Source Code
These source-code files are part of a reconstructed copy of Sunrise 45, the
penultimate release of the Block I Command Module (CM) Apollo Guidance Computer
(AGC) system test software.
They have been created via disassembly of binary dumps of original core rope memory modules, part numbers 1003133-18, 1003133-19, and 1003133-20. Corresponding portions of code have been copied from Solarium 55 where applicable. Extensive use was also made of the AGC Information Series documents, which were specifically written about the Sunrise software. Since only binary dumps (rather than listings) of Sunrise are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
001893,000002: ## Copyright: Public domain.
001894,000003: ## Filename: BANK_03_INTERPRETER_SECTION.agc
001895,000004: ## Purpose: A section of Sunrise 45.
001896,000005: ## It is part of the reconstructed source code for the penultimate
001897,000006: ## release of the Block I Command Module system test software. No
001898,000007: ## original listings of this program are available; instead, this
001899,000008: ## file was created via disassembly of dumps of Sunrise core rope
001900,000009: ## memory modules and comparison with the later Block I program
001901,000010: ## Solarium 55.
001902,000011: ## Assembler: yaYUL --block1
001903,000012: ## Contact: Ron Burkey <info@sandroid.org>.
001904,000013: ## Website: www.ibiblio.org/apollo/index.html
001905,000014: ## Mod history: 2022-12-09 MAS Initial reconstructed source.
001906,000015:
001907,000016: 03,6000 SETLOC 6000
001908,000017:
001909,000018: 03,6000 06021 BMN1 TC BRANCH # BRANCH MINUS
001910,000019: 03,6001 04702 TC RE-ENTER
001911,000020: 03,6002 04702 TC RE-ENTER
001912,000021: 03,6003 04566 TC DOBR
001913,000022:
001914,000023: 03,6004 06021 BPL1 TC BRANCH # BRANCH PLUS
001915,000024: 03,6005 04566 TC DOBR
001916,000025: 03,6006 04566 TC DOBR
001917,000026: 03,6007 04702 TC RE-ENTER
001918,000027:
001919,000028: 03,6010 06021 BZE1 TC BRANCH # BRANCH ZERO
001920,000029: 03,6011 04702 TC RE-ENTER
001921,000030: 03,6012 04566 TC DOBR
001922,000031: 03,6013 04702 TC RE-ENTER
001923,000032:
001924,000033: 03,6014 10114 BHIZ1 CCS MPAC # BRANCH ON HIGH ORDER ZERO
001925,000034: 03,6015 04702 TC RE-ENTER # PNZ
001926,000035: 03,6016 04566 TC DOBR
001927,000036: 03,6017 04702 TC RE-ENTER
001928,000037: 03,6020 04566 TC DOBR
001929,000038:
001930,000039: 03,6021 30001 BRANCH XCH Q
001931,000040: 03,6022 50110 TS BRANCHQ
001932,000041: 03,6023 10114 CCS MPAC
001933,000042: 03,6024 00110 TC BRANCHQ
001934,000043: 03,6025 06027 TC +2
001935,000044: 03,6026 06036 TC MINUS
001936,000045:
001937,000046: 03,6027 10115 CCS MPAC +1
001938,000047: 03,6030 00110 TC BRANCHQ
001939,000048: 03,6031 06033 TC +2
001940,000049: 03,6032 06036 TC MINUS
001941,000050:
001942,000051: 03,6033 10116 CCS MPAC +2
001943,000052: 03,6034 00110 TC BRANCHQ
001944,000053: 03,6035 06037 TC +2
001945,000054: 03,6036 34516 MINUS CAF ONE
001946,000055: 03,6037 64516 AD ONE
001947,000056: 03,6040 60110 AD BRANCHQ
001948,000057: 03,6041 00000 XAQ
001949,000058:
001950,000059:
001951,000060: 03,6042 40066 TRUE2 CS FIXLOC # RESTORES INTEGER ADDRESSES
001952,000061: 03,6043 60061 AD ADDRWD
001953,000062: 03,6044 50061 TS ADDRWD
001954,000063: 03,6045 10000 CCS A # WE MUST ELIMINATE THE MINUS ZERO CASE
001955,000064: 03,6046 00001 TC Q # OK HERE
001956,000065: 03,6050 LOC +1
001957,000066: 03,6050 06052 TC +2 # IF ADDRESS WAS NEGATIVE
001958,000067: 03,6051 04024 TC DANZIG # FAST EXIT FOR ZERO SHIFT COUNTS
001959,000068: 03,6052 20064 INDEX MODE # RIGHT SHIFT INSTEAD OF A LEFT ONE
001960,000069: 03,6053 06056 TC +3 # CCS FOLLOWED BY ADD LEFT THE COUNT POS.
001961,000070: 03,6054 05077 TC SHIFTR1 +3 # SO WE NEED ONLY CALL THE APPROPRIATE
001962,000071: 03,6055 05077 TC SHIFTR1 +3 # SHIFT RIGHT INSTRUCTION.
001963,000072: 03,6056 40061 CS ADDRWD # PUT POSITIVE COUNT IN ADDRWD.
001964,000073: 03,6057 50061 TS ADDRWD
001965,000074: 03,6060 64335 AD NEG1 # DECREMENT LIKE CCS BEFORE RETURNING.
001966,000075: 03,6061 05636 TC VSRT1 +4
001967,000076:
001968,000077: 03,6062 04721 AST TC TAG
001969,000078: 03,6063 40075 CS POLISH
001970,000079: 03,6064 20074 SSTORE INDEX TAG1
001971,000080: 03,6065 30050 XCH 40D # STEP REGISTER
001972,000081: 03,6066 04702 TC RE-ENTER
001973,000082:
001974,000083: 03,6067 04721 AXC TC TAG # ADDRESS TO INDEX COMPLEMENTED
001975,000084: 03,6070 30075 XCH POLISH
001976,000085: 03,6071 06074 TC XSTORE
001977,000086:
001978,000087: 03,6072 04721 AXT TC TAG
001979,000088: 03,6073 40075 CS POLISH
001980,000089: 03,6074 20074 XSTORE INDEX TAG1
001981,000090: 03,6075 30046 XCH 38D # MAY HAVE OVERFLOWED
001982,000091: 03,6076 04702 TC RE-ENTER
001983,000092:
001984,000093: 03,6077 04721 LXA TC TAG
001985,000094: 03,6100 20061 INDEX ADDRWD # MUST BE ERASABLE - NOT NEEDED OTHERWISE
001986,000095: 03,6101 40000 CS 0
001987,000096: 03,6102 40000 +3 CS A
001988,000097: 03,6103 06074 TC XSTORE
001989,000098:
001990,000099: 03,6104 04721 LXC TC TAG # LOAD INDEX FROM ADDRESS COMPLEMENTED
001991,000100: 03,6105 20061 INDEX ADDRWD
001992,000101: 03,6106 40000 CS 0
001993,000102: 03,6107 06074 TC XSTORE
001994,000103:
001995,000104: 03,6110 04721 SXA TC TAG
001996,000105: 03,6111 20074 INDEX TAG1
001997,000106: 03,6112 40046 CS 38D # GET INDEX
001998,000107: 03,6113 40000 CS A
001999,000108: 03,6114 04700 TC STOR1
002000,000109:
002001,000110:
002002,000111: 03,6115 04721 TIX TC TAG
002003,000112: 03,6116 20074 INDEX TAG1 # GET APPROPRIATE STEP REGISTER
002004,000113: 03,6117 40050 CS 40D # STEP REGISTER
002005,000114: 03,6120 20074 INDEX TAG1
002006,000115: 03,6121 60046 AD 38D
002007,000116: 03,6122 50101 TS TEM2 # TO TEMPORARY
002008,000117: 03,6123 10000 CCS A
002009,000118: 03,6124 30101 XCH TEM2 # DECREMENT INDEX AND BRANCH
002010,000119: 03,6125 06130 TC TIXBR
002011,000120: 03,6126 04702 TC RE-ENTER # INDEX LEFT ALONE AND NO BRANCH
002012,000121: 03,6127 04702 LNOBR TC RE-ENTER
002013,000122:
002014,000123: 03,6130 20074 TIXBR INDEX TAG1
002015,000124: 03,6131 50046 TS 38D
002016,000125: 03,6132 40075 CS POLISH
002017,000126: 03,6133 04601 TC DOBR2
002018,000127:
002019,000128: 03,6134 04721 INCR TC TAG
002020,000129: 03,6135 40075 CS POLISH
002021,000130: 03,6136 20074 INDEX TAG1
002022,000131: 03,6137 60046 AD 38D
002023,000132: 03,6140 06074 TC XSTORE
002024,000133:
002025,000134: 03,6141 04721 XCHX TC TAG
002026,000135: 03,6142 20061 INDEX ADDRWD
002027,000136: 03,6143 30000 XCH 0
002028,000137: 03,6144 20074 INDEX TAG1
002029,000138: 03,6145 30046 XCH 38D
002030,000139: 03,6146 04700 TC STOR1
002031,000140:
002032,000141: 03,6147 04721 XSU TC TAG # INDEX REGISTER SUBTRACT FROM ERASABLE
002033,000142: 03,6150 20061 INDEX ADDRWD
002034,000143: 03,6151 40000 CS 0
002035,000144: 03,6152 06136 TC INCR +2
002036,000145:
002037,000146: 03,6153 04721 XAD TC TAG # INDEX REGISTER ADD FROM ERASABLE
002038,000147: 03,6154 20061 INDEX ADDRWD
002039,000148: 03,6155 40000 CS 0
002040,000149: 03,6156 40000 COM
002041,000150: 03,6157 06136 TC INCR +2
002042,000151:
002043,000152:
002044,000153: 03,6160 35500 VDEF CAF ZERO
002045,000154: 03,6161 60067 AD VACLOC # USES MPAC AS V0, PUSHES UP FOR V1, AND
002046,000155: 03,6162 50101 TS TEM2 # PUSHES UP AGAIN FOR V2. THE RESULTING
002047,000156: 03,6163 34771 CAF DAD2 +4 # VECTOR IS LEFT IN VAC
002048,000157: 03,6164 05040 TC 8TO2
002049,000158: 03,6165 05411 TC INCRT2
002050,000159: 03,6166 04326 TC PUSHUP1
002051,000160: 03,6167 05040 TC 8TO2
002052,000161: 03,6170 05411 TC INCRT2
002053,000162: 03,6171 04326 TC PUSHUP1
002054,000163: 03,6172 05040 TC 8TO2
002055,000164: 03,6173 05407 TC ZEROEXIT # T0 DECLAIN MO45 IS VECTOR
002056,000165:
002057,000166: 03,6174 10020 ITA1 CCS CYR
002058,000167: 03,6175 06203 TC +6 # FOR ITA
002059,000168: 03,6177 LOC +1
002060,000169: 03,6177 20061 INDEX ADDRWD # PICK UP ADDRESS
002061,000170: 03,6200 40000 CS 0
002062,000171: 03,6201 40000 COM
002063,000172: 03,6202 04601 TC DOBR2 # AND DO THE BRANCH
002064,000173:
002065,000174: 03,6203 20066 +6 INDEX FIXLOC
002066,000175: 03,6204 40052 CS QPRET
002067,000176: 03,6205 06113 TC SXA +3 # COMPLEMENT AND DEPOSIT
002068,000177:
002069,000178: 03,6206 10020 EXIT CCS CYR # RETURN TO BASIC
002070,000179: 03,6207 04570 TC EXIT2 # EXIT.
002071,000180:
002072,000181: 03,6211 LOC +1
002073,000182:
002074,000183: 03,6211 40075 CS POLISH # HERE TO RETURN TO BASIC AT X
002075,000184: 03,6212 02524 TC SWCALL
002076,000185:
002077,000186: 03,6213 20061 SIGN INDEX ADDRWD # AFFIX SIGN OF X TO MPAC OR VAC
002078,000187: 03,6214 10000 CCS 0 # MUST BE NON-ZERO
002079,000188: 03,6215 04024 TC DANZIG
002080,000189: 03,6216 06220 TC +2 # EXAMINE MINOR PART
002081,000190: 03,6217 06325 TC COMP # COMPLEMENT VECTOR OR SCALAR.
002082,000191:
002083,000192: 03,6220 20061 INDEX ADDRWD
002084,000193: 03,6221 10001 CCS 1
002085,000194: 03,6222 04024 TC DANZIG
002086,000195: 03,6223 04024 TC DANZIG # NO OPERATION IF C(ADDRWD,ADDRWD+1) = 0
002087,000196: 03,6224 06325 TC COMP
002088,000197: 03,6225 04024 TC DANZIG
002089,000198:
002090,000199:
002091,000200: 03,6226 40067 VSQ CS VACLOC # TAKE SQUARE OF LENGTH OF VECTOR IN VAC.
002092,000201: 03,6227 40000 COM
002093,000202: 03,6230 50061 TS ADDRWD
002094,000203: 03,6231 05234 TC DOT1 +1 # FINISH IN DOT PRODUCT ROUTINE.
002095,000204:
002096,000205: 03,6232 64516 AD ONE # FROM TRUE2
002097,000206:
002098,000207: 03,6233 30001 SHIFTR XCH Q
002099,000208: 03,6234 50103 TS TEM5 # SHIFT TP MPAC RIGHT ACCORDING TO INTEGER
002100,000209: 03,6235 10001 CCS Q # PICK UP COUNT, SUBTRACTING ONE
002101,000210: 03,6236 62130 +3 AD NEG13 # RETURNS HERE FROM SR14
002102,000211: 03,6237 10000 CCS A
002103,000212: 03,6240 64516 AD ONE # SHIFT COUNT MORE THAN 14 - DECREMENT BY
002104,000213: 03,6241 06251 TC SR14 # 14 AND EXCHANGE
002105,000214: 03,6242 06244 TC +2 # REMAINING SHIFT COUNT BETWEEN 1 AND 13
002106,000215: 03,6243 06251 TC SR14 # MULTIPLES OF 14 END UP HERE
002107,000216: 03,6244 40000 COM
002108,000217: 03,6245 20000 INDEX A # PICK UP PROPER SHIFTING BIT
002109,000218: 03,6246 34515 CAF BIT2
002110,000219: 03,6247 05415 TC SHORTMP # DO SHIFT BY MULTIPLICATION
002111,000220: 03,6250 00103 TC TEM5 # (TEM5 CONTAINS SQRT RETURN IF SQRT CALL)
002112,000221:
002113,000222: 03,6251 30114 SR14 XCH MPAC # SAVE REDUCED COUNT
002114,000223: 03,6252 30115 XCH MPAC +1
002115,000224: 03,6253 30116 XCH MPAC +2
002116,000225: 03,6254 35500 CAF ZERO
002117,000226: 03,6255 30114 XCH MPAC # NOW BRING IT BACK
002118,000227: 03,6256 10000 CCS A # SEE IF REMAINING COUNT IS ZERO
002119,000228: 03,6257 06236 TC SHIFTR +3 # NON-ZERO - BACK TO SHIFT LOOP
002120,000229: 03,6260 00103 TC TEM5 # FINISHED
002121,000230:
002122,000231:
002123,000232: 03,6261 06263 ABVAL1 TC ABVAL
002124,000233: 03,6262 05236 TC DPEXIT # MODE IS NOW DP
002125,000234:
002126,000235: 03,6263 30001 ABVAL XCH Q # TAKES HALF THE LENGTH OF THE VECTOR IN
002127,000236: 03,6264 50106 TS TEM10 # VAC
002128,000237: 03,6265 06275 TC VSR1 # SHIFT VECTOR RIGHT ONE
002129,000238: 03,6266 05245 TC DOT2 # TAKE THE SQUARE OF ITS LENGTH
002130,000239: 03,6267 45501 CS FOUR # STORE SQUARE OF LENGTH IN REGISTERS 28
002131,000240: 03,6270 60067 AD VACLOC # AND 29 OF VAC AREA.
002132,000241: 03,6271 05346 TC STORDAC
002133,000242: 03,6272 04737 TC MPACCOM
002134,000243: 03,6273 07300 TC SQRT3 # TAKE A TRIPLE-PRECISION SQRT (DP ANSWER)
002135,000244: 03,6274 00106 TC TEM10 # AND EXIT
002136,000245:
002137,000246: 03,6275 30001 VSR1 XCH Q # SUBROUTINE WHICH SHIFTS VECTOR IN VAC
002138,000247: 03,6276 50105 TS TEM9 # RIGHT ONE PLACE, USED BY ABVAL AND UNIT
002139,000248: 03,6277 35501 CAF FOUR
002140,000249: 03,6300 60067 AD VACLOC # USED BY ABVAL AND UNIT
002141,000250: 03,6301 07257 TC SR1 # VECTOR IS SHIFTED RIGHT SO DOT PRODUCT
002142,000251: 03,6302 30063 XCH TEM11 # WONT OVERFLOW.
002143,000252: 03,6303 64340 AD MINUS2
002144,000253: 03,6304 07257 TC SR1
002145,000254: 03,6305 30063 XCH TEM11
002146,000255: 03,6306 64340 AD MINUS2
002147,000256: 03,6307 50061 TS ADDRWD # FOR THE DOT ROUTINE.
002148,000257: 03,6310 07257 TC SR1 # VECTOR IS NOW SHIFTED RIGHT
002149,000258:
002150,000259: 03,6311 00105 TC TEM9
002151,000260:
002152,000261: 03,6312 06021 SSM TC BRANCH # SET SIGN OF MPAC,MPAC+1 MINUS, USED BY
002153,000262: 03,6313 04737 TC MPACCOM # SIGN INSTRUCTION
002154,000263: 03,6314 04024 TC DANZIG
002155,000264: 03,6315 04024 TC DANZIG
002156,000265:
002157,000266: 03,6316 06021 SSP TC BRANCH
002158,000267: 03,6317 04024 TC DANZIG
002159,000268: 03,6320 04024 TC DANZIG
002160,000269: 03,6321 04737 TC MPACCOM
002161,000270: 03,6322 04024 TC DANZIG
002162,000271:
002163,000272:
002164,000273: 03,6323 34231 SQUARE CAF BUGMPAC # SQUARE MPAC AND LEAVE RESULT IN MPAC, +2
002165,000274: 03,6324 05063 TC DSQ2 # CONTINUE AS IN DMP.
002166,000275:
002167,000276: 03,6325 40064 COMP CS MODE
002168,000277: 03,6326 60000 DOUBLE
002169,000278: 03,6327 20000 INDEX A
002170,000279: 03,6330 06331 TC +1
002171,000280: 03,6331 05201 TC VACCOM
002172,000281: 03,6332 04024 TC DANZIG
002173,000282: 03,6333 04737 TC MPACCOM # FOR TP
002174,000283: 03,6334 04024 TC DANZIG
002175,000284: 03,6335 06333 TC -2
002176,000285:
002177,000286: 03,6336 35500 SMOVE CAF ZERO
002178,000287: 03,6337 50115 TS MPAC +1
002179,000288: 03,6340 04024 TC DANZIG
002180,000289:
002181,000290: 03,6341 10020 NEXT CCS CYR # NEXT AND ITCQ OPERATORS
002182,000291: 03,6342 10120 CCS ADRLOC # NEXT - KNOCK DOWN ADRLOC BY ONE
002183,000292: 03,6343 06347 TC +4 # AND BEGIN NEXT EQUN IMMEDIATELY
002184,000293: 03,6344 20066 INDEX FIXLOC # ITCQ - PICK UP QPRET AND BRANCH
002185,000294: 03,6345 30052 XCH QPRET
002186,000295: 03,6346 04601 TC DOBR2
002187,000296:
002188,000297: 03,6347 50120 +4 TS ADRLOC
002189,000298: 03,6350 34516 CAF ONE # TURN ON LOAD INDICATOR
002190,000299: 03,6351 06362 TC SWLODIND
002191,000300:
002192,000301: 03,6352 10120 NOLOAD CCS ADRLOC # NOLOD AND ROUND OPERATORS. DECREMENT
002193,000302: 03,6353 50120 TS ADRLOC # ADRLOC SINCE WE SHOULDNT HAVE TAKEN AN
002194,000303: 03,6354 10020 CCS CYR # ADDRESS. SEE IF NOLOD OR ROUND
002195,000304: 03,6355 35500 CAF ZERO # NOLOD - SET NEWEQIND TO ZERO
002196,000305: 03,6356 06362 TC +4
002197,000306: 03,6357 44516 CS ONE # MODE IS NOW DP
002198,000307: 03,6360 50064 TS MODE
002199,000308: 03,6361 05071 TC MPACRND # GO ROUND MPAC AND RETURN TO DANZIG
002200,000309:
002201,000310: 03,6362 50065 SWLODIND TS NEWEQIND
002202,000311: 03,6363 04024 TC DANZIG
002203,000312:
002204,000313:
002205,000314: 03,6364 30116 SL1 XCH MPAC +2 # ROUTINE WHICH SHIFTS TRIPLE ACCUMULATOR
002206,000315: 03,6365 60000 DOUBLE # LEFT ONE PLACE. IT IS USED BY TSLT AND
002207,000316: 03,6366 50116 TS MPAC +2 # TSLC
002208,000317: 03,6367 35500 CAF ZERO
002209,000318: 03,6370 60115 AD MPAC +1
002210,000319: 03,6371 60115 AD MPAC +1
002211,000320: 03,6372 50115 TS MPAC +1
002212,000321: 03,6373 35500 CAF ZERO
002213,000322: 03,6374 60114 AD MPAC
002214,000323: 03,6375 60114 AD MPAC
002215,000324: 03,6376 50114 TS MPAC
002216,000325: 03,6377 00001 TC Q
002217,000326: 03,6400 50121 TS OVFIND # SET OVFIND IF ENTIRE WORD OVERFLOWS
002218,000327: 03,6401 00001 TC Q
002219,000328:
002220,000329: 03,6402 06042 SHIFTL TC TRUE2 # TP LEFT SHIFT - GET INTEGER ADDRESS
002221,000330: 03,6403 06406 TC +3
002222,000331: 03,6404 50061 LEFTLOOP TS ADDRWD
002223,000332: 03,6405 06364 TC SL1
002224,000333: 03,6406 10061 +3 CCS ADDRWD
002225,000334: 03,6407 06404 TC LEFTLOOP
002226,000335: 03,6410 04024 TC DANZIG
002227,000336:
002228,000337: 03,6411 35500 TSLC CAF ZERO # NORMALIZATION - START BY SETTING COUNT
002229,000338: 03,6412 50101 TS TEM2 # TO ZERO
002230,000339: 03,6413 06021 TC BRANCH
002231,000340: 03,6414 06416 TC +2
002232,000341: 03,6415 06430 TC SLCANS
002233,000342:
002234,000343: 03,6416 40114 RETRN CS MPAC # HERE FOR NON-ZERO
002235,000344: 03,6417 60000 DOUBLE
002236,000345: 03,6420 50000 OVSK # SKIP ON OVERFLOW
002237,000346: 03,6421 06423 TC +2 # NO OVERFLOW - SHIFT AGAIN
002238,000347: 03,6422 06430 TC SLCANS # DONE - WE OVERFLOWED
002239,000348: 03,6423 30101 XCH TEM2
002240,000349: 03,6424 64516 AD ONE
002241,000350: 03,6425 50101 TS TEM2
002242,000351: 03,6426 06364 TC SL1 # DO THE SHIFT
002243,000352: 03,6427 06416 TC RETRN # AND LOOP
002244,000353:
002245,000354: 03,6430 40101 SLCANS CS TEM2 # STORE COMPLEMENT OF COUNT
002246,000355: 03,6431 20061 INDEX ADDRWD
002247,000356: 03,6432 50000 TS 0
002248,000357: 03,6433 04024 TC DANZIG
002249,000358:
002250,000359:
002251,000360: 03,6434 06042 SWITCHEM TC TRUE2 # SWITCH AND TEST INSTRUCTIONS.
002252,000361:
002253,000362: 03,6435 20061 INDEX ADDRWD # PICK UP A 1 IN SPECIFIED SWITCH POS.
002254,000363: 03,6436 34477 CAF BIT15 -1 # SWITCHES ARE NUMBERED 1 - 15 D.
002255,000364: 03,6437 50102 TS TEM4
002256,000365: 03,6440 70652 MASK STATE # GET BS WHERE B IS BIT AND S IS *STATE*
002257,000366: 03,6441 50103 TS TEM5 # - THE WORD CONTAINING THE 15 SWITCHES
002258,000367:
002259,000368: 03,6442 10020 CCS CYR # DECIDE WHETHER INST. IS *SWITCH* OR TEST
002260,000369: 03,6443 04364 TC INCADR # TO PICK UP NEXT ADDRESS
002261,000370: 03,6444 06447 TC +3
002262,000371: 03,6445 40102 CS TEM4
002263,000372: 03,6446 06453 TC SWITCHIT # SWITCH BIT.
002264,000373:
002265,000374: 03,6447 10103 CCS TEM5 # TEST SWITCH
002266,000375: 03,6450 04702 TC RE-ENTER # IT WAS ON - DONT BRANCH
002267,000376: 03,6451 04573 TC SWF/F # OFF - GO TO FIXED-FIXED TO PICK UP ADR.
002268,000377: 03,6452 04702 TC RE-ENTER # COMES HERE IF BIT 15 WAS ON
002269,000378:
002270,000379: 03,6453 30652 SWITCHIT XCH STATE # WE DESIRE THE LOGICAL EXCLUSIVE OR OF B
002271,000380: 03,6454 40000 COM
002272,000381: 03,6455 70652 MASK STATE
002273,000382: 03,6456 60103 AD TEM5
002274,000383: 03,6457 40000 COM
002275,000384: 03,6460 50652 TS STATE
002276,000385: 03,6461 04702 TC RE-ENTER # DONT PUSH-DOWN IF AT END.
002277,000386:
002278,000387:
002279,000388: 03,6462 50115 VSLT2 TS MPAC +1 # SET TO ZERO IN CASE OF RIGHT SHIFT.
002280,000389: 03,6463 06042 TC TRUE2 # RETURNS TO CALLER IF COUNT PNZ.
002281,000390:
002282,000391: 03,6464 06476 TC VSLTEST
002283,000392: 03,6465 50061 VSLTLOOP TS ADDRWD
002284,000393: 03,6466 35500 CAF ZERO
002285,000394: 03,6467 60067 AD VACLOC
002286,000395: 03,6470 50101 TS TEM2
002287,000396: 03,6471 06501 TC VSL1
002288,000397: 03,6472 05411 TC INCRT2
002289,000398: 03,6473 06501 TC VSL1
002290,000399: 03,6474 05411 TC INCRT2
002291,000400: 03,6475 06501 TC VSL1
002292,000401: 03,6476 10061 VSLTEST CCS ADDRWD
002293,000402: 03,6477 06465 TC VSLTLOOP
002294,000403: 03,6500 04024 TC DANZIG
002295,000404:
002296,000405: 03,6501 20101 VSL1 INDEX TEM2
002297,000406: 03,6502 30001 XCH 1
002298,000407: 03,6503 60000 DOUBLE
002299,000408: 03,6504 20101 INDEX TEM2
002300,000409: 03,6505 50001 TS 1
002301,000410: 03,6506 35500 CAF ZERO
002302,000411: 03,6507 20101 INDEX TEM2
002303,000412: 03,6510 60000 AD 0
002304,000413: 03,6511 20101 INDEX TEM2
002305,000414: 03,6512 60000 AD 0
002306,000415: 03,6513 20101 INDEX TEM2
002307,000416: 03,6514 50000 TS 0
002308,000417: 03,6515 00001 TC Q
002309,000418: 03,6516 50121 TS OVFIND
002310,000419: 03,6517 00001 TC Q
002311,000420:
002312,000421:
002313,000422: # DOUBLE-PRECISION SINE-COSINE ROUTINES.
002314,000423:
002315,000424: # THESE PROGRAMS ARE ENTERED AND EXIT IN THE INTERPRETIVE MODE, WITH
002316,000425: # THE ARGUMENT IN MPAC AT ENTRY AND THE ANSWER IN MPAC AT EXIT. THEY
002317,000426: # COMPUTE, RESPECTIVELY, (1/2) COS (PI X) AND (1/2) SIN (PI X) WHERE
002318,000427: # X = C(MPAC) RANGES OVER THE INTERVAL (-1, +1).
002319,000428:
002320,000429: # PROGRAM USES THE SERIES
002321,000430: # 3 5 7 9
002322,000431: # (1/2) SIN(PI X) = C X + 4C X + 16C X + 64C X + 256C X .
002323,000432: # 1 3 5 7 9
002324,000433: # WHERE THE C COEFFICIENTS ARE FROM HASTINGS SERIES
002325,000434: # 3 5 7 9
002326,000435: # SIN(PI X/2) = C X + C X + C X + C X + C X .
002327,000436: # 1 3 5 7 9
002328,000437:
002329,000438: 03,6520 30001 COSINE XCH Q # CLOSED COSINE ROUTINE
002330,000439: 03,6521 50104 TS TEM8
002331,000440: 03,6522 07121 TC TSGNABS # FORM 1/2 - (ABS(X)) AND COMPUTE SINE
002332,000441: 03,6523 06743 TC DACCOM+
002333,000442: 03,6524 06527 TC SINE +2
002334,000443:
002335,000444: 03,6525 30001 SINE XCH Q # CLOSED SINE ROUTINE
002336,000445: 03,6526 50104 TS TEM8
002337,000446: 03,6527 06713 TC PARTSL1 # DOUBLE ARGUMENT
002338,000447: 03,6530 50114 TS MPAC
002339,000448: 03,6531 06533 TC +2 # IF DIDNT SKIP
002340,000449: 03,6532 04741 TC DACCOM # IF SO, WE WANT -SIN(X) = SIN(-X)
002341,000450:
002342,000451: 03,6533 40114 CS MPAC
002343,000452: 03,6534 50072 TS VBUF +2 # SAVE NEGATIVE OF ARGUMENT
002344,000453: 03,6535 50101 TS TEM2
002345,000454: 03,6536 60000 DOUBLE
002346,000455: 03,6537 50001 TS Q
002347,000456: 03,6540 06553 TC SN1 # IF ABS(X) LESS THAN 1/2
002348,000457:
002349,000458: 03,6541 20000 INDEX A # CONTAINS +-1
002350,000459: 03,6542 44520 CS NEG1/2 +1
002351,000460: 03,6543 30101 XCH TEM2
002352,000461: 03,6544 60101 AD TEM2
002353,000462: 03,6545 60101 AD TEM2 # (ADD +-1/2 TWICE TO MAKE +-1.0)
002354,000463: 03,6546 50114 TS MPAC
002355,000464: 03,6547 40115 CS MPAC +1
002356,000465: 03,6550 50115 TS MPAC +1
002357,000466: 03,6551 40114 CS MPAC
002358,000467: 03,6552 50072 TS VBUF +2
002359,000468:
002360,000469:
002361,000470: 03,6553 40115 SN1 CS MPAC +1 # SAVE REST OF ARGUMENT
002362,000471: 03,6554 50073 TS VBUF +3
002363,000472: 03,6555 34231 CAF BUGMPAC # ADDRESS OF MPAC WITH MP BITS
002364,000473: 03,6556 50102 TS TEM4
002365,000474: 03,6557 34771 CAF DAD2 +4 # SQUARE MPAC
002366,000475: 03,6560 05101 TC DMP1
002367,000476: 03,6561 04525 TC TCS1 +2
002368,000477:
002369,000478: 03,6562 05553 TC POLY
002370,000479: 03,6563 00010 DEC 8 B-14
002371,000480: 03,6564 63336 40452 2DEC -0.3926990796 # ( C /4)
002372,000481: # 1
002373,000482:
002374,000483: 03,6566 24527 17013 2DEC +0.6459637111 # ( 4C /4)
002375,000484: # 3
002376,000485:
002377,000486: 03,6570 65631 56501 2DEC -0.318758717 # ( 16C /4)
002378,000487: # 5
002379,000488:
002380,000489: 03,6572 02311 06306 2DEC +0.074780249 # ( 64C /4)
002381,000490: # 7
002382,000491:
002383,000492: 03,6574 77541 45020 2DEC -0.009694988 # (256C /4)
002384,000493: # 9
002385,000494:
002386,000495: 03,6576 05156 TC DMP # DMP BY X
002387,000496: 03,6577 50071 XCADR VBUF +2
002388,000497: 03,6600 06364 TC SL1 # AND SHIFT LEFT 2
002389,000498: 03,6601 06364 TC SL1
002390,000499: 03,6602 00104 TC TEM8 # DONE
002391,000500:
002392,000501: 03,6603 06525 SIN1 TC SINE # INTERPRETER LINKAGE
002393,000502: 03,6604 04024 TC DANZIG
002394,000503:
002395,000504: 03,6605 06520 COS1 TC COSINE
002396,000505: 03,6606 04024 TC DANZIG
002397,000506:
002398,000507:
002399,000508: 03,6607 36735 ARCSIN CAF TCTAG+1 # PICK UP ARCSIN BRANCH
002400,000509: 03,6610 64476 AD POSMAX # TO FORCE OVERFLOW
002401,000510: 03,6611 50000 OVSK # SKIP AND RESTORE NON-OVERFLOW
002402,000511:
002403,000512: 03,6612 36735 ARCCOS CAF TCEX # SET ARCCOS SWITCH
002404,000513: 03,6613 30113 XCH ESCAPE # NO SKIP, PLEASE
002405,000514: 03,6614 30001 XCH Q # ONLY HAVE TO SAVE Q IN ONE PLACE
002406,000515: 03,6615 50112 TS ARETURN
002407,000516: 03,6616 06021 TC BRANCH
002408,000517: 03,6617 06625 TC ACOSST # POSITIVE
002409,000518: 03,6620 06622 TC +2 # ARCCOS = PI/2
002410,000519: 03,6621 06722 TC NEGARGU
002411,000520:
002412,000521: 03,6622 34502 CAF QUARTER # ARCCOS(0) = .25(2PI).
002413,000522: 03,6623 50114 TS MPAC # (MPAC +1 IS ALREADY ZERO).
002414,000523: 03,6624 00113 TC ESCAPE
002415,000524:
002416,000525: 03,6625 06713 ACOSST TC PARTSL1 # DOUBLE ARGUMENT
002417,000526: 03,6626 30114 XCH MPAC # NO SKIP, BUT EXAMINE ORIGINAL MPAC
002418,000527: 03,6627 64517 AD NEG1/2 # MUST BE LESS THAN OR EQUAL TO 1/2
002419,000528: 03,6630 10000 CCS A
002420,000529: 03,6631 06631 TC -0 # MAJOR PART GREATER THAN 1/2. NOTE THAT
002421,000530: 03,6633 LOC +1 # MPAC+1 IS NOT CHECKED SO A MARGIN EXISTS
002422,000531:
002423,000532: 03,6633 06637 TC +4 # NORMAL CASE
002424,000533: 03,6634 50114 TS MPAC # ARGUMENT WAS 1 (SCALED). LEAVE ZERO
002425,000534: 03,6635 50115 TS MPAC +1 # AS RESULT AND EXIT
002426,000535: 03,6636 00113 TC ESCAPE
002427,000536:
002428,000537:
002429,000538: 03,6637 40115 +4 CS MPAC +1
002430,000539: 03,6640 50115 TS MPAC +1
002431,000540: 03,6641 50073 TS B +1
002432,000541: 03,6642 40114 CS MPAC
002433,000542: 03,6643 50072 TS B
002434,000543: 03,6644 64521 AD HALF
002435,000544: 03,6645 64521 AD HALF
002436,000545: 03,6646 50114 TS MPAC # SQRT ARGUMENT IS NOW READY
002437,000546:
002438,000547: 03,6647 06655 TC +6 # NORMAL PATH.
002439,000548:
002440,000549: 03,6650 34476 CAF POSMAX # WE HAVE FALSE OVERFLOW PRESENT AND IT
002441,000550: 03,6651 50114 TS MPAC # MUST BE CORRECTED. MAJOR PART WAS ZERO
002442,000551: 03,6652 60115 AD MPAC +1 # AND MINOR PART PNZ, SO FORM 1.0 - MPAC
002443,000552: 03,6653 64516 AD ONE # PROPERLY FOR THIS CASE.
002444,000553: 03,6654 50115 TS MPAC +1 # GUARANTEED NO OVERFLOW.
002445,000554:
002446,000555: 03,6655 07276 +6 TC SQRT2 # GO TAKE THE SQUARE ROOT.
002447,000556:
002448,000557: 03,6656 40073 CS B +1
002449,000558: 03,6657 30115 XCH MPAC +1
002450,000559: 03,6660 50073 TS B +1
002451,000560: 03,6661 40072 CS B
002452,000561: 03,6662 30114 XCH MPAC
002453,000562: 03,6663 50072 TS B
002454,000563: 03,6664 05553 TC POLY # EVALUATE HASTINGS POLYNOMIAL/2PI
002455,000564: 03,6665 00016 DEC 14 B-14
002456,000565: 03,6666 07777 37777 2DEC* .4999999920 B-1* # HASTINGS COEFFICIENTS/2PI
002457,000566: 03,6670 76720 55163 2DEC* -.0683089201 B-1*
002458,000567: 03,6672 00350 00532 2DEC* .0283228913 B-1*
002459,000568: 03,6674 77575 45233 2DEC* -.0159709772 B-1*
002460,000569: 03,6676 00120 21555 2DEC* .0098331911 B-1*
002461,000570: 03,6700 77723 56072 2DEC* -.0054393193 B-1*
002462,000571: 03,6702 00021 14445 2DEC* .0021231556 B-1*
002463,000572: 03,6704 77774 66516 2DEC* -.0004018634 B-1*
002464,000573:
002465,000574: 03,6706 05156 TC DMP # INTERPRETER SUBROUTINE ONLY
002466,000575: 03,6707 50071 XCADR B
002467,000576: 03,6710 00113 TC ESCAPE # GO TO ARCSIN/ARCCOS SWITCH (OR NEGARGU)
002468,000577:
002469,000578: 03,6711 06743 TAGIT TC DACCOM+
002470,000579: 03,6712 00112 TC ARETURN
002471,000580: 03,6713 30115 PARTSL1 XCH MPAC +1 # DOES A DOUBLE SHIFT LEFT EXCEPT FOR THE
002472,000581: 03,6714 60000 DOUBLE # FINAL TS. USED BY SIN, COS, ASIN, AND
002473,000582: 03,6715 50115 TS MPAC +1 # ACOS.
002474,000583: 03,6716 35500 CAF ZERO
002475,000584: 03,6717 60114 AD MPAC
002476,000585: 03,6720 60114 AD MPAC
002477,000586: 03,6721 00001 TC Q # POSSIBLY WITH OVERLOW PRESENT
002478,000587:
002479,000588: 03,6722 04741 NEGARGU TC DACCOM # ARCCOS(-X)=PI-ARCCOS(X)
002480,000589: 03,6723 36736 CAF TCSUBTR # SET SWITCH TO PERFORM ABOVE
002481,000590: 03,6724 30113 XCH ESCAPE
002482,000591: 03,6725 50074 TS ESCAPE2 # ADDITIONAL SWITCH HERE.
002483,000592: 03,6726 06625 TC ACOSST
002484,000593:
002485,000594:
002486,000595: 03,6727 40114 SUBTR CS MPAC
002487,000596: 03,6730 64521 AD HALF
002488,000597: 03,6731 50114 TS MPAC
002489,000598: 03,6732 40115 CS MPAC +1
002490,000599: 03,6733 50115 TS MPAC +1
002491,000600: 03,6734 00074 TC ESCAPE2 # THIS IS NOW THE ARCSIN/ARCCOS SWITCH
002492,000601:
002493,000602:
002494,000603:
002495,000604: 03,6735 06712 TCTAG+1 TC TAGIT +1
002496,000605: 03,6736 03,6735 TCEX EQUALS TCTAG+1
002497,000606: 03,6736 06727 TCSUBTR TC SUBTR
002498,000607:
002499,000608: 03,6737 06607 ARCSIN1 TC ARCSIN
002500,000609: 03,6740 04024 TC DANZIG
002501,000610:
002502,000611: 03,6741 06612 ARCCOS1 TC ARCCOS
002503,000612: 03,6742 04024 TC DANZIG
002504,000613:
002505,000614: 03,6743 40115 DACCOM+ CS MPAC +1 # USED BY SIN-COS AND ARCSIN-ARCCOS
002506,000615: 03,6744 50115 TS MPAC +1
002507,000616: 03,6745 40114 CS MPAC
002508,000617: 03,6746 64502 AD QUARTER
002509,000618: 03,6747 50114 TS MPAC
002510,000619: 03,6750 00001 TC Q
002511,000620:
002512,000621:
002513,000622: 03,6751 30076 MBXCH XCH BUF # TO EXCHANGE MPAC AND BUF
002514,000623: 03,6752 30114 XCH MPAC
002515,000624: 03,6753 50076 TS BUF
002516,000625: 03,6754 30077 XCH BUF +1
002517,000626: 03,6755 30115 XCH MPAC +1
002518,000627: 03,6756 50077 TS BUF +1
002519,000628: 03,6757 00001 TC Q
002520,000629:
002521,000630: 03,6760 50116 DDV0 TS MPAC +2 # SET MPAC+2 TO ZERO TO RESUME DDV
002522,000631: 03,6761 07121 TC TSGNABS # SIGN AGGREMENT ETC
002523,000632: 03,6762 50101 TS TEM2 # SAVE SGN
002524,000633: 03,6763 06751 TC MBXCH # SWITCH CONTENTS
002525,000634: 03,6764 07121 TC TSGNABS # SAME FOR ARGUMENT
002526,000635: 03,6765 60101 AD TEM2
002527,000636: 03,6766 10000 CCS A # TO GET SIGN OF RESULT
002528,000637: 03,6767 06772 TC +3
002529,000638: 03,6770 07115 TC DPDOFLO +1 # HERE FOR 0/0 CASE
002530,000639: 03,6771 06772 TC +1
002531,000640: 03,6772 50101 TS TEM2
002532,000641: 03,6773 10107 CCS DVSW
002533,000642: 03,6774 06751 TC MBXCH # INTERCHANGE OLD DIVISOR AND DIVIDEND
002534,000643:
002535,000644: 03,6775 40076 CS BUF # CHECK TO SEE IF C(BUF,BUF+1) LESS
002536,000645: 03,6776 60114 AD MPAC # THAN C(MPAC,MPAC+1). OVERFLOW CONDITION
002537,000646: 03,6777 10000 CCS A # IF NOT
002538,000647: 03,7000 07012 TC DDVOK # SCALING OK
002539,000648: 03,7002 LOC +1
002540,000649: 03,7002 07114 TC DPDOFLO # TROUBLE HERE
002541,000650: 03,7003 40077 CS BUF +1 # CHECK MINOR PARTS IF MAJORS EQUAL
002542,000651: 03,7004 60115 AD MPAC +1
002543,000652: 03,7005 10000 CCS A
002544,000653: 03,7006 07012 TC DDVOK
002545,000654: 03,7010 LOC +1
002546,000655: 03,7010 07114 TC DPDOFLO # TROUBLE HERE
002547,000656: 03,7011 07114 TC DPDOFLO # AS WELL AS WHEN C(BUF,BUF+1)=C(MPAC,+1)
002548,000657:
002549,000658: 03,7012 35500 DDVOK CAF ZERO
002550,000659: 03,7013 60114 AD MPAC
002551,000660: 03,7014 07030 TC DPDNORT # TO NORMALIZE
002552,000661:
002553,000662:
002554,000663: 03,7015 30001 SQRTDIV XCH Q # ENTRY FROM SQRT ROUTINE
002555,000664: 03,7016 50075 TS TEMQ3
002556,000665: 03,7017 07042 TC DVSTART
002557,000666:
002558,000667: 03,7020 30077 DPDNORM XCH BUF +1
002559,000668: 03,7021 60000 DOUBLE
002560,000669: 03,7022 50077 TS BUF +1
002561,000670: 03,7023 35500 CAF ZERO
002562,000671: 03,7024 60076 AD BUF
002563,000672: 03,7025 60076 AD BUF
002564,000673: 03,7026 50076 TS BUF
002565,000674: 03,7027 06367 TC SL1 +3 # TO DOUBLE MPAC
002566,000675:
002567,000676: 03,7030 50022 DPDNORT TS CYL # TO LOOK AT BIT 14
002568,000677: 03,7031 10022 CCS CYL
002569,000678: 03,7032 07020 TC DPDNORM
002570,000679: 03,7033 07035 TC +2
002571,000680: 03,7034 07042 TC DVSTART
002572,000681: 03,7035 30077 XCH BUF +1 # HIGH ORDER ZERO
002573,000682: 03,7036 30076 XCH BUF
002574,000683: 03,7037 30115 XCH MPAC +1 # SET MPAC +1 TO ZERO
002575,000684: 03,7040 50114 TS MPAC
002576,000685: 03,7041 07030 TC DPDNORT # AND TRY AGAIN
002577,000686:
002578,000687:
002579,000688: 03,7042 30076 DVSTART XCH BUF # OK
002580,000689: 03,7043 25777 INDEX OPOVF
002581,000690: 03,7044 50114 DV MPAC
002582,000691: 03,7045 50034 TS OVCTR
002583,000692: 03,7046 25777 INDEX OPOVF
002584,000693: 03,7047 40115 MP MPAC +1
002585,000694: 03,7050 60001 -1/2+2 AD Q # COMPLIMENT OF REMAINDER.
002586,000695: 03,7051 40000 CS A
002587,000696: 03,7052 60077 AD BUF +1
002588,000697: 03,7053 50000 OVSK
002589,000698: 03,7054 07057 TC +3 # IF NOT
002590,000699: 03,7055 25777 INDEX OPOVF # IF OVERFLEW
002591,000700: 03,7056 60114 SU MPAC
002592,000701: 03,7057 50076 +3 TS BUF
002593,000702: 03,7060 10000 CCS A
002594,000703: 03,7061 64516 AD ONE
002595,000704: 03,7062 07064 TC +2
002596,000705: 03,7063 64516 AD ONE
002597,000706: 03,7064 25777 +2 EXTEND # WE NOW HAVE ABS(CORRECT BUF)
002598,000707: 03,7065 60114 SU MPAC
002599,000708: 03,7066 10000 CCS A
002600,000709: 03,7067 64516 AD ONE
002601,000710: 03,7070 07072 TC +2
002602,000711: 03,7071 07075 TC +4
002603,000712: 03,7072 30076 +2 XCH BUF
002604,000713: 03,7073 60000 DOUBLE
002605,000714: 03,7074 10000 CCS A
002606,000715: 03,7075 30076 +4 XCH BUF
002607,000716: 03,7076 07100 TC +2
002608,000717: 03,7077 40076 CS BUF
002609,000718: 03,7100 25777 INDEX OPOVF
002610,000719: 03,7101 50114 DV MPAC
002611,000720:
002612,000721:
002613,000722: 03,7102 50115 DPDSGNT TS MPAC +1
002614,000723: 03,7103 10101 CCS TEM2
002615,000724: 03,7104 07112 TC POSQUOT
002616,000725: 03,7105 40115 CS MPAC +1
002617,000726: 03,7106 50115 TS MPAC +1
002618,000727: 03,7107 40034 CS OVCTR
002619,000728: 03,7110 50114 TS MPAC
002620,000729: 03,7111 00075 TC TEMQ3
002621,000730:
002622,000731: 03,7112 30034 POSQUOT XCH OVCTR
002623,000732: 03,7113 07110 TC -3
002624,000733:
002625,000734: 03,7114 10101 DPDOFLO CCS TEM2
002626,000735: 03,7115 45502 CS TWO
002627,000736: 03,7116 64516 AD ONE
002628,000737: 03,7117 50121 TS OVFIND
002629,000738: 03,7120 00075 TC TEMQ3
002630,000739:
002631,000740:
002632,000741: 03,7121 30001 TSGNABS XCH Q # SIGNUM AND ABSOLUTE VALUE
002633,000742: 03,7122 50103 TS TEMQ2
002634,000743: 03,7123 07132 TC TPAGREE
002635,000744:
002636,000745: 03,7124 10000 CCS A # TEST SIGNUM
002637,000746: 03,7125 64516 AD ONE
002638,000747: 03,7126 00103 TC TEMQ2
002639,000748:
002640,000749: 03,7127 04737 TC MPACCOM # COMPLEMENT IF NEGATIVE
002641,000750: 03,7130 44516 CS ONE
002642,000751: 03,7131 00103 TC TEMQ2
002643,000752:
002644,000753: 03,7132 30001 TPAGREE XCH Q # FORCE SIGN AGREEMENT IN TP WORD IN MPAC
002645,000754: 03,7133 50102 TS TEMQ
002646,000755: 03,7134 06021 TC BRANCH
002647,000756: 03,7135 07150 TC SGN=+
002648,000757: 03,7136 07143 TC SGN=0
002649,000758:
002650,000759: 03,7137 44476 CS POSMAX
002651,000760: 03,7140 50100 TS SGNDMAX
002652,000761: 03,7141 44516 CS ONE
002653,000762: 03,7142 07153 TC SGFORCE
002654,000763:
002655,000764: 03,7143 35500 SGN=0 CAF ZERO
002656,000765: 03,7144 50114 TS MPAC
002657,000766: 03,7145 50115 TS MPAC +1
002658,000767: 03,7146 50116 TS MPAC +2
002659,000768: 03,7147 00102 TC TEMQ
002660,000769:
002661,000770: 03,7150 34476 SGN=+ CAF POSMAX
002662,000771: 03,7151 50100 TS SGNDMAX
002663,000772: 03,7152 34516 CAF ONE
002664,000773:
002665,000774:
002666,000775: 03,7153 60116 SGFORCE AD MPAC +2
002667,000776: 03,7154 60100 AD SGNDMAX
002668,000777: 03,7155 50116 TS MPAC +2
002669,000778: 03,7156 35500 CAF ZERO
002670,000779:
002671,000780: 03,7157 60115 AD MPAC +1
002672,000781: 03,7160 60100 AD SGNDMAX
002673,000782: 03,7161 50115 TS MPAC +1
002674,000783: 03,7162 35500 CAF ZERO
002675,000784:
002676,000785: 03,7163 60114 AD MPAC
002677,000786: 03,7164 60100 AD SGNDMAX
002678,000787: 03,7165 50114 TS MPAC
002679,000788: 03,7167 LOC +1
002680,000789: 03,7167 00102 TC TEMQ
002681,000790:
002682,000791:
002683,000792: 03,7170 06263 UNIT TC ABVAL # UNIT VECTOR ROUTINE - START BY GETTING
002684,000793: # LENGTH
002685,000794: 03,7171 06275 TC VSR1 # LEAVES 1/2 UNIT VECTORS
002686,000795:
002687,000796: 03,7172 10550 CCS NEWJOB # ALLOW FOR INTERRUPTS
002688,000797: 03,7173 07241 TC UNITRUPT # SO WE CAN RETURN IN BASIC
002689,000798:
002690,000799: 03,7174 60067 UNITRSM AD VACLOC # RETURNS HERE FROM BREAKPOINT IF CALLED.
002691,000800: 03,7175 50061 TS ADDRWD
002692,000801: 03,7176 35502 CAF TWO
002693,000802: 03,7177 50107 TS DVSW # NON-ZERO FOR BACKWARDS DIVIDE
002694,000803: 03,7200 50111 UNITLOOP TS COMPON
002695,000804: 03,7201 40114 CS MPAC
002696,000805: 03,7202 40000 CS A
002697,000806: 03,7203 20061 INDEX ADDRWD
002698,000807: 03,7204 30000 XCH 0 # LENGTH TO COMPONENT AND COMPONENT TO BUF
002699,000808: 03,7205 50076 TS BUF
002700,000809: 03,7206 40115 CS MPAC +1
002701,000810: 03,7207 40000 CS A
002702,000811: 03,7210 20061 INDEX ADDRWD
002703,000812: 03,7211 30001 XCH 1
002704,000813: 03,7212 50077 TS BUF +1
002705,000814:
002706,000815: 03,7213 37217 CAF +4 # CALL BACKWARDS DIVIDE
002707,000816: 03,7214 50075 TS TEMQ3
002708,000817: 03,7215 35500 CAF ZERO
002709,000818: 03,7216 06760 TC DDV0
002710,000819: 03,7217 07220 TC +1
002711,000820:
002712,000821: 03,7220 30114 XCH MPAC # RESULT BACK TO COMPONENT BRINGING BACK
002713,000822: 03,7221 20061 INDEX ADDRWD # LENGTH
002714,000823: 03,7222 30000 XCH 0
002715,000824: 03,7223 50114 TS MPAC
002716,000825: 03,7224 30115 XCH MPAC +1
002717,000826: 03,7225 20061 INDEX ADDRWD
002718,000827: 03,7226 30001 XCH 1
002719,000828: 03,7227 50115 TS MPAC +1
002720,000829:
002721,000830: 03,7230 05241 TC AD2 # INCREMENT ADDRWD
002722,000831: 03,7231 10111 CCS COMPON
002723,000832: 03,7232 07200 TC UNITLOOP
002724,000833: 03,7233 45502 CS TWO # STORE LENGTH OF ARGUMENT IN REGISTERS 30
002725,000834: 03,7234 60067 AD VACLOC
002726,000835: 03,7235 50101 TS TEM2 # AND 31 OF VAC AREA.
002727,000836: 03,7236 34771 CAF DAD2 +4
002728,000837: 03,7237 05040 TC 8TO2
002729,000838: 03,7240 04024 TC DANZIG
002730,000839:
002731,000840:
002732,000841: 03,7241 40060 UNITRUPT CS BANKSET # REQUESTS FOR INTERPRETIVE INTERRUPT
002733,000842: 03,7242 50116 TS MPAC +2 # COME HERE DURING THE UNIT OPERATION.
002734,000843: 03,7243 30117 XCH LOC # SINCE WE DESIRE TO RETURN IN BASIC BUT
002735,000844: 03,7244 20066 INDEX FIXLOC # BUT STILL SAVE THE INTERPRETER CENTRALS
002736,000845: 03,7245 50036 TS 30D # (BANKSET AND LOC)
002737,000846: 03,7246 02072 TC CHANG1
002738,000847:
002739,000848: 03,7247 40116 CS MPAC +2 # ON RETURN, RESTORE AS BEFORE
002740,000849: 03,7250 50060 TS BANKSET
002741,000850: 03,7251 20066 INDEX FIXLOC
002742,000851: 03,7252 30036 XCH 30D
002743,000852: 03,7253 50117 TS LOC
002744,000853: 03,7254 35500 CAF ZERO
002745,000854: 03,7255 07174 TC UNITRSM # ENTER UNIT DIVIDE LOOP.
002746,000855: 03,7256 34771 MPACSR1 CAF DAD2 +4
002747,000856:
002748,000857: 03,7257 50063 SR1 TS TEM11 # SHIFTS RIGHT ONE USING ADDRESS IN A
002749,000858: 03,7260 20000 INDEX A
002750,000859: 03,7261 30000 XCH 0
002751,000860: 03,7262 25777 INDEX OPOVF
002752,000861: 03,7263 44521 MP HALF
002753,000862: 03,7264 20063 INDEX TEM11
002754,000863: 03,7265 50000 TS 0
002755,000864: 03,7266 20063 INDEX TEM11
002756,000865: 03,7267 30001 XCH 1
002757,000866: 03,7270 50021 TS SR
002758,000867: 03,7271 30021 XCH SR
002759,000868: 03,7272 60003 AD LP
002760,000869: 03,7273 20063 INDEX TEM11
002761,000870: 03,7274 50001 TS 1
002762,000871: 03,7275 00001 TC Q
002763,000872:
002764,000873:
002765,000874: 03,7276 35500 SQRT2 CAF ZERO # ENTRY TO IGNORE C(MPAC+2)
002766,000875: 03,7277 50116 TS MPAC +2
002767,000876:
002768,000877: 03,7300 30001 SQRT3 XCH Q # HERE TO TREAT TRIPLE-PRECISION CASES
002769,000878: 03,7301 50103 TS TEMQ2
002770,000879: 03,7302 07132 TC TPAGREE # FORCE SIGN AGREEMENT
002771,000880: 03,7303 10000 CCS A # TEST SIGNUM
002772,000881: 03,7304 07307 TC SETNORM # PNZ - OK.
002773,000882: 03,7305 00103 TC TEMQ2 # FAST EXIT FOR ZERO ARGUMENT
002774,000883:
002775,000884: 03,7306 07306 TC -0 # NEGATIVE - ABORT.
002776,000885:
002777,000886: 03,7307 50061 SETNORM TS ADDRWD # SET NORMALIZATION COUNT TO ZERO
002778,000887: 03,7310 60114 AD MPAC
002779,000888: 03,7311 50022 TS CYL # WE WILL USE A/2, SO MUST CHECK FOR
002780,000889: 03,7312 10022 CCS CYL # NORMALIZATION FIRST
002781,000890: 03,7313 07317 TC SRTEST # LESS THAN 1/2 - SEE IF AT LEAST 1/8.
002782,000891: 03,7314 07324 TC A0=0 # MAJOR PART (POSSIBLY MINOR PART) = 0.
002783,000892:
002784,000893: 03,7315 07256 TC MPACSR1 # NORMALIZED - SHIFT RIGHT ONE.
002785,000894:
002786,000895: 03,7316 07356 TC ARGHI
002787,000896:
002788,000897: 03,7317 67050 SRTEST AD -1/2+2 # SEE IF ARG GREATER THAN OR EQUAL TO 1/4.
002789,000898: 03,7320 10000 CCS A
002790,000899: 03,7321 07256 TC MPACSR1 # IT IS - SHIFT RIGHT ONE AND GO TO ARGLO.
002791,000900: 03,7322 07345 TC ARGLO # (+0 WAS IMPOSSIBLE THIS CCS.)
002792,000901:
002793,000902: 03,7323 07333 TC SQRTNORM +1 # LESS THAN 1/4 - PUT IN EFFECTIVE RIGHT
002794,000903: # BY SHIFTING LEFT ONLY ONCE WHEN ADDING
002795,000904: # ONE TO THE RIGHT SHIFT COUNT.
002796,000905:
002797,000906:
002798,000907: 03,7324 30116 A0=0 XCH MPAC +2 # MOVE ARGUMENT UP
002799,000908: 03,7325 30115 XCH MPAC +1
002800,000909: 03,7326 30114 XCH MPAC
002801,000910: 03,7327 60061 AD ADDRWD
002802,000911: 03,7330 65361 AD SEVEN # INCREASE SHIFT COUNT BY 14/2 = 7
002803,000912: 03,7331 07307 TC SETNORM
002804,000913:
002805,000914: 03,7332 06364 SQRTNORM TC SL1
002806,000915: 03,7333 34516 CAF ONE # ARGUMENT LESS THAN 1/8, SO SHIFT IT LEFT
002807,000916: 03,7334 60061 AD ADDRWD # TWO PLACES AND INCREASE SHIFT COUNT FOR
002808,000917: 03,7335 50061 TS ADDRWD # RESULT
002809,000918: 03,7336 06364 TC SL1
002810,000919: 03,7337 50022 TS CYL
002811,000920: 03,7340 40022 CS CYL
002812,000921:
002813,000922:
002814,000923: 03,7341 10022 NORMTEST CCS CYL
002815,000924: 03,7342 10022 CCS CYL
002816,000925: 03,7343 07332 TC SQRTNORM # HERE IF LESS THAN 1/8
002817,000926: 03,7344 07356 TC ARGHI # HERE IF AT LEAST 1/4, LESS THAN 1/2
002818,000927:
002819,000928: 03,7345 37352 ARGLO CAF SLOPELO # HERE IF AT LEAST 1/8, LESS THAN 1/4
002820,000929: 03,7346 25777 INDEX OPOVF
002821,000930: 03,7347 40114 MP MPAC
002822,000931: 03,7350 67353 AD BIASLO # X0/2 = .8324(A0/2) + .2974/2
002823,000932: 03,7351 07362 TC ARGHI +4
002824,000933:
002825,000934: 03,7352 32506 SLOPELO DEC .8324
002826,000935: 03,7353 04604 BIASLO DEC .2974 B-1
002827,000936: 03,7354 22650 SLOPEHI DEC .5884
002828,000937: 03,7355 06552 BIASHI DEC .4192 B-1
002829,000938:
002830,000939: 03,7356 37354 ARGHI CAF SLOPEHI
002831,000940: 03,7357 25777 INDEX OPOVF
002832,000941: 03,7360 40114 MP MPAC
002833,000942: 03,7361 67355 AD BIASHI
002834,000943: 03,7362 30114 +4 XCH MPAC # X0/2 TO MPAC
002835,000944: 03,7363 50076 TS BUF # A0/2 TO BUF
002836,000945: 03,7364 50101 TS TEM2 # SET UP POSITIVE QUOTIENT SIGNAL AND
002837,000946: 03,7365 35500 CAF ZERO
002838,000947: 03,7366 30115 XCH MPAC +1 # ZERO LOW-ORDER DIVIDEND FOR DP DIVIDE
002839,000948: 03,7367 50077 TS BUF +1 # A1/2 TO BUF+1. A2 NOW DISCARDED
002840,000949: 03,7370 40076 CS BUF
002841,000950: 03,7371 25777 INDEX OPOVF
002842,000951: 03,7372 50114 DV MPAC # -(A0/2)/(X0/2).
002843,000952: 03,7373 50021 TS SR
002844,000953: 03,7374 40021 CS SR
002845,000954: 03,7375 60114 AD MPAC # X1 IS GOOD TO 14 BITS
002846,000955: 03,7376 50114 TS MPAC # X1 = X0/2 + ((A0/2)/(X0/2))/2
002847,000956: 03,7377 50100 TS TEM3 # SAVE X1 FOR ADDITION
002848,000957: 03,7400 07015 TC SQRTDIV # GO TO FORM DP QUOTIENT OF A0/2, A1/2
002849,000958: 03,7401 30100 XCH TEM3 # OVER X1, 0. RESULT IN MPAC, MPAC +1
002850,000959: 03,7402 25777 INDEX OPOVF
002851,000960: 03,7403 44521 MP HALF
002852,000961: 03,7404 60114 AD MPAC
002853,000962: 03,7405 50034 TS OVCTR # AND MAYBE SKIP, IF ARG WAS NEAR POSMAX
002854,000963: 03,7406 07412 TC +4 # IF NO OVERFLOW
002855,000964: 03,7407 34476 CAF POSMAX
002856,000965: 03,7410 50115 TS MPAC +1
002857,000966: 03,7411 07416 TC +5
002858,000967:
002859,000968: 03,7412 30003 +4 XCH LP # FOR NORMAL CASES
002860,000969: 03,7413 60115 AD MPAC +1 # ABOVE AND X1/2
002861,000970: 03,7414 30115 XCH MPAC +1
002862,000971: 03,7415 30034 XCH OVCTR
002863,000972: 03,7416 50114 +5 TS MPAC
002864,000973:
002865,000974: 03,7417 35500 CAF ZERO # ZERO MPAC+2 SO SHIFT LEFT MAKES SENSE.
002866,000975: 03,7420 50116 TS MPAC +2
002867,000976:
002868,000977: 03,7421 10061 CCS ADDRWD # RE-NORMALIZE IF COUNT NON-ZERO
002869,000978: 03,7422 06236 TC SHIFTR +3 # FITS IN WITH MAIN SHIFT LOOP
002870,000979: 03,7423 00103 TC TEMQ2 # NO RE-SCALING REQUIRED
002871,000980:
002872,000981: 03,7424 40064 SQRTS CS MODE # INTERPRETER LINKAGE
002873,000982: 03,7425 60000 DOUBLE # TAKE APPROPRIATE SQRT
002874,000983: 03,7426 20000 INDEX A
002875,000984: 03,7427 07426 TC -1
002876,000985:
002877,000986: 03,7430 07276 TC SQRT2 # FOR DP
002878,000987: 03,7431 04024 TC DANZIG
002879,000988:
002880,000989: 03,7432 07300 TC SQRT3
002881,000990: 03,7433 04024 TC DANZIG
002882,000991:
002883,000992: 03,7434 4024 DMOVE EQUALS DANZIG # LOADING ONLY
002884,000993: 03,7434 4024 VMOVE EQUALS DANZIG
002885,000994: 03,7434 45502 TMOVE CS TWO # SET MODE TO TRIPLE FOR TP OPERATIONS
002886,000995: 03,7435 05237 TC DPEXIT +1
End of include-file BANK_03_INTERPRETER_SECTION.agc. Parent file is MAIN.agc