IDA C++ SDK 9.2
Loading...
Searching...
No Matches
op_t Class Reference

Operand of an instruction. More...

#include <ua.hpp>

Public Member Functions

void set_shown ()
 Set operand to be shown.
void clr_shown ()
 Set operand to hidden.
bool shown () const
 Is operand set to be shown?
bool is_reg (int r) const
 Is register operand?
bool is_imm (uval_t v) const
 Is immediate operand?
 op_t ()

Public Attributes

uchar n = 0
 Number of operand (0,1,2).
optype_t type = o_void
 Type of operand (see Operand types)
char offb = 0
 Offset of operand value from the instruction start (0 means unknown).
char offo = 0
 Same as offb (some operands have 2 numeric values used to form an operand).
uchar flags = 0
 Operand flags
op_dtype_t dtype = 0
 Type of operand value (see Operand value types).
union { 
   uint16   reg 
 number of register (o_reg) More...
   uint16   phrase 
 number of register phrase (o_phrase,o_displ). More...
}; 
union { 
   uval_t   value 
 operand value (o_imm) or outer displacement (o_displ+#OF_OUTER_DISP). More...
   struct { 
      uint16   low 
      uint16   high 
   }   value_shorts
 This structure is defined for your convenience only. More...
}; 
union { 
   ea_t   addr 
 virtual address pointed or used by the operand. More...
   struct { 
      uint16   low 
      uint16   high 
   }   addr_shorts
 This structure is defined for your convenience only. More...
}; 
union { 
   ea_t   specval 
 This field may be used as you want. More...
   struct { 
      uint16   low 
 IBM PC: segment register number (o_mem,o_far,o_near) More...
      uint16   high 
 IBM PC: segment selector value (o_mem,o_far,o_near) More...
   }   specval_shorts
 This structure is defined for your convenience only. More...
}; 
Special flags

The following fields are used only in idp modules.

You may use them as you want to store additional information about the operand.

char specflag1 = 0
char specflag2 = 0
char specflag3 = 0
char specflag4 = 0

Detailed Description

Operand of an instruction.

This structure is filled by the analyzer. Upon entrance to the analyzer, some fields of this structure are initialized:

Constructor & Destructor Documentation

◆ op_t()

op_t::op_t ( )
inline

Member Function Documentation

◆ set_shown()

void op_t::set_shown ( )
inline

Set operand to be shown.

◆ clr_shown()

void op_t::clr_shown ( )
inline

Set operand to hidden.

◆ shown()

bool op_t::shown ( ) const
inline

Is operand set to be shown?

◆ is_reg()

bool op_t::is_reg ( int r) const
inline

Is register operand?

◆ is_imm()

bool op_t::is_imm ( uval_t v) const
inline

Is immediate operand?

Member Data Documentation

◆ n

uchar op_t::n = 0

Number of operand (0,1,2).

Initialized once at the start of work. You have no right to change its value.

◆ type

optype_t op_t::type = o_void

Type of operand (see Operand types)

◆ offb

char op_t::offb = 0

Offset of operand value from the instruction start (0 means unknown).

Of course this field is meaningful only for certain types of operands. Leave it equal to zero if the operand has no offset. This offset should point to the 'interesting' part of operand. For example, it may point to the address of a function in

call func 

or it may point to bytes holding '5' in

mov  ax, [bx+5] 

Usually bytes pointed to this offset are relocated (have fixup information).

◆ offo

char op_t::offo = 0

Same as offb (some operands have 2 numeric values used to form an operand).

This field is used for the second part of operand if it exists. Currently this field is used only for outer offsets of Motorola processors. Leave it equal to zero if the operand has no offset.

◆ flags

uchar op_t::flags = 0

◆ dtype

op_dtype_t op_t::dtype = 0

Type of operand value (see Operand value types).

This is the type of the operand itself, not the size of the addressing mode. for example, byte ptr [epb+32_bit_offset] will have the #dt_byte type.

◆ reg

uint16 op_t::reg

number of register (o_reg)

◆ phrase

uint16 op_t::phrase

number of register phrase (o_phrase,o_displ).

you yourself define numbers of phrases as you like

◆ [union]

union { ... } op_t

◆ value

uval_t op_t::value

operand value (o_imm) or outer displacement (o_displ+#OF_OUTER_DISP).

integer values should be in IDA's (little-endian) order. when using ieee_realcvt(), floating point values should be in the processor's native byte order. #dt_double and #dt_qword values take up 8 bytes (value and addr fields for 32-bit modules). NB: in case a #dt_dword/#dt_qword immediate is forced to float by user, the kernel converts it to processor's native order before calling FP conversion routines.

◆ low

uint16 op_t::low

IBM PC: segment register number (o_mem,o_far,o_near)

◆ high

uint16 op_t::high

IBM PC: segment selector value (o_mem,o_far,o_near)

◆ [struct]

struct { ... } op_t::value_shorts

This structure is defined for your convenience only.

◆ [union]

union { ... } op_t

◆ addr

ea_t op_t::addr

virtual address pointed or used by the operand.

(o_mem,o_displ,o_far,o_near)

◆ [struct]

struct { ... } op_t::addr_shorts

This structure is defined for your convenience only.

◆ [union]

union { ... } op_t

◆ specval

ea_t op_t::specval

This field may be used as you want.

◆ [struct]

struct { ... } op_t::specval_shorts

This structure is defined for your convenience only.

◆ [union]

union { ... } op_t

◆ specflag1

char op_t::specflag1 = 0

◆ specflag2

char op_t::specflag2 = 0

◆ specflag3

char op_t::specflag3 = 0

◆ specflag4

char op_t::specflag4 = 0

The documentation for this class was generated from the following file: