]> git.sur5r.net Git - cc65/blob - libsrc/runtime/staspidx.s
cfg/atari-xex.cfg: fix typo in comment
[cc65] / libsrc / runtime / staspidx.s
1 ;
2 ; Ullrich von Bassewitz, 26.10.2000
3 ;
4 ; CC65 runtime: Store a indirect into address at top of stack with index
5 ;
6
7         .export         staspidx
8         .import         incsp2
9         .importzp       sp, tmp1, ptr1
10
11 .proc   staspidx
12
13         pha
14         sty     tmp1            ; Save Index
15         ldy     #1
16         lda     (sp),y
17         sta     ptr1+1
18         dey
19         lda     (sp),y
20         sta     ptr1            ; Pointer now in ptr1
21         ldy     tmp1            ; Restore offset
22         pla                     ; Restore value
23         sta     (ptr1),y        ; Store
24         jmp     incsp2          ; Drop address
25
26 .endproc
27
28