LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
LIEF::assembly::powerpc::operands::Memory Class Reference

This class represents a memory operand. More...

#include <Memory.hpp>

Inheritance diagram for LIEF::assembly::powerpc::operands::Memory:
Collaboration diagram for LIEF::assembly::powerpc::operands::Memory:

Classes

struct  offset_t
 Wraps the memory offset as either an integer displacement or an index register. More...

Public Member Functions

REG base () const
 The base register.
offset_t offset () const
 The addressing offset.
 ~Memory () override=default
Public Member Functions inherited from LIEF::assembly::powerpc::Operand
std::string to_string () const
 Pretty representation of the operand.
template<class T>
const T * as () const
 This function can be used to down cast an Operand instance:
virtual ~Operand ()

Static Public Member Functions

static bool classof (const Operand *op)

Detailed Description

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 Index

Constructor & Destructor Documentation

◆ ~Memory()

LIEF::assembly::powerpc::operands::Memory::~Memory ( )
overridedefault

Member Function Documentation

◆ base()

REG LIEF::assembly::powerpc::operands::Memory::base ( ) const

The base register.

For lwz 3, 8(4) it would return 4.

◆ classof()

bool LIEF::assembly::powerpc::operands::Memory::classof ( const Operand * op)
static

◆ offset()

offset_t LIEF::assembly::powerpc::operands::Memory::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))

References LIEF_LOCAL.


The documentation for this class was generated from the following file: