Source program :
- LX I H, 2000H : Initialize memory pointer 52H
- MVI B, 52H : Initialize counter
- BACK: MOV A, M : Get the number
- CMP C : Compare with the given byte
- JZ LAST : Go last if match occurs
- INX H : Increment memory pointer
- DCR B : Decrement counter
- JNZ B : I f not zero, repeat
- LXI H, 0000H
- SHLD 2200H
- JMP END : Store 00 at 2200H and 2201H
- LAST: SHLD 2200H : Store memory address
- END: HLT : Stop
|
|
0 Comments