Source program :
- LXI SP, 27FFH
- LXI H, 2000H : Memory pointer
- RIM : Read SID
- ANI 80H : Check D7 bit of Accumulator
- CALL Delay : 1/2 bit time delay for stop bit
- MVI B, 08H : Initialize bit counter
- MVI D, 00H : Clear data register
- UP1: ALL Delay : 1 bit time
- RIM : Read SID line
- ANI 80H : Mask bits B6 - Bo
- ORA D : OR data bit with previous bits
- RRC
- MOV D, A : Store data bit at appropriate position
- DCR B
- JNZ UP1
- RLC : Shift left to correct result
- MOV M, A : Store result
- RIM : Read stop bit
- ANI 8OH
- CZ error : If not stop bit call error
- HLT : Terminate program.
Delay subroutine:
- Delay: LXI D, Count
- Back: DCX D
- MOV A, D
- ORA E
- JNZ Back
- RET
|
Flowchart for Program
Flowchart for Delay routine
|
0 Comments