xed-operand-values-interface.h

Go to the documentation of this file.
00001 /*BEGIN_LEGAL 
00002 Copyright (c) 2004-2008, Intel Corp.
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are
00007 met:
00008 
00009     * Redistributions of source code must retain the above copyright
00010       notice, this list of conditions and the following disclaimer.
00011 
00012     * Redistributions in binary form must reproduce the above
00013       copyright notice, this list of conditions and the following
00014       disclaimer in the documentation and/or other materials provided
00015       with the distribution.
00016 
00017     * Neither the name of Intel Corporation nor the names of its
00018       contributors may be used to endorse or promote products derived
00019       from this software without specific prior written permission.
00020 
00021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00024 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00025 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00026 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00027 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00028 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00029 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00030 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00031 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032 END_LEGAL */
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" // a generated file
00045 #include "xed-operand-enum.h" // a generated file
00046 #include "xed-operand-storage.h" 
00047 #include "xed-reg-enum.h"  // generated
00048 #include "xed-iclass-enum.h"  // generated
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 // Returns the raw operand fields. Do not use this. 
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);
00197 XED_DLL_EXPORT xed_bool_t xed_operand_values_get_real_mode(const xed_operand_values_t* p);
00198 
00200 
00201 
00202 XED_DLL_EXPORT xed_bool_t
00203 xed_operand_values_accesses_memory(const xed_operand_values_t* p);
00204 
00206 XED_DLL_EXPORT unsigned int 
00207 xed_operand_values_number_of_memory_operands(const xed_operand_values_t* p);
00208 
00210 XED_DLL_EXPORT unsigned int
00211 xed_operand_values_get_memory_operand_length(const xed_operand_values_t* p,
00212                                              unsigned int memop_idx);
00213 
00215 XED_DLL_EXPORT xed_reg_enum_t
00216 xed_operand_values_get_base_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00217 
00219 XED_DLL_EXPORT xed_reg_enum_t
00220 xed_operand_values_get_index_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00221 
00223 XED_DLL_EXPORT xed_reg_enum_t
00224 xed_operand_values_get_seg_reg(const xed_operand_values_t* p,unsigned int memop_idx);
00225 
00227 XED_DLL_EXPORT unsigned int
00228 xed_operand_values_get_scale(const xed_operand_values_t* p);
00229 
00233 XED_DLL_EXPORT xed_bool_t 
00234 xed_operand_values_memop_without_modrm(const xed_operand_values_t* p);
00237 XED_DLL_EXPORT xed_bool_t
00238 xed_operand_values_has_modrm_byte(const xed_operand_values_t* p);
00239 
00242 XED_DLL_EXPORT xed_bool_t
00243 xed_operand_values_has_sib_byte(const xed_operand_values_t* p);
00245 
00247 XED_DLL_EXPORT xed_bool_t
00248 xed_operand_values_branch_not_taken_hint(const xed_operand_values_t* p);
00250 XED_DLL_EXPORT xed_bool_t
00251 xed_operand_values_branch_taken_hint(const xed_operand_values_t* p);
00252 
00254 XED_DLL_EXPORT xed_bool_t
00255 xed_operand_values_is_nop(const xed_operand_values_t* p);
00256 
00257 
00259 
00260 
00261 XED_DLL_EXPORT xed_int64_t
00262 xed_operand_values_get_immediate_int64(const xed_operand_values_t* p);
00263 
00265 XED_DLL_EXPORT xed_uint64_t
00266 xed_operand_values_get_immediate_uint64(const xed_operand_values_t* p);
00267 
00270 XED_DLL_EXPORT xed_uint_t xed_operand_values_get_immediate_is_signed(const xed_operand_values_t* p);
00271 
00272     
00274 XED_DLL_EXPORT xed_uint8_t 
00275 xed_operand_values_get_immediate_byte(const xed_operand_values_t* p,unsigned int i);
00276 
00278 XED_DLL_EXPORT xed_uint8_t 
00279 xed_operand_values_get_second_immediate(const xed_operand_values_t* p);
00281 
00283 
00284 
00285 
00286 XED_DLL_EXPORT xed_uint32_t
00287 xed_operand_values_get_memory_displacement_length(const xed_operand_values_t* p);
00290 XED_DLL_EXPORT xed_uint32_t
00291 xed_operand_values_get_memory_displacement_length_bits(const xed_operand_values_t* p);
00292 
00294 XED_DLL_EXPORT xed_int64_t
00295 xed_operand_values_get_memory_displacement_int64(const xed_operand_values_t* p);
00296 
00298 XED_DLL_EXPORT xed_uint8_t 
00299 xed_operand_values_get_memory_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00301 
00303 
00304 
00305 
00306 XED_DLL_EXPORT xed_uint32_t
00307 xed_operand_values_get_branch_displacement_length(const xed_operand_values_t* p);
00310 XED_DLL_EXPORT xed_uint32_t
00311 xed_operand_values_get_branch_displacement_length_bits(const xed_operand_values_t* p);
00312 
00314 XED_DLL_EXPORT xed_int32_t
00315 xed_operand_values_get_branch_displacement_int32(const xed_operand_values_t* p);
00316 
00318 XED_DLL_EXPORT xed_uint8_t 
00319 xed_operand_values_get_branch_displacement_byte(const xed_operand_values_t* p,unsigned int i);
00321 
00322 
00324 XED_DLL_EXPORT xed_iclass_enum_t
00325 xed_operand_values_get_iclass(const xed_operand_values_t* p);
00326     
00328 // ENCODE API
00331 
00332 
00333 XED_DLL_EXPORT void xed_operand_values_zero_immediate(xed_operand_values_t* p);
00335 XED_DLL_EXPORT void xed_operand_values_zero_branch_displacement(xed_operand_values_t* p);
00337 XED_DLL_EXPORT void xed_operand_values_zero_memory_displacement(xed_operand_values_t* p);
00338 
00340 XED_DLL_EXPORT void xed_operand_values_set_lock(xed_operand_values_t* p);
00342 XED_DLL_EXPORT void xed_operand_values_zero_segment_override(xed_operand_values_t* p);
00343 
00344 
00346 XED_DLL_EXPORT void
00347 xed_operand_values_set_iclass(xed_operand_values_t* p,xed_iclass_enum_t iclass);
00348 
00350 XED_DLL_EXPORT void
00351 xed_operand_values_set_effective_operand_width(xed_operand_values_t* p,unsigned int width);
00352 
00354 XED_DLL_EXPORT void
00355 xed_operand_values_set_memory_operand_length(xed_operand_values_t* p,unsigned int memop_length);
00356 
00357    
00360 XED_DLL_EXPORT void
00361 xed_operand_values_set_memory_displacement(xed_operand_values_t* p,xed_int64_t x, unsigned int len);
00364 XED_DLL_EXPORT void
00365 xed_operand_values_set_memory_displacement_bits(xed_operand_values_t* p,xed_int64_t x, unsigned int len_bits);
00366 
00369 XED_DLL_EXPORT void xed_operand_values_set_relbr(xed_operand_values_t* p);
00370 
00373 XED_DLL_EXPORT void
00374 xed_operand_values_set_branch_displacement(xed_operand_values_t* p,xed_int32_t x, unsigned int len);
00377 XED_DLL_EXPORT void
00378 xed_operand_values_set_branch_displacement_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int len_bits);
00379 
00382 XED_DLL_EXPORT void
00383 xed_operand_values_set_immediate_signed(xed_operand_values_t* p,xed_int32_t x, unsigned int bytes); 
00386 XED_DLL_EXPORT void
00387 xed_operand_values_set_immediate_signed_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int bits); 
00388 
00389 
00392 XED_DLL_EXPORT void
00393 xed_operand_values_set_immediate_unsigned(xed_operand_values_t* p,xed_uint64_t x, unsigned int bytes);
00396 XED_DLL_EXPORT void
00397 xed_operand_values_set_immediate_unsigned_bits(xed_operand_values_t* p,xed_uint64_t x, unsigned int bits);
00398 
00399 
00400 
00402 XED_DLL_EXPORT void xed_operand_values_set_base_reg(xed_operand_values_t* p,
00403                                                     unsigned int memop_idx,
00404                                                     xed_reg_enum_t new_base);
00405 
00407 XED_DLL_EXPORT void xed_operand_values_set_seg_reg(xed_operand_values_t* p,
00408                                                    unsigned int memop_idx,
00409                                                    xed_reg_enum_t new_seg);
00410 
00412 XED_DLL_EXPORT void xed_operand_values_set_index_reg(xed_operand_values_t* p,
00413                                                      unsigned int memop_idx,
00414                                                      xed_reg_enum_t new_index);
00415 
00417 XED_DLL_EXPORT void xed_operand_values_set_scale(xed_operand_values_t* p, 
00418                                                  xed_uint_t memop_idx,
00419                                                  xed_uint_t new_scale);
00420 
00421 
00425 XED_DLL_EXPORT void
00426 xed_operand_values_set_operand_reg(xed_operand_values_t* p,
00427                                    xed_operand_enum_t operand_name,
00428                                    xed_reg_enum_t reg_name);
00429 
00431 #endif
00432 
00433 //Local Variables:
00434 //pref: "../../xed-operand-values-interface.c"
00435 //End:

Generated on Mon Oct 6 20:12:57 2008 for XED2 by  doxygen 1.4.6