Write an Assembly Language Program to Count the Total Number of Even Data Bytes Occurring in a Block of Data Stored from 9201h to 920ah. Store the Result (Count) at the Memory Location 9500h.
Advertisements
प्रश्न
Write an Assembly Language Program to count the total number of even data bytes occurring in a block of data stored from 9201H to 920AH. Store the result (count) at the memory location 9500H.
Advertisements
उत्तर
| Label | Mnemonics | Comment |
|
rep:
next :
|
MVI C, 00H MVI B, 0AH LXI H, 9201H MOV A, M RRC JC next INR C INX H DCR B JNZ rep MOV A, C STA 9500H RST 1.0 |
; Clear C reg ; Set B = 0AH ; Set HL = 9201 H ; Get M to A ; Rotate A to right ; Jump, if carry to next ; Increment C ; Increment HL ; Decrement B ; Jump, if no zero to rep ; Get C to A ; Store A at 9500 H ; Restart |
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
