|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--physis.core.virtualmachine.InstructionSet
This class contains the instructons of an instructionset which belongs to one or more virtual machines.
The persistent storage of the instructions is a simple textfile which has the following format:
[instruction_set_name]
TYPE [type_name] [type_code]
[instruction_name] [instruction_code]
...
TYPE ....
CRC
1. ensure access to instruction_names by codes and vice-versa - Instruction
| Field Summary | |
private static Instruction |
BLANK_INSTRUCTION
The nop instruction should be in all instructionsets. |
private static InstructionSet |
instance
|
private Instruction[] |
instcodeArray
|
private java.util.Hashtable |
instructions_by_codes
The keys are Integers, and the values are Instructions. |
private java.util.Hashtable |
instructions_by_names
The keys are Strings (the names of the instructions), and the values are Instructions. |
private java.lang.String |
name
The identifier name of the instructionset. |
private java.util.Random |
random
|
private int |
size
|
private java.util.Hashtable |
type_names
This hashtable stores the typenames of the instruction categories. |
| Constructor Summary | |
private |
InstructionSet(java.lang.String instruction_file_name)
|
| Method Summary | |
Instruction |
getBlankInstrunction()
|
static InstructionSet |
getInstance()
|
static InstructionSet |
getInstance(java.lang.String instructionset_file)
|
Instruction |
getInstruction(short instruction_code)
Gives the thin InstructionCode object according to the given instruction_code. |
Instruction |
getInstructionByCode(short code)
|
Instruction |
getInstructionByName(java.lang.String instname)
|
short |
getInstructionCodeRandomly()
This method is used when mutating the codetape. |
java.lang.String |
getInstructionMnemonic(short instruction_code)
Gives the instruction's name (mnemonic) corresponding to the given instruction_code. |
java.lang.String |
getName()
|
int |
getSize()
|
java.lang.String |
getTypeName(int instruction_type_code)
Gives the name of the corresponding integer type code. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final Instruction BLANK_INSTRUCTION
private static InstructionSet instance
private java.util.Hashtable type_names
private java.util.Hashtable instructions_by_codes
private java.util.Hashtable instructions_by_names
private java.lang.String name
private Instruction[] instcodeArray
private int size
private java.util.Random random
| Constructor Detail |
private InstructionSet(java.lang.String instruction_file_name)
| Method Detail |
public static InstructionSet getInstance()
public static InstructionSet getInstance(java.lang.String instructionset_file)
public java.lang.String getTypeName(int instruction_type_code)
public Instruction getInstruction(short instruction_code)
public Instruction getInstructionByName(java.lang.String instname)
public Instruction getInstructionByCode(short code)
public java.lang.String getInstructionMnemonic(short instruction_code)
public Instruction getBlankInstrunction()
public short getInstructionCodeRandomly()
public java.lang.String getName()
public int getSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||