jmce - 1_02

jmce.sim
Class Interrupt

java.lang.Object
  extended by jmce.sim.Interrupt
Direct Known Subclasses:
INT, Interrupt8051, IRQ6502, NMI

public class Interrupt
extends java.lang.Object

General interrupt.

Since version 1.01 is not an interface but a complete class.

When the constructor is called the interrupt is added to the specified InterruptManager (normally the CPU) and the interrupt will be fired when the 2 properties enabled and active are both true.

Version:
1.03
Author:
Mario Viara

Field Summary
protected  int vector
           
 
Constructor Summary
Interrupt(InterruptManager cpu, java.lang.String name)
           
Interrupt(InterruptManager cpu, java.lang.String name, int vector)
           
Interrupt(InterruptManager mgr, java.lang.String name, int vector, boolean nmi)
          Constructor with all parameter
 
Method Summary
 void addInterruptManager(InterruptManager mgr)
          Add a new interrupt manager to this interrupt.
protected  void checkReady()
          Called when the enabled or the active property is changed.
 int getCounter()
          Return the number of interrupt occured.
 java.lang.String getName()
          Return the interrupt name
 int getVector()
          Return the interrupt vector.
 boolean isActive()
          Return true if the interrupt is active
 boolean isAutoReset()
          Return the property autoReset.
 boolean isEnabled()
          Return true if the interrupt is enabled.
 boolean isNmi()
          Return true if this interrupt is NMI interrupt.
 boolean isReady()
          Return true if the interrupt is ready to be fired.
 void resetCounter()
          Reset the counter of number of interrupt fired.
 void setActive(boolean mode)
          Set the active property.
 void setAutoReset(boolean mode)
          Set the property autoReset.
 void setEnabled(boolean mode)
          Set the enabled property.
 void setVector(int n)
          Set the interrupt vector.
 void startISR()
          Called when the interrupt is started
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vector

protected int vector
Constructor Detail

Interrupt

public Interrupt(InterruptManager mgr,
                 java.lang.String name,
                 int vector,
                 boolean nmi)
Constructor with all parameter


Interrupt

public Interrupt(InterruptManager cpu,
                 java.lang.String name,
                 int vector)

Interrupt

public Interrupt(InterruptManager cpu,
                 java.lang.String name)
Method Detail

addInterruptManager

public void addInterruptManager(InterruptManager mgr)
Add a new interrupt manager to this interrupt.

Since:
1.02

isNmi

public boolean isNmi()
Return true if this interrupt is NMI interrupt.

Since:
1.01

startISR

public void startISR()
              throws SIMException
Called when the interrupt is started

Throws:
SIMException
Since:
1.01

getCounter

public int getCounter()
Return the number of interrupt occured.


resetCounter

public void resetCounter()
Reset the counter of number of interrupt fired.


setVector

public void setVector(int n)
Set the interrupt vector.

Since:
1.01

getVector

public int getVector()
              throws SIMException
Return the interrupt vector. The interrupt vector is CPU depending and no assumtion is made from the emulation framework.

Throws:
SIMException
Since:
1.01

getName

public java.lang.String getName()
Return the interrupt name


isEnabled

public boolean isEnabled()
Return true if the interrupt is enabled.

Since:
1.01

isActive

public boolean isActive()
                 throws SIMException
Return true if the interrupt is active

Throws:
SIMException
Since:
1.01

setEnabled

public final void setEnabled(boolean mode)
                      throws SIMException
Set the enabled property.

Throws:
SIMException
Since:
1.01

setActive

public final void setActive(boolean mode)
                     throws SIMException
Set the active property.

Throws:
SIMException
Since:
1.01

isReady

public boolean isReady()
                throws SIMException
Return true if the interrupt is ready to be fired.

Throws:
SIMException
Since:
1.01

checkReady

protected final void checkReady()
                         throws SIMException
Called when the enabled or the active property is changed. Notify the CPU that this interrupt require attention.

Throws:
SIMException
Since:
1.01

setAutoReset

public void setAutoReset(boolean mode)
Set the property autoReset.

If this property is set to true automatically the CPU call the method setActive(false) after the interrupt is fired. Can be used when the interrupt source cannot be reset programmatically.

Since:
1.01

isAutoReset

public boolean isAutoReset()
Return the property autoReset.

Since:
1.01

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

jmce - 1_02