jmce - 1_02

jmce.sim.memory
Class MemoryBits

java.lang.Object
  extended by jmce.sim.memory.MemoryBits
Direct Known Subclasses:
MemoryBit

public class MemoryBits
extends java.lang.Object

Map a portion of one memorty location.

This class map a portion of m emory location and permiot to read and write only the selected bit.

Version:
1.00
Author:
Mario Viara

Field Summary
protected  int mask
           
protected  int shift
           
 
Constructor Summary
MemoryBits(Memory memory, int address, int shift, int width)
           
 
Method Summary
 void addMemoryWriteListener(MemoryWriteListener l)
           
 int getBits()
           
 int getWidth()
           
 void setBits(int v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mask

protected int mask

shift

protected int shift
Constructor Detail

MemoryBits

public MemoryBits(Memory memory,
                  int address,
                  int shift,
                  int width)
Method Detail

getWidth

public int getWidth()

getBits

public int getBits()
            throws SIMException
Throws:
SIMException

setBits

public void setBits(int v)
             throws SIMException
Throws:
SIMException

addMemoryWriteListener

public void addMemoryWriteListener(MemoryWriteListener l)

jmce - 1_02