Crate xed_sys[][src]

Expand description

Intel XED Bindings.

For the real docs see: https://intelxed.github.io

Note that xed_tables_init() must be called before using the library.

Structs

@ingroup ISASET

@ingroup DEC The main container for instructions. After decode, it holds an array of operands with derived information from decode and also valid #xed_inst_t pointer which describes the operand templates and the operand order. See @ref DEC for API documentation.

@ingroup FLAGS Associated with each flag field there can be one action.

Options for the disasembly formatting functions. Set once during initialization by a calling #xed_format_set_options @ingroup PRINT

@ingroup IFORM Statically available information about iforms. Values are returned by #xed_iform_map().

@ingroup DEC constant information about a decoded instruction form, including the pointer to the constant operand properties #xed_operand_t for this instruction form.

@ingroup DEC Constant information about an individual generic operand, like an operand template, describing the operand properties. See @ref DEC for API information.

@ingroup PRINT This contains the information used by the various disassembly printers. Call xed_init_print_info to initialize the fields. Then change the required and optional fields when required.

@ingroup FLAGS A collection of #xed_flag_action_t’s and unions of read and written flags

Encapsulates machine modes for decoder/encoder requests. It specifies the machine operating mode as a #xed_machine_mode_enum_t for decoding and encoding. The machine mode corresponds to the default data operand width for that mode. For all modes other than the 64b long mode (XED_MACHINE_MODE_LONG_64), a default addressing width, and a stack addressing width must be supplied of type #xed_address_width_enum_t . @ingroup INIT

Constants

< 16b addressing

< 32b addressing

< 64b addressing

< EVEX.LL must not ==3 unless using embedded rounding

< An illegal value for the EVEX.U bit was present in the instruction.

< EVEX.V’=0 was detected in a non-64b mode instruction.

< EVEX.Z!=0 when EVEX.aaa==0

< A 66, F2 or F3 prefix was found where none is allowed.

< A lock prefix was found where none is allowed.

< An illegal value for the MAP field was detected in the instruction.

< Memop indices must be 0 or 1.

< XED could not decode the given instruction because an invalid register encoding was used.

< Source registers must not match the destination register for this instruction.

< An F2 or F3 prefix was found where none is allowed.

< A REX prefix was found where none is allowed.

< There were not enough bytes in the given buffer

< The register or segment callback for xed_agen experienced a problem

< The index, dest and mask regs for AVX2 gathers must be different.

< XED could not decode the given instruction

< Full decode of instruction would exeed 15B.

< The instruciton is not valid for the specified chip

< The instruction was not valid for the specified mode

< There was no error

< One or both of the callbacks for xed_agen were missing.

< The output pointer for xed_agen was zero

< value will be zero (write)

< value will be 1 (write)

< value comes from AH (write)

< modification (write)

< value comes from the stack (write)

< test (read)

< undefined (treated as a write)

< alignment check

< auxiliary flag

< carry flag

< direction flag

< x87 FC0 flag

< x87 FC1 flag

< x87 FC2 flag

< x87 FC3 flag

< ID flag

< interrupt flag

< I/O privilege level

< nested task

<< overflow flag

< parity flag

< resume flag

< sign flag

< traf flag

< virtual interrupt flag

< virtual interrupt pending

< virtual-8086 mode

< zero flag

< 16b protected mode

< 32b protected mode

< 64b operating mode

< 16b protected mode

< 32b protected mode

< 16b real mode

< 32b real mode (CS.D bit = 1)

< Conditional read

< Conditionlly read, always written (must write)

< Conditionlly written (may write)

< Read-only

< Read and conditionlly written (may write)

< Read and written (must write)

< Write-only (must write)

< bfloat16 floating point

< 64b FP double precision

< 16b floating point

< Signed integer

< 80b decimal BCD

< 80b FP x87

< 32b FP single precision

< a structure of various fields

< Unsigned integer

< depends on other fields in the instruction

< Shows up in operand encoding

< Part of the opcode, but listed as an operand

< Part of the opcode, but not typically listed as an operand

< ATT SYSV disassembly syntax

< Intel disassembly syntax

< XED disassembly syntax

Statics

Functions

This converts strings to #xed_address_width_enum_t types. @param s A C-string. @return #xed_address_width_enum_t @ingroup ENUM

This converts strings to #xed_attribute_enum_t types. @param s A C-string. @return #xed_attribute_enum_t @ingroup ENUM

This converts strings to #xed_category_enum_t types. @param s A C-string. @return #xed_category_enum_t @ingroup ENUM

This converts strings to #xed_chip_enum_t types. @param s A C-string. @return #xed_chip_enum_t @ingroup ENUM

This converts strings to #xed_cpuid_bit_enum_t types. @param s A C-string. @return #xed_cpuid_bit_enum_t @ingroup ENUM

This converts strings to #xed_error_enum_t types. @param s A C-string. @return #xed_error_enum_t @ingroup ENUM

This converts strings to #xed_exception_enum_t types. @param s A C-string. @return #xed_exception_enum_t @ingroup ENUM

This converts strings to #xed_extension_enum_t types. @param s A C-string. @return #xed_extension_enum_t @ingroup ENUM

This converts strings to #xed_flag_action_enum_t types. @param s A C-string. @return #xed_flag_action_enum_t @ingroup ENUM

This converts strings to #xed_flag_enum_t types. @param s A C-string. @return #xed_flag_enum_t @ingroup ENUM

This converts strings to #xed_iclass_enum_t types. @param s A C-string. @return #xed_iclass_enum_t @ingroup ENUM

This converts strings to #xed_iform_enum_t types. @param s A C-string. @return #xed_iform_enum_t @ingroup ENUM

This converts strings to #xed_isa_set_enum_t types. @param s A C-string. @return #xed_isa_set_enum_t @ingroup ENUM

This converts strings to #xed_machine_mode_enum_t types. @param s A C-string. @return #xed_machine_mode_enum_t @ingroup ENUM

This converts strings to #xed_nonterminal_enum_t types. @param s A C-string. @return #xed_nonterminal_enum_t @ingroup ENUM

This converts strings to #xed_operand_action_enum_t types. @param s A C-string. @return #xed_operand_action_enum_t @ingroup ENUM

This converts strings to #xed_operand_convert_enum_t types. @param s A C-string. @return #xed_operand_convert_enum_t @ingroup ENUM

This converts strings to #xed_operand_element_type_enum_t types. @param s A C-string. @return #xed_operand_element_type_enum_t @ingroup ENUM

This converts strings to #xed_operand_element_xtype_enum_t types. @param s A C-string. @return #xed_operand_element_xtype_enum_t @ingroup ENUM

This converts strings to #xed_operand_enum_t types. @param s A C-string. @return #xed_operand_enum_t @ingroup ENUM

This converts strings to #xed_operand_type_enum_t types. @param s A C-string. @return #xed_operand_type_enum_t @ingroup ENUM

This converts strings to #xed_operand_visibility_enum_t types. @param s A C-string. @return #xed_operand_visibility_enum_t @ingroup ENUM

This converts strings to #xed_operand_width_enum_t types. @param s A C-string. @return #xed_operand_width_enum_t @ingroup ENUM

This converts strings to #xed_reg_class_enum_t types. @param s A C-string. @return #xed_reg_class_enum_t @ingroup ENUM

This converts strings to #xed_reg_enum_t types. @param s A C-string. @return #xed_reg_enum_t @ingroup ENUM

This converts strings to #xed_syntax_enum_t types. @param s A C-string. @return #xed_syntax_enum_t @ingroup ENUM

This converts strings to #xed_address_width_enum_t types. @param p An enumeration element of type xed_address_width_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_address_width_enum_t The last element of the enumeration. @ingroup ENUM

Using the registered callbacks, compute the memory address for a specified memop in a decoded instruction. memop_index can have the value 0 for XED_OPERAND_MEM0, XED_OPERAND_AGEN, or 1 for XED_OPERAND_MEM1. Any other value results in an error being returned. The context parameter which is passed to the registered callbacks can be used to identify which thread’s state is being referenced. The context parameter can also be used to specify which element of a vector register should be returned for gather an scatter operations. @ingroup AGEN

Initialize the callback functions. Tell XED what to call when using #xed_agen. @ingroup AGEN

@ingroup DEC Return the i’th global attribute in a linear sequence, independent of any instruction. This is used for scanning and printing all attributes.

This converts strings to #xed_attribute_enum_t types. @param p An enumeration element of type xed_attribute_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_attribute_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup DEC Return the maximum number of defined attributes, independent of any instruction.

This converts strings to #xed_category_enum_t types. @param p An enumeration element of type xed_category_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_category_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_chip_enum_t types. @param p An enumeration element of type xed_chip_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_chip_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup DEC True for AVX/AVX2 SIMD VEX-encoded operations. Does not include BMI/BMI2 instructions.

@ingroup DEC True for AVX512 (EVEX-encoded) SIMD and (VEX encoded) K-mask instructions

@ingroup DEC True for AVX512 (VEX-encoded) K-mask operations

@ingroup DEC True for SSE/SSE2/etc. SIMD operations. Includes AES and PCLMULQDQ

@ingroup ENCHL convert a #xed_encoder_instruction_t to a #xed_encoder_request_t for encoding

This converts strings to #xed_cpuid_bit_enum_t types. @param p An enumeration element of type xed_cpuid_bit_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_cpuid_bit_enum_t The last element of the enumeration. @ingroup ENUM

This is the main interface to the decoder. @param xedd the decoded instruction of type #xed_decoded_inst_t . Mode/state sent in via xedd; See the #xed_state_t @param itext the pointer to the array of instruction text bytes @param bytes the length of the itext input array. 1 to 15 bytes, anything more is ignored. @return #xed_error_enum_t indicating success (#XED_ERROR_NONE) or failure. Note failure can be due to not enough bytes in the input array.

@ingroup DEC See #xed_decode(). This version of the decode API adds a CPUID feature vector to support restricting decode based on both a specified chip via #xed_decoded_inst_set_input_chip() and a modify-able cpuid feature vector obtained from #xed_get_chip_features().

Returns the maximum number elements processed for an AVX512 vector instruction. Scalars report 1 element. @ingroup DEC

@ingroup DEC

@ingroup PRINT Print out all the information about the decoded instruction to the buffer buf whose length is maximally buflen. This is for debugging.

@ingroup PRINT Print the instruction information in a verbose format. This is for debugging. @param p a #xed_decoded_inst_t for a decoded instruction @param buf a buffer to write the disassembly in to. @param buflen maximum length of the disassembly buffer @param runtime_address the address of the instruction being disassembled. If zero, the offset is printed for relative branches. If nonzero, XED attempts to print the target address for relative branches. @return Returns 0 if the disassembly fails, 1 otherwise.

@ingroup DEC Returns 1 if the attribute is defined for this instruction.

@ingroup DEC Returns the attribute bitvector

@ingroup DEC

@ingroup DEC

@ingroup DEC Result in BYTES

@ingroup DEC Result in BITS

@ingroup DEC Return true if the first immediate (IMM0) is signed

@ingroup DEC Return the immediate width in BYTES.

@ingroup DEC Return the immediate width in BITS.

@ingroup DEC

@ingroup DEC

@ingroup DEC Result in BYTES

@ingroup DEC Result in BITS

returns bytes @ingroup DEC

@ingroup DEC Returns the modrm byte

@ingroup DEC Returns the number of legacy prefixes.

Returns the operand width in bits: 8/16/32/64. This is different than the #xed_operand_values_get_effective_operand_width() which only returns 16/32/64. This factors in the BYTEOP attribute when computing its return value. This function provides a information for that is only useful for (scalable) GPR-operations. Individual operands have more specific information available from #xed_decoded_inst_operand_element_size_bits() @ingroup DEC

@ingroup DEC Return the specified register operand. The specifier is of type #xed_operand_enum_t .

See the comment on xed_decoded_inst_uses_rflags(). This can return 0 if the flags are really not used by this instruction. @ingroup DEC

@ingroup DEC

@ingroup DEC

@ingroup DEC

@ingroup DEC

@ingroup DEC Returns 1 if the instruction has mpx prefix.

@ingroup DEC Return 1 for broadcast instructions or AVX512 load-op instructions using the broadcast feature 0 otherwise. Logical OR of #xed_decoded_inst_is_broadcast_instruction() and #xed_decoded_inst_uses_embedded_broadcast().

@ingroup DEC Return 1 for broadcast instruction. (NOT including AVX512 load-op instructions) 0 otherwise. Just a category check.

@ingroup DEC Returns true if the instruction is a prefetch

@ingroup DEC Returns 1 if the instruction is xacquire.

@ingroup DEC Returns 1 if the instruction is xrelease.

@ingroup DEC Returns 1 iff the instruction uses destination-masking. This is 0 for blend operations that use their mask field as a control.

Returns true if the instruction uses write-masking @ingroup DEC

@ingroup DEC

@ingroup DEC

@ingroup DEC

Returns true if the instruction uses write-masking with merging @ingroup DEC

@ingroup DEC

Interpret the operand action in light of AVX512 masking and zeroing/merging. If masking and merging are used together, the dest operand may also be read. If masking and merging are used together, the elemnents of dest operand register may be conditionally written (so that input values live on in the output register). @ingroup DEC

Return the size of an element in bits (for SSE and AVX operands) @ingroup DEC

Return the type of an element of type #xed_operand_element_type_enum_t (for SSE and AVX operands) @ingroup DEC

Return the number of element in the operand (for SSE and AVX operands) @ingroup DEC

Deprecated – returns the length in bytes of the operand_index’th operand. Use #xed_decoded_inst_operand_length_bits() instead. @ingroup DEC

Return the length in bits of the operand_index’th operand. @ingroup DEC

@ingroup DEC Set the branch displacement using a BYTE length

@ingroup DEC Set the branch displacement a BITS length

@ingroup DEC Set the signed immediate a BYTE length

@ingroup DEC Set the signed immediate a BITS length

@ingroup DEC Set the unsigned immediate a BYTE length

@ingroup DEC Set the unsigned immediate a BITS length

@ingroup DEC Set the memory displacement using a BYTE length

@ingroup DEC Set the memory displacement a BITS length

@ingroup DEC

@ingroup DEC Return 1 for AVX512 load-op instructions using the broadcast feature, 0 otherwise.

This returns 1 if the flags are read or written. This will return 0 otherwise. This will return 0 if the flags are really not used by this instruction. For some shifts/rotates, XED puts a flags operand in the operand array before it knows if the flags are used because of mode-dependent masking effects on the immediate. @ingroup DEC

Indicate if this decoded instruction is valid for the specified #xed_chip_enum_t chip @ingroup DEC

@ingroup DEC Returns 128, 256 or 512 for operations in the VEX, EVEX (or XOP) encoding space and returns 0 for (most) nonvector operations. This usually the content of the VEX.L or EVEX.LL field, reinterpreted. Some GPR instructions (like the BMI1/BMI2) are encoded in the VEX space and return non-zero values from this API.

@ingroup DEC Zero the decode structure completely. Re-initializes all operands.

@ingroup DEC Zero the decode structure, but preserve the existing machine state/mode information. Re-initializes all operands.

@ingroup DEC Zero the decode structure, but copy the existing machine state/mode information from the supplied operands pointer. Same as #xed_decoded_inst_zero_keep_mode.

@ingroup DEC Zero the decode structure, but set the machine state/mode information. Re-initializes all operands.

Returns true if the instruction uses write-masking with zeroing @ingroup DEC

This is the main interface to the encoder. The array should be at most 15 bytes long. The ilen parameter should indicate this length. If the array is too short, the encoder may fail to encode the request. Failure is indicated by a return value of type #xed_error_enum_t that is not equal to #XED_ERROR_NONE. Otherwise, #XED_ERROR_NONE is returned and the length of the encoded instruction is returned in olen.

This function will attempt to encode a NOP of exactly ilen bytes. If such a NOP is not encodeable, then false will be returned.

@ingroup ENC

@ingroup ENC

@ingroup ENC Retrieve the name of the n’th operand in the operand order.

@ingroup ENC Converts an decoder request to a valid encoder request.

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC Specify the name as the n’th operand in the operand order.

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC

@ingroup ENC same storage as uimm0

@ingroup ENC Set the uimm0 using a BYTE width.

@ingroup ENC Set the uimm0 using a BIT width.

@ingroup ENC

@ingroup ENC

@ingroup ENC clear the operand order array @param[in] p xed_encoder_request_t

@ingroup ENC

This converts strings to #xed_error_enum_t types. @param p An enumeration element of type xed_error_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_error_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_exception_enum_t types. @param p An enumeration element of type xed_exception_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_exception_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_extension_enum_t types. @param p An enumeration element of type xed_extension_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_extension_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup FLAGS returns true if the specified action is invalid. Only the 2nd flag might be invalid.

This converts strings to #xed_flag_action_enum_t types. @param p An enumeration element of type xed_flag_action_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_flag_action_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup FLAGS return the action

@ingroup FLAGS get the name of the flag

@ingroup FLAGS print the flag & actions

@ingroup FLAGS test to see if the specific action is a read

@ingroup FLAGS returns true if either action is a read

@ingroup FLAGS test to see if a specific action is a write

@ingroup FLAGS returns true if either action is a write

This converts strings to #xed_flag_enum_t types. @param p An enumeration element of type xed_flag_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_flag_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup FLAGS returns true if this object has a subset of the flags of the “other” object.

@ingroup FLAGS print the flag set in the supplied buffer

Disassemble the decoded instruction using the specified syntax. The output buffer must be at least 25 bytes long. Returns true if disassembly proceeded without errors. @param syntax a #xed_syntax_enum_t the specifies the disassembly format @param xedd a #xed_decoded_inst_t for a decoded instruction @param out_buffer a buffer to write the disassembly in to. @param buffer_len maximum length of the disassembly buffer @param runtime_instruction_address the address of the instruction being disassembled. If zero, the offset is printed for relative branches. If nonzero, XED attempts to print the target address for relative branches. @param context A void* used only for the call back routine for symbolic disassembly if one is provided. Can be zero. @param symbolic_callback A function pointer for obtaining symbolic disassembly. Can be zero. @return Returns 0 if the disassembly fails, 1 otherwise. @ingroup PRINT

@ingroup PRINT Disassemble the instruction information to a buffer. See the #xed_print_info_t for the required public fields of the argument. This is the preferred method of doing disassembly. The output buffer must be at least 25 bytes long. @param pi a #xed_print_info_t @return Returns 0 if the disassembly fails, 1 otherwise.

Optionally, customize the disassembly formatting options by passing in a #xed_format_options_t structure. @ingroup PRINT

fill in the contents of p with the vector of chip features.

@ingroup INIT Returns a copyright string.

Returns the name of the i’th cpuid bit associated with this isa-set. Call this repeatedly, with 0 <= i < XED_MAX_CPUID_BITS_PER_ISA_SET. Give up when i == XED_MAX_CPUID_BITS_PER_ISA_SET or the return value is XED_CPUID_BIT_INVALID.

This provides the details of the CPUID bit specification, if the enumeration value is not sufficient. Returns 1 on success and fills in the structure pointed to by p. Returns 0 on failure.

Returns the largest enclosing register for any kind of register; This is mostly useful for GPRs. (64b mode assumed) @ingroup REGINTFC

Returns the largest enclosing register for any kind of register; This is mostly useful for GPRs in 32b mode. @ingroup REGINTFC

Returns the width, in bits, of the named register. 32b mode @ingroup REGINTFC

Returns the width, in bits, of the named register. 64b mode. @ingroup REGINTFC

@ingroup INIT Returns a string representing XED svn commit revision and time stamp.

Returns the specific width GPR reg class (like XED_REG_CLASS_GPR32 or XED_REG_CLASS_GPR64) for a given GPR register. Or XED_REG_INVALID if not a GPR. @ingroup REGINTFC

This converts strings to #xed_iclass_enum_t types. @param p An enumeration element of type xed_iclass_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_iclass_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_iform_enum_t types. @param p An enumeration element of type xed_iform_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_iform_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup IFORM Return the first of the iforms for a particular iclass. This function returns valid data as soon as global data is initialized. (This function does not require a decoded instruction as input).

@ingroup IFORM Map the #xed_iform_enum_t to a pointer to a #xed_iform_info_t which indicates the #xed_iclass_enum_t, the #xed_category_enum_t and the #xed_extension_enum_t for the iform. Returns 0 if the iform is not a valid iform.

@ingroup IFORM Return the maximum number of iforms for a particular iclass. This function returns valid data as soon as global data is initialized. (This function does not require a decoded instruction as input).

@ingroup IFORM Return the category for a given iform. This function returns valid data as soon as global data is initialized. (This function does not require a decoded instruction as input).

@ingroup IFORM Return the extension for a given iform. This function returns valid data as soon as global data is initialized. (This function does not require a decoded instruction as input).

@ingroup IFORM Return a pointer to a character string of the iclass. This translates the internal disambiguated names to the more ambiguous names that people like to see. This returns the ATT SYSV-syntax name.

@ingroup IFORM Return a pointer to a character string of the iclass. This translates the internal disambiguated names to the more ambiguous names that people like to see. This returns the Intel-syntax name.

@ingroup IFORM Return the isa_set for a given iform. This function returns valid data as soon as global data is initialized. (This function does not require a decoded instruction as input).

Returns the last element of the enumeration @return xed_iformfl_enum_t The last element of the enumeration. @ingroup ENUM

This function just does instruction length decoding. It does not return a fully decoded instruction. @param xedd the decoded instruction of type #xed_decoded_inst_t . Mode/state sent in via xedd; See the #xed_state_t . @param itext the pointer to the array of instruction text bytes @param bytes the length of the itext input array. 1 to 15 bytes, anything more is ignored. @return #xed_error_enum_t indicating success (#XED_ERROR_NONE) or failure. Only two failure codes are valid for this function: #XED_ERROR_BUFFER_TOO_SHORT and #XED_ERROR_GENERAL_ERROR. In general this function cannot tell if the instruction is valid or not. For valid instructions, XED can figure out if enough bytes were provided to decode the instruction. If not enough were provided, XED returns #XED_ERROR_BUFFER_TOO_SHORT. From this function, the #XED_ERROR_GENERAL_ERROR is an indication that XED could not decode the instruction’s length because the instruction was so invalid that even its length may across implmentations.

@ingroup PRINT

@ingroup DEC xed_inst_cpl() is DEPRECATED. Please use “xed_decoded_inst_get_attribute(xedd, XED_ATTRIBUTE_RING0)” instead. Return the current privilege level (CPL) required for execution, 0 or 3. If the value is zero, then the instruction can only execute in ring 0.

@ingroup DEC Scan for the attribute attr and return 1 if it is found, 0 otherwise.

@ingroup DEC Return the attributes bit vector

@ingroup DEC Obtain a pointer to an individual operand

@ingroup DEC Return the base of instruction table.

This converts strings to #xed_isa_set_enum_t types. @param p An enumeration element of type xed_isa_set_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_isa_set_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup ISASET return 1 if the isa_set is part included in the specified chip, 0 otherwise.

defaults to lowercase

defaults to lowercase

This converts strings to #xed_machine_mode_enum_t types. @param p An enumeration element of type xed_machine_mode_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_machine_mode_enum_t The last element of the enumeration. @ingroup ENUM

present = 1 to turn the feature on. present=0 to remove the feature.

This converts strings to #xed_nonterminal_enum_t types. @param p An enumeration element of type xed_nonterminal_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_nonterminal_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup DEC Take an #xed_iclass_enum_t value for an instruction with a REP/REPNE/REPE prefix and return the corresponding #xed_iclass_enum_t without that prefix. If the input instruction does not have a REP/REPNE/REPE prefix, this function returns XED_ICLASS_INVALID.

This converts strings to #xed_operand_action_enum_t types. @param p An enumeration element of type xed_operand_action_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_action_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup DEC If the operand has a conditional read (may also write)

@ingroup DEC If the operand has a conditional write (may also read)

This converts strings to #xed_operand_convert_enum_t types. @param p An enumeration element of type xed_operand_convert_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_convert_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_operand_element_type_enum_t types. @param p An enumeration element of type xed_operand_element_type_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_element_type_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_operand_element_xtype_enum_t types. @param p An enumeration element of type xed_operand_element_xtype_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_element_xtype_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_operand_enum_t types. @param p An enumeration element of type xed_operand_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup DEC Print the operand p into the buffer buf, of length buflen. @param p an operand template, #xed_operand_t. @param buf buffer that gets filled in @param buflen maximum buffer length

@ingroup DEC If the operand is read, including conditional reads

@ingroup DEC If the operand is read-and-written, conditional reads and conditional writes

@ingroup DEC If the operand is read-only, including conditional reads

This converts strings to #xed_operand_type_enum_t types. @param p An enumeration element of type xed_operand_type_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_type_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup OPERANDS

@ingroup OPERANDS Returns true if 0x2E prefix on Jcc

@ingroup OPERANDS Returns true if 0x3E prefix on Jcc

@ingroup OPERANDS Returns true for indirect call/jmp with 0x3E prefix (if the legacy prefix rules are obeyed)

@ingroup OPERANDS DO NOT USE - DEPRECATED. The correct way to do remove a rep prefix is by changing the iclass

@ingroup OPERANDS Dump all the information about the operands to buf.

@ingroup OPERANDS Returns true if the memory operation has atomic read-modify-write semantics. An XCHG accessing memory is atomic with or without a LOCK prefix.

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS Return the branch displacement width in bytes

@ingroup OPERANDS Return the branch displacement width in bits

@ingroup OPERANDS Deprecated. Compatibility function for XED0. See has_memory_displacement().

@ingroup OPERANDS Returns The effective address width in bits: 16/32/64.

@ingroup OPERANDS Returns The effective operand width in bits: 16/32/64. Note this is not the same as the width of the operand which can vary! For 8 bit operations, the effective operand width is the machine mode’s default width. If you also want to identify byte operations use the higher level function #xed_decoded_inst_get_operand_width() .

@ingroup OPERANDS

@ingroup OPERANDS Return the i’th byte of the immediate

@ingroup OPERANDS

@ingroup OPERANDS Return true if the first immediate (IMM0) is signed

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

Returns the potentially scaled value of the memory displacement. Certain AVX512 memory displacements are scaled before they are used. @ingroup OPERANDS

Returns the unscaled (raw) memory displacement. Certain AVX512 memory displacements are scaled before they are used. @ingroup OPERANDS

@ingroup OPERANDS Return the memory displacement width in BYTES

@ingroup OPERANDS Return the memory displacement width in BITS

@ingroup OPERANDS Return the raw memory displacement width in BITS(ignores scaling)

return bytes @ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS Returns The stack address width in bits: 16/32/64.

@ingroup OPERANDS This includes any 66 prefix that shows up even if it is ignored.

@ingroup OPERANDS This indicates the presence of a 67 prefix.

@ingroup OPERANDS True if there is a branch displacement

@ingroup OPERANDS ALIAS for has_displacement(). Deprecated. See has_memory_displacement() and has_branch_displacement().

@ingroup OPERANDS True if there is a memory or branch displacement

@ingroup OPERANDS Return true if there is an immediate operand

@ingroup OPERANDS Returns true if the memory operation has a valid lock prefix.

@ingroup OPERANDS True if there is a memory displacement

@ingroup OPERANDS Returns true if the instruction has a MODRM byte.

@ingroup OPERANDS This does not include the cases when the 66 prefix is used an opcode-refining prefix for multibyte opcodes.

@ingroup OPERANDS True if the instruction has a real REP prefix. This returns false if there is no F2/F3 prefix or the F2/F3 prefix is used to refine the opcode as in some SSE operations.

@ingroup OPERANDS True if the instruction as a F3 REP prefix (used for opcode refining, for rep for string operations, or ignored).

@ingroup OPERANDS True if the instruction as a F2 REP prefix (used for opcode refining, for rep for string operations, or ignored).

@ingroup OPERANDS This instruction has a REX prefix with the W bit set.

@ingroup OPERANDS

@ingroup OPERANDS Returns true if the instruction has a SIB byte.

@ingroup OPERANDS Initializes operand structure

@ingroup OPERANDS Initializes dst operand structure but preserves the existing MODE/SMODE values from the src operand structure.

@ingroup OPERANDS Initializes the operand storage and sets mode values.

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS Returns true if the instruction could be re-encoded to have a lock prefix but does not have one currently.

@ingroup OPERANDS Returns true if the instruction access memory but without using a MODRM byte limiting its addressing modes.

@ingroup OPERANDS

@ingroup OPERANDS More tersely dump all the information about the operands to buf.

@ingroup OPERANDS Return the segment prefix, if any, as a #xed_reg_enum_t value.

@ingroup OPERANDS

@ingroup OPERANDS Set the branch displacement using a BYTES length

@ingroup OPERANDS Set the branch displacement using a BITS length

@ingroup OPERANDS width is bits 16, 32, 64

@ingroup OPERANDS width is bits 8, 16, 32, 64

@ingroup OPERANDS

@ingroup OPERANDS Set the signed immediate using a BYTES length

@ingroup OPERANDS Set the signed immediate using a BITS length

@ingroup OPERANDS Set the unsigned immediate using a BYTE length.

@ingroup OPERANDS Set the unsigned immediate using a BIT length.

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS Set the memory displacement using a BYTES length

@ingroup OPERANDS Set the memory displacement using a BITS length

takes bytes, not bits, as an argument @ingroup OPERANDS

@ingroup OPERANDS Set the mode values

@ingroup OPERANDS Set the operand storage field entry named ‘operand_name’ to the register value specified by ‘reg_name’.

@ingroup OPERANDS Indicate that we have a relative branch.

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS Indicates if the default segment is being used. @param[in] p the pointer to the #xed_operand_values_t structure. @param[in] i 0 or 1, indicating which memory operation. @return true if the memory operation is using the default segment for the associated addressing mode base register.

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

@ingroup OPERANDS

This converts strings to #xed_operand_visibility_enum_t types. @param p An enumeration element of type xed_operand_visibility_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_visibility_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup DEC @param p an operand template, #xed_operand_t. @param eosz effective operand size of the instruction, 1 | 2 | 3 for 16 | 32 | 64 bits respectively. 0 is invalid. @return the actual width of operand in bits. See xed_decoded_inst_operand_length_bits() for a more general solution.

This converts strings to #xed_operand_width_enum_t types. @param p An enumeration element of type xed_operand_width_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_operand_width_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup DEC If the operand is written, including conditional writes

@ingroup DEC If the operand is written-only, including conditional writes

Replace a memory displacement. The widths of original displacement and replacement must match. @param xedd A decoded instruction. @param itext The corresponding encoder output, byte array. @param disp A xed_enc_displacement_t object describing the new displacement. @returns xed_bool_t 1=success, 0=failure @ingroup ENCHLPATCH

Replace an imm0 immediate value. The widths of original immediate and replacement must match. @param xedd A decoded instruction. @param itext The corresponding encoder output, byte array. @param imm0 A xed_encoder_operand_t object describing the new immediate. @returns xed_bool_t 1=success, 0=failure @ingroup ENCHLPATCH

Replace a branch displacement. The widths of original displacement and replacement must match. @param xedd A decoded instruction. @param itext The corresponding encoder output, byte array. @param disp A xed_encoder_operand_t object describing the new displacement. @returns xed_bool_t 1=success, 0=failure @ingroup ENCHLPATCH

Returns the register class of the given input register. @ingroup REGINTFC

This converts strings to #xed_reg_class_enum_t types. @param p An enumeration element of type xed_reg_class_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_reg_class_enum_t The last element of the enumeration. @ingroup ENUM

This converts strings to #xed_reg_enum_t types. @param p An enumeration element of type xed_reg_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_reg_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup INIT This is for registering a function to be called during XED’s assert processing. If you do not register an abort function, then the system’s abort function will be called. If your supplied function returns, then abort() will still be called.

@ingroup DEC Take an #xed_iclass_enum_t value without a REP prefix and return the corresponding #xed_iclass_enum_t with a REP prefix. If the input instruction cannot have a REP prefix, this function returns XED_ICLASS_INVALID.

@ingroup DEC Take an instruction with a REP/REPE/REPNE prefix and return the corresponding xed_iclass_enum_t without that prefix. The return value differs from the other functions in this group: If the input iclass does not have REP/REPNE/REPE prefix, the function returns the original instruction.

@ingroup DEC Take an #xed_iclass_enum_t value without a REPE prefix and return the corresponding #xed_iclass_enum_t with a REPE prefix. If the input instruction cannot have have a REPE prefix, this function returns XED_ICLASS_INVALID.

@ingroup DEC Take an #xed_iclass_enum_t value without a REPNE prefix and return the corresponding #xed_iclass_enum_t with a REPNE prefix. If the input instruction cannot have a REPNE prefix, this function returns XED_ICLASS_INVALID.

Set the FILE* for XED’s log msgs. This takes a FILE* as a void* because some software defines their own FILE* types creating conflicts.

Set the verbosity level for XED

returns the number of bytes required to store the SIGNED number x given a mask of legal lengths. For the legal_widths argument, bit 0 implies 1 byte is a legal return width, bit 1 implies that 2 bytes is a legal return width, bit 2 implies that 4 bytes is a legal return width. This returns 8 (indicating 8B) if none of the provided legal widths applies.

returns the number of bytes required to store the UNSIGNED number x given a mask of legal lengths. For the legal_widths argument, bit 0 implies 1 byte is a legal return width, bit 1 implies that 2 bytes is a legal return width, bit 2 implies that 4 bytes is a legal return width. This returns 8 (indicating 8B) if none of the provided legal widths applies.

arbitrary sign extension from a qty of “bits” length to 32b

arbitrary sign extension from a qty of “bits” length to 64b

@ingroup FLAGS return the specific flag-action. Very detailed low level information

@ingroup FLAGS Indicates the flags are only conditionally written. Usually MAY-writes of the flags instructions that are dependent on a REP count.

@ingroup FLAGS the flags always written

@ingroup FLAGS returns the number of flag-actions

@ingroup FLAGS return union of bits for read flags

@ingroup FLAGS return union of bits for undefined flags

@ingroup FLAGS return union of bits for written flags

@ingroup FLAGS print the flags

@ingroup FLAGS boolean test to see if flags are read, scans the flags

@ingroup FLAGS boolean test to see if flags are written, scans the flags

@ingroup INIT

returns the number of bytes remaining for the next use of #xed_strncpy() or #xed_strncat() .

returns the number of bytes remaining for the next use of #xed_strncpy() or #xed_strncat() .

This converts strings to #xed_syntax_enum_t types. @param p An enumeration element of type xed_syntax_enum_t. @return string @ingroup ENUM

Returns the last element of the enumeration @return xed_syntax_enum_t The last element of the enumeration. @ingroup ENUM

@ingroup INIT This is the call to initialize the XED encode and decode tables. It must be called once before using XED.

Type Definitions

@ingroup DEC The main container for instructions. After decode, it holds an array of operands with derived information from decode and also valid #xed_inst_t pointer which describes the operand templates and the operand order. See @ref DEC for API documentation.

@param address The input address for which we want symbolic name and offset @param symbol_buffer A buffer to hold the symbol name. The callback function should fill this in and terminate with a null byte. @param buffer_length The maximum length of the symbol_buffer including then null @param offset A pointer to a xed_uint64_t to hold the offset from the provided symbol. @param context This void* pointer passed to the disassembler’s new interface so that the caller can identify the proper context against which to resolve the symbols. The disassembler passes this value to the callback. The legacy formatters that do not have context will pass zero for this parameter. @return 0 on failure, 1 on success.

@ingroup ENC

@ingroup ENC

@ingroup FLAGS Associated with each flag field there can be one action.

@ingroup IFORM Statically available information about iforms. Values are returned by #xed_iform_map().

@ingroup DEC constant information about a decoded instruction form, including the pointer to the constant operand properties #xed_operand_t for this instruction form.

@ingroup DEC Constant information about an individual generic operand, like an operand template, describing the operand properties. See @ref DEC for API information.

A function for obtaining register values. 32b return values should be zero extended to 64b. The error value is set to nonzero if the callback experiences some sort of problem. @ingroup AGEN

A function for obtaining the segment base values. 32b return values should be zero extended zero extended to 64b. The error value is set to nonzero if the callback experiences some sort of problem. @ingroup AGEN

@ingroup FLAGS A collection of #xed_flag_action_t’s and unions of read and written flags

Encapsulates machine modes for decoder/encoder requests. It specifies the machine operating mode as a #xed_machine_mode_enum_t for decoding and encoding. The machine mode corresponds to the default data operand width for that mode. For all modes other than the 64b long mode (XED_MACHINE_MODE_LONG_64), a default addressing width, and a stack addressing width must be supplied of type #xed_address_width_enum_t . @ingroup INIT

Unions