;---------------------------------------------------------- ; DD.COM is a "front end" for D.COM (renamed DDD.COM ; to circumvent CP/M+ CCP bug) which allows the ; use of the du: disk/user form to select files for D. ; DD's syntax is identical to D's except that a ; du: format is permitted when specifing files where ; a d: format would normally be allowed. DD converts the ; du: spec to a d: spec, adds the appropriate G parameter ; to specify the user area and then chains to D. DD ; uses BDOS function 47 and, as such, may only be used ; under CP/M 3.0. ; ; R. Saeks, 2/2/86 ;---------------------------------------------------------- ; ; bdos equ 5h ;bdos entry point chain equ 2fh ;chain program function call ddtail equ 81h ;location of dd cmd line tail defdma equ 80h ;default dma buffer org 100h start: lxi d,dddtail ;beginning of d cmd line tail lxi h,ddtail ;beginning of dd cmd line tail next: mov a,m ;next char from dd tail cpi 0 ;check if end of ddtail jz finish cpi ':' ;check for d: or du: form cz dordu stax d ;move byte to d tail inx d ;increment pointers inx h jmp next ;process next byte finish: stax d ;end of cmd tail delimiter lxi h,dddbuf ;move dddbuf to default dma buf lxi d,defdma movlp: mov a,m ;get and transfer byte stax d cpi 0 ;check if end of d tail jz chnpgm ;chain if end inx h ;increment pointers inx d jmp movlp ;continue move chnpgm: mvi c,chain ;chain to d jmp bdos dordu: dcx h ;points to byte before colon mov a,m ;byte before colon in reg a cpi 30h ;check if less than '0' jc nousr cpi 40h ;check if greater than '9' jnc nousr sta usrlow ;store least sig dig of user # dcx h mov a,m ;check for 2 dig user # cpi 31h ;check if less than '0' jnz user sta usrhi ;store two digit user # flag dcx d user: dcx d ;points to colon in d tail inx h inx h ;points to colon in dd tail mvi a,':' ;restore colon in reg a fnden: stax d ;store byte in d tail inx h ;set pointers for next byte inx d mov a,m ;get next byte cpi 0 ;no d params after filename jz nopar cpi ']' ;d params after filename jnz fnden ;fall thru if filename has params param: mvi a,',' ;comma for additional param call inusr ;insert USER= jmp delim ;insert delimiter and return nopar: mvi a,'[' ;opening bracket for d param call inusr ;insert USER=# inx d mvi a,']' ;closing bracket for d param stax d delim: inx d ;point to end of file delimiter mov a,m ;get end of file delimiter ret ;return to normal processing nousr: inx h ;points to colon mvi a,':' ;restore ret inusr: stax d ;inserts G# in d cmd tail inx d mvi a,'G' ;insert 'G' in tail stax d inx d lda usrhi cpi 0 ;skip if one digit user # jz onedig stax d inx d mvi a,0 ;reset usrhi sta usrhi onedig: lda usrlow ;load one digit user # stax d ret usrhi: db 0 ;two digit user # flag usrlow: ds 1 dddbuf: db 'DDD' dddtail: ds 125 end