Question

The following is a code segment to check if the error bit signal is present in register PPBase.... why is it BNZ instead of BZ? If the error bit is present and you perform ANDLW wouldn't the Z flag be lowered?

;Constants section ErrorBitMask EQU b 00001000 InitBitMask EQU b 00000100 ;; Code section MOVF PPBase+1, ANDLW ErrorBitMa

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer :- All depends upon the status bit. Is error bit signal HIGH or LOW when error is detected? As per the code, it seems that the error status bit goes LOW when error is detected. If error signal is LOW, then use of BNZ for no_error is correct. But if error status bit sets to HIGH upon error detection, then BZ must be used for no_error condition.

Z-flag will be lowered only when overall result of an instruction is non-zero.

Dear student, please give me detail about the status bit or the PPBase register to answer clearly. Thank you.

Add a comment
Know the answer?
Add Answer to:
The following is a code segment to check if the error bit signal is present in register PPBase.... why is it BNZ instead of BZ? If the error bit is present and you perform ANDLW wouldn't the Z fla...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT