public void AllocCellsReturnsAddressTest() { var bh = new Heap(); Assert.Equal(0, bh.AllocCells(10)); Assert.Equal(40, bh.AllocCells(10)); // 40 = 10 * cell size. }
private void SetupDefaults() { // Allocate room for the STATE and the BASE variables. var systemVarsIndex = Heap.AllocCells(2); // Setup the variables... StateVariableAddress = systemVarsIndex; BaseVariableAddress = systemVarsIndex + Heap.CellSize; // ... with default values. SetStateValue(false); // False = interpreting. SetBaseValue(10); // Decimal. }