主题:大哥大姐们看看这是什么原因
代码编绎能通过,但每次连接就出现下面这些:
Microsoft (R) Overlay Linker Version 3.65
Copyright (C) Microsoft Corp 1983-1988. All rights reserved.
Run File [TELIST.EXE]:
List File [NUL.MAP]:
Libraries [.LIB]:
LINK : warning L4021: no stack segment
TELIST.OBJ(telist.asm) : fatal error L1103: attempt to access data outside segme
nt bounds
pos: 1BC Record type: 4B1A
什么意思啊!
代码如下:
data segment
inbuf label byte
maxlen db 20
len db ?
buffer db 20 dup(' ')
outname db 20 dup(' '),'$'
outphone db 8 dup(' '),'$'
msg1 db 'input name:$'
msg2 db 'input a telephone number:$'
form db 'name',16 dup(20h),'tel','$'
data ends
;data segment ends
code segment
begin proc far ;inital
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov es,ax
mov ah,09h ;get name
lea dx,msg1
int 21h
call input_name
mov ah,09h ;get phone number
lea dx,msg2
int 21h
call inphone
call printline
mov ax,4c00h
int 21h
begin endp
getchar proc near ;get the string input
mov ah,0ah
lea dx,inbuf
int 21h
ret
getchar endp
input_name proc near ;store name
call getchar
mov cx,20
cld
lea si,buffer
lea di,outname
rep movsb
ret
input_name endp
inphone proc near ;store phonenum
call getchar
mov cx,8
cld
lea si,buffer
lea di,outphone
rep movsb
ret
inphone endp
printline proc near ;show the name and phonenum
mov ah,09h
lea dx,form
int 21h
mov dl,0dh ;change the line
mov ah,2
int 21h
mov dl,0ah
int 21h
mov ah,09h
lea dx,outname
int 21h
mov ah,09h
lea dx,outphone
int 21h
ret
printline endp
end start
帮到看哈子,感谢不尽!!
Microsoft (R) Overlay Linker Version 3.65
Copyright (C) Microsoft Corp 1983-1988. All rights reserved.
Run File [TELIST.EXE]:
List File [NUL.MAP]:
Libraries [.LIB]:
LINK : warning L4021: no stack segment
TELIST.OBJ(telist.asm) : fatal error L1103: attempt to access data outside segme
nt bounds
pos: 1BC Record type: 4B1A
什么意思啊!
代码如下:
data segment
inbuf label byte
maxlen db 20
len db ?
buffer db 20 dup(' ')
outname db 20 dup(' '),'$'
outphone db 8 dup(' '),'$'
msg1 db 'input name:$'
msg2 db 'input a telephone number:$'
form db 'name',16 dup(20h),'tel','$'
data ends
;data segment ends
code segment
begin proc far ;inital
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov es,ax
mov ah,09h ;get name
lea dx,msg1
int 21h
call input_name
mov ah,09h ;get phone number
lea dx,msg2
int 21h
call inphone
call printline
mov ax,4c00h
int 21h
begin endp
getchar proc near ;get the string input
mov ah,0ah
lea dx,inbuf
int 21h
ret
getchar endp
input_name proc near ;store name
call getchar
mov cx,20
cld
lea si,buffer
lea di,outname
rep movsb
ret
input_name endp
inphone proc near ;store phonenum
call getchar
mov cx,8
cld
lea si,buffer
lea di,outphone
rep movsb
ret
inphone endp
printline proc near ;show the name and phonenum
mov ah,09h
lea dx,form
int 21h
mov dl,0dh ;change the line
mov ah,2
int 21h
mov dl,0ah
int 21h
mov ah,09h
lea dx,outname
int 21h
mov ah,09h
lea dx,outphone
int 21h
ret
printline endp
end start
帮到看哈子,感谢不尽!!