- Main Page
- Modules
- Data Structures
- Files

- Search for |

- File List
- Globals

# xed-operand-values-interface.h

Go to the documentation of this file.

    00001 /*BEGIN_LEGAL
    00002 Intel Open Source License
    00003
    00004 Copyright (c) 2002-2014 Intel Corporation. All rights reserved.
    00005
    00006 Redistribution and use in source and binary forms, with or without
    00007 modification, are permitted provided that the following conditions are
    00008 met:
    00009
    00010 Redistributions of source code must retain the above copyright notice,
    00011 this list of conditions and the following disclaimer.  Redistributions
    00012 in binary form must reproduce the above copyright notice, this list of
    00013 conditions and the following disclaimer in the documentation and/or
    00014 other materials provided with the distribution.  Neither the name of
    00015 the Intel Corporation nor the names of its contributors may be used to
    00016 endorse or promote products derived from this software without
    00017 specific prior written permission.
    00018
    00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    00020 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    00021 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    00022 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
    00023 ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    00024 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    00025 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    00026 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    00027 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00028 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    00029 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00030 END_LEGAL */
    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" // a generated file
    00043 #include "xed-operand-enum.h" // a generated file
    00044 #include "xed-decoded-inst.h"
    00045 #include "xed-reg-enum.h"  // generated
    00046 #include "xed-iclass-enum.h"  // generated
    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
    00246 XED_DLL_EXPORT unsigned int
    00247 xed_operand_values_get_memory_operand_length(const xed_operand_values_t* p,
    00248                                              unsigned int memop_idx);
    00249
    00251 XED_DLL_EXPORT xed_reg_enum_t
    00252 xed_operand_values_get_base_reg(const xed_operand_values_t* p,
    00253                                 unsigned int memop_idx);
    00254
    00256 XED_DLL_EXPORT xed_reg_enum_t
    00257 xed_operand_values_get_index_reg(const xed_operand_values_t* p,
    00258                                  unsigned int memop_idx);
    00259
    00261 XED_DLL_EXPORT xed_reg_enum_t
    00262 xed_operand_values_get_seg_reg(const xed_operand_values_t* p,
    00263                                unsigned int memop_idx);
    00264
    00266 XED_DLL_EXPORT unsigned int
    00267 xed_operand_values_get_scale(const xed_operand_values_t* p);
    00268
    00272 XED_DLL_EXPORT xed_bool_t
    00273 xed_operand_values_memop_without_modrm(const xed_operand_values_t* p);
    00276 XED_DLL_EXPORT xed_bool_t
    00277 xed_operand_values_has_modrm_byte(const xed_operand_values_t* p);
    00278
    00281 XED_DLL_EXPORT xed_bool_t
    00282 xed_operand_values_has_sib_byte(const xed_operand_values_t* p);
    00284
    00286 XED_DLL_EXPORT xed_bool_t
    00287 xed_operand_values_branch_not_taken_hint(const xed_operand_values_t* p);
    00289 XED_DLL_EXPORT xed_bool_t
    00290 xed_operand_values_branch_taken_hint(const xed_operand_values_t* p);
    00291
    00293 XED_DLL_EXPORT xed_bool_t
    00294 xed_operand_values_is_nop(const xed_operand_values_t* p);
    00295
    00296
    00298
    00299
    00300 XED_DLL_EXPORT xed_int64_t
    00301 xed_operand_values_get_immediate_int64(const xed_operand_values_t* p);
    00302
    00303
    00305 XED_DLL_EXPORT xed_uint64_t
    00306 xed_operand_values_get_immediate_uint64(const xed_operand_values_t* p);
    00307
    00310 XED_DLL_EXPORT xed_uint_t
    00311 xed_operand_values_get_immediate_is_signed(const xed_operand_values_t* p);
    00312
    00313
    00316 XED_DLL_EXPORT xed_uint8_t
    00317 xed_operand_values_get_immediate_byte(const xed_operand_values_t* p,
    00318                                       unsigned int i);
    00319
    00321 XED_DLL_EXPORT xed_uint8_t
    00322 xed_operand_values_get_second_immediate(const xed_operand_values_t* p);
    00324
    00326
    00327
    00328
    00329 XED_DLL_EXPORT xed_uint32_t
    00330 xed_operand_values_get_memory_displacement_length(const xed_operand_values_t* p);
    00333 XED_DLL_EXPORT xed_uint32_t
    00334 xed_operand_values_get_memory_displacement_length_bits(const xed_operand_values_t* p);
    00335
    00338 XED_DLL_EXPORT xed_uint32_t
    00339 xed_operand_values_get_memory_displacement_length_bits_raw(const xed_operand_values_t* p);
    00340
    00342 XED_DLL_EXPORT xed_int64_t
    00343 xed_operand_values_get_memory_displacement_int64(const xed_operand_values_t* p);
    00344
    00346 XED_DLL_EXPORT xed_int64_t
    00347 xed3_operand_get_memory_displacement_int64(const xed_operand_values_t* p);
    00348
    00350 XED_DLL_EXPORT xed_int64_t
    00351 xed3_operand_get_memory_displacement_int64_raw(const xed_operand_values_t* p);
    00352
    00354 XED_DLL_EXPORT xed_int32_t
    00355 xed3_operand_get_branch_displacement_int32(const xed_operand_values_t* p);
    00356
    00357
    00359 XED_DLL_EXPORT xed_uint8_t
    00360 xed_operand_values_get_memory_displacement_byte(const xed_operand_values_t* p,
    00361                                                 unsigned int i);
    00363
    00365
    00366
    00367
    00368 XED_DLL_EXPORT xed_uint32_t
    00369 xed_operand_values_get_branch_displacement_length(const xed_operand_values_t* p);
    00372 XED_DLL_EXPORT xed_uint32_t
    00373 xed_operand_values_get_branch_displacement_length_bits(const xed_operand_values_t* p);
    00374
    00376 XED_DLL_EXPORT xed_int32_t
    00377 xed_operand_values_get_branch_displacement_int32(const xed_operand_values_t* p);
    00378
    00380 XED_DLL_EXPORT xed_uint8_t
    00381 xed_operand_values_get_branch_displacement_byte(const xed_operand_values_t* p,
    00382                                                 unsigned int i);
    00384
    00385
    00387 XED_DLL_EXPORT xed_iclass_enum_t
    00388 xed_operand_values_get_iclass(const xed_operand_values_t* p);
    00389
    00391 // ENCODE API
    00394
    00395
    00396 XED_DLL_EXPORT void
    00397 xed_operand_values_zero_immediate(xed_operand_values_t* p);
    00399 XED_DLL_EXPORT void
    00400 xed_operand_values_zero_branch_displacement(xed_operand_values_t* p);
    00402 XED_DLL_EXPORT void
    00403 xed_operand_values_zero_memory_displacement(xed_operand_values_t* p);
    00404
    00406 XED_DLL_EXPORT void xed_operand_values_set_lock(xed_operand_values_t* p);
    00408 XED_DLL_EXPORT void
    00409 xed_operand_values_zero_segment_override(xed_operand_values_t* p);
    00410
    00411
    00413 XED_DLL_EXPORT void
    00414 xed_operand_values_set_iclass(xed_operand_values_t* p,
    00415                               xed_iclass_enum_t iclass);
    00416
    00419 XED_DLL_EXPORT void
    00420 xed_operand_values_set_effective_operand_width(xed_operand_values_t* p,
    00421                                                unsigned int width);
    00422
    00425 XED_DLL_EXPORT void
    00426 xed_operand_values_set_effective_address_width(xed_operand_values_t* p,
    00427                                                unsigned int width);
    00428
    00430 XED_DLL_EXPORT void
    00431 xed_operand_values_set_memory_operand_length(xed_operand_values_t* p,
    00432                                              unsigned int memop_length);
    00433
    00434
    00437 XED_DLL_EXPORT void
    00438 xed_operand_values_set_memory_displacement(xed_operand_values_t* p,
    00439                                            xed_int64_t x, unsigned int len);
    00442 XED_DLL_EXPORT void
    00443 xed_operand_values_set_memory_displacement_bits(xed_operand_values_t* p,
    00444                                                 xed_int64_t x,
    00445                                                 unsigned int len_bits);
    00446
    00449 XED_DLL_EXPORT void xed_operand_values_set_relbr(xed_operand_values_t* p);
    00450
    00453 XED_DLL_EXPORT void
    00454 xed_operand_values_set_branch_displacement(xed_operand_values_t* p,
    00455                                            xed_int32_t x,
    00456                                            unsigned int len);
    00459 XED_DLL_EXPORT void
    00460 xed_operand_values_set_branch_displacement_bits(xed_operand_values_t* p,
    00461                                                 xed_int32_t x,
    00462                                                 unsigned int len_bits);
    00463
    00466 XED_DLL_EXPORT void
    00467 xed_operand_values_set_immediate_signed(xed_operand_values_t* p,
    00468                                         xed_int32_t x,
    00469                                         unsigned int bytes);
    00472 XED_DLL_EXPORT void
    00473 xed_operand_values_set_immediate_signed_bits(xed_operand_values_t* p,
    00474                                              xed_int32_t x,
    00475                                              unsigned int bits);
    00476
    00477
    00480 XED_DLL_EXPORT void
    00481 xed_operand_values_set_immediate_unsigned(xed_operand_values_t* p,
    00482                                           xed_uint64_t x,
    00483                                           unsigned int bytes);
    00486 XED_DLL_EXPORT void
    00487 xed_operand_values_set_immediate_unsigned_bits(xed_operand_values_t* p,
    00488                                                xed_uint64_t x,
    00489                                                unsigned int bits);
    00490
    00491
    00492
    00494 XED_DLL_EXPORT void xed_operand_values_set_base_reg(xed_operand_values_t* p,
    00495                                                     unsigned int memop_idx,
    00496                                                     xed_reg_enum_t new_base);
    00497
    00499 XED_DLL_EXPORT void xed_operand_values_set_seg_reg(xed_operand_values_t* p,
    00500                                                    unsigned int memop_idx,
    00501                                                    xed_reg_enum_t new_seg);
    00502
    00504 XED_DLL_EXPORT void xed_operand_values_set_index_reg(xed_operand_values_t* p,
    00505                                                      unsigned int memop_idx,
    00506                                                      xed_reg_enum_t new_index);
    00507
    00509 XED_DLL_EXPORT void xed_operand_values_set_scale(xed_operand_values_t* p,
    00510                                                  xed_uint_t memop_idx,
    00511                                                  xed_uint_t new_scale);
    00512
    00513
    00517 XED_DLL_EXPORT void
    00518 xed_operand_values_set_operand_reg(xed_operand_values_t* p,
    00519                                    xed_operand_enum_t operand_name,
    00520                                    xed_reg_enum_t reg_name);
    00521
    00523 #endif
    00524