.ENABL LC .TITLE TAT Task attribute utility .IDENT /1.00/ .SBTTL Local Macros, Control Blocks, and Buffers ;+ ; VERSION 1.00 ; ; AUTHOR: R.S. Mearns, Informatics Inc., November, 1980 ; ; MODIFIED BY: RSM, 3/17/81: Added explicit error messages for privelege ; violation and no such file on task image file ; open error. ; ; RSM 10/20/81: Added /RO switch to allow read only access to a ; task image file, for display only of parameters ; ; PURPOSE: This task allows for the display and update of task ; parameters in a non-installed task image. It is specially ; useful with tasks which are not normally left installed. ; ; NOTES: Assembly: Use EXEMC.MLB (defines HDRDF$ and LBLDF$) ; Taskbuild: ASG=TI:1 (Used by GCML$ for prompting) ; ;- ; ; EQUATED SYMBOLS LUNTI = 5 ;LUN and EFN for TI: LUNTSK = 2 ;LUN and EFN for task image file ; ; ; LOCAL MACROS .MACRO ERROR MSG,LEN ;Macro to issue error messages via MOV MSG,ERRQIO+Q.IOPL ; a QIO at ERRQIO MOV LEN,ERRQIO+Q.IOPL+2 DIR$ #ERRQIO .ENDM ; .MACRO IOERR ERCAD,MSG,LEN ;Macro to issue error messages con- MOVB F.ERR(R0),R1 ; taining I/O error codes. Error MOV ERCAD,R0 ; codes at offset F.ERR from R0 CLR R2 ; (such as are present after FCS CALL $CBDSG ; operations) are converted to ERROR MSG,LEN ; ASCII, and moved to ERCAD. .ENDM ; .MCALL FINIT$, OPEN$M, READ$, WRITE$, CLOSE$ .MCALL FSRSZ$, FDBDF$, FDRC$A, FDBK$A, FDOP$A .MCALL GCMLB$, GCML$, CSI$, CSI$1, CSI$2 .MCALL CSI$SW, CSI$ND, CSI$SV, NMBLK$ .MCALL HDRDF$, LBLDF$ .MCALL EXIT$S .MCALL QIOW$,DIR$,WAIT$ .MCALL OPEN$R HDRDF$ ; Define task header offsets LBLDF$ ; Define task label block offsets CSI$ ; Define CSI values ; ; FSRSZ$ 2 ;Allow 2 levels of indirect files FDB: FDBDF$ ;FDB for task image file FDRC$A FD.RWM!FD.RAN FDBK$A ,512.,,LUNTSK,IOSB FDOP$A LUNTSK,CSIBLK+C.DSDS,DEFNAM ; DEFNAM: NMBLK$ ,TSK,,SY,0 .EVEN ; IOSB: .BLKW 2 BLKNO: .BLKW 2 HDRBKN: .BLKW 1 ;Virtual block number of header block ; LABLK0: .BLKB 512. ;Label block 0 LABLK1: .BLKB 512. ; 1 LABLK2: .BLKB 512. ; 2 DO NOT SEPARATE FROM LABLK1 !!! HDRBLK: .BLKB 512. ; LB0END: .BLKW 1 ;Address of LABLK0 + optional extra offset for ;11M+ tasks which have extra library requests ;in label block 0. Used in place of LABLK0 ;for addressing the information following the ;library requests. ; GCLBLK: GCMLB$ 2,TAT ;Get Command Line control block .EVEN ; CSIBLK: .BLKB C.SIZE ;Command String Interpreter control block .EVEN ; .PAGE .SBTTL Switch and switch value definitions ; ; SWITCH BIT DEFINITIONS LIBIT = 100000 ;/LI TSKBIT = 40000 ;/TASK PARBIT = 20000 ;/PAR UICBIT = 10000 ;/UIC ; CRDBIT = 4000 ;/CRD ;Not implemented PRIBIT = 2000 ;/PRI INCBIT = 1000 ;/INC ASGBIT = 400 ;/ASG SLVBIT = 200 ;/SLV CHKBIT = 100 ;/CKP PMDBIT = 40 ;/PMD ROBIT = 20 ;/RO ; ; SWITCH DESCRIPTOR TABLE SWTAB: CSI$SW LI, LIBIT, MSKWRD,SET,NEG CSI$SW TASK,TSKBIT,MSKWRD,SET, ,TSKVTB CSI$SW PAR, PARBIT,MSKWRD,SET, ,PARVTB CSI$SW UIC, UICBIT,MSKWRD,SET, ,UICVTB ; CSI$SW CRD, CRDBIT,MSKWRD,SET, ,CRDVTB ;Not implemented CSI$SW PRI, PRIBIT,MSKWRD,SET, ,PRIVTB CSI$SW INC, INCBIT,MSKWRD,SET, ,INCVTB CSI$SW ASG, ASGBIT,MSKWRD,SET, ,ASGVTB CSI$SW SLV, SLVBIT,MSKWRD,SET,NEG CSI$SW CKP, CHKBIT,MSKWRD,SET,NEG CSI$SW PMD, PMDBIT,MSKWRD,SET,NEG CSI$SW RO, ROBIT, MSKWRD,SET,NEG ; MSKWRD: .BLKW 1 ; NASGS=5 ;5 DDN:LUN PAIRS ; SWITCH VALUE DESCRIPTOR TABLES TSKVTB: CSI$SV ASCII,TASK,6 CSI$ND PARVTB: CSI$SV ASCII,PAR,6 CSI$ND UICVTB: CSI$SV OCTAL,UICGRP,2 CSI$SV OCTAL,UICMEM,2 CSI$ND ;CRDVTB:CSI$SV ASCII,CRD,10 ;Not implemented ; CSI$ND PRIVTB: CSI$SV OCTAL,PRI,2 CSI$ND INCVTB: CSI$SV OCTAL,INC,2 CSI$ND ASGVTB: CSI$SV ASCII, ASGDV1,4 ;Allow up to 5 DDN:LUN pairs per /ASG CSI$SV DECIMAL,ASGLN1,2 CSI$SV ASCII, ASGDV2,4 CSI$SV DECIMAL,ASGLN2,2 CSI$SV ASCII, ASGDV3,4 CSI$SV DECIMAL,ASGLN3,2 CSI$SV ASCII, ASGDV4,4 CSI$SV DECIMAL,ASGLN4,2 CSI$SV ASCII, ASGDV5,4 CSI$SV DECIMAL,ASGLN5,2 CSI$ND ; TASK: .BLKB 6 PAR: .BLKB 6 UICGRP: .BLKB 2 UICMEM: .BLKB 2 CRD: .BLKB 12 PRI: .BLKW 1 INC: .BLKW 1 ASGDV1: .BLKW 2 ;The table of device:lun pairs must be contiguous, ASGLN1: .BLKW 1 ;with the device preceding the lun for each pair ASGDV2: .BLKW 2 ASGLN2: .BLKW 1 ASGDV3: .BLKW 2 ASGLN3: .BLKW 1 ASGDV4: .BLKW 2 ASGLN4: .BLKW 1 ASGDV5: .BLKW 2 ASGLN5: .BLKW 1 ; ; .PAGE .SBTTL Module TAT Main Routine ; ;+ ; MODULE TAT ; ; FUNCTION: Main routine ; Prompts for command line (exits if ^Z entered) ; Parses command line ; Opens specified task image file ; Reads label and header blocks ; Puts new values of task parameters in header and label blocks ; Writes back updated label and header blocks ; Closes task image file ; ; INPUTS: A command line of the form ; TAT>filespec/sw/sw:val/sw:val:val etc. ; where: ; filespec a legal RSX filename string (default .TSK) ; /sw:val switches and values from the following list ; ; /TASK:taskname where taskname is a legal RSX task name ; /PAR:parname where parname is a legal RSX partition name ; /UIC:grp:mem where grp and mem are group and member of UIC ; /PRI:priority where priority is a value for task priority ; /INC:size where size is the task extend size (in words) ; /ASG:ddnn:lun where ddnn is an RSX device name (e.g., DB:, ; TT10:) and lun is a logical unit number. Up ; to 5 dd:nn pairs may be specified with a ; single /ASG switch if pairs are separated by ; colons. (e.g., /ASG:SY0:1 : LB:2 : DK1:9) ; /PMD enables post mortem dump ; /NOPMD disables post mortem dump (/-PMD also works) ; /SLV enables slave task option ; /NOSLV disables slave task option (/-SLV also works) ; /CKP enables checkpoint option ; /NOCKP disables checkpoint option (/-CKP also works) ; /LI causes TAT to display the current values of ; the above switches. When used in conjunction ; with other switches, /LI lists the updated ; switch values. The /LI function is performed ; by default. ; /NOLI suppresses the /LI function (/-LI also works) ; /RO causes display of only of task params. Other ; switches used with /RO are ignored ; ; OUTPUTS: The label and header blocks of the task image are updated to ; include the new attributes specified. ; ;- TAT:: FINIT$ ; ; ; GET A COMMAND LINE ; GETLIN: GCML$ #GCLBLK ;Get a command line BCS 5$ ;If error TST G.CMLD(R0) ;Any characters in command line? BEQ GETLIN ;No, get another line JMP PARSE1 ;Yes, process this one 5$: CMPB G.ERR(R0),#GE.EOF ;End of file? BNE 10$ ;Not EOF EXIT$S ;Was EOF; Bye. ; 10$: CMPB G.ERR(R0),#GE.IOR ;Command line I/O error? BNE 20$ ;No IOERR #CLIOEC,#CLIOEM,#CLIOML ;Write error message BR GETLIN ;Go back for more command input ; 20$: CMPB G.ERR(R0),#GE.OPR ;Command file open error? BNE 30$ ;No IOERR #CFOPEC,#CFOPEM,#CFOPML ;Write error message BR GETLIN ;Go back for more command input ; 30$: CMPB G.ERR(R0),#GE.MDE ;Max @ nesting depth exceeded? BNE 40$ ;No. ERROR #MNDEEM,#MNDEML ;Write error message BR GETLIN ;Go back for more command input ; 40$: CMPB G.ERR(R0),#GE.BIF ;Syntax error in @ file name? BNE 50$ ;No. ERROR #IFNSEM,#IFNSML ;Write error message BR GETLIN ;Go back for more command input ; 50$: ERROR #UNKNEM,#UNKNML ;Don't know what's wrong BR GETLIN ;Try again. ; ; ; CHECK SYNTAX OF COMMAND LINE AND PARSE FILE SPECIFIER PARSE1: CSI$1 #CSIBLK,GCLBLK+G.CMLD+2,GCLBLK+G.CMLD ;Check syntax BCC PARSE2 ;Branch if no error ERROR #CMLSEM,#CMLSML ;Write error message JMP GETLIN ; ; ; PARSE SWITCHES AND DECODE SWITCH VALUES PARSE2: CLR MSKWRD ;Clear leftovers CSI$2 #CSIBLK,OUTPUT,#SWTAB ;Interpret switches BCS 10$ ;If error TST CSIBLK+C.FILD ;Any filespec in line? BEQ 20$ ;No, error BR OPEN ;Filespec supplied 10$: ERROR #IVSWEM,#IVSWML ;Bad switch syntax JMP GETLIN 20$: ERROR #NFSPEM,#NFSPML ;No filespec JMP GETLIN ; ; ; OPEN TASK IMAGE FILE, READ LABEL BLOCKS 0, 1, (2), AND HEADER BLOCK OPEN: BIT #ROBIT,MSKWRD ; Read only bit set? BEQ 5$ ; If EQ, no OPEN$R #FDB ; Open file for read BR 7$ 5$: OPEN$M #FDB ;Open task image file read/write 7$: BCC READTF ;If no error CMPB #IE.PRI,F.ERR(R0) ;Privelege violation? BNE 10$ ; No ERROR #PRIVEM,#PRIVML ;Write priv. viol. message JMP GETLIN 10$: CMPB #IE.NSF,F.ERR(R0) ;No such file? BNE 20$ ; No ERROR #NSFLEM,#NSFLML ;Write no such file error message JMP GETLIN 20$: IOERR #OPENEC,#OPENEM,#OPENML ;Was some other open error JMP GETLIN ; READTF: READ$ #FDB,#LABLK0 ;Read label block 0 WAIT$ #FDB BCS 10$ ;If error READ$ #FDB,#LABLK1 ;Read label block 1 WAIT$ #FDB BCS 10$ ;If error MOV #LABLK0,LB0END ;Set up nominal addr for end of LABLK0 CMPB #4,LABLK0+L$BSYS ;Is this an 11M+ task image? BNE 5$ ; No ADD #$LBXL,LB0END ; Yes, add offset 5$: MOV LB0END,R5 ;R5 used to address end of LABLK0 MOV L$BHRB(R5),HDRBKN ;Get block number of header block INC HDRBKN ;Make it virtual MOV HDRBKN,BLKNO+2 ;Move to block pointer READ$ #FDB,#HDRBLK,,#BLKNO ;Read header block WAIT$ #FDB BCS 10$ ;If error CMP HDRBLK+H.NLUN,#128. ;How many LUNs in this task image? BLE 7$ ;<=128.; Don't read label block 2 MOV #3,BLKNO+2 ;Point to 3rd block READ$ #FDB,#LABLK2 ;Read label block 2 WAIT$ #FDB BCS 10$ ;If CS, error 7$: BIT #ROBIT,MSKWRD ; Read only? BEQ 20$ ; If EQ, no CALL LIST ; Just list the stuff JMP CLOSE ; And close the file 10$: IOERR #READEC,#READEM,#READML ;Write read error message JMP CLOSE ;And get out of here 20$: ; ; ; ; ; CONVERT VALUES OF THE SET SWITCHES TO PROPER FORMAT AND STORE ; If an error is detected in any switch value, an appropriate ; error message is written, the rest of the switches are ignored, ; and the task image file is closed unchanged. ; PROCES: PTASK: ;Process /TASK BIT #TSKBIT,MSKWRD ;Task bit set? BEQ 100$ ;No MOV #TASK,R0 ;Address of new task name MOV #6,R1 ;Length MOV #LABLK0+L$BTSK,R2 ;Address of rad50 output string JSR PC,A2R5ST ;Convert to rad50 and check for errors BCC 100$ ;If no errors ERROR #TKNMEM,#TKNMML ;Bad task name JMP CLOSE 100$: ; PPAR: ;Process /PAR BIT #PARBIT,MSKWRD ;Partition name bit set? BEQ 100$ ;No MOV #PAR,R0 ;Address of new partition name MOV #6,R1 ;Length MOV #LABLK0+L$BPAR,R2 ;Address of rad50 output string JSR PC,A2R5ST ;Convert to rad50 and check for errors BCC 100$ ;If no errors ERROR #PRNMEM,#PRNMML ;Bad partition name JMP CLOSE 100$: ; PUIC: ;Process /UIC BIT #UICBIT,MSKWRD ;UIC bit set? BEQ 100$ ;No MOV UICMEM,R0 ;Member byte CMP R0,#0 ;Within 0 to 377? BLT 10$ ;No, error CMP R0,#377 BGT 10$ ;No, error MOV UICGRP,R1 ;Group byte CMP R1,#0 ;Within 0 to 377 BLT 10$ ;No, error CMP R1,#377 BGT 10$ ;No, error SWAB R1 ;Group byte to high order ADD R1,R0 ;Group and member bytes to 1 word MOV R0,HDRBLK+H.DUIC ;Store in header block BR 100$ 10$: ERROR #UICEM,#UICML ;Write bad UIC error message JMP CLOSE 100$: ; PCRD: ;Process /CRD ; BIT #CRDBIT,MSKWRD ;CRD bit set? ; BEQ 100$ ;No ; /CRD is currently unimplemented 100$: ; PPRI: ;Process /PRI BIT #PRIBIT,MSKWRD ;PRI bit set? BEQ 100$ ;No CMP PRI,#1 ;PRI < 1? BLT 10$ ;Yes; error CMP PRI,#250. ;PRI > 250.? BGT 10$ ;Yes; error MOV PRI,L$BPRI(R5) ;Store in label block 0 BR 100$ ;Go to next section 10$: ERROR #PRIEM,#PRIML ;Write bad priority error message JMP CLOSE 100$: ; PINC: ;Process /INC BIT #INCBIT,MSKWRD ;INC bit set? BEQ 100$ ;No CLR R0 ;INC value (words) / 32. = INC value MOV INC,R1 ; (64 byte blocks) BMI 10$ ;Error if negative DIV #32.,R0 TST R1 ;Any remainder? BEQ 5$ ;No INC R0 ;Yes, round up 5$: MOV R0,L$BEXT(R5) ;Store in label block 0 BR 100$ ;Go to next section 10$: ERROR #INCEM,#INCML ;Write bad increment message JMP CLOSE 100$: ; PASG: ;Process /ASG BIT #ASGBIT,MSKWRD ;ASG bit set? BEQ 100$ ;No MOV #ASGDV1,R0 ;Address of ASG value table MOV #NASGS,R3 ;Max number of assigns CLR R4 ;Zero counter 5$: TST (R0) ;Device null? BEQ 20$ ;Yes; no more entries CMPB (R0),#'A ;1st char. of device name alphabetic? BLT 30$ ;No; error CMPB (R0),#'Z BGT 30$ ;No; error CMPB 1(R0),#'A ;2nd char. of device name alphabetic? BLT 30$ ;No; error CMPB 1(R0),#'Z BGT 30$ ;No; error CLR R1 CLR R2 MOVB 2(R0),R1 ;Load 1st character of dev. number BEQ 10$ ;If null, dev. num. defaulted to 0 CMPB R1,#'0 ;ASCII 0 thru 7? BLT 30$ ;No, error CMPB R1,#'7 BGT 30$ ;No, error SUB #60,R1 ;Convert 1st char to binary MOVB 3(R0),R2 ;Load 2nd character of device number BEQ 7$ ;Null; 1st char is only one CMPB R2,#'0 ;ASCII 0 thru 7? BLT 30$ ;No, error CMPB R2,#'7 BGT 30$ ;No, error SUB #60,R2 ;Convert to binary ASH #3,R1 ;Make 1st char the 8**1 digit ADD R2,R1 ;Combine into binary device number 7$: MOV R1,2(R0) ;Overwrite the old ASCII device number 10$: CMP 4(R0),HDRBLK+H.NLUN ;LUN .le. total task luns? BGT 30$ ;No; error CMP 4(R0),#1 ;LUN .ge. 1? BLT 30$ ;No; error MOV 4(R0),R1 ;Load LUN DEC R1 ;(LUN-1) * 4 = offset in LABLK0 and 1 ASH #2,R1 ; of 1st byte of LUN's entry MOV (R0),LABLK1(R1) ;Move device name MOV 2(R0),LABLK1+2(R1) ;Move device number ADD #6,R0 ;Point to next table entry INC R4 ;Increment loop counter CMP R4,R3 BLT 5$ 20$: BR 100$ 30$: ERROR #ASGEM,#ASGML ;Write ASG error message JMP CLOSE 100$: ; ; PBITS: ;Process /SLV, /CKP, and /PMD MOV #LABLK0+L$BFLG,R0 ;Load address of task flag word MOV #CSIBLK,R1 ; CSI control block BIT #SLVBIT,C.MKW1(R1) ;Was /SLV or /NOSLV in command line? BEQ 10$ ;No. BIC #TS$SLV,(R0) ;Assume /NOSLV BIT #SLVBIT,C.MKW2(R1) ;Test polarity BEQ 10$ ;Was /NOSLV BIS #TS$SLV,(R0) ;Was /SLV 10$: BIT #CHKBIT,C.MKW1(R1) ;Was /CKP or /NOCKP in command line? BEQ 20$ ;No BIS #TS$CHK,(R0) ;Assume /NOCKP BIT #CHKBIT,C.MKW2(R1) ;Test polarity BEQ 20$ ;Was /NOCKP BIC #TS$CHK,(R0) ;Was /CKP 20$: BIT #PMDBIT,C.MKW1(R1) ;Was /PMD or /NOPMD in command line? BEQ 30$ ;No BIC #TS$PMD,(R0) ;Assume /NOPMD BIT #PMDBIT,C.MKW2(R1) ;Test polarity BEQ 30$ ;Was /NOPMD BIS #TS$PMD,(R0) ;Was /PMD 30$: ; PLI: ;Process /LI; default is /LI BIT #LIBIT,CSIBLK+C.MKW1 ;Was /LI or /NOLI in command line? BEQ 10$ ;No, list by default BIT #LIBIT,CSIBLK+C.MKW2 ;Test polarity BEQ 100$ ;/NOLI was specified; don't list 10$: CALL LIST 100$: ; ; ; WRITE BACK MODIFIED LABEL AND HEADER BLOCKS; CLOSE FILE ; WRITTF: MOV #1,BLKNO+2 ;Set block pointer WRITE$ #FDB,#LABLK0,,#BLKNO ;Write label block 0 WAIT$ #FDB BCS 10$ ;If error WRITE$ #FDB,#LABLK1 ;Write label block 1 WAIT$ #FDB BCS 10$ ;If error MOV HDRBKN,BLKNO+2 ;Set block pointer for header block WRITE$ #FDB,#HDRBLK,,#BLKNO ;Write header block WAIT$ #FDB BCS 10$ ;If error CMP HDRBLK+H.NLUN,#128. ;Less than 128. LUNs? BLE CLOSE ;Yes MOV #3,BLKNO+2 ;No; write label block 2; set blk pntr WRITE$ #FDB,#LABLK2,,#BLKNO ;Write label block 2 WAIT$ #FDB BCC CLOSE ;If no error 10$: IOERR #WRITEC,#WRITEM,#WRITML ;Write write error message ; ; CLOSE: ;Close task image file CLOSE$ #FDB WAIT$ #FDB BCS 10$ ;If error JMP GETLIN ;Else do the whole mess again 10$: IOERR #CLOSEC,#CLOSEM,#CLOSML ;Write close error message JMP GETLIN ; ; .PAGE .SBTTL Module A2R5ST Convert an ASCII string to RADIX50 ; ; ; ; ; MODULE A2R5ST Converts an ASCII string to rad50 ; ; Inputs: R0 address of ASCII string ; R1 number of bytes in ASCII string ; R2 address of rad50 output string ; ; Outputs: the rad50 string ; C bit set if error, clear if no error ; ; Assumptions: That period (.) is a valid character, i.e., not a ; string terminator. ; That the ASCII input string is null padded on the ; right. ; ; Effects: R0 thru R4 lost ; ; A2R5ST: MOV R1,R3 ;Save count ADD R0,R3 ;R3 = address of last byte + 1 10$: TSTB -(R3) ;Is this byte null? BNE 20$ ;No, end of blank padding MOVB #40,(R3) ;Replace null with blank BR 10$ ;Process next byte 20$: MOV R1,R3 ;Save count MOV R2,R4 ;Save output string address 30$: MOV #1,R1 ;Signify period is not terminator CALL $CAT5B ;Convert to rad50 BCS 40$ ;If error MOV R1,(R4)+ ;Store result SUB #3,R3 ;Update count BNE 30$ ;Back for next convert 40$: RTS PC ;Return to caller ; ; .PAGE .SBTTL Module LIST List current label and header block values ;+ ; MODULE LIST ; ; FUNCTION: Displays on TI: the current values of those task parameters ; which can be modified by TAT. ; ; OUTPUTS: The current task parameters. ; ; NOTES: The conversion from various internal formats to ASCII, and ; the output line formatting is done with $EDMSG. For each ; line of output, there is a line descriptor string and an ; argument block. This routine consists mainly of setting ; up appropriate values in the argument blocks. ;- ; LIST: ; Line 1: Task name, Partition name, and UIC MOV #LABLK0,R3 ;Load base address of label block 1 MOV LB0END,R4 ;Base for addressing last LABLK0 info MOV L$BTSK(R3),ARGBK1 ;Move task name MOV L$BTSK+2(R3),ARGBK1+2 MOV L$BPAR(R3),ARGBK1+4 ;Move partition name MOV L$BPAR+2(R3),ARGBK1+6 MOV #LSTBUF,R0 ;Load address of output buffer MOV #LINE1,R1 ; descriptor string MOV #ARGBK1,R2 ; argument block CALL $EDMSG ;Format the line MOV R1,LSTQIO+Q.IOPL+2 ;Byte count of line ; If the first byte of the Task name field in the output line is a blank, ; replace the field with 'Defaulted'. The Task name field begins at ; LSTBUF+8. CMPB LSTBUF+8.,#40 ;Is this a blank? BNE 4$ ; No, forget the issue MOV #LSTBUF+8.,R0 ; Yes, put address in R0 MOV #DEFALT,R1 ;Address of default string MOV #9.,R2 ;Byte count of string 2$: MOVB (R1)+,(R0)+ ;Move next character SOB R2,2$ 4$: DIR$ #LSTQIO ;Write line 1 ; ; Line 2: Priority, Creation date, and Extend size MOV L$BPRI(R4),ARGBK2 ;Move priority MOV L$BDAT(R3),ARGBK2+2 ;Move year MOV L$BDAT+2(R3),ARGBK2+4 ;Move month MOV L$BDAT+4(R3),ARGBK2+6 ;Move day MOV L$BEXT(R4),R1 ;Load INC (# 64 byte blocks) ASH #5,R1 ;Convert to # words MOV R1,ARGBK2+10 ;Store for conversion MOV #LSTBUF,R0 ;Load address of output buffer MOV #LINE2,R1 ; descriptor string MOV #ARGBK2,R2 ; argument block CALL $EDMSG ;Format the line MOV R1,LSTQIO+Q.IOPL+2 ;Byte count ; If the first byte of the priority field of the output line is '0', ; replace the field with 'Defaulted'. The priority field begins at ; LSTBUF+7. CMPB LSTBUF+7.,#'0 ;Is this a 0? BNE 8$ ; No MOV #LSTBUF+7.,R0 ; Yes, put address in R0 MOV #DEFALT,R1 ;Address of Default string MOV #9.,R2 ;Byte count of string 6$: MOVB (R1)+,(R0)+ ;Move next character SOB R2,6$ 8$: DIR$ #LSTQIO ; ; Line 3: (NO)CKP, (NO)SLV, and (NO)PMD MOV #LABLK0+L$BFLG,R0 ;Load address of task flag word MOV #CHKCHR,ARGBK3 ;Move address of '/NOCKP' to arg blk BIT #TS$CHK,(R0) ;Test the checkpointable flag bit BNE 10$ ;Bit was set, arg blk is correct MOV #CHKCHR+6,ARGBK3 ;Bit was clear, move address of '/CKP' 10$: MOV #SLVCHR,ARGBK3+2 ;Move address of '/NOSLV' to arg blk BIT #TS$SLV,(R0) ;Test the slave flag bit BEQ 20$ ;Bit was clear, arg blk is correct MOV #SLVCHR+6,ARGBK3+2 ;Bit was set, move address of '/SLV' 20$: MOV #PMDCHR,ARGBK3+4 ;Move address of '/NOPMD' to arg blk BIT #TS$PMD,(R0) ;Test the post mortem dump flag bit BEQ 30$ ;Bit was clear, arg blk is correct MOV #PMDCHR+6,ARGBK3+4 ;Bit was set, move address of '/PMD' 30$: MOV #LSTBUF,R0 ;Address of output line buffer MOV #LINE3,R1 ; descriptor string MOV #ARGBK3,R2 ; argument block CALL $EDMSG ;Format the line MOV R1,LSTQIO+Q.IOPL+2 ;Byte count DIR$ #LSTQIO ;Write line 3 ; DUMMY: ;Dummy label to start another LSB ; ; Line 4: LUN assignments ; ; LUNVAL = Current LUN ; DEVNUM = Table of ASCII device numbers - contains device ; numbers (the 'nn' part of ddnn:LUN) for the 3 ; devices on an output line ; HDRBLK+H.NLUN = Total number of LUNs in the task image ; ; R2 -> next entry in DEVNUM ; R3 -> next entry in ARGBK4 (the $EDMSG argument block) ; R4 -> next entry in the LUN table (label block 1) ; R5 = inner loop counter (incremented each time an assigned LUN is ; processed, cleared when a new output line is started) ; MOV #1,LUNVAL ;LUNVAL is current LUN MOV #LABLK1,R4 ;Pointer into LUN table ; REPEAT UNTIL no more LUNs to write ; Each iteration of this loop writes an output line 10$: MOV #DEVNUM,R2 ;Pointer into device number table MOV #ARGBK4,R3 ;Pointer into argument block CLR R5 ;Clear inner loop counter ; REPEAT UNTIL 3 assigned LUNs processed or current LUN > total LUNs ; Each iteration of this loop processes an entry (assigned or ; unassigned) in the LUN table 20$: CMP LUNVAL,HDRBLK+H.NLUN ;All LUNs processed? BGT 30$ ;Branch if yes TST (R4) ;Any device assigned to this LUN? BEQ 25$ ; No. Try next LUN MOV R4,(R3)+ ;Move addr of device name to arg block MOV 2(R4),R1 ;Move device number to temp ASH #-3,R1 ;Shift off low order octal digit ADD #60,R1 ;Translate high order digit to ASCII MOV 2(R4),R0 ;Move device number to temp BIC #177770,R0 ;Clear all but low order octal digit ADD #60,R0 ;Translate low order digit to ASCII SWAB R0 ;Put low order digit in high byte ADD R0,R1 ;Combine the 2 ASCII device num. bytes MOV R2,(R3)+ ;Put address of device num in arg blk MOV R1,(R2)+ ;Put device number in device num table MOV LUNVAL,(R3)+ ;Put value of current LUN in arg blk INC R5 ;Bump inner loop counter 25$: ADD #4,R4 ;Point to next entry in LUN table INC LUNVAL ;Next LUN CMP R5,#3 ;Do we have a full output line yet BLT 20$ ;No 30$: TST R5 ;Any DDNN:LUN combinations to write? BEQ 100$ ;No MOV #LSTBUF,R0 ;Address of output line buffer MOV #LINE4,R1 ; descriptor string MOV #ARGBK4,R2 ; argument block CALL $EDMSG ;Format the line ; Set QIO byte count based on actual number of DDNN:LUN combinations ; processed by inner loop. CMP R5,#3 ;3 DDNN:LUN combinations? BEQ 50$ ;Yes, use $EDMSG's byte count CLR R2 ;R2 will count the s MOV #1,R0 ;R0 is the number of s to allow CMP R5,#1 ;1 DDNN:LUN combination/ BEQ 40$ ; Yes; R0 is right ADD #2,R0 ; No, count 3 s 40$: CLR R1 ;Start search at 2nd char of LSTBUF 41$: INC R1 ;Point to next character CMPB LSTBUF(R1),#11 ;Is this a ? BNE 41$ ;No, try next character INC R2 ;Count another CMP R0,R2 ;Enough s? BNE 41$ ;No. Find the next one 50$: MOV R1,LSTQIO+Q.IOPL+2 ;Set byte count for QIO DIR$ #LSTQIO ;Write the output line JMP 10$ ;Process the next line 100$: RTS PC ; ; LSTQIO: QIOW$ IO.WVB,LUNTI,LUNTI,,,, LSTBUF: .BLKB 80. .NLIST BEX HT=11 ;ASCII horizantal tab LINE1: .ASCIZ \/TASK:%S%2R%4S\ \/PAR:%S%2R\ \/UIC:%S%B:%B\ LINE2: .ASCIZ \/PRI:%S%M.%9S\ \/CRD:%S%Y\ \/INC:%S%M.\ LINE3: .ASCIZ \%6A\ \%6A\ \%6A\ LINE4: .ASCII \/ASG:%S%2A%2A:%M\ \:\ \%2A%2A:%M\ \:\ .ASCIZ \%2A%2A:%M\ .LIST BEX .EVEN ; ARGBK1: .BLKW 2 ;Radix-50 task name .BLKW 2 ;Radix-50 partition name .WORD HDRBLK+H.DUIC+1 ;Address of UIC (group) .WORD HDRBLK+H.DUIC ; (member) ARGBK2: .BLKW 3 ;Binary creation date .BLKW 1 ;INC .BLKW 1 ;PRI ARGBK3: .BLKW 3 ;3 addresses of strings '/(NO)SLV, PMD + CKP' ARGBK4: .BLKW 9. ;3 * (dev name addr, dev. num addr, LUN value) .NLIST BEX DEFALT: .ASCII \Defaulted\ CHKCHR: .ASCII \/NOCKP/CKP \ SLVCHR: .ASCII \/NOSLV/SLV \ PMDCHR: .ASCII \/NOPMD/PMD \ .EVEN .LIST BEX LUNVAL: .BLKW 1 ;Current LUN value DEVNUM: .BLKW 3 ;Device number table ; ; .PAGE .SBTTL Error messages ; ; ; ERROR PROCESSING ; ERRQIO: QIOW$ IO.WVB,LUNTI,LUNTI,,,,<,,40> ;For TI: error messages ; .NLIST BEX ; CLIOEM: .ASCII \ TAT -- Unable to read command line. I/O error code = \ CLIOEC: .BLKB 6 CLIOML =.-CLIOEM ; CFOPEM: .ASCII \ TAT -- Command file open error. I/O error code = \ CFOPEC: .BLKB 6 CFOPML =.-CFOPEM ; WRITEM: .ASCII \ TAT -- Task image file write error. I/O error code = \ WRITEC: .BLKB 6 WRITML =.-WRITEM ; CLOSEM: .ASCII \ TAT -- Task image file close error. I/O error code = \ CLOSEC: .BLKB 6 CLOSML =.-CLOSEM ; OPENEM: .ASCII \ TAT -- Task image file open error. I/O error code = \ OPENEC: .BLKB 6 OPENML =.-OPENEM ; READEM: .ASCII \ TAT -- Task image file read error. I/O error code = \ READEC: .BLKB 6 READML =.-READEM ; PRIVEM: .ASCII \ TAT -- Cannot open task image file - Privelege violation\ PRIVML =.-PRIVEM ; NSFLEM: .ASCII \ TAT -- Cannot open task image file - No such file\ NSFLML =.-NSFLEM ; MNDEEM: .ASCII \ TAT -- Max indirect file nesting depth exceeded\ MNDEML =.-MNDEEM ; IFNSEM: .ASCII \ TAT -- Syntax error in indirect file name\ IFNSML =.-IFNSEM ; UNKNEM: .ASCII \ TAT -- Unknown error in command input\ UNKNML =.-UNKNEM ; CMLSEM: .ASCII \ TAT -- Command line syntax error\ CMLSML =.-CMLSEM ; IVSWEM: .ASCII \ TAT -- Invalid switch\ IVSWML =.-IVSWEM ; NFSPEM: .ASCII \ TAT -- No task image filespec supplied\ NFSPML =.-NFSPEM ; TKNMEM: .ASCII \ TAT -- Invalid task name\ TKNMML =.-TKNMEM ; PRNMEM: .ASCII \ TAT -- Invalid partition name\ PRNMML =.-PRNMEM ; UICEM: .ASCII \ TAT -- Invalid UIC\ UICML =.-UICEM ; PRIEM: .ASCII \ TAT -- Invalid priority\ PRIML =.-PRIEM ; INCEM: .ASCII \ TAT -- Invalid increment\ INCML =.-INCEM ; ASGEM: .ASCII \ TAT -- Invalid assign\ ASGML =.-ASGEM ; ; .END TAT