예제 #1
0
 public override void Assemble(Assembler assembler)
 {
     if (RegDst is ValReg32)
         throw new AssembleException(ErrorMessage.NotSupported);
     assembler.Add(AsmMov.Create(RegDst.Index, RegSrc));
     assembler.Add(Instruction.CreateInstance(MetaInfo.InstructionType, RegDst.Index) as Instruction);
 }
예제 #2
0
 public override void Assemble(Assembler assembler)
 {
     if (RegDst is ValReg32)
     {
         throw new AssembleException(ErrorMessage.NotSupported);
     }
     assembler.Add(AsmMov.Create(RegDst.Index, Value));
 }
예제 #3
0
 public override void Assemble(Assembler assembler)
 {
     if (Count is ValReg)
     {
         assembler.Add(AsmMov.Create(Assembler.IReg, (int)((Count as ValReg).Index << 4)));
         assembler.Add(AsmStoreOp.Create(Assembler.IReg));
     }
     else if (Count is ValReg32)
     {
         throw new AssembleException(ErrorMessage.NotSupported);
     }
     assembler.Add(AsmFor.Create());
     assembler.ForMapping[this] = assembler.Last() as AsmFor;
 }
예제 #4
0
 public override void Assemble(Assembler assembler)
 {
     if (Right is ValInstant)
     {
         assembler.Add(AsmMov.Create(Assembler.IReg, Right));
         assembler.Add(Operater.Assemble(Left.Index, Assembler.IReg));
     }
     else
     {
         assembler.Add(Operater.Assemble(Left.Index, (Right as ValReg).Index));
     }
     assembler.Add(AsmBranchFalse.Create());
     assembler.IfMapping[this] = assembler.Last() as AsmBranchFalse;
 }
예제 #5
0
 public override void Assemble(Assembler assembler)
 {
     if (Value is ValInstant)
     {
         assembler.Add(AsmMov.Create(Assembler.IReg, -(Value as ValInstant).Val));
         assembler.Add(AsmAdd.Create(RegDst.Index, new ValReg(Assembler.IReg)));
     }
     else if (Value is ValReg)
     {
         assembler.Add(AsmMov.Create(Assembler.IReg, Value));
         assembler.Add(AsmNegative.Create(Assembler.IReg));
         assembler.Add(AsmAdd.Create(RegDst.Index, new ValReg(Assembler.IReg)));
     }
     else
     {
         throw new AssembleException(ErrorMessage.NotSupported);
     }
 }
예제 #6
0
        public override void Assemble(Assembler assembler)
        {
            if (RegIter is ValReg32)
            {
                throw new AssembleException(ErrorMessage.NotSupported);
            }
            assembler.Add(AsmMov.Create(RegIter.Index, InitVal));
            uint e_val = RegIter.Index;

            if (Count is ValReg)
            {
                e_val |= (Count as ValReg).Index << 4;
            }
            else if (Count is ValReg32)
            {
                throw new AssembleException(ErrorMessage.NotSupported);
            }
            assembler.Add(AsmMov.Create(Assembler.IReg, (int)e_val));
            assembler.Add(AsmStoreOp.Create(Assembler.IReg));
            assembler.Add(AsmFor.Create());
            assembler.ForMapping[this] = assembler.Last() as AsmFor;
        }