Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
INS Instruction
 Detail Key                               Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Title:    Input from Port to String             Flags: O D I T S Z A P C
            80186-80486 Only                             ═════════════════
                                                              -none-
  Syntax:   INS dest,src
            INSB
            INSW
            INSD (80386/486 Only)
 
  See also: .186, OUTS, IN, OUT
 
  Description:
 
     Receives a string from a port. The string is considered the
     destination and must be pointed to by ES:DI (even if an operand
     is given).
 
     The input port is specified in DX. For each element received, DI
     is adjusted according to the size of the operand and the status of
     the direction flag. DI is increased if the direction flag has been
     cleared with CLD, or decreased if the direction flag has been set
     with STD.
 
     If the INS form of the instruction is used, a destination operand
     must be provided to indicate the size of the data elements to be
     processed and DX must be specified as the source operand
     containing the port number. A segment override is not allowed.
 
     If INSB (bytes), INSW (words), or INSD (doublewords) is used, the
     instruction determines the size of the data elements to be
     received.
 
     INS and its variations are normally used with the REP prefix.
     Before the repeated instruction is executed, CX should contain the
     number of elements to be received. In protected mode, a general-
     protection fault occurs if INS is used when the current privilege
     level is greater than the value of the IOPL flag.
                                    -♦-