]> git.sur5r.net Git - cc65/blob - libsrc/runtime/pushb.s
Fixed a bug
[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 pushbidx:
12         sty     ptr1
13         clc
14         adc     ptr1
15         bcc     pushb
16         inx
17 pushb:  sta     ptr1
18         stx     ptr1+1
19         ldx     #0              ; Load index/high byte
20 .ifpc02
21         lda     (ptr1)          ; Save one cycle for the C02
22 .else
23         lda     (ptr1,x)
24 .endif
25         bpl     L1
26         dex                     ; Make high byte FF
27 L1:     jmp     pushax
28