mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 18:46:43 +00:00
update encode throw signature
This commit is contained in:
parent
1157bd5df5
commit
d2e7084354
@ -1,6 +1,6 @@
|
|||||||
package net.simon987.server.assembly;
|
package net.simon987.server.assembly;
|
||||||
|
|
||||||
|
import net.simon987.server.assembly.exception.AssemblyException;
|
||||||
import net.simon987.server.assembly.exception.IllegalOperandException;
|
import net.simon987.server.assembly.exception.IllegalOperandException;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@ -133,7 +133,7 @@ public abstract class Instruction {
|
|||||||
*
|
*
|
||||||
* @param out encoded bytes will be written here
|
* @param out encoded bytes will be written here
|
||||||
*/
|
*/
|
||||||
public void encode(ByteArrayOutputStream out, int currentLine) throws IllegalOperandException {
|
public void encode(ByteArrayOutputStream out, int currentLine) throws AssemblyException {
|
||||||
|
|
||||||
if (!noOperandsValid()) {
|
if (!noOperandsValid()) {
|
||||||
throw new IllegalOperandException("This instruction must have operand(s)!", currentLine);
|
throw new IllegalOperandException("This instruction must have operand(s)!", currentLine);
|
||||||
@ -148,7 +148,7 @@ public abstract class Instruction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine)
|
public void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine)
|
||||||
throws IllegalOperandException {
|
throws AssemblyException {
|
||||||
MachineCode code = new MachineCode();
|
MachineCode code = new MachineCode();
|
||||||
code.writeOpcode(opCode);
|
code.writeOpcode(opCode);
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ public abstract class Instruction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void encode(ByteArrayOutputStream out, Operand o1, int currentLine)
|
public void encode(ByteArrayOutputStream out, Operand o1, int currentLine)
|
||||||
throws IllegalOperandException {
|
throws AssemblyException {
|
||||||
MachineCode code = new MachineCode();
|
MachineCode code = new MachineCode();
|
||||||
code.writeOpcode(opCode);
|
code.writeOpcode(opCode);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user