From: cpg Date: Tue, 1 Jun 2004 20:25:44 +0000 (+0000) Subject: small optimization; fix line buffered read of length 0 X-Git-Tag: V2.12.0~766 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=61ca51549480d42140c8dac028eb26a3b33477de;p=cc65 small optimization; fix line buffered read of length 0 git-svn-id: svn://svn.cc65.org/cc65/trunk@3065 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/atari/read.s b/libsrc/atari/read.s index b5b6ee011..b7183d12b 100644 --- a/libsrc/atari/read.s +++ b/libsrc/atari/read.s @@ -1,5 +1,5 @@ ; -; Christian Groessler, May-2004 +; Christian Groessler, Jun-2004 ; ; int __fastcall__ read(int fd,void *buf,int count) ; @@ -87,7 +87,7 @@ newbuf: lda ICBLL,x ; get # of bytes read sta buflen lda #0 - sta index + sta index ; fresh buffer ; restore user buffer address & length pla @@ -103,6 +103,7 @@ newbuf: sta ICBLL,x ; fall into use_buf + lda buflen ; return bytes from line buffer ; use buflen and index to access buffer @@ -110,7 +111,6 @@ newbuf: ; use dataptr as a temporary pointer use_buf: - lda buflen sec sbc index ; size of unread data in the buffer sta cbs @@ -162,9 +162,7 @@ c1: ldx #0 btsmall: lda cbs sta ICBLL,x - bne icbll_copy - -; brk ; not reached + bpl icbll_copy .zeropage