.model small
.stack 40h
.data
name_telpar label byte
maxntlen db 30
name_tellen db ?
name_telfld db 30 dup(?)
crlf db 0dh,0ah,'$'
messg1 db 'string?','$'
messg2 db 'name tel','$'
messg4 db 'input name:','$'
messg5 db 'input a tel number:','$'
name_telctr db 0
name_teltab db 5 dup(?)
.code
begin proc far
mov ax,@data
mov ds,ax
cld
lea di, name_teltab
start:
mov ah,09
lea dx,messg4
int 21h
call input_name
mov ah,09
lea dx,messg5
int 21h
call inphone
call printline
begin endp
input_name proc near
call getchar
inc name_telctr
cld
lea si,name_telfld
mov cx,10
rep movsw
ret
input_name endp
outname proc near
mov ah,9
lea dx,name_teltab
int 21h
outname endp
inphone proc near
call getchar
inc name_telctr
cld
lea si,name_telfld+10
mov cx,4
rep movsw
ret
inphone endp
outphone proc near
mov ah,09
lea dx,name_teltab+10
int 21h
outphone endp
getchar proc near
mov ah,09
lea dx,messg1
int 21h
mov ah,0ah
lea dx,name_telpar
int 21h
mov ah,09
lea dx,crlf
int 21h
ret
getchar endp
printline proc near
mov ah,09
lea dx,messg2
int 21h
mov ah,09
lea dx,crlf
int 21h
mov ah,09
lea dx,name_teltab
int 21h
mov ah,09
lea dx,crlf
int 21h
ret
printline endp
end begin