2 ms·
No[0]. To read a byte through a pointer at IX, you have to: LD L,(IX+0) LD H,(IX+1) LD A,(HL) On the 6502, you can do that in one instruction[0] i
by beagle3 8y ago
No[0]. To read a byte through a pointer at IX, you have to:
LD L,(IX+0)
LD H,(IX+1)
LD A,(HL)
On the 6502, you can do that in one instruction[0] if your X or Y registers are zero (and more often than not, you can use the indexed-indirect or indirect-indexed to save even more instructions):
LDA ($40,X) ; if X == 0, and $40 is your pointer.
[0] https://8bitnotes.com/2017/05/z80-addressing-modes/ https://8bitnotes.com/2017/05/z80-addressing-modes/
[1] http://www.obelisk.me.uk/6502/addressing.html http://www.obelisk.me.uk/6502/addressing.html
- Steve44 8y agoFrom memory the IX and IY instructions took a lot of clock cycles and I avoided them unless there was a really good reason to use them. I've just had a quick look at an instruction cycle table and it seems that without indexing they took 4 cycles more than HL then with an index that increased to 12 more. Ref from search returning http://www.z80.info/z80time.txt http://www.z80.info/z80time.txt