mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-24 14:38:05 +11:00
Add word ERR
This commit is contained in:
parent
303b34b483
commit
8a58449776
3
blk/043
3
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.)
|
||||
|
1
blk/044
1
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.
|
||||
|
1
blk/394
1
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 )
|
||||
|
4
blk/421
4
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" ERR ;
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
Loading…
Reference in New Issue
Block a user