Hardware manual
Microcomputer Technical Q&A
20
Q&A No.: QAH8S-018
Category: Instruction
Subject: BOR and BIAND Instructions
Question
How are bit-manipulation instructions such as BOR and BIAND used?
Answer
These instructions are used to branch after looking at a number of flags. An example of their use is
shown below.
START
NEXT L1
Bit n of IN1 = 0?
Bit n of IN2 = 0?
No
No
Yes
Yes
Example: To branch to L1 when IN1 flag = 1 and IN2 flag = 0
Using BOR/BIAND Not Using BOR/BIAND
BLD #n,@IN1
BIAND #m,@IN2
BCS L1
BTST #n,@IN1
BNQ NEXT
BSET #m,@IN2
BNE NEXT
BRA L1
NEXT:
10 bytes/8 states 14 bytes/10 states