CIL Instructions Set Quick Reference

Prefixes to Instructions

tail. (prefix)

 call terminates current method

unaligned. (prefix)

 pointer instruction may be unaligned

volatile. (prefix)

 pointer reference is volatile

Base Instructions

add

 add numeric values

add.ovf.<signed>

 add integer values with overflow check

and

 bitwise AND

arglist

 get argument list

beq.<length>

 branch on equal

bge.<length>

 branch on greater than or equal to

bge.un.<length>

 branch on greater than or equal to, unsigned or unordered

bgt.<length>

 branch on greater than

bgt.un.<length>

 branch on greater than, unsigned or unordered

ble.<length>

 branch on less than or equal to

ble.un.<length>

 branch on less than or equal to, unsigned or unordered

blt.<length>

 branch on less than

blt.un.<length>

 branch on less than, unsigned or unordered

bne.un<length>

 branch on not equal or unordered

br.<length>

 unconditional branch

break

 breakpoint instruction

brfalse.<length>

 branch on false, null, or zero

brtrue.<length>

 branch on non

call

 call a method

calli

 indirect method call

ceq

 compare equal

cgt

 compare greater than

cgt.un

 compare greater than, unsigned or unordered

ckfinite

 check for a finite real number

clt

 compare less than

clt.un

 compare less than, unsigned or unordered

conv.<to type>

 data conversion

conv.ovf.<to type>

 data conversion with overflow detection

conv.ovf.<to type>.un

 unsigned data conversion with overflow detection

cpblk

 copy data from memory to memory

div

 divide values

div.un

 divide integer values, unsigned

dup

 duplicate the top value of the stack

endfilter

 end filter clause of SEH

endfinally

 end the finally or fault clause of an exception block

initblk

 initialize a block of memory to a value

jmp

 jump to method

ldarg.<length>

 load argument onto the stack

ldarga.<length>

 load an argument address

ldc.<type>

 load numeric constant

ldftn

 load method pointer

ldind.<type>

 load value indirect onto the stack

ldloc

 load local variable onto the stack

ldloca.<length>

 load local variable address

ldnull

 load a null pointer

leave.<length>

 exit a protected region of code

localloc

 allocate space in the local dynamic memory pool

mul

 multiply values

mul.ovf.<type>

 multiply integer values with overflow check

neg

 negate

nop

 no operation

not

 bitwise complement

or

 bitwise OR

pop

 remove the top element of the stack

rem

 compute remainder

rem.un

 compute integer remainder, unsigned

ret

 return from method

shl

 shift integer left

shr

 shift integer right

shr.un

 shift integer right, unsigned

starg.<length>

 store a value in an argument slot

stind.<type>

 store value indirect from stack

stloc

 pop value from stack to local variable

sub

 subtract numeric values

sub.ovf.<type>

 subtract integer values, checking for overflow

switch

 table switch on value

xor

 bitwise XOR

Object Model Instructions

box

 convert value type to object reference

callvirt

 call a method associated, at runtime, with an object

castclass

 cast an object to a class

cpobj

 copy a value type

initobj

 initialize a value type

isinst

 test if an object is an instance of a class or interface

ldelem.<type>

 load an element of an array

ldelema

 load address of an element of an array

ldfld

 load field of an object

ldflda

 load field address

ldlen

 load the length of an array

ldobj

 copy value type to the stack

ldsfld

 load static field of a class

ldsflda

 load static field address

ldstr

 load a literal string

ldtoken

 load the runtime representation of a metadata token

ldvirtftn

 load a virtual method pointer

mkrefany

 push a typed reference on the stack

newarr

 create a zero

newobj

 create a new object

refanytype

 load the type out of a typed reference

refanyval

 load the address out of a typed reference

rethrow

 rethrow the current exception

sizeof

 load the size in bytes of a value type

stelem.<type>

 store an element of an array

stfld

 store into a field of an object

stobj

 store a value type from the stack into memory

stsfld

 store a static field of a class

throw

 throw an exception

unbox

 convert boxed value type to its raw form

Printer friendly version (word document) - cil.zip, 7K


Revision:1, Last Modified: 02/16/02 2:09, by Vadim Melnik. Visit my Homepage .