push ds push es cs:move.w PSPSegment, ds ;Set the DS. cs:move.w CodeSegment, es ;Set the ES. *-+-* move.w #$81, si ;Where to get the data from. move.w #Filename, di ;Where to store the filename. eor.b ah, ah ;Set that no arguements processed. bra.s _Arg_Loop ;Start the fetch. _Loop_Start: inc.b ah ;Set that an arguement processed. stos.b ;Store the byte. _Arg_Loop: lods.b ;Get the next byte. cmp.b #$D, al ;Check for carriage return. beq.s _Arg_Done ;Yes, end of the line. cmp.b #$20, al ;Is it a space? bne.s _Loop_Start ;Yes, so skip it. or.b ah, ah ;An arguement processed already? beq.s _Arg_Loop ;No, so skip leading blanks. *-+-* _Arg_Done: cs:move.w #$0024, 1(di) ;Terminate the filename string. move.w #Arguements+2, di ;Where to store the arguements. move.w #$2000, cx ;Set the count to zero. lea -1(si), si ;Move back one. _Copy_Arg: movs.b ;Copy the byte across. ds:cmp.b #$D, -1(si) ;Are we at the end of the line? beq.s _Exit_Arg ;Yes, so quit all this. inc.b cl ;Add 1 to the count. bra.s _Copy_Arg ;Get the next byte. _Exit_Arg: cs:move.w cx, Arguements ;Save the count. cs:move.w #Arguements, CmdLine ; cs:move.w cs, CmdLine+2 ; *-+-* pop es pop ds rts *****************************************************************************