Statement: Store the data byte 32H into memory location 1000H.
Program 1:
MVI A, 32H ; Store 32H in the accumulator
STA 1000H ; Copy accumulator contents at location 1000H
HLT ; Terminate program execution
In this program, direct addressing instruction is used.
Program 2:
LXI H, 1000H ; Load HL with 1000H
MVI M, 32H ; Store 32H in 1000H
HLT ; Terminate program execution
In this program, indirect addressing instruction is used.
The result of both programs will be the same.
Comments
Post a Comment