;**************************************************
prog_stack segment stack 'stack'
	db 64 dup('stack...')
prog_stack ends
;-------------------------------------------------
prog_data segment 'data'
inchar	db  20 dup(?)
prog_data ends
;--------------------------------------------------
prog_code segment 'code'
typ_int proc    far
	assume  cs:prog_code, ds:prog_data
	assume  ss:prog_stack,es:prog_data
	push	ds
	mov	ax,0
	push	ax
	mov	ax,prog_data
	mov	ds,ax
	mov	es,ax
	sti
	cld
	mov	ah,0	      ;Initializing printer
	mov	dx,0
	int	17h
	mov	ah,6	      ;clear screen
	mov	al,0
	mov	ch,0
	mov	cl,0
	mov	dh,24
	mov	dl,79
	mov	bh,7
	int	10h
	mov	ah,2	      ;display prompt char.
	mov	dl,10h
	int	21h
input_char:
	mov	ah,1	   ;input with echo & check
	int	21h
check_char:
	cmp	al,0	   ;if any non_ASCII code
	je	end_prog
output_char:
	mov	dl,al	      ;print a character
	mov	ah,5
	int	21h
	cmp	al,0dh	      ;check for CR
	jne	input_char
	mov	dl,0ah	      ;if CR and LF
	mov	ah,5
	int	21h
	mov	ah,2	      ;LF on screen also
	int	21h
	jmp	input_char
end_prog:
	ret
typ_int   endp
prog_code ends
;**************************************************
	  end	typ_int
