Source Code
These source-code files are part of a reconstructed copy of Skylark 048, the
Block II Command Module (CM) Apollo Guidance Computer (AGC) software for the
Skylab-2, Skylab-3, Skylab-4, and Apollo-Soyuz Test Project missions.
They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on Skylab-2, part numbers 2010802-541, 2010802-551, 2010802-561, 2010802-571, 2010802-581, and 2010802-591. Access to these modules was provided by the New Mexico Museum of Space History, who we are much indebted to. The source code for the Apollo 15, 16, and 17 software, Artemis 072, was used as a starting point. Heavy use was made of TRW 4900.5-244, Programmed Guidance Equations for Skylark Command Module Earth Orbital Program, dated 14 February 1972. This document contains pseudocode of essentially all of Skylark, using original program labels which have been copied for this source reconstruction. Since only binary dumps (rather than listings) of Skylark are available as source material, all comments and labels are approximate. They have been taken from the Programmed Guidance Equations or other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
018015,000002: ## Copyright: Public domain.
018016,000003: ## Filename: SYSTEM_TEST_STANDARD_LEAD_INS.agc
018017,000004: ## Purpose: A section of Skylark revision 048.
018018,000005: ## It is part of the source code for the Apollo Guidance Computer (AGC)
018019,000006: ## for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
018020,000007: ## this software are available; instead, this file was created via
018021,000008: ## disassembly of dumps of the core rope modules actually flown on
018022,000009: ## Skylab-2. Access to these modules was provided by the New Mexico
018023,000010: ## Museum of Space History.
018024,000011: ## Assembler: yaYUL
018025,000012: ## Contact: Ron Burkey <info@sandroid.org>.
018026,000013: ## Website: www.ibiblio.org/apollo/index.html
018027,000014: ## Mod history: 2023-09-04 MAS Created from Artemis 072.
018028,000015:
018029,000016:
018030,000017: 22,3237 E5,1660 EBANK= XSM
018031,000018:
018032,000019: 12,2000 SETLOC E/PROG1
018033,000020: 12,2000 BANK
018034,000021:
018035,000022: 12,2000 COUNT* $$/P07
018036,000023:
018037,000024: # SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
018038,000025:
018039,000026: # E/BKCALL FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
018040,000027:
018041,000028: # THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED. LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
018042,000029: # IS NOT POSSIBLE.
018043,000030:
018044,000031: # THE CALLING SEQUENCE IS:
018045,000032:
018046,000033: # TC BANKCALL
018047,000034: # CADR E/BKCALL
018048,000035: # CADR ROUTINE WHERE YOU WANT TO GO IN FIXED.
018049,000036: # RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
018050,000037: # RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
018051,000038: # RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
018052,000039:
018053,000040: # THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
018054,000041: # OTHER EMEMORY PROGRAMS.
018055,000042:
018056,000043: # A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
018057,000044:
018058,000045: 12,2000 52134 E/BKCALL DXCH BUF2 # SAVE A,L AND GET DP RETURN.
018059,000046: 12,2001 53332 DXCH EBUF2 # SAVE DP RETURN.
018060,000047: 12,2002 25331 INCR EBUF2 # RETURN +1 BECAUSE DOUBLE CADR.
018061,000048: 12,2003 30006 CA BBANK
018062,000049: 12,2004 75053 MASK LOW10 # GET CURRENT EBANK. (SBANK SOMEDAY)
018063,000050: 12,2005 27332 ADS EBUF2 +1 # FORM BBCON. (WAS FBANK)
018064,000051: 12,2006 51331 NDX EBUF2
018065,000052: 12,2007 27777 CA 0 -1 # GET CADR OF ROUTINE.
018066,000053: 12,2010 04653 TC SWCALL # GO TO ROUTINE, SETTING Q TO SWRETURN
018067,000054: # AND RESTORING A + L.
018068,000055: 12,2011 02015 TC +4 # TX Q, V34, OR BAD STALL RETURN.
018069,000056: 12,2012 02014 TC +2 # PROCEED OR GOOD STALL RETURN.
018070,000057: 12,2013 25331 INCR EBUF2 # ENTER OR RECYCLE RETURN.
018071,000058: 12,2014 25331 INCR EBUF2
018072,000059: 12,2015 53332 E/SWITCH DXCH EBUF2
018073,000060: 12,2016 52006 DTCB
018074,000061:
018075,000062: # E/CALL FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
018076,000063:
018077,000064: # THE CALLING SEQUENCE IS...
018078,000065:
018079,000066: # RTB
018080,000067: # E/CALL
018081,000068: # CADR ROUTINE THE INTERPRETIVE SUBROUTINE YOU WANT.
018082,000069: # RETURNS HERE IN INTERPRETIVE.
018083,000070:
018084,000071: 12,2017 22164 E/CALL LXCH LOC # ADRES -1 OF CADR.
018085,000072: 12,2020 50001 INDEX L
018086,000073: 12,2021 30001 CA L # CADR IN A.
018087,000074: 12,2022 24001 INCR L
018088,000075: 12,2023 24001 INCR L # RETURN ADRES IN L.
018089,000076: 12,2024 53332 DXCH EBUF2 # STORE CADR AND RETURN.
018090,000077: 12,2025 06006 TC INTPRET
018091,000078: 12,2026 77624 CALL
018092,000079: 12,2027 01331 EBUF2 # INDIRECTLY EXECUTE ROUTINE. IT MUST
018093,000080: 12,2030 77776 EXIT # LEAVE VIA RVQ OR EQUIVALENT.
018094,000081: 12,2031 23332 LXCH EBUF2 +1 # PICK UP RETURN.
018095,000082: 12,2032 16010 TCF INTPRET +2 # SET LOC AND RETURB TO CALLER
018096,000083:
018097,000084: # E/JOBWAK FOR WAKING UP ERASABLE MEMORY JOBS.
018098,000085:
018099,000086: # THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
018100,000087:
018101,000088: # THE CALLING SEQUENCE IS:
018102,000089:
018103,000090: # INHINT
018104,000091: # .
018105,000092: # .
018106,000093: # CA WAKEADR ADDRESS OF SLEEPING JOB
018107,000094: # TC IBNKCALL
018108,000095: # CADR E/JOBWAK
018109,000096: # . RETURNS HERE
018110,000097: # .
018111,000098: # .
018112,000099: # RELINT IF YOU DID AN INHINT.
018113,000100:
018114,000101: 12,2000 SETLOC E/PROG
018115,000102: 12,2000 BANK
018116,000103:
018117,000104: 12,2033 COUNT* $$/P07
018118,000105:
018119,000106: 12,2033 05202 E/JOBWAK TC JOBWAKE # ARRIVE IWTH ADRES IN A.
018120,000107: 12,2034 44767 CS BIT11
018121,000108: 12,2035 50064 NDX LOCCTR
018122,000109: 12,2036 26164 ADS LOC # KNOCK FIXED MEMORY BIT OUT OF ADRES.
018123,000110: 12,2037 00072 TC RUPTREG3 # RETURN
018124,000111:
018125,000112:
018126,000113: # THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
018127,000114: # PRELAUNCH ALIGN. THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
018128,000115:
018129,000116:
018130,000117: 33,2000 SETLOC TESTLEAD
018131,000118: 33,2000 BANK
018132,000119:
018133,000120: 33,2000 COUNT* $$/COMST
018134,000121: 33,2000 E5,1425 EBANK= QPLACE
018135,000122:
018136,000123: 33,2000 03231 COMPVER TC GCOMPVER # MUST BE 33,2000.
018137,000124:
018138,000125: 33,2001 02722 GTSCPSS1 TC GTSCPSS # MUST BE AT 33,2001
End of include-file SYSTEM_TEST_STANDARD_LEAD_INS.agc. Parent file is MAIN.agc