鱼C论坛

 找回密码
 立即注册
查看: 2328|回复: 0

[汇编作业] 监测点6.1

[复制链接]
发表于 2017-8-21 14:05:56 | 显示全部楼层 |阅读模式

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

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

x
1.用内存0:0 ~0:15内容改写程序中的数据
assume cs:codesg
  codesg segment
      dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
  start:
      mov ax,0
      mov ds,ax
      mov bx,0
   
      mov cx,8        ;置循环次数为8
   s:
      mov ax,[bx]      ;置ax中的内容为ds段偏移为bx中的内容
      mov cs:[bx],ax  ;置cs段偏移为bx中的内容为ax的内容
      add bx,2        
      loop s
   
      mov ax,4c00h
      int 21h
  codesg ends
end start


2.
assume cs:codesg
  codesg segment
      dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
      dw  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  start:
      mov ax,cs
      mov ss,ax
      mov sp,32     ;32,34,36我认为都是OK的
   
      mov ax,0
      mov ds,ax
      mov bx, 0
      mov cx,8      ;置循环次数为8
   s:
      push [bx]     ;ds段偏移为bx中的内容入栈
      pop cs:[bx]   ;将出栈的内容置于cs段偏移为bx中
      add bx,2        
      loop s
   
      mov ax,4c00h
      int 21h
  codesg ends
end start



   

cs最终状态

cs最终状态

ds初始状态

ds初始状态

cs初始状态

cs初始状态
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-26 22:54

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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