|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 赵璐 于 2011-12-28 22:00 编辑
今天刚学到汇编第六章的实验五
其中有一题代码如下
(程序1)
assume cs:code,ds:data,ss:stack
data segment
dw 0123h,0456h,0789h,0abch,0defh,0cbah,987h
data ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment
start: mov ax,stack
mov ss,ax
mov sp,16
mov ax,data
mov ds,ax
push ds:[0]
push ds:[2]
pop ds:[2]
pop ds:[0]
mov ax,4c00h
int 21h
怎么不直接这样
(程序2)
assume cs:code,ds:data,ss:stack
data segment
dw 0123h,0456h,0789h,0abch,0defh,0cbah,987h
data ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment
start: mov sp,16
push ds:[0]
push ds:[2]
pop ds:[2]
pop ds:[0]
mov ax,4c00h
int 21h
code ends
end start
这两种写法有什么区别我试了一下好像在当步执行时程序1和程序2的cs,ds,ss值不一样。为什么,什么造成的
求高手赐教!!!!!!!!!!!!!!!!!!!!
|
|