Exemplo n.º 1
0
        public void Execute_WithBranch()
        {
            reg[1] = 0;
            target = new BeqInstruction(1, 0, 0x0002);

            target.Execute(ref pc, mem, reg);

            Assert.AreEqual(0x0000000C, pc);
        }
Exemplo n.º 2
0
        public void Execute_NoBranch()
        {
            reg[1] = 1;
            target = new BeqInstruction(1, 0, 0xFFFF);

            target.Execute(ref pc, mem, reg);

            Assert.AreEqual(0x00000004, pc);
        }
Exemplo n.º 3
0
        public void ToString_Formatted()
        {
            target = new BeqInstruction(5, 6, 0x1234);

            Assert.AreEqual("BEQ $a1, $a2, 0x1234", target.ToString());
        }