-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dem_san_pham.LST
87 lines (78 loc) · 2.76 KB
/
Dem_san_pham.LST
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
C51 COMPILER V9.01 DEM_SAN_PHAM 02/03/2019 09:26:15 PAGE 1
C51 COMPILER V9.01, COMPILATION OF MODULE DEM_SAN_PHAM
OBJECT MODULE PLACED IN Dem_san_pham.OBJ
COMPILER INVOKED BY: D:\Keil C\C51\BIN\C51.EXE Dem_san_pham.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include <main.h>
2 #include <mega328P.h>
*** WARNING C318 IN LINE 2 OF Dem_san_pham.c: can't open file 'mega328P.h'
3 #include "..\library\delay.h"
4 unsigned char code code7seg[] = {0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90};
5 unsigned int dem;
6 unsigned int i, t;
7 void time_on( int t);
8 void main()
9 {
10 1 EX0 = 1;
11 1 IT0 = 1;
12 1 EA = 1;
13 1 while(1)
14 1 {
15 2 while(1)
16 2 {
17 3 time_on(dem);
18 3 if(P2_2 == 0)
19 3 {
20 4 while(P2_2 == 0) time_on(dem);
21 4 goto here;
22 4 }
23 3 }
24 2 while(1)
25 2 {
26 3 here:;
27 3 for(i=dem;i>0;i--)
28 3 {
29 4 for(t=0;t<50;t++)
30 4 {
31 5 time_on(i);
32 5 }
33 4 }
34 3 P2_3 = 0;
35 3 delay(5000);
36 3 P2_3 = 1;
37 3 dem = 0;
38 3 break;
39 3 }
40 2 }
41 1 }
42 void time_on( int t)
43 {
44 1 int donvi, chuc;
45 1 chuc = (t%100)/10;
46 1 donvi = t%10;
47 1
48 1 LED = code7seg[donvi];
49 1 L1 = 1;
50 1 delay(10);
51 1 L1 = 0;
52 1 LED = code7seg[chuc];
53 1 L2 = 1;
54 1 delay(10);
C51 COMPILER V9.01 DEM_SAN_PHAM 02/03/2019 09:26:15 PAGE 2
55 1 L2 = 0;
56 1 }
57 void ngat() interrupt 0
58 {
59 1 if(dem==99) dem = 0;
60 1 else dem++;
61 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 221 ----
CONSTANT SIZE = 10 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 6 2
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)