next up previous contents index
Next: The Heap Allocator Up: Hardware Components Previous: The Processor   Contents   Index

Memory

(CORE/MEMORY.JAVA,
CORE/SAMMEMORY.JAVA)
Memory is responsible for data storage. It is capable of storing data of size Memory.UNIT_SIZE bits in each of Memory.MEMORYLIMIT locations. It is implemented in SamMemory as an array of integers. SaM memory is typed - it supports associating a data type with each memory location. This functionality can be used for error checking, presentation clarity, or other purposes. Internally, type and data information alternate locations, but this is not visible to the end user. The API provides methods for setting and getting data and type separately, or simultaneously, using the Memory.Data wrapper object. SaM memory is divided into two zones - stack and heap. The boundary between them is fixed at Memory.STACKLIMIT (the last stack location).

Types

The following data types are supported:

General Access

All memory locations can be accessed using the following methods:

Stack Zone

The stack can be manipulated specifically using the following functions:

Heap Zone

The heap zone is manipulated using a HeapAllocator. It is used for dynamic allocation of memory space. Memory provides the following methods for working with the heap zone:


next up previous contents index
Next: The Heap Allocator Up: Hardware Components Previous: The Processor   Contents   Index
David Levitan 2006-02-12