diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/long_mode/display.rs | 20 | ||||
| -rw-r--r-- | src/long_mode/mod.rs | 2 | 
2 files changed, 12 insertions, 10 deletions
diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index 42d3683..5dac6cf 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -2244,18 +2244,18 @@ impl <T: fmt::Write, Color: fmt::Display, Y: YaxColors<Color>> ShowContextual<u6              write!(out, "lock ")?;          } -        /* -        if [Opcode::MOVS, Opcode::CMPS, Opcode::LODS, Opcode::STOS, Opcode::INS, Opcode::OUTS].contains(&self.opcode) { -            // only a few of you actually use the prefix... -            if self.prefixes.rep() { -                write!(out, "rep ")?; -            } else if self.prefixes.repz() { -                write!(out, "repz ")?; -            } else if self.prefixes.repnz() { -                write!(out, "repnz ")?; +        if self.prefixes.rep_any() { +            if [Opcode::MOVS, Opcode::CMPS, Opcode::LODS, Opcode::STOS, Opcode::INS, Opcode::OUTS].contains(&self.opcode) { +                // only a few of you actually use the prefix... +                if self.prefixes.rep() { +                    write!(out, "rep ")?; +                } else if self.prefixes.repz() { +                    write!(out, "repz ")?; +                } else if self.prefixes.repnz() { +                    write!(out, "repnz ")?; +                }              }          } -        */          out.write_str(self.opcode.name())?; diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index 3b3bddb..5c431b4 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -3223,6 +3223,8 @@ impl Prefixes {      #[inline]      fn set_repnz(&mut self) { self.bits = (self.bits & 0xcf) | 0x30 }      #[inline] +    pub fn rep_any(&self) -> bool { self.bits & 0x30 != 0x00 } +    #[inline]      fn operand_size(&self) -> bool { self.bits & 0x1 == 1 }      #[inline]      fn set_operand_size(&mut self) { self.bits = self.bits | 0x1 }  | 
