这两个问题然道就没人回答么
本帖最后由 Pino 于 2011-6-14 23:10 编辑assume cs: code, ds: data, ss: stack
data segment
dw 0123h, 0456h, 0789h, 0abch, 0defh, 0fedh, 0cbah, 0987h
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:
push ds:
pop ds:
pop ds:
mov ax, 4c00h
int 21h
code ends
end start这是实验5的代码。
第一个问题:这段代码有定义了栈段,为什么masm提示没有栈段
Microsoft (R) Macro Assembler Version 6.15.8803
Patched for you by promethee in the year 2001 - enjoy
Copyright (C) Microsoft Corp 1981-2000.All rights reserved.
Assembling: 3.asm
Microsoft (R) Segmented Executable LinkerVersion 5.60.339 Dec5 1994
Copyright (C) Microsoft Corp 1984-1993.All rights reserved.
Object Modules [.obj]: 3.obj
Run File : "3.exe"
List File : NUL
Libraries [.lib]:
Definitions File :
LINK : warning L4021: no stack segment
第二个问题是DS的值和CS的值。根据之前学的知识,CS之前有个PSP,所以他们的值差256个字节,也就是100H,可是用了DEBUG发现他们差120H。那20H是怎么出来的我很不能理解,谁能帮我解释一下?
stack segment stack
ds ss也要占空间的
谢谢上面朋友的问答。:loveliness:
页:
[1]