Re: A85: Complement the Z flag?


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

Re: A85: Complement the Z flag?



Michael Pearce wrote:
> 
> Does anyone know of a good way to complement the zero flag?

Interesting problem indeed... although I can't really see when
that's necessary.

push af
ex (sp),hl  ; to preserve HL
ld a,%01000000  ; Z flag is the 6th bit in the F register
xor l  ; L = previous F register
ld l,a
ex (sp),hl
pop af ; 8 bytes

No registers or flags are changed, except the Z flag.

-- 
Jimmy Mårdell                "The nice thing about standards is that 
mailto:mja@algonet.se         there are so many of them to choose from."
http://www.algonet.se/~mja    
IRC: Yarin                   "Sanity? I'm sure I have it on tape
somewhere!"


Follow-Ups: References: