\prog:Pict870y.asm|Test la tâche YyTimeT.asi .Proc 16F870 .Ref 16F870 \var:Variables| .Loc DebVar TkTime: .16 1 ; Pointeur de la tâche Time Cnt20ms: .16 1 Cnt1s: .16 1 Timer1: .16 1 FlagTimer: .16 1 b20ms = 1 ; numéro du bit b1s = 2 \const:Constantes| IniOption = 2'00001000 ; 1 us decrement Perio = 100 ; microsecondes IniCnt20ms = 20000/Perio IniCnt1s = 1000/20 \const:PortC| bLed = 0 DirC = 0 ; Il faut au moins le bit bLed en sortie \macro;Led| .Macro LedOn Clr PortC:#bLed .Endmacro .Macro LedOff Set PortC:#bLed .EndMacro .Loc 0 \prog:Initialisation ; On initalise les ports Move #DirC,W Move W,TrisC ;On initialise les variables Move #IniCnt20ms,W Move W,Cnt20ms Move #IniCnt1s,W Move W,Cnt1s Clr FlagTimer Clr Timer1 ; On met en route le timer et les interruptions Move #IniOption,W Move W,Option Move #256-Perio+2,W Move W,TMR0 Loop: W$: TestSkip,BS IntCon:#TOIF Jump W$ Clr Intcon:#TOIF Move #256-Perio+2,W Move W,TMR0 ; S1On ; Pour mesurer la durée des tâches .Ins YYTimeT.asi ; L'arbre des tâches ; S1Off Jump Loop .End