From b3e3e512dbdf7602c8f36ac8a4e4e11504003f73 Mon Sep 17 00:00:00 2001
From: mterwoord_cp <7cd3fd84a0151ea055c2f79e4d2eef9576fe9afesxUZAwxD>
Date: Sun, 1 Aug 2010 15:25:09 +0000
Subject: [PATCH]
---
.../Cosmos.IL2CPU.X86.csproj | 1 +
source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Scas.cs | 42 +++++++++++++++++++
.../X86/_Infra/IInstructionWithPrefix.cs | 2 +-
3 files changed, 44 insertions(+), 1 deletion(-)
create mode 100644 source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Scas.cs
diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/Cosmos.IL2CPU.X86.csproj b/source2/IL2PCU/Cosmos.IL2CPU.X86/Cosmos.IL2CPU.X86.csproj
index d17c01e30..cd7a11bc4 100644
--- a/source2/IL2PCU/Cosmos.IL2CPU.X86/Cosmos.IL2CPU.X86.csproj
+++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/Cosmos.IL2CPU.X86.csproj
@@ -347,6 +347,7 @@
+
diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Scas.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Scas.cs
new file mode 100644
index 000000000..f491471bb
--- /dev/null
+++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Scas.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Cosmos.IL2CPU.X86
+{
+ [OpCode("scas")]
+ public class Scas: InstructionWithSize, IInstructionWithPrefix
+ {
+ public static void InitializeEncodingData(Instruction.InstructionData aData)
+ {
+ }
+
+ public InstructionPrefixes Prefixes
+ {
+ get;
+ set;
+ }
+
+ public override void WriteText(Cosmos.IL2CPU.Assembler aAssembler, System.IO.TextWriter aOutput)
+ {
+ if ((Prefixes & InstructionPrefixes.RepeatTillNotEqual) != 0)
+ {
+ aOutput.Write("repne ");
+ }
+ switch (Size)
+ {
+ case 32:
+ aOutput.Write("scasd");
+ return;
+ case 16:
+ aOutput.Write("scasw");
+ return;
+ case 8:
+ aOutput.Write("scasb");
+ return;
+ default: throw new Exception("Size not supported!");
+ }
+ }
+ }
+}
diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/_Infra/IInstructionWithPrefix.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/_Infra/IInstructionWithPrefix.cs
index ffd7667e4..896697e9a 100644
--- a/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/_Infra/IInstructionWithPrefix.cs
+++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/X86/_Infra/IInstructionWithPrefix.cs
@@ -9,7 +9,7 @@ namespace Cosmos.IL2CPU.X86 {
None,
Lock,
Repeat,
- RepeatNotEqual
+ RepeatTillNotEqual
}
public interface IInstructionWithPrefix {