.NET Framework Intermediate Language IL Instructions Collection

黄舟
Release: 2017-02-22 10:40:52
Original
2057 people have browsed it

IL is the abbreviation of Intermediate Language in the .NET framework. Using the compiler provided by the .NET framework, you can directly compile the source program into an .exe or .dll file. However, the compiled program code at this time is not machine code that can be directly executed by the CPU, but an intermediate language IL (Intermediate Language). ) code.

Name Description
Add Add the two values ​​and push the result to on the calculation stack.
Add.Ovf Adds two integers, performs overflow checking, and pushes the result onto the calculation stack.
Add.Ovf.Un Adds two unsigned integer values, performs overflow checking, and pushes the result onto the evaluation stack.
And Computes the bitwise AND of two values ​​and pushes the result onto the evaluation stack.
Arglist Returns an unmanaged pointer to the argument list of the current method.
Beq If the two values ​​are equal, control is transferred to the target instruction.
Beq.S If the two values ​​are equal, transfer control to the target instruction (short form).
Bge If the first value is greater than or equal to the second value, control is transferred to the target instruction.
Bge.S If the first value is greater than or equal to the second value, transfer control to the target instruction (short form).
Bge.Un When comparing unsigned integer values ​​or unsortable floating point values, if the first value is greater than the second value, then Control is transferred to the target instruction.
Bge.Un.S When comparing unsigned integer values ​​or unsortable floating-point values, if the first value is greater than the second value, then transfers control to the target instruction (short form).
Bgt If the first value is greater than the second value, control is transferred to the target instruction.
Bgt.S If the first value is greater than the second value, transfer control to the target instruction (short form).
Bgt.Un When comparing unsigned integer values ​​or unsortable floating-point values, if the first value is greater than the second value, then Control is transferred to the target instruction.
Bgt.Un.S When comparing unsigned integer values ​​or unsortable floating-point values, if the first value is greater than the second value, then transfers control to the target instruction (short form).
Ble If the first value is less than or equal to the second value, control is transferred to the target instruction.
Ble.S If the first value is less than or equal to the second value, transfer control to the target instruction (short form).
Ble.Un When comparing unsigned integer values ​​or unsortable floating-point values, if the first value is less than or equal to the second value, Then control is transferred to the target instruction.
Ble.Un.S When comparing unsigned integer values ​​or unsortable floating point values, if the first value is less than or equal to the second value , then control is transferred to the target instruction (short form).
Blt If the first value is less than the second value, transfer control to the target instruction.
Blt.S If the first value is less than the second value, transfer control to the target instruction (short form).
Blt.Un When comparing unsigned integer values ​​or unsortable floating-point values, if the first value is less than the second value, then Control is transferred to the target instruction.
Blt.Un.S When comparing unsigned integer values ​​or unsortable floating-point values, if the first value is less than the second value, then transfers control to the target instruction (short form).
Bne.Un When two unsigned integer values ​​or unsortable floating-point values ​​are not equal, transfer control to the target instruction.
Bne.Un.S When two unsigned integer values ​​or unsortable floating-point values ​​are not equal, transfer control to the target instruction (short Format).
Box Convert a value class to an object reference (O type).
Br Unconditionally transfers control to the target instruction.
Br.S Unconditionally transfers control to the target instruction (short form).
Break Sends a signal to the common language construct (CLI) to notify the debugger that a breakpoint has been hit.
Brfalse If value is false, a null reference (Nothing in Visual Basic), or zero, transfers control to the target instruction.
Brfalse.S If value is false, a null reference, or zero, control is transferred to the target instruction.
Brtrue If value is true, non-null, or non-zero, transfer control to the target instruction.
Brtrue.S If value is true, non-null, or non-zero, transfer control to the target instruction (short form).
Call Calls the method indicated by the passed method specifier.
Calli Call the method indicated on the calculation stack (as a pointer to the entry point) with the parameters described by the calling convention.
Callvirt Call the late binding method on the object and push the return value to the calculation stack.
Castclass Attempts to cast the object passed by reference to the specified class.
Ceq Compares two values. If the two values ​​are equal, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise, 0 (int32) is pushed onto the evaluation stack.
Cgt Compares two values. If the first value is greater than the second value, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise, 0 (int32) is pushed onto the evaluation stack.
Cgt.Un Compares two unsigned or unsortable values. If the first value is greater than the second value, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise, 0 (int32) is pushed onto the evaluation stack.
Ckfinite Throws an ArithmeticException if the value is not a finite number.
Clt Compares two values. If the first value is less than the second value, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise, 0 (int32) is pushed onto the evaluation stack.
Clt.Un Compares the unsigned or unsortable values ​​value1 and value2. If value1 is less than value2, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise, 0 (int32) is pushed onto the evaluation stack.
Constrained Constrains the type on which virtual method calls are to be made.
Conv.I Convert the value at the top of the calculation stack to a native int.
Conv.I1 Converts the value at the top of the calculation stack to an int8 and then extends (pads) it to an int32.
Conv.I2 Converts the value at the top of the calculation stack to an int16 and then extends (pads) it to an int32.
Conv.I4 Convert the value at the top of the calculation stack to an int32.
Conv.I8 Convert the value at the top of the calculation stack to an int64.
Conv.Ovf.I Converts the signed value at the top of the evaluation stack to a signed native int and throws an OverflowException on overflow.
Conv.Ovf.I.Un Converts the unsigned value at the top of the evaluation stack to a signed native int and throws an OverflowException on overflow.
Conv.Ovf.I1 Convert the signed value at the top of the evaluation stack to a signed int8 and extend it to an int32, throwing an OverflowException on overflow .
Conv.Ovf.I1.Un Convert the unsigned value at the top of the evaluation stack to a signed int8 and extend it to an int32, and on overflow Throws OverflowException.
Conv.Ovf.I2 Convert the signed value at the top of the evaluation stack to a signed int16 and extend it to an int32, throwing an OverflowException on overflow .
Conv.Ovf.I2.Un Convert the unsigned value at the top of the evaluation stack to a signed int16 and extend it to an int32, and on overflow Throws OverflowException.
Conv.Ovf.I4 Convert the signed value at the top of the evaluation stack to a signed int32 and throw an OverflowException on overflow.
Conv.Ovf.I4.Un Converts the unsigned value at the top of the evaluation stack to a signed int32 and throws an OverflowException on overflow.
Conv.Ovf.I8 Convert the signed value at the top of the evaluation stack to a signed int64 and throw an OverflowException on overflow.
Conv.Ovf.I8.Un Converts the unsigned value at the top of the evaluation stack to a signed int64 and throws an OverflowException on overflow.
Conv.Ovf.U Converts the signed value at the top of the evaluation stack to an unsigned native int and throws an OverflowException on overflow.
Conv.Ovf.U.Un Converts the unsigned value at the top of the evaluation stack to an unsigned native int and throws an OverflowException on overflow.
Conv.Ovf.U1 Converts the signed value at the top of the evaluation stack to an unsigned int8 and extends it to an int32, throwing an OverflowException on overflow.
Conv.Ovf.U1.Un Convert the unsigned value at the top of the evaluation stack to an unsigned int8 and extend it to an int32, raising on overflow OverflowException.
Conv.Ovf.U2 Converts the signed value at the top of the evaluation stack to an unsigned int16 and extends it to an int32, throwing an OverflowException on overflow.
Conv.Ovf.U2.Un Converts the unsigned value at the top of the calculation stack to an unsigned int16 and extends it to an int32, raising on overflow OverflowException.
Conv.Ovf.U4 Convert the signed value at the top of the evaluation stack to an unsigned int32 and throw an OverflowException on overflow.
Conv.Ovf.U4.Un Converts the unsigned value at the top of the evaluation stack to an unsigned int32 and throws an OverflowException on overflow.
Conv.Ovf.U8 Convert the signed value at the top of the evaluation stack to an unsigned int64 and throw an OverflowException on overflow.
Conv.Ovf.U8.Un Converts the unsigned value at the top of the evaluation stack to an unsigned int64 and throws an OverflowException on overflow.
Conv.R.Un Converts the unsigned integer value at the top of the evaluation stack to a float32.
Conv.R4 Convert the value at the top of the calculation stack to a float32.
Conv.R8 Convert the value at the top of the calculation stack to float64.
Conv.U Converts the value at the top of the evaluation stack to an unsigned native int, then expands it to a native int.
Conv.U1 Convert the value at the top of the evaluation stack to an unsigned int8 and then extend it to an int32.
Conv.U2 Convert the value at the top of the evaluation stack to an unsigned int16 and then extend it to an int32.
Conv.U4 Convert the value at the top of the evaluation stack to an unsigned int32, then expand it to an int32.
Conv.U8 Convert the value at the top of the evaluation stack to an unsigned int64, then expand it to an int64.
Cpblk Copy the specified number of bytes from the source address to the destination address.
Cpobj Copy the value type located at the address of the object (&, * or native int type) to the address of the target object (&, * or native int type) .
p Divides two values ​​and pushes the result onto the evaluation stack as a float (F type) or quotient (int32 type).
p.Un Divides two unsigned integer values ​​and pushes the result (int32) onto the evaluation stack.
Dup Copy the current topmost value on the calculation stack, and then push the copy onto the calculation stack.
Endfilter Transfers control from the exception's filter clause back to the common language construct (CLI) exception handler.
Endfinally Transfer control from the fault or finally clause of the exception block back to the common language construct (CLI) exception handler.
Initblk Initializes the specified block of memory located at a specific address to the given size and initial value.
Initobj Initializes each field of the value type at the specified address to a null reference or 0 for the appropriate primitive type.
Isinst Tests whether an object reference (of type O) is an instance of a specific class.
Jmp Exit the current method and jump to the specified method.
Ldarg Loads the argument (referenced by the specified index value) onto the stack.
Ldarg.0 Load the parameter with index 0 onto the evaluation stack.
Ldarg.1 Loads the parameter with index 1 onto the evaluation stack.
Ldarg.2 Load the parameter with index 2 onto the evaluation stack.
Ldarg.3 Load the parameter at index 3 onto the evaluation stack.
Ldarg.S Loads the argument (referenced by the specified short-form index) onto the evaluation stack.
Ldarga Load the parameter address onto the calculation stack.
Ldarga.S Loads parameter addresses in short format onto the calculation stack.
Ldc.I4 Push the provided value of type int32 onto the evaluation stack as an int32.
Ldc.I4.0 Push the integer value 0 onto the evaluation stack as an int32.
Ldc.I4.1 Push the integer value 1 onto the evaluation stack as an int32.
Ldc.I4.2 Push the integer value 2 onto the evaluation stack as an int32.
Ldc.I4.3 Push the integer value 3 onto the evaluation stack as an int32.
Ldc.I4.4 Push the integer value 4 onto the evaluation stack as an int32.
Ldc.I4.5 Push the integer value 5 onto the evaluation stack as an int32.
Ldc.I4.6 Push the integer value 6 onto the evaluation stack as an int32.
Ldc.I4.7 Push the integer value 7 onto the evaluation stack as an int32.
Ldc.I4.8 Push the integer value 8 onto the evaluation stack as an int32.
Ldc.I4.M1 Push the integer value -1 as an int32 onto the evaluation stack.
Ldc.I4.S Push the provided int8 value onto the evaluation stack as an int32 (short form).
Ldc.I8 Push the provided value of type int64 onto the evaluation stack as an int64.
Ldc.R4 Pushes the provided value of type float32 onto the evaluation stack as type F (float).
Ldc.R8 Push the provided value of type float64 onto the evaluation stack as type F (float).
Ldelem Loads the element at the specified array index into the top of the calculation stack, according to the type specified in the directive.
Ldelem.I Loads the element of type native int at the specified array index as a native int at the top of the evaluation stack.
Ldelem.I1 Loads the element of type int8 at the specified array index as an int32 at the top of the evaluation stack.
Ldelem.I2 Loads the element of type int16 at the specified array index as an int32 at the top of the evaluation stack.
Ldelem.I4 Loads the element of type int32 at the specified array index as an int32 at the top of the evaluation stack.
Ldelem.I8 Loads the element of type int64 at the specified array index as an int64 at the top of the evaluation stack.
Ldelem.R4 Loads the element of type float32 at the specified array index onto the top of the evaluation stack as type F (float).
Ldelem.R8 Loads the element of type float64 at the specified array index onto the top of the evaluation stack as type F (float).
Ldelem.Ref Loads the element containing the object reference at the specified array index onto the top of the evaluation stack as an O type (object reference).
Ldelem.U1 Loads the element of type unsigned int8 at the specified array index as an int32 at the top of the evaluation stack.
Ldelem.U2 Loads the element of type unsigned int16 at the specified array index as an int32 at the top of the evaluation stack.
Ldelem.U4 Loads the element of type unsigned int32 at the specified array index as an int32 at the top of the evaluation stack.
Ldelema Loads the address of the array element located at the specified array index as an & type (a managed pointer) at the top of the evaluation stack.
Ldfld Finds the value of the field in the object whose reference is currently on the calculation stack.
Ldflda Find the address of a field in the object whose reference is currently on the calculation stack.
Ldftn Push an unmanaged pointer (of type native int) to native code that implements a specific method onto the evaluation stack.
Ldind.I Load a value of type native int onto the calculation stack indirectly as a native int.
Ldind.I1 Indirectly loads a value of type int8 onto the calculation stack as an int32.
Ldind.I2 Indirectly loads a value of type int16 onto the calculation stack as an int32.
Ldind.I4 Loads a value of type int32 onto the calculation stack as an int32 indirection.
Ldind.I8 Load a value of type int64 onto the calculation stack as an int64 indirection.
Ldind.R4 Indirectly loads a float32 value onto the calculation stack as an F (float) type.
Ldind.R8 Indirectly load a float64 value onto the calculation stack as an F (float) type.
Ldind.Ref Loads an object reference indirectly onto the evaluation stack as an O (object reference) type.
Ldind.U1 Indirectly loads a value of type unsigned int8 onto the calculation stack as an int32.
Ldind.U2 Indirectly loads a value of type unsigned int16 onto the calculation stack as an int32.
Ldind.U4 Loads a value of type unsigned int32 onto the calculation stack indirectly as an int32.
Ldlen Push the number of elements of a zero-based, one-dimensional array onto the calculation stack.
Ldloc Loads the local variable at the specified index onto the calculation stack.
Ldloc.0 Loads the local variable at index 0 onto the evaluation stack.
Ldloc.1 Loads the local variable at index 1 onto the evaluation stack.
Ldloc.2 Load the local variable at index 2 onto the evaluation stack.
Ldloc.3 Load the local variable at index 3 onto the evaluation stack.
Ldloc.S Loads a local variable at a specific index onto the evaluation stack (short form).
Ldloca Loads the address of a local variable located at a specific index onto the evaluation stack.
Ldloca.S Loads the address of a local variable located at a specific index onto the evaluation stack (short form).
Ldnull Push a null reference (of type O) onto the evaluation stack.
Ldobj Copy the value type object pointed to by the address to the top of the calculation stack.
Ldsfld Push the value of the static field onto the calculation stack.
Ldsflda Push the address of the static field onto the calculation stack.
Ldstr Push a new object reference to the string stored in the metadata.
Ldtoken Convert a metadata token to its runtime representation and push it onto the compute stack.
Ldvirtftn Push an unmanaged pointer (of type native int) to the native code that implements the specific virtual method associated with the specified object onto the evaluation stack.
Leave Exits a protected code region and unconditionally transfers control to a specific target instruction.
Leave.S Exits the protected code region and unconditionally transfers control to the target instruction (abbreviated form).
Localloc Allocate a specific number of bytes from the local dynamic memory pool and push the address of the first allocated byte (transient pointer, type *) onto the calculation stack.
Mkrefany Push a typed reference to an instance of a specific type onto the calculation stack.
Mul Multiply two values ​​and push the result onto the calculation stack.
Mul.Ovf Multiply two integer values, perform an overflow check, and push the result onto the calculation stack.
Mul.Ovf.Un Multiply two unsigned integer values, perform an overflow check, and push the result onto the evaluation stack.
Neg Performs the negation of a value and pushes the result onto the evaluation stack.
Newarr Push an object reference to a new zero-based one-dimensional array whose elements are of a specific type onto the evaluation stack.
Newobj Creates a new object or instance of a value type and pushes the object reference (of type O) onto the calculation stack.
Nop If the opcode is patched, the space is filled. Although processing cycles may be consumed, no meaningful operation is performed.
Not Computes the bitwise complement of the integer value at the top of the stack and pushes the result onto the evaluation stack as the same type.
Or Computes the bitwise complement of the two integer values ​​at the top of the stack and pushes the result onto the evaluation stack.
Pop Removes the value currently at the top of the calculation stack.
Prefix1 Infrastructure. This command is reserved.
Prefix2 Infrastructure. This command is reserved.
Prefix3 Infrastructure. This command is reserved.
Prefix4 Infrastructure. This command is reserved.
Prefix5 Infrastructure. This command is reserved.
Prefix6 Infrastructure. This command is reserved.
Prefix7 Infrastructure. This command is reserved.
Prefixref Infrastructure. This command is reserved.
Readonly Specifies that subsequent array address operations do not perform type checking at runtime and return a managed pointer with limited mutability.
Refanytype Retrieves the type tag embedded within a typed reference.
Refanyval Retrieves an address embedded within a typed reference (& type).
Rem Divide two values ​​and push the remainder onto the calculation stack.
Rem.Un Divides two unsigned values ​​and pushes the remainder onto the evaluation stack.
Ret Returns from the current method and pushes the return value (if present) from the caller's calculation stack onto the callee's calculation stack.
Rethrow Throw the current exception again.
Shl Shifts the integer value left (padded with zeros) by the specified number of places and pushes the result onto the evaluation stack.
Shr Shifts the integer value right (sign-preserving) by the specified number of places and pushes the result onto the evaluation stack.
Shr.Un Shifts an unsigned integer value right (padded with zeros) by the specified number of places and pushes the result onto the evaluation stack.
Sizeof Push the size (in bytes) of the provided value type onto the calculation stack.
Starg Stores the value at the top of the evaluation stack into the parameter slot at the specified index.
Starg.S Stores the value at the top of the evaluation stack at the specified index in the parameter slot (short form).
Stelem Replaces the array element at the given index with the value from the calculation stack, whose type is specified in the directive.
Stelem.I Replaces the array element at the given index with the native int value on the calculation stack.
Stelem.I1 Replaces the array element at the given index with the int8 value on the calculation stack.
Stelem.I2 Replaces the array element at the given index with the int16 value on the calculation stack.
Stelem.I4 Replaces the array element at the given index with the int32 value on the calculation stack.
Stelem.I8 Replaces the array element at the given index with the int64 value on the calculation stack.
Stelem.R4 Replaces the array element at the given index with the float32 value on the calculation stack.
Stelem.R8 Replaces the array element at the given index with the float64 value on the calculation stack.
Stelem.Ref Replaces the array element at the given index with the object ref value (of type O) on the calculation stack.
Stfld Replaces the value stored in a field of an object reference or pointer with a new value.
Stind.I Store a value of type native int at the provided address.
Stind.I1 Store a value of type int8 at the provided address.
Stind.I2 Store a value of type int16 at the provided address.
Stind.I4 Store a value of type int32 at the provided address.
Stind.I8 Store the value of type int64 at the provided address.
Stind.R4 Stores a float32 value at the provided address.
Stind.R8 Stores a float64 value at the provided address.
Stind.Ref Stores the object reference value at the provided address.
Stloc Pops the current value from the top of the evaluation stack and stores it into a local variable list at the specified index.
Stloc.0 Pops the current value from the top of the evaluation stack and stores it into the local variable list at index 0.
Stloc.1 Pops the current value from the top of the evaluation stack and stores it into the local variable list at index 1.
Stloc.2 Pops the current value from the top of the evaluation stack and stores it into the local variable list at index 2.
Stloc.3 Pops the current value from the top of the evaluation stack and stores it into the local variable list at index 3.
Stloc.S Pops the current value from the top of the evaluation stack and stores it at index in the local variable list (short form).
Stobj Copies a value of the specified type from the evaluation stack to the provided memory address.
Stsfld Replace the value of a static field with the value from the calculation stack.
Sub Subtracts a value from other values ​​and pushes the result onto the calculation stack.
Sub.Ovf Subtracts an integer value from another value, performs an overflow check, and pushes the result onto the evaluation stack.
Sub.Ovf.Un Subtracts an unsigned integer value from another value, performs an overflow check, and pushes the result onto the evaluation stack.
Switch Implement jump table.
Tailcall Execute the suffixed method call instruction to remove the stack frame of the current method before executing the actual call instruction.
Throw Throws the exception object currently on the calculation stack.
Unaligned Indicates that the address currently on the evaluation stack may not be associated with an immediately following ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction Natural size alignment.
Unbox Converts a boxed representation of a value type to its unboxed form.
Unbox.Any Converts the boxed representation of the type specified in the directive to its unboxed form.
Volatile Specifies that the address currently at the top of the calculation stack can be volatile, and that the result of reading that location cannot be cached, or that multiple A storage area cannot be canceled.
Xor Computes the bitwise XOR of the two values ​​at the top of the calculation stack and pushes the result onto the calculation stack.

Summary

This article only gives you a summary of IL instructions without explaining them in detail. An ancient saying goes: You have to drink water one sip at a time, and you have to walk step by step on the road. If you take too big a step, you will easily lose your temper. Take your time. Although the content is a little short, there will be a next chapter. The next article will still write about some basic instructions of IL. I will combine my own understanding and try to write the text as plainly as possible to make it easier for everyone to understand.

The above is the content of the .NET Framework Intermediate Language IL Instructions. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!