return to main page1401 - FORTRAN - Illustrated
Goal: a web page that combines
- the "known" FORTRAN phase descriptions from 1401-IBM-Systems-Journal-FORTRAN.html - with the disassembled and commented "phases" from Van Snyder, up through rev. v3m4. Zeroth - Surprise!! - the floating point operations were "interpreted".
from http://en.wikipedia.org/wiki/Fortran
IBM 1401 FORTRAN FORTRAN was provided for the IBM 1401 by an innovative 63-pass compiler that ran in only 8k of core. It kept the program in memory and loaded overlays that gradually transformed it, in place, into executable form, as described by Haines et al.[5] The executable form was not machine language; rather it was interpreted, anticipating UCSD Pascal P-code by two decades.
Gary Mokotoff [GM] and Van Snyder [VS] state
- [GM] The compiler DID produce machine language. It converted FORTRAN to 1401 machine language.
Of course floating point was interpretive. There was no floating point hardware. :>)- [VS] Only the floating-point calculations were interpreted "byte codes". The interpreter is phase 63.
- There's a listing for it at the bottom of this page.
The alternative was to emit calls to individual floating-point routines.
The byte code is more compact (by about three characters per operation).
For a = b * c it would be something likeb arith dcw @*@ dc b dc c dcw @=@ dc a instead of b ffmult dcw b dcw c b fstore dcw aIt's not much of a performance hit: Interpreting it is much less work than actually doing the arithmetic.- [VS] The compiler fits in 4k, but that doesn't leave any room for the program )-|
- [VS] If you wish to run a version of 1401 FORTRAN on a PC in 1401 emulation mode click here 1401-FORTRAN-SIMH.
- [VS] For running on a 1401 using mag tape emulator, the longest record on the compiler tape is less than 2300 characters, so it should be possible to run them through the 1401 magnetic tape emulator. The files are v3m0.simh.mt1 and v3m4.simh.mt1
First, a little fun ;-)) Early March 2011
from David Macklin
Ron, [Ron Mak, Prof. Comp. Science, San Jose State]
I would add an amusing point:
During development and testing, during which source programs were small, we were running on a 4k byte machine.David Macklin
from Robert Garner
Amazing! Do you recall any other interesting anecdotes about your minimal-footprint compiler? Funny bugs? Interesting problems you had to solve?
What was the design process like? Fortran had just come out.
Did you grumble about any language specification holes?Why 63 passes, and not 64, or 127 ? ;-)
It was not planned to have precisely 63 passes. A new pass would be defined when the space constraints so dictated. In fact, the ability to do so is the principal benefit of the serial compiling process. David
How did you respond to folks that say it was too slow?
Honestly, no one ever said that. It was a 'fait accompli'. D
- Robert
Alan Kay addedand
I meant the compiling part heh heh! (although we had the luxury of an 8K machine in ATC so we could work with larger programs) I seem to recall an Algol compiler described by Woodger (?) in one of the first Annual Reviews of Automatic Programming that ran on a tiny British machine that only had a few hundred words of memory (on a drum), and this took more than 100 passes to compile. The paper was extremely well written and gave a good picture of how the programmer went about dividing up the passes....
Cheers,
Alan
I remember the FORTRAN compiler well .... it was .... somewhere between "glacial" and "majestic" (history should bestow the latter pace to it!) Cheers,
Alan
Hardly 'glacial'. The object program, already being in core, was instantly ready to run. David
Gary Mokotoff mentions
When I left IBM in 1968, I took with me printouts of the source code of 1401 SPS-1, SPS-2, Autocoder and FORTRAN. ... ... I gave them to the Charles Babbage Institute at the University of Minnesota. You can see the description at http://discover.lib.umn.edu/cgi/f/findaid/findaid-idx?c=umfa;cc=umfa;rgn=main;view=text;didno=cbi00093
Local copy of CBI page at MokotoffGary2CBabbageInstitute.html
Back to business ;-))
The phases (overlays) below illustrates the efforts and complexities faced (in the goode olde dayze) when memory was not essentially free and infinite. This compiler worked in a computer of 8,000 characters of memory, not 1,000,000 bytes (characters) of memory. Overlaying meant that when one "phase" was completed, another "phase" was loaded into the same place in memory, with links to common data and variables precomputed. To do the above, sucessfully, required real attention to detail !! The code in this page was sent by Van Snyder, April 18, 2004 - in a main (mokotoff-9.zip) and an update (mokotoff-9-v3m4.zip). I merged the files, replacing the updated files. Van Snyder and David Macklin have been working on this disassembly.
Table of Contents, Links to Phases (Overlays)
- 00, - Snapshot.
- 01, - System Monitor. Brings in the next phase from ...
- 02, - Loader. Stores the entire source program ...
- 03, - Scanner. Determines the type of each statement ...
- 04, - Sort one phase. Determines if there is enough free storage to ...
- 05, - Sort two phase. Statements of the same type are chained together.
- 06, - Sort three phase. The source program is sorted internally by statement type.
- 07, - Insert group-mark phase
- 08, - Squeeze phase
- 09, - Dimension phase one
- 10, - Equivalence phase one
- 11, - Equivalence phase two
- 12, - Dimension phase two
- 13, - Variable Phase One
- 14, - Variable Phase Two
- 15, - Variables Phase 3
- 16, - Variables Phase 4
- 17, - Variables Phase 5
- 18, - Constants Phase One
- 19, - Constants Phase Two
- 20, - Subscripts Phase
- 21, - Statement Numbers Phase
- 22, - Statement Numbers Phase
- 23, - TAMROF Phase One
- 24, - TAMROF Phase Two
- 25, - List Phase One
- 26, - List Phase Two
- 27, - List Phase Three
- 28, - Stmt Numbers Two
- 29, - Stmt Numbers Three
- 30, - Stmt Numbers Four
- 31, - Stmt Numbers Five
- 32, - Input/Output One
- 33, - Arith Phase One
- 34, - Arith Phase Two
- 35, - Arith Phase Three
- 36, - Arith Phase Four
- 37, - Arith Phase Five
- 38, - Arith Phase Six
- 39, - I/O Phase Two
- 40, - Computed GOTO Phase
- 41, - GOTO Phase
- 42, - STOP/PAUSE Phase
- 43, - Sense light Phase
- 44, - IF Cond Phase
- 45, - Continue Phase
- 46, - DO Phase
- 47, - Resort 1 Phase
- 48, - Resort 2 Phase
- 49, - Resort 3 Phase
- 50, - Resort 4, phase 50A & 50B
- 51, - Replace phase one
- 52, - Load - phase 52A, B, C
- 53, "Relocatable Package - Reloading Snapshot - Snapshot
- 54, - Format loader 54A, 54B, 54C, 54D
- 55, - Replace phase 2
- 56, - Snapshot phase
- 57, - Condensed deck phase one,
- 58, - Condensed deck phase 2,
- 59, ???
- 60, - Condensed deck phase 3,
- 61, - GEAUX phase one
- 62, - GEAUX phase 2
- 63, - Arithmetic package
The principal function of each phase of the compiler is indicated below. Secondary functions are subordinated; for example, error checking occurs in almost every phase, but is seldom mentioned.
- Phase 00 - Snapshot. Loads a snapshot routine into 350 positions of core storage. This routine lists a specified amount of core storage.
- Phase 01 - System Monitor. Brings in the next phase from the system tape or initiates reading of the next phase from cards, depending on whether the compiler is used as a tape or card system. The monitor and snapshot routines are the only ones that exist in storage throughout compilation. Because the phases act serially, very little is required of this phase which consists of only 20 instructions.
- Phase 02 - Loader. Stores the entire source program, statement by statement, with all non-significant blanks eliminated. The source program is stored backwards in order to use the 1401 machine instructions that cause address registers to decrement when processing data. Appended on the right of each statement is a three-position internal sequence number (001 for the first statement, 002 for the second, etc.). The sequenced source program is printed.
JOB Fortran compiler -- phases 00-02 CTL 6611 * * SNAPSHOT, SYSTEM MONITOR, and LOADER phase. v3m4 * * Read and store the source program, in reverse order, starting * at the top of core, with blanks removed except within * Hollerith fields in FORMAT statements. Each statement begins * with 000. Format statements then have F, while others have R. * Then the label, if any, followed by a colon. The end of each * statement is marked by a group mark with a word mark. After * the last card, a STOP statement is inserted. * ORG 1 * * Starts here if booted from tape * 1start BER lderr Boot error? 6 B beginn No, start up 10lderr H lderr 39 DCW @0 @ * * Left over from the rest of the overlay card * 40 NOP 0,0 47 SW 40,40 54 SW 40,40 61 SW 40,40 68 B beginn 80 DCW @009750023@ * 86 DC @ @ 89X1 DCW @000@ xxxxx1 equ x1 for use in SFX regions 91 DC @00@ 94X2 DCW @000@ xxxxx2 equ x2 for use in SFX regions 96 DC @00@ 99X3 DCW @000@ xxxxx3 equ x3 for use in SFX regions 104 DC @0 @ 110phasid DCW @LOADER@ Phase ID, for snapshot 111 DCW #1 WM cleared if DO statement appears 112 DCW #1 WM cleared if DO statement appears 113 DCW #1 WM cleared if DO statement appears 114 DCW #1 WM cleared when an I/O list of DO is processed 115 DCW #1 WM cleared if I/O list and not limited format 116subscr DCW #1 WM cleared if subscript code needed 117series DCW #1 Need series routine if no WM 118sincos DCW #1 Saw sinf or cosf if no WM 119logf DCW #1 Saw logf if no WM 120expf DCW #1 Saw expf if no WM 121 DCW #1 Saw atanf if no WM 122sawabs DCW #1 Saw absf if no WM 123sawneg DCW #1 Saw negation operator (unary minus) if no WM 124xfixf DCW #1 Saw xfixf if no WM 125floatf DCW #1 Saw floatf if no WM 126 DCW #1 Saw sqrtf if no WM 127 DCW #1 Saw user function R if no WM 128 DCW #1 Saw user function U if no WM 129 DCW #1 Saw user function P if no WM 130 DCW #1 Saw user function W if no WM 131 DCW #1 Saw user function Y if no WM 132 DCW #1 Saw user function Z if no WM 133 DCW #1 Saw user function J if no WM 134 DCW #1 Saw user function K if no WM 135 DCW #1 Saw user function L if no WM 136 DCW #1 Saw user function M if no WM 137 DCW #1 Saw user function D if no WM 138 DCW #1 Saw user function H if no WM 139 DCW #1 Saw xlinkf if no WM 142negar2 DCW #3 Looks like negary -- see phase 20 145tblbot DCW #3 One below numbers, formats, I/O lists 148seqtab DCW #3 Bottom of sequence number table - 2 151docnt DCW #3 Count of DO statements 154botfmt DCW #3 Bottom of format strings or number table - 1 157negar3 DCW #3 Looks like negary -- see phase 20 160arysiz DCW #3 Total array size & 2 163negary DCW #3 16000 - arysiz 180 DC #17 183nstmts DCW #3 Number of statements, including generated stop 184glober DC #1 Global error flag -- WM means error 185gotxl DCW #1 XLINKF was referenced if no WM 188reltab DCW #3 Relocatable function table entry addresses 191subent DCW #3 Entry to subscript routine 194arytop DCW #3 Top of arrays in object code 195 DC #1 199 DCW @V3M4@ ORG 333 * * Snapshot routine * sfx s 333snapsh SBR exit&3 337 SBR sxx&6 341 MCW kz3,adr5-2 Start five-digit address at zero 348 MCW xxxxx3,sx3&6 355 MCW xxxxx1,sx1&6 362 SBR xxxxx1,1 369 SBR xxxxx3,202 376 CS 332 380 CS 381 MCW phasid,210 388 BSS skip,F * * Print a header * 393 CC 1 395 MCW xxxxx2,250 402sxx SBR 216,0 return address was stored in B 409sx3 SBR 256,0 x3 was stored in B 416sx1 SBR 244,0 x1 was stored in B 423 W 424 CC K 426 ZA kp2,w2a 433clearh CS 332 437 CS 438 CC J 440 MCW adr5,306 five-digit address 447 MCW 448 SBR loop&6 452 MCW k9,w2b-1 459loop MCW w2b-1,000 466 MCW dots 470 SBR loop&6 474 A km10,w2b add I0 = -10 481 BWZ loop,w2b-1,2 no zone in counter high digit? 489 A kp1,adr5-2 bump hundreds digit of address 496 W 497get SW 0&X3 move data and wm to print area 501 MCW 0&X1,0&X3 508 BW dowm,0&X1 skip clearing print area wm 516 CW 0&X3 520dowm C xxxxx1,topcor Done? 527 BU cont no 532 W 533 WM 535rx1 MCW sx1&6,xxxxx1 Restore index regs 542 MCW sx3&6,xxxxx3 549 CS 332 553 CS 554 BSS halt,G 559 B exit 563halt H 564exit B 0-0 568cont SBR xxxxx1,1&X1 575 BCE bump3,xxxxx3-2,2 583 SBR xxxxx3,201 590 W 591 WM 593 A kp1,w2a 600 C w2a,kp15 607 BU clearh 612 S w2a 616 CCB clearh,1 621skip MCW xqtd,220 628 W rx1 632bump3 A kp1,xxxxx3 639 B get 651dots DCW @9........@ 653 dcw @9-@ 658adr5 DCW 00000 Five digit address 661kz3 dcw 000 662kp2 DCW &2 664w2a DCW #2 665k9 dcw 9 667km10 DCW @I0@ 669w2b DCW #2 670kp1 dcw &1 672kp15 dcw &15 680xqtd dcw @EXECUTED@ sfx End of snapshot routine * * Storage for parameter card * da 1x19 685pword 5 The word PARAM 688topcor 8 Top core address from PARAM card 690imod 10 Integer modulus -- number of digits 692mantis 12 Floating point mantissa digits 693condns 13 P for condensed deck 694snapsw 14 S for snapshot 695c1410 15 T if run on 1410 in 1401 compatibility mode 696fmtsw 16 X for no format, L for limited format * blank for ordinary, A for A conversion 699param 19 Parameter card is stored here * * Load next overlay * sfx l 700loadnx MCW clrbot-2,k999-2 Set clear end high digit 707clearl CS 0-0 711 SBR clearl&3 715 C clearl&3,k999 722 BU clearl 727 SW clrwm&4 731 MCW clearl&3,clrwm&6 738 CW clrwm&4 742clrl C clrwm&6,clrbot 749 BE cdovly Load the overlay 754clrwm LCA blank,0 Clear with blank and word mark 761 SBR clrwm&6 765 B clrl 769cdovly R 40 Card overlay unless nop 773rdagin MCW einit,ecount Initialize error count 780tpread RTW 1,beginn Load overlay from tape 788 BER tperr Error? 793 B beginn No, run the overlay 797tperr BSP 1 802 S one,ecount 809 BWZ tpread,ecount,B Still positive? 817 H 3333,3333 Too many tape errors 824 B rdagin Read again 830k999 DSA 999 833clrbot DCW #3 Address to clear down to 834blank DCW #1 835einit DCW &9 Initial error count 836one dcw &1 837ecount DCW #1 sfx End of load next overlay routine * * Start here * 838beginn BCE card,1, Being loaded from cards? 846 MCW nop,cdovly Turn off card overlay 853card CS 80 857 SW 1,gm 864 SW 81,84 871 CS 332 875 CS * * Read and check parameter card * 876 R Read parameter card 877 LCA 19,param Save it 884 C param-14,kparam Is it a parameter card? 891 BU noparm No, announce error 896 SW 73 Set word marks for 900 SW 6,7 Fortran margins 907 SW topcor-2 911 MCW 80,pword * * Determine this machine's core size, compare it to * size on parameter card * 918 CS 0-0 922 SBR corsiz 926 MCW topcor,toconv 933 B adconv Covert topcor to five digits 937 MCW convtd,top5 944 MCW corsiz,toconv 951 B adconv Convert corsiz to five digits 955 MCW convtd,cor5 962 A kp1,top5 Top addr + 1 = size 969 A kp1,cor5 Cor addr + 1 = size 976 CS 332 980 CS 981 CC 1 983 CS 332 987 CS 988 MCW stmsg,228 Start Fortran Compilation msg 995 W 996 CC J 998 MCW top5,231 1005 MCW spsize Specified size 1009 W 1010 CS 235 1014 MCW cor5,228 1021 MCW actsiz Actual size 1025 BCE bignuf,c1410,T Compiling for 1410 compatibility? 1033 W 1034 C cor5,top5 1041 BH psgtm Print Spec size gt Mach size 1046 C top5,k3900 Compare top to 3900 1053 BL bignuf 1058 CC J 1060 CS 332 1064 CS 1065 MCW sizerr,218 Machine size error 1072 W 1073 B useact 1077psgtm MCW sgtm,267 Spec. size gt Mach. size msg 1084 MCW sgtm2 Rest of the message 1088 W 1089useact MCW corsiz,topcor Use actual size 1096bignuf MCW topcor,cleard&3 * * Clear from top of this machine's memory down to DOWNTO * 1103cleard CS 0-0 1107 SBR cleard&3 1111 C cleard&3,downto 1118 BU cleard * 1123 R 1124 MZ *-6,azone Set A zone after card storage area 1131 MZ *-6,intrst&7 Set A zone in BCE D-modifier 1138 MZ *-6,blnkok&7 ,, 1145 MZ *-6,intchr-1 Add A zone to interesting chars 1152 MCW prefix,card1-1 Set default prefix 1159 MCW topcor,*&4 1166 CW 0-0 1170 SBR mvchar&6 * * Process next card * 1174rdloop BW movecd,flag 1182 BCE done,1,: * * No system after end card * 1190nosys CC 1 1192 CS 332 1196 CS 1197 MCW msg1,270 1204 W 1205 CC 1 1207halt1 H halt1 * * Move card to save area * 1211movecd MCW 72,card72 Move card to save area 1218 MCW 1219 MCW 1220 BCE done,card1,: 1228c12t BIN prthdg, Unconditional at first, becomes BCV 1233afthdg CS 300 1237 CS 1238 MCW 72,283 Move card to print area 1245 MCW 6,215 1252 BCE lstcmt,card1,C Print now if comment 1260crd1sw B notcnt Becomes NOP after first card 1264 BCE notcnt,card6,0 1272 BCE notcnt,card6, * * Continuation card * 1280 A kp1,cntcnt Bump continuation count 1287 BCE cntok,cntcnt-1,0 Nine or fewer? 1295 MCW cntmsg,300 Put error msg in print area 1302cntok W List the card 1303 MCW card7a,svchar&3 Set save char addr to col 7 * * Process the card (NOTCNT comes back here) * 1310svchar MCW 0-0,char Save a character 1317 SW svchar&1 1321 A k1,svchar&3 Bump addr of char to save 1328 CW svchar&1 1332crd2sw NOP blnkok Branch if copying everything 1336 BCE svchar,char, Skip blanks 1344 MCW char,*&8 1351 BCE intrst,intchr,0 chain5 1364mvchar MCW char,0 1371 SBR mvchar&6 1375bumpns A kp1,nchar Bump character counter 1382 C mvchar&6,botcor Core full of source code? 1389 BE bigsrc 1394crd3sw BCE holler,char,H 1402crd4sw NOP branch,crd3sw * 1409test7 C svchar&3,card7a At column 7? 1416crd5sw BU svchar 1421 SW mvchar&4 1425crd6sw MCW mvchar&6,X2 1432 CW mvchar&4 1436 MCW nop2,crd6sw 1443 MCW nop2,crd5sw 1450 A k10,colcnt 1457 BCE col3,colcnt-1,5 Three columns done? 1465 SW flag 1469 BWZ svchar,colcnt-1,2 More than seven columns done? 1477 MCW brnch2,crd5sw 1484 MCW 0&X2,work7 1491 C kfmt,work7 FORMAT% ? 1498 BU svchar * * Process a format statement * 1503 MCW branch,crd3sw 1510 MCW 0&X3,work6 1517 MCW kf,work6-3 1524 MCW work6,0&X3 1531 B svchar * 1535slash MCW kat,char Convert slash to at-sign 1542 B mvchar * * Not a continuation card * 1546notcnt MCW nop,crd1sw 1553 A kp1,nstmt 1560 MCW nop,crd3sw 1567 MCW nop,crd4sw 1574 MCW 5,211 Move label to print area 1581 S cntcnt Clear continuation count 1585 MCW nop,crd2sw 1592 MCS nstmt,203 Move statement count to print area 1599 W 1600 SW mvchar&4 1604 MCW mvchar&6,mvchr2&6 1611 CW mvchar&4 1615 MCW move,crd6sw 1622mvchr2 LCA gm,0 1629 SBR X3 Save address of first char stored 1633 SBR mvchar&6 1637 MCW colon,card6 Colon after label, if any 1644 MCW brnch2,crd5sw 1651 MCW k20,colcnt Initialize column counter 1658 MCW save2a,svchar&3 1665 B svchar * 1669col3 C 0&X2,kend END card? 1676 BU svchar 1681 CW flag 1685 B svchar * 1689at MCW kminus,char Convert at sign to minus 1696 B mvchar * * Saw an interesting character * 1700intrst BCE testlc,char, Test for A zone 1708 BCE testlc,char,| Record mark 1716 BCE slash,char,/ 1724 BCE at,char,@ 1732 MCW kstar,300 1739 MCW procd 1743 MCW char 1747 B mvchar * * Character is H, probably hollerith * 1751holler MCW mvchar&6,X1 1758 MCW nop,crd3sw 1765 MCW nop,crd4sw 1772 MCW branch,crd2sw 1779 MCW 4&X1,hcount Remember, source is stored backward 1786 BCE at2,hcount-1,@ 1794 BWZ nzhm1,hcount-1,2 1802at2 MCW hcount-2,hcount One digit of hollerith coiunt 1809 MCW kz2 1813 B test7 * * No zone at hcount-1 * 1817nzhm1 BCE at3,hcount,@ 1825 BWZ nzh,hcount,2 1833at3 MCW hcount-2,hcount 1840 MCW kz1,hcount-2 1847 B test7 * * No zone at hcount. Reverse the digits * 1851nzh MCW hcount,workh1 1858 MCW hcount-2,hcount 1865 MCW workh1,hcount-2 1872 B test7 * * Convert address to five digits * sfx c 1876adconv SBR exit&3 1880 S cnvw2a 1884 S cnvw2b 1888 MZ toconv,cnvw2a-1 1895 MZ toconv-2,cnvw2b-1 1902loop1 BWZ loop2,cnvw2b-1,2 1910 A cnvka0,cnvw2b 1917 B loop1 1921loop2 BWZ lp2x,cnvw2a-1,2 1929 A cnvkq4,cnvw2a 1936 B loop2 1940lp2x A cnvw2b-1,cnvw2a 1947 MCW toconv,convtd 1954 MCW cnvw2a 1958 ZA convtd 1962 MZ *-4,convtd Clear zone in output 1969exit B 0-0 sfx * 1973blnkok BCE testlc,char, Test for A zone 1981 S kp1,hcount 1988 C hcount,pze Hollerith count down to zero? 1995 BU mvchar Nope, just move the character 2000 MCW move2,crd4sw 2007 MCW nop2,crd2sw 2014 MCW svchar&3,X1 2021 C 0&X1,comma 2028 BE mvchar 2033 MCW mvchar&6,*&7 2040 MCW 0,0 2047 MCW comma 2051 SBR mvchar&6 2055 A kp1,nchar 2062 B bumpns 2066 B mvchar * * Finished reading the source deck * 2070done MCW mvchar&6,X1 2077 LCA gm,0&X1 2084 SBR X1 2088 CC 1 2090 CS 332 2094 CS 2095 MCS nchar,205 2102 MCW msgchr,222 2109 W 2110 CC J 2112 MCW nstmt,nstmts 2119 LCA stop,0&X1 2126 SBR X1 2130 SW 2&X1 2134 A kp1,nstmts 2141 BCE notbig,3000, 2149 B bigsrc 2153notbig SBR clearl&3,2999 2160 SBR clrbot,beginn Change address to clear down to 2167 BSS snapsh,C 2172 LCA scanr1,phasid SCANNER 2179 CS 80 Get 2183 SW 1,40 ready 2190 SW 47,54 for 2197 SW 61,68 card 2204 SW 72 overlay 2208 BCE loadnx,cdovly,N Running from tape? 2216 R 2217 C 7,scanr2 2224 BE loadnx 2229 B nosys * * Source program too big * 2233bigsrc CS 332 2237 CS 2238 CC 1 2240 MCW msg2,270 2247 W 2248 CC 1 2250 BCE halt2,cdovly,1 Running from cards? 2258 RWD 1 No, rewind the tape 2263halt2 H halt2 * * Print listing page heading * 2267prthdg CC 1 2269 MCW kat,c12t&4 Change to BCV 2276 CS 299 2280 A k1,pagnum 2287 MCS pagnum,299 2294 MCW kpage,295 2301 MCW 80 2305 W 2306 CS 299 2310 MCW paghdg,234 2317 W 2318 CC J 2320 B afthdg * * No parameter card * 2324noparm CC 1 2326 CS 332 2330 CS 2331 MCW msg3,270 2338 W 2339 CC 1 2341 BCE halt3,cdovly,1 Running from cards? 2349 RWD 1 No, rewind the tape 2354halt3 H halt3 * * List comment card * 2358lstcmt MCW final,203 2365 MCW 5,211 2372 W 2373testlc BLC done 2378 R 2379 B rdloop * 2388intchr DCW @$@/| @ Interesting characters 2423paghdg DCW @ SEQ STMNT FORTRAN STATEMENT@ * * Card save area * da 1x78 save2 2 card1 6 card6 11 card7 12 card72 77 azone 78 * * Constants and work areas * 2503colcnt DCW #2 2506card7a DSA card7 Address of column 7 in save area 2509save2a DSA save2 2510k1 dcw 1 2511brnch2 b 2513k20 dc 20 2520work7 DCW #7 2527kfmt DCW @%TAMROF@ 'FORMAT%' spelled backward 2528nop2 DC @N@ 2529gm DC @}@ 2533prefix DCW @000R@ Default statement prefix -- arithmetic 2534colon DCW @:@ 2536k10 dcw 10 2537move dc @m@ 2548procd DCW @ PROCESSED @ 2549nop NOP 2554kparam dcw @PARAM@ 2557corsiz DCW #3 Actual machine size (top addr) 2560toconv DCW #3 Address to be converted to five digits 2565convtd DCW #5 Address converted to five digits 2566kp1 dcw &1 2594stmsg DCW @START OF FORTRAN COMPILATION@ 2620spsize DCW @MACHINE SIZE SPECIFIED IS @ 2643actsiz DCW @ACTUAL MACHINE SIZE IS @ 2648cor5 DCW #5 CORSIZ as five digits 2653top5 DCW #5 TOPCOR as five digits 2658k3900 DCW 03900 2676sizerr DCW @MACHINE SIZE ERROR@ 2722sgtm DCW @SPECIFIED IS GREATER THAN ACTUAL MACHINE SIZE.@ 2743sgtm2 DCW @ERROR - MACHINE SIZE @ 2746downto DSA 2999 dcw @R99@ 2787msg1 DCW @MESSAGE 1-SYSTEM DOES NOT FOLLOW END CARD@ 2802cntmsg DCW @CONTINUE CD ERR@ 2807nchar DCW #5 Number of characters 2810botcor DSA 3000 Bottom of space to store program 2811branch DCW @B@ 2817work6 DCW #6 2818KF DCW @F@ 2819kat dcw @@@ 2822nstmt DCW #3 Number of statements 2824cntcnt DCW #2 Count of continuation cards 2827kend dcw @DNE@ END spelled backward 2828flag DCW #1 Word mark is a flag 2829kminus DCW @-@ 2830kstar DCW @*@ 2831char DCW #1 Character from input 2834hcount DCW #3 Hollerith count 2836kz2 DCW 00 Two zeros 2837kz1 DCW 0 2838workh1 DCW #1 Work space for hollerith count 2840cnvw2a DCW #2 Work space for address conversion 2842cnvw2b DCW #2 Work space for address conversion 2844cnvka0 dcw @A0@ Constant for address conversion 2846cnvkq4 dcw @?4@ Constant for address conversion 2849pze dcw &000 plus zero 2850move2 MCW 2851comma dcw @,@ 2867msgchr DCW @INPUT CHARACTERS@ 2878stop DCW @ }POTS:R000@ STOP spelled backward, etc. 2885scanr1 dcw @SCANNER@ 2892scanr2 dcw @SCANNER@ 2928msg2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2931pagnum DCW #3 2939kpage DCW @ PAGE @ 2968msg3 DCW @MESSAGE 3 - NO PARAMETER CARD@ 2971final DCW #3 org 2999 2999gmwm dcw @}@ END beginn
- Phase 03 - Scanner. Determines the type of each statement and appends a code on the right of each statement. For example, D for DO, S for STOP, I for DIMENSION statements, etc.
JOB Fortran compiler -- Scanner -- phase 03 v3m4 * * SCANNER phase: Insert statement numbers (not labels) * Classify statements (format statements already classified) * CTL 6611 * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot routine * pword equ 685 The word PARAM topcor equ 688 Top core address from PARAM card imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits condns equ 693 P for condensed deck snapsw equ 694 S for snapshot c1410 equ 695 T if run on 1410 in 1401 compatibility mode fmtsw equ 696 X for no format, L for limited format * blank for ordinary, A for A conversion param equ 699 Parameter card is stored here * loadnx equ 700 Load next overlay clearl equ 707 Clear instruction in LOADNX loadex equ 793 Branch that exits LOADNX * * Signals used when loading from cards * org 101 dcw @:@ colon 5-8 org 101 dcw @SCANNER@ * ORG 838 * * Start here. * Check modulus and mantissa * 838beginn MCW topcor,corchk&6 845 SW imod-1,mantis-1 852 BCE idef,imod, Integer modulus blank on parameter card? 860 B ispec No, use specified modulus 864idef MCW intdef,imod Yes, use default modulus 871ispec BCE fdef,mantis, Floating point mantissa blank? 879 B fspec No, use specified mantissa 883fdef MCW fltdef,mantis Yes, use default mantissa 890fspec C imod,intmin Compare modulus to minimum 897 BH badmod 902 C imod,digmax Check integer modulus 909 BL badmod 914manchk C mantis,digmax Check floating point mantissa 921 BL badman 926 C mantis,fltmin 933 BH badman * * Report modulus and mantissa * 938badret CS 332 942 CS 943 MCW modmsg,210 950 MCS imod,213 957 W 958 CS 299 962 MCW manmsg,211 969 MCS mantis,214 976 W 977 CC J * 979corchk BCE corchk,0-0,0 TOPCOR stored into B 987 B 988 SBR mvback&6 stores TOPCOR-2 992 SBR mvstmt&3 996mvstmt LCA 0-0,stmtsv Copy statement to work area 1003 SAR mvstmt&3 Ready for next statement 1007 MCW stmtno,stmtsv Insert statement number into stmt 1014 A k1,stmtno and bump it 1021 BCE class2,stmtyp,F Format stmt is already classified * * Skip over the label if any * 1029 SBR chklbl&6,stmtst 1036 SBR stmtpt,stmtst-1 Initialize statement pointer 1043chklbl BCE ststmt,stmtst,: Found the start of the statement? 1051 SBR chklbl&6 1055 SBR chklb2&6 1059chklb2 BCE chklb2,0, Decrease B register 1067 SBR stmtpt Set statement pointer 1071 B chklbl * * Start processing the statement proper. * Check for assignment statement. * 1075ststmt MCW stmtpt,endchk&6 1082 MCW stmtpt,eqtest&6 1089endchk BCE ckword,0,} End of statement? 1097 B 1098 SBR endchk&6 1102eqtest BCE eq,0-0,# 1110 B 1111 SBR eqtest&6 1115 B endchk * * Assignment statement. * 1119eq SW endchk&4 1123 MCW endchk&6,svchar&3 1130 CW endchk&4 1134svchar MCW 0-0,char 1141 SAR svchar&3 1145 BCE lparen,char,% 1153 BCE lparen,char,} 1161 BCE ckword,char,, 1169 B svchar * * Check keyword * 1173ckword MCW stmtpt,*&4 1180 MCW 0-0,word 1187 SW word 1191 SW 1192 MCW word,*&8 1199 BCE bfcs1,kbfcs, Is 1st letter B, F, C or S? 1207 chain3 1210 MCW word-1,*&8 1217tqinua BCE qinua2,kqinua, Is 2nd letter Q, I, N, U or A? 1225 chain4 1229 SW stmtyp 1233 B other * * First letter is B(ackspace), F(ormat), C(ontinue), * S(top) or S(enselight) * 1237bfcs1 C word-2,knse Is word [BFCS].NSE? 1244 BE sense 1249 MCW word,stmtyp Use first letter (BFCS) for stmt type 1256 B classd 1260sense MCW tsense,stmtyp 1267 B classd * * Second letter is (e)Q(uivalence), (d)I(mension), * (e)N(d) or (e)N(dfile), (p)U(nch) or (p)A(use) * 1271qinua2 MCW word-1,stmtyp 1278 BCE n2,tqinua&7,N 1286 B classd * * Second letter is N. Check for ENDFILE. * 1290N2 C word-2,kdfile Is word .NDFILE? 1297 BE classd 1302 MCW tslash,stmtyp Set type to / * * Statement is classified * 1309classd CW word 1313 CW 1314class2 CW stmtyp 1318mvback LCA stmtsv,0 Move the statement back 1325 SBR mvback&6 1329 SBR ckblnk&6 1333 SBR 83 Address below last stmt, for next phase 1337ckblnk BCE done,0-0, 1345 B mvstmt * * Left parenthesis or group mark * 1349lparen MCW eqtest&6,x1 1356 BCE rparen,1&X1,) 1364 B 1365 B class2 1369rparen BCE lpar2,2&X1,% 1377 SBR x1 1381 B rparen 1385lpar2 BCE f,3&X1,F 1393 B class2 1397f BCE class2,6&X1,: 1405 chain2 1407 MCW tarith,stmtyp 1414 SW 195 1418 B class2 * * First letter is not BFCS and second letter is not QINUA * 1422other CW word 1426 CW 1427 C word,kfi IF ( SENSE...? 1434 BU notif 1439 BCE slite,word-8,L 1447 MCW tssw,stmtyp Sense switch 1454 B class2 * * Ninth character is L -- assume IF ( SENSE LIGHT ... ) * 1458slite MCW tslite,stmtyp 1465 B class2 * * Bad modulus message * 1469badmod CS 332 1473 CS 1474 MCW msg42,218 1481 W 1482 CC J 1484 MCW intdef,imod 1491 B manchk * * Bad mantissa message * 1495badman CS 332 1499 CS 1500 MCW msg43,219 1507 W 1508 CC J 1510 MCW fltdef,mantis 1517 B badret * * Not an IF statement, check for others * 1521notif BCE do,word,D 1529 BCE lpar3,word-2,% 1537 BCE lpar5,word-4,% 1545 BCE goto,word,G 1553 BCE print,word,P 1561 BWZ read,word-4,2 1569 BCE rwd,word-5,D 1577 MCW k1,stmtyp 1584 MN word-5,stmtyp Use numeric of sixth char 1591 B notif2 v3m4 * * First letter is D(o) * 1595do MCW tdo,stmtyp 1602 B class2 * * Third character is left parenthesis * 1606lpar3 MCW tif,stmtyp 1613 B class2 * * Fifth character is left parenthesis -- assume computed GOTO * 1617lpar5 MCW tcgo,stmtyp 1624 B class2 * * First character is G * 1628goto MCW tgo,stmtyp 1635 B class2 * * First character is P * 1639print MCW tprint,stmtyp 1646 B class2 * * Fifth character is numeric -- assume it's READ * 1650read MCW tread,stmtyp 1657 B class2 * * Sixth character is D -- assume REWIND * 1661rwd MCW trew,stmtyp 1668 B class2 * * All done * 1672done BSS snapsh,C 1677 SBR loadex&3,1010 1684 SBR clearl&3,2599 1691 LCA sorter,phasid 1698 B loadnx 1702 DCW #1 * stmtst equ 2393 Statement start stmtyp equ 2394 Statement type -- F for format stmtsv equ 2397 * * Constants and work areas * ORG 2398 2400stmtno dcw 001 2401k1 dcw 1 2404stmtpt DCW #3 Statement pointer 2405char DCW #1 Character being examined 2415word DCW #10 2420KQINUA DC @QINUA@ Test second character of statement 2424KBFCS DC @BFCS@ Test first character of statement 2430kfi DCW @ESNES%FI@ IF(SENSE spelled backward 2433trew DC @Z@ Statement code for REWIND 2434tread dc @L@ Statement code for READ 2435tprint dc @P@ Statement code for PRINT 2436tgo dc @G@ Statement code for GOTO 2437tcgo dc @T@ Statement code for computed GOTO 2438tif dc @E@ Statement code for IF 2439tdo dc @D@ Statement code for DO 2440tssw DC @W@ Statement code for IF ( SENSE SWITCH ... 2442intdef DCW 05 Default integer modulus 2444fltdef DCW 08 Default floating point mantissa digits 2446intmin DCW 01 Minimum integer modulus 2448digmax dcw 20 Maximum int mod and max FP mantissa 2450fltmin DCW 02 Minimum floating point mantissa digits 2460modmsg DCW @MODULUS IS@ 2471manmsg DCW @MANTISSA IS@ 2474knse dcw @ESN@ NSE (part of SENSELIGHT) spelt backward 2475tsense DCW @J@ Statement code for SENSE LIGHT 2480kdfile dcw @ELIFD@ DFILE (part of ENDFILE) spelt backward 2481tslash dcw @/@ Statement code for END 2482tarith DCW @R@ Statement code for arithmetic 2483tslite DCW @K@ Statement code for IF ( SENSE LIGHT... 2501msg42 DCW @ERROR 42 - MODULUS@ 2520msg43 DCW @ERROR 43 - MANTISSA@ 2530sorter DCW @SORTER ONE@ 2535k9 DCW 9 v3m4 2535testw6 dc 6531 v3m4 2536notif2 MN word-5,*&8 v3m4 2543 BCE class2,testw6,0 read tape? v3m4 2551 B write tape? v3m4 2552 B read input tape? v3m4 2553 B write output tape? v3m4 2554 MN k9,stmtyp use code 9 v3m4 2561 BIN class2, v3m4 org 2600 2600gmwm dcw @}@ ex beginn END
- Phase 04 - Sort I. Determines if there is enough free storage to expand each statement by three characters.
JOB Fortran compiler -- Sort one phase -- phase 04 CTL 6611 * * SORT ONE phase: Determine whether there is sufficient room * to expand every statement by three characters. * 81-83 is one below the group mark below the last (bottom * address) in core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Table of addresses of the first statement of each type, * indexed by 30*(zone of statement type) + 3*(numeric part of * statement code). Filled in next phase, q.v. * ORG 838 840 DCW #3 Blank 843 DCW #3 1 READ TAPE 846 DCW #3 2 849 DCW #3 3 WRITE TAPE 852 DCW #3 4 855 DCW #3 5 READ INPUT TAPE 858 DCW #3 6 WRITE OUTPUT TAPE 861 DCW #3 7 864 DCW #3 8 867 DCW #3 9 870 DCW #3 0 873 DCW #3 / END 876 DCW #3 S STOP 879 DCW #3 T Computed GOTO 882 DCW #3 U PUNCH 885 DCW #3 V 888 DCW #3 W IF ( SENSE SWITCH ... ) 891 DCW #3 X 894 DCW #3 Y 897 DCW #3 Z REWIND 900 DCW #3 ! 903 DCW #3 J SENSE LIGHT 906 DCW #3 K IF ( SENSE LIGHT ... ) 909 DCW #3 L READ 912 DCW #3 M 915 DCW #3 N ENDFILE 918 DCW #3 O 921 DCW #3 P PRINT 924 DCW #3 Q 927 DCW #3 R Arithmetic 930 DCW #3 ? 933 DCW #3 A PAUSE 936 DCW #3 B BACKSPACE 939 DCW #3 C CONTINUE 942 DCW #3 D DO 945 DCW #3 E IF 948 DCW #3 F FORMAT 951 DCW #3 G GOTO 954 DCW #3 H 957 DCW #3 I DIMENSION ORG 1006 1009zones dcw @2SKB@ * * Start here instead of 838 * 1010beginn CS 2599 1014 chain8 1022 MCW 83,x3 Address of end of last statement 1029 MCM 2&X3 1033 MCW 1034 SBR x3 Address of beginning of last statement * * Multiply statement number of last statement by 3 * 1038 MCW 0&X3,seq 1045 ZA seq,seq5 1052 A seq5 1056 A seq,seq5 1063 S kp2,seq5 3 * # stmts - 2 1070 MCW seq5,work5 1077 MCW k16k,seq5 1084 S work5,seq5 16000 - (3 * # stmts - 2) * * Convert to address * 1091 BAV loop clear overflow 1096loop A kp96,seq5-3 1103 BAV loop 1108 MN seq5-3,*&4 1115 MZ zones-0,seq5-2 * 1122 MCW 83,x1 1129 MCW x1,nop&3 1136 MCW seq5,x2 1143 MZ km1,nop&2 set tag for x2 1150nop NOP 0 x1 + x2 1154 SAR x2 1158 S w2a 1162 S w2b 1166 MZ x2,w2a-1 1173 MZ x2-2,w2b-1 1180loop2 BWZ loop2x,w2b-1,2 1188 A k10v,w2b 1195 B loop2 1199loop2x BWZ loop3x,w2a-1,2 1207 A k04v,w2a 1214 B loop2x 1218loop3x A w2b-1,w2a 1225 MCW x2,seq5 1232 MCW w2a 1236 ZA seq5 1240 MZ *-4,seq5 Clear zone in tens digit 1247 C seq5,k2900 1254 BL ok * * Insufficient room to expand every statement by three characters * 1259 CS 332 1263 CS 1264 CC 1 1266 MCW msg2,270 1273 W 1274 CC 1 1276 BCE halt,cdovly,1 1284 RWD 1 1289halt H halt * * Source code will fit after expanding every statement by * three characters * 1293ok MCW x2,83 Replace address of bottom of code 1300 MCM 0&X1 1304 SAR x1 Address below last statement 1308 BSS snapsh,C 1313 SBR tpread&6,1022 Change load address for next phase 1320 SBR clrbot 1324 SBR loadxx&3,1022 Change entry address for next phase 1331 SBR clearl&3,sort2&1 1338 LCA sort2,phasid 1345 B loadnx Load next overlay * * Constants and work areas * 1349 DCW 0 1352seq DCW #3 Sequence number of last statement 1357seq5 DCW #5 Stmt number times 3 1358kp2 DCW &2 1363work5 DCW #5 1368k16k dcw 16000 1370kp96 dcw &96 1371km1 DCW -1 1373w2a DCW #2 1375w2b DCW #2 1377k10v dcw @A0@ Ten, overflowed 1379k04v dcw @?4@ 04, overflowed 1384k2900 DCW 02900 1420msg2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1426sort2 DCW @SORT 2@ 1427gmwm dcw @}@ ex beginn END
- Phase 05 - Sort II. Statements of the same type are chained together. Each statement expands by three characters-the machine address of the next statement of the same type.
JOB Fortran compiler -- Sort two phase -- phase 05 CTL 6611 * * SORT TWO phase: Add three characters to each statement and * chain statements of the same type together, leaving the * address of the first statement of each type in TYPTAB, * which starts at 838. * x1 has the address of the group mark word mark after (lower * address) the last (lowest address) statement. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader typtab equ 840 Type table (word marks set in Phase 3) * Indexed by 30*(zone of statement code) + * 3*(numeric part of statement code). Each * entry is the address of the earliest (highest * address) statement of a type. Each statement * has a pointer to the next one (lower in core) * of the same type as its first three (highest * address) characters. * * X1 is the address at the bottom of the last statement * X2 is X1 - 3*(number of statements) * ORG 1022 1022beginn MCW x1,x3 1029 SW gm 1033 MCM 0&X1 Address at bottom of next statement 1037 MN Address of GM below next statement 1038 MN Address at top of this statement 1039 SAR x1 1043 LCA 0&X1,stmt Save this statement 1050 MCM 0&X1 Address at bottom of next statement 1054 SAR x1 1058 MCM 0&X3,0&X2 Move down by 3*(statement number) 1065 SBR x2 1069 LCA stmt&3,1&X2 Move again, this time with its gm 1076 S x3&1 clear x3 1080 MCW 0&X2,work6 Copy statement number and stmt code 1087 MN work6-5,x3 Numeric part of statement code 1094 MCW x3,work6-2 1101 A x3 1105 A work6-2,x3 X3 = 3*(numeric part of stmt code) 1112 BWZ over,work6-5,2 Stmt type has no zone 1120 A kp30,x3 1127 BWZ over,work6-5,S Stmt type has A zone 1135 A kp30,x3 1142 BM over,work6-5 Stmt type has B zone 1150 A kp30,x3 * * Here X3 is 30*(zone of stmt code) + 3*(numeric part of stmt code) * Work is initially an array of 3-character empty fields, but * we store the address of each record in typtab&x3, resulting in * statements of the same type code being chained together * 1157over MCW typtab&X3,1&X2 Link statement to next statement 1164 LCA gm,2&X2 Mark bottom of next statement 1171 SBR typtab&X3 Save statement address in typtab 1175 MCM 2&X2 Move X2 above new statement bottom 1179 SAR x2 1183 C x2,topcor Done? 1190 BU beginn No, do another one * * Done -- load next overlay * 1195 BSS snapsh,C 1200 SBR clearl&3,2899 1207 LCA sort3,phasid 1214 B loadnx * * Data * 1218 DCW 0 1219gm dc @}@ stmt equ 1919 Save area for statement ORG 2000 2005work6 DCW #6 2007kp30 dcw &30 2013sort3 DCW @SORT 3@ 2014gmwm dcw @}@ ex beginn END
- Phase 06 - Sort III. The source program is sorted internally by statement type. The order of sorting is determined by the order in which statements of a given type undergo specific processing by subsequent phases. For example, since DIMENSION statements are processed (Phase 09) before DO statements (Phase 46), the DIMENSION statements are grouped together lower in core than the DO statements.
JOB Fortran compiler -- Sort three phase -- phase 06 CTL 6611 * * SORT THREE phase: Sort statements by type, shift to low * memory. * 81-83 is the address of the last character (lowest in core, * one above gmwm) of the last (lowest in core) statement. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader typtab equ 840 Type table (word marks set in Phase 3) * Indexed by 30*(zone of statement code) + * 3*(numeric part of statement code). Each * entry is the address of the earliest (highest * address) statement of a type. Each statement * has a pointer to the next one (lower in core) * of the same type as its first three (highest * address) characters. * ORG 1022 1022beginn MCW 83,x3 Address at end of last statement 1029 SW gm 1033 SBR x1,2899 Bottom of free storage 1040 SW 2900 1044 MN 0&X3 Compute address below last statement, 1048 LCA gm put a gmwm there 1052 SBR save&6 and store address below gmwm 1056 SBR w3,tabixs Get last typtab index 1063loop MCW w3,x3 Get next head 1070 MCW 0&X3,x3 of chain to x3 1077 SAR w3 1081 BCE done,x3,X End of the table? 1089 MCW typtab&X3,x3 Head of list of statements of type 1096 BCE loop,x3, No statements of the type * * Move all statements of the type down to low core * 1104save MCW 0&X3,0-0 Move statement to save area 1111 SAR x2 1115 BCE *&5,1&X2,} Did we move the GM? 1123 B noroom No, maybe we're out of space 1127 SBR x2,2&X2 Get back above gmwm, to bottom of stmt 1134more MCM 0&X2 Compute address above top of statement 1138 SBR sx2&6 and save it 1142 MCM 0&X2,1&X1 Move statement to bottom of free area, 1149 SBR x1 bump pointer to bottom, 1153 MN 0&X1 then back down to GM 1157 SBR x1 and save it 1161sx2 SBR x2,0-0 Move up to record mark or GM 1168 BCE more,0&X1,| More to go if stmt contains RM 1176 SBR x1,1&X1 Bump pointer above GM 1183 CW bigflg 1187 MN 0&X1 Now subtract 1191 MN four from 1192 MN x1 to recover 1193 MN space used for 1194 SAR x1 same-type link 1198 LCA gm,0&X1 Mark top of statement 1205 SBR 83 Store address of top of statement 1209 SBR x1 and in x1 1213more2 MCM 1&X1 Compute address above top of statement, 1217 MN get back down to RM or GMWM 1218 SAR x1 and save it 1222 BCE more2,0&X1,| More to go if stmt contains RM 1230 MN 0&X3 Subtract 1234 MN six 1235 MN from 1236 MN x3 1237 MN ,, 1238 MN ,, 1239 SAR x3 ,, 1243 MN 0&X1 Compute -1&x1 into B-star 1247 LCA 3&X3 Copy sequence number 1251 MCW pound,0&X3 1258more3 MCM 2&X3 Point x3 1262 MN back at 1263 MN top of 1264 SAR x3 statement 1268 BCE more3,1&X3,| More to go if stmt contains RM 1276 BCE loop,0&X3, Last statement on chain? 1284 MCW 0&X3,x3 No, get next statement in chain 1291 B save and save it * * No room to move statement below bottom statement * 1295noroom BW toobig,bigflg 1303 SW bigflg 1307 MCW topcor,x2 1314 MN 0&X2 1318 SAR x2 X2 is topcor-1 now 1322 MCW x2,x3 1329moveup LCA 0&X2,0&X3 Move statement up 1336 SAR x2 1340 MCW 0&X3,prefix 1347 BCE moved,prefix-6,# Statement already moved? 1355 LCA 0&X3,0&X3 No, decrement X3 so as not to 1362 SAR x3 clobber recently moved statement 1366moved C save&6,x2 Done? 1373 BU moveup No, move another one 1378 MCW x3,save&6 Below last moved statement 1385 MCW x3,x2 1392 MZ x3,x3999 compute x3 & x00 - 1 1399 MZ 1400 MCW 1401 MZ x1,x1999 compute x1 & x00 - 1 1408 MZ 1409 MCW 1410 C x1999,x3999 1417 BE noclr 1422clr CS 0&X3 Clear from x3 down to x1 & x00 1426 SBR x3 1430 C x3,x1999 1437 BU clr 1442noclr ZA tablen,tabcnt Table length to table counter 1449 S x3&1 * * Fill type table with blanks * 1453clrtab MCW kb3,typtab&X3 Mark end of chain 1460 S kp1,tabcnt 1467 BM clrfin,tabcnt Done clearing table? 1475 A kp3,x3 1482 B clrtab * * Relink moved statements into type table * 1486clrfin MCM 1&X2 Get X1 to top of statement 1490 MN 1491 SAR x2 1495 BCE clrfin,0&X2,| More to do if RM instead of GMWM 1503 SBR x2,1&X2 X2 is now bottom of next statement 1510 S x3&1 1514 C 0&X2 1518 SAR *&4 1522 MCW 0-0,prefix Save prefix 1529 MN prefix-6,x3 3 times 1536 MCW x3,tabcnt numeric part of 1543 A x3 statement code 1547 A tabcnt,x3 to x3 1554 BWZ zonfin,prefix-6,2 add 30 times 1562 A kp30,x3 zone part 1569 BWZ zonfin,prefix-6,S of statement 1577 A kp30,x3 code 1584 BM zonfin,prefix-6 to x3 1592 A kp30,x3 1599zonfin MN 0&X2 minus 2 1603 MN 1604 MCW typtab&X3 Link to next statement same type 1608 C 0&X2 Down to next word mark 1612 SAR typtab&X3 link type table to statement type 1616 C x2,topcor Done? 1623 BU clrfin 1628 MCW w3,x3 Recover x3 1635 NOP 3&X3 1639 SAR w3 plus 3 1643 B loop Back to sorting * * Load next overlay * 1647done BSS snapsh,C 1652 SBR tpread&6,typtab-2 Next overlay read address 1659 SBR clrbot and bottom of clear area 1663 SBR loadxx&3,typtab-2 Next overlay entry address 1670 SBR clearl&3,tabcnt Top of clear 1677 LCA gmmsg,phasid Next phase ID 1684 B loadnx Load it * * Program is too big * 1688toobig CS 332 1692 CS 1693 CC 1 1695 MCW msg2,270 1702 W 1703 CC 1 1705 BCE halt,cdovly,1 1713 RWD 1 1718halt H halt * * Data * * First is table of table indexes in the reverse order * we want statements sorted into low core * 1724 dcw @XXX@ End-of-table sentinel 1727 DSA 117 I DIMENSION 1730 DSA 84 Q 1733 DSA 108 F FORMAT 1736 DSA 9 3 WRITE TAPE 1739 DSA 3 1 READ 1742 DSA 18 6 WRITE OUTPUT TAPE 1745 DSA 81 M 1748 DSA 42 U PUNCH 1751 DSA 15 5 READ INPUT TAPE 1754 DSA 69 L 1757 DSA 87 R ARITHMETIC 1760 DSA 105 E IF 1763 DSA 27 9 1766 DSA 96 B BACKSPACE 1769 DSA 57 Z REWIND 1772 DSA 75 N ENDFILE 1775 DSA 39 T COMPUTED GOTO 1778 DSA 111 G GOTO 1781 DSA 36 S STOP 1784 DSA 93 A PAUSE 1787 DSA 63 J SENSE LIGHT 1790 DSA 66 K IF SENSE LIGHT 1793 DSA 48 W IF SENSE SWITCH 1796 DSA 99 C CONTINUE 1799tabixs DSA 102 D DO Last of table indexes * 1802x1999 DSA 999 x1 & x00 - 1 1805x3999 DCW 999 x3 & x00 - 1 1806gm dc @}@ 1807bigflg dc 0 Word mark set if too big 1810w3 DCW #3 1811pound dcw @#@ 1820prefix DCW #9 Statement prefix 1822tablen dcw &39 Type table length 1825kb3 DCW #3 three blanks -- end of chain sentinel 1826kp1 dcw &1 1827kp3 dcw &3 1829kp30 dcw &30 1839gmmsg DCW @GROUP MARK@ 1875msg2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ ORG 2001 2003tabcnt DCW #3 org 2900 2900gmwm DCW @}@ ex beginn END
- Phase 07 - Insert Group Mark. This is a housekeeping phase.
JOB Fortran compiler -- Insert group-mark phase -- 07 CTL 6611 * * Replace the colon (5-8) that separates each statement from * its appendage (prefix) by a group mark with a word mark. * Replace integer modulus by 05 if it's zero. * Replace mantissa digits by 08 if it's zero. * 81-83 = start (top address) of first (top in memory) * statement. Remember, statements are sorted by type now. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838beginn MCW 83,x1 845 SW gm 849loop BCE colon,0&X1,: 857switch BCE done,0&X1, NOP if working on format 865 BCE seegm,0&X1,} 873 SBR x1 877 B loop 881colon LCA gm,0&X1 Replace colon by GMWM 888 SBR x1 get below colon 892 C 0&X1 and then 896 SAR x1 below bottom word mark 900 B loop Process next statement 904seegm MCW 0&X1,prefix 911 BCE format,prefix-4,F Format statement? 919 MCW branch,switch 926next MN 0&X1 Decrease X1 930 SBR x1 to next statement 934 B loop 938format MCW nop,switch 945 B next * * Clear from top core down to top of statements & X00 * 949done MCW topcor,x2 956 MZ 83,k999 Compute top 963 MZ of statements 964 MCW & x00 965clear CS 0&X2 969 SBR x2 973 C x2,k999 980 BU clear * * Clear from top of statements & X00 to top of statements * 985clear2 C 83,x2 992 BE done2 997 MCW blank,0&X2 1004 CW 0&X2 1008 SBR x2 1012 B clear2 1016done2 SW imod-1 1020 A blank,mantis 1027 C imod,kz2 Integer modulus equal zero? 1034 BU notzi No 1039 MCW k05,imod Yes, use 05 1046notzi C mantis,kz2 Mantissa digits equal zero? 1053 BU notzf No 1058 MCW k08,mantis Yes, use 08 * * Load next overlay * 1065notzf BSS snapsh,C 1070 SBR clearl&3,gmwm Load clear-down-to address 1077 LCA squoze,phasid Load next phase ID 1084 B loadnx Load it 1090k999 DCW 999 1091gm dc @}@ 1096prefix DCW #5 1097branch B 1098nop NOP 1099blank DCW #1 1101kz2 DCW 00 1103k05 DCW 05 1105k08 DCW 08 1111squoze DCW @SQUOZE@ 1112gmwm DCW @}@ ex beginn END
- Phase 08 - Squoze. The words that helped define the type of each statement are eliminated, shrinking the source program. For example, the word "DIMENSION" in DIMENSION statements is eliminated.
JOB Fortran compiler -- Squeeze phase -- phase 08 * * Remove statement keywords * Note unrecognizable statements and remove them * 81-83 = start (top address) of first (top in memory) * statement. Remember, statements are sorted by type now, * and pushed to the bottom of available core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader loadxx equ 793 Exit from overlay loader * CTL 6611 ORG 838 838beginn MCW 83,x2 845 MCW 83,x1 852next MCW 0&X1,seq 859 MCW 0&X1,prefix 866 BCE arith,prefix-3,R Arithmetic? 874 BCE endstm,prefix-3,/ End? 882switch BCE same,prefix-3,X Initially nonexistent stmt, * later current one * * Compute address of keyword if not the same statement * type as the previous one * 890 MZ prefix-3,switch&7 Move statement code 897 MN prefix-3,switch&7 to switch D-modifier 904 MN prefix-3,w1 911 ZA w1,w3 w3 = 918 A w3 3 * numeric part 922 A w1,w3 of stmt code 929 MZ nozone,w3 936 LCA tabadr,gettab&3 Table address 943 A w3,gettab&3 + 3 * numeric to gettab 950 MZ prefix-3,gettab&2 957 CW gettab&1 961 MCW x2,save Save x2 968 MCW and x1 969 MCM indexs,x1-2 x1,x2,x3 = 27, 54, 81 976gettab MCW 0,x3 Get address of keyword from table 983 MCW save,x2 Retrieve x2 990 MCW and x1 991same LCA 0&X1,0&X2 Move statement up 998 SAR x1 Address of next lower source 1002 C 0&X2 Get B-star below nextg word mark 1006 SAR x2 Address of next lower target 1010 C 0&X1,0&X3 Correct keyword? 1017 SAR x1 Get X1 below keyword 1021 BU wrong 1026mvmore LCA 0&X1,0&X2 Move part of stmt below keyword up 1033 SAR x1 Get below bottom of source statement 1037 C 0&X2 Get below bottom 1041 SAR x2 of target statement 1045ifdone BCE done,0&X1, Done? 1053 B next * * Load next overlay * 1057done CS 0&X2 1061 CS 1062 BSS snapsh,C 1067 SBR loadxx&3,839 Set entry address for next phase 1074 SBR clearl&3,gmwm Top of cleared area 1081 LCA dimen1,phasid Name of next phase 1088 B loadnx * * Keyword doesn't match statement code * 1092wrong CS 332 1096 CS 1097 SW 184 What does this do? 1101 MN seq,249 1108 MN 1109 MN 1110 MCW error1 1114 W 1115 BCV pagovl 1120 B noovl 1124pagovl CC 1 1126noovl MCM 2&X2 Get above statement's top 1130 MN and then 1131 MN down two 1132 SAR x2 1136 BCE noovl,1&X2,| More to move if RM 1144 C 0&X1 Get below keyword 1148 SAR x1 1152 B ifdone Go test if done * * Arithmetic statement * 1156arith LCA 0&X1,0&X2 Move prefix up 1163 SAR x1 and move 1167 LCA 0&X2,0&X2 index registers down 1174 SBR x2 to statement 1178 B mvmore * * End statement * 1182endstm C 0&X1 Get below 1186 C statement 1187 SAR x1 1191 B ifdone * * Table of addresses of statement keywords * 1197table DSA rdtape 1 READ TAPE 1200 DSA 0 1203 DSA wrtape 2 WRITE TAPE 1206 DSA 0 1209 DSA rdintp 5 READ INPUT TAPE 1212 DSA wrottp 6 WRITE OUTPUT TAPE 1215 DSA 0 1218 DSA 0 1221 DSA nozone 9 1224 DSA 0 1227 DSA stop S STOP 1230 DSA cgoto T Computed GOTO 1233 DSA punch U PUNCH 1236 DSA 0 1239 DSA ifsw W IF ( SENSE SWITCH ... 1242 DSA 0 1245 DSA 0 1248 DSA rewind Z REWIND 1251 DSA slite J SENSE LIGHT 1254 DSA ifsl K IF ( SENSE LIGHT ... ) 1257 DSA read L READ 1260 DSA 0 1263 DSA endfil N ENDFILE 1266 DSA 0 1269 DSA print P PRINT 1272 DSA equiv Q 1275 DSA 0 Arithmetic 1278 DSA pause A PAUSE 1281 DSA backsp B BACKSPACE 1284 DSA cont C CONTINUE 1287 DSA do D DO 1290 DSA if E IF 1293 DSA format F FORMAT 1296 DSA goto G GOTO 1299 DSA 0 1302 DSA dim I DIMENSION * * Statement keywords spelled backward * 1306goto DCW @OTOG@ GO TO 1311cgoto dcw @%OTOG@ GO TO ( 1313if dcw @FI@ IF 1327ifsw DCW @HCTIWSESNES%FI@ IF ( SENSE SWITCH 1332pause dcw @ESUAP@ PAUSE 1336stop dcw @POTS@ STOP 1338do DCW @OD@ DO 1346cont dcw @EUNITNOC@ CONTINUE 1353format dcw @%TAMROF@ FORMAT ( 1357read dcw @DAER@ READ 1370rdintp DCW @EPATTUPNIDAER@ READ INPUT TAPE 1375punch dcw @HCNUP@ PUNCH 1380print DCW @TNIRP@ PRINT 1395wrottp DCW @EPATTUPTUOETIRW@ WRITE OUTPUT TAPE 1403rdtape dcw @EPATDAER@ READ TAPE 1412wrtape DCW @EPATETIRW@ WRITE TAPE 1419endfil dcw @ELIFDNE@ END FILE 1425rewind DCW @DNIWER@ REWIND 1434backsp DCW @ECAPSKCAB@ BACKSPACE 1443dim DCW @NOISNEMID@ DIMENSION 1454equiv DCW @ECNELAVIUQE@ EQUIVALENCE 1467ifsl DCW @THGILESNES%FI@ IF ( SENSE LIGHT 1477slite DCW @THGILESNES@ SENSE LIGHT * * Other data * indexs equ *&1 1491 DCW @0270005400081|@ 1494seq DCW #3 Sequence number from statement 1498prefix DCW #4 1499w1 DCW #1 Used to compute 3 * numeric part of code 1502w3 DCW #3 1503nozone DCW #1 1506tabadr DSA table-3 1514save DCW #8 1520dimen1 DCW @DIMEN1@ 1566error1 DCW @ERROR 1 - UNDETERMINABLE STATEMENT, STATEMENT @ 1567gmwm DCW @}@ ex beginn END
- Phase 09 - Dimension I. The DIMENSION statements are scanned, and an array table is generated in free storage. Each table element consists of the name of an array, its dimensions, and sufficient space for additional data to be generated by Phases 11 and 12.
JOB Fortran compiler -- Dimension phase one -- 09 * * A table of arrays is generated at the end of storage. * Each table element consists of the array name, its * dimensions and sufficient space for control statements * and data generated by the equivalence phases and by * dimension phase two. * * Dimension table elements are separated by group mark word mark. * At the top of each element is the array name, spelt backward. * Below that are two cells used to double link the elements. * The upper one points to the next one higher in core (unless * it's blank); the lower one points to the next one lower in * core (unless it's blank). Below that are empty three character * and five character fields. Below that are the dimensions, with * the first dimension at the higher address. The digits of the * dimensions are not reversed. * * 81-83 = start (top address) of first (top in memory) * statement. Remember, statements are sorted by type now, * and pushed to the bottom of available core. * * On exit, 84-86 is the address of the topmost (first) * dimension table. * CTL 6611 * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 Read (1) instruction if running from cards tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 838 838diff DCW @0@ WM if FP width /= integer width 839beginn SW gm 843 MCW 83,x1 Top of top (first) statement 850 A kb1,mantis Get rid of zones in mantis 857 MCW mantis,manp2 864 A kp2,manp2 mantis + 2 = total FP width 871 C imod,manp2 FP width == integer width? 878 BU difwid 883 CW diff 887difwid LCA gm,1&X1 Set GMWM above statement 894 LCA topcor,x2 x2 = topcor 901 MN 0&X2 905 MN 906 MCW kb1a 910 SBR x2 x2 = topcor - 3 914prev MCW kb1,1-0 clobber previous less-than sign 921 MCW kless,2&X1 stmt top + 2 = less-than sign 928 NOP 2&X1 932 SAR prev&6 Remember where we put it 936 LCA 0&X1,prefix 943 SAR x1 Point X1 947 SBR x3 and X3 after label 951 BCE done,prefix, No more statements? 959 BCE find,prefix-3,I Dimension statement? 967 BCE end,prefix-3,/ End statement? 975 B done * * Skip over the array name -- must end with left paren * 979find BCE lparen,0&X1,% 987 BCE syntax,0&X1,, 995 BCE syntax,0&X1,) 1003 BCE syntax,0&X1,} 1011 SBR x1 1015 B find * * Found the left paren * 1019lparen SW lpflag 1023 MN 0&X1 Get below 1027 SAR x1 left paren 1031 SW 2&X1 Set word mark at bottom of symbol 1035 MCW x2,savx2 1042 BW first,firstf * * Check whether symbol is in the table. X2 is at bottom * of the bottom symbol entry. * 1050check MCM 1&X2 1054 SAR x2 1058 BCE first,0&X2, Top of the table? 1066higher MCM 2&X2 Move up to next element 1070 MN 1071 MN 1072 SBR x2 Top of element (maybe) 1076 BCE higher,1&X2,| Need to move up more if RM 1084compar C 0&X2,0&X3 Same as already in table? 1091 SAR x2 1095 BU check 1100 BW double,1&X2 1108 B check 1112first MCW savx2,x2 1119 LCA gm,0&X2 Mark top of element 1126 LCA 0&X3 Symbol to element 1130 LCA newx3 chain 1134 SBR x2 below chain in element 1138 MCW newx3,x3 1145 BCE head,x3, 1153 B nohead 1157head A kb1,x3 Convert blank x3 to zeroes 1164nohead LCA k3b,0&X2 Put two three-character 1171 LCA k3b fields into symbol table 1175 SBR 6&X3 Link prev element to this one 1179 SBR newx3 1183 LCA k5b Add five spaces to element 1187 SBR x2 and get x2 below it 1191nother MN dimsav-4 Make x3&2 1195 MN be the high-order 1196 SAR x3 digit of dimsav 1200 SBR x1,0&X1 Strange kind of nop? * * Accumulate characters of dimension * 1207more MCW 0&X1,char Get character from dimension field 1214 SAR x1 and step down to next one 1218 BCE dimfin,char,) 1226 BCE dimfin,char,} 1234 BCE dimfin,char,, 1242 MCW char,2&X3 Store char in dimension save 1249 SBR x3 1253 B more 1257dimfin BCE syntax,1&X1,} 1265 LCA 1&X3,0&X2 Move dimension to symbol table 1272 SBR x2 1276 BCE nother,1&X1,, Get another dimension 1284 MCW prev&6,x3 1291 BCE notbig,0&X3,< 1299 B toobig 1303notbig CW firstf Clear first-time flag 1307tstfin BCE fini,0&X1,} Finished 1315 B with statement? 1316 BCE newvar,0&X1,, Another variable? 1324 B syntax 1328newvar MN 0&X1 Get below comma 1332 SAR x1 1336 SBR x3 1340 B find and go find end of next variable * * Finished with dimension statement * 1344fini C 0&X1 1348 SAR x1 1352 B prev * * Doubly defined array * 1356double CS 332 1360 CS 1361 SW glober 1365 MCW error2,230 1372 MCW compar&6,x2 1379 MN 232 1383 MN 1384 SAR x2 1388 SBR x3,0&X3 1395morech MCW 0&X3,ch 1402 SAR x3 1406 MCW ch,2&X2 1413 SBR x2 1417 BW donech,1&X3 At the end of the variable name? 1425 B morech 1429donech W 1430 BCV ovfl 1435 B noovfl 1439ovfl CC 1 1441noovfl BCE bottom,0&X1,) Bottom of statement? 1449 SBR x1 1453 BCE syntax,1&X1,} 1461 B noovfl 1465bottom MN 0&X1 1469 SAR x1 1473 MCW savx2,x2 1480 B tstfin * * Dimension syntax error * 1484syntax CS 332 1488 CS 1489 SW glober 1493 MN prefix,241 1500 MN 1501 MN 1502 MCW error3 1506 W 1507 BCV ovfl2 1512 B novl2 1516ovfl2 CC 1 1518novl2 MCW savx2,x2 1525 BCE prev,1&X1,} 1533end C 0&X1 1537 SAR x1 1541 B prev * 1545done BW gotlp,lpflag 1553 LCA gm,0&X2 1560 LCA colon 1564 LCA w3 1568 LCA w3 1572 LCA w3 1576 LCA w5 1580 LCA w10 1584 SBR x2 1588gotlp NOP 2&X1 1592 MCM 1593 MCW 1594 SAR x1 1598 MCW 6,86 Topmost table entry address to 86 1605 BSS snapsh,C 1610 SBR tpread&6,839 Load address for next overlay 1617 SBR clrbot and clear bottom 1621 SBR loadxx&3,1034 Exit from loader 1628 SBR clearl&3,1845 Clear top 1635 LCA equiv,phasid 1642 B loadnx * * Program is too big * 1646toobig CS 332 1650 CS 1651 CC 1 1653 MCW msg2,270 1660 W 1661 CC 1 1663 BCE halt,cdovly,1 1671 RWD 1 1676halt H halt * * Data * 1690prefix DCW @0 @ 1691gm dc @}@ 1694newx3 DCW #3 1699dimsav dcw #5 1700lpflag DC #1 WM in low-order character if left paren 1701kb1 DCW #1 1703manp2 DCW #2 mantis + 2 1704kp2 dcw &2 1705kb1a DCW #1 1706kless DCW @<@ 1709savx2 DCW #3 1710firstf DCW #1 WM is first-time flag 1713k3b DCW #3 1718k5b DCW #5 1719char DCW #1 Character from dimension field 1749error2 DCW @ERROR 2 - DOUBLY DEFINED ARRAY@ 1750ch DCW #1 1788error3 DCW @ERROR 3 - DIMENSION SYNTAX, STATEMENT @ 1789colon DCW @:@ 1792w3 DCW #3 1797w5 DCW #5 1799w10 dcw 10 1808equiv DCW @EQUIV ONE@ 1844msg2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1845gmwm DCW @}@ ex beginn END
- Phase 10 - Equivalence I. Adds simple variables present in EQUIVALENCE statements to the array table. These variables are treated, in effect, as one-element arrays.
JOB Fortran compiler -- Equivalence phase one -- 10 CTL 6611 * * 1. Assure all arrays present in EQUIVALENCE statements are * defined * 2. Add simple variables present in EQUIVALENCE statements * to the table of arrays generated by the previous phase. * These variables are treated, in effect, as one-element * arrays. * * On entry, 81-83 = start (top address) of first (top in memory) * statement (remember, statements are sorted by type now, and * pushed to the bottom of available core), 84-86 = address of the * topmost (first) dimension table (eleven below the bottom of the * name), x1 = address of the last digit of the sequence number of * the first (topmost) unprocessed statement, x2 = address of the * lowest-address character of the array table, and x3 = address * of the first (topmost) character of the x1 statement (first * character after keyword and left paren if not arithmetic). 6&x2 * is the "next" link and 9&x2 is the "previous" link in each * array table element. Blank means "end of chain". * * Each element of the array table has one or two variable-width * dimension fields (first dimension higher in core), with the * digits of the dimensions not reversed, a five digit offset from * the base of the equivalence class (x2 points at the low-order * digit), a three-character link to the next member of the * equivalence class, a three-character link to the next element, * a three-character link to the previous element, the name * (variable width), and a group mark with a word mark. The GMWM * of the topmost element is at topcor-3, and topcor-2 .. topcor * are blank. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 Read (1) instruction if running from cards tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * From dimension one phase * diff equ 838 WM if FP width /= integer width * * In equivalence two phase * done2 equ 1735 notin2 equ 1800 * ORG 839 839gm DC @}@ 849prefix dc #10 852next DCW #3 One below next slot in array table 860 DCW #8 Offset and link work for next phase 868 DCW #8 Offset and link work for next phase 876next3 DCW #8 Offset and link work for next phase 877 DC #1 882 DCW #5 * * Announce syntax error * 883syntax CS 332 887 CS 888 SW 184 Is this a global error flag? 892 MN prefix,243 Sequence 899 MN number to 900 MN error message 901 MCW error4 905 W 906 BCV ovfl1 911 B novfl1 915ovfl1 CC 1 917novfl1 C 0&X1 Get down below prefix of 921 SAR x1 statement -- next word mark 925 B nxstmt * * Get to the next variable in the statement and then * check whether it's already in the array table * 929find BCE atvar,0&X1,, Skip punctuation before variable 937 BCE atvar,0&X1,% 945 BCE atvar,0&X1,) 953 BCE syntax,0&X1,} 961 SBR x1 965 B find * * X1 is now below a variable name in the statement, and * X2 is now at the top of a variable name in the table * 969atvar SW 1&X1 Set WM at bottom of variable 973 MCW next,x2 980uneq BCE notin,2&X2, Top of the table? 988more1 MCM 2&X2 Move up to top of next table element 992 MN and then down 993 MN to table element name 994 SAR x2 998 BCE more1,1&X2,| More to do if RM 1006testv C 0-0,0&X2 Test duplicate variable 1013 SAR x3 Stmt var - len(table var) 1017 BU uneq Not found in the table yet 1022tsteql BW found,1&X3 Equal length in stmt and table? 1030 B uneq No, not found in the table yet * * Start here * 1034beginn MN 0&X2 Get down to 1038 SAR next next available slot 1042 SBR next3 in array table 1046 SW gm 1050 BW difwid,diff FP width /= integer width? 1058 MCW branch,switch 1065difwid MCW x1,savex1 1072 MCW less,2&X1 Mark statement as processed 1079 SBR tstful&6,2&X1 Remember statement end mark addr 1086more2 MCM 2&X2 Get above GMWM above bottom table element 1090 MN and then back 1091 MN below it. x2 now points at first 1092 SAR x2 (topmost) character of name. 1096 BCE more2,1&X2,| More to do if RM 1104 C 0&X2 Skip name 1108 C Skip "next" pointer 1109 C Skip "prev" pointer 1110 C Skip ??? 1111 SAR tabadr 1115nxstmt LCA 0&X1,prefix 1122 SAR x1 X1 is now first char below prefix 1126fintst BCE done,prefix, Done if no sequence number 1134 BCE goteqv,prefix-3,Q EQUIVALENCE statement? 1142finbr B done Done if not EQUIVALENCE statement 1146goteqv BCE gotlp,0&X1,% 1154 B syntax 1158gotlp SW fpflg1,fpflg2 Got left paren -- syntax OK 1165nxtvar MN 0&X1 Skip left paren to get X1 to 1169 SAR x1 top char of variable 1173 SBR testv&3 variable to find in table 1177switch NOP find branch if FP width == integer width * * Check whether variables have same type * 1181chktyp MN 0&X1,tstint&7 Get ready to test first 1188 MZ 0&X1,tstint&7 character of variable name 1195tstint BCE intvar,intchr,X Integer variable name? 1203 chain5 1208 CW fpflg2 1212 B notint 1216intvar CW fpflg1 1220notint BW find,fpflg2 1228 BWZ * * Error -- mixed FP and integer in equivalence while integer * and FP have different width * 1229 CS 332 1233 CS 1234 SW 184 Is this a global error flag? 1238 MN prefix,251 Sequence number 1245 MN to error 1246 MN message 1247 MCW error5 1251 W 1252 BCV ovfl2 1257 B novfl2 1261ovfl2 CC 1 1263novfl2 SW fpflg1,fpflg2 1270 B find * * Not in the table yet. X1 ==(?) X3 = punctuation below * the variable in the statement * 1274notin MCW x1,x3 Does this change X3? 1281 BCE subsnd,0&X1,% Subscript present? 1289 MCW next,x2 One below bottom slot in table 1296 LCA gm,1&X2 Set boundary 1303 SBR x2 Does this change X2? 1307 MCW testv&3,x3 Variable sought in table 1314 LCA 0&X3,0&X2 Move variable to table 1321 SBR x2 X2 now points at "prev" link 1325 MCW tabadr,x3 Current bottom-of-table 1332 LCA tabadr,0&X2 Set "prev" link in new entry 1339 LCA w3 Space for "next" link 1343 LCA w3 Space for ??? 1347 SBR tabadr Set current bottom-of-table 1351 SBR x2 Set X2 nine below name in table 1355 LCA w5,0&X2 1362 LCA k1 Dimension == 1 for scalar 1366 SBR x2 X2 is now one below bottom element 1370 MCW tabadr,6&X3 Set "next" link in prev entry 1377 BCE notab,86, No table yet? * * Save bottom of table and check size * 1385savbot MN 0&X2 1389 SAR next 1393tstful BCE itfits,0,< * * Program is too big -- clobbered the sentinel * 1401 CS 332 1405 CS 1406 CC 1 1408 MCW error2,270 1415 W 1416 CC 1 1418 BCE cards,cdovly,1 1426 RWD 1 1431cards H cards * * No table yet * 1435notab MCW tabadr,86 Store top of table 1442 B savbot Save bottom of table and check size * * Haven't clobbered the sentinel -- the program fits * 1446itfits BCE doneqv,0&X1,) Done with this equivalence? 1454 B moreqv 1458doneqv SW fpflg1,fpflg2 Assume equivalence is OK 1465moreqv MN 0&X1 Skip punctuation below variable 1469 SBR x1 1473 SBR testv&3 Variable to find in table 1477 BCE nother,0&X1,, Another variable in equivalence? 1485 BCE itfits,0&X1,} 1493 BCE nxstmt,1&X1,} 1501 B switch Go test types * * Subscript appears in EQUIVALENCE statement but the variable * was not found in the array table * 1505subsnd CS 299 1509 MCW x3,x1 Does this change X1? 1516 MCW x2,savx2 1523 MN 248 Why not 1527 MN just do 1528 SAR x2 sbr x1,246? 1532 SBR x1,0&X1 This can't change X1 1539findlp MCW 0&X1,savech 1546 SAR x1 1550 BCE gotlp2,savech,% Got to start of subscript? 1558 MCW savech,2&X2 Move saved character to message 1565 SBR x2 reversing variable back into order 1569 B findlp 1573gotlp2 MCW savx2,x2 1580 SW 184 Is this a global error flag? 1584 MN prefix,240 Sequence number 1591 MN to error 1592 MN message 1593 MCW error6 1597 BCV ovfl3 1602 B novfl3 1606ovfl3 CC 1 1608novfl3 W 1609skipv MN 0&X1 1613 SAR x1 1617 BCE nother,0&X1,) Found end of subscript 1625 BCE syntax,0&X1,% Syntax error if left paren 1633 BCE syntax,0&X1,} syntax error if end of statement 1641 BCE skipv,0&X1,, Skip more if comma (is this OK?) 1649 BWZ skipv,0&X1,2 Skip more if numeric 1657 B syntax Else syntax error * * Another variable in equivalence * 1661nother MN 0&X1 1665 SAR x1 1669 B itfits * * Found variable in array table * 1673found BCE skipv,0&X1,% Subscript OK since we found var 1681 B itfits * 1685done SBR fintst&3,done2 These 1692 SBR finbr&3,done2 addresses are 1699 SBR uneq&3,notin2 in next overlay 1706 SBR tsteql&3,chktyp 1713 MCW next,next3 1720 MCW savex1,x1 1727 MCW branch,switch 1734 MCW nop,gotlp 1741 BSS snapsh,C 1746 SBR tpread&6,chktyp Set load addr for next overlay 1753 SBR clrbot 1757 SBR loadxx&3,nxstmt Set entry addr for next overlay 1764 SBR clearl&3,gmwm 1771 LCA equiv2,phasid 1778 B loadnx * * More data * 1821error4 DCW @ERROR 4 - EQUIVALENCE SYNTAX, STATEMENT @ 1822branch B 1823less DCW @<@ Less-than sign 1826tabadr DCW #3 Current array table address 1827fpflg1 DCW #1 1828fpflg2 DCW #1 WM if FP variable 1834intchr DCW @IJKLMN@ First character of integer variables 1882error5 DCW @ERROR 5 - ILLEGAL EQUIVALENCE MIXING, STATEMENT @ 1885w3 DCW #3 Used to create 1887w5 DC #2 empty table entry 1888k1 dcw 1 Dimension for scalars 1924error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1927savx2 DCW #3 1928savech DCW #1 1965error6 DCW @ERROR 6 - UNDEFINED ARRAY, STATEMENT @ 1968savex1 DCW #3 1969nop NOP 1978equiv2 DCW @EQUIV TWO@ 1979gmwm DCW @}@ ex beginn END
- Phase 11 - Equivalence II. The array table is altered to show the relationship between arrays. Equated arrays are chained together. Essentially, the procedure makes known to every array whose first element is equivalent to a secondary element of another array the "distance" to the first element of the latter array.
JOB Fortran compiler -- Equivalence phase two -- 11 CTL 6611 * * The dimension table is altered to show the relationship * between arrays. The procedure, essentially, is to make * every array whose first element is equivalent to a secondary * element of another array know the distance to the first * element of the latter array. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Stuff in the previous overlay * gm equ 839 Group mark, in previous phase prefix equ 849 next equ 852 One below next slot in array table off1 equ 857 Offset work area class1 equ 860 Equivalence class link off2 equ 865 Offset work area class2 equ 868 Equivalence class link off3 equ 873 Offset work area next3 equ 876 Equivalence class link syntax equ 883 Syntax error routine nxstmt equ 1115 Process the next statement gotlp equ 1158 Get to next variable in statement nxtvar equ 1165 Process next variable * * This phase actually starts at NXSTMT in the previous overlay. * Here x1 points one below the bottom character of a variable in * a statement and x2 points at the topmost character of the name * of the corresponding variable in the array table. * * Each element of the array table has one or two variable-width * dimension fields (first dimension higher in core), with the * digits of the dimensions not reversed, a five digit offset * from the base of the equivalence class, a three-character link * to the base member of the equivalence class, a three-character * link to the next element, a three-character link to the * previous element, the name (variable width), and a group mark * with a word mark. The GMWM of the topmost element is at * topcor-3, and topcor-2 .. topcor are blank. * * The next and prev pointers are redirected so that elements of * an equivalence class are consecutive, and ascending order by * offset. * * Below the array table, build a table of classes, each element * having a five-digit offset and a link to the first element of * the class in the array table. * * At exit, X3 is one below the GM at the bottom of the array * table, and X1 is the top (prefix) of the first statement * after (below) the last equivalence. * * Come here from FIND routine in previous phase when it finds * the variable in the array table. * ORG 1181 1181 LCA kz5,off2 1188 NOP 0&X2 1192 MCW Skip name 1193 MCW Skip "next" pointer 1194 MCW Skip "prev" pointer 1195 MCW Skip "class" pointer 1196 SAR x2 X2 now points at 5-digit offset 1200 BAV *&1 Turn off arithmetic overflow flag 1205 S w3 1209more BCE new,1&X2, Offset empty? 1217 A 0&X2,off2 1224 MCW 3&X2,x2 Next element in equivalence class 1231 A kp1,w3 Count elements in class 1238 BAV fixit Error if overflow -- circular list? 1243 B more 1247new MCW x2,class2 1254 BCE subs,0&X1,% Variable in equivalence subscripted? 1262 A k1,off2 Bump offset 1269totop MCW next3,x3 Top of class table 1276 LCA off1,off3 1283 S off2,off3 1290 BM neg,off3 off2 .lt. off1? 1298 LCA class2,0&X3 1305 SBR next3 1309getnxt BCE nxtvar,0&X1,, 1317 BCE eqvfin,0&X1,) Equivalence group done 1325 B syntax 1329eqvfin MN 0&X1 Skip right paren 1333 MN Skip comma if statement not ended 1334 SAR savx1 Left paren if statement not ended 1338 MCW next3,x3 1345 LCA dollar,0&X3 Mark bottom of class table * * Search the class table for the link to the class in CLASS1 * 1352 MCW next,x3 Top of class table 1359tstbot BCE atbot,0&X3,$ At bottom of class table? 1367 MCW 0&X3,wnext 1374 C class1,wnext 1381 BE testri It's either redundant or illegal 1386backri MCW 0&X3,x2 1393 SAR next3 1397 BCE empty,0&X2, 1405 B full Entry has an offset 1409empty MCW 9&X2,x1 Prev to x1 1416emptyl MCW 6&X2,x3 Next from x3 is x3 1423 BCE endtab,x3, At end of array table? 1431 BCE endtab,1&X3, 1439 SBR x2 Next to x2 1443 B emptyl 1447endtab BCE endtb2,x3, At end of array table? 1455 MCW x1,9&X3 1462endtb2 BCE noprev,x1, No prev link? 1470 MCW x3,6&X1 1477endtb3 MCW class1,x1 1484 MCW 6&X1,6&X2 1491 MCW 6&X1,x3 1498 MCW x2,9&X3 1505 MCW next3,x3 1512 MCW 3&X3,x2 1519 MCW x2,6&X1 1526 MCW x1,9&X2 1533 MCW class1,3&X2 1540 MCW 1541 S 0&X3,0&X2 1548 SAR x3 1552 BW tstbot,flag 1560 SW flag 1564 C 0&X2,woff 1571 BE red1 1576 B illegl 1580 B tstbot * * Redundant equivalence * 1584red1 B redund 1588 B tstbot * * Variable in equivalence has subscript * 1592subs MN 877 1596 MN 1597 SAR x3 Why not SBR x3,next3-1? 1601 SBR x1,0&X1 * * Move subscript, in forward order, to class table * 1608subsl MCW 0&X1,chtest 1615 SAR x1 1619 BCE subsx,chtest,) 1627 MCW chtest,2&X3 1634 SBR x3 1638 B subsl * 1642subsx A 1&X3,off2 1649 B totop * 1653neg BCE first,off1, still empty? 1661 LCA class1,0&X3 1668 SBR next3 1672first MCW class2,class1 Current one has least offset 1679 B getnxt * * At bottom of class table * 1683atbot MCW savx1,x1 1690 LCA eoff,off1 Empty offset to off1 1697 MCW next,next3 1704 BCE gotlp,1&X1,, 1712 BCE nxstmt,1&X1,} 1720 B syntax * 1724noprev MCW x3,86 1731 B endtb3 * * Code in previous overlay comes here when equivalence statements * have all been processed * 1735done2 MCW next,x3 1742 MCW gm,1&X3 Mark bottom of array table 1749 MCM 5&X1 1753 MN 1754 MN 1755 SAR x1 Top of statement after last equivalence 1759 BSS snapsh,C 1764 SBR tpread&6,838 1771 SBR clrbot 1775 SBR loadxx&3,838 1782 SBR clearl&3,gmwm 1789 LCA dim2,phasid 1796 B loadnx * * Code in previous overlay comes here for variables in the * EQUIVALENCE statement that are not in the table * 1800notin2 BCE gotrp,0&X1,) 1808 SBR x1 1812 B notin2 1816gotrp MN 0&X1 1820 SAR x1 1824 B nxtvar * * Test for redundant or illegal equivalence * 1828testri MCW 0&X3,x2 1835 SAR x2 1839 C 0&X2,off1 1846 BE red2 1851 B illegl 1855 B backri 1859red2 B redund 1863 B backri * * Illegal equivalence * 1867illegl SBR novfl1&3 1871 CS 332 1875 CS 1876 SW glober 1880 MN prefix,244 1887 MN 1888 MN 1889 MCW error7 1893 W 1894 BCV ovfl1 1899 B novfl1 1903ovfl1 CC 1 1905novfl1 B 0 * * Redundant equivalence * 1909redund SBR novfl2&3 1913 CS 332 1917 CS 1918 SW glober 1922 MN prefix,246 1929 MN 1930 MN 1931 MCW error8 1935 W 1936 BCV ovfl2 1941 B novfl2 1945ovfl2 CC 1 1947novfl2 B 0 * * Print "Correct errors and rerun" message and stop * 1951fixit CC L 1953 CS 332 1957 CS 1958 MCW fixmsg,270 1965 W 1966 CC 1 1968halt H halt * * Offset has a value * 1972full MCW 0&X2,woff 1979 CW flag 1983 B empty * * Data * 1991kz5 DCW @00000@ 1994w3 DCW #3 1995kp1 dcw &1 1996k1 dcw 1 1999savx1 DCW #3 2000dollar DCW @$@ 2003wnext DCW #3 2004chtest DCW #1 2009eoff DCW #5 2018dim2 DCW @DIMEN TWO@ 2059error7 DCW @ERROR 7 - ILLEGAL EQUIVALENCE, STATEMENT @ 2102error8 DCW @ERROR 8 - REDUNDANT EQUIVALENCE, STATEMENT @ 2138fixmsg DCW @CORRECT ERRORS INDICATED AND RESTART@ 2143woff DCW #5 Offset work area 2144flag DCW #1 2145gmwm DCW @}@ ex nxstmt END
- Phase 12 - Dimension II. The object-time addresses which delimit each array are computed and inserted in the array table. These addresses are also printed.
JOB Fortran compiler -- Dimension phase two -- 12 CTL 6611 * * Arrays are assigned their object-time addresses. * * On entry, X3 is one below the group mark below the bottom of * the array table, and 86 is the address of the low-order digit * of the offset field of the topmost (first) array table entry * if there are any arrays, or blank if there is no array table. * * On exit the fixed-width fields of the array table elements are * the base address as five digits, the top address as three * characters with a type zone in the second character, the * array element width (imod or mantis&2) and junk, and the * address of the low-order digit of the first array element * as three characters with a type zone in the second character. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error arytop equ 194 Top of arrays in object code snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits fmtsw equ 696 X for no format, L for limited format * blank for ordinary, A for A conversion loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838beginn BCE ord,fmtsw, Ordinary formatting? 846 SBR x2,base5a 853 BCE oth,fmtsw,A A-conversion formatting? 861 SBR x2,base5l 868 BCE oth,fmtsw,L Limited formatting? 876 SBR x2,base5x 883 BCE oth,fmtsw,X No formatting? 891ord MCW x3,83 898 A kp2,mantis Add exponent width to mantissa width 905 SW gm 909 LCA gm,1&X3 Put a GMWM below bottom of array table 916 BCE noary,86, No arrays? 924 MCW 86,x3 931again S w6 935 MCW 6&X3,next 942 BCE noeqv,1&X3, No equivalence class link? 950 MCW 3&X3,x2 Next member of equivalence class 957 ZA 0&X3,w10-4 Offset 964 M 5&X2,w10-1 971 A 0&X2,w10-1 Offset of next in equivalence class 978 MCW w10-1,0&X3 985noeqvr MCW 0&X3,w6 992 SAR x3 996 S kp1,w6 1003 MCW x3,x2 1010more MCM 2&X2 Get X2 above the GMWM 1014 MN and then 1015 MN back down 1016 SAR x2 below it 1020 BCE more,1&X2,| 1028 MCW 0&X2,ch First character of variable name 1035 MCW ch,*&8 1042 BCE intvar,ijklmn,0 Integer variable? 1050 B 1051 B 1052 B 1053 B 1054 B 1055 A mantis,w6 Floating point variable 1062var MCW w6,14&X3 low-order to what was prev 1069 MCW w6-3,x2 Thousands to X2 1076 A x2 Double it 1080 MZ zones&X2,12&X3 Thousands zones 1087 MZ zones&1&X2,14&X3 to variable address 1094 ZA kz1,w10-4 Clear 1101 MCW 0&X3,w10-4 Get first dimension 1108 MCW kb1 and a blank 1112 SBR prep&6 1116 NOP 0&X3 Get X2 1120 MCW down to 1121 SAR x2 second dimension 1125 BCE nodim2,0&X2,} No second dimension if GM? 1133prep MCW 0&X2,0-0 1140 M 0&X3,w10-4 1147nodim2 LCA kb3,8&X3 Clobber equivalence link 1154 MCW x1,sx1 Save x1 1161 MCW 14&X3,x1 Address to x1 1168 MCW ch,*&8 1175 BCE intvr2,ijklm2,0 Integer variable? 1183 B 1184 B 1185 B 1186 B 1187 B 1188 M mantis,w10-1 First dimension * width 1195 MZ kzab,7&X3 Mark floating-point zone 1202 MCW mantis,10&X3 1209var2 MZ 7&X3,13&X3 Copy type zone 1216 MCW sx1,x1 1223 S 10&X3,w6 Subtract variable width 1230 A w10-1,w6 1237 MN w6,8&X3 Low-order digits 1244 MN to what was the 1245 MN equivalence class link 1246 SAR *&4 1250 MCW 0-0,x2 1257 MCW kz1 1261 A x2 1265 MZ zones&1&X2,8&X3 1272 CW why not 1273 SBR *&7 just 1277 MZ zones&X2,0 MZ ZONES&X2,6&X3 ? 1284 A kp1,w6 1291 S w6,base5 compute base5 = max(base5,w6) 1298 BM negdif,base5 1306 A w6,base5 1313tstmor BCE nomore,next, No more arrays if next is blank 1321 MCW next,x3 1328 B again * 1332intvar A imod,w6 1339 B var * * At the end of an equivalence class (maybe the only one * in it). * 1343noeqv MCW base5,0&X3 1350 B noeqvr * 1354negdif MCW w6,base5 1361 B tstmor * 1365intvr2 M imod,w10-1 First dimension * width 1372 MZ kzb,7&X3 Mark integer zone 1379 MCW imod,10&X3 1386 B var2 * * No more array table elements * * Convert topcor to five digits * 1390nomore S w2a 1394 S w2b 1398 MZ topcor,w2a-1 1405 MZ topcor-2,w2b-1 1412loop1k BWZ mod4,w2b-1,2 multiple of 4k? 1420 A ka0,w2b 1427 B loop1k 1431mod4 BWZ below4,w2a-1,2 1439 A kq4,w2a 1446 B mod4 1450below4 A w2b-1,w2a 1457 MCW topcor,top5 1464 MCW w2a 1468 ZA top5 1472 MZ *-4,top5 * * Test for too big program * 1479 S base5,top5 topcor - top of arrays 1486 S kp1,top5 1493 BM toobig,top5 1501 MN top5,top3 low-order 1508 MN digits of 1509 MN free space 1510 SAR *&4 1514 MCW 0-0,x2 thousands to x2 1521 MCW kz1 and a zero 1525 A x2 double it 1529 MZ zones&1&X2,top3 1536 CW why not 1537 SBR *&7 just 1541 MZ zones&X2,0 MCW ZONES&X2,TOP3-2? 1548 MCW base3,arytop 1555 MA top3,arytop 1562 B notbig 1566toobig BW notbig,w10 Don't repeat error message 1574 CS 332 1578 CS 1579 MCW error2,270 1586 W 1587 SW glober,w10 set global and don't repeat flags 1594 S top5 1598noary MCW topcor,arytop 1605notbig MCW base3,86 1612 CC L 1614 BCV *&5 1619 B *&3 1623 CC 1 1625 CS 332 1629 CS 1630 MCW storge,247 1637 W 1638 CC J 1640 MCW 83,x3 * * Print the arrays and their addresses * 1647nother NOP 10&X3 1651 MCM 1652 SAR x3 1656 CS 299 1660more3 BCE more2,0&X3,| 1668 B 1669 MN 0&X3 1673 MN 1674 SAR x3 1678 BCE noarys,0&X3,: No arrays if colon 1686 MN 201 1690 MN 1691 SAR x2 1695 SBR x3,0&X3 * * Move variable to print area -- need to reverse it * 1702move MCW 0&X3,ch2 1709 SAR x3 1713 MCW ch2,2&X2 1720 SBR x2 1724 BW movfin,1&X3 1732 B move 1736movfin C 0&X3 Skip 1740 C the 1741 C fixed 1742 C width 1743 SAR x2 fields 1747 A top5,5&X2 1754 MA top3,8&X2 1761 MA top3,14&X2 1768 MCS 5&X2,218 1775 MCW 8&X2,234 1782 MZ kb1,233 1789 SW 220 * * Convert top address of array to five digits * 1793 S w2c 1797 S w2d 1801 MZ 8&X2,w2c-1 1808 MZ 6&X2,w2d-1 1815lp1ka BWZ mod4a,w2d-1,2 Multiple of 4k? 1823 A ka0,w2d 1830 B lp1ka 1834mod4a BWZ low4,w2c-1,2 1842 A kq4,w2c 1849 B mod4a 1853low4 A w2d-1,w2c 1860 MCW 8&X2,224 1867 MCW w2c 1871 ZA 224 1875 MZ *-4,224 1882 MCW hyphen,219 1889 MN 5&X2,230 1896 MN 1897 MN 1898 SAR *&4 1902 MCW 0,x2 1909 MCW kz1 1913 A x2 1917 MZ zones&1&X2,230 1924 CW 1925 SBR *&7 1929 MZ zones&X2,0 1936 BCV *&5 1941 B *&3 1945 CC 1 1947 W 1948 CS 299 1952 MCM 1&X3 1956 SAR x3 1960 BCE done,0&X3, 1968 B nother Do another one * 1972more2 MCM 0&X3 1976 SBR x3 1980 B more3 * * Print No Arrays message * 1984noarys CS 332 1988 CS 1989 MCW noarym,209 1996 W 1997 BCV *&5 2002 B done 2006 CC 1 * * Done * 2008done CC L 2010 BSS snapsh,E 2015 SBR clearl&3,gmwm 2022 LCA varbl1,phasid 2029 B loadnx * * Formatting other than ordinary formatting * 2033oth MCW 0&X2,base3 Base address 2040 MCW and decimal equivalent & 1 2041 B ord * * Data * 2049base5 DCW 04280 Decimal format base address for arrays * Eventually, 1 above top of arrays 2052base3 DSA 4279 Base5 - 1 in machine address format 2057 DCW 04617 2060base5a DSA 4616 A format base address for arrays 2065 DCW 02016 2068base5l DSA 2015 L format base address for arrays 2073 DCW 01697 2076base5x DSA 1696 X (no) format base address for arrays 2081top5 DCW 00000 topcor as five digits 2084top3 DCW 000 topcor less arrays as 3 characters 2085gm dc @}@ 2095w10 DCW #10 2096kb1 DCW #1 2098zones DCW @ 9@ 2129 DCW @9Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 2130kp2 dcw &2 2136w6 DCW #6 2139next DCW #3 2140kp1 dcw &1 2141ch DCW #1 2147ijklmn DCW @IJKLMN@ 2148kz1 DCW 0 2151kb3 DCW #3 2154sx1 DCW #3 Save area for X1 2160ijklm2 DCW @IJKLMN@ 2161kzab dcw &1 A and B zones 2162kzb DCW -1 B zone 2164w2a DCW #2 2166w2b DCW #2 2168ka0 dcw @A0@ 2170kq4 dcw @?4@ 2206error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2251storge DCW @STORAGE ASSIGNMENT-ARRAYS & EQUATED VARIABLES@ 2252ch2 DCW #1 2254w2c DCW #2 2256w2d DCW #2 2257hyphen DCW @-@ 2266noarym DCW @NO ARRAYS@ 2272varbl1 DCW @VARBL1@ 2273gmwm DCW @}@ ex beginn END
- Phase 13 - Variables I. The entire source program is scanned for variables. The following changes are made directly within the text of the source program:
- Simple variables are tagged for later processing by Phase 16.
- Subscripted variables with constant subscripts are replaced by the object-time address of the designated array element.
- All other subscripted variables are put into a canonical form which specifies a computation in terms of variables and constants for determining the object-time address of the array element specified.
- Non-subscripted array names appearing in lists are replaced by the object-time address that delimit the array named.
- Non-subscripted array names appearing elsewhere are replaced by the object-time address of the first element of the array.
JOB Fortran compiler -- Variable Phase One -- 13 CTL 6611 * * The source program is scanned for variables. Simple * variables are merely tagged for later processing by * Variables Phase Four. Subscripted variables whose * subscripts are constants are replaced by the object- * time address of the array element. Subscripted variables * whose subscripts are variable are replaced by the * computation required at object time to determine the * array element selected. Non-subscripted array variables * appearing in lists are replaced by two machine-language * addresses representing the limits of the array. Non- * subscripted array variables appearing elsewhere are * replaced by the address of the first element of the * array. * * On entry, 83 is one below the GM below the bottom of * the array table and x1 is at the top of the first (in sorted * order) statement that's neither dimension nor equivalence. * * On exit the code is moved up against the array table. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader loadxx equ 793 Exit from overlay loader * ORG 838 838beginn MCW 83,x2 845 MCW x2,tblbot Save bottom of array table 852 SW gm 856nxtstm BCE done,0&X1, No more statements? 864 LCA 0&X1,prefix 871 SAR x1 Top of statement 875 SBR x3 879 LCA prefix,0&X2 Push up below array table 886 SBR x2 and save the next available 890 BCE format,prefix-3,F Format statement? 898 SW prefix-3 902 MCW prefix-3,*&8 909 BCE datxfr,datxfc,0 Data transfer statement? 917 chain6 * * Not a data transfer statement * 923 MCW nop,swich1 Turn off data transfer 930 MCW nop,swich2 statement switches * * Back here for either data transfer statement or not * 937stmt MCW 0&X1,ch Skip numeric 944 SAR x1 and non-zoned punctuation 948 BWZ stmt,ch,2 characters 956swich1 NOP datxf1 Branch if data transfer statement 960skipp MCW ch,*&8 Skip @*-&.%), 967 BCE stmt,punct,0 punctuation 975 chain7 982 BCE fltcon,ch,E Floating-point constant? 990 BCE gotvar,ch,} GM (bottom of stmt)? 998 MCW 2&X1,ch2 1005 MCW ch2,*&8 1012 BCE gotvar,punct2,0 #,}*@&-%) 1020 chain8 1028 BCE gotvar,prefix-3,D Do statement? 1036syntax CS 332 1040 CS 1041 SW glober Global error flag 1045 MN prefix,240 Sequence number to print line 1052 MN 1053 MN 1054 MCW error9 Variable syntax error 1058 W 1059 BCV ovfl1 1064 B novfl1 1068ovfl1 CC 1 1070novfl1 BW cw1s6,flag1 go clear flag 1 and set flag 6 1078 SBR x1,1&X1 1085 SW flag3 1089 B skp2p2 Skip to punct2 punctuation * 1093suber2 LCA k0q0,0&X2 0?0 1100 SBR x2 1104 SBR x3,1&X1 1111 SBR x1 1115 B varfin * * X1 is at the GM at the bottom of the statement, or one below * the top (first) character of a variable. * Move stuff above and first character up. * 1119gotvar SW 1&X1 1123 LCA 0&X3,0&X2 Move up stuff above (before) var 1130 SBR x2 1134 CW 1&X1 1138 SBR x3,1&X1 X3 now at top (beginning) of variable 1145 SBR check&6,2&X1 1152 MCW semic Replace char above variable or GM 1156 BCE endstm,ch,} End if GM 1164 ZA kp1,w2 * ` * Count characters in name * 1171skp2p2 MCW 0&X1,ch 1178 SAR x1 1182 MCW ch,*&8 1189 BCE gotp2,punct2,0 #,}*@&-%) 1197 chain8 1205 A kp1,w2 1212 B skp2p2 * 1216gotp2 BW subfn1,flag6 1224 BW suber2,flag3 1232 SW 2&X1 At bottom (last) char of token 1236 SAR sx1 Save 1&x1 at punct below name * * Look for variable in array table. X3 is at top (first) * character of the variable. CH is character below (after) * the variable. * 1240lookup MCW tblbot,x1 Get bottom of array table 1247 BCE asg,ch,# Go turn off swich2 if assignment stmt 1255look2 BCE notarr,2&X1, At end of array table? 1263more MCM 2&X1 1267 MN 1268 MN 1269 SAR x1 1273 BCE more,1&X1,| 1281 C 0&X3,0&X1 1288 BU look2 1293 C 0&X1,0&X3 1300 BU look2 1305 C 0&X1 Get x1 down to 1309 chain3 offset field 1312 SAR x1 1316 BW subvr2,flag2 Working on variable subscript? 1324 BCE sub,ch,% Subscripted * * In array table, not subscripted * 1332swich2 NOP datxf2 Branch if data transfer statement 1336 LCA 9&X1,1&X2 Addr of low digit of first array elt 1343 SBR x2 1347lookfn MCW sx1,x1 1354 B varfin * * Whole array * 1358datxf2 LCA 9&X1,1&X2 Addr of low digit of first array elt 1365 LCA 3&X1 Addr of low digit of last array elt 1369 SBR x2 1373 CW 4&X2 between addresses 1377 B lookfn * * Not in array table. X2 is two below the punctuation before * the variable or prefix moved to be below the array table. * 1381notarr MCW sx1,x1 1388 BW subvr3,flag2 Working on variable subscript? 1396 BCE subnot,ch,% 1404 LCA kbundr,1&X2 Blank, underscore 1411 SBR x2 1415notar2 LCA 0&X3,1&X2 Move variable up 1422 SBR x2 1426 CW 1&X2 1430 S kp2,w2 1437 BM short,w2 Variable name is short 1445varfin CW 1&X1 1449 SAR x3 1453varfn2 CW 1&X2 1457 CW flag4,flag3 1464 CW flag5 1468check BCE stmt,0,; Semicolon? 1476 MCW dollar,x1 1483 B done * * Not in array table, but appears to be subscripted * 1487subnot BCE notar2,1&X1,F Last char of var says function? 1495 CS 332 1499 CS 1500 SW glober 1504 MN prefix,240 1511 MN 1512 MN 1513 MCW error6 1517 W 1518 BCV ovfl2 1523 B novfl2 1527ovfl2 CC 1 1529novfl2 LCA kpct3z,1&X2 %000 1536 SBR x2 1540 MZ savzon,3&X2 1547getend BCE endsub,0&X1,) End of subscript? 1555 BCE endst2,0&X1,} End of statement? 1563 SBR x1 1567 B getend 1571endsub MN 0&X1 X1 now below subscript 1575 SAR x1 1579 B varfn2 * * In array table and subscripted * 1583sub ZA 0&X1,w6 High digit of first array element 1590 SAR x3 x3 now at first dimension 1594 SW flag7 In array table and subscripted 1598 ZA 0&X3,w5 First dimension to w5 1605 ZA 5&X1,prod-7 Element size 1612 S kp1,w6 1619 MZ 8&X1,savzon Type tag of array 1626 MCW sx1,x1 X1 back to statement 1633 LCA kbdolr,1&X2 Blank, $ indicates subscript 1640 SBR x2 1644 MN 0&X1 1648 SAR x1 1652 SBR x3 1656tstcon BWZ submor,0&X1,2 Constant subscript? 1664 SBR x1,2&X1 1671 LCA kstar1,0&X1 Star, 1 (1 is prev dim width) 1678 B submor * * Continue variable subscript processing * 1682subvar LCA kbundr,1&X2 Blank, underscore indicates variable 1689 SBR x2 * * Get down to the bottom of the variable * 1693skp2p3 MCW 0&X1,ch 1700 SAR x1 1704 MCW ch,*&8 1711 BCE gotp3,punct3,0 -&), 1719 chain3 1722 B skp2p3 1726gotp3 SW 2&X1 1730 SW 1731 SAR sx1 1735 SW flag2 Working on variable subscript 1739 B lookup * 1743subvr2 LCA 9&X1,2&X2 1750 SBR x2 1754 CW 1&X2 1758 MN 1759 SAR x2 1763 B subvr4 * * Move subscript up * 1767subvr3 LCA 0&X3,1&X2 1774 LCA 1775 SBR x2 1779 CW 2&X2 1783subvr4 MCW sx1,x1 1790 CW 2&X1 1794 BCE short2,3&X2,_ 1802 LCA kbcomm,1&X2 Blank, comma 1809 SBR x2 1813 CW flag2 Done working on variable subscript 1817 BCE morsub,ch,, 1825 BCE subfin,ch,) 1833 MZ ch,prod-7 1840subvr5 MCW x1,x3 1847 B tstcon * * Continue subscript processing * 1851submor SBR x3,bigwrk-2 1858subm2 MCW 0&X1,ch Move subscript 1865 SAR x1 to bigwrk putting 1869 MCW ch,2&X3 its characters 1876 SBR x3 into forward order 1880 BWZ subm2,0&X1,2 Constant subscript? 1888 SBR x1 1892 M prod-7,7&X3 1899 BCE subv1,1&X1,* First variable subscript? 1907 A 7&X3,w6 Add to offset from array base 1914 BCE subfin,1&X1,) Done with subscripts? 1922 BCE morsub,1&X1,, Second subscript? 1930 SW flag1 1934 B syntax * 1938cw1s6 CW flag1 1942 SW flag6 1946 B skp2p2 * 1950subfn1 CW flag6 1954subfin NOP w6-7 1958 SAR x3 1962 SW flag4 Moving variable subscript 1966 B normlz 1970subfn2 LCA dollar,0&X2 Mark end of subscript 1977 SBR x2 1981 MZ savzon,3&X2 1988 B varfin * * First variable subscript * 1992subv1 CW 1&X1,flag7 1999 B normlz 2003 LCA kbstar,0&X2 2010 SBR x2 2014 CW 1&X2 2018 MCW x1,x3 2025 B subvar * * Normalize offset between 0 and 15999, store it * into code at top of core. * 2029normlz SBR normlx&3 2033normlp S kp16k,7&X3 Subtract 16000 2040 BWZ normlp,7&X3,B until negative 2048normln A kp16k,7&X3 Add 16000 2055 BM normln,7&X3 until positive 2063 BW cvtadr,flag4 Moving variable subscript? 2071nortrm SBR x3,1&X3 Trim leading 2078 BCE nortrm,2&X3,0 zeroes 2086 SBR x2,1&X2 2093 LCA kb6 2097norrev MCW 2&X3,ch Move normalized 2104 SAR x3 offset up 2108 MCW ch,0&X2 while reversing 2115 SBR x2 the digits 2119 BWZ norrev,1&X3,2 2127 MZ kb1,1&X2 Clobber last digit zone 2134normlx B 0-0 * * Done * 2138done BSS snapsh,C 2143 SBR loadxx&3,849 2150 SBR clearl&3,gmwm 2157 LCA varbl2,phasid 2164 B loadnx * * data transfer input/output statement * 2168datxfr MCW branch,swich1 Turn on data transfer 2175 MCW branch,swich2 statement switches 2182 MCW prefix-3,*&8 2189 BCE rwt,rwtc,0 Read/write (input/output) tape? 2197 chain3 2200 B stmt read, print or punch 2204rwt SW flag5 2208 B stmt 2212datxf1 BCE datxrp,ch,) 2220 B skipp Go skip punctuation 2224datxrp MCW branch,swich2 2231 B skipp Go skip punctuation * * Bottom (end) of statement * 2235endst2 MN 0&X2 2239 SAR x2 2243endstm LCA gm,1&X2 2250 B nxtstm * * Saw assignment operator (#) * 2254asg MCW nop,swich2 2261 B look2 * * Make sure at least 3 characters * 2265short2 LCA kb2,1&X2 2272 SBR x2 2276 B subvr4 * * Variable name is short -- we need at least three spaces * 2280short LCA kb1,0&X2 2287 SBR x2 2291 CW 1&X2 2295 B varfin * * Looks like a floating-point constant * 2299fltcon BCE gotvar,2&X1,# 2307 BCE gotvar,2&X1,@ 2315 BWZ stmt,2&X1,2 2323 BCE stmt,2&X1,. 2331 B gotvar * * Convert bigwrk to machine address * 2335cvtadr MCW 7&X3,w5b 2342 MN w5b,subadr 2349 MN 2350 MN 2351 SAR *&4 2355 MCW 0-0,x3 thousands 2362 MCW k0 and a zero to x3 2366 A x3 double x3 2370 MZ zones&1&X3,subadr 2377 CW 2378 SBR *&7 2382 MZ zones&X3,0-0 2389 BCE cvtad2,2&X2,, 2397 SBR x2,1&X2 2404cvtad2 LCA subadr,1&X2 2411 SBR x2 2415 CW 1&X2 2419 MZ savzon,2&X2 2426 BW varfin,flag7 In array table and subscripted? 2434 B subfn2 * * Saw a comma, here comes another subscript * 2438morsub MZ *-4,prod-7 2445 M w5,prod-1 2452 MCM prod-5,prod-11 2459 S prod-7,w6 2466 B subvr5 * * Format statement -- just copy it * 2470format LCA 0&X1,0&X2 Copy stmt below array table 2477 SBR x2 save next 'to' address 2481 C 0&X1 get to bottom of statement 2485 SAR x1 save top of next statement 2489 B nxtstm * * Data * 2501punct2 DCW @#,}*@&-%)@ 2502flag1 dc #1 Syntax error after first subscript 2503flag2 dc #1 2504flag3 dc #1 2505bigwrk dcw #1 2554 DC #49 2555gm DC @}@ 2561 DCW @ERROR @ 2582 DCW @ VARIABLE, STATEMENT @ 2594prod DCW @ |@ 2597subadr DCW #3 Subscript variable address 2598flag4 dc #1 Moving variable subscript 2599flag5 dc #1 2600flag6 dc #1 2602zones DCW @ 9@ 2633 DCW @9Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 2636tblbot DCW #3 Bottom of the array table 2646prefix DCW #10 2653datxfc dcw @3L5UP61@ codes for data transfer statements 2654nop NOP 2655ch DCW #1 2663punct DCW @@*-&.%),@ Punctuation characters 2664ch2 DCW #1 2701error9 DCW @ERROR 9 - VARIABLE SYNTAX, STATEMENT @ 2704k0q0 DSA 0&X3 2705semic DCW @;@ semicolon 2706kp1 dcw &1 2708w2 DCW #2 2711sx1 DCW #3 2713kbundr DCW @ _@ blank, underscore 2714kp2 dcw &2 2715dollar DCW @$@ 2752error6 DCW @ERROR 6 - UNDEFINED ARRAY, STATEMENT @ 2756kpct3z dcw @%000@ 2762w6 DCW #6 2767w5 DCW #5 2768savzon DCW #1 2770kbdolr DCW @ $@ 2772kstar1 DCW @*1@ 2776punct3 DCW @-&),@ 2778kbcomm DCW @ ,@ 2779flag7 DCW #1 WM means in array table and subscripted 2781kbstar DCW @ *@ 2786kp16k DCW @1600?@ 2787kb1 dcw #1 2788kb2 dc #1 2792kb6 DC #4 2801varbl2 DCW @VARBL TWO@ 2802branch B 2806rwtc dcw @1356@ Read/Write (input/output) tape codes 2811w5b DCW #5 2812k0 DCW 0 2813gmwm DCW @}@ ex beginn END
- Phase 14 - Variables II. All free storage (including the array table) is cleared and partitioned into two tables areas-Tables I and II. Parameters needed for the randomizer of Phase 16 are computed.
JOB Fortran compiler -- Variable Phase Two -- 14 CTL 6611 * * The entire program is shifted to the top (leftmost part) of * available storage, leaving room for subsequent compiler phases. * The remaining storage is cleared for tables including the * array table generated by Dimension Phase Two. * * On entry, 83 is one below the GM below the bottom of * the array table, x1 is below the bottom of the last * statement in sorted order at the bottom of free core, * and x2 is one below the bottom of the last transformed * statement at the top of free core, in sorted order. * * On exit, 83 is topcor-2, x1 is the prefix of the first * (topmost) statement, x2 is x1&1, topcd9 (840) is top of * code & x00 - 1, diff (845) is topcor-1 - topcd9, and * bndry (848) is topcd9 + 0.3 * diff * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * frebot equ 2699 * ORG 838 840topcd9 DCW #3 top of code & x00 - 1 is bottom of hash 845diff DCW #5 diff = topcor-1 - topcd9 is size of hash 848bndry DCW #3 top of hash table 849beginn MCW 83,x3 856 BCE toobig,x1,$ 864 SBR tblbot,2&X3 871 MCW x2,x3 * * Clear from below the bottom transformed statement down * to frebot. * 878clrlp CS 0&X3 882 SBR x3 886 C x3,kfree 893 BU clrlp * * Move transformed statements down to frebot * 898 SBR x1,frebot 905 MN 0&X1 909 SAR x1 913more MCM 0&X2 917 SAR nextx2&6 921 MCM 0&X2,1&X1 Move one statement down 928 MN 929 SBR x1 933nextx2 SBR x2,0 940 BCE more,0&X1,| More to do if RM 948 MN 0&X2 952 CW 953 SW 0&X1 957 C x2,tblbot Done moving statements? 964 BU more No * * X2 is now at the bottom of the array table and * X1 is at the top of the moved-down transformed code * 969 CW 0&X2 Why clear this WM? 973 CW 974 SBR topcd9,2&X1 981 MN zones-32,topcd9 99 988 MN 989 MCW topcor,x3 996 MN 0&X3 1000 SW 1001 SAR 83 topcor-2 1005 SBR x3 1009clrlp2 CS 0&X3 Clear the array table and 1013 SBR x3 transformed code at top of core 1017 C x3,topcd9 Down to top of code & x00 ? 1024 BU clrlp2 No, more to do * * Compute topcd9 (hash table base), diff (10 * size of hash * table) and bndry (top of hash table) * 1029 MCW kless,0&X3 1036 MCW 83,toconv 1043 B conv5 Convert topcor-1 to decimal 1047 MCW w5,diff 1054 MCW topcd9,toconv Convert topcd9 to decimal 1061 B conv5 1065 S w5,diff diff = topcor-1 - topcd9 1072 A diff-1,w6 diff / 10 1079 A w6 diff / 5 1083 A diff-1,w6 diff / 5 + diff / 10 = 3 * diff / 10 1090 A w5,w6 topcd9 + diff * 0.3 1097 MCW w6-3,x3 (topcd9 + diff * 0.3) / 1000 1104 A x3 2 * (topcd9 + diff * 0.3) / 1000 1108 MZ zones-31&X3,w6-2 1115 MZ zones-30&X3,w6 to machine address 1122 MCW w6,x3 1129 SW 2&X3 1133 MCW kless 1137 SBR bndry 1141 MCW x1,x2 1148 MN 0&X2 1152 SAR x1 * * Done * 1156 BSS snapsh,C 1161 SBR tpread&6,beginn 1168 SBR clrbot 1172 SBR loadxx&3,857 1179 SBR clearl&3,gmwm 1186 LCA varbl3,phasid 1193 B loadnx * * Program is too big * 1197toobig CS 332 1201 CS 1202 CC 1 1204 MCW error2,270 1211 W 1212 CC 1 1214 BCE halt,cdovly,1 1222 RWD 1 1227halt H halt * * Convert toconv from machine to decimal * 1231conv5 SBR convx&3 1235 MN toconv,w5 1242 MN 1243 MN 1244 MCW 1245 MZ toconv,zones-32 1252 MZ toconv-2,zones-33 1259 NOP zones-34 1263 SAR x3 1267convl C 4&X3,zones-32 look for correct zones 1274 SAR x3 1278 A kp1,w5-3 add one to thousands 1285 BU convl 1290 MZ kb1,w5-3 1297convx B 0 * * Data * 1305toconv DCW @0J @ 1339zones DCW @9999Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 1342tblbot DCW #3 1345kfree DSA frebot 1346kless DCW @<@ 1351w5 DCW #5 1357w6 DCW #6 1366varbl3 DCW @VARBL TRI@ 1402error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1403kp1 dcw &1 1404kb1 DCW #1 1405gmwm DCW @}@ ex beginn END
- Phase 15 - Variables III. Does housekeeping for Phase 16.
JOB Fortran compiler -- Variables Phase 3 -- 15 CTL 6611 * * This phase does housekeeping for Variables Phase 4 * * On entry, X2 is one above the prefix of the topmost statement * x2 equ 94 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * frebot equ 2699 * ORG 849 853codsiz DCW #5 Code size, 84-86, in decimal 856topcod DCW #3 Top of code & 1 857beginn CC L 859 CS 332 863 CS 864 MCW msg,237 871 W 872 CC J 874 MCW kb1,frebot 881 MCW x2,topcod * * Convert code size (84-86) to decimal * 888 S w2h 892 S w2l 896 MZ 86,w2h-1 903 MZ 84,w2l-1 910l1 BWZ l2,w2l-1,2 918 A ka0,w2l 925 B l1 929l2 BWZ l2x,w2h-1,2 937 A kq4,w2h 944 B l2 948l2x A w2l-1,w2h 955 MCW 86,codsiz 962 MCW w2h 966 ZA codsiz 970 MZ *-4,codsiz * * Done * 977 BSS snapsh,C 982 SBR tpread&6,beginn 989 SBR clrbot 993 SBR clearl&3,frebot 1000 LCA varbl4,phasid 1007 B loadnx * * Data * 1047msg DCW @STORAGE ASSIGNMENT - SIMPLE VARIABLES@ 1048kb1 DCW #1 1050w2h DCW #2 1052w2l DCW #2 1054ka0 DCW @A0@ 1056kq4 DCW @?4@ 1066varbl4 DCW @VARBL QUAD@ 1067gmwm DCW @}@ ex beginn END
- Phase 16 - Variables IV. The source program is scanned twice for simple variables (already tagged by Phase 13). During the first scan, the compiler looks for variables being defined, i.e., those appearing on the left of an equal sign or in input lists. By means of a randomizer that computes an indirect address (a Table I address at which is located a Table II address), each such variable and its object-time address is stored uniquely and sequentially (one after another) in Table II. The object-time address replaces the variable name in the source program. During the second scan, all other variables are picked up, and the same process is carried out, except that undefined variables are noted and Table If entries are flagged whenever referenced.
JOB Fortran compiler -- Variables Phase 4 -- 16 CTL 6611 * * The compiler first scans input-output lists and the left * side of equal signs for simple variables. Each unique * variable is placed in a table with its object-time address. * In the second scan of this phase, all variables are matched * against the table. When an entry is found, the object-time * address is substituted in the statement for the variable * name. Variable names not present in the table are undefined. * * On entry, 83 is topcor-2, x1 is the prefix of the first * (topmost) statement, x2 is x1&1, topcd9 (840) is top of * code & x00 - 1, diff (845) is topcor-1 - topcd9, and * bndry (848) is topcd9 + 0.3 * diff * * On exit, topcor is the top of the scalar symbols table, * 83 is the bottom, 86 is the code size, and x1 is the top of * the transformed code * * Each element of the scalar symbols table consists of the * three-character run-time address, with a word mark under * the first character, a group mark, with a word mark under * it if the variable is not referenced, and the variable, with * characters reversed. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape topcd9 equ 840 Top of code & x00 - 1 is hash table base diff equ 845 diff = topcor-1 - topcd9 is 10*(size of hash) bndry equ 848 Top of hash table codsiz equ 853 Code size, 84-86, in decimal topcod equ 856 Top of code & 1 on entry * ORG 857 857beginn MCW topcd9,gettop&3 864 MZ x1tag,gettop&2 x1 zone tag 871 SW gm 875 CW flag 879loop1 BCE bottom,0&X1, bottom (end) of the code? 887 MCW 0&X1,seqcod 894 LCA 0&X1,prefix 901 SAR x1 X1 and X3 are now one below the 905 SBR x3 GM that separates prefix from body 909 LCA prefix,0&X2 Move up prefix 916 SBR x2 920 BCE skipit,seqcod-3,/ End statement? 928 BCE skipit,seqcod-3,F Format statement? 936 MCW k01,w2 943swread B testrd 947fndvar BCE gotvar,0&X1,_ Variable name follows? 955 chain5 960 BCE skipit,0&X1,} Bottom of statement (GM)? 968 chain5 973 SBR x1 977 B fndvar * * X1 got to within six of a variable name. Get down to * it exactly. * 981gotvar BCE gotvr2,0&X1,_ 989 SBR x1 993 B gotvar 997gotvr2 SW 1&X1 one above the underscore 1001 CW 1002 CW 1003 CW 1004 SAR x1 1008 BCE topasg,4&X1,} At top (lhs) of asg stmt if GM 1016 LCA 0&X3,0&X2 Move up 1023 SBR x2 1027 CW 1&X2 1031topasg SBR x3,2&X1 Top of variable * * Get down to punctuation * 1038punlp MCW 0&X1,ch 1045 SAR x1 1049 MCW ch,*&8 1056 BCE gotpun,punct,0 1064 chain7 1071 B punlp 1075gotpun BCE asgrhs,ch,# 1083 BCE brack,2&X1,] 1091 B nobrak 1095brack SW flag 1099nobrak NOP notrd Branch if not definition 1103afbrak SW 2&X1 1107 ZA 0&X3,w4 Hashing? 1114 A 4&X1,w4 1121 MZ kbnz3,w4 1128 MZ 1129 MZ 1130 MCW 1131pos S diff-1,w4 Subtract diff/10 1138 BWZ pos,w4,B until it's negative 1146 A diff-1,w4 Now add back diff/10 1153 MZ knz,w4 1160 MCW x2,sx1x2 1167 MCW 1168 MCW w4,x1 Triple 1175 A x1 w4 1179 A w4,x1 to x1 1186gettop NOP 0-0 topcd9 with x1 zone tag stored here 1190 SAR x1 topcd9 & 3 * w4 ro x1 1194 MCW nop,swbig Turn off ,been around hash' flag * * Not in hash table yet if blank, else check symbol * 1201swun BCE enter,0&X1, switches to bce undef.... 1209 BCE swbig,0&X1,< 1217 MCW 0&X1,x2 get symbol table entry address 1224 SAR x1 1228 C 0&X3,0&X2 compare symbol to table 1235 BU swun 1240 C 0&X2,0&X3 1247 SAR cwsw&3 1251 BU swun * * Found symbol in symbol table * 1256cwsw MN 0 CW in pass 2 to say *referenced* 1260 SAR getadr&3 1264rex1x2 MCW sx1x2,x2 Memorize x1 and x2 1271 MCW 1272getadr LCA 0,0&X2 Addr from sym tab replaces sym in code 1279 SBR x2 1283 CW 1&X2 1287 SBR x3,1&X1 1294 SBR x1 1298getsw B getpun * * Enter variable in hash table and symbol table * 1302enter MCW 83,x2 Bottom of symbol table to X2 1309 MCW 83,0&X1 and hash table 1316 MCW 0&X3,0&X2 Symbol to symbol table 1323 SBR x2 1327 BCE toobig,0&X2,< 1335 chain4 * * Check type of variable * 1339 SW 0&X3 At first character of variable 1343 MCW 0&X3,*&8 1350 BCE intvar,ijklmn,0 1358 chain5 * * Floating-point variable * 1363 MZ abzone,typtag Floating point type tag 1370 BW setbrk,flag 1378 A mantis,codsiz 1385var C codsiz,kp16k Compare codsiz to 16k 1392 BH oksize 1397 BW oksize,sizflg Printed message already? 1405 CS 332 1409 CS 1410 MCW err2a,270 1417 W 1418 SW glober,sizflg Dont print message twice * * Convert codsiz to machine address * 1425oksize MCW codsiz,w5 1432 MCW x3,sx2x3 1439 MCW 1440 MN w5,86 1447 MN 1448 MN 1449 SAR *&4 Why not just w5-3 in next A field? 1453 MCW 0,x2 Thousands to x2 1460 MCW kz1 and a zero 1464 A x2 double it 1468 MZ zones&1&X2,86 1475 CW 1476 SBR *&7 Why not just 84 in next B field? 1480 MZ zones&X2,0 1487 MCW 86,w3 1494brkset CW 0&X3 1498 CS 299 1502 MN 201 1506 MN 1507 SAR x2 Why not just SBR x2,199? 1511 SBR x3,0&X3 Why? 1518mvlp MCW 0&X3,ch2 Move 1525 SAR x3 variable to 1529 MCW ch2,2&X2 201... while 1536 SBR x2 reversing to 1540 BW *&5,1&x3 correct order 1548 B mvlp 1552 MCW sx2x3,x3 1559 MCW 1560 MCW 86,227 1567 MCS codsiz,219 1574 BW novfl1,flag 1582 W 1583 BCV *&5 1588 B *&3 1592 CC 1 1594novfl1 SW 1&X2 WM below variable in symbol table 1598 LCA gm and GMWM below that 1602 SBR getadr&3 Store symbol table address 1606 LCA w3 Store variable address in sym tab 1610 SBR 83 Store bottom of symbol table 1614 SBR x2 and in x2 1618 BCE *&5,seqcod-3,D Do statement? 1626 B *&5 1630 CW 4&X2 Mark it referenced 1634 MZ typtag,2&X2 Move type tag to symbol table 1641 CW flag 1645 B rex1x2 * 1649setbrk MCW w2,w3 1656 MCW kbrack 1660 A kp1,w2 1667 B brkset * * Test for a read statement (which defines variables) * 1671testrd BCE rdstmt,seqcod-3,1 read tape statement? 1679 BCE rdstmt,seqcod-3,5 read input tape statement? 1687 BCE rdstmt,seqcod-3,L read statement? 1695 MCW branch,nobrak 1702 MCW nop,swpar 1709 MCW nop,asgrhs 1716 MCW nop,swdolr * * Get X1 down to underscore (variable) ), $ (subscript) or GM * 1723getpun BCE gotvr2,0&X1,_ Variable? 1731swpar NOP unbrak,0&X1,) NOP if not definition 1739swdolr NOP sub,0&X1,$ Subscript NOP if not definition 1747gmtest BCE skipit,0&X1,} 1755 SBR x1 1759 B getpun * * Read (input) (tape) statement * 1763rdstmt MCW nop,nobrak 1770 MCW branch,swpar 1777 MCW move,asgrhs 1784 MCW branch,swdolr 1791 B getpun * 1795unbrak MCW nop,nobrak 1802 B gmtest 1806asgrhs NOP branch,swpar NOP if not definition 1813 MCW branch,nobrak 1820 B afbrak * * Undefined variable * 1824undef CS 299 1828 SW glober 1832 MCW err10,230 1839 MN 231 1843 MN 1844 SAR x1 1848 SBR x3,0&X3 * * Move the variable to the print line, reversing the text * back to the correct order * 1855varlp MCW 0&X3,chvar 1862 SAR x3 1866 MCW chvar,2&X1 1873 SBR x1 1877 BW varlpx,1&X3 1885 B varlp 1889varlpx MN seqcod,255 1896 MN 1897 MN 1898 MCW stmt @statement @ 1902 W 1903 BCV ovfl2 1908 B novfl2 1912ovfl2 CC 1 1914novfl2 SBR getadr&3,kz3 1921 BM topqr,231 1929isopqr MZ abzone,kz3-1 set x3 tag 1936 B rex1x2 * 1940topqr SW 231 1944 MCW 231,*&8 1951 BCE isopqr,opqr, 1959 B 1960 B 1961 B 1962 MZ x2tag,kz3-1 set x2 tag 1969 B rex1x2 * * Got to bottom of hash table * 1973swbig NOP toobig Branch if already been around 1977 MCW branch,swbig Note we've been around 1984 MCW bndry,x1 Back to top of hash table 1991 B swun Go look some more * * Subscript * 1995sub SBR swdolr&3,sub2 2002 MCW branch,nobrak 2009 B gmtest 2013sub2 SBR swdolr&3,sub 2020 MCW nop,nobrak 2027 B gmtest * * Integer variable * 2031intvar MZ bzone,typtag Set integer variable address tag 2038 BW setbrk,flag 2046 A imod,codsiz Increase codsiz by int var size 2053 B var * * Hit the bottom of the code. Either set up for pass 2 * or quit. * 2057bottom MCW topcod,x1 2064 CS 0&X2 2068 CS 2069 SBR clearl&3,gmwm 2076swdone NOP done 2080 SW gm 2084 MCW branch,swdone Exit next time around 2091 MCW cw,cwsw 2098 MCW nop,swread 2105 MCW nop,nobrak 2112 SBR swun&3,undef 2119 SBR getsw&3,fndvar 2126 CS 0&X2 2130 SBR x2,1&X1 2137 SBR topcod 2141 CC J 2143 B loop1 Go do pass 2 * * Done * 2147done BSS snapsh,C 2152 MCW varbl5,phasid 2159 B cdovly Load next phase without clearing core * * Statement has no (more) variables -- skip it * 2163skipit LCA 0&X3,0&X2 2170 SAR x3 2174 C 0&X2 Down to 2178 SAR x2 next WM in target 2182 MCW x3,x1 2189 B loop1 * 2193notrd SBR x1,1&X1 2200 SBR x3,1&X3 2207 B getpun * * Program is too big * 2211toobig CS 332 2215 CS 2216 CC 1 2218 MCW error2,270 2225 W 2226 CC 1 2228 BCE halt,cdovly,1 2236 RWD 1 2241halt H halt * * Data * 2247kz3 DCW 000 2248sizflg dc #1 Set when size message printed 2250zones DCW @ 9@ 2281 DCW @9Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 2282x1tag dcw @S@ 2286seqcod DCW #4 Sequence number and statement code 2296prefix DCW #10 Statement prefix 2298k01 DCW 01 2300w2 DCW #2 2301ch DCW #1 2309punct DCW @@}#*-&),@ 2310flag DCW #1 2314w4 DCW #4 2318kbnz3 DCW #4 Used to get a blank and three "no zone" 2319knz DCW #1 Used to get "no zone" 2327sx1x2 DCW #8 Save x1 and x2 2328nop NOP 2334ijklmn DCW @IJKLMN@ 2335abzone dcw @A@ x3 tag, floating point type tag 2336typtag DCW #1 Variable type tag 2341kp16k DCW &16000 2377err2a DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2382w5 DCW #5 2390sx2x3 DCW #8 2391kz1 DCW 0 2394w3 DCW #3 2395ch2 DCW #1 2396kbrack DCW @]@ 2397kp1 dcw &1 2398branch B 2399move MCW 2429err10 DCW @ERROR 10 - UNDEFINED VARIABLE @ 2430chvar DCW #1 Used for reversing variable text 2440stmt DCW @STATEMENT @ 2444opqr DCW @OPQR@ 2445x2tag DCW @K@ 2446bzone DCW @J@ Integer variable address tag 2447cw CW 2456varbl5 DCW @VARBLQUIN@ 2492error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2493gm dc @}@ 2498 dc #5 2499gmwm DCW @}@ ex beginn END
- Phase 17 - Variables V. Table II is scanned. The absence of a flag indicates an unreferenced variable. The object-time address of each variable is printed.
JOB Fortran compiler -- Variables Phase 5 -- 17 CTL 6611 * * A check is made for unreferenced variables * x1 equ 89 x2 equ 94 x3 equ 99 * * On entry and exit, X1 is the top of code, topcor is the top of * the symbol table, and 83 is the bottom of the symbol table. * * Each element of the scalar symbols table consists of the * three-character run-time address, with a word mark under * the first character, a group mark, with a word mark under * it if the variable is not referenced, and the variable, with * characters reversed. * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 857 857beginn CC J 859 MCW x1,sx1 Memorize top of code 866 MCW topcor,x2 Top of symbol table 873loop BCE tabent,0&X2,} GM means bottom of sym tab name 881 SBR x2 885 C x2,83 Bottom of symbol table? 892 BU loop No * * Done * 897 MCW sx1,x1 Recall top of code 904 BSS snapsh,D 909 SBR tpread&6,838 916 SBR clrbot 920 SBR loadxx&3,838 927 SBR clearl&3,2698 934 LCA const1,phasid 941 B loadnx * * X2 is at GM below a name in the symbol table * 945tabent BW unref,0&X2 Unreferenced if GM has WM 953 MN 0&X2 957 SBR x2 961 B loop * * Unreferenced symbol * * Move X3 (initially X2) up to WM above symbol * 965unref CS 299 969 MCW err11,233 976 MCW x2,x3 983loopu NOP 1&X3 Why not 987 SAR x3 just SBR X3,1&X3? 991 BW *&5,2&x3 At WM above symbol? 999 B loopu 1003 MN 234 Why not 1007 MN just 1008 SAR x1 SBR X1,232? 1012 SBR x3,1&X3 1019loopw MCW 0&X3,ch Move symbol 1026 SAR x3 to print 1030 MCW ch,2&X1 line while 1037 SBR x1 reversing characters 1041 BW *&5,1&X3 to correct 1049 B loopw order 1053 W 1054 BCV *&5 1059 B *&3 1063 CC 1 1065 MN 0&X2 1069 SAR x2 1073 B loop * * Data * 1079sx1 DCW #3 1088const1 DCW @CONST ONE@ 1121err11 DCW @ERROR 11 - UNREFERENCED VARIABLE @ 1122ch DCW #1 1123gmwm DCW @}@ ex beginn END
- Phase 18 - Constants I. The entire source program is scanned for constants. Each constant encountered is normalized and tagged. Tables I and II are destroyed.
JOB Fortran compiler -- Constants Phase One -- 18 CTL 6611 * * Constants in the source program are noted and normalized * and/or truncated. The only word marks in the statement are * under the group marks that separate prefix from body and * one statement from another. * x1 equ 89 x2 equ 94 x3 equ 99 * * On entry, X1 is the top of code. * * On exit, code is moved up to the top, 83 is the top of * code, and x2 is one below the bottom of code. * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape loadxx equ 793 Exit from overlay loader * ORG 838 838beginn CS 299 842 SW gm 846 SW 200 850 MCW topcor,x2 857 MN 0&X2 861 MN 862 SAR x2 topcor-2 866 SBR 83 topcor-2 870 LCA gm,1&X2 GMWM to topcor-1 877loop BCE done,0&X1, Bottom of statements if blank 885 MCW 0&X1,seqcod 892 LCA 0&X1,prefix 899 SAR x1 903 SBR sx1 907 SBR sx2,0&X2 914 LCA prefix,0&X2 Move prefix up 921 SBR x2 925 MCW seqcod-3,*&8 932 BCE io,codes,0 Interesting statement? 940 chain9 949 LCA 0&X1,0&X2 Move statement body up 956 SAR x1 960 C 0&X2 964 SAR x2 968 B loop * * I/O, IF, DO, Arithemtic statement * 972io SBR x3,codtab-4 979 MCW seqcod-3,*&8 986search BCE found,4&X3,0 994 SBR x3 998 B search * * Found the statement code in codtab. Copy the interesting * punctuation and the count to puncnt. The punctuation * mark is what is sought in the statement. The count * part is 2 minus the number of times the punctuation * mark must be found. It starts at 0, 1 or 2, and is * incremented until it is 2. * 1002found MCW 6&X3,puncnt 1009 MCW puncnt-1,schpun&7 1016schcnt BCE found2,puncnt,2 Found it enough times? 1024 A k1,puncnt 1031schpun BCE gotpun,0&X1,0 Found the desired punctuation? 1039 BCE found2,0&X1,} Found GM? 1047 SBR x1 1051 B schpun go search for more punctuation 1055gotpun MN 0&X1 1059 SAR x1 1063 B schcnt go test have we seen it enough times? 1067found2 BWZ nozone,0&X1,3 Digit or GMWM? 1075 SBR x1 1079 BCE switch,1&X1,$ Subscript? 1087 B found2 1091nozone BCE endstm,0&X1,} GM means end of statement 1099 SBR x1 1103 BCE found2,1&X1,# assignment operator is not a number 1111 BCE found2,1&X1,@ atsign is not a number 1119 MCW 2&X1,before 1126 MCW at 1127 MCW after 1128 SAR x1 1132 MCW before,*&8 1139 BCE found3,oppun,0 char before is operator or punct? 1147 chain10 1157 BCE endstm,1&X1,} 1165backsp SBR x1,1&X1 1172 B found2 * * Subscript begin * 1176switch NOP unsw 1180 MCW branch,switch 1187 MCW kb1,swich3&4 Set to unconditional branch 1194 B found2 * * Subscript end * 1198unsw MCW nop,switch 1205 MCW uneq,swich3&4 Set to branch unequal 1212 B found2 * * Found a digit preceded by an operator or punctuation in oppun * 1216found3 BCE decmal,3&X1,. 3&x1 = before 1224 MCW after,*&8 1231 BCE backsp,athrur,0 ?A-I!J-R ? 1239 chain19 1258 BCE testif,3&X1,) 1266mark SW 3&X1 WM above field 1270 MCW sx1,x3 1277 LCA 0&X3,0&X2 Move up stuff above field 1284 SBR x2 1288 MCW kless,3&X1 1295 SBR tless&6,3&X1 1302 CW 1&X2 1306 LCA kunder,0&X2 Mark top of constant 1313 SBR x2 1317 CW 1&X2 1321 CW flag 1325 S exp 1329 S sigwid 1333 S nlz 1337 MCW sw,swnop 1344 MCW nop,asn2 1351 MCW branch,swich2 1358 SBR man&3,add 1365 SBR msn&3,sub 1372 SBR x1,2&X1 1379zscan MCW 0&X1,at 1386 SAR x1 1390asn2 NOP kp1,exp add, sub or nop 1397 A kp1,nlz 1404swich2 BCE zscan,at,0 1412 BCE msn,at,. 1420 BCE man,swich2,B 1428 A kp1,sigwid 1435tstasg BCE kleft,at,# constant on left side of equal sign 1443 BCE *&9,at,@ originally slash in input? 1451 BWZ zscan,at,2 1459 C man&3,anop 1466 BU gotik 1471 BWZ *&8,exp,B 1479 A kp1,exp 1486 SW 2&X1 1490 BCE dec2,2&X1,. 1498decbak BCE gotexp,at,E 1506expbak C nlz,kp01 1513 NOP syntax 1517 NOP 1518 C sigwid,kpz3 1525 BU gotfpk 1530synbak LCA k15k,0&X2 1537 SBR x2 1541 CW 1&X2 1545 B tlessx * * Found a floating-point constant * 1549gotfpk MCW x1,sx1a 1556 BW *&8,flag 1564 LCA 0&X3,1&X3 1571 MCW sx1b,x1 1578 MCW mantis,width 1585 A kp2,width 1592 SBR x3,198 1599 SW 200 1603floop MCW 0&X1,at Use the 1610 SAR x1 print area 1614 MCW at,2&X3 to reverse 1621 SBR x3 the constant 1625 BW finfk,1&X1 to correct 1633 S kp1,width order 1640 C width,kp00 1647 BU floop 1652finfk SBR x3,1&X3 Finished with floating point constant 1659skip0 BCE *&5,0&X3,0 1667 B not0 1671 MN 0&X3 1675 SAR x3 1679 B skip0 1683not0 MN 0&X3 1687 SAR x3 1691 MCW exp,3&X3 Move exponent 1698 MZ add2,1&X3 Zone for mantissa 1705 LCA 3&X3,0&X2 1712 SBR x2 1716 B kfin * * Constant on left side of equal sign * 1720kleft CS 332 1724 CS 1725 SW glober 1729 MN seqcod,256 1736 MN 1737 MN 1738 MCW klm1 1742 MCW klm2 1746 W 1747 BCV *&5 1752 B *&3 1756 CC 1 1758 MCW sx2,x2 1765 MCW kb1,0&X2 1772 C 0&X1 1776 SAR x1 1780 B loop * * Syntax error for constant * 1784syntax CS 332 1788 CS 1789 SW glober 1793 MN seqcod,241 1800 MN 1801 MN 1802 MCW err44 1806 W 1807 BCV *&5 1812 B *&3 1816 CC 1 1818 B synbak * 1822dec2 MCW k0,2&X1 1829 SW flag 1833 B decbak * * Floating-point exponent * 1837gotexp ZA pze,theexp 1844 BWZ expns,0&X1,2 1852 MZ 0&X1,theexp Exponent is signed 1859 SAR x1 1863expns MN 0&X1 1867 SAR x1 1871 C 0&X1,z 1878 BL exp2 1883 MN 1&X1,theexp 1890 B exp3 1894exp2 MN 1&X1,theexp-1 1901 MN 0&X1,theexp 1908 SAR x1 1912exp3 A theexp,exp 1919 MN 0&X1 1923 SAR x1 1927 B expbak * * Found integer constant * 1931gotik C sigwid,kpz3 1938 BU i2 1943 LCA kb0,0&X2 zero constant 1950 SBR x2 1954 CW 1&X2 1958 B tlessx 1962i2 MCW x1,sx1a 1969 MCW sx1b,x3 1976 SW 0&X3 1980 SBR x3,299 1987 MCW imod,width 1994iloop MCW 2&X1,at Move up 2001 SAR x1 constant, 2005 MCW at,0&X3 reversing digits 2012 SBR x3 to correct 2016 BW finik,1&X1 order 2024 S kp1,width 2031 C width,kp00 2038swich3 BU iloop 2043finik SW 1&X3 Finished with integer constant 2047 LCA 299,0&X2 2054 SBR x2 2058 CW 1&X3 2062 C sigwid,kp001 2069 BU kfin 2074 CW 1&X2 2078 LCA kb1a,0&X2 2085 SBR x2 2089kfin CW 1&X2 Finished with integer or FP constant 2093 MCW sx1a,x1 2100tlessx SBR x1,1&X1 2107 SBR sx1 2111tless BCE found2,0-0,< * * Program is too big * 2119 CS 332 2123 CS 2124 CC 1 2126 MCW error2,270 2133 W 2134 CC 1 2136 BCE halt,cdovly,1 2144 RWD 1 2149halt H halt * * Done * 2153done BSS snapsh,C 2158 SBR loadxx&3,849 2165 SBR clearl&3,gmwm 2172 LCA const2,phasid 2179 B loadnx * * Check for IF statement * 2183testif BCE endstm,seqcod-3,E IF statement? 2191 B mark * * End of statement. Move it up * 2195endstm MCW sx1,x3 2202 LCA 0&X3,0&X2 2209 SAR x3 2213 C 0&X2 2217 SAR x2 2221 MCW x3,x1 2228 B loop * * FP constant beginning with a decimal point * 2232decmal SBR x1,1&X1 2239 B mark * * Decimal point * 2243msn MCW sub2,asn2 move sub or nop 2250 MCW anop,man&3 2257 MCW x1,x3 2264swnop SW flag either sw or nop 2268 B zscan * 2272man MCW add2,asn2 move add or nop 2279 MCW anop,msn&3 2286 MCW nop,swich2 2293 SBR sx1b,1&X1 2300 MCW nop,swnop 2307 B tstasg * * Data * codtab equ *&1 2340 DCW @R 2E 2D#1L,15,0U,1P,16,01,13,1@ 2341add A 2342sub S 2345anop DSA nop 2346after DCW #1 char after digit 2347at DCW #1 digit 2348before dcw #1 char before digit 2349gm DC @}@ gm 2353seqcod DCW #4 statement code, sequence number 2363prefix DCW #10 Entire statement prefix 2366sx1 DCW #3 2369sx2 DCW #3 2379codes DCW @UPL3165DER@ I/O, DO, IF, Arith codes 2381puncnt DCW #2 2382k1 dcw 1 2393oppun DCW @)}@.#%$,*-&@ Operators and punctuation 2394branch B 2395nop NOP 2396uneq dcw @/@ D-modifier for unequal branch 2416athrur DCW @?ABCDEFGHI!JKLMNOPQR@ 2417kless DCW @<@ 2418kunder DCW @_@ 2420exp DCW #2 2423sigwid DCW #3 Significant width of constant 2424sw SW 2425kp1 dcw &1 2428nlz DCW #3 Number of leading zeros 2430kp01 DCW &01 2433kpz3 DCW &000 2436k15k DSA 15000 2439sx1a DCW #3 2442sx1b DCW #3 2444width DCW #2 mantis or imod 2445kp2 dcw &2 2447kp00 DCW &00 2448add2 A 2470klm1 DCW @EQUAL SIGN, STATEMENT @ 2503klm2 DCW @ERROR 41 - CONSTANT LEFT SIDE OF @ 2504kb1 DCW #1 2542err44 DCW @ERROR 44 - CONSTANT SYNTAX, STATEMENT @ 2543k0 DCW 0 2544flag DCW #1 2545pze dcw &0 2547theexp DCW #2 2548z dcw @Z@ 2550kb0 DCW @ 0@ 2553kp001 dcw &001 2554kb1a DCW #1 2590error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2599const2 DCW @CONST TWO@ 2600sub2 S 2601gmwm DCW @}@ ex beginn END
JOB Fortran compiler -- Constants Phase Two -- 18 CTL 6611 * * Same as Variables Phase Two. The table of simple variables * is destroyed * x1 equ 89 x2 equ 94 x3 equ 99 * * On entry, 83 is the top of code and x2 is one below the * bottom of code, at the top of memory. * botadr equ 2599 Bottom of working core * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits & 2 for exp loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 838 840topcod DCW #3 top of code & x00 - 1 845diff DCW #5 top of core - topcod as five digits 848bndry DCW #3 * * Clear from the bottom of code down to botadr & 1 * 849beginn MCW x2,x3 856 SW gm 860clrl CS 0&X3 864 SBR x3 868 C x3,botclr 875 BU clrl * * Move code back down to botadr-2 * 880 SBR x1,botadr Why not 887 MN 0&X1 just 891 SAR x1 SAR X1,botadr-1? 895move MCM 0&X2 899 SAR sx2&6 903 MCM 0&X2,1&X1 910 MN 911 SBR x1 915sx2 SBR x2,0-0 922 BCE move,0&X1,| Do not set WM under RM 930 MN 0&X2 934 CW 935 SW 0&X1 under GM 939 C x2,topcor 946 BU move 951 CW 0&X2 955 CW 956 SBR topcod,1&X1 topcod is 963 MN k99,topcod now top of 970 MN code & x00 - 1 * * Clear from top of core down to topcod & 1 * 971 MCW 83,x3 978clrl2 CS 0&X3 982 SBR x3 986 C x3,topcod 993 BU clrl2 998 MCW kless,0&X3 1005 MCW 83,toconv 1012 B conv 1016 MCW conv5,diff 1023 MCW topcod,toconv 1030 B conv 1034 S conv5,diff 1041 A diff-1,w6 1048 A w6 1052 A diff-1,w6 1059 A conv5,w6 diff * 1.3 * * Convert diff * 1.3 to machine address * 1066 MCW w6-3,x3 1073 A x3 1077 MZ zones&X3,w6-2 1084 MZ zones&1&X3,w6 1091 MCW w6,x3 * 1098 SW 2&X3 1102 MCW kless 1106 SBR bndry 1110 MCW x1,x2 1117 MN 0&X2 1121 SAR x1 1125 MCW 83,x3 1132 LCA gm,1&X3 1139 CS 299 1143 MCW mantis,x3 1150 MCW kz1 and a zero 1154 SW 200 1158 MCW 83,*&7 1165 LCA 199&X3,0 space for a FP number 1172 SBR 83 1176 SBR spint&6 1180 MN imod,x3 1187 MN 1188spint LCA 199&X3,0 space for an integer 1195 SBR x3 1199 SBR 142 1203 LCA k1,0&X3 1210 SBR 157 1214 LCA k15100 1218 SBR 83 * * Done * 1222 BSS snapsh,C 1227 SBR tpread&6,beginn 1234 SBR clrbot 1238 SBR clearl&3,gmwm 1245 LCA const3,phasid 1252 B loadnx * * Convert toconv from machine address format to five-digit * format in conv5 * 1256conv SBR convx&3 1260 MN toconv,conv5 1267 MN 1268 MN 1269 MCW 1270 MZ toconv,k99 1277 MZ toconv-2,k99-1 1284 NOP k99-1 1288 SAR x3 1292convl C 4&X3,k99 1299 SAR x3 1303 A kp1,conv5-3 1310 BU convl 1315 MZ kb1,conv5-3 1322convx B 0 * * Data * 1330toconv DCW @0J @ 1332k99 DCW 99 1333gm dc @}@ zones equ *&1 1365 dc @99Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 1368botclr DSA botadr Clear down to here 1369kless DCW @<@ 1374conv5 DCW #5 1380w6 DCW #6 1381kz1 DCW 0 1382k1 dcw @1@ 1385k15100 DSA 15100 1394const3 DCW @CONST TRI@ 1395kp1 dcw &1 1396kb1 DCW #1 1397gmwm DCW @}@ ex beginn END
- Phase 19 - Constants II. All free storage is again cleared and partitioned into two table areas- Tables I and II. Parameters needed for the randomizer of Phase 20 are computed.
JOB Fortran compiler -- Constants Phase Two -- 18 CTL 6611 * * Same as Variables Phase Two. The table of simple variables * is destroyed * x1 equ 89 x2 equ 94 x3 equ 99 * * On entry, 83 is the top of code and x2 is one below the * bottom of code, at the top of memory. * botadr equ 2599 Bottom of working core * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits & 2 for exp loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 838 840topcod DCW #3 top of code & x00 - 1 845diff DCW #5 top of core - topcod as five digits 848bndry DCW #3 * * Clear from the bottom of code down to botadr & 1 * 849beginn MCW x2,x3 856 SW gm 860clrl CS 0&X3 864 SBR x3 868 C x3,botclr 875 BU clrl * * Move code back down to botadr-2 * 880 SBR x1,botadr Why not 887 MN 0&X1 just 891 SAR x1 SAR X1,botadr-1? 895move MCM 0&X2 899 SAR sx2&6 903 MCM 0&X2,1&X1 910 MN 911 SBR x1 915sx2 SBR x2,0-0 922 BCE move,0&X1,| Do not set WM under RM 930 MN 0&X2 934 CW 935 SW 0&X1 under GM 939 C x2,topcor 946 BU move 951 CW 0&X2 955 CW 956 SBR topcod,1&X1 topcod is 963 MN k99,topcod now top of 970 MN code & x00 - 1 * * Clear from top of core down to topcod & 1 * 971 MCW 83,x3 978clrl2 CS 0&X3 982 SBR x3 986 C x3,topcod 993 BU clrl2 998 MCW kless,0&X3 1005 MCW 83,toconv 1012 B conv 1016 MCW conv5,diff 1023 MCW topcod,toconv 1030 B conv 1034 S conv5,diff 1041 A diff-1,w6 1048 A w6 1052 A diff-1,w6 1059 A conv5,w6 diff * 1.3 * * Convert diff * 1.3 to machine address * 1066 MCW w6-3,x3 1073 A x3 1077 MZ zones&X3,w6-2 1084 MZ zones&1&X3,w6 1091 MCW w6,x3 * 1098 SW 2&X3 1102 MCW kless 1106 SBR bndry 1110 MCW x1,x2 1117 MN 0&X2 1121 SAR x1 1125 MCW 83,x3 1132 LCA gm,1&X3 1139 CS 299 1143 MCW mantis,x3 1150 MCW kz1 and a zero 1154 SW 200 1158 MCW 83,*&7 1165 LCA 199&X3,0 space for a FP number 1172 SBR 83 1176 SBR spint&6 1180 MN imod,x3 1187 MN 1188spint LCA 199&X3,0 space for an integer 1195 SBR x3 1199 SBR 142 1203 LCA k1,0&X3 1210 SBR 157 1214 LCA k15100 1218 SBR 83 * * Done * 1222 BSS snapsh,C 1227 SBR tpread&6,beginn 1234 SBR clrbot 1238 SBR clearl&3,gmwm 1245 LCA const3,phasid 1252 B loadnx * * Convert toconv from machine address format to five-digit * format in conv5 * 1256conv SBR convx&3 1260 MN toconv,conv5 1267 MN 1268 MN 1269 MCW 1270 MZ toconv,k99 1277 MZ toconv-2,k99-1 1284 NOP k99-1 1288 SAR x3 1292convl C 4&X3,k99 1299 SAR x3 1303 A kp1,conv5-3 1310 BU convl 1315 MZ kb1,conv5-3 1322convx B 0 * * Data * 1330toconv DCW @0J @ 1332k99 DCW 99 1333gm dc @}@ zones equ *&1 1365 dc @99Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 1368botclr DSA botadr Clear down to here 1369kless DCW @<@ 1374conv5 DCW #5 1380w6 DCW #6 1381kz1 DCW 0 1382k1 dcw @1@ 1385k15100 DSA 15100 1394const3 DCW @CONST TRI@ 1395kp1 dcw &1 1396kb1 DCW #1 1397gmwm DCW @}@ ex beginn END
- Phase 20 - Constants III. The entire source program is scanned for normalized constants (tagged by Phase 18). By means of a randomizer (as in Phase 16), each normalized constant is stored uniquely and sequentially (next to one another) in Table II. Once stored, these constants are at their object-time address and are not disturbed for the remainder of the compilation. The object-time address replaces the normalized constant directly in the text of the source program.
JOB Fortran compiler -- Constants Phase Three -- 20 CTL 6611 * * Constants are placed in their object-time locations at the * lower end of storage. The object-time addresses replace * the constants wherever they appear. * * On entry, x1 and topcod are the top of the prefix of the top * statement, and 81-83 is the next available place in the * number table. * * On exit, x1 is the top of the prefix of the top statement * and 81-83 is the bottom of the number table. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps negar2 equ 142 Looks like negary -- see phase 20 negar3 equ 157 Looks like negary -- see phase 20 arysiz equ 160 Total array size & 2 negary equ 163 16000 - arysiz arytop equ 194 Top of arrays in object code snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 Read (1) instruction if running from cards tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader topcod equ 840 top of code & x00 - 1 diff equ 845 top of core - topcod as five digits bndry equ 848 * ORG 849 * * Convert topcor to decimal * 849beginn S w2h 853 S w2l 857 MZ topcor,w2h-1 864 MZ topcor-2,w2l-1 871 BWZ *&12,w2l-1,2 879 A ka0,w2l 886 B *-18 890 BWZ *&12,w2h-1,2 898 A kq4,w2h 905 B *-18 909 A w2l-1,w2h 916 MCW topcor,aryszw 923 MCW w2h 927 ZA aryszw 931 MZ *-4,aryszw 938 MCW x2,sx2 945 S w2h2 949 S w2l2 * * Convert arytop to decimal * 953 MZ arytop,w2h2-1 960 MZ arytop-2,w2l2-1 967 BWZ *&12,w2l2-1,2 975 A ka0,w2l2 982 B *-18 986 BWZ *&12,w2h2-1,2 994 A kq4,w2h2 1001 B *-18 1005 A w2l2-1,w2h2 1012 MCW arytop,w5 1019 MCW w2h2 1023 ZA w5 1027 MZ *-4,w5 * * Convert w5-aryszw, whiich is array sizes & 2, to machine * address * 1034 S w5,aryszw 1041 C kp0,aryszw 1048 BE noarys 1053 MN aryszw,arysiz 1060 MN 1061 MN 1062 SAR *&4 1066 MCW 0,x2 why not just MCW ARYSZW-3,X2 ? 1073 MCW k0 1077 A x2 1081 MZ zones&X2,arysiz 1088 CW 1089 SBR *&7 1093 MZ zones-1&X2,0 why not MZ ZONES-1&X2,ARYSIZ-2 ? 1100 MCW k16k,w5b 1107 S aryszw,w5b 1114 MN w5b,negary 1121 MN 1122 MN 1123 SAR *&4 1127 MCW 0,x2 why not MCW w5b-3,x2 ? 1134 MCW k0 1138 A x2 1142 MZ zones&X2,negary 1149 CW 1150 SBR *&7 1154 MZ zones-1&X2,0 why not MZ ZONES-1&X2,negary-2 ? 1161noarys MCW sx2,x2 1168 MA negary,negar2 1175 MA negary,negar3 1182 MCW topcod,savtop&3 1189 MZ s,savtop&2 X2 zone 1196 MCW x2,sx2b 1203 MCW kb1,2599 1210loop BCE bottom,0&X1, 1218 MCW 0&X1,seqcod 1225 LCA 0&X1,prefix 1232 SAR x1 1236 SBR x3 1240 LCA prefix,0&X2 1247 SBR x2 1251 BCE endstm,seqcod-3,/ End statement? 1259schund BCE gotun6,0&X1,_ 1267 chain5 1272 BCE endstm,0&X1,} 1280 chain5 1285 SBR x1 1289 B schund * * Got X1 to within six of underscore. Get to it exactly. * 1293gotun6 BCE gotund,0&X1,_ 1301 SBR x1 1305 B gotun6 * * Got X1 to the underscore above a number * 1309gotund SW 1&X1 1313 CW 1314 CW 1315 CW 1316 SAR x1 1320 BCE gotgm,4&X1,} Can this happen? 1328 LCA 0&X3,0&X2 Move up everything above number. 1335 SBR x2 1339 CW 1&X2 1343gotgm SBR x3,2&X1 * * Get X1 down to a punctuation mark below the number * 1350schpun MCW 0&X1,w1 1357 SAR x1 1361 MCW w1,*&8 1368 BCE gotpun,punct,0 1376 chain8 1384 B schpun 1388gotpun SW 2&X1 at the bottom of the number 1392 ZA 0&X3,hash 1399 A 4&X1,hash 1406 BCE blank,2&X1, 1414bback MZ kb4,hash 1421 MZ 1422 MZ 1423 MCW 1424 S diff-1,hash Compute 1431 BWZ *-14,hash,B mod 1439 A diff-1,hash (diff-1,hash) 1446 MZ kb1,hash 1453 MCW x2,sx2c 1460 MCW 1461 MCW hash,x1 1468 A x1 1472 A hash,x1 1479savtop NOP 0 1483 SAR x1 1487 MCW nop,bothsh 1494hloop BCE notfnd,0&X1, Not found if hash entry blank 1502 BCE bothsh,0&X1,< 1510 MCW 0&X1,x2 1517 SAR x1 1521 C 0&X3,0&X2 1528 BU hloop 1533 C 0&X2,0&X3 1540 BU hloop * * Found in the hash table * 1545found MCW x2,sx2d 1552 MCW sx2d,sx2e 1559 MA negary,sx2d 1566 MCW sx2c,x2 1573 MCW 1574 LCA sx2d,0&X2 1581 SBR x2 1585 CW 1&X2 1589 MCW sx2e,*&7 1596 BWZ fpnum,0-0,2 1604 MZ kb1,2&X2 Set integer zone 1611numfin SBR x1,1&X1 1618 SBR x3 1622 B schund * * Not found, enter it * 1626notfnd MCW 83,x2 1633 MCW 83,0&X1 1640 MCW 0&X3,0&X2 1647 SBR x1 1651 SBR 83 1655 BCE toobig,0&X1,< 1663 SW 1&X1 1667 B found * * Bottom of hash table * 1671bothsh NOP toobig 1675 MCW s,bothsh Should this be B instead of S? 1682 MCW bndry,x1 1689 B hloop * * Found floating-point number * 1693fpnum MZ *-6,2&X2 set floating point zone 1700 B numfin * * A blank in the number * 1704blank SW 3&X1 1708 B bback * * Too big * 1712toobig CS 332 1716 CS 1717 CC 1 1719 MCW error2,270 1726 W 1727 CC 1 1729 BCE halt,cdovly,1 1737 RWD 1 1742halt H halt * * Got to within six of a GM without seeing underscore. * Move the remainder of the statement up. * 1746endstm LCA 0&X3,0&X2 1753 SAR x3 1757 C 0&X2 1761 SAR x2 1765 MCW x3,x1 1772 B loop * * reached the bottom of statements * 1776bottom MCW sx2b,x1 1783 CS 332 1787 CS 1788 MCW consts,223 * * Convert 81-83 to decimal * 1795 S w2h3 1799 S w2l3 1803 MZ 83,w2h3-1 1810 MZ 81,w2l3-1 1817 BWZ *&12,w2l3-1,2 1825 A ka0,w2l3 1832 B *-18 1836 BWZ *&12,w2h3-1,2 1844 A kq4,w2h3 1851 B *-18 1855 A w2l3-1,w2h3 1862 MCW 83,w5c 1869 MCW w2h3 1873 ZA w5c 1877 MZ *-4,w5c 1884 S aryszw,w5c 1891 MZ kb1,w5c 1898 A kp1,w5c 1905 MCW 83,x3 1912 MA negary,x3 1919 SBR x3,1&X3 1926 MCW arytop,247 1933 MCW hyphen 1937 MCW x3 1941 MCW kb3 1945 MCW w5 1949 MCW to 1953 MCW w5c 1957 CC J 1959 W 1960 CC J 1962 BCV *&5 1967 B *&3 1971 CC 1 * * Load next overlay * 1973 BSS snapsh,D 1978 SBR tpread&6,838 1985 SBR clrbot 1989 SBR loadxx&3,838 1996 SBR clearl&3,2598 2003 LCA subscr,phasid 2010 B loadnx * * Data * 2015 DCW @ 9@ zones equ *&1 2046 DCW @9Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 2048w2h DCW #2 High-order zones from topcor 2050w2l DCW #2 Low-order zones from topcor 2052ka0 DCW @A0@ Used to convert machine address to decimal 2054kq4 DCW @?4@ Used to convert machine address to decimal 2057sx2 DCW #3 2059w2h2 DCW #2 2061w2l2 DCW #2 2066w5 DCW #5 2071aryszw DCW #5 array size & 2 2076kp0 DCW @0000?@ 2077k0 DCW @0@ 2082k16k DCW @16000@ 2087w5b DCW #5 2088s dcw @S@ 2091sx2b DCW #3 2092kb1 DCW #1 2096seqcod DCW #4 Statement code and sequence number 2106prefix DCW #10 Entire statement prefix 2107w1 DCW #1 2116punct DCW @#}@*-&)$,@ 2120hash DCW #4 2124kb4 DCW #4 2132sx2c DCW #8 2133nop NOP 2136sx2d DCW #3 2139sx2e DCW #3 2175error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2198consts DCW @CONSTANTS LOCATED FROM @ 2200w2h3 DCW #2 2202w2l3 DCW #2 2203kp1 dcw &1 2208w5c DCW #5 2209hyphen DCW @-@ 2212kb3 DCW #3 2216to DCW @ TO @ 2222subscr DCW @SUBSCR@ 2223gmwm DCW @}@ ex beginn END
- Phase 21 - Subscripts. Under the action of Phases 14 through 20, the canonical form for subscripted variables (see Phase 13) now specifies a computation in terms of object-time addresses. This phase simplifies the computation, leaving only the object-time addresses which serve as parameters for a closed subroutine at object time.
JOB Fortran compiler -- Subscripts Phase -- 21 CTL 6611 * * Subscripts which must be computed at object time are reduced * to the required parameters. * * On entry, x1 is the top of the prefix of the top statement * and x2 is one below the bottom statement. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838beginn CS 0&X2 clear below bottom statement 842 CS 843 SBR x2,1&X1 850 SBR sx1 854loop BCE done,0&X1, below bottom statement 862 MCW 0&X1,seqcod 869 B moveup 873 BCE endst1,seqcod-3,/ End statement? 881 BCE endst1,seqcod-3,F Format statement? 889schsub BCE sub6,0&X1,$ 897 chain5 902 BW endstm,0&X1 910 chain5 915 SBR x1 919 B schsub * * Got x1 to within six of a $, which indicates subscripting. * Get to it exactly. * 923sub6 BCE gotsub,0&X1,$ 931 SBR x1 935 B sub6 939gotsub SW 0&X1 943 B move2 947 MN 0&X1 951 SAR x1 955 B x1dec4 959morsub SW 2&X1 963 B move2 967 B x1dec4 971 BWZ intsub,3&X1,S A zone? 979 BM intsub,3&X1 B zone? * * No zone or AB zone means floating point subscript * 987 CS 332 991 CS 992 SW 184 Global (?) error flag 996 MN seqcod,250 1003 MN 1004 MN 1005 MCW err12 1009 W 1010 BCV *&5 1015 B intsub 1019 CC 1 1021intsub SW 2&X1 1025 B move2 1029 B x1dec4 1033 C 1&X1,kdol 1040 BU morsub 1045 SW 1&X1 1049 B move2 1053 MCW x1,x3 1060 B schsub * * Move up prefix or tail of statement * 1064moveup SBR movex&3 1068 LCA 0&X1,0&X2 1075 SAR x1 1079 C 0&X2 1083 SAR x2 1087 MCW x1,x3 1094movex B 0-0 * * Copy x1 to x3, then decrement x1 by 4 * 1098x1dec4 SBR x1decx&3 1102 MCW x1,x3 1109 MN 0&X1 1113 MN 1114 MN 1115 MN 1116 SBR x1 1120x1decx B 0-0 * * End of a statement * 1124endstm MCW x3,x1 1131endst1 B moveup Move up tail of statement 1135 B loop * * Done * 1139done MCW sx1,x1 1146 BSS snapsh,C 1151 SBR clearl&3,gmwm 1158 LCA stnum1,phasid 1165 B loadnx * * Move up a chunk of the statement * 1169move2 SBR move2x&3 1173 LCA 0&X3,0&X2 1180 SBR x2 1184 CW 1&X2 1188move2x B 0-0 * * Data * 1194sx1 DCW #3 1198seqcod DCW #4 1245err12 DCW @ERROR 12 - FLOATING POINT SUBSCRIPT, STATEMENT @ 1246kdol DCW @$@ 1255stnum1 DCW @STNUM ONE@ 1256gmwm DCW @}@ ex beginn END
- Phase 22 - Statement Numbers I. Statement numbers that appear in the source program are reduced to a 3-character representation. Statement numbers within the body of a statement are moved to the front of the statement.
JOB Fortran compiler -- Statement Numbers Phase -- 22 CTL 6611 * * All statement numbers that appear in the program are reduced * to a unique three-character representation. Statement numbers * within the statement are moved to the beginning of each source- * program statement (rightmost end of statement in storage) that * contains those elements. * * On entry, x1 is the top of the prefix of the top statement, * x2 is one below the bottom statement, and 81-83 is one below * the bottom of the number table. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader loadxx equ 793 Exit from overlay loader * ORG 838 838beginn CS 0&X2 Clear below bottom of statements 842 MCW 83,x2 Below number table 849 SW gm 853 LCA gm,0&X2 860 SBR x2 864loop BCE done,0&X1, 872 LCA 0&X1,prefix 879 SAR x1 883 CW 1&X1 887 SW prefix-3 891 LCA prefix,0&X2 Move up only seq number and code 898 SBR x2 902 CW 1&X2 906 BWZ lbldef,prefix-4,2 914nolabl LCA gm,0&X2 921 SBR x2 925 MCW prefix-3,*&8 932 BCE lblref,stmts,0 Does statement have label refs? 940 chain10 950 BCE endstm,prefix-3,/ 958moveup LCA 0&X1,0&X2 Move (rest of) statement up 965 SAR x1 969 C 0&X2 973 SAR x2 977 B loop * * END statement * 981endstm C 0&X1 985 SAR x1 989 MCM 4&X2 993 MN 994 MN 995 SAR x2 999 B loop * * Got a statement label definition * 1003lbldef LCA prefix-4,label 1010 SBR x3 1014 SW 2&X3 1018 B conv50 1022 B nolabl * * Statement is one that contains label references * 1026lblref BCE if,prefix-3,E IF statement 1034 BCE do,prefix-3,D DO statement 1042 BCE tape,prefix-3,5 READ INPUT TAPE statement 1050 BCE tape,prefix-3,6 WRITE OUTPUT TAPE statement 1058 BCE cgo,prefix-3,T Computed GO TO statement 1066 BCE ifss,prefix-3,W IF ( SENSE SWITCH ... ) 1074 BCE ifss,prefix-3,K IF ( SENSE LIGHT ... ) 1082 B savlab PUNCH, PRINT, READ, GOTO 1086 B moveup * * Computed GO TO statement * 1090cgo B savlab 1094 BCE cgofin,0&X1,) 1102 BCE syntax,0&X1,} 1110 SBR x1 1114 B cgo 1118cgofin MN 0&X1 1122 SAR x1 1126 B moveup * * READ INPUT TAPE or WRITE OUTPUT TAPE statement * 1130tape MCW x1,stmfin&3 1137getcom BCE gotcom,0&X1,, get 1145 BCE syntax,0&X1,} down 1153 SBR x1 to 1157 B getcom comma 1161gotcom SW 1&X1 1165 MN 1166 SAR x1 1170 B savlab * 1174stmfin LCA 0,0&X2 1181 SBR x2 1185 CW 1&X2 1189 B moveup * * IF ( SENSE SWITCH ... ) or IF ( SENSE LIGHT ... ) statement * 1193ifss MCW x1,stmfin&3 1200getrp BCE gotrp,0&X1,) get 1208 BCE syntax,0&X1,} down 1216 SBR x1 to right 1220 B getrp parenthesis 1224gotrp SW 1&X1 1228 MN 1229 SAR x1 1233 B savlab 1237 MN 0&X1 1241 SAR x1 1245 BCE syntax,0&X1,} 1253 B savlab 1257setcom LCA comma,0&X2 1264 SBR x2 1268 CW 1&X2 1272 B stmfin * * DO statement * 1276do MCW x1,x3 1283geteq BCE goteq,0&X3,# Find the 1291 SBR x3 equal sign 1295 B geteq 1299goteq MCW 3&X3,ch2 1306 MCW comma,3&X3 1313 SBR w3,3&X3 1320 B savlab 1324 C w3,x1 1331 BU syntax 1336 MCW ch2,0&X1 1343 LCA comma,0&X2 1350 SBR x2 1354 CW 1&X2 1358 B moveup * * IF statement * 1362if MCW x1,stmfin&3 1369ifloop BCE ifrp,0&X1,) get down to right parenthesis 1377 BCE syntax,0&X1,} 1385 SBR x1 1389 B ifloop 1393ifrp MN 0&X1 1397 SAR x1 1401 BWZ *&5,0&X1,2 followed by a digit 1409 B ifloop 1413 BCE ifloop,0&X1,@ 1421 SW 1&X1 1425 B savlab 1429 BCE syntx2,0&X1,} v3m4 1437 MN 0&X1 v3m4 1441 SAR x1 v3m4 1445 B savlab 1449 BCE syntx2,0&X1,} v3m4 1457 MN 0&X1 v3m4 1461 SAR x1 v3m4 1465 B savlab 1469 B setcom * * Move the label to the label work area * 1473savlab SBR savlbx&3 1477 MCW x1,labmov&3 1484 BWZ *&5,0&X1,2 1492 B syntx2 1496savll MN 0&X1 1500 SAR x1 1504 BWZ savll,0&X1,2 1512 BCE endlab,0&X1,, 1520 BCE endlab,0&X1,} 1528 BCE endlab,0&X1,) 1536 B syntx2 1540endlab b 2059 v3m4 1544labmov LCA 0,label 1551 CW 1&X1 1555 B conv50 1559savlbx B 0 * * Convert labels to base 50 * 1563conv50 SBR conv5x&3 1567 LCA kz6,lblwrk 1574 C kz6,label 1581 BU *&5 1586 B zlab label is zero 1590 SBR x3,label&1 1597ztrim MN 0&X3 trim 1601 SAR x3 leading zeros 1605 BCE ztrim,0&X3,0 from label 1613 MCW 0&X3,lblwrk nonzero digits of label 1620 MCW k1 and 1 1624zlab SW lblwrk-1 1628 CW 1629 SW 1630 CW 1631 SW 1632 S k5050,lblwrk 1639 S 1640 BM *&8,lblwrk 1648 A k1,lblwrk-5 1655 BM *&8,lblwrk-2 1663 A k2,lblwrk-5 1670 MZ x1tags,lblwrk 1677 chain5 1682 MCW x1,sx1 1689 MCW achars,x1 1696 MCW alblwk,x3 1703conv5l MCW 0&X3,*&8 1710 SAR x3 1714 MCW 0-0,ch 1721 LCA ch,0&X2 1728 SBR x2 1732 CW 1&X2 1736 BWZ conv5l,0&X3,2 1744 MCW sx1,x1 1751conv5x B 0 * * Statement number syntax error * 1755syntax CS 332 1759 CS 1760 SW glober 1764 MN prefix,249 1771 MN 1772 MN 1773 MCW err13 1777 W 1778 BCV *&5 1783 B *&3 1787 CC 1 1789 BW more,flag 1797 B getup 1801syntx2 SW flag 1805 B syntax 1809more MCM 1&X2 1813 MN 1814 SAR x2 1818 BCE more,0&X2,| 1826 CW flag 1830getup MCM 4&X2 Move x2 up to gmwm 1834 MN 1835 MN 1836 SAR x2 1840 C 0&X1 get x1 down to wm 1844 SAR x1 1848 B loop * * Reached bottom of statements * 1852done BSS snapsh,C 1857 SBR loadxx&3,980 1864 SBR clearl&3,1599 1871 LCA formt1,phasid 1878 B loadnx * * Done * 1882 DCW #1 1883gm dc @}@ 1884dot dc @.@ 1890lblwrk DCW #6 1891ch DCW #1 1894sx1 DCW #3 1895flag dc #1 chars equ *&1 1941 dc @.")&$*-%#@?ABCDEFGHI!JKLMNOPQR_/STUVWXYZ012345@ 1946 DC @6789.@ 1952kz6 DCW @000000@ 1962prefix DCW #10 1973stmts DCW @WT65UPLDEGK@ Codes for statements having labels 1979label DCW #6 1980comma dcw @,@ 1981ch2 DCW #1 1984w3 DCW #3 1985k1 dcw 1 1989k5050 dcw 5050 1990k2 dcw 2 1996x1tags DCW @Z Z Z @ 1999achars DSA chars 2002alblwk DSA lblwrk 2048err13 DCW @ERROR 13 - STATEMENT NUMBER SYNTAX, STATEMENT @ 2058formt1 DCW @TAMROF ONE@ * * Patch in v3m4 * 2059 SW 1&X1 v3m4 2063 SW movtst&1 v3m4 2067 MCW labmov&3,movtst&3 v3m4 2074 CW movtst&1 v3m4 2078movtst MCW 0,test v3m4 2085 BCE labmov,test-5,: v3m4 2093 MCW *-7,test-5 v3m4 2100 B syntx2 v3m4 2109test DCW @: @ v3m4 2110 DCW @}@ v3m4 ex beginn END
- Phase 23 - Format I. FORMAT statements are checked to ensure that they are referenced by input/output statements.
JOB Fortran compiler -- TAMROF Phase One -- 23 CTL 6611 * * FORMAT statements are checked to insure that they are * referenced by input-output statements * * On entry, 81-83 is one below the number table, which is the * GMWM above the top statement in high core, x1 is the * GMWM below the bottom statement in low core, x2 is one below * the GMWM below the bottom statement in high core * * On exit, X1 is the top of statements, x2 is the top of * formatted I/O statements, and 81-83 is one below the number * table * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 838 * * The toobig and msg routines are not referenced here. Why are * not simply in phase 24? * 838toobig CS 332 842 CS 843 CC 1 845 MCW error2,270 852 W 853 CC 1 855 BCE halt,cdovly,1 863 RWD 1 868halt H halt * 872semic DCW @;@ 875sx3 DCW #3 used to save X3 exactly once 879seqcod DCW #4 * * Fill in error message boilerplate * 880msg SBR msgx&3 884 BCV *&5 889 B *&3 893 CC 1 895 CS 332 899 CS 900 SW glober 904 MN seqcod,250 911 MN 912 MN 913 MCW stmt 917 MCW err,205 924msgx B 0 963error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 974stmt DCW @STATEMENT @ 979err DCW @ERROR@ * 980beginn CS 1&X2 984 SBR x1 988 SW gmwm 992clrl CS 0&X1 996 SBR x1 1000 C x1,kbot 1007 BU clrl 1012 LCA gmwm,2601 1019 SBR x1,2602 1026 SBR x2,2&X2 1033 MCW dot,96 No format statement seen 1040 SW flag 1044loop MCW 83,x3 top of statements in top core 1051 SBR x3,1&X3 1058 C x3,x2 moved top statement up? 1065 BE done yes 1070 CW flag2 moving body 1074 MN 0&X2 1078 SAR x3 1082 MCW semic 1086movedn MN 0&X1 1090 SAR x1 1094more MCM 0&X2 1098 SAR sx2&6 1102 MCM 0&X2,1&X1 1109 MN 1110 SBR x1 1114sx2 SBR x2,0 1121 BCE more,0&X1,| 1129 MN 0&X2 1133 CW 1134 SW 0&X1 1138 SBR x1,1&X1 1145 BW prefix,flag2 processing prefix? 1153 SW flag2 moving prefix 1157 B movedn 1161prefix MN 0&X1 1165 MN 1166 SAR x3 1170 SBR setzon&6 1174 MCW 0&X3,seqcod 1181 SAR x3 1185 BCE format,seqcod-3,F Format statement? 1193 MCW seqcod-3,*&8 1200 BCE fmtio,stmts,X Formatted I/O statement? 1208 chain4 1212 B loop * * Got to bottom of statements * 1216done MN 0&X1 1220 MN 1221 SAR x1 top of statements 1225 MCW sx1,x2 top of top formatted I/O statement 1232 MCW 83,x3 one below number table 1239 MCW kb1,0&X3 clear statements 1246 MCW 0&X3 recently moved down 1250 MCW semic,0&X3 below number table 1257 BSS snapsh,C 1262 SBR tpread&6,980 1269 SBR clrbot 1273 SBR clearl&3,2600 1280 LCA fmt2,phasid 1287 B loadnx * * Found formatted I/O statement * 1291fmtio MZ abzone,3&X3 bottom of sequence number 1298 CW flag 1302 MN 0&X1 1306 MN 1307 SAR sx1 top of sequence number 1311 B loop * * Found a format statement * 1315format MCW kb1,96 Saw a format statement 1322 BW unref,flag no formatted I/O seen 1330 BCE unref,0&X3,} can't be referenced with no label 1338 MCW 0&X3,fmtlab 1345 MCW sx1,x3 seq no of top formatted I/O statement 1352chkref BWZ chklab,0&X3,B 1360 BWZ 1361unref CS 332 1365 CS 1366 MN seqcod,245 1373 MN 1374 MN 1375 MCW err14 unreferenced 1379 W 1380 BCV *&5 1385 B *&3 1389 CC 1 1391setzon MZ abzone,0-0 low-order digit of sequence number 1398 B loop * * Check whether format label appears in formatted I/O * statement. The formatted I/O statements are all below * (processed before in this phase) the format statements. * 1402chklab C 0&X3 skip 1406 SAR x3 prefix 1410 C 0&X3,fmtlab label in stmt same as the format? 1417 BE loop yes, go do next statement 1422 C 0&X3 skip 1426 SAR x3 body 1430 B chkref * 1436kbot DSA bot bottom of core clearing 1437dot dcw @.@ 1438flag DCW #1 initially set, cleared when formatted I/O seen 1439flag2 DCW #1 set for prefix, cleared for body 1444stmts DCW @56ULP@ Formatted I/O statements codes 1445kb1 DCW #1 1453fmt2 DCW @TAMROF 2@ 1454abzone dcw @A@ 1457sx1 DCW #3 top of sequence number of top formatted I/O 1460fmtlab DCW #3 label from format statement 1502err14 DCW @ERROR 14 - UNREFERENCED FORMAT, STATEMENT @ 1503gmwm DCW @}@ org *&x00 bot equ * ex beginn END
- Phase 24 - Format II. The object-time format strings are developed and stored immediately preceding the constants at the lower end of storage.
JOB Fortran compiler -- TAMROF Phase Two -- 24 CTL 6611 * * The object-time format strings are developed and stored * immediately preceding the constants at the lower (rightmost) * end of storage. * * On entry, x1 is the top of statements, x2 is the top of * formatted I/O statements, and 81-83 is one below the number * table. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps arysiz equ 160 Total array size & 2 negary equ 163 16000 - arysiz snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader toobig equ 838 Too big routine semic equ 872 A semicolon sx3 equ 875 Save area for X3 -- used exactly once? seqcod equ 879 Statement code, sequence number msg equ 880 Error message routine * ORG 980 980beginn BCE done,96,. No format statements 988 MCW x2,sx2&6 995next SBR x2,2&X1 1002 LCA kb1 1006 MCW 0&X1,seqcod 1013 BCE format,seqcod-3,F * * Format statements are sorted together, so if we do not * see one here, there are no more. * 1021done BSS snapsh,C 1026 SBR tpread&6,838 1033 SBR clrbot 1037 SBR loadxx&3,845 1044 SBR clearl&3,gmwm 1051 LCA listr1,phasid 1058 B loadnx * * Format statement * 1062format C 0&X1 get down to body 1066 SAR x1 1070 SBR sx1&6 1074 MCW 4&X1,fmtlab 1081 SW flag1 1085 CW flag2 1089 ZA kp1,w3 1096 BCE syntax,0&X1,) 1104 MCW x2,sx2b 1111 B cont 1115sx1 SBR x1,0 1122loop ZA kp1,w3 1129codeok BCE rpar,0&X1,) 1137 SBR sx1&6 1141 BCE lpar,0&X1,% 1149 BCE ifea,0&X1,I 1157 BCE ifea,0&X1,F 1165 BCE ifea,0&X1,E 1173 BCE ifea,0&X1,A 1181 BCE sign,0&X1,& 1189 BCE sign,0&X1,- 1197 BCE slash,0&X1,@ 1205 C 0&X1,kz 1212 BL number 1217 BL chkcod 1222 BW syntax,flag1 not preceded by a number? 1230 BCE holrit,0&X1,H Number, the Hollerith 1238 SBR x1 1242 BCE xfld,1&X1,X 1250 BCE pfld,1&X1,P 1258syntax B msg 1262 MCW err15,223 1269wmsg W 1270 MZ abzone,seqcod 1277 B endfmt * * X format control. Emit SBR x3,number&x3 * 1281xfld SW 8&X2 1285 SBR x2 1289 LCA bumpx3 1293 MN w3,0&X2 1300 MN 1301 MN 1302 B endfld * * Hollerith * 1306holrit SW 5&X2 1310 CW 1311 SBR x2 1315 LCA doh&3,1&X2 emit call to do hollerith routine 1322 S kp1,w3 1329 BM syntax,w3 1337 MN 0&X1 1341 SAR x1 1345moveh MN 0&X1,2&X2 move 1352 SBR x2 characters 1356 MZ 0&X1,1&X2 of hollerith 1363 SAR x1 field while 1367 SBR sx1&6 reversing 1371 CW 2&X2 to correct 1375 S kp1,w3 order 1382 BCE shorth,0&X1,} 1390 BWZ moveh,w3,B 1398holfin SBR x2,1&X2 1405 B endfld * * Statement ends before hollerith ends * 1409shorth B msg 1413 MCW err45,231 1420 W holfin * * Plus or minus sign before number before P code * 1424sign MZ 0&X1,w3 Move sign to where the number will be 1431 SAR x1 1435 B number 1439 C x3,k20 1446 BL syntax scale factor too big? 1451 MN x3,w3 1458 MN 1459 C 0&X1,kp 1466 SAR sx1&6 1470 SBR x1 1474 BU syntax error if not P field 1479pfld SBR x2,7&X2 1486 LCA w3 emit scale factor 1490 LCA dop&3 emit call to P routine 1494 B endfld * * Left parenthesis * 1498lpar BW deep,flag2 1506 SW flag2 1510cont SW 8&X2 1514 SBR x2 1518 CW flag3 1522 LCA w3,0&X2 1529 LCA dolp&3 1533 SW flag1 1537 B sx1 * * Right parenthesis * 1541rpar MN 0&X1 1545 SAR sx1&6 1549 SBR *&7 1553 BCE sawgm,0,} 1561 BW rpok,flag2 seen a right parenthesis? 1569deep B msg 1573 MCW err16,228 1580 B wmsg * 1584rpok CW flag2 1588 SW 5&X2 1592 SBR x2 1596 LCA dorp&3 1600 MN 0&X1 1604 SAR x1 1608 B endfld * * Saw gm after right parenthesis * 1612sawgm CW 5&X2 1616 SBR x2 1620 LCA dogm&3 1624 BW deep,flag2 1632 B endfmt * * Slash field. Slash was converted to @ in phase 2 * 1636slash BW *&5,flag1 no number? 1644 B syntax error if number 1648 SW 5&X2 1652 SBR x2 1656 LCA doslsh&3 emit call to slash routine 1660 B sx1 * * I, F, E or A field * 1664ifea SW 5&X2 1668 LCA doifea&3 1672 LCA w3,8&X2 1679 MCW 0&X1 1683 SAR x1 1687 B number 1691 ZA x3,w3b 1698 SW ifeat&4 1702 BCE ffld,5&X2,F 1710 BCE iafld,5&X2,I 1718 BCE iafld,5&X2,A 1726 S kp4,w3b Ew.d field, subtract four from W for exp 1733ffld CW ifeat&4 Fw.d field 1737 C 0&X1,kdot 1744 SAR x1 1748 BU syntax number not followed by dot 1753 B number 1757 S x3,w3b subtract D from W 1764 BM etest,w3b v3m4 1772iafld BCE ffld2,5&X2,F I or A field 1780 A kp4,x3 1787ffld2 SBR x2,11&X2 1794 MZ *-4,w3b 1801 LCA w3b,0&X2 1808ifeat BCE tstwid,ifeat,C 1816 SBR x2,3&X2 1823 LCA x3 1827tstwid BM syntax,w3b * * end of field * 1835endfld SW flag1 set no number flag 1839skpcom C 0&X1,comma 1846 SAR sx1&6 1850 SBR x1 1854 BE skpcom skip commas 1859 SBR x1,1&X1 1866 B loop * * W gt D for F field, or W+4 gt D for E field * 1870wbig A x3,w3b 1877 A k4,w3b 1884 MN w3b,x3 1891 MN 1892 MN 1893 MCW kz3,w3b 1900 B ffld2 * * Probably a digit. Make sure. Then put into x3. * 1904number SBR numbrx&3 1908 S x3&1 clear x3 1912 C 0&X1,k0 1919 BH syntax 0 gt char, z lt char 1924numbrl MN 0&X1,x3 1931 SAR x1 1935 C 0&X1,k0 1942 BH nodig not a digit, must be done 1947 C x3,k133 is the number too big? 1954 BL syntax 1959 MN x3-1,x3-2 shift left to reverse 1966 MN x3,x3-1 digits to correct order 1973 B numbrl look for another digit 1977nodig C k134,x3 Is the number too big? 1984 BH syntax 1989 BE syntax 1994numbrx B 0 * * Check the format code following a number * 1998chkcod ZA x3,w3 save number 2005 SW test&7 2009 MCW 0&X1,test&7 2016 CW test&7,flag1 2023test BCE codeok,fmtcod,X 2031 chain7 2038 B syntax * 2042endfmt MCW 83,x3 2049 BWZ enderr,seqcod,B 2057 C 0&X3,semic semicolon below number table gone? 2064 BU toobig 2069endfm2 LCA 0&X2,0&X3 2076 SAR x2 2080 C 0&X3 2084 SAR x3 2088 CW 1&X2 2092 C x2,sx2b 2099 BU endfm2 2104 SBR sx3,0&X3 2111 CW 0&X2 2115 CW 2116 MCW 2117 SAR x2 2121 CW 1&X2 2125 BW ender2,flag3 2133 BCE ender2,*&6, was X2 originally blank? 2141sx2 SBR x2,0 2148 CW flag4 2152 SBR sx3b&6,1&X3 2159ender4 MN 0&X2 2163 MN 2164 MN 2165 SAR x3 2169 MN 0&X3,*&15 2176 MZ 0&X3,*&8 2183 BCE iostmt,iocode,X 2191 chain4 2195 BW ender5,flag4 2203 B msg 2207 MCW err17,232 2214 W 2215 B ender6 2219ender5 MCW sx3,x3 2226 BWZ ender6,seqcod,B 2234ender3 MCW x3,83 2241 MCW semic,0&X3 2248ender2 C 0&X1 2252 SAR x1 2256 B next * 2260enderr MCW x2,x3 2267 SW flag3 2271 B endfm2 2275ender6 MCW 83,x3 2282 LCA kdot,0&X3 2289 SBR x3 2293 B ender3 * 2297iostmt C 0&X3 2301 SAR x2 2305 BWZ *&5,2&X3,B 2313 B iostme 2317 C 0&X2,fmtlab 2324 BU iostme 2329 SW flag4 2333 MA negary,sx3b&6 2340sx3b SBR 0&X2,0 2347 MZ kb1,2&X3 2354 MA arysiz,sx3b&6 2361iostme C 0&X2 2365 SAR x2 2369 B ender4 * * Vectors to format conversion routines * 2373doh B 2328 do hollerith 2383bumpx3 DCW @H0990&0@ bumps x3, for X format 2384dolp B 2152 do left parenthesis 2388dorp B 2185 do right parenthesis 2392doslsh B 2208 do / -- newline 2396doifea B 2385 I, F, E or A field 2400dogm B 2223 do gm -- end of format 2404dop B 2310 do P -- scale factor * * Data * 2408kb1 DCW #1 2414listr1 DCW @LISTR1@ 2417fmtlab DCW #3 2418flag1 DCW #1 cleared when a number is processed 2419flag2 DCW #1 set when left parenthesis is processed 2420kp1 dcw &1 2423sx2b DCW #3 2426w3 DCW #3 2427kz dcw @Z@ 2445err15 DCW @15 - FORMAT SYNTAX@ 2446abzone dcw @A@ 2466err45 DCW @45 - HOLLERITH COUNT@ 2469k20 dcw 020 2470kp dcw @P@ 2492err16 DCW @16 - PARENTHESIS ERROR@ 2495w3b DCW #3 2496kp4 dcw &4 2497kdot dcw @.@ 2498comma dcw @,@ 2499k4 dcw 4 2502kz3 dcw 000 2503k0 DCW 0 2506k133 dcw 133 2509k134 dcw 134 2517fmtcod DCW @PAXHIFE%@ 2518flag4 DCW #1 2523iocode DCW @56ULP@ stmt code for formatted I/O stmt 2549err17 DCW @17 - DOUBLY DEFINED FORMAT@ 2550flag3 dcw #1 set if error * * Patch in v3m4 * 2551etest BCE wbig,5&X2,E v3m4 2559 BIN syntax, v3m4 ORG 2599 v3m4 2599gmwm DCW @}@ ex beginn END
- Phase 25 - Lists I. Duplicate lists are checked and eliminated to optimize storage at object time.
JOB Fortran compiler -- List Phase One -- phase 25 CTL 6611 * * Duplicate lists are checked and eliminated to optimize * storage at object time. * * On entry, x1 is the top of statements in low core, x3 is * one below the format strings or number table, and 81-83 * is one below the format strings or number table. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps botfmt equ 154 Bottom of format strings or number table - 1 negary equ 163 16000 - arysiz glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot fmtsw equ 696 X for no format, L for limited format * blank for ordinary, A for A conversion loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 838 841seqcod DCW #4 844sx1 DCW #3 845beginn MCW x1,sx1 852 MCW 83,x2 859 LCA dot,0&X2 866 CW 0&X2 870 SBR 83 874 SBR botfmt,0&X2 881 MA negary,botfmt 888loop BCE done,0&X1, Below bottom statement 896 MCW 0&X1,seqcod 903 MCW x1,sx1b&6 910 MCW seqcod-3,*&8 917 BCE iostmt,stmts,0 I/O statement? 925 chain6 931 B done I/O statements are sorted together * * Found an I/O statement * 935iostmt C 0&X1 get down 939 SAR x1 to body 943 B getcom Get x1 down to a comma 947 CW 114 951 BCE *&5,fmtsw,L Limited format routine? 959 CW 115 963 SW 0&X1 under the comma 967 SAR x1 971 MCW sx1,x3 top of statements 978twowm C 0&X3 Skip two 982 C word marks 983 SAR x3 987 BCE twowm,1&X3,} 995 C x1,x3 1002 BU chklst 1007stmbot C 0&X1 1011 SAR x1 1015 B loop 1019chklst C 0&X1,0&X3 1026 BU getgm lists are different 1031 C 0&X3,0&X1 1038 BU getgm lists are different 1043 BW syntax,0&X1 1051 BWZ 1052 BWZ 1053 LCA x3,0&X1 link identical lists together 1060 SBR x1 1064 B stmbot * * Lists are unequal. Get x3 down to a GMWM * 1068getgm C 0&X3 Skip one 1072 SAR x3 word mark 1076 BCE twowm,1&X3,} 1084 B getgm * * Get comma * 1088getcom SBR getcmx&3 1092schcom BW stmbot,0&X1 1100getcmx BCE 0-0,0&X1,, 1108 SBR x1 1112 B schcom * * List syntax error * 1116syntax CS 332 1120 CS 1121 SW glober 1125 MN seqcod,237 1132 MN 1133 MN 1134 MCW err18 1138 W 1139 BCV *&5 1144 B *&3 1148 CC 1 1150 MCW slash,seqcod-3 1157sx1b MCW seqcod,0 1164 B stmbot * 1168done SW 0&X1 1172 MCW sx1,x1 1179 BSS snapsh,C 1184 SBR tpread&6,beginn 1191 SBR clrbot 1195 SBR clearl&3,gmwm 1202 LCA listr2,phasid 1209 B loadnx * * Data * 1213dot DCW @.@ 1220stmts DCW @5613LUP@ Read/Write (input) (tape), print, punch 1254err18 DCW @ERROR 18 - LIST SYNTAX, STATEMENT @ 1255slash DCW @/@ 1264listr2 DCW @LISTR TWO@ 1265gmwm DCW @}@ ex beginn END
- Phase 26 - Lists II. The object-time list strings are developed and stored immediately to the left of the format strings at the lower end of storage.
JOB Fortran compiler -- List Phase Two -- phase 26 CTL 6611 * * The object-time list strings are developed and stored * immediately to the left of the format strings at the lower * (high address) end of storage. * * On entry, x1 is the top of statements in low core, 81-83 * is three below the format strings or number table. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps negar2 equ 142 Looks like negary -- see phase 20 arysiz equ 160 Total array size & 2 negary equ 163 16000 - arysiz glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader seqcod equ 841 Statement code and sequence number sx1 equ 844 Save are for X1 from phase 25 -- same as * X1 on entry here * ORG 845 845beginn MCW 83,x2 852loop BW done,0&X1 860 MCW x2,sx2 867 MCW 0&X1,seqcod 874 MCW x1,savseq&6 881 C 0&X1 Get x1 885 SAR x1 down to body 889 SBR x3 893getgm C 0&X3 Get x3 down 897 SAR x3 to below gmwm at 901 BCE gotgm,1&X3,} bottom of statement 909 B getgm 913gotgm SBR sx3&6,0&X3 920 C 0&X1 924 C 925 SAR sx1b 929 BCE gotcom,0&X1,, 937 chain6 943 B finls2 947gotcom MCW sx1b,x1 954 BCE nolink,1&X1,} List not linked to another? 962 MCW 3&X1,x3 969 BW lsterr,1&X3 977 LCA 1&X3,4&X1 984 CW 985 B sx3 989nolink BCE endls2,2&X3,, 997 SBR x3 1001mark LCA kdot,0&X2 below number table and formats 1008 SBR x2 1012 CW 1&X2 1016 S w1 1020nxtlst SBR x3,1&X3 1027 BCE rpar,0&X3,) 1035 BCE subs,0&X3,$ 1043 B adrtst 1047 LCA w3,0&X2 1054 SBR x2 1058 BCE gotcm2,0&X3,, 1066 BCE lpar,0&X3,% 1074 B adrtst 1078 LCA w3,0&X2 1085 LCA comma 1089 SBR x2 1093 CW 5&X2 1097 CW 1&X2 1101 MZ 3&X2,kb1 1108 MCW x1,sx1d 1115 ZA imod,width 1122 BM int,3&X2 integer 1130 MCW mantis,width 1137int S kp16k,width 1144 MN width,mwidth 1151 MN 1152 MN 1153 SAR *&4 why not just 1157 MCW 0,x1 MCW WIDTH-3,0&x1? 1164 MCW k0 1168 A x1 1172 MZ zones&1&X1,mwidth 1179 CW 1180 SBR *&7 why not just 1184 MZ zones&X1,0 MZ ZONES&x1,MWIDTH-2? 1191 MCW mwidth,x1 1198 MCW 4&X2,*&14 1205 MZ *-6,*&6 Set x1 zone 1212 SBR 4&X2,0 1219 MZ kb1,3&X2 1226 MCW sx1d,x1 1233 MZ *-4,6&X2 clobber type tag 1240testlp BCE lpar,0&X3,% 1248tstlst C 0&X3,comma 1255 BU lsterr 1260gotcm2 BW endlst,0&X3 1268 B nxtlst * * Right parenthesis -- bottom of implied do * 1272rpar BCE rpar0,w1,? 1280rparb MCW x1,sx1c 1287 LCA kdot,0&X1 1294 SBR x1 1298 A kp1,w1 1305 BCE lsterr,w1,D 1313 B movadr increment or upper bound 1317 C 0&X3,comma 1324 BU lsterr 1329 B movadr upper bound or lower bound 1333 BCE movadr,0&X3,, lower bound 1341 C 0&X3,kequal 1348 BU lsterr 1353 B movadr subscript/loop inductor 1357 SBR 0&X1,1&X2 1364 CW 0&X1 decrease x1 1368 CW 1369 SW 1370 SAR x1 1374 MCW x3,sx3b 1381 MN 0&X3 1385 SAR x3 1389rlpar BCE lpar2,2&X3,% 1397 BCE rpar2,2&X3,) 1405 BW lsterr,2&X3 1413 SBR x3 1417 B rlpar 1421lpar2 LCA krpar,0&X2 1428 SBR x2 1432 CW 1&X2 1436 B rpmore 1440rpar2 LCA eqblnk,0&X2 1447 SBR x2 1451 SW 2&X2 1455 CW 1456rpmore MCW sx3b,x3 1463 B tstlst * * Left parenthesis -- top of implied do * 1467lpar S kp1,w1 1474 BM lsterr,w1 unbalanced parentheses 1482 MA negary,3&X1 1489 LCA 3&X1,0&X2 1496 LCA 6&X1 1500 SBR x2 1504 BCE dot,13&X1,. 1512 LCA 15&X1,0&X2 1519 SBR x2 1523lpar3 LCA 12&X1,0&X2 1530 LCA 1531 LCA klpar 1535 SBR x2 1539 CW 1&X2 1543switch NOP lpar5 1547 MCW 3&X1,x1 1554 MN 0&X1 1558 SAR x1 1562 MA arysiz,x1 1569 MA negary,x2 1576 SBR 0&X1,1&X2 1583 MA arysiz,x2 1590lpar4 SBR x3,1&X3 1597 MCW sx1c,x1 1604 B testlp 1608lpar5 MCW nop,switch 1615 B lpar4 1619dot LCA negar2,0&X2 1626 SBR x2 1630 B lpar3 * * Right parenthesis and w1 is zero * 1634rpar0 SBR x1,w48 1641 MCW branch,switch 1648 B rparb * * Move address at 1&x3..3&x3 to w3 and -2&x1..0&x1, * decrement x3 by 3. * 1652movadr SBR movadx&3 1656 SBR x3,1&X3 1663 B adrtst 1667 LCA w3,0&X1 1674 SBR x1 1678 MZ *-4,2&X1 clobber type tag (why?) 1685 BW lsterr,0&X3 1693movadx B 0 * * End of I/O list * 1697endlst C w1,kp0 parentheses balanced 1704 BU lsterr no 1709 CW 0&X3 1713 CW 1714 SW 1715 SAR x3 1719 SBR 3&X3,1&X2 1726 MA negary,3&X3 1733 B sx3 * * Dollar sign -- bottom of subscript * 1737subs SW 0&X3 1741 SAR x3 1745 SBR sx1e&3,1&X3 1752getdol BCE gotdol,2&X3,$ 1760 SBR x3 1764 B getdol 1768gotdol LCA 2&X3,0&X2 1775 SBR x2 1779 CW 1&X2 1783 SBR x3,3&X3 1790sx1e CW 0 1794 B testlp 1798endls2 BW finlst,2&X3 1806 SBR x3,2&X3 1813 B mark 1817finlst SW 3&X3 1821 CW 1822finls2 BCE lsterr,seqcod-3,1 1830 BCE lsterr,seqcod-3,3 1838 B savseq * * Test whether three characters starting at X3 are an address, * i.e., that the numeric part is a digit. If so, move it to * w3 and bump X3 by 3. * 1842adrtst SBR adrtsx&3 1846 MN 2&X3,digtst&11 1853 B digtst 1857 MN 1&X3,digtst&11 1864 B digtst 1868 MN 0&X3,digtst&11 1875 B digtst 1879 MCW 2&X3,w3 1886 SBR x3,3&X3 1893adrtsx B 0-0 1897digtst SBR *&4 1901 BCE 0-0,digits,0 1909 chain9 1918 B lsterr 1922lsterr CS 332 1926 CS 1927 SW glober 1931 MN seqcod,234 1938 MN 1939 MN 1940 MCW err47 1944 W 1945 BCV *&5 1950 B *&3 1954 CC 1 1956 MCW slash,seqcod-3 convert to end statement 1963savseq MCW seqcod,0 1970 MCW sx2,x2 1977sx3 SBR x1,0 1984 B loop 1988done MCW sx1,x1 1995 BSS snapsh,C 2000 SBR clearl&3,gmwm 2007 LCA list3,phasid 2014 B loadnx * * Data * 2019zones DCW @ 9@ 2050 DCW @9Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 2053sx2 DCW #3 2056sx1b DCW #3 2057kdot dcw @.@ 2058w1 DCW #1 2059comma dcw @,@ 2060kb1 DCW #1 2063sx1d DCW #3 2068width DCW #5 2073kp16k DCW @1600?@ 2074k0 DCW 0 2077mwidth DCW #3 width - 16000 in machine form 2080sx1c DCW #3 2081kp1 dcw &1 2082kequal dcw @#@ 2085sx3b DCW #3 2086krpar dcw @)@ 2090eqblnk dcw @# @ 2091klpar dcw @%@ 2092nop NOP 2140w48 DCW #48 2141branch B 2142kp0 dcw &0 2145w3 DCW #3 2155digits DCW @0123456789@ 2186err47 DCW @ERROR 47 - BAD LIST, STATEMENT @ 2187slash dcw @/@ code for end statement 2196list3 DCW @LISTR TRI@ 2197gmwm DCW @}@ ex beginn END
- Phase 27 - Lists III. Each input/output statement is reduced to the address of the list string (when present), the address of the format string (when present), and the tape unit number (where applicable).
JOB Fortran compiler -- List Phase Three -- phase 27 CTL 6611 * * Each input-output statement is reduced to the address of * the list string (when present), the format string (when * present), and the tape unit number (when applicable). * * On entry, x1 is the top of the top I/O statement and x2 * is one below the table of I/O strings, formats and numbers. * * On exit, 83 is the top of code in high core and x2 is one * below the bottom of code in high core. * x1 equ 89 x2 equ 94 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 845 845beginn MCW x2,83 852 SW gm 856 LCA gm,0&X2 GM below I/O string table 863 SBR x2 867testio BW notio,0&X1 875 B move move prefix 879 B move move tape number and list (r/w tape), * tape number and format (r/w i/o tape), * or format (read/print/punch) 883 BCE testio,1&X2,} End of statement? 891 CW 1&X2 895 C 0&X1 get down to wm 899 SAR x1 903 SBR x1,1&X1 910 B move move list (r/w i/o tape) or only gmwm 914 B testio * * Not I/O, copy everything else * 918notio CW 0&X1 922copy BCE done,0&X1, 930 B move move prefix 934 B move move body 938 B copy * * Move from code area to list area * 942move SBR movex&3 946 LCA 0&X1,0&X2 953 SAR x1 957 C 0&X2 961 SAR x2 965movex B 0-0 * 969done BSS snapsh,D 974 SBR tpread&6,838 981 SBR clrbot 985 SBR loadxx&3,937 992 SBR clearl&3,gmwm 999 LCA stnum2,phasid 1006 B loadnx * 1011gm DCW @ }@ 1017stnum2 DCW @STNUM2@ 1018gmwm DCW @}@ ex beginn END
- Phase 28 - Statement Numbers II. All free storage is again cleared and partitioned into two tables-Tables I and II. Parameters needed for Phase 29 are computed.
JOB Fortran compiler -- Stmt Numbers Two -- phase 28 CTL 6611 * * Same as Variables Phase Two (14). * * The entire source program is shifted to the top (leftmost * part) of available storage, leaving room for subsequent * compiler phases. The remaining storage is cleared for * tables. * * On entry, 83 is the top of code in high core and x2 is one * below the bottom of code in high core. * * On exit, 83 is one below the tables in high core, and x1 and * x2 are the top of code in low core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * botcod equ 3199 One below bottom of code * ORG 838 840topcd9 DCW #3 top of code & 5 & x00 - 1 846diff16 DCW #6 16 * (bottab - 1 - topcd9) 849bndry DCW #3 topcd9 + 0.48 * (bottab - 1 - topcd9) 852bottab DCW #3 bottom of tables * * Move down * 853movedn SBR movedx&3 857 MN 0&X1 861 SAR x1 865more MCM 0&X2 869 SAR newx2&6 873 MCM 0&X2,1&X1 880 MN 881 SBR x1 885newx2 SBR x2,0 892 BCE more,0&X1,| 900 MN 0&X2 904 CW 905 SW 0&X1 under the GM 909 C x2,bottab 916 BU more 921 MN 0&X1 925 SAR x1 929 SBR x2 seqno of top of code in low core 933movedx B 0-0 * 937beginn MCW 83,x3 top of code 944 SBR bottab,1&X3 bottom of tables 951 MCW x2,x3 958clear CS 0&X3 962 SBR x3 966 C x3,abot done? 973 BU clear no 978 SBR x1,botcod 985 B movedn 989 SBR topcd9,5&X1 996 MN k99,topcd9 1003 MN 1004 MCW 83,x3 1011clear2 CS 0&X3 1015 SBR x3 1019 C x3,topcd9 1026 BU clear2 1031 MCW kless,0&X3 1038 MCW 83,toconv 1045 B conv 1049 MCW w5,diff16 1056 MCW topcd9,toconv 1063 B conv 1067 S w5,diff16 1074 A diff16 1078 A diff16 1082 A diff16 1086 A diff16 16 * (bottab - 1 - topcd9) 1090 A diff16-2,w6 1097 A w6 1101 A diff16-2,w6 0.48 * (bottab - 1 - topcd9) 1108 A w5,w6 topcd9 + 0.48 * (bottab - 1 - topcd9) 1115 MCW w6-3,x3 1122 A x3 1126 MZ zones-1&X3,w6-2 1133 MZ zones&X3,w6 1140 MCW w6,x3 1147 SW 2&X3 1151 MCW kless 1155 SBR bndry 1159 BSS snapsh,C 1164 SBR tpread&6,beginn 1171 SBR clrbot 1175 SBR loadxx&3,1187 1182 SBR clearl&3,botcod 1189 LCA stnum3,phasid 1196 B loadnx * * Convert toconv to decimal in w5 * 1200conv SBR convx&3 1204 MN toconv,w5 1211 MN 1212 MN 1213 MCW 1214 MZ toconv,k99 1221 MZ toconv-2,k99-1 1228 SBR x3,zones-4 1235convl C 4&X3,k99 1242 SAR x3 1246 A kp1,w5-3 1253 BU convl 1258 MZ kb,w5-3 1265convx B 0-0 * * Data * 1273toconv DCW @0J @ 1275k99 DCW @99@ zones equ *&2 1307 dc @99Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 1310abot DSA botcod 1311kless DCW @<@ 1316w5 DCW #5 1322w6 DCW #6 1331stnum3 DCW @STNUM TRI@ 1332kp1 dcw &1 1333kb DCW #1 1334gmwm DCW @}@ ex beginn END
- Phase 29 - Statement Numbers III. By means of a randomizer (as in Phase 16), statement number representations (Phase 22) appearing within statements are stored uniquely, one after another, in Table II. Each such representation is replaced by the machine address at which it is stored.
JOB Fortran compiler -- Stmt Numbers Three -- phase 29 CTL 6611 * * The three-character equivalents of statement numbers * appearing within statements (generated by Statement * Numbers Phase One) are placed in a table. * * On entry, 83 is one below the bottom of the numbers, formats * and I/O lists in high core, and x1 and x2 are the top of * code in low core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps tblbot equ 145 One below numbers, formats, I/O lists snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * topcd9 equ 840 top of code & x00 - 1 diff16 equ 846 16 * (bottab - 1 - topcd9) bndry equ 849 topcd9 + 0.48 * (bottab - 1 - topcd9) bottab equ 852 input bottom of tables, output top of code & 2 movedn equ 853 move statements down * ORG 937 * * Move either prefix or statement up * 937move SBR movex&3 941 LCA 0&X1,0&X2 948 SAR x1 952 C 0&X2 956 SAR x2 960movex B 0 * * Compute hash probe for sought and leave it in x1. Save * -3&x1 in sx1a. * 964hash SBR hashx&3 968 MCW 0&X1,sought 975 SAR sx1a 979 MN sought,w4 986 MN 987 MN 988 MN 989 S diff16-2,w4 996 BWZ *-14,w4,B 1004 A diff16-2,w4 1011 MZ *-4,w4 1018 MCW w4,x1 1025 A x1 1029 A w4,x1 1036savtop NOP 0-0 why not just 1040 SAR x1 SBR X1,0-0 ? 1044hashx B 0 * 1048 DCW #1 1051sought DCW #3 1054sx1a DCW #3 1058w4 DCW #4 1062seqcod DCW #4 1065savbot DCW #3 bottom of I/O strings, format, numbers - 1 * 1066toobig CS 332 1070 CS 1071 CC 1 1073 MCW err2,270 1080 W 1081 CC 1 1083 BCE halt,cdovly,1 1091 RWD 1 1096halt H halt * 1100done MCW sx1,x1 1107 BSS snapsh,C 1112 SBR tpread&6,beginn 1119 SBR clrbot 1123 SBR clearl&3,gmwm 1130 LCA stnum4,phasid 1137 B loadnx 1143sx1 DCW #3 1179err2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1186stnum4 DCW @STNUM 4@ * 1187beginn MCW 83,savbot 1194 MCW 83,tblbot 1201 MCW topcd9,savtop&3 1208 MZ x1zone,savtop&2 x1 zone 1215 SBR bottab,2&X2 bottab is not top of code & 2 1222 MCW x1,sx1 1229nxstmt MCW 0&X1,seqcod 1236 BCE compgo,seqcod-3,T Computed GOTO? 1244 MCW branch,swich2 1251 MCW savbot,83 1258 C x1,x2 1265 BE tstend 1270 B movedn 1274tstend BCE done,0&X1, 1282 MCW 0&X1,seqcod 1289 B move move up prefix 1293 MCW seqcod-3,*&8 1300 BCE labels,stmts,0 1308 B 1309 B 1310 B 1311 B 1312 B 1313cont B move move up body 1317 B tstend * * An interesting statement -- one containing labels of other * executable statements. Not an I/O statement containing a * format label. * * ??? This doesn't work for computed GOTO, because it doesn't * have a comma. It ends up putting the variable in the label * table. ??? * 1321labels B hash 1325 B lookup 1329 MCW x3,0&X2 move table address to code 1336 SBR x2 1340 MCW sx1a,x1 1347 BCE cont,0&X1,} 1355 BCE cont,0&X1,, 1363 B labels * * Computed GOTO * ??? This looks buggy. Computed GOTO doesn't have * a comma in it, and X3 is off by one. ??? * 1367compgo C 0&X1 get to top of body 1371 MN 1372 SAR x3 1376 S w3b 1380compl1 MN 0&X3 1384 MN 1385 MN 1386 SAR x3 1390 A k1,w3b 1397 BCE *&5,1&X3,, 1405 B compl1 1409 S kp11,w3b 1416 BWZ compg2,w3b,B 1424 B move 1428compfn B move 1432 B nxstmt 1436compg2 MN 0&X1 1440 MN 1441 MN 1442 MCW kh 1446 B move 1450 MCW x3,sx3 1457 MN 0&X3 1461 MN 1462 SAR x1 1466 A kp9,w3b 1473compl2 SBR x1,6&X1 1480 B hash 1484 B lookup 1488 MCW sx1a,x1 1495 BCE *&5,4&X1,} End of statement? 1503 B compl2 1507 MCW savbot,0&X2 1514 MCW w3b 1518 SBR x2 1522 MCW sx3,x1 1529 B compfn * * Lookup sought in the hash table. Insert bottom of tables * address in hash table if not found, copy sought to * bottom of tables, and decrement bottom of tables address. * 1533lookup SBR lookx&3 1537 MCW nop,switch indicate first time 1544lookl MCW 0&X1,x3 1551 SAR x1 1555 BCE empty,3&X1, 1563 BCE switch,3&X1,< 1571 C 0&X3,sought 1578 BU lookl 1583swich2 NOP lookx 1587 MCW savbot,0&X3 1594 SBR x3 1598 MZ kba,2&X3 1605 CW 1606empty LCA savbot,3&X1 1613 MCW savbot,x3 1620 BCE toobig,0&X3,< 1628 B 1629 B 1630 LCA sought,0&X3 1637 SBR savbot 1641lookx B 0 * 1645switch NOP toobig 1649 MCW branch,switch 1656 MCW bndry,x1 1663 B lookl * 1667x1zone dcw @S@ 1668branch B 1674stmts DCW @WTDEGK@ codes for statements with labels 1677w3b DCW #3 1678k1 dcw 1 1680kp11 DCW &11 1681kh dcw @H@ 1684sx3 DCW #3 1685kp9 DCW &9 1686nop NOP 1688kba DCW @ A@ 1689gmwm DCW @}@ ex beginn END
- Phase 30 - Statement Numbers IV. Statement number representations are matched against Table II entries via the randomizer of Phase 29. The sequence number of the statement (Phase 02) replaces the Table II entry. The Table II address (which now contains the sequence number) replaces both the representation and the sequence number in the source program. Undefined and multiply-defined statement numbers are checked.
JOB Fortran compiler -- Stmt Numbers Four -- phase 30 CTL 6611 * * The three-character equivalents of statement numbers which * identify statements are matched against the statement number * table. When the equivalent is found, the sequence number * generated by the compiler for that statement is substituted * in the table. Unreferenced and multi-defined statement * numbers are noted. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps seqtab equ 148 Bottom of sequence number table - 2 glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * bndry equ 849 topcod + 0.48 * (bottab - 1 - topcod) move equ 937 Move either prefix or statement up hash equ 964 compute hash probe sought equ 1051 label sought in hash probe routine sx1a equ 1054 seqcod equ 1062 savbot equ 1065 bottom of sequence number table toobig equ 1066 sx1 equ 1143 * ORG 1187 1187beginn LCA kb1,0&X2 1194 SW gm 1198 MCW x1,x2 1205nxstmt BCE done,0&X1, 1213 MCW 0&X1,seqcod 1220 SAR x1 1224 BCE nolabl,0&X1,} 1232 B hash compute hash probe * lookup in hash table 1236 MCW nop,switch 1243lookl1 MCW 0&X1,x3 1250 SAR x1 1254 BW look2,1&X1 1262 BCE switch,3&X1,< bottom of the table 1270 BCE unref,1&X1, probed hash entry is empty 1278 C 3&X1,sought 1285 BU lookl1 1290 B double 1294look2 C 0&X3,sought 1301 BU lookl1 1306 MZ seqcod-1,svzone 1313 MZ *-4,seqcod-1 1320 MCW seqcod,0&X3 1327 SBR x3 1331 CW 1&X3 no WM in label table means defined 1335 MCW 3&X1,seqcod 1342 MZ svzone,seqcod-1 1349 MCW sought,3&X1 1356 CW 1&X1 no WM in hash table means defined 1360look3 MCW sx1a,x1 1367nolabb SBR x1,4&X1 Back here from nolabl 1374 MCW seqcod 1378 B move 1382 B move 1386 B nxstmt * 1390switch NOP unref got here twice? 1394 MCW branch,switch 1401 MCW bndry,x1 1408 B lookl1 * 1412unref CS 332 1416 CS 1417 MN seqcod,250 1424 MN 1425 MN 1426 MCW err19 1430 W 1431 BCV *&5 1436 B *&3 1440 CC 1 1442 B unref2 * 1446double CS 332 1450 CS 1451 SW glober 1455 MN seqcod,245 1462 MN 1463 MN 1464 MCW err20 1468 W 1469 BCV *&5 1474 B *&3 1478 CC 1 1480 B look3 * 1484done MCW savbot,x3 1491 LCA gm,0&X3 1498 SBR x3 1502 SBR seqtab 1506 CS 0&X2 1510 MCW sx1,x1 1517 SW 0&X2 1521 BSS snapsh,C 1526 SBR tpread&6,838 1533 SBR clrbot 1537 SBR loadxx&3,838 1544 SBR clearl&3,gmwm 1551 LCA stnum5,phasid 1558 B loadnx * 1562unref2 MCW sx1a,x1 1569nolabl BCE *&5,seqcod-3,D Do statement? 1577 B nolabb 1581 MCW savbot,x3 1588 MCW seqcod,0&X3 1595 SBR x3 1599 BCE toobig,0&X3,< 1607 MCW savbot,seqcod 1614 SBR savbot,1&X3 1621 B nolabb 1625kb1 DCW #1 1626nop NOP 1627svzone DCW #1 1628branch B 1675err19 DCW @ERROR 19 - UNREFERENCED STMT NUMBER, STATEMENT @ 1717err20 DCW @ERROR 20 - DOUBLY DEFINED STMT, STATEMENT @ 1724stnum5 DCW @STNUM 5@ 1725gm dc @}@ 1726gmwm DCW @}@ end beginn END
- Phase 31 - Statement Numbers V. Table II is scanned for unreferenced statement numbers (representations).
Note: Whereas the source program originally was composed of constants, variables, and statement numbers of arbitrary length, it is now highly structured and is composed of 3-character machine addresses. Machine addresses substituted for constants and variables are their object-time addresses. Machine addresses substituted for statement numbers are indirect addresses which currently reference Table II entries-sequence numbers of labeled statements. Eventually (Phase 51) these indirect addresses are replaced by the object-time addresses of the labeled statements, i.e., the addresses of object programs compiled from these statements.
JOB Fortran compiler -- Stmt Numbers Five -- phase 31 CTL 6611 * * Undefined statement numbers are noted. * * On entry, X1 is the top of statements, and X3 is one below * the label table at the top of core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * tblbot equ 145 One below numbers, formats, I/O lists * ORG 838 838beginn MCW x3,sx3 845 MCW x1,sx1 852 C 0&X3 get to 856 SAR x3 top entry of hash table 860 CW 1&X3 864 MCW tblbot,x2 871 C 0&X2 875 SAR x2 879 C x2,sx3 886 BE done 891 MCW tblbot,savbot 898tstfin BW done,0&X1 906 MCW 0&X1,seqcod 913 C 0&X1 get below prefix 917 SAR x1 921 MCW kb3,w3 928 BCE compgo,seqcod-3,H 936 MCW seqcod-3,*&8 943 BCE labels,stmts,0 951 B 952 B 953 B 954 B 955 B 956endstm C 0&X1 960 SAR x1 964 B tstfin * * was originally computed GOTO code T, now H * 968compgo MCW savbot,x3 975compg2 C 0&X1,x3 982 BE compg3 987 MN 0&X3 991 MN 992 MN 993 SAR x3 997 SBR x2 1001compgl BW compg4,1&X2 1009 BWZ compg2,2&X2,2 1017 MCW 3&X2,x2 1024 MZ nozone,x2-1 1031 MN 0&X2 1035 MN 1036 MN 1037 SAR x2 1041 B compgl 1045compg3 MCW x3,savbot 1052tundef BCE endstm,w3, 1060 BWZ *&5,seqcod,2 1068 B *&9 1072 BWZ undef,seqcod-2,2 1080 MCW seqcod,x3 1087 MCW 0&X3,seqcod 1094undef CS 299 1098 SW glober 1102 MCW err21,210 1109 MCW msg21,253 1116 MN seqcod,257 1123 MN 1124 MN 1125 MCS w3,214 1132 C w3,k001 1139 BU *&8 1144 MCW kcom,243 1151 W 1152 BCV *&5 1157 B *&3 1161 CC 1 1163 B endstm 1167compg4 A k1,w3 1174 B compg2 * * Statements containing labels of executable statements. Not * I/O statements containing format statement labels. * 1178labels BW tundef,0&X1 1186 BCE tundef,0&X1,, 1194 MCW 0&X1,x3 1201 SAR x1 1205 MN 0&X3 1209 MN 1210 SAR x3 1214 BW *&5,0&X3 1222 B labels 1226 A k1,w3 1233 B labels * 1237done MCW sx1,x1 1244 MCW sx3,x3 1251 BSS snapsh,E 1256 SBR clearl&3,gmwm 1263 LCA io1,phasid 1270 B loadnx 1276sx3 DCW #3 1279sx1 DCW #3 1282savbot DCW #3 1286seqcod DCW #4 1289kb3 DCW #3 1292w3 DCW #3 1298stmts DCW @TWEDGK@ codes for statements with labels 1299nozone DCW #1 1309err21 DCW @ERROR 21 -@ 1347msg21 DCW @UNDEFINED STATEMENT NUMBERS, STATEMENT@ 1350k001 dcw 001 1352kcom DCW @, @ 1353k1 dcw 1 1360io1 DCW @I/O ONE@ 1361gmwm DCW @}@ ex beginn END
- Phase 32 - Input/Output I. The residue of each I/O statement other than BACKSPACE, REWIND, and END FILE is substituted into an object-time mask. The filled-in mask and an identifier are stored in lower core immediately adjacent to the last entry in Table II. The identifier is the sequence number (Phase 02) or, only when the statement originally had a statement number, the machine address of the sequence number stored in Table II (Phase 30).
JOB Fortran compiler -- Input/Output One -- phase 32 CTL 6611 * * The linkage to the object format routine from the input-output * statements is generated in-line. * * On entry, X1 is the top of statements, and X3 is one below * the label table at the top of core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape * botfmt equ 154 Bottom of format strings or number table - 1 * ORG 838 838beginn SW gm 842loop BCE other,0&X1, 850 LCA 0&X1,codadr 857 CW flag 861 SW codadr-3 865 MCW codadr-3,*&8 872 BCE intrst,stmts,0 880 chain6 * * Clear from 0&x3 down to top of code & x00 * 886other SBR x1,1&X1 893 MZ x3,k999x3 900 MZ 901 MCW 902 MZ x1,k999x1 909 MZ 910 MCW 911 C k999x3,k999x1 918 BE clrx 923clrl CS 0&X3 927 SBR clrl&3 931 C clrl&3,k999x1 938 BU clrl 943clrx MCW k999x1,x2 * * Clear from top of code & x00 down to top of code * 950clrl2 C x2,x1 957 BE clrx2 962 LCA kb1,0&X2 969 CW 0&X2 973 SAR x2 977 B clrl2 * * Load next overlay * 981clrx2 MN 0&X1 985 SAR x1 989 BSS snapsh,C 994 SBR clearl&3,gmwm 1001 LCA arith1,phasid 1008 B loadnx * * Interesting statement -- one containing a format reference * 1012intrst SW codadr-2 1016 MCW kless,2&X1 1023 SBR check&6,2&X1 1030 C 0&X1 get to top 1034 SAR x1 of statement body 1038 LCA codadr,0&X3 move up code and address 1045 LCA gm and put a GMWM below it 1049 SBR x3 1053 CW 2&X3 under statement code 1057 BWZ nofmt,codadr-1,B 1065 BCE rwtp,codadr-3,1 read tape 1073 BCE rwtp,codadr-3,3 write tape 1081 BCE rdprpu,codadr-3,L read 1089 BCE rdprpu,codadr-3,P print 1097 BCE rdprpu,codadr-3,U punch 1105 MCW 0&X1,format read/write input/output tape 1112 SAR x1 1116rwtp MCW 0&X1,tapvar tape variable or constant 1123 SAR x1 1127 MCW 0&X1,iolstg i/o list and GMWM 1134 BCE const,iolstg-1,} tape number const with I/O list 1142 BCE const,tapvar-1,} tape number const, no I/O list 1150 MN k1,tapcon 1157 BCE varnol,iolstg,} tape number var, no I/O list 1165rwtp2 MCW 0&X1,iolist 1172 SAR x1 1176rwtp3 LCA iolist,0&X3 1183 SBR x3 1187 LCA format,0&X3 1194 SBR x3 1198 LCA tapcon,0&X3 1205 LCA doio&3 load branch to start I/O routine 1209 SBR x3 1213 BCE gotzon,codadr-3,L read 1221 BCE gotzon,codadr-3,P print 1229 BCE gotzon,codadr-3,U punch 1237 BCE gotzon,codadr-3,1 read tape 1245 MZ azone,5&X3 1252 BCE gotzon,codadr-3,3 write tape 1260 MZ bzone,5&X3 1267 BCE gotzon,codadr-3,5 read input tape 1275 MZ abzone,5&X3 1282gotzon BW novar,flag 1290 BWZ novar,tapvar-1,2 1298 MCW tapvar,mn-3 1305 MZ kb1,mn-4 clobber integer zone tag 1312 LCA mn,0&X3 1319 SBR x3 1323novar MCW kb3,iolstg v3m4 1330 LCA gm,0&X3 v3m4 1337 SBR x3 1341 C 0&X1 1345 SAR x1 1349check BCE loop,0,< less sign means code not clobbered yet * * Program too big * 1357 CS 332 1361 CS 1362 CC 1 1364 MCW error2,270 1371 W 1372 CC 1 1374 BCE halt,cdovly,1 1382 RWD 1 1387halt H halt * * Tape number is a constant * 1391const MN tapvar,tapcon 1398 SW flag 1402 BCE const2,tapvar-1,} 1410 SBR x1,2&X1 1417 B rwtp2 1421const2 SBR x1,1&X1 * * Tape is variable, but there is no list * 1428varnol MCW botfmt,iolist 1435 B rwtp3 * * No format * 1439nofmt MZ kb1,3&X3 1446 MCW 4&X3,seqno 1453 BWZ *&5,seqno,2 1461 B *&9 1465 BWZ nofmtm,seqno-2,2 1473 MCW seqno,*&4 1480 MCW 0,seqno 1487nofmtm CS 332 1491 CS 1492 SW glober 1496 MN seqno,242 1503 MN 1504 MN 1505 MCW err22 1509 W 1510 BCV *&5 1515 B *&3 1519 CC 1 1521 MZ *-4,codadr-1 1528 B rwtp * * Read, print, punch * 1532rdprpu MCW 0&X1,format 1539 SAR x1 1543 MCW botfmt,iolist 1550 BCE rdprp2,0&X1,} 1558 MCW 0&X1,iolist 1565 SAR x1 1569rdprp2 MCW rdunit,tapcon assume read 1576 BCE rdprp3,codadr-3,L read 1584 MCW puunit,tapcon assume punch 1591 BCE rdprp3,codadr-3,U punch 1599 MCW prunit,tapcon 1606rdprp3 SW flag 1610 B rwtp3 * * Data * 1616k999x3 DSA 999 1619k999x1 DSA 999 1626mn DCW @DXXX0?5@ 1627gm dc @}@ 1628doio B 1697 entry for I/O routine 1635iolstg DCW #4 1638tapvar DCW #3 tape variable or constant 1641iolist dcw 000 1644format dcw 000 1649codadr DCW #5 GM, statement code, address 1656stmts dcw @1356LPU@ codes for statements with formats 1665arith1 DCW @ARITH ONE@ 1666kless DCW @<@ 1667k1 dcw 1 1668azone dcw @S@ 1669bzone DCW @K@ 1670abzone dcw @B@ 1673kb3 DCW #3 1709error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1710tapcon DCW #1 tape number constant 1711kb1 DCW #1 1714seqno DCW #3 1753err22 DCW @ERROR 22 - UNDEFINED FORMAT, STATEMENT @ 1754rdunit DCW @&@ read unit 1755puunit DCW @-@ punch unit 1756prunit DCW @*@ print unit 1757flag DCW #1 1758gmwm DCW @}@ ex beginn END
- Phase 33 - Arith I. All arithmetic expressions appearing in the source program are scanned. Switches are set to indicate which function routines must be loaded by Phase 52. Minor changes are made to expressions, and sufficient error testing is done to expedite Phase 34.
JOB Fortran compiler -- Arith Phase One -- phase 33 CTL 6611 * * This is a housekeeping phase. The unary minus (negate) and * exponentiation operators are changed to unique one-character * symbols (negate becomes comma, exponentiate becomes dot). * Error checking also takes place. * * On entry, x1 is the top of the prefix of code in low core, * x2 is x1&1, and x3 is two below the GM below the I/O strings, * formats and constants in high core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps series equ 117 Need series routine if no WM sincos equ 118 Saw sinf or cosf if no WM sawabs equ 122 Saw absf if no WM sawneg equ 123 Saw negation operator (unary minus) if no WM glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838beginn SBR sx3,2&X3 845 SW gm 849 MCW 0&X1,codseq 856 BCE loop1,codseq-3,R 864 BCE loop1,codseq-3,E 872 MCW dot,x2 879 B done 883loop MCW 0&X1,codseq 890loop1 SBR sx3b,0&X3 897 BCE expr,codseq-3,R 905 BCE expr,codseq-3,E 913 MCW sx3,x2 920done BSS snapsh,C 925 SBR clearl&3,gmwm 932 LCA arith2,phasid 939 B loadnx * * Either assignment or arithmetic if * 943expr LCA 0&X1,0&X3 move prefix up 950 SAR x1 954 C 0&X3 958 SAR x3 962 BWZ *&5,codseq,2 970 B *&9 974 BWZ expr2,codseq-2,2 982 MCW codseq,x2 989 MN 0&X2,codseq 996 MN 997 MN 998expr2 C 0&X1 1002 SAR sx1 1006 BCE asg,codseq-3,R * * Statement is arithmetic IF * 1014 C 0&X1,kb10 move x1 down 1021 SAR x1 by ten 1025 SW 1&X1 1029 LCA 10&X1,0&X3 move up labels 1036 SAR x1 1040 C 0&X3 1044 SAR x3 1048 CW 1&X1,1&X3 1055 LCA gm 1059 LCA kifbot 1063 SBR x3 1067 CW 1&X3,5&X3 1074 SBR sx1b,0&X1 1081 B expr3 * * Statement is assignment * 1085asg SBR x2,1&X1 1092 BCE msg23,0&X1,# equal sign is first 1100 SBR sx1b,0&X1 1107geteq BCE goteq,0&X1,# 1115 BCE msg23,0&X1,} no equal sign at all 1123 SBR x1 1127 B geteq 1131goteq B subchk 1135asgl MN 0&X1 1139 SAR x1 1143expr3 SBR x2,1&X1 1150 SBR sx1c 1154opchkl MN 0&X1,opchk&7 1161 MZ 0&X1,opchk&7 1168 SAR x1 1172opchk BCE gotop,opratr,0 &-@*#%) or GM 1180 chain7 1187 B opchkl 1191gotop SBR x1,1&X1 1198 BCE minus,0&X1,- 1206 BCE lparen,0&X1,% 1214 BCE star,0&X1,* 1222 BCE plus,0&X1,& 1230 BCE chk27,0&X1,@ was originally slash 1238 BCE asgl,0&X1,# 1246 BCE rparen,0&X1,) 1254 MN 1&X1,opchk2&7 1261 MZ 1&X1,opchk2&7 1268opchk2 BCE msg27,oprat2,0 &-*@.#, 1276 chain6 1282 BCE restr2,1&X1, 1290 BCE restr2,1&X1,% 1298 BCE restr2,1&X1,) 1306 B subchk 1310restr2 MCW sx1b,x2 1317 LCA 0&X2,0&X3 1324 SBR x3 1328 MCW sx1,x1 1335 B loop * 1339rparen MCW 0&X1,rparsv 1346 MCW rparsv-1,*&8 char after right parenthesis 1353 BCE rpar2,oprat3,0 &*@-}) includes GM 1361 chain5 1366 BCE rpar2,rparsv-1,# 1374 B msg27 1378rpar2 MN 1&X1,opchk4&7 1385 MZ 1&X1,opchk4&7 1392opchk4 BCE msg27,oprat4,0 &-*.@ %, 1400 chain7 1407 BCE asgl,1&X1,# 1415 BCE asgl,1&X1,) 1423 B subchk 1427 B asgl * * Asterisk * 1431star MCW 0&X1,star2 1438 BCE expon,star2-1,* * slash originally, now @ 1446chk27 BCE msg27,1&X1,# 1454 BCE msg27,1&X1,% 1462 BCE msg27,1&X1, 1470chk31 MN 1&X1,opchk5&7 1477 MZ 1&X1,opchk5&7 1484opchk5 BCE msg31,oprat5,0 &-@*., 1492 chain5 1497 BCE asgl,1&X1,) 1505 B subchk 1509 B asgl * * Two asterisks in a row * 1513expon MN 0&X1 1517 MN 1518 SAR x1 1522 MCW dot,2&X1 replace ** by dot 1529 LCA 0&X1 1533 SBR x1,2&X1 1540 B chk27 * * Plus sign * 1544plus BCE ignore,1&X1,# Is plus 1552 BCE ignore,1&X1,% sign 1560 BCE ignore,1&X1, unary? 1568 B chk31 1572ignore MN 0&X1 1576 SAR x1 1580 LCA 0&X1,1&X1 move up, clobbering plus sign 1587 SBR x1,1&X1 1594 B expr3 * * Minus sign * 1598minus BCE negate,1&X1,# 1606 BCE negate,1&X1,% 1614 BCE negate,1&X1, 1622 B chk31 * 1626negate MCW comma,0&X1 1633 CW sawneg 1637 B asgl * * Left parenthesis * 1641lparen BCE func,1&X1,F Maybe a function 1649 MN 1&X1,lparc&7 1656 MZ 1&X1,lparc&7 1663lparc BCE asgl,oprat6,0 &-*@ #%,. 1671 chain8 1679 B msg27 * * Left parenthesis follows F, maybe a function * 1683func MCW x2,sx2 1690 MCW sx1c,x2 1697 MN 0&X2 1701 SAR x2 1705 SW 0&X1 1709 SBR sx1c,2&X1 1716 C sx1c,x2 1723 BE msg27 1728 SBR sx1c,3&X1 1735 C sx1c,x2 1742 BE msg27 1747 MCW x3,sx3c 1754 MCW x1,sx1d 1761 SBR x1,sincos 1768 SBR x3,fnclst 1775funcl BCE notfnc,0&X3,* search function name table 1783 SBR x3 1787 C 0&X3,0&X2 1794 BE gotfnc 1799 C 0&X3 1803 SAR x3 1807 SBR x1,1&X1 1814 B funcl * * Name ending in F and followed by left parenthesis * is not in the function table * 1818notfnc CS 332 1822 CS 1823 SW glober 1827 MN codseq,249 1834 MN 1835 MN 1836 MCW err29 1840 W 1841 BCV *&5 1846 B *&3 1850 CC 1 1852 B restrt * * Need series for undefined function, sin, cos, log, exp, atan * 1856getser CW series 1860 B fnc2 * * Sin and cos are the same * 1864cosf CW sincos 1868 B getser * * Need negate for abs * 1872absf CW sawabs,sawneg absf needs negation 1879 B fnc2 * 1883gotfnc SW 1&X3 1887 BCE cosf,1&X3,C cosf 1895 BCE absf,1&X3,A absf 1903 CW 0&X1 1907 MCW 1&X3,*&8 1914 BCE getser,sgect,0 sin log exp cos atan 1922 chain4 1926fnc2 BCE intfnc,0&X2,X integer function result? 1934fnc3 MCW 1&X3,0&X2 move function code 1941 MCW kb1 and a blank 1945 SBR x2 1949 MCW sx3c,x3 1956 MCW sx1d,x1 1963 CW 0&X1 1967 SAR x1 1971 LCA 0&X1,0&X2 1978 SBR x1,0&X2 1985 B expr3 1989intfnc MN 0&X2 1993 SAR x2 1997 B fnc3 * * Emit Coding is unintelligible message * 2001msg23 CS 332 2005 CS 2006 SW glober 2010 MN codseq,247 2017 MN 2018 MN 2019 MCW err23 unintelligible 2023 W 2024 BCV *&5 2029 B *&3 2033 CC 1 2035restrt MCW sx3b,x3 2042 MCW sx1,x1 2049 B loop * * Check for subscript? * 2053subchk SBR subchx&3 2057 BCE subch2,1&X1,$ 2065 SBR sx1e,4&X1 2072subch3 C sx1e,x2 2079subchx BE 0 * * Left side is invalid * 2084msg25 CS 332 2088 CS 2089 SW glober 2093 MN codseq,243 2100 MN 2101 MN 2102 MCW err25 2106 W 2107 BCV *&5 2112 B *&3 2116 CC 1 2118 B restrt * * Arithmetic syntax error * 2122msg27 CS 332 2126 CS 2127 SW glober 2131 MN codseq,249 2138 MN 2139 MN 2140 MCW err27 2144 W 2145 BCV *&5 2150 B *&3 2154 CC 1 2156 B restrt * 2160gm dc @}@ * * Double operators * 2161msg31 CS 332 2165 CS 2166 SW glober 2170 MN codseq,242 2177 MN 2178 MN 2179 MCW err31 2183 W 2184 BCV *&5 2189 B *&3 2193 CC 1 2195 B restrt * 2199subch2 SBR sx1e,12&X1 2206 BCE subch3,11&X1,$ 2214 SBR sx1e,18&X1 2221 B subch3 * * Data * 2225 DCW @*@ WM cleared if needed 2234 DCW @ %FSOCC@ cosf 118 and 117 2243 DCW @ %FSBAXA@ xabsf 122 and 123 2252 DCW @ %FKNILXI@ xlinkf 139 2261 DCW @ H@ 138 2270 DCW @ D@ 137 2279 DCW @ M@ 136 2288 DCW @ L@ 135 2297 DCW @ K@ 134 2306 DCW @ J@ 133 2315 DCW @ Z@ 132 2324 DCW @ Y@ 131 2333 DCW @ W@ 130 2342 DCW @ P@ 129 2351 DCW @ U@ 128 2360 DCW @ R@ 127 2369 DCW @ %FTRQSQ@ sqrtf 126 2378 DCW @ %FTAOLFF@ floatf 125 2387 DCW @ %FXIFXX@ xfixf 124 2396 DCW #9 negation 123 2405 DCW @ %FSBAA@ absf 122 2414 DCW @ %FNATAT@ atanf 121 and 117 2423 DCW @ %FPXEE@ expf 129 and 117 2432 DCW @ %FGOLG@ logf 119 and 117 2441fnclst DCW @ %FNISS@ sinf 118 and 117 2442 DCW #1 2443dot dcw @.@ 2447codseq DCW #4 statement code and sequence number 2450sx3b DCW #3 2453sx3 DCW #3 2462arith2 DCW @ARITH TWO@ 2465sx1 DCW #3 2475kb10 DCW #10 2479kifbot dcw @#<99@ 2482sx1b DCW #3 2485sx1c DCW #3 2493opratr DCW @&-@*#%)}@ 2500oprat2 DCW @&-*@.#,@ 2502rparsv DCW #2 right parenthesis and next character 2508oprat3 DCW @&*@-})@ 2516oprat4 DCW @&-*.@ %,@ 2518star2 DCW #2 asterisk and next character 2524oprat5 DCW @&-@*.,@ 2525comma dcw @,@ 2534oprat6 DCW @&-*@ #%,.@ 2537sx2 DCW #3 2540sx3c DCW #3 2543sx1d DCW #3 2589err29 DCW @ERROR 29 - UNDEFINED FUNCTION NAME, STATEMENT @ 2594sgect DCW @SGECT@ 2595kb1 DCW #1 2639err23 DCW @ERROR 23 - CODING UNINTELLIGIBLE, STATEMENT @ 2642sx1e DCW #3 2682err25 DCW @ERROR 25 - LEFT SIDE INVALID, STATEMENT @ 2728err27 DCW @ERROR 27 - ARITHMETIC SYNTAX ERROR, STATEMENT @ 2767err31 DCW @ERROR 31 - DOUBLE OPERATORS, STATEMENT @ 2768gmwm DCW @}@ ex beginn END
- Phase 34 - Arith II. By means of a transition matrix, each arithmetic expression is broken down into a sequence of one or two operand sub-expressions involving temporary dummy storage locations.
JOB Fortran compiler -- Arith Phase Two -- phase 34 CTL 6611 * * All arithmetic and IF statements are unnested using a * forcing table technique. Error checking continues. * * On entry X1 is the top of the topmost non-assignment non-IF * statement, x2 is the top of the topmost assignment or IF * statement in high core, and x3 is one below the bottommost * assignment or IF statement in high core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape * ORG 838 838beginn BCE done,x2,. 846 SW gm 850 MCW x2,sx2 857 SBR x3,2&X3 864 SBR x1,2&X1 871 MCW x1,x2 878get00 MN x2,chkx2 get x2 885 MN up to 886 C chkx2,k00 x2 & x00 893 BE got00 898 CW 0&X2 902 SBR x2,1&X2 909 B get00 913got00 MN 0&X2 917 SAR x2p99 x2 & x00 - 1 921 MN 0&X3 925 SAR x2 929clrl C x2,x2p99 clear down 936 BE clrx to top 941 CS 0&X2 of code 945 SBR x2 in low 949 B clrl core & x00 953clrx MN 0&X1 957 SAR x1 961more MCM 0&X3 move code 965 SAR sx3&6 down from 969 MCM 0&X3,1&X1 top core 976 MN to bottom 977 SBR x1 of bottommost 981sx3 SBR x3,0 assignment 988 BCE more,0&X1,| or if 996 MN 0&X3 statement 1000 CW 1001 SW 0&X1 1005 C x3,sx2 1012 BU more 1017 MN 0&X1 1021 SAR x1 * * X1 is now the top of the topmost assignment or if statement * in low core and x3 is one above the top of the topmost * assignment or if statement in high core. * 1025 MN 0&X3 1029 SBR ixtop index of statement in top core 1033 BCE loop,0&X3,} 1041 SBR x3 1045 LCA gm 1049 SBR ixtop 1053 MCW x3,sx2 1060loop MCW ixtop,ixtsav 1067 MCW 0&X1,x3 1074 BWZ *&5,x3,2 zone in ones or 1082 B *&9 thousands means address of 1086 BWZ *&8,x3-2,2 sequence number in symbol table 1094 MCW 0&X3,x3 get sequence number from table 1101 MCW x3,seqno 1108 MCW kb12,w3b 1115 MCW kbrack,40&X1 right bracket 1122 SBR locbrk&6,40&X1 remember where we put it 1129 B moveup move prefix up to high core 1133 BCE ifstmt,2&X1,E If statement? 1141 C 2&X1,kr Assignment statement? 1148 BU almost No, almost done 1153ready MCW x1,x3 1160 SBR link&3,0&X1 1167 C 0&X3 1171 SAR sx3b 1175 B hunt 1179locbrk BCE whew,0,] right bracket * * Bracket having been clobbered means program is too big * 1187 CS 332 1191 CS 1192 CC 1 1194 MCW err2,270 1201 W 1202 CC 1 1204 BCE halt,cdovly,1 1212 RWD 1 1217halt H halt * * If statement, get x3 down to a blank below x1, then set * a word mark one below there * 1221ifstmt MCW x1,x3 1228getb BCE gotb,0&X3,, 1236 SBR x3 1240 B getb 1244gotb MN 0&X3 1248 SW 1249 B moveup 1253 B ready * * Move up prefix or body * 1257moveup SBR moveux&3 1261 MCW ixtop,x2 1268 LCA 0&X1,0&X2 1275 SBR ixtop 1279 C 0&X1 1283 SAR x1 1287moveux B 0 * * Hunt for interesting characters * 1291hunt SBR huntx&3 1295 BCE skpsub,0&X3,$ 1303huntl MCW 0&X3,curr 1310 SAR x3 1314 MCW curr,*&8 1321 BCE huntx,chars,0 1329 chain10 1339 B huntl 1343huntx B 0 * * Skip subscript -- decrease x3 by either 12 or 18 * 1347skpsub C 0&X3,kb12 1354 SAR x3 1358 BCE huntx,2&X3,$ 1366 C 0&X3,kb12-6 1373 SAR x3 1377 B huntx * * Program isn't too big * 1381whew MCW 1&X3,curr current operator or assignment 1388 MCW 1&X1,prev previous operator or GM 1395 MCW prev,lookch&7 1402 MCW kb12,w3 1409 B look 1413 MN chnum,w3-1 previous chars index is tens 1420 MCW curr,lookch&7 1427 B look 1431 MN chnum,w3 current chars index is ones 1438 MCW w3,x2 1445 MN table&X2,x2 get one 1452 MCW kb12 digit from table 1456 BWZ msg24,x2,S 1464 A x2 1468 A x2 quadruple it 1472 B *&1&X2 1476 B zero index from table is zero 1480 B one index from table is one 1484 B two index from table is two 1488 B three index from table is three 1492 B four index from table is four 1496 B five index from table is five 1500 B msg25 index from table is six 1504 B msg16 index from table is seven 1508 B msg32 index from table is eight 1512 B msg26 index from table is nine * * Look for a character in chars, treating minus and plus * equally, counting as we look * 1516look SBR lookch&3 1520 BCE look3,lookch&7,- 1528look2 S chnum Index in chars 1532 MCW achars,lookch&6 1539lookch BCE 0,0,0 1547 SBR lookch&6 1551 A k1,chnum 1558 B lookch 1562look3 MCW kplus,lookch&7 1569 B look2 * 1573count SBR countx&3 1577 A k1,w3b 1584 MZ w3b-1,ch 1591 MN w3b,ch 1598 MN 1599countx B 0 * * Index from table is zero. * Prev * curr %. blank * Prev % curr *%&@. blank , * Prev # curr *%&@. blank , * Prev GM curr # * Prev & curr *%@. blank , * Prev @ curr %. blank * Prev . curr % blank * Prev blank curr *%&@. blank , * Prev , curr %. blank * 1603zero MCW x3,x1 current to previous 1610 B hunt get next operator 1614 B whew * * Index from table is one. * Prev % curr ) * 1618one SW 2&X3 1622 LCA 0&X1,1&X1 1629 CW 3&X3 1633 CW 1634 LCA 0&X3,2&X3 1641 SBR x1,1&X1 1648 SBR x3,1&X3 1655 B whew * * Index from table is two * Prev * curr *)G&@ * Prev & curr )G& * Prev @ curr *)G&@ * Prev . curr *)G&@ * 1659two MCW ixtop,x2 1666 MZ 4&X3,savtag 1673 BCE *&8,2&X3,$ 1681 MZ 3&X3,savtag 1688 SW 2&X3 1692 LCA 0&X1,0&X2 1699 SBR x2 1703 CW 1&X2 1707 SW 2&X1 1711 SW 1712 LCA 1&X1,0&X2 1719 SBR x2 1723 SBR ixtop 1727 CW 1&X2 1731 BCE subtwo,2&X1,$ 1739 LCA 4&X1,0&X2 1746 SBR ixtop 1750 MZ 3&X1,tag1 1757 SAR x1 1761subbak B count 1765 LCA ch,2&X1 1772 LCA 1&X3 1776 CW 0&X1 1780 MN 1781 SAR x3 1785 SBR x1,2&X1 1792 BWZ twoa,tag1,S 1800 BM twoa,tag1 1808 BWZ locbrk,savtag,2 1816 BWZ locbrk,savtag,B 1824 BCE locbrk,prev,. 1832 B mixed 1836twoa BWZ locbrk,savtag,S 1844 BM locbrk,savtag * * Mixed mode arithmetic * 1852mixed CS 332 1856 CS 1857 SW glober 1861 MN seqno,241 1868 MN 1869 MN 1870 MCW err46 1874 W 1875 BCV *&5 1880 B *&3 1884 CC 1 1886 B errfin * 1890subtwo SBR x2,10&X1 1897 BCE *&8,2&X2,$ 1905 SBR x2,6&X2 1912 MCW ixtop,*&7 1919 LCA 2&X2,0 1926 SBR ixtop 1930 MZ 4&X1,tag1 1937 MCW x2,x1 1944 B subbak * * Index from table is four * Prev , curr *)G&@ * 1948four MCW kn,1&X1 1955 MZ 4&X3,tag1 1962 BCE fiveb,2&X3,$ 1970 MZ 3&X3,tag1 1977 B fiveb * * Index from table is five * Prev blank curr ) * 1981five MCW 3&X1,w2 1988 BCE fivec,3&X1,X 1996 MZ *-4,tag1 2003fivef SW 2&X1 2007 MCW 2&X1,*&8 2014 BCE usrfnc,usrcod,0 2022 chain11 2033 MZ 4&X3,savtag 2040 BCE fivea,2&X3,$ 2048 MZ 3&X3,savtag 2055fivea BCE fived,2&X1,F 2063 BCE fived,2&X1,I 2071 C w2,kax 2078 BE fived 2083 BWZ msg28,savtag,S 2091 BM msg28,savtag 2099usrfnc MCW 2&X1,1&X1 2106 MCW klpar,2&X1 2113 CW 2&X1 2117fiveb MCW ixtop,x2 2124 SW 2&X3 2128 LCA 1&X1,0&X2 2135 SBR ixtop 2139 B count 2143 LCA ch,1&X1 2150 LCA 1&X3 2154 MN 0&X1 2158 CW 2159 MN 2160 SAR x3 2164 SBR x1,1&X1 2171 B locbrk 2175fivec MZ fivec,tag1 2182 LCA 2&X1,3&X1 2189 SBR x1,1&X1 2196 SBR x3,1&X3 2203 B fivef 2207fived BWZ usrfnc,savtag,S 2215 BM usrfnc,savtag * * Wrong argument type for function * 2223msg28 CS 332 2227 CS 2228 SW glober 2232 MN seqno,261 2239 MN 2240 MN 2241 MCW err28 2245 W 2246 BCV *&5 2251 B *&3 2255 CC 1 2257 B errfin * * System error * 2261msg24 CS 332 2265 CS 2266 SW glober 2270 MN seqno,238 2277 MN 2278 MN 2279 MCW err24 2283 W 2284 BCV *&5 2289 B *&3 2293 CC 1 2295 B errfin * * Excess of # signs * Index from table is nine * Prev * curr # * Prev # curr # * Prev & curr # * Prev @ curr # * Prev . curr # * Prev blank curr # * Prev , curr # * 2299msg26 CS 332 2303 CS 2304 SW glober 2308 MN seqno,243 2315 MN 2316 MN 2317 MCW err26 2321 W 2322 BCV *&5 2327 B *&3 2331 CC 1 2333 B errfin * * Multiple exponent * Index from table is eight * Prev . curr . * 2337msg32 CS 332 2341 CS 2342 SW glober 2346 MN seqno,243 2353 MN 2354 MN 2355 MCW err32 2359 W 2360 BCV *&5 2365 B *&3 2369 CC 1 2371 B errfin * * Parenthesis error * Index from table is seven * Prev % curr GM * Prev # curr ) * Prev blank curr GM * 2375msg16 CS 332 2379 CS 2380 SW glober 2384 MN seqno,243 2391 MN 2392 MN 2393 MCW err16 2397 W 2398 BCV *&5 2403 B *&3 2407 CC 1 2409 B errfin * * Left side is wrong * Index from table is six * Prev GM curr *)%&@. blank , * 2413msg25 CS 332 2417 CS 2418 SW glober 2422 MN seqno,243 2429 MN 2430 MN 2431 MCW err25 2435 W 2436 BCV *&5 2441 B *&3 2445 CC 1 2447errfin MCW ixtsav,ixtop 2454 B restrt * * Index from table is three * Prev # curr G * 2458three MCW ixtop,x2 2465 SW 2&X3 2469 LCA 0&X1,0&X2 2476 LCA keq 2480 SBR x2 2484 CW 2&X2 2488 CW 2489 SW 2&X1 2493link LCA 0,0&X2 2500 LCA gm 2504 SBR ixtop 2508restrt MCW sx3b,x1 2515 B loop * 2519almost SBR x1,5&X1 get back above prefix in low core 2526 MCW ixtop,x3 2533 SBR x2,5&X3 2540 MCW sx2,x3 * 2547done BSS snapsh,C 2552 SBR clearl&3,gmwm 2559 LCA arith3,phasid 2566 B loadnx * * Data * 2570 DCW @<@ 2571tag1 dc @ @ 2572ch dc @ @ 2573gm dc @}@ 2623 DCW @ERROR 28 - INCORRECT MODE OF FUNCTION ARGUMENT, ST@ 2631err28 DC @ATEMENT @ 2632 DCW @-@ * * Rows and columns of table are indexed by positions in * chars, taken in reverse order. * 2642chars DCW @, .@&}#%)*@ interesting characters? 2643table equ *&1 * curr *)%#G&@. , 2652 DCW @220922200S@ * prev 2662 DC @SSSSSSSSSS@ ) 2672 DC @0109700000@ % 2682 DC @0709300000@ # 2692 DC @6660S66666@ GM 2702 DC @020922000S@ & 2712 DC @220922200S@ AT was / 2722 DC @220922280S@ . was ** 2732 DC @0509700000@ blank 2742 DC @440944400S@ , was negate 2745sx2 DCW #3 2747chkx2 DCW #2 2749k00 DCW 00 2752x2p99 DCW #3 x2 & x00 - 1 2755ixtop DCW #3 index of statement in top core 2758ixtsav DCW #3 2761seqno DCW #3 2762kbrack DCW @]@ 2763kr DCW @R@ 2766sx3b DCW #3 2802err2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2814kb12 DCW #12 2815curr DCW #1 2816prev DCW #1 2819w3 DCW #3 2820chnum DCW #1 2823achars DSA chars 2824k1 dcw 1 2825kplus DCW @&@ 2828w3b DCW #3 2829savtag DCW #1 type tag zone 2867err46 DCW @ERROR 46 - MIXING IN ARITH, STATEMENT @ 2868kn dcw @N@ 2870w2 DCW #2 2882usrcod DCW @RUPWYZKJLMDH@ codes for user functions 2884kax DCW @AX@ 2885klpar dcw @%@ 2920err24 DCW @ERROR 24 - SYSTEM ERROR, STATEMENT @ 2960err26 DCW @ERROR 26 - EXCESS OF # SIGNS, STATEMENT @ 3000err32 DCW @ERROR 32 - MULTIPLE EXPONENT, STATEMENT @ 3040err16 DCW @ERROR 16 - PARENTHESIS ERROR, STATEMENT @ 3080err25 DCW @ERROR 25 - LEFT SIDE INVALID, STATEMENT @ 3081keq dcw @#@ 3090arith3 DCW @ARITH TRI@ 3091gmwm DCW @}@ ex beginn END
- Phase 35 - Arith III. Initialization for Phase 36.
JOB Fortran compiler -- Arith Phase Three -- phase 35 CTL 6611 * * Initialization for Arith Phase Four takes place. * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838beginn BSS snapsh,C 843 SBR clearl&3,gmwm 850 LCA arith4,phasid 857 b loadnx 910 dc #50 960 dc #50 1010 dc #50 1060 dc #50 1067arith4 DCW @ARITH 4@ 1068gmwm DCW @}@ ex beginn END
- Phase 36 - Arith IV. Redundant references to temporary dummy storage locations are eliminated by forming maximal strings of operands and operators from each sequence of sub-expressions. Each string specifies the computation in which (1) unary operators act on the entire substring immediately to their left and (2) binary operators combine this substring with the operand on their right.
JOB Fortran compiler -- Arith Phase Four -- phase 36 CTL 6611 * * Strings generated by Arith Phase Two are optimized to reduce * the number of temporary storage areas for each statement. * * On entry, X1 is the top of the topmost statement in low core * that is neither an assignment nor if statement, X2 is the top * of the topmost statement in high core that is neither an * assignment nor if statement, X3 is the top of the prefix of * the topmost statement in high coore that is either an * assignment or if statement, and 81-83 is the GMWM above the * topmost statement in high core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps sawneg equ 123 Saw negation operator (unary minus) if no WM snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * * Runtime addresses * aritf equ 700 * ORG 838 838beginn BCE done,x2,. 846 SW gm 850 SBR sx3,0&X3 857 SBR x1,1&X1 864 SBR x2,1&X2 871loop S wrktop 875 C x2,sx3 882 BE done 887 MCW kb4,3021 894 SBR sx1,0&X1 901outer MCW kb4,op2 908 CW flag 912 B setup 916 BCE testeq,w18a-2,< 924middle BCE 1166,w18b-2,< 932 BCE 1733,1&X2,} 940 BW 1302,flag 948inner A k3999,2972 955 MCW 2972,x3 962 BCE inner,work&X3,1 970 B outer 974testeq BCE middle,op,# 982 BCE 1328,op,. was ** 990 B 2758 996 DSA w18a 997 B 2837 1001 MN kp1,work&X1 1008 LCA 0&X3,w35 1015 SAR x1 1019move13 C x1,x2 move 1026 BE m13x 0&x1 1031 LCA 0&X1,0&X3 up to 1038 SAR x1 0&x3 1042 C 0&X3 until 1046 SAR x3 x1 equal x2 1050 B move13 1054m13x C 0&X2 1058 SAR x1 1062 BW 2928,flag 1070 BCE 1101,w18b,* 1078 BCE 1695,op,# 1086 LCA w18b,0&X3 1093 SBR x3 1097 CW 1&X3 1101 LCA op,0&X3 1108 SBR x3 1112 CW 1&X3 1116 LCA w35,0&X3 1123 SBR x3 1127 SBR x2 1131 LCA 0&X1,0&X3 1138 SAR x1 1142 C 0&X3 1146 SAR x3 1150 BCE 1162,1&X1,} 1158 B 1131 1162 B 901 1166 BCE 1178,op2, 1174 B 1496 1178 BCE 1663,op,# 1186 BCE 1214,op,& 1194 BCE 1214,op,* 1202 BCE 1239,op,- 1210 B 1527 1214 LCA w18a,w35 swap 1221 LCA w18b,w18a w18a 1228 LCA w35,w18b and w18b 1235 B 974 1239 BW 1379,flag 1247 LCA w18a,0&X2 1254 LCA kplus 1258 SBR x2 1262 CW 2&X2,sawneg 1269 LCA w18b,w18a 1276 LCA kstar3,w18b 1283 MCW nop,op 1290 CW sawneg 1294 SW flag 1298 B 974 * 1302 BCE 1328,w18b,* 1310 MCW op,1324 1317 BCE 1391,3017,0 1325 B 1326 B 1327 B 1328 BW *&5,flag 1336 B inner 1340 B 1379 1344 BW 1360,2&X2 1352 SBR x2 1356 B 1344 1360 SBR x2,1&X2 1367 BCE 1733,1&X2,} gmark 1375 B inner * 1379 SBR 1390 1383 CW 1&X2 1387 B 0 * 1391 BCE 1403,op2, 1399 B 1440 1403 MCW op,op2 1410 CW 1&X2 1414 LCA w18b,0&X2 1421 SBR x2 1425 CW keepwm 1429 SBR rwm1&3,1&X2 Remember where to clear WM 1436 B 908 1440 BCE 1476,op2,& 1448 BCE 1476,op2,- 1456 BCE 1410,op,* 1464 BCE 1410,op,/ 1472 B 1328 1476 BCE 1410,op,& 1484 BCE 1410,op,- 1492 B 1328 1496 MCW op,1510 1503 BCE 1575,op2,0 1511 BCE 1555,op2,& 1519 BCE 1555,op2,- 1527 BCE 1733,1&X2,} 1535 BW 1328,flag 1543 BW inner,1&X2 1551 B 1328 1555 BCE 1575,op,& 1563 BCE 1575,op,- 1571 B 1527 1575 BCE 1328,op,@ 1583 BW 1379,flag 1591 C 0&X2,kb4 1598 SAR x3 1602 MCW 0&X3,0&X2 1609 SBR x2 1613 BCE 1644,op,- 1621 MCW op,0&X2 1628 MCW w18b 1632 C 0&X2 1636 SBR x2 1640 B 901 1644 LCA kplus,0&X2 1651 SBR x2 1655 SW flag 1659 B 1269 1663 B 2758 1669 DSA w18b 1670 MCW w18b,3021 1677 MCW 3091,2972 1684 A kp1,2972 1691 B 997 1695 LCA w35,0&X3 1702 SBR x2 1706 LCA op 1710 SBR x3 1714 CW 1&X3 1718 LCA w18a,0&X3 1725 LCA gm 1729 B 901 1733 MCW sx1,x1 1740 SBR 3024,0&X2 1747 BCE 1887,2&X2,, 1755 BCE 1887,3019,< 1763 BCE 1887,0&X2,$ 1771 BCE 1887,w18a,$ 1779 BM 1807,3062 1787 BM 1887,3087 1795 BWZ 1887,3087,S 1803 B 1823 1807 BWZ 1887,3087,2 1815 BWZ 1887,3087,B 1823 B 1887 1827 LCA w18a 1831 LCA w18b 1835 LCA lca 1839 SBR x3 1843 CW 2&X3,5&X3 1850 MZ 1852,3&X3 1857 MZ 1859,6&X3 1864 SBR x1,6&X1 1871 LCA 6&X2 1875 LCA 1876 SBR x2,6&X2 1883 B loop 1887 MCW 3027,3021 1894 MCW a001,x3 1901 MCW 3027,3032 1908 SBR x1,4&X1 1915 LCA baritf&3 1919 BCE 1963,work&X3,0 1927 A kp1,3032 1934 MCW 3032,3021 1941 MZ 3031,3021 1948 A kp1,x3 1955 SW flag 1959 B 1919 1963 LCA assign,4&X1 1970 LCA 3021 1974 CW 4&X1 1978 C 0&X1,baritf&3 1985 BE 1994 1990 CW 1&X1 1994 LCA gm,1&X2 2001 C 0&X2 2005 SAR x2 2009 BCE 2139,0&X2,# 2017 BCE 2147,1&X2,$ 2025 MZ 2&X2,2&X1 2032 SBR x1,4&X1 2039more MCM 1&X2,1&X1 2046 MN 2047 SBR x1 2051 MCM 1&X2 2055 MN 2056 SAR x2 2060 BCE more,0&X2,| 2068 C 0&X2 2072 SAR x2 2076 MCW x3,sx3a 2083 MCW 3041,0&X1 2090 LCA 0&X2 2094 SBR x3 2098 CW 0&X1,1&X3 2105 C 0&X2 2109 SAR x3 2113 BCE 2158,0&X3,} 2121 SBR x2,0&X3 2128 MCW sx3a,x3 2135 B 1927 2139 CW 1&X2 2143 B 2001 2147 MZ 3&X2,2&X1 2154 B 2032 2158 C 0&X1,kb4 2165 SAR x1 2169 LCA 3041,0&X1 2176 MCW 0&X2 2180 MCW 3024,x2 2187 BW 2217,6&X2 2195 SW 3&X2 2199 SBR x1,9&X1 2206 LCA 11&X2 2210 SBR x2,11&X2 2217 SBR x1,6&X1 2224 LCA 6&X2 2228 LCA 2229 SBR x2,6&X2 2236 B loop 2240gm dc @}@ work equ *&1 2290 DCW #50 2340 dc #50 2390 dc #50 2440 dc #50 2490 dc #50 2540 dc #50 2572wrktop dc #32 * * Skip subscript if present. Copy the next operand into w18a * and the next operator into op. Bump X2 by 4. If the * operand after the operator has a word mark, put stars into * w3b, else skip another subscript if present and put the * next operand into w3b and bump x3 by three. * 2573setup SBR setupx&3 2577 BCE skpsub,1&X2,$ 2585 LCA 3&X2,w18a 2592 MCW 4&X2,op 2599 SBR x2,4&X2 2606 BW *&5,keepwm 2614rwm1 CW 0 2618 SW keepwm 2622 BW gotwm,1&X2 2630 SW 1&X2 2634 SBR rwm2&3,1&X2 remember where to clear WM 2641 MN 0&X2,*&15 2648 MZ 0&X2,*&8 2655 BCE gotop,ops,0 &-*@.# 2663 chain5 2668 SW flag 2672gotwm LCA kstar3,w18b 2679 B setupx 2683gotop BCE skpsub,1&X2,$ 2691 LCA 3&X2,w18b 2698 SBR x2,3&X2 2705 BW rwm2,1&X2 2713 SW 1&X2,flag 2720rwm2 CW 0 2724setupx B 0 * * Skip subscript * 2728skpsub SBR skpsux&3 2732 SBR x2,8&X2 2739 BCE skpsux,3&X2,$ 2747 SBR x2,6&X2 2754skpsux B 0 * 2758 SBR x1 2762 SBR 2836,3&X1 2769 MCW 2&X1,x1 2776 MN 0&X1,3091 2783 MN 2784 MCW 3092 2788 BWZ 2833,0&X1,2 2796 A kp100,3091 2803 BWZ 2833,0&X1,S 2811 A kp100,3091 2818 BM 2833,0&X1 2826 A kp100,3091 2833 B 0 * 2837 SBR 2873 2841 SBR x3,0&X2 2848 MCW 2972,x1 2855 BW 2890,flag 2863 C x1,3091 2870 BE 0 2875 BCE 2917,work&X1,1 2883 A k3999,x1 2890 BW 2906,2&X3 2898 SBR x3 2902 B 2890 2906 SBR x3,1&X3 2913 B 2863 2917 A k3999,x1 2924 B 2863 2928 CW 1&X3 2932 B 1070 * 2936flag dc #1 2937done BSS snapsh,C 2942 SBR clearl&3,gmwm 2949 LCA arith5,phasid 2956 B loadnx * * Data * 2962sx3 DCW #3 2965sx1 DCW #3 2966op2 DCW #1 2969k3999 DSA 3999 2972 DCW #3 2973kp1 dcw &1 3008w35 DCW #35 3009kplus DCW @&@ 3012kstar3 DCW @***@ 3013nop NOP 3017 DCW @&-*@@ 3018keepwm DCW #1 3021 DCW #3 3024 DCW #3 3025lca LCA 3027 DCW @01@ 3030a001 DSA 1 3032 DCW #2 3033baritf B aritf Entry to the arithmetic interpreter 3037assign dcw @#@ 3040sx3a DCW #3 3041 DCW @|@ 3045kb4 DCW #4 3063w18a DCW #18 3064op DCW #1 3070ops DCW @&-*@.#@ 3088w18b DCW #18 3091 DCW #3 3092 DCW @0@ 3095kp100 dcw &100 3102arith5 DCW @ARITH 5@ 3103gmwm DCW @}@ ex beginn END
- Phase 37 - Arith V. Exponentiation operators are replaced by substrings involving log and anti-log functions. Implied mode changes are made explicit by inserting (or deleting) fix or float operators in the strings. The Table II addresses (Phase 29) appearing within IF statements (involving arithmetic expressions) are substituted into masks of object-time instructions. The filled-in mask replaces the addresses in the source program.
JOB Fortran compiler -- Arith Phase Five -- phase 37 CTL 6611 * * IF statement exits and strings for exponentiation are created. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps series equ 117 Need series routine if no WM logf equ 119 Saw logf if no WM expf equ 120 Saw expf if no WM xfixf equ 124 Saw xfixf if no WM floatf equ 125 Saw floatf if no WM negar3 equ 157 Looks like negary -- see phase 20 arysiz equ 160 Total array size & 2 glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * * Runtime addresses * aritf equ 700 * ORG 838 838beginn BCE done,x2,. Done? 846 C 0&X2 850 SAR x2 854 SBR sx2 858 C 0&X1 862 SAR x1 866loop MCW 0&X1,seqno 873 MCW 874 BCE arif,code,E if statement 882 BCE arif,code,R arithmetic assignment statement 890 B almost 894arif LCA 0&X1,0&X2 move up prefix 901 SAR x1 905 C 0&X2 909 SAR x2 913 LCA 1&X2,2&X2 move up gmwm? 920 SBR x2 924 CW parity 928 BCE ifstmt,2&X1,E if statement * * Assignment statement * 936asgstm LCA 0&X1,0&X2 943 SAR x1 947 C 0&X2 951 SAR x2 955 SBR x3,0&X1 962 SBR sx1 966 BCE endstm,0&X1,} 974getop MN 0&X3,lookop&7 981 MZ 0&X3,lookop&7 988 SAR x3 992lookop BCE gotop,ops,0 &-@*.# 1000 chain5 1005 B getop 1009gotop BCE expon,1&X3,. exponentialtion 1017 MZ 4&X3,savzon type of LHS if subscript 1024 BCE subs,2&X3,$ 1032 MZ 3&X3,savzon type of LHS if no subscript 1039outer SBR x3,4&X3 1046inner C x3,sx1 1053 BE getasg 1058 SBR x3,1&X3 1065 BCE *&13,0&X3,F 1073 BCE *&5,0&X3,X 1081 B inner 1085 BW even,parity 1093 SW parity 1097 B inner 1101even CW parity 1105 B inner * * Exponentiation * 1109expon SBR sx3&6,0&X3 1116 BCE expon2,0&X3,$ 1124 SBR x3 1128exponl MZ 0&X3,savzon 1135sx3 SBR x3,0 1142 BCE subs,2&X3,$ 1150 B outer 1154expon2 C 0&X3,w8 1161 SAR x3 1165 BCE exponl,0&X3,$ 1173 B 1174 B 1175 C 0&X3,w6 1182 SAR x3 1186 B exponl * * Subscript -- skip it * 1190subs SBR x3,12&X3 1197 BCE inner,0&X3,$ 1205 SBR x3,6&X3 1212 B inner * * Get down to assignment operator * 1216getasg BCE gotasg,0&X3,# 1224 SBR x3 1228 B getasg 1232gotasg MCW 0&X3,w18a 1239 BCE sublft,2717,$ subscript before equal 1247 MZ w18a-2,lstype type tag for LHS 1254sblbak BWZ lfix,lstype,S back here after subscript 1262 BWZ lfix,lstype,K 1270 BWZ lfrf,savzon,2 1278 BWZ lfrf,savzon,B 1286 BW endexp,parity left float right fixed 1294lfrx MCW fcode,0&X2 1301 SBR x2 1305 CW 1&X2,floatf need floatf 1312 B endexp 1316lfrf BW lfrx,parity left float right float 1324 B endexp 1328lxrx BW lxrf,parity left fix right fix 1336 B endexp 1340lfix BWZ lxrx,savzon,S left side is fixed point 1348 BM lxrx,savzon 1356 BW endexp,parity 1364lxrf MCW xcode,0&X2 left fix right float 1371 SBR x2 1375 CW 1&X2,xfixf need xfixf 1382endexp SBR x3,0&X1 1389endex2 BCE expon3,0&X1,. Exponentiation 1397 BCE divop,0&X1,@ 1405 BCE endstm,0&X1,} 1413 SBR x1 1417 B endex2 * * End of IF or assignment statement * 1421endstm LCA 0&X3,0&X2 1428 SAR x3 1432 C 0&X2 1436 SAR x2 1440 BCE finstm,1&X3,} 1448 B endstm 1452finstm SBR x1,0&X3 1459 B loop * * Divide operator -- turn it back to slash * 1463divop MCW slash,0&X1 1470 SBR x1 1474 B 1389 * * Almost done * 1478almost SBR x1,5&X1 1485 MCW sx2,x3 1492 SBR x3,2&X3 * 1499done BSS snapsh,C 1504 SBR clearl&3,gmwm 1511 LCA arith6,phasid 1518 B loadnx * * IF statement * 1522ifstmt C 0&X1 1526 SAR x1 1530 MCW 9&X1,labneg negative branch 1537 MCW 6&X1,labzro zero branch 1544 MCW 3&X1,labpos positive branch 1551 MZ x2zone,labneg-1 1558 MZ x2zone,labzro-1 1565 MZ x2zone,labpos-1 1572 MCW labpos,uncond 1579 LCA kb20,w20 1586 SBR x3,recmrk 1593 C labpos,labzro 1600 BE poszro positive and zero the same label 1605 C labzro,labneg 1612 BE zeqneg negative and zero the same label 1617 SBR x3,8&X3 1624 MCW brzero 1628 MCW 1629 LCA 1630 C labpos,labneg 1637 BE posneg positive and negative the same label 1642zeqneg SBR x3,8&X3 1649 MCW brpos 1653 MCW 1654 LCA 1655 MCW labneg,uncond 1662posneg MCW x3,sx1 1669 BWZ *&5,seqno,2 1677 B *&9 1681 BWZ *&15,seqno-2,2 1689 MCW seqno,x3 address of sequence number if zones 1696 MCW 0&X3,seqno 1703 A kp1,seqno 1710 MCW uncond,x3 1717 C 0&X3,seqno 1724 MCW sx1,x3 1731 BE moveup 1736posn2 SBR x3,4&X3 1743 MCW uncond 1747 LCA 1748moveup LCA 0&X3,0&X2 move up generated code 1755 SAR x3 1759 C 0&X2 1763 SAR x2 1767 BCE asgstm,0&X3,| 1775 B moveup 1779poszro C labpos,labneg 1786 BE posn2 all the same label 1791 SBR x3,8&X3 1798 MCW brneg 1802 MCW 1803 LCA 1804 B posneg * * Exponentiation operator * 1808expon3 SW 1&X1 1812 BCE esubr,1&X1,$ 1820 LCA 3&X1,w17a 1827 MZ 2&X1,exprt 1834 SBR sx1p3,3&X1 1841 C sx1p3,x3 1848 BE expon5 1853 SW 4&X1 1857expon4 LCA 0&X3,0&X2 1864 SAR x3 1868 C 0&X2 1872 SAR x2 1876 CW 1&X2 1880expon5 C 0&X1,kb4 1887 SAR x1 1891 BCE esubl,3&X1,$ 1899 MZ 2&X1,explt 1906 SW 1&X1 1910expon6 LCA 3&X1,w17b 1917 SAR x1 1921 BWZ erx,exprt,S 1929 BWZ erx,exprt,K 1937 CW logf,expf need logf and expf 1944 CW series and series 1948 BWZ erflf,explt,2 1956 BWZ erflf,explt,B 1964 BWZ *&5,seqno,2 1972 B *&9 1976 BWZ msg30,seqno-2,2 sequence number if no zones 1984 MCW seqno,x3 address of sequence number 1991 MCW 0&X3,seqno 1998msg30 CS 332 2002 CS 2003 SW glober 2007 MN seqno,244 2014 MN 2015 MN 2016 MCW err30 2020 W 2021 BCV *&5 2026 B *&3 2030 CC 1 2032erflf LCA ecode,0&X2 both operands float 2039 LCA w17a 2043 LCA kgstar G* 2047 SBR x2 2051 CW 3&X2,1&X1 2058 LCA w17b,0&X2 2065 SBR x2 2069 CW 1&X2 2073 B endexp * * Right operand of exponentiation is fixed point * 2077erx BWZ getfun,exprt,K 2085 BCE getfun,w17a-2,< 2093 MCW w17a,x3 2100 MA arysiz,x3 2107 C k3,0&X3 2114 BH getfun 2119 LCA w17b,0&X2 2126 LCA kstar 2130 SBR x2 2134 SBR sx2b 2138 CW 1&X2,2&X2 2145 LCA w17b,0&X2 2152 SBR x2 2156 CW 1&X2 2160 BCE erx2,0&X3,0 2168 BCE erx3,0&X3,1 2176 BCE endexp,0&X3,2 2184 LCA kstar,0&X2 2191 SBR x2 2195 CW 1&X2 2199 LCA w17b,0&X2 2206 SBR x2 2210 CW 1&X2 2214 B endexp * 2218erx2 MCW sx2b,x3 2225 MCW slash,1&X3 2232 B endexp * 2236erx3 MCW sx2b,x2 2243 SBR x2,1&X2 2250 B endexp * 2254getfun CW logf,expf need logf and expf 2261 CW series,floatf 2268 BWZ getff1,explt,2 left is float 2276 BWZ getff1,explt,B left is float 2284 LCA xcode,0&X2 xfixf code 2291 SBR x2 2295 CW 0&X2,xfixf 2302 LCA negar3,0&X2 2309 LCA kplus 2313 SBR x2 2317 CW 2&X2 2321getff1 LCA ecode,0&X2 2328 LCA kfless F*<4? 2332 LCA w17a 2336 SBR x2 2340 CW 1&X2 2344 C 0&X1,kb4 2351 SAR x3 2355 BCE subfun,3&X3,$ 2363subfub SW 1&X3 2367 LCA 0&X1,0&X2 2374 SAR x1 2378 C 0&X2 2382 SAR x2 2386 CW 1&X2 2390 LCA kgrm G| 2394 SBR x2 2398 BWZ getff2,explt,2 left is float 2406 BWZ getff2,explt,B left is float 2414 LCA fcode,0&X2 2421 SBR x2 2425getff2 LCA w17b,0&X2 2432 LCA kl4 <4?# 2436 SBR x2 2440 CW 5&X2 2444 C 0&X1,baritf&3 2451 BE endexp 2456 CW 1&X2 2460 B endexp * 2464recmrk DCW @|@ 2484w20 DCW #20 2485 B 2488uncond DCW #3 2489 BWZ 2492labpos DCW #3 positive branch from arithmetic if 2495 dsa 277&x3 2496brpos dc @B@ 2497 B 2500labzro DCW #3 zero branch from arithmetic if 2503 dsa 280 2504brzero dc 0 2505 BWZ 2508labneg DCW #3 negative branch from arithmetic if 2511 dsa 277&x3 2512brneg dc @K@ * * Right operand of exponentiation operator is subscripted * 2513esubr MZ 3&X1,exprt 2520 SBR x1,11&X1 2527 BCE *&8,0&X1,$ 2535 SBR x1,6&X1 2542 C x1,x3 2549 BE *&5 2554 SW 1&X1 2558 LCA 0&X1,w17a 2565 SAR x1 2569 BE expon5 2574 B expon4 * * Left operand of exponentiation operator is subscripted * 2578esubl C 0&X1,w8 2585 SAR x3 2589 BCE *&12,1&X3,$ 2597 C 0&X3,w6 2604 SAR x3 2608 MZ 3&X3,explt 2615 SW 1&X3 2619 B expon6 * * Subscript after ??? * 2623subfun C 0&X3,w8 2630 SAR x3 2634 BCE subfub,1&X3,$ 2642 C 0&X3,w6 2649 SAR x3 2653 B subfub * * Subscript on left of equal sign * 2657sublft MZ w18a-9,lstype type tag for LHS 2664 BCE sblbak,w18a-11,$ 2672 MZ w18a-15,lstype type tag for LHS 2679 B sblbak * * Data * 2683code DCW #1 statement code 2686seqno DCW #3 sequence number or 2689sx2 DCW #3 2690parity DCW #1 of loop in assignment statement processing 2693sx1 DCW #3 2699ops DCW @&-@*.#@ 2700savzon DCW #1 2718w18a DCW #18 2719lstype DCW #1 type zone for LHS 2720fcode DCW @F@ fix-to-float (floatf) code 2721xcode DCW @X@ float-to-fix (xfixf) code 2722slash dcw @/@ 2728arith6 DCW @ARITH6@ 2729x2zone DCW @K@ 2749kb20 DCW #20 2750kp1 dcw &1 2767w17a DCW #17 2768exprt DCW #1 type tag of right operand of exponentiation 2771sx1p3 DCW #3 2775kb4 DCW #4 used in compare to decrement index 2776explt DCW #1 type tag of left operand of exponentiation 2793w17b DCW #17 2834err30 DCW @ERROR 30 - FIX TO FLOAT POWER, STATEMENT @ 2835ecode DCW @E@ code for exponential 2837kgstar DCW @G*@ code for logarithm 2838k3 DCW 3 2839kstar DCW @*@ 2842sx2b DCW #3 2843kplus DCW @&@ 2848kfless DCW @F*<4?@ 2850kgrm DCW @G|@ 2854kl4 DCW @<4?#@ 2855baritf B aritf 2866w8 DCW #8 used in compare to decrement index 2872w6 DCW #6 used in compare to decrement index 2873gmwm DCW @}@ ex beginn END
- Phase 38 - Arith VI. The arithmetic strings are altered so that temporary storage areas are shared whenever possible. Machine addresses are determined for these areas and substituted for the dummy addresses in the strings. Previous arithmetic and IF statements are now stored, each with its identifier (Phase 32), in lower core immediately to the left of the list and format "statements."
JOB Fortran compiler -- Arith Phase Six -- phase 38 CTL 6611 * * Optimization of temporary storage areas takes place. * These areas are assigned definite locations in storage. * * On entry x1 is at the bottom of the bottommost assignment * statement in low core, x2 is at the at the bottom of the * bottommost assignment statement in high core, and x3 is * the bottom of the bottom of the bottommost statement in * high core that is neither an assignment nor if statement. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838beginn BCE done,x2,. 846 SBR sx2,0&X2 853 MN 0&X3 857 MN 858 SAR sx3 862 SBR sx1,0&X1 869 MCW 86,s86 876 MCW mantis,numwid 883 MN kpzero,numwid-2 890 A kp2,numwid wasn't this done a long time ago? 897 C numwid,imod 904 BL *&8 909 MCW imod,numwid numwid is max(imod,mantis&4) 916loop C x2,sx3 923 BE almost 928 MCW work,work-1 fill work with record marks 935getles BCE gotles,2&X2,< 943 SBR x2 947 BCE endstm,1&X2,} 955 B getles 959gotles MN 4&X2,w3 966 MN 967 MCW kzero 971 BWZ zonex3,4&X2,2 979 A kp100,w3 986 BWZ zonex3,4&X2,S 994 A kp100,w3 1001 BWZ zonex3,4&X2,K 1009 A kp100,w3 1016zonex3 MCW w3,x3 4&x2 & &100*zone to x3 1023 A x3 1027 A w3,x3 times 3 1034 BCE gotasg,5&X2,# 1042 MCW wrkbot&X3,x1 1049 MCW rm,wrkmid&X1 1056 B notasg 1060gotasg MCM wrkmid&1 1064 SAR x1 1068 MA a13671,x1 1075 MCW *-6,wrkmid&X1 1082 MCW x1,wrkbot&X3 1089notasg ZA x1,w7-4 1096 M numwid,w7 1103 SW w7-4 1107 MN w7,4&X2 Convert W7 to machine address 1114 MN 1115 MN 1116 SAR *&4 1120 MCW 0,x3 1127 MCW kzero 1131 A x3 1135 MZ zones&X3,4&X2 1142 CW 1143 SBR *&7 1147 MZ zones-1&X3,0 1154 CW w7-4 1158 MA 86,4&X2 1165 C x1,w3b 1172 BH notbig 1177 MCW x1,w3b 1184 MCW 4&X2,s86 1191 BWZ bigtst,s86,2 under 4k? v3m4 1199notbig SBR x2,3&X2 1206 B getles * * End of statement. * 1210endstm SBR x2,4&X2 1217 B loop * * Almost done * 1221almost MCW sx2,x3 1228 MCW sx1,x1 1235 C 0&X1 1239 C 1240 SAR x1 1244 MCW s86,86 * 1251done BSS snapsh,D 1256 SBR clearl&3,gmwm 1263 LCA io2,phasid 1270 B loadnx * * Program is too big * 1274toobig BW notbig,printd 1282 CS 332 1286 CS 1287 MCW error2,270 1294 W 1295 SW glober,printd 1302 B notbig * 1305wrkbot equ * 1355 DCW @ @ ORG 2329 2328wrkmid equ * 2378 DCW @ @ 2428 DC @ @ 2478 DC @ @ 2494work DC @ |@ 2495printd DC @ @ WM means *too big* message has been printed 2497kb9 DCW @ 9@ 2498zones equ *&1 2528 DCW @9Z9R9I99ZZZRZIZ9RZRRRIR9IZIRIII@ 2531sx2 DCW #3 2534sx3 DCW #3 2537sx1 DCW #3 2540numwid DCW #3 2541kpzero DCW @?@ 2542kp2 dcw &2 2545w3 DCW #3 2546kzero DCW 0 2549kp100 DCW &100 2550rm DCW @|@ 2553a13671 DSA 13671 2560w7 DCW #7 2563w3b DCW #3 2566s86 DCW #3 2573io2 DCW @I/O TWO@ 2609error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 2610bigtst BWZ toobig,s86-2,2 under 1k? v3m4 2618 BIN notbig, v3m4 2623gmwm DCW @}@ ex beginn END
- Phase 39 - End file, Rewind, Backspace.
JOB Fortran compiler -- I/O Phase Two -- phase 39 CTL 6611 * * In-line instructions are generated for executing END FILE, * REWIND and BACKSPACE statements. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape * ORG 838 838loop BCE done,0&X1, 846 MCW 0&X1,codseq 853 MCW codseq-3,*&8 860 BCE iostmt,codes,0 Interesting statement? 868 B 869 B 870done BSS snapsh,C 875 SBR clearl&3,gmwm 882 LCA cgoto,phasid 889 B loadnx * * Statement is Backspace, Endfile or Rewind * 893iostmt MCW kb,ioinst Assume backspace 900 MCW kless,2&X1 907 SBR tstles&6,2&X1 914 BCE moveup,codseq-3,B Backspace? 922 MCW kr,ioinst Assume rewind 929 BCE moveup,codseq-3,Z Rewind? 937 MCW km,ioinst Must be endfile 944moveup LCA 0&X1,0&X3 951 SAR x1 955 C 0&X3 959 SAR x3 963 LCA 1&X1,2&X3 970 SBR x3 974 BWZ *&5,codseq,2 982 B *&9 986 BWZ *&15,codseq-2,2 994 MCW codseq,x2 Zone in codseq high or low 1001 MCW 0&X2,codseq means it's an address 1008 BCE syntax,0&X1,} 1016 MN 0&X1 1020 SAR x2 1024 BCE unitk,0&X2,} unit number is a constant 1032uvar MCW k0,ioinst-1 1039 MCW 0&X1,mvunit&3 1046 MCW mn,mvunit 1053 MZ *-4,mvunit&2 clobber type tag 1060 CW flag 1064gotu C 0&X1 1068 SAR x1 1072 LCA ioinst,0&X3 load CU instruction 1079 SBR x3 1083 BW const,flag unit number is a constant 1091 SW flag 1095 LCA mvunit&6,0&X3 load move unit number instr 1102 SBR x3 1106const LCA 1&X1,0&X3 1113 SBR x3 1117tstles BCE loop,0,< not too big if less-than not clobbered 1125 CS 332 1129 CS 1130 CC 1 1132 MCW error2,270 1139 W 1140 CC 1 1142 BCE halt,cdovly,1 1150 RWD 1 1155halt H halt 1159syntax CS 332 1163 CS 1164 SW glober 1168 MN codseq,245 1175 MN 1176 MN 1177 MCW err33 1181 W 1182 BCV *&5 1187 B *&3 1191 CC 1 1193 MCW k0,ioinst-1 1200 B uvar * * Unit number is a constant * 1204unitk MN 0&X1,ioinst-1 1211 B gotu * * Data * 1215mvunit MCW 5777&X1,4&X3 1226ioinst DCW @U%U0X@ 1230codseq DCW #4 Statement code and sequence number 1233codes DCW @BZN@ Backspace, Rewind, Endfile statement codes 1238cgoto DCW @CGOTO@ 1239kb dcw @B@ 1240kless DCW @<@ core is not full yet sentinel 1241kr DCW @R@ 1242km DCW @M@ 1243k0 DCW @0@ 1244mn MN 1245flag DCW #1 no WM means unit is variable, WM means const 1281error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1323err33 DCW @ERROR 33 - NO TAPE UNIT NUMBER, STATEMENT @ 1324gmwm DCW @}@ ex loop END
- Phase 40 -- Computed Go To.
JOB Fortran compiler -- Computed GOTO Phase -- phase 40 CTL 6611 * * Statements with two to ten exits generate in-line instructions. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape * ORG 838 838beginn SW gm,gm2 845loop BW done,0&X1 853 MCW 0&X1,seqno 860 MCW seqno,seqno2 867 MCW rbrack,1&X1 874 SBR tstbrk&6,1&X1 881 C 0&X1 885 SAR x1 889 C 2&X1,kt Computed GOTO statement? 896 BU almost No 901 S w2 905count MN 0&X1 909 MN 910 MN 911 SAR x1 915 A kp1,w2 922 C w2,kp11 Eleven ways yet? 929 BE syntax yes, syntax error 934 C 0&X1,kcomma 941 BU count Count branches 946 MN 0&X1 950 SAR x1 954 B getadr 958 LCA seqno2,0&X3 965 LCA branch&3 969 LCA 970 LCA 971 SBR x3 975 SBR x1,1&X1 * * Generate BCE instructions to test selector * 982genbce BW endstm,4&X1 990 SW bce-6 994 MN w2,bce 1001 MCW w3 1005 MCW 6&X1 1009 SAR x1 1013 CW bce-6 1017 MZ x2zone,bce-5 1024 MZ *-4,bce-2 1031 LCA bce,0&X3 1038 SBR x3 1042 S kp1,w2 1049 B genbce * 1053endstm LCA gm,0&X3 1060 SBR x3 1064bottom C 0&X1 bottom of loop -- get down to 1068 SAR x1 bottom of statement 1072tstbrk BCE loop,0,] not too big if bracket not clobbered 1080 CS 332 1084 CS 1085 CC 1 1087 MCW error2,270 1094 W 1095 CC 1 1097 BCE halt,cdovly,1 1105 RWD 1 1110halt H halt * * Verify that the field after the branches is an address, * that is, the digit part of all three characters is in * the range 0-9. Move it to w3. * 1114getadr SBR getadx&3 1118 S w1 1122getch MN 0&X1,tstdgt&7 1129 SAR x1 1133 BCE okadr,w1,B tested all three characters? 1141 A kp1,w1 1148tstdgt BCE getch,digits,0 Numeric part is a digit? 1156 B 1157 B 1158 B 1159 B 1160 B 1161 B 1162 B 1163 B 1164 B 1165getgm BCE syntax,0&X1,} 1173 SBR x1 1177 B getgm 1181okadr BM *&5,2&X1 1189 B getgm 1193 MZ kb1,2&X1 1200 MCW 3&X1,w3 1207 C 0&X1,gm 1214 BU getgm 1219getadx B 0 * 1223syntax BWZ *&5,seqno,2 1231 B *&9 1235 BWZ *&15,seqno-2,2 1243 MCW seqno,x2 1250 MCW 0&X2,seqno 1257 CS 332 1261 CS 1262 SW glober 1266 MN seqno,247 1273 MN 1274 MN 1275 MCW err34 1279 W 1280 BCV *&5 1285 B *&3 1289 CC 1 1291 B bottom * 1295gm dc @}@ 1299 DCW @T840@ 1302w3 DCW #3 1305 DCW #3 1308 DCW #3 1309gm2 dc @}@ 1312seqno2 dc #3 * 1313almost SBR x1,5&X1 1320done BSS snapsh,C 1325 SBR clearl&3,gmwm 1332 LCA gomsk,phasid 1339 B loadnx * 1350bce dcw @BXXXXXXA@ BCE XXX,XXX,A 1351 NOP 1001 1355 H 1356branch B 15992&X3 1362seqno DCW #3 1363rbrack DCW @]@ 1364kt DCW @T@ computed GOTO statement code 1366w2 DCW #2 1367kp1 dcw &1 1369kp11 DCW &11 1370kcomma dcw @,@ 1371x2zone DCW @K@ 1407error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1408w1 DCW #1 1418digits DCW @0123456789@ 1419kb1 DCW #1 1463err34 DCW @ERROR 34 - COMPUTED GO TO SYNTAX, STATEMENT @ 1468gomsk DCW @GOMSK@ 1469gmwm DCW @}@ ex beginn END
- Phase 41 - Go To.
JOB Fortran compiler -- GOTO Phase -- phase 41 CTL 6611 * * An unconditional branch instruction is generated in-line * in place of the original statement * x1 equ 89 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838loop BCE done,0&X1, 846 MCW 0&X1,codseq 853 BCE goto,codseq-3,G goto statement? 861done BSS snapsh,C 866 SBR clearl&3,gmwm 873 LCA stoppz,phasid 880 B loadnx * 884goto LCA 0&X1,0&X3 seqno, code, gmwm 891 SAR x1 895 C 0&X3 899 SAR x3 903 LCA 1&X3,2&X3 move gmwm up 910 SBR x3 914 LCA 0&X1,0&X3 move label up 921 SAR x1 925 C 0&X3 929 SAR x3 933 MCW branch,1&X3 replace gmwm by branch 940 LCA 1&X1 with the gmwm below it 944 SBR x3 948 MZ x2zone,4&X3 955 B loop * * Data * 962codseq DCW #4 statement code and sequence number 972stoppz DCW @STOP/PAUSE@ 973branch B 974x2zone DCW @K@ 975gmwm DCW @}@ ex loop END
- Phase 42 - Stop/Pause.
JOB Fortran compiler -- STOP/PAUSE Phase -- phase 42 CTL 6611 * * The proper instructions to * 1. HALT * 2. halt, continue, and display the number indicated * are generated in-line * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape * ORG 838 838beginn CS 299 842loop BCE done,0&X1, 850 MCW 0&X1,codseq 857 BCE stoppz,codseq-3,A Pause statment? 865 BCE stoppz,codseq-3,S Stop statement? 873done BSS snapsh,C 878 SBR clearl&3,gmwm 885 LCA light,phasid 892 B loadnx * * Stop or pause statement * 896stoppz MCW kless,2&X1 903 SBR tstles&6,2&X1 910 LCA 0&X1,0&X3 seqno, code, gmwm 917 SAR x1 921 C 0&X3 925 SAR x3 929 LCA 1&X3,2&X3 clobber statement code with gmwm 936 SBR x3 940 BCE nocode,0&X1,} 948 CS work 952 MN wrkbot 956 MN 957 SAR x2 961 SBR x1,0&X1 * * Move the stop code into the work area * 968movcod MCW 0&X1,w1 975 SAR x1 979 BW gotwm,1&X1 987 MCW w1,2&X2 994 SBR x2 998 B movcod * 1002gotwm SW wrkbot 1006 BCE twotst,wrkbot&3, one, two or three digits? 1014 MCW err35,222 1021 MCW msg,247 1028 MCW wrkbot&4,228 1035 MCW wrkbot&2,251 1042twotst BCE twodig,wrkbot&2, one or two digits? 1050 B gotcod 1054twodig MCW wrkbot&1,wrkbot&2 1061 MCW k0 1065 B twotst 1069nocode LCA k000,wrkbot&2 use 000 for halt code 1076 C 0&X1 1080 SAR x1 1084gotcod MCW wrkbot&2,w3 1091 A k0,wrkbot&3 1098 C wrkbot&2,w3 code is numeric? 1105 BE nozone yes 1110 BCE notyet,201, Showed a message yet? 1118clrcod MZ k3b,251 clear the code in the message 1125 MZ 1126 MZ 1127 B nozone 1131notyet MCW err35,222 1138 MCW msg,247 1145 MCW wrkbot&2,226 1152 MCW wrkbot&2,251 1159 MCW k3b-2,223 1166 B clrcod 1170nozone BCE nomsg,201, 1178 W 1179 BCV *&5 1184 B *&3 1188 CC 1 1190 CS 299 1194nomsg CW wrkbot 1198 BCE pause,codseq-3,A 1206 LCA branch&3,0&X3 branch back to nop 1213 LCA haltop halt 1217 LCA wrkbot&2 nop with stop code 1221 LCA 1&X1 gmwm 1225 SBR x3 1229 B tstles 1233pause LCA haltop,0&X3 halt 1240 LCA wrkbot&2 nop with stop code 1244 LCA 1&X1 gmwm 1248 SBR x3 1252tstles BCE loop,0,< not too big if less-than not clobbered 1260 CS 332 1264 CS 1265 CC 1 1267 MCW error2,270 1274 W 1275 CC 1 1277 BCE halt,cdovly,1 1285 RWD 1 1290halt H halt 1315err35 DCW @ERROR 35 - HALT NUMBER@ 1333msg DCW @TO BE DISPLAYED AS@ 1364 dc @ @ ORG 1499 1499 DCW @N@ 1500wrkbot equ *&1 1548 dc @ @ ORG 1599 1598work equ * 1602codseq DCW #4 statement code and sequence number 1607light DCW @LIGHT@ 1608kless DCW @<@ 1609w1 DCW #1 1610k0 DCW 0 1613k000 DCW 000 1616w3 DCW #3 1619k3b DCW #3 1620branch B 15992&X3 1624haltop H 1660error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1661gmwm DCW @}@ ex beginn END
- Phase 43 - Sense Light.
JOB Fortran compiler -- Sense light Phase -- phase 43 CTL 6611 * * In-line instructions are generated. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape * ORG 838 838beginn BCE done,0&X1, 846 MCW 0&X1,seqcod 853 BCE slite,seqcod-3,J 861done BSS snapsh,C 866 SBR clearl&3,gmwm 873 LCA ifcond,phasid 880 B loadnx 884slite LCA 0&X1,0&X3 891 SAR x1 895 C 0&X3 899 SAR x3 903 SBR tstbrk&6,1&X1 910 MCW rbrack,1&X1 917 LCA 1&X3,2&X3 924 SBR x3 928 MCW seqcod,w3 935 BWZ *&5,w3,2 943 B *&9 947 BWZ *&15,w3-2,2 955 MCW w3,x2 962 MCW 0&X2,w3 969 BCE syntax,0&X1,} 977 MCW 0&X1,w2 984 BCE tstcod,w2-1,} sense light number is one digit? 992 B syntax 996tstcod MN 0&X1,*&8 1003 BCE sensok,k01234,0 valid sense light number? 1011 chain4 1015syntax CS 332 1019 CS 1020 SW glober 1024 MN w3,245 1031 MN 1032 MN 1033 MCW err36 1037 W 1038 BCV *&5 1043 B *&3 1047 CC 1 1049 SBR x3,4&X3 1056 C 0&X1 1060 SAR x1 1064 B beginn 1068sensok MZ *-4,0&X1 1075 BCE sense0,0&X1,0 1083 MN 0&X1,cw&3 1090 LCA cw&3,0&X3 load CW instruction 1097 SBR x3 1101endstm C 0&X1 1105 SAR x1 1109 LCA 1&X1,0&X3 gmwm 1116 SBR x3 1120tstbrk BCE beginn,0,] not too big if bracket not clobbered 1128 CS 332 1132 CS 1133 CC 1 1135 MCW error2,270 1142 W 1143 CC 1 1145 BCE halt,cdovly,1 1153 RWD 1 1158halt H halt 1162sense0 LCA sw,0&X3 chained sw 1169 LCA sw2&6 sw 82,84 1173 SBR x3 1177 B endstm 1181cw CW 80 1188seqcod DCW #4 1194ifcond DCW @IFCOND@ 1195rbrack DCW @]@ 1198w3 DCW #3 1200w2 DCW #2 1205k01234 DCW @01234@ 1247err36 DCW @ERROR 36 - ILLEGAL SENSE LIGHT, STATEMENT @ 1283error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1284sw SW 1285sw2 SW 82,84 1292gmwm DCW @}@ ex beginn END
- Phase 44 - If (Hardware).
Phases 39 through 44 are essentially the same. In each phase, the residue of statements of the indicated type are substituted into masks of in-line, object-time instructions. The filled-in masks are stored with their identifiers (Phase 32) at the next available locations in lower core.
JOB Fortran compiler -- IF Cond Phase -- phase 44 CTL 6611 * * In-line instructions are generated for IF ( SENSE SWITCH i ) * and IF ( SENSE LIGHT i ) * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape * ORG 838 838beginn BCE done,0&X1, 846 MCW 0&X1,seqno 853 MCW code 854 BCE ifcond,code,W if ( sense switch i ) 862 BCE ifcond,code,K if ( sense light i ) 870done BSS snapsh,C 875 SBR clearl&3,gmwm 882 LCA cont,phasid 889 B loadnx 893ifcond MCW kless,2&X1 900 SBR tstles&6,2&X1 907 LCA 0&X1,0&X3 seqno, code, gmwm 914 SAR x1 918 C 0&X3 922 SAR x3 926 LCA 1&X3,2&X3 replace statement code with gmwm 933 SBR x3 937 MCW 0&X1,on 944 MCW 945 SAR x1 949 MZ x2zone,on-1 956 MZ x2zone,off-1 963 BWZ *&5,seqno,2 971 B *&9 975 BWZ *&15,seqno-2,2 983 MCW seqno,x2 990 MCW 0&X2,seqno 997 B more * 1001bottom C 0&X1 1005 SAR x1 1009 SBR x3,4&X3 1016 B beginn * 1020more MN 0&X1 1024 SAR x1 1028 BCE slite,code,K * * if ( sense switch i ) on, off * 1036 MCW 0&X1,ch 1043 MCW ch,*&8 1050 BCE oksw,k0to6,0 1058 B 1059 B 1060 B 1061 B 1062 B 1063 B 1064 CS 332 1068 CS 1069 SW glober 1073 MN seqno,246 1080 MN 1081 MN 1082 MCW err37 1086 W 1087 BCV *&5 1092 B *&3 1096 CC 1 1098 B bottom * * Sense switch number is OK * 1102oksw A kp1,ch 1109 MN ch,bin 1116 MCW on,bin-1 1123 MCW off,x2 1130 MCW 0&X2,x2 1137 S kp10,x2&1 1144 C seqno,x2 1151 BE same 1156 MCW off,branch 1163 LCA branch,0&X3 1170 LCA bin 1174 SBR x3 1178almost C 0&X1 1182 SAR x1 1186 LCA 1&X1,0&X3 1193 SBR x3 1197tstles BCE beginn,0,< not too big if less-than not clobbered 1205 CS 332 1209 CS 1210 CC 1 1212 MCW error2,270 1219 W 1220 CC 1 1222 BCE halt,cdovly,1 1230 RWD 1 1235halt H halt * 1239same LCA bin,0&X3 1246 SBR x3 1250 B almost * 1254slite MCW 0&X1,ch 1261 MCW ch,1275 1268 BCE oklite,k1234,0 1276 B 1277 B 1278 B 1279 CS 332 1283 CS 1284 SW glober 1288 MN seqno,245 1295 MN 1296 MN 1297 MCW err36 1301 W 1302 BCV *&5 1307 B *&3 1311 CC 1 1313 B bottom * 1317oklite MCW k080,w3 1324 A ch,w3 1331 MCW w3,bw-1 1338 MCW off 1342 MCW w3,sw 1349 MCW on,x2 1356 MCW 0&X2,x2 1363 S kp10,x2&1 1370 C seqno,x2 1377 BE same2 1382 MCW on,branch 1389 LCA branch,0&X3 1396 LCA sw 1400 LCA bw 1404 SBR x3 1408 B almost 1412same2 LCA sw,0&X3 1419 LCA bw 1423 SBR x3 1427 B almost * * Data * 1433off DCW #3 1436on DCW #3 1441bin DCW @B &@ 1442code DCW #1 1445seqno DCW #3 1449branch DCW @B @ 1457bw DCW @V 1@ 1461sw DCW @, @ 1469cont DCW @CONTINUE@ 1470kless DCW @<@ 1471x2zone DCW @K@ 1472ch DCW #1 1479k0to6 DCW @0123456@ 1522err37 DCW @ERROR 37 - ILLEGAL SENSE SWITCH, STATEMENT @ 1523kp1 dcw &1 1525kp10 DCW &10 1561error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1565k1234 dcw 1234 1607err36 DCW @ERROR 36 - ILLEGAL SENSE LIGHT, STATEMENT @ 1610k080 DSA 80 1613w3 DCW #3 1614gmwm DCW @}@ ex beginn END
- Phase 45 - Continue. No object-time instructions are generated for these statements. Only the identifiers (Phase 30) are stored in lower core.
JOB Fortran compiler -- Continue Phase -- phase 45 CTL 6611 * * No object-time instructions are generated for these * statements. This phase passes information required by * the Resort phases of the compiler. * x1 equ 89 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * ORG 838 838beginn BCE done,0&X1, 846 MCW 0&X1,codseq 853 BCE cont,codseq-3,C Continue statement? 861done BSS snapsh,C 866 SBR clearl&3,gmwm 873 LCA domsk,phasid 880 B loadnx 884cont LCA 0&X1,0&X3 891 SAR x1 895 C 0&X3 899 SAR x3 903 LCA 1&X1,2&X3 Replace statement code by gmwm 910 C 0&X1 914 SAR x1 918 B beginn * * Data * 925codseq DCW #4 930domsk DCW @DOMSK@ 931gmwm DCW @}@ ex beginn END
- Phase 46 - Do. DO statements are analyzed for nesting. Illegal nesting is noted. The residue of each DO statement is substituted into an object-time mask; but in general, the exit address is left blank. The partially filled-in mask and its identifier are stored in lower core. An unconditional branch is generated (uniquely) to follow (via Phase 49) the last statement within the range of the DO.
Note: At thus point, the entire source program has been transformed into (essentially) object program procedure. For simplicity, we continue to write "statement" when we mean "procedure compiled from statement."
JOB Fortran compiler -- DO Phase -- phase 46 CTL 6611 * * Strings of unconditional BRANCH instructions and parameters * are generated in-line. An unconditional BRANCH is generated * to follow the last statement within the range of the DO * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps negar2 equ 142 Looks like negary -- see phase 20 docnt equ 151 Count of DO statements glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape loadxx equ 793 Exit from overlay loader * ORG 838 838beginn SW gm,gm3 845 SW gm4,gm2 852 MCW x3,sx3 859loop BW done,0&X1 867 MCW kless,2&X1 mark top of code -- bottom of free 874 SBR tstles&6,2&X1 881 C 0&X1 885 SAR x1 889 C 2&X1,kd Do statement? 896 BU almost no 901 CW 111,112 908 CW 113,114 915 MCW 5&X1,x2 address of sequence number 922 MCW 0&X2,seqno 929 MCW 0&X1,x2 936 SAR x1 940 MCW 0&X2,seqend 947 ZA seqno,seqdif 954 S seqend,seqdif 961 MCW nop,swich1 968 BWZ msg38,seqdif,B illegal range if positive 976 MCW x1,x2 983 MCW kb3,f5 990 MCW kt,longop 997 MCW branch,swich2 1004nested C 0&X2 down to body of stmt below DO 1008 C 1009 SAR x2 1013 C 2&X2,kd Is it a DO statement? 1020 BU notdo 1025 MCW 0&X2,x3 1032 C 0&X3,seqno properly nested? 1039 BH nested yes 1044 C 0&X3,seqend 1051 BH msg39 illegal DO nesting 1056 BCE *&8,1&X2,H co-ending? 1064 MCW ke,1&X2 not co-ending 1071 BL notdo 1076 MCW kh,1&X2 co-ending after all 1083 MCW 5&X2,f5 1090notdo BCE coend,4&X1,H 1098 MCW nop,swich2 1105 BCE *&8,4&X1,} 1113 MCW branch,longop 1120coend MCW seqend,long 1127 SW 6&X1 1131 MCW 8&X1,short 1138 MCW 8&X1,f6 * * Test syntax and generate code * 1145gen B sub 1149 dcw @,@ 1152 DSA f4 1153 B sub 1157 dcw @#@ 1160 DSA f1 1161 B sub 1165 dcw @,@ 1168 DSA f2 1169 BW nrbot,0&X1 1177 B sub 1181 dcw @,@ 1184 DSA f3 1185 BW bottom,0&X1 1193 B msg40 syntax error * 1197bottom MCW sx3,x3 1204 MN 0&X1 1208 SAR x1 1212swich1 NOP tstles 1216swich2 NOP skip 1220 A kp1,docnt 1227 LCA long,0&X3 1234 LCA 1235 LCA 1236 SBR x3 1240skip LCA short,0&X3 1247 chain8 1255 SBR sx3 1259tstles BCE loop,0,< 1267 CS 332 1271 CS 1272 CC 1 1274 MCW error2,270 1281 W 1282 CC 1 1284 BCE halt,cdovly,1 1292 RWD 1 1297halt H halt * * Check the next character against the one at 0&x1, then * check that the next three have numeric parts in 0..9, * that is, they constitute an address. * 1301sub SBR x2 1305 C 0&X1,0&X2 1312 SAR x1 1316 BU msg40 Syntax error if not the expected char 1321 MCW 3&X2,*&7 1328 MCW 0&X1,0 1335 S w1 1339gotdig A kp1,w1 1346 BCE 4&X2,w1,D Exit if three times through loop 1354 MN 0&X1,*&12 1361 SAR x1 1365 BCE gotdig,digits,0 1373 chain9 1382 B msg40 Special character means syntax error * 1386nrbot MCW negar2,f3 1393 B bottom * * Illegal range of DO * 1397msg38 CS 332 1401 CS 1402 SW glober 1406 MN seqno,245 1413 MN 1414 MN 1415 MCW err38 1419 W 1420 BCV *&5 1425 B *&3 1429 CC 1 1431set1 MCW branch,swich1 1438 B gen * * Illegal nesting * 1442msg39 CS 332 1446 CS 1447 SW glober 1451 MN seqno,241 1458 MN 1459 MN 1460 MCW err39 1464 W 1465 BCV *&5 1470 B *&3 1474 CC 1 1476 B set1 * * Syntax error * 1480msg40 CS 332 1484 CS 1485 SW glober 1489 MN seqno,235 1496 MN 1497 MN 1498 MCW err40 1502 W 1503 BCV *&5 1508 B *&3 1512 CC 1 1514 C 1&X1 1518 SAR x1 1522 B tstles * 1526almost SBR x1,5&X1 1533done MCW sx3,x3 1540 MN 0&X3 1544 SAR x2 1548csloop CS 0&X2 1552 SBR x2 1556 C 0&X2,1899 Should this be @1899@??? 1563 BU csloop 1568 BSS snapsh,E 1573 SBR loadxx&3,1175 1580 SBR clearl&3,2499 1587 LCA resort,phasid 1594 B loadnx 1598gm DC @}@ * * Generated code template * 1602 DCW @T924@ 1606 DCW @T921@ 1609f1 DCW #3 1612f2 DCW #3 1615f3 DCW #3 1618f4 DCW #3 1621f5 DCW #3 1622gm2 dc @}@ 1625short dc #3 1626gm3 dcw @}@ 1627longop DCW @T@ 1630f6 DC #3 1631gm4 dc @}@ 1634long dc #3 * * Data * 1637sx3 DCW #3 1638kless DCW @<@ 1639kd DCW @D@ 1642seqno DCW #3 sequence number of do 1645seqend DCW #3 sequence number of final statement of do 1648seqdif DCW #3 seqno - seqend -- better be negative 1649nop NOP 1652kb3 DCW #3 1653kt DCW @T@ 1654branch B 1655ke DCW @E@ 1656kh DCW @H@ 1657kp1 dcw &1 1693error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1694w1 DCW #1 1704digits DCW @0123456789@ 1746err38 DCW @ERROR 38 - ILLEGAL RANGE OF DO, STATEMENT @ 1784err39 DCW @ERROR 39 - ILLEGAL NESTING, STATEMENT @ 1816err40 DCW @ERROR 40 - DO SYNTAX, STATEMENT @ 1824resort DCW @RESORT 1@ 1825 DCW @}@ ex beginn END
- Phase 47 - Resort I. An area is made available for a table to assist in resorting the statements into their original order.
JOB Fortran compiler -- Resort 1 Phase -- phase 47 CTL 6611 * * An area is made available for a table to assist in resorting * the statements into their original order. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps docnt equ 151 Count of DO statements nstmts equ 183 Number of statements, including generated stop snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * sortab equ 2499 Sort table * ORG 838 838w1 DCW 0 841topa DCW 000 tabbot plus 3 x number of statements 844 DCW 000 847tabbot DCW 000 bottom of resort table 850 DCW 000 853 DCW 000 856sx3 DCW 000 859 DCW 000 862topc DCW 000 tabbot plus 3 x number of statements plus 1 865 DCW 000 870topc5 DCW 00000 topc as five digits 875times6 DCW 00000 docnt times 6 880w5 DCW 00000 883topb DCW 000 tabbot plus 3 x number of statements plus 1 884 DCW 0 886zontst DCW 99 for testing zones 891adr5b DCW #5 896adr5 DCW #5 898zones DCW @99@ 900 DCW @Z9@ 902 DCW @R9@ 904 DCW @I9@ 906 DCW @9Z@ 908 DCW @ZZ@ 910 DCW @RZ@ 912 DCW @IZ@ 914 DCW @9R@ 916 DCW @ZR@ 918 DCW @RR@ 920 DCW @IR@ 922 DCW @9I@ 924 DCW @ZI@ 926 DCW @RI@ 928 DCW @II@ * * Convert five-digit address in adr5 to machine form * 929conv53 SBR conv5x&3 933 ZA adr5-3,x1 940 MZ nozone,x1 947 A x1 951 MZ zones-1&X1,adr5-2 958 MZ zones&X1,adr5 965conv5x B 0-0 * * Convert three-character address in adr5 to five digits in adr5b * 969conv35 SBR conv3x&3 973 MCW k5b,adr5b 980 MN adr5,adr5b 987 MN 988 MN 989 MZ adr5,zontst 996 MZ adr5-2,zontst-1 1003 MCW azones,*&11 1010 S adr5 1014tstzon C zontst,0-0 1021conv3x BE 0-0 1026 A k1,adr5b-3 1033 SW tstzon&4 1037 A k002,tstzon&6 1044 CW tstzon&4 1048 B tstzon * * Find next higher GMWM. Leave its address & 1 in x3. * 1052findgm SBR findgx&3 1056 MN 0&X3 1060 SAR x3 1064more MCM 1&X3 1068 MN 1069 SBR x3 1073 BCE more,0&X3,| 1081 SBR x3,1&X3 1088findgx B 0-0 * * Program is too big * 1092toobig CS 332 1096 CS 1097 CC 1 1099 MCW error2,270 1106 W 1107 CC 1 1109 BCE halt,cdovly,1 1117 RWD 1 1122halt H halt * 1126nozone DCW #1 1131k5b DCW #5 1134azones DSA zones 1135k1 dcw 1 1138k002 DCW 002 1174error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ * 1175beginn SBR sx3,0&X3 1182 SBR x1,sortab 1189 SBR tabbot Bottom of code in low core 1193 MCW nstmts,*&14 1200 MZ x1zone,*&6 1207nsx3 SBR x1,0 Compute 1214 A k1a,w1 tabbot plus 1221 C w1,k3 number of statements 1228 BH nsx3 times 3 1233 SBR topa,0&X1 1240 SBR topb,1&X1 1247 MCW kb,w1 1254 BCE *&5,docnt, 1262 B have 1266 SBR topc,1&X1 1273 SBR adr5 1277 B conv35 1281 MCW adr5b,topc5 1288 B not 1292have MCW docnt,times6 1299 A times6 1303 A times6 1307 A docnt 1311 A docnt,times6 1318 SBR adr5,1&X1 1325 B conv35 1329 MCW adr5b,topc5 1336 A times6,topc5 1343 MCW topc5,adr5 1350 B conv53 1354 MCW adr5,topc 1361not MCW sx3,adr5 1368 B conv35 1372 MCW adr5b,w5 1379 C topc5,w5 1386 BH *&5 1391 B toobig 1395 CC 1 1397 CS 332 1401 CS 1402 MCW strtng,243 1409 W 1410 CC K 1412 CS 332 1416 CS 1417 MCW seq,208 1424 MCW strta,242 1431 MCW displa,256 1438 W 1439 CC J 1441 CS 332 1445 CS 1446 LCA k000,208 1453 MCW sx3,x1 1460 SBR x1,2&X1 1467 SBR x3 1471 B findgm 1475 MCW x3,x2 1482 BSS snapsh,C 1487 SBR tpread&6,1175 1494 SBR clrbot 1498 SBR loadxx&3,1175 1505 SBR clearl&3,gmwm 1512 LCA resort,phasid 1519 B loadnx * * Data * 1523x1zone DCW @Z@ 1524k1a dcw 1 1525k3 dcw 3 1526kb DCW #1 1556strtng DCW @STARTING ADDRESS OF STATEMENTS@ 1559seq DCW @SEQ@ 1575strta DCW @STARTING ADDRESS@ 1582displa DCW @DISPLAY@ 1585k000 dcw 000 1593resort DCW @RESORT 2@ 1594gmwm DCW @}@ ex beginn END
- Phase 48 - Resort II. The resort table is filled with the current location of each statement.
JOB Fortran compiler -- Resort 2 Phase -- phase 48 CTL 6611 * * The resort table is filled with the current location * of each statement. * * On entry, x1 and x2 are the bottom of the prefix of the * bottommost statement in high core, and x3 is the bottom * of the bottommost statement in high core. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps seqtab equ 148 Bottom of sequence number table - 2 nstmts equ 183 Number of statements, including generated stop * Beginning of generated code on exit. snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * * Stuff from the previous phase * sx3 equ 844 tabbot equ 847 bottom of resort table sx2 equ 853 w3 equ 859 topc equ 862 tabbot plus 3 x number of statements plus 1 seqno equ 865 sequence number of statement being processed topc5 equ 870 topc as five digits times6 equ 875 docnt times 6 topb equ 883 tabbot plus 3 x number of statements plus 1 flag equ 884 adr5b equ 891 adr5 equ 896 conv53 equ 929 convert five digits in adr5 to address conv35 equ 969 Convert address in adr5 to digits in adr5b findgm equ 1052 find next higher GM * sortab equ 2499 Sort table * ORG 1175 1175beginn MCW topb,x3 1182 B first 1186loop SBR x2,2&X2 1193 MZ x3,sx3 1200 MCW x2,x3 1207 B findgm 1211 MCW x3,x2 1218 MCW sx3,x3 1225first SBR sx2,2&X2 1232 BWZ *&5,0&X2,2 1240 B *&9 1244 BWZ *&19,2&X2,2 1252 MCW 2&X2,x2 1259 MCW 0&X2,x2 get sequence number from table to x2 1266 B *&8 1270 MCW 2&X2,x2 get sequence number to x2 1277 SBR seqno,0&X2 1284 SBR *&14 1288 MZ x2zone,*&6 1295 SBR x2,0 1302 MCW seqno,*&14 1309 MZ x2zone,*&6 1316 SBR x2,0 double sequence number the hard way??? 1323 C sortab&X2,kb3 sort table entry emtpy? 1330 BU *&12 no 1335 MCW x1,sortab&X2 1342 B linked 1346 SW 3&X3 link another statement 1350 MCW sortab&X2,5&X3 of the same sequence number 1357 CW 3&X3 to the table. this can 1361 MCW x1,2&X3 happen with 1368 MCW k1,flag do statements 1375 SBR sortab&X2,2&X3 1382 MZ x1zone,sortab-1&X2 mark first as linked 1389 SBR x3,6&X3 1396linked MCW sx2,x2 1403 C seqtab,sx2 1410 BU what 1415 BCE one,flag,0 1423 MCW k0,flag 1430 MCW x1,x3 1437 B findgm 1441 MZ x1zone,1&X3 1448one MCW topc,x2 1455 LCA colon,0&X2 1462 MCW tabbot,x3 1469 SBR x3,3&X3 1476 MCW 86,adr5 1483 B conv35 1487 MCW adr5b,topc5 1494 SBR adr5,0&X2 1501 B conv35 1505 MCW adr5b,times6 1512 S times6,topc5 1519 BM *&5,topc5 1527 B *&8 1531 A k16k,topc5 1538 MCW topc5,adr5 1545 B conv53 1549 MCW adr5,w3 1556 SBR x2,1&X2 1563 SBR nstmts 1567 BSS snapsh,C 1572 SBR clearl&3,gmwm 1579 LCA resort,phasid 1586 B loadnx * 1590what MCW x3,sx3 1597 MCW x1,x3 1604 B findgm get up to next statement 1608 MCW x3,x1 1615 MCW sx3,x3 1622 BCE oneb,flag,0 1630 MCW k0,flag 1637 MZ x1zone,1&X1 1644oneb SBR x1,4&X1 1651 B loop * * Data * 1655x2zone DCW @R@ 1658kb3 DCW #3 1659k1 dcw 1 1660x1zone dcw @Z@ 1661k0 DCW 0 1662colon DCW @:@ 1667k16k DCW 16000 1675resort DCW @RESORT 3@ 1676gmwm DCW @}@ ex beginn END
- Phase 49 - Resort III. The statements are resorted back into their original order with the identifiers eliminated. The Table II entries (sequence numbers of statements originally labeled with statement numbers) are replaced by the current machine addresses of those statements. Exit addresses are substituted into the procedure generated for DO statements (Phase 46). For each executable statement, the sequence number and the object-time starting address of the generated procedure are printed.
JOB Fortran compiler -- Resort 3 Phase -- phase 49 CTL 6611 * * The source program is resorted back to its original order. * The statement number table is filled with the current location * of each statement. * * On entry X3 is at the bottom entry in the sort table and * X2 is one above the colon that marks the top of the sort table. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps seqtab equ 148 Bottom of sequence number table - 2 snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * * Stuff from the previous phase * topa equ 841 tabbot plus 3 x number of statements sx1 equ 844 sx3a in previous phase next equ 850 next sort table entry to process sx3a equ 853 sx2 in previous phase sx3 equ 856 w3 equ 859 topc equ 862 tabbot plus 3 x number of statements plus 1 seqno equ 865 sequence number of statement being processed topc5 equ 870 topc as five digits times6 equ 875 docnt times 6 w5 equ 880 flag equ 884 adr5b equ 891 adr5 equ 896 conv35 equ 969 Convert address in adr5 to digits in adr5b findgm equ 1052 find next higher GM toobig equ 1092 * sortab equ 2499 Sort table * ORG 1175 1175beginn SW gm 1179 B *&8 1183loop SBR x3,0-0 1190 SBR next 1194middle BCE empty,0&X3, 1202 SBR loop&6,3&X3 1209 MN 0&X3 1213 SAR *&7 1217 BWZ indir,0-0,S 1225 MCW 0&X3,x1 1232indirb SBR topc,0&X3 1239inner MCW x1,sx1a 1246 MCW x1,x3 1253 B findgm get address & 1 of GM above statement 1257 MCW x3,adr5 1264 B conv35 1268 MCW adr5b,w5 Address &1 of GM above statement 1275 A k1,w5 1282 MCW sx1a,adr5 Address of statement 1289 B conv35 1293 MCW adr5b,w5b 1300 S w5b,w5 length of statement 1307 MCW x2,adr5 1314 B conv35 1318 MCW adr5b,topc5 top of table & 2 1325 B test 1329 BL moved1 1334newstm MCW sx1a,x1 1341 BCE *&12,f1,1 1349 A k1,208 1356 B report * 1360 MCW k0,f1 1367 MCW x3,sx3b&6 1374 MCW 3&X1,x3 1381 MCW 0&X3,x3 1388 SBR 3&X1,4&X3 1395 MA w3,3&X1 1402 MCW x1,sx1b 1409dezone MZ *-4,9&X3 1416 MZ *-4,12&X3 1423 MZ *-4,15&X3 1430 MZ *-4,18&X3 1437 BCE dezonx,22&X3, 1445 MCW 22&X3,x1 1452 MCW 0&X1,22&X3 1459 MA k004,22&X3 1466 MA w3,22&X3 1473 MCW 0&X1,x3 1480 B dezone 1484dezonx SBR 22&X3,4&X2 1491 MA w3,22&X3 1498 MCW sx1b,x1 1505 BCE *&8,0&X1,B 1513 SBR 3&X1,918 ??? 1520sx3b SBR x3,0-0 1527report MCW w3,227 1534 MA x2,227 1541 MCW 227,x3 1548 MCW x3,adr5 1555 B conv35 convert adr5 to adr5b 1559 MCS adr5b,244 1566 MCW x3,256 1573 MA k004,256 1580 W 1581 BCV *&5 1586 B *&3 1590 CC 1 1592 MCW x2,link2&6 1599 BCE endstm,0&X1,} gm 1607 MN 0&X2 1611 SAR x2 1615more MCM 0&X1 1619 SAR newx1&6 1623 MCM 0&X1,1&X2 move code down 1630 MN 1631 SBR x2 1635newx1 SBR x1,0-0 1642 BCE more,0&X2,| 1650 B *&15 v3m4 1654endstm SBR x1,1&X1 v3m4 1661 MCW branch,switch v3m4 1668 BWZ *&5,0&X1,2 v3m4 1676 B link1 v3m4 1680 BWZ mark,2&X1,2 v3m4 1688link1 MCW 2&X1,x3 prefix is addr of statement number 1695link2 SBR 0&X3,0-0 start of statement to stmt num tbl 1702mark MCW colon,0&X1 1709switch NOP endst2 1713 MN 0&X1 1717 MN 1718 SAR x1 1722 MN 0&X2 1726 SAR *&7 1730setwms LCA 0&X1,0&X2 set word marks in moved-down code 1737 SBR *-4 1741 C 0&X1 1745 SAR x1 1749 BCE *&5,0&X1,} gm 1757 B setwms * 1761endst2 MCW nop,switch 1768 C next,topa 1775 BU contin * 1780done LCA colon,0&X2 1787 SBR x3 1791 BSS snapsh,C 1796 SBR clearl&3,gmwm 1803 LCA resort,phasid 1810 B loadnx * 1814contin BCE indir2,flag,1 1822 B loop * * Sort table entry is the address of another one * 1826indir MCW 0&X3,x3 1833 MCW 0&X3,x1 1840 SBR newx3&3,3&X3 1847 MCW k1,flag 1854 B indirb * 1858indir2 MCW k0,flag 1865newx3 MCW 0-0,x1 1872 MCW newx3&3,topc 1879 MCW k1,f1 1886 B inner * 1890test SBR testx&3 1894 MCW sx3,adr5 1901 B conv35 convert adr5 to adr5b 1905 MCW adr5b,times6 1912 S topc5,times6 1919 C w5,times6 1926testx B 0-0 * * Empty cell in sort table * 1930empty A k1,208 1937 C next,topa 1944 BE done 1949 SBR x3,3&X3 1956 SBR next 1960 B middle * 1964moved SBR sx3,2&X3 1971moved1 MCW sx3,x3 1978 SBR x3,2&X3 1985 B findgm 1989 BCE moved,0&X3,: colon means statement already moved 1997 B test 2001 BL *&5 2006 B newstm * 2010 SBR sx2a&6,0&X2 2017tsttop C x3,topcor 2024 BE attop 2029 SBR x1,3&X3 2036 BCE nextab,0&X1,} gm 2044attop B test 2048 BL toobig 2053 B sx2a 2057nextab SBR x3,4&X3 2064nextb1 B findgm 2068 C 0&X3,colon 2075 BU tsttop 2080 SBR nextx1&6,0&X3 2087 SBR sx3a,2&X3 2094 SBR x3,3&X3 2101loop2 LCA 0&X1,0&X3 2108 SAR x1 2112 C 0&X3 2116 SAR x3 2120 BCE *&5,0&X1,} gm 2128 B loop2 2132 MN 0&X1 2136 SAR sx1 2140nextx1 SBR x1,0-0 2147 BWZ *&5,1&X1,S 2155 B *&8 2159 MCW k1,f2 2166 BWZ *&5,0&X1,2 2174 B *&9 2178 BWZ *&19,2&X1,2 2186 MCW 2&X1,x1 2193 MCW 0&X1,x2 2200 B *&8 2204 MCW 2&X1,x2 2211 SBR seqno,0&X2 2218 SBR *&14 2222 MZ x2zone,*&6 2229 SBR x2,0-0 2236 MCW seqno,*&14 2243 MZ x2zone,*&6 2250 SBR x2,0-0 2257 BWZ *&12,sortab-1&X2,S 2265 SBR sortab&X2,1&X3 2272 B skip2 2276 MCW sortab&X2,x1 2283 BCE *&12,f2,1 2291 SBR 3&X1,1&X3 2298 B *&15 2302 SBR 0&X1,1&X3 2309 MCW k0,f2 2316skip2 C sx1,sx3 2323 BE loop2x 2328 MCW sx1,x1 2335 MN 0&X3 2339 MN 2340 MN 2341 SAR nextx1&6 2345 SBR x1,1&X1 2352 B loop2 2356loop2x LCA gm,0&X3 2363 SBR sx3 2367 C seqtab,sx3a 2374 BE atbot 2379 MCW sx3a,x3 2386 SBR x1,1&X3 2393 SBR x3,2&X3 2400 B nextb1 * * At bottom of sort table * 2404atbot B test 2408 BL toobig 2413sx2a SBR x2,0-0 2420 MCW topc,x3 2427 MCW 0&X3,sx1a 2434 B newstm * * Data * 2442w5b DCW 00000 2443f1 DCW 0 2444f2 DCW 0 2447sx1a DCW #3 2448k1 dcw 1 2449k0 DCW 0 2452sx1b DCW #3 2455k004 DSA 4 2456branch B 2457colon DCW @:@ 2458nop NOP 2466resort DCW @RESORT 4@ 2467x2zone DCW @R@ 2468gm dc @}@ 2469gmwm DCW @}@ ex beginn END
- Phase 50 - Resort IV. The statements are shifted to the places they will occupy at object time. The Table II entries are bumped accordingly.
JOB Fortran compiler -- Resort 4 Phase -- phase 50A CTL 6611 * * The statements are relocated to the positions they will occupy * at object time. The statement number table is adjusted to * to show the object time locations of the statements. * * On entry X3 is at the top of the moved-down code. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps tblbot equ 145 One below numbers, formats, I/O lists seqtab equ 148 Bottom of sequence number table - 2 nstmts equ 183 Number of statements, including generated stop snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * * Stuff from the previous phase * w3 equ 859 topc5 equ 870 topc as five digits adr5b equ 891 adr5 equ 896 conv35 equ 969 Convert address in adr5 to digits in adr5b toobig equ 1092 * ORG 1175 1175beginn MCW seqtab,x1 1182 SBR x1,1&X1 1189 C tblbot,x1 1196 BE atbot 1201loop SBR x1,3&X1 1208 MCW 0&X1,x2 1215 BWZ *&12,x2-1,2 1223 MCW 0&X2,0&X1 1230 B tstbot 1234 MA w3,x2 1241 MCW x2,0&X1 1248tstbot C x1,tblbot 1255 BU loop 1260atbot MCW w3,x1 1267 MA x3,x1 1274 MCW x1,newx3&6 1281 SBR adr5,0&X3 1288 B conv35 1292 MCW adr5b,topc5 1299 MCW adr5b,w5 1306 MCW w3,adr5 1313 B conv35 1317 A adr5b,topc5 1324 C k16000,topc5 1331 BL *&8 1336 S k16000,topc5 1343 MCW seqtab,adr5 1350 B conv35 1354 C adr5b,topc5 1361 BH toobig 1366 MZ x1,tstzon&7 1373 MCW x1-2,tstchr&7 1380 MCW nstmts,x2 1387 MA w3,nstmts 1394 C topc5,w5 1401 BH findw2 1406more LCA 0&X3,0&X1 1413 SAR x3 1417 C 0&X1 1421 SAR x1 1425 BCE *&5,0&X3,: At top of moved-up code 1433 B more * * Done * 1437csloop CS 0&X1 1441 SBR x1 1445 C x1,botclr At the bottom of core to clear? 1452 BU csloop no, clear more 1457 CW 0&X1 1461 CW 1462 CW 1463newx3 SBR x3,0 1470 SW 0&X1,1&X3 1477 MCW w3,x2 1484 BSS snapsh,D 1489 SBR clearl&3,gmwm 1496 LCA shift,phasid 1503 B loadnx * * Move the code to its final place * 1507findwm MA a001,x2 why not sbr x2,1&x2 ??? v3m4 1514findw2 BW *&5,1&X2 1522 B findwm 1526 MCW x2,x1 1533 MA w3,x1 1540 LCA 0&X2,0&X1 move one field to its final place 1547 C x2,x3 1554 BU findwm 1559 LCA kb2,2&X3 1566 CW 1&X3 1570tstzon BWZ tstchr,x3,2 clear moved-away code 1578 CS 0&X3 1582 SBR x3 1586 B tstzon 1590tstchr BCE clr00f,x3-2,0 1598 CS 0&X3 1602 SBR x3 1606 B tstchr 1610clr00f C x3,x1 1617 BE clrfin 1622 LCA kb1,0&X3 1629 CW 0&X3 1633 SBR x3 1637 B clr00f 1641clrfin MCW nstmts,x1 1648 MA k15999,x1 1655 B csloop * * Data * 1663k16000 DCW 16000 1668w5 DCW #5 1671botclr DSA downto test for bottom of clearing 1680shift DCW @SHIFT CFL@ 1681kp1 dcw &1 1683kb2 DCW #2 1684kb1 DCW #1 1687k15999 DSA 15999 1690a001 DSA 1 v3m4 1691gmwm DCW @}@ org *&x00 downto equ * ex beginn END
JOB Fortran compiler -- Shift CFL Phase -- phase 50B CTL 6611 * * Constants, formats and list strings are moved into their * object core-storage locations above array storage. Array * storage-area is cleared. * * On entry X3 is at the top of the moved-down code. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps tblbot equ 145 One below numbers, formats, I/O lists seqtab equ 148 Bottom of sequence number table - 2 arysiz equ 160 Total array size & 2 negary equ 163 16000 - arysiz arytop equ 194 Top of arrays in object code snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Stuff from the previous phase * adr5b equ 891 adr5 equ 896 conv35 equ 969 Convert address in adr5 to digits in adr5b toobig equ 1092 * ORG 1175 1175beginn C topcor,arytop 1182 BE done 1187 MCW seqtab,x1 1194 MCW seqtab,x2 1201 MA negary,x2 1208 SBR sx3&6,0&X3 1215 CW adr5-2 1219 MCW x2,adr5 1226 B conv35 1230 MCW adr5b,w5a 1237 MCW x3,adr5 1244 B conv35 1248 MCW adr5b,w5b 1255 C w5a,w5b 1262 BH toobig 1267 MCW seqtab,adr5 1274 B conv35 1278 MCW adr5b,w5c 1285 MCW arytop,adr5 1292 B conv35 1296 MCW adr5b,w5d 1303 C w5c,w5d 1310 BIN testmv, v3m4 * * Move sequence number table down by the array size * 1315seqmv MA ka001,x1 1322 MA ka001,x2 1329 BW seqmv3,0&X1 1337 CW 0&X2 1341 MN 0&X1,0&X2 1348 MZ 0&X1,0&X2 1355seqmv2 CW 0&X1 1359 C x1,arytop 1366 BU seqmv 1371 MCW arytop,x3 1378 B nosqv2 1382seqmv3 LCA 0&X1,0&X2 1389 B seqmv2 * * Don't move the sequence number table * 1393nosqmv MCW seqtab,x3 1400nosqv2 BW *&9,1&X3 1408 CW flag 1412 SW 1&X3 * * Move constants and strings up * 1416 MCW topcor,x1 1423 MCW arytop,x2 1430moveup LCA 0&X1,0&X2 1437 SBR x2 1441 SBR x1 1445 MA arysiz,x1 1452 C x1,x3 1459 BU moveup 1464 BW sx3,flag 1472 MA negary,x3 1479 CW 1&X3 1483sx3 SBR x3,0 1490 MA negary,83 1497 MA negary,tblbot 1504 MA negary,seqtab 1511 MCW topcor,x1 1518csloop C x1,arytop 1525 BE done 1530 MCW kb1,0&X1 1537 CW 0&X1 1541 SBR x1 1545 B csloop * 1549done BSS snapsh,C 1554 SBR tpread&6,838 1561 SBR clrbot 1565 SBR loadxx&3,838 1572 SBR clearl&3,gmwm 1579 LCA replac,phasid 1586 B loadnx * * Data * 1594w5a DCW #5 1599w5b DCW #5 1604w5c DCW #5 1609w5d DCW #5 1612ka001 DSA 1 1613flag DCW #1 1614kb1 DCW #1 1623replac DCW @REPLACE 1@ 1624testmv BH seqmv v3m4 1629 BIN nosqmv, v3m4 1634gmwm DCW @}@ ex beginn END
- Phase 51 - Replace I. The entire object program procedure is scanned for indirect addresses (see note following Phase 31). Each indirect address is replaced by its direct address-now available in Table II.
JOB Fortran compiler -- Replace phase one -- phase 51 CTL 6611 * * Object-time instructions which reference statement numbers * are corrected to the object-time addresses of the * statement. Subscript strings are cleaned up. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps subscr equ 116 WM cleared if subscript code needed seqtab equ 148 Bottom of sequence number table - 2 botfmt equ 154 Bottom of format strings or number table - 1 negary equ 163 16000 - arysiz snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Runtime routines * aritf equ 700 Arithmetic interpreter * ORG 838 838beginn MCW x3,sx3 845 MCW seqtab,*&7 852 MCW kgreat,0 859 MCW botfmt,x2 866 MCW kgreat,1600 873getsub BCE find,0&X2,$ within ten of top of subscript? v3m4 881 chain9 890botex BCE bottom,0&X2,> greater sign below code? 898 chain9 907 SBR x2 911 B getsub 915getsb2 BCE subtop,0&X2,$ top of subscript? 923 SBR x2 927 B getsb2 931subtop MN 0&X2 935 SAR x2 939 BCE subbot,0&X2,$ within 16 of bottom of subscript? 947 chain15 962 B getsub 966subbot CW subscr 970dec3 MN 0&X2 974 MN 975 MN 976 SAR x2 980 SW 1&X2 984 BCE dec1,0&X2,$ 992 MZ *-4,2&X2 999 B dec3 1003dec1 MN 0&X2 1007 SAR x2 1011 B getsub 1015bottom MCW apass2,botex&3 1022 MCW x3,x2 1029 B getsub 1033pass2x BCE done,0&X3, 1041 MCW x3,link&6 1048 C 0&X3 1052 SBR x2 1056 SBR x3 1060 BCE taritf,1&X3,| Top of arithmetic assignment 1068testwm BW pass2x,4&X2 1076 BWZ 1077 BWZ 1078 BM nolink,3&X2 1086 C 4&X2,a277x3 1093 BE pass2x 1098 BWZ addlnk,3&X2,B 1106bumpx2 SBR x2,3&X2 1113 B testwm 1117addlnk MCW 4&X2,x1 why not just MA 4&x2,link&6 ??? 1124 MZ *-6,*&6 x1 tag 1131link SBR 4&X2,0 1138 B bumpx2 1142nolink MCW 4&X2,x1 1149 MA negary,x1 1156 MCW 0&X1,x1 1163 MCW x1,4&X2 1170 B bumpx2 1174taritf BW *&5,2&X3 Need to look for branch to aritf? 1182 B pass2x 1186faritf C 0&X3 Find the branch to aritf 1190 SBR x3 1194 C 4&X3,baritf&3 Branch to arithmetic interpreter? 1201 BE pass2x yes 1206 B faritf no, look again 1210done MCW sx3,x3 1217 BSS snapsh,C 1222 SBR loadxx&3,934 1229 SBR clearl&3,gmwm 1236 LCA load52,phasid 1243 B loadnx 1249sx3 DCW #3 1250kgreat DCW @>@ greater than sign 1253apass2 DSA pass2x 1256a277x3 DSA 277&X3 1257baritf B aritf 1270load52 DCW @LOAD 52B&C@ 1271find BCE botex,0&X2,> greater sign below code? v3m4 1279 BCE subtop,0&X2,$ top of subscript? v3m4 1287 SBR x2 v3m4 1291 BIN find, v3m4 1296gmwm DCW @}@ ex beginn END
- Phase 52 - Function/Subroutine Loader. Relocatable function routines and subroutines (which comprise Phase 53) are selectively loaded. A table of starting addresses of these routines is created in free storage.
JOB Fortran compiler -- Load Phases 52BC -- phase 52A CTL 6611 * * As the object coding may originate at 1697, the coding for * phase 52 must be split into two parts, the first of which * replaces the snapshot coding in positions 333-680. This * phase loads the two sections. * x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Address in normal format routine * iolist equ 2132 * ORG 838 840exlink DCW #3 139 I xlinkf entry address 843 DCW #3 138 H user function 12 entry address 846 DCW #3 137 D user function 11 entry address 849 DCW #3 136 M user function 10 entry address 852 DCW #3 135 L user function 09 entry address 855 DCW #3 134 K user function 08 entry address 858 DCW #3 133 J user function 07 entry address 861 DCW #3 132 Z user function 06 entry address 864 DCW #3 131 Y user function 05 entry address 867 DCW #3 130 W user function 04 entry address 870 DCW #3 129 P user function 03 entry address 873 DCW #3 128 U user function 02 entry address 876user1 DCW #3 127 R user function 01 entry address 879 DCW #3 126 Q sqrtf entry address 882 DCW #3 125 F floatf entry address 885 DCW #3 124 X xfixf entry address 888 DCW #3 123 N negation entry address 891 DCW #3 122 A absf entry address 894 DCW #3 121 T atanf entry address 897 DCW #3 120 E expf entry address 900 DCW #3 119 G logf entry address 903 DCW #3 118 SC sinf or cosf entry address 906 DCW #3 117 series 909 DCW #3 116 subscript 912 DSA iolist 115 I/O list and not limited format 915 DCW #3 114 I/O list 918 DCW #3 113 921 DCW #3 112 924funtab DCW #3 111 927 DSA funtab 930conbot DCW #3 bottom of constants - 1 933arybot DCW #3 bottom of arrays - 1 * 934beginn B setup v3m4 938loadc SBR tpread&6,beginn 945 SBR clrbot 949 SBR loadxx&3,337 956 SBR clearl&3,gmwm 963 LCA funldc,phasid 970 B loadnx 982funldc DCW @FUNLOAD C@ 983loadb SBR tpread&6,333 990 SBR clrbot,loadb 997 BSS snapsh,C 1002 SBR loadxx&3,loadc 1009 SBR clearl&3,gmwm 1016 LCA funldb,phasid 1023 B loadnx 1035funldb DCW @FUNLOAD B@ 1036setup BWZ *&5,x3,2 v3m4 1044 B loadb v3m4 1048 BWZ *&5,x3-2,S v3m4 1056 B loadb v3m4 1060 SBR x3,2000 v3m4 1116 BIN loadb, v3m4 ORG 1696 1696gmwm DCW @}@ ex beginn END
JOB Fortran compiler -- Loader Phase -- phase 52B CTL 6611 * * Relocatable function routines and subroutines are loaded. * A table of the starting addresses of these routines is * created. * * Relocation of relocatable functions in the 1401 Fortran * compiler is accomplished by tagging the load instruction in * location 40, and the subsequent set word mark instructions, to * indicate what fields are to be relocated. It is assumed that * they are relocated by the load address less 2000, since they * are assembled to be loaded at 2000. The utility that converts * Autocoder decks to relocatable form assumes addresses above * 2000 are to be relocated. * * If the index tag of the A field of the load instruction has A * and B zones, it means the B address of the load instruction and * both addresses of the set word mark instructions, except those * that are 040, are to be relocated. Otherwise they are not to * be relocated. If the index tag of the B address of the load * instruction has an A zone it indicates that only the B address * (word mark + 4--6) of the first field is to be relocated, If * it has an B zone it indicates that only the A address (word * mark + 1--3) is to be relocated. If it has both A and B zones * it indicates that both addresses are to be relocated. * * If the index tag of either address in a set word mark * instruction has an A zone it indicates that only the B address * (word mark + 4-6) of the tagged field is to be relocated, If * it has an B zone it indicates that only the A address (word * mark + 1-3) is to be relocated. If it has both A and B zones * it indicates that both addresses are to be relocated. * * The beginning of the series routine used by the transcendental * functions is marked by underscore characters (11-7-8) in * columns 1-5 of the first load card. The base address is saved * at this point in SERBAS. Then, addresses above 4k, which are * above 14k, are converted to addresses above 2k, and relocated * by SERBAS. This is done so that the transcendental function * routines can access addresses within the series function. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps func1 equ 111 Switch to select first relocatable func sincos equ 118 Saw sinf or cosf if no WM funcn equ 139 Switch to select last relocatable func gotxl equ 185 XLINKF was loaded reltab equ 188 Top of relocatable functions & 1 arytop equ 194 Top of arrays in object code snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Stuff in previous phase (52A) * exlink equ 840 139 I xlinkf entry user1 equ 876 127 R user function entry sx2 equ 927 conbot equ 930 bottom of constants - 1 arybot equ 933 bottom of arrays - 1 * ORG 333 333 H 333 337beginn CS 80 341 MCW x3,sx3 348 SBR x3,1&X3 355 SW 1,40 set word 362 SW 47,54 marks to 369 SW 61,68 read relocatable 376 SW 72 subprograms 380 MCW cdovly,rdcard cards if 1, tape if NOP 387 B rdrec skip boundary -- five brackets 391 MCW 83,x2 398 MN 0&X2 402 MN 403 SBR tstund&6 407 MCW kund1 too big if this gets clobbered 411 NOP 412outer MCW x3,add14k&3 419 MZ branch,add14k&2 x3 zone 426 MCW k14k,x3 * why not sbr x3,0-0 ??? 433add14k NOP 0-0 subtract 2000 from x3 because 437 SAR x3 reloctables org at 2000 441getund B rdrec 445chkund C 5,kund4 does record begin with underlines 452 BU notund no 457 MCW x3,serbas save base address for series function 464 B getund yes, get another record 468notund MCW afunc1,x1 next load switch 475sbrnop SBR afunc1,1&X1 nop for second pass SIN flag 482 C x1,afuncn end of load flags? 489 BE switch yes 494 MCW sbr,sbrnop 501 C sx2,auser1 508swich1 BE gotusr user functions? 513retusr MCW sx2,x2 decrement 520 C 0&X2 function table 524 SAR sx2 pointer 528 BW skip,0&X1 Don't need deck if WM in load flag 536mcwnop MCW nop,swich2 allow storing load address unless nop 543tstrel BWZ norel,42,2 No relocation 551 MN 46,load&6 load from where 558 chain5 563 MZ 46,load&6 load to where 570 MN dont clobber x3 zone tag 571 MZ 572load LCA 0,0&X3 load the field from the record 579 SBR x2 583swich2 NOP mz45 skip storing load address if branch 587 MCW sx2,x1 594 SBR 3&X1,1&X2 store function load address 601 MCW branch,swich2 skip over storing load address 608mz45 MZ 45,savzon relocation tag for first field 615 B reloc 619 S x1&1 623loop C 50&X1,a40 why not BCE norelx,50&x1,0 ??? 630 BE norelx at WM address 040 or at 1040 instr 635 MCW 50&X1,swcw&3 642 MZ branch,swcw&2 x3 tag 649 BCE swcw,swcw,) 657 MCW sw,swcw in case we are doing the B field 664swcw SW 0&X3 set or clear relocated word mark 668 SAR x2 672 B cont branch around phase loader 676 NOP 0 680 DCW @}@ EX loadxx JOB Fortran compiler -- Loader Phase -- phase 52C ORG 934 934cont MZ 49&X1,savzon relocation tag from SW instruction 941 B reloc * Add either 3 or 4 to x1 to get to next SW address * This would be simpler if SBR/NOP x1,1&x1 then SBR x1,3&x1 ??? 945nopadd NOP k4,x1 sometimes add, sometimes nop 952addnop A k3,x1 sometimes add, sometimes nop 959 BCE exch43,nopadd,A 967 MCW add,nopadd 974 MCW nop,addnop 981 BCE nopadd,swcw,) ??? 989 B loop 993exch43 MCW nop,nopadd 1000 MCW add,addnop 1007 B loop * * Done with relocation of one deck * 1011norelx MCW 46,where top address loaded? 1018 MCW nop,nopadd reset add 3/4 1025 MCW add,addnop toggle 1032 B rdrec 1036 BCE exend,68,B EX card? 1044 BCE exend,40,/ END card? 1052 B tstrel 1056exend MCW where,*&11 can we use load&6 here ??? 1063 MZ branch,*&3 x3 tag 1070 NOP 0&X3 1074 SAR x3 1078 SBR sx3 1082 SBR x3,1&X3 next function load address 1089tstund BCE outer,0,_ not too big if still underline 1097 CS 332 1101 CS 1102 CC 1 1104 MCW error2,270 1111 W 1112 CC 1 1114 BCE halt,cdovly,1 1122 RWD 1 1127halt H halt * * No relocation, simply execute the load code * 1131norel SBR 71,norelx 1138 MCW branch,68 1145 B 40 * * Read a record of the relocatable library either * from card or tape * 1149rdrec SBR rdrecx&3 1153 MCW kb1,1 in case it was a GM in the prev record 1160rdcard R rdrecx NOP if loaded from tape 1164reread MCW kp9,errcnt 1171rdtape RT 1,1 1179 BER taperr 1184rdrecx B 0 * 1188taperr BSP 1 1193 S kp1,errcnt 1200 BWZ rdtape,errcnt,B 1208 NOP 3333 1212 H 1213 B reread * * Relocate fields of loaded instructions * 1217reloc SBR relocx&3 1221 BWZ relocx,savzon,2 No relocation 1229 BWZ relx1,savzon,S B field relocation only 1237 MCW x3,sx3 1244 BWZ relnz1,4&X2,2 is relocated field below 4k 1252 MCW serbas,x3 no, must be above 14k = 16k-2k 1259 MZ *-4,4&X2 thousands tag set to 2 1266relnz1 MA x3,4&X2 Relocate A field 1273 MCW sx3,x3 1280 BM relocx,savzon A field relocation only 1288relx1 MCW x3,sx3 1295 BWZ relnz2,7&X2,2 is relocated field below 4k 1303 MCW serbas,x3 no, must be above 14k = 16k-2k 1310 MZ *-4,7&X2 thousands tag set to 2 1317relnz2 MA x3,7&X2 Relocate B field 1324 MCW sx3,x3 1331relocx B 0 * * Don't need the function * Skip until end or ex record * 1335skip B rdrec 1339 BCE getund,40,/ 1347 BCE getund,68,B 1355 B skip * * Got to end of load flags * Start over at SINCOS to store the entry table * 1359switch NOP done second time it is a branch 1363 MCW branch,switch only do this once 1370 SBR afunc1,sincos start over at sincos 1377 MCW sx3,x2 1384 SBR reltab,1&X2 relocatable entry table address 1391 MCW nop,sbrnop 1398 MCW nop,mcwnop 1405 MCW branch,swich2 skip storing load address 1412 MCW sx3,sx3d 1419 B chkund * * Down to user functions in the address table * 1423gotusr MCW sx3,sx3c save first user function address 1430 MCW nop,swich1 1437 B retusr * 1441done MCW sx3,x3 top of function entry table 1448 MCW topcor,x2 1455 C 0&X2 1459 SAR x2 1463 SBR arybot bottom of arrays - 1 1467 C 0&X2 1471 SAR conbot bottom of constants - 1 1475 BCE blank,exlink, is xlinkf loaded 1483 MCW exlink,x1 yes 1490 MA a13,x1 why not MCW arytop,13&x1 ??? 1497 MCW arytop,0&X1 store within XLINKF 1504 CW gotxl 1508blank MCW sx3c,x1 first user function address 1515 MCW sx3d,x2 last function load address & 1 1522 SBR tpread&6,934 1529 SBR clrbot 1533 SBR loadxx&3,934 1540 SBR clearl&3,1696 1547 LCA reload,phasid 1554 B loadnx * * Data * 1560k14k DSA 14000 14000 is 16000-2000 1563afunc1 DCW func1 address of first function switch 1564 dc #1 1565kund1 DCW @_@ one underline character 1566branch B 1570kund4 DCW @____@ four underline characters (11-7-8) 1573serbas DCW #3 base address for series function 1576afuncn DSA funcn&1 address of last function switch 1577sbr SBR 1580auser1 DSA user1 first user function entry 1581nop NOP 1582savzon DCW #1 1585a40 DSA 40 1586sw SW 1587k4 dcw 4 1588k3 dcw 3 1589add A 1592where DCW #3 1628error2 DCW @MESSAGE 2 - OBJECT PROGRAM TOO LARGE@ 1629kb1 DCW #1 1630kp9 DCW &9 1631errcnt DCW #1 tape error counter 1632kp1 dcw &1 1635sx3 DCW #3 1638sx3d DCW #3 1641sx3c DCW #3 1644a13 DSA 13 1653reload DCW @RELOAD SS@ 1654 DCW @}@ ex beginn END
- Phase 53 - Relocatable Package. This phase consists of the relocatable routines loaded by Phase 52.
JOB Fortran compiler -- Reloading Snapshot -- Phase 53R CTL 6611 * * The snapshot coding which was replaced by 52B is retained. * If a snapshot is requested for phases 52 and 53, it is taken * at this point. * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot xqtd equ 680 GMWM should be D in EXECUTED loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 934 934beginn B begin1 * * Load the format package * 938begin2 MCW d,xqtd Replace GMWM with D making EXECUTED 945 CW xqtd and clear the WM 949 BSS snapsh,C 954 SBR tpread&6,beginn 961 SBR clrbot 965 SBR loadxx&3,beginn 972 SBR clearl&3,gmwm 979 LCA format,phasid 986 B loadnx 990D dcw @D@ 999format DCW @FORMATPAK@ * * Reload the snapshot phase 53S * 1000begin1 SBR tpread&6,snapsh 1007 SBR clrbot,begin1 1014 SBR loadxx&3,begin2 1021 SBR clearl&3,gmwm 1028 LCA snap53,phasid 1035 B loadnx 1048snap53 DCW @SNAPSHOT53@ ORG 1696 1696gmwm DCW @}@ ex beginn END
JOB Fortran compiler -- Snapshot -- Phase 53S CTL 6611 * * Same as snapshot in phase 00 * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 topcor equ 688 Top core address from PARAM card * * Return in phase 53R after loading * begin2 equ 938 * ORG 333 333snapsh SBR exit&3 337 SBR sxx&6 341 MCW kz3,adr5-2 Start five-digit address at zero 348 MCW x3,sx3&6 355 MCW x1,sx1&6 362 SBR x1,1 369 SBR x3,202 376 CS 332 380 CS 381 MCW phasid,210 388 BSS skip,F * * Print a header * 393 CC 1 395 MCW x2,250 402sxx SBR 216,0 return address was stored in B 409sx3 SBR 256,0 x3 was stored in B 416sx1 SBR 244,0 x1 was stored in B 423 W 424 CC K 426 ZA kp2,w2a 433clearh CS 332 437 CS 438 CC J 440 MCW adr5,306 five-digit address 447 MCW 448 SBR loop&6 452 MCW k9,w2b-1 459loop MCW w2b-1,000 466 MCW dots 470 SBR loop&6 474 A km10,w2b add I0 = -10 481 BWZ loop,w2b-1,2 no zone in counter high digit? 489 A kp1,adr5-2 bump hundreds digit of address 496 W 497get SW 0&X3 move data and wm to print area 501 MCW 0&X1,0&X3 508 BW dowm,0&X1 skip clearing print area wm 516 CW 0&X3 520dowm C x1,topcor Done? 527 BU cont no 532 W 533 WM 535rx1 MCW sx1&6,x1 Restore index regs 542 MCW sx3&6,x3 549 CS 332 553 CS 554 BSS halt,G 559 B exit 563halt H 564exit B 0-0 568cont SBR x1,1&X1 575 BCE bump3,x3-2,2 583 SBR x3,201 590 W 591 WM 593 A kp1,w2a 600 C w2a,kp15 607 BU clearh 612 S w2a 616 CCB clearh,1 621skip MCW xqtd,220 628 W rx1 632bump3 A kp1,x3 639 B get 651dots DCW @9........@ 653 dcw @9-@ 658adr5 DCW 00000 Five digit address 661kz3 dcw 000 662kp2 DCW &2 664w2a DCW #2 665k9 dcw 9 667km10 DCW @I0@ 669w2b DCW #2 670kp1 dcw &1 672kp15 dcw &15 679 DCW @EXECUTE@ 680xqtd DCW @}@ Changed to D by reloader phase 53R ex begin2 END
- Phase 54 - Format Loader. The object-time format routine, which is included in this phase, is loaded.
JOB Fortran compiler -- Format loader -- Phase 54A CTL 6611 * * This phase selects the proper I/O routine and loads it into * its object core-storage location. * * Limited format routine is first (54B), normal format routine * is second (54C), A-conversion format routine is third (54D). * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps snapsh equ 333 Core dump snapshot imod equ 690 Integer modulus -- number of digits fmtsw equ 696 X for no format, L for limited format * blank for ordinary, A for A conversion loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Runtime addresses * fmtbas equ 1697 base address of limited and normal fmtbaa equ 4280 base address of A-conversion agm equ 4616 GMWM at end of A-conversion lgm equ 2015 GMWM at end of limited routine ngm equ 4279 GMWM at end of normal routine v3m4 nswich equ 3138 Switch in normal routine * ORG 934 934beginn SW gmwm,fmtbas 941 BCE tape,cdovly,N * * Load format routine from cards * 949 BCE cardl,fmtsw,L 957skip1 R skip limited routine (54B) 958 BCE *&5,68,B EX card? 966 B skip1 970 BCE cardx,fmtsw,X 978 R 40 load normal routine (54C) 982nret CW ngm Return here from normal load 986 C imod,k01 993 BU ctesta 998 LCA nop,nswich 1005ctesta BCE carda,fmtsw,A 1013skip2 R 1014 BCE done,68,B EX card? 1022 B skip2 1026cardl R 40 load limited routine (54B) 1030lret CW lgm return here from limited load 1034cardx R 1035 BCE ctesta,68,B EX card? 1043 B cardx 1047carda R 40 load A-conversion routine (54D) 1051aret CW agm return here from A-conversion load 1055 B done * * Load format routine from tape * 1059tape BCE tapel,fmtsw,L 1067 RTW 1,gmwm skip limited format routine 1075 BER taperr 1080 BCE tapex,fmtsw,X 1088 RTW 1,fmtbas load normal format routine 1096 BER taperr 1101 C imod,k01 1108 BU *&8 1113 LCA nop,nswich 1120 BCE tapea,fmtsw,A 1128skipa RTW 1,gmwm skip A-conversion routine 1136 BER taperr 1141done BSS snapsh,C 1146 SBR clearl&3,gmwm 1153 LCA repl2,phasid 1160 B loadnx 1164tapel RTW 1,fmtbas load limited routine 1172 BER taperr 1177tapex RTW 1,gmwm skip normal routine 1185 BER taperr 1190 B skipa 1194tapea RTW 1,fmtbaa load A-conversion routine 1202 BER taperr 1207 B done * * Tape error routine * 1211taperr SBR taperx&3 1215 MA am13,taperx&3 Back up exit to read instruction 1222 BSP 1 1227 H 3333,3333 1234taperx B 0 * * Data * 1239k01 DCW 01 1240nop NOP 1249repl2 DCW @REPLACE 2@ 1252am13 DSA 15987 -13 as an address 1253gmwm DCW @}@ ex beginn END
JOB Fortran compiler -- Limited I/O -- Phase 54B CTL 6611 * * Limited I/O routine -- no formatting * Completely revised in v3m4 * x1 equ 89 x2 equ 94 x3 equ 99 * * Address in format loader * lret equ 1030 return here from limited load * ORG 1697 1697 SBR x1 1701 SW gmwm 1705 LCA x3,39 1712 LCA 1713 MN 0&X1,wt&3 1720 BWZ *&8,0&X1,S 1728 MCW kr,wt&7 1735 SBR exit&3,7&X1 1742 MCW 6&X1,x1 1749loop BCE done,0&X1,. 1757 MCW 3&X1,x2 1764 MCW 6&X1,x3 1771 SBR x1,7&X1 1778 MCW 1&X3,w1 1785 LCA gmwm,1&X3 1792 SBR wt&6,1&X2 1799retry S errcnt 1803retryw S erwcnt 1807wt WTW 1,0-0 1815 BCE erwtst,wt&7,W go test for write error 1823 BEF eofr end file on read? 1828 BCE wt,14&X2,} Noise (short) record? 1836 chain12 1848 BER taperr error on read? 1853 B cont * * EOF while reading * 1857eofr NOP 888 1861 H * 1862cont MCW w1,1&X3 1869 B loop * * Error while reading, or after three retries on writing * 1873taperr MN wt&3,*&4 1880 BSP 0 1885 BCE errhlt,errcnt,I 1893 A *-6,errcnt 1900 BCE wt,wt&7,R 1908 MN wt&3,*&4 1915 SKP 0-0 1920 B retryw * * Test for error or EOF on write * 1924erwtst BER taperw error on write? 1929 BEF eofw eof on write? 1934 B cont * * Error while writing * 1938taperw BCE taperr,erwcnt,C 1946 MN wt&3,*&4 1953 BSP 0-0 1958 A *-6,erwcnt 1965 B wt * * EOF while writing 1969eofw NOP 666 1973 H 1974 B cont * * Tape error * 1978errhlt NOP 777 1982 H 1983 B retry * 1987done MCW 39,x3 1994 MCW 1995 MCW kw,wt&7 2002exit B 0 * * Data * 2006kr DCW @R@ 2007w1 DCW #1 2008errcnt DCW #1 2009erwcnt DCW #1 2010kw DCW @W@ 2011gmwm DCW @}@ ex lret Return to format loader after loading END
JOB Fortran compiler -- Normal format -- Phase 54C CTL 6611 * * Normal format routine * * For each input-output statement, an entry to the Format * Routine is compiled. Following this appears: * 1. a code indicating the appropriate I/O device; * & is read, - is punch, * is print, otherwise digit part * is tape number and no zone is read tape, a zone is write * tape, b zone is read input tape, ab zone is write output * tape; * 2. the address of a series of instructions (format string) * which determines the arrangement of the data (compiled * from the referenced format statement); and * 3. the address of the specified list of data (list string). * * The format string consists of * 1. branches to appropriate closed subroutines of the Format * routine, * 2. parameters describing the data which are needed by these * subroutines, * 3. the data itself (H-conversion fields), and * 4. certain register-updating instructions. * x1 equ 89 x2 equ 94 x3 equ 99 * * Address in format loader * nret equ 982 return here from normal load * * Address in function loader * lisent equ 912 I/O list processing continuation address * * Runtime addresses * snapsh equ 333 entry to snapshot routie manwid equ 837 Mantissa width. in arithmetic interpreter * ORG 1697 1697beginn SBR x1 1701 MCW 0&X1,unit 1708 MCW *-6,tape assume tape I/O without word marks 1715 SBR relent&3,7&X1 1722 MCW 6&X1,lstpos 1729 ZA *-6,a12k 1736 CW rdflag start by assuming write 1740 SW gmwm 1744 MCW 3&X1,x2 1751 SBR x3,200 1758 SBR endrec,334 1765 BCE readcd,0&X1,& read card 1773 BCE punch,0&X1,- punch 1781 BCE clearp,0&X1,* print 1789 BM rdtape,0&X1 read tape formatted 1797 BWZ clearw,0&X1,B write tape formatted 1805 SBR x2,getwm 1812 CS 332 1816 CS 1817 CS 1818 SBR x3,100 1825 MCW lca,tape tape I/O with word marks 1832 SW 0&X3 1836 B 1943 1840 BWZ rdtape,unit,2 1848 SBR recpos,100 * * Find the right-hand (higher core address) of a hollerith * field with a left-hand end having a word mark, as it is * moved to the output buffer. * 1855chars MCW 0&X1,0&X3 1862 SAR x2 1866 B incx3 1870 BW *&5,1&X2 1878 B chars 1882 B chklen 1886 SBR 2222,redoio 1893 B 1832 * * Move a field to the output buffer * 1897gotwm B chklen 1901 LCA 0&X3,0&X1 1908 B 1943 1912getwml B incx3 get x3 up to 1916getwm BW gotwm,1&X3 one below next WM 1924 B getwml * 1928 SBR 2222 1932 MCW x3,recpos 1939 B 0&X2 * 1943 SBR 2006 1947 MCW x2,sx2&6 1954 BW 2031,flag 1965 t lisent 1968lstpos DCW #3 Position in I/O list 1969 SBR x2 1973 MZ nozone,x1-1 1980 BCE 2046,x1,. 1988 BCE 2007,x1, 1996sx2 SBR x2,0 2003 B 0 * 2007 BW relent,rdflag 2015 C recpos,x3 2022 BU 2208 2027 B relent 2031 CW flag 2035 MCW sx1,x1 2042 B 1973 * 2046 MCW 2&X2,x3 2053 MCW 5&X2,x1 2060 MCW 1&X1,ch 2067 BW lca,1&X1 2075 CW wmflag 2079lca LCA gmwm,1&X1 2086 B incx3 2090 SBR x2,*&13 2097 BWZ rdtape,unit,2 2105 B redoio 2109 MCW ch,1&X1 2116 BW relent,wmflag 2124 CW 1&X1 2128 SW wmflag 2132relent B 0 enter here from relocatable function table 2136unit DCW #1 tape unit number * * Increment X3 by 1. * 2137incx3 SBR incx3x&3 2141 SBR x3,1&X3 2148incx3x B 0 * 2152 SBR x2 2156 MN 0&X2 2160 MN 2161 MN 2162 MN 2163 SAR 2309 2167 MCW 2&X2,count 2174 SBR 2207,3&X2 2181 B *&5 2185 SBR x2 2189 S k1,count 2196 BM 0&X2,count 2204 B 0 * 2208 SBR x2 2212 MCW recpos,x3 2219 B 0 * 2223 BW *&13,rdflag 2231 C recpos,x3 2238 BU 2208 2243 MCW lstpos,*&7 2250 BCE 2298,0,, 2258 MCW lstpos,listp2 2268 t lisent 2271listp2 DCW #3 2272 BCE relent,x1, 2280 MCW listp2,lstpos 2287 MCW x1,sx1 2294 SW flag 2298 BW 2208,rdflag 2306 B 0 * 2310 SBR x2 2314 ZA 2&X2,a12k 2321 B 3&X2 * 2327a12k DSA 12000 * * copy the argument to the output buffer * 2328 SBR x2 2332cpargl BW *&8,rdflag 2340 MCW 0&X2,0&X3 2347 MCW 0&X3,0&X2 Why? 2354 B incx3 2358 SBR x2,1&X2 2365 BW *&5,0&X2 2373 B cpargl 2377 B chklen 2381 B 0&X2 * 2385 SBR x2 2389 MCW 3&X2,count2 2396dec2 S k1,count2 2403 BWZ more,count2,B still positive? 2411 BCE 7&X2,0&X2,I 2419 BCE 7&X2,0&X2,A 2427 B 10&X2 2431more B 1943 2434 S 2438 DC @_00@ 2539 sw 2442 DC @;0J@ 2443 BW 3651,rdflag 2451 CS 24 2455 SW 0&X3 2459 MN 2460 SBR x3 2464 SBR sw1&3,2&X3 2471 SBR cw2&3 2475 SW 1 2479 BCE ifmt,0&X2,I 2487 BCE afmt3,0&X2,A 2495 mcw 0&x1 2501 DC @;00@ 2502 MCW 2503 SBR x1 2507 SW 0&X1 2511 A 6&X2,x3 2518 SBR cw1&3,2&X3 2525 MCW k0dot0 0.0 2529 SW 2&X3 2533 BCE *&9,1&X1,0 2541 v 2674 2548 DC @;0K2@ 2549 BCE efmt,0&X2,E 2557 a a12k Not E format 2563 DC @;00@ 2564 B *&8 2568efmt s a12k 2574 DC @;00@ 2575 mn 2578 DC @;00@ 2581 dc w2 2582 MN 2583 mcw 2586 DC @;00@ 2587 BCE ffmt1,0&X2,F 2595 C w2,kz4-2 two zero digits 2602 BE *&9 2607 BM *&8,savzon 2615 MZ nozone,savzon 2622 za a12k 2628 DC @;00@ 2629 mn 2633 DC @;00@ 2635 dc sbr&6 2636 MN 2637sbr SBR x1,0&X1 2644 ZA manwid,w3 mantissa width in aritf 2651 S k2,w3 includes the exponent width 2658 c w3 2664 DC @;00@ 2665 BH 2728 2670 B 2797 * 2674 MCW kx,2&X3 blank X blank 2681 MCW 0.0 2682 SBR x3,2&X3 2689 SBR cw3&3 2693 A 9&X2,x3 2700 B noovfl * 2704ffmt1 BM 2766,savzon 2712 C 6&X2,w2 2719 BL 2629 2724 B 2674 * 2728 S 23 2732 mcm 2738 DC @_0A001@ 2739 MCW kz4 2743 MZ nozone 2744 MCW w2,x1 2751 MCW kz4-3 one zero digit 2755 MCW gmwm,3&X1 2762 B 2797 2766 MZ nozone,0&X1 2773 C 9&X2,w2 2780 BU *&8 2785 c 2788 DC @_0A@ 2791 dc k5 2792 BH ifmt2 2797 mz 2800 DC @;0K@ 2803 dc @0|0@ 0&x1 2804 B ifmt2 * * Check record length * 2808chklen SBR chklex&3 2812 C endrec,x3 2819 BL chklex 2824 NOP 3700 snapshot routine is clobbered 2828 H 2829chklex B 0 * 2833ifmt mcw 0&x1 2839 DC @_00@ 2840 A 6&X2,x3 2847 MCW 6&X2,x1 2854 za 2857 dc @_00@ 2860 DC @0|0@ 0&x1 2861 B incx3 2865ifmt2 MCS 0&X1,0&X3 2872 SBR sx3&6 2876 MN 0&X1,0&X3 at least show the low order digit 2883 SBR mcs&3,0&X3 2890 SBR cw3&3 2894sw1 SW 0 2898 BM *&5,0&X1 2906 B sx3 2910getb BCE gotb,0&X3, found a blank? 2918 SBR x3 2922 BW sx3,1&X3 end of the field, no sign 2930 B getb 2934gotb MZ bzone,0&X3 set the sign 2941 SW 1&X3 2945 SBR cw3&3,1&X3 2952sx3 SBR x3,111 2959 BCE cw2,0&X2,I 2967 A 9&X2,x3 2974 BCE ffmt2,0&X2,F 2982 MN 0&X3 2986 MN 2987 MN 2988 MN 2989 SBR x3 2993ffmt2 SBR sx3a&6,1&X3 3000 S 1&X3 3004 MN 3005 SAR x3 3009 BCE findgm,0&X2,E 3017 BWZ findgm,savzon,B 3025 C 9&X2,w2 3032 BH sx3a 3037 A w2,x3 3044findgm BCE sx3a,3&X1,} gm 3052 MN 1&X1,2&X3 3059 SBR x1,1&X1 3066 BWZ sx3a,2&X3,B 3074 SBR x3 3078 B findgm 3082sx3a SBR x3,0 3089 BAV *&1 3094 A kp5,0&X3 3101 MCW nozone,0&X3 3108 BCE ffmt3,0&X2,F 3116 SBR x3,4&X3 3123 MN 0&X3 3127 MCW w2 3131 MZ 3132 MCW 3133ffmt3 BAV ovfl 3138noovfl cw 3141 DC @_00@ 3142cw1 CW 0 3146cw2 CW 0 3150cw3 CW 0 3154sw2 sw 3157 DC @_0A@ 3158 B chklen 3162 B dec2 * 3166ovfl MCW cw1&3,x1 3173 MZ nozone,0&X1 3180 MCW dot 3181 A one 3182 BAV *&9 3187mcs MCS 0 3191 B noovfl 3195 MN 0&X1 3199 C 3200 MN 3201 SBR x1 3205 C cw2&3,x1 3212 BL xxfld 3217 SW 0&X1 3221 MCW 1&X1,0&X1 3228 CW 3229 lca k10,2&x1 v3m4 3236 B 4269 v3m4 3240xxfld MCW 1&X3,0&X3 clear the field 3247 MCW 3248 MCW 3249 MCW kx,3&X1 then put blank x blank in it 3256 B noovfl * 3260 dcw 1 3261 dcw @.@ 3262nozone DCW #1 3266kz4 DCW @0000@ * 3267ifmt3 MCW x1,x3 3274 MZ zas2,3288 3281 mn 0&x3 3287 DC @_0A@ 3288 ZA 3289 MCW 4146,x1 3296 lca 3299 dc @_00@ 3302 DC @0|0@ 0&x1 3303 B 4155 * * End of file on input * 3307eofrd NOP 4002 3311 H * * Tape read * 3312rdtape SW rdflag 3316clearr CS 332 3320 CS 3321 B redoio * * After tape read * 3325endrd BEF eofrd 3330 BCE redoio,12&X3,} short -- noise -- record? 3338 chain12 3350 B 1928 3354 B clearr * * End of tape on output * 3358eofwr MN unit,*&4 3365 WTM 0 3370 NOP 4003 3374 H * * Write tape * 3375clearw CS 332 3379 CS 3380 B 1928 3384redoio MN unit,tape&3 3391 MCW kr,tape&7 Assume it's read, not write 3398 ZA kr,w3 @R@ used as -9 here 3405 BW doio,rdflag 3413 MCW kw,tape&7 oops, it's write 3420 A kp41,w3 3427doio LCA gmwm,snapsh 3434tape RT 0,0&X3 3442 LCA beginn,snapsh unclobber 3449 BER taperr 3454 BCE endrd,tape&7,R 3462 BEF eofwr 3467 B clearw * * Print * 3471clearp CS snapsh 3475 CS 3476 B 1928 3480 BCE k2,200, No spacing 3488 BCE dble,200,0 Double space? 3496 MN 200,*&2 set skip-to channel 3503 CC 0 3505k2 W 3506 BCV *&5 3511 B clearp 3515 CCB clearp,1 3520dble CCB k2,J * * Punch * 3525punch MCW a281,endrec 3532 CS 1928,285 3539 SW 200 3543 LCA 279,180 3550 P 3551 SSB punch,4 * * Read a card * 3556readcd CS 80 3560 MCW a281,endrec 3567 SW 1,rdflag 3574k1 R 3575 LCA 80,279 3582 SSB 1928,1 3587 B readcd * * Tape I/O error * 3591taperr MN unit,bsp&3 3598 MN unit,skp&3 3605bsp BSP 0 3610 BCE *&6,tape&7,R 3618skp SKP 0 3623 S k1,w3 3630 BWZ doio,w3,B 3638 NOP 1111 3642 H 3643 B redoio * 3647kp5 dcw &5 3648savzon DCW #1 3650w2 DCW 00 * 3651 SW 0&X3 3655 MCW x1,4146 3662 MCW x3,x1 3669 A 6&X2,x1 3676 BCE ifmt4,0&X2,I 3684 BCE afmt2,0&X2,A 3692 A 9&X2,x1 3699ifmt4 SW 0&X1 3703 SBR cw4&3,0&X1 3710 s 3713 DC @;00@ 3714 S 3715 mz nozone v3m4 3721 dc @;0K@ v3m4 3722 MZ abz2,zas2 v3m4 3729 BCE 3765,0&X3, v3m4 3737 BCE bzone,0&X3,- v3m4 3745 BCE bzone,0&X3,@ v3m4 3753 BCE 3785,0&X3,& v3m4 3761 B 3793 v3m4 3765 BW 4132,1&X3 v3m4 3773 B incx3 v3m4 3777 B 3722 v3m4 3781bzone ZS zas2 v3m4 3785 SW 1&X3 v3m4 3789abz2 B incx3 v3m4 3793 BCE ifmt3,0&X2,I v3m4 3801 sbr x1 v3m4 3807 DC @_0J@ v3m4 3808 CW flag1,flag2 3815 CW flag3 3819 S w3a 3823 BCE afmt1,0&X2,A 3831 B chkch1 * 3835dot SBR w3,0&X3 3842 SW flag3 3846 BW *&8,flag1 3854 SBR w3,1&X3 3861notdot BW ckefmt,1&X3 3869 BCE ckefmt,1&X3, 3877 B incx3 3881chkch1 BCE dot,0&X3,. 3889 C 0&X3,kz4-3 one zero digit 3896 BL 4163 3901 BH chkch2 3906 BW 4163,flag1 3914 B notdot * * Check validity of character * 3918chkch2 BCE er1121,0&X2,F no exponent if F format 3926 SBR w3b,4&X3 3933 MZ abzone,zas 3940 BCE exp,0&X3,E 3948cksign MZ 0&X3,zas 3955 BCE sign,0&X3,& 3963 BCE sign,0&X3,- * * Data and FORMAT specifications disagree in mode or * acceptable characters. * 3971er1121 NOP 1121 3975 H 3976abzone B er1121 * 3980exp BWZ *&9,1&X3,2 3988 B incx3 3992 B cksign 3996 BCE *&5,1&X3, 4004 B *&5 4008 B incx3 4012sign SW 1&X3 4016 BW zas,2&X3 4024 BCE zas,2&X3, 4032 SBR x3 4036zas ZA 1&X3,w3a sometimes zs 4043 B *&16 4047ckefmt BCE er1121,0&X2,E E format? 4055 SBR w3b,1&X3 4062zas2 za 4065 DC @;0K@ 4066 BW *&5,flag1 4074 B 4140 4078 BW *&15,flag3 4086 S 9&X2,w3b 4093 ZA w3b,w3 4100 S w3,w3c 4107 A a12k,w3a 4114 ZS w3c 4118 A w3c,w3a 4125 za w3a 4131 DC @;00@ 4132 BCE ifmt3,0&X2,I 4140 mcw 4143 DC @;00@ 4146 dc 000 4147 LCA 4148 MCW *&4,x3 4155cw4 CW 0 4159 B sw2 * 4163 BW *&12,flag1 4171 SBR w3c,0&X3 4178 SW flag1 4182 BW notdot,flag2 4190 MN 0&X3,2&X1 4197 SBR x1 4201 SW flag2 4205 BCE notdot,4&X1,} gm 4213 CW flag2 4217 B notdot * 4223w3a DCW #3 4226w3b DCW #3 4229w3c DCW #3 4232w3 DCW #3 4233k5 DCW @5@ 4234flag dc #1 4235rdflag DCW #1 read if WM, write if no WM 4238endrec DCW #3 Address of end of record, either 334 or 281 4241recpos DCW #3 4242ch DCW #1 4243wmflag DCW #1 WM if char being copied has a WM 4246count DCW #3 4249sx1 DCW #3 4252count2 DCW #3 4255k0dot0 DCW @0.0@ 4258kx DCW @ X @ 4259kr DCW @R@ 4260kw dcw @W@ 4262kp41 DCW &41 4265a281 DSA 281 4266flag1 DCW #1 4267flag2 DCW #1 4268flag3 DCW #1 4269 CW 1&X1 v3m4 4273 B noovfl v3m4 4278k10 DCW 10 v3m4 4279gmwm DCW @}@ v3m4 ex nret JOB Fortran compiler -- A conversion -- Phase 54D ORG 4280 4280afmt1 BW *&12,flag1 4288 SBR w3c,0&X3 4295 SW flag1 4299 BW atest,flag2 4307 MN 0&X3,2&X1 4314 MZ 0&X3,2&X1 4321 SBR x1 4325 SW flag2 4329 BCE atest,4&X1,} gm 4337 CW flag2 4341atest BW *&9,1&X3 End of source field? 4349 B incx3 4353 B afmt1 4357 SBR w3b,1&X3 4364 MCW 4146,*&7 4371 MCW 0,0 4378 LCA 4379 MCW cw4&3,x3 4386 B sw2 4390afmt2 mcw k3b 4396 DC @;00@ 4397 mcw w20 4403 DC @;0K@ 4404 SW 0&X1 4408 SBR cw4&3,0&X1 4415 B 3793 v3m4 * * Move data to A format field * 4419afmt3 MCW 2501,*&7 4426amcw MCW 0,0 4433 MCW 4434 SBR x1 4438 SBR src,1&X1 4445 SBR trgend,0&X3 4452 MA 6&X2,trgend 4459 SBR target,1&X3 4466 MCW amcw&6,srcend 4473 MA am2,srcend 4480aloop MN 1&X1,2&X3 4487 MZ 1&X1,2&X3 4494 C target,trgend 4501 BE aend 4506 C src,srcend 4513 BE aend 4518 MA a001,src 4525 MA a001,target 4532 SBR x1,1&X1 4539 SBR x3,1&X3 4546 B aloop 4550aend SBR cw3&3,0&X3 4557 MCW trgend,x3 4564 SBR x3,2&X3 4571 B cw2 * 4577k3b DCW #3 4597w20 DCW #20 4600target DCW #3 4603src DCW #3 4606trgend DCW #3 4609srcend DCW #3 4612am2 DSA 15998 -2 = 16000 - 2 = 15998 4615a001 DSA 1 4616 DCW @}@ ex nret END
- Phase 55 - Replace II. Those instructions in the generated object program that should branch to the relocatable routines are modified (via the table of Phase 52) to show the object-time addresses of these routines.
JOB Fortran compiler -- Replace phase 2 -- Phase 55 CTL 6611 * * Address of the fixed- and floating-word work-areas are * inserted into the generated object program. Instructions * which branch to the relocatable routines are corrected to * show the object core-storage addresses of these routines. * Unused core storage is cleared. * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps subent equ 191 Entry to subscript routine, from subsc snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Stuff in phase 52A * subsc equ 909 subscript entry in function table conbot equ 930 bottom of constants - 1 arybot equ 933 bottom of arrays - 1 * * Runtime addresses * aritf equ 700 Arithmetic interpreter fmtbas equ 1697 base address for limited and normal * ORG 934 934beginn SBR sx3,1&X3 941 SW 1&X3 945 SBR sx2,0&X2 952 SBR sx1,0&X1 959 MCW topcor,x2 966 C 0&X2 970 C 971 C 972 SBR 1393 976 MCW 86,x2 983 MN 0&X2 987 SAR sx2a * * Go through the relocatable library looking for codes * that indicate various kinds of relocation: * T with a word mark means A is an address in the function * table; convert the T to a B. * 991loop C x3,sx2 998loopt BE loopx 1003 C 0&X3 1007 SBR x2 1011 SBR x3 1015 BCE transf,1&X3,T op code is T? 1023checka MCW 4&X3,w3 check A field address 1030 BCE semund,w3-2,; semicolon? 1038 BCE semund,w3-2,_ underscore? 1046 BCE rbrack,w3-2,] right bracket? 1054 MCW w3,4&X3 W3 back to A address 1061checkb MCW 7&X3,w3 check B field address 1068 BCE semund,w3-2,; semicolon? 1076 BCE semund,w3-2,_ underscore? 1084 MCW w3,7&X3 W3 back to B address 1091 B loop * * Replace T XXX with B YYY where YYY is taken from XXX. * 1095transf BCE loop,4&X3,$ 1103 C 0&X3,baritf&3 1110 BE loop 1115 BW checka,4&X2 Not a transfer if any 1123 BWZ of the next three 1124 BWZ characters has a word mark 1125 MCW branch,1&X3 Convert to branch 1132 MCW 4&X2,x1 table address to X1 1139 MCW 0&X1,x1 table entry to X1 (why???) 1146 MCW x1,4&X2 and A address 1153 B checka * * Repeat the loop for the format code * 1157loopx MCW apass3,loopt&3 1164 MCW sx1,x3 1171 MCW afmt,sx2 1178 B loop * * Clear unused core * 1182pass3 MCW sx3,x3 1189 SBR x3,1&X3 1196 MZ x3,k999a 1203 MZ 1204 MCW 1205 MZ 83,k999b 1212 MZ 1213 MCW 1214 C k999a,k999b 1221 BE equal 1226 MCW 83,x3 1233clrhlp CS 0&X3 clear hundred at a time 1237 SBR x3 1241 C x3,k999a 1248 BU clrhlp 1253clr1lp C x3,sx3 1260 BE clrl1x 1265 LCA kb1,0&X3 clear 1272 SBR x3 one at 1276 CW 1&X3 a time 1280 B clr1lp * * X3 and 83 in same hundreds * 1284equal MCW 83,x3 1291 B clr1lp * * Fill empty core with right brackets, except for the * last character, which gets a record mark. * 1295clrl1x MCW 83,x3 1302 MCW rm,0&X3 1309 SBR x3 1313 MCW krbrak,0&X3 1320 MCW 0&X3 1324 SBR x3 1328 LCA kb1,2&X3 1335 LCA kb1 1339 MCW subsc,subent 1346 BSS snapsh,C 1351 SBR tpread&6,838 1358 SBR clrbot 1362 SBR loadxx&3,838 1369 SBR clearl&3,gmwm 1376 LCA snap,phasid 1383 B loadnx * * A field begins with right bracket * 1387rbrack SBR 4&X3,0 1394 B checkb * * A or B field begins with semicolon or underscore * Semicolon adds or subtracts next two digits to arubot. * Underscore adds or subtracts next two digits from conbot. * AB zone means add, else subtract. * 1398semund SBR exit&3 1402 MCW conbot,x2 1409 BCE *&8,w3-2,_ underscore? 1417 MCW arybot,x2 1424 BCE nooff,w3,0 No offset if low order digit zero 1432 BWZ add,w3,B Add unzoned offset 1440 SW w3-1 1444decr A kp1,w3 subtract 1451 BWZ decrx,w3,B unzoned w3 1459 MN 0&X2 from 1463 SAR x2 X2 1467 B decr 1471decrx CW w3-1 1475nooff MCW x2,w3 1482exit B 0 1486add MN w3,rew3&6 1493 MN 1494rew3 SBR w3,0&X2 x2 plus unzoned offset to w3 1501 B exit * * Data * 1507k999a DSA 999 1510k999b DSA 999 1513sx3 DCW #3 1516sx2 DCW #3 1519sx1 DCW #3 1522sx2a DCW #3 1525w3 DCW #3 1526baritf B aritf 1530branch B 1533apass3 DSA pass3 1536afmt DSA fmtbas-1 one before format 1537kb1 DCW #1 1538rm DCW @|@ 1539krbrak DCW @]@ 1547snap DCW @SNAPSHOT@ 1548kp1 dcw &1 1549gmwm DCW @}@ ex beginn END
- Phase 56 - Snapshot. A snapshot of the generated program is printed if initially requested and if no source program errors have been detected that would make program execution unrewarding.
JOB Fortran compiler -- Snapshot phase -- Phase 56 CTL 6611 * * A snapshot of the generated program is printed if requested * (if there were no source program errors which would make * program execution unrewarding). * x1 equ 89 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error snapsh equ 333 Core dump snapshot routine topcor equ 688 Top core address from PARAM card snapsw equ 694 S for snapshot fmtsw equ 696 X for no format, L for limited format * blank for ordinary, A for A conversion loadnx equ 700 Load next overlay clearl equ 707 Clear instruction in LOADNX loadex equ 793 Branch that exits LOADNX * ORG 838 838beginn BCE *&5,snapsw,S 846 B done 850 BW error,glober * * Set the bottom of the dump, depending on the format switch * 858 SBR x1,4200 Assume normal format 865 SBR x3,201 872 BCE fmtx,fmtsw,X 880 BCE fmtl,fmtsw,L 888 BCE fmta,fmtsw,A 896 B gotbot 900fmtx SBR x1,1600 907 MCW k1600,bot bottom of dump 914 MCW k1696,top top of fixed code 921 B gotbot 925fmtl SBR x1,2000 932 MCW k2000,bot bottom of dump 939 MCW k2015,top top of fixed code 946 B gotbot 950fmta SBR x1,4600 957 MCW k4600,bot bottom of dump 964 MCW k4616,top top of fixed code 971gotbot CC 1 973 CS 332 977 CS 978 MCW snap,260 985 W 986 CC J 988 CS 332 992 CS 993 MCW ioarea,239 1000 W 1001 CC J 1003 CS 332 1007 CS 1008 MCW top,248 1015 W 1016 CC K 1018 ZA kp3,lines 1025outer CS 332 1029 CS 1030 CC J 1032 MCW bot,311 1039 MCW 1040 MCW 1041 SBR indic&6 1045 MCW k9,w2-1 1052indic MCW w2-1,0 1059 MCW dots 1063 SBR indic&6 1067 A km90,w2 1074 BWZ indic,w2-1,2 1082 A kp1,bot-2 1089 W 1090inner SW 0&X3 1094 MCW 0&X1,0&X3 1101 BW *&5,0&X1 1109 CW 0&X3 1113 C x1,topcor 1120 BU more 1125 W 1126 WM 1128done BSS snapsh,C 1133 SBR loadex&3,884 1140 SBR clearl&3,gmwm 1147 LCA condek,phasid 1154 B loadnx 1158error CC J 1160 CS 332 1164 CS 1165 MCW defer,237 1172 W 1173 BCV *&5 1178 B *&3 1182 CC 1 1184 B done 1188more SBR x1,1&X1 more hundreds to print 1195 BCE morech,x3-2,2 1203 SBR x3,201 1210 W 1211 WM 1213 A kp1,lines 1220 C lines,kp15 1227 BU outer 1232 S lines 1236 CC 1 1238 B outer 1242morech A kp1,x3 more characters to put in line 1249 B inner 1300top DCW @FIXED OBJECT TIME ROUTINES LOCATED FROM 333-4279@ 1309dots DCW @9........@ 1310 dcw 9 1316 DCW @-AREA-@ 1321bot DCW 04200 1326k1600 DCW 01600 1330k1696 DCW 1696 1335k2000 DCW 02000 1339k2015 dcw 2015 1344k4600 DCW 04600 1348k4616 dcw 4616 1374snap DCW @SNAPSHOT OF OBJECT PROGRAM@ 1413ioarea DCW @INPUT/OUTPUT AREAS LOCATED FROM 001-332@ 1414kp3 dcw &3 1415k9 dcw 9 1417km90 DCW @I0@ 1419w2 DCW #2 1420kp1 dcw &1 1428condek DCW @CONDECK1@ 1465defer DCW @SNAPSHOT DEFERRED DUE TO INPUT ERRORS@ 1467lines DCW #2 1469kp15 DCW &15 1470gmwm DCW @}@ ex beginn END
- Phases 57, 58, 59, 60 - Condensed Deck. When requested and if there are no input errors, these phases punch and list the object program as a self-loading condensed card deck.
JOB Fortran compiler -- Condensed deck phase one -- 57 CTL 6611 * * When requested (if there are no input errors), the comiler * will punch a self-loading card deck. The deck is listed on * the printer if sense switch B is on. This phase punches * only the clear-storage and bootstrap cards. * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps glober equ 184 Global error flag -- WM means error arytop equ 194 Top of arrays in object code snapsh equ 333 Core dump snapshot topcor equ 688 Top core address from PARAM card condns equ 693 P for condensed deck loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 838 838punch SBR punchx&3 842 A kp1,175 bump sequence number 849 BSS *&6,B punch and print? 854 P 855punchx B 0-0 859 MCW 180,280 866 MCW 867 WP 868 BCV *&5 873 B *&3 877 CC 1 879 B punchx 883kp1 dcw &1 884beginn BCE *&5,condns,P punch condensed deck? 892 B done 896 BW done,glober 904 LCA arytop,arytop 911 CS 180 915 SW 101 919 MCW 685,180 926 BSS *&5,B 931 B cont 935 CC 1 937 CS 332 941 CS 942 MCW title,260 949 W 950 CC J 952 B cont 956done BSS snapsh,C 961 SBR tpread&6,884 968 SBR clrbot 972 SBR loadxx&3,884 979 SBR clearl&3,gmwm 986 LCA condek,110 993 B loadnx 997cont LCA k0000,175 sequence number 1004 BWZ under4,topcor,2 1012 MCW b1g4k,152 1019 B punch First bootstrap ge 4k 1023 MCW topcor,b2ag4k 1030 MCW b2bg4k,171 1037 B punch Second bootstrap ge 4k 1041 B third 1045under4 MCW b1l4k,144 1052 B punch First bootstrap lt 4k 1056 MCW topcor,b2al4k 1063 MCW b2bl4k,170 1070 B punch Second bootstrap lt 4k 1074third MCW r40,171 1081 CS 1082 LCA b3,146 1089 B punch Third bootstrap 1093 B done 1140b1l4k DC @,008015,019026,030,034041,045,053,0570571026@ 1169b2al4k DCW @L068112,102106,113/101099/I99@ 1210b2bl4k dc @,027A070028)027B0010270B0261,001/001113I0@ 1221r40 DCW @,0010011040@ 1267b3 DC @,008015,022029,036040,047054,061068,072/061039@ 1310 DCW @,008015,022026,030037,044,049,053034,035036@ v3m4 1319b1g4k DC @N00001026@ 1348b2ag4k DCW @L068116,105106,110117B101/I9I@ 1390b2bg4k dc @H029NNNC029056B026/B001/0991,001/001117I0?@ v3m4 1404title DCW @CONDENSED DECK@ 1412condek DCW @CONDECK2@ 1416k0000 DCW @0000@ 1417gmwm DCW @}@ ex beginn END
JOB Fortran compiler -- Condensed deck phase 2 -- 58 CTL 6611 * * This phase punches cards that will initialize the index * registers and sense lights, the snapshot or the linkage * routine, the arithmetic routine, and certain final * addresses and constants. * * Stuff in the resident area * glober equ 184 Global error flag -- WM means error gotxl equ 185 XLINKF was referenced if no WM reltab equ 188 Relocatable function table entry addresses subent equ 191 Entry to subscript routine snapsh equ 333 Core dump snapshot imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits & 2 condns equ 693 P for condensed deck loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * * Address in Phase 57 * punch equ 838 Punch a card and maybe print it too * * Addresses in ARITF * setfp equ 831 put mantissa width into B qfunct equ 1327 branch to function selector dosub equ 1206 branch to subscript routine ariti equ 1530 put integer size in B * ORG 884 884beginn MCW cdovly,r2 891 BW skipx1,gotxl need XLINKF if no WM, skip if WM * * Skip snapshot * 899 MCW cdovly,r1 read or NOP 906 SBR tstcnt&3,rt1 913 SBR taperx&3,reset1 920r1 R test1 924reset1 MCW kp9,errcnt 931rt1 RT 1,1 939 BER taperr 944test1 BCE *&5,68,B 952 B r1 * * Setup second reader to punch * 956 SBR swich2&3,test2 963 SBR tstcnt&3,rt2 970 SBR taperx&3,reset2 977 A kp1,w1 984skipx1 BCE *&5,condns,P 992 B r2 996 BW errmsg,glober * * Set index registers and sense lights with zeroes * Part of ARITF deck now * 1004 MCW r40&3,171 1011 MCW load1 to set index registers and sense lights 1015 CS 1016 LCA kz14,114 zeroes 1023 MCW branch,swich1 1030 B punch why bother; it's in ARITF deck ??? * * Load topcor, imod, mantis, gmwm * 1034 MCW r40&3,171 1041 MCW load 1045 CS 1046 MCW load2,157 Load mantis, imod, topcor 1053 SW gmwm 1057 MCW gmwm,108 1064 MCW mantis FP size 1068 MCW integer size 1069 LCA topcor 1070swich1 NOP punch sometimes branch * * Copy or skip a deck * 1074r2 R swich2 1078reset2 MCW kp9,errcnt 1085rt2 RT 1,1 1093 BER taperr 1098swich2 B chg2 sometimes test2, sometimes endeks 1102taperr BSP 1 1107 S kp1,errcnt 1114tstcnt BWZ rt2,errcnt,B 1122 NOP 3333 1126 H 1127taperx B reset2 1131test2 BCE end2,68,B 1139 MCW 71,171 1146 chain5 1151 B swich1 1155chg2 SBR swich2&3,test2 skip first card, punch the rest 1162 B r2 * * Errors prevent condensed deck * 1166errmsg CS 332 1170 CS 1171 MCW errors,243 1178 W 1179 CC J 1181 B r2 * * Copy another deck * 1185end2 A kp1,w1 1192 BCE endeck,w1,3 1200 BCE r2,w1,2 1208 BW *&5,gotxl skip XLINKF if WM 1216 B r2 get XLINKF if no WM 1220 MCW cdovly,r3 1227 SBR tstcnt&3,rt3 1234 SBR taperx&3,reset3 * * Skip a deck * 1241r3 R test3 1245reset3 MCW kp9,errcnt 1252rt3 RT 1,1 1260 BER taperr 1265test3 BCE *&5,68,B 1273 B r3 1277 SBR tstcnt&3,rt2 1284 SBR taperx&3,reset2 1291 B end2 1295endeck SBR swich2&3,endeks 1302 B r2 1306endeks BCE done,swich1,N * * imod, mantis, reltab, subent to ARITF * 1314 CS 171 1318 SW 101 1322 MCW r40&3,171 1329 MCW load 1333 MCW mvimod&6,146 to put imod into ARITF 1340 MCW imod,102 1347 B punch 1351 MCW where,146 to put mantis into ARITF 1358 MCW mantis,102 1365 B punch 1369 MCW funce&3,146 mcw 3,qfunc&3 1376 MCW reltab,103 relocatable function table address 1383 B punch 1387 MCW sube,146 1394 MCW subent,103 1401 B punch * 1405done BSS snapsh,C 1410 SBR tpread&6,838 1417 SBR clrbot 1421 SBR loadxx&3,838 1428 SBR clearl&3,gmwm 1435 LCA condek,110 1442 B loadnx * * Data * 1463load2 DCW @L008693,689691,693@ topcor imod mantis gmwm 1506errors DCW @CONDENSED DECK DEFERRED DUE TO INPUT ERRORS@ 1534load DCW @L039000,040040,040040,040040@ 1535 dc @$@ 1536kp9 DCW &9 1537kp1 dcw &1 1538r40 R 40 1569load1 DCW @L014100,092097,081082,083084@ 1583kz14 DCW @00000000000000@ 1584branch B 1585errcnt DCW #1 tape error count 1586w1 DCW #1 1587mvimod MCW 2,ariti&6 integer size to arithmetic routine 1596where DSA setfp&6 where to put FP size 1597funce WR qfunct&3 used to create mcw 3,qfunct&3 1603sube DSA dosub&3 1611condek DCW @CONDECK3@ 1612gmwm DCW @}@ ex beginn END
JOB Fortran compiler -- Condensed deck phase 3 -- 60 CTL 6611 * x1 equ 89 x2 equ 94 x3 equ 99 * * Stuff in the resident area * phasid equ 110 Phase ID, for snapshot dumps nstmts equ 183 Number of statements, including generated stop * Beginning of generated code by now. glober equ 184 Global error flag -- WM means error arytop equ 194 Top of arrays in object code snapsh equ 333 Core dump snapshot condns equ 693 P for condensed deck fmtsw equ 696 X for no format, L for limited format * blank for ordinary, A for A conversion loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader * * Runtime addresses * fmtbas equ 1697 base address of limited and normal lgm equ 2015 GMWM at end of limited routine ngm equ 4269 GMWM at end of normal routine fmtbaa equ 4280 base address for A-conversion agm equ 4616 GMWM at end of A-conversion * ORG 838 838beginn MCW nstmts,x1 Beginning of generated code 845 BCE *&5,condns,P 853 B done 857 BW done,glober 865loop SBR puexit&3,setup 872 MCW setwms-11,w7 ,040040 879 MCW a146,x3 886 MCW lca,140 893setup CS 139 897 BCV *&5 902 B *&3 906 CC 1 908 MCW setwms,171 915 SW 140 919 CS 332 923 CS 924 SW 101 928 MCW a001,x2 935 MCW k1,w1 942 MCW w7,153 949 BW cwload,flag 957more MN 0&X1,100&X2 Move a character 964 MZ 0&X1,100&X2 to the punch area 971chktop C arytop,x1 978 BE top 983 SBR x1,1&X1 990 SBR x2,1&X2 997 BCE endcod,0&X1,] right bracket means end of code 1005 BW wm,0&X1 1013 C a040,x2 1020 BL more 1025 C a160,x3 1032 BL setcw 1037 MCW a040,167 1044 BH *&8 1049 MCW a040,164 1056 CW 140 1060sw SW 0 1064 SBR x2 1068 A km990,x2&1 1075 MCW 239,139 clear part of card above loaded chars 1082sx1 SBR x1,0 1089punch0 MCW setwms-11,w7 ,040040 1096 MCW a146,x3 1103punch A k1,175 Bump sequence number 1110 MN 0&X2 1114 SBR 143 1118 C 143,a000 1125puex1 BE aftary v3m4 1130 MN 0&X1 1134 SBR 146 1138 LCA 180,280 1145 LCA 1146 LCA 1147 BSS *&5,B 1152puexit P setup 1156 SW prexit&1 1160 MCW puexit&3,prexit&3 1167 CW prexit&1 1171prexit WP setup * * Put a CW instruction in W7 * 1175setcw MCW cw,w7-6 1182 MCW x1,w7 1189 MCW x1 1193 MCW a153,x3 1200 B punch * * Got to top of arrays * 1204top SBR puexit&3,aftary 1211 B punch * * Found WM * 1215wm MCW x1,sx1&6 1222 SBR sw&3,100&X2 1229 C a040,x2 1236 BE punch0 1241 C a167,x3 1248 BE punch0 1253 SBR x3,3&X3 1260 ZS w1 1264 BM bumpx3,w1 1272wm2 MCW x1,0&X3 1279 B more * * Saw a right bracket -- end of code * 1283endcod SW flag 1287 B punch0 * * Set a CW instruction in the load area * 1291cwload CW flag 1295 MCM 0&X1 1299 SBR x1 1303 BW more,0&X1 1311 MCW x1,153 1318 MCW x1 1322 MCW cw 1326 MCW a153,x3 1333 B more * 1337bumpx3 SBR x3,1&X3 1344 B wm2 * * After the arrays * 1348aftary SBR x1,fmtbas 1355 BCE xfmt,fmtsw,X no format routine 1363 BCE lfmt,fmtsw,L limited format routine 1371 BCE afmt,fmtsw,A A-conversion format 1379setchk SBR chktop&3,usrbas normal format 1386 SBR puex1&3,xfmt v3m4 1393 SBR top&6,xfmt 1400 B loop 1404lfmt SBR usrbas,lgm&1 After limited format 1411 B setchk 1415afmt SBR usrbas,agm&1 After A conversion 1422 B setchk 1426xfmt CS 171 1430 MCW a080,146 1437 MCW nstmts 1441 LCA cs 1445 A k1,175 1452 LCA 180,280 1459 LCA 1460 CS 1461 BSS print,B 1466 P 1467lastcd CS 180 1471 P 1472 SS 8 1474done BSS snapsh,C 1479 SBR clearl&3,gmwm 1486 LCA gaux1,phasid 1493 B loadnx 1497print WP lastcd * * Data * 1503usrbas DSA fmtbaa Base address of user code 1521setwms DCW @,040040,0400401040@ 1522flag dc #1 1525a146 DSA 146 1526lca LCA 1529a001 DSA 1 1530k1 dcw 1 1531w1 DCW #1 1538w7 DCW #7 1541a040 DSA 40 1544a160 DSA 160 1547km990 dcw -990 1550a000 DSA 0 1551cw CW 1554a153 DSA 153 1557a167 DSA 167 1560a080 DSA 80 1561cs CS 1569gaux1 DCW @GAUX ONE@ 1572 DSA 3999 1573gmwm DCW @}@ ex beginn END
- Phase 61 -- Geaux I. This phase prints the end-of-compilation message, initializes the sense lights, and prepares the branch into the object program coding.
JOB Fortran compiler -- GEAUX phase one -- Phase 61 CTL 6611 * * This phase prints the end of compilation message, initializes * the sense lights, and prepares the branch into the object * program coding. * x1 equ 89 * * Addresses in the resident area * nstmts equ 183 Number of statements, including generated stop * Beginning of code by now glober equ 184 Global error flag -- WM means error gotxl equ 185 XLINKF was referenced if no WM snapsh equ 333 Core dump snapshot phasld equ 381 Loads phase ID in snapshot snapex equ 564 Halt end exit in snapshot condns equ 693 P for condensed deck loadnx equ 700 Load next overlay clearl equ 707 CS at start of overlay loader cdovly equ 769 1 if running from cards, N if from tape tpread equ 780 Tape read instruction in overlay loader loadxx equ 793 Exit from overlay loader clrbot equ 833 Bottom of core to clear in overlay loader * ORG 838 838beginn LCA w4,84 Initialize 845 SW 84 sense 849 SW lights 850 SW 851 CC 1 853 CS 332 857 CS 858 MCW endmsg,218 865 W 866 MCW nstmts,x1 entry address for generated code 873 BW errors,glober 881 CC J 883 CS 332 887 CS 888 MCW start,217 895 W 896afterr SW gmwm 900 LCA gmwm,condns why here??? 907 BCE cards,cdovly,1 915 BW skiptp,gotxl 923 SBR retry&3,rd333 * * Load overlay loader * 930rd333 RTW 1,snapsh 938 BER taperr 943 B aftovl 947taperr BSP 1 952 H 4444,4444 959retry B skiptp 963cards BW skipld,gotxl 971 R 40 load overlay loader * * Skip overlay loader * 975skipld R 976 BCE done,68,B 984 B skipld 988skiptp RTW 1,gmwm 996 BER taperr * 1001done BSS snapsh,C 1006 LCA nop,phasld 1013 LCA halt,snapex * * Return here after loading overlay loader * 1020aftovl CW 680 in case of overlay loader, clear its gmwm 1024 SBR clearl&3,gmwm 1031 SBR tpread&6,201 1038 SBR loadxx&3,201 1045 SBR clrbot,beginn 1052 B loadnx * 1056errors CC J 1058 CS 332 1062 CS 1063 MCW errmsg,228 1070 W 1071 B afterr 1078w4 DCW #4 1096endmsg DCW @END OF COMPILATION@ 1113start DCW @PRESS START TO GO@ 1114nop NOP 1115halt H 1143errmsg DCW @CORRECT ERRORS AND RECOMPILE@ 1144gmwm DCW @}@ ex beginn END
- Phase 62 - Geaux II. The arithmetic routine (Phase 63) is read into storage. Communication between this routine and the relocatable routines is established. The object program is executed on option.
JOB Fortran compiler -- GEAUX phase 2 -- phase 62 CTL 6611 * * The arithmetic routine is loiaded. Communication is * established between that routine and the generated coding. * The index registers are initialized (but they're not). * x1 equ 89 * * Addresses in the resident area * nstmts equ 183 Number of statements, including generated stop * Beginning of code by now glober equ 184 Global error flag -- WM means error reltab equ 188 Relocatable function table entry addresses subent equ 191 Entry to subscript routine imod equ 690 Integer modulus -- number of digits mantis equ 692 Floating point mantissa digits & 2 cdovly equ 769 1 if running from cards, N if from tape * * Addresses in ARITF * setfp equ 831 put mantissa width into B qfunct equ 1327 branch to function selector dosub equ 1206 branch to subscript routine ariti equ 1530 put integer size in B gmwm equ 1696 group mark * ORG 201 201beginn BCE cdovly,cdovly,1 load from cards 209retry RTW 1,700 217 BER taperr 222 RWD 1 * * Return here after loading * 227ldret MCW subent,dosub&3 subscript routine entry 234 CW gmwm 238 MCW reltab,qfunct&3 relocatable function table 245 MCW imod,ariti&6 integer modulus 252 MCW mantis,setfp&6 FP mantissa width & 2 259 CC 1 261 BW 280,glober 269 MCW nstmts,x1 entry address 276 H 0&X1 280halt H halt 284taperr BSP 1 289 H 3333,3333 296 B retry 300 DCW 0 301 DCW @}@ ex beginn END
- Phase 63 - Arithmetic Package. This phase consists of the arithmetic routine loaded by Phase 62.
JOB Fortran compiler -- Arithmetic package -- Phase 63 CTL 6611 * * This phase is comprised of the arithmetic routine which is * loaded by GEAUX phase 2. * ORG 87 89x1 DCW 000 91 DC 00 94x2 DCW 000 96 dc 00 99x3 DCW 000 100 dc 0 * * Arithmetic interpreter * * General form of interpreted string is * operand [ operator operand ... ], * however, if operand has a word mark, it's an operator, * usually a function call. Operands are machine addresses, * with a tag in the tens digit to indicate type: A- or B- * zone alone indicates integer. Operators are one character. * Subscript calculations are surrounded by $...$. * * Two accumulators in the print area are used. The low-order * digit of an operand is loaded into accumulator 1 at 250; it * extends leftward by the length of the operand, and rightward * from the left end by the mantissa width. Accumulator 2 has its * high-order digit at acchi&1; it extends rightward by the mantissa * width. * * In the Fortran manual C24-1455, the high-order digit of * accum 2 is labeled ACCHI&1. * acchi equ 279 * * Mostly, index register usage is * X1 = operand address * X2 = interpreter's counter, low-order digit of accum 1 * X3 = operand width * * Address in phase 62 * ldret equ 227 Return here after loading * ORG 700 700aritf SBR x2 704 SBR x1-3 Interpreter address for dumps 708 SBR ermsi&6 Interpreter address for err msgs 712nxtop MCW 2&X2,x1 x1 = Operand (result) address 719 SAR sx2a&6 Save x2-1 723nxtop0 SBR sx2b&6 twice 727 BCE dosub,0&X2,$ Subscript? 735 SBR res&6,0&X1 Save x1 (result address) 742 CS 303 Clear accumumulators 746 CS 747 CS 748 LCA kz1,acchi&1 Set high-order zero in accum 2 755nxtop1 S x1&2 Clear x1 759sx2a SBR x2,0-0 recover x2 = addr(operand) - 1 766 C 4&X2,asgop Compare op to assignment op 773 MCW 4&X2,savop Save whatever operator it is 780 SW 201 784 BL func func if assignment op .lt. operator * * Assignment op greater or equal to operator, i.e., operator is * blank, ., ) lozenge, } group mark, &, $, *, -, /, comma, %, # * 789 SBR nxtop2&6,4&X2 Save addr of operator 796 BCE dosub5,5&X2,$ Subscript? 804 MCW 7&X2,x1 Second operand address to x1 811 SAR sx2a&6 save 4&x2 815tstzon BWZ ariti,x1-1,K Operand 2 tag is B zone (integer)? 823 BWZ ariti,x1-1,S Operand 2 tag is A zone (integer)? 831 SBR x3,0 Loader plugs mantissa width into B 838 CW iflag Indicate floating point 842 MCW 0&X1,exp1-1 Save exponent 1 849 SAR x1 Save mantissa 1 address 853 MCW 0&X1,250 mantissa 1 to accumulator 1 * From here, X2 indexes accum 1, first high, then low digit 860 SBR x2 Set X2 to accum 1 address - op width 864 LCA kz1 Append a high-order zero to accum 1 868nxtop2 BW nosign,0-0 WM under operator? 876 MZ 250,zas Sign of operand 1 determines ZA or ZS 883nosign S kz1,252&X3 Add zeros below mantissa 890 C 1&X2,kz1 Compare operand high-order digit to 0 897 A x3,x2 x2 now at low-order digit of accum 1 904 BCE fdiv,savop,/ Divide? 912 BCE fmpy,savop,* Multiply? 920 S savop Turn it back to ZA 924savop ZA zas Copy this op code 928 BCE nmlz1,acchi&1,0 high-order digit of accum 2 zero? 936 BE clrwk Accum 1 high-order digit is zero 941 S exp1-1,exp2-1 exp2 is now exp2 - exp1 948 ZA exp2,x1&1 Move abs(exp2-exp1) to x1 955 C x3,x1 compare mantissa width and abs(exp2-exp1) 962 BM e1gte2,exp2-1 exp1 .gt. exp2 970 BH exdgmw abs(exp2-exp1) .gt. mantissa width 975 A exp2-1,exp1-1 Add exp2-exp1 to exp1 982 ZA 250,250&X1 Shift mantissa right by exp2-exp1 989 ZA x3&1,x1&1 X1 and X3 now both mantissa width 996addsub MZ zas,0&X2 Sign of accum 1 depends on op 1003 A acchi&X1,0&X2 Add (subtract) mantissas * * Relocatable functions return here too * 1010fret MZ 0&X2,zas * * Normalize floating-point result of a single arithmetic * operation; place the normalized result in the working * accumulator. If exponent overflow is detected, go to ERMSG to * print message (NOF); then go to STR99. If exponent underflow * is detected, go to STRZE. Here, the low-order digit of the * result is indexed by x2. * * The normalized result is left in accum 2. * 1017nmlz1 ZA exp1-1,exp2-1 1024nmlz2 MCW rm,1&X2 Insert RM after low-order digit 1031 MZ Chain 1032 MZ two zeros 1033 A and add another one 1034 MN Decr A and B (copies junk to unused) 1035 SBR x1 X1 is now two below accum 1 high-order 1039 S acchi&2&X3 Clear accum 2 1043nmlzl BCE strze,2&X1,| Record mark indicates zero result 1051 SBR x1 Bump x1 1055 BCE nmlzl,1&X1,0 Zero means more normalization needed 1063 MCM 1&X1,acchi&1 Normalize 1070 S x3,x2 1077 CW Decrease AS and BS to 1078 CW refer to X2 and X1 1079 S S x2,x1 1080 S x1,exp2-1 Store normalized exponent 1087zas ZA acchi&X3 ZS if accum 1 negative 1091 SW 1092 BCE clrwk,exp2-3,0 1100 BM strze,exp2-1 Exponent underflow 1108 B ermsg Exponent overflow 1114 DCW @NOF@ * * Exponent overflow; set result magnitude equal to largest * value possible in floating-point notation; set result sign * as appropriate. * 1115str99 ZA kp99,exp2-1 -99 to exp2 1122 MN kp99,acchi&X3 All 9's 1129 MCW to mantissa 1130 MCW acchi-1&X3 in accum2 * * Clear accum 1 after an individual arithmetic operation * 1134clrwk CS acchi-1 1138 B nxtop1 * * Exponent underflow, or result is zero. Set floating-point * result to zero * 1142strze S exp2-1 exp2 = 0 1146 S acchi&X3 accum 2 mantissa = 0 1150 B clrwk * * Division by zero * 1154dverr B ermsg 1160 dcw @DZE@ Divide by zero message 1161 B str99 Insert overflow exponent * * exp1 is greater than exp2 * 1165e1gte2 BH nmlz1 abs(exp2-exp1) .gt. mantissa width 1170 S x3&1,x1&1 subtr man. width from abs(exp2-exp1) 1177 MZ acchi&X3,acchi&X1 Move zone over to new width 1184 B addsub Go add (or subtract) mantissas * * abs(exp2-exp1) .gt. mantissa width * 1188exdgmw A exp1-1,exp2-1 Restore exp2 1195 B clrwk * * Calculate subscripted address using a relocatable routine that * is only loaded if needed. * 1199dosub5 SBR x2,5&X2 Bump x2 to beginning of subscript info 1206dosub B 0-0 Loader plugs subscript routine address here * 1210 MN 0&X2 Subtract 4 from x2 1214 MN 1215 MN 1216 MN 1217 SAR sx2a&6 1221sx2b BCE nxtop0,0-0,$ 1229 B tstzon * * Floating-point divide * 1233fdiv BE dverr Divide by zero (compare was at nosign) 1238 MN acchi&X3,1&X2 1245 MCW 1246 MN 1247 D 0&X1,251 Divide mantissas. 1254 ZS exp1-1 Negate exponent 1258 B exps Go add exponents, normalize, etc. * * Floating-point multiply * 1262fmpy M acchi&X3,251&X3 Multiply mantissas 1269 SBR x2,3&X2 1276 S kp2,exp2-1 1283exps A exp1-1,exp2-1 Add exponents 1290 MZ acchi&X3,*&1 Prepare to 1297 ZA zas set sign of result 1301 B nmlz2 Normalize * * Assignment operator is less than current operator, i.e., * current operator is one of @, ?, A-I, !, J-R, |, S-Z, 0-9. * If not record mark, it's the first character of what would * otherwise be an operand, so bump the operand address. * 1305func BCE done,4&X2,| Done (record mark)? 1313 SBR sx2a&6,1&X2 Bump operand addr 1320 C acchi&1,kz1 High-order accum 2 mantissa digit * The loader plugs the relocatable function selector address here 1327qfunct B 0 Go to function selector 1331done BCE res,acchi&1,0 Floating-point result zero? 1339 BW res,iflag Integer result? 1347 BW fpres,4&X2 WM under operator? 1355 SBR x3,2&X3 1362sexp2 MCM exp2-2,acchi-1&X3 Move exp2 to accum 2 1369res LCA acchi&X3,0 Store accumulator to saved B 1376 BW 5&X2,4&X2 Return if done (word mark) 1384 SAR x2 Bump x2 to next operand 1388 B nxtop * * Round nonzero floating-point result * 1392fpres A kp5,acchi-1&X3 Round mantissa 1399 BWZ carry,acchi&1,S Carry in acc2 shown by A-zone? 1407cpzone MZ acchi&X3,acchi-2&X3 Move zone from exp to man 1414 B sexp2 1418carry A kp1,exp2-1 Bump exponent 1425 BCE fovfl,exp2-3,1 Overflow? 1433 S acchi&X3 Clear mantissa 1437 LCA k1b-1,acchi&1 and put 1 in its high-order digit 1444 B cpzone * * Floating-point overflow -- high-order digit of exp2 is 1 * 1448fovfl MN kp99,acchi&X3 99 to 1455 MCW exponent 1456 MCW acchi-1&X3 all 9s to mantissa 1460 S kp1,exp2-1 1467 B cpzone * * Print appropriate error messages, which includes a mnemonic * three-character code and the display address in the generated * procedure of the source program statement being executed. This * subroutine is used to record circumstances, occurring during * arithmetic operations, which may affect the calculation * adversely. * 1471ermsg SBR ersvx&6 Save return address 1475 CS 202&X3 1479 SBR ersx3&6,0&X3 Save x3 1486ersvx SBR x3,0 Return address to x3 1493 MCW 2&X3,212 Mnemonic to print area 1500ermsi SBR 217,0 Interpreter address to print area 1507 W 1508 SW 201 1512 SBR ermsgx&3,3&X3 Return address to exit 1519ersx3 SBR x3,0 Restore x3 1526ermsgx B 0 * * Operand tens digit has A or B but not AB zone (integer arith.) * 1530ariti SBR x3,0 Loader puts integer size in B 1537 SW iflag Indicate integer 1541 MCS 0&X1,250 Operand to accumulator 1 1548 BCE xdiv,savop,/ Divide? 1556 BCE xmpy,savop,* Multiply? 1564 BM xsub,savop Subtract? 1572 A 0&X1,acchi&X3 Add operand to accumulator 2 1579xsign ZA acchi&X3 Put a sign on the accumulator 1583 B clrwk 1587xsub S 0&X1,acchi&X3 Subtract operand from accumulator 2 1594 B xsign 1598xmpy LCA 0&X1,250 Move operand to accumulator 1 1605 M acchi&X3,251&X3 1612 MCW 251&X3,acchi&X3 1619 B clrwk 1623xdiv BCE dverr,250, Divide by zero? 1631 MCW 0&X1,250&X3 1638 MN 1639 SBR moveq&3 Store addr to move to accum 2 1643 LCA acchi&X3 1647 ZA acchi&X3,250&X3 1654 D 0&X1,251 1661moveq MCW 249,acchi&X3 1668 B clrwk * * Data * 1674 dcw 000 Chained to RM 1675rm DCW @|@ 1676 DCW 0 1680exp2 DCW @000|@ Exponent of accum 2, and zero and RM 1683exp1 dcw 000 Exponent of accum 1, and zero 1684k8 dcw 8 1685kz1 DCW 0 1686asgop dcw @#@ Assignment operator 1687iflag DCW #1 Word mark indicates integer 1689kp99 dcw &99 Used for overflow 1690kp2 DCW &2 1691kp5 dcw &5 1692kp1 dcw &1 1694k1b dcw @1 @ 1695 DCW 0 1696gmwm DCW @}@ ex ldret END