The two parts of the instruction that the computer can directly execute are the "opcode" and the "operand". The memory inside the computer has memory characteristics and can store a large amount of information. This information includes not only various types of data information, but also programs (a set of instructions) for processing these data. Each instruction in the instruction system contains an operation code and an operand. The operation code indicates the nature of the operation that the instruction should perform, and the operand is the participant of the instruction execution, that is, the object of various operations.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
The two parts of the instruction that the computer can directly execute are the opcode and the operand .
The memory inside the computer has memory characteristics and can store a large amount of information. This information not only includes various types of data information, but also includes programs for processing these data (a set of instructions that the computer can recognize and execute) ).
Usually an instruction contains an opcode and operands. For example: in the comparison instruction, the operator specifies the computer to perform the comparison operation, and the operand specifies the two values to be compared.
The operand is the participant of the instruction execution, that is, the object of various operations. Related to it is the operation code. The so-called operation code describes what kind of operations the computer wants to perform, such as transmission, operation, shift, jump, etc. It is an indispensable part of the instruction.
Different instructions are represented by different codes in the opcode field. Each code represents an instruction; the number of digits that make up the opcode field generally depends on the size of the computer instruction system.
Operation code
The operation code refers to the part of the instructions or fields (usually represented by codes) specified in the computer program to perform the operation. It is actually the instruction sequence number. , used to tell the CPU which instruction needs to be executed.
Each instruction in the instruction system has an opcode, which indicates the nature of the operation that the instruction should perform. Different instructions are represented by different encodings of the opcode field, and each encoding represents an instruction. The number of bits that make up the opcode field generally depends on the size of the computer's instruction set.
Operator
The operand indicates the source of the data required for the operation performed by the instruction. An operand is a field of an assembly language instruction. For example: Mov AX 5678H operand (AX 5678H). In the operand field, you can put the operand itself, the operation address, and the calculation method of the operation address.
Form of operand:
Immediate operand: The data to be operated by the instruction appears in the instruction in the form of a constant, called an immediate number, which can only be used as a source operand.
Register operand: The data to be operated by the instruction is stored in the register in the CPU. Just give the register name in the instruction.
Memory operand: The data to be operated by the instruction is stored in certain units of memory. The physical address of the memory unit is given in the instruction (actually the instruction only gives the offset address, and the segment address is given implicitly. out, you can also use the cross-segment method to indicate the current segment address).
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What are the two parts of an instruction that a computer can directly execute?. For more information, please follow other related articles on the PHP Chinese website!