cpu

Was 8-bit Atari (6502) faster than IBM PC (8088)?

  • by

I was silent for a while as some things required my attention more than old computers. We extended the list of implementations of our Sieve Benchmark and it now supports even 6502. It was developed on Atari 800XL without any modern hardware or software (it’s written in ATMAS II macro-assembler). And it was a pain.

We all remember the lovely days of being young and playing with these simple computers, where programming was often the best way to spend time. These nostalgic memories don’t say the truth how horribly inefficient the development was on these machines in comparison with what came a decade later. David told me that his productivity was about 20 times lower in comparison with developing an assembly program of similar complexity and size on PC. These were one of the biggest reasons for your entertainment:

  • It was easy to fill whole available memory with the source code text. There was a situation when only 100 characters could be added to the text buffer, but about 2000 were needed. That caused that multiple parts were optimized for source code length (except, of course, the sieve routine itself, which was optimized for speed).
  • At the end, it was necessary to split the source code into two parts anyway.
  • Unlike with PCs, the Atari keyboard doesn’t support roll-over on standard keys. It is necessary to release the key before pressing another one (otherwise the
    key-press is not properly recognized).
  • Having a disk drive was a big advantage over tapes. However, the implementation on Atari was very slow and everything took incredible amount of time. Boot into editor? 20 seconds. Loading the first part of the source code? 5 seconds. Loading the second part? 30 seconds. Storing it back? 60 seconds (for just 17 KB). You needed about 160 seconds before trying to run the program after every larger change (including 20 seconds for compiling). Often a minute
    more if the program crashed the whole computer.

Although David never started to use “modern” features like syntax highlighting and code completion and he still programs mostly in the 80×25 text-mode, he said that this was too much for him so I don’t think we will repeat this again soon.

Regarding the results: A 1.77-MHz MOS 6502 in Atari 800XL/XE (PAL) required about 66 CPU cycles to go through a single inner-loop step. If graphics output was disabled during the test, this decreased to just 49 CPU cycles. A 4.77-MHz Intel 8088 needed about 73 CPU cycles to do the same. Thus, 6502 is faster if running on the same clock.

On the other side, the original IBM PC is clocked 2.7x higher than the Atari and 4.7x higher than other important 6502 machines (Apple IIe, Commodore 64). Thus, IBM PC was at least twice as fast in this type of tasks (similar to compiling, XML parsing…). I’m not surprised, but it is nice to see the numbers.

Interestingly, the heavily optimized assembly code running on Atari provides the same performance as compiled BASIC (MS QuickBasic 4.5) running on 20MHz 386DX (interpreted version would be three times slower). This was one of the fastest BASICs out there so it gives you good perspective on how these high-level languages killed the performance back then. David spent a lot of time optimizing the code for both CPUs and used the available tricks for each architecture (like self-modifying code…). If you feel that your favorite CPU should have been faster, you can download the project folder and check the source code. If you create a faster version, please send it to me (but please read the README first, especially the part called “Allowed tricks”).

Also if somebody is able to port the code to Commodore 64, it would be nice to compare the results with Atari (only the disk access, timer and console input/output need to be rewritten). Any expert/volunteer?

Sieve Benchmark download

Mobile CPU Upgrades

  • by

Siemens-Nixdorf PCD-4ND is a 486-based laptop from 1993-1995. It was quite popular in Germany and you could have seen a few of them still in use even ten years ago (mostly connected to expensive industrial devices using a serial port).

I like how easy it was to upgrade the CPU in this particular laptop. It took about 20 seconds to remove a small plastic cover and replace the CPU board. There were probably four options during the lifecycle of the machine – 25-MHz 486SX, 50-MHz 486DX2 and 75-MHz/100-MHz 486DX4 (Intel called it ‘Intel DX4’).

Note the WDC graphics chip below the CPU board slot. It shared the bus with the CPU as it was connected using VLB (= VESA Local Bus) instead of the older ISA/AT bus. This allowed to use fast 32-bit transfers on a frequency equal to the CPU external clock (25/33-MHz) without a sophisticated bus controller (EISA, PCI). This chip was used in many laptops of this era and it was surprisingly powerful. It allowed up to 1024×768 with 256 colors and 640×480 with 65k colors and it could accelerate bit-block transfers as well as graphics primitives.