Cosmos/source2/Compiler/Cosmos.Compiler.Assembler/Comment.cs
mterwoord_cp 89b92ac9fd
2010-08-21 15:27:53 +00:00

46 lines
1.2 KiB
C#

using System;
using System.Linq;
namespace Cosmos.Compiler.Assembler
{
public class Comment : Instruction
{
public readonly string Text;
public Comment( Assembler aAssembler, string aText )
: base() //HACK
{
if (aText.StartsWith(";")) {
aText = aText.TrimStart(';').TrimStart();
}
Text = String.Intern(aText);
}
public Comment(string aText):base(true) {
if (aText.StartsWith(";")) {
aText = aText.TrimStart(';').TrimStart();
}
Text = String.Intern(aText);
}
public override void WriteText( Assembler aAssembler, System.IO.TextWriter aOutput )
{
aOutput.Write( "; " );
aOutput.Write( Text );
}
public override void UpdateAddress( Assembler aAssembler, ref ulong aAddress )
{
base.UpdateAddress( aAssembler, ref aAddress );
}
public override bool IsComplete( Assembler aAssembler )
{
return true;
}
public override byte[] GetData( Assembler aAssembler )
{
return new byte[ 0 ];
}
}
}