From: Michael D. Lowis Date: Thu, 4 Dec 2014 02:24:01 +0000 (-0500) Subject: Added support for constant definitions X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c0310064ea5b44674cb5cf36aa3f7b177479e4e3;p=projs%2Fonward.git Added support for constant definitions --- diff --git a/source/onward.ft b/source/onward.ft index 010eb2d..aa4a58d 100644 --- a/source/onward.ft +++ b/source/onward.ft @@ -1,3 +1,15 @@ +\ Runtime Words +\ ----------------------------------------------------------------------------- +: depth asp @ asb @ - ; + +: aligned + CELLSZ 1 - \ Calculate the value to add + dup ~ rot \ Calculate the bitmask + + & \ Apply the mask to align the number +; + +: align here dup @ aligned ! ; + \ Compiler Words \ ----------------------------------------------------------------------------- : immediate @@ -19,6 +31,10 @@ ' lit , , \ Compile the top item on the stack as a literal ; +: const word create [compile] literal 0 , ; + +: dump word find dumpw ; + \ Stack Manipulation Words \ ----------------------------------------------------------------------------- : nip swap drop ;