IMUL multiplies signed two's-complement numbers. On the 8086 it has only the one-operand form and uses the same registers as MUL: a byte operand is multiplied by AL with the result in AX, a word operand by AX with the result in DX:AX. The result is sign-extended across the whole width, so −42 as a word product is FFD6h.
MOV AL, -6MOV BL, 7IMUL BL ; AX = -42 = FFD6hNEG AX ; AX = 42MOV CX, AXMOV DL, '-'MOV AH, 02hINT 21hMOV AX, CXAAM ; AH = tens, AL = onesOR AX, 3030h ; both digits -> charactersMOV BX, AXMOV DL, BHMOV AH, 02h ; DOS: print DLINT 21hMOV DL, BLMOV AH, 02hINT 21h
IMUL or MUL?
The low half of a product is the same either way; only the upper half differs. With AL = FAh and BL = 7, IMUL BL reads FAh as −6 and gives AX = FFD6h (−42), while MUL BL reads it as 250 and gives AX = 06D6h (1750). Both have D6h in AL. So if you keep only the low half, either instruction works; if you need the full product, pick the one that matches your data.
Flags
CF and OF are both cleared when the upper half is just the sign extension of the lower half (AH is all copies of AL's top bit, or DX of AX's), meaning the product fits in AL or AX as a signed number. Otherwise both are set. SF, ZF, AF and PF are undefined. JO (or INTO) after IMUL therefore checks whether a signed byte or word result is enough.
Pitfalls
There is no immediate operand: to multiply by a constant, load it into a register first. A word IMUL overwrites DX. Mixing a signed byte with a word means sign-extending the byte first with CBW.
Later CPUs
The 80186 added IMUL reg16, reg/mem16, imm (and IMUL reg16, imm as a short way to write the same register twice), and the 386 added IMUL reg, reg/mem. These forms keep only the low half of the product in the destination register and do not touch DX; CF and OF report whether the full result was cut off. None of them run on an 8086.