mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-20 11:06:46 +00:00
Fixes #185
This commit is contained in:
parent
ce8c5375ee
commit
993838651f
@ -95,9 +95,7 @@ public class DefaultInstructionSet implements InstructionSet {
|
|||||||
if (instructionMap.containsKey(instruction.getOpCode())) {
|
if (instructionMap.containsKey(instruction.getOpCode())) {
|
||||||
LogManager.LOGGER.fine(instruction.getMnemonic() + " instruction is an alias for " +
|
LogManager.LOGGER.fine(instruction.getMnemonic() + " instruction is an alias for " +
|
||||||
instructionMap.get(instruction.getOpCode()).getMnemonic());
|
instructionMap.get(instruction.getOpCode()).getMnemonic());
|
||||||
} else {
|
|
||||||
instructionMap.put(instruction.getOpCode(), instruction);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
instructionMap.put(instruction.getOpCode(), instruction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ public abstract class Instruction {
|
|||||||
*
|
*
|
||||||
* @param out encoded bytes will be written here
|
* @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()) {
|
if (!noOperandsValid()) {
|
||||||
throw new IllegalOperandException("This instruction must have operand(s)!", currentLine);
|
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 {
|
throws IllegalOperandException {
|
||||||
MachineCode code = new MachineCode();
|
MachineCode code = new MachineCode();
|
||||||
code.writeOpcode(opCode);
|
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 {
|
throws IllegalOperandException {
|
||||||
MachineCode code = new MachineCode();
|
MachineCode code = new MachineCode();
|
||||||
code.writeOpcode(opCode);
|
code.writeOpcode(opCode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user