JR cc,e

Jump e relative on condition.
Function: if cc true, PC <- PC + e
 
Format:
001c c000
 
byte 1
 
<-- e-2 -->
 
byte 2: offset value
 
Description: If the specified condition is met, the given offset value is added to the program counter using the two's complement arithmetic so as to enable both forward and backward jumps. The offset value is added to the value of the PC + 2 (after the jump). As a result, the effective offset is -126 to +129 bytes. The assembler automatically subtracts the value PC + 2 from the source offset value to generate the hex code. If the condition is not met, the offset value is ignored and instruction execution continues in sequence. cc may be any one of:
NZ
00
Z
01
NC
10
C
11
Data Flow:
 
Timing:
M cyclesT statesusec
@ 2 MHz
condition
met:
3126
condition
not met:
273.5
 
Addressing Mode: relative
 
Byte Codes:
JR   cc,e
cc:NZZNCC
20283038
 
Flags:
 
(no effect)
 
Example:
JR NC,$ - 3
$ = current PC
 

OBJECT CODE
Before:
 
After: