Advertisements
Advertisements
प्रश्न
Write an Assembly Language Program to add two BCD number stored at location 2500H and 2501H. Place the BCD result in location 2502H and onward starting with LSB.
कोड लेखन
Advertisements
उत्तर
LDA 2500H ; A = 1st BCD number
MOV B, A
LDA 2501H ; A = 2nd BCD number
ADD B ; A = binary sum
DAA ; Adjust result to BCD
STA 2502H ; Store LSB (BCD result)
MVI A, 00H ; Prepare to store carry
ADC A ; A = 01H if CY = 1 else 00H
STA 2503H ; Store carry as next digit
HLTshaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
