]> git.sur5r.net Git - cc65/blob - libsrc/runtime/ldau0sp.s
Fixed a bug
[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 ldau00sp:
11         ldy     #1
12 ldau0ysp:
13         lda     (sp),y
14         sta     ptr1+1
15         dey
16         lda     (sp),y
17         sta     ptr1
18         ldx     #0
19 .ifpc02
20         lda     (ptr1)          ; Save one cycle for the C02
21 .else
22         lda     (ptr1,x)
23 .endif
24         rts
25