R32V2020 Screen Clear Example

From Land Boards Wiki
Jump to navigation Jump to search
; Clear the screen routine
clearScreen:
	ads	r5,r0,r0	; start of screen character memory
	ads	r8,r0,r0	; clear the character
	lil	r8,0x0020	; fill with spaces
	ads	r9,r0,r0	; screen count
	lil	r9,0x7FE	; loopCount	
looper:
	spb	r8			; put the character to the screen
	ads	r5,r5,r1	; Increment screen pointer
	ads	r9,r9,r2	; decrement character counter
	bne	looper		; loop until complete
	bra	doneClear