1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 06:58:07 +11:00
collapseos/blk/355
Virgil Dupras adea75e50a Add alias and switch word types
I'm pretty happy about how lightweight the implementation turns
out to be.
2020-10-28 15:02:06 -04:00

12 lines
287 B
Plaintext

: +! TUCK @ + SWAP ! ;
: *! ( addr alias -- ) 1+ ! ;
: **! ( addr switch -- ) 1+ @ ! ;
: / /MOD NIP ;
: MOD /MOD DROP ;
: ALLOT HERE +! ;
: FILL ( a n b -- )
SWAP 2 PICK + ( a b a+n ) ROT ( b a+n a ) DO ( b )
DUP I C!
LOOP DROP ;
: ALLOT0 ( n -- ) H@ OVER 0 FILL ALLOT ;