コード例 #1
0
ファイル: Machine.cs プロジェクト: dshifflet/WasmZork
        private void InitMachine(IZmachineInputOutput io)
        {
            setProgramCounter();
            for (int i = 0; i < 128; ++i)
            {
                callStack[i] = new RoutineCallState();
            }

            objectTable = new ObjectTable(memory);
            lex         = new Lex(memory, io);
        }
コード例 #2
0
 public Memory(int size, IZmachineInputOutput io)
 {
     // Class constructor
     memory = new byte[size];
     _io    = io;
 }
コード例 #3
0
ファイル: Lex.cs プロジェクト: dshifflet/WasmZork
        uint mp = 0;                                 // Memory Pointer

        public Lex(Memory mem, IZmachineInputOutput io)
        {
            memory            = mem;
            dictionaryAddress = memory.getWord(Memory.ADDR_DICT);
            _io = io;
        }
コード例 #4
0
ファイル: Machine.cs プロジェクト: dshifflet/WasmZork
 private void InitMemory(IZmachineInputOutput io)
 {
     _io    = io;
     memory = new Memory(1024 * 128, io);         // Initialize memory
     stack  = new Memory(1024 * 32, io);          // Stack of size 32768 (can be larger, but this should be fine)
 }
コード例 #5
0
ファイル: Machine.cs プロジェクト: dshifflet/WasmZork
 public Machine(byte[] bytes, IZmachineInputOutput io)
 {
     InitMemory(io);
     memory.load(bytes);
     InitMachine(io);
 }
コード例 #6
0
ファイル: Machine.cs プロジェクト: dshifflet/WasmZork
 // Class constructor : Loads in data from file and sets Program Counter
 public Machine(string filename, IZmachineInputOutput io)
 {
     InitMemory(io);
     memory.load(filename);
     InitMachine(io);
 }