microprobe.target.isa.operand.InstructionAddressRelativeOperand

class InstructionAddressRelativeOperand(name, descr, maxdispl, mindispl, shift, except_range, relative, step)[source]

Bases: Operand

Class to represent a relative instruction address operand.

Relative instruction address operands are used for immediates operands used to compute relative distance between the current instruction and the target. Examples are : branch relative, or load address relative.

__init__(name, descr, maxdispl, mindispl, shift, except_range, relative, step)[source]

Create a InstructionAddressRelativeOperand object.

Parameters:
  • name (str) – Operand name

  • descr (str) – Operand description

  • maxdispl (:int) – Maximum displacement allowed

  • mindispl (:int) – Minimum displacement allowed

  • shift (:int) – Number of shifted bits

  • except_range (list of tuple() with int) – list of forbidden ranges for displacement. Ranges are represented using (lower_bound, upper_bound)

Return type:

InstructionAddressRelativeOperand

Methods

__init__(name, descr, maxdispl, mindispl, ...)

Create a InstructionAddressRelativeOperand object.

access(dummy)

param dummy:

check(value)

param value:

codification(value)

param value:

copy()

Return a copy of the operand.

random_value()

Return a random possible value for the operand.

representation(value)

param value:

set_valid_values(values)

param values:

values()

Return the possible value of the operand.

Attributes

address_absolute

Operand is for generating absolute addresses (bool).

address_base

Operand is the base register for an address (bool).

address_immediate

Operand is an immediate of an address (bool).

address_index

Operand is the index register for an address (bool).

address_relative

Operand is for generating relative addresses (bool).

constant

Operand is constant (bool).

description

Operand description (str).

float

Operand is float (bool).

immediate

Operand is immediate (bool).

name

Operand name (str).

shift

vector

Operand is vector (bool).




copy()[source]

Return a copy of the operand.

values()[source]

Return the possible value of the operand.

Return type:

list of :int

random_value()[source]

Return a random possible value for the operand.

Return type:

:int

representation(value)[source]
Parameters:

value

property address_absolute

Operand is for generating absolute addresses (bool).

property address_base

Operand is the base register for an address (bool).

property address_immediate

Operand is an immediate of an address (bool).

property address_index

Operand is the index register for an address (bool).

property address_relative

Operand is for generating relative addresses (bool).

check(value)[source]
Parameters:

value

property constant

Operand is constant (bool).

property description

Operand description (str).

property float

Operand is float (bool).

property immediate

Operand is immediate (bool).

property name

Operand name (str).

property vector

Operand is vector (bool).

codification(value)[source]
Parameters:

value

property shift
access(dummy)[source]
Parameters:

dummy

set_valid_values(values)[source]
Parameters:

values