|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.models.pic.PicDecode
PicDecode - Decode instruction. Just split the instruction word into pieces for the different units.
Currently, all fields are decoded for all instructions. Profiling shows that this is not a performance problem.
This class also contains some disassembler support. To disassemble an instruction, first call decode( opcode ), then disassamble().
Field Summary | |
static int |
ADDLW
|
static int |
ADDWF
|
static int |
ALUACTION
The four different instruction types |
static int |
ANDLW
|
static int |
ANDWF
|
static java.lang.String[] |
bank0Names
|
static java.lang.String[] |
bank1Names
|
static int |
BCF
|
static int |
BITACTION
|
static int |
BSF
|
static int |
BTFSC
|
static int |
BTFSS
|
static int |
CALL
|
static int |
CLRF
|
static int |
CLRW
|
static int |
CLRWDT
|
static int |
COMF
|
static int |
DECF
|
static int |
DECFSZ
|
static int |
GOTO
|
static int |
INCF
|
static int |
INCFSZ
|
static int |
IORLW
|
static int |
IORWF
|
static int |
JUMPACTION
|
static int |
LITERALACTION
|
static int |
MOVF
|
static int |
MOVLW
|
static int |
MOVWF
|
static int |
NOP
|
static int |
RETFIE
|
static int |
RETLW
|
static int |
RETURN
|
static int |
RLF
|
static int |
RRF
|
static int |
SLEEP
|
static int |
SUBLW
|
static int |
SUBWF
|
static int |
SWAPF
|
static int |
XORLW
|
static int |
XORWF
|
Constructor Summary | |
PicDecode(PicByteReg _statusReg)
Constructor, do reset |
Method Summary | |
void |
decode(int word)
decode splits the given instruction into the needed parts |
java.lang.String |
disassemble()
convert the current instruction into a Microchip assembler notation. |
java.lang.String |
disassembleAluInstruction()
|
java.lang.String |
disassembleBitInstruction()
|
java.lang.String |
disassembleJumpInstruction()
|
java.lang.String |
disassembleLiteralInstruction()
|
void |
dump(java.io.PrintStream out)
Write everything |
int |
getAddress()
Get address for absolute addressing |
int |
getAluOperation()
Get ALU-operation |
int |
getBitNumber()
Get bitNumber for bit operations |
int |
getBitOperation()
Get Bit-operation |
int |
getDecoded()
Get the word that was decoded last |
int |
getDestination()
Get ALU-destination |
int |
getInstruction()
Get instruction for further decode |
int |
getJumpOperation()
Get Jump-operation |
java.lang.String |
getJumpTarget()
|
int |
getLiteral()
Get literal for literal operations |
int |
getRegister()
Get register-number for register operations |
void |
por()
|
void |
reset()
Reset, init with NOP |
void |
setEprom(PicEprom _eprom)
|
int |
splitWord(int word,
int lsb,
int size)
Get a part of a word, beginning with lsb and size bits |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALUACTION
public static final int BITACTION
public static final int JUMPACTION
public static final int LITERALACTION
public static final int NOP
public static final int RETURN
public static final int RETFIE
public static final int SLEEP
public static final int CLRWDT
public static final int MOVWF
public static final int CLRW
public static final int CLRF
public static final int SUBWF
public static final int DECF
public static final int IORWF
public static final int ANDWF
public static final int XORWF
public static final int ADDWF
public static final int MOVF
public static final int COMF
public static final int INCF
public static final int DECFSZ
public static final int RRF
public static final int RLF
public static final int SWAPF
public static final int INCFSZ
public static final int BCF
public static final int BSF
public static final int BTFSC
public static final int BTFSS
public static final int CALL
public static final int GOTO
public static final int MOVLW
public static final int RETLW
public static final int IORLW
public static final int ANDLW
public static final int XORLW
public static final int SUBLW
public static final int ADDLW
public static final java.lang.String[] bank0Names
public static final java.lang.String[] bank1Names
Constructor Detail |
public PicDecode(PicByteReg _statusReg)
Method Detail |
public void setEprom(PicEprom _eprom)
public void por()
public void reset()
public int splitWord(int word, int lsb, int size)
public void decode(int word)
public int getDecoded()
public int getRegister()
public int getDestination()
public int getBitNumber()
public int getLiteral()
public int getAddress()
public int getInstruction()
public int getAluOperation()
public int getBitOperation()
public int getJumpOperation()
public void dump(java.io.PrintStream out)
public java.lang.String disassemble()
public java.lang.String disassembleAluInstruction()
public java.lang.String disassembleBitInstruction()
public java.lang.String disassembleJumpInstruction()
public java.lang.String getJumpTarget()
public java.lang.String disassembleLiteralInstruction()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |