hades.models.pic
Class PicStack

java.lang.Object
  extended byhades.models.pic.PicStack
All Implemented Interfaces:
PicMemory

public class PicStack
extends java.lang.Object
implements PicMemory

PicStack - Hardware stack for Call/Return.


Field Summary
 PicBreakPoint bp
           
 PicWordReg[] stack
           
 int stackPtr
           
 int stackSize
           
 int wordWidth
           
 
Constructor Summary
PicStack(PicBreakPoint newBp)
          Default-Stack has 8 entries with 13 bit
PicStack(PicBreakPoint newBp, int newSize, int bitWidth)
           
 
Method Summary
 int getMemorySize()
          Capacity of the memory in words
 int getStackPointer()
           
 int getWordWidth()
          Witdh of one word in bits
 int pop()
          Get a value from the stack
 void por()
           
 void push(int value)
          Put a value into the stack
 int readMemory(int address)
          Read a word from the memory
 int readMemoryOld(int address)
           
 void reset()
          Clear the stack
 void writeMemory(int address, int word)
          Write a word into the memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stack

public PicWordReg[] stack

stackPtr

public int stackPtr

stackSize

public int stackSize

wordWidth

public int wordWidth

bp

public PicBreakPoint bp
Constructor Detail

PicStack

public PicStack(PicBreakPoint newBp)
Default-Stack has 8 entries with 13 bit


PicStack

public PicStack(PicBreakPoint newBp,
                int newSize,
                int bitWidth)
Method Detail

por

public void por()

reset

public void reset()
Clear the stack


push

public void push(int value)
Put a value into the stack


pop

public int pop()
Get a value from the stack


getWordWidth

public int getWordWidth()
Description copied from interface: PicMemory
Witdh of one word in bits

Specified by:
getWordWidth in interface PicMemory

getMemorySize

public int getMemorySize()
Description copied from interface: PicMemory
Capacity of the memory in words

Specified by:
getMemorySize in interface PicMemory

readMemoryOld

public int readMemoryOld(int address)

readMemory

public int readMemory(int address)
Description copied from interface: PicMemory
Read a word from the memory

Specified by:
readMemory in interface PicMemory

writeMemory

public void writeMemory(int address,
                        int word)
Description copied from interface: PicMemory
Write a word into the memory

Specified by:
writeMemory in interface PicMemory

getStackPointer

public int getStackPointer()