Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of BURST120 (SUNBURST 120). They were scanned at archive.org's Boston facility, and the scanning was sponsored by Mike Stewart. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are in ALL-CAPS, whereas comments added later in transcription are in Mixed-Case. In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the BURST120 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: REVISION 0 OF PROGRAM BURST120 
	BY NASA 2021106-031 DEC 7, 1967

	THIS LISTING IS A COPY OF A VERSION OF THE PROGRAM INTENDED 
	FOR USE IN THE ON-BOARD PRIMARY GUIDANCE COMPUTER IN THE 
	UNMANNED FLIGHT OF APOLLO LUNAR MODULE 1 --- THE AS206 MISSION.
Note that the date is the date of the printout, not the date of the program revision.

044029,000002:                                                                                                  ## Copyright:   Public domain.
044030,000003:                                                                                                  ## Filename:    SINGLE_PRECISION_SUBROUTINES.agc
044031,000004:                                                                                                  ## Purpose:     A module for revision 0 of BURST120 (Sunburst). It 
044032,000005:                                                                                                  ##              is part of the source code for the Lunar Module's
044033,000006:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 5.
044034,000007:                                                                                                  ## Assembler:   yaYUL
044035,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
044036,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
044037,000010:                                                                                                  ## Mod history: 2016-09-30 RSB  Created draft version.
044038,000011:                                                                                                  ##              2016-10-19 RSB  Transcribed ... I think it's identical to the 
044039,000012:                                                                                                  ##                              Aurora 12 version.
044040,000013:                                                                                                  ##              2016-12-06 RSB  Comments proofed using octopus/ProoferComments,
044041,000014:                                                                                                  ##                              no changes made.
044042,000015: 

Page 1046

044044,000017:    5354                                           BLOCK    02                                    
044045,000018:                                                                                                  #  SINGLE PRECISION SINE AND COSINE
044046,000019: 
044047,000020:    5354           67746        SPCOS              AD       HALF                                  #  ARGUMENTS SCALED AT PI
044048,000021:    5355           55130        SPSIN              TS       TEMK                                  
044049,000022:    5356           15360                           TCF      SPT                                   
044050,000023:    5357           41130                           CS       TEMK                                  
044051,000024:    5360           60000        SPT                DOUBLE                                         
044052,000025:    5361           55130                           TS       TEMK                                  
044053,000026:    5362           15373                           TCF      POLLEY                                
044054,000027:    5363           57130                           XCH      TEMK                                  
044055,000028:    5364           51130                           INDEX    TEMK                                  
044056,000029:    5365           67744                           AD       LIMITS                                
044057,000030:    5366           40000                           COM                                            
044058,000031:    5367           61130                           AD       TEMK                                  
044059,000032:    5370           55130                           TS       TEMK                                  
044060,000033:    5371           15373                           TCF      POLLEY                                
044061,000034:    5372           15411                           TCF      ARG90                                 
044062,000035:    5373           00006        POLLEY             EXTEND                                         
044063,000036:    5374           71130                           MP       TEMK                                  
044064,000037:    5375           55131                           TS       SQ                                    
044065,000038:    5376           00006                           EXTEND                                         
044066,000039:    5377           75416                           MP       C5/2                                  
044067,000040:    5400           65415                           AD       C3/2                                  
044068,000041:    5401           00006                           EXTEND                                         
044069,000042:    5402           71131                           MP       SQ                                    
044070,000043:    5403           65414                           AD       C1/2                                  
044071,000044:    5404           00006                           EXTEND                                         
044072,000045:    5405           71130                           MP       TEMK                                  
044073,000046:    5406           20001                           DDOUBL                                         
044074,000047:    5407           55130                           TS       TEMK                                  
044075,000048:    5410           00002                           TC       Q                                     
044076,000049:    5411           50000        ARG90              INDEX    A                                     
044077,000050:    5412           47744                           CS       LIMITS                                
044078,000051:    5413           00002                           TC       Q                                     #  RESULT SCALED AT 1
044079,000052:    5414           31103        C1/2               DEC      .7853134                              
044080,000053:    5415           65552        C3/2               DEC      -.3216146                             
044081,000054:    5416           01124        C5/2               DEC      .0363551                              

Page 1047

044083,000056:                                                                                                  #  ENTER WITH ARGUMENT IN A, EXIT WITH ROOT IN A.  IF GIVEN A NEGATIVE ARGUMENT, THE RETURN SKIPS WITH CCS RESULT.
044084,000057:                                                                                                  #  MINUS ZERO RETURNS LIKE PLUS ZERO.
044085,000058:                                                                                                  #  MAXIMUM ERROR IN ANSWER IS NO GREATER THAN 2 BITS.
044086,000059:                                                                                                  #  INTERRUPT PROGRAMS USING SPROOT MUST SAVE AND RESTORE SR.
044087,000060: 
044088,000061: 
044089,000062: 
044090,000063:    5417           55132        SPROOT             TS       SQRARG                                #  ENTER WITH C(A) = Y
044091,000064:    5420           10000                           CCS      A                                     
044092,000065:    5421           15425                           TCF      POSARG                                #  IF PNZ, CONTINUE
044093,000066:    5422           00002                           TC       Q                                     #  RETURN WITH 0 FOR +0
044094,000067:    5423           24002                           INCR     Q                                     
044095,000068:    5424           00002                           TC       Q                                     #  RETURN WITH 0 FOR -0
044096,000069: 
044097,000070:    5425           00006        POSARG             EXTEND                                         
044098,000071:    5426           23131                           QXCH     ROOTRET                               #  WILL BE CALLING SPROOT1
044099,000072:    5427           65504                           AD       63/64+1                               #  B(A) = Y - 1
044100,000073:    5430           54000                           OVSK                                           
044101,000074:    5431           15473                           TCF      SPROOT2                               
044102,000075:    5432           57132                           XCH      SQRARG                                #  ARG JUGGLING
044103,000076: 
044104,000077:    5433           55132        SPROOT3            TS       SQRARG                                
044105,000078:    5434           54021                           TS       SR                                    #  C(A) = Y
044106,000079:    5435           56021                           XCH      SR                                    #  (LOSE 1 BIT)
044107,000080:    5436           55130                           TS       HALFY                                 #  HALFY = Y/2
044108,000081:    5437           65502                           AD       -1/8                                  #  FORM Y/2 - 1/8
044109,000082:    5440           10000                           CCS      A                                     #  TEST FOR FIRST GUESS
044110,000083:    5441           65503                           AD       5/8+1                                 #  Y .G. 1/4, X = Y/2 + 1/2
044111,000084:    5442           05447                           TC       HIGUESS                               #  +0 IMPOSSIBLE FROM ADDITION
044112,000085:    5443           15444                           NOOP                                           #  Y .LE. 1/4, X/2 = Y + 1/16
044113,000086:    5444           37751                           CAF      BIT11                                 #  1/16
044114,000087:    5445           61132                           AD       SQRARG                                #  SQRARG = Y
044115,000088:    5446           60000                           DOUBLE                                         #  X FROM X/2
044116,000089:    5447           05462        HIGUESS            TC       SPROOT1                               
044117,000090:    5450           05462                           TC       SPROOT1                               #  ITERATE TWICE
044118,000091:    5451           57131                           XCH      ROOTRET                               #  SAVE ANSWER AND GET Q
044119,000092:    5452           10000                           CCS      A                                     
044120,000093:    5453           57131                           XCH      ROOTRET                               #  NO SHIFT NEEDED
044121,000094:    5454           05460                           TC       ROOTBCK                               
044122,000095:    5455           57131                           XCH      ROOTRET                               #  Q NEG, SHIFT RIGHT THREE
044123,000096:    5456           00006                           EXTEND                                         
044124,000097:    5457           77750                           MP       BIT12                                 #  EXP -3
044125,000098:    5460           51131        ROOTBCK            INDEX    ROOTRET                               #  ROOTRET = Q - 1
044126,000099:    5461           00001                           TC       1                                     #  RETURN, C(A) = SQRT(Y)
044127,000100: 
044128,000101:    5462           56021        SPROOT1            XCH      SR                                    #  SR = X/2
044129,000102:    5463           41130                           CS       HALFY                                 #  NEWTON ITER  X = X/2 + (Y/2 / X/2) / 2
044130,000103:    5464           22007                           ZL                                             
044131,000104:    5465           00006                           EXTEND                                         
044132,000105:    5466           10021                           DV       SR                                    #  C(SR) = X/2 DV DOES NOT EDIT

Page 1048

044134,000107:    5467           56021                           XCH      SR                                    
044135,000108:    5470           00006                           EXTEND                                         
044136,000109:    5471           60021                           SU       SR                                    
044137,000110:    5472           00002                           TC       Q                                     #  C(A) = X (NEXT)
044138,000111: 
044139,000112:    5473           41131        SPROOT2            CS       ROOTRET                               #  SET RETURN Q NEG, AS FLAG
044140,000113:    5474           55131                           TS       ROOTRET                               
044141,000114:    5475           37755                           CAF      BIT7                                  #  SHIFT FOR SIGNIFCANCE
044142,000115:    5476           00006                           EXTEND                                         
044143,000116:    5477           71132                           MP       SQRARG                                
044144,000117:    5500           30001                           CA       L                                     #  B(A) = 0
044145,000118:    5501           05433                           TC       SPROOT3                               
044146,000119: 
044147,000120:    5502           73777        -1/8               OCTAL    73777                                 
044148,000121:    5503           24001        5/8+1              OCTAL    24001                                 
044149,000122:    5504           37401        63/64+1            OCTAL    37401                                 
044150,000123: 

End of include-file SINGLE_PRECISION_SUBROUTINES.agc.  Parent file is MAIN.agc