📄 level3.lst
字号:
211 .LBE3:
212 /* epilogue: frame size=0 */
213 00a4 CF91 pop r28
214 00a6 1F91 pop r17
215 00a8 0F91 pop r16
216 00aa FF90 pop r15
217 00ac EF90 pop r14
218 00ae 0895 ret
219 /* epilogue end (size=6) */
220 /* function Send size 50 (39) */
221 .size Send, .-Send
222 .stabs "fwd_bit_count:r(4,2)",64,0,57,16
223 .stabs "i:r(4,2)",64,0,58,28
224 .stabn 192,0,0,.LBB3-Send
225 .stabn 224,0,0,.LBE3-Send
226 .Lscope1:
227 .stabs "",36,0,0,.Lscope1-Send
228 .stabs "Capture:F(0,20)",36,0,85,Capture
229 .global Capture
230 .type Capture, @function
231 Capture:
76:level3.c ****
77:level3.c ****
78:level3.c **** // ==================================================================
79:level3.c **** // Down Link setup function
80:level3.c **** // Requires: maxCaptureTime and maxCaptureTimeScale
81:level3.c **** // (located here instead of level2 because of register variables)
82:level3.c ****
83:level3.c ****
84:level3.c **** void Capture( void )
85:level3.c **** {
232 .stabn 68,0,85,.LM19-Capture
233 .LM19:
234 /* prologue: frame size=0 */
235 /* prologue end (size=0) */
86:level3.c **** TCCR0 = 0; //disable Counter0
236 .stabn 68,0,86,.LM20-Capture
237 .LM20:
238 00b0 13BE out 83-0x20,__zero_reg__
87:level3.c **** TCCR1B = 0; //disable Counter1
239 .stabn 68,0,87,.LM21-Capture
240 .LM21:
241 00b2 1EBC out 78-0x20,__zero_reg__
88:level3.c **** TCNT1 = 0;
242 .stabn 68,0,88,.LM22-Capture
243 .LM22:
244 00b4 1DBC out (76)+1-0x20,__zero_reg__
245 00b6 1CBC out 76-0x20,__zero_reg__
89:level3.c ****
90:level3.c **** if ( !bufferClean )
246 .stabn 68,0,90,.LM23-Capture
247 .LM23:
248 00b8 8091 0000 lds r24,bufferClean
249 00bc 8823 tst r24
250 00be 01F1 breq .L16
251 .L12:
91:level3.c **** ClearCaptureBuffers( );
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccWGbaaa.s page 7
92:level3.c **** bufferClean = 0;
252 .stabn 68,0,92,.LM24-Capture
253 .LM24:
254 00c0 1092 0000 sts bufferClean,__zero_reg__
93:level3.c **** captured_bit_count = 0; //reset some values
255 .stabn 68,0,93,.LM25-Capture
256 .LM25:
257 00c4 9924 clr r9
94:level3.c **** // last_valid = 0;
95:level3.c ****
96:level3.c **** //set hi byte of maximum capture timer2 timeout
97:level3.c **** TCNT2 = ~maxCaptureTime; //set timer2 timeout
258 .stabn 68,0,97,.LM26-Capture
259 .LM26:
260 00c6 8091 0000 lds r24,maxCaptureTime
261 00ca 8095 com r24
262 00cc 84BD out 68-0x20,r24
98:level3.c **** TCNT0 = 0; //clear timer0
263 .stabn 68,0,98,.LM27-Capture
264 .LM27:
265 00ce 92BE out 82-0x20,r9
99:level3.c **** TIFR = TIFR | ( 1 << ICF1 ) | ( 1 << TOV1 ) | ( 1 << OCF2 ) | ( 1 << TOV2 ); //clear pendi
266 .stabn 68,0,99,.LM28-Capture
267 .LM28:
268 00d0 88B7 in r24,88-0x20
269 00d2 846E ori r24,lo8(-28)
270 00d4 88BF out 88-0x20,r24
100:level3.c ****
101:level3.c **** sbi( TIMSK , TOIE2 ); //enable timer2 overflow
271 .stabn 68,0,101,.LM29-Capture
272 .LM29:
273 00d6 89B7 in r24,89-0x20
274 00d8 8064 ori r24,lo8(64)
275 00da 89BF out 89-0x20,r24
102:level3.c **** sbi( SFIOR , PSR2 ); //clear timer2 prescaler
276 .stabn 68,0,102,.LM30-Capture
277 .LM30:
278 00dc 80B7 in r24,80-0x20
279 00de 8260 ori r24,lo8(2)
280 00e0 80BF out 80-0x20,r24
103:level3.c ****
104:level3.c **** TCCR2 = maxCaptureTimeScale; //run T2
281 .stabn 68,0,104,.LM31-Capture
282 .LM31:
283 00e2 8091 0000 lds r24,maxCaptureTimeScale
284 00e6 85BD out 69-0x20,r24
105:level3.c ****
106:level3.c ****
107:level3.c **** number = 0;
285 .stabn 68,0,107,.LM32-Capture
286 .LM32:
287 00e8 9092 0000 sts number,r9
108:level3.c **** //type B
109:level3.c **** sbi( GIFR , INTF1 ); //clear any pending interrupt
288 .stabn 68,0,109,.LM33-Capture
289 .LM33:
290 00ec 8AB7 in r24,90-0x20
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccWGbaaa.s page 8
291 00ee 8068 ori r24,lo8(-128)
292 00f0 8ABF out 90-0x20,r24
110:level3.c **** sbi( GICR , INT1 ); //enable interrupt 1
293 .stabn 68,0,110,.LM34-Capture
294 .LM34:
295 00f2 8BB7 in r24,91-0x20
296 00f4 8068 ori r24,lo8(-128)
297 00f6 8BBF out 91-0x20,r24
111:level3.c **** while ( TIMSK & ( 1 << TOIE2 ) ) //wait until done for BPSK
298 .stabn 68,0,111,.LM35-Capture
299 .LM35:
300 .L13:
301 00f8 09B6 in __tmp_reg__,89-0x20
302 00fa 06FC sbrc __tmp_reg__,6
303 00fc FDCF rjmp .L13
304 00fe 02C0 rjmp .L17
305 .stabn 68,0,91,.LM36-Capture
306 .LM36:
307 .L16:
308 0100 00D0 rcall ClearCaptureBuffers
309 0102 DECF rjmp .L12
112:level3.c **** { }
113:level3.c **** cbi( GICR , INT1 ); //disable interrupt 1
310 .stabn 68,0,113,.LM37-Capture
311 .LM37:
312 .L17:
313 0104 8BB7 in r24,91-0x20
314 0106 8F77 andi r24,lo8(127)
315 0108 8BBF out 91-0x20,r24
114:level3.c **** TCCR2 = 0;
316 .stabn 68,0,114,.LM38-Capture
317 .LM38:
318 010a 15BC out 69-0x20,__zero_reg__
115:level3.c **** cbi( TIMSK , TOIE2 ); //disable timer2 overflow
319 .stabn 68,0,115,.LM39-Capture
320 .LM39:
321 010c 89B7 in r24,89-0x20
322 010e 8F7B andi r24,lo8(-65)
323 0110 89BF out 89-0x20,r24
116:level3.c **** sbi( TIFR , TOV2 ); //clear pending interrupt
324 .stabn 68,0,116,.LM40-Capture
325 .LM40:
326 0112 88B7 in r24,88-0x20
327 0114 8064 ori r24,lo8(64)
328 0116 88BF out 88-0x20,r24
117:level3.c **** }
329 .stabn 68,0,117,.LM41-Capture
330 .LM41:
331 /* epilogue: frame size=0 */
332 0118 0895 ret
333 /* epilogue end (size=1) */
334 /* function Capture size 53 (52) */
335 .size Capture, .-Capture
336 .Lscope2:
337 .stabs "",36,0,0,.Lscope2-Capture
338 .stabs "Wait:F(0,20)",36,0,123,Wait
339 .stabs "period:P(4,4)",64,0,122,24
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccWGbaaa.s page 9
340 .global Wait
341 .type Wait, @function
342 Wait:
118:level3.c ****
119:level3.c **** // ==================================================================
120:level3.c **** // Wait
121:level3.c ****
122:level3.c **** void Wait( uint16_t period )
123:level3.c **** {
343 .stabn 68,0,123,.LM42-Wait
344 .LM42:
345 /* prologue: frame size=0 */
346 /* prologue end (size=0) */
124:level3.c **** uint8_t time = ScaleTime( period );
347 .stabn 68,0,124,.LM43-Wait
348 .LM43:
349 .LBB4:
350 011a 2ED0 rcall ScaleTime
125:level3.c **** TCCR2 = 0; //disable Counter2
351 .stabn 68,0,125,.LM44-Wait
352 .LM44:
353 011c 15BC out 69-0x20,__zero_reg__
126:level3.c **** TCNT2 = -time; //set timer with initial time
354 .stabn 68,0,126,.LM45-Wait
355 .LM45:
356 011e 8195 neg r24
357 0120 84BD out 68-0x20,r24
127:level3.c **** TIFR = TIFR | ( 1 << OCF2 ) | ( 1 << TOV2 ); //clear pending interrupts
358 .stabn 68,0,127,.LM46-Wait
359 .LM46:
360 0122 88B7 in r24,88-0x20
361 0124 806C ori r24,lo8(-64)
362 0126 88BF out 88-0x20,r24
128:level3.c **** sbi( SFIOR , PSR2 ); //clear T2 prescaler
363 .stabn 68,0,128,.LM47-Wait
364 .LM47:
365 0128 80B7 in r24,80-0x20
366 012a 8260 ori r24,lo8(2)
367 012c 80BF out 80-0x20,r24
129:level3.c **** sbi( TIMSK , TOIE2 ); //enable overflow
368 .stabn 68,0,129,.LM48-Wait
369 .LM48:
370 012e 89B7 in r24,89-0x20
371 0130 8064 ori r24,lo8(64)
372 0132 89BF out 89-0x20,r24
130:level3.c ****
131:level3.c **** TCCR2 = maxCaptureTimeScale; //run! at clkio/scale
373 .stabn 68,0,131,.LM49-Wait
374 .LM49:
375 0134 8091 0000 lds r24,maxCaptureTimeScale
376 0138 85BD out 69-0x20,r24
132:level3.c **** while ( TIMSK & ( 1 << TOIE2 ) ) //wait until done
377 .stabn 68,0,132,.LM50-Wait
378 .LM50:
379 .L19:
380 013a 09B6 in __tmp_reg__,89-0x20
381 013c 06FC sbrc __tmp_reg__,6
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccWGbaaa.s page 10
382 013e FDCF rjmp .L19
133:level3.c **** { }
134:level3.c **** TCCR2 = 0; //stop
383 .stabn 68,0,134,.LM51-Wait
384 .LM51:
385 0140 15BC out 69-0x20,__zero_reg__
135:level3.c **** }
386 .stabn 68,0,135,.LM52-Wait
387 .LM52:
388 .LBE4:
389 /* epilogue: frame size=0 */
390 0142 0895 ret
391 /* epilogue end (size=1) */
392 /* function Wait size 21 (20) */
393 .size Wait, .-Wait
394 .stabs "time:r(4,2)",64,0,124,24
395 .stabn 192,0,0,.LBB4-Wait
396 .stabn 224,0,0,.LBE4-Wait
397 .Lscope3:
398 .stabs "",36,0,0,.Lscope3-Wait
399 .stabs "ScaleOnce:F(4,4)",36,0,142,ScaleOnce
400 .stabs "period:P(4,4)",64,0,141,24
401 .global ScaleOnce
402 .type ScaleOnce, @function
403 ScaleOnce:
136:level3.c ****
137:level3.c **** // ==================================================================
138:level3.c **** // Scale Once - minimum scale is RF/32
139:level3.c **** // fixed parameters - maxCaptureTimeScale
140:level3.c ****
141:level3.c **** uint16_t ScaleOnce( uint16_t period )
142:level3.c **** {
404 .stabn 68,0,142,.LM53-ScaleOnce
405 .LM53:
406 /* prologue: frame size=0 */
407 /* prologue end (size=0) */
143:level3.c **** if ( period > 255 )
408 .stabn 68,0,143,.LM54-ScaleOnce
409 .LM54:
410 0144 8F3F cpi r24,255
411 0146 9105 cpc r25,__zero_reg__
412 0148 79F0 breq .L23
413 014a 70F0 brlo .L23
144:level3.c **** {
145:level3.c **** period /= 2;
414 .stabn 68,0,145,.LM55-ScaleOnce
415 .LM55:
416 014c 9695 lsr r25
417 014e 8795 ror r24
146:level3.c **** if ( maxCaptureTimeScale <= 5 )
418 .stabn 68,0,146,.LM56-ScaleOnce
419 .LM56:
420 0150 2091 0000 lds r18,maxCaptureTimeScale
421 0154 2630 cpi r18,lo8(6)
422 0156 58F0 brlo .L29
147:level3.c **** {
148:level3.c **** maxCaptureTimeScale++;
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccWGbaaa.s page 11
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -