Ejemplo n.º 1
0
        public void Execute_DataLoadedToReg()
        {
            mem[4] = 0xDEADBEEF;
            target = new LwInstruction(8, 9, 0x0004);

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

            Assert.AreEqual(0xDEADBEEF, reg[8]);
            Assert.AreEqual(0x00000004, pc);
        }
Ejemplo n.º 2
0
        public void Execute_DataLoadedToReg_SignExtendedImmediate()
        {
            mem[4] = 0xDEADBEEF;
            reg[9] = 0x00000008;
            target = new LwInstruction(8, 9, 0xFFFC);

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

            Assert.AreEqual(0xDEADBEEF, reg[8]);
            Assert.AreEqual(0x00000004, pc);
        }
Ejemplo n.º 3
0
        public void ToString_Formatted()
        {
            target = new LwInstruction(8, 9, 0x0004);

            Assert.AreEqual("LW $t0, 0x0004($t1)", target.ToString());
        }