📄 mc_vtimer.ls
字号:
1 ; C Compiler for STM8 (COSMIC Software)
2 ; Parser V4.9.10 - 10 Feb 2011
3 ; Generator (Limited) V4.3.6 - 15 Feb 2011
4 ; Optimizer V4.3.5 - 15 Feb 2011
59 ; 31 void vtimer_init()
59 ; 32 {
61 switch .text
62 0000 _vtimer_init:
64 0000 88 push a
65 00000001 OFST: set 1
68 ; 34 for (i = 0; i < VTIMER_NUM; i++)
70 0001 4f clr a
71 0002 6b01 ld (OFST+0,sp),a
72 0004 L13:
73 ; 36 sVtimer[i].msec = 0;
75 0004 97 ld xl,a
76 0005 a604 ld a,#4
77 0007 42 mul x,a
78 0008 905f clrw y
79 000a df0000 ldw (L3_sVtimer,x),y
80 ; 37 sVtimer[i].pCallback = 0;
82 000d df0002 ldw (L3_sVtimer+2,x),y
83 ; 34 for (i = 0; i < VTIMER_NUM; i++)
85 0010 0c01 inc (OFST+0,sp)
88 0012 7b01 ld a,(OFST+0,sp)
89 0014 a10a cp a,#10
90 0016 25ec jrult L13
91 ; 39 }
94 0018 84 pop a
95 0019 81 ret
233 ; 41 void vtimer_SetTimer(VtimerName_t name,timer_res_t msec,void* pCallback)
233 ; 42 {
234 switch .text
235 001a _vtimer_SetTimer:
237 001a 88 push a
238 00000000 OFST: set 0
241 ; 43 sVtimer[name].msec = msec;
243 001b 97 ld xl,a
244 001c a604 ld a,#4
245 001e 42 mul x,a
246 001f 1604 ldw y,(OFST+4,sp)
247 0021 df0000 ldw (L3_sVtimer,x),y
248 ; 44 sVtimer[name].pCallback = pCallback;
250 0024 7b01 ld a,(OFST+1,sp)
251 0026 97 ld xl,a
252 0027 a604 ld a,#4
253 0029 42 mul x,a
254 002a 1606 ldw y,(OFST+6,sp)
255 002c df0002 ldw (L3_sVtimer+2,x),y
256 ; 45 }
259 002f 84 pop a
260 0030 81 ret
296 ; 47 void vtimer_KillTimer(VtimerName_t name)
296 ; 48 {
297 switch .text
298 0031 _vtimer_KillTimer:
300 0031 88 push a
301 00000000 OFST: set 0
304 ; 49 sVtimer[name].msec = 0;
306 0032 97 ld xl,a
307 0033 a604 ld a,#4
308 0035 42 mul x,a
309 0036 905f clrw y
310 0038 df0000 ldw (L3_sVtimer,x),y
311 ; 50 sVtimer[name].pCallback = 0;
313 003b 7b01 ld a,(OFST+1,sp)
314 003d 97 ld xl,a
315 003e a604 ld a,#4
316 0040 42 mul x,a
317 ; 51 }
320 0041 84 pop a
321 0042 df0002 ldw (L3_sVtimer+2,x),y
322 0045 81 ret
359 ; 53 u8 vtimer_TimerElapsed(VtimerName_t name)
359 ; 54 {
360 switch .text
361 0046 _vtimer_TimerElapsed:
365 ; 55 if (sVtimer[name].msec == 0)
367 0046 97 ld xl,a
368 0047 a604 ld a,#4
369 0049 42 mul x,a
370 004a d60001 ld a,(L3_sVtimer+1,x)
371 004d da0000 or a,(L3_sVtimer,x)
372 0050 2602 jrne L351
373 ; 56 return TRUE;
375 0052 4c inc a
378 0053 81 ret
379 0054 L351:
380 ; 58 return FALSE;
382 0054 4f clr a
385 0055 81 ret
421 ; 63 void vtimer_UpdateHandler(void)
421 ; 64 {
422 switch .text
423 0056 _vtimer_UpdateHandler:
425 0056 88 push a
426 00000001 OFST: set 1
429 ; 68 for (i = 0; i < VTIMER_NUM; i++)
431 0057 4f clr a
432 0058 6b01 ld (OFST+0,sp),a
433 005a L571:
434 ; 70 if (sVtimer[i].msec != 0)
436 005a 97 ld xl,a
437 005b a604 ld a,#4
438 005d 42 mul x,a
439 005e d60001 ld a,(L3_sVtimer+1,x)
440 0061 da0000 or a,(L3_sVtimer,x)
441 0064 2724 jreq L302
442 ; 72 sVtimer[i].msec--;
444 0066 9093 ldw y,x
445 0068 de0000 ldw x,(L3_sVtimer,x)
446 006b 5a decw x
447 006c 90df0000 ldw (L3_sVtimer,y),x
448 ; 73 if (sVtimer[i].pCallback != 0)
450 0070 7b01 ld a,(OFST+0,sp)
451 0072 97 ld xl,a
452 0073 a604 ld a,#4
453 0075 42 mul x,a
454 0076 d60003 ld a,(L3_sVtimer+3,x)
455 0079 da0002 or a,(L3_sVtimer+2,x)
456 007c 270c jreq L302
457 ; 75 if (sVtimer[i].msec == 0)
459 007e d60001 ld a,(L3_sVtimer+1,x)
460 0081 da0000 or a,(L3_sVtimer,x)
461 0084 2604 jrne L302
462 ; 77 ((PFN_Callback_t)sVtimer[i].pCallback)();
464 0086 de0002 ldw x,(L3_sVtimer+2,x)
465 0089 fd call (x)
467 008a L302:
468 ; 68 for (i = 0; i < VTIMER_NUM; i++)
470 008a 0c01 inc (OFST+0,sp)
473 008c 7b01 ld a,(OFST+0,sp)
474 008e a10a cp a,#10
475 0090 25c8 jrult L571
476 ; 82 }
479 0092 84 pop a
480 0093 81 ret
531 switch .bss
532 0000 L3_sVtimer:
533 0000 000000000000 ds.b 40
534 xdef _vtimer_UpdateHandler
535 xdef _vtimer_TimerElapsed
536 xdef _vtimer_KillTimer
537 xdef _vtimer_SetTimer
538 xdef _vtimer_init
558 end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -