When I learn C language, sometimes encounter the technical points that they can not understand, it is impossible, but these technical points if the Assembly to understand the words, it may be very good understanding, it is easier for everyone to understand, so feel the assembly is very powerful, for us to learn some other high-level language is also very useful, So hope that they can have a certain understanding of the Great assembly language and cognition, the way of thinking of the computer also have a further understanding of their own coding habits have a good impact or change, at the same time on their own ability to improve it.
1. We first need to know what is machine language? This is the set of machine instructions, which is the command that a machine can execute correctly. The machine instruction is actually a series of binary numbers that the computer converts into a series of high and low levels to drive the hardware to work.
Because machine instruction or machine language is a combination of some 0 and 1, it is not easy for people to remember and distinguish, so there is assembly language.
2. The main body of assembly language or the core is the assembly instructions, as in C language C89 32 keywords. Assembly instructions determine the characteristics of assembly language.
What is a compiler? It is a program that is a tool for translating our assembly instructions into machine instructions.
The process of communication between programmers and computers is: programmer-----assembler--------computer
3. Assembly language is made up of three parts
Assembly instruction: Mnemonic of the machine code, since the assembly instruction and the machine instruction are one by one corresponding.
Pseudo-directive: can only be recognized by the compiler
Other directives: also recognized by the compiler
4. Memory: That is what we normally call memory, it is not the same as the disk, the data on the disk needs to be read into memory before it can be used.
5. Instruction and data: In fact, the instruction and data in memory are stored in binary information, without any difference, depends on how the CPU to use the data in memory.
6. Storage unit: Memory is divided into several storage units, each storage unit has its own number, and the number is starting from 0.
Analogy: The memory is the cinema, and the seat is the storage unit
Better analogy: Memory is a street, and a house is a storage unit in memory
You can think of the memory unit as linear arrangement.
Relationship between memory capacity units: 1 B = 8b, 1KB = 1024B, 1MB = 1024KB, 1GB = 1024MB, 1TB = 1024GB
We want to have a computer thinking: good brother to borrow 1000 yuan, and I said to make a whole, lend you 1024 yuan. Isn't it fun?
7. The CPU to read and write data to have the following three types of information exchange:
Address information: Address of the storage unit
Control information: whether to read or write data to a memory unit
Data information: Data to be read or to be written
8. Through three kinds of bus to complete the data interaction:
Address bus: Determines the addressing capability of the CPU
Control bus: Determines the CPU's ability to control external devices
Data bus: Determines the speed of data transfer between the CPU and the external device
9. Classify the memory from read-write attributes
RAM: Random memory, readable writable, must live storage, storage data loss after shutdown
ROM: Read-only memory, read-only, non-writable, the data stored after the shutdown is not lost, such as the bios of the motherboard, the BIOS of the video card, the BIOS of the network card
10. Memory address space: each memory composed of linear storage space, which is what we call logical storage space, that is, memory address space.
Detection:
- The 1 CPU has an addressing capacity of 8KB, then its address bus width is 13
- 1KB of memory has 1024 storage units, the number of storage units from 0 to 1023
- The 1KB memory can store 8,192 bits and 1024 bytes.
- 1GB, 1MB, 1KB is 2^30 byte, 2^20 byte, 2^10 byte
- 8080, 8088, 80286, 80386 address bus widths of 16, 20, 24, 32, respectively, their addressing capabilities are: 64KB, 1MB, 16MB, 4GB
- The data bus widths of 8080, 8088, 8086, 80286, and 80386 are 8, 8, 16, 16, 32, respectively, and they can transmit data at a time of 1 B, 1B, 2B, 2B, 4 b
- Reads 1024 bytes of data from memory, 8086 reads at least 512 times, 80386 reads at least 256 times
- In memory, data and programs are stored in binary form
Summary: This chapter of the study, mainly know the composition of computers, and computer processing data process, what is machine language, what is assembly language.
We also need to know that the end of the program is the CPU, so we have to learn from the perspective of the CPU to think. (Super Important).
Compilation Study note 01 (Basic knowledge)