2000-05-28 13:40:48 +00:00
|
|
|
;
|
2001-10-24 20:48:18 +00:00
|
|
|
; Ullrich von Bassewitz, 24.10.2001
|
2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; CC65 runtime: Load word from stack slot and push
|
|
|
|
;
|
|
|
|
|
|
|
|
.export pushwysp, pushw0sp
|
|
|
|
.importzp sp
|
|
|
|
|
2001-10-24 20:44:54 +00:00
|
|
|
.macpack generic
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
pushw0sp:
|
2001-10-24 20:44:54 +00:00
|
|
|
ldy #2
|
2000-05-28 13:40:48 +00:00
|
|
|
pushwysp:
|
2001-10-24 20:44:54 +00:00
|
|
|
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
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2001-10-24 20:48:18 +00:00
|
|
|
|