diff --git a/libsrc/telestrat/read.s b/libsrc/telestrat/read.s index f31909f45..b89f246cc 100644 --- a/libsrc/telestrat/read.s +++ b/libsrc/telestrat/read.s @@ -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 diff --git a/libsrc/telestrat/write.s b/libsrc/telestrat/write.s index 2ce2657ac..06524f749 100644 --- a/libsrc/telestrat/write.s +++ b/libsrc/telestrat/write.s @@ -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