New pushwysp implementation
git-svn-id: svn://svn.cc65.org/cc65/trunk@1071 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
37f7bc4c83
commit
20143c0187
1 changed files with 18 additions and 7 deletions
|
@ -8,13 +8,24 @@
|
||||||
.import pushax
|
.import pushax
|
||||||
.importzp sp
|
.importzp sp
|
||||||
|
|
||||||
|
.macpack generic
|
||||||
|
|
||||||
pushw0sp:
|
pushw0sp:
|
||||||
ldy #1
|
ldy #2
|
||||||
pushwysp:
|
pushwysp:
|
||||||
lda (sp),y ; get hi byte
|
lda sp ; 3
|
||||||
tax
|
sub #2 ; 4
|
||||||
dey
|
sta sp ; 3
|
||||||
lda (sp),y ; get lo byte
|
bcs @L1 ; 3(+1)
|
||||||
jmp pushax ; push that
|
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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue