diff --git a/source/Indy.IL2CPU.Tests/Assembler/X86/BaseTest.cs b/source/Indy.IL2CPU.Tests/Assembler/X86/BaseTest.cs index f716d521d..888bad3ed 100644 --- a/source/Indy.IL2CPU.Tests/Assembler/X86/BaseTest.cs +++ b/source/Indy.IL2CPU.Tests/Assembler/X86/BaseTest.cs @@ -37,7 +37,7 @@ namespace Indy.IL2CPU.Tests.Assembler.X86 { using (var xOut = new StringWriter()) { Assembler.FlushText(xOut); using (var xReader = new StreamReader(typeof(BaseTest).Assembly.GetManifestResourceStream(xManStreamName + ".asm"))) { - Assert.AreEqual(xReader.ReadToEnd().Replace(' ', '_').Replace('\t', '_'), xOut.ToString().Replace(' ', '_').Replace('\t', '_')); + Assert.AreEqual(xReader.ReadToEnd(), xOut.ToString()); } } } diff --git a/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs b/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs index 9634e5a52..92b703a11 100644 --- a/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs +++ b/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs @@ -34,6 +34,19 @@ namespace Indy.IL2CPU.Tests.Assembler.X86 { Verify(); } + [Test] + public void TestImmediateToRegister8() { + new Move { DestinationReg = Registers.AL, SourceValue = 1 }; + new Move { DestinationReg = Registers.BL, SourceValue = 2 }; + new Move { DestinationReg = Registers.CL, SourceValue = 3 }; + new Move { DestinationReg = Registers.DL, SourceValue = 4 }; + new Move { DestinationReg = Registers.AH, SourceValue = 1 }; + new Move { DestinationReg = Registers.BH, SourceValue = 2 }; + new Move { DestinationReg = Registers.CH, SourceValue = 3 }; + new Move { DestinationReg = Registers.DH, SourceValue = 4 }; + Verify(); + } + [Test] public void TestImmediateToMemorySimple8() { new Move { Size = 8, DestinationReg = Registers.EAX, DestinationIsIndirect = true, SourceValue = 65 }; diff --git a/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToRegister8.asm b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToRegister8.asm new file mode 100644 index 000000000..2bd1f835c --- /dev/null +++ b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToRegister8.asm @@ -0,0 +1,10 @@ +use32 +org 0x200000 + mov byte AL, 0x1 + mov byte BL, 0x2 + mov byte CL, 0x3 + mov byte DL, 0x4 + mov byte AH, 0x1 + mov byte BH, 0x2 + mov byte CH, 0x3 + mov byte DH, 0x4 diff --git a/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToRegister8.bin b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToRegister8.bin new file mode 100644 index 000000000..10e1d09f0 --- /dev/null +++ b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToRegister8.bin @@ -0,0 +1 @@ +°³±²´·µ¶ \ No newline at end of file diff --git a/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj b/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj index feec3327a..6503c220a 100644 --- a/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj +++ b/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj @@ -73,6 +73,12 @@ + + + + + +