1 /4 OS/8 FORTRAN (PASS ONE)
3 / VERSION 4A PT 16-MAY-77
5 / OS/8 FORTRAN COMPILER - PASS 1
8 / UPDATED BY: R.LARY + M. HURLEY
11 /COPYRIGHT (C) 1974,1975 BY DIGITAL EQUIPMENT CORPORATION
22 /THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE
23 /AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
24 /CORPORATION. DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
25 /FOR ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT.
27 /THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED TO THE PURCHASER
28 /UNDER A LICENSE FOR USE ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED
29 /(WITH INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH
30 /SYSTEM, EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY DIGITAL.
32 /DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE
33 /OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY
39 \f/CHANGES FOR MAINTENANCE RELEASE (S.R.):
41 /1. BUMPED VERSION NUMBER TO 304
42 /2. INCLUDED PATCH SEQ #4 (OCT DSN) FOR SF ERROR FIX
43 /3. INCLUDED PATCH SEQ #6 (TEMP VARS IN ASF)
44 /4. FIXED PROBLEM IN DATA STATEMENT
45 /5. STOPPED HALT AFTER OT ERROR BY CONVERTING LOGICAL
46 / VARS TO INTEGER IN ARITHMETIC IF STATEMENT
47 /6. FIXED BUG RE /A AND .RA EXTENSION
51 /7. ALLOWED PARITY INPUT
52 /8. IGNORE NULLS ON INPUT
53 /9. FIXED BUG RE IGNORING LAST LINE IF IN ERROR
54 / OR IN FACT IGNORING ANY LAST LINE IF NO END STATEMENT
55 /10. ALLOW MULTIPLE INPUT FILES
58 /CHANGES FOR OS/8 V3D AND OS/78 BY P.T.
59 / .PATCH LEVEL NOW CONTAINED IN LOCATION 1130
61 LINENO, 1 /2.01/ LINE NUMBER
62 X10, 0 /AUTO INDEX REGISTERS
65 NEXT, FREE-1 /FREE SPACE POINTER
66 STACK, STACKS-1 /STACK POINTER
67 CHRPTR, 0 /INPUT BUFFER POINTER
70 STKLVL, STACKS-1 /STACK BASE LEVEL
71 BUCKET, 0 /FIRST CHAR OF NAME
72 WORD1, 0 /SIX WORD LITERAL BUFFER
78 ACO, 0 /FLOATING AC OVERFLOW WORD
79 OP1, 0 /SEVEN WORD OPERAND FOR "NUMBER"
86 CHAR, 0 /ICHAR PUTS CHARACTER HERE
87 NOCODE, 0 /IS 1 IF CODE GENERATION OFF
88 NCHARS, 0 /SIZE OF INPUT LINE
89 NUMELM, 0 /NUMBER OF VARS IN TYPED LIST
92 DECPT, 0 /SET 1 IF NUMBER CONTAINED .
93 ESWIT, 0 /1 FOR E 0 FOR D
94 NDIGIT, 0 /NUMBER OF DIGITS TO RIGHT OF .
95 HCHAR, HCOUNT /HOLLERITH GETTER ROUTINE
96 SNUM, 0 /POINTER TO ST ENTRY FOR STMT NUMBER
97 IFSWIT, 0 /=1 IF INSIDE LOGICAL IF
98 EXPON, 0 /HOLDS EXPONENT FOR CONVERSION
99 TMPFIL, 0617;2224;2216;2415 /PASS1 OUTPUT FILE
100 0;0;0;0 /PASS2 OUTPUT FILE
101 DOEND, 0 /SET 1 IF THIS STMT WAS A IF,
102 /GOTO, RETURN, PAUSE, OR STOP
103 THSNUM, 0 /CURRENT STATEMENT NUMBER
104 DIMNUM, 0 /LINEARIZED SS FOR EQ
105 DPRDCT, 0 /HOLDS DIMENSION PRODUCT
106 EQTEMP, 0 /TEMP FOR EQUIVALENCE
107 MQ, 0 /MQ FOR 12 BIT MULTIPLY
108 MASTER, 0 /POINTER TO MASTER IN EQUIV GROUP
109 MNUM, 0 /LINEARIZED SS FOR MASTER
110 NSLAVE, 0 /NUMBER OF SLAVES IN GROUP
111 PASS2O, 0 /START OF PASS 2 OVERLAY SECTION
112 OUFILE, 0 /START OF PASS1 OUTPUT FILE
113 DSERES, 0 /MAGIC NUMBER
114 PROGNM, MAIN /POINTER TO PROG NAME
115 ARGLST, 0 /POINTER TO ARG LIST
116 FUNCTN, 0 /0=MAIN, 1=FUNCTION, -2=SUBROUTINE
117 SETBIT, 0 /TEMPS FOR DECLARATION SCANNER
119 DOINDX, 0 /POINTER TO DO INDEX FOR DO LOOPS
120 TLTEMP, 0 /TEMP FOR TYPE ROUTINE
121 OWTEMP, 0 /TEMP FOR OUTWRD
122 CNT72, -102 /72 COLUMN COUNTER
123 DPUSED, 0 /=1 IF DOUBLE HARDWARE USED
124 VERS, VERSON /VERSION NUMBER
131 STMJMP, 0 /FOR DEFINE FILE
133 MAXHOL=100 /MAXIMUM HOLLERITH LITERAL
134 COMREG=4600 /INTER-PASS COMMUNICATION REGION
135 STACKS=4700 /STACK AREA
136 NAME1=6200 /NAME AND HOLLERITH BUFFER (WAS 6400)**
137 LINE=6300 /LINE BUFFER (WAS 6500)**
138 INBUF=6600 /INPUT BUFFER (FIELD 1)
139 OUBUF=7200 /OUTPUT BUFFER (DITTO)
140 INDEVH=7200 /INPUT DEVICE HANDLER (WAS 7400)**
143 BINRD1=DPUSH+1 /OPCODE DEFINITIONS
182 RDLOOP, CIF 10 /FOR OS/8 2 PG HANDLERS**
183 JMS I [ICHAR /GET CHAR FROM INPUT FILE
184 JMP ENDLIN /END LINE OR CR
185 TAD M211 /CHECK FOR TAB**
187 TAD (240-211 /CONVERT TO BLANK
189 DCA I CHRPTR /SAVE CHAR
190 ISZ CNT72 /PAST COLUMN 72 ?
192 JMP SKPLIN /SKIP 73 TO 80
196 SZL CLA /TEST FOR TOO MANY CONTINUATIONS
198 JMS I [ERMSG /LINE TOO LONG
200 SKPCOM, TAD X16 /RESTORE CHRPTR
203 JMS I [ICHAR /SKIP REST OF LINE
207 ENDLIN, TAD CHRPTR /SAVE CHAR POSITION
210 DCA X10 /SAVE POSITION FOR COMMENT CHECK
211 TAD (-102 /SET COLUMN COUNT
216 JMS I [ICHAR /GET FIRST 6 CHARS
217 JMP SHORTL /IGNORE SHORT LINES
218 TAD M211 /IS CHAR A TAB ? **
221 TAD P240 /TREAT FIRST TAB AS SIX BLANKS
225 TAD P240 /FAKE CONTINUATION CHECK
227 JMP CCHECK /GO TO COMMENT CHECK
228 SHORTL, TAD X16 /RESET CHAR POINTER
229 DCA CHRPTR /TO IGNORE SHORT LINES
235 CCHECK, TAD I X10 /IS IT A COMMENT ?
238 JMP SKPCOM /COMMENT, SKIP REST
239 NOCMNT, TAD CHAR /WAS SIXTH CHAR A BLANK ?
242 JMP GOTLIN /YES, NO MORE CONTINUATIONS
243 CCARD, TAD X16 /IGNORE THESE SIX CHARACTERS
245 JMP RDLOOP /CONTINUE WITH THIS LINE
246 GOTLIN, TAD CHRPTR /COMPUTE -NCHARS-1
250 TAD [LINE-1 /RESET CHAR POINTER
252 JMS I [CKCTLC /CHECK FOR CONTROL C
253 LINE1, DCA THSNUM /ZERO CURRENT STMT NUMBER
254 CLL CML RAR /SET LABEL DEFINE BIT
255 JMS I [STMNUM /GO LOOK FOR LABEL
256 JMP COMPIL /NONE THERE
257 TAD SNUM /SAVE STATEMENT NUMBER
259 TAD (DEFLBL /OUTPUT DEFINITION FOR THIS LABEL
262 JMS I [OUTWRD /FOLLOWED BY THE LABEL ADDRESS
263 COMPIL, JMS I [SAVECP
264 ISZ LINENO /2.01/ PUT LINE NUMBER
265 TAD LINENO /2.01/ INTO MQ
268 DCA NOCODE /SET NOCODE SWITCH
269 JMS I [ERMSG /SET UP DEFAULT ERROR MESSAGE
271 JMS I [LEXPR /IS IT ARITHMETIC ?
273 JMS I [GETC /LOOK FOR =
274 JMP NOTAR /NOT ARITHMETIC
277 JMS I [EXPR /SCAN LEFT PART
279 JMS I [ERMSG /SET MESSAGE TO ILLEGAL OPERATOR
281 ISZ NCHARS /SHOULD BE NOTHING LEFT
282 JMP NOTAR /IF THERE IS, ITS NOT ARITHMETIC
283 ITSAR, JMS I [RESTCP /RESTORE TO START OF LINE
284 DCA NOCODE /ALLON CODE
285 JMS I [LEXPR /GET LEFT SIDE
286 M6, -6 /V3C MUST BE HERE
288 MMM240, -240 /SHOULD NEVER GET HERE
290 JMS I [EXPR /GET RIGHT SIDE
291 MMM275, -275 /SHOULD NEVER GET HERE
292 TAD (STOROP /OUTPUT STORE
294 JMP I [NEXTST /DO NEXT LINE
295 NOTAR, JMS I [RESTCP /RESTART LINE
297 JMS I [SAVECP /RESAVE CHAR POSITION
300 JMP I (CMDLUP /GO SEARCH FOR KEYWORD
303 CMDLUP, CDF 10 /TABLE IN FIELD ONE
304 TAD I X10 /GET NEXT 2 CHARS OF KEYWORD
306 JMP CMDLP2 /NOT DONE YET
307 CLL CMA RAL /REMOVE CHAR POS FROM STACK
310 TAD I X10 /GET ROUTINE ADDRESS
313 JMP I STMJMP /JUMP TO THE ROUTINE
314 CMDLP2, DCA TEMP /SAVE THE TWO CHARS
316 JMS I [GET2C /GET TWO CHARS FROM THE INPUT
317 JMP .+4 /NOT ENOUGH CHARS, CAN'T BE THIS ONE
320 JMP CMDLUP /MATCHES, KEEP GOING
321 JMS I [RESTCP /RESTORE CHAR POS
323 ISZ STACK /AND SAVE IT AGAIN
325 TAD I X10 /FIND END OF THIS COMMAND
328 ISZ X10 /SKIP ROUTINE ADDRESS
329 TAD I X10 /IS THE LIST EXHAUSTED ?
331 JMP CMDLP2 /NO, GO AGAIN
332 BADCMD, JMS I [ERMSG /TREAT AS BAD ARITHMETIC STMT
337 DOENDR, TAD STKLVL /RESET STACK POINTER
339 JMS I [POP /LOOK FOR DO END
341 TAD THSNUM /DOES THIS LINE END A DO LOOP ?
343 JMP NODOND /NO, REPLACE STACK AND COMPILE STMT
345 JMS I [OUTWRD /OUTPUT DO END COMMAND
346 JMS I [POP /GET INDEX VARIABLE
348 TAD STACK /RESET STACK BASE LEVEL
350 TAD DOEND /WAS THIS A LEGAL ENDING STMT ?
354 DCA DOEND /KILL SWITCH
356 NODOND, ISZ STACK /REPLACE STACK ENTRY
357 DCA DOEND /KILL SWITCH
358 TAD (EOLCOD /OUTPUT EOL CODE
360 DCA ERCODE /RESET ERROR CODE
361 DCA IFSWIT /KILL IF SWITCH
362 TAD (-6 /MOVE FIRST 6 CHARS
364 TAD [LINE-1 /INTO START OF BUFFER
372 GOTO, ISZ DOEND /DO END ILLEGAL
373 JMS I [STMNUM /IS IT A SIMPLE GOTO ?
374 JMP CMPGO2 /NO, SEE IF ITS A COMPUTED ONE
375 TAD (GO2OPR /OUTPUT GOTO OPERATOR
377 TAD SNUM /FOLLOWED BY STMT NUMBER
380 CMPGO2, JMS I [GETC /LOOK FOR (
384 JMP ASNGO2 /NOT ( , MAYBE ITS AN ASSIGNED GOTO
385 TAD STACK /SAVE STACK POSITION
387 DCA TEMP /ZERO BRANCH COUNTER
388 GO2LUP, JMS I [STMNUM /GET NEXT STMT NUMBER
389 JMP BADGO2 /MUST BE THERE
391 JMS I [PUSH /SAVE IT TEMPORARILY
392 ISZ TEMP /BUMP BRANCH COUNT
393 JMS I [COMARP /LOOK FOR COMMA OR RIGHT PAREN
395 JMP GO2LUP /COMMA, GO GET NEXT LABEL
396 JMS I [GETC /SKIP NEXT CHAR (ITS A COMMA)
400 JMS I [PUSH /ON STACK
401 JMS I [EXPR /COMPILE INDEX EXPR
403 TAD (CGO2OP /OUTPUT COMPUTED GOTO OPERATOR
405 JMS I [POP /GET COUNT
407 DCA TEMP /SAVE COMPLEMENT
410 JMS I [OUTWRD /OUTPUT COUNT
411 TAD X12 /RESTORE STACK POINTER
413 TAD I X12 /MOVE STMT NUMBERS TO OUTPUT
418 ASNGO2, JMS I [BACK1 /PUT BACK NON (
419 JMS I [LEXPR /GET ASSIGN VAR
421 TAD (AGO2OP /OUTPUT GOTO OPERATOR
429 RDWR, 0 /SUBR FOR IO STATEMENTS
430 JMS I [CHECKC /LOOK FOR (
433 JMS I [EXPR /COMPILE UNIT
436 JMP DAQUOT /LOOK FOR ' (DIRECT ACCESS I/O)
438 TAD (BINRD1 /FORMATLESS READ/WRITE
439 IOSTRT, TAD I RDWR /ADD ADJUSTOR
440 JMS I [OUTWRD /OUTPUT BINARY READ
441 IOLIST, JMS I [PUSH /MARK STACK
442 JMS I [GETC /IS IT AN IMPLIED DO ?
443 JMP ENDIOL /NO, END OF LIST
446 JMP TRYIOE /NO, LOOK FOR IO ELEMENT
447 JMS I [SAVECP /SAVE CHAR POS AT START OF IDO
448 DCA IDOPAR /ZERO PAREN COUNTER
449 FINDND, JMS I [GETNAM /GET A NAME IF THERE IS ONE
450 XPURGE, PRGSTK /DON'T WORRY ITS A NOP
451 JMS I [GETC /GET A CHAR
453 TAD M251 /IS IT A ) ?
459 TAD (250-275 /IS IT = ?
461 JMP FINDND /NONE OF THESE
462 TAD IDOPAR /IS PAREN COUNT 0 ?
464 JMP FINDND /NO, ITS FROM AN INNER LOOP
465 JMS I [LOOKUP /THIS ELEMENT IS THE DO INDEX
467 JMS I (DOSTUF /COMPILE THE LOOP
468 JMP BADIOL /ERROR IN DO PARMS
469 JMS I [CHECKC /MUST HAVE )
472 TAD CHRPTR /SAVE CHAR POSITION
476 JMS I [RESTCP /RESTORE TO START OF IMPLIED LOOP
477 TAD TEMP2 /NOW SAVE POS AFTER LOOP
481 TAD DOINDX /AND DO INDEX
483 LPIOL, ISZ IDOPAR /( INCREASES COUNT
485 RPIOL, CMA /) DECREASES COUNT
491 BADRD, JMS I [ERMSG /BAD IO STMT
494 TRYIOE, JMS I [BACK1 /PUT BACK NON (
495 JMS I [LEXPR /GET IOLIST ELEMENT
496 JMP BADRD /NOT THERE, ERROR
497 JMS I [GETC /LOOK FOR A COMMA
501 JMP NOTIOL /NOT AN ELEMENT
502 TAD (IOLMNT /OUTPUT OPCODE
505 NOTIOL, TAD (254-275 /IS IT AN = (END OF IDO)
508 JMS I [POP /GET STUFF FROM THE STACK
510 JMP BADIOL /ZERO IS BAD
511 DCA DOINDX /THIS IS THE INDEX
512 JMS I [RESTCP /GET THE CHAR POSITION
513 TAD XPURGE /OUTPUT PURGE OPERATOR
514 JMS I [OUTWRD /BECAUSE AN EXTRA IS ON THE STK
515 TAD (DOFINI /END LOOP
519 JMS I [GETC /END OF LIST ?
523 JMP BADIOL /MUST BE A COMMA
526 ENDIOL, JMS I [POP /IS THE MARK THERE ?
530 TAD (RCLOSE /END OF IO OPERATION
533 RDFMT, JMS I [STMNUM /LOOK FOR FMT LINE NUMBER
535 JMS I [OUTWRD /OUTPUT PUSH COMMAND
536 TAD SNUM /OUTPUT STMT NUMBER OF FORMAT
538 RDLIST, TAD (FMTRD1 /START OF FORMATTED READ
539 TAD I RDWR /ADD ADJUSTOR
541 JMS I [CHECKC /LOOK FOR )
544 JMP IOLIST /GO GET IO LIST
545 RTFMT, JMS I [LEXPR /GET R.T. FORMAT
551 JMS I [CHECKC /LOOK FOR '
553 JMP BADRD /SYNTAX IS NO GOOD
554 JMS I [EXPR /GET RECORD NUMBER EXPR
556 JMS I [CHECKC /LOOK FOR )
559 TAD (DARD1 /DIRECT ACCESS OPEN
561 FIND, JMP I [NEXTST /COOL ISN'T IT ?
562 DFINFL, JMS I [EXPR /COMPILE UNIT
563 JMP BADDEF /BAD DEFINE STMT
564 DCA STMJMP /PERMIT VARIABLE FOR LOG UNIT
568 JMS I [EXPR /NUMBER OF RECORDS
573 JMS I [EXPR /RECORD SIZE
584 JMS I [GETNAM /GET INDEX VARIABLE
588 JMS I [OUTWRD /OUTPUT INDEX VAR
589 TAD (DEFFIL /OUTPUT DEFINE OPERATOR
594 JMS I [GETC /ANOTHER DEFINE ?
598 JMP DFINFL /YES, ANOTHER FILE
599 BADDEF, JMS I [ERMSG /BAD DEFINE FILE STMT
602 RESTCP, 0 /RESTORE CHAR POSITION FROM STACK
608 INTEGE, JMS I [CHECKC /INTEGER STMT
616 PAUZE, JMS I [CHECKC /LOOK FOR E
619 JMS I [GETC /ANY EXPR ?
620 JMP NOARGP /MAKE IT PAUSE 1
621 JMS I [BACK1 /PUT IT BACK
622 JMS I [EXPR /GET PAUSE NUMBER
624 OPAUZ, TAD XPAUZ /OUTPUT PAUSE OPERATOR
627 NOARGP, JMS I [OUTWRD /PUSH 1.0
630 JMP OPAUZ /GO PUT OPERATOR
631 READ, JMS I (RDWR /COMPILE READ STMT
633 WRITE, JMS I [CHECKC /LOOK FOR E
636 JMS I (RDWR /COMPILE WRITE
638 CKCTLC, 6401 /CHECK FOR CONTROL C
647 XOCTAL, DCA WORD1 /**
649 DCA WORD3 /STATEMENT NUM LEFT THERE**
653 JMS I [DIGIT /GET NEXT DIGIT
654 JMP ENDOXT /NO DIGITS LEFT
655 AND [7 /THROW AWAY SOME BITS
657 JMS I (AL1 /MOVE WORD LEFT THREE
660 TAD WORD4 /ADD DIGIT TO WORD4
663 ENDOXT, TAD WORD2 /PUT WORDS INTO THE LEFT PLACE
669 JMP DATAFP /GO STUFF IT AWAY
670 \f/ DIMENSION, COMMON, REAL
672 DIMENS, JMS I [IFCHEK
673 JMS I [CHECKC /CHECK FOR "N"
675 JMP I [BADCMD /NO GOOD
676 JMS I [TYPLST /PROCESS LIST
677 0000 /DIMENSION IS THE SIMPLEST CASE
681 REAL, JMS I [IFCHEK /CHECK FOR INSIDE IF
682 JMS I [TYPLST /PROCESS LIST
687 COMPLE, JMS I [CHECKC /CHECK FOR "X"
691 JMS I [TYPLST /PROCESS COMPLEX LIST
695 CLA IAC /SET DP SWITCH
698 COMMON, JMS I [IFCHEK /BAD INSIDE LOGICAL IF
699 JMS I [GETC /CHECK FOR SLASH
703 JMP BLANKC /MUST BE BLANK COMMON
704 JMS I [GETNAM /GET NAME OF COMMON
705 JMP DBLSLS /MIGHT BE //
706 JMS I [CHECKC /LOOK FOR /
709 JMS I [LOOKUP /LOOKUP COMMON NAME
711 DCA COMNAM /SAVE ADDR OF TYPE WORD
713 TAD I COMNAM /LOOK AT TYPE
715 TAD (-111 /MUST BE COMMON OR UNDEF.
718 TAD (111 /SET CORRECT BITS
721 DOCOMN, JMS I [TYPLST /HANDLE LIST
726 DCA STACK /RESET STACK
728 ISZ COMNAM /POINTER TO COMMON INFO
729 DCA I NEXT /ZERO NEXT PTR WORD
730 TAD I COMNAM /LOOK FOR END OF LIST
733 DCA COMNAM /PROCEED DOWN LIST
735 EOCL, TAD NEXT /HOOK IN NEXT PART
738 DCA I NEXT /NUMBER IN THIS PART
743 TAD I X12 /MOVE VARIABLE PTRS
749 JMS I [GETC /ANOTHER BLOCK ?
752 DBLSLS, JMS I [CHECKC /LOOK FOR SECOND SLASH
756 BLANKC, JMS I [BACK1 /PUT BACK NON SLASH
757 TAD (BLNKCN /USE BLANK COMMON
760 BADCOM, JMS I [ERMSG /ERROR IN COMMON STMT
764 \f/ EXTERNAL, FORMAT, BACKSPACE
765 EXTERN, JMS I [TYPLST /PROCESS LIST
770 FORMAT, TAD (FMTOPR /OUTPUT FORMAT OPERATOR
772 TAD NCHARS /GET NUMBER OF WORDS
774 CLL RAR /NWORDS=(NCHARS+1)/2
775 FMTLUP, JMS I [OUTWRD /OUTPUT IT
776 JMS I [GETCWB /GET THE CHARS
777 JMP I [NEXTST /NO MORE
779 CLL RTL /SHIFT LEFT 6
783 JMS I [GETCWB /GET OTHER HALF
784 NOP /IGNORE END OF LINE
786 TAD TEMP /PUT THEM TOGETHER
788 /NOTE : THE ENTIRE FORMAT INCLUDING PARENTHESIS ()
789 / IS PASSED TO THE CODE
790 BACKSP, JMS I [CHECKC /CHECK FOR "E"
793 JMS I [EXPR /COMPILE UNIT EXPR
795 TAD (BAKOPR /OUTPUT BACKSPACE OPERATOR
802 OUTWRD, 0 /OUTPUT ROUTINE
803 DCA OWTEMP /SAVE WORD
806 JMP I OUTWRD /COOL IT IF NOCODE
807 ISZ OCOUNT /TEST FOR BUFFER FULL
808 JMP NOWRIT /STILL SOME ROOM
809 JMS OUDUMP /DUMP THE BUFFER
810 TAD OUBLOK-1 /RESET BUFFER PARAMETERS
814 NOWRIT, TAD OWTEMP /PUT WORD
816 DCA I OUPTR /INTO BUFFER
818 ISZ OUPTR /MOVE POINTER
820 OULEN, 0 /NUMBER OF BLOCKS LEFT IN HOLE
821 OUDUMP, 0 /DUMP OUT BUFFER
822 TAD OULEN /ANY ROOM LEFT ?
827 JMS I (7607 /CALL SYSTEM HANDLER
832 ISZ OUBLOK /INCREMENT BLOCK NUMBER
833 ISZ FILSIZ /ALSO SIZE OF FILE
835 OUERR, JMS I [MESSAG /ERROR IN WRITING OR OPENING FILE
839 XEND, JMS I [CHECKC /LOOK FOR "D"
842 JMS I [GETC /END MUST BE ALL
844 L7700, SMA CLA /NEVER SKIPS
847 TAD (ENDOPR /OUTPUT END OF FILE
849 JMS OUDUMP /DUMP BUFFER
851 JMS I L7700 /LOCK MONITOR IN
855 JMS I L200 /CLOSE TEMP FILE
862 JMS I L200 /OPEN PASS 2 OUTPUT FILE
864 OBLK, TMPFIL+4 /STARTING BLOCK
867 TAD (COMREG-1 /SAVE IMPORTANT STUFF
869 TAD NEXT /ADDR OF FREE SPACE
871 TAD STKLVL /STACK LEVEL
873 TAD OUFILE /START OF PASS1 OUTPUT FILE
875 TAD FILSIZ /ALSO THE SIZE
877 TAD PASS2O /START OF PASS2 OVERLAY
879 TAD OBLK /START OF PASS2 OUTPUT FILE
881 TAD OBLK+1 /AND MAX SIZE
883 TAD PROGNM /POINTER TO PROG NAME
885 TAD ARGLST /AND ARG LIST
887 TAD FUNCTN /AND PROG SWITCH
889 TAD DPUSED /STORE THE DP SWITCH
891 TAD VERS /AND THE VERSION NUMBER
894 JMS I L200 /CHAIN TO PASS TWO
896 PASS2B, 0 /FILLED BY ONCE ONLY CODE FOR PASS 1
897 RETURN, TAD (RETOPR /OUTPUT RETURN CODE
899 ISZ DOEND /DO END ILLEGAL HERE
901 COMARP, 0 /LOOK FOR COMMA OR RIGHT PAREN
907 TAD L3 /RIGHT PAREN ?
911 ISZ COMARP /COMMA INCR ONCE
913 LOGICA, JMS I [CHECKC /LOOK FOR L
915 JMP I [BADCMD /NO GOOD
916 JMS I [TYPLST /PROCESS LIST
921 \f/ EQUIVALENCE (UGH!)
923 EQUIV, JMS I [IFCHEK /BAD WITH IF
924 JMS I [CHECKC /LOOK FOR "E"
927 EQVLUP, JMS I [CHECKC /LOOK FOR (
930 TAD STACK /SAVE STACK POS
932 DCA NSLAVE /NUMBER OF SLAVES = 0
933 JMS I [GETSS /GET THE MASTER
935 SVMSTR, CDF 10 /1.03/ CHECK FOR ALREADY EQUIVALENCED
938 AND (200 /1.03/ (AS A SLAVE)
940 JMP DOFUNY /3.01/BACK UP TO ITS MASTER
941 TAD TEMP2 /SAVE THE MASTER TYPE ADDRESS
943 DCA SFUDGE /3.01/CLEAR OFFSET FUDGE
944 TAD DIMNUM /SAVE THE MASTER SUBSCRIPT
946 GETSLV, JMS I [COMARP /LOOK FOR , OR )
949 TAD NSLAVE /COMPLEMENT THE NUMBER OF SLAVES
951 JMP ENDGRP /NO SLAVES
954 TAD X17 /RESTACK THE STORE
956 EQLOOP, TAD I X17 /GET NEXT SUBSCRIPT NUMBER
958 TAD I X17 /AND NEXT TYPE WORD ADDRESS
961 TAD I TEMP2 /LOOK AT TYPE WORD
962 TAD (200 /SET EQUIVALENCE BIT
964 ISZ TEMP2 /MOVE TO EQUIVALENCE/DIMENSION PTR
965 TAD I TEMP2 /PROPAGATE DIMENSION POINTER
966 DCA I NEXT /TO EQUIVALENCE INFO BLOCK
967 TAD NEXT /NOW STORE EQ INFO BLK ADDRESS
968 DCA I TEMP2 /INTO EQ-DIM POINTER WORD
970 TAD MASTER /STORE S.T. ADDR OF MASTER
971 DCA I NEXT /INTO THE EQUIVALENCE BLOCK
972 TAD MNUM /OUTPUT NUMBERS
977 ISZ NSLAVE /ANY MORE SLAVES ?
978 JMP EQLOOP /YES, EQUIVALENCE NOT YET ATTAINED
979 ENDGRP, JMS I [GETC /FINI, ALL VARIABLES ARE CREATED
980 JMP I [NEXTST /EQUIVALENCED
981 TAD (-254 /IS NEXT CHAR A COMMA ?
983 JMP EQVLUP /IF YES, DO NEXT GROUP
984 BADEQU, JMS I [ERMSG /SYNTAX ERROR IN EQUIVALENCE
987 EQUCOM, JMS I [ERMSG /MULTIPLE LEVELS OF EQUIVALENCE OR
988 2114 /MORE THAN ONE COMMON VARIABLE
990 DOSLAV, ISZ NSLAVE /ANOTHER SLAVE VARIABLE
991 JMS I [GETSS /GET THE GOODS
994 TAD I TEMP2 /LOOK AT THE TYPE
996 JMP SVSLAV /IT ISN'T IN COMMON
997 TAD I MASTER /LOOK AT THE MASTERS TYPE
999 JMP EQUCOM /MASTER IS IN COMMON TOO .. BAD
1001 TAD MNUM /SAVE THE MAGIC NUMBER
1004 JMS I [PUSH /AND THE S.T. ADDRESS
1005 JMP SVMSTR /NOW GO MAKE THE NEW ONE MASTER
1006 SVSLAV, TAD I TEMP2 /1.03/ PREVIOUSLY EQUIVALENCED ?
1009 JMP EQUCOM /1.03/ YES, ERROR
1010 TAD DIMNUM /SAVE THE NEW SLAVE
1011 TAD SFUDGE /3.01/ADD OFFSET FUDGE
1016 JMP GETSLV /AND GO GET THE NEXT SLAVE
1019 \f/ROUTINE TO HANDLE TRIVIAL CASES OF EQUIVALENCE CHAINING
1020 /THIS WHOLE PAGE IS 3.01
1024 DCA MASTER /GET POINTER TO EQUIVALENCE BLOCK
1029 TAD I X12 /GET ADDRESS OF "REAL" MASTER'S
1030 DCA MASTER /TYPE WORD
1033 DCA MNUM /OFFSETS ARE ADDITIVE
1035 DCA SFUDGE /SAVE OTHER HALF OF OFFSET TO ADD
1039 \f/ EQUIVALENCE (UGH!)
1040 O1420, 1420 /1.03/ MUST BE FIRST ON PAGE
1041 GETSS, 0 /GET THE LINEARIZED SUBSCRIPT
1043 JMS I [GETNAM /GET THE VARIABLE
1046 IAC /ADDRESS OF TYPE WORD
1051 O200, AND O1420 /1.03/ EXT, STMTFUN, SUBARG ?
1055 DCA X12 /SAVE STACK POSITION
1056 DCA TEMP /ZERO NUMBER OF DIMENSIONS
1059 DCA EQTEMP /ADDRESS OF EQ-DIM POINTER
1062 TAD (-250 /LOOK FOR (
1067 DCA DIMNUM /DATA CALLS GETSS WITH AC = 7777
1068 DIMGET, JMS I (SMLNUM /GET A SUBSCRIPT
1071 JMS I [PUSH /SAVE SS
1072 ISZ TEMP /BUMP COUNT OF SS
1073 JMS I [COMARP /LOOK FOR , OR )
1077 DCA DPRDCT /SET DIMENSION PRODUCT TO 1
1078 TAD X12 /RESTORE STACK POSITION
1080 TAD TEMP /COMPLEMENT NUMBER OF SS
1085 AND I TEMP2 /HAS VARIABLE BEEN DIMENSIONED ?
1087 JMP I GETSS /NO, THATS BAD
1088 TAD I EQTEMP /GET ADDRESS OF DIMENSION BLOCK
1090 TAD I EQTEMP /IS NUMBER OF DIMENSIONS
1091 TAD TEMP /EQUAL TO NUMBER OF SUBSCRIPTS ?
1093 JMP TRY1SS /1.03/ SEE IF ITS ONE SUBSCRIPT
1095 TAD I EQTEMP /+ NUMBER OF DIMENSIONS
1096 TAD EQTEMP /+ ADDRESS OF COUNT WORD
1097 DCA EQTEMP /GIVES ADDRESS OF NEXT TO LAST DIMENSION
1099 TAD I X12 /GET NEXT SS - 1
1101 TAD DPRDCT /MULTIPLY BY THE DIMENSION PRODUCT
1102 JMS MUL12 /WHERE D.P. = 1,D1,D1D2,D1D2D3,...
1103 TAD DIMNUM /ACCUMULATE THE SUM
1106 TAD I EQTEMP /ADDR OF LITERAL
1108 DCA X11 /WORKING POINTER TO VALUE
1109 TAD I X11 /GET DIMENSION INTO FAC
1116 JMS I [FIXNUM /GO FIX IT
1118 TAD DPRDCT /OF THE D.P. SERIES (ABOVE)
1121 CLA IAC /V3C BUMP POSITION POINTER
1124 ISZ TEMP /ANY MORE SS ?
1128 TRY1SS, CLA IAC /1.03/
1129 TAD TEMP /1.03/ ONLY ONE SS ?
1131 JMP I GETSS /1.03/ MORE, THATS NO GOOD
1133 TAD I X12 /1.03/ GET THE SUBSCRIPT
1134 DCA DIMNUM /1.03/ AND RETURN IT
1136 MUL12, 0 /12 BIT UNSIGNED MULTIPLY
1137 DCA OP2 /SAVE OPERAND
1138 TAD (-15 /SET SHIFT COUNT
1153 TAD MQ /RETURN VALUE
1159 IF, JMS I [EXPR /COMPILE CONDITION EXPRESSION
1161 JMS I [STMNUM /IS IT ARITHMETIC IF ?
1163 TAD (ARTHIF /START IF COMMAND
1167 ISZ DOEND /DO END ILLEGAL HERE
1168 JMP IFLABL /GET IF LABELS
1169 IFLOOP, JMS I [CHECKC /LOOK FOR ,
1172 JMS I [STMNUM /GET NEXT STMT NUMBER
1174 IFLABL, TAD SNUM /OUTPUT LABEL
1179 LOGIF, JMS IFCHEK /IF()IF()... NOT LEGAL
1180 ISZ IFSWIT /CLEAR IF SWITCH
1181 TAD (LIFBGN /START LOGICAL IF
1183 JMP I (COMPIL /COMPILE THE STATEMENT
1185 IFCHEK, 0 /CHECK IF SWITCH
1193 CALL, JMS I [SAVECP /SAVE CHAR POS
1194 JMS I [GETNAM /GET SUBROUTINE NAME
1195 JMP BADCAL /NO NAME HERE IS BAD
1196 JMS I [LOOKUP /GET ADDRESS OF TYPE WORD
1200 TAD I TEMP /LOOK AT TYPE
1201 AND (6640 /ANYTHING BUT EXT OR ARG ?
1203 JMP BADCAL /YES, BAD
1204 TAD I TEMP /SET EXT BIT
1205 AND (137 /LEAVE TYPE AND ARG BITS
1209 JMS I [RESTCP /RESTORE CHAR POS
1210 CLA IAC /SIGNAL THAT THIS IS A CALL
1211 JMS I [LEXPR /COMPILE IT
1212 XSTORE, DOSTOR /DON'T WORRY VIRGINIA, ITS A NOP
1213 TAD OWTEMP /WHAT WAS THE LAST THING OUT ?
1215 TAD (-63 /IF LESS THAN 63
1217 JMP I [NEXTST /IT WAS AN ARG COUNT
1218 TAD [ARGSOP /OTHERWISE IT WAS AN ARG LESS CALL
1219 JMS I [OUTWRD /SO TELL PASS 2 ABOUT IT
1222 BADCAL, JMS I [ERMSG
1226 DO, JMS I [IFCHEK /IF(...)DO IS ILLEGAL
1227 JMS I [STMNUM /LOOK FOR ENDING STMT NUMBER
1229 JMS I [GETNAM /LOOKUP INDEX VARIABLE
1233 JMS I [CHECKC /LOOK FOR =
1236 ISZ DOEND /CAN'T END DO LOOP ON A DO
1237 JMS DOSTUF /GET DO PARAMETERS
1239 TAD DOINDX /PUSH DO INDEX
1241 TAD SNUM /PUSH ENDING STMT NUMBER
1244 DCA STKLVL /SAVE NEW STACK BASE
1247 DOSTUF, 0 /SUBR FOR DO LOOP STUFF
1248 JMS I [OUTWRD /OUTPUT DO INDEX
1251 JMS I [EXPR /GET EXPR FOR INITIAL VALUE
1255 JMS I [CHECKC /LOOK FOR COMMA
1258 JMS I [EXPR /GET EXPR FOR FINAL VALUE
1260 JMS I [GETC /LOOK FOR A COMMA
1261 JMP STEP1 /USE STEP OF 1
1265 JMS I [EXPR /GET EXPR FOR STEP
1268 TAD (DOBEGN /DO BEGIN OPERATOR
1271 JMS I [BACK1 /PUT BACK NON , (OFFICER BELOW LT.)
1272 STEP1, JMS I [OUTWRD /OUTPUT A PUSH 1.0
1275 JMP DORET /FINISH DO STUFF
1276 BADDO, JMS I [ERMSG /BAD DO COMMAND
1279 BDERR, JMS I [ERMSG /ILLEGAL IN BLOCK DATA
1282 \f/ TYPE STATEMENT SUBROUTINE
1284 TYPLST, 0 /HANDLE LIST FOR TYPE DELL
1286 DCA X12 /SAVE STACK POINTER
1288 TAD I TYPLST /GET SET BITS
1291 TAD I TYPLST /AND ILLEGAL BITS
1294 LSTLUP, JMS I [GETNAM /GET VARIABLE
1296 JMS I [LOOKUP /S.T. SEARCH
1297 DCA TLTEMP /SAVE VAR ADDRESS
1298 TAD TLTEMP /PUT IT ON THE STACK
1299 ISZ TLTEMP /NOW POINT TO TYPE WORD
1300 JMS I [PUSH /INCREMENT NUMBER
1301 ISZ NUMELM /INCREMENT NUMBER
1303 TAD I TLTEMP /COMPARE TYPES
1304 AND BADBIT /CHECK FOR ILLEGAL BITS
1306 JMP TYPAGN /ATTEMPT TO RE-TYPE
1307 TAD SETBIT /GET SET BITS
1310 TAD SETBIT /DO THE SET
1311 DCA I TLTEMP /BUT NOT DIMENSION BIT
1315 TAD (-250 /LOOK FOR (
1317 JMP NOTDIM /NOT DIMENSIONED
1318 CLA IAC /INITIALIZE MAGIC NUMBER
1321 DCA DPRDCT /AND DIMENSION PRODUCT
1323 DCA X17 /SAVE STACK POINTER
1324 DCA TEMP2 /DIMENSION COUNT=0
1325 JMP I (DIMLUP /GET DIMENSIONS
1327 DCA STACK /RESTORE STACK
1329 TAD (3400 /DIM, EXT, SF ?
1332 JMP DIMAGN /ATTEMPT TP RE-DIMENSION
1334 TAD I TLTEMP /SET DIMENSION BIT
1337 TAD TEMP2 /NUMBER OF DIMS.
1339 TAD I TLTEMP /GET EQUIVALENCE POINTER
1342 TAD NEXT /STORE POINTER TO
1343 DCA I TLTEMP /DIMENSION INFORMATION
1344 TAD DPRDCT /SAVE DIM PRODUCT
1346 TAD DSERES /AND MAGIC NUMBER
1348 DCA I NEXT /ZERO MAGIC LITERAL POINTER
1351 DCA TEMP2 /LEAVE LAST DIM
1353 MOVDIM, TAD I X17 /1.03/ GET THE DIMENSION
1355 DCA I NEXT /1.03/ INTO THE DIMENSION INFO BLOCK
1359 NEXTEL, JMS I [GETC /LOOK FOR ,
1363 JMP LSTLUP /OK, GET NEXT MEMBER
1364 ENDLST, JMS I [BACK1
1367 BADDIM, JMS I [ERMSG /DIMENSION ERROR
1370 BADLST, JMS I [ERMSG /ERROR IN LIST
1373 TYPAGN, JMS I [ERMSG
1376 DIMAGN, JMS I [ERMSG /ATTEMPT TO RE DIMENSION
1379 NOTDIM, TAD (250-254 /IS IT A COMMA?
1382 JMP LSTLUP /GET NEXT ELEMENT
1385 JMP I TYPLST /TAKE OK EXIT
1386 ENDFIL, JMS I [CHECKC /LOOK FOR "E"
1389 JMS I [EXPR /COMPILE UNIT
1391 TAD (ENDFOP /OUTPUT ENDFILE OPERATOR
1394 DOUBLE, JMS I [CHECKC /LOOK FOR N
1398 JMS I [IFCHEK /NOT ON AN IF
1399 JMS I [TYPLST /PROCESS LIST
1403 CLA IAC /SET THE DP SWITCH
1406 \f/ SYMBOL TABLE LOOKERUPPER
1408 LOOKUP, 0 /SYMBOL TABLE LOOKUP FOR VARIABLE ENTRY
1409 TAD NOCODE /IS THIS IN NOCODE MODE ?
1411 JMP I LOOKUP /YES, DO NOTHING
1413 TAD (ALIST-1 /GET START OF CORRECT BUCKET
1415 LOOK, DCA OLDN3 /SAVE ADDR OF PREVIOUS ENTRY
1416 TAD I OLDN3 /GET ADDR OF NEXT ENTRY
1418 JMP HOOKIN /NO NEXT ENTRY, ATTACH NEW ENTRY
1419 TAD (2 /SKIP OVER TYPE AND DIM POINTER
1422 DCA PNAME /SETUP POINTER TO NAME
1424 CHKNAM, TAD I PNAME /GET WORD NAME
1427 TAD I X10 /COMPARE WITH THIS ENTRY
1429 JMP NOTSAM /DIFFERENT
1432 AND [77 /WAS THIS THE END OF NAME?
1435 JMP CHKNAM /NO, KEEP COMPARING
1437 RLOOKU, TAD I OLDN3 /GET ADDR OF START OF ENTRY
1438 CDF /AND RETURN IT IN THE AC
1439 JMP I LOOKUP /RETURN ADDR OF SYMBOL
1441 JMP HOOKIN /NEW SYMBOL <CURRENT ONE
1443 JMP LOOK /CONTINUE SEARCH
1444 HOOKIN, TAD I OLDN3 /HOOK NEW ENTRY INTO LIST
1448 DCA I NEXT /ZERO TYPE WORD
1449 DCA I NEXT /ZERO EQUIVALENCE/DIMENSION POINTER
1450 TAD (NAME1 /PREPARE TO STICK IN THE NAME
1453 ENTERN, TAD I PNAME /MOVE NAME INTO S.T.
1458 ISZ PNAME /END OF NAME?
1461 JMP ENTERN /NO, KEEP GOING
1463 STCHEK, TAD NEXT /CHECK FOR S.T. OVERFLOW
1465 TAD (4740 /5000 STARTS PASS2 SKELETON TABLES
1469 JMS I [ERMSG /S.T. FULL
1471 JMP I (ENDX /TREAT AS END OF INPUT
1472 OLDN3, 0 /ADDR OF PREVIOUS ENTRY
1473 N3SIZE, 0 /SIZE OF ENTRY
1475 PNAME, /POINTER TO NAME BUFFER
1476 LUKUP2, 0 /LOOKUP FOR FIXED LENGTH SYMBOLS
1477 TAD I LUKUP2 /GET THE BUCKET START
1478 DCA OLDN3 /SAVE IT AS THE PREVIOUS ENTRY
1480 TAD I LUKUP2 /GET THE ENTRY SIZE
1483 TAD LUKUP2 /SAVE RETURN ADDR
1485 TAD NOCODE /IS CODE GENERATION OFF ?
1487 JMP I LOOKUP /YES, JUST RETURN
1489 LOOK2, TAD I OLDN3 /GET ADDR OF NEXT ENTRY
1491 JMP HOKIN2 /IF 0 ITS END OF LIST
1493 DCA X10 /START OF VALUE INFO
1494 TAD (WORD1-1 /SETUP POINTER TO PROTOTYPE
1496 TAD N3SIZE /AND TEMP OF ENTRY SIZE
1500 CIA CLL /COMPARE THIS WORD OF THE VALUE
1504 JMP NOTSM2 /NOT THIS ONE
1505 ISZ LTEMP /INCR SIZE COUNT
1506 JMP CHKVAL /MORE STUFF
1507 JMP RLOOKU /RETURN WITH THE GOODS
1509 JMP HOKIN2 /NEW SYMBOL < CURRENT ONE
1510 TAD I OLDN3 /CONTINUE SEARCH
1513 HOKIN2, TAD I OLDN3 /HOOK NEW ENTRY INTO LIST
1517 TAD (WORD1-1 /PREPARE TO STICK IN THE VALUE
1519 DCA I NEXT /ZERO TYPE WORD
1521 ENTERV, TAD I X11 /MOVE VALUE INTO S.T.
1524 ISZ N3SIZE /INCR SIZE COUNT
1526 JMP STCHEK /STORE TYPE AND CHECK FOR OVERFLOW
1527 STOP, TAD (STOPOP /OUTPUT STOP OPERATOR
1529 ISZ DOEND /DO ILLEGAL ON STOP
1531 \f/ EXPRESSION ANALYZER
1533 EXPR, 0 /POLISHIZE EXPRESSION
1535 JMS I [PUSH /SAVE RETURN ADDR
1536 JMS I [PUSH /MARK STACK
1537 UNOPR, JMS I [GETC /LOOK FOR UNARY OPERATOR
1538 JMP MISARG /THERE HAS TO BE AN OPERAND
1539 TAD (-253 /UNARY+(NOP)
1542 TAD (253-255 /UNARY-
1548 DCA BUCKET /FOR CKNOT
1549 JMS I (TRUFAL /.TRUE. OR .FALSE. ?
1550 JMP CKNOT /NEITHER, IS IT >.NOT.
1552 TAD (NOTOPR /FALSE=.NOT.TRUE
1561 JMP OPRAND /MIGHT BE LITERAL .XXXXXX
1562 TAD (NOTOPR /PUSH .NOT. OPERATOR
1565 UMINUS, TAD (UMOPR /PUSH UNARY MINUS
1568 OPRAND, JMS I [BACK1 /PUT BACK NON UNARY OPERATOR
1569 JMS I [GETNAM /LOOK FOR VARIABLE REFERENCE
1571 JMS I [LOOKUP /SYMBOL TABLE SEARCH
1572 JMP I [OPR8R /GO OUTPUT PUSH-VAR
1573 NOTVAR, JMS I [NUMBER /LOOK FOR A LITERAL
1574 JMP NOTNUM /NO KIND OF NUMBER
1576 JMP DPLIT /DOUBLE PRECISION
1577 FPLIT, JMS I [LUKUP2 /FLOATING, ENTER INTO TABLE
1580 JMP I [OPR8RL /PUSH VARIABLE, NO SUBSCRIPTS
1581 DPLIT, JMS I [LUKUP2 /DOUBLE-PREC., ENTER IN TABLE
1585 HOLCHK, JMS I [GETC /IS THIS HOLLERITH?
1591 JMS I [LUKUP2 /FIND THE ENTRY
1595 NOTNUM, JMS I [GETC /LOOK FOR COMPLEX LITERAL
1596 JMP MISARG /MISSING OPERAND
1597 TAD (-250 /OPEN PAREN?
1599 JMP QUOTE /GO LOOK FOR A STRING
1600 JMS I [SAVECP /SAVE CHAR POSITION
1601 JMS I [NUMBER /GET REAL PART
1602 JMP I (NCMPLX /NO NUMBER
1604 JMP I (NCMPLX /DOUBLE-NOT LEGAL FOR COMPLEX
1605 JMS I [CHECKC /LOOK FOR ,
1607 JMP I (NCMPLX /NO, CAN'T BE COMPLEX LIT.
1608 TAD WORD1 /SAVE REAL PART
1614 JMS I [NUMBER /GET IMAGINARY PART
1615 JMP BADCL /NOT THERE, BAD
1618 JMS I [CHECKC /LOOK FOR )
1621 TAD WORD1 /PUT IMAGINARY PART
1623 TAD WORD2 /INTO SECOND AHLF
1625 TAD WORD3 /OF COMPLEX LITERAL
1627 TAD TEMP /NOW RESTORE REAL PART
1633 CLL CMA RAL /REMOVE CHAR POS FROM STACK
1634 TAD STACK /SINCE OTHERWISE IT GOES OUT
1636 JMS I [LUKUP2 /WHICH WE WILL NOW SEARCH
1637 CMPLST /USE COMPLEX LIST
1640 BADCL, JMS I [ERMSG /BAD COMPLEX LITERAL
1643 MISARG, JMS I [ERMSG /MISSING OPERAND
1646 \f/ EXPRESSION ANALYZER
1648 HQUOTE, 0 /SUBR FOR QUOTE STRINGS
1649 JMS I [GETCWB /GET CHAR
1656 TAD [-247 /LOOK FOR ''
1658 JMP NOTQ2 /REPLACE '' BY '
1659 JMS I [BACK1 /ITS END OF STRING
1661 NOTQ2, TAD [247 /RESTORE CHAR
1664 HFIELD, JMS I [FIXNUM /INTEGERIZE NUMBER
1666 JMP BADH /ZERO IS BAD
1669 TAD (HCOUNT /SET SUBR POINTER
1671 TAD (-MAXHOL /SET COUNTER FOR MAX
1673 TAD (NAME1 /SET UP NAME POINTER
1675 PAKHOL, DCA I TEMP2 /PACK HOLLERITH STRING
1685 ISZ HOLCTR /CHECK FOR TOO MANY
1687 BADH, JMS I [ERMSG /BAD OR TOO BIG HOLLERITH FIELD
1690 LUHOL, TAD (33 /LOOK UP THIS LITERAL
1695 ISZ TEMP /CHECK COUNT
1698 JMS I [GETCWB /GET CHAR
1700 AND [77 /6-BIT IZE IT
1702 HOLCTR, 0 /COUNTER FOR HOLLERITH FIELDS
1703 NCMPLX, JMS I [RESTCP /NOT COMPLEX LITERAL
1704 JMS I [EXPR /MUST BE SUB EXPRESSION
1706 JMS I [GETC /LOOK FOR )
1710 JMP I (NOSS /NO SUBSCRIPT LEGAL AFTER SUB EXPR
1711 PARMM, JMS I [ERMSG /MISSING )
1713 BADEXP, JMS I [POP /BAD EXPRESSION,
1715 JMP BADEXP /LOOK FOR STACK MARKER
1717 DCA TEMP /RETURN ADDR.
1719 JMS I [BACK1 /PUT BACK TEMINAL CHAR
1720 ENDEXP, JMS I [POP /GET NEXT THING FROM STACK
1722 JMP EXPDUN /IF ZERO, FINISH
1723 IAC /GET ADDR OF OPERATION NUMBER
1725 TAD I TEMP /GET OPERATOR VALUE
1726 JMS I [OUTWRD /OUTPUT OPERATOR XXXXXX
1728 EXPDUN, JMS I [POP /GET RETURN ADDR
1732 LETTER, 0 /GET A LETTER
1746 QUOTE, TAD (250-247 /IS IT '
1748 JMP MISARG /NO, OPERAND IS MISSING
1749 TAD (HQUOTE /SET SUBR POINTER
1751 CHECKC, 0 /CHECK FOR A SINGLE CHAR
1752 TAD I CHECKC /GET THE CHAR
1754 ISZ CHECKC /SKIP PAST THE CHAR
1755 JMS I [GETC /GET CHAR FROM INPUT
1756 JMP I CHECKC /DIDN'T MAKE IT
1757 TAD CCTEMP /IS THIS IT ?
1762 \f/ EXPRESSION ANALYZER
1764 BADFSS, JMS I [ERMSG
1770 JMS I [OUTWRD /OUTPUT OPERAND PTR
1773 TAD (-250 /IS IT S.S. OR FUNCTION
1778 SNA CLA /FOR D.F.,PERMIT VARPARENS
1780 ISZ TEMP /LOOK AT TYPE
1782 TAD (3420 /DIM, EXT, SF, OR ARG ?
1785 JMP NOTFUN /NOT A FUNCTION REFERENCE
1787 TAD (1000 /SET EXT BIT
1791 JMS I [POP /PUT COUNT INTO AC
1792 SSFUN, IAC /INCREMENT ARG COUNT
1793 JMS I [PUSH /SAVE IT ON THE STACK
1794 JMS I [EXPR /GET ARG (OR S.S.)
1796 JMS I [COMARP /LOOK FOR , OR )
1798 JMP SSFUN-1 /, GET NEXT ARG (SUBSCRIPT?)
1799 TAD (ARGSOP /YES, OUTPUT ARGLIST OPER
1801 JMS I [POP /AND THE COUNT
1803 NOSS, JMS I [GETC /GET NEXT CHAR
1805 TAD (-253 /PREPARE IT
1807 OPR8RL, DCA TEMP /SAVE ADDR OF LITERAL
1813 DIMLUP, JMS I [NUMBER /GET DIMENSION
1814 JMP VARDIM /MAYBE ITS VAR DIM ?
1815 JMP .+3 /OK, INTEGER
1817 JMP BADDIM /DP AND FP ARE BAD
1818 JMS I [FIXNUM /FIX IT FOR SOME STUFF
1820 TAD DPRDCT /GET NEW DIMENSION PRODUCT
1823 ISZ TEMP2 /INCREMENT DIM COUNT
1824 TAD WORD2 /IF WORD2 OR AC NON ZERO
1825 TAD AC /DIM IS TOO BIG
1828 JMS I (ANORM /1.03/ RENORMALIZE THE NUMBER
1829 JMS I [LUKUP2 /1.03/ ENTER IT INTO LITERAL LIST
1832 PSHDIM, JMS I [PUSH /1.03/ AND SAVE ON THE STACK
1833 JMS I [COMARP /LOOK FOR , OR )
1835 SKP /COMMA MEANS ANOTHER DIM FOLLOWS
1836 JMP PUTDIM /) MEANS END OF DIMS
1837 TAD DSERES /FORM NEXT VALUE OF MAGIC NUMBER
1840 JMP DIMLUP /NOW LOOP FOR NEXT DIM
1842 VARDIM, CDF 10 /IS ARRAY AN ARG ?
1847 JMP BADDIM /NO, BAD DIMENSION
1848 JMS I [GETNAM /OK, GET DIMENSION
1852 DCA VDTEMP /ADDR OF TYPE WORD
1853 CDF 10 /IS THA VARIABLE AN ARG ?
1858 JMP BADDIM /NO, THATS BAD
1859 DCA DPRDCT /3.02 ZERO DIM PRODUCT
1860 ISZ TEMP2 /INCREMENT DIM COUNT
1862 TAD VDTEMP /1.03/ SAVE DIMENSION VARIABLE
1863 JMP PSHDIM /3.02 SAVE DIM ON STACK
1864 MESSAG, 0 /PRINT PASS1 IMMEDIATE ERROR
1865 TAD I MESSAG /GET CHAR ONE
1868 TAD I MESSAG /GET CHAR TWO
1874 JMP I (7605 /EXIT TO MONITOR
1875 \f/ EXPRESSION ANALYZER REVISITED
1877 NOTFSS, TAD (250-253 /IS IT +
1882 TAD (253-255 /IS IT -
1887 TAD (255-252 /IS IT *
1898 NOTEXP, TAD (MULOPR /IT WAS *
1900 NOTMUL, TAD (252-257 /IS IT /
1907 JMP I (ENDEXP-1 /NO, END OF EXPR
1908 JMS CKEOPR /LOOK FOR EXTENDED OPERATOR
1909 JMP BADOPR /NONE THERE
1910 JMS I [CHECKC /CHECK FOR CLOSING .
1912 JMP BADOPR /NOT THERE
1914 TAD I X10 /GET OPERATOR POINTER
1917 CKEOPR, 0 /CHECK FOR EXTENDED OPERATOR
1918 JMS I [GETNAM /GET NAME
1920 TAD (OPRLST-1 /PTR TO LIST
1922 OPRLUP, CDF 10 /3.01/
1923 TAD I X10 /COMPARE FIRST CHAR
1926 JMP I CKEOPR /END OF LIST
1929 JMP NOTHIS /NOT THIS ONE
1933 TAD I (NAME1 /COMPARE 2ND AND 3RD
1935 JMP NOTHIS+1 /NOT THIS ONE
1936 ISZ CKEOPR /BUMP RETURN
1938 NOTHIS, ISZ X10 /BUMP LIST PTR
1940 JMP OPRLUP /KEEP GOING
1941 BADOPR, JMS I [ERMSG /NOT LEGAL EXT. OPER.
1944 GOTOPR, DCA NEWOP /SAVE NEWEST OPER.
1945 JMS I [POP /GET STACK TOP
1949 TAD I OLDOP /COMPARE PREC.
1951 TAD I NEWOP /NEW-OLD
1955 PUSH2, JMS I [PUSH /OLD < NEW
1956 TAD NEWOP /GO PUSH BOTH
1958 JMP I (UNOPR /GO LOOK FOR NEXT OPERAND
1959 OUTOLD, ISZ OLDOP /OUTPUT OPERATOR
1962 JMP GOTOPR+1 /TRY NEXT STACK ELEMENT
1966 GETCWB, 0 /GET A CHARACTER (PRESERVE BLANKS)
1970 DCA NCHARS /RESET NCHARS
1973 TAD I CHRPTR /GET THE CHAR
1975 SAVECP, 0 /SAVE CHAR POSITION
1981 FIXNUM, 0 /FIX FAC (I'M MOVING IT AGAIN)
1982 TAD WORD1 /IS IT FIXED ?
1985 JMP RETFN /YES, EXPONENT IS 23
1987 JMP I FIXNUM /BAD IF EXP IS >23
1988 JMS I (AR1 /RIGHT SHIFT ONE
1989 JMP FIXNUM+1 /TEST AGAIN
1990 RETFN, TAD WORD3 /RETURN LOWEST 12 BITS
1994 GETC, 0 /GET A CHARACTER (IGNORING BLANKS)
2001 TAD (-240 /IS IT A BLANK
2003 JMP GETC+1 /YES IGNORE IT
2007 ERMSG, 0 /ERROR MESSAGE HANDLER
2009 TAD NOCODE /IS CODE GENERATION ON ?
2012 TAD (ERRCOD /ERROR CODE TO OUTPUT FILE
2018 NOTOUT, TAD I ERMSG /SAVE THE ERROR CODE
2022 POP, 0 /PUT TOP OF STACK INTO AC
2027 DCA STACK /DECREMENT STACK POINTER
2030 TRUFAL, 0 /CHECK FOR LOGICAL LITERALS
2033 JMS I [CHECKC /LOOK FOR TERMINAL .
2036 TAD BUCKET /LOOK AT FIRST CHAR
2042 JMP I TRUFAL /ITS NEITHER
2046 \f/ LEFT HALF EXPRESSION ANALYZER
2047 LEXPR, 0 /GET LEFT HAND EXPRESSION
2048 DCA LETEMP /SAVE CALL SWITCH
2049 JMS I [GETNAM /LOOK FOR VAR NAME
2050 JMP MSNGOP /MUST BE THERE
2051 JMS I [OUTWRD /OUTPUT A ZERO (PUSH)
2052 JMS I [LOOKUP /SEEK OUT ENTRY FOR THIS VAR
2056 JMS I [GETC /LOOK FOR DIMENSIONS
2061 ISZ TEMP /LOOK AT TYPE
2063 CLL CML RTR /DIMENSIONED ?
2065 TAD LETEMP /OR A CALL ?
2066 TAD NOCODE /OR CODE OFF ?
2068 JMP NOTSF /YES, NOT AN ARITHMETIC S.F.
2070 AND (1420 /EXT, SF, OR ARG ?
2072 TAD [-M6 /SEE IF CALLED FROM SPECIAL PLACE
2073 TAD LEXPR /V3C COMPARE WITH ENTRY PT
2075 JMP ASFERR /THIS IS BAD IF SO
2078 DCA I TEMP /SET A.S.F. BIT
2080 TAD (ASFDEF /DEFINE ASF
2084 JMS I [POP /ARG COUNT TO AC
2085 SSLOOP, IAC /INCREMENT SS COUNT
2086 JMS I [PUSH /SAVE ON THE STACK
2087 JMS I [EXPR /COMPILE SUBSCRIPT
2088 JMP FSSBAD+2 /ERROR WITHIN SS
2089 JMS I [COMARP /LOOK FOR , OR )
2090 JMP FSSBAD /NEITHER (THERE WAS A BUG HERE)
2091 JMP SSLOOP-1 /, GET NEXT ARG/SS
2092 TAD (ARGSOP /OUTPUT SS OPERATOR
2094 JMS I [POP /THEN COUNT
2097 JMS I [BACK1 /PUT BACK A CHARACTER
2100 MSNGOP, JMS I [ERMSG /MISSING OPERAND
2103 FSSBAD, JMS I [ERMSG /MISSING COMMA OR CLOSE PARENTHESIS
2105 JMS I [POP /GET ARG COUNT OFF STACK
2108 ASFERR, JMS I [ERMSG /BAD ARITHMETIC STMT FUNCTION
2110 JMP NOTSF /DO THE REST OF THE ASF DEF
2115 PUSH, 0 /PUT AC ONTO STACK
2117 TAD (STACKS+100 /CHECK FOR STACK OVERFLOW
2121 JMP I PUSH /OK, RETURN
2122 DCA NOCODE /SET CODE GENERATION ON
2126 GET2C, 0 /GET 2 SIX BIT CHARS INTO ONE WPRD
2127 JMS I [GETC /GET FIRST CHAR
2134 JMS I [GETC /GET SECOND CHAR
2136 ISZ GET2C /FIX RETURN ADDR
2140 STMNUM, 0 /PICK UP STATEMENT NUMBER
2141 DCA WORD4 /SAVE DEFINED BIT (IF ANY)
2142 DCA WORD2 /ZERO SOME STUFF
2144 JMS DIGIT /GET A DIGIT
2145 JMP I STMNUM /NONE THERE, NO STMT NUMBER
2146 TAD (-60 /IS IT A LEADING 0 ?
2148 JMP .-4 /YES, IGNORE IT
2154 JMS DIGIT /GET SECOND DIGIT
2155 JMP ENDNUM /END OF NUMBER
2157 DCA WORD1 /COMBINE FIRST AND SECOND
2165 JMP ENDNUM /COMBINE THIRD AND FOURTH
2168 JMS DIGIT /GET FIFTH DIGIT
2174 ENDNUM, JMS I [LUKUP2 /LOOK UP IN S.T.
2175 SNLIST /STMT NUMBER LIST
2178 DCA SNUM /SAVE S.T. ADDRESS OF LABEL
2179 CDF 10 /SET TYPE WORD
2180 TAD SNUM /GET ADDR OF TYPE
2183 TAD I SNTEMP /GET TYPE WORD
2185 TAD WORD4 /PUT IN THE DEFINITION BIT
2187 DCA I SNTEMP /RESTORE IT IF NOT MULTIPLE DEFN
2195 DIGIT, 0 /GET A DIGIT
2196 JMS I [GETC /GET A CHAR
2198 TAD (-272 /IS IT > 271 (9)
2200 JMP NODIGT /YES, ITS GREATER
2201 TAD (272-260 /IS IT < 260 (0)
2203 JMP NODIGT /YES, ITS LESS
2206 JMP I DIGIT /TAKE SUCCESSFUL RETURN
2207 NODIGT, JMS I [BACK1 /RESTORE NON DIGIT
2209 ASSIGN, JMS I [STMNUM /GET STMT NUMBER
2211 JMS I [GET2C /LOOK FOR "TO"
2215 JMS I [LEXPR /GET ASSIGN VARIABLE
2217 TAD (ASNOPR /OUTPUT ASSIGN OPERATOR
2219 TAD SNUM /NOW STMT NUMBER
2222 BADASN, JMS I [ERMSG
2225 TTYOUT, 0 /TTY OUTPUT ROUTINE
2231 \f/ PRECEDENCE TABLE
2267 \f/ UTILITY ROUTINES
2268 BACK1, 0 /BACK UP ONE CHAR
2276 OADD, 0 /ADD OPERAND TO FAC
2302 \f/ FLOATING POINT DIVIDE ROUTINE
2305 JMS I DAR1 /UNNORMALIZE AC BY ONE
2306 TAD OP1 /COMPUTE FINAL EXPONENT
2309 DCA OP1 /AND SAVE IT
2310 TAD DM74 /SET ITERATION COUNTER
2313 RAL /INITIALIZE LINK
2314 FPDVLP, CLA RAR /COMPARE SIGNS
2318 TAD OPMAC /NEGATE OPERAND
2320 JMS I DOADD /ADD OPERAND AND FAC
2321 TAD D6 /RIGHT SHIFT QUOTIENT
2322 RAL /PRESERVING ADD OVERFLOW BIT
2336 JMS I DAL1 /LEFT SHIFT FAC ONE
2337 ISZ DITCNT /TEST ITERATION COUNT
2339 TAD OP1 /PUT QUOTIENT INTO FAC
2352 JMS I DNORM /NORMALIZE
2368 -1 /TO PREVENT SPURIOUS DO ENDS
2369 \f/ NUMERIC CONVERSION ROUTINE
2371 NUMBER, 0 /GENERAL NUMBER CONVERSION ROUTINE
2372 DCA ESWIT /ZERO E/D SWITCH
2373 DCA DECPT /ZERO DECIMAL POINT SWITCH
2381 DCA SIGN /CLEAR SIGN SWITCH
2382 JMS I [GETC /GET A CHAR
2383 JMP I NUMBER /NO CHAR IS NO NUMBER
2384 JMS CHKSGN /CHECK FOR SIGN
2385 SIGN, 0 /THIS SWITCH GETS SET
2386 DCA NDIGIT /ZERO DIGIT COUNT
2387 CONVLP, JMS I [DIGIT /GET A DIGIT
2388 JMP TRYDEC /IS THERE A DECIMAL POINT ?
2390 DCA NXTDGT /SAVE THE DIGIT
2391 ISZ NDIGIT /INCR NUMBER OF DIGITS
2392 TAD WORD2 /PREPARE TO MULT BY 10
2404 JMS I (AL1 /DOUBLE FAC
2405 JMS I (AL1 /DOUBLE AGAIN
2406 JMS I (OADD /TIMES FIVE
2407 JMS I (AL1 /ONE MORE DOUBLING IS TIMES 10
2409 DCA OP3 /PUT NEWEST DIGIT INTO OPERAND
2415 JMS I (OADD /ADD IN NEWEST DIGIT
2417 TRYDEC, TAD DECPT /DECIMAL ALREADY ?
2419 JMP TRYE2 /YES, LOOK FOR EXPONENT
2420 JMS I [GETC /LOOK FOR .
2421 JMP DIGTST /SEE IF THERE WAS ANYTHING
2424 JMP TRYE1 /TRY FOR E
2425 JMS I [SAVECP /SAVE CHAR POS
2426 JMS I (CKEOPR /CHECK FOR SPECIAL CASE OF LIT.RE.
2427 JMP NOLDRE /NOT LIT.RE.
2429 JMS I [BACK1 /PUT BACK . IT BELONGS TO RELATIONAL
2430 DIGTST, TAD NDIGIT /ANY DIGITS ?
2432 JMP I NUMBER /NO, NO NUMBER
2433 JMP INTEGR /TAKE INTEGER EXIT
2434 NOLDRE, ISZ DECPT /SET DECIMAL POINT SW
2435 JMS I [RESTCP /RESTORE CHAR POS
2436 JMP CONVLP-1 /LOOP FOR OTHER DIGITS
2437 TRYE1, JMS I [BACK1 /PUT BACK NON .
2438 TAD NDIGIT /ANY DIGITS YET ?
2440 JMP I NUMBER /NO, NO NUMBER
2441 JMS EORD /LOOK OR E OR D
2443 TRYE2, JMS EORD /LOOK FOR E OR D
2446 DCA EXPON /ZERO EXPONENT
2447 JMS I (DODEC /HANDLE DIGITS RIGHT OF .
2448 JMP DOSIGN-1 /GO DO SIGN
2449 INTEGR, TAD (107 /PUT IN EXPONNT
2451 JMS I (ANORM /NORMALIZE
2452 ISZ NUMBER /BUMP RETURN
2453 DOSIGN, TAD SIGN /CHECK THE SIGN
2455 JMS I (NEGFAC /NEGATE IF NEGATIVE
2456 JMP I NUMBER /RETURN
2457 CHKSGN, 0 /CHECK FOR SIGN
2458 TAD (-255 /IS IT - ?
2460 ISZ I CHKSGN /YES, SET SWITCH
2462 TAD (255-253 /IS IT + ?
2464 JMS I [BACK1 /RETURN CHAR OTHERWISE
2466 EORD, 0 /LOOK FOR E OR D
2467 JMS I [GETC /LOOK FOR E OR D
2474 ISZ ESWIT /SET SWITCH IF E
2476 ISZ DPUSED /SET D.P. SWITCH IF D
2477 JMP I (GETEXP /OK, GET EXPONENT
2478 NOEORD, JMS I [BACK1 /PUT IT BACK CAUSE ITS NOT OURS
2481 REWIND, JMS I [EXPR /COMPILE UNIT
2483 TAD (REWOPR /OUTPUT REWIND OPERATOR
2486 \f/ NUMERIC CONVERSION ROUTINE
2488 SMLNUM, 0 /INPUT A NUMBER <= 4095
2489 EXPLUP, DCA EXPON /ZERO THE EXPONENT
2490 JMS I [DIGIT /GET THE NEXT DIGIT
2491 JMP I SMLNUM /NUMBER DONE
2493 DCA OPO /SAVE THE DIGIT
2494 TAD EXPON /MULT BY 10
2499 TAD OPO /ADD IN DIGIT
2500 JMP EXPLUP /STORE BACK INTO EXPONENT
2501 GETEXP, DCA ESIGN /ZERO EXPONENT SIGN SWITCH
2502 JMS I [GETC /GET A CHAR
2504 JMS I (CHKSGN /IS IT A SIGN
2506 ESIGN, 0 /THIS IS THE SWITCH TO SET
2507 JMS SMLNUM /GO GET THE EXPONENT
2508 FIXEXP, TAD ESIGN /CHECK EXPONENT SIGN
2511 TAD EXPON /COMPLEMENT EXPONENT
2514 JMS DODEC /GO HANLE EXPONENT
2515 CLL CML RTL /BUMP RETURN BY TWO (DP) OR 3 (FP)
2516 TAD ESWIT /DEPENDING ON E/D SWITCH
2519 JMP I (DOSIGN /CHECK THE SIGN
2521 TAD DO107 /NORMALIZE THE NUMBER
2524 TAD DECPT /WAS THERE A DECIMAL POINT ?
2526 TAD NDIGIT /HOW MANY DIGITS TO THE RIGHT ?
2528 TAD EXPON /SUBTRACT THAT NUMBER FROM EXP
2530 JMP POSEXP /EXPONENT IS POSITIVE
2532 DCA EXPON /ONLY NEED ABS VALUE
2533 TAD (FPDIV /DO DIVIDES
2536 TAD (FPMUL /DO MULTIPLIES
2537 DCA FPRTNE /MULTIPLY/DIVIDE ROUTINE
2538 TAD (PETABL-1 /POWERS OF TEN TABLE
2540 EXPMUL, TAD EXPON /LOOK AT THE EXPONENT
2542 JMP I DODEC /IF 0 ITS THRU
2544 DCA EXPON /PUT LOWEST BIT INTO LINK
2546 JMP SKPEXP /THIS ONE DOESN'T COUNT
2548 TAD I X17 /MOVE FACTOR INTO OPERAND
2562 JMS I FPRTNE /MULTIPLY OR DIVIDE BY THIS FACTOR
2563 JMP EXPMUL /CHECK NEXT BIT
2564 SKPEXP, TAD X17 /SKIP OVER THIS FACTOR
2567 AR1, 0 /SHIFT FAC RIGHT ONE
2590 AL1, 0 /SHIFT FAC LEFT ONE
2610 \f/ NUMERIC CONVERSION ROUTINE
2612 FPMUL, 0 /FLOATING MULTIPLY ROUTINE
2613 TAD WORD1 /COMPUTE NEW EXPONENT
2616 TAD WORD2 /SAVE AC MANTISSA
2626 TAD (-74 /SET ITERATION COUNTER
2628 DCA WORD2 /ZERO FAC MANTISSA
2634 MULLUP, JMS I (AR1 /SHIFT FAC RIGHT ONE
2635 TAD TW2 /SHIFT MULTIPLIER RIGHT
2651 JMS I (OADD /ADD IF LINK IS ONE
2652 ISZ ITRCNT /BUMP COUNT
2654 TAD OP1 /PUT IN CORRECT EXPONENT
2656 JMS I (ANORM /NORMALIZE THE RESULT
2663 ANORM, 0 /NORMALIZE FAC
2664 TAD WORD2 /IS MANTISSA 0 ?
2676 JMP ZEXP /YES, ZERO EXPONENT
2677 NORMLP, CLA CLL CML RTR /IS HIGH ORDER MANTISSA = 6000
2680 JMP NO6000 /NO, SKIP THIS STUFF
2681 TAD WORD3 /YES, IS THE REST 0 ?
2690 SZA CLA /SKIP IF 600000 ... 0000
2692 JMP I ANORM /NORM IS DONE WHEN BITS DIFFER
2693 JMS I (AL1 /SHIFT LEFT ONE
2694 CLA CMA /DECREMENT EXPONENT
2700 NEGFAC, 0 /NEGATE FAC
2701 TAD (ACO /GET POINTER TO OPERAND
2703 TAD (-6 /SIX WORD NEGATE
2707 TAD I NFPTR /GET NEXT WORD
2709 DCA I NFPTR /RESTORE AFTER COMPLEMENTING
2710 CML CLA CMA /LINK GETS COMPLEMENTED ONCE HERE
2711 TAD NFPTR /AND ONCE AGAIN HERE
2712 DCA NFPTR /RESTORE DECREMENTED POINTER
2719 DHLRTH, 0 /HOLLERITH IN DATA SUBR
2727 \f/ VARIABLE SCANNER
2729 GETNAM, 0 /GET VARIABLE NAME
2730 JMS LETTER /FIRST CHAR MUST BE ALPHABETIC
2731 JMP I GETNAM /NO VARIABLE
2732 DCA BUCKET /FIRST ONE IS THE BUCKET
2734 DCA NPTR /POINTER TO NAME BUFFER
2735 CLL CMA RTL /SIX CHARS MAX (3 WORDS)
2737 PAKLUP, JMS LETTER /GET A LETTER
2740 JMS I [DIGIT /NO LETTER, IS IT A DIGIT ?
2741 JMP NDONE /NO, NAMES OVER
2744 RTL /MOVE CHAR TO A HIGHER PLACE
2745 DCA I NPTR /STORE IT
2746 ISZ NCNT /BUMP COUNTER
2747 JMP MORNAM /MORE TO COME
2749 NDONE, DCA I NPTR /ZERO NEXT WORD
2750 ISZ GETNAM /FIX RETURN ADDR
2752 MORNAM, JMS LETTER /GET NEXT CHAR
2754 JMP .+3 /ITS A LETTER
2756 JMP NDONE+1 /NO GOOD, NAMES OVER
2758 DCA I NPTR /COMBINE TWO CHARS
2764 DATA, JMS I [IFCHEK /IF(..)DATA ????
2765 TAD (DATAST /START DATA STATEMENT
2767 DATLUP, CLA CMA /SET DIMNUM = -1 IF NO SUBSCRIPTS
2768 JMS I [GETSS /GET LIST ELEMENT
2770 TAD (DPUSH /OUTPUT DPUSH OPERATOR
2773 TAD TEMP2 /FOLLOWED BY POINTER
2775 TAD DIMNUM /FOLLOWED BY NUMBER
2778 TAD I TEMP2 /LOOK AT TYE TYPE
2779 AND (20 /IS IT AN ARG ?
2782 JMP DATAER /YES, THATS BAD
2787 JMP DATLUP /LOOK FOR MORE
2791 JMP DLOOP2 /GO LOOK FOR ELEMENT
2793 DCA X10 /POINTER TO THE GOODS
2794 TAD I X10 /THEN STUFF
2798 NXTDE, TAD (ENDELM /OUTPUT END OF ELEMENT
2800 JMS I [GETC /LOOK FOR COMMA
2804 JMP DLOOP2 /YES, GET MORE DATA
2805 TAD (254-257 /SLASH ?
2807 JMP DATAER /NO, ERROR
2808 JMS I [GETC /ANOTHER DATA GROUP ?
2812 JMP DATA+1 /START A NEW DATA STMT
2813 DATAER, JMS I [ERMSG
2814 0401 /OK WHEN THIS IS AN AND
2816 DHOLER, JMS I [ERMSG
2817 0410 /HOLLERITH DATA ERROR
2819 DQUOTE, 0 /GET CHAR FOR QUOTED DATA
2829 JMP DNOTQ2 /REPLACE '' BY '
2832 DNOTQ2, TAD [247 /FIX CHAR
2835 OUT3WD, 0 /2.02/ OUTPUT 3 WORDS
2836 TAD [DATELM /2.02/ OUTPUT ELEMENT HEAD
2837 JMS I [OUTWRD /2.02/
2838 TAD (3 /2.02/ AND SIZE
2839 JMS I [OUTWRD /2.02/
2840 TAD WORD1 /2.02/ NOW THREE WORDS
2841 JMS I [OUTWRD /2.02/
2843 JMS I [OUTWRD /2.02/
2845 JMS I [OUTWRD /2.02/
2851 TAD (-250 /IS CHAR ( ?
2853 JMP NOCMPD /NO, NOT COMPLEX DATA
2854 JMS I [NUMBER /GET REAL PART
2857 JMP DATAER /DP IS NG WITH COMPLEX
2858 JMS OUT3WD /2.02/ OUTPUT 3 WORDS
2859 JMS I [CHECKC /LOOK FOR COMMA
2861 JMP DATAER /BAD IF NOT THERE
2862 JMS I [NUMBER /GET IMAGINARY PART
2866 JMS I [CHECKC /LOOK FOR )
2868 JMP DATAER /NOT THERE
2869 JMP DATAFP /GO MOVE IMAGINARY PART
2870 NOCMPD, IAC /IS IT QUOTED STRING ?
2873 TAD (DQUOTE /GET SUBR ADDRESS
2874 JMP HOLDAT /GO HANDLE IT
2875 NQUOTD, TAD (247-317 /IS IT AN O (OCTAL)
2878 TAD (317-256 /IS IT .
2880 JMS I (TRUFAL /CHECK FOR TRUE OR FALSE
2881 JMP NOTF /NO TRUE-FALSE, TRY NUMBER
2887 DCA WORD1 /TRUE=1.0 FALSE=0.0
2889 JMP DATAFP /GO PUT IT
2890 NOTF, JMS I [BACK1 /PUT BACK CHAR
2891 JMS I [NUMBER /TRY FOR A NUMBER
2892 JMP DATAER /ELEMENT MISSING
2893 JMP TRYHOS /IF INTEGER, TRY FOR H OR *
2895 DATAFP, TAD (-3 /FP DATA
2896 DCA TEMP /SIZE OF ITEM
2897 TAD [DATELM /DATA ELEMENT SIGNAL
2900 CIA /ALWAYS POSITIVE
2902 JMP DATA3 /GO OUTPUT THE DATA
2903 TRYHOS, JMS I [GETC /LOOK FOR H
2907 JMP TRYSTR /NOT H, MAYBE ITS *
2908 JMS I [FIXNUM /INTEGERIZE IT
2910 JMP DHOLER /HOLLERITH DATA ERROR
2912 DCA TEMP /SAVE COUNT
2913 TAD (DHLRTH /GET SUBR POINTER
2915 CLL CMA RTL /2.02/ COUNT
2916 DCA TEMP2 /2.02/ BY THREES
2918 DCA X10 /2.02/ POINTER
2919 HDLOOP, JMS I HCHAR /GET A CHAR
2921 AND [77 /6 BITIZE IT
2924 RTL /UPPER-PART-OF-WORDIZE
2925 DCA WORD3 /2.02/ STORAGIZE IT
2926 JMS I HCHAR /GET ANOTHER
2927 JMP LASTHD /LAST HALF WORD MUST GO OUT
2929 TAD WORD3 /2.02/ COMBINIZE THE TWO HALVES
2930 DCA I X10 /2.02/ STORE IT
2931 ISZ TEMP2 /2.02/ THREE AT A TIME
2933 JMS OUT3WD /2.02/ OUTPUT THREE
2934 JMP HOLDAT+1 /2.02/ GO DO NEXT THREE WDS
2935 EOHD, CLL CML RTL /2.02/ ANY CHARS IN THIS SET ?
2938 JMP NXTDE /2.02/ NO, DO NEXT ELEMENT
2939 JMP .+4 /2.02/ YES, FILL IT OUT
2940 LASTHD, TAD WORD3 /2.02/ FILL OUT LOWER CHAR
2941 TAD (40 /2.02/ WITH A BLANK
2943 TAD (4040 /2.02/ THEN FILL REST
2944 DCA I X10 /2.02/ WITH BLANKS
2947 JMP DATAFP /2.02/ GO OUTPUT IT
2948 TRYSTR, TAD (310-252 /*
2951 JMS I [BACK1 /PUT BACK THAT CHAR
2952 JMP DATAFP /ITS JUST AN INTEGER
2953 TAD (DREPTC /REPETITION COUNT
2956 JMS I [OUTWRD /OUTPUT COUNT
2958 \f/ INITIALIZE READ IN
2960 INITLN, TAD IX7772 /READ FIRST SIX CHARS
2965 JMS I [ICHAR /READ A CHAR
2969 JMP NIXTAB /NO THIS ONE
2974 JMP CHKCOM /DO COMMENT CHECK
2976 DCA I CHRPTR /STORE THE CHAR
2979 CHKCOM, TAD I IXLINE /COMMENT ?
2982 JMP IGNORE /IGNORE IT
2983 TAD I IXLNP5 /CONTINUATION ?
2987 TAD IX7700 /FIX CALL
2988 CDF 10 /SEE WHAT HAPPENS WHEN YOU MOVE A ROUTINE**
2992 JMS I IX200 /REMOVE MONITOR
2994 CDF 10 /FIX FIELD ONE STUFF
3002 JMP I IXRDFS /LOOK FOR PROG HEADER
3007 JMS I [ICHAR /SKIP TILL CARRIAGE RETURN
3021 \f/ SEARCH FOR PROGRAM HEADER
3024 JMS I [ICHAR /THIS IS A DUPLICATE OF THE CODE
3025 JMP ENDLNF /AT LABEL 'RDLOOP' , ONLY THE
3030 DCA I CHRPTR /NAMES HAVE BEEN CHANGED TO
3034 TAD CHRPTR /PROTECT THE ASSEMBLY
3035 CIA CLL /(IT GETS THE FIRST LINE
3036 TAD (LINE+270 /WHICH MAY BE SUBROUTINE OR
3037 /FUNCTION. 1ST LINE SHORTER THAN REST BEC OF BUFFER OVERWRITES**
3038 SZL CLA /OR SOMETHING ELSE, IN WHICH CASE
3039 JMP RDFRST /ITS THE MAIN PROGRAM)
3040 JMS I [ERMSG /LINE TOO LONG
3042 JMP SKPFL /SKIP REST
3048 SKPCMF, TAD X16 /BY ORDER OF THE EMPEROR
3049 DCA CHRPTR /MARIO DE NOBILI
3099 DCA X10 /PREPARE TO SEARCH THE LIST
3100 CLOOP1, CDF 10 /(FNC NAMES UP IN FLD 1)**
3101 TAD I X10 /OF LEGAL HEADER LINES
3103 SZA /CODE IS AS UNDER 'CMDLUP'
3134 BADCMF, JMS I [RESTCP /NOT A FUNCTION OR SUBROUTINE
3135 JMP I (LINE1 /SO GO TO MAIN PART OF COMPILER
3136 BADDIE, JMS I [MESSAG /SOMETHING MISSING FROM SYS
3139 \f/ ANALYZE PROGRAM HEADER
3141 SUBRTN, CLA CMA /SET TO -1 FOR SUBR
3143 REAFUN, TAD (102 /SET TYPE TO REAL
3146 LOGFUN, IAC /SET TYPE OF FUN
3147 DBLFUN, IAC /WITH DOUBLEMINT GUM !
3152 JMS I [CHECKC /LOOK FOR 'N'
3156 DCA FUNCTN /SET SWITCH
3157 CDF 10 /1.05/ KILL ENTRY FOR 'MAIN'
3158 DCA I (ALIST+14 /1.05/ BUT DO IT BEFORE THE M BUCKET
3159 CDF /1.05/ CONTAINS ANYTHING USEFULL
3160 JMS I [GETNAM /GET FUNC/SUBR NAME
3162 JMS I [LOOKUP /PUT INTO SYMBOL TABLE
3164 TAD PROGNM /SET UP TYPE
3168 DCA X12 /SAVE POINTER
3169 DCA TEMP2 /ZERO ARG COUNTER
3171 TAD TYPE /PUT IN THE TYPE BITS
3175 JMS I [CHECKC /LOOK OFR (
3177 JMP ISITFN /IS IT A FUNCTION ?
3178 ARGLUP, JMS I [GETNAM /GET THE ARG
3182 DCA TEMP /ADDR OF TYPE WORD
3186 JMP BADBGN /ALREADY AN ARG
3191 TAD TEMP /OUTPUT ADDR OF ARG
3193 ISZ TEMP2 /KEEP COUNT
3194 JMS I [COMARP /LOOK FOR , OR )
3197 TAD TEMP2 /) HOW MANY ARGS ?
3199 DCA I NEXT /INTO ARG LIST
3203 TAD NEXT /SAVE ADDR OF ARG LIST
3206 TAD X12 /RESTORE THE STACK
3208 MOVARG, TAD I X12 /PUT ARGS INTO ARG LIST
3214 JMP I [NEXTST /DO NEXT LINE
3216 ISITFN, TAD FUNCTN /IS IT A FUNCTION
3217 SPA SNA CLA /WITH NO ARGS ?
3218 JMP I [NEXTST /NO, WE'RE OK
3219 BADBGN, JMS I [ERMSG
3222 BDATA, JMS I [CHECKC /LOOK FOR A
3225 CLL CMA RAL /SET FUNCTION SWITCH
3226 DCA FUNCTN /2.02/ STORE IT DUMMY!!
3227 TAD (BDLIST-1 /POINTER TO LIST OF PATCHES
3230 TAD I X10 /GET PATCH LOCATION
3233 JMP I [NEXTST /NO MORE PATCHES
3234 DCA TEMP /SAVE PATCH ADDRESS
3235 TAD BADJMP /GET ERROR JUMP
3236 DCA I TEMP /STORE IT
3238 BADJMP, JMP I [BDERR
3239 \f/ INITIAL SYMBOL TABLE
3246 BLNKCN, 111;0 /BLANK COMMON SLOT
3247 ALIST, 0;0;0;0;0;0;0;0;0;0;0;0;MAIN;0;0;0;0;0;0;0;0;0;0;0;0;0
3254 ONE, THREE;0;1;2000;0
3255 THREE, SIX;0;2;3000;0
3258 MAIN, 0;1000;0;0111;1600
3260 \f/ BLOCK DATA PATCH LIST
3261 BDLIST, IF /BLOCK DATA PATCH LIST
3281 START, SKP /NON-CHAINED ENTRY POINT
3283 CIF CDF 10 /START HERE
3284 JMS I (200 /COMMAND DECODE
3286 0624 /DEFAULT EXT IS .FT
3287 TAD I L7600 /IS AN OUTPUT FILE GIVEN ?
3289 JMP MYFILE /NO, USE FORTRN.TM
3290 MOVOFN, TAD I OFNAME /MOVE NAME INTO PAGE 0
3298 EXTEST, TAD I (7604 /SET DEFAULT EXTENSIONS
3303 JMP GETRA /A WAS SET.USE RA
3304 AND L41 /CHECK FOR L+G
3315 TAD (1423 /.LS FOR LISTING
3319 TAD (1520 /.MP FOR LOAD MAP
3321 EFILE, CLA IAC /OPEN PASS1 OUTPUT FILE
3328 TAD OBLOK /SAVE STARTING BLOCK
3336 JMS I (200 /GET PASS2
3344 SP2O, PAS2ON /GET PASS2 OVERLAY
3347 CDF /SAVE PASS2 AND PASS2O BLOCKS
3350 TAD SP2O /SKIP FIRST BLOCK
3351 IAC /ITS THE CORE TABLE
3354 JMP INITLN /GO START COMPILE
3355 MYFILE, CDF /PUT DEFAULT INTO 17600
3358 TAD I NAMOF /ALSO INTO PAGE 0
3366 CLA IAC /SET DEV TO SYS
3368 JMP EXTEST /GO OPEN FILE
3371 OFNAME, 7601 /IGNORE DEVICE (ALWAYS USE SYS)
3375 TMPFL2, 0617;2224;2216;2415 /FORTRN.TM
3376 PASS2N, 2001;2323;6200;2326 /PASS2.SV
3377 PAS2ON, 2001;2323;6217;2326 /PASS2O.SV
3381 TAD (2201 /V3C USE RA
3385 / PROGRAM HEADER LIST
3386 HDRLST, TEXT 'INTEGERFUNCTIO'
3390 TEXT 'COMPLEXFUNCTIO'
3392 TEXT 'DOUBLEPRECISIONFUNCTIO'
3394 TEXT 'LOGICALFUNCTIO'
3403 \f/ PS-8 FILE INPUT ROUTINES
3404 /NEED TWO PAGES BEC. MOVING ICHAR OUT OF FIELD 1 REQUIRES
3405 /ALOT OF FIELD DIDDLING.
3407 MORCHR, TAD (214 /FIX CHAR
3415 TAD I QCHAR /RETURN VALUE IN AC
3419 / EXTENDED OPERATOR LIST
3420 OPRLST, -01;-1604;ANDOPR
3432 PETABL, 0004;2400;0000 /1E1
3440 0066;2160;6744 /1E16
3442 0153;2356;1326 /1E32
3444 0325;3023;6017 /1E64
3446 0652;2235;6443 /1E128
3448 1523;2523;7565 /1E256
3450 3245;3430;6320 /1E512
3452 ENDSTM, 211;"E;"N;"D;215;211;215;232 /V3C
3453 /FAKE END STATEMENT USED IF PROGRAM HAS NONE
3455 \f/MAIN PART OF OS/8 INPUT ROUTINES
3457 ICHAR, 0 /READ CHAR FROM INPUT FILE
3459 ISZ INJMP /BUMP THREE WAY UNPACK SWITCH
3463 TAD INEOF /DID LAST READ YEILD END OF FILE ?
3465 JMP INGBUF /NO, DO ANOTHER READ
3466 GETNEW, JMS INNEWF /OPEN A NEW INPUT FILE
3467 JMP ENDIN /END OF INPUT
3468 INGBUF, TAD INCTR /BUMP RECORD COUNTER
3471 DCA INCTR /RESTORE IF IT HASN'T OVERFLOWED
3473 ISZ INEOF /SET END OF FILE SWITCH
3476 JMS I INHNDL /DO THE READ
3477 0210 /ONE BLOCK TO FIELD 1
3480 JMP INERR /HANDLER ERROR
3481 INBREC, ISZ INREC /BUMP RECORD NUMBER
3482 TAD INBUFP /RESET BUFFER POINTER
3483 SVIBPT, DCA INPTR /V3C
3484 TAD (-601 /SET CHAR COUNT
3486 TAD INJMPP /RESET THREE WAY JUMP SWITCH
3488 JMP ICHAR+1 /GO AGAIN
3489 INERR, ISZ INEOF /EITHER EOF OR BADDIE
3491 JMP INBREC /END OF FILE, DO NEXT FILE
3492 JMP TERR /INPUT ERROR, GIVE I F AND EXIT
3493 ENDIN, TAD (ENDSTM /V3C IF NO END STATEMENT, FORCE ONE
3496 /ENDIN, TAD INCALL /END OF INPUT IS USR IN CORE ?
3500 / JMP I (ENDX /NO, ITS END OF PROG
3501 TERR, JMS I (MESSAG /YES, BAD INPUT. WAS SQ.BRCK**
3504 INJMP, HLT /3 WAY CHAR UNPACK BRANCH
3507 ICHAR3, TAD INJMPP /RESET JUMP SWITCH
3510 AND (7400 /COMBINE THE HIGH ORDER BITS
3511 CLL RTR /OF THE TWO WORDS
3513 TAD INTMP /TO FORM THE THIRD CHAR
3516 ISZ INPTR /BUMP WORD POINTER
3517 JMP ICHAR1+1 /DO SOME COMMON STUFF
3518 ICHAR2, TAD I INPTR /SAVE THE HIGH ORDER BITS
3520 DCA INTMP /FOR THE THIRD CHAR
3521 ISZ INPTR /GO TO THE SECOND WORD
3522 ICHAR1, TAD I INPTR /GET THE LOW 8 BITS
3524 AND (177 /AND I MEAN ONLY 8 !!
3525 SNA /V3C YOU WERE WRONG - YOU MEANT ONLY 7
3527 TAD (-32 /IS IT ^Z (END OF FILE)
3529 JMP GETNEW /YES, LOOK FOR THE NEXT FILE
3532 JMP ICHAR+1 /IGNORE LINE FEEDS
3535 JMP ICHARN /RETURN ON CARRIAGE RETURN **
3538 JMP ICHAR+1 /IGNORE FORM FEEDS
3543 INFPTR, 7617 /POINTER TO INPUT FILE LIST
3546 INNEWF, -1 /FETCH HANDLER FOR NEXT FILE
3548 TAD (INDEVH+1 /THIS IS WHERE IT GOES **
3551 TAD I INFPTR /GET NEXT INPUT FILE INFO
3553 JMP I INNEWF /NO MORE FILES
3554 CDF 10 /WAS CIF 10**
3555 JMS I INCALL /CALL MONITOR
3557 INHNDL, 0 /ENTRY ADDR GOES HERE
3558 JMP INERR+3 /THIS CAN'T HAPPEN HERE
3559 TAD I INFPTR /GET LENGTH
3561 SZA /A ZERO HERE MEANS >=256 BLOCKS
3562 TAD (17 /PUT IN SOME MORE BITS
3565 DCA INCTR /STORE LENGTH OF FILE
3567 TAD I INFPTR /GET STARTING RECORD NUMBER
3570 DCA INEOF /CLEAR EOF FLAG
3574 INCALL, 200 /CHANGED TO 7700 AFTER FIRST TIME
3578 CMDLST, -1106;0;IF /IF
3585 -1117;0;DOUBLE /DOUBLE PRECISION
3591 -1716;0;COMMON /COMMON
3594 -1405;0;COMPLE /COMPLEX
3598 -2505;0;NEXTST /CONTINUE
3607 -1604;0;REWIND /REWIND
3610 -2216;0;RETURN /RETURN
3613 -1114;0;ENDFIL /ENDFILE
3618 -1117;0;DIMENS /DIMENSION
3623 -0124;0;FORMAT /FORMAT
3625 -1124;0;WRITE /WRITE
3630 -1603;0;EQUIV /EQUIVALENCE
3635 -1405;0;DFINFL /DEFINEFILE
3638 -0705;0;INTEGE /INTEGER
3641 -0301;0;LOGICA /LOGICAL
3645 -0114;0;EXTERN /EXTERNAL
3649 -0103;0;BACKSP /BACKSPACE
3652 -0716;0;ASSIGN /ASSIGN
3654 -2523;0;PAUZE /PAUSE