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
00033
00034 #if !defined(_XED_OPERAND_VALUES_INTERFACE_H_)
00035 # define _XED_OPERAND_VALUES_INTERFACE_H_
00036
00037 #include "xed-common-hdrs.h"
00038 #include "xed-common-defs.h"
00039 #include "xed-portability.h"
00040 #include "xed-util.h"
00041 #include "xed-types.h"
00042 #include "xed-state.h"
00043 #include "xed-operand-enum.h"
00044 #include "xed-operand-storage.h"
00045 #include "xed-reg-enum.h"
00046 #include "xed-iclass-enum.h"
00048
00049
00050
00051 XED_DLL_EXPORT void xed_operand_values_init(xed_operand_values_t* p);
00052
00055 XED_DLL_EXPORT void xed_operand_values_init_set_mode(xed_operand_values_t* p,
00056 const xed_state_t* dstate);
00057
00060 XED_DLL_EXPORT void xed_operand_values_set_mode(xed_operand_values_t* p,
00061 const xed_state_t* dstate);
00062
00066 XED_DLL_EXPORT void xed_operand_values_init_keep_mode( xed_operand_values_t* dst,
00067 const xed_operand_values_t* src );
00069
00070
00071 XED_DLL_EXPORT xed_uint32_t
00072 xed_operand_values_get_operand_decider(const xed_operand_values_t* p,
00073 xed_operand_enum_t operand_decider_index) ;
00074
00075
00078
00079
00080
00081 XED_DLL_EXPORT void xed_operand_values_dump(const xed_operand_values_t* ov, char* buf, int buflen);
00084 XED_DLL_EXPORT void xed_operand_values_print_short(const xed_operand_values_t* ov, char* buf, int buflen);
00086
00088
00089
00090
00091
00092
00093 XED_DLL_EXPORT xed_bool_t
00094 xed_operand_values_has_real_rep(const xed_operand_values_t* p);
00097 XED_DLL_EXPORT xed_bool_t
00098 xed_operand_values_has_rep_prefix(const xed_operand_values_t* p);
00101 XED_DLL_EXPORT xed_bool_t
00102 xed_operand_values_has_repne_prefix(const xed_operand_values_t* p);
00103
00106 XED_DLL_EXPORT void xed_operand_values_set_repne(xed_operand_values_t* p);
00109 XED_DLL_EXPORT void xed_operand_values_set_rep(xed_operand_values_t* p);
00112 XED_DLL_EXPORT void xed_operand_values_clear_rep(xed_operand_values_t* p);
00113
00115
00120 XED_DLL_EXPORT xed_bool_t
00121 xed_operand_values_get_atomic(const xed_operand_values_t* p);
00122
00125 XED_DLL_EXPORT xed_bool_t
00126 xed_operand_values_has_lock_prefix(const xed_operand_values_t* p);
00127
00133 XED_DLL_EXPORT xed_bool_t
00134 xed_operand_values_using_default_segment(const xed_operand_values_t* p, unsigned int i);
00135
00136
00137
00144 XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_operand_width(const xed_operand_values_t* p);
00147 XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_address_width(const xed_operand_values_t* p);
00148
00149
00152 XED_DLL_EXPORT xed_bool_t
00153 xed_operand_values_has_memory_displacement(const xed_operand_values_t* p);
00156 XED_DLL_EXPORT xed_bool_t
00157 xed_operand_values_has_branch_displacement(const xed_operand_values_t* p);
00160 XED_DLL_EXPORT xed_bool_t
00161 xed_operand_values_has_displacement(const xed_operand_values_t* p);
00162
00163
00166 XED_DLL_EXPORT xed_bool_t
00167 xed_operand_values_get_displacement_for_memop(const xed_operand_values_t* p);
00168
00171 XED_DLL_EXPORT xed_bool_t
00172 xed_operand_values_has_immediate(const xed_operand_values_t* p);
00173
00174
00179 XED_DLL_EXPORT xed_bool_t
00180 xed_operand_values_has_disp(const xed_operand_values_t* p);
00181
00184 XED_DLL_EXPORT xed_bool_t
00185 xed_operand_values_has_address_size_prefix(const xed_operand_values_t* p);
00186
00190 XED_DLL_EXPORT xed_bool_t
00191 xed_operand_values_has_operand_size_prefix(const xed_operand_values_t* p);
00192
00195 XED_DLL_EXPORT xed_bool_t
00196 xed_operand_values_has_66_prefix(const xed_operand_values_t* p);
00197
00198 #if 0
00199 XED_DLL_EXPORT xed_bool_t
00200 xed_operand_values_has_refining_66_prefix(const xed_operand_values_t* p);
00201 XED_DLL_EXPORT xed_bool_t
00202 xed_operand_values_has_refining_f2_prefix(const xed_operand_values_t* p);
00203 XED_DLL_EXPORT xed_bool_t
00204 xed_operand_values_has_refining_f3_prefix(const xed_operand_values_t* p);
00205 #endif
00206
00208 XED_DLL_EXPORT xed_bool_t
00209 xed_operand_values_has_segment_prefix(const xed_operand_values_t* p);
00210
00213 XED_DLL_EXPORT xed_reg_enum_t
00214 xed_operand_values_segment_prefix(const xed_operand_values_t* p);
00215
00217 XED_DLL_EXPORT xed_bool_t
00218 xed_operand_values_is_prefetch(const xed_operand_values_t* p);
00219
00221 XED_DLL_EXPORT xed_bool_t xed_operand_values_get_long_mode(const xed_operand_values_t* p);
00223 XED_DLL_EXPORT xed_bool_t xed_operand_values_get_real_mode(const xed_operand_values_t* p);
00224
00226
00227
00228 XED_DLL_EXPORT xed_bool_t
00229 xed_operand_values_accesses_memory(const xed_operand_values_t* p);
00230
00232 XED_DLL_EXPORT unsigned int
00233 xed_operand_values_number_of_memory_operands(const xed_operand_values_t* p);
00234
00236 XED_DLL_EXPORT unsigned int
00237 xed_operand_values_get_memory_operand_length(const xed_operand_values_t* p,
00238 unsigned int memop_idx);
00239
00241 XED_DLL_EXPORT xed_reg_enum_t
00242 xed_operand_values_get_base_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00243
00245 XED_DLL_EXPORT xed_reg_enum_t
00246 xed_operand_values_get_index_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00247
00249 XED_DLL_EXPORT xed_reg_enum_t
00250 xed_operand_values_get_seg_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00251
00253 XED_DLL_EXPORT unsigned int
00254 xed_operand_values_get_scale(const xed_operand_values_t* p);
00255
00259 XED_DLL_EXPORT xed_bool_t
00260 xed_operand_values_memop_without_modrm(const xed_operand_values_t* p);
00263 XED_DLL_EXPORT xed_bool_t
00264 xed_operand_values_has_modrm_byte(const xed_operand_values_t* p);
00265
00268 XED_DLL_EXPORT xed_bool_t
00269 xed_operand_values_has_sib_byte(const xed_operand_values_t* p);
00271
00273 XED_DLL_EXPORT xed_bool_t
00274 xed_operand_values_branch_not_taken_hint(const xed_operand_values_t* p);
00276 XED_DLL_EXPORT xed_bool_t
00277 xed_operand_values_branch_taken_hint(const xed_operand_values_t* p);
00278
00280 XED_DLL_EXPORT xed_bool_t
00281 xed_operand_values_is_nop(const xed_operand_values_t* p);
00282
00283
00285
00286
00287 XED_DLL_EXPORT xed_int64_t
00288 xed_operand_values_get_immediate_int64(const xed_operand_values_t* p);
00289
00291 XED_DLL_EXPORT xed_uint64_t
00292 xed_operand_values_get_immediate_uint64(const xed_operand_values_t* p);
00293
00296 XED_DLL_EXPORT xed_uint_t xed_operand_values_get_immediate_is_signed(const xed_operand_values_t* p);
00297
00298
00301 XED_DLL_EXPORT xed_uint8_t
00302 xed_operand_values_get_immediate_byte(const xed_operand_values_t* p,unsigned int i);
00303
00305 XED_DLL_EXPORT xed_uint8_t
00306 xed_operand_values_get_second_immediate(const xed_operand_values_t* p);
00308
00310
00311
00312
00313 XED_DLL_EXPORT xed_uint32_t
00314 xed_operand_values_get_memory_displacement_length(const xed_operand_values_t* p);
00317 XED_DLL_EXPORT xed_uint32_t
00318 xed_operand_values_get_memory_displacement_length_bits(const xed_operand_values_t* p);
00319
00321 XED_DLL_EXPORT xed_int64_t
00322 xed_operand_values_get_memory_displacement_int64(const xed_operand_values_t* p);
00323
00325 XED_DLL_EXPORT xed_uint8_t
00326 xed_operand_values_get_memory_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00328
00330
00331
00332
00333 XED_DLL_EXPORT xed_uint32_t
00334 xed_operand_values_get_branch_displacement_length(const xed_operand_values_t* p);
00337 XED_DLL_EXPORT xed_uint32_t
00338 xed_operand_values_get_branch_displacement_length_bits(const xed_operand_values_t* p);
00339
00341 XED_DLL_EXPORT xed_int32_t
00342 xed_operand_values_get_branch_displacement_int32(const xed_operand_values_t* p);
00343
00345 XED_DLL_EXPORT xed_uint8_t
00346 xed_operand_values_get_branch_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00348
00349
00351 XED_DLL_EXPORT xed_iclass_enum_t
00352 xed_operand_values_get_iclass(const xed_operand_values_t* p);
00353
00355
00358
00359
00360 XED_DLL_EXPORT void xed_operand_values_zero_immediate(xed_operand_values_t* p);
00362 XED_DLL_EXPORT void xed_operand_values_zero_branch_displacement(xed_operand_values_t* p);
00364 XED_DLL_EXPORT void xed_operand_values_zero_memory_displacement(xed_operand_values_t* p);
00365
00367 XED_DLL_EXPORT void xed_operand_values_set_lock(xed_operand_values_t* p);
00369 XED_DLL_EXPORT void xed_operand_values_zero_segment_override(xed_operand_values_t* p);
00370
00371
00373 XED_DLL_EXPORT void
00374 xed_operand_values_set_iclass(xed_operand_values_t* p,xed_iclass_enum_t iclass);
00375
00377 XED_DLL_EXPORT void
00378 xed_operand_values_set_effective_operand_width(xed_operand_values_t* p,unsigned int width);
00379
00381 XED_DLL_EXPORT void
00382 xed_operand_values_set_memory_operand_length(xed_operand_values_t* p,unsigned int memop_length);
00383
00384
00387 XED_DLL_EXPORT void
00388 xed_operand_values_set_memory_displacement(xed_operand_values_t* p,xed_int64_t x, unsigned int len);
00391 XED_DLL_EXPORT void
00392 xed_operand_values_set_memory_displacement_bits(xed_operand_values_t* p,xed_int64_t x, unsigned int len_bits);
00393
00396 XED_DLL_EXPORT void xed_operand_values_set_relbr(xed_operand_values_t* p);
00397
00400 XED_DLL_EXPORT void
00401 xed_operand_values_set_branch_displacement(xed_operand_values_t* p,xed_int32_t x, unsigned int len);
00404 XED_DLL_EXPORT void
00405 xed_operand_values_set_branch_displacement_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int len_bits);
00406
00409 XED_DLL_EXPORT void
00410 xed_operand_values_set_immediate_signed(xed_operand_values_t* p,xed_int32_t x, unsigned int bytes);
00413 XED_DLL_EXPORT void
00414 xed_operand_values_set_immediate_signed_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int bits);
00415
00416
00419 XED_DLL_EXPORT void
00420 xed_operand_values_set_immediate_unsigned(xed_operand_values_t* p,xed_uint64_t x, unsigned int bytes);
00423 XED_DLL_EXPORT void
00424 xed_operand_values_set_immediate_unsigned_bits(xed_operand_values_t* p,xed_uint64_t x, unsigned int bits);
00425
00426
00427
00429 XED_DLL_EXPORT void xed_operand_values_set_base_reg(xed_operand_values_t* p,
00430 unsigned int memop_idx,
00431 xed_reg_enum_t new_base);
00432
00434 XED_DLL_EXPORT void xed_operand_values_set_seg_reg(xed_operand_values_t* p,
00435 unsigned int memop_idx,
00436 xed_reg_enum_t new_seg);
00437
00439 XED_DLL_EXPORT void xed_operand_values_set_index_reg(xed_operand_values_t* p,
00440 unsigned int memop_idx,
00441 xed_reg_enum_t new_index);
00442
00444 XED_DLL_EXPORT void xed_operand_values_set_scale(xed_operand_values_t* p,
00445 xed_uint_t memop_idx,
00446 xed_uint_t new_scale);
00447
00448
00452 XED_DLL_EXPORT void
00453 xed_operand_values_set_operand_reg(xed_operand_values_t* p,
00454 xed_operand_enum_t operand_name,
00455 xed_reg_enum_t reg_name);
00456
00458 #endif
00459
00460
00461
00462