
Instruction Set
4-174
OUTS
OUTS
Operation It Performs
Flag Settings After Instruction
Tips
Before using OUTS, always be sure to: set up SI with the offset of the string, set up CX
with the length of the string, and use CLD (forward) or STD (backward) to establish the
direction for string processing.
The string instructions always advance SI and/or DI, regardless of the use of the REP prefix.
Be sure to set or clear DF before any string instruction.
Related Instructions
If you want to
See
Process string components from lower to higher addresses
CLD
Copy a component from a port in I/O memory to a register
IN
Copy a component from a port in I/O memory to a string located in main memory INS
Copy a component from a register to a port in I/O memory
OUT
Repeat one string instruction
REP
Process string components from higher to lower addresses
STD
if (size(
source) == 8)
/* output bytes */
{
[DX] = DS:[SI];
if (DF == 0)
/* forward */
increment = 1;
else
/* backward */
increment = -1;
}
if (size(
source) == 16)
/* output words */
{
[DX] = DS:[SI];
if (DF == 0)
/* forward */
increment = 2;
else
/* backward */
increment = -2;
}
/* point to location for next string component */
SI = SI + increment;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
–
–
–
–
–
– res – res – res –
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...