8 ms·
Why does the Commodore C128 perform poorly when running CP/M?
- jerf 4y agoA good reply to the "we should write more efficient code today, like we used to do in the Good Ol' Days". Inefficient code is not a new phenomenon!
- ajross 4y agoNo, but it's possible to make things harder on yourself than you need to also. CP/M had a "terminal" abstractions for some good reason, but it also means that every byte of output needs to go through functions to "handle" it[1] but then Commodore had to shoehorn that onto a video controller chip designed for a very different bus[2], making everything slower still. The C128 was... it was just a bad computer, I'm sorry. This was the swan song for the 8 bit machine, the market was moving very rapidly onward in 1985 as it was released (within 3 years or so it would be routine to see new personal devices quoted with multiple megabytes of fully addressable RAM and 256kb+ color framebuffers). Commodore threw together what they could to keep the C64 band together for one more tour, but... let's be honest, their last album sucked. [1] vs. software for contemporary PC's that had largely abandoned the equivalent MS-DOS abstractions and was blasting bytes straight into the MDA or CGA text buffers. You could technically do that on the 128 also, but that would mean losing compatibility with a decade of CP/M software designed for other terminals, which was the only reason for having the Z80 there in the first place. [2] The 6502 had an essentially synchronous bus where the data resulting from the address lines latched at the rising edge of the clock was present when the clock fell. The Z80 had a 3-cycle sequence that needed to be mediated by glue logic to fit what the VIC-II was expecting, and it didn't fit within a single cycle. That's the reason for the Z80 having to run at "half speed", essentially.
- csixty4 4y ago> Commodore threw together what they could to keep the C64 band together for one more tour, but... let's be honest, their last album sucked. Exactly! Bil Herd said it was just supposed to get them through a year until the Amiga picked up. Nobody expected the 8-bit line to last so long with a multitasking multimedia powerhouse out there for under $1000.
- UncleSlacky 4y agoAmstrad managed to keep selling 8-bit CP/M machines as (semi) dedicated word processors well into the 90s: https://en.wikipedia.org/wiki/Amstrad_PCW https://en.wikipedia.org/wiki/Amstrad_PCW
- pkaye 4y agoI had an PCW for ages. My dad got it so I could write up school reports. Screen was pretty crisp text. Main drawback is it uses a 3" floppy which was hard to find. Also only after purchase did I realize it was not IBM compatible.
- ajross 4y agoCommodore kept selling the 64C until it entered chapter 11 in 1994, actually. It was the 128 that was an embarassing dead end, but the 64 had a huge base of software and there was still a market for a dirt cheap TV-connected home device for all the purposes for which it was ever useful. It's hard to remember how fast things changed in the early era of computing. The killer app that finally put the knife in the 8 bit home computer was... the web browser.
- forinti 4y agoIndeed, we went from ZX81 in 1981 to Amiga in 1985. Every new project was obsolete or nearly so at launch.
- jerf 4y ago"Commodore threw together what they could to keep the C64 band together for one more tour, but... let's be honest, their last album sucked." I've sometimes seen people say "Oh, modern computing sucks so much, if only the Commodore line had continued on and been the basis for computing instead of the IBM line"... and I have no idea what they mean. Even the Amiga may have been neat for the time, but trying to project that line forward all the way into 2022... well, whatever would have gotten here probably wouldn't be all that different than what we have now. Commodore did some interesting things. They lost for reasons, though. Even the Amiga.
- NovaVeles 4y agoWhile the Amiga was impressive in the 80's, they failed to continue on that path of technical innovation. The technical lead they provided simply vanished by having everyone else move forwards just a little bit faster than they were. Thus the inevitable erosion of their space. By the mid 90's there was little compelling that gave the Amiga an advantage and thus they had their lunch eaten. I suspect if we were to project the Amiga forward to today it would have actually meant us being in a worse place than we are today. In the same way if we had of waited for Silicon Graphics to provide desktop 3D graphics, we would have been waiting for a LONG time and at a high price.
- rbanffy 4y ago> waited for Silicon Graphics to provide desktop 3D graphics OTOH, we wouldn't need to put up with Windows for so long ;-)
- lproven 4y agoSir is aware that SGI made Windows NT workstations, right? They were lovely things, too. I wish I'd bought one when PIIIs were being flogged off. https://wiki.preterhuman.net/SGI_Visual_Workstation https://wiki.preterhuman.net/SGI_Visual_Workstation
- tssva 4y ago> While the Amiga was impressive in the 80's, they failed to continue on that path of technical innovation. The US market was the largest computer market at the time and the Amiga sales in the US were awful. This left Commodore financially incapable of continuing on the path of technical innovation. Even in the few countries where the Amiga could have been considered a success, UK, Germany and Italy, the vast majority of sales were for the low end and margin A500.
- Baeocystin 4y agoI mean... You're not objectively wrong when looking at it overall. I pretty much never used CP/M mode besides a few times for WordStar. But 14-year-old me loved his tremendously. 80-column mode felt so futuristic! BBSes looked amazing! And BASIC 7 was a lot more fun than BASIC 2. I felt like I was getting away with something when I learned I could enable 2MHz mode in subroutines, and if they were fast enough, the screen wouldn't even flicker before I reverted to VIC-capable speeds. Good times.
- _the_inflator 4y agoAs much as I loved my C128 D, I only used C128 mode to enter „GO64“.
- apetersonBFI 4y agoI used 128 mode to learn basic. But everything else was in 64. 7 cities of gold and Archon especially.
- forinti 4y agoAlmost all 8-bit micros were hacks made to be as cheap as possible. Commodores were no exception.
- ajross 4y agoIn 1985, sure. But even then the 64C was the cost-reduced variant, the 128 was the "fancy" 8 bit and almost 2x as expensive. But note that the 128's Z-80 CP/M processor was effectively a recapitulation of the Microsoft (yes, that Microsoft) Softcard product that they shipped in 1980 for the Apple II. The Softcard was a huge hit and an absolute revelation to the small handful of users[1] in its world. In point of fact it was the single most popular CP/M computer sold anywhere. And yet it was afflicted by most of the same problems the 128 was. Everything is about timing. Commodore happened to be five (yikes) years late to market with the idea. [1] This was just a tiny bit before my time. And in any case I grew up in an Atari 800 family and wouldn't have been caught dead with a II plus.
- classichasclass 4y agoI'll concede ill-positioned, but the 128 was the logical upgrade for 64 owners, not the Amiga. CP/M was always a tack-on to deal with the incompatibility of the CP/M 2.2 cartridge, which is why the Z80 was on the logic board in the first place (Bil Herd has explained this in detail). Your post basically says the 128 sucks because its CP/M implementation does (which I won't dispute), but the 128's native mode is a lot stronger than CP/M and you got nearly perfect 64 compatibility to boot. That wasn't "bad" as a follow-on to a stratospherically popular home computer.
- lproven 4y ago> This was the swan song for the 8 bit machine This is a common statement. It's not true. As pointed out down the comments, it was pretty much only the last 8-bit in the US market. https://news.ycombinator.com/item?id=33925871 https://news.ycombinator.com/item?id=33925871 The rest of the world carried on making 8-bits for another decade or more. New 8-bit machines and ranges of machines launched after in or after 1985: • Sinclair Spectrum +2 • Sinclair Spectrum +3 • Acorn BBC Master range • MGT SAM Coupé • Amstrad CPC Plus range • Amstrad PCW series • MSX 2 • MSX 2+ • MSX Turbo-R That's not counting 21st century reboots, of which there are hundreds. Notably, after the collapse of Communism in Europe, the West found out about legions of enhanced ZX Spectrum clones and the like from the Warsaw Pact countries. Amazing machines with built-in floppy drives, hard disk controllers, stereo sound, improved graphics, lots more RAM (megabytes of it) and so on. http://rk.nvg.ntnu.no/sinclair/computers/clones/russian.htm http://rk.nvg.ntnu.no/sinclair/computers/clones/russian.htm <- pay attention to the dates column. Some are still being made. https://www.hackster.io/news/css-electronics-zx-nucleon-is-an-eight-bit-clone-of-a-clone-designed-with-russian-software-in-mind-0695274c412f https://www.hackster.io/news/css-electronics-zx-nucleon-is-a... Note this is real hardware, not FPGA emulation or anything, although some of those are amazing too. https://github.com/UzixLS/zx-sizif-512 https://github.com/UzixLS/zx-sizif-512 I know that the USA thinks that the C128 was the last new 8-bit machine, but in fact it was only about the half way point of the evolution of 8-bit home computers, and some of the more interesting machines were yet to come. Entire families of native CP/M computers that sold in the millions of units in multiple countries. Capable home games computers with amazing graphics. Powerful educational/laboratory machines that gave rise to the ARM chip. But they weren't American, and so everyone in the USA doesn't even know that most of them existed.
- tom_ 4y agoYou forgot the Amstrad GX4000 ;) That and the SAM Coupé were kind of ridiculous, looking back, being so massively outdated at the time. In the UK, both were obviously worse for games than even the Atari ST, which was already starting to get shown up in that respect by the Amiga. (And the writing was on the wall for Amiga games too, thanks to increasingly impressive bitplane-unfriendly ALU-heavy PC games, and the SNES. And Windows 3.1 - which was actually turning out to be useful, no matter how janky - was attacking every other platform on the productivity side.) The Amstrad and Sinclair markets kept going in the UK until 1991 or so, likewise the C64, as the machines were everywhere and so there was still a market for the games. 8-bit Acorn games dried up in 1990 (after probably last being a proper going concern in 1988 at best), but they kept producing the hardware until the early 90s because of demand for it from schools. (I have a BBC Master as part of my collection of crappy old UK 8-bit computers from the period. Manufacture date: week 47, 1989!)
- robinsonb5 4y agoOr perhaps an indication that the C128 was ahead of its time! ;) Interesting that some of the slowdowns are directly attributable, even back then, to greater abstraction in the newer CP/M BDOS.
- chinabot 4y agoMaking an efficient program these days means using an efficient stack, working with threads to avoid blocked code, fighting the other 100+ processes on the CPU for resources and possibly avoiding the same on a database server, possibly on the other side of the world. In many ways its a lot harder than the early 80's where you had no networks, diddnt have to worry about security and generally total control of the local OS/CPU.
- rbanffy 4y agoYou forgot the low level parts - properly using the CPU caches. Cache thrashing can make even the fastest most amazingest CPU look like a Celeron from the 90's.
- kazinator 4y agoFrom top answer: > each character is compared to every possible control character before it is decided that it isn't one That's crazy; ASCII was carefully designed to avoid this kind of shit.
- Dwedit 4y agoAh the interrupt handling a bunch of unnecessary things... Z80 has IM 2, you set a page-aligned 256 byte buffer, point the I register, enter Interrupt Mode 2, then you have your own custom interrupt handler instead of the one provided by the ROM.
- greenbit 4y agoDidn't it use the 80 column screen? It was my experience that the C128's 80 column screen was an absolute dog. I was pretty handy with 6502 assembly language but trying to get anything onto that screen was just disappointingly slow. Maybe I was doing it wrong, but it seemed like you had to put every last screen address into that display controller, and that controller itself required you to select register numbers before putting the values in. So just to write one character onto the actual screen required six writes into the controller chip. Adress-low-register-number into D600, screen address LSB into D601. Then address-high-register-number into D600, then screen address MSB into D601. Now you're ready to write 'A' into the actual screen buffer! So, write-data-register-number into D600 and 0x41 into D601! Do you want to put a 'B' on the screen right after that 'A'? Repeat the above - six more writes to get the 'B' showing! Why they didn't embed an auto-incrementing screen address counter in the controller is beyond reckoning. At least that way you'd only have need to set the address once, and could then leave the select register (D600) parked on the write-and-increment register, and merrily stuffed your display string into D601 with a relatively tight loop. Presumably the Z80 had to put up with the same annoying 80 column controller. That can't have helped.
- deleted 4y ago[deleted]
- dzdt 4y agoThe hardware designer of the C128 (Bil Herd) had lots of choice things to say about the designer of that 80 column (MOS 8563) chip. The chip and machine were designed in parallel but the 8563 was originally intended for a different application and its designer had little consideration for making it work well in the system it ended up in. Though to be honest the weaknesses of the 8563 seem like they would make it pretty poor in any design.
- peterfirefly 4y ago> Why they didn't embed an auto-incrementing screen address counter in the controller is beyond reckoning. They did. Page 361 of the Commodore 128 Programmer's Reference Guide (halfway down the page): > At this point, the 8563 hardware takes over. It automatically increments the address contained in the update register pair (R18, R19). You as the programmer do not increment the update register pair's contents; the 8563 chip does this for you automatically. You can say that the update register pair is auto-incrementing. You can get the ProgRef here: https://www.pagetable.com/docs/Commodore%20128%20Programmer's%20Reference%20Guide.pdf https://www.pagetable.com/docs/Commodore%20128%20Programmer'...
- myrandomcomment 4y agoSo I had a C128D (replacement for C64, which was replacement for VIC20). I had also used a few CP/M machines at this point. I know why they put the Z80 in the 128 but I always felt it was just a stupid thing that the PM/Marketing team should have been told, NO. It would have reduced cost, shipping date, etc. This is a prime example where marketing made the decision without having a real compelling business case for doing so. They could have said 100% C64 compatible with and * that said, sorry no CP/M cartridge support and it would have been just fine.
- snvzz 4y agoPeople don't believe me when I tell them Amiga ended up in the worst possible hands. This is something to point them to.
- spullara 4y agoIf I remember right, the team that made the Amiga was the Atari 400/800 team and the team that made the Atari ST was the Commodore 64/128 team.
- cmrdporcupine 4y agoSort-of. Jay Miner (Amiga chipset) did work on the chipset in the Atari 8-bits. And Shiraz Shivji (Atari ST designer) did work on the C64. But the sets don't intersect with all the other people, just some of them. There's not a lot in common between the ST and the C64 other than "rock bottom price" and "multiplex the memory BUS between the CPU and the VDP" (VICII/Shifter). The C64 laid in heavily on accelerating video via a custom chip (a bit like the Amiga and Atari 8 bits) but the ST's video was really just "spew a bitmap out of RAM." Don't get me wrong, I loved my ST.
- StillBored 4y agoThe whole slow IO library, was a problem in a lot of places and spawned the nansi.sys/etc utilities on dos too. That is because the DOS console output services were generally a lot slower than could be accomplished with a bit of hand spun assembly running out of RAM. So instead of going through ansi.sys + BIOS int 10 it was possible to hook the output int (21,2 IIRC) and dump right to the text framebuffer tracking little more than the current color and cursor position. It was so easy I wrote my own at one point (before I discovered/got nansi.sys? I can't remember the sequence). It was IIRC faster than the later nansi sys replacements but didn't work 100% of the time either. Probably because I only implemented the common subset needed to run a couple programs I wanted faster text output from. I remember for a while switching back and forth between mine and a replacement driver depending on application before I got a 486+VLB which was so fast that I could no longer tell the difference between the two.
- rep_lodsb 4y agoMost full-screen programs wrote directly to video memory anyway. It's mainly the ones ported from UNIX that needed an ANSI driver. Now in the glorious future of 2022, every console app runs on an emulated DEC VTxxx, and if you press "Esc" it can't be sure if that's a real key or part of some control sequence unless it waits a second to find out if more bytes arrive.
- Axien 4y agoWas CP/M actually widely used on the C64? I always thought it was marketing to sell machines but never was actually delivered.
- manv1 4y agoMy response: the C128 ran CP/M? Really?