What is Machine Code?
A programming language used directly by a computer. The statement is a machine instruction code. A machine instruction code is a set of binary numbers used to direct the computer to perform operations and operand addresses. [1]
- Various uses
Machine instruction code
- A code is a number that is used to represent information and can be input, transmitted, processed, and output. Letters, numbers, control characters, etc. must be represented as corresponding binary digits to be recognized by digital devices.
- In an electronic computer, the information entered, such as symbols, letters, numbers, etc., must be converted into binary numbers that can be recognized by the electronic computer. Such binary numbers representing information are called codes. In a computer, not only information is represented by a code, but instructions that cause the computer to operate and storage addresses of various types of codes are also represented by a code. The codes used in the computer are ASCII code, BCD code, EBCDIC code, etc.
- Codes are rules and symbolic systems that represent data, information, and programs on a one-to-one correspondence basis. There are three types of codes: original code, complement code and reverse code. Computers use binary codes "0" and "1" to represent numbers or letters as processed information. It can be expressed by the magnetization direction of the magnetic core, the hole of a paper tape or a card, and the like. Data or information can only be identified and accepted by the computer after it is represented by a code (form).
- The operation code and address code are binary codes. For convenience, they are usually written in octal or hexadecimal numbers.
Machine instruction code machine language
- Machine language is the basic set of computer instructions expressed in digital form. It is a programming language that can be recognized by computer hardware systems and can be directly executed by machines without translation. Machine language includes instruction system, number form, channel instruction, interrupt word, mask word, information of control register and so on. Its characteristics are related to specific machines and high efficiency, but they are complicated, tedious, time-consuming and prone to errors.
- Programs written directly in machine language are called "hand-written programs." Programming by hand is a tedious task that requires a lot of manpower and time. A lot of the work is mechanical and repetitive. And because machine language is not very intuitive, hand-programming is very error-prone, and it is not easy to check and modify. Moreover, different types of computers have different instruction systems, that is to say, different types of computers have their own machine languages, and they are not universal. Therefore, for the same problem, a program compiled with A-type computer instructions cannot be used on a B-type computer. Instead, you must compile another program according to the instructions of the B-type computer. Obviously this is very inconvenient.
- In addition, because the machine instructions are all numeric codes composed of 0 and 1, the program is also composed of numerals composed of 0 and 1. In this way, it is not only difficult to remember the meaning of the various instruction codes, which increases the difficulty of programming, but also the programmed programs are all numbers such as 0 and 1, which are difficult to identify and easy to make mistakes. Compared with the languages people are accustomed to, machine language is harder to learn, harder to write, harder to remember, harder to check, harder to modify, and different machines are not universal. Therefore, machine programming is rarely used in practice. Machine language also has its advantages, that is, the program written in it can be executed as soon as it is entered into the computer. Therefore, compared with programs written in other languages, the execution speed is the fastest. For this reason, people have designed a variety of "program automation languages", such as algorithm languages, which are convenient for writing programs. [3]