]> git.sur5r.net Git - cc65/blob - libsrc/runtime/pusha.s
Working
[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         pusha0sp, pushaysp, pusha
8         .importzp       sp
9
10 ; Beware: The optimizer knows about this function!
11
12 pusha0sp:
13         ldy     #$00
14 pushaysp:
15         lda     (sp),y
16 pusha:  ldy     sp
17         beq     @L1
18         dec     sp
19 .ifpc02
20         sta     (sp)
21 .else
22         ldy     #0
23         sta     (sp),y
24 .endif
25         rts
26
27 @L1:    dec     sp+1
28         dec     sp
29         sta     (sp),y
30         rts
31