fix: rename OperandSize to OperandWidth
This commit is contained in:
@@ -204,9 +204,9 @@ pub type RegisterId = u8;
|
||||
#[allow(dead_code)]
|
||||
impl Register {
|
||||
/// Find the register corresponding to the 8086 bytecode ID
|
||||
pub fn by_id(id: OperandSize) -> Self {
|
||||
pub fn by_id(id: OperandWidth) -> Self {
|
||||
match id {
|
||||
OperandSize::Byte(b) => match b {
|
||||
OperandWidth::Byte(b) => match b {
|
||||
0b000 => Self::AL,
|
||||
0b001 => Self::CL,
|
||||
0b010 => Self::DL,
|
||||
@@ -217,7 +217,7 @@ impl Register {
|
||||
0b111 => Self::BH,
|
||||
_ => panic!("Invalid 8bit register ID encountered"),
|
||||
},
|
||||
OperandSize::Word(w) => match w {
|
||||
OperandWidth::Word(w) => match w {
|
||||
0b000 => Self::AX,
|
||||
0b001 => Self::CX,
|
||||
0b010 => Self::DX,
|
||||
@@ -339,7 +339,7 @@ impl std::fmt::Display for ModRmTarget {
|
||||
pub struct MemoryIndex {
|
||||
pub base: Option<Register>,
|
||||
pub index: Option<Register>,
|
||||
pub displacement: Option<OperandSize>,
|
||||
pub displacement: Option<OperandWidth>,
|
||||
}
|
||||
|
||||
impl fmt::Display for MemoryIndex {
|
||||
@@ -369,12 +369,12 @@ impl fmt::Display for MemoryIndex {
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(dead_code)]
|
||||
/// Can be used to encode either byte or word operands
|
||||
pub enum OperandSize {
|
||||
pub enum OperandWidth {
|
||||
Byte(u8),
|
||||
Word(u16),
|
||||
}
|
||||
|
||||
impl fmt::Display for OperandSize {
|
||||
impl fmt::Display for OperandWidth {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
Self::Byte(byte) => write!(f, "{}", byte),
|
||||
|
||||
Reference in New Issue
Block a user