Permalink
Browse files

meta: Add ,, [, ].

  • Loading branch information...
1 parent d414783 commit d7c370f3967586d074468e6253ef182d8672a79c @MostAwesomeDude committed Apr 11, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 cauliflower/meta.py
View
@@ -367,4 +367,15 @@ def thread(self, name, words):
# TOS.
preamble = assemble(SET, A, POP)
+# This could be done in Forth, but it's so small in assembly!
+ucode = _pop([ma.HERE])
+ucode += assemble(ADD, [ma.HERE], 0x1)
+ma.asm(",", ucode)
+
+ucode = assemble(SET, [ma.STATE], 0x0)
+ma.asm("[", ucode)
+
+ucode = assemble(SET, [ma.STATE], 0x1)
+ma.asm("]", ucode)
+
ma.finalize()

0 comments on commit d7c370f

Please sign in to comment.