mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 12:58:39 +00:00
26 lines
No EOL
784 B
C#
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();
|
|
}
|
|
}
|
|
}
|
|
} |