OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
DisassemblyIntRegister Class Reference

#include <DisassemblyIntRegister.hh>

Inheritance diagram for DisassemblyIntRegister:
Inheritance graph
Collaboration diagram for DisassemblyIntRegister:
Collaboration graph

Public Member Functions

 DisassemblyIntRegister (Word index)
 
virtual ~DisassemblyIntRegister ()
 
virtual std::string toString () const
 
- Public Member Functions inherited from DisassemblyElement
virtual ~DisassemblyElement ()
 

Private Attributes

Word index_
 Index of the register. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DisassemblyElement
 DisassemblyElement ()
 

Detailed Description

Represents an int register in the disassembler.

Definition at line 42 of file DisassemblyIntRegister.hh.

Constructor & Destructor Documentation

◆ DisassemblyIntRegister()

DisassemblyIntRegister::DisassemblyIntRegister ( Word  index)

The Constructor.

Parameters
indexIndex of the register.

Definition at line 41 of file DisassemblyIntRegister.cc.

41  :
43  index_(index) {
44 }

◆ ~DisassemblyIntRegister()

DisassemblyIntRegister::~DisassemblyIntRegister ( )
virtual

The destructor.

Definition at line 50 of file DisassemblyIntRegister.cc.

50  {
51 }

Member Function Documentation

◆ toString()

std::string DisassemblyIntRegister::toString ( ) const
virtual

Returns disassembly of the int register.

Returns
Disassembly of the int register as a string.

Implements DisassemblyElement.

Definition at line 60 of file DisassemblyIntRegister.cc.

60  {
61 
62  switch (index_) {
63  case 0: return "ires0"; // Return value.
64  case 1: return "sp"; // Stack pointer.
65  // Registers for passing function parameters:
66  case 2: return "iarg1";
67  case 3: return "iarg2";
68  case 4: return "iarg3";
69  case 5: return "iarg4";
70  }
71 
72  return "r" + Conversion::toString(index_);
73 }

References index_, and Conversion::toString().

Here is the call graph for this function:

Member Data Documentation

◆ index_

Word DisassemblyIntRegister::index_
private

Index of the register.

Definition at line 49 of file DisassemblyIntRegister.hh.

Referenced by toString().


The documentation for this class was generated from the following files:
DisassemblyIntRegister::index_
Word index_
Index of the register.
Definition: DisassemblyIntRegister.hh:49
Conversion::toString
static std::string toString(const T &source)
DisassemblyElement::DisassemblyElement
DisassemblyElement()
Definition: DisassemblyElement.cc:38