📄 outs.htm
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>80386 Programmer's Reference Manual -- Opcode OUTS</TITLE></HEAD><BODY><B>up:</B> <A HREF="c17.htm">Chapter 17 -- 80386 Instruction Set</A><BR><B>prev:</B><A HREF="OUT.htm"> OUT Output to Port</A><BR><B>next:</B><A HREF="POP.htm"> POP Pop a Word from the Stack</A><P><HR><P><H1>OUTS/OUTSB/OUTSW/OUTSD -- Output String to Port</H1><PRE>Opcode Instruction Clocks Description6E OUTS DX,r/m8 14,pm=8*/28** Output byte [(E)SI] to port in DX6F OUTS DX,r/m16 14,pm=8*/28** Output word [(E)SI] to port in DX6F OUTS DX,r/m32 14,pm=8*/28** Output dword [(E)SI] to port in DX6E OUTSB 14,pm=8*/28** Output byte DS:[(E)SI] to port in DX6F OUTSW 14,pm=8*/28** Output word DS:[(E)SI] to port in DX6F OUTSD 14,pm=8*/28** Output dword DS:[(E)SI] to port in DX</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 SI for source-index;ELSE (* AddressSize = 32 *) use ESI for source-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 (DEST, width(DEST)) THEN #GP(0); FI;FI;IF byte type of instructionTHEN [DX] := [source-index]; (* Write byte at DX I/O address *) IF DF = 0 THEN IncDec := 1 ELSE IncDec := -1; FI;FI;IF OperandSize = 16THEN [DX] := [source-index]; (* Write word at DX I/O address *) IF DF = 0 THEN IncDec := 2 ELSE IncDec := -2; FI;FI;IF OperandSize = 32THEN [DX] := [source-index]; (* Write dword at DX I/O address *) IF DF = 0 THEN IncDec := 4 ELSE IncDec := -4; FI; FI;FI;source-index := source-index + IncDec;</PRE><H2>Description</H2>OUTS transfers data from the memory byte, word, or doubleword at thesource-index register to the output port addressed by the DX register. Ifthe address-size attribute for this instruction is 16 bits, SI is used forthe source-index register; otherwise, the address-size attribute is 32 bits,and ESI is used for the source-index register.<P>OUTS does not allow specification of the port number as an immediate value.The port must be addressed through the DX register value. Load the correctvalue into DX before executing the OUTS instruction.<P>The address of the source data is determined by the contents ofsource-index register. Load the correct index value into SI or ESI beforeexecuting the OUTS instruction.<P>After the transfer, source-index register is advanced automatically. Ifthe direction flag is 0 (<A HREF="CLD.htm">CLD</A> was executed), the source-index register isincremented; if the direction flag is 1 (<A HREF="STD.htm">STD</A> was executed), it isdecremented. The amount of the increment or decrement is 1 if a byte isoutput, 2 if a word is output, or 4 if a doubleword is output.<P>OUTSB, OUTSW, and OUTSD are synonyms for the byte, word, anddoubleword OUTS instructions. OUTS can be preceded by the <A HREF="REP.htm">REP</A>prefix for block output of CX bytes or words. Refer to the <A HREF="REP.htm">REP</A>instruction for details on this operation.<H2>Flags Affected</H2>None<H2>Protected Mode Exceptions</H2>#GP(0) if CPL is greater than IOPL and any of the corresponding I/Opermission bits in TSS equals 1; #GP(0) for an illegal memory operandeffective address in the CS, DS, or ES segments; #SS(0) for an illegaladdress 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="OUT.htm"> OUT Output to Port</A><BR><B>next:</B><A HREF="POP.htm"> POP Pop a Word from the Stack</A></BODY>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -