|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.mips.instructions.Instruction
mars.mips.instructions.ExtendedInstruction
public class 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(String example,
String translation)
Constructor for ExtendedInstruction, where no instruction description or compact translation is provided. |
|
ExtendedInstruction(String example,
String translation,
String description)
Constructor for ExtendedInstruction. |
|
ExtendedInstruction(String example,
String translation,
String compactTranslation,
String description)
Constructor for ExtendedInstruction. |
Method Summary | |
---|---|
ArrayList |
getBasicIntructionTemplateList()
Get ArrayList of Strings that represent list of templates for basic instructions generated by this extended instruction. |
ArrayList |
getCompactBasicIntructionTemplateList()
Get ArrayList of Strings that represent list of templates for basic instructions generated by the "compact" or 16-bit version of this extended instruction. |
int |
getCompactInstructionLength()
Get length in bytes that this extended instruction requires in its binary form if it includes an alternative expansion for compact memory (16 bit addressing) configuration. |
int |
getInstructionLength()
Get length in bytes that this extended instruction requires in its binary form. |
boolean |
hasCompactTranslation()
Determine whether or not this pseudo-instruction has a second translation optimized for 16 bit address space: a compact version. |
static String |
makeTemplateSubstitutions(MIPSprogram program,
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(String example, String translation, String compactTranslation, 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.compactTranslation
- Alternative translation that can be used if running under
a compact (16 bit) memory configuration.description
- a helpful description to be included on help requests
The presence of an alternative "compact translation" can optimize code generation
by assuming that data label addresses are 16 bits instead of 32public ExtendedInstruction(String example, String translation, 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(String example, 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 ArrayList getBasicIntructionTemplateList()
public int getCompactInstructionLength()
public boolean hasCompactTranslation()
public ArrayList getCompactBasicIntructionTemplateList()
public static String makeTemplateSubstitutions(MIPSprogram program, String template, TokenList theTokenList)
template
- a String containing template for basic statement.tokenList
- a TokenList containing tokens from extended instruction.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |