From d9ccd387c5ff9576459feeeed099b2cfd5e99d12 Mon Sep 17 00:00:00 2001 From: mterwoord_cp <7cd3fd84a0151ea055c2f79e4d2eef9576fe9afesxUZAwxD> Date: Mon, 10 Nov 2008 11:44:15 +0000 Subject: [PATCH] --- .../Assembler/X86/MoveTests.cs | 25 ++++++++++++++++++ .../MoveTests/ImmediateToMemorySimple32.asm | 10 +++++++ .../MoveTests/ImmediateToMemorySimple32.bin | Bin 0 -> 50 bytes .../Indy.IL2CPU.Tests.csproj | 6 +++++ .../Playgrounds/Matthijs/TestApp/Program.cs | 18 ++++++------- 5 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.asm create mode 100644 source/Indy.IL2CPU.Tests/Assembler/X86/VerificationData/MoveTests/ImmediateToMemorySimple32.bin 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 0000000000000000000000000000000000000000..02aef55041e4264633206c9cd1fef0b9927f613f GIT binary patch literal 50 pcmX@k;K;zhaGco*L^3*qNG2B$$?ggw+1x-Ri;6pla%J!UQULKo2;Bex literal 0 HcmV?d00001 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 @@ + + + + + +