]> git.sur5r.net Git - cc65/blob - libsrc/atari/chline.s
Add test showing optimizer failure, OptUnusedLoads removes needed loads
[cc65] / libsrc / atari / chline.s
1 ;
2 ; Ullrich von Bassewitz, 08.08.1998
3 ;
4 ; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
5 ; void chline (unsigned char length);
6 ;
7
8         .export         _chlinexy, _chline
9         .import         gotoxy, cputdirect, setcursor
10         .importzp       tmp1
11
12 CHRCODE =       $12+64
13
14 _chlinexy:
15         pha                     ; Save the length
16         jsr     gotoxy          ; Call this one, will pop params
17         pla                     ; Restore the length
18
19 _chline:
20         cmp     #0              ; Is the length zero?
21         beq     L9              ; Jump if done
22         sta     tmp1
23 L1:     lda     #CHRCODE        ; Horizontal line, screen code
24         jsr     cputdirect      ; Direct output
25         dec     tmp1
26         bne     L1
27 L9:     jmp     setcursor