]> git.sur5r.net Git - cc65/blob - libsrc/pet/clrscr.s
Add sample linker configurations for Atari binary output in C.
[cc65] / libsrc / pet / clrscr.s
1 ;
2 ; Ullrich von Bassewitz, 26.11.1998
3 ;
4 ; void clrscr (void);
5 ;
6
7         .export         _clrscr
8         .import         plot
9         .importzp       ptr1
10
11         .include        "pet.inc"
12
13 _clrscr:
14
15 ; Set the screen base address
16
17         lda     #$00
18         sta     ptr1
19         lda     #$80
20         sta     ptr1+1
21
22 ; Determine, how many pages to fill
23
24         ldx     #4
25         lda     SCR_LINELEN     ; Check length of one line
26         cmp     #40+1
27         bcc     L1
28         ldx     #8
29
30 ; Clear the screen
31
32 L1:     lda     #$20            ; Screen code for blank
33         ldy     #$00
34 L2:     sta     (ptr1),y
35         iny
36         bne     L2
37         inc     ptr1+1
38         dex
39         bne     L2
40
41 ; Set the cursor to 0/0
42
43         lda     #0
44         sta     CURS_X
45         sta     CURS_Y
46         jmp     plot
47
48         rts
49