chore: align disasm print more with objdump(1)
This commit is contained in:
@@ -56,7 +56,7 @@ impl Instruction {
|
||||
|
||||
impl fmt::Display for Instruction {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:04x}: ", self.start).unwrap();
|
||||
write!(f, "{:04x}:\t", self.start).unwrap();
|
||||
|
||||
write!(
|
||||
f,
|
||||
@@ -65,11 +65,11 @@ impl fmt::Display for Instruction {
|
||||
.iter()
|
||||
.map(|b| format!("{:02x}", b))
|
||||
.collect::<Vec<String>>()
|
||||
.join("")
|
||||
.join(" ")
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
write!(f, "\t\t{}", self.opcode)
|
||||
write!(f, "\t{}", self.opcode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,14 +529,14 @@ impl fmt::Display for Mnemonic {
|
||||
Self::SAR_fromReg(target, reg) => write!(f, "sar {target}, {reg}"),
|
||||
|
||||
Self::IN_AL(byte) => write!(f, "in {}, {byte:#04x}", Register::AL),
|
||||
Self::IN_AX(byte) => write!(f, "in :#04x{}, {byte:#04x}", Register::AX),
|
||||
Self::IN_ALDX => write!(f, "in {}, :#04x{}", Register::AL, Register::DX),
|
||||
Self::IN_AXDX => write!(f, "in {}, :#04x{}", Register::AX, Register::DX),
|
||||
Self::IN_AX(byte) => write!(f, "in {}, {byte:#04x}", Register::AX),
|
||||
Self::IN_ALDX => write!(f, "in {}, {}", Register::AL, Register::DX),
|
||||
Self::IN_AXDX => write!(f, "in {}, {}", Register::AX, Register::DX),
|
||||
|
||||
Self::OUT_AL(byte) => write!(f, "out :#04x{}, {byte:#04x}", Register::AL),
|
||||
Self::OUT_AX(byte) => write!(f, "out :#04x{}, {byte:#04x}", Register::AX),
|
||||
Self::OUT_ALDX => write!(f, "out {}, :#04x{}", Register::AL, Register::DX),
|
||||
Self::OUT_AXDX => write!(f, "out {}, :#04x{}", Register::AX, Register::DX),
|
||||
Self::OUT_AL(byte) => write!(f, "out {}, {byte:#04x}", Register::AL),
|
||||
Self::OUT_AX(byte) => write!(f, "out {}, {byte:#04x}", Register::AX),
|
||||
Self::OUT_ALDX => write!(f, "out {}, {}", Register::AL, Register::DX),
|
||||
Self::OUT_AXDX => write!(f, "out {}, {}", Register::AX, Register::DX),
|
||||
|
||||
Self::INT(byte) => write!(f, "int {byte:#04x}"),
|
||||
Self::INTO => write!(f, "into"),
|
||||
|
||||
Reference in New Issue
Block a user