pub fn segment_override_for_op(&self, op: u8) -> Option<Segment> {
        match self.opcode {
            Opcode::STOS |
            Opcode::SCAS => {
                if op == 0 {
                    Some(Segment::ES)
                } else {
                    None
                }
            }
            Opcode::LODS => {
                if op == 1 {
                    Some(self.prefixes.segment)
                } else {
                    None
                }
            }
            Opcode::MOVS => {
                if op == 0 {
                    Some(Segment::ES)
                } else if op == 1 {
                    Some(self.prefixes.segment)
                } else {
                    None
                }
            }
            Opcode::CMPS => {
                if op == 0 {
                    Some(self.prefixes.segment)
                } else if op == 1 {
                    Some(Segment::ES)
                } else {
                    None
                }
            },
            _ => {
                // most operands are pretty simple:
                if self.operands[op as usize].is_memory() &&
                    self.prefixes.segment != Segment::DS {
                    Some(self.prefixes.segment)
                } else {
                    None
                }
            }
        }
    }
/// get the `Segment` that will *actually* be used for accessing the operand at index `i`.
///
/// `stos`, `lods`, `movs`, and `cmps` specifically name some segments for use regardless of
/// prefixes.
get the `Segment` that will *actually* be used for accessing the operand at index `i`.
get the ` Segment ` that will * actually * be used for accessing the operand at index ` i ` .
pub fn segment_override_for_op(&self, op: u8) -> Option<Segment> {
        match self.opcode {
            Opcode::STOS |
            Opcode::SCAS => {
                if op == 0 {
                    Some(Segment::ES)
                } else {
                    None
                }
            }
            Opcode::LODS => {
                if op == 1 {
                    Some(self.prefixes.segment)
                } else {
                    None
                }
            }
            Opcode::MOVS => {
                if op == 0 {
                    Some(Segment::ES)
                } else if op == 1 {
                    Some(self.prefixes.segment)
                } else {
                    None
                }
            }
            Opcode::CMPS => {
                if op == 0 {
                    Some(self.prefixes.segment)
                } else if op == 1 {
                    Some(Segment::ES)
                } else {
                    None
                }
            },
            _ => {
                // most operands are pretty simple:
                if self.operands[op as usize].is_memory() &&
                    self.prefixes.segment != Segment::DS {
                    Some(self.prefixes.segment)
                } else {
                    None
                }
            }
        }
    }
pub fn segment_override_for_op ( & self , op : u8 ) -> Option < Segment > { match self . opcode { Opcode :: STOS | Opcode :: SCAS => { if op == 0 { Some ( Segment :: ES ) } else { None } } Opcode :: LODS => { if op == 1 { Some ( self . prefixes . segment ) } else { None } } Opcode :: MOVS => { if op == 0 { Some ( Segment :: ES ) } else if op == 1 { Some ( self . prefixes . segment ) } else { None } } Opcode :: CMPS => { if op == 0 { Some ( self . prefixes . segment ) } else if op == 1 { Some ( Segment :: ES ) } else { None } } , _ => { // most operands are pretty simple: if self . operands [ op as usize ] . is_memory ( ) && self . prefixes . segment != Segment :: DS { Some ( self . prefixes . segment ) } else { None } } } }
get the `Segment` that will *actually* be used for accessing the operand at index `i`.
get the ` Segment ` that will * actually * be used for accessing the operand at index ` i ` .
&self
op
u8
&self
op
u8