]> git.sur5r.net Git - cc65/blob - libsrc/runtime/pusha.s
Added mouse module from C64
[cc65] / libsrc / runtime / pusha.s
1 ;
2 ; Ullrich von Bassewitz, 26.10.2000
3 ;
4 ; CC65 runtime: Push value in a onto the stack
5 ;
6
7         .export         pushaysp, pusha
8         .importzp       sp
9
10 ; Beware: The optimizer knows about this function!
11
12 pushaysp:
13         lda     (sp),y
14 pusha:  ldy     sp
15         beq     @L1
16         dec     sp
17 .ifpc02
18         sta     (sp)
19 .else
20         ldy     #0
21         sta     (sp),y
22 .endif
23         rts
24
25 @L1:    dec     sp+1
26         dec     sp
27         sta     (sp),y
28         rts
29