Truncated match.
PICList
Thread
'test accumulator for zero'
1997\01\05@211049
by
Brad Pousland
What is the best way to test if the accumulator is zero?
Respectfully,
Brad
1997\01\05@213132
by
Wireless Scientific
At 09:15 PM 1/5/97 -0500, Brad Pousland wrote:
>What is the best way to test if the accumulator is zero?
add zero then check zero flag, is that one way of doing that?
I actually learned that at a Microchip seminar. If that's wrong, then
I didn't learn that at a Microchip seminar.
craig
1997\01\05@213716
by
John Payson
> What is the best way to test if the accumulator is zero?
If you have not just done an instruction which sets the Z flag (in which
case testing the Z flag will give you the answer) your best bet is most
likely "IORLW 0" followed by testing the Z flag. If you have a spare
RAM location and specifically desire not to affect the Z flag, you could
use three instructions thus:
movwf SPARE
incfsz SPARE
decfsz SPARE
do_something
If do_something is executed, then the accumulator was not zero. Note that
the incfsz instruction was chosen because it performs an increment without
affecting any flags.
1997\01\05@222330
by
John Payson
> >What is the best way to test if the accumulator is zero?
>
> add zero then check zero flag, is that one way of doing that?
That works, but it clears the carry flag. If you want the carry flag
cleared, that's fine, otherwise it's not so great. Normally I would use
IORLW 0; that leaves carry alone.
1997\01\06@103248
by
myke predko
>> >What is the best way to test if the accumulator is zero?
>>
>> add zero then check zero flag, is that one way of doing that?
>
>That works, but it clears the carry flag. If you want the carry flag
>cleared, that's fine, otherwise it's not so great. Normally I would use
>IORLW 0; that leaves carry alone.
AND it has the advantage of working in both the 12 and 14 bit PICs.
myke
"There are only three kinds of economists in the world. Those who can count
and those who can't." - Eddy George, governor of the Bank of England
1997\01\06@195739
by
Eduardo J. Martinez Velez
part 0 644 bytes
----------
De: Brad Pousland[SMTP:spam_OUTbpouslanTakeThisOuT
MOLE.UVM.EDU]
Enviado: domingo 5 de enero de 1997 23:15
Para: Multiple recipients of list PICLIST
Asunto: test accumulator for zero
What is the best way to test if the accumulator is zero?
Respectfully,
Brad
----------------------------
Thanks for all - Mil gracias
----------------------------
Eduardo Jorge Mart’nez VŽlez
a Asesoria
& &
s Sistematizacion
INET: .....ejmvKILLspam
@spam@satlink.com
73070.3653
KILLspamcompuserve.com
CServe: 73070,3653
2000-Rosario-SF-Argentina
TelFax: (54)(41)254561
Tel: (54)(41)8804
----------------------------
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...