Interface IMemory
- All Known Implementing Classes:
ConstantSizeMemory
public interface IMemory
Collection of
memory cells which can hold an integer value.
Each cell can be accessed using its address.
Memory also contains working cell, that has a special position
during execution as it is used as target variable for some instructions. Working cell can be accessed
either through dedicated method getWorkingCell() or its constant address 0.
- Author:
- Erik Zemčík
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetCellByAddress(int address) Retrieves acellat the specified address.Retrieves the workingcell.
-
Method Details
-
getCellByAddress
Retrieves acellat the specified address.- Parameters:
address- address of the cell to return- Returns:
- cell at the specified address
- Throws:
IndexOutOfBoundsException- if address is out of range of the memory
-
getWorkingCell
IMemoryCell getWorkingCell()Retrieves the workingcell.- Returns:
- working cell
-