]> git.sur5r.net Git - cc65/blob - libsrc/runtime/pushb.s
Add more register #defines to ANTIC header file
[cc65] / libsrc / runtime / pushb.s
1 ;
2 ; Ullrich von Bassewitz, 31.08.1998
3 ;
4 ; CC65 runtime: Push word from stack
5 ;
6
7         .export         pushb, pushbidx
8         .import         pushax
9         .importzp       ptr1
10
11         .macpack        cpu
12
13 pushbidx:
14         sty     ptr1
15         clc
16         adc     ptr1
17         bcc     pushb
18         inx
19 pushb:  sta     ptr1
20         stx     ptr1+1
21         ldx     #0              ; Load index/high byte
22 .if (.cpu .bitand CPU_ISET_65SC02)
23         lda     (ptr1)          ; Save one cycle for the C02
24 .else
25         lda     (ptr1,x)
26 .endif
27         bpl     L1
28         dex                     ; Make high byte FF
29 L1:     jmp     pushax
30