Testing if an entire register is 0 on the pic

Status
Not open for further replies.

bitem2k

New Member
Is there anyway of telling if the entire register byte is 0, instead of checking each bit individually?

i,e check if all bits of a port are off.

many thanks
 
Yes, various ways of doing it - probably the easiest is movf it to W, and check the zero flag.
 
Another way would be to move the file into itself with mov File,F. This instruction does nothing except set the zero flag if the file is zero.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…