.model small
.stack
.data
string db 'sdf we sad sfaawf sd sdf frff ','$'
.code
.startup
mov bx,offset string
mov si,0
mov cx,0
next:
mov al,[bx]
cmp al,' '
je next1
push bx
sub bx,si
mov [bx],al
pop bx
jmp continue
next1:
inc si
continue:
inc cx
inc bx
cmp al,'$'
jnz next
display:
mov dx,offset string
mov ah,09h
int 21h
.exit 0
end