Chapter 3

image

Making the Coding Easier

I don’t know about you, but for me this endless typing and retyping of the same code again and again is fun way below the average. Let’s see how ILAsm 2.0 or later can make this work less tedious. There are three useful additions to the assembler syntax that can be exploited: aliasing, compilation control directives, and special keywords for the current class and its parent.

Aliasing

In the sample Simple2.il presented in the previous chapter, the methods of console input/output were called four times (one time for input and three times for output). And every time you had to type [mscorlib]System.Console::WriteLine ...

Get .NET IL Assembler now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.