From 1d3d44199658af3f809e4a1ed005a6954b247f83 Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Mon, 14 Jan 2019 17:48:49 +0100 Subject: [PATCH] allow instructions to override the encode method --- .../main/java/net/simon987/server/assembly/Instruction.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);