]> git.sur5r.net Git - cc65/blob - libsrc/runtime/lpop.s
few 6502 and some 65SC02 optimizations
[cc65] / libsrc / runtime / lpop.s
1 ;
2 ; Ullrich von Bassewitz, 29.12.1999
3 ; Christian Krueger, 11-Mar-2017, added 65SC02 optimization
4 ;
5 ; CC65 runtime: long pop
6 ;
7
8         .export         popeax
9         .import         incsp4
10         .importzp       sp, sreg
11
12         .macpack        cpu
13
14 popeax: ldy     #3
15         lda     (sp),y
16         sta     sreg+1
17         dey
18         lda     (sp),y
19         sta     sreg
20         dey
21         lda     (sp),y
22         tax
23 .if (.cpu .bitand ::CPU_ISET_65SC02)
24         lda     (sp)
25 .else        
26         dey
27         lda     (sp),y
28 .endif
29         jmp     incsp4
30
31