INSB inputs a byte from the I/O port specified in DX and
stores it at [ES:DI] or [ES:EDI]. It then increments or
decrements (depending on the direction flag: increments if the flag
is clear, decrements if it is set) DI or EDI.
The register used is DI if the address size is 16 bits, and
EDI if it is 32 bits. If you need to use an address size not
equal to the current BITS setting, you can use an explicit
a16 or a32 prefix.
Segment override prefixes have no effect for this instruction: the
use of ES for the load from [DI] or [EDI] cannot be
overridden.
INSW and INSD work in the same way, but they input a word or
a doubleword instead of a byte, and increment or decrement the
addressing register by 2 or 4 instead of 1.
The REP prefix may be used to repeat the instruction CX (or
ECX - again, the address size chooses which) times.
See also OUTSB, OUTSW and OUTSD (OUTSB).