Home >Common Problem >What programming language is used to write programs that can be directly executed by computers?

What programming language is used to write programs that can be directly executed by computers?

青灯夜游
青灯夜游Original
2021-03-24 17:05:3249125browse

Programs that can be directly executed by computers are written in "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, or it refers to a programming language that can be directly understood and accepted by the machine without translation. or instruction code.

What programming language is used to write programs that can be directly executed by computers?

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

Programs that can be directly executed by computers are written in "machine language".

Programming language is a formal language used to define computer programs and to issue instructions to the computer. There are many computer languages, and a large number of new programming languages ​​are created every year. According to levels, programming languages ​​can be divided into three categories: machine language, assembly language and high-level language.

  • Machine language consists of a set of machine instructions and can be directly executed by the machine. Programs written in machine language have problems that are difficult to read and remember.

  • Assembly language essentially operates directly on hardware. Due to the use of mnemonics, it is more convenient to write and read than machine language.

  • In high-level languages, multiple assembler statements are merged into more concise programming statements, and at the same time, some tasks such as stack and register allocation management are automatically completed, making it more convenient for programmers to develop programs.

Machine language is a programming language or instruction code that can be directly recognized by the machine without translation. Each operation code has a corresponding circuit inside the computer to complete it, or refers to it without any translation. Translation can be a programming language or instruction code that the machine can directly understand and accept.

Machine language has the characteristics of flexibility, direct execution and fast 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.

The opcode specifies the operation of the instruction. It is a keyword in the instruction and cannot be defaulted. The operand represents the operand of the instruction. The computer's instruction format has a great relationship with the machine's word length, memory capacity and instruction function. 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.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of What programming language is used to write programs that can be directly executed by computers?. 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