From 26a97259f5a7b066cff2927e88c867fac2aaad87 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 26 May 2009 23:10:13 +0200 Subject: template FTW!!!!!11 --- ue4/mycpu/cinstruction.cpp | 48 ---------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 ue4/mycpu/cinstruction.cpp (limited to 'ue4/mycpu/cinstruction.cpp') diff --git a/ue4/mycpu/cinstruction.cpp b/ue4/mycpu/cinstruction.cpp deleted file mode 100644 index a766015..0000000 --- a/ue4/mycpu/cinstruction.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @module cinstruction - * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) - * @brief Abstract class for displays - * @date 13.05.2009 - */ - -#include -#include -#include -#include -#include "cinstruction.h" -#include "ccpu.h" - -using namespace std; - -const unsigned CInstruction::parseRegister(const std::string& str) -{ - unsigned reg; - if (str.length() < 2 || str[0] != 'r') - throw runtime_error("Invalid syntax of register"); - - try - { - reg = boost::lexical_cast(str.substr(1)); - } - catch(boost::bad_lexical_cast& ex) - { - throw runtime_error("Invalid syntax of register"); - } - - return reg; -} - -/*----------------------------------------------------------------------------*/ - -inline void CInstruction::checkRegister(CCPU *cpu, const unsigned regidx) -{ - assert(cpu != NULL); - if (regidx >= cpu->getRegisterCount()) - { - stringstream sstr; - sstr << "Register R" << regidx << " doesn't exist (out of bound)"; - throw runtime_error(sstr.str()); - } -} - -/* vim: set et sw=2 ts=2: */ -- cgit v1.2.3