SED: Fix bug with handling of blank input lines.

This commit is contained in:
Bobbi Webber-Manners 2021-07-03 23:53:57 -04:00
parent 75ca6300b9
commit cc3624079f
1 changed files with 6 additions and 7 deletions

View File

@ -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