|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmce.sim.cpu.AbstractOpcode
public abstract class AbstractOpcode
Abstract implementation of Opcode interface.
For performance reason this class contain boolean flag to identify subclass it is not very much elegant but use or instanceof is to slow for simulator performance. For example the subclass MultiOpcode in the costructor set the multiOpcode flag and at runtime to identify the class it is enough check the flag and do not require use of instanceof.
Field Summary | |
---|---|
protected java.lang.String |
desc
|
protected int |
length
|
protected boolean |
multiOpcode
Flag to identify subclass MultiOpcode |
protected int |
opcode
|
protected AbstractOpcode[] |
opcodes
Used for MultiOpcode implementation |
protected boolean |
prefixOpcode
Flag to identify subclass PrefixOpcode |
protected boolean |
runtimeOpcode
Flag to identify subclass RuntimeOpcode |
protected int |
times
|
Constructor Summary | |
---|---|
AbstractOpcode(int opcode,
int length,
int times,
java.lang.String desc)
|
Method Summary | |
---|---|
void |
clearCounter()
Clear execution counter |
long |
getCounter()
return execution counter |
java.lang.String |
getDescription()
|
int |
getLength()
|
int |
getMaxLength()
Return the maximum lenght instructions. |
int |
getOpcode()
|
AbstractOpcode |
getOpcode(int code)
Return the opcode with the specified code |
int |
getOpcodeCount()
Get the opcode count |
int |
getTimes()
|
void |
incCounter()
increment exec counter |
boolean |
isMultiOpcode()
|
void |
setDescription(java.lang.String s)
|
void |
setOpcode(AbstractOpcode o)
Set a new opcode |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jmce.sim.Opcode |
---|
exec |
Field Detail |
---|
protected int opcode
protected int length
protected int times
protected java.lang.String desc
protected AbstractOpcode[] opcodes
protected boolean multiOpcode
protected boolean runtimeOpcode
protected boolean prefixOpcode
Constructor Detail |
---|
public AbstractOpcode(int opcode, int length, int times, java.lang.String desc)
Method Detail |
---|
public final int getOpcode()
getOpcode
in interface Opcode
public final int getLength()
getLength
in interface Opcode
public final int getTimes()
getTimes
in interface Opcode
public void setDescription(java.lang.String s)
setDescription
in interface Opcode
public java.lang.String getDescription()
getDescription
in interface Opcode
public void clearCounter()
Opcode
clearCounter
in interface Opcode
public long getCounter()
Opcode
getCounter
in interface Opcode
public final void incCounter()
Opcode
incCounter
in interface Opcode
public java.lang.String toString()
toString
in class java.lang.Object
public final boolean isMultiOpcode()
public final AbstractOpcode getOpcode(int code)
MultiOpcode
public void setOpcode(AbstractOpcode o)
MultiOpcode
public int getMaxLength()
MultiOpcode
public int getOpcodeCount()
MultiOpcode
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |