A86: Faster way (_ldhlind)?


[Prev][Next][Index][Thread]

A86: Faster way (_ldhlind)?




Does anyone know how the rom call _ldhlind work?  It effectively does this
operation:

ld hl,(hl)

This is useful when hl points to a pointer, and you want it to point to the
data pointed to by that pointer (I hope you understood that, because I
didn't).  What I came up with is below and worked out well because I needed
to de to have the old pointer anyway, but is there a better routine (that
doesn't destroy other regs)?

 ld d,(hl)	; 7T
 inc hl	; 6T
 ld e,(hl)	; 7T
 ex hl,de	; 4T
		;==== 24 t-states, HL = (HL), DE = HL + 1
		
Thanks,

--
David Phillips
mailto:electrum@tfs.net
ICQ: 13811951
AOL/AIM: electrum32


Follow-Ups: