aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-06-01 19:05:56 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commitbf9d79066de007a79bc343270c968413d3a1d365 (patch)
tree82792571eb1004f77d0dbe047a39bce55d98e239
parentaa79e826869a7fed8df6b4f7e7a7503565659f89 (diff)
fix segment selector assignment
-rw-r--r--src/lib.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ab67362..60c9ab7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -545,29 +545,29 @@ impl Prefixes {
#[inline]
fn set_address_size(&mut self) { self.bits = self.bits | 0x2 }
#[inline]
- fn cs(&self) -> bool { self.bits & 0x70 == 0x10 }
+ fn cs(&self) -> bool { self.segment == Segment::CS }
#[inline]
- fn set_cs(&mut self) { self.bits = (self.bits & 0x8f) | 0x10 }
+ fn set_cs(&mut self) { self.segment = Segment::CS }
#[inline]
- fn ds(&self) -> bool { self.bits & 0x70 == 0x20 }
+ fn ds(&self) -> bool { self.segment == Segment::DS }
#[inline]
- fn set_ds(&mut self) { self.bits = (self.bits & 0x8f) | 0x20 }
+ fn set_ds(&mut self) { self.segment = Segment::DS }
#[inline]
- fn es(&self) -> bool { self.bits & 0x70 == 0x30 }
+ fn es(&self) -> bool { self.segment == Segment::ES }
#[inline]
- fn set_es(&mut self) { self.bits = (self.bits & 0x8f) | 0x30 }
+ fn set_es(&mut self) { self.segment = Segment::ES }
#[inline]
- fn fs(&self) -> bool { self.bits & 0x70 == 0x40 }
+ fn fs(&self) -> bool { self.segment == Segment::FS }
#[inline]
- fn set_fs(&mut self) { self.bits = (self.bits & 0x8f) | 0x40 }
+ fn set_fs(&mut self) { self.segment = Segment::FS }
#[inline]
- fn gs(&self) -> bool { self.bits & 0x70 == 0x50 }
+ fn gs(&self) -> bool { self.segment == Segment::GS }
#[inline]
- fn set_gs(&mut self) { self.bits = (self.bits & 0x8f) | 0x50 }
+ fn set_gs(&mut self) { self.segment = Segment::GS }
#[inline]
- fn ss(&self) -> bool { self.bits & 0x70 == 0x60 }
+ fn ss(&self) -> bool { self.segment == Segment::SS }
#[inline]
- fn set_ss(&mut self) { self.bits = (self.bits & 0x8f) | 0x60 }
+ fn set_ss(&mut self) { self.segment = Segment::SS }
#[inline]
fn rex(&self) -> &PrefixRex { &self.rex }
#[inline]