fcml  1.1.3
fcml_common_utils.h
Go to the documentation of this file.
1 /*
2  * FCML - Free Code Manipulation Library.
3  * Copyright (C) 2010-2015 Slawomir Wojtasiak
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
28 #ifndef FCML_COMMON_UTILS_H_
29 #define FCML_COMMON_UTILS_H_
30 
31 #include "fcml_lib_export.h"
32 
33 #include "fcml_common.h"
34 #include "fcml_assembler.h"
35 #include "fcml_disassembler.h"
36 #include "fcml_instructions.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
48 extern LIB_EXPORT fcml_st_register fcml_reg_AL;
49 extern LIB_EXPORT fcml_st_register fcml_reg_AX;
50 extern LIB_EXPORT fcml_st_register fcml_reg_EAX;
51 extern LIB_EXPORT fcml_st_register fcml_reg_RAX;
52 extern LIB_EXPORT fcml_st_register fcml_reg_MM0;
53 extern LIB_EXPORT fcml_st_register fcml_reg_XMM0;
54 extern LIB_EXPORT fcml_st_register fcml_reg_YMM0;
55 
56 extern LIB_EXPORT fcml_st_register fcml_reg_CL;
57 extern LIB_EXPORT fcml_st_register fcml_reg_CX;
58 extern LIB_EXPORT fcml_st_register fcml_reg_ECX;
59 extern LIB_EXPORT fcml_st_register fcml_reg_RCX;
60 extern LIB_EXPORT fcml_st_register fcml_reg_MM1;
61 extern LIB_EXPORT fcml_st_register fcml_reg_XMM1;
62 extern LIB_EXPORT fcml_st_register fcml_reg_YMM1;
63 
64 extern LIB_EXPORT fcml_st_register fcml_reg_DL;
65 extern LIB_EXPORT fcml_st_register fcml_reg_DX;
66 extern LIB_EXPORT fcml_st_register fcml_reg_EDX;
67 extern LIB_EXPORT fcml_st_register fcml_reg_RDX;
68 extern LIB_EXPORT fcml_st_register fcml_reg_MM2;
69 extern LIB_EXPORT fcml_st_register fcml_reg_XMM2;
70 extern LIB_EXPORT fcml_st_register fcml_reg_YMM2;
71 
72 extern LIB_EXPORT fcml_st_register fcml_reg_BL;
73 extern LIB_EXPORT fcml_st_register fcml_reg_BX;
74 extern LIB_EXPORT fcml_st_register fcml_reg_EBX;
75 extern LIB_EXPORT fcml_st_register fcml_reg_RBX;
76 extern LIB_EXPORT fcml_st_register fcml_reg_MM3;
77 extern LIB_EXPORT fcml_st_register fcml_reg_XMM3;
78 extern LIB_EXPORT fcml_st_register fcml_reg_YMM3;
79 
80 extern LIB_EXPORT fcml_st_register fcml_reg_AH;
81 extern LIB_EXPORT fcml_st_register fcml_reg_SPL;
82 extern LIB_EXPORT fcml_st_register fcml_reg_SP;
83 extern LIB_EXPORT fcml_st_register fcml_reg_ESP;
84 extern LIB_EXPORT fcml_st_register fcml_reg_RSP;
85 extern LIB_EXPORT fcml_st_register fcml_reg_MM4;
86 extern LIB_EXPORT fcml_st_register fcml_reg_XMM4;
87 extern LIB_EXPORT fcml_st_register fcml_reg_YMM4;
88 
89 extern LIB_EXPORT fcml_st_register fcml_reg_CH;
90 extern LIB_EXPORT fcml_st_register fcml_reg_BPL;
91 extern LIB_EXPORT fcml_st_register fcml_reg_BP;
92 extern LIB_EXPORT fcml_st_register fcml_reg_EBP;
93 extern LIB_EXPORT fcml_st_register fcml_reg_RBP;
94 extern LIB_EXPORT fcml_st_register fcml_reg_MM5;
95 extern LIB_EXPORT fcml_st_register fcml_reg_XMM5;
96 extern LIB_EXPORT fcml_st_register fcml_reg_YMM5;
97 
98 extern LIB_EXPORT fcml_st_register fcml_reg_DH;
99 extern LIB_EXPORT fcml_st_register fcml_reg_SIL;
100 extern LIB_EXPORT fcml_st_register fcml_reg_SI;
101 extern LIB_EXPORT fcml_st_register fcml_reg_ESI;
102 extern LIB_EXPORT fcml_st_register fcml_reg_RSI;
103 extern LIB_EXPORT fcml_st_register fcml_reg_MM6;
104 extern LIB_EXPORT fcml_st_register fcml_reg_XMM6;
105 extern LIB_EXPORT fcml_st_register fcml_reg_YMM6;
106 
107 extern LIB_EXPORT fcml_st_register fcml_reg_BH;
108 extern LIB_EXPORT fcml_st_register fcml_reg_DIL;
109 extern LIB_EXPORT fcml_st_register fcml_reg_DI;
110 extern LIB_EXPORT fcml_st_register fcml_reg_EDI;
111 extern LIB_EXPORT fcml_st_register fcml_reg_RDI;
112 extern LIB_EXPORT fcml_st_register fcml_reg_MM7;
113 extern LIB_EXPORT fcml_st_register fcml_reg_XMM7;
114 extern LIB_EXPORT fcml_st_register fcml_reg_YMM7;
115 
116 extern LIB_EXPORT fcml_st_register fcml_reg_R8L;
117 extern LIB_EXPORT fcml_st_register fcml_reg_R8W;
118 extern LIB_EXPORT fcml_st_register fcml_reg_R8D;
119 extern LIB_EXPORT fcml_st_register fcml_reg_R8;
120 extern LIB_EXPORT fcml_st_register fcml_reg_XMM8;
121 extern LIB_EXPORT fcml_st_register fcml_reg_YMM8;
122 
123 extern LIB_EXPORT fcml_st_register fcml_reg_R9L;
124 extern LIB_EXPORT fcml_st_register fcml_reg_R9W;
125 extern LIB_EXPORT fcml_st_register fcml_reg_R9D;
126 extern LIB_EXPORT fcml_st_register fcml_reg_R9;
127 extern LIB_EXPORT fcml_st_register fcml_reg_XMM9;
128 extern LIB_EXPORT fcml_st_register fcml_reg_YMM9;
129 
130 extern LIB_EXPORT fcml_st_register fcml_reg_R10L;
131 extern LIB_EXPORT fcml_st_register fcml_reg_R10W;
132 extern LIB_EXPORT fcml_st_register fcml_reg_R10D;
133 extern LIB_EXPORT fcml_st_register fcml_reg_R10;
134 extern LIB_EXPORT fcml_st_register fcml_reg_XMM10;
135 extern LIB_EXPORT fcml_st_register fcml_reg_YMM10;
136 
137 extern LIB_EXPORT fcml_st_register fcml_reg_R11L;
138 extern LIB_EXPORT fcml_st_register fcml_reg_R11W;
139 extern LIB_EXPORT fcml_st_register fcml_reg_R11D;
140 extern LIB_EXPORT fcml_st_register fcml_reg_R11;
141 extern LIB_EXPORT fcml_st_register fcml_reg_XMM11;
142 extern LIB_EXPORT fcml_st_register fcml_reg_YMM11;
143 
144 extern LIB_EXPORT fcml_st_register fcml_reg_R12L;
145 extern LIB_EXPORT fcml_st_register fcml_reg_R12W;
146 extern LIB_EXPORT fcml_st_register fcml_reg_R12D;
147 extern LIB_EXPORT fcml_st_register fcml_reg_R12;
148 extern LIB_EXPORT fcml_st_register fcml_reg_XMM12;
149 extern LIB_EXPORT fcml_st_register fcml_reg_YMM12;
150 
151 extern LIB_EXPORT fcml_st_register fcml_reg_R13L;
152 extern LIB_EXPORT fcml_st_register fcml_reg_R13W;
153 extern LIB_EXPORT fcml_st_register fcml_reg_R13D;
154 extern LIB_EXPORT fcml_st_register fcml_reg_R13;
155 extern LIB_EXPORT fcml_st_register fcml_reg_XMM13;
156 extern LIB_EXPORT fcml_st_register fcml_reg_YMM13;
157 
158 extern LIB_EXPORT fcml_st_register fcml_reg_R14L;
159 extern LIB_EXPORT fcml_st_register fcml_reg_R14W;
160 extern LIB_EXPORT fcml_st_register fcml_reg_R14D;
161 extern LIB_EXPORT fcml_st_register fcml_reg_R14;
162 extern LIB_EXPORT fcml_st_register fcml_reg_XMM14;
163 extern LIB_EXPORT fcml_st_register fcml_reg_YMM14;
164 
165 extern LIB_EXPORT fcml_st_register fcml_reg_R15L;
166 extern LIB_EXPORT fcml_st_register fcml_reg_R15W;
167 extern LIB_EXPORT fcml_st_register fcml_reg_R15D;
168 extern LIB_EXPORT fcml_st_register fcml_reg_R15;
169 extern LIB_EXPORT fcml_st_register fcml_reg_XMM15;
170 extern LIB_EXPORT fcml_st_register fcml_reg_YMM15;
171 
172 extern LIB_EXPORT fcml_st_register fcml_reg_ES;
173 extern LIB_EXPORT fcml_st_register fcml_reg_CS;
174 extern LIB_EXPORT fcml_st_register fcml_reg_SS;
175 extern LIB_EXPORT fcml_st_register fcml_reg_DS;
176 extern LIB_EXPORT fcml_st_register fcml_reg_FS;
177 extern LIB_EXPORT fcml_st_register fcml_reg_GS;
178 
179 extern LIB_EXPORT fcml_st_register fcml_reg_ST0;
180 extern LIB_EXPORT fcml_st_register fcml_reg_ST1;
181 extern LIB_EXPORT fcml_st_register fcml_reg_ST2;
182 extern LIB_EXPORT fcml_st_register fcml_reg_ST3;
183 extern LIB_EXPORT fcml_st_register fcml_reg_ST4;
184 extern LIB_EXPORT fcml_st_register fcml_reg_ST5;
185 extern LIB_EXPORT fcml_st_register fcml_reg_ST6;
186 extern LIB_EXPORT fcml_st_register fcml_reg_ST7;
187 
188 extern LIB_EXPORT fcml_st_register fcml_reg_CR0;
189 extern LIB_EXPORT fcml_st_register fcml_reg_CR2;
190 extern LIB_EXPORT fcml_st_register fcml_reg_CR3;
191 extern LIB_EXPORT fcml_st_register fcml_reg_CR4;
192 extern LIB_EXPORT fcml_st_register fcml_reg_CR8;
193 
194 extern LIB_EXPORT fcml_st_register fcml_reg_DR0;
195 extern LIB_EXPORT fcml_st_register fcml_reg_DR1;
196 extern LIB_EXPORT fcml_st_register fcml_reg_DR2;
197 extern LIB_EXPORT fcml_st_register fcml_reg_DR3;
198 extern LIB_EXPORT fcml_st_register fcml_reg_DR4;
199 extern LIB_EXPORT fcml_st_register fcml_reg_DR5;
200 extern LIB_EXPORT fcml_st_register fcml_reg_DR6;
201 extern LIB_EXPORT fcml_st_register fcml_reg_DR7;
202 
203 extern LIB_EXPORT fcml_st_register fcml_reg_IP;
204 extern LIB_EXPORT fcml_st_register fcml_reg_EIP;
205 extern LIB_EXPORT fcml_st_register fcml_reg_RIP;
206 
213 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_reg( fcml_st_register *reg );
214 
215 /* IMM.*/
216 
221 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_8( fcml_uint8_t value );
226 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_8( fcml_int8_t value );
231 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_16( fcml_uint16_t value );
236 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_16( fcml_int16_t value );
241 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_32( fcml_uint32_t value );
246 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_32( fcml_int32_t value );
251 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_64( fcml_uint64_t value );
256 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_64( fcml_int64_t value );
257 
258 /* Memory addressing.*/
259 
265 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_far_pointer_offset16( fcml_int16_t seg, fcml_int16_t offset );
271 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_far_pointer_offset32( fcml_int16_t seg, fcml_int32_t offset );
277 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_16( fcml_int16_t offset, fcml_usize size_operator );
283 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_32( fcml_int32_t offset, fcml_usize size_operator );
290 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_abs_64( fcml_int64_t offset, fcml_usize size_operator );
297 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_rel_64( fcml_int64_t offset, fcml_usize size_operator );
303 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_16( fcml_int16_t disp, fcml_usize size_operator );
309 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_32( fcml_int32_t disp, fcml_usize size_operator );
315 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_64( fcml_int64_t disp, fcml_usize size_operator );
322 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_8( fcml_st_register *base, fcml_int8_t disp, fcml_usize size_operator );
329 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_16( fcml_st_register *base, fcml_int16_t disp, fcml_usize size_operator );
336 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_32( fcml_st_register *base, fcml_int32_t disp, fcml_usize size_operator );
343 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_64( fcml_st_register *base, fcml_int64_t disp, fcml_usize size_operator );
351 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_8( fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int8_t disp, fcml_usize size_operator );
359 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_32( fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int32_t disp, fcml_usize size_operator );
367 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_64( fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int64_t disp, fcml_usize size_operator );
376 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_8( fcml_st_register *base, fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int8_t disp, fcml_usize size_operator );
385 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_32( fcml_st_register *base, fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int32_t disp, fcml_usize size_operator );
394 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_64( fcml_st_register *base, fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int64_t disp, fcml_usize size_operator );
395 
401 LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_add_operand_hints( fcml_st_operand operand, fcml_hints hints );
402 
412 LIB_EXPORT fcml_st_instruction* LIB_CALL fcml_fn_cu_clone_instruction( fcml_st_instruction *instruction );
413 
418 LIB_EXPORT void LIB_CALL fcml_fn_cu_free_instruction( fcml_st_instruction *instruction );
419 
426 LIB_EXPORT fcml_st_operand *fcml_fn_cu_find_operand( fcml_st_instruction *instruction, fcml_en_operand_type operand_type );
427 
428 /* Some shortcuts for those who prefer to use macros instead of functions.*/
429 
430 #define FCML_IMM8_S( x ) fcml_fn_cu_operand_signed_imm_8( x )
431 #define FCML_IMM8( x ) fcml_fn_cu_operand_unsigned_imm_8( x )
432 #define FCML_IMM16_S( x ) fcml_fn_cu_operand_signed_imm_16( x )
433 #define FCML_IMM16( x ) fcml_fn_cu_operand_unsigned_imm_16( x )
434 #define FCML_IMM32_S( x ) fcml_fn_cu_operand_signed_imm_32( x )
435 #define FCML_IMM32( x ) fcml_fn_cu_operand_unsigned_imm_32( x )
436 #define FCML_IMM64_S( x ) fcml_fn_cu_operand_signed_imm_64( x )
437 #define FCML_IMM64( x ) fcml_fn_cu_operand_unsigned_imm_64( x )
438 
439 #ifdef FCML_USE_SHORT_REG
440 #define FCML_REG( x ) fcml_fn_cu_operand_reg( &fcml_reg_##x )
441 #else
442 #define FCML_REG( x ) fcml_fn_cu_operand_reg( &x )
443 #endif
444 
445 #define FCML_FAR_POINTER_16( seg, offset ) fcml_fn_cu_operand_addr_far_pointer_offset16( seg, offset )
446 #define FCML_FAR_POINTER_32( seg, offset ) fcml_fn_cu_operand_addr_far_pointer_offset32( seg, offset )
447 #define FCML_OFFSET_16( offset ) fcml_fn_cu_operand_addr_offset_16( offset )
448 #define FCML_OFFSET_32( offset ) fcml_fn_cu_operand_addr_offset_32( offset )
449 #define FCML_OFFSET_ABS_64( offset ) fcml_fn_cu_operand_addr_offset_abs_64( offset )
450 #define FCML_OFFSET_REL_64( offset ) fcml_fn_cu_operand_addr_offset_rel_64( offset )
451 #define FCML_DISP_16( offset ) fcml_fn_cu_operand_addr_disp_16( offset )
452 #define FCML_DISP_32( offset ) fcml_fn_cu_operand_addr_disp_32( offset )
453 #define FCML_DISP_64( offset ) fcml_fn_cu_operand_addr_disp_64( offset )
454 
455 #ifdef FCML_USE_SHORT_REG
456 #define FCML_B_DISP_8( base, offset ) fcml_fn_cu_operand_addr_b_disp_8( &fcml_reg_##base, offset )
457 #define FCML_B_DISP_16( base, offset ) fcml_fn_cu_operand_addr_b_disp_16( &fcml_reg_##base, offset )
458 #define FCML_B_DISP_32( base, offset ) fcml_fn_cu_operand_addr_b_disp_32( &fcml_reg_##base, offset )
459 #define FCML_B_DISP_64( base, offset ) fcml_fn_cu_operand_addr_b_disp_64( &fcml_reg_##base, offset )
460 #define FCML_IS_DISP_8( index, scale, offset ) fcml_fn_cu_operand_addr_is_disp_8( &fcml_reg_##index, scale, offset )
461 #define FCML_IS_DISP_16( index, scale, offset ) fcml_fn_cu_operand_addr_is_disp_32( &fcml_reg_##index, scale, offset )
462 #define FCML_IS_DISP_32( index, scale, offset ) fcml_fn_cu_operand_addr_is_disp_64( &fcml_reg_##index, scale, offset )
463 #define FCML_BIS_DISP_8( base, index, scale, offset ) fcml_fn_cu_operand_addr_bis_disp_8( &fcml_reg_##base, &fcml_reg_##index, scale, offset )
464 #define FCML_BIS_DISP_16( base, index, scale, offset ) fcml_fn_cu_operand_addr_bis_disp_32( &fcml_reg_##base, &fcml_reg_##index, scale, offset )
465 #define FCML_BIS_DISP_32( base, index, scale, offset ) fcml_fn_cu_operand_addr_bis_disp_64( &fcml_reg_##base, &fcml_reg_##index, scale, offset )
466 #else
467 #define FCML_B_DISP_8( base, offset ) fcml_fn_cu_operand_addr_b_disp_8( &base, offset )
468 #define FCML_B_DISP_16( base, offset ) fcml_fn_cu_operand_addr_b_disp_16( &base, offset )
469 #define FCML_B_DISP_32( base, offset ) fcml_fn_cu_operand_addr_b_disp_32( &base, offset )
470 #define FCML_B_DISP_64( base, offset ) fcml_fn_cu_operand_addr_b_disp_64( &base, offset )
471 #define FCML_IS_DISP_8( index, scale, offset ) fcml_fn_cu_operand_addr_is_disp_8( &index, scale, offset )
472 #define FCML_IS_DISP_16( index, scale, offset ) fcml_fn_cu_operand_addr_is_disp_32( &index, scale, offset )
473 #define FCML_IS_DISP_32( index, scale, offset ) fcml_fn_cu_operand_addr_is_disp_64( &index, scale, offset )
474 #define FCML_BIS_DISP_8( base, index, scale, offset ) fcml_fn_cu_operand_addr_bis_disp_8( &base, &index, scale, offset )
475 #define FCML_BIS_DISP_16( base, index, scale, offset ) fcml_fn_cu_operand_addr_bis_disp_32( &base, &index, scale, offset )
476 #define FCML_BIS_DISP_32( base, index, scale, offset ) fcml_fn_cu_operand_addr_bis_disp_64( &base, &index, scale, offset )
477 #endif
478 
479 #define FCML_IS_INSTRUCTION_GROUP( result, group ) ( result.instruction_details.instruction_group & ( group ) )
480 #define FCML_IS_INSTRUCTION_CODE( result, _ins ) ( result.instruction_details.instruction == _ins )
481 
482 #ifdef __cplusplus
483 }
484 #endif
485 
486 #endif /* FCML_COMMON_UTILS_H_ */
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_64(fcml_st_register *base, fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int64_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 32-bit displacement, base register, scale factor and index register.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_16(fcml_int16_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 16-bit displacement.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_32(fcml_st_register *base, fcml_int32_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 32-bit displacement and base register.
LIB_EXPORT fcml_st_instruction *LIB_CALL fcml_fn_cu_clone_instruction(fcml_st_instruction *instruction)
Clones given instruction.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_32(fcml_st_register *base, fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int32_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 16-bit displacement, base register, scale factor and index register.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_abs_64(fcml_int64_t offset, fcml_usize size_operator)
Prepares memory addressing operand for 64-bit absolute offset.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_rel_64(fcml_int64_t offset, fcml_usize size_operator)
Prepares memory addressing operand for 64-bit absolute offset.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_16(fcml_int16_t value)
Prepares immediate operand for signed int16.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_32(fcml_int32_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 32-bit displacement.
fcml_en_operand_type
Supported operand types.
Definition: fcml_common.h:513
fcml_uint16_t fcml_hints
Type used for storing instruction and operand hint masks.
Definition: fcml_common.h:85
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_8(fcml_uint8_t value)
Prepares immediate operand for unsigned int8.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_64(fcml_uint64_t value)
Prepares immediate operand for unsigned int64.
Definitions of common structures used by FCML components.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_64(fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int64_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 32-bit displacement, scale factor and index register...
Generic instruction model.
Definition: fcml_common.h:611
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_far_pointer_offset16(fcml_int16_t seg, fcml_int16_t offset)
Prepares far pointer operand for given segment and offset.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_8(fcml_int8_t value)
Prepares immediate operand for signed int8.
Handles Win32 DLL symbols importing/exporting.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_16(fcml_st_register *base, fcml_int16_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 16-bit displacement and base register.
Structure describes x86_64 register.
Definition: fcml_common.h:325
Structures and functions declarations related to FCML disassembler.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_8(fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int8_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 8-bit displacement, scale factor and index register...
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_far_pointer_offset32(fcml_int16_t seg, fcml_int32_t offset)
Prepares far pointer operand for given segment and offset.
LIB_EXPORT fcml_st_operand * fcml_fn_cu_find_operand(fcml_st_instruction *instruction, fcml_en_operand_type operand_type)
Gets operand of given type or NULL if there is no such operand.
LIB_EXPORT void LIB_CALL fcml_fn_cu_free_instruction(fcml_st_instruction *instruction)
Frees given instruction.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_32(fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int32_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 16-bit displacement, scale factor and index register...
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_8(fcml_st_register *base, fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int8_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 8-bit displacement, base register, scale factor and index register.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_64(fcml_int64_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 64-bit displacement.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_16(fcml_int16_t offset, fcml_usize size_operator)
Prepares memory addressing operand for 16-bit absolute offset.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_16(fcml_uint16_t value)
Prepares immediate operand for unsigned int16.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_8(fcml_st_register *base, fcml_int8_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 8-bit displacement and base register.
Instruction operand.
Definition: fcml_common.h:567
Instruction codes and addressing modes/instruction forms.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_reg(fcml_st_register *reg)
Prepares register operand for given register.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_add_operand_hints(fcml_st_operand operand, fcml_hints hints)
Adds hints to the operand.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_64(fcml_int64_t value)
Prepares immediate operand for signed int64.
Structures and functions declarations related to one-line FCML assembler.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_32(fcml_int32_t value)
Prepares immediate operand for signed int32.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_32(fcml_int32_t offset, fcml_usize size_operator)
Prepares memory addressing operand for 32-bit absolute offset.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_32(fcml_uint32_t value)
Prepares immediate operand for unsigned int32.
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_64(fcml_st_register *base, fcml_int64_t disp, fcml_usize size_operator)
Prepares effective memory addressing operand for 64-bit displacement and base register.