Intel 253666-024US Computer Hardware User Manual


 
Vol. 2A 3-467
INSTRUCTION SET REFERENCE, A-M
INS/INSB/INSW/INSD—Input from Port to String
INS/INSB/INSW/INSD—Input from Port to String
Description
Copies the data from the I/O port specified with the source operand (second
operand) to the destination operand (first operand). The source operand is an I/O
port address (from 0 to 65,535) that is read from the DX register. The destination
operand is a memory location, the address of which is read from either the ES:DI,
ES:EDI or the RDI registers (depending on the address-size attribute of the instruc-
tion, 16, 32 or 64, respectively). (The ES segment cannot be overridden with a
segment override prefix.) The size of the I/O port being accessed (that is, the size of
the source and destination operands) is determined by the opcode for an 8-bit I/O
port or by the operand-size attribute of the instruction for a 16- or 32-bit I/O port.
At the assembly-code level, two forms of this instruction are allowed: the “explicit-
operands” form and the “no-operands” form. The explicit-operands form (specified
with the INS mnemonic) allows the source and destination operands to be specified
explicitly. Here, the source operand must be “DX,” and the destination operand
should be a symbol that indicates the size of the I/O port and the destination
address. This explicit-operands form is provided to allow documentation; however,
note that the documentation provided by this form can be misleading. That is, the
Opcode Instruction 64-Bit
Mode
Compat/
Leg Mode
Description
6C INS m8, DX Valid Valid Input byte from I/O port specified in DX
into memory location specified in ES:(E)DI
or RDI.*
6D INS m16, DX Valid Valid Input word from I/O port specified in DX
into memory location specified in ES:(E)DI
or RDI.
1
6D INS m32, DX Valid Valid Input doubleword from I/O port specified
in DX into memory location specified in
ES:(E)DI or RDI.
1
6C INSB Valid Valid Input byte from I/O port specified in DX
into memory location specified with
ES:(E)DI or RDI.
1
6D INSW Valid Valid Input word from I/O port specified in DX
into memory location specified in ES:(E)DI
or RDI.
1
6D INSD Valid Valid Input doubleword from I/O port specified
in DX into memory location specified in
ES:(E)DI or RDI.
1
NOTES:
* In 64-bit mode, only 64-bit (RDI) and 32-bit (EDI) address sizes are supported. In non-64-bit
mode, only 32-bit (EDI) and 16-bit (DI) address sizes are supported.