1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-17 10:18:05 +11:00
collapseos/tests/forth/harness.fs
Virgil Dupras 48078d9c9c forth: Replace "SKIP?" with "(?br)"
There is an alternate git history where I continued the Forth-ification of
words, including "SKIP?", but that was a bad idea: because that word was
written by flow control immediates, I stepped into quicksands where stability
became necessary in z80c.fs and I couldn't gracefully get out of it.

I'm stepping back and take this opportunity to replace the shoddy SKIP? algo
with a more straightforward (?br) implementation.

(br) and (?br) will always stay in boot code where it's easier manage a stable
ABI.
2020-03-29 09:10:23 -04:00

10 lines
254 B
Forth

( Forth testing harness
"#" means "assert". We stop at first failure, indicating
the failure through IO on port 1 )
: fail SPC ." failed" LF 1 1 PC! BYE ;
: # IF SPC ." pass" LF ELSE fail THEN ;
: #eq 2DUP SWAP . SPC '=' EMIT SPC . '?' EMIT = # ;