Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mterwoord committed Jun 16, 2016
1 parent 2468981 commit dd1710d
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Users/Matthijs/Testing/MonoCecilToEcmaCil1/Reader.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
2 changes: 1 addition & 1 deletion Users/Orvid/Orvid.Extensions/System/Half.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;

Expand Down
1 change: 1 addition & 0 deletions source/Cosmos.Assembler/Cosmos.Assembler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
<Compile Include="x86\INT.cs" />
<Compile Include="x86\INT1.cs" />
<Compile Include="x86\INT3.cs" />
<Compile Include="x86\Interrupt.cs" />
<Compile Include="x86\IRET.cs" />
<Compile Include="x86\JumpAlways.cs" />
<Compile Include="x86\JumpBase.cs" />
Expand Down
7 changes: 7 additions & 0 deletions source/Cosmos.Assembler/x86/Interrupt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Cosmos.Assembler.x86
{
public class Interrupt: Instruction
{

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Reflection;

using Cosmos.IL2CPU;
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.IL2CPU/IL/Conv_I8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public override void Execute( MethodInfo aMethod, ILOpCode aOpCode )
else
{
XS.Pop(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
new CPUx86.SignExtendAX { Size = 32 };
XS.SignExtendAX(XSRegisters.RegisterSize.Int32);
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EDX));
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
}
Expand Down
4 changes: 2 additions & 2 deletions source/Cosmos.IL2CPU/IL/Conv_Ovf_I.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public override void Execute(MethodInfo aMethod, ILOpCode aOpCode)
// case 8:
// {
// XS.Pop(XSRegisters.EAX);
// new CPUx86.SignExtendAX { Size = 32 };
// XS.SignExtendAX(XSRegisters.RegisterSize.Int32);
// //all bits of EDX == sign (EAX)
// XS.Pop(XSRegisters.EBX);
// //must be equal to EDX
Expand Down Expand Up @@ -99,7 +99,7 @@ public override void Execute(MethodInfo aMethod, ILOpCode aOpCode)
// case 8:
// {
// XS.Pop(XSRegisters.EAX);
// new CPUx86.SignExtendAX { Size = 32 };
// XS.SignExtendAX(XSRegisters.RegisterSize.Int32);
// //all bits of EDX == sign (EAX)
// XS.Pop(XSRegisters.EBX);
// //must be equal to EDX
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.IL2CPU/IL/Conv_Ovf_I8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override void Execute( MethodInfo aMethod, ILOpCode aOpCode )
case 2:
case 4:
XS.Pop(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
new CPUx86.SignExtendAX { Size = 32 };
XS.SignExtendAX(XSRegisters.RegisterSize.Int32);
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EDX));
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
break;
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.IL2CPU/IL/Conv_Ovf_I_Un.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override void Execute(MethodInfo aMethod, ILOpCode aOpCode) {
// // "EDX");
// //new CPUx86.JumpIfZero(NextInstructionLabel);
// ////equals
// //new CPUx86.Interrupt(CPUx86.Interrupt.INTO);
// //newCPUx86.Interr upt(CPUx86.Interrupt.INTO);
// break;
// }
// default:
Expand Down
6 changes: 3 additions & 3 deletions source/Cosmos.IL2CPU/IL/Div.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override void Execute( MethodInfo aMethod, ILOpCode aOpCode )
XS.IntegerDivide(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ESI));

// sign extend
new CPUx86.SignExtendAX { Size = 32 };
XS.SignExtendAX(XSRegisters.RegisterSize.Int32);

// save result to stack
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EDX));
Expand All @@ -109,7 +109,7 @@ public override void Execute( MethodInfo aMethod, ILOpCode aOpCode )
XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EDX));
// extend that sign is in edx
new CPUx86.SignExtendAX { Size = 32 };
XS.SignExtendAX(XSRegisters.RegisterSize.Int32);
// divide high part
XS.IntegerDivide(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ESI));
// save high result
Expand Down Expand Up @@ -137,7 +137,7 @@ public override void Execute( MethodInfo aMethod, ILOpCode aOpCode )
{
XS.Pop(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX));
XS.Pop(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
new CPUx86.SignExtendAX { Size = 32 };
XS.SignExtendAX(XSRegisters.RegisterSize.Int32);
XS.IntegerDivide(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX));
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
}
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.IL2CPU/IL/Rem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public override void Execute(MethodInfo aMethod, ILOpCode aOpCode) {
XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX));
XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EDX));
// extend that sign is in edx
new CPUx86.SignExtendAX { Size = 32 };
XS.SignExtendAX(XSRegisters.RegisterSize.Int32);
// divide high part
XS.IntegerDivide(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ESI));
XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX));
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.IL2CPU/Plugs/Assemblers/CtorImplAssembler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

using Cosmos.Assembler;
using Cosmos.IL2CPU.X86.IL;
Expand Down
2 changes: 1 addition & 1 deletion source/Unused/Cosmos.Kernel.Plugs/Assemblers/CPUID.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Cosmos.IL2CPU.Plugs;
using Assembler = Cosmos.Assembler;
using CPUAll = Cosmos.Assembler;
Expand Down
7 changes: 7 additions & 0 deletions source/XSharp.Compiler/XS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,5 +1030,12 @@ public static void Or(Register destination, Register source, bool destinationIsI
Do<Or>(destination, source, destinationIsIndirect, destinationDisplacement, sourceIsIndirect, sourceDisplacement);
}

public static void SignExtendAX(RegisterSize size)
{
new SignExtendAX
{
Size = (byte)size
};
}
}
}

0 comments on commit dd1710d

Please sign in to comment.