Draft a program that adds two BCD numbers (10-digits each). The first BCD number
ID: 3690962 • Letter: D
Question
Draft a program that adds two BCD numbers (10-digits each). The first BCD number is stored in an array named myAuburnID, and the second in an array named myAurbunIdRev. The first number is your actual Auburn ID (with a prefix single zero digit and the remaining digits as the 9-digits of your Auburn ID); the second is the value of MyAuburnId written backwards. Your program should do the following: 1) Use shifts/rotates using myAuburnID to fill the array myAuburnIdRev 2) Display contents of the memory locations in question 3) Add myAuburnID and myAurbunIdRev using BCD arithmetic 4) Store the sum in a variable named Result, and 5) Display contents of memory post execution.
Explanation / Answer
DATA SEGMENT
NUM1 DB 04
NUM2 DB 05
RESULT DB ?
ENDS
CODE SEGMENT
ASSUME DT:DATA CT:CODE
START:
MOV BX,DATA
MOV DS,BX
MOV BL,NUM1
ADD BL,NUM2
MOV RESULT,BL
MOV BH,0
BBB
MOV BH,5CH
INT 21H
ENDS
END START
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.