📄 mnapp.lst
字号:
1 000000 ;温度检测
2 000000 tempretp:
3 000000 b0bts0 temphumiflag
4 000000 jmp tempretp90
5 000000 b0bclr fp00ien
6 000000 mov a,temchat
7 000000 b0bts1 fz
8 000000 jmp tempretp90
9 000000 b0mov a,chkstat
10 000000 @jmp_a 7
11 000000 jmp mnchkrx1
12 000000 jmp mnchkrx2
13 000000 jmp mnchkrx3
14 000000 jmp mnchkrx4
15 000000 jmp mnchkrx5
16 000000
17 000000
18 000000
19 000000 mnchkrx1:
20 000000 call discharge
21 000000 mov a,#3
22 000000 mov temchat,a ;//set the delay timer constant
23 000000 mov a,#1
24 000000 mov chkstat,a
25 000000 jmp tempretp90
26 000000
27 000000 mnchkrx2:
28 000000 call rstandcharge
29 000000 mov a,#1 ;//set the delay timer constant
30 000000 mov temchat,a
31 000000 mov a,#2
32 000000 mov chkstat,a
33 000000 jmp tempretp90
34 000000
35 000000 mnchkrx3:
36 000000 call discharge
37 000000 mov a,#3 ;//set the delay timer constant
38 000000 mov temchat,a
39 000000 mov a,#3
40 000000 mov chkstat,a
41 000000 jmp tempretp90
42 000000
43 000000 mnchkrx4:
44 000000 call rntccharge
45 000000 mov a,#1 ;//set the delay timer constant
46 000000 mov temchat,a
47 000000 mov a,#4
48 000000 mov chkstat,a
49 000000 jmp tempretp90
50 000000
51 000000 mnchkrx5:
52 000000 call discharge
53 000000 mov a,#3 ;//set the delay timer constant
54 000000 mov temchat,a
55 000000 clr chkstat
56 000000
57 000000 @RST_WDT
58 000000 mov_ temp0,tmrf1
59 000000 mov_ temp1,tmrf2
60 000000 mov_ temp2,tmrntc1
61 000000 mov_ temp3,tmrntc2
62 000000 call comparerx
63 000000 ; mov_ data1,temp4
64 000000 ; mov_ data2,temp5
65 000000 b0bset temphumiflag
66 000000 b0bset detctflag
67 000000 tempretp90:
68 000000 ret
69 000000
70 000000 ;**********************************************
71 000000 ;Name :discharge
72 000000 ;Function:
73 000000 ;Input :
74 000000 ;Output :
75 000000 ;Register Used:
76 000000 ;***********************************************
77 000000 discharge:
78 000000 mov a,p1
79 000000 and a,#11111001b
80 000000 mov p1,a
81 000000 mov a,#11111110b
82 000000 mov p1m,a
83 000000 discharge90:
84 000000 ret
85 000000
86 000000 ;**********************************************
87 000000 ;Name :rfcharge
88 000000 ;Function:
89 000000 ;Input :
90 000000 ;Output :
91 000000 ;Register Used:
92 000000 ;***********************************************
93 000000 rstandcharge:
94 000000 mov a,p1
95 000000 or a,#00000010b
96 000000 mov p1,a
97 000000 mov a,#11111010b ;p1.1 output 1
98 000000 mov p1m,a
99 000000 clr tmrf1
100 000000 clr tmrf2
101 000000
102 000000 rstandcharge1:
103 000000 mov a,#1
104 000000 add tmrf1,a
105 000000 mov a,#0
106 000000 adc tmrf2,a
107 000000 b0bts0 fc
108 000000 jmp rstandcharge89
109 000000 b0bts1 pttesch
110 000000 jmp rstandcharge1
111 000000
112 000000 jmp rstandcharge90
113 000000 rstandcharge89:
114 000000 mov a,#0ffh ;//error overflow
115 000000 mov tmrf1,a
116 000000 mov tmrf2,a
117 000000
118 000000 rstandcharge90:
119 000000 ret
120 000000
121 000000 ;**********************************************
122 000000 ;Name :rocharge
123 000000 ;Function:
124 000000 ;Input :
125 000000 ;Output :
126 000000 ;Register Used:
127 000000 ;***********************************************
128 000000 rntccharge:
129 000000 mov a,p1
130 000000 or a,#00000100b
131 000000 mov p1,a
132 000000 mov a,#11111100b ;p1.2 output 1
133 000000 mov p1m,a
134 000000 clr tmrntc1
135 000000 clr tmrntc2
136 000000
137 000000 rntccharge1:
138 000000 mov a,#1
139 000000 add tmrntc1,a
140 000000 mov a,#0
141 000000 adc tmrntc2,a
142 000000 b0bts0 fc
143 000000 jmp rntccharge89
144 000000 b0bts1 pttesch
145 000000 jmp rntccharge1
146 000000
147 000000 jmp rntccharge90
148 000000 rntccharge89:
149 000000 mov a,#0ffh ;//error overflow
150 000000 mov tmrntc1,a
151 000000 mov tmrntc1,a
152 000000
153 000000 rntccharge90:
154 000000 ret
155 000000
156 000000 ;**********************************************
157 000000 ;Name :comparerx
158 000000 ;Function:temp5,4=temp3,2/temp1,0
159 000000 ;Input :temp0,temp1,temp2,temp3
160 000000 ;Output :temp4,temp5
161 000000 ;Register Used:
162 000000 ;***********************************************
163 000000 comparerx:
164 000000
165 000000 clr Temp4
166 000000 clr Temp5
167 000000 mov_ Temp9,#9
168 000000 DividLoop:
169 000000 nop
170 000000 DividCont1: ;16位除16位,已经是从高位开始减
171 000000 mov_ r1,temp2
172 000000 mov_ r2,temp3
173 000000 mov A,temp2
174 000000 sub A,temp0
175 000000 mov temp2,A
176 000000 mov A,temp3
177 000000 sbc A,temp1
178 000000 mov temp3,A
179 000000 bts1 FC
180 000000 jmp RestoreData
181 000000
182 000000 add_ temp4,#1
183 000000 mov A,#0
184 000000 adc temp5,A
185 000000
186 000000 jmp DividLoop
187 000000
188 000000 RestoreData:
189 000000 decms temp9
190 000000 jmp L_RSD1
191 000000 jmp DividEnd
192 000000
193 000000 L_RSD1:
194 000000 bclr FC
195 000000 rlc r1
196 000000 mov temp2,A
197 000000 rlc r2
198 000000 mov temp3,A
199 000000 bclr FC
200 000000 rlcm temp4
201 000000 rlcm temp5
202 000000 jmp DividLoop
203 000000
204 000000 DividEnd:
205 000000 comparerx90:
206 000000 ret
207 000000
208 000000 ;****************************************************
209 000000 ;查表得到温度值
210 000000 ;data1,data2
211 000000 detector:
212 000000 clr rcount
213 000000 mov a,#RxTable$m
214 000000 mov y,a
215 000000 mov a,#RxTable$l
216 000000 mov z,a
217 000000 detector10:
218 000000 nop
219 000000 movc
220 000000 mov r0,a
221 000000 mov a,r
222 000000 mov r1,a
223 000000
224 000000 mov a,data1
225 000000 sub a,r0
226 000000 mov a,data2
227 000000 sbc a,r1
228 000000 b0bts1 fc
229 000000 jmp detector20
230 000000 mov a,#0
231 000000 mov rcount,a
232 000000 mov a,#0
233 000000 mov r2,a
234 000000 jmp detector60
235 000000
236 000000 detector20: ; 得到整数部分
237 000000 incms z
238 000000 jmp detector30
239 000000 incms y
240 000000 nop
241 000000 detector30:
242 000000 movc
243 000000 mov r4,a
244 000000 mov a,data1
245 000000 sub a,r4
246 000000 mov a,data2
247 000000 sbc a,r
248 000000 b0bts0 fc
249 000000 jmp detector50
250 000000 mov a,r4
251 000000 mov r0,a
252 000000 mov a,r
253 000000 mov r1,a
254 000000 incms rcount
255 000000 nop
256 000000 mov a,rcount
257 000000 sub a,#40
258 000000 b0bts1 fc
259 000000 jmp detector20
260 000000 mov a,#40
261 000000 mov rcount,a
262 000000 mov a,#0
263 000000 mov r2,a
264 000000 jmp detector60
265 000000
266 000000
267 000000 detector50: ;得到小数部分
268 000000 mov a,r0
269 000000 sub a,r4
270 000000 mov r2,a
271 000000 mov a,r1
272 000000 sbc a,r
273 000000 mov r3,a
274 000000
275 000000 mov a,r0
276 000000 sub a,data1
277 000000 mov r0,a
278 000000 mov a,r1
279 000000 sbc a,data2
280 000000 mov r1,a
281 000000 call DIV_HEX2B
282 000000 mov a,r6
283 000000 add rcount,a
284 000000 mov a,r5
285 000000 mov r2,a
286 000000
287 000000 detector60:
288 000000 call CHA_HEXD1BTOBCD
289 000000 mov a,r2
290 000000 mov temp_dis_d,a
291 000000 mov a,rcount
292 000000 mov r0,a
293 000000 call CHA_HEX1BTOBCD
294 000000 mov a,r2
295 000000 mov temp_dis_i,a
296 000000
297 000000
298 000000 b0bts1 tempfirflag
299 000000 jmp detector80
300 000000 mov a,temp_dis_iold
301 000000 sub a,temp_dis_i
302 000000 sub a,#1
303 000000 b0bts1 fc
304 000000 jmp detector70
305 000000 jmp detector75
306 000000 detector70:
307 000000 mov a,temp_dis_i
308 000000 sub a,temp_dis_iold
309 000000 sub a,#1
310 000000 b0bts1 fc
311 000000 jmp detector79
312 000000 detector75:
313 000000 mov a,tempcount
314 000000 sub a,#5
315 000000 b0bts0 fc
316 000000 jmp detector79
317 000000 incms tempcount
318 000000 nop
319 000000 mov a,temp_dis_iold
320 000000 mov temp_dis_i,a
321 000000 mov a,temp_dis_dold
322 000000 mov temp_dis_d,a
323 000000 jmp detector80
324 000000 detector79:
325 000000 clr tempcount
326 000000 detector80:
327 000000
328 000000 b0mov y,#lcdwtable$m
329 000000 b0mov z,#lcdwtable$l
330 000000 swap temp_dis_i
331 000000 and a,#0fh
332 000000 add z,a
333 000000 movc
334 000000 mov seg1,a
335 000000 mov a,r
336 000000 mov seg2,a
337 000000 b0mov y,#lcdwtable$m
338 000000 b0mov z,#lcdwtable$l
339 000000 mov a,temp_dis_i
340 000000 and a,#0fh
341 000000 add z,a
342 000000 movc
343 000000 mov seg3,a
344 000000 mov a,r
345 000000 or a,#00010000b
346 000000 mov seg4,a
347 000000 b0mov y,#lcdwtable$m
348 000000 b0mov z,#lcdwtable$l
349 000000 mov a,temp_dis_d
350 000000 and a,#0fh
351 000000 add z,a
352 000000 movc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -