Source Code
![]() |
These source-code files were obtained by digitally photographing
an Artemis 72 program listing from a private collection and then
modifying pre-existing Comanche 55 (Apollo 11) source files to
incorporate changes. Note that the page images
presented online are of reduced quality, and that additional images
may be available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:GAP: ASSEMBLE REVISION 072 OF AGC PROGRAM ARTEMIS BY NASA 2021114-011 11:40 FEB. 26, 1971 THIS AGC PROGRAM SHALL ALSO BE REFERRED TO AS COLOSSUS 3 THIS PROGRAM IS INTENDED FOR USE IN THE CM AS SPECIFIED IN REPORT R-577. THIS PROGRAM WAS PREPARED UNDER OSR PROJECT 55-23890, SPONSORED BY THE MANNED SPACECRAFT CENTER OF THE NATIONAL AERONAUTICS AND SPACE ADMINISTRATION THROUGH CONTRACT NAS 9-4065 WITH THE CHARLES STARK DRAPER LABORATORY, MASSACHUSETTS INSTITUTE OF TECHNOLOGY, CAMBRIDGE, MASS. |
063227,000002: # Copyright: Public domain.
063228,000003: # Filename: SERVICE_ROUTINES.agc
063229,000004: # Purpose: Part of the source code for Artemis (i.e., Colossus 3),
063230,000005: # build 072. This is for the Command Module's (CM)
063231,000006: # Apollo Guidance Computer (AGC), we believe for
063232,000007: # Apollo 15-17.
063233,000008: # Assembler: yaYUL
063234,000009: # Contact: Jim Lawton <jim DOT lawton AT gmail DOT com>
063235,000010: # Website: www.ibiblio.org/apollo/index.html
063236,000011: # Page scans: www.ibiblio.org/apollo/ScansForConversion/Artemis072/
063237,000012: # Mod history: 2009-08-18 JL Adapted from corresponding Comanche 055 file.
063238,000013: # 2010-02-01 JL Fixed build error: missing code at end.
063239,000014: # 2010-02-07 JL Removed spurious NDX instruction on p1478.
063240,000015: # 2010-02-20 RSB Un-##'d this header.
063241,000016:
![]() |
Page 1478 |
063243,000018:
063244,000019: 10,2000 SETLOC DISPLAYS
063245,000020: 10,2000 BANK
063246,000021: 10,3755 COUNT* $$/DSPLA
063247,000022: 10,3755 54001 UPENT2 TS L
063248,000023: 10,3756 40100 CS FLAGWRD4
063249,000024: 10,3757 70001 MASK L
063250,000025: 10,3760 26100 ADS FLAGWRD4
063251,000026: 10,3761 00002 TC Q # RETURN
063252,000027:
063253,000028: 10,3762 40000 DOWNENT2 COM # START TO PROCESS THE INFORMATION
063254,000029: 10,3763 70100 MASK FLAGWRD4
063255,000030: 10,3764 54100 TS FLAGWRD4
063256,000031: 10,3765 00002 TC Q # RETURN
063257,000032:
063258,000033: 10,3766 4774 OCT7 EQUALS SEVEN
063259,000034:
![]() |
Page 1479 |
063261,000036:
063262,000037: # UPFLAG AND DOWNFLAG ARE ENTIRELY GENERAL FLAG SETTING AND CLEARING SUBROUTINES. USING THEM, WHETHER OR
063263,000038: # NOT IN INTERRUPT, ONE MAY SET OR CLEAR ANY SINGLE, NAMED BIT IN ANY ERASABLE REGISTER, SUBJECT OF COURSE TO
063264,000039: # EBANK SETTING. A "NAMED" BIT, AS THE WORD IS USED HERE, IS ANY BIT WITH A NAME FORMALLY ASSIGNED BY THE YUL
063265,000040: # ASSEMBLER.
063266,000041:
063267,000042: # AT PRESENT THE ONLY NAMED BITS ARE THOSE IN THE FLAGWORDS. ASSEMBLER CHANGES WILL MAKE IT POSSIBLE TO
063268,000043: # NAME ANY BIT IN ERASABLE MEMORY.
063269,000044:
063270,000045: # CALLING SEQUENCES ARE AS FOLLOWS:-
063271,000046: # TC UPFLAG TC DOWNFLAG
063272,000047: # ADRES NAME OF FLAG ADRES NAME OF FLAG
063273,000048:
063274,000049: # RETURN IS TO THE LOCATION FOLLOWING THE "ADRES" ABOUT .58 MS AFTER THE "TC".
063275,000050: # UPON RETURN A CONTAINS THE CURRENT FLAGWRD SETTING.
063276,000051:
063277,000052: 4000 SETLOC FFTAG1
063278,000053: 4000 BANK
063279,000054: 5547 COUNT* $$/FLAG
063280,000055:
063281,000056: 5547 30002 UPFLAG CA Q
063282,000057: 5550 05565 TC DEBIT
063283,000058: 5551 40000 COM # +(15 - BIT)
063284,000059: 5552 00006 EXTEND
063285,000060: 5553 04001 ROR LCHAN # SET BIT
063286,000061: 5554 50061 COMFLAG INDEX ITEMP1
063287,000062: 5555 54074 TS FLAGWRD0
063288,000063: 5556 22063 LXCH ITEMP3
063289,000064: 5557 00003 RELINT
063290,000065: 5560 00001 TC L
063291,000066:
063292,000067: 5561 30002 DOWNFLAG CA Q
063293,000068: 5562 05565 TC DEBIT
063294,000069: 5563 70001 MASK L # RESET BIT
063295,000070: 5564 15554 TCF COMFLAG
063296,000071:
063297,000072: 5565 64770 DEBIT AD ONE # CET DE BITS
063298,000073: 5566 00004 INHINT
063299,000074: 5567 54063 TS ITEMP3
063300,000075: 5570 34777 CA LOW4 # DEC15
063301,000076: 5571 54061 TS ITEMP1
063302,000077: 5572 50063 INDEX ITEMP3
063303,000078: 5573 27777 CA 0 -1 # ADRES
063304,000079: 5574 54001 TS L
063305,000080: 5575 34772 CA ZERO
063306,000081: 5576 00006 EXTEND
![]() |
Page 1480 |
063308,000083: 5577 10061 DV ITEMP1 # A = FLAGWRD, L = (15 - BIT)
063309,000084: 5600 52062 DXCH ITEMP1
063310,000085: 5601 50061 INDEX ITEMP1
063311,000086: 5602 30074 CA FLAGWRD0
063312,000087: 5603 54001 TS L # CURRENT STATE
063313,000088: 5604 50062 INDEX ITEMP2
063314,000089: 5605 44752 CS BIT15 # -(15 - BIT)
063315,000090: 5606 00002 TC Q
063316,000091:
![]() |
Page 1481 |
063318,000093:
063319,000094: # DELAYJOB - A GENERAL ROUTINE TO DELAY A JOB A SPECIFIC AMOUNT OF TIME BEFORE PICKING UP AGAIN.
063320,000095:
063321,000096: # ENTRANCE REQUIREMENTS ...
063322,000097: # CAF DT # DELAY JOB FOR DT CENTISECS
063323,000098: # TC BANKCALL
063324,000099: # CADR DELAYJOB
063325,000100:
063326,000101: 00,2000 SETLOC DLAYJOB
063327,000102: 00,2000 BANK
063328,000103:
063329,000104: # THIS MUST REMAIN IN BANK 0 ****************************************
063330,000105: 00,3730 COUNT* $$/DELAY
063331,000106: 00,3730 35016 1SECDELY CAF 1SEC
063332,000107: 00,3731 00004 DELAYJOB INHINT
063333,000108: 00,3732 54002 TS Q # STORE DELAY DT IN Q FOR DLY -1 IN
063334,000109:
063335,000110: 00,3733 36214 CAF DELAYNUM # WAITLIST
063336,000111: 00,3734 54070 DELLOOP TS RUPTREG1
063337,000112: 00,3735 50000 INDEX A
063338,000113: 00,3736 31000 CA DELAYLOC # IS THIS DELAYLOC AVAILABLE
063339,000114: 00,3737 00006 EXTEND
063340,000115: 00,3740 13745 BZF OK2DELAY # YES
063341,000116:
063342,000117: 00,3741 10070 CCS RUPTREG1 # NO, TRY NEXT DELAYLOC
063343,000118: 00,3742 13734 TCF DELLOOP
063344,000119:
063345,000120: 00,3743 07706 TC BAILOUT # NO AVAILABLE LOCS.
063346,000121: 00,3744 31104 OCT 31104
063347,000122:
063348,000123: 00,3745 33765 OK2DELAY CA TCSLEEP # SET WAITLIST IMMEDIATE RETURN
063349,000124: 00,3746 54061 TS WAITEXIT
063350,000125:
063351,000126: 00,3747 30004 CA FBANK
063352,000127: 00,3750 60070 AD RUPTREG1 # STORE BBANK FOR TASK CALL
063353,000128: 00,3751 54001 TS L
063354,000129:
063355,000130: 00,3752 33766 CAF WAKECAD # STORE CADR FOR TASK CALL
063356,000131: 00,3753 15243 TCF DLY2 -1 # DLY IS IN WAITLIST ROUTINE
063357,000132:
063358,000133: 00,3754 04665 TCGETCAD TC MAKECADR # GET CALLERS FCADR
063359,000134:
063360,000135: 00,3755 50070 INDEX RUPTREG1
063361,000136: 00,3756 55000 TS DELAYLOC # SAVE DELAY CADRS
063362,000137:
063363,000138: 00,3757 05163 TC JOBSLEEP
063364,000139:
063365,000140: 00,3760 34772 WAKER CAF ZERO
063366,000141: 00,3761 50006 INDEX BBANK
063367,000142: 00,3762 57000 XCH DELAYLOC # MAKE DELAYLOC AVAILABLE
063368,000143: 00,3763 05167 TC JOBWAKE
![]() |
Page 1482 |
063370,000145: 00,3764 05314 TC TASKOVER
063371,000146:
063372,000147: 00,3765 03752 TCSLEEP GENADR TCGETCAD -2
063373,000148: 00,3766 03760 WAKECAD GENADR WAKER
063374,000149:
![]() |
Page 1483 |
063376,000151:
063377,000152: # GENTRAN, A BLOCK TRANSFER ROUTINE
063378,000153:
063379,000154: # WRITTEN BY D. EYLES
063380,000155: # MOD 1 BY KERNAN UTILITYM REV 17 11/18/67
063381,000156:
063382,000157: # MOD 2 BY SCHULENBERG (REMOVE RELINT) SKIPPER REV 4 2/28/68
063383,000158:
063384,000159: # THIS ROUTINE IS USEFUL FOR TRANSFERRING N CONSECUTIVE ERASABLE OR FIXED QUANTITIES TO SOME OTHER N
063385,000160: # CONSECUTIVE ERASABLE LOCATIONS. IF BOTH BLOCKS OF DATA ARE IN SWITCHABLE EBANKS, THEY MUST BE IN THE SAME ONE.
063386,000161:
063387,000162: # GENTRAN IS CALLABLE IN A JOB AS WELL AS A RUPT. THE CALLING SEQUENCE IS:
063388,000163:
063389,000164: # I CA N-1 # # OF QUANTITIES MINUS ONE.
063390,000165: # I +1 TC GENTRAN # IN FIXED-FIXED.
063391,000166: # I +2 ADRES L # STARTING ADRES OF DATA TO BE MOVED.
063392,000167: # I +3 ADRES M # STARTING ADRES OF DUPLICATION BLOCK.
063393,000168: # I +4 # RETURNS HERE.
063394,000169:
063395,000170: # GENTRAN TAKES 25 MCT'S (300 MICROSECONDS) PER ITEM + 5 MCT'S (60 MICS) FOR ENTERING AND EXITING.
063396,000171:
063397,000172: # A, L, AND ITEMP1 ARE NOT PRESERVED.
063398,000173:
063399,000174: 4000 SETLOC FFTAG4
063400,000175: 4000 BANK
063401,000176:
063402,000177: 5607 0061 EBANK= ITEMP1
063403,000178:
063404,000179: 5607 COUNT* $$/TRAN
063405,000180:
063406,000181: 5607 00004 GENTRAN INHINT
063407,000182: 5610 54061 +1 TS ITEMP1 # SAVE N-1
063408,000183: 5611 50002 INDEX Q # C(Q) = ADRES L.
063409,000184: 5612 60000 AD 0 # ADRES (L + N - 1).
063410,000185: 5613 50000 INDEX A
063411,000186: 5614 30000 CA 0 # C(ABOVE).
063412,000187: 5615 54001 TS L # SAVE DATA.
063413,000188: 5616 30061 CA ITEMP1
063414,000189: 5617 50002 INDEX Q
063415,000190: 5620 60001 AD 1 # ADRES (M + N - 1).
063416,000191: 5621 50000 INDEX A
063417,000192: 5622 22000 LXCH 0 # STUFF IT.
063418,000193: 5623 10061 CCS ITEMP1 # LOOP UNTIL N-1 = 0.
063419,000194: 5624 15610 TCF GENTRAN +1
063420,000195: 5625 16710 TCF Q+2 # RETURN TO CALLER.
063421,000196:
![]() |
Page 1484 |
063423,000198:
063424,000199: # B5OFF ZERO BIT 5 OF EXTVBACT, WHICH IS SET BY TESTXACT.
063425,000200: # MAY BE USED AS NEEDED BY ANY EXTENDED VERB WHICH HAS DONE TESTXACT
063426,000201:
063427,000202: 5626 COUNT* $$/EXTVB
063428,000203:
063429,000204: 5626 44764 B5OFF CS BIT5
063430,000205: 5627 71247 MASK EXTVBACT
063431,000206: 5630 55247 TS EXTVBACT
063432,000207: 5631 05205 TC ENDOFJOB
063433,000208:
![]() |
Page 1485 |
063435,000210:
063436,000211: # SUBROUTINES TO TURN OFF AND TURN ON TRACKER FAIL LIGHT.
063437,000212:
063438,000213: 5632 COUNT* $$/DSPLA
063439,000214: 5632 00004 TRFAILOF INHINT
063440,000215: 5633 47670 CS OCT40200 # TURN OFF TRACKER LIGHT
063441,000216: 5634 71241 MASK DSPTAB +11D
063442,000217: 5635 64752 AD BIT15
063443,000218: 5636 55241 TS DSPTAB +11D
063444,000219: 5637 41337 CS OPTMODES # TO INSURE THAT OCDU FAIL WILL GO ON
063445,000220: 5640 74762 MASK OCDUFBIT # AGAIN IF IT WAS ON IN ADDITION TO
063446,000221: 5641 27337 ADS OPTMODES # TRACKER FAIL.
063447,000222:
063448,000223: 5642 00003 REQ RELINT
063449,000224: 5643 00002 TC Q
063450,000225:
063451,000226: 5644 00004 TRFAILON INHINT
063452,000227: 5645 41241 CS DSPTAB +11D # TURN ON
063453,000228: 5646 77670 MASK OCT40200
063454,000229: 5647 27241 ADS DSPTAB +11D
063455,000230: 5650 15642 TCF REQ
063456,000231:
063457,000232: 5651 10000 INCRQCK CCS A
063458,000233: 5652 24002 INCR Q
063459,000234: 5653 00002 TC Q
063460,000235: 5654 COUNT* $$/CFAIL
063461,000236: 5654 54001 C31BTCHK TS L # SAVE MASK
063462,000237: 5655 30374 CA C31FLWRD
063463,000238: 5656 74346 MASK FAILBIT
063464,000239: 5657 10000 CCS A
063465,000240: 5660 15667 TCF USEFLBTS
063466,000241: 5661 00006 EXTEND
063467,000242: 5662 00031 READ CHAN31
063468,000243: 5663 70001 C31CMCHK MASK L
063469,000244: 5664 00006 EXTEND
063470,000245: 5665 16711 BZF TCQ # BITS SET
063471,000246: 5666 16706 TCF Q+1 # BITS NOT SET
063472,000247:
063473,000248: 5667 30374 USEFLBTS CA C31FLWRD
063474,000249: 5670 15663 TCF C31CMCHK
063475,000250:
063476,000251: 5671 4346 FAILBIT = PRIO30
063477,000252:
End of include-file SERVICE_ROUTINES.agc. Parent file is MAIN.agc