Cosmos/source/Cosmos.Assembler/x86/Return.cs
2016-06-11 16:13:13 -04:00

32 lines
746 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Cosmos.Assembler.x86 {
[Cosmos.Assembler.OpCode("ret")]
public class Return: Instruction {
public Return() {
DestinationValue = 0;
}
public uint DestinationValue
{
get;
set;
}
public override void WriteText(Assembler aAssembler, TextWriter aOutput)
{
if (DestinationValue == 0)
{
aOutput.WriteLine("Ret");
}
else
{
aOutput.WriteLine("Ret 0x" + DestinationValue.ToString("X"));
}
}
}
}