Esempio n. 1
0
        private ushort GetOperand(OperandType type)
        {
            ushort arg = 0;

            switch (type)
            {
            case OperandType.LargeConstant:
                arg = _memoryManager.GetUShort((int)_stack.GetPC());
                _stack.IncrementPC(2);
                Log.Write($"#{arg:X4}, ");
                break;

            case OperandType.SmallConstant:
                arg = _memoryManager.Get(_stack.GetPCAndInc());
                Log.Write($"#{arg:X2}, ");
                break;

            case OperandType.Variable:
                var b = _memoryManager.Get(_stack.GetPCAndInc());
                arg = _variableManager.GetUShort(b);
                break;
            }

            return(arg);
        }
Esempio n. 2
0
 public ushort Get(byte globalNumber) =>
 _manager.GetUShort(AddressOfGlobal(globalNumber));