|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmce.sim.AbstractHardware
jmce.sim.cpu.AbstractCPU
jmce.mos.M6502
public class M6502
MOS 6502
Emulated register : A,X,Y,P,S,PC
The 6502 have one one memory used as program data and i/o space.
Field Summary |
---|
Fields inherited from class jmce.sim.cpu.AbstractCPU |
---|
interrupts, io, memory, NS100MS, NS1MS |
Fields inherited from interface jmce.mos.M65XXConstants |
---|
BRK_VECTOR, IRQ_VECTOR, NMI_VECTTOR, P_B, P_C, P_D, P_E, P_I, P_S, P_V, P_Z, RESET_VECTOR, S_PAGE, Z_PAGE |
Fields inherited from interface jmce.sim.CPU |
---|
BIG_ENDIAN, IO_MEMORY, LITTLE_ENDIAN, MAIN_MEMORY |
Constructor Summary | |
---|---|
M6502()
|
Method Summary | |
---|---|
void |
dumpStatistics(java.io.PrintStream ps)
Dump cpu execution statistics in the specified stream. |
int |
fireISR(Interrupt irq)
This function must be overridden from sub class that implements interrupt. |
int |
getWord(int a)
Read one word (16 bit) from the main memory. |
void |
init(Hardware parent)
Initialize the hardware. |
protected void |
initMemories()
|
protected void |
initPeripherals()
No peripherals are build in on 6502 this function is present only for compatibility |
protected void |
initRegisters()
|
boolean |
isInterruptEnabled()
Return the status of the interrupt enable |
int |
pc()
Return the register used as program counter |
void |
pc(int pc)
Set the program counter. |
protected int |
pop()
Pop a 8 bit value from the stack. |
protected int |
pop16()
Pop a word (16 bit) from the stack |
protected void |
push(int value)
Push a 8 bit value on the stack. |
protected void |
push16(int value)
Push a word (16 bit) on the stack |
void |
reset()
Reset the CPU and call all installed ResetListener. |
void |
setWord(int a,
int v)
Set one word (16 bit) in the main memory |
int |
vectorToAddress(int irq)
Convert one irq number to the memory address. |
Methods inherited from class jmce.sim.AbstractHardware |
---|
addHardware, createFrame, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jmce.sim.Hardware |
---|
addHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName |
Constructor Detail |
---|
public M6502()
Method Detail |
---|
public int vectorToAddress(int irq) throws SIMException
irq
- Interrupt request number.
SIMException
public void reset() throws SIMException
AbstractCPU
Reset is performed in this order :
reset
in interface Hardware
reset
in class AbstractCPU
SIMException
public final void setWord(int a, int v) throws SIMException
CPU
setWord
in interface CPU
a
- - Addressv
- - value
SIMException
public final int getWord(int a) throws SIMException
CPU
getWord
in interface CPU
a
- - Address
SIMException
protected void initRegisters()
public void init(Hardware parent) throws SIMException
Hardware
init
in interface Hardware
init
in class AbstractCPU
parent
- Parent of this hardware.
SIMException
protected void initPeripherals() throws SIMException
SIMException
protected void initMemories() throws SIMException
SIMException
protected void push16(int value) throws SIMException
SIMException
protected int pop16() throws SIMException
SIMException
protected void push(int value) throws SIMException
SIMException
protected int pop() throws SIMException
SIMException
public void pc(int pc) throws SIMException
CPU
pc
in interface CPU
pc
- - New value for the program counter.
SIMException
public int pc() throws SIMException
CPU
pc
in interface CPU
SIMException
public int fireISR(Interrupt irq) throws SIMException
AbstractCPU
fireISR
in interface CPU
fireISR
in class AbstractCPU
SIMException
public boolean isInterruptEnabled()
CPU
isInterruptEnabled
in interface CPU
public void dumpStatistics(java.io.PrintStream ps)
AbstractCPU
dumpStatistics
in class AbstractCPU
ps
- - The print stream.
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |