Cosmos/source/Indy.IL2CPU.Assembler.X86/Move.cs
2008-04-27 00:57:57 +00:00

41 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Indy.IL2CPU.Assembler.X86 {
[OpCode(0xFFFFFFFF, "mov")]
public class Move: Instruction {
public readonly string Destination;
public readonly string Source;
public readonly string Size;
public Move(string aSize, string aDestination, string aSource)
: this(aDestination, aSource) {
Size = aSize;
}
public Move(string aSize, string aDestination, UInt32 aSource)
: this(aDestination, aSource) {
Size = aSize;
}
public Move(string aDestination, string aSource) {
Destination = aDestination;
Source = aSource;
}
public Move(string aDestination, UInt32 aSource) {
Destination = aDestination;
Source = aSource.ToString();
}
public override string ToString() {
if (String.IsNullOrEmpty(Size)) {
return "mov " + Destination + "," + Source;
} else {
return "mov " + Size + " " + Destination + ", " + Source;
}
}
}
}