I believe something as simple as a memory copy would be faster on the CP-1610, if you measured in bytes/sec. Here's two loops. The 6502 version below is limited to a maximum 128 byte copy, and I assume you can do the copy "backwards" for it, to merge your index register with the loop counter, which requires a "pre-decrement" and to terminate at -1 rather than 0 because LDA sets flags...
Yeah, the best thing about the CP1610 is that it just seems to simplify programming. It may not be very fast, but it seems a lot easier to implement more complex algorithms. It would be interesting to do a comparison to see what operations the CP1610 could do faster at its lower clock rate than the 6502 or Z80, for example.
; CP-1610 version
loop: MVI@ R4, R0 ; 8 cycles
MVO@ R0, R5 ; 9 cycles
DECR R1 ; 6 cycles
BNEQ loop ; 9 cycles
; 6502 version. Assume 'src' ptr is in ($10), 'dst' ptr is in ($12),
; and X is number of bytes to copy.
DEX ; pre-adjust X so ($10),X points to last byte
loop: LDA ($10), X ; 5 cycles
STA ($12), X ; 6 cycles
DEX ; 2 cycles
BMI loop ; 3 cycles
So, it takes CP-1610 32 cycles for the Intellivision to copy 2 bytes, and 16 cycles for the 6502 to copy 1 byte. At the same clock rate, they copy at the same rate in bytes per second. But, consider all the provisos that come with the 6502 version, such as being limited to 128 bytes, etc. And if you unroll even just one time, the advantage starts to tip toward the CP-1600 (24.5 cycles/byte vs. 27 cycles/byte).
(Ok, I expect a 6502 expert to tell me all the ways I screwed up in 3... 2... 1...)
On the other hand, I like the 6502 because there simply aren't a lot of ways to do things so you don't have to spend a lot of time juggling registers and figuring out how to optimize something. And it has that nifty zero page that shrinks the instruction size and speeds it up a bit.
The zero-page isn't just nifty. It's a necessity, since there aren't enough registers. :-) The ZP is
your register set.
The Z80 is overly complicated, but it does in fact have 16-bit registers and some 16-bit instructions. I particularly like the stack instructions since you can push and pull 16 bit values quite quickly – I use this technique for my Intellivision for Gameboy Color emulator to quickly grab new opcodes from the game ROMs.
I admit my brief brush with it stuck largely to the 8080 subset, which I believe only has HL (sometimes called "M").
The 8048 is a piece of junk, in my opinion. What, a 256 byte address space and something like a 16 byte stack? It does have two register sets, but this is a very, very limited processor. I can't believe they chose this as the main CPU for the Odyssey 2. Fortunately, it's kind of speedy… It was good enough to generate the waveform data for DK's sound.
It's a reasonable microcontroller meant mainly for tasks such as scanning a keyboard or controlling simple children's toys. It was stretched beyond those limits in the O2. The 8051 is a bit nicer and even has an external fetch mode. (I don't remember if the 8048 does.)
Edited by intvnut, Wed May 2, 2012 6:35 PM.