2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 31.08.1998
|
|
|
|
;
|
|
|
|
; CC65 runtime: Push word from stack
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export pushb, pushbidx
|
|
|
|
.import pushax
|
|
|
|
.importzp ptr1
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2003-10-10 17:52:12 +00:00
|
|
|
.macpack cpu
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
pushbidx:
|
2013-05-09 11:56:54 +00:00
|
|
|
sty ptr1
|
|
|
|
clc
|
|
|
|
adc ptr1
|
|
|
|
bcc pushb
|
|
|
|
inx
|
|
|
|
pushb: sta ptr1
|
|
|
|
stx ptr1+1
|
|
|
|
ldx #0 ; Load index/high byte
|
2003-10-10 17:52:12 +00:00
|
|
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
2013-05-09 11:56:54 +00:00
|
|
|
lda (ptr1) ; Save one cycle for the C02
|
2000-11-27 22:59:03 +00:00
|
|
|
.else
|
2013-05-09 11:56:54 +00:00
|
|
|
lda (ptr1,x)
|
2000-11-27 22:59:03 +00:00
|
|
|
.endif
|
2013-05-09 11:56:54 +00:00
|
|
|
bpl L1
|
|
|
|
dex ; Make high byte FF
|
|
|
|
L1: jmp pushax
|
2000-05-28 13:40:48 +00:00
|
|
|
|