Cosmos/source2/Compiler/Cosmos.Compiler.XSharp/RegisterESI.cs
mterwoord_cp ede6b418c5
2011-01-04 17:26:33 +00:00

52 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cosmos.Compiler.Assembler;
using Cosmos.Compiler.Assembler.X86;
namespace Cosmos.Compiler.XSharp {
public class RegisterESI : Register32 {
public static readonly RegisterESI Instance = new RegisterESI();
public static RegisterESI operator ++(RegisterESI aRegister) {
new Inc { DestinationReg = aRegister.GetId() };
return aRegister;
}
public static RegisterESI operator --(RegisterESI aRegister) {
new Dec { DestinationReg = aRegister.GetId() };
return aRegister;
}
public static implicit operator RegisterESI(ElementReference aReference) {
Instance.Move(aReference);
return Instance;
}
public static implicit operator RegisterESI(MemoryAction aAction) {
Instance.Move(aAction);
return Instance;
}
public static implicit operator RegisterESI(UInt32 aValue) {
Instance.Move(aValue);
return Instance;
}
public static implicit operator RegisterESI(RegisterESP aValue) {
Instance.Move(aValue.GetId());
return Instance;
}
public static implicit operator RegisterESI(RegisterEBP aValue) {
Instance.Move(aValue);
return Instance;
}
public static implicit operator RegisterESI(RegisterEAX aValue)
{
Instance.Move(aValue);
return Instance;
}
}
}