What are the best resources for learning CIL (MSIL)

后端 未结 5 1366
轮回少年
轮回少年 2021-02-01 06:05

I\'m an expert C# 3 / .NET 3.5 programmer looking to start doing some runtime codegen using System.Reflection.Emit.DynamicMethod. I\'d love to move up to the next level by be

相关标签:
5条回答
  • 2021-02-01 06:47

    .NET Reflector is great for examining the IL produced by C#/VB.NET.

    It's a wonderful learning tool.

    0 讨论(0)
  • 2021-02-01 06:53

    The ECMA 335 specification is freely available for download here: http://www.ecma-international.org/publications/standards/Ecma-335.htm

    Partition III is the most relevant for dealing with MSIL, but I'd strongly recommend partition I as well for any .NET developer as it will greatly solidify understanding of the platform.

    0 讨论(0)
  • 2021-02-01 07:01

    In addition to Darren's answer, I'd suggest picking or inventing a toy language, and writing a simple compiler for it. Pick something that requires little parsing, like BF or a stack-based language, and you'll find that writing a compiler is actually simpler than it seems.

    0 讨论(0)
  • 2021-02-01 07:02

    The best way to learn it, is to write something you understand, then look at the IL it created. Also, depending on what you are doing, you can use expression trees instead of emitting IL, and then when you compile the expression trees, those smart guys at microsoft create the IL for ya.

    0 讨论(0)
  • 2021-02-01 07:06

    Expert .NET 2.0 IL Assembler. Although this book may be a little dated now, it was still a great overview for me.

    0 讨论(0)
提交回复
热议问题