Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- iAPx86 - <b>outs output string to port flags: not altered</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
OUTS            Output String to Port                Flags: Not altered

OUTS DX,source                                       CPU: 186+ IOpm

        Logic   [port] . [DS:eSI]
                if DF = 0
                   eSI . eSI + n        ; n = 1 for byte, 2 for word,
                else                    ;     4 for dword (386+)
                   eSI . eSI - n
                endif

    The OUTS instruction transfers a byte, word, or dword from memory
    (at DS:eSI) to an output port (specified in the DX register).
    After the transfer, eSI is updated to point to the next string
    location. The port is always addressed through DX. If the
    address-size attribute is 16 bits, SI is used as source-index
    register; if 32 bits, ESI is used.


    Protected mode
    An exception occurs if the current task has insufficient privilege
    for the I/O. OUTS is not IOPL-sensitive in V86 mode.


    Note:       This instruction is always translated by the
                assembler into OUTSB, Output String Byte, OUTSW,
                Output String Word, or OUTSD, Output String Dword,
                depending upon whether destination refers to a string
                of bytes, words or doublewords. In either case, you
                must explicitly load the DS and eSI registers with
                the location of the source.

                OUTSB, OUTSW, and OUTSD are synonyms for the byte, word,
                and doubleword OUTS instructions that do not require an
                operand. They are simpler to use but provide no type
                or segment checking.


    These instructions normally use a REP prefix to indicate a block
    write of the number of bytes as specified in eCX.


        Example:
        lds     si,[pSec]               ; Point DS:SI to storage
        mov     dx,PORT_NUM             ; DX = port number
        mov     cx,512                  ; No. of bytes to write
        cld                             ; String ops forward
        rep     outsb                   ; Write to the port


    Opcode      Format
    6E          OUTS DX,m8              ; = OUTSB (186+)
    6F          OUTS DX,m16             ; = OUTSW (186+)
    6F          OUTS DX,m32             ; = OUTSD (386+)


    Length and timing
    Variations  Bytes   8088    186     286     386     486     Pentium
    outsb        1              14       5      14      17      13   NP
    outsw        1              14       5      14      17      13   NP
    outsd        1               -       -      14      17      13   NP

                             Protected Mode

                Bytes                           386     486     Pentium
                 1                           8/28/28 10/32/30 10/27/25 NP

                Cycles for: CPL <= IOPL / CPL > IOPL / V86

See Also: REP OUT IN INS IOPL

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson