H$$Y 发表于 2011-12-11 13:29:22

王爽的那本上面的实验五

希望版主讲解一下王爽那本的实验五

api 发表于 2011-12-11 18:31:08

你要问什么,敲上来看看啊

H$$Y 发表于 2011-12-11 19:07:24

assum cs: code,ds:data,ss:stack
data segment
    dw 0123h,0456h,0789h,0abch,0fedh,0cbah,0987h
data edns
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,date
       mov ds,ax
       push ds:
       push ds:
       pop ds:
       pop ds:
      
       mov ax 4c00h
       int 21h
code ends
end start
    程序加载后,code段的段地址为X,则data段的段地址为?stack段的段地址为?这个怎么分析

api 发表于 2011-12-11 20:25:23

data的段地址是x-2    ////data定义了8个字型数据,开辟8个字的内存空间来存放数据,如果data定义了
                           ////16个字型数据,就是x-3.楼主用debug自己去调试看就知道;
stack的段地址是x-1////同上;

H$$Y 发表于 2011-12-12 13:01:41

assume cs:code,ds:data,ss:stack
code segment
start:mov ax,stack
       mov ss,ax
       mov sp,16
      
       mov ax,data
       mov ds,ax
      
       push ds:
       push ds:
       pop ds:
       pop ds:
      
       mov ax,4c00
       int 21h
code ends

data segment
   dw 0123h,0456h
data ends

stack segment
      dw 0,0
stack ends

end start
程序加载后,code段的段地址为X,则data段的段地址为?stack段的段地址为?这个怎么分析,这个又是什么情况呢
页: [1]
查看完整版本: 王爽的那本上面的实验五