📄 正反转.lst
字号:
C51 COMPILER V7.06 正__转 02/03/2009 15:08:15 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE 正__转
OBJECT MODULE PLACED IN E:\挑战杯~1\步进电~1\正反转.OBJ
COMPILER INVOKED BY: d:\Keil\c51\BIN\C51.EXE E:\挑战杯~1\步进电~1\正反转.C DB SB OE
stmt level source
1 #include <reg52.h>
2 #include <intrins.h>
3 #include <string.h>
4 #define uchar unsigned char
5 #define uint unsigned int
6 sbit P1_0=P1^0;
7 sbit P1_1=P1^1;
8 sbit P1_2=P1^2;
9 sbit P1_3=P1^3;
10 sbit key1=P1^4;
11 sbit key2=P1^5;
12 //uchar y=10;
13 void delay_10us(uint n)
14 {
15 1 //us极延时程序
16 1 do
17 1 {
18 2 _nop_();
19 2 _nop_();
20 2 _nop_();
21 2 _nop_();
22 2 _nop_();
23 2 }while(--n);
24 1 }
25 //毫秒极延时程序
26 void delay_ms(uint n)
27 {
28 1 do
29 1 {delay_10us(131);
30 2 }while(--n);
31 1 }
32
33 void zzm(void)
34 {
35 1
36 1 while(1)
37 1 {
38 2 P1_0=1;
39 2 P1_1=0;
40 2 P1_2=0;
41 2 P1_3=0;
42 2 delay_ms(4);
43 2 P1_0=0;
44 2 P1_1=0;
45 2 P1_2=1;
46 2 P1_3=0;
47 2 delay_ms(4);
48 2 P1_0=0;
49 2 P1_1=1;
50 2 P1_2=0;
51 2 P1_3=0;
52 2 delay_ms(4);
53 2 P1_0=0;
54 2 P1_1=0;
55 2 P1_2=0;
C51 COMPILER V7.06 正__转 02/03/2009 15:08:15 PAGE 2
56 2 P1_3=1;
57 2 delay_ms(4);
58 2 if(key2==0)
59 2 break;
60 2 }
61 1 }
62 void ffm(void)
63 {
64 1 while(1)
65 1 {
66 2
67 2 P1_0=0;
68 2 P1_1=0;
69 2 P1_2=0;
70 2 P1_3=1;
71 2 delay_ms(4);
72 2 P1_0=0;
73 2 P1_1=1;
74 2 P1_2=0;
75 2 P1_3=0;
76 2 delay_ms(4);
77 2 P1_0=0;
78 2 P1_1=0;
79 2 P1_2=1;
80 2 P1_3=0;
81 2 delay_ms(4);
82 2 P1_0=1;
83 2 P1_1=0;
84 2 P1_2=0;
85 2 P1_3=0;
86 2 delay_ms(4);
87 2 if(key1==0)
88 2 break;
89 2 }
90 1 }
91 //主函数
92 void main(void)
93 {
94 1 while(1)
95 1 {
96 2 if (key1==0)
97 2 zzm();
98 2 if (key2==0)
99 2 ffm();
100 2 }
101 1 }
102
103 /*
104
105
106 int i=500;
107 int j=500;
108 while(i)
109 {
110 P1_0=1;
111 P1_1=0;
112 P1_2=0;
113 P1_3=0;
114 delay_ms(4);
115 P1_0=0;
116 P1_1=0;
117 P1_2=1;
C51 COMPILER V7.06 正__转 02/03/2009 15:08:15 PAGE 3
118 P1_3=0;
119 delay_ms(4);
120 P1_0=0;
121 P1_1=1;
122 P1_2=0;
123 P1_3=0;
124 delay_ms(4);
125 P1_0=0;
126 P1_1=0;
127 P1_2=0;
128 P1_3=1;
129 delay_ms(4);
130 i--;
131 }
132 while(j)
133 {
134
135 P1_0=0;
136 P1_1=0;
137 P1_2=0;
138 P1_3=1;
139 delay_ms(4);
140 P1_0=0;
141 P1_1=1;
142 P1_2=0;
143 P1_3=0;
144 delay_ms(4);
145 P1_0=0;
146 P1_1=0;
147 P1_2=1;
148 P1_3=0;
149 delay_ms(4);
150 P1_0=1;
151 P1_1=0;
152 P1_2=0;
153 P1_3=0;
154 delay_ms(4);
155 j--;
156 }
157 }
*** ERROR C300 IN LINE 157 OF E:\挑战杯~1\步进电~1\正反转.C: unterminated comment
C51 COMPILATION COMPLETE. 0 WARNING(S), 1 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -