Escolar Documentos
Profissional Documentos
Cultura Documentos
Write program to add two 16 bit numbers, the numbers are FC45H and 02ECH
When adding two 16 bit data operand, we need to be concerned with the propagation of a carry from
the lower byte to the higher byte. The instruction ADDC (add with carry) is used on such occasion.
e.g. 1
3C E7
+ 3B 8D
________
78 74
When the first byte is added (E7+8D=74, CY=1). The carry is propagated to the higher byte, which results
in 3C+3B+1=78 (all in hex).
Flow Chart:
Start
Add low byte of second number with Low byte of first number
Add high byte of second number with High byte of second number with carry
Stop
Program:
ADD A, #8DH ;add the low byte now A=74H and CY=1
END
Result: