|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
求解?栈定义空间中,2字节的栈和16字节的栈,为什么16字节的栈定义可以运行,而2字节的栈空间运行到push时就退出程序了?[/fo- assume cs:code,ss:stack,ds:data ;问题7.9 将datasg段中每个单词前4个字母改为大写字母。
-
- data segment
- db '1. display '
- db '2. brows '
- db '3. replace '
- db '4. modify '
- data ends
- stack segment
- dw 0,0,0,0,0,0,0,0
- stack ends
- code segment
- start: mov ax,data
- mov ds,ax
- mov ax,stack
- mov ss,ax
- mov sp,16
-
- mov bx,0
- mov cx,4
- s0: push cx
- mov cx,4
- s: mov al,[bx+3]
- and al,11011111b
- mov [bx+3],al
- inc bx
- loop s
-
- add bx,16
- pop cx
- loop s0
-
- mov ax,4c00h
- int 21h
-
- code ends
- end start
复制代码 nt]
栈太小了中debug的时候可能出现问题,因为单步中断时会把flags,cs,ip压栈
而你的栈空间太小,可能会覆盖掉有用的数据
|
|