Cosmos/source2/Compiler/Cosmos.Compiler.Assembler.X86/SignExtendAX.cs
kudzu_cp 3488d1309a
2011-07-17 23:51:19 +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();
}
}
}
}