sseg segment stack
db 256 dup(?)
sseg ends
dseg segment
 text db 'asqw asd asdfq afaf sdf.'
 text2 db 16 dup( )
dseg ends
cseg segment
 assume cs:cseg,ds:dseg,ss:sseg
 start proc
 push ds
 push ax
 mov bx,dseg
 mov ds,bx
 call main
 ret
 start endp
 main proc near
 mov si,0
 mov di, 0
m1: mov bh,0
begin: mov al,text[si]
  cmp al,'.'
 je point
 cmp al,' '
 je space
 mov text2[di],al
 inc bh
 inc si
 inc di
 jmp begin
space: 
inc si
cmp bh,5
 ja begin
 mov text2[di+2],'$'
 mov dx,offset text2
 mov ah,9
 int 21h
 mov di,0
 mov dl,bh
 or dl,30h
 mov ah,2
 int 21h
 mov bh,0
 mov dl,13
 mov ah,2
 int 21h
 mov dl,10
 mov ah,2
 int 21h
 mov cx,10
 mov di, 0
 q: mov text2[di], ' '
 inc di
 loop q
 mov di, 0
 jmp begin
point:
 cmp bh,5
 ja enddd
 mov text2[di+2],'$'
 mov dx,offset text2
 mov ah,9
 int 21h
 mov di,0
 mov dl,bh
 or dl,30h
 mov ah,2
 int 21h
enddd: mov ah,1
int 21h
mov ah, 4Ch
int 21h
;ret
main endp
cseg ends
end start
  
