diff options
Diffstat (limited to 'src/long_mode')
| -rw-r--r-- | src/long_mode/mod.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index f2fac5b..bfe67c3 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -3498,8 +3498,12 @@ impl Prefixes { fn set_repnz(&mut self) { self.bits = (self.bits & 0xcf) | 0x30 } #[inline] pub fn rep_any(&self) -> bool { self.bits & 0x30 != 0x00 } + /// return `true` if an operand-size (`66`) prefix is active for the instruction. + /// + /// this interacts in subtle ways with a REX prefix, if both are present. if you are tempted to + /// refine decode logic based the result of this function, please report that as an issue. #[inline] - fn operand_size(&self) -> bool { self.bits & 0x1 == 1 } + pub fn operand_size(&self) -> bool { self.bits & 0x1 == 1 } #[inline] fn set_operand_size(&mut self) { self.bits = self.bits | 0x1; @@ -3508,14 +3512,18 @@ impl Prefixes { fn unset_operand_size(&mut self) { self.bits = self.bits & !0x1; } + /// return `true` if an operand-size (67) prefix is active for the instruction. #[inline] - fn address_size(&self) -> bool { self.bits & 0x2 == 2 } + pub fn address_size(&self) -> bool { self.bits & 0x2 == 2 } #[inline] fn set_address_size(&mut self) { self.bits = self.bits | 0x2 } #[inline] fn set_lock(&mut self) { self.bits |= 0x4 } #[inline] pub fn lock(&self) -> bool { self.bits & 0x4 == 4 } + /// return the instruction's selected data segment. + #[inline] + pub fn segment(&self) -> Segment { self.segment } #[inline] pub fn cs(&self) -> bool { self.segment == Segment::CS } #[inline] |
