Decoding ED Prefix
How the ED instruction prefix works
Instructions with the ED prefix consist of instructions that are not used as often as those in the main group.
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
---|---|---|---|---|---|---|---|---|---|
0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | NEG | |
0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | RETN | |
0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | RETI | |
0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ||
0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | IM2 | |
0 | 1 | 0 | x | 0 | 1 | 1 | 0 | IMx | |
0 | 1 | 0 | x | 0 | 1 | 1 | 1 | LD | |
0 | 1 | 0 | x | 1 | 0 | 0 | 0 | LD | |
0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | RRD (HL) | |
0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | LD | |
0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | RLD (HL) | |
0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | ||
0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | OUT (C) A | |
0 | 1 | x | x | 0 | 0 | 1 | 0 | SBC | |
0 | 1 | x | x | 1 | 0 | 1 | 0 | ADC | |
0 | 1 | x | x | x | 0 | 0 | 0 | IN r (C) | |
0 | 1 | x | x | x | 0 | 0 | 1 | OUT (C) r | |
0 | 1 | x | x | x | 0 | 1 | 1 | LD | |
1 | 0 | 1 | x | x | 0 | 0 | x | Block Memory | |
1 | 0 | 1 | x | x | 0 | 1 | x | Block IO |
Last modified November 16, 2021: Optimise decoding pages (f08ceb7)