/Meta command processor for FORTRAN *400;INBUF, ;DECIMAL;VERSION, 05;38;OCTAL /Written by: / Stephen R. Besch / Dept. of Physiology / SUNY at Buffalo / Buffalo, N.Y. 14214 / APR 6, 1984 / /Modified by: / Johnny Billquist /Assemble, Load and Save: / .REN SYS:F4P1.SVZ,0>9=-42>-1 SZL /Skip if it is Alphabetic or digit JMP FRCERR /Force syntax error TAD (44 /Convert to relative bit number SUBTR, TAD (-14 /Subtract 12 bits SPA /Skip if positive JMP GOTBIT /Got the bit number ISZ OPTL /Bump the option word location JMP SUBTR /Subtract again GOTBIT, DCA TEMP /Store the bit count CLA STL /Set the link for rotate loop RAL /Rotate once ISZ TEMP /Count it JMP .-2 /Repeat till count is up DCA TEMP /Save the rotated bit TAD TEMP CDF 10 /Set option field AND I OPTL /Get the bit to toggle SNA CLA /Skip if already set TAD TEMP /Set the new bit TAD I OPTL /by adding to option word DCA I OPTL /and store the result CDF 0 /Reset this field TAD (7643 /Load address DCA OPTL /to reset option word pointer TAD CHAR /Save a copy of CHAR DCA TEMP /because PRINT destroys it / JMS I [PRINT /"Forcing /" / FORMSG /Message address / TAD TEMP / JMS TYPE /Print the character /Look for a comma here. If there is no sig. character, we've entered /the next non-continuation line and must go look for another KEYWORD. /If there is a character, it must be a "," or there's an error. /When we find a comma, go get the next option character. JMS I [SIGNIF /Look for a , or line terminator JMP CHKLIN /All done if no character TAD (-", SZA CLA /Skip if a comma JMP FRCERR /Error if not JMP FRCLP /Get next spec. OPTL, 7643 /Option word pointer ORCE, -"O;-"R;-"C;-"E;0 /Keyword character string. MSSG07, TEXT *^[SYNTAX ERROR IN [F[O[R[C[E STATEMENT%* FORMSG, TEXT *^[FORCING /%* /RPASS3, TEXT *^.[R [P[A[S[S3^%* PAGE /5200 /Routine to SORT input character and vector to an address /on a match. List of character address pairs follows the /call. List terminator may be any positive number, and /will be executed upon returning. This means TAD, ISZ /and DCA are OK as terminators, as are any small /constants which look like an AND instruction. SORTJ, 0 SZA /Skip if character already in CHAR DCA CHAR /Store character SJLOOP, TAD I SORTJ /Load first test SMA /Skip if not a termiator JMP SJEXIT /return ISZ SORTJ /Bump return TAD CHAR /See if match SNA CLA /Skip if not JMP JUMP /Take JUMP pathway ISZ SORTJ /Ignore address word JMP SJLOOP /Loop till terminator found JUMP, TAD I SORTJ /Load address DCA SORTJ /Save it SJEXIT, CLA CLL /Clear link (and AC) JMP I SORTJ /Take address branch SNTCHR="%&77 /Value of sentinel character CLFCHR="^&77 /Embedded CRLF character UCFCHR="[&77 /Uppercase flag character /Six bit printing routine. All characters are assumed to be lower /case unless preceeded by the upper case flag character. PRINT, 0 /Routine to unpack and print 6-bit ASCII SZA /Skip if AC=0 JMP ADINAC /Address in AC TAD I PRINT /Load address of message ISZ PRINT /Bump return address ADINAC, DCA PPTR /Save pointer to message /Flow through to initialize co-routine linkage. PRINT1, JMS PSUB /Go reset co-routine linkage BSW /Move upper byte down JMS PSUB /Set new co-routine link OUTXIT, ISZ PPTR /Bump pointer after byte 2 JMP PRINT1 /Loop back for first character PCRLF, TAD [215 /Do a CRLF here JMS TYPE TAD [212 JMS TYPE PBACK, TAD I PPTR /Load a word of messsage JMP I PSUB /Call co-routine PSUB, 0 /Returns using JMS to set co-routine AND [77 /Strip off unused byte SNA /Skip if not null character JMP PBACK /Ignore nulls. JMS SORTJ /Sort and JUMP -SNTCHR;PREXIT /Return on sentinel -CLFCHR;PCRLF /Test for imbedded CRLF -UCFCHR;SETUCF /Look for upper case flag TAD CHAR /Reload character TAD (-40 /Make non-alpha characters negative SPA /Skip if Non-alpha TAD UCF /Add 100 for upper case, 140 for lower TAD [240 /Convert all to 8-bit JMS TYPE /Type the character SETLC, TAD LOWER /Load 1st. 1/2 of UCF if lower case SETUCF, TAD (100 /Load only 2nd. half for upper case DCA UCF /Save result as upper case flag JMP PBACK /Back for more characters PREXIT, JMP I PRINT UCF, 140 /Value of flag is for lower case LOWER, 40 /Set to 0 if upper case only /Return next significant character. SIGNIF, 0 IGNR2, JMS I [GETCHR /Get a character JMS I [SORTJ -211;IGNR2 /Ignore TABS -" ;IGNR2 /and spaces -215;SKPCHR /Go get first character after CR ISZ SIGNIF /Take non-error return TAD CHAR /Load significant character JMP I SIGNIF /And return SKPCHR, JMS PEND /Call FIRSTC JMP GOTNS /No signif. character DCA PEND /Zero pending operation JMP IGNR2 /Go test next character GOTNS, DCA PEND /Zero pending operation JMP I SIGNIF /Return, empty handed /Error processing routine ERROR, 0 CLA CMA /AC=-1 TAD ERROR /Load error address TAD I ENUM /Compare to list SNA CLA /Skip if no match JMP GOTERR /Found it ISZ ENUM /Ignore unused message address JMP ERROR+1 /Try again GOTERR, TAD I ENUM /Load message address JMS PRINT /Print it JMP I (7605 /return to monitor, saving core. ELST, -FETERR;MSSG01 /Output handler -OFERR;MSSG04 /Open error -CLSERR;MSSG05 /Close error -EROR08;MSSG08 /Read error -EROR09;MSSG09 /Write error -EROR10;MSSG10 /File overflow -NOINF;MSSG12 /No input file -STKER2;MSSG02 /Include stack overflow -STKERR;MSSG06 /Param stack overflow -FRCERR;MSSG07 /Syntax error in FORCE command -STRERR;MSSG11 /Too many characters in file name -LKPERR;MSSG13 /Can't find include file -BADEXT;MSSG14 /Illegal extension -BADDEV;MSSG15 /illegal device spec. -F4ERR;MSSG03 /can't find F4 pass 1 -NOPAS3;NP3ERR /No PASS3.SV -NOLPT;NLPTER /No LPT: -SYRDER;P3RDER /Error reading PASS3 0 /Sentinel PAGE /5400 NCLUDE, -"N;-"C;-"L;-"U;-"D;-"E;0 MSSG02, TEXT *^[INCLUDE STACK OVERFLOW^%* MSSG03, TEXT *^[CAN'T FIND [F[O[R[T[R[A[N PASS 1!^%* MSSG05, TEXT *^[ERROR CLOSING [F[O[R[T[R[N.[T[M^%* MSSG06, TEXT *^[POINTER STACK OVERFLOW^%* MSSG09, TEXT *^[OUTPUT WRITE ERROR^%* MSSG10, TEXT *^[OUTPUT FILE OVERFLOW^%* MSSG11, TEXT *^[TOO MANY CHARACTERS IN [I[N[C[L[U[D[E FILENAME^%* MSSG13, TEXT *^[CAN'T FIND [I[N[C[L[U[D[E FILE^%* MSSG14, TEXT *^[BAD EXTENSION IN [I[N[C[L[U[D[E FILE^%* MSSG15, TEXT *^[BAD DEVICE IN [I[N[C[L[U[D[E FILE^%* DECIMAL SAVEB, ZBLOCK 72 /72 character save buffer OCTAL PAGE STACK, *.+STKSIZ ISTACK, *.+ISTKSZ /It's an error if the code causes the stacks to pass address 7200 /which would cause a 2 page handler to overwrite the system /handler. Either the code must be repacked, or the stack sizes /must be adjusted. IFNZRO .-7200 <****CHANGE STACK SIZE****> INHND=. /Room for 2 page handler /Page 0 *10 AINDX, 0 ENUM, ELST-1 *20 OBPTR, OUTBUF /Output buffer pointer INDEV, 0 /Input device number CHAR, 0 /Current input character PPTR, 0 /Print routine pointer COLUMN, 0 /Screen col. (for TAB expansion) INPUT, 0 /Input handler entry point TEMP, 0 TEMP2, 0 DEVFLG, 0 EXTFLG, 0 MULTFL, 0 NAMBUF, ZBLOCK 4 MCR, -215 /Print a character to TTY TYPE, 0 TSF JMP .-1 TLS CLA CLL JMP I TYPE PAGE /200 /Pass 3 call must be on page 200 /PROGRAM FLIST.PA /Redesigned to run in F4META /"/E" bug fixed. JMP FILSET /Monitor and JMP START /Chain entry P3CALL, CLA IAC /AC=1/for SYS CIF 10 /Set field 1 for USR call JMS I [USR /Call USR 2 /To look up a file P3REC, P3NAM /Address of file name;Start block 0 /Arg2=Length NOPAS3, JMS I [ERROR /Error if no PASS3.SV CDF 10 /Set field 1 TAD I (OPTION /Load "/E AND (200 /Remove the bit SNA CLA /Skip if it was set DCA I (5000 /Otherwise clear error table TAD (OPTION-1 /Load address of option words DCA AINDX /Store in auto index CLA CLL CML RAR /Load option "A" DCA I AINDX /Store "A" option DCA I AINDX /And zero all others DCA I AINDX /Now decide what to do. If there is a second output file, use it. /If not, then move first output file over. If there is no first /output file use LPT. TAD I (FILE2 /Load file 2 device number SZA CLA /Skip if no file there JMP CHKEX /Else just check extension TAD (FILE2-1 /Load start of 2nd output file DCA AINDX /into autoindex TAD I (FILE1 /Load first output file D.N. SNA CLA /Skip if specified JMP USELPT /No output file, use LPT MFNLP, TAD I (FILE1 /Load first output file DCA I AINDX /and make it the second DCA I (FILE1 /since PASS3 expects ".LS" there ISZ (FILE1 /Bump pointer ISZ (-5 /Bump count JMP MFNLP /And loop /Here to check for file extension. If there is none, then install /".LS" CHKEX, TAD I (FILE2+4 /Load extension of 2nd file SZA CLA /Skip if no extension JMP GETP3 /There is one, skip ahead TAD (1423 /Load ".LS" DCA I (FILE2+4 /Set the extension JMP GETP3 /And load pass 3 USELPT, CDF 0 /Set field 0 CIF 10 /Field 1 for USR call JMS I [USR /call USR 12 /Inquire ARGS, DEVICE LPT /Device LPT 0 NOLPT, JMS I [ERROR /Error if NO LPT handler CDF 10 TAD ARGS+1 /Load device number of LPT DCA I AINDX /Store as second output file ISZ (-5 /And loop to JMP .-2 /zero the rest GETP3, CDF 0 /Reset field 0 TAD P3REC /Get start block of PASS 3 IAC /Skip header block DCA P3BLK /Store in handler call / JMS I [PRINT / RPASS3 /Print ".R PASS3" JMS I (7607 /Load PASS 3 1600 /Read 16 pages, field 0 PASS3, 400 /Into 400 page P3BLK, 0 /Start block SYRDER, JMS I [ERROR /Errors halt JMP I PASS3 /And start pass 3 P3NAM, FILENAME PASS3.SV NP3ERR, TEXT *^[P[A[S[S3.[S[V [NOT ON [S[Y[S!%* NLPTER, TEXT *^[NO [L[P[T HANDLER!%* P3RDER, TEXT *^[ERROR READING [P[A[S[S3.[S[V%*