public abstract class Instruction extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
opcode |
Modifier | Constructor and Description |
---|---|
protected |
Instruction(int opcode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static String |
decodeOp(int opcode)
Get the symbolic name of an opcode.
|
static int |
decodeOpcodeName(String opcodeName)
Decode an opcode name into a numeric constant.
|
int |
getImmediate() |
int |
getOpcode() |
Object |
getOperand(int index)
Get one of the instruction's non-immediate operands.
|
int |
getOperandCount() |
Label |
getTarget()
Get the target of a branch instruction.
|
boolean |
hasOperands() |
boolean |
isBranch()
Is this a branch instruction?
|
boolean |
isExecutable() |
boolean |
isImmediate()
determine if instruction has immediate operands.
|
boolean |
isReturn()
Is this one of the return instructions?
|
boolean |
isTargetableInstruction()
Test whether this instructions opcode is targetable
|
boolean |
isTransferOfControl()
Is this a transfer of control?
|
void |
setImmediate(int immediate)
Set the immediate field of a local register access instruction.
|
void |
setOperands(Object[] operands)
Set this Instruction's operands.
|
void |
setTarget(Label target)
Set the target of a branch instruction.
|
void |
setTempRegisters(Object[] tempregs)
Set the temporary register operands of a hasnext2 instruction.
|
String |
toString() |
protected void |
unsupported(String diagnostic) |
protected int opcode
ABCConstants
public static int decodeOpcodeName(String opcodeName)
opcodeName
- - the name of the opcode.public static String decodeOp(int opcode)
public int getOpcode()
for opcodes.
public boolean isImmediate()
public int getImmediate()
public Label getTarget()
public void setTarget(Label target)
target
- - the AET Label this instruction targets.public Object getOperand(int index)
index
- - the index of the desired operand.IllegalStateException
- if the instruction has no operands.public int getOperandCount()
public boolean hasOperands()
public void setOperands(Object[] operands)
public boolean isBranch()
public boolean isReturn()
public boolean isTransferOfControl()
public void setImmediate(int immediate)
public void setTempRegisters(Object[] tempregs)
public boolean isExecutable()
public boolean isTargetableInstruction()
public String toString()
protected void unsupported(String diagnostic)
Copyright © 2016 The Apache Software Foundation. All rights reserved.