home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / rpip.lbr / RPIP.AZM / RPIP.ASM
Encoding:
Assembly Source File  |  1993-10-25  |  4.1 KB  |  123 lines

  1. ; PIP Patch to add (R)eset Disks and (Q)uick Repeat function
  2. ;
  3. ;    LIFELINES, Vol III, Number 3   Page 15
  4. ;    Patching PIP for multiple file transfers-Kelly Smith
  5. ;
  6. ;
  7. ;      A>ddt pip.com<cr>    invoke DDT to load memory with PIP.COM
  8. ;      DDT VERS 2.2            DDT telling us that PIP.COM
  9. ;      NEXT    PC        uses 29 pages of memory 
  10. ;      1E00   0100
  11. ;      -irpip.hex<cr>        input the patch file rpip.hex
  12. ;      -r<cr>            read it to memory(overlaying parts of PIP)
  13. ;      NEXT    PC        
  14. ;      1E00  0100        DDT telling us again
  15. ;      -^C            Control C to exit DDT
  16. ;      A>save 29 rpip.com<cr>     save 29 pages of memory as RPIP.COM
  17. ;
  18. ;
  19. ;        You now have two new PIP commands
  20. ;
  21. ;     *r<cr>    which allows you to insert different disk(s) in any drive
  22. ;        and continue PIPing(may be different formats from previous)
  23. ;
  24. ;     *q    which resets disk drives as above, and also repeats last
  25. ;        commands(great for B:=A:*.*-just keep changing source and
  26.         destination disks)
  27. ;
  28. ;    
  29. bdos            equ    05h    ; bdos entry address
  30. fcb            equ    5ch    ; default file control block address
  31. dfcb            equ    080h    ; default disk/command buffer
  32. ;
  33. pmessg            equ    9    ; print message function
  34. rdcbuf            equ    10    ; read console buffer function 
  35. rsetdsk            equ    13    ; reset disk system function
  36. ;
  37. start$pip    equ    04ceh    ; normal start of PIP
  38. con$buff    equ    1ecbh    ; pip's internal console buffer
  39. pip$cr$lf    equ    082eh    ; pip's internal cr/lf output routine
  40. pip$prompt    equ    053ch    ; pip's command parser entry address
  41. pip$patch    equ    096fh    ; pip gets patched at this address
  42. ;
  43. lf        equ     0ah    ; line feed character
  44. cr        equ    0dh    ; carriage return character
  45. ;
  46.     org    100h
  47. ;    
  48.     jmp    begin            ;jump over INP:/OUT: vectors and EOF
  49. ;
  50.     org     010ah
  51. ;
  52. begin:    lda    dbuf        ; filename specified?
  53.     ora    a        ; zero if no filename
  54.     lxi    d,msg1            ; and sign in please
  55.     cz     prnt$messg    ; print message
  56.     jmp    start$pip    ; and off to pip
  57. ;
  58. added:    lxi    h,con$buff    ; point to pip's console buffer
  59.     mvi     m,128        ; set-up for 128 character command string
  60.     xchg             ; pointer swapped to [DE] for CP/M
  61.     mvi    c,rdcbuf    ; read console buffer function
  62.     call    bdos        ; let CP/M do the work
  63.     lda    con$buff+1    ; check how many characters typed
  64.     cpi    1         ; just one?
  65.     jnz    save$char$cnt    ; if not, save char count and return
  66.      lda    con$buff+2    ; get single character command
  67.     ani    05fh        ; force to uppercase character
  68.     cpi    'Q'        ; repeat pip function last specified
  69.     jnz     reset$dsk$sys   ; if not, check for reset disk system
  70.     lhld    char$cnt    ; get character count
  71.     shld    con$buff+1    ; stuff back to console buffer
  72.     lxi    d,msg3        ; tell them repeating last process
  73.     call     prnt$messg    ; print message
  74.     lxi    h,con$buff+1    ; point to last command entry in console buffer
  75.     mov    c,m        ; get command length to calculate offset
  76.     mvi    b,0        ; clean high byte bias
  77.     inx    h        ; bump to start of command string address
  78.     dad    b        ; add bias to locate end of string
  79.     mvi    m,'$'        ; tag end of command string for message
  80.     lxi     d,con$buff+2    ; point to command string for message out
  81.     call    prnt$messg    ; print message
  82.     mvi    c,rsetdsk    ; reset disk system function
  83.      call    bdos            ; let CP/M do the work
  84.     ret            ; return
  85. ;
  86. reset$dsk$sys:
  87. ;
  88.     cpi    'R'        ; reset disk system?
  89.     jnz    save$char$cnt    ; if not, restore chracter count and return
  90.     lxi    d,msg2         ; tell them all disk set R/W
  91.     call    prnt$messg    ; print message
  92.     mvi    c,rsetdsk    ; reset disk system function
  93.     call    bdos        ; let CP/M do the work
  94.     call     pip$cr$lf    ; do carriage return/line feed
  95.     pop    h        ; clean the stack for pip restart
  96.     jmp    pip$prompt    ; do pip '*' prompt and wait for command
  97. ;
  98. save$char$cnt:
  99. ;
  100.     lhld    con$buff+1    ; save character count + character
  101.     shld    char$cnt    ; save character count
  102.     ret            ; return
  103. ;
  104. prnt$messg:
  105. ;
  106.     mvi    c,pmessg    ; print message function
  107.     call    bdos        ; let CP/M do the work
  108.     ret            ; return
  109. ;
  110. msg1    db    cr,lf,'PIP 1.5 with (R)eset Disks and (Q)uick Repeat',cr,lf,'$'
  111. ;
  112. msg2    db    cr,lf,'Resetting all disks to R/W$'
  113. ;
  114. msg3    db    cr,lf,'Repeating:   $'
  115. ;
  116. char$cnt dw    0            ; console buffer character count
  117. ;
  118.     org    pip$patch     ; patch to get to added code goes here
  119. ;
  120.     jmp    added        ; check for reset or repeat command
  121. ;
  122. ;
  123.     end