public class Instruction
extends java.lang.Object
Field| Constructor and Description |
|---|
Instruction(InstructionCode code,
Field fieldA,
Field fieldB)
Constructs an Instruction consisting of instruction code and A- and
B-Fields.
|
Instruction(InstructionCode code,
Modifiers modifier,
Field fieldA,
Field fieldB)
Constructs an Instruction consisting of instruction code, modifier and A-
and B-Fields.
|
Instruction(java.lang.String label,
InstructionCode code,
Modifiers modifier,
Field fieldA,
Field fieldB)
Constructs an Instruction consisting of label, instruction code, modifier
and A- and B-Fields.
|
| Modifier and Type | Method and Description |
|---|---|
Field |
getField(int fieldAorB)
Gets the field a or b ([Field.a] = 0, [Field.b] = 1)
|
InstructionCode |
getInstructionCode()
Gets InstructionCode ENUM.
|
protected java.lang.String |
getLabel()
Gets the string value of the label describing this instruction line.
|
Modifiers |
getModifier()
Gets modifier of this lines instruction code.
|
protected boolean |
isVariable()
Returns false if there are no variables in the fields of the instruction
or if all variables have assigned values.
|
void |
setField(int fieldAorB,
AddressingMode mode,
int value)
Sets FieldValue and AddressingMode for a or b ([Field.a] = 0, [Field.b] =
1)
|
void |
setField(int fieldAorB,
int value)
Sets FieldValue a or b ([Field.a] = 0, [Field.b] = 1)
|
java.lang.String |
toString()
String output of the Instruction class, which ignores labels if
accompanied by integer values.
|
public Instruction(java.lang.String label,
InstructionCode code,
Modifiers modifier,
Field fieldA,
Field fieldB)
label - must not contain any sign apart from letters.code - ENUM must exist.modifier - ENUM is NONE for no modifier.fieldA - must be a Field object.fieldB - must be a Field object.public Instruction(InstructionCode code, Modifiers modifier, Field fieldA, Field fieldB)
code - ENUM must exist.modifier - ENUM is NONE for no modifier.fieldA - must be a Field object.fieldB - must be a Field object.public Instruction(InstructionCode code, Field fieldA, Field fieldB)
code - ENUM must exist.fieldA - must be a Field object.fieldB - must be a Field object.public InstructionCode getInstructionCode()
public java.lang.String toString()
toString in class java.lang.Objectpublic Field getField(int fieldAorB)
fieldAorB - must be 0 or 1 (recommended Field.a / Field.b)Fieldpublic void setField(int fieldAorB,
int value)
fieldAorB - must be 0 or 1 (recommended Field.a / Field.b)value - which is saved in the FieldFieldpublic void setField(int fieldAorB,
AddressingMode mode,
int value)
fieldAorB - must be 0 or 1 (recommended Field.a / Field.b)mode - which is saved as new AddressingModevalue - which is saved in the FieldFieldprotected boolean isVariable()
Fieldprotected java.lang.String getLabel()
public Modifiers getModifier()