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.

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

Page 1104

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

Page 1105

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

Page 1106

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

Page 1107

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

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