Some more 6502 code
git-svn-id: svn://svn.cc65.org/cc65/trunk@485 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
b4163d0e4e
commit
6cbd32b49d
2 changed files with 14 additions and 5 deletions
|
@ -14,8 +14,12 @@
|
|||
ldy #1
|
||||
lda (sp),y ; get hi byte
|
||||
tax ; into x
|
||||
.ifpc02
|
||||
lda (sp) ; get lo byte
|
||||
.else
|
||||
dey
|
||||
lda (sp),y ; get lo byte
|
||||
.endif
|
||||
|
||||
.endproc
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
;
|
||||
|
||||
.export tossuba0, tossubax
|
||||
.import addysp1
|
||||
.import addysp1
|
||||
.importzp sp, ptr1
|
||||
|
||||
;
|
||||
|
@ -15,14 +15,19 @@
|
|||
tossuba0:
|
||||
ldx #0
|
||||
tossubax:
|
||||
ldy #0
|
||||
sta ptr1
|
||||
stx ptr1+1
|
||||
lda (sp),y ; lo byte
|
||||
sec
|
||||
.ifpc02
|
||||
lda (sp),y ; Get lo byte
|
||||
ldy #1 ; Hi index
|
||||
.else
|
||||
ldy #0
|
||||
lda (sp),y ; Lo byte
|
||||
iny ; Hi index
|
||||
.endif
|
||||
sec
|
||||
sbc ptr1
|
||||
sta ptr1 ; save lo byte
|
||||
iny
|
||||
lda (sp),y
|
||||
sbc ptr1+1
|
||||
tax
|
||||
|
|
Loading…
Add table
Reference in a new issue