public void MnemonicStartsWith_LoadsOfA() { var finder = new InstructionNavigator(_instructionSetInfo); var result = finder.MnemonicStartsWith("ld A"); result.Should().HaveCount(5); }
public void Expand_NEG_Mnemonics() { var navigator = new InstructionNavigator(_instructionSetInfo); var expander = new InstructionExpander(navigator.Tables); var instructions = navigator.MnemonicStartsWith("NEG"); var decls = new List <InstructionMeta>(); foreach (var instruction in instructions) { expander.Expand(decls, new InstructionMeta(instruction)); } decls.ForEach(d => Console.WriteLine(d.Name)); decls.Should().HaveCount(8); }
public void Expand_ADDIXm_Mnemonics() { var navigator = new InstructionNavigator(_instructionSetInfo); var expander = new InstructionExpander(navigator.Tables); var instruction = navigator.MnemonicStartsWith("ADD IX").First(); var decls = expander.Expand(new InstructionMeta(instruction)).ToList(); decls.ForEach(d => Console.WriteLine(d.Name)); decls.Should().HaveCount(4); decls[0].Info.Mnemonic.Should().Be("ADD IX, BC"); decls[1].Info.Mnemonic.Should().Be("ADD IX, DE"); decls[2].Info.Mnemonic.Should().Be("ADD IX, IX"); decls[3].Info.Mnemonic.Should().Be("ADD IX, SP"); decls[0].Info.Bytes[0].Should().Be("DD"); decls[0].Info.Bytes[1].Should().Be("08"); }