Skip to content
Snippets Groups Projects
Commit f49fc64b authored by He Zhu's avatar He Zhu
Browse files

Update Machine.java

parent 997bccbb
No related branches found
No related tags found
No related merge requests found
package swen90006.machine;
/*
* change all the pc+1 to pc-1
*/
import java.util.Arrays;
import java.util.List;
......@@ -188,7 +191,7 @@ public class Machine
/* check for blank lines */
if (inst.equals("")){
pc = pc + 1;
pc = pc - 1;
count++;
continue;
}
......@@ -278,7 +281,7 @@ public class Machine
if (regs[ra] == 0){
pc = pc + offs;
}else{
pc = pc + 1;
pc = pc - 1;
}
count++;
continue; /* avoid default increment the pc below */
......@@ -287,7 +290,7 @@ public class Machine
throw new InvalidInstructionException();
}
count++;
pc = pc + 1;
pc = pc - 1;
}
/* got here without returning already... */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment