ft: add first basic test
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user