[Mono-list] code size of each IL instruction?

Jonathan Pryor jonpryor@vt.edu
Thu, 28 Aug 2003 08:01:05 -0400


For CIL code information, just refer to the standard:

	http://www.ecma-international.org/publications/standards/ecma-335.htm

In particular, you want "Partition III CIL Instruction Set."

For actually dealing with CIL opcodes, you might want to look at
PEAPI.dll, which is included with mono distributions (since 0.25, at
least) and in CVS.

 - Jon

On Wed, 2003-08-27 at 22:12, Okehee Goh wrote:
>  Hello,
>  I'd like to manipulate CIL codes manually. Each instruction's code size
> seems to be different.
>  Could you tell me where I can refer the code size information for all IL
> instructions?
>  For instance, the following codes are a part of IL codes generated by using
> "monodis" tool.
>  The first field implicates a relative address of each instruction and they
> are determined by the code size of an ahead instruction. I like to insert
> certain IL instructions manually somewhere of these codes.
>  So, I'd like to refer the code size of IL instructions.
> 
>  Regards,
> 
>  Okehee
> 
> 
>  ==== a part of IL codes
> 
>     IL_0000: newobj instance void class Node::.ctor()
>     IL_0005: stloc.3
>     IL_0006: ldstr "  size of NODE:"
>     IL_000b: ldloc.3
>     IL_000c: call int32 class
> [corlib]System.Runtime.InteropServices.Marshal::SizeOf(object)    IL_0011:
> box [mscorlib]System.Int32
>     IL_0016: call string valuetype [corlib]System.String::Concat(object,
> object)
>     IL_001b: call void class [corlib]System.Console::WriteLine(string)
>     IL_0020: call valuetype [corlib]System.DateTime valuetype
> [corlib]System.DateTime::get_No
> w()
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list