diff --git a/src/Assembleur.cpp b/src/Assembleur.cpp index 50bf1c5..b2637a0 100644 --- a/src/Assembleur.cpp +++ b/src/Assembleur.cpp @@ -106,7 +106,10 @@ std::uint32_t Assembleur::ParseIO(Instruction a_Instruction, std::uint32_t a_R1, static std::uint32_t ParseRegistry(const std::string& a_Str) { if (a_Str.at(0) != 'R') throw std::runtime_error("Registry " + a_Str + " not found !"); - return std::stoi(a_Str.substr(1)); + std::uint32_t registry = std::stoi(a_Str.substr(1)); + if (registry > 7) + throw std::runtime_error("You can only have up to 8 registries !"); + return registry; } static bool IsConstant(const std::string& a_Str) {