示例#1
0
        public void Branch_BranchWithPositiveOffset_PcCorrect()
        {
            AgbCpu cpu = CpuUtil.CreateAndRunCpu(new uint[]
            {
                0xEA0003FE // B #0x1000
            });

            Assert.Equal(InternalWramRegion.REGION_START + 0x1000, cpu.CurrentRegisterSet.GetRegister(CpuUtil.PC));
        }
示例#2
0
        public void BranchWithLink_BranchWithNegativeOffset_PcAndLrCorrect()
        {
            AgbCpu cpu = CpuUtil.CreateAndRunCpu(new uint[]
            {
                0xEBFFFBFE // BL #-0x1000
            });

            Assert.Equal(InternalWramRegion.REGION_START - 0x1000, cpu.CurrentRegisterSet.GetRegister(CpuUtil.PC));
            Assert.Equal(InternalWramRegion.REGION_START + 0x4, cpu.CurrentRegisterSet.GetRegister(CpuUtil.LR));
        }