ft: add first basic test

This commit is contained in:
2025-05-25 21:20:12 +09:00
parent 35207d23f0
commit 8ea91d80b8
4 changed files with 41 additions and 8 deletions

View File

@@ -39,7 +39,7 @@ impl fmt::LowerHex for Operand {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
/// ModRM byte can either target a memory location or some register.
pub enum ModRmTarget {
Memory(MemoryIndex),
@@ -55,7 +55,7 @@ impl std::fmt::Display for ModRmTarget {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
/// Memory displacements are signed versions of Byte and Word operands.
/// Encodes either Byte- or Word-sized operands.
pub enum Displacement {
@@ -95,7 +95,7 @@ impl std::fmt::Display for Displacement {
/// A memory index operand is usually created by ModRM bytes or words.
/// e.g. [bx+si]
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MemoryIndex {
pub base: Option<Register>,
pub index: Option<Register>,
@@ -131,7 +131,7 @@ impl fmt::Display for MemoryIndex {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
/// 32-bit segment:offset pointer (e.g. for CALL instruction)
pub struct Pointer {
pub raw: DWord,