.MCALL .MODULE .MODULE DUPZMC,VERSION=08,COMMENT=,IDENT=NO ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .ENABL LC,GBL .SBTTL PSECT definitions .IIF NDF MDUP, MDUP = 0 ;Default to no MDUP .IIF NDF M$UPD, M$UPD = 0 ;Default to no MDUP Update .IIF NDF SDC, SDC = 0 ;Default to no SDCOPY .MCALL .DELETE PSECT IMPURE ;Impure data PSECT PURE ;Pure data PSECT PUREB ;[byte] Pure data PSECT ZERO2 ;Code psect PSECT PATCH ;Patch psect .BLKW 32. .SBTTL Label Information PSECT PURE ; VOL1 label .NLIST BEX VOL1: .WORD VOL11-VOL1-4,0 .ASCII \VOL1RT11A \ VOL11: .WORD VOL12-VOL11-4,36. ; 05DEC86/RHH .ASCII \ D%B 1 \ VOL12: .WORD HDR1-VOL12-4,78. .ASCII \ 3\ ; HDR1 label HDR1: .WORD EOF1-HDR1-4,0 .ASCII \HDR1ZEROED.ZZZ RT11A 000100000001\ .ASCII \00 00000 00000 000000DECRT11A \ ; EOF1 label EOF1: .WORD END-EOF1-4,0 .ASCII \EOF1\ END: .EVEN .LIST BEX PSECT PUREB .NLIST BEX MSGINI: .ASCII \/Initialize\<200> .LIST BEX PSECT IMPURE OUTCHN: .WORD 0 ;Channel to use for output BLK: .WORD 0 ;Block number for .SPFUN's MTLSIZ: .WORD 40. ;Magtape Label size (words) ..MTLS == MTLSIZ ;User customization patch .SBTTL ZEROMC - Zero a Magtape or Cassette ;+ ; ZEROMC ;- ORIGIN ZERO2 .ENABL LSB ZEROMC:: MOV #INFILE,R2 ;Assume prompt for input file BIT #DEV.MT,$OSFLG ;Are we zeroing a magtape? BEQ 1$ ;Branch if not MOV #OUTFIL,R2 ;Use the output filename for prompts 1$: SURE R2,#MSGINI,FG ;Is he sure? ;Check for foreground running BNE 6$ ;Branch if not .GTCOR #512.*2 ;Get a buffer BCC 2$ ;Branch if no error ;+ ;ERROR .ERR #ERAREA,#FE.NOM,LEVEL=FATAL,RETURN=NO ; <-F-Insufficient memory> ;- 2$: MOV R0,IBFBEG ;Save the pointer to the label buffer MOV #ICHAN,OUTCHN ;Assume we do output on input channel MOVB #1,SPFUNI ;.SPFUN's to write BIT #FLG.DV,$OSFLG ;Was an output device specified? BEQ 3$ ;Branch if not MOV #OCHAN,OUTCHN ;Save the correct output channel number SWAB SPFUN ;Switch the .SPFUN flags 3$: BIT #DEV.CT,$ISFLG ;Is it a cassette? BEQ 7$ ;Branch if not. Must be magtape ; Initialize CASSETTE .CLOSE #ICHAN ;Close the channel .DELETE #IOAREA,#ICHAN,#INFILE ;This causes the CT to be zeroed BCS 12$ ;Branch on error 4$: .LOOKUP #IOAREA,#ICHAN,#INFILE ;Lookup the device again BCC 5$ ;Branch if no error ;+ ;ERROR MOV #DIE,R1 ;Set error code BR 13$ ;Give the error ; <-F-Directory input error> ;- 5$: JSR R5,SPFUNG ;Rewind the cassette .WORD SF.RWD ;.SPFUN rewind code 6$: JMP 16$ ;We're done ; Initialize MAGTAPE 7$: MOV IBFBEG,R1 ;R1 -> label buffer MOV R1,R5 ;Copy the pointer MOV #256.,R0 ;R0 = size of buffer 8$: MOV #20040,(R1)+ ;Fill the buffer with spaces ; 05DEC86/RHH SOB R0,8$ ;Keep going MOV #VOL1,R0 ;R0 -> VOL1 label information CALL SETHOM ;Set it up MOV #VOL11,R0 ;R0 -> 2nd part of VOL1 label info CALL SETHOM ;Do it MOV #VOL12,R0 ;R0 -> 3rd part of VOL1 label CALL SETHOM ;Do it MOV OUTCHN,-(SP) ;Save the channel from the overlay read BIT #FL.VOL,$MFLAG ;Do we do volume ID and owner name? BEQ 9$ ;Branch if not CALL VOLID ;Go do the volume ID 9$: MOV (SP)+,OUTCHN ;Restore the channel JSR R5,SPFUNG ;Go rewind the magtape .WORD SF.RWD ;Rewind code CLR BLK ;Set the block number CALL SPFMTW ; Write VOL1 label BCC 11$ ;Branch if no error ;+ ;ERROR 10$: MOV #FE.OPE,R1 ;Set up the error code MOV #OUTFIL,R2 ;Setup device for error BR 13$ ;Go give error ;- 11$: INC BLK ;Bump the block number BIT #FLG.DV,$OSFLG ;Was there a bootstrap to write BEQ 15$ ;Branch if not MOV IBFBEG,R1 ;R1 -> label buffer ADD #512.,R1 ;Skip it READ #IOAREA,#ICHAN,R1,#256.,#0 ;Read in the file BCC 14$ ;Branch if no error ;+ ;ERROR 12$: MOV #FE.INE,R1 ;Set up the error code MOV #INFILE,R2 ;Setup device for error 13$: .ERR #ERAREA,R1,LEVEL=FATAL,RETURN=NO,FILE=R2 ; <-F-Output error dev:filename> ; <-F-Input error dev:filename> ;- 14$: WRITE #IOAREA,OUTCHN,R1,#256.,BLK ;Write out the boot block BCS 10$ ;Branch on error 15$: MOV #HDR1,R0 ;Put HDR1 label in buffer CALL SETHOM ;Do it CALL SPFMTW ; Write HDR1 label BCS 10$ ;Branch on error INC BLK ;Bump the block count MOV OUTCHN,R1 ;Set up the channel number CALL WRT2TM ;Write 2 tapemarks MOV #EOF1,R0 ;Put EOF1 label in buffer CALL SETHOM ;Do it CALL SPFMTW ; Write EOF1 label BCS 10$ ;Branch on error CALL WRT3TM ;Put the last 3 tapemarks there JSR R5,SPFUNG ;Rewind the magtape .WORD SF.RWD ;Rewind code 16$: RETURN .DSABL LSB .SBTTL SPFUNG - Issue a .SPFUN ;+ ; SPFUNG ; ; JSR R5,SPFUNG ; .WORD special function code ;- SPFUNG: .SPFUN #IOAREA,OUTCHN,@R5,#0,#0,#0,#0 BITB (R5)+,(R5)+ RTS R5 .SBTTL SPFMTW - Write label to MAGTAPE with SPFUN ;+ ; SPFMTW ; ; R5 = address of label buffer ;- SPFMTW: .SPFUN #IOAREA,OUTCHN,#SF.WTV,R5,MTLSIZ,BLK ; Write label RETURN .SBTTL SETHOM - Set Up Home Block Buffer ;+ ; SETHOM ; This routine sets up data in the home block buffer. ; ; R0 -> .WORD size of data in bytes ; .WORD offset into home block for data ; .BLKB data ; R5 -> home block buffer ; ; CALL SETHOM ;- SETHOM: SAVE02 ;Save volatile registers MOV (R0)+,R1 ;R1 = size of data to move MOV (R0)+,R2 ;R2 = offset from start of home block ADD R5,R2 ;Make it absolute 1$: MOVB (R0)+,(R2)+ ;Move a byte SOB R1,1$ ;Loop RETURN .END