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); }
public override void Assemble(Assembler assembler) { if (RegDst is ValReg32) { throw new AssembleException(ErrorMessage.NotSupported); } assembler.Add(AsmMov.Create(RegDst.Index, Value)); }
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; }
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; }
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); } }
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; }