mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-30 12:50:19 +00:00
[-] some unnecessary overloads [+] overloaded operators in order to allow defining memory operands easily [+] overloaded automatic conversions to allow operands [+] Labels support [+] code generator based on F# started
28 lines
650 B
C#
28 lines
650 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Lost.JIT.AMD64
|
|
{
|
|
[Serializable]
|
|
public class InstructionOperand
|
|
{
|
|
public static implicit operator InstructionOperand(byte value)
|
|
{
|
|
return new ImmediateOperand(value);
|
|
}
|
|
public static implicit operator InstructionOperand(short value)
|
|
{
|
|
return new ImmediateOperand(value);
|
|
}
|
|
public static implicit operator InstructionOperand(int value)
|
|
{
|
|
return new ImmediateOperand(value);
|
|
}
|
|
public static implicit operator InstructionOperand(long value)
|
|
{
|
|
return new ImmediateOperand(value);
|
|
}
|
|
}
|
|
}
|