mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-27 06:28:05 +11:00
adea75e50a
I'm pretty happy about how lightweight the implementation turns out to be.
12 lines
287 B
Plaintext
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 ;
|