]> git.sur5r.net Git - cc65/blob - libsrc/runtime/ldau0sp.s
Merge pull request #740 from laubzega/master
[cc65] / libsrc / runtime / ldau0sp.s
1 ;
2 ; Ullrich von Bassewitz, 11.04.1999
3 ;
4 ; CC65 runtime: Load an unsigned char indirect from pointer somewhere in stack
5 ;
6
7         .export         ldau00sp, ldau0ysp
8         .importzp       sp, ptr1
9
10         .macpack        cpu
11
12 ldau00sp:
13         ldy     #1
14 ldau0ysp:
15         lda     (sp),y
16         sta     ptr1+1
17         dey
18         lda     (sp),y
19         sta     ptr1
20         ldx     #0
21 .if (.cpu .bitand CPU_ISET_65SC02)
22         lda     (ptr1)          ; Save one cycle for the C02
23 .else
24         lda     (ptr1,x)
25 .endif
26         rts
27