fcml  1.2.2
Macros | Functions | Variables
fcml_common_utils.h File Reference

Common general purpose utility functions. More...

#include "fcml_lib_export.h"
#include "fcml_common.h"
#include "fcml_assembler.h"
#include "fcml_disassembler.h"
#include "fcml_instructions.h"
Include dependency graph for fcml_common_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FCML_IMM8_S(x)   fcml_fn_cu_operand_signed_imm_8( x )
 
#define FCML_IMM8(x)   fcml_fn_cu_operand_unsigned_imm_8( x )
 
#define FCML_IMM16_S(x)   fcml_fn_cu_operand_signed_imm_16( x )
 
#define FCML_IMM16(x)   fcml_fn_cu_operand_unsigned_imm_16( x )
 
#define FCML_IMM32_S(x)   fcml_fn_cu_operand_signed_imm_32( x )
 
#define FCML_IMM32(x)   fcml_fn_cu_operand_unsigned_imm_32( x )
 
#define FCML_IMM64_S(x)   fcml_fn_cu_operand_signed_imm_64( x )
 
#define FCML_IMM64(x)   fcml_fn_cu_operand_unsigned_imm_64( x )
 
#define FCML_REG(x)   fcml_fn_cu_operand_reg( &x )
 
#define FCML_FAR_POINTER_16(seg, offset)   fcml_fn_cu_operand_addr_far_pointer_offset16( seg, offset )
 
#define FCML_FAR_POINTER_32(seg, offset)   fcml_fn_cu_operand_addr_far_pointer_offset32( seg, offset )
 
#define FCML_OFFSET_16(offset)   fcml_fn_cu_operand_addr_offset_16( offset )
 
#define FCML_OFFSET_32(offset)   fcml_fn_cu_operand_addr_offset_32( offset )
 
#define FCML_OFFSET_ABS_64(offset)   fcml_fn_cu_operand_addr_offset_abs_64( offset )
 
#define FCML_OFFSET_REL_64(offset)   fcml_fn_cu_operand_addr_offset_rel_64( offset )
 
#define FCML_DISP_16(offset)   fcml_fn_cu_operand_addr_disp_16( offset )
 
#define FCML_DISP_32(offset)   fcml_fn_cu_operand_addr_disp_32( offset )
 
#define FCML_DISP_64(offset)   fcml_fn_cu_operand_addr_disp_64( offset )
 
#define FCML_B_DISP_8(base, offset)   fcml_fn_cu_operand_addr_b_disp_8( &base, offset )
 
#define FCML_B_DISP_16(base, offset)   fcml_fn_cu_operand_addr_b_disp_16( &base, offset )
 
#define FCML_B_DISP_32(base, offset)   fcml_fn_cu_operand_addr_b_disp_32( &base, offset )
 
#define FCML_B_DISP_64(base, offset)   fcml_fn_cu_operand_addr_b_disp_64( &base, offset )
 
#define FCML_IS_DISP_8(index, scale, offset)   fcml_fn_cu_operand_addr_is_disp_8( &index, scale, offset )
 
#define FCML_IS_DISP_16(index, scale, offset)   fcml_fn_cu_operand_addr_is_disp_32( &index, scale, offset )
 
#define FCML_IS_DISP_32(index, scale, offset)   fcml_fn_cu_operand_addr_is_disp_64( &index, scale, offset )
 
#define FCML_BIS_DISP_8(base, index, scale, offset)   fcml_fn_cu_operand_addr_bis_disp_8( &base, &index, scale, offset )
 
#define FCML_BIS_DISP_16(base, index, scale, offset)   fcml_fn_cu_operand_addr_bis_disp_32( &base, &index, scale, offset )
 
#define FCML_BIS_DISP_32(base, index, scale, offset)   fcml_fn_cu_operand_addr_bis_disp_64( &base, &index, scale, offset )
 
#define FCML_IS_INSTRUCTION_GROUP(result, group)   ( result.instruction_details.instruction_group & ( group ) )
 
#define FCML_IS_INSTRUCTION_CODE(result, _ins)   ( result.instruction_details.instruction == _ins )
 

Functions

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_reg (fcml_st_register *reg)
 Prepares register operand for given register. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_8 (fcml_uint8_t value)
 Prepares immediate operand for unsigned int8. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_8 (fcml_int8_t value)
 Prepares immediate operand for signed int8. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_16 (fcml_uint16_t value)
 Prepares immediate operand for unsigned int16. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_16 (fcml_int16_t value)
 Prepares immediate operand for signed int16. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_32 (fcml_uint32_t value)
 Prepares immediate operand for unsigned int32. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_32 (fcml_int32_t value)
 Prepares immediate operand for signed int32. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_64 (fcml_uint64_t value)
 Prepares immediate operand for unsigned int64. More...
 
LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_64 (fcml_int64_t value)
 Prepares immediate operand for signed int64. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
LIB_EXPORT fcml_st_instruction *LIB_CALL fcml_fn_cu_clone_instruction (fcml_st_instruction *instruction)
 Clones given instruction. More...
 
LIB_EXPORT void LIB_CALL fcml_fn_cu_free_instruction (fcml_st_instruction *instruction)
 Frees given instruction. More...
 
LIB_EXPORT fcml_st_operandfcml_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. More...
 

Variables

LIB_EXPORT fcml_st_register fcml_reg_AL
 
LIB_EXPORT fcml_st_register fcml_reg_AX
 
LIB_EXPORT fcml_st_register fcml_reg_EAX
 
LIB_EXPORT fcml_st_register fcml_reg_RAX
 
LIB_EXPORT fcml_st_register fcml_reg_MM0
 
LIB_EXPORT fcml_st_register fcml_reg_XMM0
 
LIB_EXPORT fcml_st_register fcml_reg_YMM0
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM0
 
LIB_EXPORT fcml_st_register fcml_reg_CL
 
LIB_EXPORT fcml_st_register fcml_reg_CX
 
LIB_EXPORT fcml_st_register fcml_reg_ECX
 
LIB_EXPORT fcml_st_register fcml_reg_RCX
 
LIB_EXPORT fcml_st_register fcml_reg_MM1
 
LIB_EXPORT fcml_st_register fcml_reg_XMM1
 
LIB_EXPORT fcml_st_register fcml_reg_YMM1
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM1
 
LIB_EXPORT fcml_st_register fcml_reg_DL
 
LIB_EXPORT fcml_st_register fcml_reg_DX
 
LIB_EXPORT fcml_st_register fcml_reg_EDX
 
LIB_EXPORT fcml_st_register fcml_reg_RDX
 
LIB_EXPORT fcml_st_register fcml_reg_MM2
 
LIB_EXPORT fcml_st_register fcml_reg_XMM2
 
LIB_EXPORT fcml_st_register fcml_reg_YMM2
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM2
 
LIB_EXPORT fcml_st_register fcml_reg_BL
 
LIB_EXPORT fcml_st_register fcml_reg_BX
 
LIB_EXPORT fcml_st_register fcml_reg_EBX
 
LIB_EXPORT fcml_st_register fcml_reg_RBX
 
LIB_EXPORT fcml_st_register fcml_reg_MM3
 
LIB_EXPORT fcml_st_register fcml_reg_XMM3
 
LIB_EXPORT fcml_st_register fcml_reg_YMM3
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM3
 
LIB_EXPORT fcml_st_register fcml_reg_AH
 
LIB_EXPORT fcml_st_register fcml_reg_SPL
 
LIB_EXPORT fcml_st_register fcml_reg_SP
 
LIB_EXPORT fcml_st_register fcml_reg_ESP
 
LIB_EXPORT fcml_st_register fcml_reg_RSP
 
LIB_EXPORT fcml_st_register fcml_reg_MM4
 
LIB_EXPORT fcml_st_register fcml_reg_XMM4
 
LIB_EXPORT fcml_st_register fcml_reg_YMM4
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM4
 
LIB_EXPORT fcml_st_register fcml_reg_CH
 
LIB_EXPORT fcml_st_register fcml_reg_BPL
 
LIB_EXPORT fcml_st_register fcml_reg_BP
 
LIB_EXPORT fcml_st_register fcml_reg_EBP
 
LIB_EXPORT fcml_st_register fcml_reg_RBP
 
LIB_EXPORT fcml_st_register fcml_reg_MM5
 
LIB_EXPORT fcml_st_register fcml_reg_XMM5
 
LIB_EXPORT fcml_st_register fcml_reg_YMM5
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM5
 
LIB_EXPORT fcml_st_register fcml_reg_DH
 
LIB_EXPORT fcml_st_register fcml_reg_SIL
 
LIB_EXPORT fcml_st_register fcml_reg_SI
 
LIB_EXPORT fcml_st_register fcml_reg_ESI
 
LIB_EXPORT fcml_st_register fcml_reg_RSI
 
LIB_EXPORT fcml_st_register fcml_reg_MM6
 
LIB_EXPORT fcml_st_register fcml_reg_XMM6
 
LIB_EXPORT fcml_st_register fcml_reg_YMM6
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM6
 
LIB_EXPORT fcml_st_register fcml_reg_BH
 
LIB_EXPORT fcml_st_register fcml_reg_DIL
 
LIB_EXPORT fcml_st_register fcml_reg_DI
 
LIB_EXPORT fcml_st_register fcml_reg_EDI
 
LIB_EXPORT fcml_st_register fcml_reg_RDI
 
LIB_EXPORT fcml_st_register fcml_reg_MM7
 
LIB_EXPORT fcml_st_register fcml_reg_XMM7
 
LIB_EXPORT fcml_st_register fcml_reg_YMM7
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM7
 
LIB_EXPORT fcml_st_register fcml_reg_R8L
 
LIB_EXPORT fcml_st_register fcml_reg_R8W
 
LIB_EXPORT fcml_st_register fcml_reg_R8D
 
LIB_EXPORT fcml_st_register fcml_reg_R8
 
LIB_EXPORT fcml_st_register fcml_reg_XMM8
 
LIB_EXPORT fcml_st_register fcml_reg_YMM8
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM8
 
LIB_EXPORT fcml_st_register fcml_reg_R9L
 
LIB_EXPORT fcml_st_register fcml_reg_R9W
 
LIB_EXPORT fcml_st_register fcml_reg_R9D
 
LIB_EXPORT fcml_st_register fcml_reg_R9
 
LIB_EXPORT fcml_st_register fcml_reg_XMM9
 
LIB_EXPORT fcml_st_register fcml_reg_YMM9
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM9
 
LIB_EXPORT fcml_st_register fcml_reg_R10L
 
LIB_EXPORT fcml_st_register fcml_reg_R10W
 
LIB_EXPORT fcml_st_register fcml_reg_R10D
 
LIB_EXPORT fcml_st_register fcml_reg_R10
 
LIB_EXPORT fcml_st_register fcml_reg_XMM10
 
LIB_EXPORT fcml_st_register fcml_reg_YMM10
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM10
 
LIB_EXPORT fcml_st_register fcml_reg_R11L
 
LIB_EXPORT fcml_st_register fcml_reg_R11W
 
LIB_EXPORT fcml_st_register fcml_reg_R11D
 
LIB_EXPORT fcml_st_register fcml_reg_R11
 
LIB_EXPORT fcml_st_register fcml_reg_XMM11
 
LIB_EXPORT fcml_st_register fcml_reg_YMM11
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM11
 
LIB_EXPORT fcml_st_register fcml_reg_R12L
 
LIB_EXPORT fcml_st_register fcml_reg_R12W
 
LIB_EXPORT fcml_st_register fcml_reg_R12D
 
LIB_EXPORT fcml_st_register fcml_reg_R12
 
LIB_EXPORT fcml_st_register fcml_reg_XMM12
 
LIB_EXPORT fcml_st_register fcml_reg_YMM12
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM12
 
LIB_EXPORT fcml_st_register fcml_reg_R13L
 
LIB_EXPORT fcml_st_register fcml_reg_R13W
 
LIB_EXPORT fcml_st_register fcml_reg_R13D
 
LIB_EXPORT fcml_st_register fcml_reg_R13
 
LIB_EXPORT fcml_st_register fcml_reg_XMM13
 
LIB_EXPORT fcml_st_register fcml_reg_YMM13
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM13
 
LIB_EXPORT fcml_st_register fcml_reg_R14L
 
LIB_EXPORT fcml_st_register fcml_reg_R14W
 
LIB_EXPORT fcml_st_register fcml_reg_R14D
 
LIB_EXPORT fcml_st_register fcml_reg_R14
 
LIB_EXPORT fcml_st_register fcml_reg_XMM14
 
LIB_EXPORT fcml_st_register fcml_reg_YMM14
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM14
 
LIB_EXPORT fcml_st_register fcml_reg_R15L
 
LIB_EXPORT fcml_st_register fcml_reg_R15W
 
LIB_EXPORT fcml_st_register fcml_reg_R15D
 
LIB_EXPORT fcml_st_register fcml_reg_R15
 
LIB_EXPORT fcml_st_register fcml_reg_XMM15
 
LIB_EXPORT fcml_st_register fcml_reg_YMM15
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM15
 
LIB_EXPORT fcml_st_register fcml_reg_XMM16
 
LIB_EXPORT fcml_st_register fcml_reg_YMM16
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM16
 
LIB_EXPORT fcml_st_register fcml_reg_XMM17
 
LIB_EXPORT fcml_st_register fcml_reg_YMM17
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM17
 
LIB_EXPORT fcml_st_register fcml_reg_XMM18
 
LIB_EXPORT fcml_st_register fcml_reg_YMM18
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM18
 
LIB_EXPORT fcml_st_register fcml_reg_XMM19
 
LIB_EXPORT fcml_st_register fcml_reg_YMM19
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM19
 
LIB_EXPORT fcml_st_register fcml_reg_XMM20
 
LIB_EXPORT fcml_st_register fcml_reg_YMM20
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM20
 
LIB_EXPORT fcml_st_register fcml_reg_XMM21
 
LIB_EXPORT fcml_st_register fcml_reg_YMM21
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM21
 
LIB_EXPORT fcml_st_register fcml_reg_XMM22
 
LIB_EXPORT fcml_st_register fcml_reg_YMM22
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM22
 
LIB_EXPORT fcml_st_register fcml_reg_XMM23
 
LIB_EXPORT fcml_st_register fcml_reg_YMM23
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM23
 
LIB_EXPORT fcml_st_register fcml_reg_XMM24
 
LIB_EXPORT fcml_st_register fcml_reg_YMM24
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM24
 
LIB_EXPORT fcml_st_register fcml_reg_XMM25
 
LIB_EXPORT fcml_st_register fcml_reg_YMM25
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM25
 
LIB_EXPORT fcml_st_register fcml_reg_XMM26
 
LIB_EXPORT fcml_st_register fcml_reg_YMM26
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM26
 
LIB_EXPORT fcml_st_register fcml_reg_XMM27
 
LIB_EXPORT fcml_st_register fcml_reg_YMM27
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM27
 
LIB_EXPORT fcml_st_register fcml_reg_XMM28
 
LIB_EXPORT fcml_st_register fcml_reg_YMM28
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM28
 
LIB_EXPORT fcml_st_register fcml_reg_XMM29
 
LIB_EXPORT fcml_st_register fcml_reg_YMM29
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM29
 
LIB_EXPORT fcml_st_register fcml_reg_XMM30
 
LIB_EXPORT fcml_st_register fcml_reg_YMM30
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM30
 
LIB_EXPORT fcml_st_register fcml_reg_XMM31
 
LIB_EXPORT fcml_st_register fcml_reg_YMM31
 
LIB_EXPORT fcml_st_register fcml_reg_ZMM31
 
LIB_EXPORT fcml_st_register fcml_reg_ES
 
LIB_EXPORT fcml_st_register fcml_reg_CS
 
LIB_EXPORT fcml_st_register fcml_reg_SS
 
LIB_EXPORT fcml_st_register fcml_reg_DS
 
LIB_EXPORT fcml_st_register fcml_reg_FS
 
LIB_EXPORT fcml_st_register fcml_reg_GS
 
LIB_EXPORT fcml_st_register fcml_reg_ST0
 
LIB_EXPORT fcml_st_register fcml_reg_ST1
 
LIB_EXPORT fcml_st_register fcml_reg_ST2
 
LIB_EXPORT fcml_st_register fcml_reg_ST3
 
LIB_EXPORT fcml_st_register fcml_reg_ST4
 
LIB_EXPORT fcml_st_register fcml_reg_ST5
 
LIB_EXPORT fcml_st_register fcml_reg_ST6
 
LIB_EXPORT fcml_st_register fcml_reg_ST7
 
LIB_EXPORT fcml_st_register fcml_reg_CR0
 
LIB_EXPORT fcml_st_register fcml_reg_CR2
 
LIB_EXPORT fcml_st_register fcml_reg_CR3
 
LIB_EXPORT fcml_st_register fcml_reg_CR4
 
LIB_EXPORT fcml_st_register fcml_reg_CR8
 
LIB_EXPORT fcml_st_register fcml_reg_DR0
 
LIB_EXPORT fcml_st_register fcml_reg_DR1
 
LIB_EXPORT fcml_st_register fcml_reg_DR2
 
LIB_EXPORT fcml_st_register fcml_reg_DR3
 
LIB_EXPORT fcml_st_register fcml_reg_DR4
 
LIB_EXPORT fcml_st_register fcml_reg_DR5
 
LIB_EXPORT fcml_st_register fcml_reg_DR6
 
LIB_EXPORT fcml_st_register fcml_reg_DR7
 
LIB_EXPORT fcml_st_register fcml_reg_K0
 
LIB_EXPORT fcml_st_register fcml_reg_K1
 
LIB_EXPORT fcml_st_register fcml_reg_K2
 
LIB_EXPORT fcml_st_register fcml_reg_K3
 
LIB_EXPORT fcml_st_register fcml_reg_K4
 
LIB_EXPORT fcml_st_register fcml_reg_K5
 
LIB_EXPORT fcml_st_register fcml_reg_K6
 
LIB_EXPORT fcml_st_register fcml_reg_K7
 
LIB_EXPORT fcml_st_register fcml_reg_IP
 
LIB_EXPORT fcml_st_register fcml_reg_EIP
 
LIB_EXPORT fcml_st_register fcml_reg_RIP
 

Detailed Description

Common general purpose utility functions.

Function Documentation

◆ fcml_fn_cu_add_operand_hints()

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.

Parameters
operandOperand for hints.
hintsHints mask.
Returns
Prepared operand.

◆ fcml_fn_cu_clone_instruction()

LIB_EXPORT fcml_st_instruction* LIB_CALL fcml_fn_cu_clone_instruction ( fcml_st_instruction instruction)

Clones given instruction.

Allocates new instance of instruction and makes a deep copy of all fields. Remember that cloned instructions have to be freed using fcml_fn_cu_free_instruction() function. Do not try to free it on your own because it might be allocated on different dedicated memory heap.

Parameters
instructionInstruction to be cloned.
Returns
Cloned instruction.

◆ fcml_fn_cu_find_operand()

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.

If more than one operand of given type exist, the first one is returned.

Parameters
instructionFinds an operand of the given type for for given instruction.
operand_typeOperand type.
Returns
Pointer to the operand of given type.

◆ fcml_fn_cu_free_instruction()

LIB_EXPORT void LIB_CALL fcml_fn_cu_free_instruction ( fcml_st_instruction instruction)

Frees given instruction.

Frees instruction allocated by fcml_fn_cu_clone_instruction() function.

Parameters
instructionInstruction to be freed.

◆ fcml_fn_cu_operand_addr_b_disp_16()

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.

Parameters
baseBase register.
disp16-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_b_disp_32()

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.

Parameters
baseBase register.
disp32-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_b_disp_64()

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.

Parameters
baseBase register.
disp64-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_b_disp_8()

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.

Parameters
baseBase register.
disp8-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_bis_disp_32()

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.

Parameters
baseBase register.
indexIndex register.
scale_factorScale factor.
disp16-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_bis_disp_64()

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.

Parameters
baseBase register.
indexIndex register.
scale_factorScale factor.
disp32-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_bis_disp_8()

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.

Parameters
baseBase register.
indexIndex register.
scale_factorScale factor.
disp8-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_disp_16()

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.

Parameters
disp16-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_disp_32()

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.

Parameters
disp32-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_disp_64()

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.

Parameters
disp64-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_far_pointer_offset16()

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.

Parameters
seg16-bit code segment.
offset16-bit code offset.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_far_pointer_offset32()

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.

Parameters
seg16-bit code segment.
offset32-bit code offset.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_is_disp_32()

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.

Parameters
indexIndex register.
scale_factorScale factor.
disp16-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_is_disp_64()

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.

Parameters
indexIndex register.
scale_factorScale factor.
disp32-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_is_disp_8()

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.

Parameters
indexIndex register.
scale_factorScale factor.
disp8-bit displacement.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_offset_16()

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.

Parameters
offset16-bit absolute offset.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_offset_32()

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.

Parameters
offset32-bit absolute offset.
size_operatorSize operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_addr_offset_abs_64()

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.

Function sets operand level hint: FCML_OP_HINT_ABSOLUTE_ADDRESSING.

Parameters
offset64-bit absolute offset.
size_operatorSize operator.
Returns
Prepared operand.
See also
RIP addressing.

◆ fcml_fn_cu_operand_addr_offset_rel_64()

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.

Function sets operand level hint: FCML_OP_HINT_RELATIVE_ADDRESSING.

Parameters
offset64-bit absolute offset.
size_operatorSize operator.
Returns
Prepared operand.
See also
RIP addressing.

◆ fcml_fn_cu_operand_reg()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_reg ( fcml_st_register reg)

Prepares register operand for given register.

Parameters
regRegister for instruction operator.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_signed_imm_16()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_16 ( fcml_int16_t  value)

Prepares immediate operand for signed int16.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_signed_imm_32()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_32 ( fcml_int32_t  value)

Prepares immediate operand for signed int32.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_signed_imm_64()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_64 ( fcml_int64_t  value)

Prepares immediate operand for signed int64.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_signed_imm_8()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_8 ( fcml_int8_t  value)

Prepares immediate operand for signed int8.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_unsigned_imm_16()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_16 ( fcml_uint16_t  value)

Prepares immediate operand for unsigned int16.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_unsigned_imm_32()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_32 ( fcml_uint32_t  value)

Prepares immediate operand for unsigned int32.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_unsigned_imm_64()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_64 ( fcml_uint64_t  value)

Prepares immediate operand for unsigned int64.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.

◆ fcml_fn_cu_operand_unsigned_imm_8()

LIB_EXPORT fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_8 ( fcml_uint8_t  value)

Prepares immediate operand for unsigned int8.

Parameters
valueValue for immediate operand.
Returns
Prepared operand.