mirror of
https://github.com/soconnor0919/eceg431.git
synced 2025-12-11 22:54:43 -05:00
project12 - add files
This commit is contained in:
33
12/Memory.jack
Normal file
33
12/Memory.jack
Normal file
@@ -0,0 +1,33 @@
|
||||
// This file is part of www.nand2tetris.org
|
||||
// and the book "The Elements of Computing Systems"
|
||||
// by Nisan and Schocken, MIT Press.
|
||||
// File name: projects/12/Memory.jack
|
||||
/**
|
||||
* This library provides two services: direct access to the computer's main
|
||||
* memory (RAM), and allocation and recycling of memory blocks. The Hack RAM
|
||||
* consists of 32,768 words, each holding a 16-bit binary number.
|
||||
*/
|
||||
class Memory {
|
||||
|
||||
/** Initializes the class. */
|
||||
function void init() {
|
||||
}
|
||||
|
||||
/** Returns the RAM value at the given address. */
|
||||
function int peek(int address) {
|
||||
}
|
||||
|
||||
/** Sets the RAM value at the given address to the given value. */
|
||||
function void poke(int address, int value) {
|
||||
}
|
||||
|
||||
/** Finds an available RAM block of the given size and returns
|
||||
* a reference to its base address. */
|
||||
function int alloc(int size) {
|
||||
}
|
||||
|
||||
/** De-allocates the given object (cast as an array) by making
|
||||
* it available for future allocations. */
|
||||
function void deAlloc(Array o) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user