
ARCHITECTURE AND INSTRUCTIONS
Accumulator-Specific Transfers
Three
IN transfers a byte (or word) from an input port to the AL register (or AX register for a word). The port is specified either with an inline data byte, allowing fixed access to ports 0 through 255, or with a port number in the DX register, allowing variable access to 64K input ports.
OUT is similar to IN except that the transfer is from the accumulator to the output port.
XLAT performs a table lookup byte transla- tion. The AL register is used as an index into a
Three
LEA (load effective address) transfers the off- set address of (rather than its value) to the destination operand. The source operand must be a memory operand and the destination operand must be a
LDS (load pointer into DS) transfers a
LES (load pointer into ES) is similar to LDS except that the segment address is transferred to the ES segment register.
Flag Register Transfers
Four flag register transfer operations are provided:
LAHF (load AH with flags) transfer the flag registers SF, ZF, AF, PF, and CF (the 8080
flags) into specific bits of the AH register.
SAHF (store AH into flags) transfers specific bits of the AH register to the flag register, SF, ZF, AF, PF, and CF.
PUSHF (push flags) decrements the SP reg- ister by two and transfers all of the flag registers into specific bits of the stack element addressed by SP.
POPF (pop flags) transfers specific bits of the stack element addressed by the SP register to the flag registers and then increments SP by two.
Arithmetic Instructions
The 8088 provides the four basic mathemati- cal operations in a variety of instructions. Both 8- and
Flag Register Settings
Six flag registers are set or cleared by arith- metic operations to reflect results of the operation. They generally follow these rules:
CF is set if the operation results in a carry out 'of (from addition) or a borrow into (from subtraction) the
otherwise CF is cleared. | . |
AF is set if the operation results in a carry out of (from addition) or a borrow into (from subtraction) the
ZF is set if the result of the operation is zero; otherwise ZF is cleared.
SF is set if the