Advertisements
Advertisements
प्रश्न
Write an Assembly Language Program to find the sum of ten hex numbers stored in consecutive memory locations starting from 4000 II. Store the two-byte result at the end of the block beginning with a lower byte.
संक्षेप में उत्तर
Advertisements
उत्तर
| Label | Mnemonics and Ope | Comments |
| LOOP: | LXI H, 4000 H | ; Set HL with 4000 H |
| MOI C, 10H | ; Set C reg. with 10 H | |
| MVI A, 00H | ; Store A with 00 | |
| MVI B, 00H | ; Store B with 00 | |
| ADD M | ; Add mem. with Acc. | |
| JNC next | ; if c y = 0 go to next | |
| INR B | ; Incr. B b y 1 | |
| next: | INX H | ; Increment HL b y 1 |
| DCR C | ; Decrement C by 1 | |
| JNZ LOOP | ; if Z ≠ 0 go to LOOP | |
| INX H | ; Increment HL b y 1 | |
| MOV M, A | ; Copy contents of A to M reg | |
| INX H | ; Increment HL b y 1 | |
| RST 1 | ; Restart |
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
