|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jfrace.cpu.MC6502
The 6502 microprocessor.
Field Summary | |
static int |
A
Index of register A (accumulator). |
static int |
B_POS
Bit position of the break flag. |
static int |
C_POS
Bit position of the carry flag. |
static int |
D_POS
Bit position of the decimal mode flag. |
static int |
I_POS
Bit position of the interrupt disable flag. |
static int |
N_POS
Bit position of the negative flag. |
static int |
P
Index of register P (processor status). |
static int |
PC
Index of register PC (pogram counter). |
static int |
S
Index of register S (stack pointer). |
static int |
V_POS
Bit position of the overflow flag. |
static int |
X
Index of register X (index register). |
static int |
Y
Index of register X (index register). |
static int |
Z_POS
Bit position of the zero flag. |
Constructor Summary | |
MC6502()
|
Method Summary | |
int |
disassemble(java.lang.StringBuffer sb,
int address)
Disassemble the next op-code at the given address and append it to the given string buffer. |
AddressSpace |
getAddressSpace()
Get the address space. |
java.lang.String |
getErrorDescription()
Return error description. |
java.lang.String |
getName()
Return "6502". |
int |
getNumberOfBits()
Return 8. |
int |
getNumberOfRegisters()
Return 6. |
Register |
getProgramCounter()
Return the program counter. |
Register |
getRegister(int index)
Return a register. |
void |
interrupt(long interrupt)
Not implemented. |
int |
next()
Proceed one opcode further. |
void |
reset()
Reset the hardware. |
void |
setAddressSpace(AddressSpace addressSpace)
Set the address space. |
void |
setRegisterValue(int index,
int value)
Set the value of a register. |
boolean |
supportsDisassembling()
Disassembling is supported. |
java.lang.String |
toString()
Return the state of the CPU as a well-formed string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int A
A
(accumulator).public static final int X
X
(index register).public static final int Y
X
(index register).public static final int S
S
(stack pointer).public static final int P
P
(processor status).public static final int PC
PC
(pogram counter).public static final int N_POS
public static final int V_POS
public static final int B_POS
public static final int D_POS
public static final int I_POS
public static final int Z_POS
public static final int C_POS
Constructor Detail |
public MC6502()
Method Detail |
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
getName
in interface CPU
public int getNumberOfBits()
getNumberOfBits
in interface Hardware
public int getNumberOfRegisters()
getNumberOfRegisters
in interface CPU
public Register getRegister(int index)
CPU
getRegister
in interface CPU
jfrace.CPU
index
- Index of the register.null
if no register exists for the
given index.public Register getProgramCounter()
CPU
getProgramCounter
in interface CPU
public void setRegisterValue(int index, int value)
CPU
setRegisterValue
in interface CPU
jfrace.CPU
index
- Index of the register.value
- New value.public void setAddressSpace(AddressSpace addressSpace)
CPU
setAddressSpace
in interface CPU
public AddressSpace getAddressSpace()
CPU
getAddressSpace
in interface CPU
public void reset()
Hardware
reset
in interface Hardware
public void interrupt(long interrupt)
interrupt
in interface CPU
jfrace.CPU
interrupt
- Bit pattern of the interrupt. The meaning of
the bits depend on the implementation.public java.lang.String getErrorDescription()
CPU
CPU.next()
returns -1
.getErrorDescription
in interface CPU
public int next()
CPU
next
in interface CPU
jfrace.CPU
-1
if an error occured.public boolean supportsDisassembling()
supportsDisassembling
in interface CPU
public int disassemble(java.lang.StringBuffer sb, int address)
CPU
disassemble
in interface CPU
jfrace.CPU
sb
- String buffer.address
- Address of op-code.address
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |