;---------------------------------------------------------- ; PP.COM is a "front end" for PIP.COM 3.0 which allows the ; use of the du: disk/user form to specify the source and ; destination files for PIP. PP's syntax is identical to ; PIP's except that a du: format is permitted wherever ; a d: format would normally be allowed. PP converts the ; du: spec to a d: spec, adds the appropriate G parameter ; to specify the user area and then chains to PIP. PP ; uses BDOS function 47 and, as such, may only be used ; under CP/M 3.0. ; ; R. Saeks, 2/1/86 ;---------------------------------------------------------- ; ; Added ',' as an end of filename delimiter to permit use ; of PIP's file concatenation feature. R. Saeks - 2/2/86 ; bdos equ 5h ;bdos entry point chain equ 2fh ;chain program function call pptail equ 81h ;location of pp cmd line tail defdma equ 80h ;default dma buffer org 100h start: lxi d,piptail ;beginning of pip cmd line tail lxi h,pptail ;beginning of pp cmd line tail next: mov a,m ;next char from pp tail cpi 0 ;check if end of pptail jz finish cpi ':' ;check for d: or du: form cz dordu stax d ;move byte to pip tail inx d ;increment pointers inx h jmp next ;process next byte finish: stax d ;end of cmd tail delimiter lxi h,pipbuf ;move pipbuf to default dma buf lxi d,defdma movlp: mov a,m ;get and transfer byte stax d cpi 0 ;check if end of pip tail jz chnpgm ;chain if end inx h ;increment pointers inx d jmp movlp ;continue move chnpgm: mvi c,chain ;chain to pip 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 pip tail inx h inx h ;points to colon in pp tail mvi a,':' ;restore colon in reg a fnden: stax d ;store byte in pip tail inx h ;set pointers for next byte inx d mov a,m ;get next byte cpi ' ' ;check if end of filename jz nopar ;delimiters are ' ', '=', ',' cpi '=' ;and 0h if no pip params are jz nopar ;specified and ']' if pip params cpi 0 ;are specified. jz nopar cpi ',' jz nopar cpi ']' jnz fnden ;fall thru if filename has params param: mvi a,'G' ;G for go/get user # stax d inx d lda usrhi cpi 0 ;skip if one digit user # jz param1 stax d inx d mvi a,0 ;reset usrhi sta usrhi param1: lda usrlow ;load one digit user # stax d jmp delim ;insert delimiter and return nopar: mvi a,'[' ;opening bracket for pip param stax d inx d mvi a,'G' ;G for go/get user # stax d inx d lda usrhi cpi 0 ;skip if one digit user # jz nopar1 stax d inx d mvi a,0 ;reset usrhi sta usrhi nopar1: lda usrlow ;load one digit user # stax d inx d mvi a,']' ;closing bracket for pip 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 usrhi: db 0 ;two digit user # flag usrlow: ds 1 pipbuf: db 'PIP' piptail: ds 125 end