Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Part I: Quick Start > Simple Sample - Pg. 2

2 Chapter 1. Simple Sample This chapter offers a general overview of the MSIL assembly language (ILAsm). ( MSIL stands for Microsoft intermediate language, which will soon be discussed in this chapter.) We'll review a rel- atively simple program written in ILAsm, and then I'll suggest some modifications that illustrate how the concepts and elements of Microsoft .NET programming are expressed in this language. This chapter does not teach you how to write programs in ILAsm. But it should help you to under- stand what the ILAsm compiler and the IL Disassembler (ILDASM) do and to use that understanding to analyze the internal structure of a .NET-based program with the help of these ubiquitous tools. You'll also learn some intriguing facts about the mysterious affairs that take place behind the scenes, within the common language runtime--intriguing enough, I hope, to prompt you to read the rest of the book. Note For your sake and mine, I'll abbreviate IL assembly language as ILAsm throughout this book. Don't confuse it with ILASM , which is used as the abbreviation for the ILAsm compiler in the .NET documentation. Basics of the Common Language Runtime The .NET common language runtime is but one of many aspects of the .NET concept, but it's the core of .NET. (Note that, for variety's sake, I'll sometimes refer to the common language runtime as the runtime.) Rather than focusing on an overall description of the .NET platform here, then, let's concentrate on the part of .NET where the action really happens: the common language runtime. More Information For excellent discussions of the general structure of .NET and its components, see Introducing Micro- soft .NET (Microsoft Press, 2001), by David S. Platt, and Inside C# (Microsoft Press, 2001), by Tom Archer. Simply put, the common language runtime is a run-time environment in which .NET applications run. It provides an operating layer between the .NET applications and the underlying operating system. In principle, the common language runtime is similar to the runtimes of interpreted lan- guages such as GBasic or Smalltalk or to the Java Virtual Machine. But this similarity is only in principle: the common language runtime is not an interpreter. The .NET applications generated by .NET-oriented compilers (such as Microsoft Visual C# .NET, Microsoft Visual Basic .NET, ILAsm, and many others) are represented in an abstract, intermediate form, independent of the original programming language and of the target machine and its operating system. Because they are represented in this abstract form, .NET applications written in different languages can interoperate very closely, not only on the level of calling each other's functions but also on the level of class inheritance.