From 8a58449776528e1d5522962fd89a3c3f1e87a2ed Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 14 May 2020 11:57:26 -0400 Subject: [PATCH] Add word ERR --- blk/043 | 3 ++- blk/044 | 1 + blk/394 | 1 + blk/421 | 4 ++-- emul/forth.bin | Bin 5922 -> 5947 bytes 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/blk/043 b/blk/043 index e4c6099..60f3f7c 100644 --- a/blk/043 +++ b/blk/043 @@ -12,4 +12,5 @@ have to consume it to avoid PSP leak. ] -- End interpretative mode. ABORT -- Resets PS and RS and returns to interpreter. ABORT" x" -- *I* Compiles a ." followed by a ABORT. -EXECUTE a -- Execute wordref at addr a +ERR a -- Prints a and ABORT. Defined early and used by + drivers. (cont.) diff --git a/blk/044 b/blk/044 index f15cb2f..ae2cdc6 100644 --- a/blk/044 +++ b/blk/044 @@ -1,3 +1,4 @@ +EXECUTE a -- Execute wordref at addr a INTERPRET -- Get a line from stdin, compile it in tmp memory, then execute the compiled contents. LEAVE -- In a DO..LOOP, exit at the next LOOP call. diff --git a/blk/394 b/blk/394 index 6fb571f..d6742b5 100644 --- a/blk/394 +++ b/blk/394 @@ -1,4 +1,5 @@ : ABORT (resSP) QUIT ; +: ERR LIT< (print) (find) IF EXECUTE THEN ABORT ; : = CMP NOT ; : < CMP -1 = ; : > CMP 1 = ; : 0< 32767 > ; : >= < NOT ; : <= > NOT ; : 0>= 0< NOT ; ( n l h -- f ) diff --git a/blk/421 b/blk/421 index f73d4ed..3c7e85b 100644 --- a/blk/421 +++ b/blk/421 @@ -12,5 +12,5 @@ : CRLF CR LF ; : SPC 32 EMIT ; : NL 0x0a RAM+ @ ( NLPTR ) DUP IF EXECUTE ELSE DROP CRLF THEN ; : (ok) SPC LIT" ok" (print) NL ; -: (uflw) LIT" stack underflow" (print) ABORT ; -: (wnf) (print) SPC LIT" word not found" (print) ABORT ; +: (uflw) LIT" stack underflow" ERR ; +: (wnf) (print) SPC LIT" word not found" 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