OpenASIP 2.2
Loading...
Searching...
No Matches
ImmediateElement.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file ImmediateElement.hh
26 *
27 * Declaration of ImmediateElement class.
28 *
29 * @author Mikael Lepistö 2003 (tmlepist-no.spam-cs.tut.fi)
30 * @note reviewed 21 October 2003 by ml, jn, rl, pj
31 *
32 * @note rating: yellow
33 */
34
35#ifndef TTA_IMMEDIATE_ELEMENT_HH
36#define TTA_IMMEDIATE_ELEMENT_HH
37
38#include <vector>
39
40#include "TPEFBaseType.hh"
41#include "InstructionElement.hh"
42#include "Exception.hh"
43
44namespace TPEF {
45
46/**
47 * Immediate data element of CodeSection.
48 */
50public:
52 virtual ~ImmediateElement();
53
54 bool isInline() const;
55
56 void addByte(Byte aByte);
57
58 Byte byte(unsigned int index) const;
59
60 void setByte(unsigned int index, Byte aValue);
61
62 void setWord(Word aValue);
63 void setSignedWord(SignedWord aValue);
65 void setULongWord(ULongWord aValue);
66
67 Word word() const;
68
71
72 SignedWord signedWord() const;
73
74 unsigned int length() const;
75
77 void setDestinationUnit(Byte aDestinationUnit);
78
80 void setDestinationIndex(Byte aDestinationIndex);
81
82private:
83 /// Value of immediate.
84 std::vector<Byte> value_;
85 /// Destination unit of immediate.
87 /// Destination index of immediate.
89};
90}
91
92#include "ImmediateElement.icc"
93
94#endif
unsigned long ULongWord
Definition BaseType.hh:51
unsigned long LongWord
Definition BaseType.hh:49
long SLongWord
Definition BaseType.hh:52
long SignedLongWord
Definition BaseType.hh:50
unsigned char Byte
Definition BaseType.hh:116
void setByte(unsigned int index, Byte aValue)
SignedWord signedWord() const
Byte destinationUnit_
Destination unit of immediate.
LongWord longWord() const
std::vector< Byte > value_
Value of immediate.
void setDestinationIndex(Byte aDestinationIndex)
SignedLongWord sLongWord() const
void setULongWord(ULongWord aValue)
Byte destinationIndex() const
void setDestinationUnit(Byte aDestinationUnit)
Byte destinationUnit() const
Byte destinationIndex_
Destination index of immediate.
void setSignedWord(SignedWord aValue)
void addByte(Byte aByte)
void setWord(Word aValue)
unsigned int length() const
void setSignedLong(SLongWord aValue)
Byte byte(unsigned int index) const