13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24594 Rev. 3.10 February 2005 AMD64 TechnologyINInput from PortTransfers a byte, word, or doubleword from an I/O port (second oper<strong>and</strong>) to the AL,AX or EAX register (first oper<strong>and</strong>). The port address can be an 8-bit immediate value(00h to FFh) or contained in the DX register (0000h to FFFFh).The port is in the processor’s I/O address space. For 8-bit I/O port accesses, the opcodedetermines the port size. For 16-bit <strong>and</strong> 32-bit accesses, the oper<strong>and</strong>-size attributedetermines the port size. If the oper<strong>and</strong> size is 64-bits, IN reads only 32 bits from theI/O port.If the CPL is higher than IOPL, or the mode is virtual mode, IN checks the I/Opermission bitmap in the TSS before allowing access to the I/O port. (See <strong>Volume</strong> 2 fordetails on the TSS I/O permission bitmap.)Mnemonic Opcode DescriptionIN AL, imm8IN AX, imm8IN EAX, imm8IN AL, DXIN AX, DXIN EAX, DXRelated <strong>Instructions</strong>INSx, OUT, OUTSxrFLAGS AffectedNoneE4 ibE5 ibE5 ibECEDEDInput a byte from the port at the address specified by imm8 <strong>and</strong>put it into the AL register.Input a word from the port at the address specified by imm8 <strong>and</strong>put it into the AX register.Input a doubleword from the port at the address specified byimm8 <strong>and</strong> put it into the EAX register.Input a byte from the port at the address specified by the DXregister <strong>and</strong> put it into the AL register.Input a word from the port at the address specified by the DXregister <strong>and</strong> put it into the AX register.Input a doubleword from the port at the address specified by theDX register <strong>and</strong> put it into the EAX register.IN 149

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!