From 8fc41ad39f57abd82fa0614b8785051ccb938165 Mon Sep 17 00:00:00 2001 From: Koichi Nakamura Date: Sat, 2 Jan 2021 02:44:57 +0900 Subject: [PATCH] Add +!, -! and allot --- core.fs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core.fs b/core.fs index da2c748..3461939 100644 --- a/core.fs +++ b/core.fs @@ -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