- Main Page
- Modules
- Data Structures
- Files

- Search for |

# Address generation calculation support

## Typedefs

typedef xed_uint64_t(* | xed_register_callback_fn_t )(xed_reg_enum_t reg, void *context, xed_bool_t *error)
| A function for obtaining register values.
typedef xed_uint64_t(* | xed_segment_base_callback_fn_t )(xed_reg_enum_t reg, void *context, xed_bool_t *error)
| A function for obtaining the segment base values.

## Functions

XED_DLL_EXPORT xed_error_enum_t | xed_agen (xed_decoded_inst_t *xedd, unsigned int memop_index, void *context, xed_uint64_t *out_address)
| Using the registered callbacks, compute the memory address for a specified memop in a decoded instruction.
XED_DLL_EXPORT void | xed_agen_register_callback (xed_register_callback_fn_t register_fn, xed_segment_base_callback_fn_t segment_fn)
| Initialize the callback functions.

## Detailed Description

There are several functions available that help with computation of addresses. Note the "big real" or "unreal" address calculation is not currently supported. Two callbacks are defined for providing register values or segment base values. For real mode, the selector value is usedin the address computation. In protected mode or long mode, the segment descriptor callbacks are used.

## Typedef Documentation

typedef xed_uint64_t(* xed_register_callback_fn_t)(xed_reg_enum_t reg, void *context, xed_bool_t *error)

| A function for obtaining register values. 32b return values should be zero extended to 64b. The error value is set to nonzero if the callback experiences some sort of problem. Definition at line 44 of file xed-agen.h.

typedef xed_uint64_t(* xed_segment_base_callback_fn_t)(xed_reg_enum_t reg, void *context, xed_bool_t *error)

| A function for obtaining the segment base values. 32b return values should be zero extended zero extended to 64b. The error value is set to nonzero if the callback experiences some sort of problem. Definition at line 50 of file xed-agen.h.

## Function Documentation

XED_DLL_EXPORT xed_error_enum_t xed_agen | ( | xed_decoded_inst_t * | xedd,
|  | unsigned int | memop_index,
|  | void * | context,
|  | xed_uint64_t * | out_address
| ) |

| Using the registered callbacks, compute the memory address for a specified memop in a decoded instruction. memop_index can have the value 0 for XED_OPERAND_MEM0, XED_OPERAND_AGEN, or 1 for XED_OPERAND_MEM1. Any other value results in an error being returned. The context parameter which is passed to the registered callbacks can be used to identify which thread's state is being referenced.

XED_DLL_EXPORT void xed_agen_register_callback | ( | xed_register_callback_fn_t | register_fn,
|  | xed_segment_base_callback_fn_t | segment_fn
| ) |

| Initialize the callback functions. Tell XED what to call when using xed_agen.