PowerPC¶
Instruction¶
- class Instruction : public LIEF::assembly::Instruction¶
Public Types
- using operands_it = iterator_range<Operand::Iterator>¶
Public Functions
- OPCODE opcode() const¶
The instruction opcode as defined in LLVM.
- operands_it operands() const¶
Iterator over the operands of the current instruction.
- virtual ~Instruction() override = default¶
Public Static Functions
- static bool classof(const assembly::Instruction *inst)¶
True if
instis an effective instance of powerpc::Instruction.
- using operands_it = iterator_range<Operand::Iterator>¶
Opcodes¶
See LIEF::assembly::powerpc::OPCODE in include/asm/powerpc/opcodes.hpp
Operands¶
- class Operand¶
This class represents an operand for a PowerPC instruction.
Subclassed by LIEF::assembly::powerpc::operands::Immediate, LIEF::assembly::powerpc::operands::Memory, LIEF::assembly::powerpc::operands::PCRelative, LIEF::assembly::powerpc::operands::Register
Public Functions
- std::string to_string() const¶
Pretty representation of the operand.
- template<class T>
inline const T *as() const¶ This function can be used to down cast an Operand instance:
std::unique_ptr<assembly::powerpc::Operand> op = ...; if (const auto* imm = inst->as<assembly::powerpc::operands::Immediate>()) { const int64_t value = imm->value(); }
- virtual ~Operand()¶
- std::string to_string() const¶
Immediate¶
Register¶
Memory¶
- class Memory : public LIEF::assembly::powerpc::Operand¶
This class represents a memory operand.
PowerPC has two addressing forms:
lwz 3, 8(4) lwzx 3, 4, 5 | | | | | +------+ +---+ +------+ | +---+ | | | | | v v v v v Disp Base Reg Base IndexPublic Functions
- REG base() const¶
The base register.
For
lwz 3, 8(4)it would return4.
- offset_t offset() const¶
The addressing offset.
It can be either:
An index register (e.g.
lwzx 3, 4, 5)A displacement (e.g.
lwz 3, 8(4))
- ~Memory() override = default¶
- struct offset_t¶
Wraps the memory offset as either an integer displacement or an index register.
Public Types
- enum class TYPE¶
Enum type used to discriminate the anonymous union.
Values:
- enumerator NONE = 0¶
- enumerator REG¶
The union holds the REG attribute.
- enumerator DISP¶
The union holds the
displacementattribute (int64_t).
- enumerator NONE = 0¶
- enum class TYPE¶
- REG base() const¶