-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.asm
More file actions
66 lines (46 loc) · 651 Bytes
/
main.asm
File metadata and controls
66 lines (46 loc) · 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$NOMOD51
$INCLUDE (8051.MCU)
org 0000h
SETB P1.0
CPL P1.0
Start:
SETB P3.3
CLR P3.4
SETB P3.5
SETB P3.4
stay: JB P3.5, stay
CLR P3.3
SETB P3.7
MOV TMOD,#00H
MOV R1, P0
MOV A, R1
MOV B, #3
MUL AB
MOV P2,A
CPL A
MOV R7, A
SETB TR0
CLR P1.1
LCALL HIGH_DONE
SETB TR0
LCALL LOW_DONE
JMP Start
HIGH_DONE:
SETB P1.1
CLR TF0
MOV TH0, R7
stay1: JNB TF0, stay1
CLR TF0
RET
LOW_DONE:
CLR P1.1
MOV A, #0FFH
CLR C
SUBB A, R7
MOV TH0, A
stay2: JNB TF0, stay2
CLR TF0
RET
Loop:
jmp Loop
END