First page Back Continue Last page Overview Graphics
Complex Branch Instructions
- BGE (Branch if Greater than or Equal) branches if NV equals zero. Examine the problems in the notes below.
- BGT (Branch if Greater Than) branches if Z+(NV) equals zero.
- BLE (Branch if Less than or Equal) branches if Z+(NV) equals one.
- BLT (Branch if Less Than) branches if NV is equal to 1.
Normally these branch instructions follow a compare instruction. The instruction operation treats the numbers as though they were signed. The value +1 (01h) would be considered a larger value than -1 (0ffh). Multiple condition code bits are examined by these instructions to determine whether a branch is necessary.
The BGE instruction branches if the value in the accumulator is greater than or equal to the value in the operand. For the exclusive OR of N with V to result in a zero, both N and V can be one or both N and V can be zero. Examine the following possibilities and determine if the BGE instruction would branch by considering the flags
1h - 0ffh
1h - 7fh
0ffh - 1h
7fh - 1h
1h - 1h
The BGT instruction branches if the accumulator is greater than the value in memory, BLE branches if the accumulator is less than the value in memory and BLT branches if the accumulator is less than the value in memory.