mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
This commit is contained in:
parent
0454d6b0d3
commit
b3e3e512db
3 changed files with 44 additions and 1 deletions
|
|
@ -347,6 +347,7 @@
|
||||||
<Compile Include="X86\Registers.cs" />
|
<Compile Include="X86\Registers.cs" />
|
||||||
<Compile Include="X86\Return.cs" />
|
<Compile Include="X86\Return.cs" />
|
||||||
<Compile Include="X86\RotateThroughCarryRight.cs" />
|
<Compile Include="X86\RotateThroughCarryRight.cs" />
|
||||||
|
<Compile Include="X86\Scas.cs" />
|
||||||
<Compile Include="X86\SetInterruptFlag.cs" />
|
<Compile Include="X86\SetInterruptFlag.cs" />
|
||||||
<Compile Include="X86\ShiftLeft.cs" />
|
<Compile Include="X86\ShiftLeft.cs" />
|
||||||
<Compile Include="X86\ShiftRight.cs" />
|
<Compile Include="X86\ShiftRight.cs" />
|
||||||
|
|
|
||||||
42
source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Scas.cs
Normal file
42
source2/IL2PCU/Cosmos.IL2CPU.X86/X86/Scas.cs
Normal file
|
|
@ -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!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,7 @@ namespace Cosmos.IL2CPU.X86 {
|
||||||
None,
|
None,
|
||||||
Lock,
|
Lock,
|
||||||
Repeat,
|
Repeat,
|
||||||
RepeatNotEqual
|
RepeatTillNotEqual
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IInstructionWithPrefix {
|
public interface IInstructionWithPrefix {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue