Exemple #1
0
        public void Execute_NegativeImmediate()
        {
            reg[1] = 0x00000003;
            target = new AddiInstruction(2, 1, 0xFFFF);

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

            Assert.AreEqual(0x00000002, reg[2]);
            Assert.AreEqual(0x00000004, pc);
        }
Exemple #2
0
        public void Execute_Overflow()
        {
            reg[1] = 0xFFFFFFFF;
            target = new AddiInstruction(1, 1, 0x0001);

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

            Assert.AreEqual(0x00000000, reg[1]);
            Assert.AreEqual(0x00000004, pc);
        }
Exemple #3
0
        public void Execute_AddPositiveNumbers()
        {
            reg[1] = 0x00000002;
            target = new AddiInstruction(1, 1, 0x0001);

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

            Assert.AreEqual(0x00000003, reg[1]);
            Assert.AreEqual(0x00000004, pc);
        }