Exchange the contents of memory locations 2050H and 2370H.
Program
1:
- LDA 2050H : "Get the contents of memory location 2050H into
accumulator"
- MOV B, A : "Save the contents into B register"
- LDA 2370H : "Get the contents of memory location 2370Hinto
accumulator"
- STA 2050H : "Store the contents of accumulator at address
2050H"
- MOV A, B : "Get the saved contents back into A register"
- STA 2370H : "Store the contents of accumulator at address
2370H"
Program
2:
- LXI H 2050H : "Initialize HL register pair as a pointer to
memory location 2050H."
- LXI D 2370H : "Initialize DE register pair as a pointer to
memory location 2370H."
- MOV B, M : "Get the contents of memory location 2050H into B
register."
- LDAX D : "Get the contents of memory location 2370H into A
register."
- MOV M, A : "Store the contents of A register into memory
location 2050H."
- MOV A, B : "Copy the contents of B register into
accumulator."
- STAX D : "Store the contents of A register into memory location
2370H."
- HLT : "Terminate program execution."