Skip to content
Snippets Groups Projects
Commit ab1a3446 authored by Linyuan Zhao's avatar Linyuan Zhao
Browse files

Update Machine.java

parent 2d3eb377
Branches
No related tags found
No related merge requests found
...@@ -235,6 +235,9 @@ public class Machine ...@@ -235,6 +235,9 @@ public class Machine
int rs2 = parseReg(toks[3]); int rs2 = parseReg(toks[3]);
do_div(rd,rs1,rs2); do_div(rd,rs1,rs2);
} else if (toks[0].equals(INSTRUCTION_RETURN)){ } else if (toks[0].equals(INSTRUCTION_RETURN)){
if (toks.length != 2){
throw new InvalidInstructionException();
}
int rs = parseReg(toks[1]); int rs = parseReg(toks[1]);
count++; count++;
return regs[rs]; return regs[rs];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment