2. Understand managed code

Source: Internet
Author: User
Tags types of tables

I have already learned about hosting.CodeThe concept of managed code is to be learned now.
On the Donnet platformProgramming LanguageAs long as the compiler is oriented to CLR, it can work. However, different languages have different advantages, so you should select the language that best expresses your intention.

For example, no matter which language or compiler is used, the result is to generate a managed module, which is a standard 32-bit Microsoft Windows portable execution body (pe32) file, or a standard 64-bit Microsoft Windows Executable (pe32 +) file, which consists of pe32 or pe32 + headers, CLR headers, metadata, and intermediate languages, it must be managed by CLR, so it is called a managed module.
What is a PE file? PE means portable executable, which is a portable executable file in Microsoft Windows, here is an explanation of its structure: http://www.cnblogs.com/ilove/archive/2008/04/15/1157228.html. In the managed module, the pe32 or pe32 + header is the standard Windows PE File Header. If this header is in the pe32 format, the file can be run in the Windows 32-bit or 64-bit version, if it is pe32 +, it can only run on 64-bit.
The CLR header contains information that makes this module A managed module (consists of the CLR header and Program Contains the required CLR version, some labels, and methoddef metadata tag of the managed module entry method (main method, the metadata of the module, resources, strong names, some signs, and the size and location of other less important data items.
Metadata (metadata) is a special data table of the system. It mainly has two types of tables, one is used to describe Source code Types and Members defined in. One is the type that describes Source code references.
Intermediate Language: the code generated by the compiler compilation is called the intermediate language. CLR compiles the Il command at a cost. Il is stack-based, which means that all its commands will press the operand into an execution stack, and the result will pop up from this stack. Since il does not provide instructions for operation registers, compiler developers can easily generate il code. They don't have to worry about register management, and require less il commands, because there are no commands specifically used to operate registers. Il commands are still "non-typed". The biggest advantage of Il is not that it is an abstraction from the underlying CPU, but that it provides application reliability and security.
The interaction between managed code and non-managed code includes the following:
(1) The managed code can call an unmanaged function in the DLL.
(2) managed code can use an existing COM Component
(3) unmanaged code can use a managed type

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.