mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
Add initial pass at constants and operands that reference labels
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
namespace Microsoft.Iris.Asm.Models;
|
||||
|
||||
public enum LiteralDataType : byte
|
||||
{
|
||||
Byte,
|
||||
UInt16,
|
||||
UInt32,
|
||||
Int32,
|
||||
Bytes,
|
||||
}
|
||||
|
||||
public abstract record Operand(object Value, string Content = null) : AsmItem
|
||||
{
|
||||
public override string ToString() => Content ?? Value.ToString();
|
||||
}
|
||||
|
||||
public record OperandLiteral : Operand
|
||||
{
|
||||
public OperandLiteral(object value, LiteralDataType dataType, string content = null) : base(value, content)
|
||||
{
|
||||
DataType = dataType;
|
||||
}
|
||||
|
||||
public LiteralDataType DataType { get; init; }
|
||||
|
||||
public override string ToString() => base.ToString();
|
||||
}
|
||||
|
||||
public record OperandReference : Operand
|
||||
{
|
||||
public OperandReference(string labelName) : base(labelName, labelName)
|
||||
{
|
||||
}
|
||||
|
||||
public string LabelName => Content;
|
||||
|
||||
public override string ToString() => base.ToString();
|
||||
}
|
||||
Reference in New Issue
Block a user