Skip to content
Snippets Groups Projects
Commit 3de76570 authored by Jingjiahui Lu's avatar Jingjiahui Lu
Browse files

Update Machine.java

parent bc66120f
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ public class Machine
}
private void do_load(int dest, int src, int offs) {
if (regs[src] + offs > MAX_ADDR){
if (regs[src] + offs >= MAX_ADDR){
/* no op */
}else if(regs[src] + offs < 0){
/* no op */
......@@ -148,7 +148,7 @@ public class Machine
private void validate_offset(int offset)
throws InvalidInstructionException
{
if (offset < -MAX_ADDR || offset > MAX_ADDR+1) {
if (offset < -MAX_ADDR || offset > MAX_ADDR) {
throw new InvalidInstructionException();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment