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
00129 XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_operand_width(const xed_operand_values_t* p);
00132 XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_address_width(const xed_operand_values_t* p);
00133
00134
00137 XED_DLL_EXPORT xed_bool_t
00138 xed_operand_values_has_memory_displacement(const xed_operand_values_t* p);
00141 XED_DLL_EXPORT xed_bool_t
00142 xed_operand_values_has_branch_displacement(const xed_operand_values_t* p);
00145 XED_DLL_EXPORT xed_bool_t
00146 xed_operand_values_has_displacement(const xed_operand_values_t* p);
00147
00148
00151 XED_DLL_EXPORT xed_bool_t
00152 xed_operand_values_get_displacement_for_memop(const xed_operand_values_t* p);
00153
00156 XED_DLL_EXPORT xed_bool_t
00157 xed_operand_values_has_immediate(const xed_operand_values_t* p);
00158
00159
00164 XED_DLL_EXPORT xed_bool_t
00165 xed_operand_values_has_disp(const xed_operand_values_t* p);
00166
00168 XED_DLL_EXPORT xed_bool_t
00169 xed_operand_values_has_address_size_prefix(const xed_operand_values_t* p);
00171 XED_DLL_EXPORT xed_bool_t
00172 xed_operand_values_has_operand_size_prefix(const xed_operand_values_t* p);
00173
00174 #if 0
00175 XED_DLL_EXPORT xed_bool_t
00176 xed_operand_values_has_refining_66_prefix(const xed_operand_values_t* p);
00177 XED_DLL_EXPORT xed_bool_t
00178 xed_operand_values_has_refining_f2_prefix(const xed_operand_values_t* p);
00179 XED_DLL_EXPORT xed_bool_t
00180 xed_operand_values_has_refining_f3_prefix(const xed_operand_values_t* p);
00181 #endif
00182
00184 XED_DLL_EXPORT xed_bool_t
00185 xed_operand_values_has_segment_prefix(const xed_operand_values_t* p);
00186
00189 XED_DLL_EXPORT xed_reg_enum_t
00190 xed_operand_values_segment_prefix(const xed_operand_values_t* p);
00191
00193 XED_DLL_EXPORT xed_bool_t
00194 xed_operand_values_is_prefetch(const xed_operand_values_t* p);
00195
00197 XED_DLL_EXPORT xed_bool_t xed_operand_values_get_long_mode(const xed_operand_values_t* p);
00199 XED_DLL_EXPORT xed_bool_t xed_operand_values_get_real_mode(const xed_operand_values_t* p);
00200
00202
00203
00204 XED_DLL_EXPORT xed_bool_t
00205 xed_operand_values_accesses_memory(const xed_operand_values_t* p);
00206
00208 XED_DLL_EXPORT unsigned int
00209 xed_operand_values_number_of_memory_operands(const xed_operand_values_t* p);
00210
00212 XED_DLL_EXPORT unsigned int
00213 xed_operand_values_get_memory_operand_length(const xed_operand_values_t* p,
00214 unsigned int memop_idx);
00215
00217 XED_DLL_EXPORT xed_reg_enum_t
00218 xed_operand_values_get_base_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_index_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00223
00225 XED_DLL_EXPORT xed_reg_enum_t
00226 xed_operand_values_get_seg_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00227
00229 XED_DLL_EXPORT unsigned int
00230 xed_operand_values_get_scale(const xed_operand_values_t* p);
00231
00235 XED_DLL_EXPORT xed_bool_t
00236 xed_operand_values_memop_without_modrm(const xed_operand_values_t* p);
00239 XED_DLL_EXPORT xed_bool_t
00240 xed_operand_values_has_modrm_byte(const xed_operand_values_t* p);
00241
00244 XED_DLL_EXPORT xed_bool_t
00245 xed_operand_values_has_sib_byte(const xed_operand_values_t* p);
00247
00249 XED_DLL_EXPORT xed_bool_t
00250 xed_operand_values_branch_not_taken_hint(const xed_operand_values_t* p);
00252 XED_DLL_EXPORT xed_bool_t
00253 xed_operand_values_branch_taken_hint(const xed_operand_values_t* p);
00254
00256 XED_DLL_EXPORT xed_bool_t
00257 xed_operand_values_is_nop(const xed_operand_values_t* p);
00258
00259
00261
00262
00263 XED_DLL_EXPORT xed_int64_t
00264 xed_operand_values_get_immediate_int64(const xed_operand_values_t* p);
00265
00267 XED_DLL_EXPORT xed_uint64_t
00268 xed_operand_values_get_immediate_uint64(const xed_operand_values_t* p);
00269
00272 XED_DLL_EXPORT xed_uint_t xed_operand_values_get_immediate_is_signed(const xed_operand_values_t* p);
00273
00274
00276 XED_DLL_EXPORT xed_uint8_t
00277 xed_operand_values_get_immediate_byte(const xed_operand_values_t* p,unsigned int i);
00278
00280 XED_DLL_EXPORT xed_uint8_t
00281 xed_operand_values_get_second_immediate(const xed_operand_values_t* p);
00283
00285
00286
00287
00288 XED_DLL_EXPORT xed_uint32_t
00289 xed_operand_values_get_memory_displacement_length(const xed_operand_values_t* p);
00292 XED_DLL_EXPORT xed_uint32_t
00293 xed_operand_values_get_memory_displacement_length_bits(const xed_operand_values_t* p);
00294
00296 XED_DLL_EXPORT xed_int64_t
00297 xed_operand_values_get_memory_displacement_int64(const xed_operand_values_t* p);
00298
00300 XED_DLL_EXPORT xed_uint8_t
00301 xed_operand_values_get_memory_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00303
00305
00306
00307
00308 XED_DLL_EXPORT xed_uint32_t
00309 xed_operand_values_get_branch_displacement_length(const xed_operand_values_t* p);
00312 XED_DLL_EXPORT xed_uint32_t
00313 xed_operand_values_get_branch_displacement_length_bits(const xed_operand_values_t* p);
00314
00316 XED_DLL_EXPORT xed_int32_t
00317 xed_operand_values_get_branch_displacement_int32(const xed_operand_values_t* p);
00318
00320 XED_DLL_EXPORT xed_uint8_t
00321 xed_operand_values_get_branch_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00323
00324
00326 XED_DLL_EXPORT xed_iclass_enum_t
00327 xed_operand_values_get_iclass(const xed_operand_values_t* p);
00328
00330
00333
00334
00335 XED_DLL_EXPORT void xed_operand_values_zero_immediate(xed_operand_values_t* p);
00337 XED_DLL_EXPORT void xed_operand_values_zero_branch_displacement(xed_operand_values_t* p);
00339 XED_DLL_EXPORT void xed_operand_values_zero_memory_displacement(xed_operand_values_t* p);
00340
00342 XED_DLL_EXPORT void xed_operand_values_set_lock(xed_operand_values_t* p);
00344 XED_DLL_EXPORT void xed_operand_values_zero_segment_override(xed_operand_values_t* p);
00345
00346
00348 XED_DLL_EXPORT void
00349 xed_operand_values_set_iclass(xed_operand_values_t* p,xed_iclass_enum_t iclass);
00350
00352 XED_DLL_EXPORT void
00353 xed_operand_values_set_effective_operand_width(xed_operand_values_t* p,unsigned int width);
00354
00356 XED_DLL_EXPORT void
00357 xed_operand_values_set_memory_operand_length(xed_operand_values_t* p,unsigned int memop_length);
00358
00359
00362 XED_DLL_EXPORT void
00363 xed_operand_values_set_memory_displacement(xed_operand_values_t* p,xed_int64_t x, unsigned int len);
00366 XED_DLL_EXPORT void
00367 xed_operand_values_set_memory_displacement_bits(xed_operand_values_t* p,xed_int64_t x, unsigned int len_bits);
00368
00371 XED_DLL_EXPORT void xed_operand_values_set_relbr(xed_operand_values_t* p);
00372
00375 XED_DLL_EXPORT void
00376 xed_operand_values_set_branch_displacement(xed_operand_values_t* p,xed_int32_t x, unsigned int len);
00379 XED_DLL_EXPORT void
00380 xed_operand_values_set_branch_displacement_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int len_bits);
00381
00384 XED_DLL_EXPORT void
00385 xed_operand_values_set_immediate_signed(xed_operand_values_t* p,xed_int32_t x, unsigned int bytes);
00388 XED_DLL_EXPORT void
00389 xed_operand_values_set_immediate_signed_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int bits);
00390
00391
00394 XED_DLL_EXPORT void
00395 xed_operand_values_set_immediate_unsigned(xed_operand_values_t* p,xed_uint64_t x, unsigned int bytes);
00398 XED_DLL_EXPORT void
00399 xed_operand_values_set_immediate_unsigned_bits(xed_operand_values_t* p,xed_uint64_t x, unsigned int bits);
00400
00401
00402
00404 XED_DLL_EXPORT void xed_operand_values_set_base_reg(xed_operand_values_t* p,
00405 unsigned int memop_idx,
00406 xed_reg_enum_t new_base);
00407
00409 XED_DLL_EXPORT void xed_operand_values_set_seg_reg(xed_operand_values_t* p,
00410 unsigned int memop_idx,
00411 xed_reg_enum_t new_seg);
00412
00414 XED_DLL_EXPORT void xed_operand_values_set_index_reg(xed_operand_values_t* p,
00415 unsigned int memop_idx,
00416 xed_reg_enum_t new_index);
00417
00419 XED_DLL_EXPORT void xed_operand_values_set_scale(xed_operand_values_t* p,
00420 xed_uint_t memop_idx,
00421 xed_uint_t new_scale);
00422
00423
00427 XED_DLL_EXPORT void
00428 xed_operand_values_set_operand_reg(xed_operand_values_t* p,
00429 xed_operand_enum_t operand_name,
00430 xed_reg_enum_t reg_name);
00431
00433 #endif
00434
00435
00436
00437