commit fed0d13f2d6ccf3e371f02e138267d472fbbd6d3 parent c67c16531ff7acf7b2f669970691ff1fc09f7787 Author: Henry Wilson <m3henry@googlemail.com> Date: Tue, 1 Aug 2017 15:40:15 +0100 added IF ... ELSE ... THEN Diffstat:
M | compiler.s | | | 24 | ++++++++++++++++++++++++ |
1 file changed, 24 insertions(+), 0 deletions(-)
diff --git a/compiler.s b/compiler.s @@ -127,3 +127,27 @@ verb forth plusloop "+LOOP" immediate compile drop2 endword +# Conditionals + +verb forth IF "IF" immediate + compile iszero + compile dobranch + get HERE + compile 0 + endword + +verb forth ELSE "ELSE" immediate + compile dogoto + get HERE + compile 0 + do SWAP + get HERE + do SWAP + do store + endword + +verb forth THEN "THEN" immediate + get HERE + do SWAP + do store + endword