From 59ee6149e5cf529678e14e741b154fa49dd97c97 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Thu, 26 Feb 2026 18:09:36 +0000 Subject: [PATCH] Switch to -1 for true, 0 for false This means you can use the bitwise operators for booleans too. --- wipforth.wat | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wipforth.wat b/wipforth.wat index d669bad..e6c98ae 100644 --- a/wipforth.wat +++ b/wipforth.wat @@ -345,6 +345,7 @@ call $pop call $pop i32.eq + i32.const 0 i32.sub call $push call $next) @@ -352,6 +353,7 @@ call $pop call $pop i32.ne + i32.const 0 i32.sub call $push call $next) @@ -361,6 +363,7 @@ call $pop local.get $tmp i32.lt_s + i32.const 0 i32.sub call $push call $next) @@ -370,6 +373,7 @@ call $pop local.get $tmp i32.gt_s + i32.const 0 i32.sub call $push call $next) @@ -379,6 +383,7 @@ call $pop local.get $tmp i32.le_s + i32.const 0 i32.sub call $push call $next) @@ -388,12 +393,14 @@ call $pop local.get $tmp i32.ge_s + i32.const 0 i32.sub call $push call $next) (func $zeq call $pop i32.eqz + i32.const 0 i32.sub call $push call $next) @@ -401,6 +408,7 @@ call $pop i32.const 0 i32.ne + i32.const 0 i32.sub call $push call $next) @@ -408,6 +416,7 @@ call $pop i32.const 0 i32.lt_s + i32.const 0 i32.sub call $push call $next) @@ -415,6 +424,7 @@ call $pop i32.const 0 i32.gt_s + i32.const 0 i32.sub call $push call $next) @@ -422,6 +432,7 @@ call $pop i32.const 0 i32.le_s + i32.const 0 i32.sub call $push call $next) @@ -429,6 +440,7 @@ call $pop i32.const 0 i32.ge_s + i32.const 0 i32.sub call $push call $next)