'<br/>mess3 db 'please Input the telephone number
'<br/>mess4 db 0ah,0dh,'$'<br/>mess5 db 'Insert succed!$'<br/>err1 db 'there is not exsit the people!',0ah,0dh,'$'<br/>DATAS ENDS</p><p>STACKS SEGMENT<br/> db 2000 dup(?)<br/>STACKS ENDS</p><p>CODES SEGMENT<br/> ASSUME CS:CODES,DS
ATAS,SS:STACKS</p><p>main proc far<br/> mov ax,datas<br/> mov ds,ax<br/> mov es,ax <br/>n1: lea dx,menuitem <br/> mov ah,9<br/> int 21h <br/> mov ah,1<br/> int 21h<br/> cmp al,'q'<br/> jnz n2 <br/> call query<br/> jmp n1<br/>n2: cmp al,'i'<br/> jnz n3<br/> call insert<br/> jmp n1 <br/>n3: cmp al,'e'<br/> jz exit<br/> jmp n1<br/>exit:<br/> mov ah,7<br/> int 21h<br/> mov ah,4ch<br/> int 21h<br/> ret<br/>main endp</p><p>query proc near ;查找总菜单<br/> push ds<br/> xor ax,ax<br/> push ax<br/> mov ax,datas<br/> mov ds,ax<br/> mov es,ax<br/> cld<br/> lea dx,mess4<br/> mov ah,9<br/> int 21h<br/> lea dx,mess2 <br/> mov ah,9<br/> int 21h <br/> call ipname<br/> lea dx,mess4<br/> mov ah,9<br/> int 21h<br/> call search<br/> mov ah,7<br/> int 21h<br/> ret <br/>query endp</p><p>ipname proc near ;从键盘输入名字<br/> lea dx,_name<br/> mov ah,10<br/> int 21h<br/> mov bh,0<br/> mov bl,_name+1<br/> mov cx,9<br/> sub cx,bx<br/>r: <br/> mov _name[bx+2],20h ;补空格<br/> inc bx<br/> loop r<br/> ret<br/>ipname endp</p><p>search proc near <br/> lea di,buf<br/> push di<br/> mov bl,count<br/> mov bh,0<br/>l: <br/> lea si,_name+2<br/> mov cx,9<br/> repe cmpsb<br/> jz n4<br/> pop di<br/> add di,20<br/> push di<br/> dec bx<br/> jnz l<br/> lea dx,err1<br/> mov ah,9<br/> int 21h<br/> jmp n1<br/>n4:<br/> pop di<br/> mov si,di<br/> lea di,temp <br/> mov cx,20<br/> rep movsb ;将内容传给 temp<br/> lea dx,mess1<br/> mov ah,9<br/> int 21h <br/> lea dx,temp<br/> mov ah,9<br/> int 21h<br/> ret<br/>search endp</p><p>insert proc near<br/> lea dx,mess4<br/> mov ah,9<br/> int 21h<br/> lea dx,mess2<br/> mov ah,9<br/> int 21h<br/> lea dx,mess4<br/> mov ah,9<br/> int 21h<br/> call ipname<br/> lea dx,mess4<br/> mov ah,9<br/> int 21h<br/> lea dx,mess3<br/> mov ah,9<br/> int 21h<br/> call ipnumber <br/> cld<br/> mov al,20<br/> mov cl,count<br/> mul cl<br/> lea di,buf<br/> add di,ax<br/> lea si,_name+2<br/> mov cx,10<br/> rep movsb<br/> lea si,num+2<br/> mov cx,10<br/> rep movsb<br/> inc count<br/> lea dx,mess5<br/> mov ah,9<br/> int 21h<br/> lea dx,mess4<br/> mov ah,9<br/> int 21h<br/> mov ah,7<br/> int 21h<br/> ret<br/>insert endp</p><p>ipnumber proc near<br/> lea dx,num<br/> mov ah,10<br/> int 21h<br/> lea dx,mess4<br/> mov ah,9<br/> int 21h<br/> mov bh,0<br/> mov bl,num+1<br/> mov cx,10<br/> sub cx,bx<br/>c1: mov num[bx+2],20h<br/> inc bx<br/> loop c1<br/> ret<br/>ipnumber endp<br/>( b& d4 S* w4 W, @# P) o$ Q' [
140.5 KB, 下载次数: 16, 下载积分: 体力 -2 点
汇编课程设计报告.doc
| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |