|
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.intel.i8080.I8080
public class I8080
Intel 8080 Standard.
Required memory
Emulated register : A,F,BC,DE,HL,PC,SP
The 8080 inplementation is tested using the child class
Z80
with Yaze ZEXDOC Z80 exerciser.
For better rediability the mnemonics used on the disassembler are the Z80 mnemonics and not the original Intel 8080.
Field Summary | |
---|---|
int |
A
8080 register |
int |
BC
8080 register |
protected static int[] |
booleanTable
|
int |
DE
8080 register |
int |
F
8080 register |
int |
HL
8080 register |
boolean |
iff1
Interrupt enable flag register. |
boolean |
iff2
Interrupt enable flag register. |
protected static boolean[] |
parityTable
Table with PV flag on accumulator |
int |
PC
8080 register |
int |
SP
8080 register |
Fields inherited from class jmce.sim.cpu.AbstractCPU |
---|
interrupts, io, memory, NS100MS, NS1MS |
Fields inherited from interface jmce.intel.i8080.I8080Constants |
---|
FLAG_3, FLAG_5, FLAG_C, FLAG_H, FLAG_N, FLAG_PV, FLAG_S, FLAG_Z |
Fields inherited from interface jmce.sim.CPU |
---|
BIG_ENDIAN, IO_MEMORY, LITTLE_ENDIAN, MAIN_MEMORY |
Constructor Summary | |
---|---|
I8080()
Default constructor |
|
I8080(java.lang.String name)
Costructor with specified name. |
Method Summary | |
---|---|
protected int |
adc16(int a,
int b,
int c)
16 bit addition with carry |
void |
adc8(int b,
int c)
Add 8 bit with carry. |
int |
add16(int a,
int b)
16 bit addition |
void |
add8(int b)
8 bit addition |
int |
af()
Return the AF register |
protected void |
af(int v)
Set the value of AF register. |
void |
and(int value)
Logical and |
protected void |
b(int v)
Set the value of B register |
protected void |
c(int v)
Set the value of C register |
void |
ccf()
Complement Carry Flag |
void |
cp(int v)
Compare value with accumulator. |
void |
cpl()
Complement accumulator. |
protected void |
d(int v)
Set the value of D register. |
void |
daa()
Decimal Adjust after addition. |
int |
dec(int value)
8 Bit decrement |
protected void |
e(int v)
Set the value of E register. |
protected void |
f(int value)
Set the value of F register. |
int |
fireISR(Interrupt isr)
This function must be overridden from sub class that implements interrupt. |
int |
fireNMI(Interrupt isr)
This function must be overridden from sub class that implements NMI interrupt. |
protected boolean |
FLAG_3()
Return the undocumented bit 3 of flag. |
protected void |
FLAG_3(boolean value)
Set the undocumented bit 3 of flag. |
protected boolean |
FLAG_5()
Return the undocumented bit 5 of flag. |
protected void |
FLAG_5(boolean value)
Set the undocumented bit 5 of flag. |
protected boolean |
FLAG_C()
Return the value of CF |
protected void |
FLAG_C(boolean value)
Set the value of CF |
protected boolean |
FLAG_H()
Return the HF flag. |
protected void |
FLAG_H(boolean value)
Set the HF flag. |
protected boolean |
FLAG_N()
Return the NF flag. |
protected void |
FLAG_N(boolean value)
Set the NF flag. |
protected boolean |
FLAG_S()
Return the SF flag. |
protected void |
FLAG_S(boolean value)
Set the SF flag. |
protected boolean |
FLAG_V()
Return the status of PV flag. |
protected void |
FLAG_V(boolean value)
Set the PV flag. |
protected boolean |
FLAG_Z()
Return the statu of the ZF |
protected void |
FLAG_Z(boolean value)
Set the ZF flag. |
java.lang.String |
getCCC(int opcode)
|
boolean |
getFlagCCC(int opcode)
|
int |
getPortHI()
Return the 8 High bit for I/O operations. |
java.lang.String |
getPP(int opcode)
|
java.lang.String |
getQQ(int opcode)
|
java.lang.String |
getRRR(int opcode)
|
int |
getValuePP(int opcode)
|
int |
getValueQQ(int opcode)
|
int |
getValueRRR(int opcode)
|
int |
getWord(int a)
Read one word (16 bit) from the main memory. |
protected void |
h(int v)
Set the value of H register |
protected int |
in(int portLOW,
int portHI)
Read a I/O port. |
int |
inc(int value)
8 Bit increment |
void |
init(Hardware parent)
Initialize the hardware. |
protected void |
initMemories()
Initialize all required memories. |
protected void |
initOpcodeDecoder()
|
protected void |
initOpcodes()
|
protected void |
initPeripherals()
Initialize all peripherals. |
protected void |
initRegisters()
Initialize all standard intel 8080 register. |
boolean |
isInterruptEnabled()
Return the status of the interrupt enable |
protected void |
l(int v)
Set the value of L register |
void |
or(int value)
Logical or |
void |
out(int portLow,
int portHI,
int value)
Output one byte to the specfied port. |
int |
pc()
Return the register used as program counter |
void |
pc(int pc)
Set the program counter. |
int |
pop()
Pop a WORD (16 bit) from the stack and return it. |
protected void |
push(int value)
Push a WORD (16 bit) on the stack. |
protected void |
resetRegisters()
Reset all register to default value. |
int |
rl(int value)
9 bit left rotation |
void |
rla()
|
protected int |
rlc(int value)
8 bit left rotation |
void |
rlca()
|
protected int |
rr(int value)
9 bit right rotate. |
void |
rra()
|
int |
rrc(int value)
8 bit right rotate |
void |
rrca()
|
int |
sbc16(int a,
int b,
int c)
16 bit sub with carry |
void |
sbc8(int b,
int c)
Sub 8 bit with carry |
void |
scf()
Set carry flag |
void |
setValuePP(int opcode,
int value)
|
void |
setValueQQ(int opcode,
int value)
|
void |
setValueRRR(int opcode,
int value)
|
void |
setWord(int a,
int v)
Set one word (16 bit) in the main memory |
void |
sub8(int b)
Sub 8 bit |
void |
xor(int value)
Logical xor |
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 |
Field Detail |
---|
public int A
public int F
public int BC
public int DE
public int HL
public int PC
public int SP
public boolean iff1
public boolean iff2
protected static final boolean[] parityTable
protected static int[] booleanTable
Constructor Detail |
---|
public I8080()
public I8080(java.lang.String name)
Set all requested value for the intel 8080 cpu.
Method Detail |
---|
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
public final void pc(int pc)
CPU
pc
in interface CPU
pc
- - New value for the program counter.public final int pc()
CPU
pc
in interface CPU
protected final boolean FLAG_C()
protected final void FLAG_C(boolean value)
protected final boolean FLAG_Z()
protected final boolean FLAG_V()
protected final boolean FLAG_S()
protected final boolean FLAG_H()
protected final void FLAG_Z(boolean value)
protected final void FLAG_S(boolean value)
protected void FLAG_H(boolean value)
protected final void FLAG_V(boolean value)
protected final boolean FLAG_N()
protected final void FLAG_N(boolean value)
protected final boolean FLAG_3()
protected final boolean FLAG_5()
protected final void FLAG_5(boolean value)
protected final void FLAG_3(boolean value)
protected void initMemories()
Add the MAIN_MEMORY and the IO_MEMORY if sub class override this method to change the type of memory must first add the required memories and then call the parent method.
protected void initRegisters()
protected final void h(int v)
protected final void l(int v)
protected final void b(int v)
protected final void c(int v)
protected final void d(int v)
protected final void e(int v)
protected final void f(int value)
public final int af()
protected final void af(int v)
public final boolean isInterruptEnabled()
CPU
isInterruptEnabled
in interface CPU
protected void initPeripherals() throws SIMException
This method do nothing because the Intel 8080 do not have any internal peripheral.
SIMException
public void init(Hardware parent) throws SIMException
Hardware
init
in interface Hardware
init
in class AbstractCPU
parent
- Parent of this hardware.
SIMException
protected final void push(int value) throws SIMException
SIMException
public final int pop() throws SIMException
SIMException
public final int getPortHI()
public final void out(int portLow, int portHI, int value) throws SIMException
portLow
- - 8 Bit low port address.portHI
- - 8 Bit hi port address.value
- - Value to write.
SIMException
protected final int in(int portLOW, int portHI) throws SIMException
portLOW
- - 8 Bit low port address.portHI
- - 8 Bit port high address.
SIMException
public final void daa()
public final int rl(int value)
protected final int rlc(int value)
protected final int rr(int value)
public final void rla()
public final void rra()
public final void rlca()
public final void rrca()
public final int rrc(int value)
protected void resetRegisters() throws SIMException
AbstractCPU
resetRegisters
in class AbstractCPU
SIMException
public final void or(int value)
public final void scf()
public final void ccf()
public final void cpl()
public final void xor(int value)
public final void and(int value)
public final void add8(int b)
public final void adc8(int b, int c)
public final void sub8(int b)
public final void sbc8(int b, int c)
public final void cp(int v)
public final int inc(int value)
public final int dec(int value)
public final int sbc16(int a, int b, int c)
public final int add16(int a, int b)
protected final int adc16(int a, int b, int c)
public final void setValuePP(int opcode, int value)
public final boolean getFlagCCC(int opcode)
public java.lang.String getCCC(int opcode)
public final void setValueQQ(int opcode, int value)
public java.lang.String getPP(int opcode)
public final int getValuePP(int opcode)
public java.lang.String getQQ(int opcode)
public final int getValueQQ(int opcode)
public java.lang.String getRRR(int opcode)
public final int getValueRRR(int opcode) throws SIMException
SIMException
public final void setValueRRR(int opcode, int value) throws SIMException
SIMException
protected void initOpcodeDecoder()
protected void initOpcodes()
public int fireISR(Interrupt isr) throws SIMException
AbstractCPU
fireISR
in interface CPU
fireISR
in class AbstractCPU
SIMException
public int fireNMI(Interrupt isr) throws SIMException
AbstractCPU
fireNMI
in interface CPU
fireNMI
in class AbstractCPU
SIMException
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |