हिंदी

Write an assembly language program to fill the memory block of 16 memory locations staring from C200H with data byte 22H and 33H every alternate memory locations.

Advertisements
Advertisements

प्रश्न

Write an assembly language program to fill the memory block of 16 memory locations staring from C200H with data byte 22H and 33H every alternate memory locations.

कोड लेखन
Advertisements

उत्तर

      LXI H, C200H  ; Point to starting memory location
      MVI C, 08H    ; Counter set to 8 (since we fill 2 bytes per loop)

LOOP: MVI M, 22H    ; Fill first location with 22H
      INX H         ; Move to next location
      MVI M, 33H    ; Fill next location with 33H
      INX H         ; Move to next location
      DCR C         ; Decrement counter
      JNZ LOOP      ; Repeat until 16 locations are filled (8 * 2)
      HLT           ; Terminate
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2025-2026 (March) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×