Read a u16 instead of 2 x u8
@@ -1859,11 +1859,11 @@ impl<'a> Decoder<'a> {
#[cfg(not(feature = "__internal_mem_vsib"))]
fn read_op_mem_1_4(&mut self, instruction: &mut Instruction) -> bool {
- let sib = self.read_u8() as u32;
- self.displ_index = self.data_ptr as u8;
- let displ = self.read_u8() as i8 as u32;
+ let sib = self.read_u16() as u32;
+ let displ = (sib >> 8) as i8 as u32;
+ self.displ_index = self.data_ptr.wrapping_sub(1) as u8;
- instruction_internal::internal_set_memory_index_scale(instruction, sib >> 6);
+ instruction_internal::internal_set_memory_index_scale(instruction, (sib >> 6) & 3);
let index = ((sib >> 3) & 7) + self.state.extra_index_register_base;
let base_reg = if self.state.address_size == OpSize::Size64 { Register::RAX } else { Register::EAX };
if index != 4 {
