PERWAPI.CILInstructions.PushInt C# (CSharp) Method

PushInt() public method

Add an instruction which puts an integer on TOS. This method selects the correct instruction based on the value of the integer.
public PushInt ( int i ) : void
i int the integer value
return void
        public void PushInt(int i)
        {
            if (i == -1) {
                AddToBuffer(new Instr(Op.ldc_i4_m1));
            } else if ((i >= 0) && (i <= 8)) {
                Op op = (Op)(Op.ldc_i4_0 + i);
                AddToBuffer(new Instr(op));
            } else if ((i >= minByteVal) && (i <= maxByteVal)) {
                AddToBuffer(new IntInstr(IntOp.ldc_i4_s,i));
            } else {
                AddToBuffer(new IntInstr(IntOp.ldc_i4,i));
            }
        }