⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 55.asm

📁 电话本功能
💻 ASM
字号:
data segment 
	bufname db 40,?,38 dup (0),13,10,'$'
	buftab db 20,?,20 dup (0)
	hello1 db 13,10,'please input the name:$'
	hello2 db 13,10,'please input a telephone number:$'
	hello3 db 13,10,'[(i..input data)\\(f..findtele)\\(e..exit)]',13,10,'$'
	helld db 13,10,'name     	telephone',13,10,'$'
	tbover db 13,10,'table already over',13,10,'$'
	tbtop db ?
	tbnum  db ?
	table db 50 dup(20 dup(0),8 dup(0))
data ends

prog segment

main proc far
	assume cs:prog,ds:data,es:data
start:
	push ds
	mov ax,0
	push ax
	mov ax,data
	mov ds,ax
	mov es,ax
	mov tbtop,0
begin:
	lea dx,hello3
	mov ah,9
	int 21h
	mov ah,1
	int 21h
	cmp al,'i'
	jnz disp
input:
	mov al,tbtop
	cmp al,50
	jnc tabov
	call inname
	call intele
	call store
	jmp short begin
disp:
	cmp al,'f'
	jnz next
	call inname
	call find
	jmp short begin
next:
	cmp al,'e'
	jz exit
	jmp short begin
exit:
	ret
tabov:
	lea dx,tbover
	mov ah,9
	int 21h
	jmp short begin
main endp
;=============================
inname proc near
	push dx
	lea dx,hello1
	mov ah,9
	int 21h
	lea dx,bufname 
	mov ah,10
	int 21h
	pop dx
	ret
inname endp
;==============================
intele proc near
	push dx
	lea dx,hello2
	mov ah,9
	int 21h
	lea dx,buftab
	mov ah,10
	int 21h
	pop dx
	ret
intele endp

store proc near
	push cx
	push si
	push di
	mov ah,tbtop
	mov al,28
	mul ah
	lea di,table
	add di,ax
	push di
	lea si,bufname+2
	mov cl,bufname+1
	mov ch,0
	rep movsb
	pop di
	add di,20
	lea si,buftab+2
	mov cl,buftab+1
	mov ch,0
	rep movsb
	inc tbtop
	pop di
	pop si
	pop cx
	ret
store endp
;=========================
find proc near
	push bx
	push cx
	push si
	push di
	mov al,tbtop
	mov tbnum,al
	lea si,table
	mov bx,si
	cld
finds:
	lea di,bufname+2
	mov si,bx
	mov cl,bufname+1
	mov ch,0
	repz cmpsb
	jz finde
finde:
	lea dx,helld
	mov ah,9
	int 21h
	mov si,bx
	lea di,bufname+2
	mov cx,28
	rep movsb
	lea dx,bufname+2
	mov ah,9
	int 21h
findx:
	pop di
	pop si
	pop cx
	pop bx
	ret
find endp
	prog ends
	end main	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -