A <- (n)
IN
A,(n)
b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | |
---|---|---|---|---|---|---|---|---|
1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | $DB |
n |
The operand n is 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 the Accumulator also appear on the top half (A8 through A15) of the address bus at this time. Then one byte from the selected port is placed on the data bus and written to the Accumulator (Register A) in the CPU.
None
The Accumulator contains $23, and byte $7B is available at the peripheral device mapped to I/O port address $01. Upon the execution of
IN A,($01)
the Accumulator contains $7B.