ft: implement group3a/b instructions

This commit is contained in:
2025-05-14 11:46:09 +09:00
parent 04493b1179
commit 38a2782cc6
3 changed files with 64 additions and 33 deletions

View File

@@ -24,27 +24,3 @@ macro_rules! modrms {
Mnemonic::$variant(target, SegmentRegister::by_id(reg))
}};
}
#[macro_export]
/// Generate the resulting Mnemonic from a GPR instruction with Byte-sized
/// Immediate, encoded in a ModRM byte.
/// GPR always has an imm value as second operand.
macro_rules! modrmgpr1b {
($self:ident) => {{
let (target, reg) = $self.parse_modrm_byte(Operand::Byte(0));
let imm = $self.parse_byte();
Self::modrm_reg_to_mnemonic(reg, target, Operand::Byte(imm))
}};
}
#[macro_export]
/// Generate the resulting Mnemonic from a GPR instruction with Word-sized
/// Immediate, encoded in a ModRM byte.
/// GPR always has an imm value as second operand.
macro_rules! modrmgpr1v {
($self:ident) => {{
let (target, reg) = $self.parse_modrm_byte(Operand::Word(0));
let imm = $self.parse_word();
Self::modrm_reg_to_mnemonic(reg, target, Operand::Word(imm))
}};
}