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

Write an assembly language program to get Binary Coded Decimal (BCD) sum of series of 1-byte numbers stored at locations beginning 2600 H. Length of series is at 25FF H. Store the 1-byte result - Computer Science 2

Advertisements
Advertisements

प्रश्न

Write an assembly language program to get Binary Coded Decimal (BCD) sum of series of 1-byte numbers stored at locations beginning 2600 H. Length of series is at 25FF H. Store the 1-byte result in 2700 H.

लघु उत्तर

उत्तर

Label Mnemonics code Comments
  LXI H, 25FF H ; Load addr of block
  ; Length in HL pair
; Memory value in M
MOV B, M ; Copy block length in B
SUB A ; Clear (A) to 00H
Back: INX H ; Go to next memory
  ADD M ; Add data into A
DA A ; Convert into BCD
DCR B ; decrease B by 1
JNZ Back ; check z flag if z = 0
  ; then jump back to
; loop, i.e. B ≠ 0
STA 2700H ; Store final 1-byte
  ; Sum from A into memory
HLT ; Halt the process
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2023-2024 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.