Module 0218: Subtracting in assembly language

Tak Auyeung, Ph.D.

February 18, 2010
1 About this module
2 Binary subtraction
 2.1 The rules
 2.2 Logic gates of a bit subtractor
 2.3 Combinatorial multi-bit subtractor
 2.4 Half subtractors and full subtractors
 2.5 The borrow from the most significant bit
3 Subtraction and comparison
4 Flags affected by subtraction and comparison
 4.1 The Carry flag
 4.2 The Zero flag
 4.3 The Sign flag
 4.4 The Overflow flag
5 Results of comparison
 5.1 the Z-flag
 5.2 the C-flag
 5.3 the S-flag
 5.4 the O-flag
 5.5 the L-flag