From 61ca51549480d42140c8dac028eb26a3b33477de Mon Sep 17 00:00:00 2001 From: cpg Date: Tue, 1 Jun 2004 20:25:44 +0000 Subject: [PATCH] small optimization; fix line buffered read of length 0 git-svn-id: svn://svn.cc65.org/cc65/trunk@3065 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/atari/read.s | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 -- 2.39.5