3 ms·
but I gather that the IX and IY index registers were added to it to address similar limitations in the 8080 architecture The 8080 was much better than the 6502
by PhantomGremlin 8y ago
but I gather that the IX and IY index registers were added to it to address similar limitations in the 8080 architecture
The 8080 was much better than the 6502 in terms of 16-bit registers, even without IX and IY.
The architecture was:
A an 8 bit accumulator
B C two 8 bit regs or combined 16 bit
D E two 8 bit regs or combined 16 bit
H L two 8 bit regs or combined 16 bit
I did a lot of Z80 programming and I usually ignored IX and IY. They were useful for certain things. But they were slower than the 8080's registers, because IIRC they needed an extra opcode byte.
The Z80 did, however, add lots of neat stuff that used the existing 8080 architecture registers.
E.g., here's a single instruction equivalent of today's memmove() Unix library function. Do this:
BC <-- stuff a 16 bit count into it
DE <-- stuff a 16 bit destination address into it
HL <-- stuff a 16 bit source address into it
then do the LDIR instruction and you get a memory copy in a single instruction. Up to 64 K bytes, which was the entire address space.
IIRC the instruction was interruptible on a byte-by-byte basis, so it's not like you ruined your interrupt response time.
- flohofwoe 8y ago> IIRC the instruction was interruptible on a byte-by-byte basis, so it's not like you ruined your interrupt response time. Yes, LDIR is basically the same as the LDI instruction with the little difference that the PC is reset to the start of the LDIR instruction until BC is 0. It's basically a microcoded LDI+conditional jump, and interrupt handling, DRAM refresh etc... happens at each step, since from the CPU's point of view, it's just executing a lot of single instructions while LDIR is running.