检测点10.5

检测点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


(2)下面的程序执行后,ax和bx中的数值为多少?

assume cs:codesg

stack segment

    dw 8 dup(0)

stack ends

codesg segment

start:

    mov ax,stack

    mov ss,ax

    mov sp,10h

    mov word ptr ss:[0],offset s ;(ss:[0])=1ah

    mov ss:[2],cs                ;(ss:[2])=cs

    call dword ptr ss:[0]        ;cs入栈,ip=19h入栈,转到cs:1ah处执行指令

                                 ;(ss:[4])=cs,(ss:[6])=ip

    nop

s:  mov ax,offset s              ;ax=1ah

    sub ax,ss:[0ch]              ;ax=1ah-(ss:[0ch])=1ah-19h=1

    mov bx,cs                    ;bx=cs=0c5bh

    sub bx,ss:[0eh]              ;bx=cs-cs=0

    mov ax,4c00h

    int 21h

codesg ends

end start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值