MVI SP, 99H ; initialize stack pointer at XX99H
MVI A, 00H ; load accumulator with 00H MOV B, 90H ; load B register with starting memory location (XX90H) MOV C, 0FH ; load C register with number of memory locations to clear (16)
CLEAR: STAX B ; store accumulator value in memory location INR B ; increment memory location DCR C ; decrement number of memory locations JNZ CLEAR ; jump to CLEAR if number of memory locations is not zero
LXI B, 0237H ; load B register with 0237H LXI D, 1242H ; load D register with 1242H LXI H, 4087H ; load H register with 4087H
PUSH: PUSH B ; push B register value onto stack PUSH D ; push D register value onto stack PUSH H ; push H register value onto stack
HALT ; end program
No comments:
Post a Comment