MachineCode->Assembly->CIL(.Net) or SpecialMachineCode(JVM)->Pogramming code

CIL Instruction Set

Opcode Instruction Description
0x58 add Add two values, returning a new value.
0xD6 add.ovf Add signed integer values with overflow check.
0xD7 add.ovf.un Add unsigned integer values with overflow check.
0x5F and Bitwise AND of two integral values, returns an integral value.
0xFE 0x00 arglist Return argument list handle for the current method.
0x3B beq <int32 (target)> Branch to target if equal.
0x2E beq.s<int8 (target)> Branch to target if equal, short form.
0x3C bge <int32 (target)> Branch to target if greater than or equal to.
0x2F bge.s <int8 (target)> Branch to target if greater than or equal to, short form.
0x41 bge.un <int32 (target)> Branch to target if greater than or equal to (unsigned or unordered).
0x34 bge.un.s <int8 (target)> Branch to target if greater than or equal to (unsigned or unordered), short form
0x3D bgt <int32 (target)> Branch to target if greater than.
0x30 bgt.s <int8 (target)> Branch to target if greater than, short form.
0x42 bgt.un <int32 (target)> Branch to target if greater than (unsigned or unordered).
0x35 bgt.un.s <int8 (target)> Branch to target if greater than (unsigned or unordered), short form.
0x3E ble <int32 (target)> Branch to target if less than or equal to.
0x31 ble.s <int8 (target)> Branch to target if less than or equal to, short form.
0x43 ble.un <int32 (target)> Branch to target if less than or equal to (unsigned or unordered).
0x36 ble.un.s <int8 (target)> Branch to target if less than or equal to (unsigned or unordered), short form
0x3F blt <int32 (target)> Branch to target if less than.
0x32 blt.s <int8 (target)> Branch to target if less than, short form.
0x44 blt.un <int32 (target)> Branch to target if less than (unsigned or unordered).
0x37 blt.un.s <int8 (target)> Branch to target if less than (unsigned or unordered), short form.
0x40 bne.un <int32 (target)> Branch to target if unequal or unordered.
0x33 bne.un.s <int8 (target)> Branch to target if unequal or unordered, short form.
0x8C box <typeTok> Convert a boxable value to its boxed form
0x38 br <int32 (target)> Branch to target.
0x2B br.s <int8 (target)> Branch to target, short form.
0x01 break Inform a debugger that a breakpoint has been reached.
0x39 brfalse <int32 (target)> Branch to target if value is zero (false).
0x2C brfalse.s <int8 (target)> Branch to target if value is zero (false), short form.
0x3A brinst <int32 (target)> Branch to target if value is a non-null object reference (alias for brtrue).
0x2D brinst.s <int8 (target)> Branch to target if value is a non-null object reference, short form (alias for brtrue.s).
0x39 brnull <int32 (target)> Branch to target if value is null (alias for brfalse).
0x2C brnull <int8 (target)> Branch to target if value is null (alias for brfalse.s), short form.
0x3A brtrue <int32 (target)> Branch to target if value is non-zero (true).
0x2D brtrue.s <int8 (target)> Branch to target if value is non-zero (true), short form.
0x39 brzero<int32 (target)> Branch to target if value is zero (alias for brfalse).
0x2C brzero<int8 (target)> Branch to target if value is zero (alias for brfalse.s), short form.
0x28 call <method> Call method described by method.
0x29 calli <callsitedescr> Call method indicated on the stack with arguments described by callsitedescr.
0x6F callvirt <method> Call a method associated with an object.
0x74 castclass <class> Cast obj to class.
0xFE 0x01 ceq Push 1 (of type int32) if value1 equals value2, else push 0.
0xFE 0x02 cgt Push 1 (of type int32) if value1 > value2, else push 0.
0xFE 0x03 cgt.un Push 1 (of type int32) if value1 > value2, unsigned or unordered, else push 0.
0xC3 ckfinite Throw ArithmeticException if value is not a finite number.
0xFE 0x04 clt Push 1 (of type int32) if value1 < value2, else push 0.
0xFE 0x05 clt.un Push 1 (of type int32) if value1 < value2, unsigned or unordered, else push 0.
0xFE 0x16 constrained. <thisType> [prefix] Call a virtual method on a type constrained to be type T
0xD3 conv.i Convert to native int, pushing native int on stack.
0x67 conv.i1 Convert to int8, pushing int32 on stack.
0x68 conv.i2 Convert to int16, pushing int32 on stack.
0x69 conv.i4 Convert to int32, pushing int32 on stack.
0x6A conv.i8 Convert to int64, pushing int64 on stack.
0xD4 conv.ovf.i Convert to a native int (on the stack as native int) and throw an exception on overflow.
0x8A conv.ovf.i.un Convert unsigned to a native int (on the stack as native int) and throw an exception on overflow.
0xB3 conv.ovf.i1 Convert to an int8 (on the stack as int32) and throw an exception on overflow.
0x82 conv.ovf.i1.un Convert unsigned to an int8 (on the stack as int32) and throw an exception on overflow.
0xB5 conv.ovf.i2 Convert to an int16 (on the stack as int32) and throw an exception on overflow.
0x83 conv.ovf.i2.un Convert unsigned to an int16 (on the stack as int32) and throw an exception on overflow.
0xB7 conv.ovf.i4 Convert to an int32 (on the stack as int32) and throw an exception on overflow.
0x84 conv.ovf.i4.un Convert unsigned to an int32 (on the stack as int32) and throw an exception on overflow.
0xB9 conv.ovf.i8 Convert to an int64 (on the stack as int32) and throw an exception on overflow.
0x85 conv.ovf.i8.un Convert unsigned to an int64 (on the stack as int32) and throw an exception on overflow.
0xD5 conv.ovf.u Convert to a native unsigned int (on the stack as native int) and throw an exception on overflow.
0x8B conv.ovf.u.un Convert unsigned to a native unsigned int (on the stack as native int) and throw an exception on overflow.
0xB4 conv.ovf.u1 Convert to an unsigned int8 (on the stack as int32) and throw an exception on overflow.
0x86 conv.ovf.u1.un Convert unsigned to an unsigned int8 (on the stack as int32) and throw an exception on overflow.
0xB6 conv.ovf.u2 Convert to an unsigned int16 (on the stack as int32) and throw an exception on overflow.
0x87 conv.ovf.u2.un Convert unsigned to an unsigned int16 (on the stack as int32) and throw an exception on overflow.
0xB8 conv.ovf.u4 Convert to an unsigned int32 (on the stack as int32) and throw an exception on overflow.
0x88 conv.ovf.u4.un Convert unsigned to an unsigned int32 (on the stack as int32) and throw an exception on overflow.
0xBA conv.ovf.u8 Convert to an unsigned int64 (on the stack as int32) and throw an exception on overflow.
0x89 conv.ovf.u8.un Convert unsigned to an unsigned int64 (on the stack as int32) and throw an exception on overflow.
0x76 conv.r.un Convert unsigned integer to floating-point, pushing F on stack.
0x6B conv.r4 Convert to float32, pushing F on stack.
0x6C conv.r8 Convert to float64, pushing F on stack.
0xE0 conv.u Convert to native unsigned int, pushing native int on stack.
0xD2 conv.u1 Convert to unsigned int8, pushing int32 on stack.
0xD1 conv.u2 Convert to unsigned int16, pushing int32 on stack.
0x6D conv.u4 Convert to unsigned int32, pushing int32 on stack.
0x6E conv.u8 Convert to unsigned int64, pushing int64 on stack.
0xFE 0x17 cpblk Copy data from memory to memory.
0x70 cpobj <typeTok> Copy a value type from src to dest.
0x5B div Divide two values to return a quotient or floating-point result.
0x5C div.un Divide two values, unsigned, returning a quotient.
0x25 dup Duplicate the value on the top of the stack.
0xDC endfault End fault clause of an exception block.
0xFE 0X11 endfilter End an exception handling filter clause.
0xDC endfinally End finally clause of an exception block.
0x4C idind.u8 Indirect load value of type unsigned int64 as int64 on the stack (alias for ldind.i8).
0xFE 0x18 initblk Set all bytes in a block of memory to a given byte value.
0xFE 0x15 initobj <typeTok> Initialize the value at address dest.
0x75 isinst <class> Test if obj is an instance of class, returning null or an instance of that class or interface.
0x27 jmp <method> Exit current method and jump to the specified method.
0xFE 0x09 ldarg <uint16 (num)> Load argument numbered num onto the stack.
0x02 ldarg.0 Load argument 0 onto the stack.
0x03 ldarg.1 Load argument 1 onto the stack.
0x04 ldarg.2 Load argument 2 onto the stack.
0x05 ldarg.3 Load argument 3 onto the stack.
0x0E ldarg.s <uin8 (num)> Load argument numbered num onto the stack, short form.
0xFE 0x0A ldarga <uint16 (argNum)> Fetch the address of argument argNum.
0x0F ldarga.s <uint8 (argNum)> Fetch the address of argument argNum, short form.
0x20 ldc.i4 <int32 (num)> Push num of type int32 onto the stack as int32.
0x16 ldc.i4.0 Push 0 onto the stack as int32.
0x17 ldc.i4.1 Push 1 onto the stack as int32.
0x18 ldc.i4.2 Push 2 onto the stack as int32.
0x19 ldc.i4.3 Push 3 onto the stack as int32.
0x1A ldc.i4.4 Push 4 onto the stack as int32.
0x1B ldc.i4.5 Push 5 onto the stack as int32.
0x1C ldc.i4.6 Push 6 onto the stack as int32.
0x1D ldc.i4.7 Push 7 onto the stack as int32.
0x1E ldc.i4.8 Push 8 onto the stack as int32.
0x15 ldc.i4.m1 Push -1 onto the stack as int32.
0x15 ldc.i4.M1 Push -1 of type int32 onto the stack as int32 (alias for ldc.i4.m1).
0x1F ldc.i4.s <int8 (num)> Push num onto the stack as int32, short form.
0x21 ldc.i8 <int64 (num)> Push num of type int64 onto the stack as int64.
0x22 ldc.r4 <float32 (num)> Push num of type float32 onto the stack as F.
0x23 ldc.r8 <float64 (num)> Push num of type float64 onto the stack as F.
0xA3 ldelem <typeTok> Load the element at index onto the top of the stack.
0x97 ldelem.i Load the element with type native int at index onto the top of the stack as a native int.
0x90 ldelem.i1 Load the element with type int8 at index onto the top of the stack as an int32.
0x92 ldelem.i2 Load the element with type int16 at index onto the top of the stack as an int32.
0x94 ldelem.i4 Load the element with type int32 at index onto the top of the stack as an int32.
0x96 ldelem.i8 Load the element with type int64 at index onto the top of the stack as an int64.
0x98 ldelem.r4 Load the element with type float32 at index onto the top of the stack as an F
0x99 ldelem.r8 Load the element with type float64 at index onto the top of the stack as an F.
0x9A ldelem.ref Load the element at index onto the top of the stack as an O. The type

of the O is the same as the element type of the array pushed on the CIL stack.

0x91 ldelem.u1 Load the element with type unsigned int8 at index onto the top of the stack as an int32.
0x93 ldelem.u2 Load the element with type unsigned int16 at index onto the top of the stack as an int32.
0x95 ldelem.u4 Load the element with type unsigned int32 at index onto the top of the stack as an int32.
0x96 ldelem.u8 Load the element with type unsigned int64 at index onto the top of the stack as an int64 (alias for ldelem.i8).
0x8F ldelema <class> Load the address of element at index onto the top of the stack.
0x7B ldfld <field> Push the value of field of object (or value type) obj, onto the stack.
0x7C ldflda <field> Push the address of field of object obj on the stack.
0xFE 0x06 ldftn <method> Push a pointer to a method referenced by method, on the stack.
0x4D ldind.i Indirect load value of type native int as native int on the stack
0x46 ldind.i1 Indirect load value of type int8 as int32 on the stack.
0x48 ldind.i2 Indirect load value of type int16 as int32 on the stack.
0x4A ldind.i4 Indirect load value of type int32 as int32 on the stack.
0x4C ldind.i8 Indirect load value of type int64 as int64 on the stack.
0x4E ldind.r4 Indirect load value of type float32 as F on the stack.
0x4F ldind.r8 Indirect load value of type float64 as F on the stack.
0x50 ldind.ref Indirect load value of type object ref as O on the stack.
0x47 ldind.u1 Indirect load value of type unsigned int8 as int32 on the stack
0x49 ldind.u2 Indirect load value of type unsigned int16 as int32 on the stack
0x4B ldind.u4 Indirect load value of type unsigned int32 as int32 on the stack
0x8E ldlen Push the length (of type native unsigned int) of array on the stack.
0xFE 0x0C ldloc <uint16 (indx)> Load local variable of index indx onto stack.
0x06 ldloc.0 Load local variable 0 onto stack.
0x07 ldloc.1 Load local variable 1 onto stack.
0x08 ldloc.2 Load local variable 2 onto stack.
0x09 ldloc.3 Load local variable 3 onto stack.
0x11 ldloc.s <uint8 (indx)> Load local variable of index indx onto stack, short form.
0xFE 0x0D ldloca <uint16 (indx)> Load address of local variable with index indx.
0x12 ldloca.s <uint8 (indx)> Load address of local variable with index indx, short form.
0x14 ldnull Push a null reference on the stack.
0x71 ldobj <typeTok> Copy the value stored at address src to the stack.
0x7E ldsfld <field> Push the value of field on the stack.
0x7F ldsflda <field> Push the address of the static field, field, on the stack.
0x72 ldstr <string> Push a string object for the literal string.
0xD0 ldtoken <token> Convert metadata token to its runtime representation.
0xFE 0x07 ldvirtftn <method> Push address of virtual method method on the stack.
0xDD leave <int32 (target)> Exit a protected region of code.
0xDE leave.s <int8 (target)> Exit a protected region of code, short form.
0xFE 0x0F localloc Allocate space from the local memory pool.
0xC6 mkrefany <class> Push a typed reference to ptr of type class onto the stack.
0x5A mul Multiply values.
0xD8 mul.ovf.<type> Multiply signed integer values. Signed result shall fit in same size
0xD9 mul.ovf.un Multiply unsigned integer values. Unsigned result shall fit in same size
0x65 neg Negate value.
0x8D newarr <etype> Create a new array with elements of type etype.
0x73 newobj <ctor> Allocate an uninitialized object or value type and call ctor.
0xFE 0x19 no. { typecheck, rangecheck, nullcheck } [prefix] The specified fault check(s) normally performed

as part of the execution of the subsequent instruction can/shall be skipped.

0x00 nop Do nothing.
0x66 not Bitwise complement.
0x60 or Bitwise OR of two integer values, returns an integer.
0x26 pop Pop value from the stack.
0xFE 0x1E readonly. [prefix] Specify that the subsequent array address operation performs no

type check at runtime, and that it returns a controlled-mutability managed pointer

0xFE 0x1D refanytype Push the type token stored in a typed reference.
0xC2 refanyval <type> Push the address stored in a typed reference.
0x5D rem Remainder when dividing one value by another.
0x5E rem.un Remainder when dividing one unsigned value by another.
0x2A ret Return from method, possibly with a value.
0xFE 0x1A rethrow Rethrow the current exception.
0x62 shl Shift an integer left (shifting in zeros), return an integer.
0x63 shr Shift an integer right (shift in sign), return an integer.
0x64 shr.un Shift an integer right (shift in zero), return an integer.
0xFE 0x1C sizeof <typeTok> Push the size, in bytes, of a type as an unsigned int32.
0xFE 0x0B starg <uint16 (num)> Store value to the argument numbered num.
0x10 starg.s <uint8 (num)> Store value to the argument numbered num, short form.
0xA4 stelem <typeTok> Replace array element at index with the value on the stack
0x9B stelem.i Replace array element at index with the i value on the stack.
0x9C stelem.i1 Replace array element at index with the int8 value on the stack.
0x9D stelem.i2 Replace array element at index with the int16 value on the stack.
0x9E stelem.i4 Replace array element at index with the int32 value on the stack.
0x9F stelem.i8 Replace array element at index with the int64 value on the stack.
0xA0 stelem.r4 Replace array element at index with the float32 value on the stack.
0xA1 stelem.r8 Replace array element at index with the float64 value on the stack.
0xA2 stelem.ref Replace array element at index with the ref value on the stack.
0x7D stfld <field> Replace the value of field of the object obj with value.
0xDF stind.i Store value of type native int into memory at address
0x52 stind.i1 Store value of type int8 into memory at address
0x53 stind.i2 Store value of type int16 into memory at address
0x54 stind.i4 Store value of type int32 into memory at address
0x55 stind.i8 Store value of type int64 into memory at address
0x56 stind.r4 Store value of type float32 into memory at address
0x57 stind.r8 Store value of type float64 into memory at address
0x51 stind.ref Store value of type object ref (type O) into memory at address
0xFE 0x0E stloc <uint16 (indx)> Pop a value from stack into local variable indx.
0x0A stloc.0 Pop a value from stack into local variable 0.
0x0B stloc.1 Pop a value from stack into local variable 1.
0x0C stloc.2 Pop a value from stack into local variable 2.
0x0D stloc.3 Pop a value from stack into local variable 3.
0x13 stloc.s <uint8 (indx)> Pop a value from stack into local variable indx, short form.
0x81 stobj <typeTok> Store a value of type typeTok at an address.
0x80 stsfld <field> Replace the value of field with val.
0x59 sub Subtract value2 from value1, returning a new value.
0xDA sub.ovf Subtract native int from a native int. Signed result shall fit in same size
0xDB sub.ovf.un Subtract native unsigned int from a native unsigned int. Unsigned result shall fit in same size.
0x45 switch <uint32, int32,int32 (t1..tN)> Jump to one of n values.
0xFE 0x14 tail. [prefix] Subsequent call terminates current method
0x7A throw Throw an exception.
0xFE 0x12 unaligned. (alignment) [prefix] Subsequent pointer instruction might be unaligned.
0x79 unbox <valuetype> Extract a value-type from obj, its boxed representation.
0xA5 unbox.any <typeTok> Extract a value-type from obj, its boxed representation
0xFE 0x13 volatile. [prefix] Subsequent pointer reference is volatile.
0x61 xor Bitwise XOR of integer values, returns an integer.

Reference to:http://en.csharp-online.net/CIL_Instruction_Set

.Net CIL的更多相关文章

  1. 用CIL写程序:你好,沃尔德

    前言: 项目紧赶慢赶总算在年前有了一些成绩,所以沉寂了几周之后,小匹夫也终于有时间写点东西了.以前匹夫写过一篇文章,对CIL做了一个简单地介绍,不过不知道各位看官看的是否过瘾,至少小匹夫觉得很不过瘾. ...

  2. Mono为何能跨平台?聊聊CIL(MSIL)

    前言: 其实小匹夫在U3D的开发中一直对U3D的跨平台能力很好奇.到底是什么原理使得U3D可以跨平台呢?后来发现了Mono的作用,并进一步了解到了CIL的存在.所以,作为一个对Unity3D跨平台能力 ...

  3. 用CIL写程序:写个函数做加法

    前言: 上一篇文章小匹夫为CIL正名的篇幅比较多,反而忽略了写那篇文章初衷--即通过写CIL代码来熟悉它,了解它.那么既然有上一篇文章做基础(炮灰),想必各位对CIL的存在也就释然了,兴许也燃起了一点 ...

  4. 用CIL写程序:定义一个叫“慕容小匹夫”的类

    前文回顾: <用CIL写程序:你好,沃尔德> <用CIL写程序:写个函数做加法> 前言: 今天是乙未羊年的第一天,小匹夫先在这里给各位看官拜个年了.不知道各位看官是否和匹夫一样 ...

  5. 用CIL写程序:从“call vs callvirt”看方法调用

    前文回顾:<用CIL写程序系列> 前言: 最近的时间都奉献给了加班,距离上一篇文章也有半个多月了.不过在上一篇文章<用CIL写程序:定义一个叫“慕容小匹夫”的类>中,匹夫和各位 ...

  6. 关于CLR、CIL、CTS、CLS、CLI、BCL和FCL 的区分与总结

    关于CLR.CIL.CTS.CLS.CLI.BCL和FCL 的区分与总结 如果要想深入学习.NET平台,那么标题中的这些关键字对你来说并不陌生,这些名词构成了.NET庞大的生态系统,为了宏观认识.NE ...

  7. 关于CLR、CIL、CTS、CLS、CLI、BCL和FCL

    如果要想深入学习.NET平台,那么标题中的这些关键字对你来说并不陌生,这些名词构成了.NET庞大的生态系统,为了宏观认识.NET平台,学些.NET架构体系,针对一些常用常用名词的理解是很有必要的,未必 ...

  8. 生成CIL的问题

    private void testILMethod() { InventCountPlanLine planLine; ; update_recordSet planLine setting Coun ...

  9. C# 从CIL代码了解委托,匿名方法,Lambda 表达式和闭包本质

    前言 C# 3.0 引入了 Lambda 表达式,程序员们很快就开始习惯并爱上这种简洁并极具表达力的函数式编程特性. 本着知其然,还要知其所以然的学习态度,笔者不禁想到了几个问题. (1)匿名函数(匿 ...

  10. 你需要一点点CIL

    1.当我们程序集中有大量反射的时候,性能往往会下降很快.我们目的很明确 如何解决反射造成的这些影响,其中之一个正确且高逼格的做法是 使用 CIL指令去实现.如何实现需要我们拥有若干基础知识.知道 CI ...

随机推荐

  1. C++并发低级接口:std::thread和std::promise

    std::thread和std::promise 相比std::async,std::thread就原始多了.thread一定会创建新线程(而不是像async那样创建的时候可能不会,后面才创建新线程( ...

  2. Super-Resolution Restoration of MISR Images Using the UCL MAGiGAN System 超分辨率恢复

    作者是伦敦大学学院Mullard空间科学实验室成像组,之前做过对火星图像的分辨率增强. 文章用了许多的图像处理方法获得特征和高分辨率的中间结果,最后用一个生产对抗网络获得更好的高分辨率结果. 用的数据 ...

  3. for别名

    name:for(int i =0 ;i< a.length;i++){ System.out.println(i); for(int j =0;j<i;j++){ continue na ...

  4. POJ1113 Wall

    题目来源:http://poj.org/problem?id=1113题目大意: 如图所示,给定N个顶点构成的一个多边形和一个距离值L.建立一个围墙,把这个多边形完全包含在内,且围墙距离多边形任一点的 ...

  5. 用C#写一个函数,在一个数组中找出随意几个值相加等于一个值 与迭代器对比

    算法!用C#写一个函数,在一个数组中找出随意几个值相加等于一个值比如,数组{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}  要找出那些数相加等 ...

  6. php 伪造HTTP_REFERER页面URL来源的三种方法

    php获取当前页面的前一个页面URL地址,即当前页面是从哪个页面链接过来的,可以使用$_SERVER['HTTP_REFERER']; 但是$_SERVER['HTTP_REFERER']也是可以被伪 ...

  7. Sharepoint 页面超链接地址打开

    SharePoint页面: http://test:81/pages/nihao.aspx 页面超链接:<a href="www.baidu.com" >百度</ ...

  8. sql 常用语句备份

    新增字段,默认其他字段计算 ALTER TABLE 表名 add 字段名 as 字段名1+字段名2 SQL查看变量的数据类型 DECLARE @Sum int--SET @Sum = 0SELECT ...

  9. 9 Strings

    1       Strings 1.1  Strings and GStrings Groovy允许你使用2种不同类型的字符串类型,分别是java.lang.String和groovy.lang.GS ...

  10. python进制转换或数据格式转换

    以下是部分进制转换的,都是python内置函数 int(x [,base ])         将x转换为一个整数    long(x [,base ])        将x转换为一个长整数    f ...