Checkpoint 2
This commit is contained in:
parent
7d7509e852
commit
e0845968a1
4 changed files with 17 additions and 27 deletions
|
|
@ -3,7 +3,6 @@ package hatelace.instructions;
|
|||
import hatelace.Instruction;
|
||||
import hatelace.Memory;
|
||||
import hatelace.ProgramCounter;
|
||||
import hatelace.IntWord;
|
||||
import hatelace.Word;
|
||||
import hatelace.Address;
|
||||
|
||||
|
|
@ -19,7 +18,7 @@ public class Add extends Instruction {
|
|||
}
|
||||
|
||||
public void execute(Memory memory, ProgramCounter PC) {
|
||||
memory.write(this.dest, new IntWord(op1.add(op2)));
|
||||
memory.write(this.dest, op1.add(op2));
|
||||
PC.incPC();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import hatelace.Word;
|
|||
import hatelace.Instruction;
|
||||
import hatelace.Memory;
|
||||
import hatelace.ProgramCounter;
|
||||
import hatelace.IntWord;
|
||||
|
||||
public class Mul extends Instruction {
|
||||
private Word op1;
|
||||
|
|
@ -19,7 +18,7 @@ public class Mul extends Instruction {
|
|||
}
|
||||
|
||||
public void execute(Memory memory, ProgramCounter PC) {
|
||||
memory.write(this.dest, new IntWord(op1.multiply(op2)));
|
||||
memory.write(this.dest, op1.multiply(op2));
|
||||
PC.incPC();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue