1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-10 19:29:45 +00:00

fix compute length for read and write for telestrat target

This commit is contained in:
jede 2023-05-23 23:08:56 +02:00
parent 652949f183
commit 1377ba0d36
2 changed files with 16 additions and 15 deletions

View File

@ -30,13 +30,14 @@
ldy ptr1+1 ldy ptr1+1
BRK_TELEMON XFREAD BRK_TELEMON XFREAD
; compute nb of bytes read ; compute nb of bytes read
lda PTR_READ_DEST+1
sec sec
sbc ptr2+1 lda PTR_READ_DEST
tax sbc ptr2
lda PTR_READ_DEST sta tmp1
sec lda PTR_READ_DEST+1
sbc ptr2 sbc ptr2+1
; here A and X contains number of bytes read tax
lda tmp1
rts rts
.endproc .endproc

View File

@ -42,16 +42,16 @@ next:
ldy ptr3+1 ldy ptr3+1
ldx tmp1 ; send fd in X ldx tmp1 ; send fd in X
BRK_TELEMON XFWRITE BRK_TELEMON XFWRITE
; compute nb of bytes written ; compute nb of bytes written
lda PTR_READ_DEST+1
sec sec
sbc ptr1+1 lda PTR_READ_DEST
tax sbc ptr1
lda PTR_READ_DEST sta tmp1
sec lda PTR_READ_DEST+1
sbc ptr1 sbc ptr1+1
tax
lda tmp1
rts rts