Make (print) stop on CR

Lines edited with the Block editor end with 0xd and (print) spits
spurious CR when printing those lines.

Also, properly initialize ACC in BROWSE.
This commit is contained in:
Virgil Dupras 2020-05-05 15:49:50 -04:00
parent c681cb639d
commit fa79e3d8a6
4 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@ I/O
result in n as well as whether parsing was a
success in f (false = failure, true =
success)
(print) a -- Print string at addr a.
(print) a -- Print string at addr a. Stops at 0x0 or 0xd.
. n -- Print n in its decimal form
.x n -- Print n's LSB in hex form. Always 2
characters.

View File

@ -2,7 +2,8 @@
1 5 LOADR+
: BROWSE
L BEGIN
0 ACC ! L
BEGIN
KEY CASE
'Q' OF EXIT ENDOF
'B' OF B ENDOF

View File

@ -4,10 +4,10 @@
: (print)
BEGIN
C@+ ( a+1 c )
( exit if null )
DUP NOT IF 2DROP EXIT THEN
EMIT ( a )
C@+ ( a+1 c )
( exit if null or 0xd )
DUP 13 = OVER NOT OR IF 2DROP EXIT THEN
EMIT ( a )
AGAIN
;

Binary file not shown.