]> git.sur5r.net Git - cc65/blob - libsrc/runtime/staxspi.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / runtime / staxspi.s
1 ;
2 ; Ullrich von Bassewitz, 26.10.2000
3 ;
4 ; CC65 runtime: Store a/x indirect into address at top of stack with index
5 ;
6
7         .export         staxspidx
8         .import         incsp2
9         .importzp       sp, tmp1, ptr1
10
11 .proc   staxspidx
12
13         sty     tmp1            ; Save Y
14         pha                     ; Save A
15         ldy     #1
16         lda     (sp),y
17         sta     ptr1+1
18         dey
19         lda     (sp),y
20         sta     ptr1            ; Address now in ptr1
21         ldy     tmp1            ; Restore Y
22         iny                     ; Address high byte
23         txa                     ; Get high byte
24         sta     (ptr1),y        ; Store high byte
25         dey                     ; Address low byte
26         pla                     ; Restore low byte into A
27         sta     (ptr1),y        ; Store low byte
28         jmp     incsp2          ; Drop address
29
30 .endproc
31
32