Home  >  Article  >  What language can be directly recognized and executed by computer hardware?

What language can be directly recognized and executed by computer hardware?

王林
王林Original
2020-12-25 15:16:1592821browse

The language that computer hardware can directly recognize and execute is machine language. Machine language is a programming language or instruction code that the machine can directly recognize without translation. Each operation code has a corresponding circuit inside the computer to complete it.

What language can be directly recognized and executed by computer hardware?

The operating environment of this article: Windows 7 system, Dell G3 computer.

The language that computer hardware can directly recognize and execute is machine language.

Machine language introduction

Machine language is a programming language or instruction code that can be directly recognized by the machine without translation. The operation code has a corresponding circuit inside the computer to complete it, or refers to a programming language or instruction code that can be directly understood and accepted by the machine without translation.

Machine language uses absolute addresses and absolute opcodes. Different computers have their own machine languages, that is, instruction systems. From a usage perspective, machine language is the lowest level language.

Machine language is a set of machine instructions represented by binary code that a computer can directly recognize and execute. It is the operating function given to the computer by the computer designer through the computer's hardware structure. Machine language has the characteristics of flexibility, direct execution and high speed. The machine languages ​​of different types of computers are incompatible. A program compiled according to the machine instructions of one type of computer cannot be executed on another type of computer.

An instruction is a statement in machine language. It is a set of meaningful binary codes. The basic format of the instruction is such as the operation code field and the address code field. The operation code specifies the operation nature and function of the instruction. , the address code gives the operand or the address of the operand.

Instruction format

Machine language instruction is a binary code consisting of two parts: operation code and operand. The opcode specifies the operation of the instruction. It is a keyword in the instruction and cannot be defaulted. The operand indicates the operand of the instruction. The instruction format of the computer has a great relationship with the word length of the machine, the capacity of the memory and the function of the instruction. From the perspective of facilitating program design, increasing parallelism of basic operations, and improving instruction functionality, instructions should contain a variety of information. However, in some instructions, because part of the information may be useless, this will waste the storage space occupied by the instruction and increase the number of memory accesses, which may actually affect the speed. 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 storage space, shorten the value time, and improve the performance of the machine. This is an important issue in instruction format design.

Computers process various data by executing instructions. In order to indicate the source of data, the destination of operation results and the operations 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 instruction has a corresponding operation code, and the computer completes different operations by recognizing the operation code.

(2) The address of the operand. The CPU can obtain the required operands through this address.

(3) Storage address of the operation result. The result of processing the operand is saved at this address for reuse.

(4) The address of the next instruction. When executing a program, most instructions are fetched from the main memory in order and executed. Only when a transfer instruction is encountered, the execution order of the program will change. In order to compress the length of the instruction, a program counter (ProgramCounter, PC) can be used to store the instruction address. Every time an instruction is executed, the instruction address of the PC is automatically set to 1 (assuming that the instruction only occupies one main memory unit), indicating the address of the next instruction to be executed. When a transfer instruction is encountered, the transfer address is used to modify the contents of the PC. Due to the use of PC, the address of the next instruction to be executed does not need to be explicitly given in the instruction.

(Learning video sharing: Programming video)

The above is the detailed content of What language can be directly recognized and executed by computer hardware?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What software is brNext article:What software is br