|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mars.mips.instructions.Instruction
Base class to represent member of MIPS instruction set.
Field Summary | |
protected java.lang.String |
description
Description of instruction for display to user |
protected java.lang.String |
exampleFormat
Example usage of this instruction. |
static int |
INSTRUCTION_LENGTH
Length in bytes of a machine instruction. |
static int |
INSTRUCTION_LENGTH_BITS
|
protected java.lang.String |
mnemonic
The instruction name. |
static char[] |
operandMask
Characters used in instruction mask to indicate bit positions for 'f'irst, 's'econd, and 't'hird operands. |
protected TokenList |
tokenList
List of tokens generated by tokenizing example usage (see exampleFormat). |
Constructor Summary | |
Instruction()
|
Method Summary | |
protected void |
createExampleTokenList()
Used to build a token list from the example instruction provided as constructor argument. |
protected java.lang.String |
extractOperator(java.lang.String example)
Used by subclass constructors to extract operator mnemonic from the instruction example. |
java.lang.String |
getDescription()
Get string describing the instruction. |
java.lang.String |
getExampleFormat()
Get string descriptor of instruction's format. |
int |
getInstructionLength()
Get length in bytes that this instruction requires in its binary form. |
java.lang.String |
getName()
Get operation mnemonic |
TokenList |
getTokenList()
Get TokenList corresponding to correct instruction syntax. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INSTRUCTION_LENGTH
public static final int INSTRUCTION_LENGTH_BITS
public static char[] operandMask
protected java.lang.String mnemonic
protected java.lang.String exampleFormat
protected java.lang.String description
protected TokenList tokenList
Constructor Detail |
public Instruction()
Method Detail |
public java.lang.String getName()
public java.lang.String getExampleFormat()
public java.lang.String getDescription()
public TokenList getTokenList()
public int getInstructionLength()
protected java.lang.String extractOperator(java.lang.String example)
protected void createExampleTokenList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |