JR cx,label
Jump Relative
Rabbit 4000/5000 Instruction
|
| ---- |
JR cx,label JR cx,mn1 |
if {cx} PC = PC2 + e |
| A0 e |
JR GT,mn |
if {GT} PC = PC + e |
| B0 e |
JR LT,mn |
if {LT} PC = PC + e |
| A8 e |
JR GTU,mn |
if {GTU} PC = PC + e |
| B8 e |
JR V,mn |
if {V} PC = PC + e |
1
The 16-bit constant mn is the destination logical address of the jump.
2
The value of PC after the instruction fetch.
|
Description
If condition cx is true, this instruction transfers control to the specifed address. The address is specified
by a label or logical address. The assembler translates the label or logical address "mn" to an 8-bit signed
displacement value, "e".
The displacement value "e" is relative to the address of the first byte of the instruction following JR. This
fact is because the processor calculates the new PC value after it increments the PC for the instruction
fetch of JR. If condition cx is false, PC is incremented normally.
|
|
|
True when Z is 0 and L/V and S are either both 1 or both 0. |
|
|
True when either S or L/V is 1. |
|
|
True when C and Z are both 0. |
|
|
True when L/V flag is set: there is overflow. |
Note that the relative jump has a limited range of [-128, 127] from the address of the first byte of the
instruction following the JR instruction.