Source Code

These source-code files are part of a reconstructed copy of Aurora 88, the final release of the Lunar Module (LM) Apollo Guidance Computer (AGC) system test software.

They have been created via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-011, 2003972-091, and 2003972-111, belonging to Steve Jurvetson.

Since only binary dumps (rather than listings) of Aurora 88 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.

004307,000002:                                                                                                  ## Copyright:   Public domain.
004308,000003:                                                                                                  ## Filename:    SINGLE_PRECISION_SUBROUTINES.agc
004309,000004:                                                                                                  ## Purpose:     A section of Aurora 88.
004310,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
004311,000006:                                                                                                  ##              release of the Lunar Module system test software. No original
004312,000007:                                                                                                  ##              listings of this program are available; instead, this file
004313,000008:                                                                                                  ##              was created via disassembly of dumps of Aurora 88 core rope
004314,000009:                                                                                                  ##              modules and comparison with other AGC programs.
004315,000010:                                                                                                  ## Assembler:   yaYUL
004316,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
004317,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
004318,000013:                                                                                                  ## Mod history: 2023-06-30 MAS  Created from Aurora 12.
004319,000014:                                                                                                  ##              2023-07-12 MAS  Updated for Aurora 88.
004320,000015: 
004321,000016: 
004322,000017:    4150                                           SETLOC   ENDIBNKF                              
004323,000018: 
004324,000019:                                                                                                  #  SINGLE PRECISION SINE AND COSINE
004325,000020: 
004326,000021:    4150           67635        SPCOS              AD       HALF                                  #  ARGUMENTS SCALED AT PI
004327,000022:    4151           55106        SPSIN              TS       TEMK                                  
004328,000023:    4152           14154                           TCF      SPT                                   
004329,000024:    4153           41106                           CS       TEMK                                  
004330,000025:    4154           60000        SPT                DOUBLE                                         
004331,000026:    4155           55106                           TS       TEMK                                  
004332,000027:    4156           14171                           TCF      POLLEY                                
004333,000028:    4157           57106                           XCH      TEMK                                  
004334,000029:    4160           51106                           INDEX    TEMK                                  
004335,000030:    4161           67633                           AD       LIMITS                                
004336,000031:    4162           40000                           COM                                            
004337,000032:    4163           61106                           AD       TEMK                                  
004338,000033:    4164           55106                           TS       TEMK                                  
004339,000034:    4165           14171                           TCF      POLLEY                                
004340,000035:    4166           50000                           INDEX    A                                     
004341,000036:    4167           37634                           CA       LIMITS     +1                         
004342,000037:    4170           00002                           TC       Q                                     
004343,000038:    4171           00006        POLLEY             EXTEND                                         
004344,000039:    4172           71106                           MP       TEMK                                  
004345,000040:    4173           55107                           TS       SQ                                    
004346,000041:    4174           00006                           EXTEND                                         
004347,000042:    4175           74207                           MP       C5/2                                  
004348,000043:    4176           64206                           AD       C3/2                                  
004349,000044:    4177           00006                           EXTEND                                         
004350,000045:    4200           71107                           MP       SQ                                    
004351,000046:    4201           64205                           AD       C1/2                                  
004352,000047:    4202           00006                           EXTEND                                         
004353,000048:    4203           71106                           MP       TEMK                                  
004354,000049:    4204           00002                           TC       Q                                     #  RESULT SCALED AT 1
004355,000050:    4205           31103        C1/2               DEC      .7853134                              
004356,000051:    4206           65552        C3/2               DEC      -.3216146                             
004357,000052:    4207           01124        C5/2               DEC      .0363551                              
004358,000053:                                                                                                  #  ENTER WITH ARGUMENT IN A, EXIT WITH ROOT IN A.  IF GIVEN A NEGATIVE ARGUMENT, THE RETURN SKIPS WITH CCS RESULT.
004359,000054:                                                                                                  #  MINUS ZERO RETURNS LIKE PLUS ZERO.
004360,000055:                                                                                                  #  MAXIMUM ERROR IN ANSWER IS NO GREATER THAN 2 BITS.
004361,000056:                                                                                                  #  INTERRUPT PROGRAMS USING SPROOT MUST SAVE AND RESTORE SR.
004362,000057: 
004363,000058: 
004364,000059: 
004365,000060:    4210           55110        SPROOT             TS       SQRARG                                #  ENTER WITH C(A) = Y
004366,000061:    4211           10000                           CCS      A                                     
004367,000062:    4212           14216                           TCF      POSARG                                #  IF PNZ, CONTINUE
004368,000063:    4213           00002                           TC       Q                                     #  RETURN WITH 0 FOR +0
004369,000064:    4214           24002                           INCR     Q                                     
004370,000065:    4215           00002                           TC       Q                                     #  RETURN WITH 0 FOR -0
004371,000066: 
004372,000067:    4216           00006        POSARG             EXTEND                                         
004373,000068:    4217           23107                           QXCH     ROOTRET                               #  WILL BE CALLING SPROOT1
004374,000069:    4220           64275                           AD       63/64+1                               #  B(A) = Y - 1
004375,000070:    4221           54000                           OVSK                                           
004376,000071:    4222           14264                           TCF      SPROOT2                               
004377,000072:    4223           57110                           XCH      SQRARG                                #  ARG JUGGLING
004378,000073: 
004379,000074:    4224           55110        SPROOT3            TS       SQRARG                                
004380,000075:    4225           54021                           TS       SR                                    #  C(A) = Y
004381,000076:    4226           56021                           XCH      SR                                    #  (LOSE 1 BIT)
004382,000077:    4227           55106                           TS       HALFY                                 #  HALFY = Y/2
004383,000078:    4230           64273                           AD       -1/8                                  #  FORM Y/2 - 1/8
004384,000079:    4231           10000                           CCS      A                                     #  TEST FOR FIRST GUESS
004385,000080:    4232           64274                           AD       5/8+1                                 #  Y .G. 1/4, X = Y/2 + 1/2
004386,000081:    4233           04240                           TC       HIGUESS                               #  +0 IMPOSSIBLE FROM ADDITION
004387,000082:    4234           14235                           NOOP                                           #  Y .LE. 1/4, X/2 = Y + 1/16
004388,000083:    4235           37640                           CAF      BIT11                                 #  1/16
004389,000084:    4236           61110                           AD       SQRARG                                #  SQRARG = Y
004390,000085:    4237           60000                           DOUBLE                                         #  X FROM X/2
004391,000086:    4240           04253        HIGUESS            TC       SPROOT1                               
004392,000087:    4241           04253                           TC       SPROOT1                               #  ITERATE TWICE
004393,000088:    4242           57107                           XCH      ROOTRET                               #  SAVE ANSWER AND GET Q
004394,000089:    4243           10000                           CCS      A                                     
004395,000090:    4244           57107                           XCH      ROOTRET                               #  NO SHIFT NEEDED
004396,000091:    4245           04251                           TC       ROOTBCK                               
004397,000092:    4246           57107                           XCH      ROOTRET                               #  Q NEG, SHIFT RIGHT THREE
004398,000093:    4247           00006                           EXTEND                                         
004399,000094:    4250           77637                           MP       BIT12                                 #  EXP -3
004400,000095:    4251           51107        ROOTBCK            INDEX    ROOTRET                               #  ROOTRET = Q - 1
004401,000096:    4252           00001                           TC       1                                     #  RETURN, C(A) = SQRT(Y)
004402,000097: 
004403,000098:    4253           56021        SPROOT1            XCH      SR                                    #  SR = X/2
004404,000099:    4254           41106                           CS       HALFY                                 #  NEWTON ITER  X = X/2 + (Y/2 / X/2) / 2
004405,000100:    4255           22007                           ZL                                             
004406,000101:    4256           00006                           EXTEND                                         
004407,000102:    4257           10021                           DV       SR                                    #  C(SR) = X/2 DV DOES NOT EDIT
004408,000103:    4260           56021                           XCH      SR                                    
004409,000104:    4261           00006                           EXTEND                                         
004410,000105:    4262           60021                           SU       SR                                    
004411,000106:    4263           00002                           TC       Q                                     #  C(A) = X (NEXT)
004412,000107: 
004413,000108:    4264           41107        SPROOT2            CS       ROOTRET                               #  SET RETURN Q NEG, AS FLAG
004414,000109:    4265           55107                           TS       ROOTRET                               
004415,000110:    4266           37644                           CAF      BIT7                                  #  SHIFT FOR SIGNIFCANCE
004416,000111:    4267           00006                           EXTEND                                         
004417,000112:    4270           71110                           MP       SQRARG                                
004418,000113:    4271           30001                           CA       L                                     #  B(A) = 0
004419,000114:    4272           04224                           TC       SPROOT3                               
004420,000115: 
004421,000116:    4273           73777        -1/8               OCTAL    73777                                 
004422,000117:    4274           24001        5/8+1              OCTAL    24001                                 
004423,000118:    4275           37401        63/64+1            OCTAL    37401                                 
004424,000119: 
004425,000120: 
004426,000121: 
004427,000122:    4276                        ENDSUBSF           EQUALS                                         

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