extrn .qnum, .upshft, .pfnm1 extrn .lastch, .nextch, .skipblks entry .pfnmdu, .getdu ; ; Parse the next field from the command line (de^) into fcb hl^. Any ; drive/user specifications are recorded in c and b respectively, ; (which default to 0s), with drive recorded in the FCB. Name and ; type are parsed into fname and ftype, with any '*'s expanded into ; '?'s, and the fields are blank padded. At exit de points to the ; field terminating delimiter char., (a) is the count of '?' chars. ; in fname & ftype fields, with flags set on it, bc as above. ; ; NOTE that 0 means default user, and a specified user is returned ; as user no. + 1, i.e. the identical convention to that for drives. ; This also allows the user specification to be stored in a 5 or 6 ; bit field, depending on whether the max user is 15 or 31. ; a,f,b,c,d,e,h,l .pfnmdu: call .skipblks; skip any leading blanks call .getdu; c := user, b := drv mov m,c; set fcbdrv, set up for ldfld call .lastch cpi ':' cz .nextch; Absorb any du terminating ':' jmp .pfnm1 ; ; .getdu returns any "du" spec. in b and c, with b = user, c = drv ; The default user is signified by a -1 value, default drive by 0 ; At entry, de points to the start of the field to be parsed. At ; exit, either de is unchanged (no du found), or points to ':'. ; ; NOTE that the user convention here is different from that used ; in the remainder of the system. Convert by incrementing. ; a,f,b,c,d,e .getdu: lxi b,0ff00h; set defaults push d; save for pre-scan exit ldax d call .upshft; 2.1 - No ':' abort here call .qnum jnc getdu1; 1st char digit, no d cpi '@' jc getdu2; < '@', no du spec cpi 'Z'+1; allowing XYZ as device specs. cmc jc getdu2; > Z, no du spec inx d ldax d cpi ':' jz getdu2; d spec only call .qnum jc getdu2; no 'du' spec getdu1: inx d ldax d cpi ':' jz getdu2; du spec found call .qnum jc getdu2; no du spec inx d ldax d cpi ':' getdu2: pop d; restore entry scan pointer rnz; not terminal ':', no du spec rc; or exit from above tests, no du ; " " ; prescan found a valid du format, now load it call .lastch call .qnum jnc getdu4; digit, no d portion sui '@' mov c,a; save d portion call .nextch getdu4: cpi ':' rz; no 'u' portion ani 0fh mov b,a call .nextch rz; ':', 1 digit only ani 0fh push psw add a add a add b; 5* add a; 10* mov b,a pop psw add b mov b,a; result jmp .nextch; and advance to the (known) ':'