aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn.rs
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-02-27 23:35:32 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-02-27 23:39:25 +0100
commitd44466c852dd353166c79d1cc618646b21e17f8c (patch)
tree43881e9164badf11206785688b4787859b710c02 /src/insn.rs
parentfdc967fb7a4c8417e846a7c2b1656e3d482967cd (diff)
downloadjuicebox-asm-d44466c852dd353166c79d1cc618646b21e17f8c.tar.gz
juicebox-asm-d44466c852dd353166c79d1cc618646b21e17f8c.zip
Add JNZ and Reg32 ADD, DEC, TEST for readme example
Diffstat (limited to 'src/insn.rs')
-rw-r--r--src/insn.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/insn.rs b/src/insn.rs
index 8351c54..f3ba18d 100644
--- a/src/insn.rs
+++ b/src/insn.rs
@@ -1,6 +1,7 @@
mod add;
mod dec;
mod jmp;
+mod jnz;
mod jz;
mod mov;
mod ret;
@@ -21,6 +22,11 @@ pub trait Jmp<T> {
fn jmp(&mut self, op1: T);
}
+pub trait Jnz<T> {
+ /// Emit a conditional jump if not zero instruction (`ZF = 0`).
+ fn jnz(&mut self, op1: T);
+}
+
pub trait Jz<T> {
/// Emit a conditional jump if zero instruction (`ZF = 1`).
fn jz(&mut self, op1: T);