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

#include <DisassemblyImmediate.hh>

Inheritance diagram for DisassemblyImmediate:
Inheritance graph
Collaboration diagram for DisassemblyImmediate:
Collaboration graph

Public Member Functions

 DisassemblyImmediate (SimValue value, bool signExtend)
 
virtual ~DisassemblyImmediate ()
 
virtual std::string toString () const
 
- Public Member Functions inherited from DisassemblyElement
virtual ~DisassemblyElement ()
 

Private Attributes

SimValue value_
 Immediate value. More...
 
bool signExtend_
 The value is sign extended if set to true. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DisassemblyElement
 DisassemblyElement ()
 

Detailed Description

Represents an inline immediate value in the disassembler.

Definition at line 42 of file DisassemblyImmediate.hh.

Constructor & Destructor Documentation

◆ DisassemblyImmediate()

DisassemblyImmediate::DisassemblyImmediate ( SimValue  value,
bool  signExtend 
)

The constructor.

Parameters
valueInline immediate value.

Definition at line 42 of file DisassemblyImmediate.cc.

42  :
44  value_(value), signExtend_(signExtend) {
45 }

◆ ~DisassemblyImmediate()

DisassemblyImmediate::~DisassemblyImmediate ( )
virtual

The destructor.

Definition at line 51 of file DisassemblyImmediate.cc.

51  {
52 }

Member Function Documentation

◆ toString()

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

Returns disassembly of the inline immediate value.

Returns
Disassembly of the inline immediate value as a string.

Implements DisassemblyElement.

Definition at line 61 of file DisassemblyImmediate.cc.

61  {
62  if (value_.width() == 0) {
63  return "Invalid Immediate";
64  }
65  // Select the extension mode in the printout depending on the
66  // move slots's (bus) extension mode. Wrong extension mode can
67  // produce wrong output that cannot be assembled in case
68  // of a negative-looking value on a zero extending slot.
69  if (signExtend_) {
71  return text;
72  }
73  else {
75  return text;
76  }
77 }

References signExtend_, SimValue::sLongWordValue(), Conversion::toString(), SimValue::uLongWordValue(), value_, and SimValue::width().

Referenced by TTAProgram::TerminalImmediate::toString(), and TTAProgram::TerminalLaneIDImmediate::toString().

Here is the call graph for this function:

Member Data Documentation

◆ signExtend_

bool DisassemblyImmediate::signExtend_
private

The value is sign extended if set to true.

Definition at line 51 of file DisassemblyImmediate.hh.

Referenced by toString().

◆ value_

SimValue DisassemblyImmediate::value_
private

Immediate value.

Definition at line 49 of file DisassemblyImmediate.hh.

Referenced by toString().


The documentation for this class was generated from the following files:
SimValue::sLongWordValue
SLongWord sLongWordValue() const
Definition: SimValue.cc:997
Conversion::toString
static std::string toString(const T &source)
DisassemblyElement::DisassemblyElement
DisassemblyElement()
Definition: DisassemblyElement.cc:38
SimValue::uLongWordValue
ULongWord uLongWordValue() const
Definition: SimValue.cc:1027
SimValue::width
int width() const
Definition: SimValue.cc:103
DisassemblyImmediate::value_
SimValue value_
Immediate value.
Definition: DisassemblyImmediate.hh:49
TCEString
Definition: TCEString.hh:53
DisassemblyImmediate::signExtend_
bool signExtend_
The value is sign extended if set to true.
Definition: DisassemblyImmediate.hh:51