From cc3624079f30af82fec35882deadb74a46f78546 Mon Sep 17 00:00:00 2001 From: Bobbi Webber-Manners Date: Sat, 3 Jul 2021 23:53:57 -0400 Subject: [PATCH] SED: Fix bug with handling of blank input lines. --- BIN/SED.S.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/BIN/SED.S.txt b/BIN/SED.S.txt index c9cfb8c3..77646dbf 100644 --- a/BIN/SED.S.txt +++ b/BIN/SED.S.txt @@ -1,5 +1,3 @@ -NEW - AUTO 3,1 .LIST OFF .OP 65C02 .OR $2000 @@ -253,6 +251,9 @@ CS.RUN.OPEN >PUSHYA CS.RUN.PRINT >LDYA ZPBufPtr >STYA ZPPtr1 + lda (ZPPtr1) If null first time + beq .8 + .1 lda (ZPPtr1) beq .7 EOL. No match. @@ -290,11 +291,12 @@ CS.RUN.PRINT >LDYA ZPBufPtr * Hit EOL but not end of pattern, return .7 jsr CS.RUN.NoMatch - lda #C.CR +.8 lda #C.CR >SYSCALL PutChar lda #C.LF >SYSCALL PutChar - clc + +.9 clc rts *-------------------------------------- CS.RUN.GotMatch phy @@ -377,6 +379,3 @@ MSG.CRLF .AZ "\r\n" DS.START DS.END .ED *-------------------------------------- -MAN -SAVE usr/src/bin/sed.s -ASM