Home  >  Article  >  What two parts does an instruction usually consist of?

What two parts does an instruction usually consist of?

青灯夜游
青灯夜游Original
2021-01-13 11:39:3147848browse

An instruction usually consists of two parts: operation code and address code. An instruction is a statement in machine language, which is a set of meaningful binary codes. The basic format of the instruction is: opcode field, address code field; the opcode specifies the operating nature and function of the instruction, and the address code gives The operand or the address of the operand.

What two parts does an instruction usually consist of?

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

Computer instructions are instructions and commands that direct the work of the machine. A program is a series of instructions arranged in a certain order. The process of executing the program is the working process of the computer.

The controller relies on instructions to direct the machine to work. People use instructions to express their intentions and give them to the controller for execution.

An instruction usually consists of two parts: operation code and address code.

An instruction is a command given to the computer. It tells the computer what operation to do, where the data involved in this operation comes from, and where the operation results will be sent. Therefore, an instruction must include an operation code and an address code.

There are three types of organization and coding of operation codes:

(1) Fixed-length operation code organization scheme

Advantages: Computer The hardware design is simple and the instruction decoding and execution speed is fast.

Disadvantages: When the number of instructions increases and the instruction word is divided into fixed multiple bits for the operation code, the number of bits left to represent the operand address will be seriously insufficient.

Suitable for computer systems with longer word lengths, such as 32 bits or more.

Related recommendations: "Programming Video"

(2) Organization scheme for variable-length opcodes

Advantages: In relatively short instruction words , it can not only express a relatively large number of instructions but also try to meet the requirements of the operand address.

Disadvantages: The computer hardware design is complex, and the instruction decoding and execution speed is slow.

Suitable for computer systems with shorter word lengths, such as 16 bits or less.

(3) A scheme in which the opcode field intersects with the operand address

Advantages: In a relatively short instruction word, it can express a larger number of instructions and maximize the number of instructions. Meet the requirements of the operand address. The opcode is no longer concentrated in the highest bit of the instruction word, but intersects with the field representing the address of the operand.

Disadvantages: The computer hardware design is complex, and the instruction decoding and execution speed is slow.

This solution is not very commonly used.

If you want to read more related articles, please visit PHP Chinese website! !

The above is the detailed content of What two parts does an instruction usually consist of?. 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