AED_X86_INSTRUCTION_WALK(3) Library Functions Manual AED_X86_INSTRUCTION_WALK(3)

AED_x86_instruction_walkaed x86 instruction functions

/* -laed */
#include <aed/x86.h>

void
AED_x86_instruction_walk(void (*callback)(const AED_x86_instruction_info *, void *), void *opaque);

The () function iterates over all instructions supported by both aed_x86_decoder(3) and aed_x86_encoder(3). It is intended to be used to obtain information about instructions that is independent of their encoding. The callback is invoked for every such instruction and the opaque argument is passed as is.

The definition of the AED_x86_instruction_info structure is as follows:

typedef struct AED_x86_instruction_info {
	uint8_t map;
	uint8_t op;
	uint8_t mode;
	uint64_t selector;
	AED_x86_category category;

	struct {
		const char *s;
		AED_x86_mnemonic i;
	} mnemonic;

	struct {
		AED_x86_isa_group group;
	} isa;

	struct {
		const AED_x86_explicit_operand o[];
		uint8_t n;
	} operands;

	struct {
		const AED_x86_implicit_operand o[];
		uint8_t n;
	} implicit_operands;

	struct {
		uint32_t r;
		uint32_t w;
	} flags;

	struct {
		const char *field;
		size_t offset;
	} assembler;
} AED_x86_instruction_info;
map
Instruction map number.
op
Instruction opcode.
mode
Bitmask of operating modes supported by the instruction.

Instruction supported in 64-bit mode.
Instruction supported in 32-bit mode.
Instruction supported in 16-bit mode.
selector
Bitmask of criteria that must be fulfilled in order to decode the instruction.

Non-zero opmask register required in EVEX.AAA.
Mandatory broadcast required in EVEX.B.
Mandatory EVEX prefix.
(E)VEX.LL must be equal to 0.
(E)VEX.LL must be equal to 1.
EVEX.LL must be equal to 2.
REX2 is not allowed.
Mandatory VEX prefix.
category
Bitmask of instruction categories.

Call instruction.
Call instruction.
Load address instruction.
mnemonic.s
Lowercase string representation of the mnemonic, such as "add".
mnemonic.i
Numeric representation of the instruction mnemonic, such as AED_X86_ADD.
isa.group
Instruction Set Architecture (ISA) group the instruction belongs in:

,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
 
operands
Operands of the instruction. The o field points to an array of n AED_x86_explicit_operand structures, which are defined as follows:
typedef struct AED_x86_explicit_operand {
	uint64_t type;
	uint8_t size;
	uint8_t r;
	uint8_t w;
} AED_x86_explicit_operand;
type
Bitmask of possible operand types. If the instruction information is obtained using (), only one bit will be set denoting the type of the decoded operand.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
size
Operand size, considered defined if not equal to AED_X86_OS_0. If the instruction information is obtained using (), this field is defined. If the instruction information is obtained using AED_x86_instruction_walk(), it is only defined if the size is independent of the encoding and operating mode.

 
 
 
 
 
 
 
 
r
Non-zero if the operand is read.
w
Non-zero if the operand is written.
implicit_operands
Implicit operands of the instruction. The o field points to an array of n AED_x86_implicit_operand structures, which are defined as follows:
typedef struct AED_x86_implicit_operand {
	uint8_t type;
	uint8_t reg;
	uint8_t r;
	uint8_t w;
} AED_x86_implicit_operand;
type
Either AED_X86_IMPLICIT_OPERAND_GPR, AED_X86_IMPLICIT_OPERAND_IMM, AED_X86_IMPLICIT_OPERAND_XMM or AED_X86_IMPLICIT_OPERAND_FLAGS.
reg
Register number, only applicable to AED_X86_IMPLICIT_OPERAND_GPR and AED_X86_IMPLICIT_OPERAND_XMM.
r
Non-zero if the implicit operand is read.
w
Non-zero if the implicit operand is written.
flags.r flags.w
Bitmask of read and written fields in the flags register:

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assembler
Denotes how the instruction can be encoded using the AED_x86_assembler structure as part of aed_x86_encoder(3). If the instruction cannot be encoded, all fields will be zero.
field
Name of corresponding function pointer field in AED_x86_assembler used to encode the instruction.
offset
Offset of the corresponding function pointer field in AED_x86_assembler used to encode the instruction.

aed_x86_decoder(3), aed_x86_encoder(3), aed_x86_serializer(3)

Anton Lindqvist <anton@basename.se>

OpenBSD 8.0 May 10, 2026 AED_X86_INSTRUCTION_WALK(3)