\chapter{Task 2: TBD Example}
\label{chp:task2}

This chapter implements a simple task which will be loaded into the system
as task number [[2]].

<<Task 2 implementation>>=
	;; Task 2 - TBD
; header
<<Task 2 header>>

; routines
<<Task 2 process routine>>
@

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Header}

<<Task 2 header>>=
t2header:
        .byte   0xc9, 0x4a, 0x73, 0x4c  ; cookie
        .byte   0x01                    ; version
        .byte   0x04                    ; requested timeslices
	.word	t2name			; name
        .word   t2process               ; process function

t2name:
	.byte	6			; strlen
        .asciz  "Task 2"                ; name
@


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Process routine}

<<Task 2 process routine>>=
t2process:
	ld      hl, #(colram)   ; base of color ram
	ld      a, #0x01        ; clear the screen to 0x00
	ld      b, #0x04        ; 256*4 = 1k
	call	memsetN

	ld	hl, #(vidram)	; base of video ram
	ld	a, #0x61	; 'a'
	ld	b, #0x04	; 256*4 = 1k
	call	memsetN

	ld	hl, #(vidram)	; base of video ram
	ld	a, #0x62	; 'b'
	ld	b, #0x04	; 256*4 = 1k
	call	memsetN

	ld	hl, #(vidram)	; base of video ram
	ld	a, #0x63	; 'c'
	ld	b, #0x04	; 256*4 = 1k
	call	memsetN

	jp	t2process
	halt
@
