diff options
author | iximeow <me@iximeow.net> | 2019-10-19 22:59:58 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 16:10:13 -0800 |
commit | 98fcbbcb92554090651a15460319ce7ae4038c6a (patch) | |
tree | 402e1ac3bbf9eedce53adfcde1ca61ea21441651 /src/display.rs | |
parent | 3c9597a105670c91a6c11493204a4828ed54d235 (diff) |
decode shift-by-cl and fix error decoding sign-extending operands
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/display.rs b/src/display.rs index 2a1dcc2..fc3f1bd 100644 --- a/src/display.rs +++ b/src/display.rs @@ -6,7 +6,22 @@ use std::fmt; use yaxpeax_arch::{Colorize, ColorSettings, ShowContextual, YaxColors}; use yaxpeax_arch::display::*; -use ::{RegSpec, RegisterBank, Opcode, Operand, Instruction, Segment}; +use ::{RegSpec, RegisterBank, Opcode, Operand, Instruction, Segment, PrefixRex}; + +impl fmt::Display for PrefixRex { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if self.present() { + write!(f, "rex:{}{}{}{}", + if self.w() { "w" } else { "-" }, + if self.r() { "r" } else { "-" }, + if self.x() { "x" } else { "-" }, + if self.b() { "b" } else { "-" }, + ) + } else { + write!(f, "rex:none") + } + } +} impl fmt::Display for Segment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |