]> git.sur5r.net Git - cc65/blob - libsrc/runtime/lpush.s
074b4320aee1a5bbeee5924e9eef25043c207584
[cc65] / libsrc / runtime / lpush.s
1 ;
2 ; Ullrich von Bassewitz, 06.08.1998
3 ;
4 ; CC65 runtime: long push
5 ;
6
7 ;
8 ; push eax on stack
9 ;
10         .export         pushl0, push0ax, pusheax
11         .import         decsp4
12         .importzp       sp, sreg
13
14 pushl0:
15         lda     #0
16         tax
17 push0ax:
18         ldy     #0
19         sty     sreg
20         sty     sreg+1
21 pusheax:
22         pha                     ; decsp will destroy A (but not X)
23         jsr     decsp4
24         ldy     #3
25         lda     sreg+1
26         sta     (sp),y
27         dey
28         lda     sreg
29         sta     (sp),y
30         dey
31         txa
32         sta     (sp),y
33         dey
34         pla
35         sta     (sp),y
36         rts
37