Пример #1
0
        public void AllocCellsReturnsAddressTest()
        {
            var bh = new Heap();

            Assert.Equal(0, bh.AllocCells(10));
            Assert.Equal(40, bh.AllocCells(10));  // 40 = 10 * cell size.
        }
Пример #2
0
        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.
        }