]> git.sur5r.net Git - cc65/blob - libsrc/runtime/pushwsp.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / runtime / pushwsp.s
1 ;
2 ; Ullrich von Bassewitz, 24.10.2001
3 ;
4 ; CC65 runtime: Load word from stack slot and push
5 ;
6
7         .export         pushwysp, pushw0sp
8         .importzp       sp
9
10         .macpack        generic
11
12 pushw0sp:
13         ldy     #3
14 pushwysp:
15         lda     sp              ; 3
16         sub     #2              ; 4
17         sta     sp              ; 3
18         bcs     @L1             ; 3(+1)
19         dec     sp+1            ; (5)
20 @L1:    lda     (sp),y          ; 5 =16
21         tax                     ; 2
22         dey                     ; 2
23         lda     (sp),y          ; 5
24         ldy     #$00            ; 2
25         sta     (sp),y          ; 5
26         iny                     ; 2
27         txa                     ; 2
28         sta     (sp),y          ; 5
29         rts
30
31