I



The I/O instructions in the X86 instruction system are IN/OUT instructions. The function of the IN instruction is to input (read) data from the I/O port to the accumulator of the microprocessor, and the function of the OUT instruction is to output (write) the data in the accumulator of the microprocessor to the I/O port.

The addressing mode of IN/OUT instruction has two kinds of direct addressing and indirect addressing. When the port address is <=0FFH, the direct addressing mode is adopted. When the port address>0FFH, the indirect addressing mode should be adopted, and DX is used as the I/O indirect address register, and the I/O port address is stored in DX. Of course, indirect addressing is also possible when the port address <=0FFH. IN/OUT instructions can only transfer information between the port and the AL register or between the port and the AX register. The choice between Al and AX depends on the number of bits of the port and the width of the data bus.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP