; ; ********************************************************************** .TITLE COMMENT .IDENT /1/ ; this is a program to upper case code and lower case comments ; this file must be linked w/ sys$useful:error ; ;*********************************************************************** ; ; ; modified by: ; W. Koenig 2-3-1980 transmit zero length records from input to output ; W. Koenig 2-12-1980 set up outrab rsz on zero length records ; W. Koenig 2-20-1980 added escape to table ; ; $DSCDEF ; ; follows a bunch of macros to get the show on the road ; ; ; the put_rec macro ; .MACRO PUT_REC RECORD,SIZE MOVAL RECORD,OUTRAB+RAB$L_RBF .IF NB SIZE MOVW SIZE,OUTRAB+RAB$W_RSZ .IFF MOVW #RECORD'LEN,OUTRAB+RAB$W_RSZ .ENDC $PUT RAB=OUTRAB,ERR=REPORT_ERROR .ENDM ; ; ; .PSECT STRUCT,LONG INFAB:: $FAB NAM=NAMBLK,FOP=NAM INRAB:: $RAB FAB=INFAB,UBF=BUFFER,RBF=BUFFER,RSZ=512,USZ=512 OUTFAB:: $FAB RAT=CR OUTRAB:: $RAB FAB=OUTFAB,UBF=BUFFER,RBF=BUFFER,RSZ=512,USZ=512 NAMBLK:: $NAM ESA=RESULT,ESS=NAM$C_MAXRSS RESULT: .BLKB NAM$C_MAXRSS GETCMD: $CLIREQDESC - RQTYPE = CLI$K_GETCMD DESCRIPTOR: .BLKL 2 BUFFER:: .BLKB 512 CHARLEN:: .LONG 6 HEADFLG:: .LONG 0 CHAR:: .BYTE 0 DESC:: .LONG 0,0 PROMPT1:: .ASCID /$_Input File:/ COMMENT_DESC:: .ASCID /$_Comment Character:/ FIRST: .BLKB 80 SECOND: .BLKB 80 .ALIGN LONG ; ; table to convert lower case letters to upper case ; UPPER: .ASCII /......... / ;hex 00-09 .BYTE ^X0A,^X0B,^X0C,^X0D,^X0E,^X0F ;hex 0a-0f .ASCII /.............../ ;hex 10-1f .ASCII A !"#$%&'()*+,-./A ;hex 20-2f .ASCII /0123456789:;<=>?/ ;hex 30-3f .ASCII /@ABCDEFGHIJKLMNO/ ;hex 40-4f .ASCII /PQRSTUVWXYZ[\]^_/ ;hex 50-5f .ASCII /`ABCDEFGHIJKLMNO/ ;hex 60-6f .ASCII /PQRSTUVWXYZ{|}~./ ;hex 70-7f ; ; table to convert upper case letters to lower case ; LOWER: .ASCII /......... / ;hex 00-09 .BYTE ^X0A,^X0B,^X0C,^X0D,^X0E,^X0F ;hex 0a-0f .ASCII /.............../ ;hex 10-1f .ASCII A !"#$%&'()*+,-./A ;hex 20-2f .ASCII /0123456789:;<=>?/ ;hex 30-3f .ASCII /@abcdefghijklmno/ ;hex 40-4f .ASCII /pqrstuvwxyz[\]^_/ ;hex 50-5f .ASCII /`abcdefghijklmno/ ;hex 60-6f .ASCII /pqrstuvwxyz{|}~./ ;hex 70-7f .PSECT CODE COMMENT:: .WORD 0 ; ; begin by getting the file name ; an input file with an random formatting ; and an output file which will be reformatted as follows- ; all characters before the comment character will be uppercased ; all characters after the comment character will be lowercased ; comment is a foreign command so that i can get the input line if there is one ; PUSHAB W^GETCMD CALLS #1,@CLI$A_UTILSERV(AP) MOVQ W^GETCMD+CLI$Q_RQDESC,DESCRIPTOR TSTL DESCRIPTOR BEQL PROMPT_FIRST ; ; have one file spec, get it ; MOVL DESCRIPTOR+4,INFAB+FAB$L_FNA MOVB DESCRIPTOR,INFAB+FAB$B_FNS ; BRW ON_WITH_IT BRW ON_WITH_IT ; ; need to get file -- prompt away ; PROMPT_FIRST: MOVB #DSC$K_CLASS_D,DESC+DSC$B_CLASS PUSHAL PROMPT1 PUSHAL DESC CALLS #2,LIB$GET_INPUT BLBS R0,A PUSHL R0 CALLS #1,LIB$SIGNAL RET A: MOVZWL DESC,R0 MOVB R0,INFAB+FAB$B_FNS MOVAL FIRST,INFAB+FAB$L_FNA MOVTC R0,@DESC+4,#^A/./,UPPER,R0,FIRST ; ; got file spec, open the file and away we go ; ON_WITH_IT:: CLRL HEADFLG $OPEN FAB=INFAB,ERR=REPORT_ERROR MOVAL INFAB,R10 $FAB_STORE FAB=OUTFAB,FNA=RESULT,FNS=NAMBLK+NAM$B_ESL,- ORG=FAB$B_ORG(R10),RFM=FAB$B_RFM(R10),MRS=FAB$W_MRS(R10),- RAT=FAB$B_RAT(R10),ALQ=FAB$L_ALQ(R10) $CREATE FAB=OUTFAB,ERR=REPORT_ERROR $CONNECT RAB=INRAB,ERR=REPORT_ERROR $CONNECT RAB=OUTRAB,ERR=REPORT_ERROR MOVB #DSC$K_CLASS_D,DESC+DSC$B_CLASS PUSHAL COMMENT_DESC PUSHAL DESC CALLS #2,LIB$GET_INPUT MOVB @DESC+4,CHAR MOVAL BUFFER,R9 ; ; keep on getting records from the input file until we run out ; in most cases there is a straightforward correspondence between ; the input file and the output file ; GETS: MOVC5 #0,(SP),#0,#512,BUFFER ;zero buffer $GET RAB=INRAB CMPL R0,#RMS$_EOF BNEQ CONT BRW DONE CONT: BLBS R0,NOERR MOVAL INRAB,R10 BSBW REPORT_ERR NOERR: MOVZWL INRAB+RAB$W_RSZ,R0 MOVW R0,OUTRAB+RAB$W_RSZ BEQL FINI MOVTUC R0,@INRAB+RAB$L_RBF,CHAR,UPPER,R0,@OUTRAB+RAB$L_RBF TSTL R0 BEQL FINI MOVTC R0,(R1),#^A/./,LOWER,R0,(R5) FINI: $PUT RAB=OUTRAB,ERR=REPORT_ERROR BRB GETS DONE: $CLOSE FAB=INFAB $CLOSE FAB=OUTFAB RET .END COMMENT