Here is the program to exchange contents of memory locations D000H and D001H:
LDA D000H ;Load Acc with data from D000H
MOV B,A ;Move the data to B
LDA D001H ;Load Acc with data from D001H
STA D000H ;Store Acc data at D000H
MOV A,B ;Move B's data to Acc
STA D001H ;Store Acc data at D001H
This program loads the data from D000H into the accumulator and B register. It then loads the data from D001H into the accumulator and stores it in D000H. Finally, it moves the