Files
EMARS/docs/mars/mips/instructions/ExtendedInstruction.html
T
adolphenom 0da1c5dcca Source code of MARS Assembler
First commit of the 4.5 version (latest version available)
2014-12-21 12:49:28 +01:00

532 lines
32 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_33) on Tue Aug 20 12:20:44 EDT 2013 -->
<TITLE>
ExtendedInstruction
</TITLE>
<META NAME="date" CONTENT="2013-08-20">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ExtendedInstruction";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../mars/mips/instructions/BasicInstructionFormat.html" title="class in mars.mips.instructions"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../mars/mips/instructions/Instruction.html" title="class in mars.mips.instructions"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?mars/mips/instructions/ExtendedInstruction.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ExtendedInstruction.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_mars.mips.instructions.Instruction">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
mars.mips.instructions</FONT>
<BR>
Class ExtendedInstruction</H2>
<PRE>
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../mars/mips/instructions/Instruction.html" title="class in mars.mips.instructions">mars.mips.instructions.Instruction</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>mars.mips.instructions.ExtendedInstruction</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>ExtendedInstruction</B><DT>extends <A HREF="../../../mars/mips/instructions/Instruction.html" title="class in mars.mips.instructions">Instruction</A></DL>
</PRE>
<P>
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.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Pete Sanderson</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_mars.mips.instructions.Instruction"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class mars.mips.instructions.<A HREF="../../../mars/mips/instructions/Instruction.html" title="class in mars.mips.instructions">Instruction</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../mars/mips/instructions/Instruction.html#description">description</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#exampleFormat">exampleFormat</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#INSTRUCTION_LENGTH">INSTRUCTION_LENGTH</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#INSTRUCTION_LENGTH_BITS">INSTRUCTION_LENGTH_BITS</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#mnemonic">mnemonic</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#operandMask">operandMask</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#tokenList">tokenList</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#ExtendedInstruction(java.lang.String, java.lang.String)">ExtendedInstruction</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;translation)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor for ExtendedInstruction, where no instruction description or
compact translation is provided.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#ExtendedInstruction(java.lang.String, java.lang.String, java.lang.String)">ExtendedInstruction</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;translation,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;description)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor for ExtendedInstruction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#ExtendedInstruction(java.lang.String, java.lang.String, java.lang.String, java.lang.String)">ExtendedInstruction</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;translation,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;compactTranslation,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;description)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor for ExtendedInstruction.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#getBasicIntructionTemplateList()">getBasicIntructionTemplateList</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get ArrayList of Strings that represent list of templates for
basic instructions generated by this extended instruction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#getCompactBasicIntructionTemplateList()">getCompactBasicIntructionTemplateList</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get ArrayList of Strings that represent list of templates for
basic instructions generated by the "compact" or 16-bit version
of this extended instruction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#getCompactInstructionLength()">getCompactInstructionLength</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#getInstructionLength()">getInstructionLength</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get length in bytes that this extended instruction requires in its
binary form.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#hasCompactTranslation()">hasCompactTranslation</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine whether or not this pseudo-instruction has a second
translation optimized for 16 bit address space: a compact version.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../mars/mips/instructions/ExtendedInstruction.html#makeTemplateSubstitutions(mars.MIPSprogram, java.lang.String, mars.assembler.TokenList)">makeTemplateSubstitutions</A></B>(<A HREF="../../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;program,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;template,
<A HREF="../../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A>&nbsp;theTokenList)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_mars.mips.instructions.Instruction"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class mars.mips.instructions.<A HREF="../../../mars/mips/instructions/Instruction.html" title="class in mars.mips.instructions">Instruction</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../mars/mips/instructions/Instruction.html#createExampleTokenList()">createExampleTokenList</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#extractOperator(java.lang.String)">extractOperator</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#getDescription()">getDescription</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#getExampleFormat()">getExampleFormat</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#getName()">getName</A>, <A HREF="../../../mars/mips/instructions/Instruction.html#getTokenList()">getTokenList</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="ExtendedInstruction(java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
ExtendedInstruction</H3>
<PRE>
public <B>ExtendedInstruction</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;translation,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;compactTranslation,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;description)</PRE>
<DL>
<DD>Constructor for ExtendedInstruction.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>example</CODE> - A String containing example use of the MIPS extended instruction.<DD><CODE>translation</CODE> - Specifications for translating this instruction into a sequence
of one or more MIPS basic instructions.<DD><CODE>compactTranslation</CODE> - Alternative translation that can be used if running under
a compact (16 bit) memory configuration.<DD><CODE>description</CODE> - 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 32</DL>
</DL>
<HR>
<A NAME="ExtendedInstruction(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
ExtendedInstruction</H3>
<PRE>
public <B>ExtendedInstruction</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;translation,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;description)</PRE>
<DL>
<DD>Constructor for ExtendedInstruction. No compact translation is provided.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>example</CODE> - A String containing example use of the MIPS extended instruction.<DD><CODE>translation</CODE> - Specifications for translating this instruction into a sequence
of one or more MIPS basic instructions.<DD><CODE>description</CODE> - a helpful description to be included on help requests</DL>
</DL>
<HR>
<A NAME="ExtendedInstruction(java.lang.String, java.lang.String)"><!-- --></A><H3>
ExtendedInstruction</H3>
<PRE>
public <B>ExtendedInstruction</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;translation)</PRE>
<DL>
<DD>Constructor for ExtendedInstruction, where no instruction description or
compact translation is provided.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>example</CODE> - A String containing example use of the MIPS extended instruction.<DD><CODE>translation</CODE> - Specifications for translating this instruction into a sequence
of one or more MIPS basic instructions.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getInstructionLength()"><!-- --></A><H3>
getInstructionLength</H3>
<PRE>
public int <B>getInstructionLength</B>()</PRE>
<DL>
<DD>Get length in bytes that this extended instruction requires in its
binary form. The answer depends on how many basic instructions it
expands to. This may vary, if expansion includes a nop, depending on
whether or not delayed branches are enabled. Each requires 4 bytes.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../mars/mips/instructions/Instruction.html#getInstructionLength()">getInstructionLength</A></CODE> in class <CODE><A HREF="../../../mars/mips/instructions/Instruction.html" title="class in mars.mips.instructions">Instruction</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>int length in bytes of corresponding binary instruction(s).</DL>
</DD>
</DL>
<HR>
<A NAME="getBasicIntructionTemplateList()"><!-- --></A><H3>
getBasicIntructionTemplateList</H3>
<PRE>
public <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A> <B>getBasicIntructionTemplateList</B>()</PRE>
<DL>
<DD>Get ArrayList of Strings that represent list of templates for
basic instructions generated by this extended instruction.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>ArrayList of Strings.</DL>
</DD>
</DL>
<HR>
<A NAME="getCompactInstructionLength()"><!-- --></A><H3>
getCompactInstructionLength</H3>
<PRE>
public int <B>getCompactInstructionLength</B>()</PRE>
<DL>
<DD>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. The answer depends on
how many basic instructions it expands to. This may vary, if
expansion includes a nop, depending on whether or not delayed
branches are enabled. Each requires 4 bytes.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>int length in bytes of corresponding binary instruction(s).
Returns 0 if an alternative expansion is not defined for this
instruction.</DL>
</DD>
</DL>
<HR>
<A NAME="hasCompactTranslation()"><!-- --></A><H3>
hasCompactTranslation</H3>
<PRE>
public boolean <B>hasCompactTranslation</B>()</PRE>
<DL>
<DD>Determine whether or not this pseudo-instruction has a second
translation optimized for 16 bit address space: a compact version.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getCompactBasicIntructionTemplateList()"><!-- --></A><H3>
getCompactBasicIntructionTemplateList</H3>
<PRE>
public <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A> <B>getCompactBasicIntructionTemplateList</B>()</PRE>
<DL>
<DD>Get ArrayList of Strings that represent list of templates for
basic instructions generated by the "compact" or 16-bit version
of this extended instruction.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>ArrayList of Strings. Returns null if the instruction does not
have a compact alternative.</DL>
</DD>
</DL>
<HR>
<A NAME="makeTemplateSubstitutions(mars.MIPSprogram, java.lang.String, mars.assembler.TokenList)"><!-- --></A><H3>
makeTemplateSubstitutions</H3>
<PRE>
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>makeTemplateSubstitutions</B>(<A HREF="../../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;program,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;template,
<A HREF="../../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A>&nbsp;theTokenList)</PRE>
<DL>
<DD>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. Assumes the extended instruction statement has
been translated from source form to basic assembly form (e.g. register mnemonics
translated to corresponding register numbers).
Operand format of source statement is already verified correct.
Assume the template has correct number and positions of operands.
Template is String with special markers. In the list below, n represents token position (1,2,3,etc)
in source statement (operator is token 0, parentheses count but commas don't):
<UL>
<LI>RGn means substitute register found in n'th token of source statement
<LI>NRn means substitute next higher register than the one in n'th token of source code
<LI>OPn means substitute n'th token of source code as is
<LI>LLn means substitute low order 16 bits from label address in source token n.
<LI>LLnU means substitute low order 16 bits (unsigned) from label address in source token n.
<LI>LLnPm (m=1,2,3,4) means substitute low order 16 bits from label address in source token n, after adding m.
<LI>LHn means substitute high order 16 bits from label address in source token n. Must add 1 if address bit 15 is 1.
<LI>LHnPm (m=1,2,3,4) means substitute high order 16 bits from label address in source token n, after adding m. Must then add 1 if bit 15 is 1.
<LI>VLn means substitute low order 16 bits from 32 bit value in source token n.
<LI>VLnU means substitute low order 16 bits (unsigned) from 32 bit value in source token n.
<LI>VLnPm (m=1,2,3,4) means substitute low order 16 bits from 32 bit value in source token n, after adding m to value.
<LI>VLnPmU (m=1,2,3,4) means substitute low order 16 bits (unsigned) from 32 bit value in source token n, after adding m to value.
<LI>VHLn means substitute high order 16 bits from 32 bit value in source token n. Use this if later combined with low order 16 bits using "ori $1,$1,VLn". See logical and branch operations.
<LI>VHn means substitute high order 16 bits from 32 bit value in source token n, then add 1 if value's bit 15 is 1. Use this only if later instruction uses VLn($1) to calculate 32 bit address. See loads and stores.
<LI>VHLnPm (m=1,2,3,4) means substitute high order 16 bits from 32 bit value in source token n, after adding m. See VHLn.
<LI>VHnPm (m=1,2,3,4) means substitute high order 16 bits from 32 bit value in source token n, after adding m. Must then add 1 if bit 15 is 1. See VHn.
<LI>LLP is similar to LLn, but is needed for "label+100000" address offset. Immediate is added before taking low order 16.
<LI>LLPU is similar to LLnU, but is needed for "label+100000" address offset. Immediate is added before taking low order 16 (unsigned).
<LI>LLPPm (m=1,2,3,4) is similar to LLP except m is added along with mmediate before taking low order 16.
<LI>LHPA is similar to LHn, but is needed for "label+100000" address offset. Immediate is added before taking high order 16.
<LI>LHPN is similar to LHPA, used only by "la" instruction. Address resolved by "ori" so do not add 1 if bit 15 is 1.
<LI>LHPAPm (m=1,2,3,4) is similar to LHPA except value m is added along with immediate before taking high order 16.
<LI>LHL means substitute high order 16 bits from label address in token 2 of "la" (load address) source statement.
<LI>LAB means substitute textual label from last token of source statement. Used for various branches.
<LI>S32 means substitute the result of subtracting the constant value in last token from 32. Used by "ror", "rol".
<LI>DBNOP means Delayed Branching NOP - generate a "nop" instruction but only if delayed branching is enabled. Added in 3.4.1 release.
<LI>BROFFnm means substitute n if delayed branching is NOT enabled otherwise substitute m. n and m are single digit numbers indicating constant branch offset (in words). Added in 3.4.1 release.
</UL>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>template</CODE> - a String containing template for basic statement.<DD><CODE>tokenList</CODE> - a TokenList containing tokens from extended instruction.
<DT><B>Returns:</B><DD>String representing basic assembler statement.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../mars/mips/instructions/BasicInstructionFormat.html" title="class in mars.mips.instructions"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../mars/mips/instructions/Instruction.html" title="class in mars.mips.instructions"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?mars/mips/instructions/ExtendedInstruction.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ExtendedInstruction.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_mars.mips.instructions.Instruction">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>