halt j halt

This commit is contained in:
aljazbrodar. 2025-12-07 14:45:47 +01:00
parent bfa4a8cd72
commit 12421d0e5d
23 changed files with 270 additions and 173 deletions

View file

@ -50,7 +50,7 @@ void Machine::setReg(int reg, int val)
}
unsigned char Machine::readByte(unsigned int address) {
if (address > MAX_ADDRESS) {
if (address > MAX_ADDRESS || address <0) {
throw std::out_of_range("Memory read out of range");
}
return memory[address];