Re: LZ: Help with a routine


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

Re: LZ: Help with a routine



On Fri, 20 Sep 1996, Jimmy Mardell wrote:


> Mattias Lindqvist wrote:
> > 
> > On 19 Sep 96 at 22:42, Ed Plese, Jr. wrote:
> > 
> > > Actually, I think that if the bit is set, it will set the ZERO
> > > flag, but if it is cleared, then it will clear the Z flag (indicating
> > > nz).
> > 
> > No, the zero flag indicates that something is zero. Therefore if the
> > bit's cleared (meaning it's zero) the Zero flag will be set!
> > 
> 
> Nonono... bit COPIES the bit into the zero flag, and if the bit is set,
> the zero flag will also be set (1=flag set, 0=flag reset in the flag
> register). It's backwards and may be a reason for bugs in programs.


According to Rodney Zaks' book the BIT instruction tests a bit
and sets the zero condition code accordingly.  That's the same
phrase he uses in other instructions to say it's set 1 if it's
0 and 0 if it's not.


Barry


References: