diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-02-27 22:00:11 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-02-27 22:00:11 +0100 |
commit | fed6ae454f659f4d2b36520474d1998b526a27dd (patch) | |
tree | 562da1123e520af33a1cce63d71e57e27c8c5036 /src/insn | |
parent | ab5711a77e2a6872ca1392c1dbc2f545f7d3ab3b (diff) | |
download | juicebox-asm-fed6ae454f659f4d2b36520474d1998b526a27dd.tar.gz juicebox-asm-fed6ae454f659f4d2b36520474d1998b526a27dd.zip |
Add JMP, JZ, and Label
Diffstat (limited to 'src/insn')
-rw-r--r-- | src/insn/jmp.rs | 7 | ||||
-rw-r--r-- | src/insn/jz.rs | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/insn/jmp.rs b/src/insn/jmp.rs new file mode 100644 index 0000000..71d1dbc --- /dev/null +++ b/src/insn/jmp.rs @@ -0,0 +1,7 @@ +use crate::prelude::*; + +impl Jmp<&mut Label> for Asm { + fn jmp(&mut self, op1: &mut Label) { + self.encode_jmp_label(&[0xe9], op1); + } +} diff --git a/src/insn/jz.rs b/src/insn/jz.rs new file mode 100644 index 0000000..6563ca2 --- /dev/null +++ b/src/insn/jz.rs @@ -0,0 +1,7 @@ +use crate::prelude::*; + +impl Jz<&mut Label> for Asm { + fn jz(&mut self, op1: &mut Label) { + self.encode_jmp_label(&[0x0f, 0x84], op1); + } +} |