Advertisements
Advertisements
प्रश्न
Write a subroutine to fill the memory location 2501H to 25FF H with Hex number 01H to FFH.
कोड लेखन
Advertisements
उत्तर
FILL: LXI H, 2501H ; HL points to starting address
MVI A, 01H ; A = 01H (initial data)
MVI B, FFH ; Counter = FFH (255 locations)
LOOP: MOV M, A ; Store A at memory location [HL]
INX H ; Point to next memory location
INR A ; Increment data (01H → FFH)
DCR B ; Decrement counter
JNZ LOOP ; Repeat until B = 00H
RET ; Return from subroutineshaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
