diff options
author | iximeow <me@iximeow.net> | 2019-06-30 12:56:08 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 16:10:13 -0800 |
commit | 2f9867664191bcfe0b7f7209de7463df30f775de (patch) | |
tree | 6f8e5f2265b201ece2712c1db321b09a4db2511d /src/display.rs | |
parent | 49d2e670b56d43d079775f01a02f31555bb9da73 (diff) |
add more x86 instructions (bt, btr, bts, bsf, ...) and xadd
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/display.rs b/src/display.rs index ca2b2f7..cbf3e61 100644 --- a/src/display.rs +++ b/src/display.rs @@ -183,6 +183,13 @@ impl <T: std::fmt::Write> Colorize<T> for Operand { impl fmt::Display for Opcode { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { + &Opcode::XADD => write!(f, "{}", "xadd"), + &Opcode::BT => write!(f, "{}", "bt"), + &Opcode::BTS => write!(f, "{}", "bts"), + &Opcode::BTR => write!(f, "{}", "btr"), + &Opcode::BTC => write!(f, "{}", "btc"), + &Opcode::BSF => write!(f, "{}", "bsf"), + &Opcode::BSR => write!(f, "{}", "bsr"), &Opcode::MOVSS => write!(f, "{}", "movss"), &Opcode::SQRTSS => write!(f, "{}", "sqrtss"), &Opcode::ADDSS => write!(f, "{}", "addss"), @@ -350,8 +357,11 @@ impl fmt::Display for Opcode { &Opcode::DIV => write!(f, "{}", "div"), &Opcode::IDIV => write!(f, "{}", "idiv"), &Opcode::CMPXCHG => write!(f, "{}", "cmpxchg"), + &Opcode::MOVSX_b => write!(f, "{}", "movsx"), + &Opcode::MOVSX_w => write!(f, "{}", "movsx"), &Opcode::MOVZX_b => write!(f, "{}", "movzx"), &Opcode::MOVZX_w => write!(f, "{}", "movzx"), + &Opcode::MOVSXD => write!(f, "{}", "movsxd"), &Opcode::MOVSX => write!(f, "{}", "movsx"), &Opcode::SETO => write!(f, "{}", "seto"), &Opcode::SETNO => write!(f, "{}", "setno"), @@ -387,11 +397,10 @@ impl <T: std::fmt::Write> Colorize<T> for Opcode { Opcode::SUBSS | Opcode::MULSS | Opcode::DIVSS | - Opcode::MOVDDUP | - Opcode::MOVSLDUP | Opcode::HADDPS | Opcode::HSUBPS | Opcode::ADDSUBPS | + Opcode::XADD| Opcode::DIV | Opcode::IDIV | Opcode::MUL | @@ -415,6 +424,12 @@ impl <T: std::fmt::Write> Colorize<T> for Opcode { Opcode::ADD | Opcode::ADC | Opcode::SUB | + Opcode::BT | + Opcode::BTS | + Opcode::BTR | + Opcode::BTC | + Opcode::BSF | + Opcode::BSR | Opcode::IMUL => { write!(out, "{}", colors.arithmetic_op(self)) } Opcode::POPF | Opcode::PUSHF | @@ -471,6 +486,8 @@ impl <T: std::fmt::Write> Colorize<T> for Opcode { Opcode::STC | Opcode::STI | Opcode::STD | + Opcode::MOVDDUP | + Opcode::MOVSLDUP | Opcode::MOV | Opcode::MOVSD | Opcode::CBW | @@ -482,9 +499,12 @@ impl <T: std::fmt::Write> Colorize<T> for Opcode { Opcode::MOVS | Opcode::INS | Opcode::OUTS | + Opcode::MOVSX_b | + Opcode::MOVSX_w | Opcode::MOVZX_b | Opcode::MOVZX_w | Opcode::MOVSX | + Opcode::MOVSXD | Opcode::XCHG | Opcode::CMOVA | Opcode::CMOVB | @@ -627,6 +647,7 @@ impl <T: std::fmt::Write> ShowContextual<u64, [Option<String>], T> for Instructi } }; match self.opcode { + Opcode::MOVSX_b | Opcode::MOVZX_b => { match context.and_then(|xs| xs[1].as_ref()) { Some(s) => { write!(out, ", {}", s) } @@ -653,6 +674,7 @@ impl <T: std::fmt::Write> ShowContextual<u64, [Option<String>], T> for Instructi } } }, + Opcode::MOVSX_w | Opcode::MOVZX_w => { match context.and_then(|xs| xs[1].as_ref()) { Some(s) => { write!(out, ", {}", s) } |