]> git.sur5r.net Git - cc65/blob - libsrc/runtime/popsreg.s
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / libsrc / runtime / popsreg.s
1 ;
2 ; Ullrich von Bassewitz, 21.08.1998
3 ;
4 ; CC65 runtime: Pop TOS into sreg
5 ;
6
7         .export         popsreg
8         .import         incsp2
9         .importzp       sp, sreg
10
11 popsreg:
12         pha                     ; save A
13         ldy     #0
14         lda     (sp),y          ; get lo byte
15         sta     sreg            ; store it
16         iny
17         lda     (sp),y          ; get hi byte
18         sta     sreg+1          ; store it
19         pla                     ; get A back
20         jmp     incsp2          ; bump stack and return
21
22