Checkpoint 2

This commit is contained in:
Imbus 2024-04-16 13:02:44 +02:00
parent 7d7509e852
commit e0845968a1
4 changed files with 17 additions and 27 deletions

View file

@ -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();
}

View file

@ -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();
}