Beispiel #1
0
        public void Execute_NotLessThanImmediate()
        {
            reg[8] = 0x00000001;
            target = new SltiInstruction(9, 8, 0x0000);

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

            Assert.AreEqual(0x00000000, reg[9]);
            Assert.AreEqual(0x00000004, pc);
        }
Beispiel #2
0
        public void Execute_LessThanImmediate_SignedComparison()
        {
            reg[8] = 0xFFFFFFFF;
            target = new SltiInstruction(9, 8, 0x0000);

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

            Assert.AreEqual(0x00000001, reg[9]);
            Assert.AreEqual(0x00000004, pc);
        }
Beispiel #3
0
        public void ToString_Formatted()
        {
            target = new SltiInstruction(9, 8, 0x0000);

            Assert.AreEqual("SLTI $t1, $t0, 0x0000", target.ToString());
        }