1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +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
BRK_TELEMON XFREAD
; compute nb of bytes read
lda PTR_READ_DEST+1
sec
sbc ptr2+1
tax
lda PTR_READ_DEST
sec
sbc ptr2
; here A and X contains number of bytes read
lda PTR_READ_DEST
sbc ptr2
sta tmp1
lda PTR_READ_DEST+1
sbc ptr2+1
tax
lda tmp1
rts
.endproc

View File

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