ft: introduce modrm macro for leaner matching
All instructions which use a modrm instruction for memory reads from or into a register can make use of this macro
This commit is contained in:
8
src/disasm_macros.rs
Normal file
8
src/disasm_macros.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
#[macro_export]
|
||||
/// Generate an Opcode for 'normal' ModRM instructions with mem access and a reg
|
||||
macro_rules! modrm {
|
||||
($self:ident, $variant:ident) => {{
|
||||
let (idx, reg) = $self.parse_modrm_byte();
|
||||
Opcode::$variant(idx, Register::by_id(reg))
|
||||
}};
|
||||
}
|
||||
Reference in New Issue
Block a user