1
0
mirror of https://github.com/cc65/cc65.git synced 2026-01-26 13:16:42 +00:00
Files
cc65/libsrc/runtime/pusha.s
2025-06-22 21:34:41 +00:00

30 lines
707 B
ArmAsm

;
; Ullrich von Bassewitz, 26.10.2000
;
; CC65 runtime: Push value in a onto the stack
;
.export pusha0sp, pushaysp, pusha
.importzp c_sp
.macpack cpu
; Beware: The optimizer knows about this function!
pusha0sp:
ldy #$00
pushaysp:
lda (c_sp),y
pusha: ldy c_sp ; (3)
beq @L1 ; (6)
dec c_sp ; (11)
ldy #0 ; (13)
sta (c_sp),y ; (19)
rts ; (25)
@L1: dec c_sp+1 ; (11)
dec c_sp ; (16)
sta (c_sp),y ; (22)
rts ; (28)