当前位置:网站首页>Compilation process of program
Compilation process of program
2022-06-11 20:34:00 【I running】
Catalog
1. Program translation environment and execution environment
precompile 、 compile 、 assembly 、 The link process is shown in the figure :
Every source program needs to be read by the machine and can run , Produce the effect we want , Both need to go through the process of translation and linking , This article will take you through the process of program translation and linking , Lead everyone to see the unknown process before the program runs .
1. Program translation environment and execution environment
stay ANSI C In any implementation of , There are two different environments
Translation environment :
In this environment, source code is converted into executable machine instructions .
execution environment :
Used to actually execute code .

In the translation environment c Original code of language , After processing, it is converted into binary file test.c, It contains binary instructions / Machine instructions , After processing in the running environment, we can generate the desired results .

There are two parts in the translation environment: Compilation and linking .
The source file is compiled into a file with .obj Target file for suffix
The target file is generated by linking the linker and the link library .exe For suffix executable .

2. Compilation phase
Overview of translation environment :
precompile 、 compile 、 assembly 、 The link process is shown in the figure :

3. Running environment
The execution of a program :
1. The program must be loaded into memory .
In an operating system environment : This is usually done by the operating system . In an independent environment , The loading of the program must be arranged manually , It can also be done by putting executable code into read-only memory .
2. The execution of the procedure begins , And then I call main function .
3. Start executing program code ( Execute in the order we write the code ).
At this time, the program will use a runtime Stack (stack, Function stack frame ), Store function local variables and return address . Programs can also use static (static) Memory , Variables stored in static memory retain their values throughout the execution of the program .
4. To terminate the program . Normal termination main function ; It could be an accidental termination .
边栏推荐
- Database introduction
- Show your creativity and win the graphics card! Mmpose attitude estimation creative contest shocks
- Première formation sur les largeurs modernes
- Global Market Consulting - Research Report on the overall scale and application segmentation of the global HVDC converter station market in 2022
- Windows icon display exception resolution. The desktop icon is abnormal, the start menu icon is abnormal, and the taskbar icon is abnormal. Icon cache location.
- Usage methods and cases of PLSQL blocks, cursors, functions, stored procedures and triggers of Oracle Database
- Using the flask framework to write the bezel
- Power supply anti reverse connection and anti backflow - use MOS tube and op amp to realize ideal diode
- Ora-01089 ora-19809 ora-19815 exceeded the limit for recovering files
- 13 r basic exercises
猜你喜欢

Modelarts second job

In unity, opencv and QT are used to create a plugin (I)

里氏替换原则

QQ贴吧那种图片一点开,就变了的原理

银泰百货与淘宝天猫联合打造绿色潮玩展,助力“碳中和”

The first bullet of comparative learning

2022年最新宁夏建筑八大员(标准员)考试试题及答案

The input value "18-20000hz" is incorrect. The setting information is incomplete. Please select a company

28. JS implementation mechanism

C deep copy
随机推荐
The latest test questions and answers for the eight major members (standard members) of Ningxia architecture in 2022
The world's first public chain integrating commercial and financial fields
Title does not display after toolbar replaces actionbar
Installation and performance test of Apache APIs IX on Amazon graviton3
Windows icon display exception resolution. The desktop icon is abnormal, the start menu icon is abnormal, and the taskbar icon is abnormal. Icon cache location.
14 r basic exercises
周刊02|不瞒你说,我其实是MIT的学生
银泰百货与淘宝天猫联合打造绿色潮玩展,助力“碳中和”
Log in with password and exit with error for three times.
Capriccio in the Internet Age
浅聊对比学习(Contrastive Learning)第一弹
Vectordrawable error
unity package manager starting server stuck(Unity启动卡在starting server,然后报错)
Golang learning notes - Basics
Leetcode 1992. 找到所有的农场组(可以,一次过)
Detailed explanation on persistence of 2022redis7.0x
2022-2028 current situation and future development trend of global and Chinese thermocouple belt Market
15 r exercise
2022年最新宁夏建筑八大员(标准员)考试试题及答案
2022-2028 global and Chinese thermal power generation (TEG) module market status and future development trend