This article is a compilation of my study notes, because there is no foundation, so most of them are partial basic things, reference is king of cool "assembly language Third Edition," and a small turtle assembly language video and online all kinds of information
What is assembly language
Assembly language is text in the form of a binary instruction, and the instruction is one to one relationship
What is register
Because the cpu is only responsible for operations, data are generally stored in the memory
However, operation speed is much higher than the cpu memory, in order to avoid slowing down, it comes with all cpu cache and secondary cache
However, cpu cache is not fast enough, or not fixed address additional data in the cache, each read and write must be addressed, it will slow down the speed
Therefore, in addition to the buffer, cpu registers also comes, the most commonly used for storing data, is the most frequently read and write data, which will be placed in register, cpu priority read and write registers, then the register and memory data exchange
Address register does not rely distinguish data, and rely on name.
There are a plurality of registers cpu
Register cache, this is relatively closer to the presence of the cpu
Assembly language consists of the following three categories consisting of
1 assembler instructions (machine code mnemonic, a corresponding machine code)
2 directive (there is no corresponding machine code, executed by a compiler, the computer does not perform)
3 other symbols (e.g., + - * /, etc., recognized by the compiler, there is no corresponding machine code)
The core assembly language is the assembly instructions, which determines the characteristics of assembly language
Memory
cpu cpu is a core component of a computer, which controls the operation of the entire computer and performs arithmetic, cpu to get a job, you must provide instructions and data to him.
Instructions and data stored in a memory, said memory is usually
Cpu want to read and write data, you must interact with three types of information and external chip:
Address (address information) of the storage unit 1. The
2. Select device, read or write command (control information)
3. read or write data (data)
There is a special link in the computer chip cpu and other wires, commonly referred to as a bus.
Logically divided into:
1. Address bus
2. Data bus
3. Control Bus
Address bus
N root has a cpu address bus, it can be said that the width of the address bus of the cpu n
Such cpu can find up to n-th power of 2 memory cells.
Data Bus
Data transfer between the cpu and memory, or other device is carried out via the data bus, the data bus width determines the data transfer rate and external cpu
Control bus
cpu control of external devices are performed via the control bus, the control bus here is a general term, a control bus is a collection of a number of different control lines, the number of root control bus provides a means cpu how many external devices control, so that control of the bus width determines the cpu control of external devices, the transmission control information on the control bus
Checkpoint 1.1
1 addressing capability for a cpu 8KB, then the width of its address bus is 13
8KB = 8192byte, i.e. you can look up the storage unit 8192
Calculated from 8192 to 13 th power of 2, i.e., the address bus width of the cpu 13
2 1KB memory 1024 memory cells, the memory cells are numbered from 0 to 1023
Storage size of a memory cell is 8bit, 8bit = 1byte, 1KB = 1024byte, so the storage unit 1024
3 1KB memory 8192 may store a bit, 1024 th byte
4 1GB, 1MB, 1KB are 1073741824byte, 1048576byte, 1024byte
5 8080,8088,80286,80386 address bus width were 16, 20, 24, 32, they are addressing capability: 64KB 1MB 16MB 4GB
6 8080,8088,8086,80286,80386 data bus width are respectively 8, 8, 16, 16, 32, they are addressing capability 1,1,2,2,4
7 reads 1024 bytes of data from memory 8086 to read at least 512 times, at least 80386 to read 256
8 in the memory, data stored in binary form and procedures