(C) <- r
OUT
(C),r
| b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | $ED |
| 0 | 1 | r | 0 | 0 | 1 | |||
The contents of Register C are placed on the bottom half (A0 through A7) of the address bus to select the I/O device at one of 256 possible ports. The contents of Register r are placed on the top half (A8 through A15) of the address bus at this time. Then the byte contained in register r is placed on the data bus and written to the selected peripheral device. Register r identifies any of the CPU registers shown in the following table, which also shows the corresponding three-bit r field for each that appears in the assembled object code.
| Register | r | Hex |
|---|---|---|
| B | 000 | $41 |
| C | 001 | $49 |
| D | 010 | $51 |
| E | 011 | $59 |
| H | 100 | $61 |
| L | 101 | $69 |
| A | 111 | $79 |
None
If Register C contains $01 and the D Register contains $5A, then upon the execution of
OUT (C),D
byte $5A is written to the peripheral device mapped to I/O port address $01.