microprobe.target.isa.operand.OperandConst

class OperandConst(name, descr, value, aim=False, arel=False)[source]

Bases: Operand

Class to represent a constant operand.

__init__(name, descr, value, aim=False, arel=False)[source]
Parameters:
  • name

  • descr

  • value

Methods

__init__(name, descr, value[, aim, arel])

param name:

access(dummy)

param dummy:

check(value)

Check if a value is valid for the operand.

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).

min

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

representation(value)[source]
Parameters:

value

codification(value)[source]
Parameters:

value

random_value()[source]

Return a random possible value for the operand.

Return type:

:int

property shift
property min
access(dummy)[source]
Parameters:

dummy

set_valid_values(values)[source]
Parameters:

values

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)

Check if a value is valid for the operand.

Parameters:

value (str, Register or int) – value of the operand.

Raises:

microprobe.exceptions.MicroprobeValueError – if the value is not allowed for the operand

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).