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

我的博客

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

[2009-06-01 21:09] 检测点10.1-10.5

检测点10.1  
补全程序,实现从内存1000:0000处开始执行指令  
 assume cs:code  
 stack segment  
  db 16 dup (0)  
 stack ends  
 code segment  
 start:mov ax,stack  
       mov ss,ax  
       mov,sp,16  
       mov ax,1000  
       push ax  
       mov ax,0  
       push ax  
       reft f  
 code ends  
 end start  
分析:Mov ax,1000h:把段地址压入栈  
Mov ax,[0]  :把偏移地址压入栈  

检测点10.2  
程序执行后,AX中的数值为多少  

ax 的值为6;  
分析:call s,push ip  ip的值为6,也就是把6压入栈中,然后jmp near prt s 转到标号处执行,  
 即s:pop ax  也就是pop ip 所以ip 的值是6;  

检测点10.3  
程序执行后,AX中的数值  

Ax的值为1010h   
分析:call far ptr s,就push cs ,push ip 即push 1000h,push 0008h  
      然后jmp far ptr s ,然后pop ax ,即pop 000h,add ax,ax 即ax=0008*0008=10h  
      Pop bx 即pop 1000h ,add ax,bx 即ax=ax+bx=1000h*10h=1010h;  
检测点10.4  
程序执行后,AX中的数值  
Ax的值为:000BH  
分析: mov ax,6,则ax为6  
       Call ax则push ip 即push 0005h,在jmp 16位寄存器;在执行  
       Mov bp,sp 则bp=0005h  
       继续执行add ax,[bp],则ax=ax+[bp]=0006+0005=000B;  

检测点10.5  
程序执行后,AX中的数值  
(1)  
   Ax的值为3;  
 分析;  
  当执行call word ptr ds:[0EH],则push ds:[0EH]处的内容  
   再执行3 次inc ax ,则ax 为3;
(2)  
程序执行后,AX.BX中的数值  
Ax 的值为1,bx 的值为0;  
   分析:当执行mov word ptr ss:[0],offset s(是获得s处的偏移地址给ss:[0]这个字空间)  
当执行call dword ptr ss:[0]则push cs,push ip ,在此之前,0E 空间存放offset s 处的偏移址,0C空间存入着CS ,sub ax,ss:[0ch]后,则AX=AX-call dword ptr ss:[0]即ax=offset s- call dword ptr ss:[0],则ax=1,同理bx=0;
评论次数(2)  |  浏览次数(661)  |  类型(汇编作业) |  收藏此文  | 

[  tomato   发表于  2009-06-02 07:57  ]

很不错啊,完全正确。

[  游客   发表于  2012-09-27 10:58  ]

10.4解释有误,误导我都搞不清楚了,后来琢磨了很久才弄明白。应该是(bp)=0005h;

 
 请输入验证码  (提示:点击验证码输入框,以获取验证码