public abstract class IsaPrimitive
extends java.lang.Object
IsaPrimitive
class implements base functionality of addressing modes
and operations.Constructor and Description |
---|
IsaPrimitive()
Constructs a primitive.
|
IsaPrimitive(java.util.Map<java.lang.String,IsaPrimitive> arguments)
Constructs a primitive and saves the table of its arguments.
|
Modifier and Type | Method and Description |
---|---|
Location |
access() |
Location |
access(ProcessingElement processingElement,
TemporaryVariables temporaryVariables)
Returns the location the primitive object points to (when initialized with specific
parameters).
|
protected void |
action(ProcessingElement processingElement,
TemporaryVariables temporaryVariables)
Runs the action associated with the primitive.
|
protected void |
addArgument(java.lang.String name,
IsaPrimitive value)
Registers an argument in the argument table.
|
protected Location |
annotate(Location location,
TemporaryVariables tempVars) |
void |
decode(TemporaryVariables temporaryVariables)
Provides a hint to construct the decoder.
|
void |
execute(ProcessingElement processingElement,
TemporaryVariables temporaryVariables)
Runs execution of the current primitive's action.
|
java.util.Map<java.lang.String,IsaPrimitive> |
getArguments()
Returns the primitive argument table.
|
static java.lang.String |
getCurrentOperation()
Returns the name of the currently executed primitive or an empty
string if no primitive is being executed.
|
java.lang.String |
getName()
Returns the primitive name.
|
java.lang.String |
image(TemporaryVariables temporaryVariables)
Returns binary representation of the specified primitive.
|
void |
init(TemporaryVariables temporaryVariables)
Performs initialization of temporary variables that can be used in other attributes
except for
decode (action , syntax , and image ). |
protected void |
setLabelReference(LabelReference labelReference) |
protected java.lang.String |
syntax(TemporaryVariables temporaryVariables)
Returns assembly format of the specified primitive.
|
java.lang.String |
text(TemporaryVariables temporaryVariables)
Returns assembly text of the specified primitive.
|
public IsaPrimitive(java.util.Map<java.lang.String,IsaPrimitive> arguments)
arguments
- Primitive arguments.java.lang.IllegalArgumentException
- if the parameter is null
.public IsaPrimitive()
public static java.lang.String getCurrentOperation()
public final java.lang.String getName()
public final java.util.Map<java.lang.String,IsaPrimitive> getArguments()
protected final void addArgument(java.lang.String name, IsaPrimitive value)
name
- Argument name.value
- Argument.java.lang.IllegalArgumentException
- if any of the parameters is null
.protected final void setLabelReference(LabelReference labelReference)
public void init(TemporaryVariables temporaryVariables)
decode
(action
, syntax
, and image
).
This attribute is implicitly called inside of the above mentioned attributes.
When needed, it can be called explicitly by other primitives.temporaryVariables
- temporary variables.public void decode(TemporaryVariables temporaryVariables)
temporaryVariables
- temporary variables.public final java.lang.String text(TemporaryVariables temporaryVariables)
temporaryVariables
- temporary variables.protected java.lang.String syntax(TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that have no explicitly specified syntax attribute. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
temporaryVariables
- temporary variables.public java.lang.String image(TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that have no explicitly specified image attribute. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
temporaryVariables
- temporary variables.public final void execute(ProcessingElement processingElement, TemporaryVariables temporaryVariables)
processingElement
- Processing element instance.temporaryVariables
- Temporary variables.protected void action(ProcessingElement processingElement, TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that have no explicitly specified action attribute. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
processingElement
- Processing element instance.temporaryVariables
- Temporary variables.public Location access(ProcessingElement processingElement, TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that do not have a return expression. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
processingElement
- Processing element instance.temporaryVariables
- Temporary variables.public final Location access()
protected final Location annotate(Location location, TemporaryVariables tempVars)