हिंदी

A block of daa is stored in memory locations from 8400H. The length of the block is stored in 73FFH. Another block of same length is stored from 8500H. Write an assembly language program to

Advertisements
Advertisements

प्रश्न

A block of daa is stored in memory locations from 8400H. The length of the block is stored in 73FFH. Another block of same length is stored from 8500H. Write an assembly language program to exchange the contents of these two blocks.

कोड लेखन
Advertisements

उत्तर

LDA 73FFH        ; Load count
MOV B, A         ; B = counter

LXI H, 8400H     ; HL -> first block
LXI D, 8500H     ; DE -> second block

LOOP: 
MOV C, M         ; C = [HL] (store first block data)
LDAX D           ; A = [DE] (get second block data)
MOV M, A         ; [HL] = second block data

MOV A, C         ; A = first block data
STAX D           ; [DE] = first block data

INX H            ; Next location of first block
INX D            ; Next location of second block

DCR B            ; Decrement count
JNZ LOOP         ; Repeat till count ≠ 0

HLT              ; Stop
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2025-2026 (March) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×