连接过程提示no stack segment

来源:百度知道 编辑:UC知道 时间:2024/05/25 12:56:48
程序代码是
code segment
assume cs:code
start:mov al,3eh
mov bl,al
mov dl,al
mov cl,4
shr dl,cl
cmp dl,9
jbe next1
add dl,7
next1:add dl,30h
mov ah,2
int 21h
mov dl,bl
and dl,0fh
cmp dl,9
jbe next2
add dl,7
next2:add dl,30h
mov ah,2
int 21h
code ends
end start
如果添加stack segment
stack ends 应该在哪个位置添加啊?刚接触汇编,希望大家说的详细些。

stacksegmentstack ;堆栈段
db128dup(?) ;注意这里只有128个字节
stackends

code segment
assume cs:code,ss:stack ;增加ss:stack,程序就不会有那个警告了
start:mov al,3eh
mov bl,al
mov dl,al
mov cl,4
shr dl,cl
cmp dl,9
jbe next1
add dl,7
next1:add dl,30h
mov ah,2
int 21h
mov dl,bl
and dl,0fh
cmp dl,9
jbe next2
add dl,7
next2:add dl,30h
mov ah,2
int 21h
code ends
end start