mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 22:12:25 +00:00
50 lines
1.9 KiB
C#
50 lines
1.9 KiB
C#
using System;
|
|
|
|
namespace Cosmos.IL2CPU.Profiler.IL
|
|
{
|
|
[Cosmos.IL2CPU.OpCode(ILOp.Code.Div_Un)]
|
|
public class Div_Un: ILOpProfiler
|
|
{
|
|
|
|
|
|
|
|
#region Old code
|
|
// using System;
|
|
//
|
|
// using CPUx86 = Indy.IL2CPU.Assembler.X86;
|
|
//
|
|
// namespace Indy.IL2CPU.IL.X86 {
|
|
// [Cosmos.IL2CPU.OpCode(ILOp.Code.Div_Un)]
|
|
// public class Div_Un: ILOpProfiler {
|
|
// public Div_Un(ILReader aReader, MethodInformation aMethodInfo)
|
|
// : base(aReader, aMethodInfo) {
|
|
// }
|
|
// public override void DoAssemble() {
|
|
// var xStackItem= Assembler.StackContents.Pop();
|
|
// if (xStackItem.IsFloat) {
|
|
// throw new Exception("Floats not yet supported!");
|
|
// }
|
|
// if (xStackItem.Size == 8) {
|
|
// //TODO: implement proper div support for 8byte values!
|
|
// new CPUx86.Xor { DestinationReg = CPUx86.Registers.EDX, SourceReg = CPUx86.Registers.EDX };
|
|
// new CPUx86.Pop{DestinationReg = CPUx86.Registers.ECX};
|
|
// new CPUx86.Add { DestinationReg = CPUx86.Registers.ESP, SourceValue = 4 };
|
|
// new CPUx86.Pop { DestinationReg = CPUx86.Registers.EAX };
|
|
// new CPUx86.Add { DestinationReg = CPUx86.Registers.ESP, SourceValue = 4 };
|
|
// new CPUx86.Divide { DestinationReg = CPUx86.Registers.ECX };
|
|
// new CPUx86.Push { DestinationValue = 0 };
|
|
// new CPUx86.Push { DestinationReg = CPUx86.Registers.EAX };
|
|
//
|
|
// } else {
|
|
// new CPUx86.Xor { DestinationReg = CPUx86.Registers.EDX, SourceReg = CPUx86.Registers.EDX };
|
|
// new CPUx86.Pop { DestinationReg = CPUx86.Registers.ECX };
|
|
// new CPUx86.Pop{DestinationReg = CPUx86.Registers.EAX};
|
|
// new CPUx86.Divide{DestinationReg=CPUx86.Registers.ECX};
|
|
// new CPUx86.Push { DestinationReg = CPUx86.Registers.EAX };
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
#endregion
|
|
}
|
|
}
|