	.module task1.c
	.area text
;              i -> -2,x
_task1::
	pshx
	tfr s,x
	leas -2,sp
; // task1.c
; 
; #include <stdio.h>
; #include <912d60.h>
; #include "kernel.h"
; 
; 
; 
; /* dummy task to eat up time, and to give the kernel
;    something to multitask with  */
; int task1 (void) {
; 	 
; 	 int i;
; 	 
; 	 get_mutex(COM1);
	ldd #3
	jsr _get_mutex
; 	 INTR_ON();
		cli

; 	 
; 	 
; 	 puts("T1 Starting");
	ldd #L4
	jsr _puts
	ldd #0
	std -2,x
L5:
L6:
; 	 for (i=0; i<0x0800; i++);
	ldd -2,x
	addd #1
	std -2,x
	ldd -2,x
	cpd #2048
	blt L5
; 	 puts("T1.1");
	ldd #L9
	jsr _puts
	ldd #0
	std -2,x
L10:
L11:
; 	 
; 	 for (i=0; i<0x1000; i++);
	ldd -2,x
	addd #1
	std -2,x
	ldd -2,x
	cpd #4096
	blt L10
; 	 puts("T1.2");
	ldd #L14
	jsr _puts
	ldd #0
	std -2,x
L15:
L16:
; 	 
; 	 for (i=0; i<0x1A00; i++);
	ldd -2,x
	addd #1
	std -2,x
	ldd -2,x
	cpd #6656
	blt L15
; 	 puts("T1.3");
	ldd #L19
	jsr _puts
	ldd #0
	std -2,x
L20:
L21:
; 
; 	 for (i=0; i<0x2000; i++);
	ldd -2,x
	addd #1
	std -2,x
	ldd -2,x
	cpd #8192
	blt L20
; 	 puts("T1 Finished");
	ldd #L24
	jsr _puts
; 	 
; 	 
; 	 
; 	 INTR_OFF();
		sei

; 	 give_mutex(COM1);
	ldd #3
	jsr _give_mutex
; 	 
; 	 return 0;
	ldd #0
L3:
	tfr x,s
	pulx
	.dbline 0 ; func end
	rts
L24:
	.byte 'T,49,32,'F,'i,'n,'i,'s,'h,'e,'d,0
L19:
	.byte 'T,49,46,51,0
L14:
	.byte 'T,49,46,50,0
L9:
	.byte 'T,49,46,49,0
L4:
	.byte 'T,49,32,'S,'t,'a,'r,'t,'i,'n,'g,0

