--- /dev/null
+;\r
+; void clrscr (void);\r
+;\r
+ .export _clrscr\r
+ .include "c1p.inc"\r
+\r
+; Adapted from the Challenger Character Graphics\r
+; Reference Manual, "2.3.3 MACHINE LANGUAGE SCREEN CLEAR"\r
+; This is self-modifying code!\r
+BANKS = VIDEORAMSIZE / $100\r
+\r
+_clrscr: LDA #$20 ;' '\r
+ LDY #BANKS\r
+ LDX #$00\r
+STALOC: STA SCRNBASE,X\r
+ INX\r
+ BNE STALOC\r
+ INC STALOC+2\r
+ DEY\r
+ BNE STALOC\r
+ LDA #>(SCRNBASE) ; load high byte\r
+ STA STALOC+2 ; restore base address\r
+ RTS\r