Does anyone know a good way to negate HL? The way I'm doing it at the moment is:
ld a,h
neg
ld h,a
ld a,l
neg
ld l,a
ret
There are some undocumented instructions "XOR [HX/HY/LX/LY]" but i cant find information about them. Does anyone know what these do?
Thanks in advance.
[TI ASM] negating HL
Moderator: MaxCoderz Staff
Re: [TI ASM] negating HL
This doesn't always work. Try with 1 for example. You should just complement H and L with cpl and then increment HL.Duck wrote: ld a,h
neg
ld h,a
ld a,l
neg
ld l,a
ret
I suspect these are the lower and higher bytes of ix and iy. Sometimes they are also referred to as ixh, ixl, iyh and iyl.There are some undocumented instructions "XOR [HX/HY/LX/LY]" but i cant find information about them. Does anyone know what these do?