2 ; Ullrich von Bassewitz, 26.10.2000
3 ; Christian Krueger, 12-Mar-2017, added 65SC02 optimization
5 ; CC65 runtime: Store a/x indirect into address at top of stack with index
10 .importzp sp, tmp1, ptr1
21 .if (.cpu .bitand ::CPU_ISET_65SC02)
27 sta ptr1 ; Address now in ptr1
29 iny ; Address high byte
31 sta (ptr1),y ; Store high byte
32 dey ; Address low byte
33 pla ; Restore low byte into A
34 sta (ptr1),y ; Store low byte
35 jmp incsp2 ; Drop address