SoFunction
Updated on 2025-03-04

The difference between assembly language pseudo-instructions and assembly instructions

[Instruction statement]

Each instruction statement must generate instruction code (i.e. object code) that can be executed by the computer when assembling the source program, so this statement is also called executable statement. Each instruction statement represents a basic capability of the computer, such as data transmission, addition or subtraction of two numbers, shifting, etc. This capability is completed when the target program (ordered set of instruction codes) is run and is implemented by relying on hardware devices such as the central processing unit (CPU), memory, I/O interface, etc. in the juice computer.

[Pseudo-instruction statement]

Pseudo-instruction statements are used to indicate how the assembler assembles the source program, so this statement is also called a command statement. For example, the pseudo-instruction statement in the source program tells the assembler: how the source program is segmented, which logical segments are in the program segment and which segment registers they are pointed to; which data is defined, how the storage unit is allocated, etc. Except for the specific data defined by the pseudo-directive statement, there is no corresponding object code. These command functions of pseudo-instructions are accomplished by the assembler when assembling the source program, by executing a piece of program, rather than being implemented when running the target program.

A pseudo-instruction has no corresponding machine code. It is not executed by the CPU like an instruction. It is processed by the MASM assembler during assembly of the source program.

Again, the difference between directives and pseudo-instructions

This title seems simple, but I didn't understand it all at once. Let's take a record here.

Instructions: Each instruction statement generates instruction code (i.e., object code) that can be executed by the computer when assembling the source program. Therefore, this statement is also called an executable statement. Each instruction statement represents a basic capability of the CPU, such as data transmission, addition or subtraction of two numbers, shifting, etc., and this capability is completed when the target program is run and is implemented by relying on interface devices such as CPU, memory, IO, etc.

Pseudo-instruction: As the name suggests, it is not a real instruction, that is, it is not a final instruction. It is used to instruct the assembler how to assemble the source program. Therefore, this kind of statement is also called a command statement. For example, a pseudo-instruction tells the assembler how to segment the source program, which logical segments are in the program segment, which are the current segments, etc. These command functions of the pseudo-instruction statement are completed by the assembler when assembling the source program, by executing another program, rather than being implemented when running the target program.

So why do you need to have pseudo-instructions instead of using them directly? The reason is to achieve more advanced features.

Summary: Instructions control the operation of machine code during program runs and are the basis for CPU execution. Programming, compiling and execution are all valid.

The pseudo-instructions do not directly control the machine at the runtime, but control how the translation program generates machine instruction code, that is, only for compilation services. After compilation is completed, the function of the pseudo-instructions disappears.

Summarize

The above is the difference between assembly language pseudo-instructions and assembly instructions that the editor introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!
If you think this article is helpful to you, please reprint it. Please indicate the source, thank you!