From 993838651f9465627026b3208a64d9454db0ed9b Mon Sep 17 00:00:00 2001 From: simon987 Date: Mon, 14 Jan 2019 18:24:34 -0500 Subject: [PATCH] Fixes #185 --- .../net/simon987/server/assembly/DefaultInstructionSet.java | 4 +--- .../main/java/net/simon987/server/assembly/Instruction.java | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java b/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java index 445db18..a87f8ee 100755 --- a/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java +++ b/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java @@ -95,9 +95,7 @@ public class DefaultInstructionSet implements InstructionSet { if (instructionMap.containsKey(instruction.getOpCode())) { LogManager.LOGGER.fine(instruction.getMnemonic() + " instruction is an alias for " + instructionMap.get(instruction.getOpCode()).getMnemonic()); - } else { - instructionMap.put(instruction.getOpCode(), instruction); - } + instructionMap.put(instruction.getOpCode(), instruction); } } diff --git a/Server/src/main/java/net/simon987/server/assembly/Instruction.java b/Server/src/main/java/net/simon987/server/assembly/Instruction.java index 1f81546..eb393c5 100755 --- a/Server/src/main/java/net/simon987/server/assembly/Instruction.java +++ b/Server/src/main/java/net/simon987/server/assembly/Instruction.java @@ -133,7 +133,7 @@ public abstract class Instruction { * * @param out encoded bytes will be written here */ - void encode(ByteArrayOutputStream out, int currentLine) throws IllegalOperandException { + public void encode(ByteArrayOutputStream out, int currentLine) throws IllegalOperandException { if (!noOperandsValid()) { throw new IllegalOperandException("This instruction must have operand(s)!", currentLine); @@ -147,7 +147,7 @@ public abstract class Instruction { } } - void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine) + public void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine) throws IllegalOperandException { MachineCode code = new MachineCode(); code.writeOpcode(opCode); @@ -182,7 +182,7 @@ public abstract class Instruction { } } - void encode(ByteArrayOutputStream out, Operand o1, int currentLine) + public void encode(ByteArrayOutputStream out, Operand o1, int currentLine) throws IllegalOperandException { MachineCode code = new MachineCode(); code.writeOpcode(opCode);