Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmeteor/include/ameteor/disassembler/instruction.hpp
2 views
1
// Meteor - A Nintendo Gameboy Advance emulator
2
// Copyright (C) 2009-2011 Philippe Daouadi
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
#ifndef __INSTRUCTION_H__
18
#define __INSTRUCTION_H__
19
20
#include "arguments.hpp"
21
22
#include <string>
23
#include <stdint.h>
24
25
namespace AMeteor
26
{
27
namespace Disassembler
28
{
29
class Instruction
30
{
31
public :
32
Instruction ()
33
{
34
}
35
36
explicit Instruction (uint32_t offset, uint32_t code)
37
{
38
ParseArm (offset, code);
39
}
40
41
explicit Instruction (uint32_t offset, uint16_t code)
42
{
43
ParseThumb(offset, code);
44
}
45
46
void Clear ();
47
48
void ParseArm (uint32_t offset, uint32_t code);
49
void ParseThumb (uint32_t offset, uint16_t code);
50
51
const std::string& GetOperator () const
52
{
53
return m_operator;
54
}
55
56
std::string GetArguments () const
57
{
58
return m_args.GetString();
59
}
60
61
std::string ToString () const
62
{
63
return GetOperator() + ' ' + GetArguments();
64
}
65
66
private :
67
std::string m_operator;
68
Arguments m_args;
69
70
void ParseArmDataProc (uint32_t code);
71
void ParseArmCondition (uint32_t code);
72
};
73
}
74
}
75
76
#endif
77
78