鱼C论坛

 找回密码
 立即注册
查看: 2444|回复: 1

[汇编作业] 实验8 分析一个奇怪的程序

[复制链接]
发表于 2014-6-29 02:37:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
分析下面的程序,在运行前思考:这个程序可以正确返回吗?
  1. assume cs:codesg

  2. codesg segment

  3.         mov ax,4c00h
  4.         int 21h
  5.        
  6. start:
  7.         mov ax,0       
  8. s:
  9.         nop
  10.         nop
  11.        
  12.         mov di,offset s
  13.         mov si,offset s2
  14.         mov ax,cs:[si]
  15.         mov cs:[di],ax       
  16. s0:
  17.         jmp short s
  18. s1:
  19.         mov ax,0
  20.         int 21h
  21.         mov ax,0
  22. s2:
  23.         jmp short s1
  24.         nop       

  25. codesg ends

  26. end start
复制代码
Debug中可以发现:s-0008 s0-0016 s1-0018 s2-0020。
程序执行到mov cs:[di],ax,将s2处指令EBF6(jmp short 0018)写在s处,指令变为jmp 0000。
从而程序执行到mov ax,4c00h int 21h,结束。
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2014-6-29 10:55:34 | 显示全部楼层
楼主想问啥?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-7-12 11:50

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表