Advertisements
Advertisements
प्रश्न
Write an Assembly Language Program to exchange the contents of two blocks of data. First block is stored from memory location CO20H to CO24H. The second block is stored from CO70H to CO74H.
कोड लेखन
Advertisements
उत्तर
Label Mnemonic operand Comments
MVI C, 05H ; Get count in register C
LXI H, C020H ; Address of first block in HL pair
LXI D, C070H ; Address of second block in D-E pair
REP MOV B, M ; Get number from first block in reg. B
LDAX D ; Get number from second block in accumulator
MOV M, A ; Store the number in first block
MOV A, B ; Get the number of first block in accumulator
STAX D ; Store the number in second block
INX D ; Get address of next number
INX H ; Get address of next number
DCR C ; Decrement count by 1
JNZ REP ; Is zero? No-jump to label REP
HLT ; Yes, stop processingshaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
