Path: blob/master/libmeteor/source/disassembler/argregister.cpp
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#include "ameteor/disassembler/argregister.hpp"1718#include <sstream>1920namespace AMeteor21{22namespace Disassembler23{24std::string ArgRegister::GetString () const25{26static const char* SpeRegisters[] = {"SP", "LR", "PC"};2728std::ostringstream ss;2930if (m_memory)31ss << '[';3233if (m_special)34ss << SpeRegisters[m_reg-13];35else36ss << 'r' << (int)m_reg;3738if (m_memory)39ss << ']';4041if (m_writeback)42ss << '!';4344return ss.str();45}4647Argument* ArgRegister::Clone () const48{49return new ArgRegister(*this);50}51}52}535455