汇编语言学习笔记——————第一个程序
一个汇编语言从写出到最终执行的简要过程 大体分为以下三步: 1.编写汇编源程序 2.对源程序进行编译连接 3.执行可执行文件中的程序 第二步执行的操作是使用汇编语言编译程序对源程序文件中的源程序进行编译,产生目标文件;再用链接程序对目标文件进行连接,生成可在操作系统中直接运行的可执行文件。 第三步中,操作系统依照可执行文件中的描述信息,将可执行文件中的机器码和数据加载到内存,设置CS:IP指向第一条要执行的指令,然后由CPU执行程序。 下图是从汇编程序从写出到执行的详细步骤。 编写 1.asm 编译MASM 1.obj 连接LINK 1.exe 加载command 内存中的程序 运行CPU 编译链接 编译 为了使得我们编写的汇编语言程序得以执行,我们必须有相应的编译器和链接器,这里我们需要下载对应的三个文件,分别是MASM.exe、LINK.exe,ML.exe三个文件,对应的百度云链接如下: 链接: https://pan.baidu.com/s/15k0PZSgvO9JrAmilZ5U4Kg . 提取码:aswr 将下载的文件统一的放到一个文件夹下,如下图所示: 将三个文件拷贝至文件夹下就可以编译链表了,编译链接操作这里采用win10命令行窗口的方法进行编译和链接。编译链接前的文件下只有三个刚拷贝进来的文件,一个.asm文件和debug.exe(下面解释)