|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.mips.instructions.Instruction
public abstract class Instruction
Base class to represent member of MIPS instruction set.
Field Summary | |
---|---|
protected String |
description
Description of instruction for display to user |
protected String |
exampleFormat
Example usage of this instruction. |
static int |
INSTRUCTION_LENGTH
Length in bytes of a machine instruction. |
static int |
INSTRUCTION_LENGTH_BITS
|
protected 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 String |
extractOperator(String example)
Used by subclass constructors to extract operator mnemonic from the instruction example. |
String |
getDescription()
Get string describing the instruction. |
String |
getExampleFormat()
Get string descriptor of instruction's format. |
int |
getInstructionLength()
Get length in bytes that this instruction requires in its binary form. |
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 String mnemonic
protected String exampleFormat
protected String description
protected TokenList tokenList
Constructor Detail |
---|
public Instruction()
Method Detail |
---|
public String getName()
public String getExampleFormat()
public String getDescription()
public TokenList getTokenList()
public int getInstructionLength()
protected String extractOperator(String example)
protected void createExampleTokenList()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |