|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--misim.Instruction
The Instruction class is the basis for all emulated instructions. Each emulated instruction must extend this class, and implement the doIt() method to perform the task for that instruction. The extending class must also set the bitmask, bitvalue, mnemonic, type and asmType member variables in its constructor.
Field Summary | |
int |
address
|
int |
asmType
|
java.lang.String |
assembly
|
int |
bitmask
|
int |
bitMask
|
int |
bits
|
int |
bitvalue
|
static int |
carryBit
|
static int |
decimalBit
|
boolean |
destW
|
int |
literal
|
protected MachineState |
machineState
|
static int |
MAX_PARAMS
|
java.lang.String |
mnemonic
|
int |
opcode
|
static int |
OPERAND_TYPE_ADDRESS
|
static int |
OPERAND_TYPE_BITS
|
static int |
OPERAND_TYPE_ERROR
|
static int |
OPERAND_TYPE_FLAG
|
static int |
OPERAND_TYPE_LITERAL
|
static int |
OPERAND_TYPE_NONE
|
static int |
OPERAND_TYPE_SOURCE_DEST
|
static int |
OPERAND_TYPE_TRIS
|
boolean |
optLoop
|
static int |
pageBit
|
static int |
readBit
|
int |
reg
|
boolean |
regDest
|
boolean |
stepOver
|
int |
type
|
static int |
zeroBit
|
Constructor Summary | |
Instruction()
|
Method Summary | |
java.lang.Object |
clone()
|
void |
complete()
This is called after each instruction completes, and handles any special behaviour of registers that may have been altered by the instruction |
abstract void |
doIt()
This method must be implemented to perform the function of the instruction being emulated. |
java.lang.String |
getMnemonic()
Return this instruction's mnemonic. |
int |
getOpcode()
Return this instruction's opcode |
boolean |
isOneOf(java.lang.String instructionList)
Test to see if this instruction is one of a list of instructions The list is of the standard Pic Mnemonics, and does not change if the mnemonic style changes. |
int |
optionalParams()
Return the number of optional parameters for this instruction |
int |
requiredParams()
Return the number of required parameters to this instruction |
void |
setMachineState(MachineState machineState)
|
void |
setValue(int value)
This method sets the data value of this instruction - that is, it decodes the binary form of the instruction into its possible components |
java.lang.String |
toString()
The returns the disassembled version of the instruction |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected MachineState machineState
public static final int pageBit
public static final int zeroBit
public static final int carryBit
public static final int decimalBit
public static final int readBit
public static final int OPERAND_TYPE_ERROR
public static final int OPERAND_TYPE_NONE
public static final int OPERAND_TYPE_FLAG
public static final int OPERAND_TYPE_SOURCE_DEST
public static final int OPERAND_TYPE_BITS
public static final int OPERAND_TYPE_ADDRESS
public static final int OPERAND_TYPE_LITERAL
public static final int OPERAND_TYPE_TRIS
public static final int MAX_PARAMS
public int type
public int asmType
public java.lang.String mnemonic
public java.lang.String assembly
public int bitmask
public int bitvalue
public int reg
public int literal
public int bits
public int bitMask
public int address
public int opcode
public boolean destW
public boolean regDest
public boolean optLoop
public boolean stepOver
Constructor Detail |
public Instruction()
Method Detail |
public void setMachineState(MachineState machineState)
public abstract void doIt()
public void setValue(int value)
value
- The binary value of the instructionpublic java.lang.String toString()
toString
in class java.lang.Object
public final void complete()
public boolean isOneOf(java.lang.String instructionList)
instructionList
- String list of instructions to test againstpublic java.lang.String getMnemonic()
public int getOpcode()
public int requiredParams()
public int optionalParams()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |