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.

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

Page 1046

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

Page 1047

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

Page 1048

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

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