public FluentEmitter IfNot() { Pop(); var block = new IfBlock() { StartInstruction = LastEmittedInstruction, OpCode = OpCodes.Brtrue }; // it jumps if value top on stack is true IfBlocks.Push(block); return this; }
public FluentEmitter Ifgte() { Pop(); var pop1 = LastEmittedInstruction; Pop(); var block = new IfBlock() { StartInstruction = pop1, IsDoublePop = true, OpCode = OpCodes.Blt }; IfBlocks.Push(block); return this; }
public FluentEmitter IfNot() { Pop(); var block = new IfBlock() { StartInstruction = LastEmittedInstruction, OpCode = OpCodes.Brtrue }; // it jumps if value top on stack is true IfBlocks.Push(block); return(this); }
public FluentEmitter Else() { if(IfBlocks.Count == 0 || IfBlocks.Peek().OpCode == OpCodes.Br) throw new Exception("no if blfor else"); Nop(); var jumpstart = LastEmittedInstruction; EndIf(); var block = new IfBlock() { StartInstruction = jumpstart, OpCode = OpCodes.Br }; // it jumps if value top on stack is true IfBlocks.Push(block); return this; }
public FluentEmitter Ifgte() { Pop(); var pop1 = LastEmittedInstruction; Pop(); var block = new IfBlock() { StartInstruction = pop1, IsDoublePop = true, OpCode = OpCodes.Blt }; IfBlocks.Push(block); return(this); }
public FluentEmitter Else() { if (IfBlocks.Count == 0 || IfBlocks.Peek().OpCode == OpCodes.Br) { throw new Exception("no if blfor else"); } Nop(); var jumpstart = LastEmittedInstruction; EndIf(); var block = new IfBlock() { StartInstruction = jumpstart, OpCode = OpCodes.Br }; // it jumps if value top on stack is true IfBlocks.Push(block); return(this); }