
Instruction Set
4-173
OUT S * Output S tring Component to Port
OUT S B Output S tring Byte to Port
OUT S W Output S tring Word to Port
OUT S
What It Does
OUTS copies a component from a string in main memory to a port in I/O memory.
S yntax
Desc ription
OUTS transfers data from the address indicated by the source-index register (SI) to the
output port addressed by the DX register. OUTS does not allow specification of the port
number as an immediate value. You must address the port through the DX register value.
Load the correct values into the DX register and the source-index (SI) register before
executing the OUTS instruction.
After the transfer, the source-index register advances automatically. If the Direction Flag
(DF) is 0 (see CLD on page 4-29), the source-index register increments. If DF is 1 (see
STD on page 4-231), it decrements. The SI register increments or decrements by 1 for a
byte or 2 for a word.
OUTSB and OUTSW are synonyms for the byte and word OUTS instructions.
You can use the REP prefix with the OUTS instruction for block output of CX bytes or words.
* – This instruction was not available on the original 8086/8088 systems.
Form
Opcode
Description
Clocks
Am186 Am188
OUTS DX,m8
6E
Output byte DS:[SI] to port in DX
14
14
OUTS DX,m16
6F
Output word DS:[SI] to port in DX
14
14
OUTSB
6E
Output byte DS:[SI] to port in DX
14
14
OUTSW
6F
Output word DS:[SI] to port in DX
14
14
To have the assembler type-check
your operands, use this form. The as-
sembler uses the definition of the
string component to determine its
size.
Regardless of the form of OUTS you
use, source is always DS:[SI], and
port is always DX. Before using any
form of OUTS, make sure that DS
contains the segment of the string,
SI contains the offset of the string,
and DX contains the number of the
port.
To copy a byte from within a string
located in the segment specified in
DS to the I/O port specified n DX, use
this form.
OUTS port,source
OUTSB
OUTSW
To copy a word from within a string
located in the segment specified in
DS to the I/O port specified n DX, use
this form.