From fed6ae454f659f4d2b36520474d1998b526a27dd Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Mon, 27 Feb 2023 22:00:11 +0100 Subject: Add JMP, JZ, and Label --- src/insn/jmp.rs | 7 +++++++ src/insn/jz.rs | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 src/insn/jmp.rs create mode 100644 src/insn/jz.rs (limited to 'src/insn') 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); + } +} -- cgit v1.2.3