mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-21 05:18:38 +00:00
33 lines
No EOL
1,010 B
C#
33 lines
No EOL
1,010 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Cosmos.Compiler.Assembler.X86 {
|
|
[OpCode("movs")]
|
|
public class Movs : InstructionWithSize, IInstructionWithPrefix {
|
|
public InstructionPrefixes Prefixes {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public override void WriteText( Cosmos.Compiler.Assembler.Assembler aAssembler, System.IO.TextWriter aOutput )
|
|
{
|
|
if ((Prefixes & InstructionPrefixes.Repeat) != 0) {
|
|
aOutput.Write("rep ");
|
|
}
|
|
switch (Size) {
|
|
case 32:
|
|
aOutput.Write("movsd");
|
|
return;
|
|
case 16:
|
|
aOutput.Write("movsw");
|
|
return;
|
|
case 8:
|
|
aOutput.Write("movsb");
|
|
return;
|
|
default: throw new Exception("Size not supported!");
|
|
}
|
|
}
|
|
}
|
|
} |