RISC-V¶
Instruction¶

- class lief.assembly.riscv.Instruction¶
Bases:
InstructionThis class represents a RISC-V (32 or 64 bit) instruction
- property opcode lief.assembly.riscv.OPCODE¶
The instruction opcode as defined in LLVM
- property operands Iterator[lief.assembly.riscv.Operand | None]¶
Iterator over the operands of the current instruction
Opcodes¶
See: lief.assembly.riscv.OPCODE
Operands¶

- class lief.assembly.riscv.Operand¶
Bases:
objectThis class represents an operand for a RISC-V instruction
- property to_string str¶
Pretty representation of the operand
Immediate¶

Register¶

- class lief.assembly.riscv.operands.Register¶
Bases:
OperandThis class represents a register operand.
csrr a0, mstatus | | +------+ +-------+ | | v v REG SYSREG- property value lief.assembly.riscv.REG | lief.assembly.riscv.SYSREG | None¶
The effective register as either: a
lief.assembly.riscv.REGor alief.assembly.riscv.SYSREG.
Memory¶

- class lief.assembly.riscv.operands.Memory¶
Bases:
OperandThis class represents a memory operand.
lw a0, 8(sp) | | | +----> Base: sp | +-------> Displacement: 8- property base lief.assembly.riscv.REG¶
The base register.
For
lw a0, 8(sp)it would returnsp.
- property displacement int¶
The displacement value.
For
lw a0, 8(sp)it would return8.
PCRelative¶
