
;--------------------------------------------------
dseg	segment
	maxlen	db  16
	actlen	db  ?
	names	db  16 dup(' ')
	mess1	db  'WELCOME  '
	mess2	db  16 dup(' ')
	crlf	db  0dh,0ah,'$'
dseg	ends
;--------------------------------------------------
cseg	segment
main	proc	far
	assume	cs:cseg, ds:dseg, es:dseg
	push	ds	    ;set up stack for return
	sub	ax,ax
	push	ax
	mov	ax,dseg	    ;set DS,ES to dseg
	mov	ds,ax
	mov	es,ax
	cld
begin:	mov	cx,16	    ;initialize output
	mov	al,20h	    ;  buffer
	lea	di,mess2
	rep	stosb
	lea	dx,maxlen
	mov	ah,0ah	    ;input name
	int	21h

	mov	ah,7	    ;input any key
	int	21h	    ;  not echo
	cmp	al,3	    ;ctrl_c,exit
	je	exit
display:
        mov	ch,0
        mov	cl,actlen   ;move name to
	lea	si,names    ; output buffer
	lea	di,mess2
	rep	movsb

	mov	ah,09h	    ;display message
	lea	dx,mess1
	int	21h
exit:	ret
main	endp
cseg	ends
;--------------------------------------------------
	end	main
  
