halt j halt
This commit is contained in:
parent
bfa4a8cd72
commit
12421d0e5d
23 changed files with 270 additions and 173 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue