;*************************** AMUS Program Label ****************************** ; Filename: ARXHIV.M68 Date: 03/03/88 ; Category: UTIL Hash Code: 130-026-737-673 Version: 2.0 ; Initials: DDSS/AM Name: DAVE DRAKE ; Company: DOUBLE-D SOFTWARE SERVICES Telephone #: 7024382173 ; Related Files: ARXRES.*,ARXDIR.*,ARXDOC.DOC ; Min. Op. Sys.: ??? Expertise Level: INT ; Special: ; Description: Modification of Dave Pallman Archive Routines to handle ; random files! ; ;***************************************************************************** ;***************************************************************************; ; ; ; ARCHIV ; ; create an archive image file of a wildcard file set ; ; ; ; Author: David F. Pallmann ; ; Copyright (C) 1984 by LMS Technical Services, Inc. ; ; ; ;***************************************************************************; ; ; Modified for Random file handling (Ver 2.0) ; ; Author: David A. Drake ; Copyright (C) 1988 by Double-D Software Services ; ;***************************************************************************; ; ; File uses universal (.UNV) files other ; than SYS, SYSSYM, and TRM. ; These are on the AMUS network ; ; File makes external references to WLDSCN.OBJ[P,PN]. After ; assembly, enter this command: .LNKLIT file,WLDSCN[P,PN] OBJNAM ARXHIV.LIT VMAJOR=2 ;03-Mar-88 DDSS - mod for random file handling ;edit history VEDIT=100. ;06-Jan-84 DFP creation. ;universals SEARCH SYS SEARCH SYSSYM SEARCH WLDSCN ;registers IMP=A5 ;impure index ;special DDB definitions D.BLK=D.WRK ;block size returned by LOOKUP D.ACT=D.WRK+6 ;active count returned by LOOKUP ;impure area .OFINI .OFDEF FILE,D.DDB ;DDB for reading AMOS files .OFDEF ARCDIR,D.DDB ;DDB for writing archive directory .OFDEF ARCDAT,D.DDB ;DDB for writing archive data .OFSIZ IMPSIZ START: PHDR -1,0,PH$REE!PH$REU ;program header GETIMP IMPSIZ,IMP ;allocate impure area WINIT ;initialize WLDSCN ;get archive specification GETARC: BYP LIN JEQ HELP MOV A2,A3 FSPEC ARCDIR(IMP),XXX MOVW #[MAP],ARCDIR+D.EXT(IMP) INIT ARCDIR(IMP) MOV A3,A2 FSPEC ARCDAT(IMP),XXX MOVW #[ARX],ARCDAT+D.EXT(IMP) INIT ARCDAT(IMP) ;bypass '=' SKIP: BYP CMMB (A2)+,#'= JNE HELP ;get wildcard file specification GETSPC: BYP WSPEC ;process wildcard file spec JNE EXIT ;exit if invalid spec ;create archive file MAKARC: OPENO ARCDIR(IMP) OPENO ARCDAT(IMP) ;get next matching file GETFIL: CTRLC ABORT WSCAN ;get a file JNE DONE ;no more files MOVW D.DEV(A4),FILE+D.DEV(IMP) MOVW D.DRV(A4),FILE+D.DRV(IMP) MOV D.FIL(A4),FILE+D.FIL(IMP) MOVW D.EXT(A4),FILE+D.EXT(IMP) MOVW D.PPN(A4),FILE+D.PPN(IMP) INIT FILE(IMP) LOOKUP FILE(IMP) TSTW FILE+D.ACT(IMP) BPL DOSEQ ;v2 JMP DORAN ;v2 DOSEQ: TYPESP Processing file PFILE FILE(IMP) TAB ;V2 TYPECR < - Sequential> ;v2 ;copy file CPYSEQ: OPENI FILE(IMP) CLR D0 10$: FILINB FILE(IMP) TST FILE+D.SIZ(IMP) BEQ ENDSEQ INC D0 FILOTB ARCDAT(IMP) BR 10$ ENDSEQ: CLOSE FILE(IMP) ;write file directory header HDRSEQ: MOV FILE+D.FIL(IMP),D1 FILOTL ARCDIR(IMP) ;output filename to header CLR D1 MOVW FILE+D.EXT(IMP),D1 FILOTW ARCDIR(IMP) ;output extension to header MOVW FILE+D.PPN(IMP),D1 FILOTW ARCDIR(IMP) ;output PPN to header MOV D0,D1 FILOTL ARCDIR(IMP) ;output file size in bytes MOV FILE+D.BLK(IMP),D1 FILOTL ARCDIR(IMP) ;v2-output file size in blocks MOVB #'S,D1 FILOTB ARCDIR(IMP) ;v2-output random/sequential flag MOVB #0,D1 FILOTB ARCDIR(IMP) ;v2-even word filler JMP GETFIL ;------------------------------------------------------------------- ; random file processing - v2 ;------------------------------------------------------------------- DORAN: TYPESP Processing file PFILE FILE(IMP) TAB TYPECR < - Random> ;copy file CPYRAN: PUSH A4 ; save wldscn pointer MOV FILE+D.WRK(IMP),D2 ;D2 holds the number of blocks OPENR FILE(IMP) ;open the file CLR D0 READIT: READ FILE(IMP) ;get a block MOV FILE+D.SIZ(IMP),D3 ;number of byte moves MOV FILE+D.BUF(IMP),A4 ;A4 points to block 10$: MOVB (A4)+,D1 ;get date FILOTB ARCDAT(IMP) ;out to archive file INC D0 ;Inc file size DEC D3 ;one less to do BNE 10$ ;still more to do DEC D2 ;one less block to do BEQ ENDRAN ;if zero, we are done INCW FILE+D.REC+2(IMP) ;point to next block BR READIT ;and read it ENDRAN: CLOSE FILE(IMP) POP A4 ;restore wldscn pointer HDRRAN: MOV FILE+D.FIL(IMP),D1 FILOTL ARCDIR(IMP) ;output filename to header CLR D1 MOVW FILE+D.EXT(IMP),D1 FILOTW ARCDIR(IMP) ;output extension to header MOVW FILE+D.PPN(IMP),D1 FILOTW ARCDIR(IMP) ;output PPN to header MOV D0,D1 FILOTL ARCDIR(IMP) ;output file size in bytes MOV FILE+D.BLK(IMP),D1 FILOTL ARCDIR(IMP) ;output file size in blocks MOVB #'R,D1 FILOTB ARCDIR(IMP) ;output random/sequential flag MOVB #0,D1 FILOTB ARCDIR(IMP) ;even word filler JMP GETFIL HELP: TYPECR TYPECR BR EXIT ABORT: TYPECR ?aborted DONE: CLOSE ARCDIR(IMP) CLOSE ARCDAT(IMP) EXIT: CRLF EXIT END .