S3F84B8_UM_REV 1.00
6.3.34 JR — JUMP RELATIVE
cc,dst
JR
If cc is true, PC PC + dst.
Operation:
If the condition specified by condition code (cc) is true, then relative address is added to the
program counter and control is passed to the statement whose address is now in the program
counter; otherwise, the instruction following the JR instruction is executed. (See list of condition
codes).
The range of relative address is from +127 to –128. The original value of the program counter is
the address of first instruction byte following the JR statement.
No flags are affected.
Flags:
Format:
(NOTE)
cc | opc
In the first byte of the two-byte instruction format, the condition code and the opcode are each four bits.
NOTE:
Given the carry flag = "1" and LABEL_X = 1FF7H:
Example:
JR
If the carry flag is set (that is, if the condition code is true), the statement "JR C,LABEL_X" will
pass control to the statement whose address is now in the PC. Otherwise, the program instruction
following the JR will be executed.
dst
C,LABEL_X
Bytes
2
PC = 1FF7H
6-47
6 INSTRUCTION SET
Cycles
Opcode
(Hex)
6
ccB
cc = 0 to F
Addr Mode
dst
RA