1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

fix devicestr call, so related posix function work on cbm targets

This commit is contained in:
mrdudz 2023-01-28 15:08:00 +01:00
parent 6267db6b01
commit 8ac5e2f7b6

View File

@ -9,8 +9,6 @@
.import pusha0, tosudiva0
.importzp sreg, ptr1, ptr2
.macpack generic
initcwd:
lda #<__cwd
ldx #>__cwd
@ -27,15 +25,20 @@ devicestr:
lda #10
jsr tosudiva0
ldy #0
lda sreg
beq @L0 ; >=10
add #'0'
tax ; result of the division (lsb)
beq @L0 ; < 10
clc
adc #'0'
sta (ptr2),y
iny
@L0: lda ptr1 ; rem
add #'0'
@L0:
lda sreg ; reminder of the division
clc
adc #'0'
sta (ptr2),y
iny
lda #0
lda #0 ; terminating 0
sta (ptr2),y
rts