mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
37 lines
949 B
C#
37 lines
949 B
C#
using Microsoft.Iris.Markup;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Microsoft.Iris.Debug.Data;
|
|
|
|
[Serializable]
|
|
public class InterpreterInstruction : IComparable<InterpreterInstruction>
|
|
{
|
|
public InterpreterInstruction() { }
|
|
|
|
public InterpreterInstruction(OpCode opCode, uint offset, string loadUri)
|
|
{
|
|
OpCode = opCode;
|
|
Offset = offset;
|
|
LoadUri = loadUri;
|
|
}
|
|
|
|
public OpCode OpCode { get; set; }
|
|
|
|
public uint Offset { get; set; }
|
|
|
|
public string LoadUri { get; set; }
|
|
|
|
public List<object> Operands { get; } = new();
|
|
|
|
public int CompareTo(InterpreterInstruction other)
|
|
{
|
|
var stringCmp = string.Compare(LoadUri, other.LoadUri, StringComparison.Ordinal);
|
|
return stringCmp != 0
|
|
? stringCmp
|
|
: Offset.CompareTo(other.Offset);
|
|
}
|
|
|
|
public override string ToString() => $"[0x{Offset:X}] {OpCode} {string.Join(", ", Operands)}";
|
|
}
|