📄 main1.lst
字号:
C51 COMPILER V7.06 MAIN1 09/22/2005 14:53:59 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE MAIN1
OBJECT MODULE PLACED IN E:\NEWMAC~1\050808\MAIN\MAIN1.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE E:\NEWMAC~1\050808\MAIN\MAIN1.C DB SB OE
stmt level source
1 //#pragma la
2 #include <main1.h>
3 #define uchar unsigned char
4 #define uint unsigned int
5 sbit stop=P3^5;
6
7 xdata uchar sbuffer[5],rbuffer[64],sbuffer1[55];
8 uchar S_ANSW,R_ANSW,POINTER0,POINTER1,RSUM,SSUM,c_t1,s_byte_nums,r_byte_nums,
9 work,pn1,PRG,err,toPRG,temp_c;
10 bit edit_finish,copy,change_prg,overtime,getPRG,received,send,t31OK,t41OK,
11 t51OK,resend,ans,s_p,noans_ok,connect,break_connect,main1_err,in_sector,
12 editing,p_received,lift_ok,pc_ok,need_para,temp_motor_stop,p_forbid,rc_forbid,new_switch1,new_switch2,
13 pc_stop,urgent_stop,p_active,rc_active;
14 uint *point;
15
16 xdata uchar start _at_ 0x0800;
17 xdata uchar decrease _at_ 0x0802;
18 //xdata uchar urgent_stop _at_ 0x0804;
19 xdata uchar YOUHU _at_ 0x0806;
20 xdata uchar WIRE _at_ 0x0808;
21 xdata uchar decrease_ok _at_ 0x080A;
22 xdata uchar weld_switch _at_ 0x080C;
23 xdata uchar wire_switch _at_ 0x080E;
24 xdata uchar current_add _at_ 0x0810;
25 xdata uchar current_dec _at_ 0x0812;
26 xdata uchar rot_front _at_ 0x0814;
27 xdata uchar rot_reverse _at_ 0x0816;
28 xdata uchar wire_add _at_ 0x0818;
29 xdata uchar wire_dec _at_ 0x081A;
30 xdata uchar osc_l _at_ 0x081C;
31 xdata uchar osc_r _at_ 0x081E;
32 xdata uchar breadth_add _at_ 0x0820;
33 xdata uchar breadth_dec _at_ 0x0822;
34 xdata uchar avc_up _at_ 0x0824;
35 xdata uchar avc_down _at_ 0x0826;
36 xdata uchar motor_stop _at_ 0x0828;
37 //xdata uchar lift_ok _at_ 0x082A;
38 xdata uchar return_ok _at_ 0x082C;
39 xdata uchar nonce_sec _at_ 0X082E;
40 xdata uint FINISH _at_ 0X0830;
41 xdata uint CURRENT _at_ 0X0832;
42 xdata uint VOLTAGE _at_ 0X0834;
43 xdata uint AVC _at_ 0X0836;
44 //xdata uchar pc_ok _at_ 0x0838;
45 xdata uchar new_switch11 _at_ 0x0839;
46 xdata uchar new_switch22 _at_ 0x083A;
47 xdata uchar p_forbided _at_ 0x083B;
48 xdata uchar rc_forbided _at_ 0x083C;
49 xdata uchar p_actived _at_ 0x083D;
50 xdata uchar rc_actived _at_ 0x083E;
51 xdata uint last_FINISH _at_ 0x0840;
52
53 void TR_noans()
54 {
55 1 REN=0;
C51 COMPILER V7.06 MAIN1 09/22/2005 14:53:59 PAGE 2
56 1 noans_ok=0;
57 1 // TB8=1;
58 1 POINTER0=0;
59 1 SSUM=0;
60 1 send=1;
61 1 c_t1=0;
62 1 TR1=1;
63 1 while(POINTER0<s_byte_nums);
64 1 TR1=0;
65 1 noans_ok=1;
66 1 REN=1;
67 1 }
68
69 void TR_ans()
70 {
71 1 REN=0;
72 1 ans=1;
73 1 POINTER1=0;
74 1 RSUM=0;
75 1 TB8=1;
76 1 POINTER0=0;
77 1 SSUM=0;
78 1 send=1;
79 1 c_t1=0;
80 1 TR1=1;
81 1 while(POINTER0<s_byte_nums);
82 1 TR1=0;
83 1
84 1 REN=1;
85 1 send=0;
86 1 c_t1=0;
87 1 // TR1=1;
88 1 while(POINTER1<r_byte_nums&&overtime==0);
89 1 TR1=0;
90 1 POINTER1=0;
91 1 RSUM=0;
92 1 if(overtime==1)
93 1 {
94 2 err=3;
95 2 main1_err=1;
96 2 overtime=0;
97 2 stop=0;
98 2 }
99 1 ans=0;
100 1 REN=0;
101 1 }
102
103 void ini_sbuf(unsigned char a,b,c,d,e)
104 {
105 1 sbuffer[0]=a;
106 1 sbuffer[1]=b;
107 1 sbuffer[2]=c;
108 1 sbuffer[3]=d;
109 1 sbuffer[4]=e;
110 1 }
111
112 unsigned char get_byte_nums(unsigned char type)
113 {
114 1 unsigned char numbers;
115 1 switch(type)
116 1 {
117 2 case command:
C51 COMPILER V7.06 MAIN1 09/22/2005 14:53:59 PAGE 3
118 2 case program:
119 2 case answer: numbers=4;
120 2 break;
121 2 case err_infor:
122 2 case parameter1: numbers=5;
123 2 break;
124 2 case parameter:
125 2 case infor: numbers=6;
126 2 break;
127 2 case parameter2: numbers=7;
128 2 break;
129 2 case call_result: numbers=9;
130 2 break;
131 2 case para_pc: numbers=10;
132 2 break;
133 2 case p_out_sec: numbers=55;
134 2 break;
135 2 case p_in_sec: numbers=24;
136 2 break;
137 2 case edit_sec: numbers=64;
138 2 break;
139 2 default: break;
140 2 }
141 1 return numbers;
142 1 }
143
144 void com_type()
145 {
146 1 switch(rbuffer[2])
147 1 {
148 2 case com_edit: if(p_forbided==1)
149 2 {
150 3 editing=1; //编程
151 3 }break;
152 2
153 2 case com_efinish: if(p_forbided==1)
154 2 {
155 3 editing=0;
156 3 edit_finish=1;
157 3
158 3 }break;
159 2
160 2 case com_start: if(rc_forbided==1)
161 2 {
162 3 // if((edited==1&&edit_finish==1)||(edited==0))//编程未结束,禁止启动焊接
163 3 start=1;
164 3 }break;
165 2 case com_decrease: if(rc_forbided==1)
166 2 decrease=1;break; //手动衰减
167 2 case com_current_add: if(rc_forbided==1)
168 2 current_add=1;break; //电流加
169 2 case com_current_dec: if(rc_forbided==1)
170 2 current_dec=1;break; //电流减
171 2 case com_rot_front: if(rc_forbided==1)
172 2 rot_front=1;break;
173 2 case com_rot_reverse: if(rc_forbided==1)
174 2 rot_reverse=1;break;
175 2 case com_wire_add: if(rc_forbided==1)
176 2 wire_add=1;break;
177 2 case com_wire_dec: if(rc_forbided==1)
178 2 wire_dec=1;break;
179 2 case com_osc_l: if(rc_forbided==1&&osc_l==0)
C51 COMPILER V7.06 MAIN1 09/22/2005 14:53:59 PAGE 4
180 2 osc_l=1;break;
181 2 case com_osc_r: if(rc_forbided==1&&osc_r==0)
182 2 osc_r=1;break;
183 2 case com_breadth_add: if(rc_forbided==1&&breadth_add==0)
184 2 breadth_add=1;break;
185 2 case com_breadth_dec: if(rc_forbided==1&&breadth_dec==0)
186 2 breadth_dec=1;break;
187 2 case com_avc_up: if(rc_forbided==1)
188 2 avc_up=1;break;
189 2 case com_avc_down: if(rc_forbided==1)
190 2 avc_down=1;break;
191 2 case com_motor_stop: if(rc_forbided==1&&temp_motor_stop==0)
192 2 temp_motor_stop=1;break;
193 2 case com_urgent_stop: if(rc_forbided==1)
194 2 {
195 3 pc_stop=1;
196 3 urgent_stop=1;
197 3 err=1;
198 3 }break;
199 2 case com_connect: connect=1;break;
200 2 case com_connect_fail: break_connect=1;break;
201 2 case com_forbid_p: if(p_forbided==0)
202 2 p_forbid=1;break;
203 2 case com_forbid_rc: if(rc_forbided==0)
204 2 rc_forbid=1;break;
205 2 case com_p_active: p_active=1;break;
206 2 case com_rc_active: rc_active=1;break;
207 2 case com_need_para: need_para=1;break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -