Skip to main content

opnd_create_base_disp

Function opnd_create_base_disp 

Source
pub unsafe extern "C" fn opnd_create_base_disp(
    base_reg: reg_id_t,
    index_reg: reg_id_t,
    scale: c_int,
    disp: c_int,
    data_size: opnd_size_t,
) -> opnd_t
Expand description

Returns a memory reference operand that refers to the address:

  • disp(base_reg, index_reg, scale)

or, in other words,

  • base_reg + index_reg*scale + disp

The operand has data size data_size (must be a OPSZ_ constant). Both \p base_reg and \p index_reg must be DR_REG_ constants. \p scale must be either 0, 1, 2, 4, or 8. On ARM, opnd_set_index_shift() can be used for further manipulation of the index register. On ARM, a negative value for \p disp will be converted into a positive value with #DR_OPND_NEGATED set in opnd_get_flags(). On ARM, either \p index_reg must be #DR_REG_NULL or disp must be 0.

Also use this function to create VSIB operands, passing a SIMD register as the index register.