Program Flow Instructions
How to decode program flow instructions from binary
Table of Contents
Opcode format7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 1 | D | 0 | 0 | 0 |
e-2 |
|
0 | 0 | 1 | cc | 0 | 0 | 0 | JR |
e-2 |
|
1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | JP |
7 | nn | 0 |
15 | 8 |
|
1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | RET |
|
1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | CALL |
7 | nn | 0 |
15 | 8 |
|
1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | JP (HL) |
|
1 | 1 | ccc | 0 | 0 | 0 | RET |
|
1 | 1 | ccc | 0 | 1 | 0 | JP |
7 | nn | 0 |
15 | 8 |
|
1 | 1 | ccc | 1 | 0 | 0 | CALL |
7 | nn | 0 |
15 | 8 |
|
1 | 1 | b | 1 | 1 | 1 | RST |
Conditions
cc | ccc | Abbrev |
Condition |
Flag |
00 | 000 | NZ |
Non Zero |
Z |
01 | 001 | Z |
Zero |
10 | 010 | NC |
No Carry |
C |
11 | 011 | C |
Carry |
| 100 |
PO |
Parity Odd |
P/V |
101 |
PE |
Parity Even |
110 |
P |
Sign Positive |
S |
111 |
M |
Sign Negative |
Bits
Value | b |
0 | 000 |
1 | 001 |
2 | 010 |
3 | 011 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |