jmce - 1_02

jmce.sim
Interface Memory

All Superinterfaces:
Hardware, Peripheral
All Known Subinterfaces:
SpectrumMemory
All Known Implementing Classes:
AbstractMemory, ArrayMemory, AT24C16, BankedMemory, CombinedMemory, DuplicateMemory, FastMemory, LoadableMemory, MappedMemory, Memory, Memory, Memory, Memory128K, Memory48K, PersistentMemory, PlainMemory, ReadOnlyMemory

public interface Memory
extends Peripheral

Memory device.

Interface used to simulate every memory mapped device like ram. eprom , I/O space and so on. The width of the memory is 8 bit.

Memory can have global MemoryWriteListener , called at every memory write and a specific listener called when a specific location is written.

Memory can have MemoryReadListener called when one memory location must be read. Multiple MemoryReadListener can be installed and are called in installation order.

Version:
1.01
Author:
Mario Viara

Method Summary
 void addMemoryReadListener(int a, MemoryReadListener l)
           
 void addMemoryReadListener(MemoryReadListener l)
           
 void addMemoryWriteListener(int address, MemoryWriteListener l)
          Add a specific MemoryWriteListener.
 void addMemoryWriteListener(MemoryWriteListener l)
          Add a global MemoryWriteListener.
 void clrBit(int a, int mask)
           
 int getMemory(int address)
          Get a location of memory.
 java.lang.String getMemoryName(int address)
           
 MemoryReadListener getMemoryReadListenerAt(int i)
           
 MemoryReadListener getMemoryReadListenerAt(int i, int a)
           
 int getMemoryReadListenerCount()
           
 int getMemoryReadListenerCount(int a)
           
 MemoryWriteListener getMemoryWriteListenerAt(int i)
           
 MemoryWriteListener getMemoryWriteListenerAt(int i, int a)
           
 int getMemoryWriteListenerCount()
          Return the number of global memory write listener installed.
 int getMemoryWriteListenerCount(int a)
          Return the number of specific memory write listener installed at the specified affress.
 boolean getReadOnly(int add)
          Check if a speficied location is read only.
 int getSize()
          Return the size of the memory in byte.
 boolean isBit(int a, int mask)
           
 void removeMemoryReadListener(int a, MemoryReadListener l)
           
 void removeMemoryReadListener(MemoryReadListener l)
           
 void removeMemoryWriteListener(int a, MemoryWriteListener l)
          Remove a previus specific installed memory write listener.
 void removeMemoryWriteListener(MemoryWriteListener l)
          Remove a previous global installed memory write listener.
 void setBit(int a, int mask)
           
 void setMemory(int address, int value)
          Set a location of memory.
 void setMemoryName(int address, java.lang.String name)
           
 void setReadOnly()
          Set the flag read only for all the memory
 void setReadOnly(int address)
          Set the flag read only for a single address.
 void setReadOnly(int start, int len)
          Set the flag read only for the specified range
 void setSize(int size)
          Set the size of the memory.
 
Methods inherited from interface jmce.sim.Peripheral
idle, registerCPU
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 

Method Detail

setMemory

void setMemory(int address,
               int value)
               throws SIMException
Set a location of memory.

Parameters:
address - - Memory address
value - - Value to set only 8 bit are used
Throws:
SIMException

getMemory

int getMemory(int address)
              throws SIMException
Get a location of memory.

Parameters:
address - - Location
Returns:
A byte from the memory.
Throws:
SIMException

getSize

int getSize()
Return the size of the memory in byte.


setSize

void setSize(int size)
Set the size of the memory.


addMemoryWriteListener

void addMemoryWriteListener(MemoryWriteListener l)
Add a global MemoryWriteListener.

The listener will be called when any location of the memory is writed.

Parameters:
l - - Memory write listener called when the memory is writed.

addMemoryWriteListener

void addMemoryWriteListener(int address,
                            MemoryWriteListener l)
Add a specific MemoryWriteListener.

The listener will be called when the specified memory location is written.

Parameters:
address - - Address where to install the listener.
l - - Memory write listener called when the memory is writed.

removeMemoryWriteListener

void removeMemoryWriteListener(MemoryWriteListener l)
Remove a previous global installed memory write listener.


removeMemoryWriteListener

void removeMemoryWriteListener(int a,
                               MemoryWriteListener l)
Remove a previus specific installed memory write listener.


getMemoryWriteListenerCount

int getMemoryWriteListenerCount()
Return the number of global memory write listener installed.


getMemoryWriteListenerCount

int getMemoryWriteListenerCount(int a)
Return the number of specific memory write listener installed at the specified affress.


getMemoryWriteListenerAt

MemoryWriteListener getMemoryWriteListenerAt(int i)

getMemoryWriteListenerAt

MemoryWriteListener getMemoryWriteListenerAt(int i,
                                             int a)

addMemoryReadListener

void addMemoryReadListener(MemoryReadListener l)

removeMemoryReadListener

void removeMemoryReadListener(MemoryReadListener l)

removeMemoryReadListener

void removeMemoryReadListener(int a,
                              MemoryReadListener l)

addMemoryReadListener

void addMemoryReadListener(int a,
                           MemoryReadListener l)

getMemoryReadListenerCount

int getMemoryReadListenerCount()

getMemoryReadListenerCount

int getMemoryReadListenerCount(int a)

getMemoryReadListenerAt

MemoryReadListener getMemoryReadListenerAt(int i)

getMemoryReadListenerAt

MemoryReadListener getMemoryReadListenerAt(int i,
                                           int a)

setMemoryName

void setMemoryName(int address,
                   java.lang.String name)

getMemoryName

java.lang.String getMemoryName(int address)

setBit

void setBit(int a,
            int mask)
            throws SIMException
Throws:
SIMException

clrBit

void clrBit(int a,
            int mask)
            throws SIMException
Throws:
SIMException

isBit

boolean isBit(int a,
              int mask)
              throws SIMException
Throws:
SIMException

setReadOnly

void setReadOnly(int start,
                 int len)
Set the flag read only for the specified range

Since:
1.01

setReadOnly

void setReadOnly(int address)
Set the flag read only for a single address.

Since:
1.01

setReadOnly

void setReadOnly()
Set the flag read only for all the memory

Since:
1.01

getReadOnly

boolean getReadOnly(int add)
Check if a speficied location is read only.

Since:
1.01

jmce - 1_02