예제 #1
0
 public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
 {
     aOutput.Write(mMnemonic);
     aOutput.Write(" ");
     aOutput.Write(SizeToString(Size));
     if (!DestinationEmpty)
     {
         aOutput.Write(" ");
         aOutput.Write(this.GetDestinationAsString());
     }
 }
        public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
        {
            aOutput.Write(mMnemonic);
            String destination = this.GetDestinationAsString();

            if (!(DestinationEmpty && destination.Equals("")))
            {
                aOutput.Write(" ");
                aOutput.Write(destination);
            }
        }
예제 #3
0
        public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
        {
            aOutput.Write(mMnemonic);
            String destination = this.GetDestinationAsString();

            if (!destination.Equals(""))
            {
                aOutput.Write(" ");
                aOutput.Write(destination);
                string source = this.GetSourceAsString();
                if (!(SourceEmpty && source.Equals("")))
                {
                    aOutput.Write(", ");
                    aOutput.Write(source);
                }
            }
        }
예제 #4
0
        public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter 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();
            }
        }
예제 #5
0
 public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
 {
     aOutput.Write(mMnemonic);
     aOutput.Write(" ");
     aOutput.Write(this.GetDestinationAsString());
     aOutput.Write(", ");
     aOutput.Write(this.GetSourceAsString());
     aOutput.Write(", ");
     aOutput.Write(this.pseudoOpcode);
 }
예제 #6
0
        public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
        {
            if ((Prefixes & InstructionPrefixes.Repeat) != 0)
            {
                aOutput.Write("rep ");
            }
            switch (Size)
            {
            case 32:
                aOutput.Write("stosd");
                return;

            case 16:
                aOutput.Write("stosw");
                return;

            case 8:
                aOutput.Write("stosb");
                return;

            default: throw new Exception("Size not supported!");
            }
        }
예제 #7
0
 public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
 {
     if (DestinationRef != null)
     {
         aOutput.Write("jmp ");
         aOutput.Write(Segment);
         aOutput.Write(":");
         aOutput.Write(DestinationRef.ToString());
     }
     else
     {
         aOutput.Write("jmp ");
         aOutput.Write(Segment);
         aOutput.Write(":0x0");
     }
 }
예제 #8
0
 public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
 {
     if (Size == 0)
     {
         Size = 32;
         //Console.WriteLine("ERRROR no size set for Instruction - set to 4 InstructionWithDestinationAndSourceAndSize") ;
     }
     aOutput.Write(mMnemonic);
     aOutput.Write(" ");
     aOutput.Write(SizeToString(Size));
     if (!DestinationEmpty)
     {
         aOutput.Write(" ");
         aOutput.Write(this.GetDestinationAsString());
         aOutput.Write(", ");
         aOutput.Write(this.GetSourceAsString());
     }
 }
예제 #9
0
        public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
        {
            switch (Condition)
            {
            case FloatConditionalMoveTestEnum.Below:
                aOutput.Write("fcmovb");
                break;

            case FloatConditionalMoveTestEnum.Equal:
                aOutput.Write("fcmove");
                break;

            case FloatConditionalMoveTestEnum.BelowOrEqual:
                aOutput.Write("fcmovbe");
                break;

            case FloatConditionalMoveTestEnum.Unordered:
                aOutput.Write("fcmovu");
                break;

            case FloatConditionalMoveTestEnum.NotBelow:
                aOutput.Write("fcmovnb");
                break;

            case FloatConditionalMoveTestEnum.NotEqual:
                aOutput.Write("fcmovne");
                break;

            case FloatConditionalMoveTestEnum.NotBelowOrEqual:
                aOutput.Write("fcmovnbe");
                break;

            case FloatConditionalMoveTestEnum.Ordered:
                aOutput.Write("fcmovnu");
                break;
            }
            aOutput.Write(" ");
            aOutput.Write("ST0");
            aOutput.Write(", ");
            aOutput.Write(this.GetSourceAsString());
        }
예제 #10
0
 public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
 {
     aOutput.Write("extern ");
     aOutput.Write(Name);
 }
예제 #11
0
 public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
 {
     base.WriteText(aAssembler, aOutput);
     aOutput.Write(", DX");
 }
예제 #12
0
        public static void WriteToFile(XzaarAssembly xzaarAssembly, string filename)
        {
            var writer = new AssemblyWriter();

            writer.Write(new AssemblyWriterContext(xzaarAssembly, filename));
        }
예제 #13
0
 public override void WriteText(NCAsm.AsmContext aAssembler, AssemblyWriter aOutput)
 {
     //TODO: In base have a property that has the opcode from above and we can reuse it.
     aOutput.Write("Int " + DestinationValue.Value.ToString("X2") + "h");
 }