Z8 Microcontrollers
Instruction Descriptions and Formats ZiLOG
12-36 UM001601-0803
JR
JUMP RELATIVE
JR
Jump Relative
JR cc, dst
Instruction Format:
Operation:
If cc is true, PC <— PC + dst
If the condition specified by the “cc” is true, the relative address is added to the PC and control passes to the
instruction located at the address specified by the PC (See Section 12.3 for a list of condition codes). Otherwise, the
instruction following the JR instruction is executed. The range of the relative address is +127 to –128, and the
original value of the PC is taken to be the address of the first instruction byte following the JR instruction.
Example:
If the result of the last arithmetic operation executed is negative, the next four statements (which occupy a total of
seven bytes) are skipped with the statement:
JR Ml, #9
Op Code: 5B 09
If the result was not negative, execution would have continued with the instruction following the JR instruction.
Example:
A short form of a jump –45 is:
JR #–45
Op Code: 8B D3
The condition code is “blank” in this case, and is assumed to be “always true.”
dst
Cycles
OPC
Address Mode
(Hex)
dst
12 if jump taken
10 if jump not taken
ccB
cc = 0 to F
RA
cc OPC
Flags: C: Unaffected
Z: Unaffected
S: Unaffected
V: Unaffected
D: Unaffected
H: Unaffected