Google

Jun 8, 2008

How to add two binary numbers without carry

Adding binary numbers without carry



MOV A,L
ADD E
DDA
STA 2300H
MOV A,H
ADC D
DAA
STA 2301H
HLT

the program works as followes
first statment gets 2 digits of the number 1
second statment addes two lower digits
DDA will adjust to valid BCD
STA statment will store the result in the address 2300H
mov A,H will move the most significan digits of second number
next statment will add them
then adjust to valid BCD
then store the result to 2301
thats it the end of the program.

You might be also interested in:

:: Effective addresses
:: Floating Point Initializations
:: options available for int 21h instruction

No comments: