"C Language" Reading Notes (4) [re-compilation and execution]

Source: Internet
Author: User
Introduction to A. Out (Hello, world Program ) What happened after execution? This is a rough description of system hardware and operations, which is helpful to us. If any error occurs in the middle, please do not hesitate to inform us. Read the. out command from the keyboard. When we open our terminal, the shell program will execute its command and wait for our input. When we enter "A. Out" on the keyboard and press enter, shell will know that we have ended the command input. Then the shell command will read the target file a. out one by one. Code And data to the Register, and then copy the code and data to the primary storage. The flowchart is as follows:

How does one run in hardware?

 

Popular Science:

1. The primary storage is used to store the data processed by commands and commands.

2. The processor (short for CPU) is the engine for interpreting (or executing) commands stored in the primary storage. At any time point, the PC (program counter) in the CPU points to a machine language instruction in the main memory.

3. There is a DMA (direct Storage Access) technology that allows data to be directly transferred from the disk to the primary storage without passing through the processor.

 

From the memory write output string to the display 1. Once the code and data in the. out target file are loaded into the main memory, the CPU starts to execute Main Program of Main. C program Machine language commands. 2. These commands copy the bytes in the "Hello, world \ n" string from the primary memory to the register file. 3. copy the file from the register to the display device and display it on the screen. Flowchart:

How are these running in hardware?

The problem is summarized from two perspectives: Machine commands: First copied to the primary storage on the disk (when the program is loaded) (when the processor runs the commands) copy from the primary storage to the processor. Data string: The data string is initially copied to the primary storage on the disk and the device is displayed. References: in-depth understanding of computer systems

Recommendation

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.