|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Memory
The Memory interface provides low-level memory access methods
| Nested Class Summary | |
|---|---|
static class |
Memory.Data
Represents memory data |
static class |
Memory.Type
Represents memory type |
| Field Summary | |
|---|---|
static int |
MEMORYLIMIT
The upper limit of memory |
static int |
STACKLIMIT
The upper limit of the stack |
static int |
UNIT_SIZE
Memory unit size in bits |
| Method Summary | |
|---|---|
java.util.List<Memory.Data> |
getAllocation(HeapAllocator.Allocation alloc)
Returns an array containing the data for the given allocation. |
HeapAllocator |
getHeapAllocator()
Get the Heap Allocator object associated with this memory. |
Memory.Data |
getMem(int pos)
Returns the data object at the requested memory position |
java.util.List<Memory.Data> |
getStack()
Returns a list containing the current stack |
Sys |
getSystem()
Return the Sys object associated with this memory. |
Memory.Type |
getType(int pos)
Returns the type at the requested memory position |
int |
getValue(int pos)
Returns the value at the requested memory position |
void |
init()
Initializes memory to default state |
Memory.Data |
pop()
Pops a data object off the stack |
char |
popCH()
Pops a character off the stack |
float |
popFLOAT()
Pops a floating pointer number off the stack |
int |
popINT()
Pops an integer off the stack |
int |
popMA()
Pops a memory address off the stack |
int |
popPA()
Pops a program address off the stack |
int |
popValue()
Pops a value off the stack |
void |
push(int value,
Memory.Type type)
Pushes a value/type pair on the stack |
void |
push(Memory.Data data)
Pushes a data object on the stack |
void |
pushCH(char ch)
Pushes a character on the stack |
void |
pushFLOAT(float fl)
Pushes a floating pointer number on the stack |
void |
pushINT(int i)
Pushes an integer on the stack |
void |
pushMA(int ma)
Pushes a memory address on the stack |
void |
pushPA(int pa)
Pushes a program address on the stack |
void |
setHeapAllocator(HeapAllocator ha)
Set the HeapAllocator object associated with this memory. |
void |
setMem(int pos,
int value,
Memory.Type type)
Stores the given value/type pair in memory |
void |
setMem(int pos,
Memory.Data data)
Stores the given data object in memory |
void |
setSystem(Sys sys)
Set the Sys object associated with this memory. |
void |
setType(int pos,
Memory.Type type)
Sets this location to the given type |
void |
setValue(int pos,
int value)
Stores the given value in memory |
| Field Detail |
|---|
static final int MEMORYLIMIT
static final int STACKLIMIT
static final int UNIT_SIZE
| Method Detail |
|---|
void init()
Sys getSystem()
void setSystem(Sys sys)
sys - The Sys objectvoid setHeapAllocator(HeapAllocator ha)
ha - The allocatorHeapAllocator getHeapAllocator()
void setMem(int pos,
Memory.Data data)
throws SystemException
addr - The address in memorydata - The data object to set
SystemException - if there is an error accessing memory
void setMem(int pos,
int value,
Memory.Type type)
throws SystemException
addr - The address in memoryvalue - The value to storetype - The type of this value
SystemException - if there is an error accessing memory
void setValue(int pos,
int value)
throws SystemException
addr - The address in memoryvalue - The value to store
SystemException - if there is an error accessing memory
void setType(int pos,
Memory.Type type)
throws SystemException
addr - The address in memorytype - The type to set
SystemException - if there is an error accessing memory
Memory.Data getMem(int pos)
throws SystemException
pos - The memory address
SystemException - if there is an error accessing memory
int getValue(int pos)
throws SystemException
pos - The memory address
SystemException - if there is an error accessing memory
Memory.Type getType(int pos)
throws SystemException
pos - The memory address
SystemException - if there is an error accessing memoryjava.util.List<Memory.Data> getAllocation(HeapAllocator.Allocation alloc)
alloc - The heap allocation
java.util.List<Memory.Data> getStack()
void push(Memory.Data data)
throws SystemException
data - The data object to push on the stack
SystemException - if there is an error accessing the stack
void push(int value,
Memory.Type type)
throws SystemException
value - The value to push on the stacktype - The type of this value
SystemException - if there is an error accessing the stack
void pushINT(int i)
throws SystemException
i - The integer to push
SystemException - if there is an error accessing the stack
void pushCH(char ch)
throws SystemException
ch - The character to push
SystemException - if there is an error accessing the stack
void pushMA(int ma)
throws SystemException
ma - The address to push
SystemException - if there is an error accessing the stack
void pushPA(int pa)
throws SystemException
pa - The program address to push
SystemException - if there is an error accessing the stack
void pushFLOAT(float fl)
throws SystemException
fl - The floating point number to push
SystemException - if there is an error accessing the stack
Memory.Data pop()
throws SystemException
SystemException - if there is an error accessing the stack
int popValue()
throws SystemException
SystemException - if there is an error accessing the stack
int popINT()
throws SystemException
SystemException - if there is an error accessing the stack
char popCH()
throws SystemException
SystemException - if there is an error accessing the stack
int popMA()
throws SystemException
SystemException - if there is an error accessing the stack
int popPA()
throws SystemException
SystemException - if there is an error accessing the stack
float popFLOAT()
throws SystemException
SystemException - if there is an error accessing the stack
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||