process_cmdline proc near
;points DS:DX to the supplied filename

        mov ah,51h
        int 21h

        push ds
        mov ds,bx



        mov bx,80h
        mov si,bx
        add bl,byte ptr [si]
        inc bl
        mov byte ptr[bx],0             ;zero terminate

        mov si,81h
nospace:
        lodsb
        cmp al," "
        jz nospace

        dec si
        mov dx,si
        call    save_filename
        pop ds

        ret
process_cmdline endp

save_filename proc near

        push    es
        push    cs
        pop     es

        lea     di, fname

copychars:
        lodsb
        stosb
        cmp     al, 0
        jnz     copychars

        pop     es
        ret
save_filename endp

