diff --git a/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs b/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs index 351c49e5b..50307b516 100644 --- a/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs +++ b/source/Indy.IL2CPU.Tests/Assembler/X86/MoveTests.cs @@ -8,6 +8,18 @@ using Indy.IL2CPU.Assembler.X86; namespace Indy.IL2CPU.Tests.Assembler.X86 { [TestFixture] public class MoveTests: BaseTest { + /* + * situations to cover: + * immediate to memory indirect + byte (8bit, 16bit, 32bit) + * immediate to memory indirect + dword (8bit, 16bit, 32bit) + * register to memory indirect + byte (8bit, 16bit, 32bit) + * register to memory indirect + dword (8bit, 16bit, 32bit) + * immediate to memoryreg indirect + byte (8bit, 16bit, 32bit) + * immediate to memoryreg indirect + dword (8bit, 16bit, 32bit) + * register to memoryreg indirect + byte (8bit, 16bit, 32bit) + * register to memoryreg indirect + dword (8bit, 16bit, 32bit) + * register to register (8bit, 16bit, 32bit) + */ [Test] public void TestImmediateToRegister32() { new Move { DestinationReg = Registers.EAX, SourceValue = 1 }; @@ -72,5 +84,18 @@ namespace Indy.IL2CPU.Tests.Assembler.X86 { new Move { Size = 16, DestinationReg = Registers.EBP, DestinationIsIndirect = true, SourceValue = 72 }; Verify(); } + + [Test] + public void TestImmediateToMemorySimple32() { + new Move { Size = 32, DestinationReg = Registers.EAX, DestinationIsIndirect = true, SourceValue = 65 }; + new Move { Size = 32, DestinationReg = Registers.EBX, DestinationIsIndirect = true, SourceValue = 66 }; + new Move { Size = 32, DestinationReg = Registers.ECX, DestinationIsIndirect = true, SourceValue = 67 }; + new Move { Size = 32, DestinationReg = Registers.EDX, DestinationIsIndirect = true, SourceValue = 68 }; + new Move { Size = 32, DestinationReg = Registers.EDI, DestinationIsIndirect = true, SourceValue = 69 }; + new Move { Size = 32, DestinationReg = Registers.ESI, DestinationIsIndirect = true, SourceValue = 70 }; + new Move { Size = 32, DestinationReg = Registers.ESP, DestinationIsIndirect = true, SourceValue = 71 }; + new Move { Size = 32, DestinationReg = Registers.EBP, DestinationIsIndirect = true, SourceValue = 72 }; + Verify(); + } } } \ No newline at end of file diff --git a/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.asm b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.asm new file mode 100644 index 000000000..d3f2d3779 --- /dev/null +++ b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.asm @@ -0,0 +1,10 @@ +use32 +org 0x200000 + mov dword [EAX], 0x41 + mov dword [EBX], 0x42 + mov dword [ECX], 0x43 + mov dword [EDX], 0x44 + mov dword [EDI], 0x45 + mov dword [ESI], 0x46 + mov dword [ESP], 0x47 + mov dword [EBP], 0x48 diff --git a/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.bin b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.bin new file mode 100644 index 000000000..02aef5504 Binary files /dev/null and b/source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.bin differ diff --git a/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj b/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj index feb44ca1c..d11ab812f 100644 --- a/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj +++ b/source/Indy.IL2CPU.Tests/Indy.IL2CPU.Tests.csproj @@ -85,6 +85,12 @@ + + + + + +