Source Code
These source-code files were obtained by digitally photographing
a Solarium 55 (Apollo 6) program listing from the American Computer Museum in
Bozeman, Montana. Photography was by Ron Burkey, with assistance from
museum curator George Keremedjiev and Montana
State University curator Kim Scott. The listing originally belonged to Eldon C. Hall,
who donated it to the museum. Volunteers then manually typed in the
source code or else modified similar pre-existing Colossus 249
(Apollo 9) source files to incorporate changes, although this transcription was
principally done by Jim Lawton and corrected by Ron Burkey.
Notations on the program listing read, in part:YUL SYSTEM FOR AGC4: REVISION 0 OF PROGRAM SOLRUM55 BY NASA 1021108-021 DEC. 4, 1966Note that the date is the date of the printout, not the date of the program revision. Due to statements by Jay Sampson, the original contractor from AC Electronics who created Solarium 54 (Apollo 4) from the earlier Corona (AS-202 mission) program, it is believed that Solarium 54 and Solarium 55 (Apollo 6) are actually identical programs. The change in numbering, from 54 to 55, is believed to be for some administrative purpose. Thus, it is believed that the source-code represented here is equally appropriate for both Apollo 4 and Apollo 6 missions. |
002761,000002: ## Copyright: Public domain.
002762,000003: ## Filename: BANK_03_INTERPRETER_SECTION.agc
002763,000004: ## Purpose: Part of the source code for Solarium build 55. This
002764,000005: ## is for the Command Module's (CM) Apollo Guidance
002765,000006: ## Computer (AGC), for Apollo 6.
002766,000007: ## Assembler: yaYUL --block1
002767,000008: ## Contact: Jim Lawton <jim DOT lawton AT gmail DOT com>
002768,000009: ## Website: www.ibiblio.org/apollo/index.html
002769,000010: ## Page Scans: www.ibiblio.org/apollo/ScansForConversion/Solarium055/
002770,000011: ## Mod history: 2009-09-17 JL Created.
002771,000012: ## 2009-09-22 JL Fixed typo.
002772,000013: ## 2016-08-18 RSB Some corrections.
002773,000014: ## 2016-12-28 RSB Proofed comment text using octopus/ProoferComments,
002774,000015: ## and fixed errors found.
002775,000016:
Page 70 |
002777,000018: 03,6000 SETLOC 6000
002778,000019:
002779,000020: 03,6000 06021 BMN1 TC BRANCH # BRANCH MINUS
002780,000021: 03,6001 04703 TC RE-ENTER
002781,000022: 03,6002 04703 TC RE-ENTER
002782,000023: 03,6003 04567 TC DOBR
002783,000024:
002784,000025: 03,6004 06021 BPL1 TC BRANCH # BRANCH PLUS
002785,000026: 03,6005 04567 TC DOBR
002786,000027: 03,6006 04567 TC DOBR
002787,000028: 03,6007 04703 TC RE-ENTER
002788,000029:
002789,000030: 03,6010 06021 BZE1 TC BRANCH # BRANCH ZERO
002790,000031: 03,6011 04703 TC RE-ENTER
002791,000032: 03,6012 04567 TC DOBR
002792,000033: 03,6013 04703 TC RE-ENTER
002793,000034:
002794,000035: 03,6014 10115 BHIZ1 CCS MPAC # BRANCH ON HIGH ORDER ZERO
002795,000036: 03,6015 04703 TC RE-ENTER # PNZ
002796,000037: 03,6016 04567 TC DOBR
002797,000038: 03,6017 04703 TC RE-ENTER
002798,000039: 03,6020 04567 TC DOBR
002799,000040:
002800,000041: 03,6021 30001 BRANCH XCH Q
002801,000042: 03,6022 50111 TS BRANCHQ
002802,000043: 03,6023 10115 CCS MPAC
002803,000044: 03,6024 00111 TC BRANCHQ
002804,000045: 03,6025 06027 TC +2
002805,000046: 03,6026 06036 TC MINUS
002806,000047:
002807,000048: 03,6027 10116 CCS MPAC +1
002808,000049: 03,6030 00111 TC BRANCHQ
002809,000050: 03,6031 06033 TC +2
002810,000051: 03,6032 06036 TC MINUS
002811,000052:
002812,000053: 03,6033 10117 CCS MPAC +2
002813,000054: 03,6034 00111 TC BRANCHQ
002814,000055: 03,6035 06037 TC +2
002815,000056: 03,6036 34516 MINUS CAF ONE
002816,000057: 03,6037 64516 AD ONE
002817,000058: 03,6040 60111 AD BRANCHQ
002818,000059: 03,6041 00000 XAQ
002819,000060:
Page 71 |
002821,000062:
002822,000063: 03,6042 40067 TRUE2 CS FIXLOC # RESTORES INTEGER ADDRESSES
002823,000064: 03,6043 60062 AD ADDRWD
002824,000065: 03,6044 50062 TS ADDRWD
002825,000066: 03,6045 10000 CCS A # WE MUST ELIMINATE THE MINUS ZERO CASE
002826,000067: 03,6046 00001 TC Q # OK HERE
002827,000068: 03,6047 03062 TC CCSHOLE
002828,000069: 03,6050 06052 TC +2 # IF ADDRESS WAS NEGATIVE
002829,000070: 03,6051 04024 TC DANZIG # FAST EXIT FOR ZERO SHIFT COUNTS
002830,000071: 03,6052 20065 INDEX MODE # RIGHT SHIFT INSTEAD OF A LEFT ONE
002831,000072: 03,6053 06056 TC +3 # CCS FOLLOWED BY ADD LEFT THE COUNT POS.
002832,000073: 03,6054 05100 TC SHIFTR1 +3 # SO WE NEED ONLY CALL THE APPROPRIATE
002833,000074: 03,6055 05100 TC SHIFTR1 +3 # SHIFT RIGHT INSTRUCTION.
002834,000075: 03,6056 40062 CS ADDRWD # PUT POSITIVE COUNT IN ADDRWD.
002835,000076: 03,6057 50062 TS ADDRWD
002836,000077: 03,6060 64335 AD NEG1 # DECREMENT LIKE CCS BEFORE RETURNING.
002837,000078: 03,6061 05637 TC VSRT1 +4
002838,000079:
002839,000080: 03,6062 04722 AST TC TAG
002840,000081: 03,6063 40076 CS POLISH
002841,000082: 03,6064 20075 SSTORE INDEX TAG1
002842,000083: 03,6065 30050 XCH 40D # STEP REGISTER
002843,000084: 03,6066 04703 TC RE-ENTER
002844,000085:
002845,000086: 03,6067 04722 AXC TC TAG # ADDRESS TO INDEX COMPLEMENTED
002846,000087: 03,6070 30076 XCH POLISH
002847,000088: 03,6071 06074 TC XSTORE
002848,000089:
002849,000090: 03,6072 04722 AXT TC TAG
002850,000091: 03,6073 40076 CS POLISH
002851,000092: 03,6074 20075 XSTORE INDEX TAG1
002852,000093: 03,6075 30046 XCH 38D # MAY HAVE OVERFLOWED
002853,000094: 03,6076 04703 TC RE-ENTER
002854,000095:
002855,000096: 03,6077 04722 LXA TC TAG
002856,000097: 03,6100 20062 INDEX ADDRWD # MUST BE ERASABLE - NOT NEEDED OTHERWISE
002857,000098: 03,6101 40000 CS 0
002858,000099: 03,6102 40000 +3 CS A
002859,000100: 03,6103 06074 TC XSTORE
002860,000101:
002861,000102: 03,6104 04722 LXC TC TAG # LOAD INDEX FROM ADDRESS COMPLEMENTED
002862,000103: 03,6105 20062 INDEX ADDRWD
002863,000104: 03,6106 40000 CS 0
002864,000105: 03,6107 06074 TC XSTORE
002865,000106:
002866,000107: 03,6110 04722 SXA TC TAG
002867,000108: 03,6111 20075 INDEX TAG1
002868,000109: 03,6112 40046 CS 38D # GET INDEX
002869,000110: 03,6113 40000 CS A
002870,000111: 03,6114 04701 TC STOR1
002871,000112:
Page 72 |
002873,000114:
002874,000115: 03,6115 04722 TIX TC TAG
002875,000116: 03,6116 20075 INDEX TAG1 # GET APPROPRIATE STEP REGISTER
002876,000117: 03,6117 40050 CS 40D # STEP REGISTER
002877,000118: 03,6120 20075 INDEX TAG1
002878,000119: 03,6121 60046 AD 38D
002879,000120: 03,6122 50102 TS TEM2 # TO TEMPORARY
002880,000121: 03,6123 10000 CCS A
002881,000122: 03,6124 30102 XCH TEM2 # DECREMENT INDEX AND BRANCH
002882,000123: 03,6125 06130 TC TIXBR
002883,000124: 03,6126 04703 TC RE-ENTER # INDEX LEFT ALONE AND NO BRANCH
002884,000125: 03,6127 04703 LNOBR TC RE-ENTER
002885,000126:
002886,000127: 03,6130 20075 TIXBR INDEX TAG1
002887,000128: 03,6131 50046 TS 38D
002888,000129: 03,6132 40076 CS POLISH
002889,000130: 03,6133 04602 TC DOBR2
002890,000131:
002891,000132: 03,6134 04722 INCR TC TAG
002892,000133: 03,6135 40076 CS POLISH
002893,000134: 03,6136 20075 INDEX TAG1
002894,000135: 03,6137 60046 AD 38D
002895,000136: 03,6140 06074 TC XSTORE
002896,000137:
002897,000138: 03,6141 04722 XCHX TC TAG
002898,000139: 03,6142 20062 INDEX ADDRWD
002899,000140: 03,6143 30000 XCH 0
002900,000141: 03,6144 20075 INDEX TAG1
002901,000142: 03,6145 30046 XCH 38D
002902,000143: 03,6146 04701 TC STOR1
002903,000144:
002904,000145: 03,6147 04722 XSU TC TAG # INDEX REGISTER SUBTRACT FROM ERASABLE
002905,000146: 03,6150 20062 INDEX ADDRWD
002906,000147: 03,6151 40000 CS 0
002907,000148: 03,6152 06136 TC INCR +2
002908,000149:
002909,000150: 03,6153 04722 XAD TC TAG # INDEX REGISTER ADD FROM ERASABLE
002910,000151: 03,6154 20062 INDEX ADDRWD
002911,000152: 03,6155 40000 CS 0
002912,000153: 03,6156 40000 COM
002913,000154: 03,6157 06136 TC INCR +2
002914,000155:
Page 73 |
002916,000157:
002917,000158: 03,6160 35501 VDEF CAF ZERO
002918,000159: 03,6161 60070 AD VACLOC # USES MPAC AS V0, PUSHES UP FOR V1, AND
002919,000160: 03,6162 50102 TS TEM2 # PUSHES UP AGAIN FOR V2. THE RESULTING
002920,000161: 03,6163 34772 CAF DAD2 +4 # VECTOR IS LEFT IN VAC
002921,000162: 03,6164 05041 TC 8TO2
002922,000163: 03,6165 05412 TC INCRT2
002923,000164: 03,6166 04326 TC PUSHUP1
002924,000165: 03,6167 05041 TC 8TO2
002925,000166: 03,6170 05412 TC INCRT2
002926,000167: 03,6171 04326 TC PUSHUP1
002927,000168: 03,6172 05041 TC 8TO2
002928,000169: 03,6173 05410 TC ZEROEXIT # T0 DECLAIN MO45 IS VECTOR
002929,000170:
002930,000171: 03,6174 10020 ITA1 CCS CYR
002931,000172: 03,6175 06203 TC +6 # FOR ITA
002932,000173: 03,6176 03062 TC CCSHOLE
002933,000174: 03,6177 20062 INDEX ADDRWD # PICK UP ADDRESS
002934,000175: 03,6200 40000 CS 0
002935,000176: 03,6201 40000 COM
002936,000177: 03,6202 04602 TC DOBR2 # AND DO THE BRANCH
002937,000178:
002938,000179: 03,6203 20067 +6 INDEX FIXLOC
002939,000180: 03,6204 40052 CS QPRET
002940,000181: 03,6205 06113 TC SXA +3 # COMPLEMENT AND DEPOSIT
002941,000182:
002942,000183: 03,6206 10020 EXIT CCS CYR # RETURN TO BASIC
002943,000184: 03,6207 04571 TC EXIT2 # EXIT.
002944,000185:
002945,000186: 03,6210 03062 TC CCSHOLE
002946,000187:
002947,000188: 03,6211 40076 CS POLISH # HERE TO RETURN TO BASIC AT X
002948,000189: 03,6212 05662 TC SWCALL
002949,000190:
002950,000191: 03,6213 20062 SIGN INDEX ADDRWD # AFFIX SIGN OF X TO MPAC OR VAC
002951,000192: 03,6214 10000 CCS 0 # MUST BE NON-ZERO
002952,000193: 03,6215 04024 TC DANZIG
002953,000194: 03,6216 06220 TC +2 # EXAMINE MINOR PART
002954,000195: 03,6217 06325 TC COMP # COMPLEMENT VECTOR OR SCALAR.
002955,000196:
002956,000197: 03,6220 20062 INDEX ADDRWD
002957,000198: 03,6221 10001 CCS 1
002958,000199: 03,6222 04024 TC DANZIG
002959,000200: 03,6223 04024 TC DANZIG # NO OPERATION IF C(ADDRWD,ADDRWD+1) = 0
002960,000201: 03,6224 06325 TC COMP
002961,000202: 03,6225 04024 TC DANZIG
002962,000203:
Page 74 |
002964,000205:
002965,000206: 03,6226 40070 VSQ CS VACLOC # TAKE SQUARE OF LENGTH OF VECTOR IN VAC.
002966,000207: 03,6227 40000 COM
002967,000208: 03,6230 50062 TS ADDRWD
002968,000209: 03,6231 05235 TC DOT1 +1 # FINISH IN DOT PRODUCT ROUTINE.
002969,000210:
002970,000211: 03,6232 64516 AD ONE # FROM TRUE2
002971,000212:
002972,000213: 03,6233 30001 SHIFTR XCH Q
002973,000214: 03,6234 50104 TS TEM5 # SHIFT TP MPAC RIGHT ACCORDING TO INTEGER
002974,000215: 03,6235 10001 CCS Q # PICK UP COUNT, SUBTRACTING ONE
002975,000216: 03,6236 65363 +3 AD NEG13 # RETURNS HERE FROM SR14
002976,000217: 03,6237 10000 CCS A
002977,000218: 03,6240 64516 AD ONE # SHIFT COUNT MORE THAN 14 - DECREMENT BY
002978,000219: 03,6241 06251 TC SR14 # 14 AND EXCHANGE
002979,000220: 03,6242 06244 TC +2 # REMAINING SHIFT COUNT BETWEEN 1 AND 13
002980,000221: 03,6243 06251 TC SR14 # MULTIPLES OF 14 END UP HERE
002981,000222: 03,6244 40000 COM
002982,000223: 03,6245 20000 INDEX A # PICK UP PROPER SHIFTING BIT
002983,000224: 03,6246 34515 CAF BIT2
002984,000225: 03,6247 05416 TC SHORTMP # DO SHIFT BY MULTIPLICATION
002985,000226: 03,6250 00104 TC TEM5 # (TEM5 CONTAINS SQRT RETURN IF SQRT CALL)
002986,000227:
002987,000228: 03,6251 30115 SR14 XCH MPAC # SAVE REDUCED COUNT
002988,000229: 03,6252 30116 XCH MPAC +1
002989,000230: 03,6253 30117 XCH MPAC +2
002990,000231: 03,6254 35501 CAF ZERO
002991,000232: 03,6255 30115 XCH MPAC # NOW BRING IT BACK
002992,000233: 03,6256 10000 CCS A # SEE IF REMAINING COUNT IS ZERO
002993,000234: 03,6257 06236 TC SHIFTR +3 # NON-ZERO - BACK TO SHIFT LOOP
002994,000235: 03,6260 00104 TC TEM5 # FINISHED
002995,000236:
Page 75 |
002997,000238:
002998,000239: 03,6261 06263 ABVAL1 TC ABVAL
002999,000240: 03,6262 05237 TC DPEXIT # MODE IS NOW DP
003000,000241:
003001,000242: 03,6263 30001 ABVAL XCH Q # TAKES HALF THE LENGTH OF THE VECTOR IN
003002,000243: 03,6264 50107 TS TEM10 # VAC
003003,000244: 03,6265 06275 TC VSR1 # SHIFT VECTOR RIGHT ONE
003004,000245: 03,6266 05246 TC DOT2 # TAKE THE SQUARE OF ITS LENGTH
003005,000246: 03,6267 45502 CS FOUR # STORE SQUARE OF LENGTH IN REGISTERS 28
003006,000247: 03,6270 60070 AD VACLOC # AND 29 OF VAC AREA.
003007,000248: 03,6271 05347 TC STORDAC
003008,000249: 03,6272 04740 TC MPACCOM
003009,000250: 03,6273 07322 TC SQRT3 # TAKE A TRIPLE-PRECISION SQRT (DP ANSWER)
003010,000251: 03,6274 00107 TC TEM10 # AND EXIT
003011,000252:
003012,000253: 03,6275 30001 VSR1 XCH Q # SUBROUTINE WHICH SHIFTS VECTOR IN VAC
003013,000254: 03,6276 50106 TS TEM9 # RIGHT ONE PLACE, USED BY ABVAL AND UNIT
003014,000255: 03,6277 35502 CAF FOUR
003015,000256: 03,6300 60070 AD VACLOC # USED BY ABVAL AND UNIT
003016,000257: 03,6301 07301 TC SR1 # VECTOR IS SHIFTED RIGHT SO DOT PRODUCT
003017,000258: 03,6302 30064 XCH TEM11 # WONT OVERFLOW.
003018,000259: 03,6303 64340 AD MINUS2
003019,000260: 03,6304 07301 TC SR1
003020,000261: 03,6305 30064 XCH TEM11
003021,000262: 03,6306 64340 AD MINUS2
003022,000263: 03,6307 50062 TS ADDRWD # FOR THE DOT ROUTINE.
003023,000264: 03,6310 07301 TC SR1 # VECTOR IS NOW SHIFTED RIGHT
003024,000265:
003025,000266: 03,6311 00106 TC TEM9
003026,000267:
003027,000268: 03,6312 06021 SSM TC BRANCH # SET SIGN OF MPAC,MPAC+1 MINUS, USED BY
003028,000269: 03,6313 04740 TC MPACCOM # SIGN INSTRUCTION
003029,000270: 03,6314 04024 TC DANZIG
003030,000271: 03,6315 04024 TC DANZIG
003031,000272:
003032,000273: 03,6316 06021 SSP TC BRANCH
003033,000274: 03,6317 04024 TC DANZIG
003034,000275: 03,6320 04024 TC DANZIG
003035,000276: 03,6321 04740 TC MPACCOM
003036,000277: 03,6322 04024 TC DANZIG
003037,000278:
Page 76 |
003039,000280:
003040,000281: 03,6323 34231 SQUARE CAF BUGMPAC # SQUARE MPAC AND LEAVE RESULT IN MPAC, +2
003041,000282: 03,6324 05064 TC DSQ2 # CONTINUE AS IN DMP.
003042,000283:
003043,000284: 03,6325 40065 COMP CS MODE
003044,000285: 03,6326 60000 DOUBLE
003045,000286: 03,6327 20000 INDEX A
003046,000287: 03,6330 06331 TC +1
003047,000288: 03,6331 05202 TC VACCOM
003048,000289: 03,6332 04024 TC DANZIG
003049,000290: 03,6333 04740 TC MPACCOM # FOR TP
003050,000291: 03,6334 04024 TC DANZIG
003051,000292: 03,6335 06333 TC -2
003052,000293:
003053,000294: 03,6336 35501 SMOVE CAF ZERO
003054,000295: 03,6337 50116 TS MPAC +1
003055,000296: 03,6340 04024 TC DANZIG
003056,000297:
003057,000298: 03,6341 10020 NEXT CCS CYR # NEXT AND ITCQ OPERATORS
003058,000299: 03,6342 10121 CCS ADRLOC # NEXT - KNOCK DOWN ADRLOC BY ONE
003059,000300: 03,6343 06347 TC +4 # AND BEGIN NEXT EQUN IMMEDIATELY
003060,000301: 03,6344 20067 INDEX FIXLOC # ITCQ - PICK UP QPRET AND BRANCH
003061,000302: 03,6345 30052 XCH QPRET
003062,000303: 03,6346 04602 TC DOBR2
003063,000304:
003064,000305: 03,6347 50121 +4 TS ADRLOC
003065,000306: 03,6350 34516 CAF ONE # TURN ON LOAD INDICATOR
003066,000307: 03,6351 06362 TC SWLODIND
003067,000308:
003068,000309: 03,6352 10121 NOLOAD CCS ADRLOC # NOLOD AND ROUND OPERATORS. DECREMENT
003069,000310: 03,6353 50121 TS ADRLOC # ADRLOC SINCE WE SHOULDNT HAVE TAKEN AN
003070,000311: 03,6354 10020 CCS CYR # ADDRESS. SEE IF NOLOD OR ROUND
003071,000312: 03,6355 35501 CAF ZERO # NOLOD - SET NEWEQIND TO ZERO
003072,000313: 03,6356 06362 TC +4
003073,000314: 03,6357 44516 CS ONE # MODE IS NOW DP
003074,000315: 03,6360 50065 TS MODE
003075,000316: 03,6361 05072 TC MPACRND # GO ROUND MPAC AND RETURN TO DANZIG
003076,000317:
003077,000318: 03,6362 50066 SWLODIND TS NEWEQIND
003078,000319: 03,6363 04024 TC DANZIG
003079,000320:
Page 77 |
003081,000322:
003082,000323: 03,6364 30117 SL1 XCH MPAC +2 # ROUTINE WHICH SHIFTS TRIPLE ACCUMULATOR
003083,000324: 03,6365 60000 DOUBLE # LEFT ONE PLACE. IT IS USED BY TSLT AND
003084,000325: 03,6366 50117 TS MPAC +2 # TSLC
003085,000326: 03,6367 35501 CAF ZERO
003086,000327: 03,6370 60116 AD MPAC +1
003087,000328: 03,6371 60116 AD MPAC +1
003088,000329: 03,6372 50116 TS MPAC +1
003089,000330: 03,6373 35501 CAF ZERO
003090,000331: 03,6374 60115 AD MPAC
003091,000332: 03,6375 60115 AD MPAC
003092,000333: 03,6376 50115 TS MPAC
003093,000334: 03,6377 00001 TC Q
003094,000335: 03,6400 50122 TS OVFIND # SET OVFIND IF ENTIRE WORD OVERFLOWS
003095,000336: 03,6401 00001 TC Q
003096,000337:
003097,000338: 03,6402 06042 SHIFTL TC TRUE2 # TP LEFT SHIFT - GET INTEGER ADDRESS
003098,000339: 03,6403 06406 TC +3
003099,000340: 03,6404 50062 LEFTLOOP TS ADDRWD
003100,000341: 03,6405 06364 TC SL1
003101,000342: 03,6406 10062 +3 CCS ADDRWD
003102,000343: 03,6407 06404 TC LEFTLOOP
003103,000344: 03,6410 04024 TC DANZIG
003104,000345:
003105,000346: 03,6411 35501 TSLC CAF ZERO # NORMALIZATION - START BY SETTING COUNT
003106,000347: 03,6412 50102 TS TEM2 # TO ZERO
003107,000348: 03,6413 06021 TC BRANCH
003108,000349: 03,6414 06416 TC +2
003109,000350: 03,6415 06430 TC SLCANS
003110,000351:
003111,000352: 03,6416 40115 RETRN CS MPAC # HERE FOR NON-ZERO
003112,000353: 03,6417 60000 DOUBLE
003113,000354: 03,6420 50000 OVSK # SKIP ON OVERFLOW
003114,000355: 03,6421 06423 TC +2 # NO OVERFLOW - SHIFT AGAIN
003115,000356: 03,6422 06430 TC SLCANS # DONE - WE OVERFLOWED
003116,000357: 03,6423 30102 XCH TEM2
003117,000358: 03,6424 64516 AD ONE
003118,000359: 03,6425 50102 TS TEM2
003119,000360: 03,6426 06364 TC SL1 # DO THE SHIFT
003120,000361: 03,6427 06416 TC RETRN # AND LOOP
003121,000362:
003122,000363: 03,6430 40102 SLCANS CS TEM2 # STORE COMPLEMENT OF COUNT
003123,000364: 03,6431 20062 INDEX ADDRWD
003124,000365: 03,6432 50000 TS 0
003125,000366: 03,6433 04024 TC DANZIG
003126,000367:
Page 78 |
003128,000369:
003129,000370: 03,6434 40076 SWITCHEM CS POLISH # SWITCH AND TEST INSTRUCTIONS.
003130,000371: 03,6435 50062 TS ADDRWD # DECOMPOSE ADDRESS INTO SWITCH WORD AND
003131,000372: 03,6436 77210 MASK SBITMASK # BIT. MULTIPLES OF 16 ARE EXCLUDED.
003132,000373: 03,6437 30062 XCH ADDRWD
003133,000374: 03,6440 25777 EXTEND
003134,000375: 03,6441 44504 MP BIT11
003135,000376: 03,6442 50105 TS TEM8 # 0, 1, OR 2.
003136,000377:
003137,000378: 03,6443 20062 INDEX ADDRWD # PICK UP A 1 IN SPECIFIED SWITCH POS.
003138,000379: 03,6444 34477 CAF BIT15 -1 # SWITCHES ARE NUMBERED 1 - 15 D.
003139,000380: 03,6445 50103 TS TEM4
003140,000381: 03,6446 20017 INHINT
003141,000382: 03,6447 20105 INDEX TEM8
003142,000383: 03,6450 70645 MASK STATE # GET BS WHERE B IS BIT AND S IS *STATE*
003143,000384: 03,6451 50104 TS TEM5 # - THE WORD CONTAINING THE 15 SWITCHES
003144,000385:
003145,000386: 03,6452 10020 CCS CYR # DECIDE WHETHER INST. IS *SWITCH* OR TEST
003146,000387: 03,6453 04364 TC INCADR # TO PICK UP NEXT ADDRESS
003147,000388: 03,6454 06457 TC +3
003148,000389: 03,6455 40103 CS TEM4
003149,000390: 03,6456 06464 TC SWITCHIT # SWITCH BIT.
003150,000391:
003151,000392: 03,6457 20016 RELINT
003152,000393: 03,6460 10104 CCS TEM5 # TEST SWITCH
003153,000394: 03,6461 04703 TC RE-ENTER # IT WAS ON - DONT BRANCH
003154,000395: 03,6462 04574 TC SWF/F # OFF - GO TO FIXED-FIXED TO PICK UP ADR.
003155,000396: 03,6463 04703 TC RE-ENTER # COMES HERE IF BIT 15 WAS ON
003156,000397:
003157,000398: 03,6464 20105 SWITCHIT INDEX TEM8 # WE DESIRE THE LOGICAL EXCLUSIVE OR OF B
003158,000399: 03,6465 70645 MASK STATE
003159,000400: 03,6466 50001 TS Q # SET THIS BIT TO OSO AD IS OR.
003160,000401: 03,6467 20105 INDEX TEM8
003161,000402: 03,6470 40645 CS STATE
003162,000403: 03,6471 70103 MASK TEM4 # COMPLEMENT OF SWITCH BIT.
003163,000404: 03,6472 60001 AD Q # OR
003164,000405: 03,6473 20105 INDEX TEM8
003165,000406: 03,6474 50645 TS STATE
003166,000407: 03,6475 20016 RELINT
003167,000408: 03,6476 04703 TC RE-ENTER # DONT PUSH-DOWN IF AT END.
003168,000409:
Page 79 |
003170,000411:
003171,000412: 03,6477 50116 VSLT2 TS MPAC +1 # SET TO ZERO IN CASE OF RIGHT SHIFT.
003172,000413: 03,6500 06042 TC TRUE2 # RETURNS TO CALLER IF COUNT PNZ.
003173,000414:
003174,000415: 03,6501 06513 TC VSLTEST
003175,000416: 03,6502 50062 VSLTLOOP TS ADDRWD
003176,000417: 03,6503 35501 CAF ZERO
003177,000418: 03,6504 60070 AD VACLOC
003178,000419: 03,6505 50102 TS TEM2
003179,000420: 03,6506 06516 TC VSL1
003180,000421: 03,6507 05412 TC INCRT2
003181,000422: 03,6510 06516 TC VSL1
003182,000423: 03,6511 05412 TC INCRT2
003183,000424: 03,6512 06516 TC VSL1
003184,000425: 03,6513 10062 VSLTEST CCS ADDRWD
003185,000426: 03,6514 06502 TC VSLTLOOP
003186,000427: 03,6515 04024 TC DANZIG
003187,000428:
003188,000429: 03,6516 20102 VSL1 INDEX TEM2
003189,000430: 03,6517 30001 XCH 1
003190,000431: 03,6520 60000 DOUBLE
003191,000432: 03,6521 20102 INDEX TEM2
003192,000433: 03,6522 50001 TS 1
003193,000434: 03,6523 35501 CAF ZERO
003194,000435: 03,6524 20102 INDEX TEM2
003195,000436: 03,6525 60000 AD 0
003196,000437: 03,6526 20102 INDEX TEM2
003197,000438: 03,6527 60000 AD 0
003198,000439: 03,6530 20102 INDEX TEM2
003199,000440: 03,6531 50000 TS 0
003200,000441: 03,6532 00001 TC Q
003201,000442: 03,6533 50122 TS OVFIND
003202,000443: 03,6534 00001 TC Q
003203,000444:
Page 80 |
003205,000446:
003206,000447: # DOUBLE-PRECISION SINE-COSINE ROUTINES.
003207,000448:
003208,000449: # THESE PROGRAMS ARE ENTERED AND EXIT IN THE INTERPRETIVE MODE, WITH
003209,000450: # THE ARGUMENT IN MPAC AT ENTRY AND THE ANSWER IN MPAC AT EXIT. THEY
003210,000451: # COMPUTE, RESPECTIVELY, (1/2) COS (PI X) AND (1/2) SIN (PI X) WHERE
003211,000452: # X = C(MPAC) RANGES OVER THE INTERVAL (-1, +1).
003212,000453:
003213,000454: # PROGRAM USES THE SERIES
003214,000455: # 3 5 7 9
003215,000456: # (1/2) SIN(PI X) = C X + 4C X + 16C X + 64C X + 256C X .
003216,000457: # 1 3 5 7 9
003217,000458: # WHERE THE C COEFFICIENTS ARE FROM HASTINGS SERIES
003218,000459: # 3 5 7 9
003219,000460: # SIN(PI X/2) = C X + C X + C X + C X + C X .
003220,000461: # 1 3 5 7 9
003221,000462:
003222,000463: 03,6535 30001 COSINE XCH Q # CLOSED COSINE ROUTINE
003223,000464: 03,6536 50105 TS TEM8
003224,000465: 03,6537 07143 TC TSGNABS # FORM 1/2 - (ABS(X)) AND COMPUTE SINE
003225,000466: 03,6540 06761 TC DACCOM+
003226,000467: 03,6541 06544 TC SINE +2
003227,000468:
003228,000469: 03,6542 30001 SINE XCH Q # CLOSED SINE ROUTINE
003229,000470: 03,6543 50105 TS TEM8
003230,000471: 03,6544 06731 TC PARTSL1 # DOUBLE ARGUMENT
003231,000472: 03,6545 50115 TS MPAC
003232,000473: 03,6546 06550 TC +2 # IF DIDNT SKIP
003233,000474: 03,6547 04742 TC DACCOM # IF SO, WE WANT -SIN(X) = SIN(-X)
003234,000475:
003235,000476: 03,6550 40115 CS MPAC
003236,000477: 03,6551 50073 TS VBUF +2 # SAVE NEGATIVE OF ARGUMENT
003237,000478: 03,6552 50102 TS TEM2
003238,000479: 03,6553 60000 DOUBLE
003239,000480: 03,6554 50001 TS Q
003240,000481: 03,6555 06570 TC SN1 # IF ABS(X) LESS THAN 1/2
003241,000482:
003242,000483: 03,6556 20000 INDEX A # CONTAINS +-1
003243,000484: 03,6557 44521 CS NEG1/2 +1
003244,000485: 03,6560 30102 XCH TEM2
003245,000486: 03,6561 60102 AD TEM2
003246,000487: 03,6562 60102 AD TEM2 # (ADD +-1/2 TWICE TO MAKE +-1.0)
003247,000488: 03,6563 50115 TS MPAC
003248,000489: 03,6564 40116 CS MPAC +1
003249,000490: 03,6565 50116 TS MPAC +1
003250,000491: 03,6566 40115 CS MPAC
003251,000492: 03,6567 50073 TS VBUF +2
003252,000493:
Page 81 |
003254,000495:
003255,000496: 03,6570 40116 SN1 CS MPAC +1 # SAVE REST OF ARGUMENT
003256,000497: 03,6571 50074 TS VBUF +3
003257,000498: 03,6572 34231 CAF BUGMPAC # ADDRESS OF MPAC WITH MP BITS
003258,000499: 03,6573 50103 TS TEM4
003259,000500: 03,6574 34772 CAF DAD2 +4 # SQUARE MPAC
003260,000501: 03,6575 05102 TC DMP1
003261,000502: 03,6576 04526 TC TCS1 +2
003262,000503:
003263,000504: 03,6577 05554 TC POLY
003264,000505: 03,6600 00010 DEC 8 B-14
003265,000506: 03,6601 63336 40452 2DEC -0.3926990796 # ( C /4)
003266,000507: # 1
003267,000508:
003268,000509: 03,6603 24527 17013 2DEC +0.6459637111 # ( 4C /4)
003269,000510: # 3
003270,000511:
003271,000512: 03,6605 65631 56501 2DEC -0.318758717 # ( 16C /4)
003272,000513: # 5
003273,000514:
003274,000515: 03,6607 02311 06306 2DEC +0.074780249 # ( 64C /4)
003275,000516: # 7
003276,000517:
003277,000518: 03,6611 77541 45020 2DEC -0.009694988 # (256C /4)
003278,000519: # 9
003279,000520:
003280,000521: 03,6613 05157 TC DMP # DMP BY X
003281,000522: 03,6614 50072 XCADR VBUF +2
003282,000523: 03,6615 06364 TC SL1 # AND SHIFT LEFT 2
003283,000524: 03,6616 06364 TC SL1
003284,000525: 03,6617 00105 TC TEM8 # DONE
003285,000526:
003286,000527: 03,6620 06542 SIN1 TC SINE # INTERPRETER LINKAGE
003287,000528: 03,6621 04024 TC DANZIG
003288,000529:
003289,000530: 03,6622 06535 COS1 TC COSINE
003290,000531: 03,6623 04024 TC DANZIG
003291,000532:
Page 82 |
003293,000534:
003294,000535: 03,6624 36753 ARCSIN CAF TCTAG+1 # PICK UP ARCSIN BRANCH
003295,000536: 03,6625 64476 AD POSMAX # TO FORCE OVERFLOW
003296,000537: 03,6626 50000 OVSK # SKIP AND RESTORE NON-OVERFLOW
003297,000538:
003298,000539: 03,6627 36753 ARCCOS CAF TCEX # SET ARCCOS SWITCH
003299,000540: 03,6630 30114 XCH ESCAPE # NO SKIP, PLEASE
003300,000541: 03,6631 30001 XCH Q # ONLY HAVE TO SAVE Q IN ONE PLACE
003301,000542: 03,6632 50113 TS ARETURN
003302,000543: 03,6633 07154 TC TPAGREE # FORCE SIGN AGREEMENT SO WE CAN CHECK
003303,000544: 03,6634 10000 CCS A # SIZE OF ARGUMENT (SIGNUM RETURNS IN A).
003304,000545: 03,6635 06643 TC ACOSST # POSITIVE
003305,000546: 03,6636 06640 TC +2 # ARCCOS = PI/2
003306,000547: 03,6637 06740 TC NEGARGU
003307,000548:
003308,000549: 03,6640 34502 CAF QUARTER # ARCCOS(0) = .25(2PI).
003309,000550: 03,6641 50115 TS MPAC # (MPAC +1 IS ALREADY ZERO).
003310,000551: 03,6642 00114 TC ESCAPE
003311,000552:
003312,000553: 03,6643 06731 ACOSST TC PARTSL1 # DOUBLE ARGUMENT
003313,000554: 03,6644 30115 XCH MPAC # NO SKIP, BUT EXAMINE ORIGINAL MPAC
003314,000555: 03,6645 64520 AD NEG1/2 # MUST BE LESS THAN OR EQUAL TO 1/2
003315,000556: 03,6646 10000 CCS A
003316,000557: 03,6647 03044 TC ABORT # MAJOR PART GREATER THAN 1/2. NOTE THAT
003317,000558: 03,6650 01301 OCT 01301 # MPAC+1 IS NOT CHECKED SO A MARGIN EXISTS
003318,000559:
003319,000560: 03,6651 06655 TC +4 # NORMAL CASE
003320,000561: 03,6652 50115 TS MPAC # ARGUMENT WAS 1 (SCALED). LEAVE ZERO
003321,000562: 03,6653 50116 TS MPAC +1 # AS RESULT AND EXIT
003322,000563: 03,6654 00114 TC ESCAPE
003323,000564:
Page 83 |
003325,000566:
003326,000567: 03,6655 40116 +4 CS MPAC +1
003327,000568: 03,6656 50116 TS MPAC +1
003328,000569: 03,6657 50074 TS B +1
003329,000570: 03,6660 40115 CS MPAC
003330,000571: 03,6661 50073 TS B
003331,000572: 03,6662 64522 AD HALF
003332,000573: 03,6663 64522 AD HALF
003333,000574: 03,6664 50115 TS MPAC # SQRT ARGUMENT IS NOW READY
003334,000575:
003335,000576: 03,6665 06673 TC +6 # NORMAL PATH.
003336,000577:
003337,000578: 03,6666 34476 CAF POSMAX # WE HAVE FALSE OVERFLOW PRESENT AND IT
003338,000579: 03,6667 50115 TS MPAC # MUST BE CORRECTED. MAJOR PART WAS ZERO
003339,000580: 03,6670 60116 AD MPAC +1 # AND MINOR PART PNZ, SO FORM 1.0 - MPAC
003340,000581: 03,6671 64516 AD ONE # PROPERLY FOR THIS CASE.
003341,000582: 03,6672 50116 TS MPAC +1 # GUARANTEED NO OVERFLOW.
003342,000583:
003343,000584: 03,6673 07320 +6 TC SQRT2 # GO TAKE THE SQUARE ROOT.
003344,000585:
003345,000586: 03,6674 40074 CS B +1
003346,000587: 03,6675 30116 XCH MPAC +1
003347,000588: 03,6676 50074 TS B +1
003348,000589: 03,6677 40073 CS B
003349,000590: 03,6700 30115 XCH MPAC
003350,000591: 03,6701 50073 TS B
Page 84 |
003352,000593: 03,6702 05554 TC POLY # EVALUATE HASTINGS POLYNOMIAL/2PI
003353,000594: 03,6703 00016 DEC 14 B-14
003354,000595: 03,6704 07777 37777 2DEC* .4999999920 B-1* # HASTINGS COEFFICIENTS/2PI
003355,000596: 03,6706 76720 55163 2DEC* -.0683089201 B-1*
003356,000597: 03,6710 00350 00532 2DEC* .0283228913 B-1*
003357,000598: 03,6712 77575 45233 2DEC* -.0159709772 B-1*
003358,000599: 03,6714 00120 21555 2DEC* .0098331911 B-1*
003359,000600: 03,6716 77723 56072 2DEC* -.0054393193 B-1*
003360,000601: 03,6720 00021 14445 2DEC* .0021231556 B-1*
003361,000602: 03,6722 77774 66516 2DEC* -.0004018634 B-1*
003362,000603:
003363,000604: 03,6724 05157 TC DMP # INTERPRETER SUBROUTINE ONLY
003364,000605: 03,6725 50072 XCADR B
003365,000606: 03,6726 00114 TC ESCAPE # GO TO ARCSIN/ARCCOS SWITCH (OR NEGARGU)
003366,000607:
003367,000608: 03,6727 06761 TAGIT TC DACCOM+
003368,000609: 03,6730 00113 TC ARETURN
003369,000610: 03,6731 30116 PARTSL1 XCH MPAC +1 # DOES A DOUBLE SHIFT LEFT EXCEPT FOR THE
003370,000611: 03,6732 60000 DOUBLE # FINAL TS. USED BY SIN, COS, ASIN, AND
003371,000612: 03,6733 50116 TS MPAC +1 # ACOS.
003372,000613: 03,6734 35501 CAF ZERO
003373,000614: 03,6735 60115 AD MPAC
003374,000615: 03,6736 60115 AD MPAC
003375,000616: 03,6737 00001 TC Q # POSSIBLY WITH OVERLOW PRESENT
003376,000617:
003377,000618: 03,6740 04742 NEGARGU TC DACCOM # ARCCOS(-X)=PI-ARCCOS(X)
003378,000619: 03,6741 36754 CAF TCSUBTR # SET SWITCH TO PERFORM ABOVE
003379,000620: 03,6742 30114 XCH ESCAPE
003380,000621: 03,6743 50075 TS ESCAPE2 # ADDITIONAL SWITCH HERE.
003381,000622: 03,6744 06643 TC ACOSST
003382,000623:
Page 85 |
003384,000625:
003385,000626: 03,6745 40115 SUBTR CS MPAC
003386,000627: 03,6746 64522 AD HALF
003387,000628: 03,6747 50115 TS MPAC
003388,000629: 03,6750 40116 CS MPAC +1
003389,000630: 03,6751 50116 TS MPAC +1
003390,000631: 03,6752 00075 TC ESCAPE2 # THIS IS NOW THE ARCSIN/ARCCOS SWITCH
003391,000632:
003392,000633:
003393,000634:
003394,000635: 03,6753 06730 TCTAG+1 TC TAGIT +1
003395,000636: 03,6754 03,6753 TCEX EQUALS TCTAG+1
003396,000637: 03,6754 06745 TCSUBTR TC SUBTR
003397,000638:
003398,000639: 03,6755 06624 ARCSIN1 TC ARCSIN
003399,000640: 03,6756 04024 TC DANZIG
003400,000641:
003401,000642: 03,6757 06627 ARCCOS1 TC ARCCOS
003402,000643: 03,6760 04024 TC DANZIG
003403,000644:
003404,000645: 03,6761 40116 DACCOM+ CS MPAC +1 # USED BY SIN-COS AND ARCSIN-ARCCOS
003405,000646: 03,6762 50116 TS MPAC +1
003406,000647: 03,6763 40115 CS MPAC
003407,000648: 03,6764 64502 AD QUARTER
003408,000649: 03,6765 50115 TS MPAC
003409,000650: 03,6766 00001 TC Q
003410,000651:
Page 86 |
003412,000653:
003413,000654: 03,6767 30077 MBXCH XCH BUF # TO EXCHANGE MPAC AND BUF
003414,000655: 03,6770 30115 XCH MPAC
003415,000656: 03,6771 50077 TS BUF
003416,000657: 03,6772 30100 XCH BUF +1
003417,000658: 03,6773 30116 XCH MPAC +1
003418,000659: 03,6774 50100 TS BUF +1
003419,000660: 03,6775 00001 TC Q
003420,000661:
003421,000662: 03,6776 50117 DDV0 TS MPAC +2 # SET MPAC+2 TO ZERO TO RESUME DDV
003422,000663: 03,6777 07143 TC TSGNABS # SIGN AGGREMENT ETC
003423,000664: 03,7000 50102 TS TEM2 # SAVE SGN
003424,000665: 03,7001 06767 TC MBXCH # SWITCH CONTENTS
003425,000666: 03,7002 07143 TC TSGNABS # SAME FOR ARGUMENT
003426,000667: 03,7003 60102 AD TEM2
003427,000668: 03,7004 10000 CCS A # TO GET SIGN OF RESULT
003428,000669: 03,7005 07010 TC +3
003429,000670: 03,7006 07133 TC DPDOFLO +1 # HERE FOR 0/0 CASE
003430,000671: 03,7007 07010 TC +1
003431,000672: 03,7010 50102 TS TEM2
003432,000673: 03,7011 10110 CCS DVSW
003433,000674: 03,7012 06767 TC MBXCH # INTERCHANGE OLD DIVISOR AND DIVIDEND
003434,000675:
003435,000676: 03,7013 40077 CS BUF # CHECK TO SEE IF C(BUF,BUF+1) LESS
003436,000677: 03,7014 60115 AD MPAC # THAN C(MPAC,MPAC+1). OVERFLOW CONDITION
003437,000678: 03,7015 10000 CCS A # IF NOT
003438,000679: 03,7016 07030 TC DDVOK # SCALING OK
003439,000680: 03,7017 03062 TC CCSHOLE
003440,000681: 03,7020 07132 TC DPDOFLO # TROUBLE HERE
003441,000682: 03,7021 40100 CS BUF +1 # CHECK MINOR PARTS IF MAJORS EQUAL
003442,000683: 03,7022 60116 AD MPAC +1
003443,000684: 03,7023 10000 CCS A
003444,000685: 03,7024 07030 TC DDVOK
003445,000686: 03,7025 03062 TC CCSHOLE
003446,000687: 03,7026 07132 TC DPDOFLO # TROUBLE HERE
003447,000688: 03,7027 07132 TC DPDOFLO # AS WELL AS WHEN C(BUF,BUF+1)=C(MPAC,+1)
003448,000689:
003449,000690: 03,7030 35501 DDVOK CAF ZERO
003450,000691: 03,7031 60115 AD MPAC
003451,000692: 03,7032 07046 TC DPDNORT # TO NORMALIZE
003452,000693:
Page 87 |
003454,000695:
003455,000696: 03,7033 30001 SQRTDIV XCH Q # ENTRY FROM SQRT ROUTINE
003456,000697: 03,7034 50076 TS TEMQ3
003457,000698: 03,7035 07060 TC DVSTART
003458,000699:
003459,000700: 03,7036 30100 DPDNORM XCH BUF +1
003460,000701: 03,7037 60000 DOUBLE
003461,000702: 03,7040 50100 TS BUF +1
003462,000703: 03,7041 35501 CAF ZERO
003463,000704: 03,7042 60077 AD BUF
003464,000705: 03,7043 60077 AD BUF
003465,000706: 03,7044 50077 TS BUF
003466,000707: 03,7045 06367 TC SL1 +3 # TO DOUBLE MPAC
003467,000708:
003468,000709: 03,7046 50022 DPDNORT TS CYL # TO LOOK AT BIT 14
003469,000710: 03,7047 10022 CCS CYL
003470,000711: 03,7050 07036 TC DPDNORM
003471,000712: 03,7051 07053 TC +2
003472,000713: 03,7052 07060 TC DVSTART
003473,000714: 03,7053 30100 XCH BUF +1 # HIGH ORDER ZERO
003474,000715: 03,7054 30077 XCH BUF
003475,000716: 03,7055 30116 XCH MPAC +1 # SET MPAC +1 TO ZERO
003476,000717: 03,7056 50115 TS MPAC
003477,000718: 03,7057 07046 TC DPDNORT # AND TRY AGAIN
003478,000719:
Page 88 |
003480,000721:
003481,000722: 03,7060 30077 DVSTART XCH BUF # OK
003482,000723: 03,7061 25777 INDEX OPOVF
003483,000724: 03,7062 50115 DV MPAC
003484,000725: 03,7063 50034 TS OVCTR
003485,000726: 03,7064 25777 INDEX OPOVF
003486,000727: 03,7065 40116 MP MPAC +1
003487,000728: 03,7066 60001 -1/2+2 AD Q # COMPLIMENT OF REMAINDER.
003488,000729: 03,7067 40000 CS A
003489,000730: 03,7070 60100 AD BUF +1
003490,000731: 03,7071 50000 OVSK
003491,000732: 03,7072 07075 TC +3 # IF NOT
003492,000733: 03,7073 25777 INDEX OPOVF # IF OVERFLEW
003493,000734: 03,7074 60115 SU MPAC
003494,000735: 03,7075 50077 +3 TS BUF
003495,000736: 03,7076 10000 CCS A
003496,000737: 03,7077 64516 AD ONE
003497,000738: 03,7100 07102 TC +2
003498,000739: 03,7101 64516 AD ONE
003499,000740: 03,7102 25777 +2 EXTEND # WE NOW HAVE ABS(CORRECT BUF)
003500,000741: 03,7103 60115 SU MPAC
003501,000742: 03,7104 10000 CCS A
003502,000743: 03,7105 64516 AD ONE
003503,000744: 03,7106 07110 TC +2
003504,000745: 03,7107 07113 TC +4
003505,000746: 03,7110 30077 +2 XCH BUF
003506,000747: 03,7111 60000 DOUBLE
003507,000748: 03,7112 10000 CCS A
003508,000749: 03,7113 30077 +4 XCH BUF
003509,000750: 03,7114 07116 TC +2
003510,000751: 03,7115 40077 CS BUF
003511,000752: 03,7116 25777 INDEX OPOVF
003512,000753: 03,7117 50115 DV MPAC
003513,000754:
Page 89 |
003515,000756:
003516,000757: 03,7120 50116 DPDSGNT TS MPAC +1
003517,000758: 03,7121 10102 CCS TEM2
003518,000759: 03,7122 07130 TC POSQUOT
003519,000760: 03,7123 40116 CS MPAC +1
003520,000761: 03,7124 50116 TS MPAC +1
003521,000762: 03,7125 40034 CS OVCTR
003522,000763: 03,7126 50115 TS MPAC
003523,000764: 03,7127 00076 TC TEMQ3
003524,000765:
003525,000766: 03,7130 30034 POSQUOT XCH OVCTR
003526,000767: 03,7131 07126 TC -3
003527,000768:
003528,000769: 03,7132 10102 DPDOFLO CCS TEM2
003529,000770: 03,7133 35503 CAF TWO
003530,000771: 03,7134 64335 AD NEG1
003531,000772: 03,7135 50122 TS OVFIND
003532,000773: 03,7136 25777 EXTEND # SET MPAC = +- POSMAX
003533,000774: 03,7137 44476 MP POSMAX
003534,000775: 03,7140 30003 XCH LP
003535,000776: 03,7141 50116 TS MPAC +1
003536,000777: 03,7142 07126 TC POSQUOT -2
003537,000778:
Page 90 |
003539,000780:
003540,000781: 03,7143 30001 TSGNABS XCH Q # SIGNUM AND ABSOLUTE VALUE
003541,000782: 03,7144 50104 TS TEMQ2
003542,000783: 03,7145 07154 TC TPAGREE
003543,000784:
003544,000785: 03,7146 10000 CCS A # TEST SIGNUM
003545,000786: 03,7147 64516 AD ONE
003546,000787: 03,7150 00104 TC TEMQ2
003547,000788:
003548,000789: 03,7151 04740 TC MPACCOM # COMPLEMENT IF NEGATIVE
003549,000790: 03,7152 44516 CS ONE
003550,000791: 03,7153 00104 TC TEMQ2
003551,000792:
003552,000793: 03,7154 30001 TPAGREE XCH Q # FORCE SIGN AGREEMENT IN TP WORD IN MPAC
003553,000794: 03,7155 50103 TS TEMQ
003554,000795: 03,7156 06021 TC BRANCH
003555,000796: 03,7157 07172 TC SGN=+
003556,000797: 03,7160 07165 TC SGN=0
003557,000798:
003558,000799: 03,7161 44476 CS POSMAX
003559,000800: 03,7162 50101 TS SGNDMAX
003560,000801: 03,7163 44516 CS ONE
003561,000802: 03,7164 07175 TC SGFORCE
003562,000803:
003563,000804: 03,7165 35501 SGN=0 CAF ZERO
003564,000805: 03,7166 50115 TS MPAC
003565,000806: 03,7167 50116 TS MPAC +1
003566,000807: 03,7170 50117 TS MPAC +2
003567,000808: 03,7171 00103 TC TEMQ
003568,000809:
003569,000810: 03,7172 34476 SGN=+ CAF POSMAX
003570,000811: 03,7173 50101 TS SGNDMAX
003571,000812: 03,7174 34516 CAF ONE
003572,000813:
Page 91 |
003574,000815:
003575,000816: 03,7175 60117 SGFORCE AD MPAC +2
003576,000817: 03,7176 60101 AD SGNDMAX
003577,000818: 03,7177 50117 TS MPAC +2
003578,000819: 03,7200 35501 CAF ZERO
003579,000820:
003580,000821: 03,7201 60116 AD MPAC +1
003581,000822: 03,7202 60101 AD SGNDMAX
003582,000823: 03,7203 50116 TS MPAC +1
003583,000824: 03,7204 35501 CAF ZERO
003584,000825:
003585,000826: 03,7205 60115 AD MPAC
003586,000827: 03,7206 60101 AD SGNDMAX
003587,000828: 03,7207 50115 TS MPAC
003588,000829: 03,7210 00017 SBITMASK OCT 17
003589,000830: 03,7211 00103 TC TEMQ
003590,000831:
Page 92 |
003592,000833:
003593,000834: 03,7212 06263 UNIT TC ABVAL # UNIT VECTOR ROUTINE - START BY GETTING
003594,000835: # LENGTH
003595,000836: 03,7213 06275 TC VSR1 # LEAVES 1/2 UNIT VECTORS
003596,000837:
003597,000838: 03,7214 10215 CCS NEWJOB # ALLOW FOR INTERRUPTS
003598,000839: 03,7215 07263 TC UNITRUPT # SO WE CAN RETURN IN BASIC
003599,000840:
003600,000841: 03,7216 60070 UNITRSM AD VACLOC # RETURNS HERE FROM BREAKPOINT IF CALLED.
003601,000842: 03,7217 50062 TS ADDRWD
003602,000843: 03,7220 35503 CAF TWO
003603,000844: 03,7221 50110 TS DVSW # NON-ZERO FOR BACKWARDS DIVIDE
003604,000845: 03,7222 50112 UNITLOOP TS COMPON
003605,000846: 03,7223 40115 CS MPAC
003606,000847: 03,7224 40000 CS A
003607,000848: 03,7225 20062 INDEX ADDRWD
003608,000849: 03,7226 30000 XCH 0 # LENGTH TO COMPONENT AND COMPONENT TO BUF
003609,000850: 03,7227 50077 TS BUF
003610,000851: 03,7230 40116 CS MPAC +1
003611,000852: 03,7231 40000 CS A
003612,000853: 03,7232 20062 INDEX ADDRWD
003613,000854: 03,7233 30001 XCH 1
003614,000855: 03,7234 50100 TS BUF +1
003615,000856:
003616,000857: 03,7235 37241 CAF +4 # CALL BACKWARDS DIVIDE
003617,000858: 03,7236 50076 TS TEMQ3
003618,000859: 03,7237 35501 CAF ZERO
003619,000860: 03,7240 06776 TC DDV0
003620,000861: 03,7241 07242 TC +1
003621,000862:
003622,000863: 03,7242 30115 XCH MPAC # RESULT BACK TO COMPONENT BRINGING BACK
003623,000864: 03,7243 20062 INDEX ADDRWD # LENGTH
003624,000865: 03,7244 30000 XCH 0
003625,000866: 03,7245 50115 TS MPAC
003626,000867: 03,7246 30116 XCH MPAC +1
003627,000868: 03,7247 20062 INDEX ADDRWD
003628,000869: 03,7250 30001 XCH 1
003629,000870: 03,7251 50116 TS MPAC +1
003630,000871:
003631,000872: 03,7252 05242 TC AD2 # INCREMENT ADDRWD
003632,000873: 03,7253 10112 CCS COMPON
003633,000874: 03,7254 07222 TC UNITLOOP
003634,000875: 03,7255 45503 CS TWO # STORE LENGTH OF ARGUMENT IN REGISTERS 30
003635,000876: 03,7256 60070 AD VACLOC
003636,000877: 03,7257 50102 TS TEM2 # AND 31 OF VAC AREA.
003637,000878: 03,7260 34772 CAF DAD2 +4
003638,000879: 03,7261 05041 TC 8TO2
003639,000880: 03,7262 04024 TC DANZIG
003640,000881:
Page 93 |
003642,000883:
003643,000884: 03,7263 40061 UNITRUPT CS BANKSET # REQUESTS FOR INTERPRETIVE INTERRUPT
003644,000885: 03,7264 50117 TS MPAC +2 # COME HERE DURING THE UNIT OPERATION.
003645,000886: 03,7265 30120 XCH LOC # SINCE WE DESIRE TO RETURN IN BASIC BUT
003646,000887: 03,7266 20067 INDEX FIXLOC # BUT STILL SAVE THE INTERPRETER CENTRALS
003647,000888: 03,7267 50036 TS 30D # (BANKSET AND LOC)
003648,000889: 03,7270 02101 TC CHANG1
003649,000890:
003650,000891: 03,7271 40117 CS MPAC +2 # ON RETURN, RESTORE AS BEFORE
003651,000892: 03,7272 50061 TS BANKSET
003652,000893: 03,7273 20067 INDEX FIXLOC
003653,000894: 03,7274 30036 XCH 30D
003654,000895: 03,7275 50120 TS LOC
003655,000896: 03,7276 35501 CAF ZERO
003656,000897: 03,7277 07216 TC UNITRSM # ENTER UNIT DIVIDE LOOP.
003657,000898: 03,7300 34772 MPACSR1 CAF DAD2 +4
003658,000899:
003659,000900: 03,7301 50064 SR1 TS TEM11 # SHIFTS RIGHT ONE USING ADDRESS IN A
003660,000901: 03,7302 20000 INDEX A
003661,000902: 03,7303 30000 XCH 0
003662,000903: 03,7304 25777 INDEX OPOVF
003663,000904: 03,7305 44522 MP HALF
003664,000905: 03,7306 20064 INDEX TEM11
003665,000906: 03,7307 50000 TS 0
003666,000907: 03,7310 20064 INDEX TEM11
003667,000908: 03,7311 30001 XCH 1
003668,000909: 03,7312 50021 TS SR
003669,000910: 03,7313 30021 XCH SR
003670,000911: 03,7314 60003 AD LP
003671,000912: 03,7315 20064 INDEX TEM11
003672,000913: 03,7316 50001 TS 1
003673,000914: 03,7317 00001 TC Q
003674,000915:
Page 94 |
003676,000917:
003677,000918: 03,7320 35501 SQRT2 CAF ZERO # ENTRY TO IGNORE C(MPAC+2)
003678,000919: 03,7321 50117 TS MPAC +2
003679,000920:
003680,000921: 03,7322 30001 SQRT3 XCH Q # HERE TO TREAT TRIPLE-PRECISION CASES
003681,000922: 03,7323 50104 TS TEMQ2
003682,000923: 03,7324 07154 TC TPAGREE # FORCE SIGN AGREEMENT
003683,000924: 03,7325 10000 CCS A # TEST SIGNUM
003684,000925: 03,7326 07336 TC SETNORM # PNZ - OK.
003685,000926: 03,7327 00104 TC TEMQ2 # FAST EXIT FOR ZERO ARGUMENT
003686,000927: 03,7330 10115 CCS MPAC # IF ARGUMENT WAS NEGATIVE BUT MAJOR PART
003687,000928:
003688,000929: 03,7331 03044 TC ABORT # (MPAC IS NEGATIVE) IS ZERO, ANSWER IS
003689,000930: 03,7332 01302 OCT 01302 # TAKEN AS ZERO WITH NO FURTHER ACTION.
003690,000931: 03,7333 07331 TC -2 # IF NON-ZERO, IT IS ASSUMED A TRANSIENT
003691,000932: # ERROR HAS PRODUCED THE BAD DATA.
003692,000933:
003693,000934: 03,7334 50116 TS MPAC +1 # ARGUMENT NEGATIVE BUT MORE THAN -10-4.
003694,000935: 03,7335 00104 TC TEMQ2 # SET MPAC,+1 TO ZERO AND EXIT.
003695,000936:
003696,000937: 03,7336 50062 SETNORM TS ADDRWD # SET NORMALIZATION COUNT TO ZERO
003697,000938: 03,7337 40115 CS MPAC
003698,000939: 03,7340 50022 TS CYL # WE WILL USE A/2, SO MUST CHECK FOR
003699,000940: 03,7341 10022 CCS CYL # NORMALIZATION FIRST
003700,000941: 03,7342 07300 TC MPACSR1 # NORMALIZED - SHIFT RIGHT ONE.
003701,000942: 03,7343 07405 TC ARGHI
003702,000943:
003703,000944: 03,7344 07346 TC SRTEST # LESS THAN 1/2 - SEE IF AT LEAST 1/8.
003704,000945:
003705,000946: 03,7345 07353 TC A0=0 # MAJOR PART (POSSIBLY MINOR PART) = 0.
003706,000947:
003707,000948: 03,7346 67066 SRTEST AD -1/2+2 # SEE IF ARG GREATER THAN OR EQUAL TO 1/4.
003708,000949: 03,7347 10000 CCS A
003709,000950: 03,7350 07300 TC MPACSR1 # IT IS - SHIFT RIGHT ONE AND GO TO ARGLO.
003710,000951: 03,7351 07374 TC ARGLO # (+0 WAS IMPOSSIBLE THIS CCS.)
003711,000952:
003712,000953: 03,7352 07362 TC SQRTNORM +1 # LESS THAN 1/4 - PUT IN EFFECTIVE RIGHT
003713,000954: # BY SHIFTING LEFT ONLY ONCE WHEN ADDING
003714,000955: # ONE TO THE RIGHT SHIFT COUNT.
003715,000956:
Page 95 |
003717,000958:
003718,000959: 03,7353 30117 A0=0 XCH MPAC +2 # MOVE ARGUMENT UP
003719,000960: 03,7354 30116 XCH MPAC +1
003720,000961: 03,7355 30115 XCH MPAC
003721,000962: 03,7356 60062 AD ADDRWD
003722,000963: 03,7357 65362 AD SEVEN # INCREASE SHIFT COUNT BY 14/2 = 7
003723,000964: 03,7360 07336 TC SETNORM
003724,000965:
003725,000966: 03,7361 06364 SQRTNORM TC SL1
003726,000967: 03,7362 34516 CAF ONE # ARGUMENT LESS THAN 1/8, SO SHIFT IT LEFT
003727,000968: 03,7363 60062 AD ADDRWD # TWO PLACES AND INCREASE SHIFT COUNT FOR
003728,000969: 03,7364 50062 TS ADDRWD # RESULT
003729,000970: 03,7365 06364 TC SL1
003730,000971: 03,7366 50022 TS CYL
003731,000972: 03,7367 40022 CS CYL
003732,000973:
Page 96 |
003734,000975:
003735,000976: 03,7370 10022 NORMTEST CCS CYL
003736,000977: 03,7371 10022 CCS CYL
003737,000978: 03,7372 07361 TC SQRTNORM # HERE IF LESS THAN 1/8
003738,000979: 03,7373 07405 TC ARGHI # HERE IF AT LEAST 1/4, LESS THAN 1/2
003739,000980:
003740,000981: 03,7374 37401 ARGLO CAF SLOPELO # HERE IF AT LEAST 1/8, LESS THAN 1/4
003741,000982: 03,7375 25777 INDEX OPOVF
003742,000983: 03,7376 40115 MP MPAC
003743,000984: 03,7377 67402 AD BIASLO # X0/2 = .8324(A0/2) + .2974/2
003744,000985: 03,7400 07411 TC ARGHI +4
003745,000986:
003746,000987: 03,7401 32506 SLOPELO DEC .8324
003747,000988: 03,7402 04604 BIASLO DEC .2974 B-1
003748,000989: 03,7403 22650 SLOPEHI DEC .5884
003749,000990: 03,7404 06552 BIASHI DEC .4192 B-1
003750,000991:
003751,000992: 03,7405 37403 ARGHI CAF SLOPEHI
003752,000993: 03,7406 25777 INDEX OPOVF
003753,000994: 03,7407 40115 MP MPAC
003754,000995: 03,7410 67404 AD BIASHI
003755,000996: 03,7411 30115 +4 XCH MPAC # X0/2 TO MPAC
003756,000997: 03,7412 50077 TS BUF # A0/2 TO BUF
003757,000998: 03,7413 50102 TS TEM2 # SET UP POSITIVE QUOTIENT SIGNAL AND
003758,000999: 03,7414 35501 CAF ZERO
003759,001000: 03,7415 30116 XCH MPAC +1 # ZERO LOW-ORDER DIVIDEND FOR DP DIVIDE
003760,001001: 03,7416 50100 TS BUF +1 # A1/2 TO BUF+1. A2 NOW DISCARDED
003761,001002: 03,7417 40077 CS BUF
003762,001003: 03,7420 25777 INDEX OPOVF
003763,001004: 03,7421 50115 DV MPAC # -(A0/2)/(X0/2).
003764,001005: 03,7422 50021 TS SR
003765,001006: 03,7423 40021 CS SR
003766,001007: 03,7424 60115 AD MPAC # X1 IS GOOD TO 14 BITS
003767,001008: 03,7425 50115 TS MPAC # X1 = X0/2 + ((A0/2)/(X0/2))/2
003768,001009: 03,7426 50101 TS TEM3 # SAVE X1 FOR ADDITION
003769,001010: 03,7427 07033 TC SQRTDIV # GO TO FORM DP QUOTIENT OF A0/2, A1/2
003770,001011: 03,7430 30101 XCH TEM3 # OVER X1, 0. RESULT IN MPAC, MPAC +1
003771,001012: 03,7431 25777 INDEX OPOVF
003772,001013: 03,7432 44522 MP HALF
003773,001014: 03,7433 60115 AD MPAC
003774,001015: 03,7434 50034 TS OVCTR # AND MAYBE SKIP, IF ARG WAS NEAR POSMAX
Page 97 |
003776,001017: 03,7435 07441 TC +4 # IF NO OVERFLOW
003777,001018: 03,7436 34476 CAF POSMAX
003778,001019: 03,7437 50116 TS MPAC +1
003779,001020: 03,7440 07445 TC +5
003780,001021:
003781,001022: 03,7441 30003 +4 XCH LP # FOR NORMAL CASES
003782,001023: 03,7442 60116 AD MPAC +1 # ABOVE AND X1/2
003783,001024: 03,7443 30116 XCH MPAC +1
003784,001025: 03,7444 30034 XCH OVCTR
003785,001026: 03,7445 50115 +5 TS MPAC
003786,001027:
003787,001028: 03,7446 35501 CAF ZERO # ZERO MPAC+2 SO SHIFT LEFT MAKES SENSE.
003788,001029: 03,7447 50117 TS MPAC +2
003789,001030:
003790,001031: 03,7450 10062 CCS ADDRWD # RE-NORMALIZE IF COUNT NON-ZERO
003791,001032: 03,7451 06236 TC SHIFTR +3 # FITS IN WITH MAIN SHIFT LOOP
003792,001033: 03,7452 00104 TC TEMQ2 # NO RE-SCALING REQUIRED
003793,001034:
003794,001035: 03,7453 40065 SQRTS CS MODE # INTERPRETER LINKAGE
003795,001036: 03,7454 60000 DOUBLE # TAKE APPROPRIATE SQRT
003796,001037: 03,7455 20000 INDEX A
003797,001038: 03,7456 07455 TC -1
003798,001039:
003799,001040: 03,7457 07320 TC SQRT2 # FOR DP
003800,001041: 03,7460 04024 TC DANZIG
003801,001042:
003802,001043: 03,7461 07322 TC SQRT3
003803,001044: 03,7462 04024 TC DANZIG
003804,001045:
003805,001046: 03,7463 5363 NEG13 EQUALS MINUS13
003806,001047: 03,7463 4024 DMOVE EQUALS DANZIG # LOADING ONLY
003807,001048: 03,7463 4024 VMOVE EQUALS DANZIG
003808,001049: 03,7463 45503 TMOVE CS TWO # SET MODE TO TRIPLE FOR TP OPERATIONS
003809,001050: 03,7464 05240 TC DPEXIT +1
End of include-file BANK_03_INTERPRETER_SECTION.agc. Parent file is MAIN.agc