home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols100 / vol177 / pipxfr.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  3.4 KB  |  126 lines

  1. ;     PIPXFR.ASM handshaked file transfer via PIP INP: and OUT: devices.
  2. ;    ------------------------------------------------------------------
  3.  
  4. ;     V01 L00 created on 1983 June 24 by Dennis E. Hamilton 
  5.  
  6.  
  7. ;    PIPXFR patches Digital Research PIP.COM so that the INP: and OUT:
  8. ;    devices are defined at the RDR: and PUN: logical devices *AND*
  9. ;    subject to special echo handshaking so that the sender does not
  10. ;    overrun the receiver.
  11.  
  12. ;    The basic patch procedure for PIP is that described in PIPIO.ASM
  13. ;    by T. Jennings (written 1982 February 1).
  14.  
  15. ;    This implementation uses a protocol suggested by Steven Fisher
  16. ;    [PIP Data Between Computers. MICROSYSTEMS 4, 7(July 1983), 48-54].
  17. ;    (The patch itself was developed 1978 March 3.)
  18.  
  19. ;    A typical installation of this modification is as follows:
  20.  
  21. ;        >ASM PIPXFR
  22. ;        >DDT PIP.COM
  23. ;        -IPIPXFR.HEX
  24. ;        -R
  25. ;        -G0
  26. ;        >SAVE 29 PIP.COM     
  27.  
  28.  
  29.  
  30.  
  31. ;        CP/M SYSTEM INTERFACE DEFINITIONS***************************
  32. ;        ============================================================
  33.  
  34. BBASE    EQU    0000H        ; system base location
  35.  
  36. WBOOT    EQU    BBASE        ; warm-boot exit instruction
  37.  
  38. IOBYTE    EQU    BBASE+3        ; CP/M 2.x Serial Device Assignments
  39. DEFAULT    EQU    BBASE+4        ; CP/M 2.x Default Disk Assignment
  40.  
  41. BDOS    EQU    BBASE+5        ; BDOS operation entry point
  42.  
  43. TICCNT    EQU    BBASE+11    ; H/Z CP/M 2.2.03 2ms tick counter
  44. H88CTL    EQU    BBASE+13    ; H88/Z89 latch 362Q contents
  45. H8CTL    EQU    BBASE+14    ; H8 latch 360Q contents (or zero)
  46. HA82    EQU    BBASE+22    ; word for HA8-2 music output
  47.  
  48. FILE1    EQU    BBASE+92    ; Default FCB built by CCP
  49.  
  50. RECORD1    EQU    BBASE+128    ; Default DMA record location and the 
  51.                 ; CCP deposit of the command-line tail
  52.  
  53. TPA    EQU    BBASE+0100H    ; CP/M Transient Program Area
  54.  
  55.  
  56.                 ; STANDARD CP/M 2.2 BDOS OPERATIONS
  57. AUXIN    EQU    3        ; AUXilliary byte INput
  58. AUXOUT    EQU    4        ; AUXilliary byte OUTput
  59.  
  60.  
  61.  
  62.  
  63. ;        TPA PAGE INP: AND OUT: INTERFACE
  64. ;        ================================
  65.  
  66.  
  67.     ORG    TPA+3        ; start just past PIP entry point
  68.     
  69.     JMP    INPUT        ; INP: procedure entry point
  70.     JMP    OUTPUT        ; OUT: procedure entry point
  71. INBYTE:
  72.     DB    80H        ; delivery cell for received bytes
  73.  
  74.  
  75.  
  76. ;===========================================================================;
  77. ;                                        ;
  78. ; *******************  INP: CHARACTER INPUT PROCEDURE  ******************** ;
  79. ;                                        ;
  80. ;===========================================================================;
  81.  
  82. ;        On entry to INPUT from PIP, the additional subroutine should
  83. ;        obtain one character and return with it stored in INBYTE.
  84.  
  85.  
  86. INPUT:
  87.     MVI    C,AUXIN        ; read the next input character, if any,
  88.     CALL    BDOS        ; into INBYTE
  89.     ANI    7FH        
  90.     STA    INBYTE
  91.  
  92.     MOV    E,A        ; return the same character as 
  93.     MVI    C,AUXOUT    ; confirmation
  94.     JMP    BDOS
  95.  
  96.  
  97.  
  98. ;==========================================================================;
  99. ;                                       ;
  100. ; *******************  OUT: CHARACTER OUTPUT PROCEDURE  ****************** ;
  101. ;                                       ;
  102. ;==========================================================================;
  103.  
  104. ;        On entry to OUTPUT from PIP, the character to be output is
  105. ;        found in register C.
  106.  
  107.  
  108. OUTPUT:
  109.     MOV    E,C        ; send the character to AUXOUT
  110.     MVI    C,AUXOUT
  111.     CALL    BDOS
  112.  
  113.     MVI    C,AUXIN        ; wait for any character to return as
  114.     JMP    BDOS        ; confirmation before continuing
  115.  
  116.  
  117.  
  118.     DS    TPA+256-$    ; the patches must fit in 1st TPA page
  119.     END
  120. r to return as
  121.     JMP    BDOS        ; confirmation before continuing
  122.  
  123.  
  124.  
  125.     DS    TPA+256-$    ; the patches must fit in 1st TPA page
  126.     END