BEQ

From Intellivision Wiki
Jump to: navigation, search
Instruction NameBranch If Equal
Branch On Zero
MnemonicsBEQ/BZ
CP1610 Clock Cycles7 or 9
InterruptibleYes
Opcode Range$0201, $0221

The Branch If Equal opcode (BEQ) is a two-decle opcode that is a part of the Branch family of opcodes. It is also known by the name Branch On Zero (BZE) because a test for equality is functionally equivalent to a test for a zero result. Essentially, to test equality, the CMP type of operations subtract operand #2 from operand #1 and if the result is zero, then the operands must be equal. This instruction causes the CP1610 to branch if the Zero Flag is set to the address specified by the following parameters.

   Format - Decle #1    Format - Word #2 (All 16 bits are significant)
   0000:0010:00d0:0100  aaaa:aaaa:aaaa:aaaa
where:
d indicates the direction of the branch such that: d == 0 indicates to branch in the forward direction d == 1 indicates to branch in the reverse direction
aaaaaaaaaaaaaaaa indicates the amount of offset

See the Branch opcode family documentation for more information.