In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how the machine language that the computer can directly recognize is composed of, the introduction in the article is very detailed, has certain reference value, interested friends must read it!
The machine language that can be directly recognized by the computer is composed of an opcode and an Operand. The opcode defines the operation of the instruction, which is the keyword in the instruction and cannot be defaulted; the Operand represents the operating object of the instruction. the instruction format of the computer is closely related to the word length of the machine, the capacity of the memory and the function of the instruction.
Machine language is a program language or instruction code that can be directly recognized by the machine, without translation, each opcode has a corresponding circuit to complete it in the computer, or refers to the program language or instruction code that can be directly understood and accepted by the machine without translation. The machine language uses absolute addresses and absolute opcodes. Different computers have their own machine languages, that is, instruction systems. From a use point of view, machine language is the lowest level of language.
Machine language instruction is a kind of binary code, which is composed of opcode and Operand. The opcode specifies the operation of the instruction, which is the keyword in the order and cannot be defaulted. The Operand represents the Operand of the instruction. The instruction format of the computer is closely related to the word length of the machine, the capacity of the memory and the function of the instruction.
From the point of view of facilitating programming, increasing the parallelism of basic operations and improving the function of instructions, instructions should contain a variety of information. However, in some instructions, because some of the information may be useless, this will waste the storage space occupied by the instructions and increase the number of memory accesses, which may affect the speed instead.
Therefore, how to design the instruction format reasonably and scientifically so that the instruction can not only give enough information, but also make its length match the word length of the machine as much as possible, so as to save the storage space, shorten the value time and improve the performance of the machine? this is an important problem in instruction format design.
Computers process all kinds of data by executing instructions. In order to indicate the source of the data, the whereabouts of the operation results, and the actions performed, an instruction must contain the following information:
(1) Operation code. It specifies the nature and function of the operation. A computer may have dozens to hundreds of instructions, each of which has a corresponding opcode, and the computer completes different operations by identifying the opcode.
(2) address of Operand. CPU can get the required operands through this address.
(3) the storage address of the operation result. Save the results of the processing of the operands in this address for re-use.
(4) the address of the next instruction. When the program is executed, most of the instructions are fetched from the main memory sequentially, and the execution order of the program will be changed only when the transfer instruction is encountered. To compress the length of an instruction, a program counter (ProgramCounter,PC) can be used to store the instruction address. Each time an instruction is executed, the instruction address of the PC is automatically + 1 (assuming that the instruction occupies only one main memory unit), indicating the address of the next instruction to be executed. When the execution of the transfer instruction is encountered, the content of the PC is modified with the transfer address. Because of the use of PC, it is not necessary to explicitly give the address of the next instruction to be executed in the instruction.
An instruction actually includes two kinds of information, namely, an opcode and an address code. The operation code (OperationCode,OP) is used to indicate the operations to be completed by the instruction (such as addition, subtraction, multiplication, division, data transfer, etc.), and its length depends on the number of instructions in the instruction system. The address code is used to describe the Operand of the instruction, which either gives the Operand directly or indicates the memory address or register address of the Operand (that is, the register name).
The above is all the contents of this article, "how is the machine language directly recognized by computers?" Thank you for reading! Hope to share the content to help you, more related 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.