Keeps basic description of the operand or pseudooperand of the 80x86 command. Part of the structure t_cmdinfo. Filled by Cmdinfo().
typedef struct t_opinfo { // Operand in t_cmdinfo
ulong features; // Operand features, set of OP_xxx
ulong arg; // Operand type, set of B_xxx
int opsize; // Total size of data, bytes
int reg; // REG_xxx (also ESP in POP) or REG_UNDEF
int seg; // Selector (SEG_xxx)
uchar scale[NREG]; // Scales of registers in memory address
ulong opconst; // Constant or const part of address
} t_opinfo;
Members:
features
Features of the operand as a combination of zero or more of the following flags. If features is 0, operand is unavailable:
Location of the operand, only one is allowed:
OP_REGISTER - operand is a general-purpose register reg (EAX, CX, BH etc.)
OP_SEGREG - operand is a segment register reg (ES, CS, SS, DS, FS or GS)
OP_FPUREG - operand is a FPU register reg (ST0 .. ST7)
OP_MMXREG - operand is a MMX register reg (MM0 .. MM7)
OP_3DNOWREG - operand is a 3DNow! register reg (MM0 .. MM7)
OP_SSEREG - operand is a SSE register reg (XMM0 .. XMM7)
OP_CREG - operand is a control register reg (CR0 .. CR7)
OP_DREG - operand is a debug register reg (DR0 .. DR7)
OP_MEMORY - operand is in memory (seg, scale/aregs, opconst)
OP_CONST - operand is an immediate opconst
OP_PORT - operand is an I/O port
Additional operand properties:
OP_INVALID - invalid operand, like register where only memory is allowed
OP_PSEUDO - pseudooperand (missing in mnenonics, like ESP in PUSH EAX or EAX and EDX in CDQ)
OP_MODREG - operand describes memory but as a side effect changes reg (like ESP by POP EAX or ESI/EDI by MOVSB)
OP_REL - operand is either offset to the IP (like in relative jumps) or includes fixuped opconst
OP_SELECTOR - operand includes immediate selector (JMP FAR xxxx:yyyyyyyy)
Additional properties of memory address:
OP_INDEXED - memory address contains registers (scale/aregs)
OP_OPCONST - memory address contains opconst
OP_ADDR16 - 16-bit memory address
arg
Location of the operand, only one is allowed:
OP_REGISTER - operand is a general-purpose register reg (EAX, CX, BH etc.)
OP_SEGREG - operand is a segment register reg (ES, CS, SS, DS, FS or GS)
OP_FPUREG - operand is a FPU register reg (ST0 .. ST7)
OP_MMXREG - operand is a MMX register reg (MM0 .. MM7)
OP_3DNOWREG - operand is a 3DNow! register reg (MM0 .. MM7)
OP_SSEREG - operand is a SSE register reg (XMM0 .. XMM7)
OP_CREG - operand is a control register reg (CR0 .. CR7)
OP_DREG - operand is a debug register reg (DR0 .. DR7)
OP_MEMORY - operand is in memory (seg, scale/aregs, opconst)
OP_CONST - operand is an immediate opconst
OP_PORT - operand is an I/O port
Additional operand properties:
OP_INVALID - invalid operand, like register where only memory is allowed
OP_PSEUDO - pseudooperand (missing in mnenonics, like ESP in PUSH EAX or EAX and EDX in CDQ)
OP_MODREG - operand describes memory but as a side effect changes reg (like ESP by POP EAX or ESI/EDI by MOVSB)
OP_REL - operand is either offset to the IP (like in relative jumps) or includes fixuped opconst
OP_SELECTOR - operand includes immediate selector (JMP FAR xxxx:yyyyyyyy)
Additional properties of memory address:
OP_INDEXED - memory address contains registers (scale/aregs)
OP_OPCONST - memory address contains opconst
OP_ADDR16 - 16-bit memory address
Type of the operand as a combination of flags B_xxx
hiliteindex
Input
parameter, index of command highlighting scheme
opsize
Total size of the operand, bytes
reg
If operand specifies a register (like EAX, ST0 or DR7), index of this register. If operand is OP_MEMORY but as a side effect modifies general purpose register (OP_MODREG), index of this register. Otherwise, REG_UNDEF.
For example, MOVSD has two memory (pseudo)operands: [ESI] and [ES:EDI].
First operand modifies ESI and second - EDI. POP EAX has two
operands: EAX and [ESP]. Second operand modifies ESP.
seg
Index of the segment register explicitly or implicitly specified in the memory address, or SEG_UNDEF if there is no associated segment register. Note that OP_SEGREGs are specified in reg and set seg to SEG_UNDEF
scale
Scale
factors of general purpose registers that form memory address. If
operand is EAX, all scales are 0 because this is not a memory address.
If operand is [123456], all scales are also 0 because address does not
include any registers. For [EAX+4*EDI+123456], scale[REG_EAX] is set to 1, scale[REG_EDI] is 4 and all other scales are 0
opconst
If operand is of type OP_CONST, contains immediate constant. If operand is OP_MEMORY,
immediate part of address. Note that in the command PUSH EAX register
ESP is predecremented and data will be saved to the
pseudooperand [ESP-4]. In this cas opconst is set to -4
See also: