In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
I would like to share with you that the instructions in the application programs in the computer can be divided into requesting specific services and what to the operating system. I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article, let's learn about it!
In theory, instructions in an application can be divided into a set of instructions for requesting specific services and central processing units (CPU) from the operating system. The processing flow of CPU operation instructions is roughly divided into several steps: fetch, decode, execute, access memory, write back, and so on; each instruction varies from 1 to 6 bytes, depending on which fields are required.
Theoretically, instructions in an application can be divided into two categories: the instruction set of the central processing unit (CPU) and the request for specific services from the operating system.
Central processing unit (CPU,Central Processing Unit) is a very large-scale integrated circuit, which is the computing core (Core) and control core (Control Unit) of a computer. Its main function is to interpret computer instructions and process data in computer software.
The CPU mainly includes arithmetic unit (arithmetic logic operation unit, ALU,Arithmetic Logic Unit) and cache memory (Cache) and the data (Data), control and state bus (Bus) that realize the relationship between them. It is called the three core components of electronic computer together with internal memory (Memory) and input / output (I / O) devices.
The processing flow of CPU operation instruction is roughly divided into several steps: fetch, decode, execute, access memory, write back and so on. Each instruction varies from 1 to 6 bytes, depending on which fields are required. The first byte of each instruction indicates the type of instruction: the high 4 bits are the code part (for example, 6 is the integer class operation instruction), and the lower 4 bits are the functional part (for example: 1 is the subtraction instruction in the integer class) 61 is the sub instruction.
Processing instruction flow
An important property of an instruction set is that byte encoding must have a unique interpretation. Any byte sequence is either the encoding of a unique instruction sequence or is not a legitimate byte sequence. Because the first byte of each instruction has a unique code and function combination, given this byte, we can determine the length and meaning of all other additional bytes.
Each instruction varies from 1 to 6 bytes, depending on which fields are required. The first byte of each instruction indicates the type of instruction: the high 4 bits are the code part (for example, 6 is the integer class operation instruction), and the lower 4 bits are the functional part (for example: 1 is the subtraction instruction in the integer class) 61 is the sub instruction.
The following is a flowchart for processing each instruction:
Fetch reference (fetch)
The value phase reads instruction bytes from memory and puts them into the instruction memory (CPU) with the address of the value of the program counter (PC). It calculates the address of the next instruction of the current instruction in a sequential manner (that is, the value of PC plus the length of the fetched instruction).
Decoding (decode)
ALU reads up to two operands from a register file (a collection of general registers). (that is, reading up to two registers at a time)
Execute (execute)
During the execution phase, the arithmetic / logic unit (ALU) is used for different purposes depending on the type of instruction. For other instructions, it acts as an adder to increase or decrease the stack pointer, or to calculate a valid address, or simply add 0 to pass an input to the output.
The condition code register (CC) has three condition bits. ALU is responsible for calculating the new value of the condition code. When a jump instruction is executed, the branch signal cnd is calculated according to the condition code and jump type.
Access to memory (memory)
In the memory access phase, the data memory (in CPU) reads or writes a memory word. Instructions and data memory access the same memory location, but for different purposes.
Write back (write back)
The writeback phase can write up to two results to a register file. The register file has two write ports. Port E is used to write values calculated by ALU, while port M is used to write values read from the data store.
Update PC (PC update)
According to the instruction code and the branch flag, the value of the next PC is selected from the signal values obtained in the previous steps.
The above is all the contents of the article "instructions in computer applications can be divided into requests for specific services and what to the operating system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.