Home > Mobile >  Does the Intel 64 and IA-32 Architectures Software Developer's Manual Description of OUT Instru
Does the Intel 64 and IA-32 Architectures Software Developer's Manual Description of OUT Instru

Time:02-19

In Volume 2, CHAPTER 4 INSTRUCTION SET REFERENCE, M-U, the description of OUT Instruction has this sentence:

"using the DX register as a source operand allows I/O ports from 0 to 65,535 to be accessed."

I think when using OUT instruction, the DX register is specify the IO port not the source operand.

CodePudding user response:

What the manual attempts to say is true, even if the wording is a bit unclear.

When using an immediate parameter to specify the port number (like OUT imm8, AX), you are limited to ports 0-255 as the immediate operand is 8 bits.

When using DX to specify the port number (like OUT DX, EAX), all 65536 ports can be used.

The term 'source operand' is a bit misleading, as in the above example, the contents of EAX are output to the port specified by DX. So, the contents of DX specify the destination port number.

  • Related