;
-; Christian Groessler, May-2004
+; Christian Groessler, Jun-2004
;
; int __fastcall__ read(int fd,void *buf,int count)
;
lda ICBLL,x ; get # of bytes read
sta buflen
lda #0
- sta index
+ sta index ; fresh buffer
; restore user buffer address & length
pla
sta ICBLL,x
; fall into use_buf
+ lda buflen
; return bytes from line buffer
; use buflen and index to access buffer
; use dataptr as a temporary pointer
use_buf:
- lda buflen
sec
sbc index ; size of unread data in the buffer
sta cbs
btsmall:
lda cbs
sta ICBLL,x
- bne icbll_copy
-
-; brk ; not reached
+ bpl icbll_copy
.zeropage