⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ins.htm

📁 Programmer s Reference Manual is an improtant book on Intel processor architecture and programming.
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>80386 Programmer's Reference Manual -- Opcode INS</TITLE></HEAD><BODY><B>up:</B> <A HREF="c17.htm">Chapter 17 -- 80386 Instruction Set</A><BR><B>prev:</B><A HREF="INC.htm"> INC Increment by 1</A><BR><B>next:</B><A HREF="INT.htm"> INT/INTO Call to Interrupt Procedure</A><P><HR><P><H1>INS/INSB/INSW/INSD -- Input from Port to String</H1><PRE>Opcode  Instruction    Clocks         Description6C      INS r/m8,DX    15,pm=9*/29**  Input byte from port DX into ES:(E)DI6D      INS r/m16,DX   15,pm=9*/29**  Input word from port DX into ES:(E)DI6D      INS r/m32,DX   15,pm=9*/29**  Input dword from port DX into ES:(E)DI6C      INSB           15,pm=9*/29**  Input byte from port DX into ES:(E)DI6D      INSW           15,pm=9*/29**  Input word from port DX into ES:(E)DI6D      INSD           15,pm=9*/29**  Input dword from port DX into ES:(E)DI</PRE><EM><H3>Notes</H3><PRE>   *If CPL <= IOPL  **If CPL > IOPL or if in virtual 8086 mode</PRE></EM><H2>Operation</H2><PRE>IF AddressSize = 16THEN use DI for dest-index;ELSE (* AddressSize = 32 *)   use EDI for dest-index;FI;IF (PE = 1) AND ((VM = 1) OR (CPL > IOPL))THEN (* Virtual 8086 mode, or protected mode with CPL > IOPL *)   IF NOT I-O-Permission (SRC, width(SRC))   THEN #GP(0);   FI;FI;IF byte type of instructionTHEN   ES:[dest-index] := [DX]; (* Reads byte at DX from I/O address space *)   IF DF = 0 THEN IncDec := 1 ELSE IncDec := -1; FI;FI;IF OperandSize = 16THEN   ES:[dest-index] := [DX]; (* Reads word at DX from I/O address space *)   IF DF = 0 THEN IncDec := 2 ELSE IncDec := -2; FI;FI;IF OperandSize = 32THEN   ES:[dest-index] := [DX]; (* Reads dword at DX from I/O address space *)   IF DF = 0 THEN IncDec := 4 ELSE IncDec := -4; FI;FI;dest-index := dest-index + IncDec;</PRE><H2>Description</H2>INS transfers data from the input port numbered by the DX register tothe memory byte or word at ES:dest-index. The memory operand mustbe addressable from ES; no segment override is possible. The destinationregister is DI if the address-size attribute of the instruction is 16 bits,or EDI if the address-size attribute is 32 bits.<P>INS does not allow the specification of the port number as an immediatevalue. The port must be addressed through the DX register value. Loadthe correct value into DX before executing the INS instruction.<P>The destination address is determined by the contents of the destinationindex register. Load the correct index into the destination index registerbefore executing INS.<P>After the transfer is made, DI or EDI advances automatically. If thedirection flag is 0 (CLD was executed), DI or EDI increments; if thedirection flag is 1 (STD was executed), DI or EDI decrements. DIincrements or decrements by 1 if a byte is input, by 2 if a word is input,or by 4 if a doubleword is input.<P>INSB, INSW and INSD are synonyms of the byte, word, and doublewordINS instructions. INS can be preceded by the <A HREF="REP.htm">REP</A> prefix for block input ofCX bytes or words. Refer to the <A HREF="REP.htm">REP</A> instruction for details of thisoperation.<H2>Flags Affected</H2>None<H2>Protected Mode Exceptions</H2>#GP(0) if CPL is numerically greater than IOPL and any of thecorresponding I/O permission bits in TSS equals 1; #GP(0) if thedestination is in a nonwritable segment; #GP(0) for an illegal memoryoperand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) foran illegal address in the SS segment; #PF(fault-code) for a page fault<H2>Real Address Mode Exceptions</H2>Interrupt 13 if any part of the operand would lie outside of the effectiveaddress space from 0 to 0FFFFH<H2>Virtual 8086 Mode Exceptions</H2>#GP(0) fault if any of the corresponding I/O permission bits in TSSequals 1; #PF(fault-code) for a page fault<P><HR><P><B>up:</B> <A HREF="c17.htm">Chapter 17 -- 80386 Instruction Set</A><BR><B>prev:</B><A HREF="INC.htm"> INC Increment by 1</A><BR><B>next:</B><A HREF="INT.htm"> INT/INTO Call to Interrupt Procedure</A></BODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -