]> git.mdlowis.com Git - projs/onward.git/commitdiff
Added support for constant definitions
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 4 Dec 2014 02:24:01 +0000 (21:24 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 4 Dec 2014 02:24:01 +0000 (21:24 -0500)
source/onward.ft

index 010eb2d3318936603aa07236a33ab943d4b76cd7..aa4a58d2d682b604a82a329a3981d32a8fcb2e56 100644 (file)
@@ -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
     ' 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 ;