80x86 is a series of microprocessors
The microprocessor is also called the central Processing Unit, namely the CPU, is an integrated circuit chip. It is a core component of microcomputers.
Since the microprocessor is the core of the microcomputer, it is necessary to discuss the microcomputer in a simple way first. Microcomputer:
Microcomputer refers to the microprocessor as the core, with the memory, input/output interface circuit composed of computers (also known as the host).
Microcomputer system refers to a microcomputer-centered system, which is equipped with the corresponding peripheral equipment, power supply and auxiliary circuit (collectively known as hardware) and the system software of the command circuit. That is, as with the general computer systems, microcomputer system is composed of two parts: hardware and software.
below, I will introduce some of the basic concepts involved in micro-computer systems, there may be no obvious relationship between each concept, but in the absence of the principle of not mentioning, as far as possible to the mentioned points of knowledge strung together to form a simple knowledge framework easy to understand.
Just as the brain controls people's work,
The CPU controls the operation of the entire computer and operates on it. To get a CPU to work, you have to provide instructions and data to it. Instructions and data are stored in memory, which is what we normally call memory (the memory referred to in the following if not specifically stated). The disk is different from memory and cannot be used by the CPU if the data or program on the disk is not read into memory.
Directives and data are concepts of application, and there is no difference between instructions and data, both binary information. When the CPU is working, it regards the information as the instruction, and some information as the data, which gives different meanings to the same information.
Storage unit: Memory is divided into several storage units, one storage unit stores one byte of information, that is, 8 bits.
The following unit conversions are available:
1 B = 8 x bits
1KB = 1024B
1MB = 1024KB
1GB = 1024MB
1TB = 1024GB
Each storage unit is numbered sequentially from 0, which can be thought of as the address of the storage unit in memory. The following figure is a memory with 128 storage units:
When the CPU is working, it is often necessary to read data from memory or write data to memory, which requires the interaction of address information, data information, and control information between the CPU and the memory.
So, what is the CPU going to do with these three kinds of information in the memory chip? The information that the computer can process and transmit is an electrical signal, of course, the electrical signal must be transmitted by wire.
There are wires in the computer that are specifically connected to the CPU and other chips, often called buses. The bus is physically a collection of a single root wire. According to the different transmission information, the bus is logically divided into three classes: Address bus, control bus and data bus.
The bus can be a ribbon flat cable or a very thin metal connection on the printed board.
The process by which the CPU reads data from a memory unit is as follows:
(1) The CPU sends the address information 3 through the address line
(2) The CPU sends out a memory read command through the control line, selects the memory chip and notifies it that it will read the data from it.
(3) The memory sends the data in unit 3rd to the CPU via a data cable.
A write operation is similar to a read operation. If you write data 2 to unit 3rd, the steps are:
(1) The CPU sends the address information 3 through the address line.
(2) The CPU through the control bus issued memory Write command, check the memory chip, and notify it, to write data inside.
(3) The CPU feeds data 2 into the memory unit 3rd via the data bus. Let's take a brief look at these three types of buses,
Address Bus AB: When accessing a memory or I/O port, the address information of the storage unit or I/O port provided by the CPU to be accessed is transmitted. AB is a one-way bus.
A CPU has n address line, it can be said that the address bus width of the CPU is n, so that the CPU can look for 2 of the n-th square of the internal deposit cells.
Data bus db:cpu and memory or other parts of the data transfer is done through the data bus, the width of the data bus determines the speed of the CPU and the outside world. 8 Data bus can transmit one byte at a time. The 8088CPU data bus width is 8,8086cpu with a data bus width of 16.
For example, the CPU wants to write data 89d8 to memory.
Because 80,881 times can only transmit one byte of data is 8 bits, so it is divided into two transmission, the first transmission D8, the second transmission 89. However, 8086 has 16 data bus which can transmit two bytes, so the data can be 89d8 into memory at once. DB is a two-way bus
Control Bus CB: The control bus is a collection of a number of different control lines. The number of control buses means how much control the CPU provides to the external device, and the width of the control bus determines the CPU's ability to control the external device. we know that the CPU consists of three parts: the operator (ALU), the controller (CU) and the internal register (R). Controller:
Controller is the command center of the whole machine, it is responsible for the instruction from the memory to take out, after decoding analysis to the whole machine issued a number, execution, storage and other control commands to complete the function required by the program. The controller consists of the following parts:
A. Instruction register IR: used to store the instruction code to be executed from the memory.
When executing an instruction, it is first taken from memory to the data buffer Register DR and then transferred to the instruction register IR.
B. Instruction decoder ID: Decodes the instruction opcode field in the instruction register IR to determine what action the instruction performs. It is necessary to note that the instruction is usually composed of two parts: opcode and operand. The opcode represents the action done by the instruction, which represents the number of participating operations or the address of the operand.
C. Programmable logic array PLA: used to generate a command and execute instructions required by a variety of micro-operation control signals, and after the control bus CB sent to the relevant parts, so that the computer to complete the corresponding operation. Internal registers:
1) Program Counter PC: The program counter is sometimes referred to as the instruction pointer (IP), IP is usually automatically modified by the CPU plus one, so that it always holds the next command to execute the address of the storage unit. However, when a redirect is encountered that alters the order of the program's execution, the PC (IP) will switch from the instruction register IR
Gets the address field in the.
2) address register AR: Address of the address or operand used to store the instruction being removed.
3) Data Buffer Register DR: used to temporarily store instructions or data. It is the transfer of information between CPU and memory and external devices to compensate for differences in operating speed between CPU and memory and peripheral devices.
4) Accumulator: Used to temporarily store the results of the ALU operation.
5) Flag Register Flags: sometimes also referred to as the program status Word (PSW). When writing a program, you can determine the flow direction of the program by testing the status of the flag bit (1 or 0).
6) Register array: The register array is actually equivalent to the internal CPU RAM, avoids the CPU frequently accesses the memory, increases the machine to run the speed. The size of the register array for different types of CPUs will vary.
The CPU also has a component is an operator (arithmetic logic unit ALU), the main function of the operator is the operation, the operation of the two operand one from the accumulator A, one from the internal data bus, can be the contents of the buffer register, can also be a register array in the contents of a register.
Our description of memory here is just a brief introduction to a concept, because it contains too much information and is not explained in detail here.
In each PC, there is a motherboard. The motherboard has a core device and some major devices that are connected via the bus. These devices include CPUs, memory, peripheral chipsets, expansion slots, and so on. The expansion slots are generally plugged into RAM memory strips and a variety of connector ports.
The CPU can not directly control external devices, such as monitors, speakers, printers and so on. Direct control of these devices is done by plugging in the riser on the expansion slot. The expansion slots are connected via the bus and the CPU, so the adapter port is also connected via the bus and CPU. The CPU sends commands to the socket via the bus, and the adapter controls the peripheral work according to the command.
Well, for the microcomputer hardware we first introduced here, the main description of the CPU on the host of some of the hardware concepts involved. For other hardware in the system such as peripherals, as well as memory on the host, I/O interfaces and input, etc.
At the same time, the software is also an indispensable part of the microcomputer system, software including system software and users (application software). System software is no need to intervene, for the development of other programs, commissioning and operation of a good environment to establish a program. It mainly includes operating system and system applications. The working process of a microcomputer:
1) Assign the address of the storage unit where the first instruction is located to the program counter PC.
2) Take the address and get the instruction
3) Decoding the Operation Code field of the instruction and issuing the micro-operation control signal of the execution instruction.
4) Execute the instruction and complete the operation specified in the instruction. after some simple understanding of the microcomputer system, we are more familiar with the working situation of the microprocessor, let us first look at the contour of a processor internal register.
This piece of explanation, when doing the picture due to poor consideration, the picture proportion is not adjusted well, the display is particularly small, you can adjust the zoom rate a little more to see the picture, for example, CTRL + Look, haha.
We note that the above mentioned paragraph address, paragraph register, these two nouns contain the concept of "paragraph", below we will briefly explain what is paragraph.
8086CPU gives the physical address of the memory unit with the base address (segment address x16) + offset address = Physical address, allowing us to manage memory in a segmented manner.
To prevent it from being misunderstood, I repeat it here. In other words, the actual memory is not fragmented, the segment is divided from the CPU, but the CPU itself with the segment address and offset address to represent the physical address.
Later, when programming, you can consider several contiguous memory units as a segment as needed. The programming here refers to assembly language programming. It is important to note that since the segment address x16 must be a multiple of 16, the starting address of a segment must also be a multiple of 16. The offset address is 16 bits and the 16-bit address has a 64KB addressing capacity, so the length of a segment is 64KB maximum.
So, why the base address must be a segment address x16 not by the other number. Since address bus is 20 bits, the CPU must provide a 20-bit address information to address bus when it accesses memory. And because the segment address is stored in a 16-bit segment register, it must be x16 (10H), that is, moving the four-bit left to make it a 20-bit base address, plus an offset to locate the specific physical memory unit.
Originally wanted to use a blog content on the 8086 microprocessor roughly introduced, but wrote to write to find the content of the involved is too much, accidentally ran away. Below I have the function of the 8086 microprocessor as the end, briefly introduce the simple concept here, as to the specific stack operation and the concept of interrupt and working mode and some of the basic assembly language instructions they use, we have to introduce in the next article.
The CPU is functionally divided into two parts: 1. Bus interface Unit Biu:
The function of the bus interface unit Biu is to complete the data transfer between the CPU and the memory or I/O device. 2. Execution Unit EU:
The execution unit is not directly connected to the outside of the system, its function is only responsible for executing instructions. The executed instruction is obtained directly from the Biu's instruction buffer queue. When executing the instruction, if the operation needs to read and write from the memory or I/O port, the EU sends a request to the Biu and is accessed by the Biu on the memory or I/O port.
In short, Biu is responsible for interacting with the system outside, and the EU is responsible for the implementation instructions.