汇编程序30:检测点10.4

 1 assume cs:code
 2 //推断程序结束后ax的值,使用call reg指令
 3 code segment
 4     start:
 5           mov ax,6
 6           call ax //将IP=5压栈,随后修改IP=ax=6并跳到新CS:IP处
 7           inc ax 
 8           mov bp,sp //将栈的偏移SP赋给BP,此时SP默认为FFFE,即存在备用栈
 9           add ax,[bp] //把栈偏移为BP的数据,这里即为之前压栈的IP=5,所以ax=ax+IP=11(B)
10     mov ax,4c00h
11     int 21h
12 code ends
13 
14 end start

 

posted on 2018-01-29 23:41  叶倾仙  阅读(193)  评论(0编辑  收藏  举报

导航