汇编网首页登录博客注册
nbfengyi的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
学习动态
最新留言
文章收藏
友情链接

[2011-10-20 22:23] 实验八

分析下面的程序,在运行前考虑:这个程序能正确返回吗?运行后在思考:为什么是这种结果。

assume cs:code
code segment
        mov ax,4c00h
        int 21h
start:        mov ax,0
s:        nop 
        nop

        mov di,offset s          ;取得s的偏移地址
        mov si,offset s2  ;取得s2的偏移地址
        mov ax,cs:[si]        
        mov cs:[di],ax    ;将s2处的两字节复制到s处
s0:        jmp short s
s1:        mov ax,0
        int21h        
        mov ax,0
s2:        jmp short s1
        nop
code ends
end start

第一次执行jmp short s后,程序到s:处。用debug发现jmp short s1是2字节,也就是把这句复制到了s:处。debug 发现转移的距离也是刚好到code第一句的地方,刚好返回
评论次数(0)  |  浏览次数(384)  |  类型(汇编作业) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码