Esempio n. 1
0
        public void TRAP_PutS()
        {
            var proc = new Processor {
                [Register.MemoryData] = ((int)OpCode.TRAP << 12) +
                                        (int)TrapVector.PutS,
                [Register.R0] = 0x6A,
                Memory        =
                {
                    [0x6A] = 'T',
                    [0x6B] = 'e',
                    [0x6C] = 's',
                    [0x6D] = 't'
                }
            };

            var io = new TestAdapter();

            Program.IoAdapter = io;
            new TRAP().Call(proc);

            Assert.AreEqual("Test\0", io.GetOutput());
        }