Re: A85: Complement the Z flag?


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

Re: A85: Complement the Z flag?



Dines Justesen wrote:
> 
> >He is using the zero flag as an error flag on the return from a routine.
> >Let's say that
> >at one place in his routine, the zero flag would be RESET if there were
> >an error. How does he fix this? He needs to do a
> >
> >czf
> >ret z
> 
> You can do a RET NZ ! RET,JP,CALL and JR all supports both NZ and Z
> (according to Programming the Z80 by Rodney Zaks). Thats why i can not see
> when you need a czf.

But he wants to set the zf for an error...if he ret nz then it will
return with zf reset, and the program won't know an error happened.

-- 
Terry Peng <tpeng@geocities.com>


References: