	.module TaskManager.c
	.area text(rom, con, rel)
	.dbfile ..\..\..\POWERS~2\GRAPHL~1\Code\TaskManager.c
	.area data(ram, con, rel)
	.dbfile ..\..\..\POWERS~2\GRAPHL~1\Code\TaskManager.c
_TaskMax::
	.blkb 2
	.area idata
	.word 0
	.area data(ram, con, rel)
	.dbfile ..\..\..\POWERS~2\GRAPHL~1\Code\TaskManager.c
	.dbfile C:\DATA\POWERS~2\GRAPHL~1\Code\TaskManager.c
	.dbsym e TaskMax _TaskMax I
	.area text(rom, con, rel)
	.dbfile C:\DATA\POWERS~2\GRAPHL~1\Code\TaskManager.c
	.dbfunc e TaskInit _TaskInit fV
	.even
_TaskInit::
	.dbline -1
	.dbline 59
; //*****************************************************************************
; // TaskManager
; // Version 2.0 Fev 2005
; //
; // 2.0 -> -Re work all the interrupt code
; // 1.0 -> -Everything is new
; //
; // Sylvain Bissonnette
; //*****************************************************************************
; // Editor : UltraEdit32
; //*****************************************************************************
; //                T I M E R   U S A G E
; //
; // Timer 0 is use by Task Manager
; //
; //*****************************************************************************
; //
; //*****************************************************************************
; //                      I N C L U D E
; //*****************************************************************************
; #include <iom32v.h>
; #include <shortnametype.h>
; #include <macros.h>
; #include <stdlib.h>
; #include <STRING.H>
; #include "TaskManager.h"
; //#define MINIMUM_CODE    // if def save 71 words of code but no more
;                           // checking of Register and UnRegister
; 
; //*****************************************************************************
; //            G L O B A L   V A R I A B L E
; //*****************************************************************************
; typedef struct Task
; {
;   void (*FunctionPTR)(void);
;   uint Interval;
;   uint Ticker;
;   ushort Persiste;
; }Task;
; Task TaskList[MAX_TASK];
; Task TaskAdd;
; Task TaskDel;
; int TaskMax = 0;
; 
; /******************************************************************************
; 
; Name:         void TaskInit(void)
; 
; Description:  Init task system
; 
; Input:        none
; 
; Output:       none
; 
; Misc:         Use Timer 0
; 
; ******************************************************************************/
; void TaskInit(void)
; {
	.dbline 61
;   //Timer0
;   TCCR0 = 0x02;               // Timer0 / 8
	ldi R24,2
	out 0x33,R24
	.dbline 62
;   TIMSK |= (1<<TOIE0);        // int enable on Timer 0 overflow
	in R24,0x39
	ori R24,1
	out 0x39,R24
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e TaskRegister _TaskRegister fI
;              i -> R20,R21
;       Persiste -> y+2
;       Interval -> R18,R19
;    FunctionPTR -> R16,R17
	.even
_TaskRegister::
	st -y,R20
	st -y,R21
	.dbline -1
	.dbline 86
; }
; 
; /******************************************************************************
; 
; Name:         int TaskRegister( void(*FunctionPTR)(void),
;                                 int Interval,
;                                 ushort Persiste)
; 
; Description:  Register a function to be call
; 
; Input:        void  Function pointer
;               int   Interval
;               uchar Persiste
; 
; Output:       0 -> Task not registrated (error)
;               1 -> Task is now registrated
; 
; Misc:
; 
; ******************************************************************************/
; int TaskRegister(void(*FunctionPTR)(void),
;                  uint Interval,
;                  ushort Persiste)
; {
	.dbline 88
;   #ifndef MINIMUM_CODE
;   uint i = 0;
	clr R20
	clr R21
	.dbline 90
; 
;   if (FunctionPTR == NULL) return 0;
	cpi R16,0
	cpc R16,R17
	brne L3
X0:
	.dbline 90
	clr R16
	clr R17
	xjmp L2
L3:
	.dbline 91
;   if (TaskMax >= MAX_TASK) return 0;
	lds R24,_TaskMax
	lds R25,_TaskMax+1
	cpi R24,10
	ldi R30,0
	cpc R25,R30
	brlt L8
X1:
	.dbline 91
	clr R16
	clr R17
	xjmp L2
L7:
	.dbline 94
; 
;   while (TaskAdd.FunctionPTR != NULL)
;   {
	.dbline 95
;     WDR();
	wdr
	.dbline 96
;     if (i++ > 65530) return 0;
	movw R2,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	ldi R24,250
	ldi R25,255
	ldi R26,0
	ldi R27,0
	clr R4
	clr R5
	cp R24,R2
	cpc R25,R3
	cpc R26,R4
	cpc R27,R5
	brge L10
X2:
	.dbline 96
	clr R16
	clr R17
	xjmp L2
L10:
	.dbline 97
;   }
L8:
	.dbline 93
	lds R2,_TaskAdd
	lds R3,_TaskAdd+1
	tst R2
	brne L7
	tst R3
	brne L7
X3:
	.dbline 99
;   #endif
;   TaskAdd.FunctionPTR = FunctionPTR;
	sts _TaskAdd+1,R17
	sts _TaskAdd,R16
	.dbline 100
;   TaskAdd.Interval = Interval;
	sts _TaskAdd+2+1,R19
	sts _TaskAdd+2,R18
	.dbline 101
;   TaskAdd.Persiste = Persiste;
	ldd R0,y+2
	sts _TaskAdd+6,R0
	.dbline 102
;   return 1;
	ldi R16,1
	ldi R17,0
	.dbline -2
L2:
	.dbline 0 ; func end
	ld R21,y+
	ld R20,y+
	ret
	.dbsym r i 20 i
	.dbsym l Persiste 2 c
	.dbsym r Interval 18 i
	.dbsym r FunctionPTR 16 pfV
	.dbend
	.dbfunc e TaskUnRegister _TaskUnRegister fI
;              i -> R20,R21
;    FunctionPTR -> R16,R17
	.even
_TaskUnRegister::
	st -y,R20
	st -y,R21
	.dbline -1
	.dbline 120
; }
; 
; /******************************************************************************
; 
; Name:         int TaskUnRegister(void(*FunctionPTR)(void))
; 
; Description:  UnRegister a function
; 
; Input:        Function pointer
; 
; Output:       0 -> Task not find
;               1 -> Task is unregistrated
; 
; Misc:
; 
; ******************************************************************************/
; int TaskUnRegister(void(*FunctionPTR)(void))
; {
	.dbline 122
;   #ifndef MINIMUM_CODE
;   uint i = 0;
	clr R20
	clr R21
	.dbline 124
; 
;   if (FunctionPTR == NULL) return 0;
	cpi R16,0
	cpc R16,R17
	brne L18
X4:
	.dbline 124
	clr R16
	clr R17
	xjmp L14
L17:
	.dbline 127
; 
;   while(TaskDel.FunctionPTR != NULL)
;   {
	.dbline 128
;     WDR();
	wdr
	.dbline 129
;     if (i++ > 65530) return 0;
	movw R2,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	ldi R24,250
	ldi R25,255
	ldi R26,0
	ldi R27,0
	clr R4
	clr R5
	cp R24,R2
	cpc R25,R3
	cpc R26,R4
	cpc R27,R5
	brge L20
X5:
	.dbline 129
	clr R16
	clr R17
	xjmp L14
L20:
	.dbline 130
;   }
L18:
	.dbline 126
	lds R2,_TaskDel
	lds R3,_TaskDel+1
	tst R2
	brne L17
	tst R3
	brne L17
X6:
	.dbline 132
;   #endif
;   TaskDel.FunctionPTR = FunctionPTR;
	sts _TaskDel+1,R17
	sts _TaskDel,R16
	.dbline 133
;   return 1;
	ldi R16,1
	ldi R17,0
	.dbline -2
L14:
	.dbline 0 ; func end
	ld R21,y+
	ld R20,y+
	ret
	.dbsym r i 20 i
	.dbsym r FunctionPTR 16 pfV
	.dbend
	.dbfunc e TaskCheckRegister _TaskCheckRegister fI
;              i -> R10
;    FunctionPTR -> R16,R17
	.even
_TaskCheckRegister::
	st -y,R10
	.dbline -1
	.dbline 151
; }
; 
; /**********************************************************
; 
; Name:         int TaskCheckRegister(void(*FunctionPTR)(void))
; 
; Description:  Check if a function is register
; 
; Input:        Function pointer
; 
; Output:       0 -> Not register
;               1 -> Register
; 
; Misc:
; 
; **********************************************************/
; int TaskCheckRegister(void(*FunctionPTR)(void))
; {
	.dbline 154
;   ushort i;
; 
;   for (i=0; i < TaskMax; i++)
	clr R10
	xjmp L26
L23:
	.dbline 155
;   {
	.dbline 156
;     if (TaskList[i].FunctionPTR == FunctionPTR) return 1;
	ldi R24,7
	mul R24,R10
	movw R30,R0
	ldi R24,<_TaskList
	ldi R25,>_TaskList
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	ldd R3,z+1
	cp R2,R16
	cpc R3,R17
	brne L27
X7:
	.dbline 156
	ldi R16,1
	ldi R17,0
	xjmp L22
L27:
	.dbline 157
;   }
L24:
	.dbline 154
	inc R10
L26:
	.dbline 154
	lds R2,_TaskMax
	lds R3,_TaskMax+1
	mov R4,R10
	clr R5
	cp R4,R2
	cpc R5,R3
	brlt L23
X8:
	.dbline 158
;   return 0;
	clr R16
	clr R17
	.dbline -2
L22:
	.dbline 0 ; func end
	ld R10,y+
	ret
	.dbsym r i 10 c
	.dbsym r FunctionPTR 16 pfV
	.dbend
	.dbfunc e TaskBlock _TaskBlock fV
;           Time -> R10,R11
	.even
_TaskBlock::
	st -y,R10
	st -y,R11
	movw R10,R16
	sbiw R28,1
	.dbline -1
	.dbline 175
; }
; 
; /**********************************************************
; 
; Name:         void TaskBlock(int Time)
; 
; Description:  Block for x time
; 
; Input:        none
; 
; Output:       none
; 
; Misc:
; 
; **********************************************************/
; void TaskBlock(uint Time)
; {
	.dbline 176
;   TaskRegister(TaskDummy,Time,FALSE);
	clr R2
	std y+0,R2
	movw R18,R10
	ldi R16,<PL_TaskDummy
	ldi R17,>PL_TaskDummy
	xcall _TaskRegister
	xjmp L31
L30:
	.dbline 177
;   while (TaskCheckRegister(TaskDummy)) WDR();
	wdr
L31:
	.dbline 177
	ldi R16,<PL_TaskDummy
	ldi R17,>PL_TaskDummy
	xcall _TaskCheckRegister
	cpi R16,0
	cpc R16,R17
	brne L30
X9:
	.dbline -2
L29:
	.dbline 0 ; func end
	adiw R28,1
	ld R11,y+
	ld R10,y+
	ret
	.dbsym r Time 10 i
	.dbend
	.dbfunc e TaskDummy _TaskDummy fV
	.even
_TaskDummy::
	.dbline -1
	.dbline 181
; }
; 
; void TaskDummy(void)
; {
	.dbline -2
L33:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e TaskStop _TaskStop fV
	.even
_TaskStop::
	.dbline -1
	.dbline 198
; }
; 
; /**********************************************************
; 
; Name:         void TaskStop(void)
; 
; Description:  Stop Task Execution
; 
; Input:        none
; 
; Output:       none
; 
; Misc:
; 
; **********************************************************/
; void TaskStop(void)
; {
	.dbline 199
;   TIMSK &= ~(1<<TOIE0);   // int disable on Timer 0 overflow
	in R24,0x39
	andi R24,254
	out 0x39,R24
	.dbline -2
L34:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e TaskStart _TaskStart fV
	.even
_TaskStart::
	.dbline -1
	.dbline 216
; }
; 
; /**********************************************************
; 
; Name:         void TaskStart(void)
; 
; Description:  Start Task Execution
; 
; Input:        none
; 
; Output:       none
; 
; Misc:
; 
; **********************************************************/
; void TaskStart(void)
; {
	.dbline 217
;   TIMSK |= (1<<TOIE0);    // int enable on Timer 0 overflow
	in R24,0x39
	ori R24,1
	out 0x39,R24
	.dbline -2
L35:
	.dbline 0 ; func end
	ret
	.dbend
	.area vector(rom, abs)
	.org 44
	jmp _TaskExecute
	.area text(rom, con, rel)
	.dbfile C:\DATA\POWERS~2\GRAPHL~1\Code\TaskManager.c
	.area bss(ram, con, rel)
	.dbfile C:\DATA\POWERS~2\GRAPHL~1\Code\TaskManager.c
L37:
	.blkb 1
L38:
	.blkb 1
L39:
	.blkb 2
	.area text(rom, con, rel)
	.dbfile C:\DATA\POWERS~2\GRAPHL~1\Code\TaskManager.c
	.dbfunc e TaskExecute _TaskExecute fV
	.dbsym s FunctionPTR L39 pfV
	.dbsym s j L38 c
	.dbsym s i L37 c
	.even
_TaskExecute::
	st -y,R0
	st -y,R1
	st -y,R2
	st -y,R3
	st -y,R4
	st -y,R5
	st -y,R6
	st -y,R7
	st -y,R8
	st -y,R9
	st -y,R16
	st -y,R17
	st -y,R18
	st -y,R19
	st -y,R24
	st -y,R25
	st -y,R26
	st -y,R27
	st -y,R30
	st -y,R31
	IN R0,63
	st -y,R0
	st -y,R10
	st -y,R11
	sbiw R28,2
	.dbline -1
	.dbline 235
; }
; 
; /**********************************************************
; 
; Name:         void TaskExecute(void)
; 
; Description:  TaskExecute
; 
; Input:        none
; 
; Output:       none
; 
; Misc:         TaskExecute is execute each 100us
; 
; **********************************************************/
; #pragma interrupt_handler TaskExecute:12
; void TaskExecute(void)
; {
	.dbline 239
;   static ushort i,j;
;   static void (*FunctionPTR)(void);
; 
;   TCNT0 = 255 - (XTAL / 8 / 10000);
	ldi R24,155
	out 0x32,R24
	.dbline 240
;   TaskStop();
	xcall _TaskStop
	.dbline 241
;   WDR();
	wdr
	.dbline 243
; 
;   if (TaskDel.FunctionPTR != NULL) _TaskUnRegister();
	lds R2,_TaskDel
	lds R3,_TaskDel+1
	tst R2
	brne X10
	tst R3
	breq L40
X10:
	.dbline 243
	xcall __TaskUnRegister
L40:
	.dbline 244
;   if (TaskAdd.FunctionPTR != NULL) _TaskRegister();
	lds R2,_TaskAdd
	lds R3,_TaskAdd+1
	tst R2
	brne X11
	tst R3
	breq L42
X11:
	.dbline 244
	xcall __TaskRegister
L42:
	.dbline 246
;   
;   for (i=0;i<TaskMax;i++)
	clr R2
	sts L37,R2
	xjmp L47
L44:
	.dbline 247
;   {
	.dbline 248
;     if (TaskList[i].Ticker++ >= TaskList[i].Interval) 
	lds R2,L37
	ldi R24,7
	mul R24,R2
	movw R2,R0
	ldi R24,<_TaskList+4
	ldi R25,>_TaskList+4
	add R2,R24
	adc R3,R25
	movw R30,R2
	ldd R6,z+0
	ldd R7,z+1
	movw R24,R6
	adiw R24,1
	std z+1,R25
	std z+0,R24
	lds R2,L37
	ldi R24,7
	mul R24,R2
	movw R30,R0
	ldi R24,<_TaskList+2
	ldi R25,>_TaskList+2
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	ldd R3,z+1
	cp R6,R2
	cpc R7,R3
	brsh X16
	xjmp L48
X16:
X12:
	.dbline 249
;     {
	.dbline 250
;       FunctionPTR = TaskList[i].FunctionPTR;
	lds R2,L37
	ldi R24,7
	mul R24,R2
	movw R30,R0
	ldi R24,<_TaskList
	ldi R25,>_TaskList
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	ldd R3,z+1
	sts L39+1,R3
	sts L39,R2
	.dbline 251
;       if (!TaskList[i].Persiste)
	lds R2,L37
	ldi R24,7
	mul R24,R2
	movw R30,R0
	ldi R24,<_TaskList+6
	ldi R25,>_TaskList+6
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	tst R2
	brne L52
X13:
	.dbline 252
;       {
	.dbline 253
;         for (j=i;j<TaskMax;j++) memcpy(&TaskList[j],&TaskList[j+1],sizeof(Task));
	lds R2,L37
	sts L38,R2
	xjmp L58
L55:
	.dbline 253
	ldi R24,7
	ldi R25,0
	std y+1,R25
	std y+0,R24
	lds R2,L38
	mul R24,R2
	movw R10,R0
	ldi R24,<_TaskList+7
	ldi R25,>_TaskList+7
	movw R18,R10
	add R18,R24
	adc R19,R25
	ldi R24,<_TaskList
	ldi R25,>_TaskList
	movw R16,R10
	add R16,R24
	adc R17,R25
	xcall _memcpy
L56:
	.dbline 253
	lds R24,L38
	subi R24,255    ; addi 1
	sts L38,R24
L58:
	.dbline 253
	lds R2,_TaskMax
	lds R3,_TaskMax+1
	lds R4,L38
	clr R5
	cp R4,R2
	cpc R5,R3
	brlt L55
X14:
	.dbline 254
;         TaskMax--;
	movw R24,R2
	sbiw R24,1
	sts _TaskMax+1,R25
	sts _TaskMax,R24
	.dbline 255
;       }
	xjmp L53
L52:
	.dbline 257
;       else
;       {
	.dbline 258
;         TaskList[i].Ticker = 0;
	lds R2,L37
	ldi R24,7
	mul R24,R2
	movw R30,R0
	ldi R24,<_TaskList+4
	ldi R25,>_TaskList+4
	add R30,R24
	adc R31,R25
	clr R2
	clr R3
	std z+1,R3
	std z+0,R2
	.dbline 259
;       }
L53:
	.dbline 260
;       SEI();
	sei
	.dbline 261
;       FunctionPTR();
	lds R30,L39
	lds R31,L39+1
	xcall xicall
	.dbline 262
;       CLI();
	cli
	.dbline 263
;     }
L48:
	.dbline 264
;   }
L45:
	.dbline 246
	lds R24,L37
	subi R24,255    ; addi 1
	sts L37,R24
L47:
	.dbline 246
	lds R2,_TaskMax
	lds R3,_TaskMax+1
	lds R4,L37
	clr R5
	cp R4,R2
	cpc R5,R3
	brge X17
	xjmp L44
X17:
X15:
	.dbline 265
;   TaskStart();
	xcall _TaskStart
	.dbline -2
L36:
	.dbline 0 ; func end
	adiw R28,2
	ld R11,y+
	ld R10,y+
	ld R0,y+
	OUT 63,R0
	ld R31,y+
	ld R30,y+
	ld R27,y+
	ld R26,y+
	ld R25,y+
	ld R24,y+
	ld R19,y+
	ld R18,y+
	ld R17,y+
	ld R16,y+
	ld R9,y+
	ld R8,y+
	ld R7,y+
	ld R6,y+
	ld R5,y+
	ld R4,y+
	ld R3,y+
	ld R2,y+
	ld R1,y+
	ld R0,y+
	reti
	.dbend
	.dbfunc e _TaskUnRegister __TaskUnRegister fV
;              i -> R10
;              j -> R12
	.even
__TaskUnRegister::
	st -y,R10
	st -y,R12
	sbiw R28,2
	.dbline -1
	.dbline 282
; }
; 
; /******************************************************************************
; 
; Name:         void _TaskUnRegister(void)
; 
; Description:  UnRegister a function
; 
; Input:        TaskDel struct
; 
; Output:       none
; 
; Misc:
; 
; ******************************************************************************/
; void _TaskUnRegister(void)
; {
	.dbline 285
;   ushort i,j;
; 
;   for (i=0;i<TaskMax;i++)
	clr R10
	xjmp L65
L62:
	.dbline 286
;   {
	.dbline 287
;     if (TaskList[i].FunctionPTR == TaskDel.FunctionPTR)
	ldi R24,7
	mul R24,R10
	movw R30,R0
	ldi R24,<_TaskList
	ldi R25,>_TaskList
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	ldd R3,z+1
	lds R4,_TaskDel
	lds R5,_TaskDel+1
	cp R2,R4
	cpc R3,R5
	brne L66
X18:
	.dbline 288
;     {
	.dbline 289
;       for (j=i;j<TaskMax;j++) memcpy(&TaskList[j],&TaskList[j+1],sizeof(Task));
	mov R12,R10
	xjmp L71
L68:
	.dbline 289
	ldi R24,7
	ldi R25,0
	std y+1,R25
	std y+0,R24
	mul R24,R12
	ldi R24,<_TaskList+7
	ldi R25,>_TaskList+7
	movw R18,R0
	add R18,R24
	adc R19,R25
	ldi R24,<_TaskList
	ldi R25,>_TaskList
	movw R16,R0
	add R16,R24
	adc R17,R25
	xcall _memcpy
L69:
	.dbline 289
	inc R12
L71:
	.dbline 289
	lds R2,_TaskMax
	lds R3,_TaskMax+1
	mov R4,R12
	clr R5
	cp R4,R2
	cpc R5,R3
	brlt L68
X19:
	.dbline 290
;       TaskMax--;
	movw R24,R2
	sbiw R24,1
	sts _TaskMax+1,R25
	sts _TaskMax,R24
	.dbline 291
;       TaskDel.FunctionPTR = NULL;
	clr R2
	clr R3
	sts _TaskDel+1,R3
	sts _TaskDel,R2
	.dbline 292
;       return;
	xjmp L61
L66:
	.dbline 294
;     }
;   }
L63:
	.dbline 285
	inc R10
L65:
	.dbline 285
	lds R2,_TaskMax
	lds R3,_TaskMax+1
	mov R4,R10
	clr R5
	cp R4,R2
	cpc R5,R3
	brge X21
	xjmp L62
X21:
X20:
	.dbline 295
;   TaskDel.FunctionPTR = NULL;
	clr R2
	clr R3
	sts _TaskDel+1,R3
	sts _TaskDel,R2
	.dbline -2
L61:
	.dbline 0 ; func end
	adiw R28,2
	ld R12,y+
	ld R10,y+
	ret
	.dbsym r i 10 c
	.dbsym r j 12 c
	.dbend
	.dbfunc e _TaskRegister __TaskRegister fV
	.even
__TaskRegister::
	.dbline -1
	.dbline 312
; }
; 
; /******************************************************************************
; 
; Name:         int _TaskRegister(void)
; 
; Description:  Register a function
; 
; Input:        TaskAdd struct
; 
; Output:       none
; 
; Misc:
; 
; ******************************************************************************/
; void _TaskRegister(void)
; {
	.dbline 313
;   TaskList[TaskMax].FunctionPTR = TaskAdd.FunctionPTR;
	lds R18,_TaskMax
	lds R19,_TaskMax+1
	ldi R16,7
	ldi R17,0
	xcall empy16s
	movw R30,R16
	ldi R24,<_TaskList
	ldi R25,>_TaskList
	add R30,R24
	adc R31,R25
	lds R2,_TaskAdd
	lds R3,_TaskAdd+1
	std z+1,R3
	std z+0,R2
	.dbline 314
;   TaskList[TaskMax].Interval = TaskAdd.Interval;
	lds R18,_TaskMax
	lds R19,_TaskMax+1
	ldi R16,7
	ldi R17,0
	xcall empy16s
	movw R30,R16
	ldi R24,<_TaskList+2
	ldi R25,>_TaskList+2
	add R30,R24
	adc R31,R25
	lds R2,_TaskAdd+2
	lds R3,_TaskAdd+2+1
	std z+1,R3
	std z+0,R2
	.dbline 315
;   TaskList[TaskMax].Ticker = 0;
	lds R18,_TaskMax
	lds R19,_TaskMax+1
	ldi R16,7
	ldi R17,0
	xcall empy16s
	movw R30,R16
	ldi R24,<_TaskList+4
	ldi R25,>_TaskList+4
	add R30,R24
	adc R31,R25
	clr R2
	clr R3
	std z+1,R3
	std z+0,R2
	.dbline 316
;   TaskList[TaskMax].Persiste = TaskAdd.Persiste;
	lds R18,_TaskMax
	lds R19,_TaskMax+1
	ldi R16,7
	ldi R17,0
	xcall empy16s
	movw R30,R16
	ldi R24,<_TaskList+6
	ldi R25,>_TaskList+6
	add R30,R24
	adc R31,R25
	lds R2,_TaskAdd+6
	std z+0,R2
	.dbline 317
;   TaskAdd.FunctionPTR = NULL;
	clr R2
	clr R3
	sts _TaskAdd+1,R3
	sts _TaskAdd,R2
	.dbline 318
;   TaskMax++;
	lds R24,_TaskMax
	lds R25,_TaskMax+1
	adiw R24,1
	sts _TaskMax+1,R25
	sts _TaskMax,R24
	.dbline -2
L73:
	.dbline 0 ; func end
	ret
	.dbend
	.area bss(ram, con, rel)
	.dbfile C:\DATA\POWERS~2\GRAPHL~1\Code\TaskManager.c
_TaskDel::
	.blkb 7
	.dbstruct 0 7 Task
	.dbfield 0 FunctionPTR pfV
	.dbfield 2 Interval i
	.dbfield 4 Ticker i
	.dbfield 6 Persiste c
	.dbend
	.dbsym e TaskDel _TaskDel S[Task]
_TaskAdd::
	.blkb 7
	.dbsym e TaskAdd _TaskAdd S[Task]
_TaskList::
	.blkb 70
	.dbsym e TaskList _TaskList A[70:10]S[Task]
; }
	.area  func_lit
PL_TaskDummy:	.word `_TaskDummy
