《汇编语言》王爽 实验三

1、将下面程序保存为t1.asm文件,将其生成可执行文件t1.exe

assume cs:codesg

codesg segment
mov ax,2000H
mov ss,ax
mov sp,0
add sp,10
pop ax
pop bx
push ax
push bx
pop ax
pop bx

mov ax,4c00H
int 21H

link时出现warning:


image.png

未设栈段但是使用了栈

debug:每一步执行后寄存器和栈顶内容:


image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

查看PSP头两个字节:

1、重新加载程序


image.png

可以看到程序起始段地址为075C,该段地址即为PSP的段地址

2、查看PSP内容


image.png
image.png
image.png
image.png
image.png
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。