
BASIC INSTRUCTION SET
3.3.4 Division Instructions
DIV (Unsigned Integer Divide) performs an unsigned division of the accumulator by the source operand. If the source operand is a byte, it is divided into the
If the source operand is a word, it is divided into the
For unsigned byte division, the largest quotient is 255. For unsigned word division, the largest quotient is 65,535. DIY leaves OF, SF, ZF, AF, PF, and CF undefined. Interrupt (INT 0) occurs if the divisor is zero or if the quotient is too large for AL or AX.
Example: DIY BX. Replaces the contents of AX with the unsigned quotient of the doubleword value contained in DX and AX, divided by BX. The unsigned modulo replaces the contents of
DX.
Example: DIY BL. Replaces the contents of AL with the unsigned quotient of the word value in AX, divided by BL. The unsigned modulo replaces the contents of AH.
IDIV (Signed Integer Divide) performs a signed division of the accumulator by the source operand. IDlY uses the same registers as the DIY instruction.
For signed byte division, the maximum positive quotient is +127 and the minimum negative quotient is
Example: IDlY WORDOPRND. Replaces the contents of AX with the signed quotient of the double- word value contained in DX and AX, divided by the value contained in the memory word labeled WORDOPRND. The signed modulo replaces the contents of DX.
3.4LOGICAL INSTRUCTIONS
The group of logical instructions includes the Boolean operation instructions, rotate and shift instruc- tions, type conversion instructions, and the
3.4.1 Boolean Operation Instructions
Except for the NOT and NEG instructions, the Boolean operation instructions can use two register operands, a general purpose register operand with a memory operand, an immediate operand with a general purpose register operand, or a memory operand. The NOT and NEG instructions are unary operations that use a single operand in a register or memory.
AND (And) performs the logical "and" of the operands (byte or word) and returns the result to the destination operand. AND clears OF and DF, leaves AF undefined, and updates SF, ZF, and PF.