The process of an assembly program from writing to execution

The process of a program from writing to execution

 

The first step: writing a program

Use a text editor (any text editor is fine, just change the file suffix to .asm), and write the source program in assembly language (the file format is XX.asm)

Step 2: Compile and link the source program

① Use the assembly compiler (masm.exe) to compile the source program in the source file to generate the target file (the file format is XX.obj)

②Use the linker (link.exe) to link the target file to generate an executable file (XX.exe)

Forced insertion:

The executable file contains two parts:

Program (translated from the source over the assembly instruction opcode) and data (data defined in the source program)

Related description information (such as how big the program is, how much memory space it takes, etc.)

Step 3: Execute the program in the executable file

According to the information described in the executable file, the operating system loads the machine code and data in the executable file into the memory and performs related initialization (such as

Set CS:IP to point to the first instruction to be executed) and then execute the program by the CPU

 

In addition: share all relevant documents needed for learning assembly, link https://download.csdn.net/download/m0_51461907/14913664 , including

Compiler (masm.exe), linker (link.exe), debugger (debug.exe), DOSBOX installation package, GVIM installation package

(The three programs masm.exe, link.exe, and debug.exe cannot be run directly in windous10\7, because the system is not compatible, so they must be in DOSBOX

Simulate DOS system operation)

                                                                

Guess you like

Origin blog.csdn.net/m0_51461907/article/details/113004837