IN r,(C)

Operation

r <- (C)

Mnemonic

IN

Operands

r,(C)

b7b6b5b4b3b2b1b0
1 1 1 0 1 0 1 1$ED
0 1 r 0 0 0

Description

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 B are placed 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 register r in the CPU. Register r identifies any of the CPU registers shown in the following table, which also indicates the corresponding 3-bit r field for each. The flags are affected, checking the input data.

RegisterrHex
B000$40
C001$48
D010$50
E011$58
H100$60
L101$68
Flag110Undefined op code; set the flag
A111$78

Condition Bits Affected

Sis set if result is negative, otherwise it is reset.
Zis set if result is 0, otherwise it is reset.
His reset.
P/Vis set if parity is even, otherwise it is reset
Nis reset.
Cis not affecte.

Example

Register C contains $07, Register B contains $10, and byte $7B is available at the peripheral device mapped to I/O port address $07. Upon the execution of

	IN	D,(C)

the D Register contains $7B.