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:
parent
652949f183
commit
1377ba0d36
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user