Instruction Set
4-72
INS
INS
Operation It Performs
Flag Settings After Instruction
Tips
Before using INS, always be sure to: set up ES:[DI] 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 register to a port in I/O memory
OUT
Copy a component from a string in main memory to a port in I/O memory
OUTS
Repeat one string instruction
REP
Process string components from higher to lower addresses
STD
if (size(
destination) == 8)
/* input bytes */
{
ES:DI = [DX];
/* byte in I/O memory */
if DF == 0
/* forward */
increment = 1;
else
/* backward */
increment = -1;
}
if (size(
destination) == 16)
/* input words */
{
ES:DI = [DX];
/* word in I/O memory */
if DF == 0
/* forward */
increment = 2;
else
/* backward */
increment = -2;
}
/* point to location for next string component */
DI = DI + 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...