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

Update Machine.java

parent 3de76570
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ public class Machine
private void do_div(int dest, int src1, int src2)
{
if (regs[src2] == 0){
if (regs[src2] == 1){
/* no op */
}else{
regs[dest] = regs[src1] / regs[src2];
......@@ -83,7 +83,7 @@ public class Machine
private void do_load(int dest, int src, int offs) {
if (regs[src] + offs > MAX_ADDR){
/* no op */
}else if(regs[src] - offs < 0){
}else if(regs[src] + offs < 0){
/* no op */
}else{
regs[dest] = memory[regs[src] + offs];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment