document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.     [TestMethod]
  2.         public void TestLDA()
  3.         {
  4.             CPU6502 cpu = new CPU6502();
  5.             Assert.AreEqual<byte>(cpu.Reg_A, 0x00); // Accumulator should be 0x00 on initialisation
  6.  
  7.             // Build a ram_basic program to load the accumulator with 255
  8.             cpu.Ram[0] = 0xA9; // LDA
  9.             cpu.Ram[1] = 0xFF; // immediate mode 255
  10.  
  11.             // Run the program (The PC is initialised to 0x00)
  12.             cpu.Run();
  13.  
  14.             // Check we have loaded the accumulator
  15.             Assert.AreEqual<byte>(cpu.Reg_A, 0xFF);
  16.         }
');