dioscuri.module.cpu32
Class AbstractMemory

java.lang.Object
  extended by dioscuri.module.cpu32.Memory
      extended by dioscuri.module.cpu32.AbstractMemory
All Implemented Interfaces:
ByteArray
Direct Known Subclasses:
AddressSpace, LazyMemory

public abstract class AbstractMemory
extends Memory

Author:
Bram Lohman, Bart Kiers

Constructor Summary
AbstractMemory()
           
 
Method Summary
 void clear()
           
 void clear(int start, int length)
           
static void clearArray(byte[] target, byte value)
           
static void clearArray(java.lang.Object[] target, java.lang.Object value)
           
 void copyContentsFrom(int address, byte[] buffer, int off, int len)
           
 void copyContentsInto(int address, byte[] buffer, int off, int len)
           
abstract  byte getByte(int offset)
           
 int getDoubleWord(int offset)
           
static int getDoubleWord(int offset, byte[] src)
           
protected  int getDoubleWordInBytes(int offset)
           
 long getLowerDoubleQuadWord(int offset)
           
 long getQuadWord(int offset)
           
protected  long getQuadWordInBytes(int offset)
           
abstract  long getSize()
           
 long getUpperDoubleQuadWord(int offset)
           
 short getWord(int offset)
           
static short getWord(int offset, byte[] src)
           
protected  short getWordInBytes(int offset)
           
abstract  void setByte(int offset, byte data)
           
 void setDoubleWord(int offset, int data)
           
protected  void setDoubleWordInBytes(int offset, int data)
           
 void setLowerDoubleQuadWord(int offset, long data)
           
 void setQuadWord(int offset, long data)
           
protected  void setQuadWordInBytes(int offset, long data)
           
 void setUpperDoubleQuadWord(int offset, long data)
           
 void setWord(int offset, short data)
           
protected  void setWordInBytes(int offset, short data)
           
 
Methods inherited from class dioscuri.module.cpu32.Memory
decodeCodeBlockAt, execute, isAllocated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMemory

public AbstractMemory()
Method Detail

getSize

public abstract long getSize()
Specified by:
getSize in interface ByteArray
Specified by:
getSize in class Memory
Returns:
-

getByte

public abstract byte getByte(int offset)
Specified by:
getByte in interface ByteArray
Specified by:
getByte in class Memory
Parameters:
offset -
Returns:
-

setByte

public abstract void setByte(int offset,
                             byte data)
Specified by:
setByte in interface ByteArray
Specified by:
setByte in class Memory
Parameters:
offset -
data -

clear

public void clear()
Specified by:
clear in interface ByteArray
Specified by:
clear in class Memory

clear

public void clear(int start,
                  int length)
Specified by:
clear in class Memory
Parameters:
start -
length -

copyContentsInto

public void copyContentsInto(int address,
                             byte[] buffer,
                             int off,
                             int len)
Specified by:
copyContentsInto in interface ByteArray
Specified by:
copyContentsInto in class Memory
Parameters:
address -
buffer -
off -
len -

copyContentsFrom

public void copyContentsFrom(int address,
                             byte[] buffer,
                             int off,
                             int len)
Specified by:
copyContentsFrom in class Memory
Parameters:
address -
buffer -
off -
len -

getWordInBytes

protected final short getWordInBytes(int offset)
Parameters:
offset -
Returns:
-

getDoubleWordInBytes

protected final int getDoubleWordInBytes(int offset)
Parameters:
offset -
Returns:
-

getQuadWordInBytes

protected final long getQuadWordInBytes(int offset)
Parameters:
offset -
Returns:
-

getWord

public short getWord(int offset)
Specified by:
getWord in class Memory
Parameters:
offset -
Returns:
-

getDoubleWord

public int getDoubleWord(int offset)
Specified by:
getDoubleWord in class Memory
Parameters:
offset -
Returns:
-

getQuadWord

public long getQuadWord(int offset)
Specified by:
getQuadWord in class Memory
Parameters:
offset -
Returns:
-

getLowerDoubleQuadWord

public long getLowerDoubleQuadWord(int offset)
Specified by:
getLowerDoubleQuadWord in class Memory
Parameters:
offset -
Returns:
-

getUpperDoubleQuadWord

public long getUpperDoubleQuadWord(int offset)
Specified by:
getUpperDoubleQuadWord in class Memory
Parameters:
offset -
Returns:
-

setWordInBytes

protected final void setWordInBytes(int offset,
                                    short data)
Parameters:
offset -
data -

setDoubleWordInBytes

protected final void setDoubleWordInBytes(int offset,
                                          int data)
Parameters:
offset -
data -

setQuadWordInBytes

protected final void setQuadWordInBytes(int offset,
                                        long data)
Parameters:
offset -
data -

setWord

public void setWord(int offset,
                    short data)
Specified by:
setWord in class Memory
Parameters:
offset -
data -

setDoubleWord

public void setDoubleWord(int offset,
                          int data)
Specified by:
setDoubleWord in class Memory
Parameters:
offset -
data -

setQuadWord

public void setQuadWord(int offset,
                        long data)
Specified by:
setQuadWord in class Memory
Parameters:
offset -
data -

setLowerDoubleQuadWord

public void setLowerDoubleQuadWord(int offset,
                                   long data)
Specified by:
setLowerDoubleQuadWord in class Memory
Parameters:
offset -
data -

setUpperDoubleQuadWord

public void setUpperDoubleQuadWord(int offset,
                                   long data)
Specified by:
setUpperDoubleQuadWord in class Memory
Parameters:
offset -
data -

getWord

public static final short getWord(int offset,
                                  byte[] src)
Parameters:
offset -
src -
Returns:
-

getDoubleWord

public static final int getDoubleWord(int offset,
                                      byte[] src)
Parameters:
offset -
src -
Returns:
-

clearArray

public static final void clearArray(java.lang.Object[] target,
                                    java.lang.Object value)
Parameters:
target -
value -

clearArray

public static final void clearArray(byte[] target,
                                    byte value)
Parameters:
target -
value -