Path: blob/master/libmeteor/include/ameteor/disassembler/instruction.hpp
2 views
// Meteor - A Nintendo Gameboy Advance emulator1// Copyright (C) 2009-2011 Philippe Daouadi2//3// This program is free software: you can redistribute it and/or modify4// it under the terms of the GNU General Public License as published by5// the Free Software Foundation, either version 3 of the License, or6// (at your option) any later version.7//8// This program is distributed in the hope that it will be useful,9// but WITHOUT ANY WARRANTY; without even the implied warranty of10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11// GNU General Public License for more details.12//13// You should have received a copy of the GNU General Public License14// along with this program. If not, see <http://www.gnu.org/licenses/>.1516#ifndef __INSTRUCTION_H__17#define __INSTRUCTION_H__1819#include "arguments.hpp"2021#include <string>22#include <stdint.h>2324namespace AMeteor25{26namespace Disassembler27{28class Instruction29{30public :31Instruction ()32{33}3435explicit Instruction (uint32_t offset, uint32_t code)36{37ParseArm (offset, code);38}3940explicit Instruction (uint32_t offset, uint16_t code)41{42ParseThumb(offset, code);43}4445void Clear ();4647void ParseArm (uint32_t offset, uint32_t code);48void ParseThumb (uint32_t offset, uint16_t code);4950const std::string& GetOperator () const51{52return m_operator;53}5455std::string GetArguments () const56{57return m_args.GetString();58}5960std::string ToString () const61{62return GetOperator() + ' ' + GetArguments();63}6465private :66std::string m_operator;67Arguments m_args;6869void ParseArmDataProc (uint32_t code);70void ParseArmCondition (uint32_t code);71};72}73}7475#endif767778