arche
Class Stack

java.lang.Object
  |
  +--arche.Storage
        |
        +--arche.Stack

public class Stack
extends Storage

Stack as a structural element for processors. There is no error checking, you can read more than you actually have put. Of course the values will be periodical.


Field Summary
private  byte size
           
private  byte sp
          The stack pointer.
private  short[] stack
           
 
Constructor Summary
Stack(int size_)
           
 
Method Summary
 void clear()
           
 int getSize()
          Returns the number of cells inside the storage.
 short read()
           
 void write(short newvalue)
          Sets the content to a new value.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

size

private byte size

stack

private short[] stack

sp

private byte sp
The stack pointer. Points the last put element.
Constructor Detail

Stack

public Stack(int size_)
Method Detail

getSize

public int getSize()
Description copied from class: Storage
Returns the number of cells inside the storage. It's 1 for registers.
Overrides:
getSize in class Storage

read

public short read()
Overrides:
read in class Storage

write

public void write(short newvalue)
Sets the content to a new value.
Overrides:
write in class Storage

clear

public void clear()
Overrides:
clear in class Storage