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

This class represents a memory operand. More...

#include <Memory.hpp>

Inheritance diagram for LIEF::assembly::mips::operands::Memory:
Collaboration diagram for LIEF::assembly::mips::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::mips::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.

MIPS has two addressing forms:

lw $4, 8($5) ldxc1 $f2, $4($7)
| | | | | |
+------+ | +---+ +-------+ | +-----+
| | | | | |
v v v v v v
Reg Disp Base Reg Index Base

Constructor & Destructor Documentation

◆ ~Memory()

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

Member Function Documentation

◆ base()

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

The base register.

For lw $4, 8($5) it would return $5.

◆ classof()

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

◆ offset()

offset_t LIEF::assembly::mips::operands::Memory::offset ( ) const

The addressing offset.

It can be either:

  • A register (e.g. ldxc1 $f2, $4($7))
  • A displacement (e.g. lw $4, 8($5))

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