Instruction Set
4-67
IN
Input Component from Port
IN
What It Does
IN copies a component from a port in I/O space to a register.
Syntax
Description
IN transfers a data byte or word from the port numbered by the second operand (
port) into
the register (AL or AX) specified by the first operand (
destination). Access any port from 0
to 65535 by placing the port number in the DX register and using an IN instruction with the
DX register as the second operand. The upper eight bits of the port address will be 0 when
an 8-bit port number is used.
Operation It Performs
Flag Settings After Instruction
Form
Opcode
Description
Clocks
Am186 Am188
IN AL,
imm8
E4
ib
Input byte from immediate port to AL
10
10
IN AX,
imm8
E5
ib
Input word from immediate port to AX
10
14
IN AL,DX
EC
Input byte from port in DX to AL
8
8
IN AX,DX
ED
Input word from port in DX to AX
8
12
IN
destination,port
if (size(
port) == 8)
/* extend port address */
port = 0x00FF & port;
/* move component */
destination = [port];
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
–
–
–
–
–
– res – res – res –
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...