We do not speak the language first, from the hardware-level image of the explanation of how the CPU to complete various functions
int A, B, C; >> a >> b; = a + b;
Here the C + + code is only three lines to see what the hardware does to implement such a function
CPU read-in instructions
Cin >> a >>b
CPU: I just received a task from the organization to get us two integers and put them in memory corresponding to the two memory addresses provided by the organization .
keyboard: Okay, if someone knocks on me, I'll let you in.
CPU: Okay .
CPU: User knocked a 1 graphics card you go to the 1 of the image information in your video memory so that our screen brothers can read your memory to illuminate its corresponding LED bulb display to the user to see let the user know that he knocked a 1
Graphics: Yes
..... Until the user has typed in 1 2 press ENTER
CPU: Oh, mom, you can press ENTER, quick and fast. Memory transports the 1 and 2 from your input buffer memory to the memory of A and B to complete the a=1 b=2
Memory: Well, it's done .
CPU: I've been tasked with the organization, and he wants us to open up a memory space, C, and put A+b in.
Cpu:a+b, I've already worked it out. I just applied for a memory address, and the Memory brothers put A+b in the memory address.
Memory: OK
Summary: The memory bar is specifically responsible for the storage and reading of the data CPU to the address to be read to the memory Bar memory bar to find this memory to take the value inside out to the CPU
The display card display card also has a storage data place called the memory screen to read the memory can know that the light bulb needs to glow
Keyboard keyboard Whenever someone knocks on it, he tells someone (in fact, the memory has an area with keyboard keys, the keyboard is knocked to change the memory of the value of the CPU by reading this memory to know the keyboard key state)
C + + underlying system concept (ii) How to play hardware----