Add +!, -! and allot

This commit is contained in:
Koichi Nakamura 2021-01-02 02:44:57 +09:00
parent f2ce995009
commit 8fc41ad39f

11
core.fs
View file

@ -770,4 +770,15 @@ alias-builtin xor ^
Now we can use multiline comment with ( nests. )
)
( === Memory Operation === )
: +! ( n a-addr -- ) tuck @ + swap ! ;
: -! ( n a-addr -- ) tuck @ - swap ! ;
\ allocate n bytes
: allot ( n -- c-addr )
here @ swap
here +!
;
bye