2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 06.08.1998
|
2017-03-12 22:21:43 +00:00
|
|
|
; Christian Krueger, 11-Mar-2017, added 65SC02 optimization
|
2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; CC65 runtime: long push
|
|
|
|
;
|
|
|
|
|
|
|
|
;
|
|
|
|
; push eax on stack
|
|
|
|
;
|
2013-05-09 11:56:54 +00:00
|
|
|
.export pushl0, push0ax, pusheax
|
|
|
|
.import decsp4
|
|
|
|
.importzp sp, sreg
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2017-03-12 22:21:43 +00:00
|
|
|
.macpack cpu
|
|
|
|
|
2012-06-10 19:15:52 +00:00
|
|
|
pushl0:
|
|
|
|
lda #0
|
|
|
|
tax
|
2000-05-28 13:40:48 +00:00
|
|
|
push0ax:
|
2017-03-12 22:21:43 +00:00
|
|
|
.if (.cpu .bitand ::CPU_ISET_65SC02)
|
|
|
|
stz sreg
|
|
|
|
stz sreg+1
|
|
|
|
.else
|
|
|
|
ldy #$00
|
2013-05-09 11:56:54 +00:00
|
|
|
sty sreg
|
|
|
|
sty sreg+1
|
2017-03-12 22:21:43 +00:00
|
|
|
.endif
|
2000-05-28 13:40:48 +00:00
|
|
|
pusheax:
|
2013-05-09 11:56:54 +00:00
|
|
|
pha ; decsp will destroy A (but not X)
|
|
|
|
jsr decsp4
|
|
|
|
ldy #3
|
|
|
|
lda sreg+1
|
|
|
|
sta (sp),y
|
|
|
|
dey
|
|
|
|
lda sreg
|
|
|
|
sta (sp),y
|
|
|
|
dey
|
|
|
|
txa
|
|
|
|
sta (sp),y
|
|
|
|
pla
|
2017-03-12 22:21:43 +00:00
|
|
|
.if (.cpu .bitand ::CPU_ISET_65SC02)
|
|
|
|
sta (sp)
|
|
|
|
.else
|
|
|
|
dey
|
2013-05-09 11:56:54 +00:00
|
|
|
sta (sp),y
|
2017-03-12 22:21:43 +00:00
|
|
|
.endif
|
2013-05-09 11:56:54 +00:00
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|