]> git.sur5r.net Git - cc65/blob - libsrc/runtime/pusha.s
Added some cycle counts
[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              ; (3)
17         beq     @L1             ; (6)
18         dec     sp              ; (11)
19 .ifpc02
20         sta     (sp)
21 .else
22         ldy     #0              ; (13)
23         sta     (sp),y          ; (19)
24 .endif
25         rts                     ; (25)
26
27 @L1:    dec     sp+1            ; (11)
28         dec     sp              ; (16)
29         sta     (sp),y          ; (22)
30         rts                     ; (28)
31