王爽汇编第四章,第一个程序

王爽汇编第四章,第一个程序

汇编程序从写出到执行的过程

在这里插入图片描述

;1.asm
assume cs:code ;代码段code和cs关联

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;代码段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
code segment ;code是标号,最终会被编译成段地址
;程序入口
start: 
       mov ax,0123h
       mov bx,0456h
       add ax,bx
       add ax,ax
       
       ;返回到DOS
       mov ax,4c00h
       int 21h
code ends
;程序结束
end start
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

编译过程:编译->连接->生成1.exe

image-20210916085646696

image-20210916085811678

程序执行过程的跟踪分析

首先看下图,DOS系统中.EXE文件加载如下,注意和Windows的.EXE有区别。

在这里插入图片描述

debug进行跟踪分析

image-20210916090308172

image-20210916090514422

image-20210916090610399

文献参考:
https://blog.csdn.net/qq_39654127/article/details/88698911

posted @ 2021-07-26 09:09  VxerLee昵称已被使用  阅读(55)  评论(0编辑  收藏  举报