Source program :
- LXI SP, 27FFH : Initialize stack pointer
- LXI B, 1388H : Initialize counter with count 5000.
- BACK: MVI A, COH
- SIM : Send high on SOD pin
- CALL DELAY : Wait for 0.5 msec
- MVI A, 40H : Send low on SOD pin
- CALL DELAY : wait for. 5 msec
- DCX B : Decrement count by 1
- MOV A, C
- ORA B : Check if count = 0
- JNZ BACK : If not, repeat
- HLT : Stop program execution
Delay subroutine:
- Delay: LXI D, Count
- Back: DCX D
- MOV A, D
- ORA E
- JNZ Back
- RET
|
|
0 Comments