chore: show raw pointer value in disasm

This commit is contained in:
2025-05-25 10:27:32 +09:00
parent 90fb88aec6
commit 6762195378
2 changed files with 18 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ pub type Byte = u8; // b
pub type IByte = i8; // used for displacements of memory access
pub type Word = u16; // w or v
pub type IWord = i16; // used for displacement of memory access
pub type DWord = u32;
#[derive(Debug, Clone)]
#[allow(dead_code)]
@@ -130,12 +131,13 @@ impl fmt::Display for MemoryIndex {
#[derive(Debug, Clone)]
/// 32-bit segment:offset pointer (e.g. for CALL instruction)
pub struct Pointer {
pub raw: DWord,
pub segment: Word,
pub offset: Word,
}
impl std::fmt::Display for Pointer {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}:{}", self.segment, self.offset)
write!(f, "[{:#04x}] ({}:{})", self.raw, self.segment, self.offset)
}
}