Block write to port
\(\begin{rcases} (C) \longleftarrow (HL)\\HL \longleftarrow HL+1 \text{ if } D = 0\\HL \longleftarrow HL-1 \text{ if } D = 1\\B \longleftarrow B-1 \end{rcases} \text{repeat while } L=1 \And B \not = 0\)
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | ED |
1 | 0 | 1 | L | D | 0 | 1 | 1 |
D 0=Increment, 1=Decrement HL
after each iteration
L If set then if \(B \not = 0\) then \(PC \longleftarrow PC-2\) so that the instruction is repeated.
The contents of Register C are placed on the bottom half (A0…A7) of the address bus to select the I/O device at one of 256 possible ports.
Register B can be used as a byte counter, and its contents are placed on the top half (A8…15) of the address bus at this time.
Then one byte from the address pointed to by HL
is placed on the data bus and written to the port.
Finally, the byte counter is decremented and register pair HL is incremented.
Flags Affected
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
z | set if B = 0, always true for repeat operations | ||||||||
n | set |
Opcode Matrix
Increment | Decrement | |
---|---|---|
Single |
OUTI
EDA3216 |
OUTD
EDAB216 |
Repeat |
OUTIR
EDB3221 |
OUTDR
EDBB221 |
Instruction
Opcode hexSize bytesCycle count
| Special |