jmce - 1_02

jmce.intel.i8086
Class I8086

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.cpu.AbstractCPU
          extended by jmce.intel.i8086.I8086
All Implemented Interfaces:
java.lang.Runnable, I8086Constants, BreakPointListener, CPU, Hardware, InterruptManager
Direct Known Subclasses:
PCXT

public class I8086
extends AbstractCPU
implements I8086Constants

Intel 8086

Memory required :

Implemented register : AX,BX,CX,DX,BP,SI,DI,ES,CS,DS,SS,SP,IP,F

Version:
1.00
Author:
Mario Viara

Field Summary
 int AX
          General register
 int BP
          Special register
 int BX
          General register
 int CS
          Segment register
 int CX
          General register
 int DI
          Index register
 int DS
          Segment register
 int DX
          General register
 int ES
          Segment register
 int F
          Special register
 int IP
          Special register
 int SI
          Index register
 int SP
          Special register
 int SS
          Segment register
 
Fields inherited from class jmce.sim.cpu.AbstractCPU
interrupts, io, memory, NS100MS, NS1MS
 
Fields inherited from interface jmce.intel.i8086.I8086Constants
AX_R, BP_R, BX_R, CS_R, CX_R, DI_R, DS_R, DX_R, ES_R, F_AF, F_CF, F_DF, F_IF, F_OF, F_PF, F_R1, F_R3, F_R5, F_SF, F_TF, F_ZF, REPE_P, REPNE_P, RESET_CS, RESET_IP, SI_R, SP_R, SS_R
 
Fields inherited from interface jmce.sim.CPU
BIG_ENDIAN, IO_MEMORY, LITTLE_ENDIAN, MAIN_MEMORY
 
Constructor Summary
I8086()
           
 
Method Summary
protected  int add16(int a, int b)
           
protected  int add8(int a, int b)
           
protected  Runtime8086 createRuntime()
          CPU implementing istruction with RuntimeOpcode must in this method create the appropriate runtime class.
 int get_cd(int pc)
          Get operand ssss:oooo
 java.lang.String get_ew(Runtime8086 r)
           
 int getByte(int s, int a)
           
 int getSegBase(int s)
           
protected  int getValue_eb(Runtime8086 r)
           
protected  int getValue_ew(Runtime8086 r)
           
 int getValue_rb(int r)
           
 int getValue_rw(int opcode)
           
 int getWord(int a)
          Read one word (16 bit) from the main memory.
 int getWord(int s, int a)
           
 void init(Hardware parent)
          Initialize the hardware.
protected  void initMemories()
           
protected  void initOpcodeALU(int base, int time, java.lang.String desc, jmce.intel.i8086.I8086.ALUOP op)
           
protected  void initOpcodeDecoder()
           
protected  void initOpcodes()
           
protected  void initPeripherals()
           
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.
 void setByte(int s, int a, int v)
           
protected  void setValue_eb(Runtime8086 r, int value)
           
protected  void setValue_ew(Runtime8086 r, int value)
           
 void setValue_rb(int r, int v)
           
 void setValue_rw(int r, int value)
          Set value for operand rw (word register)
protected  void setValue_sw(Runtime8086 r, int value)
           
 void setWord(int a, int v)
          Set one word (16 bit) in the main memory
 void setWord(int s, int a, int v)
           
protected  int sub16(int a, int b)
           
protected  int sub8(int a, int b)
           
protected  int xor16(int a, int b)
           
protected  int xor8(int a, int b)
           
 
Methods inherited from class jmce.sim.cpu.AbstractCPU
abort, addCycleListener, addDecoder, addExceptionListener, addExecBreakPoint, addInterrupt, addIOReadListener, addIOReadListener, addIOWriteListener, addIOWriteListener, addLoader, addMemoryWriteListener, addOffset, addReadBreakPoint, addRegister, addResetListener, addTimerCycle, addTimerMs, addTraceListener, addWriteBreakPoint, bit0, bit7, breakPointEvent, decodeAt, destroy, dumpStatistics, dumpStatistics, dumpTitle, dumpValue, dumpValue, fetch, fireISR, fireNMI, formatFrequence, getBreakPointAt, getBreakPointCount, getByte, getCallListener, getClock, getClockPerCycle, getCycle, getCycleMillis, getDecoderAt, getDecoderCount, getEndian, getExceptionListenerAt, getExceptionListenerCount, getExecStatistics, getInterruptCount, getInterruptCounter, getInterruptName, getIOByte, getLenghtAt, getMemory, getMemoryAt, getMemoryCount, getMemoryForName, getOpcodeAt, getOpcodes, getRealTime, getRegisterAt, getRegisterCount, getRegisterForName, getResetAddress, getUsage, getUsageDesc, getWordBig, getWordLittle, halt, idle, isBigEndian, isLittleEndian, isRunning, load, load, notifyInterrupt, removeBreakPoint, removeBreakPoint, removeExceptionListener, removeTraceListener, reset, resetRegisters, run, run0, setByte, setCallListener, setClock, setClockPerCycle, setEndian, setIO, setIOByte, setMemory, setOpcode, setRealTime, setResetAddress, setStatusLine, setTill, start, step, step0, stepNoBreak, stop
 
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

F

public int F
Special register


IP

public int IP
Special register


SP

public int SP
Special register


BP

public int BP
Special register


SI

public int SI
Index register


DI

public int DI
Index register


AX

public int AX
General register


BX

public int BX
General register


CX

public int CX
General register


DX

public int DX
General register


CS

public int CS
Segment register


DS

public int DS
Segment register


SS

public int SS
Segment register


ES

public int ES
Segment register

Constructor Detail

I8086

public I8086()
Method Detail

setWord

public final void setWord(int a,
                          int v)
                   throws SIMException
Description copied from interface: CPU
Set one word (16 bit) in the main memory

Specified by:
setWord in interface CPU
Parameters:
a - - Address
v - - value
Throws:
SIMException

getWord

public final int getWord(int a)
                  throws SIMException
Description copied from interface: CPU
Read one word (16 bit) from the main memory.

Specified by:
getWord in interface CPU
Parameters:
a - - Address
Returns:
The word at the specified address.
Throws:
SIMException

initPeripherals

protected void initPeripherals()
                        throws SIMException
Throws:
SIMException

initMemories

protected void initMemories()

init

public void init(Hardware parent)
          throws SIMException
Description copied from interface: Hardware
Initialize the hardware. This method must be called before any use of the interface. Only set ... / get ... method are allowed to be called before the intialization.

Specified by:
init in interface Hardware
Overrides:
init in class AbstractCPU
Parameters:
parent - Parent of this hardware.
Throws:
SIMException

initOpcodeALU

protected void initOpcodeALU(int base,
                             int time,
                             java.lang.String desc,
                             jmce.intel.i8086.I8086.ALUOP op)

add8

protected final int add8(int a,
                         int b)

add16

protected final int add16(int a,
                          int b)

sub8

protected final int sub8(int a,
                         int b)

sub16

protected final int sub16(int a,
                          int b)

xor8

protected final int xor8(int a,
                         int b)

xor16

protected final int xor16(int a,
                          int b)

initOpcodes

protected void initOpcodes()

setValue_sw

protected void setValue_sw(Runtime8086 r,
                           int value)

getSegBase

public int getSegBase(int s)
               throws SIMException
Throws:
SIMException

setByte

public void setByte(int s,
                    int a,
                    int v)
             throws SIMException
Throws:
SIMException

setWord

public void setWord(int s,
                    int a,
                    int v)
             throws SIMException
Throws:
SIMException

getWord

public int getWord(int s,
                   int a)
            throws SIMException
Throws:
SIMException

getByte

public int getByte(int s,
                   int a)
            throws SIMException
Throws:
SIMException

get_ew

public java.lang.String get_ew(Runtime8086 r)
                        throws SIMException
Throws:
SIMException

setValue_eb

protected void setValue_eb(Runtime8086 r,
                           int value)
                    throws SIMException
Throws:
SIMException

setValue_ew

protected void setValue_ew(Runtime8086 r,
                           int value)
                    throws SIMException
Throws:
SIMException

getValue_ew

protected int getValue_ew(Runtime8086 r)
                   throws SIMException
Throws:
SIMException

getValue_eb

protected int getValue_eb(Runtime8086 r)
                   throws SIMException
Throws:
SIMException

initOpcodeDecoder

protected void initOpcodeDecoder()

initRegisters

protected void initRegisters()

isInterruptEnabled

public boolean isInterruptEnabled()
Description copied from interface: CPU
Return the status of the interrupt enable

Specified by:
isInterruptEnabled in interface CPU

pc

public final void pc(int pc)
Description copied from interface: CPU
Set the program counter.

Specified by:
pc in interface CPU
Parameters:
pc - - New value for the program counter.

pc

public int pc()
Description copied from interface: CPU
Return the register used as program counter

Specified by:
pc in interface CPU
Returns:
- Program counter.

getValue_rb

public int getValue_rb(int r)

getValue_rw

public int getValue_rw(int opcode)

setValue_rb

public void setValue_rb(int r,
                        int v)

setValue_rw

public void setValue_rw(int r,
                        int value)
Set value for operand rw (word register)


get_cd

public int get_cd(int pc)
           throws SIMException
Get operand ssss:oooo

Throws:
SIMException

createRuntime

protected Runtime8086 createRuntime()
                             throws SIMException
Description copied from class: AbstractCPU
CPU implementing istruction with RuntimeOpcode must in this method create the appropriate runtime class.

Overrides:
createRuntime in class AbstractCPU
Throws:
SIMException

jmce - 1_02