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-decoded-inst.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
00061 xed_operand_values_set_mode(xed_operand_values_t* p,
00062 const xed_state_t* dstate);
00063
00067 XED_DLL_EXPORT void
00068 xed_operand_values_init_keep_mode( xed_operand_values_t* dst,
00069 const xed_operand_values_t* src );
00071
00074
00075
00076
00077 XED_DLL_EXPORT void
00078 xed_operand_values_dump(const xed_operand_values_t* ov,
00079 char* buf,
00080 int buflen);
00083 XED_DLL_EXPORT void
00084 xed_operand_values_print_short(const xed_operand_values_t* ov,
00085 char* buf,
00086 int buflen);
00088
00090
00091
00092
00093
00094
00095 XED_DLL_EXPORT xed_bool_t
00096 xed_operand_values_has_real_rep(const xed_operand_values_t* p);
00100 XED_DLL_EXPORT xed_bool_t
00101 xed_operand_values_has_rep_prefix(const xed_operand_values_t* p);
00105 XED_DLL_EXPORT xed_bool_t
00106 xed_operand_values_has_repne_prefix(const xed_operand_values_t* p);
00107
00110 XED_DLL_EXPORT void xed_operand_values_set_repne(xed_operand_values_t* p);
00113 XED_DLL_EXPORT void xed_operand_values_set_rep(xed_operand_values_t* p);
00116 XED_DLL_EXPORT void xed_operand_values_clear_rep(xed_operand_values_t* p);
00117
00119
00124 XED_DLL_EXPORT xed_bool_t
00125 xed_operand_values_get_atomic(const xed_operand_values_t* p);
00126
00129 XED_DLL_EXPORT xed_bool_t
00130 xed_operand_values_has_lock_prefix(const xed_operand_values_t* p);
00131
00138 XED_DLL_EXPORT xed_bool_t
00139 xed_operand_values_using_default_segment(const xed_operand_values_t* p,
00140 unsigned int i);
00141
00142
00143
00150 XED_DLL_EXPORT xed_uint32_t
00151 xed_operand_values_get_effective_operand_width(const xed_operand_values_t* p);
00154 XED_DLL_EXPORT xed_uint32_t
00155 xed_operand_values_get_effective_address_width(const xed_operand_values_t* p);
00158 XED_DLL_EXPORT xed_uint32_t
00159 xed_operand_values_get_stack_address_width(const xed_operand_values_t* p);
00160
00161
00164 XED_DLL_EXPORT xed_bool_t
00165 xed_operand_values_has_memory_displacement(const xed_operand_values_t* p);
00168 XED_DLL_EXPORT xed_bool_t
00169 xed_operand_values_has_branch_displacement(const xed_operand_values_t* p);
00172 XED_DLL_EXPORT xed_bool_t
00173 xed_operand_values_has_displacement(const xed_operand_values_t* p);
00174
00175
00178 XED_DLL_EXPORT xed_bool_t
00179 xed_operand_values_get_displacement_for_memop(const xed_operand_values_t* p);
00180
00183 XED_DLL_EXPORT xed_bool_t
00184 xed_operand_values_has_immediate(const xed_operand_values_t* p);
00185
00186
00191 XED_DLL_EXPORT xed_bool_t
00192 xed_operand_values_has_disp(const xed_operand_values_t* p);
00193
00196 XED_DLL_EXPORT xed_bool_t
00197 xed_operand_values_has_address_size_prefix(const xed_operand_values_t* p);
00198
00202 XED_DLL_EXPORT xed_bool_t
00203 xed_operand_values_has_operand_size_prefix(const xed_operand_values_t* p);
00204
00207 XED_DLL_EXPORT xed_bool_t
00208 xed_operand_values_has_66_prefix(const xed_operand_values_t* p);
00209
00212 XED_DLL_EXPORT xed_bool_t
00213 xed_operand_values_has_rexw_prefix(const xed_operand_values_t* p);
00214
00216 XED_DLL_EXPORT xed_bool_t
00217 xed_operand_values_has_segment_prefix(const xed_operand_values_t* p);
00218
00221 XED_DLL_EXPORT xed_reg_enum_t
00222 xed_operand_values_segment_prefix(const xed_operand_values_t* p);
00223
00225 XED_DLL_EXPORT xed_bool_t
00226 xed_operand_values_is_prefetch(const xed_operand_values_t* p);
00227
00229 XED_DLL_EXPORT xed_bool_t
00230 xed_operand_values_get_long_mode(const xed_operand_values_t* p);
00232 XED_DLL_EXPORT xed_bool_t
00233 xed_operand_values_get_real_mode(const xed_operand_values_t* p);
00234
00236
00237
00238 XED_DLL_EXPORT xed_bool_t
00239 xed_operand_values_accesses_memory(const xed_operand_values_t* p);
00240
00242 XED_DLL_EXPORT unsigned int
00243 xed_operand_values_number_of_memory_operands(const xed_operand_values_t* p);
00244
00247 XED_DLL_EXPORT unsigned int
00248 xed_operand_values_get_memory_operand_length(const xed_operand_values_t* p,
00249 unsigned int memop_idx);
00250
00252 XED_DLL_EXPORT xed_reg_enum_t
00253 xed_operand_values_get_base_reg(const xed_operand_values_t* p,
00254 unsigned int memop_idx);
00255
00257 XED_DLL_EXPORT xed_reg_enum_t
00258 xed_operand_values_get_index_reg(const xed_operand_values_t* p,
00259 unsigned int memop_idx);
00260
00262 XED_DLL_EXPORT xed_reg_enum_t
00263 xed_operand_values_get_seg_reg(const xed_operand_values_t* p,
00264 unsigned int memop_idx);
00265
00267 XED_DLL_EXPORT unsigned int
00268 xed_operand_values_get_scale(const xed_operand_values_t* p);
00269
00273 XED_DLL_EXPORT xed_bool_t
00274 xed_operand_values_memop_without_modrm(const xed_operand_values_t* p);
00277 XED_DLL_EXPORT xed_bool_t
00278 xed_operand_values_has_modrm_byte(const xed_operand_values_t* p);
00279
00282 XED_DLL_EXPORT xed_bool_t
00283 xed_operand_values_has_sib_byte(const xed_operand_values_t* p);
00285
00287 XED_DLL_EXPORT xed_bool_t
00288 xed_operand_values_branch_not_taken_hint(const xed_operand_values_t* p);
00290 XED_DLL_EXPORT xed_bool_t
00291 xed_operand_values_branch_taken_hint(const xed_operand_values_t* p);
00292
00294 XED_DLL_EXPORT xed_bool_t
00295 xed_operand_values_is_nop(const xed_operand_values_t* p);
00296
00297
00299
00300
00301 XED_DLL_EXPORT xed_int64_t
00302 xed_operand_values_get_immediate_int64(const xed_operand_values_t* p);
00303
00304
00306 XED_DLL_EXPORT xed_uint64_t
00307 xed_operand_values_get_immediate_uint64(const xed_operand_values_t* p);
00308
00311 XED_DLL_EXPORT xed_uint_t
00312 xed_operand_values_get_immediate_is_signed(const xed_operand_values_t* p);
00313
00314
00317 XED_DLL_EXPORT xed_uint8_t
00318 xed_operand_values_get_immediate_byte(const xed_operand_values_t* p,
00319 unsigned int i);
00320
00322 XED_DLL_EXPORT xed_uint8_t
00323 xed_operand_values_get_second_immediate(const xed_operand_values_t* p);
00325
00327
00328
00329
00330 XED_DLL_EXPORT xed_uint32_t
00331 xed_operand_values_get_memory_displacement_length(const xed_operand_values_t* p);
00334 XED_DLL_EXPORT xed_uint32_t
00335 xed_operand_values_get_memory_displacement_length_bits(
00336 const xed_operand_values_t* p);
00337
00340 XED_DLL_EXPORT xed_uint32_t
00341 xed_operand_values_get_memory_displacement_length_bits_raw(
00342 const xed_operand_values_t* p);
00343
00347 XED_DLL_EXPORT xed_int64_t
00348 xed_operand_values_get_memory_displacement_int64(const xed_operand_values_t* p);
00349
00352 XED_DLL_EXPORT xed_int64_t
00353 xed_operand_values_get_memory_displacement_int64_raw(const xed_operand_values_t* p);
00354
00356 XED_DLL_EXPORT xed_uint8_t
00357 xed_operand_values_get_memory_displacement_byte(const xed_operand_values_t* p,
00358 unsigned int i);
00360
00362
00363
00364
00365 XED_DLL_EXPORT xed_uint32_t
00366 xed_operand_values_get_branch_displacement_length(const xed_operand_values_t* p);
00369 XED_DLL_EXPORT xed_uint32_t
00370 xed_operand_values_get_branch_displacement_length_bits(
00371 const xed_operand_values_t* p);
00372
00374 XED_DLL_EXPORT xed_int32_t
00375 xed_operand_values_get_branch_displacement_int32(const xed_operand_values_t* p);
00376
00378 XED_DLL_EXPORT xed_uint8_t
00379 xed_operand_values_get_branch_displacement_byte(const xed_operand_values_t* p,
00380 unsigned int i);
00382
00383
00385 XED_DLL_EXPORT xed_iclass_enum_t
00386 xed_operand_values_get_iclass(const xed_operand_values_t* p);
00387
00389
00392
00393
00394 XED_DLL_EXPORT void
00395 xed_operand_values_zero_immediate(xed_operand_values_t* p);
00397 XED_DLL_EXPORT void
00398 xed_operand_values_zero_branch_displacement(xed_operand_values_t* p);
00400 XED_DLL_EXPORT void
00401 xed_operand_values_zero_memory_displacement(xed_operand_values_t* p);
00402
00404 XED_DLL_EXPORT void xed_operand_values_set_lock(xed_operand_values_t* p);
00406 XED_DLL_EXPORT void
00407 xed_operand_values_zero_segment_override(xed_operand_values_t* p);
00408
00409
00411 XED_DLL_EXPORT void
00412 xed_operand_values_set_iclass(xed_operand_values_t* p,
00413 xed_iclass_enum_t iclass);
00414
00417 XED_DLL_EXPORT void
00418 xed_operand_values_set_effective_operand_width(xed_operand_values_t* p,
00419 unsigned int width);
00420
00423 XED_DLL_EXPORT void
00424 xed_operand_values_set_effective_address_width(xed_operand_values_t* p,
00425 unsigned int width);
00428 XED_DLL_EXPORT void
00429 xed_operand_values_set_memory_operand_length(xed_operand_values_t* p,
00430 unsigned int memop_length);
00431
00432
00435 XED_DLL_EXPORT void
00436 xed_operand_values_set_memory_displacement(xed_operand_values_t* p,
00437 xed_int64_t x, unsigned int len);
00440 XED_DLL_EXPORT void
00441 xed_operand_values_set_memory_displacement_bits(xed_operand_values_t* p,
00442 xed_int64_t x,
00443 unsigned int len_bits);
00444
00447 XED_DLL_EXPORT void xed_operand_values_set_relbr(xed_operand_values_t* p);
00448
00451 XED_DLL_EXPORT void
00452 xed_operand_values_set_branch_displacement(xed_operand_values_t* p,
00453 xed_int32_t x,
00454 unsigned int len);
00457 XED_DLL_EXPORT void
00458 xed_operand_values_set_branch_displacement_bits(xed_operand_values_t* p,
00459 xed_int32_t x,
00460 unsigned int len_bits);
00461
00464 XED_DLL_EXPORT void
00465 xed_operand_values_set_immediate_signed(xed_operand_values_t* p,
00466 xed_int32_t x,
00467 unsigned int bytes);
00470 XED_DLL_EXPORT void
00471 xed_operand_values_set_immediate_signed_bits(xed_operand_values_t* p,
00472 xed_int32_t x,
00473 unsigned int bits);
00474
00475
00478 XED_DLL_EXPORT void
00479 xed_operand_values_set_immediate_unsigned(xed_operand_values_t* p,
00480 xed_uint64_t x,
00481 unsigned int bytes);
00484 XED_DLL_EXPORT void
00485 xed_operand_values_set_immediate_unsigned_bits(xed_operand_values_t* p,
00486 xed_uint64_t x,
00487 unsigned int bits);
00488
00489
00490
00492 XED_DLL_EXPORT void xed_operand_values_set_base_reg(xed_operand_values_t* p,
00493 unsigned int memop_idx,
00494 xed_reg_enum_t new_base);
00495
00497 XED_DLL_EXPORT void xed_operand_values_set_seg_reg(xed_operand_values_t* p,
00498 unsigned int memop_idx,
00499 xed_reg_enum_t new_seg);
00500
00502 XED_DLL_EXPORT void xed_operand_values_set_index_reg(xed_operand_values_t* p,
00503 unsigned int memop_idx,
00504 xed_reg_enum_t new_index);
00505
00507 XED_DLL_EXPORT void xed_operand_values_set_scale(xed_operand_values_t* p,
00508 xed_uint_t memop_idx,
00509 xed_uint_t new_scale);
00510
00511
00515 XED_DLL_EXPORT void
00516 xed_operand_values_set_operand_reg(xed_operand_values_t* p,
00517 xed_operand_enum_t operand_name,
00518 xed_reg_enum_t reg_name);
00519
00521 #endif
00522