From a5bd09d7d62abf683ca31230b5d108d94dd5361d Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Tue, 28 Jan 2020 18:27:19 -0500 Subject: [PATCH] Add Not and Inv instructions to spec Signed-off-by: Alek Ratzloff --- vm.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vm.md b/vm.md index 6bb36f3..b409a64 100644 --- a/vm.md +++ b/vm.md @@ -74,6 +74,19 @@ wrapping around to 0. * Or * **Params**: REG1, REG2 * `REG1 = REG1 | REG2` +* Inv + * **Params**: REG1 + * `REG1 = ~REG1` +* Not + * **Params**: REG1 + * ``` + if REG1 == 0 { + REG1 = 0; + } else { + REG1 = 1; + } + ``` + * Boolean NOT; equivalent of C's `!` unary operator * Xor * **Params**: REG1, REG2 * `REG1 = REG1 ^ REG2`