MVI H,10D
MVI A,0FH
LXI B,2500H
LOOP: STAX B
INX B
DCR H
JNZ LOOP
After a complete pass through LOOP, register B should be 2501H which is correct in the registers window and the location 2500H is now written with 0FH. The second time it passes through LOOP, STAX B does not store the data into 2501H but to some other memory location, which is wrong.
Consider this simple example:
After a complete pass through LOOP, register B should be 2501H which is correct in the registers window and the location 2500H is now written with 0FH. The second time it passes through LOOP, STAX B does not store the data into 2501H but to some other memory location, which is wrong.