Example #1
0
        public void CanInitializeRegistryWithAnInstruction()
        {
            const Opcode opcode = Opcode.Nop;

              var instruction = new InstructionTestDouble();
              var registry = new Registry {
            { 0x00, opcode, instruction, AddressingMode.Implied } };

              Assert.That(registry.Get(opcode), Is.EqualTo(instruction));
        }
Example #2
0
        public void CanGetACodeFromAnInstructionOpcodePair()
        {
            const byte expectedCode = 0xFF;
              const Opcode opcode = Opcode.Nop;
              const AddressingMode mode = AddressingMode.Implied;

              var instruction = new InstructionTestDouble();
              var registry = new Registry {
            { expectedCode, opcode, instruction, AddressingMode.Implied } };

              Assert.That(registry.Get(opcode, mode), Is.EqualTo(expectedCode));
        }
Example #3
0
        public void CanInitializeRegistryWithACodeAddressingModePair()
        {
            const byte code = 0xFF;
              const Opcode opcode = Opcode.Nop;
              const AddressingMode mode = AddressingMode.Implied;

              var instruction = new InstructionTestDouble();
              var registry = new Registry {
            { code, opcode, instruction, AddressingMode.Implied } };

              Assert.That(registry.Get(code).Opcode, Is.EqualTo(opcode));
              Assert.That(registry.Get(code).Mode, Is.EqualTo(mode));
        }