aboutsummaryrefslogtreecommitdiff
path: root/src/protected_mode/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/protected_mode/mod.rs')
-rw-r--r--src/protected_mode/mod.rs30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/protected_mode/mod.rs b/src/protected_mode/mod.rs
index a088ad6..5e19676 100644
--- a/src/protected_mode/mod.rs
+++ b/src/protected_mode/mod.rs
@@ -4,6 +4,8 @@ mod evex;
mod display;
pub mod uarch;
+use MemoryAccessSize;
+
#[cfg(feature = "fmt")]
pub use self::display::DisplayStyle;
@@ -4112,34 +4114,6 @@ impl Default for Instruction {
}
}
-const MEM_SIZE_STRINGS: [&'static str; 64] = [
- "byte", "word", "BUG", "dword", "far", "ptr", "BUG", "qword",
- "BUG", "mword", "BUG", "BUG", "BUG", "BUG", "BUG", "xmmword",
- "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG",
- "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "ymmword",
- "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG",
- "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG",
- "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "BUG",
- "BUG", "BUG", "BUG", "BUG", "BUG", "BUG", "ptr", "zmmword",
-];
-
-pub struct MemoryAccessSize {
- size: u8,
-}
-impl MemoryAccessSize {
- pub fn bytes_size(&self) -> Option<u8> {
- if self.size == 63 {
- None
- } else {
- Some(self.size)
- }
- }
-
- pub fn size_name(&self) -> &'static str {
- MEM_SIZE_STRINGS[self.size as usize - 1]
- }
-}
-
impl Instruction {
pub fn opcode(&self) -> Opcode {
self.opcode