chore: align disasm print more with objdump(1)

This commit is contained in:
2025-05-20 11:28:23 +09:00
parent beccff0d79
commit 48eeff16fa
2 changed files with 30 additions and 30 deletions

View File

@@ -66,22 +66,22 @@ impl Register {
impl fmt::Display for Register {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::AX => write!(f, "ax"),
Self::BX => write!(f, "bx"),
Self::CX => write!(f, "cx"),
Self::DX => write!(f, "dx"),
Self::AH => write!(f, "ah"),
Self::AL => write!(f, "al"),
Self::BL => write!(f, "bl"),
Self::BH => write!(f, "bh"),
Self::CH => write!(f, "ch"),
Self::CL => write!(f, "cl"),
Self::DH => write!(f, "dh"),
Self::DL => write!(f, "dl"),
Self::DI => write!(f, "di"),
Self::SI => write!(f, "si"),
Self::BP => write!(f, "bp"),
Self::SP => write!(f, "sp"),
Self::AX => write!(f, "%ax"),
Self::BX => write!(f, "%bx"),
Self::CX => write!(f, "%cx"),
Self::DX => write!(f, "%dx"),
Self::AH => write!(f, "%ah"),
Self::AL => write!(f, "%al"),
Self::BL => write!(f, "%bl"),
Self::BH => write!(f, "%bh"),
Self::CH => write!(f, "%ch"),
Self::CL => write!(f, "%cl"),
Self::DH => write!(f, "%dh"),
Self::DL => write!(f, "%dl"),
Self::DI => write!(f, "%di"),
Self::SI => write!(f, "%si"),
Self::BP => write!(f, "%bp"),
Self::SP => write!(f, "%sp"),
}
}
}
@@ -113,10 +113,10 @@ impl SegmentRegister {
impl fmt::Display for SegmentRegister {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::DS => write!(f, "ds"),
Self::ES => write!(f, "es"),
Self::SS => write!(f, "ss"),
Self::CS => write!(f, "cs"),
Self::DS => write!(f, "%ds"),
Self::ES => write!(f, "%es"),
Self::SS => write!(f, "%ss"),
Self::CS => write!(f, "%cs"),
}
}
}