]> git.sur5r.net Git - cc65/blob - libsrc/runtime/incsp2.s
Moved the jmpvec module from common to runtime
[cc65] / libsrc / runtime / incsp2.s
1 ;
2 ; Ullrich von Bassewitz, 25.10.2000
3 ;
4 ; CC65 runtime: Increment the stackpointer by 2. For performance reasons,
5 ;               this modules does also contain the popax function.
6
7         .export         popax, incsp2
8         .importzp       sp
9
10 ; Pop a/x from stack. This function will run directly into incsp2
11
12 .proc   popax
13
14         ldy     #1
15         lda     (sp),y          ; get hi byte
16         tax                     ; into x
17         dey
18         lda     (sp),y          ; get lo byte
19
20 .endproc
21
22
23
24 .proc   incsp2
25
26         ldy     sp              ; 3
27         iny                     ; 2
28         beq     @L1             ; 2
29         iny                     ; 2
30         beq     @L2             ; 2
31         sty     sp              ; 3
32         rts
33
34 @L1:    iny                     ; 2
35 @L2:    sty     sp              ; 3
36         inc     sp+1            ; 5
37         rts
38
39 .endproc
40
41
42
43
44