|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--physis.core.virtualmachine.Instruction
This class represents one instruction for a virtual machine. Instructions are coded as positive integers. Instructions have mnemonics just like in assembly languages. The instructions can be categorized into types. (copy, biological, nop...) Instructions may have operands (although in evolvable languages they are not preferred).
| Field Summary | |
(package private) boolean |
hasOperand
Tells whether the instruction has operand(s) or not. |
(package private) short |
inst_code
This is actually the main identifier of the instruction (the instruction itself). |
private java.lang.String |
instruction_mnemonic
Actually it is the name of the instruction. |
private int |
number_of_operands
The number of operands. |
private int |
type
Every instruction has a type. |
| Constructor Summary | |
Instruction(int type,
short code,
java.lang.String mnemonic,
int number_of_operands)
This class is immutable, which means that you can not change the state of an instance after you created. |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
|
short |
getInstructionCode()
|
java.lang.String |
getMnemonic()
Returns the mnemonic (name) of the instruction. |
int |
getNumberOfOperands()
Returns the number of operands. |
int |
getType()
Returns the type identifier. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private java.lang.String instruction_mnemonic
private int type
final short inst_code
final boolean hasOperand
private int number_of_operands
| Constructor Detail |
public Instruction(int type,
short code,
java.lang.String mnemonic,
int number_of_operands)
| Method Detail |
public java.lang.String getMnemonic()
public int getType()
public int getNumberOfOperands()
public short getInstructionCode()
public boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||