Cosmos/source2/Compiler/Cosmos.Compiler.Assembler.X86/386AndUp/SignExtendAX.cs
2010-08-05 17:11:04 +00:00

26 lines
No EOL
784 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.Compiler.Assembler.X86 {
[OpCode("cdq")]
public class SignExtendAX : InstructionWithSize {
public override void WriteText( Cosmos.Compiler.Assembler.Assembler aAssembler, System.IO.TextWriter aOutput )
{
switch (Size) {
case 32:
aOutput.Write("cdq");
return;
case 16:
aOutput.Write("cwde");
return;
case 8:
aOutput.Write("cbw");
return;
default:
throw new NotSupportedException();
}
}
}
}