![]() |
#2
zaixuexi2011-12-01 16:19
|

assume cs:cde,ds:dta,ss:stk
dta segment
dw 0123h,0456h,0789h,0987h,0abch,0fedh,0edfh,0defh
dta ends
stk segment
dw 0,0,0,0,0,0,0,0
stk ends
cde segment
start:mov ax,stk
mov ss,ax
mov sp,16
mov ax,dta
mov ds,ax
push ds:[0]
push ds:[2]
pop ds:[2]
pop ds:[0]
mov ax,4c00h
int 21h
cde ends
end start
dta segment
dw 0123h,0456h,0789h,0987h,0abch,0fedh,0edfh,0defh
dta ends
stk segment
dw 0,0,0,0,0,0,0,0
stk ends
cde segment
start:mov ax,stk
mov ss,ax
mov sp,16
mov ax,dta
mov ds,ax
push ds:[0]
push ds:[2]
pop ds:[2]
pop ds:[0]
mov ax,4c00h
int 21h
cde ends
end start
设程序加载后,code段的段地址是X,则data段的段地址是______
stack段的段地址是______
网上有答案说是X-2,X-1
不能理解,求解释
PS.这是我想的:data段地址应该放在ds之中的,
栈段地址应该放在ss之中,
代码段在cs之中。
我用debug加载后是这样的:
ds:15C8
SS: 15D8
CS: 15DA
如果cs为X的话,那么data段地址就是X-13,stack段地址就是X-3,不知道对不?
[ 本帖最后由 haolly 于 2011-12-1 20:43 编辑 ]