Lib.Statement module
The base class for RISCV ASM statements is Statement
.
It is inherited by Comment
, Label
and Instruction
. In turn, Instruction
is inherited by Instru3A
(for regular non-branching 3-address instructions),
AbsoluteJump
and ConditionalJump
.
- Lib.Statement.regset_to_string(registerset) str [source]
Utility function: pretty-prints a set of locations.
- class Lib.Statement.Statement[source]
Bases:
object
A Statement, which is an instruction, a comment or a label.
- substitute(subst: Dict[Operand, Operand]) TStatement [source]
Return a new instruction, cloned from this one, replacing operands that appear as key in subst by their value.
- class Lib.Statement.Label(name: str)[source]
-
A label is both a Statement and an Operand.
- name: str
- class Lib.Statement.Instruction[source]
Bases:
Statement
- ins: str
- class Lib.Statement.Instru3A(ins, *args: Lib.Operands.Operand)[source]
Bases:
Instruction
- class Lib.Statement.AbsoluteJump(label: Label)[source]
Bases:
Instruction
An Absolute Jump is a specific kind of instruction
- ins: str = 'j'
- substitute(subst: Dict[Operand, Operand])[source]
Return a new instruction, cloned from this one, replacing operands that appear as key in subst by their value.
- class Lib.Statement.ConditionalJump(cond: Condition, op1: Operand, op2: Operand, label: Label)[source]
Bases:
Instruction
A Conditional Jump is a specific kind of instruction