dioscuri.module
Class ModuleMemory

java.lang.Object
  extended by dioscuri.module.AbstractModule
      extended by dioscuri.module.ModuleMemory
All Implemented Interfaces:
Module
Direct Known Subclasses:
DynamicAllocationMemory, Memory

public abstract class ModuleMemory
extends AbstractModule

Abstract class representing a memory hardware module.


Nested Class Summary
 
Nested classes/interfaces inherited from interface dioscuri.interfaces.Module
Module.Type
 
Field Summary
 
Fields inherited from class dioscuri.module.AbstractModule
type
 
Constructor Summary
ModuleMemory()
           
 
Method Summary
abstract  byte getByte(int address)
          Return a byte from memory at a specific address
abstract  byte[] getWord(int address)
          Returns the value of a word at a specific address Note: words in memory are stored in Little Endian order (LSB, MSB), but this method returns a word in Big Endian order (MSB, LSB) because this is the common way words are used by instructions.
abstract  void setA20AddressLine(boolean status)
          Set A20 address line toggle
abstract  void setByte(int address, byte value)
          Set a byte in memory at given address
abstract  void setBytes(int address, byte[] binaryStream)
          Stores an array of bytes in memory starting at a specific address
abstract  void setRamSizeInMB(int ramSizeMB)
          Set RAM Size in megabytes
abstract  void setWatchValueAndAddress(boolean isWatchOn, int watchAddress)
          Set watch toggle and address to trace in memory
abstract  void setWord(int address, byte[] value)
          Stores the value of a word at a specific address Note: words in memory are stored in Little Endian order (LSB, MSB), but this method assumes that a word is given in Big Endian order (MSB, LSB) because this is the common way words are used by instructions.
 
Methods inherited from class dioscuri.module.AbstractModule
getConnection, getConnections, getDebugMode, getDump, getExpectedConnections, getType, isConnected, reset, setConnection, setDebugMode, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleMemory

public ModuleMemory()
Method Detail

getByte

public abstract byte getByte(int address)
                      throws ModuleException
Return a byte from memory at a specific address

Parameters:
address - Flat-address where data can be found
Returns:
the byte at the given address
Throws:
ModuleException

setByte

public abstract void setByte(int address,
                             byte value)
                      throws ModuleException
Set a byte in memory at given address

Parameters:
address -
value -
Throws:
ModuleException

getWord

public abstract byte[] getWord(int address)
                        throws ModuleException
Returns the value of a word at a specific address Note: words in memory are stored in Little Endian order (LSB, MSB), but this method returns a word in Big Endian order (MSB, LSB) because this is the common way words are used by instructions.

Parameters:
address - Flat-address where data can be found
Returns:
byte[] array [MSB, LSB] containing data, 0xFFFF if address outside RAM_SIZE range
Throws:
ModuleException

setWord

public abstract void setWord(int address,
                             byte[] value)
                      throws ModuleException
Stores the value of a word at a specific address Note: words in memory are stored in Little Endian order (LSB, MSB), but this method assumes that a word is given in Big Endian order (MSB, LSB) because this is the common way words are used by instructions. However, storage takes place in Little Endian order.

Parameters:
address -
value -
Throws:
ModuleException

setBytes

public abstract void setBytes(int address,
                              byte[] binaryStream)
                       throws ModuleException
Stores an array of bytes in memory starting at a specific address

Parameters:
address - Flat-address where data is stored
binaryStream -
Throws:
ModuleException

setA20AddressLine

public abstract void setA20AddressLine(boolean status)
Set A20 address line toggle

Parameters:
status -

setWatchValueAndAddress

public abstract void setWatchValueAndAddress(boolean isWatchOn,
                                             int watchAddress)
Set watch toggle and address to trace in memory

Parameters:
isWatchOn -
watchAddress -

setRamSizeInMB

public abstract void setRamSizeInMB(int ramSizeMB)
Set RAM Size in megabytes

Parameters:
ramSizeMB -