1. Preface
This series of articles for me to learn some summary of assembly language and reading notes, sharing out with everyone to encourage, if there are errors please advise 2. Machine language
Machine language is the set of machine instructions. Machine instructions are commands that a machine can understand and execute correctly, and the computer's machine instruction is a string of binary digits, which is translated into a list of high and low levels so that the computer's electronic devices are driven to perform related operations. Different computer hardware requires different levels to drive, so the machine instructions for different computers are different. 3. assembly language Related
1. Production of assembly language
Since early programmers are programmed to use machine instructions directly, which is a string of binary numbers, so that not only inefficient, but also particularly error-prone, so the assembly language came into being, assembly language will be a string of binary instructions for the relatively easier to read the assembly instructions, to see an example:
2. Work Flow
But the computer can only understand the machine instructions, so we directly to the computer to see the assembly instructions, the computer is not understand, at this time need to compile the debut, the compiler's job is to tell the assembly instructions translated into computer-readable machine instructions. The general flow is as follows:
3. Assembler assembly instruction: Machine code mnemonic, there is the corresponding machine code pseudo-directive: no corresponding machine code, by the compiler to execute other symbols: + 、-、 *,% by the compiler to identify 4.CPU and memory exchange between the information
4.1
Register: In the CPU, the fastest read and write speed
Memory: Different from external memory such as hard disk and U disk, they are not a kind of thing
4.2
The CPU's job is to process the data and where the data comes from. The memory is needed, and the data of the hard disk must be read into the memory before it can be processed by the CPU. How does the CPU exchange information with the memory? We just need to focus on the three point: to operate on that piece of storage unit (a byte in memory as a storage unit). How to operate. How the data is sent over.
How did the seniors deal with it?
They used three different lines to transmit the data: address bus, control bus, data bus
Work in the following ways:
5. Address Bus
Note: The CPU uses address bus to determine which storage unit will be operated
Note: The bus is not just a line, but a combination of many lines.
The number of bars in the address bus determines the extent to which the CPU can access the storage unit, such as 10 address lines, so that the CPU can access 1024 storage units. A CPU has an n address line to say that the CPU's address bus width is n, the maximum number of storage units can be accessed 2 of the n-th square.
6. Data bus
The number of data bus bars determines the number of bits of data that the CPU can transmit at one time. 7. Control Bus
The number of bars in the control bus determines how much control the CPU has on the external device.