1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-18 07:29:36 +00:00
cc65/libsrc/runtime/pushwsp.s
cuz 20143c0187 New pushwysp implementation
git-svn-id: svn://svn.cc65.org/cc65/trunk@1071 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-10-24 20:44:54 +00:00

32 lines
472 B
ArmAsm

;
; Ullrich von Bassewitz, 31.08.1998
;
; CC65 runtime: Load word from stack slot and push
;
.export pushwysp, pushw0sp
.import pushax
.importzp sp
.macpack generic
pushw0sp:
ldy #2
pushwysp:
lda sp ; 3
sub #2 ; 4
sta sp ; 3
bcs @L1 ; 3(+1)
dec sp+1 ; (5)
@L1: lda (sp),y ; 5 =16
tax ; 2
dey ; 2
lda (sp),y ; 5
ldy #$00 ; 2
sta (sp),y ; 5
iny ; 2
txa ; 2
sta (sp),y ; 5
rts