]> git.sur5r.net Git - cc65/blob - libsrc/runtime/ldaxsp.s
cfg/atari-xex.cfg: fix typo in comment
[cc65] / libsrc / runtime / ldaxsp.s
1 ;
2 ; Ullrich von Bassewitz, 31.08.1998
3 ;
4 ; CC65 runtime: Load ax from offset in stack
5 ;
6
7         .export         ldax0sp, ldaxysp
8         .importzp       sp
9
10 ; Beware: The optimizer knows about the value in Y after return!
11
12 ldax0sp:
13         ldy     #1
14 ldaxysp:
15         lda     (sp),y          ; get high byte
16         tax                     ; and save it
17         dey                     ; point to lo byte
18         lda     (sp),y          ; load low byte
19         rts
20