.TITLE CVTLIS .IDENT /V2.3/ ;+ ; ; Copyright © 1990, 1993 by Hunter Goatley. All rights reserved. ; Permission granted for non-profit distribution. ; ;- ;++ ; ; Facility: CVTLIS ; ; Author: Hunter Goatley ; VMS Systems Programmer ; Western Kentucky University ; Bowling Green, KY 42101 ; E-mail: goathunter@WKUVX1.BITNET ; ; Date: June 13, 1990 ; ; Functional Description: ; ; This program converts DEC's .LIS files from the Source Listings ; on CD back to the appropriate source files. The following file ; types are recognized: ; ; Language Type Output file type ; --------- ---- ---------------- ; MACRO-32 (VAX) .MAR ; AMACRO-32 (AXP) .MAR ; BLISS-32 (VAX) .B32 ; BLISS-32E (AXP) .B32E ; BLISS-64 (AXP) .B64 ; MACRO-64 (AXP) .M64 ; VAX C (VAX) .C ; DEC C (AXP) .C ; MESSAGE (VAX/AXP) .MSG ; PL/I (VAX) .PLI ; Pascal (VAX) .PAS ; ; Highly dependent on the .LIS format produced for the source listings ; CDs. Fortunately, most of the VMS programmers follow rigorous ; source code formats, so this program will successfully convert ; most listing files. ; ; Modified by: ; ; V2.3 Hunter Goatley 9-JUL-1993 20:02 ; Ah, they changed one on me. Once MACRO-64 went into ; release V1.0, the header ID changed from "Alpha MACRO-64" ; to just "MACRO-64". Both are handled now. ; ; Also added more checks to handle .MAR files better (leaving ; out macro expansions, handling files with no machine ; code listings, etc.). Added .BRANCH_* directives for AXP. ; ; V2.2 Hunter Goatley 29-APR-1993 12:00 ; I just can't stop. Modified AMACRO to handle compiler ; warnings and infos. Changed processing for non-MACRO ; languages. Changed detection of end of BLISS-32 files. ; Added PL/I and Pascal. ; ; V2.1 Hunter Goatley 28-APR-1993 11:31 ; Add support for SDL and fix stupid error that broke MACRO. ; ; V2.0 Hunter Goatley 27-APR-1993 10:17 ; Added support for all the AXP languages and MESSAGE files. ; ; 01-003 Hunter Goatley 25-APR-1993 17:50 ; Add a few extra checks to try to better handle non-conformant ; BLISS modules. ; ; 01-002 Hunter Goatley 22-APR-1993 07:10 ; Ported to compile and run under OpenVMS AXP (still processing ; VAX .LIS files). Fixed .C check for end of file so that ; it really stops when it finds "Command Line". ; ; 01-001 Hunter Goatley 5-JUL-1990 11:36 ; Added support for VAX C listings. Modified MACRO to handle ; multiple .SBTTL records without putting a before each ; one. Also modified MACRO to comment out macro expansions ; in the code (previously, there was no distinction; now the ; expansions are still in-line, but commented out). ; ; 01-000 Hunter Goatley 13-JUN-1990 11:31 ; Original version. ; ;-- ; ; Define ALPHA if R22 is a register and not a symbol ; .NTYPE ...IS_IT_ALPHA,R22 ;Get the type of R22 ...IS_IT_ALPHA = <...IS_IT_ALPHA@-4&^XF>-5 .IIF EQ,...IS_IT_ALPHA, ALPHA=1 .DSABL GLOBAL ; Declare external references .ENABL SUPPRESSION ; Don't list unreference symbols .NOSHOW BINARY ; Include binary in listings ; ; External routines: ; .EXTRN LIB$GET_FOREIGN ; Get foreign DCL command line .EXTRN LIB$PUT_OUTPUT ; Write to SYS$OUTPUT .EXTRN FPARSE ; File parse $DSCDEF ; Descriptor symbols $FABDEF ; File Access Block symbols $NAMDEF ; Name Block symbols $RABDEF ; Record Access Block symbols $RMSDEF ; RMS status symbols $SSDEF ; System service status symbols .SHOW BINARY ; Include binary in listings .MACRO READ RABADDR,ERR,EOF=0,?LAB1,?LAB2 ;* Read using $GET with error $GET RAB=RABADDR ; Get the record CMPL #RMS$_EOF,R0 ; Was it end of file? BNEQ LAB2 ; Branch if not to handle error MOVL #SS$_NORMAL,R0 ; Convert it to "OK" .IF EQ EOF ;* EOF hander not given... LAB1: BRW ERR ; Branch to return OK LAB2: BLBC R0,LAB1 ; Branch if error occurred .IFF ;* EOF handler given BRW EOF ; Branch to EOF handler LAB2: BLBS R0,LAB1 ; Check for success BRW ERR ; Branch to error handler if not LAB1: .ENDC ;* End of EOF check .ENDM READ ;* End of READ macro .MACRO PUT_FF RABREG,?HERE ;* Write out a TSTW RAB$W_RSZ(RABREG) ; Was last record a null? BRANCH_UNLIKELY BEQL HERE ; Don't do another one, if so CLRW RAB$W_RSZ(RABREG) ; Write null record first $PUT RAB=(RABREG) ; Write it out to disk HERE: MOVW #FF_LEN,RAB$W_RSZ(RABREG) ; Store length in RAB MOVAB FF_RECORD,RAB$L_RBF(RABREG) ; Store address in RAB $PUT RAB=(RABREG) ; Write it out to disk .ENDM PUT_FF ;* End of PUT_FF macro .MACRO CHECK_FF REG=R5,?HERE CMPL #55,REG ; Full page? BRANCH_UNLIKELY BLEQ HERE ; Branch if so PUT_FF RABREG=R11 ; Print a to file HERE: CLRL REG ; Clear line counter .ENDM CHECK_FF .MACRO CHECK_FF2 REG=R5,?HERE CMPL #55,REG ; Full page? BLEQ HERE ; Branch if so MOVL #1,R4 HERE: CLRL REG ; Clear line counter .ENDM CHECK_FF2 .MACRO PUT_FF2 RABREG=R11,?HERE BLBC R4,HERE ; Branch if no needed PUT_FF RABREG CLRL R4 ; Clear indicator HERE: .ENDM PUT_FF2 .MACRO BRANCH_LIKELY .IIF DF,ALPHA, .BRANCH_LIKELY .ENDM BRANCH_LIKELY .MACRO BRANCH_UNLIKELY .IIF DF,ALPHA, .BRANCH_UNLIKELY .ENDM BRANCH_UNLIKELY .MACRO ON_ERR DEST,?LAB BRANCH_LIKELY BLBS R0,LAB BRW DEST LAB: .ENDM ON_ERR .MACRO JSB_ENTRY .IIF DF,ALPHA, .JSB_ENTRY .ENDM JSB_ENTRY TAB = 9 FF = 12 .PSECT CVTLIS_DATA_RD,NOEXE,NOWRT,LONG,SHR CONTENTS: .ASCII /Table of contents/ ; MACRO-32 CONT_LEN = .-CONTENTS .ALIGN LONG SYMBOLS: .ASCII /Symbol table/ ; MACRO-32 SYMBOL_LEN = .-SYMBOLS .ALIGN LONG SBTTL: .ASCII /.SBTTL/ ; MACRO-32 SBTTL_LEN = .-SBTTL .ALIGN LONG LSBTTL: .ASCII /.sbttl/ ; MACRO-32 LSBTTL_LEN = .-LSBTTL .ALIGN LONG SUBTITLE: .ASCII /.SUBTITLE/ ; MACRO-64 SUBTITLE_LEN = .-SUBTITLE .ALIGN LONG FF_RECORD: .ASCII FF_LEN = .-FF_RECORD .ALIGN LONG RTNSIZ: .ASCII /; Routine Size: / ; BLISS-32 RTNSIZ_LEN = .-RTNSIZ .ALIGN LONG END_B32: .ASCII /;// PSECT SUMMARY/ END_B32_LEN = .-END_B32 .ALIGN LONG END_VAX_C: .ASCII /Command Line/ ; VAX C END_VAX_C_LEN = .-END_VAX_C .ALIGN LONG END_PLI: .ASCII / COMMAND LINE / ; PL/I END_PLI_LEN= .-END_PLI .ALIGN LONG END_PAS: .ASCII /Generated Code/ END_PAS_LEN = .-END_PAS .ALIGN LONG END_PAS2: .ASCII /Pascal Compilation Statistics/ END_PAS2_LEN = .-END_PAS2 .ALIGN LONG END_AXP: .ASCII /Machine Code Listing/ ; All AXP compilers END_AXP_LEN = .-END_AXP .ALIGN LONG MSG_DEFS: .ASCII /Message definitions/ ; MESSAGE MSG_DEFS_LEN = .-MSG_DEFS .ALIGN LONG CDU_ID: .ASCII /VMS Command Definition Utility/ ; CDU CDU_ID_LEN = .-CDU_ID .ALIGN LONG MESSAGE_D: .ASCID /MESSAGE/ .ALIGN LONG AMACRO_D: .ASCID /AMACRO/ .ALIGN LONG MACRO_D: .ASCID /MACRO/ .ALIGN LONG MACRO64_D: .ASCID /MACRO-64/ .ALIGN LONG BLISS_D: .ASCID /BLISS/ .ALIGN LONG BLISS32E_D: .ASCID /BLISS-32E/ .ALIGN LONG BLISS64_D: .ASCID /BLISS-64E/ .ALIGN LONG CC_D: .ASCID /VAX C/ .ALIGN LONG DEC_CC_D: .ASCID /DEC C/ .ALIGN LONG SDL_D: .ASCID /SDL/ .ALIGN LONG CLD_D: .ASCID /CLD/ .ALIGN LONG PLI_D: .ASCID \VAX PL/I\ .ALIGN LONG PASCAL_D: .ASCID /VAX Pascal/ .ALIGN LONG MAR: .ASCID /SYS$DISK:[].MAR/ ; MACRO and AMACRO .ALIGN LONG M64: .ASCID /SYS$DISK:[].M64/ ; Alpha MACRO-64 .ALIGN LONG B32: .ASCID /SYS$DISK:[].B32/ ; VAX BLISS-32 .ALIGN LONG B32E: .ASCID /SYS$DISK:[].B32E/ ; AXP BLISS-32E .ALIGN LONG B64: .ASCID /SYS$DISK:[].B64/ ; AXP BLISS-64 .ALIGN LONG C: .ASCID /SYS$DISK:[].C/ ; DEC C and VAX C .ALIGN LONG MSG: .ASCID /SYS$DISK:[].MSG/ ; MESSAGE .ALIGN LONG SDL: .ASCID /SYS$DISK:[].SDL/ ; SDL .ALIGN LONG CLD: .ASCID /SYS$DISK:[].CLD/ ; CDU .ALIGN LONG PLI: .ASCID /SYS$DISK:[].PLI/ ; PLI .ALIGN LONG PAS: .ASCID /SYS$DISK:[].PAS/ ; VAX Pascal .ALIGN LONG CREATING: .ASCID /Creating !AS file !AS..../ .ALIGN LONG CONVERTED: .ASCID /File !AS converted to file !AS/ .ALIGN LONG PARSE_FILENAME: .LONG 5 ; FPARSE argument list .ADDRESS FILENAME ; ... The file name .ADDRESS INPUT_BUFFER ; ... .LONG 0 ; ... .LONG 0 ; ... .ADDRESS 10$ ; ... The options 10$: .LONG ^B00000100 ; ... Return file name only .PSECT CVTLIS_DATA_RW,NOEXE,WRT,LONG,NOSHR INREC_LEN = 1024 LIS_FAB: $FAB DNM=,- ; Default filename NAM=LIS_NAM,- ; NAM block FAC=,- ; Want to read it SHR= ; Let others read, too LIS_RAB: $RAB FAB=LIS_FAB,- ; FAB is LIS_FAB RAC=SEQ,- ; Sequential file UBF=INREC,- ; Input buffer USZ=INREC_LEN ; Input buffer length OUT_FAB: $FAB DNM=,- ; Default filename FAC=,- ; Want to write to it NAM=OUT_NAM,- ; NAM block FOP=MXV ; Maximize version # OUT_RAB: $RAB FAB=OUT_FAB,- ; FAB is OUT_FAB RAC=SEQ ; Sequential file LIS_NAM: $NAM RSA=LIS_FILENAME, - ; Buffer for resultant filename RSS=NAM$C_MAXRSS ; Resultant string area size OUT_NAM: $NAM RSA=OUT_FILENAME, - ; Buffer for resultant filename RSS=NAM$C_MAXRSS ; Resultant string area size LIS_FILENAME: .BLKB NAM$C_MAXRSS ; Buffer for resultant filename OUT_FILENAME: .BLKB NAM$C_MAXRSS ; Buffer for resultant filename LIS_FILENAME_D: .LONG 0 ; Descriptor for .LIS filename .ADDRESS LIS_FILENAME ; ... OUT_FILENAME_D: .LONG 0 ; Descriptor for output filename .ADDRESS OUT_FILENAME ; ... INREC: .BLKB INREC_LEN ; Input buffer .ALIGN LONG FAO_ARGS: $FAO CTRSTR = CREATING,- ; $FAO arglst for info message OUTBUF = MESSAGE,- ; ... OUTLEN = MESSAGE,- ; ... P1 = 0,- ; No P1... P2 = 0 ; No P2 yet MESSAGE_LEN = 256 MESSAGE: .WORD MESSAGE_LEN ; Descriptor for output buffer .BYTE DSC$K_DTYPE_T ; ... to be used for messages .BYTE DSC$K_CLASS_S ; ... printed to the terminal .ADDRESS .+4 ; ... .BLKB MESSAGE_LEN ; Message output buffer GET_FILE: .LONG 3 ; LIB$GET_FOREIGN arglst .ADDRESS INPUT_BUFFER ; ... Buffer for input .ADDRESS 10$ ; ... The prompt .ADDRESS INPUT_BUFFER ; ... Write length read here 10$: .ASCID /_File: / ; ... The prompt INPUT_BUFFER: .WORD MESSAGE_LEN ; Descriptor for output buffer .BYTE DSC$K_DTYPE_T ; ... to be used for messages .BYTE DSC$K_CLASS_S ; ... printed to the terminal .ADDRESS .+4 ; ... .BLKB MESSAGE_LEN ; Input buffer FILENAME: .WORD 0 ; Descriptor for filename .BYTE DSC$K_DTYPE_T ; ... .BYTE DSC$K_CLASS_D ; ... Dynamic string .LONG 0 ; ... .PSECT CVTLIS_CODE,EXE,NOWRT,LONG,SHR .ENTRY CVTLIS,^M CALLG GET_FILE,G^LIB$GET_FOREIGN ; Ask user for file to convert BRANCH_LIKELY BLBS R0,20$ ; Branch if successful CMPL #RMS$_EOF,R0 ; Did user enter ^Z? BRANCH_UNLIKELY BNEQ 10$ MOVL #SS$_NORMAL,R0 ; Make it OK and return 10$: RET ; Return to caller 20$: TSTW INPUT_BUFFER ; Did user enter anything? BRANCH_UNLIKELY BEQL 10$ ; Just exit if not given MOVAL OUT_RAB,R11 ; Get OUT RAB address MOVAL LIS_RAB,R10 ; Get LIS RAB address MOVAL INREC,R9 ; Get address of input buffer MOVAL OUT_FAB,R3 ; Get OUT FAB address MOVAL LIS_FAB,R2 ; Get LIS FAB address MOVB INPUT_BUFFER,FAB$B_FNS(R2) ; Set the .LIS filename MOVL INPUT_BUFFER+4,FAB$L_FNA(R2) ; ... $OPEN FAB=LIS_FAB ; Open the .LIS file ON_ERR 230$ ; Branch on error $CONNECT RAB=(R10) ; Connect the RAB ON_ERR 220$ ; Branch on error MOVZBW LIS_NAM+NAM$B_RSL,LIS_FILENAME_D ; Store length of result filnam MOVW FAB$W_MRS(R2),FAB$W_MRS(R3) ; Copy the file ORGanization MOVB FAB$B_ORG(R2),FAB$B_ORG(R3) ; Copy the file ORGanization MOVB FAB$B_RAT(R2),FAB$B_RAT(R3) ; Copy the Record ATtributes MOVB FAB$B_RFM(R2),FAB$B_RFM(R3) ; Copy the Record ForMat CALLG PARSE_FILENAME,FPARSE ; Parse out the file name ON_ERR 220$ ; Branch on error MOVB FILENAME,FAB$B_FNS(R3) ; Set the file name MOVL FILENAME+4,FAB$L_FNA(R3) ; ... in the FAB ; READ RABADDR=(R10),ERR=210$ ; Read a record ; ; Determine if the .LIS is from MACRO or BLISS. This is done by checking ; the first line in the file: if only one character, a , .LIS file was ; produced by BLISS; otherwise, .LIS file was produced by MACRO. ; ; Pretty simple, but it works for DEC's listings on CD. ; ; SDL files appear to start with a null line. ; ; MESSAGE files look like MACRO files, so there's a special check. ; CLRL R0 ; Assume file is MACRO listing TSTW RAB$W_RSZ(R10) ; Was anything read? BRANCH_UNLIKELY BEQL 70$ ; Branch if not (SDL?) CMPW #1,RAB$W_RSZ(R10) ; Was there only one character? BGTR 40$ ; Branch if not even 1 character BNEQ 30$ ; Branch if not BLISS MOVL #1,R0 ; Make it BLISS 30$: CMPB #FF,INREC ; See if it's a 40$: BEQL 50$ ; Continue if equal BRW 130$ ; Unrecognized file, if not 50$: BLBS R0,70$ ; Branch if BLISS CMPC3 #MSG_DEFS_LEN,MSG_DEFS,INREC+33 ; Is it a MESSAGE file? BNEQU 60$ ; Branch if not MOVAL OUT_FAB,R3 ; Get OUT FAB address BSBW DO_MESSAGE ; Go do a MESSAGE file BRW 120$ ; Leave 60$: MOVAL OUT_FAB,R3 ; Get OUT FAB address BSBW MACRO ; Go do a MACRO file BRB 120$ ; Branch around BLISS call 70$: READ RABADDR=(R10),ERR=210$ ; Read a record CMPL #^A/SDL /,INREC+84 ; Is it "SDL"? BNEQ 80$ ; Branch if not BSBW DO_SDL ; Go do it BRW 210$ ; Branch to return 80$: CMPL #^A/VAX /,INREC+88 ; See if we find "VAX C" BNEQ 100$ ; Branch if not VAX C CMPW #^A/C /,INREC+92 ; ... BNEQ 90$ ; ... BSBW VAX_C ; Go do a VAX C file BRW 210$ ; Branch to return 90$: CMPL #^A"PL/I",INREC+92 ; Is it "PL/I"? BNEQ 100$ ; Branch if not BSBW DO_PLI ; Do a PL/1 file BRW 210$ 100$: MATCHC #CDU_ID_LEN,CDU_ID,- ; See if this is "VMS Command RAB$W_RSZ(R10),INREC ; ... Definition Utility" BNEQ 110$ ; Branch if not BSBW DO_CLD ; Go do CLD BRW 210$ 110$: BSBW BLISS ; Go do a BLISS file 120$: BRW 210$ ; Branch to return ; ; If here, it might be an AXP listing file. Check it out. ; 130$: CMPL #^A/AMAC/,INREC+88 ; Is it compiled MACRO-32? BNEQ 140$ ; Branch if not BSBW AMACRO ; Go do a MACRO file BRW 210$ 140$: CMPL #^A/BLIS/,INREC+88 ; Is it a BLISS-32E file? BNEQ 160$ ; Branch if not CMPL #^A/S-32/,INREC+92 ; ... BNEQ 150$ ; ... CMPB #^A/E/,INREC+96 ; ... BNEQ 150$ ; ... BSBW BLISS32E ; Go do BLISS-32E BRW 210$ 150$: CMPL #^A/S-64/,INREC+92 ; Is it BLISS-64? BNEQ 160$ ; ... CMPB #^A/E/,INREC+96 ; ... BNEQ 160$ ; ... BSBW BLISS64 ; Go do BLISS-64 BRW 210$ 160$: CMPL #^A/DEC /,INREC+88 ; See if we find "DEC C" BNEQ 170$ ; Branch if not DEC C CMPB #^A/C/,INREC+92 ; ... BNEQ 170$ ; ... BSBW DEC_C ; Go do a DEC C file BRW 210$ ; Branch to return 170$: CMPL #^A/Alph/,INREC+88 ; Is it "Alpha MACRO-64"? BNEQ 180$ ; Branch if not CMPL #^A/a MA/,INREC+92 ; ... BNEQ 180$ ; ... CMPL #^A/CRO-/,INREC+96 ; ... BNEQ 180$ ; ... CMPW #^A/64/,INREC+100 ; ... BNEQ 180$ ; ... BSBW MACRO64 ; Go do MACRO-64 BRW 210$ 180$: CMPL #^A/MACR/,INREC+88 ; Is it "Alpha MACRO-64"? BNEQ 190$ ; Branch if not CMPL #^A/O-64/,INREC+92 ; ... BNEQ 190$ ; ... BSBW MACRO64 ; Go do MACRO-64 BRB 210$ 190$: CMPL #^A/VAX /,INREC+88 ; Is it "VAX Pascal"? BNEQ 200$ ; Branch if not CMPL #^A/Pasc/,INREC+92 ; ... BNEQ 200$ ; ... BSBW DO_PASCAL ; Go do VAX Pascal BRB 210$ ; ... 200$: CLRL R0 210$: PUSHL R0 ; Save status $CLOSE FAB=OUT_FAB ; Close .MAR file POPL R0 ; Restore status 220$: PUSHL R0 ; Save status $CLOSE FAB=LIS_FAB ; Close .MAR file POPL R0 ; Restore status BRANCH_UNLIKELY BLBC R0,230$ ; Branch on error MOVAL CONVERTED,FAO_ARGS+FAO$_CTRSTR ; Set control string address MOVAL LIS_FILENAME_D,FAO_ARGS+FAO$_P1 ; Set P1 MOVAL OUT_FILENAME_D,FAO_ARGS+FAO$_P2 ; Set P2 MOVW #MESSAGE_LEN,MESSAGE ; Reset length of output buffer $FAO_G FAO_ARGS ; Format the output string BRANCH_UNLIKELY BLBC R0,230$ ; Branch on error PUSHAQ MESSAGE ; Write it to SYS$OUTPUT CALLS #1,G^LIB$PUT_OUTPUT ; ... 230$: RET ; Return to caller .PAGE .SBTTL BLISS ;+ ; ; Routine: BLISS ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by BLISS-32. Parsing stops when the "PSECT SUMMARY" record is found. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ;- BLISS: JSB_ENTRY MOVAL BLISS_D,R1 ; R1 -> ASCII string "BLISS" MOVAL B32,R2 ; R2 -> .B32 default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 80$ ; Branch on error CLRL R5 ; Clear line counter MOVL #3,R7 ; Skip next four records, too 10$: READ RABADDR=(R10),ERR=80$ ; Read a record SOBGTR R7,10$ ; Loop if need to read more TSTW RAB$W_RSZ(R10) ; Was anything returned? BRANCH_LIKELY BNEQ 20$ BRW 90$ ; Branch to write nothing out 20$: CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 30$ ; Branch if not CHECK_FF MOVL #4,R7 ; Skip next four records, too BRB 10$ ; Loop to read next four 30$: CMPB #^A/;/,(R9) ; Is 1st char. a ";"? BNEQ 10$ ; Branch if not MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size 40$: CMPB #^A/9/,3(R9) ; Is this some error message? BLSSU 10$ ; Skip if not " " or number MOVL #1,R7 ; Not skipping any records SUBL2 #12,R6 ; Subtract 16 from it BRANCH_LIKELY BGEQ 60$ ; Branch if something to write 50$: CLRL R6 ; Make length 0 if it went negative 60$: MOVW R6,RAB$W_RSZ(R11) ; Copy the record size MOVAL 12(R9),RAB$L_RBF(R11) ; And the buffer address $PUT RAB=(R11) ; Write the record out INCL R5 ; Bump line counter 70$: BRW 10$ ; Loop to read next record 80$: RSB ; Return to caller ; ; We've encounted the null lines that precede the MACRO instructions in ; the listing. Read and ignore all lines until we encounter a line that ; looks like the following line: ; ; "; Routine Size: 512 bytes, Routine Base: $CODE$ + 0000" ; ; At this point, there should be two null records and then a header ; record introducing the next routine. Read all records until the ; line and then rejoin the common processing code above. ; 90$: READ RABADDR=(R10),ERR=80$ ; Read a record CMPW #RTNSIZ_LEN,RAB$W_RSZ(R10) ; Big enough to be RTNSIZ? BRANCH_UNLIKELY BGTR 90$ ; Just go on to next record CMPB #^A/;/,(R9) ; Is first char a ";"? BNEQ 90$ ; No - haven't found RTNSIZ ; See if we've encounted end-of-module ("ELUDOM"). Another way is to ; read until we encounter ";PSECT SUMMARY". ; CMPW #END_B32_LEN,RAB$W_RSZ(R10) ; Record big enough for it? BRANCH_UNLIKELY BGTR 100$ ; Branch if not CMPC3 #END_B32_LEN,END_B32,(R9) ; Is it ";PSECT SUMMARY"? BRANCH_UNLIKELY BNEQ 100$ ; Branch if not MOVL #SS$_NORMAL,R0 ; Set success status BRB 80$ ; Branch to return 100$: READ RABADDR=(R10),ERR=80$ ; Read a record TSTW RAB$W_RSZ(R10) ; Is there a length? BEQL 100$ ; Yes - go process it normally BRW 20$ ; Rejoin common code .PAGE .SBTTL MACRO ;+ ; ; Routine: MACRO ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by MACRO. It skips the table of contents (labeled by "Table of ; contents" in the header record) and processes the file up to the ; symbol table listing (denoted by "Symbol table"). ; ; Form-feeds are inserted before all .SBTTL records (beginning with ; ".SBTTL"). ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MAR file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- MACRO: JSB_ENTRY MOVAL MACRO_D,R1 ; R1 -> ASCII string "MACRO" MOVAL MAR,R2 ; R2 -> .MAR default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 100$ ; Branch on error CLRL R5 ; Clear multiple .SBTTL flag MOVL #3,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=100$ ; Read a record CMPC3 #CONT_LEN,CONTENTS,(R9) ; Found table of contents? BRANCH_LIKELY BNEQ 20$ ; Branch if not found BRW 110$ ; Branch out of line if found 20$: CMPC3 #SYMBOL_LEN,SYMBOLS,(R9) ; Found symbol table (EOF)? BRANCH_UNLIKELY BNEQ 30$ ; Branch out of line if found MOVL #SS$_NORMAL,R0 ; Set success status BRW 100$ ; And return 30$: SOBGTR R7,10$ ; Loop if need to read more CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 40$ ; Branch if not MOVL #3,R7 ; Skip next three records, too BRB 10$ ; Go skip header lines 40$: MOVL #1,R7 ; Read only one record MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size SUBL2 #48,R6 ; Subtract 48 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if negative - null rec ; ; Check to see if this is a .SBTTL record. If so, write out a unless ; this is the second or third in a multiple .SBTTL sequence. For example, ; DEC has started using the following sequence, which this code handles: ; ; .SBTTL + ; .SBTTL The pluses make the table of contents pretty ; .SBTTL + ; CMPL #SBTTL_LEN,R6 ; Is record even big enough? BRANCH_UNLIKELY BGTR 60$ ; Branch if too small for SBTTL CMPC3 #SBTTL_LEN,SBTTL,48(R9) ; Is this a ".SBTTL" record? BRANCH_UNLIKELY BEQL 50$ ; Branch if not CMPC3 #LSBTTL_LEN,LSBTTL,48(R9) ; Is this a ".sbttl" record? BRANCH_LIKELY BNEQ 60$ ; Branch if not 50$: BBSS #0,R5,70$ ; Branch if multiple .SBTTL PUT_FF RABREG=R11 ; Write out a BRB 70$ ; Skip on to next 60$: CLRL R5 ; Clear multiple .SBTTL flag 70$: MOVW R6,RAB$W_RSZ(R11) ; Copy the record size to RAB ; ; Now handle macro expansions. These lines do not have line numbers, so ; we can check to see if there is a blank word at offset 46. If so, stick ; a comment character in position 47 and write from there. ; CMPW #^X2020,46(R9) ; Is there a line number? BRANCH_UNLIKELY BEQL 90$ ; Branch out of line if not MOVAL 48(R9),RAB$L_RBF(R11) ; And the buffer address 80$: $PUT RAB=(R11) ; Write the record out BRW 10$ ; Loop to read next record 90$: MOVB #^A/;/,47(R9) ; Store a comment character MOVL R9,RAB$L_RBF(R11) ; Do in two steps to avoid ADDL2 #47,RAB$L_RBF(R11) ; ... AXP "unaligned" warning INCW RAB$W_RSZ(R11) ; Bump length to include it too BRB 80$ ; ... 100$: RSB ; Return to caller ; ; Read all table of contents records - just throw them away ; 110$: READ RABADDR=(R10),ERR=100$ ; Read a record TSTW RAB$W_RSZ(R10) ; Was anything returned? BEQL 110$ ; No - go read next CMPB #FF,(R9) ; Is it a new ? BNEQ 110$ ; Branch to start over if so BRW 10$ ; Branch back to common code .PAGE .SBTTL CREATE_FILE ;+ ; ; Routine: CREATE_FILE ; ; Functional Description: ; ; Create the appropriate output file in the default directory. ; ; Environment: ; ; Called via BSBW. ; ; Inputs: ; ; R1 -> MACRO or BLISS or CC ; R2 -> MAR or B32 or C ; R3 -> FAB ; R11 -> RAB ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; ; Side effects: ; ; ;- CREATE_FILE: JSB_ENTRY MOVL R1,FAO_ARGS+FAO$_P1 ; Set type in $FAO arguments MOVL 4(R2),FAB$L_DNA(R3) ; Set default name extension MOVB (R2),FAB$B_DNS(R3) ; ... $CREATE FAB=(R3) ; Open the .MAR file BRANCH_UNLIKELY BLBC R0,10$ ; Branch on error $CONNECT RAB=(R11) ; Connect the RAB BRANCH_UNLIKELY BLBC R0,10$ ; Branch on error MOVZBW OUT_NAM+NAM$B_RSL,OUT_FILENAME_D; Set length in descriptor MOVAL CREATING,FAO_ARGS+FAO$_CTRSTR ; Set control string MOVAL OUT_FILENAME_D,FAO_ARGS+FAO$_P2 ; Set second argument list MOVW #MESSAGE_LEN,MESSAGE ; Reset length of message buffer $FAO_G FAO_ARGS ; Format the output string BRANCH_UNLIKELY BLBC R0,10$ ; Branch on error PUSHAQ MESSAGE ; Write it to SYS$OUTPUT CALLS #1,G^LIB$PUT_OUTPUT ; ... 10$: RSB ; Return to caller .PAGE .SBTTL VAX_C ;+ ; ; Routine: VAX_C ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by VAX C. Parsing stops when a "Command Line" record is found. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ;- VAX_C: JSB_ENTRY MOVAL CC_D,R1 ; R1 -> ASCII string "VAX C" MOVAL C,R2 ; R2 -> .C default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 50$ ; Branch on error CLRL R5 ; Clear line counter MOVL #5,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=50$ ; Read a record SOBGTR R7,10$ ; Loop if need to read more TSTW RAB$W_RSZ(R10) ; Was anything returned? BRANCH_UNLIKELY BEQL 10$ ; Branch if nothing to write out CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 20$ ; Branch if not CHECK_FF ; See if is needed MOVL #4,R7 ; Skip next three records, too BRB 10$ ; Loop to read next four 20$: MOVL #1,R7 ; Not skipping any records MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size ; ; See if we've encounted end-of-file. If so, record will be "Command Line". ; CMPL #END_VAX_C_LEN,R6 ; Record same size? BRANCH_UNLIKELY BEQL 40$ ; Branch out of line if so 30$: SUBL2 #14,R6 ; Subtract 14 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if nothing to write MOVW R6,RAB$W_RSZ(R11) ; Copy the record size MOVL R9,RAB$L_RBF(R11) ; Do in two steps to avoid ADDL2 #14,RAB$L_RBF(R11) ; ... AXP "unaligned" warning $PUT RAB=(R11) ; Write the record out INCL R5 ; Bump line counter BRW 10$ ; Loop to read next record 40$: CMPC3 #END_VAX_C_LEN,END_VAX_C,(R9) ; Is it "Command Line"? BRANCH_UNLIKELY BNEQ 30$ ; Branch if not MOVL #SS$_NORMAL,R0 ; Set success status 50$: RSB ; Return to caller .PAGE .SBTTL BLISS32E ;+ ; ; Routine: BLISS32E ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by DEC C. Parsing stops when a "Machine Code Listing" header is ; found. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ;- BLISS32E: JSB_ENTRY MOVAL BLISS32E_D,R1 ; R1 -> ASCII string "BLISS-32E" MOVAL B32E,R2 ; R2 -> .B32E default file spec BSBB DO_AXP_BLISS ; Go do common code RSB ; Return to caller BLISS64: JSB_ENTRY MOVAL BLISS64_D,R1 ; R1 -> ASCII string "BLISS-64E" MOVAL B64,R2 ; R2 -> .B64 default file spec BSBB DO_AXP_BLISS ; Go do common code RSB ; Return to caller DO_AXP_BLISS: JSB_ENTRY MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 80$ ; Branch on error CLRL R4 ; Clear indicator CLRL R5 ; Clear line counter MOVL #3,R7 ; Skip next two records, too 10$: READ RABADDR=(R10),ERR=80$ ; Read a record CMPL #1,R7 ; Processing a header? BRANCH_UNLIKELY BGEQ 20$ ; If not, don't check for end ; ; The end of a BLISS-32E module is determined by finding a header that ; says "Machine Code Listing". If we find that, stop processing the file. ; CMPC3 #END_AXP_LEN,END_AXP,32(R9) ; Found end? BRANCH_UNLIKELY BNEQ 20$ ; Branch out of line if found MOVL #SS$_NORMAL,R0 ; Set success status BRW 80$ ; And return 20$: SOBGTR R7,10$ ; Loop if need to read more 30$: CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_UNLIKELY BNEQ 40$ ; Branch if not CHECK_FF2 ; See if is needed MOVL #4,R7 ; Skip next four records, too BRB 10$ ; Loop to read next four 40$: MOVL #1,R7 ; Not skipping any records MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size SUBL2 #14,R6 ; Subtract 16 from it BRANCH_LIKELY BGEQ 60$ ; Branch if something to write 50$: CLRL R6 ; Make length 0 if it went neg 60$: PUT_FF2 ; Write a out, if needed MOVW R6,RAB$W_RSZ(R11) ; Copy the record size MOVL R9,RAB$L_RBF(R11) ; Store buffer address in two ADDL2 #14,RAB$L_RBF(R11) ; ... inst to avoid AXP warning $PUT RAB=(R11) ; Write the record out INCL R5 ; Bump line counter 70$: BRW 10$ ; Loop to read next record 80$: RSB ; Return to caller .PAGE .SBTTL AMACRO ;+ ; ; Routine: AMACRO ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by MACRO. It processes the file up to the "Machine Code Listing" ; header. ; ; Form-feeds are inserted before all .SBTTL records (beginning with ; ".SBTTL"). ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MAR file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- AMACRO: JSB_ENTRY MOVAL AMACRO_D,R1 ; R1 -> ASCII string "AMACRO" MOVAL MAR,R2 ; R2 -> .MAR default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 90$ ; Branch on error CLRL R5 ; Clear multiple .SBTTL flag MOVL #3,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=90$ ; Read a record CMPL #1,R7 ; Processing a header? BGTRU 30$ ; If not, don't check for end ; ; The end of a compiled MACRO module is determined by finding a header that ; says "Machine Code Listing". If we find that, stop processing the file. ; CMPC3 #END_AXP_LEN,END_AXP,32(R9) ; Found end? BRANCH_UNLIKELY BEQL 20$ ; Branch if so CMPC3 #SYMBOL_LEN,SYMBOLS,32(R9) ; Check for "Symbol table" BRANCH_LIKELY BNEQ 30$ ; Branch out of line if found 20$: MOVL #SS$_NORMAL,R0 ; Set success status BRW 90$ ; And return 30$: SOBGTR R7,10$ ; Loop if need to read more CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 40$ ; Branch if not MOVL #3,R7 ; Skip next three records, too BRB 10$ ; Go skip header lines 40$: MOVL #1,R7 ; Read only one record MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size SUBL2 #39,R6 ; Subtract 39 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if negative - null rec CMPB #^A/ /,37(R9) ; Does it have a blank line #? BRANCH_UNLIKELY BEQL 10$ ; Skip if so CMPB #TAB,31(R9) ; Is there a tab and no line #? BRANCH_UNLIKELY BEQL 10$ ; Branch if so CMPL #^A/%AMA/,(R9) ; Is this a compiler message? BRANCH_UNLIKELY BEQL 10$ ; Skip if so CMPL #^A/-MAC/,(R9) ; Continued message? BRANCH_UNLIKELY BEQL 10$ ; Skip if so ; ; Check to see if this is a .SBTTL record. If so, write out a unless ; this is the second or third in a multiple .SBTTL sequence. For example, ; DEC has started using the following sequence, which this code handles: ; ; .SBTTL + ; .SBTTL The pluses make the table of contents pretty ; .SBTTL + ; CMPL #SBTTL_LEN,R6 ; Is record even big enough? BRANCH_UNLIKELY BGTR 60$ ; Branch if too small for SBTTL CMPC3 #SBTTL_LEN,SBTTL,39(R9) ; Is this a ".SBTTL" record? BRANCH_UNLIKELY BEQL 50$ ; Branch if not CMPC3 #LSBTTL_LEN,LSBTTL,39(R9) ; Is this a ".sbttl" record? BRANCH_LIKELY BNEQ 60$ ; Branch if not 50$: BBSS #0,R5,70$ ; Branch if multiple .SBTTL PUT_FF RABREG=R11 ; Write out a BRB 70$ ; Skip on to next 60$: CLRL R5 ; Clear multiple .SBTTL flag 70$: MOVW R6,RAB$W_RSZ(R11) ; Copy the record size to RAB ; ; Now handle macro expansions. These lines do not have line numbers, so ; we can check to see if there is a blank word at offset 46. If so, stick ; a comment character in position 47 and write from there. ; MOVL R9,RAB$L_RBF(R11) ; Store buffer address in two ADDL2 #39,RAB$L_RBF(R11) ; ... inst to avoid AXP warning 80$: $PUT RAB=(R11) ; Write the record out BRW 10$ ; Loop to read next record 90$: RSB ; Return to caller .PAGE .SBTTL DO_MESSAGE ;+ ; ; Routine: DO_MESSAGE ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by MESSAGE. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- DO_MESSAGE: JSB_ENTRY MOVAL MESSAGE_D,R1 ; R1 -> ASCII string "MESSAGE" MOVAL MSG,R2 ; R2 -> .MSG default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 60$ ; Branch on error CLRL R5 ; Clear line counter MOVL #3,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=60$ ; Read a record TSTW RAB$W_RSZ(R10) ; Was anything read? EOF? BRANCH_LIKELY BNEQ 20$ ; Branch out of line if found MOVL #SS$_NORMAL,R0 ; Set success status BRW 60$ ; And return 20$: SOBGTR R7,10$ ; Loop if need to read more CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 30$ ; Branch if not CHECK_FF ; See if is needed MOVL #3,R7 ; Skip next three records, too BRB 10$ ; Go skip header lines 30$: MOVL #1,R7 ; Read only one record MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size SUBL2 #40,R6 ; Subtract 40 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if negative - null rec 40$: MOVW R6,RAB$W_RSZ(R11) ; Copy the record size to RAB MOVAL 40(R9),RAB$L_RBF(R11) ; And the buffer address 50$: $PUT RAB=(R11) ; Write the record out INCL R5 ; Bump line counter BRW 10$ ; Loop to read next record 60$: RSB ; Return to caller .PAGE .SBTTL DEC_C ;+ ; ; Routine: DEC_C ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by DEC C. Parsing stops when a "Machine Code Listing" header is ; found. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ;- DEC_C: JSB_ENTRY MOVAL DEC_CC_D,R1 ; R1 -> ASCII string "DEC C" MOVAL C,R2 ; R2 -> .C default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 50$ ; Branch on error CLRL R4 ; Clear indicator CLRL R5 ; Clear line counter MOVL #3,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=50$ ; Read a record CMPL #1,R7 ; Processing a header? BRANCH_UNLIKELY BGEQU 20$ ; If not, don't check for end ; ; The end of a DEC C module is determined by finding a header that says ; "Machine Code Listing". If we find that, stop processing the file. ; CMPC3 #END_AXP_LEN,END_AXP,32(R9) ; Found end? BRANCH_UNLIKELY BNEQ 20$ ; Branch out of line if found MOVL #SS$_NORMAL,R0 ; Set success status BRW 50$ ; And return 20$: SOBGTR R7,10$ ; Loop if need to read more TSTW RAB$W_RSZ(R10) ; Was anything returned? BRANCH_UNLIKELY BEQL 10$ ; Branch if nothing to write out CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 30$ ; Branch if not CHECK_FF2 ; See if is needed MOVL #4,R7 ; Skip next three records, too BRB 10$ ; Loop to read next four 30$: MOVL #1,R7 ; Not skipping any records MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size MOVL #9,R0 ; Assume length of 9 CMPB #TAB,(R9) ; Is the first char a ? BEQL 40$ ; Branch if so MOVL #16,R0 ; Make it 16 if not a 40$: SUBL2 R0,R6 ; Subtract from total length BRANCH_UNLIKELY BLSS 10$ ; Branch if nothing to write PUT_FF2 ; Write , if needed MOVW R6,RAB$W_RSZ(R11) ; Copy the record size MOVL R9,RAB$L_RBF(R11) ; Do in two steps to avoid ADDL2 R0,RAB$L_RBF(R11) ; ... AXP "unaligned" warning $PUT RAB=(R11) ; Write the record out INCL R5 ; Bump line counter BRW 10$ ; Loop to read next record 50$: RSB ; Return to caller .PAGE .SBTTL MACRO64 ;+ ; ; Routine: MACRO64 ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by MACRO-64. It skips the table of contents (labeled by "Table of ; contents" in the header record) and processes the file up to the ; symbol table listing (denoted by "Symbol table"). ; ; Form-feeds are inserted before all .SBTTL records (beginning with ; ".SBTTL"). ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MAR file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- MACRO64: JSB_ENTRY MOVAL MACRO64_D,R1 ; R1 -> ASCII string "MACRO-64" MOVAL M64,R2 ; R2 -> .M64 default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 80$ ; Branch on error CLRL R5 ; Clear multiple .SBTTL flag MOVL #3,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=80$ ; Read a record CMPL #^A/Comm/,(R9) ; Is it "Command:"? BRANCH_LIKELY BNEQ 20$ ; Branch if not CMPL #^A/and:/,4(R9) ; ... BRANCH_UNLIKELY BNEQ 20$ MOVL #SS$_NORMAL,R0 ; Set success status BRW 80$ ; And return 20$: SOBGTR R7,10$ ; Loop if need to read more CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_UNLIKELY BNEQ 30$ ; Branch if not MOVL #3,R7 ; Skip next three records, too BRB 10$ ; Go skip header lines 30$: MOVL #1,R7 ; Read only one record MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size MOVL #9,R0 ; Assume length of 9 CMPB #TAB,(R9) ; Is the first char a ? BEQL 40$ ; Branch if so MOVL #16,R0 ; Make it 16 if not a 40$: SUBL2 R0,R6 ; Subtract from total length BRANCH_UNLIKELY BLSS 10$ ; Branch if negative - null rec ADDL3 R0,R9,R4 ; R4 -> first byte ; ; Check to see if this is a .SBTTL record. If so, write out a unless ; this is the second or third in a multiple .SBTTL sequence. For example, ; DEC has started using the following sequence, which this code handles: ; ; .SBTTL + ; .SBTTL The pluses make the table of contents pretty ; .SBTTL + ; CMPL #SUBTITLE_LEN,R6 ; Is record even big enough? BRANCH_UNLIKELY BGTR 50$ ; Branch if too small for SBTTL CMPC3 #SUBTITLE_LEN,SUBTITLE,(R4) ; Is this a ".SBTTL" record? BRANCH_LIKELY BNEQ 50$ ; Branch if not BBSS #0,R5,60$ ; Branch if multiple .SBTTL PUT_FF RABREG=R11 ; Write out a BRB 60$ ; Skip on to next 50$: CLRL R5 ; Clear multiple .SBTTL flag 60$: MOVW R6,RAB$W_RSZ(R11) ; Copy the record size to RAB MOVL R4,RAB$L_RBF(R11) ; Store address of record 70$: $PUT RAB=(R11) ; Write the record out BRW 10$ ; Loop to read next record 80$: RSB ; Return to caller .PAGE .SBTTL DO_SDL ;+ ; ; Routine: DO_SDL ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by SDL. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- DO_SDL: JSB_ENTRY MOVAL SDL_D,R1 ; R1 -> ASCII string "SDL" MOVAL SDL,R2 ; R2 -> .SDL default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 40$ ; Branch on error 10$: READ RABADDR=(R10),ERR=40$ ; Read a record TSTW RAB$W_RSZ(R10) ; Was anything read? EOF? BRANCH_UNLIKELY BEQL 10$ ; Skip null lines CMPB #^A/ /,4(R9) ; Is it a header? BRANCH_UNLIKELY BEQL 10$ ; Branch if so MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size SUBL2 #8,R6 ; Subtract 7 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if negative - null rec 20$: MOVW R6,RAB$W_RSZ(R11) ; Copy the record size to RAB MOVL R9,RAB$L_RBF(R11) ; Copy the address ADDL2 #8,RAB$L_RBF(R11) ; And the buffer address 30$: $PUT RAB=(R11) ; Write the record out BRW 10$ ; Loop to read next record 40$: RSB ; Return to caller .PAGE .SBTTL DO_CLD ;+ ; ; Routine: DO_CLD ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by SET COMMAND/OBJECT (CDU). ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- DO_CLD: JSB_ENTRY MOVAL CLD_D,R1 ; R1 -> ASCII string "CLD" MOVAL CLD,R2 ; R2 -> .CLD default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 50$ ; Branch on error MOVL #4,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=50$ ; Read a record SOBGTR R7,10$ ; Skip any headers CMPB #FF,(R9) ; Form feed? (Headers) BRANCH_LIKELY BNEQ 20$ ; Branch if not MOVL #5,R7 ; Skip the headers BRB 10$ ; ... 20$: MOVZWL RAB$W_RSZ(R10),R6 ; Was anything read? EOF? BRANCH_UNLIKELY BEQL 50$ ; Branch if nothing read (EOF) SUBL2 #10,R6 ; Subtract 11 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if negative - null rec 30$: MOVW R6,RAB$W_RSZ(R11) ; Copy the record size to RAB MOVL R9,RAB$L_RBF(R11) ; Copy the address ADDL2 #10,RAB$L_RBF(R11) ; And the buffer address 40$: $PUT RAB=(R11) ; Write the record out BRW 10$ ; Loop to read next record 50$: RSB ; Return to caller .PAGE .SBTTL DO_PLI ;+ ; ; Routine: DO_PLI ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by PL/I. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- DO_PLI: JSB_ENTRY MOVAL PLI_D,R1 ; R1 -> ASCII string "PL/I" MOVAL PLI,R2 ; R2 -> .PLI default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 50$ ; Branch on error CLRL R5 ; Clear line counter MOVL #5,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=50$ ; Read a record SOBGTR R7,10$ ; Loop if need to read more TSTW RAB$W_RSZ(R10) ; Was anything returned? BRANCH_UNLIKELY BEQL 10$ ; Branch if nothing to write out CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 20$ ; Branch if not CHECK_FF ; See if is needed MOVL #5,R7 ; Skip next three records, too BRB 10$ ; Loop to read next four 20$: MOVL #1,R7 ; Not skipping any records MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size ; ; See if we've encounted end-of-file. If so, record will be " COMMAND LINE ". ; CMPL #END_PLI_LEN,R6 ; Record same size? BRANCH_UNLIKELY BEQL 40$ ; Branch out of line if so 30$: SUBL2 #11,R6 ; Subtract 14 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if nothing to write MOVW R6,RAB$W_RSZ(R11) ; Copy the record size MOVL R9,RAB$L_RBF(R11) ; Do in two steps to avoid ADDL2 #11,RAB$L_RBF(R11) ; ... AXP "unaligned" warning $PUT RAB=(R11) ; Write the record out INCL R5 ; Bump line counter BRW 10$ ; Loop to read next record 40$: CMPC3 #END_PLI_LEN,END_PLI,(R9) ; Is it "Command Line"? BRANCH_UNLIKELY BNEQ 30$ ; Branch if not MOVL #SS$_NORMAL,R0 ; Set success status 50$: RSB ; Return to caller .PAGE .SBTTL DO_PAS ;+ ; ; Routine: DO_PAS ; ; Functional Description: ; ; This internal subroutine handles the parsing of a .LIS file created ; by Pascal. ; ; Environment: ; ; User-mode. ; ; Inputs: ; ; R9 - Address of input buffer for records read ; R10 - Address of RAB for the .LIS file ; R11 - Address of RAB for the .MSG file ; ; Implicit inputs: ; ; None. ; ; Outputs: ; ; None. ; ; Returns: ; ; R0 - Status ; R10 - Preserved ; R11 - Preserved ; All other registers may be destroyed ; ; Side effects: ; ; ;- DO_PASCAL: JSB_ENTRY MOVAL PASCAL_D,R1 ; R1 -> ASCII string "Pascal" MOVAL PAS,R2 ; R2 -> .PAS default file spec MOVAL OUT_FAB,R3 ; In case R3 was wiped out BSBW CREATE_FILE ; Go create the file ON_ERR 50$ ; Branch on error CLRL R5 ; Clear line counter MOVL #5,R7 ; Skip next three records, too 10$: READ RABADDR=(R10),ERR=50$ ; Read a record ; ; The end is determined when a header reading either "Generated Code" ; or "Pascal Computation Statistics" is found. ; CMPC3 #END_PAS_LEN,END_PAS,32(R9) ; Is it "Generated Code"? BRANCH_UNLIKELY BEQL 20$ ; Branch if not CMPC3 #END_PAS2_LEN,END_PAS2,32(R9) ; Is it "Pascal Comp. Stat."? BRANCH_LIKELY BNEQ 30$ ; Branch if not 20$: MOVL #SS$_NORMAL,R0 ; Set success status BRW 50$ ; And return 30$: SOBGTR R7,10$ ; Loop if need to read more TSTW RAB$W_RSZ(R10) ; Was anything returned? BRANCH_UNLIKELY BEQL 10$ ; Branch if nothing to write out CMPB #FF,(R9) ; Is 1st char. a ? BRANCH_LIKELY BNEQ 40$ ; Branch if not CHECK_FF2 ; See if is needed MOVL #5,R7 ; Skip next three records, too BRB 10$ ; Loop to read next four 40$: MOVL #1,R7 ; Not skipping any records MOVZWL RAB$W_RSZ(R10),R6 ; Copy the record size SUBL2 #16,R6 ; Subtract 14 from it BRANCH_UNLIKELY BLSS 10$ ; Branch if nothing to write PUT_FF2 ; Write , if needed MOVW R6,RAB$W_RSZ(R11) ; Copy the record size MOVL R9,RAB$L_RBF(R11) ; Do in two steps to avoid ADDL2 #16,RAB$L_RBF(R11) ; ... AXP "unaligned" warning $PUT RAB=(R11) ; Write the record out INCL R5 ; Bump line counter BRW 10$ ; Loop to read next record 50$: RSB ; Return to caller .END CVTLIS