microprobe.target.isa.operand.Operand

class Operand(name, descr)[source]

Bases: object

This represents a machine instruction operand

abstract __init__(name, descr)[source]
Parameters
  • name

  • descr

Methods

__init__(name, descr)

param name

access(value)

param value

check(value)

Check if a value is valid for the operand.

codification(value)

Return the binary codification of the operand.

copy()

Return a copy of the operand.

random_value()

Return a random possible value for the operand.

representation(value)

Return the string representation of the operand.

set_valid_values(values)

Sets the set of valid value for the operand.

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

vector

Operand is vector (bool).




property name

Operand name (str).

property description

Operand description (str).

property address_relative

Operand is for generating relative addresses (bool).

property address_absolute

Operand is for generating absolute addresses (bool).

property address_immediate

Operand is an immediate of an address (bool).

property float

Operand is float (bool).

property address_base

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

property address_index

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

property immediate

Operand is immediate (bool).

property vector

Operand is vector (bool).

property constant

Operand is constant (bool).

abstract copy()[source]

Return a copy of the operand.

abstract values()[source]

Return the possible value of the operand.

abstract random_value()[source]

Return a random possible value for the operand.

abstract representation(value)[source]

Return the string representation of the operand.

Parameters

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

Return type

str

abstract codification(value)[source]

Return the binary codification of the operand.

Parameters

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

Return type

str

abstract access(value)[source]
Parameters

value

abstract set_valid_values(values)[source]

Sets the set of valid value for the operand.

Parameters

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

check(value)[source]

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