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. Both operands may be bytes or words,
and both may signed or unsigned binary numbers.

                                                                          
Operands                  Clocks   Transfers  Bytes   Example
                        byte(word)
register, register          3          -        2     SUB DX,BX
register, memory        9(13) + EA     1       2-4    SUB DX,TOTAL
memory, register       16(24) + EA     2       2-4    SUB RATE,CL
accumulator, immediate      4          -       2-3    SUB AH,25
register, immediate         4          -       3-4    SUB DX,5280
memory, immediate      17(25) + EA     2       3-6    SUB RESULT,1032
                                                                          

Notes:         You may wish to use SBB if you need to subtract
numbers that are larger than 16 bits, since SBB
subtracts a borrow from a previous operation.

You may subtract a byte-length immediate value from
a destination which is a word; in this case, the
byte is sign-extended to 16 bits before the
subtraction.

See also: SBB
See also: DEC
See also: NEG
See also: CMP
See also: AAS
See also: DAS
See also: EA
See also: Flags
Next:     TEST Test

SUB Subtract