Learning CIL [closed]

感情迁移 提交于 2019-12-04 09:29:00

问题


Does anybody know any good resources for learning how to program CIL with in-depth descriptions of commands, etc.? I have looked around but not found anything particularly good.


回答1:


The only CIL book on my shelf is Expert .NET 2.0 IL Assembler by Serge Lidin. In terms of what the individual opcodes do or mean, the Microsoft documentation on System.Reflection.Emit has some pretty good information. And it's always useful to look at existing IL with Reflector.

Edit: CIL (and indeed the CLR in general) has not changed at all between .NET 2.0 and .NET 3.5 -- the underlying runtime is basically the same, modulo fixes and performance improvements. So there's nothing newer available on a CIL level than what would be in a book on 2.0




回答2:


Expert .NET 2.0 IL Assembler rocks because the author writes well and includes every freaking detail you can imagine. It doesn't hurt that he wrote the IL assembler, disassembler and validator. Best of all you can buy it in a PDF instead of a dead tree.

Masochists interested in compiler development will also enjoy Compiling for the .NET Common Language Runtime by John Gough. I found this book immensely helpful during a virtual machine development project where I "stole" lots of ideas from the CLR design.




回答3:


Expert .NET 2.0 IL Assembler by Serge Lidin

There was a 1.1 version of the same book, but I haven't seen anything for the latest .NET release. It's an excellent book. I used it to write an OCR component in MSIL, as a learning project.

[Edit] @Curt is right, 3.0 and 3.5 are just extensions to 2.0, I hadn't plugged that in to my head yet. Now I've thought of a fun geek project... compare the disassembly of standard 2.0 code to the new LINQ/Lambda way of performing common tasks like filtering lists. For some reason I assumed that the magic was happening in new IL features, not just the compiler.



来源:https://stackoverflow.com/questions/44940/learning-cil

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!