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(Assembly.Assembler assembler) { if (Left is not ValRegEx left) { throw new Assembly.AssembleException("外部变量仅限联机模式使用"); } if (Right is ValInstant) { assembler.Add(Assembly.Instructions.AsmMov.Create(Assembly.Assembler.IReg, Right)); assembler.Add(Operater.Assemble(left.Index, Assembly.Assembler.IReg)); } else { assembler.Add(Operater.Assemble(left.Index, (Right as ValReg).Index)); } assembler.Add(Assembly.Instructions.AsmBranchFalse.Create()); assembler.IfMapping[this] = assembler.Last() as Assembly.Instructions.AsmBranchFalse; }