mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-27 16:58:06 +11:00
705d68deec
With KEY and EMIT being switch words, most of the high layer can be defined before drivers. In addition to this change, I've compacted core blocks which were becoming quite sparse.
15 lines
581 B
Plaintext
15 lines
581 B
Plaintext
: _bchk DUP 0x7f + 0xff > IF LIT" br ovfl" (print) ABORT THEN ;
|
|
: DO COMPILE 2>R H@ ; IMMEDIATE
|
|
: LOOP COMPILE (loop) H@ - _bchk C, ; IMMEDIATE
|
|
( LEAVE is implemented in low xcomp )
|
|
: LITN COMPILE (n) , ;
|
|
( gets its name at the very end. can't comment afterwards )
|
|
: _ BEGIN LIT" )" WORD S= UNTIL ; IMMEDIATE
|
|
: _ ( : will get its name almost at the very end )
|
|
(entry) 1 ( compiled ) C,
|
|
BEGIN
|
|
WORD DUP LIT" ;" S= IF DROP COMPILE EXIT EXIT THEN
|
|
FIND IF ( is word ) DUP IMMED? IF EXECUTE ELSE , THEN
|
|
ELSE ( maybe number ) (parse) LITN THEN
|
|
AGAIN ;
|