home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG049.ARK / LCAT.RAT < prev    next >
Text File  |  1984-04-29  |  2KB  |  76 lines

  1.     PROGRAM LCAT
  2. # Written by Tim Prince, July 1979
  3. # on MCOS, CP/m RATFOR, Microsoft/Cromemco FORTRAN
  4. # requires IOER.Z80 & Cromemco ASMLIB
  5. # Concatenate .REL files into searchable library.
  6. #files must end with 9E 1A as do compiler output files
  7. #FOR automatically makes library of those modules in the
  8. #.FOR file but ASMB must be used separately for each module
  9. # .REL files not made by compilers may be scrambled beyond the
  10. # 9E byte and must have 1A patched in before using LCAT;
  11. # note that 9E and 1A bytes will occur separately within
  12. # bit data stream.
  13. include ASMDEF
  14. INTEGER*1 XFCB(40),BUF(128),XBUF(512),OFN(11)
  15. INTEGER*1 DRV,NCHAR,MCHAR,EOR,CZ,SUB
  16. LOGICAL NMI
  17. EQUIVALENCE(LXBUF,XFCB(36))
  18. INCLUDE CONSTS
  19. DATA XFCB/11*0,'R','E','L',25*0,4/,EOR/158/,SUB/26/
  20. DATA OFN/8*0,'R','E','L'/
  21. LXBUF=LOC(XBUF)
  22. WRITE(KONS,10)
  23. 10    FORMAT(1X,'Output .REL file (aaaaaaaa)?')
  24. READ(KONS,20)(OFN(I),I=1,8)
  25. 20    FORMAT(8A1)
  26. WRITE(KONS,30)
  27. 30    FORMAT(1X,'Drive(A/B)?')
  28. READ(KONS,40)DRV
  29. 40    FORMAT(A1)
  30. CALL OPEN(6,OFN,DRV-'@')
  31. WRITE(KONS,50)
  32. 50    FORMAT(1X,'Input files will be requested singly;')
  33. CALL OPIF(XFCB,NMI)
  34. NCHAR=GCHAR(0,XFCB)
  35. REPEAT{ #Until stopped by blank filename
  36. FOR(IC=1;IC<=128;)
  37. {MCHAR=NCHAR;NCHAR=GCHAR(0,XFCB)
  38. IF(MCHAR==EOR&NCHAR==SUB)
  39. {CALL ZCLOS(ERMSG,XFCB)
  40. CALL OPIF(XFCB,NMI);IF(^NMI) NCHAR=GCHAR(0,XFCB)
  41. ELSE{BUF(IC)=EOR;IF(IC<128)BUF(IC+1)=SUB;BREAK}}
  42. ELSE{BUF(IC)=MCHAR;IC=IC+1}}
  43. WRITE(6)BUF}UNTIL (NMI)
  44. CALL ZCLOS(ERMSG,XFCB)
  45. STOP
  46. END
  47. BYTE FUNCTION LOC(X)#Return address of X in HL
  48. BYTE X
  49. RETURN
  50. END
  51. SUBROUTINE OPIF(XFCB,NMI)#Open existing file for XFCB
  52. INCLUDE ASMDEF
  53. INTEGER*1 LN
  54. INTEGER*1 BLANK, XFCB(40),NAME(14)
  55. LOGICAL NMI#Return true if no more input files
  56. INCLUDE CONSTS
  57. DATA BLANK/' '/
  58. WRITE(KONS,10)
  59. 10    FORMAT(1X,'Input file (aaaaaaaa)?')
  60. READ(KONS,20)(XFCB(I),I=4,11)
  61. 20    FORMAT(8A1)
  62. NMI=XFCB(4)==BLANK;IF(^NMI)
  63. {WRITE(KONS,30)
  64. 30    FORMAT(1X,'Drive (A/B)?')
  65. READ(KONS,40)XFCB(3)
  66. 40    FORMAT(A1)
  67. XFCB(3)=XFCB(3).XOR.'@'#Convert to numeric
  68. CALL ZOPN(ERMSG,XFCB)
  69. IF(IOER(ERMSG))CALL ZIOER
  70. ELSE {LN=PFNAM(NAME)
  71. WRITE(KONS,50)(NAME(I),I=1,LN)
  72. 50    FORMAT(1X,14A1)
  73. }}
  74. RETURN
  75. END
  76.