This commit is contained in:
mrdudz
2025-06-23 17:09:06 +02:00
parent 4863a3e29b
commit 5fc15a7a60
204 changed files with 915 additions and 912 deletions

View File

@@ -6,7 +6,7 @@
.export tosulong, toslong
.import decsp2
.importzp sp
.importzp c_sp
.macpack cpu
@@ -16,25 +16,25 @@ tosulong:
pha
jsr decsp2 ; Make room
ldy #2
lda (sp),y
lda (c_sp),y
.if (.cpu .bitand CPU_ISET_65SC02)
sta (sp) ; 65C02 version
sta (c_sp) ; 65C02 version
iny ; Y = 3
.else
ldy #0
sta (sp),y
sta (c_sp),y
ldy #3
.endif
lda (sp),y
lda (c_sp),y
toslong1:
ldy #1
sta (sp),y
sta (c_sp),y
lda #0 ; Zero extend
toslong2:
iny
sta (sp),y
sta (c_sp),y
iny
sta (sp),y
sta (c_sp),y
pla
rts
@@ -42,19 +42,19 @@ toslong:
pha
jsr decsp2 ; Make room
ldy #2
lda (sp),y
lda (c_sp),y
.if (.cpu .bitand CPU_ISET_65SC02)
sta (sp) ; 65C02 version
sta (c_sp) ; 65C02 version
iny ; Y = 3
.else
ldy #0
sta (sp),y
sta (c_sp),y
ldy #3
.endif
lda (sp),y
lda (c_sp),y
bpl toslong1 ; Jump if positive, high word is zero
ldy #1
sta (sp),y
sta (c_sp),y
lda #$FF
bne toslong2 ; Branch always