Exemple #1
0
        public virtual void TestPC()
        {
            bus.WriteLong(4, 305419896);
            cpu.SetPC(4);
            int val = cpu.FetchPCLong();

            Assert.Equal(305419896, val);
            Assert.Equal(8, cpu.GetPC());
            cpu.SetPC(4);
            val = cpu.FetchPCWord();
            Assert.Equal(0x1234, val);
            Assert.Equal(6, cpu.GetPC());
            val = cpu.FetchPCWord();
            Assert.Equal(0x5678, val);
            Assert.Equal(8, cpu.GetPC());
            cpu.SetPC(4);
            bus.WriteLong(4, 0x12348765);
            val = cpu.FetchPCWordSigned();
            Assert.Equal(0x1234, val);
            Assert.Equal(6, cpu.GetPC());
            val = cpu.FetchPCWordSigned();
            Assert.Equal(-30875, val);
            Assert.Equal(8, cpu.GetPC());
        }