|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mars.mips.instructions.Instruction | +--mars.mips.instructions.ExtendedInstruction
ExtendedInstruction represents a MIPS extended (a.k.a pseudo) instruction. This assembly language instruction does not have a corresponding machine instruction. Instead it is translated by the extended assembler into one or more basic instructions (operations that have a corresponding machine instruction). The TranslationCode object is responsible for performing the translation.
Field Summary |
Fields inherited from class mars.mips.instructions.Instruction |
description, exampleFormat, INSTRUCTION_LENGTH, INSTRUCTION_LENGTH_BITS, mnemonic, operandMask, tokenList |
Constructor Summary | |
ExtendedInstruction(java.lang.String example,
java.lang.String translation)
Constructor for ExtendedInstruction, where no instruction description is provided. |
|
ExtendedInstruction(java.lang.String example,
java.lang.String translation,
java.lang.String description)
Constructor for ExtendedInstruction. |
Method Summary | |
java.util.ArrayList |
getBasicIntructionTemplateList()
Get ArrayList of Strings that represent list of templates for basic instructions generated by this extended instruction. |
int |
getInstructionLength()
Get length in bytes that this extended instruction requires in its binary form. |
static java.lang.String |
makeTemplateSubstitutions(MIPSprogram program,
java.lang.String template,
TokenList theTokenList)
Given a basic instruction template and the list of tokens from an extended instruction statement, substitute operands from the token list appropriately into the template to generate the basic statement. |
Methods inherited from class mars.mips.instructions.Instruction |
createExampleTokenList, extractOperator, getDescription, getExampleFormat, getName, getTokenList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExtendedInstruction(java.lang.String example, java.lang.String translation, java.lang.String description)
example
- A String containing example use of the MIPS extended instruction.translation
- Specifications for translating this instruction into a sequence
of one or more MIPS basic instructions.description
- a helpful description to be included on help requestspublic ExtendedInstruction(java.lang.String example, java.lang.String translation)
example
- A String containing example use of the MIPS extended instruction.translation
- Specifications for translating this instruction into a sequence
of one or more MIPS basic instructions.Method Detail |
public int getInstructionLength()
getInstructionLength
in class Instruction
public java.util.ArrayList getBasicIntructionTemplateList()
public static java.lang.String makeTemplateSubstitutions(MIPSprogram program, java.lang.String template, TokenList theTokenList)
template
- a String containing template for basic statement.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |