home *** CD-ROM | disk | FTP | other *** search
- ; PIP Patch to add (R)eset Disks and (Q)uick Repeat function
- ;
- ; LIFELINES, Vol III, Number 3 Page 15
- ; Patching PIP for multiple file transfers-Kelly Smith
- ;
- ;
- ; A>ddt pip.com<cr> invoke DDT to load memory with PIP.COM
- ; DDT VERS 2.2 DDT telling us that PIP.COM
- ; NEXT PC uses 29 pages of memory
- ; 1E00 0100
- ; -irpip.hex<cr> input the patch file rpip.hex
- ; -r<cr> read it to memory(overlaying parts of PIP)
- ; NEXT PC
- ; 1E00 0100 DDT telling us again
- ; -^C Control C to exit DDT
- ; A>save 29 rpip.com<cr> save 29 pages of memory as RPIP.COM
- ;
- ;
- ; You now have two new PIP commands
- ;
- ; *r<cr> which allows you to insert different disk(s) in any drive
- ; and continue PIPing(may be different formats from previous)
- ;
- ; *q which resets disk drives as above, and also repeats last
- ; commands(great for B:=A:*.*-just keep changing source and
- destination disks)
- ;
- ;
- bdos equ 05h ; bdos entry address
- fcb equ 5ch ; default file control block address
- dfcb equ 080h ; default disk/command buffer
- ;
- pmessg equ 9 ; print message function
- rdcbuf equ 10 ; read console buffer function
- rsetdsk equ 13 ; reset disk system function
- ;
- start$pip equ 04ceh ; normal start of PIP
- con$buff equ 1ecbh ; pip's internal console buffer
- pip$cr$lf equ 082eh ; pip's internal cr/lf output routine
- pip$prompt equ 053ch ; pip's command parser entry address
- pip$patch equ 096fh ; pip gets patched at this address
- ;
- lf equ 0ah ; line feed character
- cr equ 0dh ; carriage return character
- ;
- org 100h
- ;
- jmp begin ;jump over INP:/OUT: vectors and EOF
- ;
- org 010ah
- ;
- begin: lda dbuf ; filename specified?
- ora a ; zero if no filename
- lxi d,msg1 ; and sign in please
- cz prnt$messg ; print message
- jmp start$pip ; and off to pip
- ;
- added: lxi h,con$buff ; point to pip's console buffer
- mvi m,128 ; set-up for 128 character command string
- xchg ; pointer swapped to [DE] for CP/M
- mvi c,rdcbuf ; read console buffer function
- call bdos ; let CP/M do the work
- lda con$buff+1 ; check how many characters typed
- cpi 1 ; just one?
- jnz save$char$cnt ; if not, save char count and return
- lda con$buff+2 ; get single character command
- ani 05fh ; force to uppercase character
- cpi 'Q' ; repeat pip function last specified
- jnz reset$dsk$sys ; if not, check for reset disk system
- lhld char$cnt ; get character count
- shld con$buff+1 ; stuff back to console buffer
- lxi d,msg3 ; tell them repeating last process
- call prnt$messg ; print message
- lxi h,con$buff+1 ; point to last command entry in console buffer
- mov c,m ; get command length to calculate offset
- mvi b,0 ; clean high byte bias
- inx h ; bump to start of command string address
- dad b ; add bias to locate end of string
- mvi m,'$' ; tag end of command string for message
- lxi d,con$buff+2 ; point to command string for message out
- call prnt$messg ; print message
- mvi c,rsetdsk ; reset disk system function
- call bdos ; let CP/M do the work
- ret ; return
- ;
- reset$dsk$sys:
- ;
- cpi 'R' ; reset disk system?
- jnz save$char$cnt ; if not, restore chracter count and return
- lxi d,msg2 ; tell them all disk set R/W
- call prnt$messg ; print message
- mvi c,rsetdsk ; reset disk system function
- call bdos ; let CP/M do the work
- call pip$cr$lf ; do carriage return/line feed
- pop h ; clean the stack for pip restart
- jmp pip$prompt ; do pip '*' prompt and wait for command
- ;
- save$char$cnt:
- ;
- lhld con$buff+1 ; save character count + character
- shld char$cnt ; save character count
- ret ; return
- ;
- prnt$messg:
- ;
- mvi c,pmessg ; print message function
- call bdos ; let CP/M do the work
- ret ; return
- ;
- msg1 db cr,lf,'PIP 1.5 with (R)eset Disks and (Q)uick Repeat',cr,lf,'$'
- ;
- msg2 db cr,lf,'Resetting all disks to R/W$'
- ;
- msg3 db cr,lf,'Repeating: $'
- ;
- char$cnt dw 0 ; console buffer character count
- ;
- org pip$patch ; patch to get to added code goes here
- ;
- jmp added ; check for reset or repeat command
- ;
- ;
- end