MCS-51 Family Macro Assembler A S E M - 5 1 V 1.3
=====================================================
Source File: p10_p21.txt
Object File: p10_p21.hex
List File: p10_p21.lst
Line I Addr Code Source
1: ; INPUT CLOCK VALUE IN MEGAHERTZ...: 11.0592
2: ; WANTED TIME DELAY IN MICROSECONDS: 60000000
3: ; PROCESSOR CYCLE TIME (12)....... : 1085 ns
4: ; TOTAL REQUIRED CYCLES........... : 55296000
5: ; TOTAL TIME (INCLUDING CALL)..... : 60000.0 mS
6:
7: 0000 START:
8: 0000 C2 A0 CLR P2.0 ; motor output "L" ..
9:
10: 0002 30 90 FD JNB P1.0, $ ; read P1.0, if not "H" stay here ..
11: 0005 75 F0 FF MOV B, #0FFh
12: 0008 D5 F0 FD DJNZ B, $ ; wait a while ..
13:
14: 000B D2 A0 SETB P2.0 ; set P2.0 output to "H" ..
15:
16: 000D 7C 02 MOV R4,#2 ; set delay for 60s ..
17: 000F 7B A6 MOV R3,#166
18: 0011 7A DF MOV R2,#223
19: 0013 79 75 MOV R1,#117
20:
21: 0015 TT1:
22: 0015 D9 FE DJNZ R1,TT1
23:
24: 0017 20 90 06 JB P1.0, Stop_Motor ; read P1.0 and if not "L" set motor output "L" ..
25:
26: 001A DA F9 DJNZ R2,TT1
27: 001C DB F7 DJNZ R3,TT1
28: 001E DC F5 DJNZ R4,TT1
29:
30: 0020 Stop_Motor:
31:
32: 0020 C2 A0 CLR P2.0
33: 0022 02 00 00 LJMP START
34:
35: END
36:
no errors