1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-07-20 04:48:26 +10:00
collapseos/blk/397
Virgil Dupras 3d2dc041fb Make word routines into word types
Instead of having wordref point to core word routines, I made them
into word 4 word types. It liberates space into the stable ABI and
should make porting to other arches easier.

I'm also thinking of combining word type with the namelen field
for precious bytes saving, but not now...
2020-06-17 21:41:01 -04:00

16 lines
576 B
Plaintext

( Now we have "as late as possible" stuff )
: _bchk DUP 0x7f + 0xff > IF LIT< br-ovfl (print) ABORT THEN ;
: DO COMPILE 2>R H@ ; IMMEDIATE
: LOOP COMPILE (loop) H@ - _bchk , ; 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 FIND
IF ( is word ) DUP IMMED? IF EXECUTE ELSE , THEN
ELSE ( maybe number ) (parse) LITN THEN
AGAIN ;