Browse Source

Add word ERR

pull/102/head
Virgil Dupras 4 years ago
parent
commit
8a58449776
5 changed files with 6 additions and 3 deletions
  1. +2
    -1
      blk/043
  2. +1
    -0
      blk/044
  3. +1
    -0
      blk/394
  4. +2
    -2
      blk/421
  5. BIN
      emul/forth.bin

+ 2
- 1
blk/043 View File

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

+ 1
- 0
blk/044 View File

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


+ 1
- 0
blk/394 View File

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


+ 2
- 2
blk/421 View File

@@ -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" ERR ;

BIN
emul/forth.bin View File


Loading…
Cancel
Save