
INTRODUCTION
execution. Bytes and words also may be rotated. Bits rotated out of an operand are not lost as in a shift but are circled back into the other end of the operand.
POWERFUL STRING PROCESSING
Five basic string instructions called primitives allow a string of bytes or words to be oper- ated on, one byte or word at a time. Strings of up to 64K bytes may be manipulated with these instructions. Instructions are available to move data from a source string to a desti- nation string, or to compare two strings, or to scan one string for a given value. In addi- tion, string instructions are provided to move string elements to and from the AX register in the 8088 (Fig.
The specified operation is performed only once when the string primitive is encountered in the program. If the programmer desires the operation to be performed repetitively,
| LOGICALS |
NOT | "Not" byte or word |
AND | "And" byteorword |
OR | "Inclusive or" byte or word |
XOR | "Exclusive or" byte or word |
TEST | "Test" byte or word |
| SHIFTS |
SHLISAL | Shift logical/arithmetic left |
| byte or word |
SHR | Shift logical right byte or word |
SAR | Shift arithmetic right byte or |
| word |
| ROTATES |
ROL | Rotate left byte or word |
ROR | Rotate right byte or word |
RCL | Rotate through carry left byte |
| or word |
RCR | Rotate through carry right |
| byte or word |
such as in a block or string manipulation operation, the basic string primitive may be proceeded by a special one byte "prefix" that causes the instruction to be repeated by the hardware. This prefix is called REPEAT. The use of the REPEAT prefix allows long strings to be processed much faster than would be possible with a software loop. The repetitions can be terminated by a variety of conditions and a repeated operation may be interrupted and resumed. The ex register counts the number of times the string opera- tion is performed.
When the 8088 moves a
The program transfer instructions are shown in Figure
MOVS | Move byte or word string |
CMPS | Compare byte or word |
| string |
SCAS | Scan byte or word string |
LODS | Load byte or word string |
STOS | Store byte or word string |
REP | Repeat |
REPE/REPZ | Repeat while equal/zero |
REPNE/REPNZ | Repeat while not |
| equal/not zero |
Figure | Figure |