2000-10-26 20:43:54 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 26.10.2000
|
|
|
|
;
|
|
|
|
; CC65 runtime: Push value in a onto the stack
|
|
|
|
;
|
|
|
|
|
2001-10-01 22:21:16 +00:00
|
|
|
.export pusha0sp, pushaysp, pusha
|
2000-10-26 20:43:54 +00:00
|
|
|
.importzp sp
|
|
|
|
|
|
|
|
; Beware: The optimizer knows about this function!
|
|
|
|
|
2001-10-01 22:21:16 +00:00
|
|
|
pusha0sp:
|
|
|
|
ldy #$00
|
2000-10-26 20:43:54 +00:00
|
|
|
pushaysp:
|
|
|
|
lda (sp),y
|
|
|
|
pusha: ldy sp
|
|
|
|
beq @L1
|
|
|
|
dec sp
|
2000-11-28 13:33:08 +00:00
|
|
|
.ifpc02
|
|
|
|
sta (sp)
|
|
|
|
.else
|
2000-10-26 20:43:54 +00:00
|
|
|
ldy #0
|
|
|
|
sta (sp),y
|
2000-11-28 13:33:08 +00:00
|
|
|
.endif
|
2000-10-26 20:43:54 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
@L1: dec sp+1
|
|
|
|
dec sp
|
|
|
|
sta (sp),y
|
|
|
|
rts
|
|
|
|
|