SUB             Subtract                             Flags: O D I T S Z A P C
* - - - * * * * *
SUB destination,source

Logic destination ← destination - source

SUB subtracts the source operand from the destination operand and
stores the result in destination.

When an immediate byte value is subtracted from a word operand,
the immediate value is first sign-extended to the size of the
destination operand.


Opcode Format
28 /r SUB r/m8,r8
29 /r SUB r/m16,r16
29 /r SUB r/m32,r32
2A /r SUB r8,r/m8
2B /r SUB r16,r/m16
2B /r SUB r32,r/m32
2C ib SUB AL,imm8
2D iw SUB AX,imm16
2D id SUB EAX,imm32
80 /5 ib SUB r/m8,imm8
81 /5 iw SUB r/m16,imm16
81 /5 id SUB r/m32,imm32
83 /5 ib SUB r/m16,imm8
83 /5 ib SUB r/m32,imm8


Length and timing
Operands Bytes 8088 186 286 386 486 Pentium
reg, reg 2 3 3 2 2 1 1 UV
mem, reg 2+d(0,2) 24+EA 10 7 7 3 3 UV
reg, mem 2+d(0,2) 13+EA 10 7 6 2 2 UV
reg, imm 2+i(1,2) 4 4 3 2 1 1 UV
mem, imm 2+d(0,2) 23+EA 16 7 7 3 3 UV*
+i(1,2)
acc, imm 1+i(1,2) 4 4 3 2 1 1 UV

* = not pairable if there is a displacement and immediate