mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-17 09:28:06 +11:00
48078d9c9c
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.
10 lines
254 B
Forth
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 = # ;
|