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

我的博客

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

[2011-10-21 15:22] 第十章检测点

检测点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
        retf
code ends
end start

检测点10.2
下面的程序执行后,ax中的数值为多少?
内存地址    机器码   汇编指令
1000:0     b8 00 00 mov ax,0
1000:3     e8 01 00 call s
1000:6     40       inc ax
1000:7     58       s:pop ax
ax=6

检测点10.3
下面的程序执行后,ax中的数值为多少?
内存地址
内存地址   机器码   汇编指令
1000:0   b8 00 00   mov ax,0
1000:3   9a 09 00 00 10  call far ptr s
1000:8   40         inc ax
1000:9   58      s: pop ax
                     add ax,ax
                     pop bx
                     add ax,bx
ax=1010h

检测点10.4
下面的程序执行后,ax中的数值为多少?
内存地址   机器码   汇编指令
1000:0   b8 06 00   mov ax,6
1000:2   ff d0      call ax
1000:5   40         inc ax
1000:6              mov bp,sp
                     add ax,[bp]
ax=0bh

检测点10.5
(1)下面的程序执行后,ax中的数值为多少?
assume cs:code
stack segment
dw 8 dup (0)
stack ends
code segment
start:        mov ax,stack
        mov ss,ax
        mov sp,16
        mov ds,ax
        mov ax,0
call word ptr ds:[0eh]
        inc ax
        inc ax
        inc ax
        mov ax,4c00h
        int 21h
code ends
end start

ax=3
(call后,讲后面一句的段地址和ip压入了栈中,所以跳到的就是后一句。)

(2)下面的程序执行后,ax和bx中的数值是多少?
assume cs:code
data segment
dw 8 dup (0)
data ends
code segment
start:        mov ax,data
        mov ss,ax
        mov sp,16
        mov ds,ax
        mov ax,0
        mov word ptr ss:[0],offset s
        mov ss:[2],cs        
        call dword ptr ss:[0]
        nop
s:        mov ax,offset s
        sub ax,ss:[0ch]
        mov bx,cs
        sub bx,ss:[0eh]
        
        mov ax,4c00h
        int 21h
code ends
end start

ax=1,bx=0。
评论次数(0)  |  浏览次数(391)  |  类型(汇编作业) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码