00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00035
00036 #if !defined(_XED_OPERAND_VALUES_INTERFACE_H_)
00037 # define _XED_OPERAND_VALUES_INTERFACE_H_
00038
00039 #include "xed-common-hdrs.h"
00040 #include "xed-common-defs.h"
00041 #include "xed-portability.h"
00042 #include "xed-util.h"
00043 #include "xed-types.h"
00044 #include "xed-state.h"
00045 #include "xed-operand-enum.h"
00046 #include "xed-operand-storage.h"
00047 #include "xed-reg-enum.h"
00048 #include "xed-iclass-enum.h"
00050
00051
00052
00053 XED_DLL_EXPORT void xed_operand_values_init(xed_operand_values_t* p);
00054
00057 XED_DLL_EXPORT void xed_operand_values_init_set_mode(xed_operand_values_t* p,
00058 const xed_state_t* dstate);
00062 XED_DLL_EXPORT void xed_operand_values_init_keep_mode( xed_operand_values_t* dst,
00063 const xed_operand_values_t* src );
00065
00066
00067 XED_DLL_EXPORT xed_uint32_t
00068 xed_operand_values_get_operand_decider(const xed_operand_values_t* p,
00069 xed_operand_enum_t operand_decider_index) ;
00070
00071
00074
00075
00076
00077 XED_DLL_EXPORT void xed_operand_values_dump(const xed_operand_values_t* ov, char* buf, int buflen);
00080 XED_DLL_EXPORT void xed_operand_values_print_short(const xed_operand_values_t* ov, char* buf, int buflen);
00082
00084
00085
00086
00087
00088
00089 XED_DLL_EXPORT xed_bool_t
00090 xed_operand_values_has_real_rep(const xed_operand_values_t* p);
00093 XED_DLL_EXPORT xed_bool_t
00094 xed_operand_values_has_rep_prefix(const xed_operand_values_t* p);
00097 XED_DLL_EXPORT xed_bool_t
00098 xed_operand_values_has_repne_prefix(const xed_operand_values_t* p);
00100
00105 XED_DLL_EXPORT xed_bool_t
00106 xed_operand_values_get_atomic(const xed_operand_values_t* p);
00107
00110 XED_DLL_EXPORT xed_bool_t
00111 xed_operand_values_has_lock_prefix(const xed_operand_values_t* p);
00112
00118 XED_DLL_EXPORT xed_bool_t
00119 xed_operand_values_using_default_segment(const xed_operand_values_t* p, unsigned int i);
00120
00121
00122
00127 XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_operand_width(const xed_operand_values_t* p);
00130 XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_address_width(const xed_operand_values_t* p);
00131
00132
00135 XED_DLL_EXPORT xed_bool_t
00136 xed_operand_values_has_memory_displacement(const xed_operand_values_t* p);
00139 XED_DLL_EXPORT xed_bool_t
00140 xed_operand_values_has_branch_displacement(const xed_operand_values_t* p);
00143 XED_DLL_EXPORT xed_bool_t
00144 xed_operand_values_has_displacement(const xed_operand_values_t* p);
00145
00146
00149 XED_DLL_EXPORT xed_bool_t
00150 xed_operand_values_get_displacement_for_memop(const xed_operand_values_t* p);
00151
00154 XED_DLL_EXPORT xed_bool_t
00155 xed_operand_values_has_immediate(const xed_operand_values_t* p);
00156
00157
00162 XED_DLL_EXPORT xed_bool_t
00163 xed_operand_values_has_disp(const xed_operand_values_t* p);
00164
00166 XED_DLL_EXPORT xed_bool_t
00167 xed_operand_values_has_address_size_prefix(const xed_operand_values_t* p);
00169 XED_DLL_EXPORT xed_bool_t
00170 xed_operand_values_has_operand_size_prefix(const xed_operand_values_t* p);
00171
00172 #if 0
00173 XED_DLL_EXPORT xed_bool_t
00174 xed_operand_values_has_refining_66_prefix(const xed_operand_values_t* p);
00175 XED_DLL_EXPORT xed_bool_t
00176 xed_operand_values_has_refining_f2_prefix(const xed_operand_values_t* p);
00177 XED_DLL_EXPORT xed_bool_t
00178 xed_operand_values_has_refining_f3_prefix(const xed_operand_values_t* p);
00179 #endif
00180
00182 XED_DLL_EXPORT xed_bool_t
00183 xed_operand_values_has_segment_prefix(const xed_operand_values_t* p);
00184
00187 XED_DLL_EXPORT xed_reg_enum_t
00188 xed_operand_values_segment_prefix(const xed_operand_values_t* p);
00189
00191 XED_DLL_EXPORT xed_bool_t
00192 xed_operand_values_is_prefetch(const xed_operand_values_t* p);
00193
00195 XED_DLL_EXPORT xed_bool_t xed_operand_values_get_long_mode(const xed_operand_values_t* p);
00196
00198
00199
00200 XED_DLL_EXPORT xed_bool_t
00201 xed_operand_values_accesses_memory(const xed_operand_values_t* p);
00202
00204 XED_DLL_EXPORT unsigned int
00205 xed_operand_values_number_of_memory_operands(const xed_operand_values_t* p);
00206
00208 XED_DLL_EXPORT unsigned int
00209 xed_operand_values_get_memory_operand_length(const xed_operand_values_t* p,
00210 unsigned int memop_idx);
00211
00213 XED_DLL_EXPORT xed_reg_enum_t
00214 xed_operand_values_get_base_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00215
00217 XED_DLL_EXPORT xed_reg_enum_t
00218 xed_operand_values_get_index_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00219
00221 XED_DLL_EXPORT xed_reg_enum_t
00222 xed_operand_values_get_seg_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00223
00225 XED_DLL_EXPORT unsigned int
00226 xed_operand_values_get_scale(const xed_operand_values_t* p);
00227
00231 XED_DLL_EXPORT xed_bool_t
00232 xed_operand_values_memop_without_modrm(const xed_operand_values_t* p);
00235 XED_DLL_EXPORT xed_bool_t
00236 xed_operand_values_has_modrm_byte(const xed_operand_values_t* p);
00237
00240 XED_DLL_EXPORT xed_bool_t
00241 xed_operand_values_has_sib_byte(const xed_operand_values_t* p);
00243
00245 XED_DLL_EXPORT xed_bool_t
00246 xed_operand_values_branch_not_taken_hint(const xed_operand_values_t* p);
00248 XED_DLL_EXPORT xed_bool_t
00249 xed_operand_values_branch_taken_hint(const xed_operand_values_t* p);
00250
00252 XED_DLL_EXPORT xed_bool_t
00253 xed_operand_values_is_nop(const xed_operand_values_t* p);
00254
00255
00257
00258
00259 XED_DLL_EXPORT xed_int64_t
00260 xed_operand_values_get_immediate_int64(const xed_operand_values_t* p);
00261
00263 XED_DLL_EXPORT xed_uint64_t
00264 xed_operand_values_get_immediate_uint64(const xed_operand_values_t* p);
00265
00268 XED_DLL_EXPORT xed_uint_t xed_operand_values_get_immediate_is_signed(const xed_operand_values_t* p);
00269
00270
00272 XED_DLL_EXPORT xed_uint8_t
00273 xed_operand_values_get_immediate_byte(const xed_operand_values_t* p,unsigned int i);
00274
00276 XED_DLL_EXPORT xed_uint8_t
00277 xed_operand_values_get_second_immediate(const xed_operand_values_t* p);
00279
00281
00282
00283
00284 XED_DLL_EXPORT xed_uint32_t
00285 xed_operand_values_get_memory_displacement_length(const xed_operand_values_t* p);
00288 XED_DLL_EXPORT xed_uint32_t
00289 xed_operand_values_get_memory_displacement_length_bits(const xed_operand_values_t* p);
00290
00292 XED_DLL_EXPORT xed_int64_t
00293 xed_operand_values_get_memory_displacement_int64(const xed_operand_values_t* p);
00294
00296 XED_DLL_EXPORT xed_uint8_t
00297 xed_operand_values_get_memory_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00299
00301
00302
00303
00304 XED_DLL_EXPORT xed_uint32_t
00305 xed_operand_values_get_branch_displacement_length(const xed_operand_values_t* p);
00308 XED_DLL_EXPORT xed_uint32_t
00309 xed_operand_values_get_branch_displacement_length_bits(const xed_operand_values_t* p);
00310
00312 XED_DLL_EXPORT xed_int32_t
00313 xed_operand_values_get_branch_displacement_int32(const xed_operand_values_t* p);
00314
00316 XED_DLL_EXPORT xed_uint8_t
00317 xed_operand_values_get_branch_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00319
00320
00322 XED_DLL_EXPORT xed_iclass_enum_t
00323 xed_operand_values_get_iclass(const xed_operand_values_t* p);
00324
00326
00329
00330
00331 XED_DLL_EXPORT void xed_operand_values_zero_immediate(xed_operand_values_t* p);
00333 XED_DLL_EXPORT void xed_operand_values_zero_branch_displacement(xed_operand_values_t* p);
00335 XED_DLL_EXPORT void xed_operand_values_zero_memory_displacement(xed_operand_values_t* p);
00336
00338 XED_DLL_EXPORT void xed_operand_values_set_lock(xed_operand_values_t* p);
00340 XED_DLL_EXPORT void xed_operand_values_zero_segment_override(xed_operand_values_t* p);
00341
00342
00344 XED_DLL_EXPORT void
00345 xed_operand_values_set_iclass(xed_operand_values_t* p,xed_iclass_enum_t iclass);
00346
00348 XED_DLL_EXPORT void
00349 xed_operand_values_set_effective_operand_width(xed_operand_values_t* p,unsigned int width);
00350
00352 XED_DLL_EXPORT void
00353 xed_operand_values_set_memory_operand_length(xed_operand_values_t* p,unsigned int memop_length);
00354
00355
00358 XED_DLL_EXPORT void
00359 xed_operand_values_set_memory_displacement(xed_operand_values_t* p,xed_int64_t x, unsigned int len);
00362 XED_DLL_EXPORT void
00363 xed_operand_values_set_memory_displacement_bits(xed_operand_values_t* p,xed_int64_t x, unsigned int len_bits);
00364
00367 XED_DLL_EXPORT void xed_operand_values_set_relbr(xed_operand_values_t* p);
00368
00371 XED_DLL_EXPORT void
00372 xed_operand_values_set_branch_displacement(xed_operand_values_t* p,xed_int32_t x, unsigned int len);
00375 XED_DLL_EXPORT void
00376 xed_operand_values_set_branch_displacement_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int len_bits);
00377
00380 XED_DLL_EXPORT void
00381 xed_operand_values_set_immediate_signed(xed_operand_values_t* p,xed_int32_t x, unsigned int bytes);
00384 XED_DLL_EXPORT void
00385 xed_operand_values_set_immediate_signed_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int bits);
00386
00387
00390 XED_DLL_EXPORT void
00391 xed_operand_values_set_immediate_unsigned(xed_operand_values_t* p,xed_uint64_t x, unsigned int bytes);
00394 XED_DLL_EXPORT void
00395 xed_operand_values_set_immediate_unsigned_bits(xed_operand_values_t* p,xed_uint64_t x, unsigned int bits);
00396
00397
00398
00400 XED_DLL_EXPORT void xed_operand_values_set_base_reg(xed_operand_values_t* p,
00401 unsigned int memop_idx,
00402 xed_reg_enum_t new_base);
00403
00405 XED_DLL_EXPORT void xed_operand_values_set_seg_reg(xed_operand_values_t* p,
00406 unsigned int memop_idx,
00407 xed_reg_enum_t new_seg);
00408
00410 XED_DLL_EXPORT void xed_operand_values_set_index_reg(xed_operand_values_t* p,
00411 unsigned int memop_idx,
00412 xed_reg_enum_t new_index);
00413
00415 XED_DLL_EXPORT void xed_operand_values_set_scale(xed_operand_values_t* p,
00416 xed_uint_t memop_idx,
00417 xed_uint_t new_scale);
00418
00419
00423 XED_DLL_EXPORT void
00424 xed_operand_values_set_operand_reg(xed_operand_values_t* p,
00425 xed_operand_enum_t operand_name,
00426 xed_reg_enum_t reg_name);
00427
00429 #endif
00430
00431
00432
00433