Module 0217: Adding in assembly language
Tak Auyeung, Ph.D.
February 16, 2010
1
About this module
2
Isn’t that trivial?
3
Binary adding revisited
3.1
Revisiting the add rules
3.2
Bit operators
3.3
Back to adding
3.4
Half adding and full adding
3.5
The last carry
3.6
Is the result zero?
4
What about signed numbers?
4.1
Two’s complement
4.2
What exactly is a negative number?
4.3
Is two’s complement a good fit?
4.4
What does 1101
2
represent?
4.5
Ranges of numbers
5
The add instruction
6
Flags
6.1
C-flag
6.2
Z-flag
6.3
S-flag
6.4
O-flag
7
How do I see the flags?
8
Add with carry