मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (संगणक विज्ञान) इयत्ता १२ वी

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. - Computer Science 2

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

        HLT
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2021-2022 (March) Set 1

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×