Source Code

These source-code files were obtained by digitally photographing an Artemis 72 (Apollo 15-17 Command Module) program listing from a private collection and then modifying pre-existing Comanche 55 (Apollo 11) source files to incorporate changes. Photography was by Ron Burkey, and transcription was performed by a team of volunteers. 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
Note that the date is the date of the printout, not the date of the program revision.

048235,000002:                                                                                                  ## Copyright:   Public domain.
048236,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
048237,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
048238,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM)
048239,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for
048240,000007:                                                                                                  ##              Apollo 15-17.
048241,000008:                                                                                                  ## Assembler:   yaYUL
048242,000009:                                                                                                  ## Contact:     Jim Lawton <jim DOT lawton AT gmail DOT com>
048243,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
048244,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
048245,000012:                                                                                                  ## Mod history: 2009-08-22 JL   Adapted from corresponding Comanche 055 file.
048246,000013:                                                                                                  ##              2009-08-29 JL   Merged changes from Sergio Navarro.
048247,000014:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
048248,000015:                                                                                                  ##              2011-05-07 JL   Removed workaround.
048249,000016:                                                                                                  ##              2017-02-05 RSB  Proofed comment text by diff'ing vs Comanche 55
048250,000017:                                                                                                  ##                              and corrected errors found.
048251,000018: 

Page 1104

048253,000020: 
048254,000021:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
048255,000022:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE  TC BANKCALL  INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
048256,000023: 
048257,000024:    4000                                           SETLOC   FFTAG1                                
048258,000025:    4000                                           BANK                                           
048259,000026: 
048260,000027:    4636                                           COUNT*   $$/BANK                               
048261,000028:    4636           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
048262,000029:    4637           50002                           INDEX    Q                                     #  PICK UP CADR.
048263,000030:    4640           30000                           CA       0                                     
048264,000031:    4641           24002                 -1        INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
048265,000032: 
048266,000033:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
048267,000034: 
048268,000035:    4642           54001        SWCALL             TS       L                                     
048269,000036:    4643           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
048270,000037:    4644           75041                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
048271,000038:    4645           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
048272,000039:    4646           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
048273,000040:    4647           50002                           INDEX    Q                                     
048274,000041:    4650           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
048275,000042: 
048276,000043:    4651           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
048277,000044:    4652           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
048278,000045:    4653           56134                           XCH      BUF2       +1                         
048279,000046:    4654           00133                           TC       BUF2                                  
048280,000047: 
048281,000048:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
048282,000049:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
048283,000050: 
048284,000051:    4655           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
048285,000052:    4656           50000                           INDEX    A                                     #  GET CADR.
048286,000053:    4657           30000                           CA       0                                     
048287,000054: 
048288,000055:                                                                                                  #  BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
048289,000056: 
048290,000057:    4660           54004        BANKJUMP           TS       FBANK                                 
048291,000058:    4661           75041                           MASK     LOW10                                 
048292,000059:    4662           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
048293,000060:    4663           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
048294,000061:    4664           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF  10000 = 12000
048295,000062: 

Page 1105

048297,000064: 
048298,000065:                                                                                                  #  THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
048299,000066: 
048300,000067:    4665           35041        MAKECADR           CAF      LOW10                                 
048301,000068:    4666           70133                           MASK     BUF2                                  
048302,000069:    4667           60134                           AD       BUF2       +1                         
048303,000070:    4670           00002                           TC       Q                                     
048304,000071: 
048305,000072:    4671           54135        SUPDACAL           TS       MPTEMP                                
048306,000073:    4672           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
048307,000074:    4673           00006                           EXTEND                                         
048308,000075:    4674           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
048309,000076:    4675           56135                           XCH      MPTEMP                                #  SUPERBANK IN BITS 7-5.
048310,000077:    4676           75041                           MASK     LOW10                                 
048311,000078:    4677           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
048312,000079:    4700           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
048313,000080:    4701           00006                           EXTEND                                         
048314,000081:    4702           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
048315,000082:    4703           50001                           INDEX    L                                     
048316,000083:    4704           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
048317,000084:    4705           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
048318,000085:    4706           00006                           EXTEND                                         
048319,000086:    4707           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
048320,000087:    4710           00003                           RELINT                                         
048321,000088:    4711           54004                           TS       FBANK                                 #  RESTORE FBANK.
048322,000089:    4712           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
048323,000090:    4713           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
048324,000091: 

Page 1106

048326,000093: 
048327,000094:                                                                                                  #  THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
048328,000095: 
048329,000096:    4714           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
048330,000097:    4715           50002                           INDEX    Q                                     
048331,000098:    4716           30000                           CAF      0                                     
048332,000099:    4717           24002                           INCR     Q                                     
048333,000100: 
048334,000101:    4720           54001        ISWCALL            TS       L                                     
048335,000102:    4721           22004                           LXCH     FBANK                                 
048336,000103:    4722           75041                           MASK     LOW10                                 
048337,000104:    4723           56002                           XCH      Q                                     
048338,000105:    4724           52073                           DXCH     RUPTREG3                              
048339,000106:    4725           50002                           INDEX    Q                                     
048340,000107:    4726           02000                           TC       10000                                 
048341,000108: 
048342,000109:    4727           56073        ISWRETRN           XCH      RUPTREG4                              
048343,000110:    4730           56004                           XCH      FBANK                                 
048344,000111:    4731           56073                           XCH      RUPTREG4                              
048345,000112:    4732           00072                           TC       RUPTREG3                              
048346,000113: 
048347,000114:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
048348,000115: 
048349,000116:                                                                                                  #        L       TC      USPRCADR
048350,000117:                                                                                                  #        L+1     CADR    INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
048351,000118:                                                                                                  #                                        RETURN IS TO L+2
048352,000119: 
048353,000120:    4733           54164        USPRCADR           TS       LOC                                   #  SAVE A
048354,000121:    4734           34761                           CA       BIT8                                  
048355,000122:    4735           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
048356,000123:    4736           30006                           CA       BBANK                                 
048357,000124:    4737           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
048358,000125:    4740           50002                           INDEX    Q                                     
048359,000126:    4741           30000                           CA       0                                     
048360,000127:    4742           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
048361,000128:    4743           75041                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
048362,000129:    4744           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
048363,000130:    4745           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
048364,000131:    4746           14663                           TCF      Q+10000                               
048365,000132: 

Page 1107

048367,000134: 
048368,000135:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07.  (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
048369,000136: 
048370,000137:                                                                                                  #                                                PSEUDO-FIXED    OCTAL PSEUDO
048371,000138:                                                                                                  #  SUPERBANK     SETTING         S-REG. VALUE    BANK NUMBERS    ADDRESSES
048372,000139:                                                                                                  #  ----------    -------         ------------     ------------    ------------
048373,000140:                                                                                                  #  SUPERBANK 3     0XX            2000 - 3777       30 - 37      70000 - 107777          (WHERE XX CAN BE ANYTHING AND
048374,000141:                                                                                                  #                                                                                        WILL USUALLY BE SEEN AS 11)
048375,000142:                                                                                                  #  SUPERBANK 4     100            2000 - 3777       40 - 47      110000 - 127777         (AS FAR AS IT CAN BE SEEN,
048376,000143:                                                                                                  #                                                                                        ONLY BANKS 40-43 WILL EVER BE
048377,000144:                                                                                                  #                                                                                        AND ARE PRESENTLY AVAILABLE)
048378,000145:                                                                                                  #  SUPERBANK 5     101            2000 - 3777       50 - 57      130000 - 147777         (PRESENTLY NOT AVAILABLE TO
048379,000146:                                                                                                  #                                                                                        THE USER)
048380,000147:                                                                                                  #  SUPERBANK 6     110            2000 - 3777       60 - 67      150000 - 167777         (PRESENTLY NOT AVAILABLE TO
048381,000148:                                                                                                  #                                                                                        THE USER)
048382,000149: 

End of include-file INTER-BANK_COMMUNICATION.agc.  Parent file is MAIN.agc