| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 578 人关注过本帖
标题:高手帮棒忙
只看楼主 加入收藏
zhi666
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-12-29
收藏
 问题点数:0 回复次数:0 
高手帮棒忙

程序出现无限循环,那位高手帮帮忙,帮我修改一下,只要循环3次就让它中断帮帮忙,发到我 的邮箱fanping2008100@sina.com 下面是我的代码:
data segment
mess1 db 13,10,"Input name :$"
mess2 db 13,10,"Input phone number :$"
outline db 13,10,10,"NAME TEL.",13,10,'$'
inbuf db 30 dup(20h)
outname db 20 dup(20h)
outphone db 20 dup(20h)
data ends
code segment
main proc far
assume cs:code,ds:data,es:data
start:
mov ax,data
mov ds,ax
mov es,ax
lop3:

mov dx,offset mess1
mov ah,09h
int 21h
call input_name

mov dx,offset mess2
mov ah,09h
int 21h
call inphone

call printline
jmp lop3
mov ax,4ch
int 21h

main endp

input_name proc near
mov bx,0
lop1:
call getchar
cmp al,13
je out1

mov inbuf[bx],al
inc bx
cmp bx,14
jl lop1
out1:

mov cx,bx
mov si,offset inbuf
mov di,offset outname
rep movsb
mov outname[14],'$'
ret
input_name endp

inphone proc near
mov bx,0
lop2:
call getchar
cmp al,13
je out2
mov inbuf[bx],al
inc bx
jmp lop2
out2:

mov cx,bx
mov si,offset inbuf
mov di,offset outphone
rep movsb
mov outphone[bx],'$'
ret
inphone endp

getchar proc near
mov ah,01h
int 21h
ret
getchar endp

printline proc near
mov dx,offset outline
mov ah,09h
int 21h
mov dx,offset outname
mov ah,09h
int 21h
mov dx,offset outphone
mov ah,09h
int 21h

ret
printline endp
code ends
end start

各位谢了!!!!!!!!!!!!!!!!!!!!!!!1

2005-12-29 10:58
快速回复:高手帮棒忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014688 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved