Source Code
These source-code files are part of a reconstructed copy of Luminary 69/2,
the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.
The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation. Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
|
048671,000002: ## Copyright: Public domain.
048672,000003: ## Filename: PLANETARY_INERTIAL_ORIENTATION.agc
048673,000004: ## Purpose: A section of LUM69 revision 2.
048674,000005: ## It is part of the reconstructed source code for the flown
048675,000006: ## version of the flight software for the Lunar Module's (LM)
048676,000007: ## Apollo Guidance Computer (AGC) for Apollo 10. The code has
048677,000008: ## been recreated from a copy of Luminary revsion 069, using
048678,000009: ## changes present in Luminary 099 which were described in
048679,000010: ## Luminary memos 75 and 78. The code has been adapted such
048680,000011: ## that the resulting bugger words exactly match those specified
048681,000012: ## for LUM69 revision 2 in NASA drawing 2021152B, which gives
048682,000013: ## relatively high confidence that the reconstruction is correct.
048683,000014: ## Reference: pp. 1135-1143
048684,000015: ## Assembler: yaYUL
048685,000016: ## Contact: Ron Burkey <info@sandroid.org>.
048686,000017: ## Website: www.ibiblio.org/apollo/index.html
048687,000018: ## Mod history: 2019-07-27 MAS Created from Luminary 69.
048688,000019:
Page 1135 |
048690,000021: # ..... RP-TO-R SUBROUTINE .....
048691,000022: # SUBROUTINE TO CONVERT RP (VECTOR IN PLANETARY COORDINATE SYSTEM, EITHER
048692,000023: # EARTH-FIXED OR MOON-FIXED) TO R (SAME VECTOR IN THE BASIC REF. SYSTEM)
048693,000024:
048694,000025: # R = MT(T)*(RP + LP X RP) MT = M MATRIX TRANSPOSE
048695,000026:
048696,000027: # CALLING SEQUENCE
048697,000028: # L CALL
048698,000029: # L+1 RP-TO-R
048699,000030:
048700,000031: # SUBROUTINES USED
048701,000032: # EARTHMX,MOONMX,EARTHL
048702,000033:
048703,000034: # ITEMS AVAILABLE FROM LAUNCH DATA
048704,000035: # 504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL,EXPRESSED
048705,000036: # IN THE MOON-FIXED COORD. SYSTEM RADIANS B0
048706,000037:
048707,000038: # ITEMS NECESSARY FOR SUBR. USED (SEE DESCRIPTION OF SUBR.)
048708,000039:
048709,000040: # INPUT
048710,000041: # MPAC= 0 FOR EARTH, NON-ZERO FOR MOON
048711,000042: # 0-5D= RP VECTOR
048712,000043: # 6-7D= TIME
048713,000044:
048714,000045: # OUTPUT
048715,000046: # MPAC = R VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
048716,000047:
048717,000048: 24,2000 SETLOC PLANTIN
048718,000049: 24,2000 BANK
048719,000050:
048720,000051: 24,3504 COUNT* $$/LUROT
048721,000052:
048722,000053: 24,3504 46020 RP-TO-R STQ BHIZ
048723,000054: 24,3505 00050 RPREXIT
048724,000055: 24,3506 51521 RPTORA
048725,000056: 24,3507 77624 CALL # COMPUTE M MATRIX FOR MOON
048726,000057: 24,3510 51561 MOONMX # LP=LM FOR MOON RADIANS B0
048727,000058: 24,3511 77775 VLOAD
048728,000059: 24,3512 02013 504LM
048729,000060: 24,3513 53235 RPTORB VXV VAD
048730,000061: 24,3514 00001 504RPR
048731,000062: 24,3515 00001 504RPR
048732,000063: 24,3516 52105 VXM GOTO
048733,000064: 24,3517 00025 MMATRIX # MPAC=R=MT(T)*(RP+LPXRP)
048734,000065: 24,3520 51547 RPRPXXXX # RESET PUSHLOC TO 0 BEFORE EXITING
048735,000066: 24,3521 77624 RPTORA CALL # EARTH COMPUTATIONS
048736,000067: 24,3522 55657 EARTHMX # M MATRIX B-1
048737,000068: 24,3523 77624 CALL
048738,000069: 24,3524 55711 EARTHL # L VECTOR RADIANS B0
048739,000070: 24,3525 76521 MXV VSL1 # LP=M(T)*L RAD B-0
048740,000071: 24,3526 00025 MMATRIX
Page 1136 |
048742,000073: 24,3527 77650 GOTO
048743,000074: 24,3530 51513 RPTORB
048744,000075:
Page 1137 |
048746,000077: # ..... R-TO-RP SUBROUTINE .....
048747,000078: # SUBROUTINE TO CONVERT R (VECTOR IN REFERENCE COORD. SYSTEM) TO RP
048748,000079: # (VECTOR IN PLANETARY COORD SYSTEM) EITHER EARTH-FIXED OR MOON-FIXED
048749,000080:
048750,000081: # RP = M(T)*(R - L X R)
048751,000082:
048752,000083: # CALLING SEQUENCE
048753,000084: # L CALL
048754,000085: # L+1 R-TO-RP
048755,000086:
048756,000087: # SUBROUTINES USED
048757,000088: # EARTHMX,MOONMX,EARTHL
048758,000089:
048759,000090: # INPUT
048760,000091: # MPAC= 0 FOR EARTH,NON-ZERO FOR MOON
048761,000092: # 0-5D= R VECTOR
048762,000093: # 6-7D= TIME
048763,000094:
048764,000095: # ITEMS AVAILABLE FROM LAUNCH DATA
048765,000096: # 504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL,EXPRESSED
048766,000097: # IN THE MOON-FIXED COORD. SYSTEM RADIANS B0
048767,000098:
048768,000099: # ITEMS NECESSARY FOR SUBROUTINES USED (SEE DESCRIPTION OF SUBR.)
048769,000100:
048770,000101: # OUTPUT
048771,000102: # MPAC = RP VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
048772,000103:
048773,000104: 24,3531 46020 R-TO-RP STQ BHIZ
048774,000105: 24,3532 00050 RPREXIT
048775,000106: 24,3533 51553 RTORPA
048776,000107: 24,3534 77624 CALL
048777,000108: 24,3535 51561 MOONMX
048778,000109: 24,3536 61375 VLOAD VXM
048779,000110: 24,3537 02013 504LM # LP=LM
048780,000111: 24,3540 00025 MMATRIX
048781,000112: 24,3541 77772 VSL1 # L=MT(T)*LP RADIANS B0
048782,000113: 24,3542 51235 RTORPB VXV BVSU
048783,000114: 24,3543 00001 504RPR
048784,000115: 24,3544 00001 504RPR
048785,000116: 24,3545 77721 MXV # M(T)*(R-LXR) B-2
048786,000117: 24,3546 00025 MMATRIX
048787,000118: 24,3547 40372 RPRPXXXX VSL1 SETPD
048788,000119: 24,3550 00001 0D
048789,000120: 24,3551 77650 GOTO
048790,000121: 24,3552 00050 RPREXIT
048791,000122: 24,3553 77624 RTORPA CALL # EARTH COMPUTATIONS
048792,000123: 24,3554 55657 EARTHMX
048793,000124: 24,3555 77624 CALL
048794,000125: 24,3556 55711 EARTHL
048795,000126: 24,3557 77650 GOTO # MPAC=L=(-AX,-AY,0) RAD B-0
048796,000127: 24,3560 51542 RTORPB
048797,000128:
Page 1138 |
048799,000130: # ..... MOONMX SUBROUTINE .....
048800,000131: # SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE MOON
048801,000132:
048802,000133: # CALLING SEQUENCE
048803,000134: # L CALL
048804,000135: # L+1 MOONMX
048805,000136:
048806,000137: # SUBROUTINES USED
048807,000138: # NEWANGLE
048808,000139:
048809,000140: # INPUT
048810,000141: # 6-7D= TIME
048811,000142:
048812,000143: # ITEMS AVAILABLE FROM LAUNCH DATA
048813,000144: # BSUBO,BDOT
048814,000145: # TIMSUBO,NODIO,NODDOT,FSUBO,FDOT
048815,000146: # COSI= COS(I) B-1
048816,000147: # SINI= SIN(I) B-1
048817,000148: # I IS THE ANGLE BETWEEN THE MEAN LUNAR EQUATORIAL PLANE AND THE
048818,000149: # PLANE OF THE ECLIPTIC (1 DEGREE 32.1 MINUTES)
048819,000150:
048820,000151: # OUTPUT
048821,000152: # MMATRIX= 3X3 M MATRIX B-1 (STORED IN VAC AREA)
048822,000153:
048823,000154: 24,3561 40220 MOONMX STQ SETPD
048824,000155: 24,3562 00051 EARTHMXX
048825,000156: 24,3563 00011 8D
048826,000157: 24,3564 77770 AXT,1 # B REQUIRES SL 0, SL 5 IN NEWANGLE
048827,000158: 24,3565 00005 5
048828,000159: 24,3566 65345 DLOAD PDDL # PD 10D 8-9D=BSUBO
048829,000160: 24,3567 10017 BSUBO # 10-11D=BDOT
048830,000161: 24,3570 10011 BDOT
048831,000162: 24,3571 45006 PUSH CALL # PD 12D
048832,000163: 24,3572 51706 NEWANGLE # EXIT WITH PD 8D AND MPAC= B REVS B0
048833,000164: 24,3573 71406 PUSH COS # PD 10D
048834,000165: 24,3574 14041 STODL COB # PD 8D COS(B) B-1
048835,000166: 24,3575 77756 SIN # SIN(B) B-1
048836,000167: 24,3576 14043 STODL SOB # SETUP INPUT FOR NEWANGLE
048837,000168: 24,3577 10015 FSUBO # 8-9D=FSUBO
048838,000169: 24,3600 41525 PDDL PUSH # PD 10D THEN 12D 10-11D=FDOT
048839,000170: 24,3601 10007 FDOT
048840,000171: 24,3602 45170 AXT,1 CALL # F REQUIRES SL 1, SL 6 IN NEWANGLE
048841,000172: 24,3603 00004 4
048842,000173: 24,3604 51706 NEWANGLE # EXIT WITH PD 8D AND MPAC= F REVS B0
048843,000174: 24,3605 14027 STODL AVECTR +2 # SAVE F TEMP
048844,000175: 24,3606 10013 NODIO # 8-9D=NODIO
048845,000176: 24,3607 41525 PDDL PUSH # PD 10D THEN 12D 10-11D=NODDOT
048846,000177: 24,3610 10005 NODDOT # MPAC=T
048847,000178: 24,3611 45170 AXT,1 CALL # NODE REQUIRES SL 0, SL 5 IN NEWANGLE
048848,000179: 24,3612 00005 5
048849,000180: 24,3613 51706 NEWANGLE # EXIT WITH PD 8D AND MPAC= NODI REVS B0
Page 1139 |
048851,000182: 24,3614 71406 PUSH COS # PD 10D 8-9D= NODI REVS B0
048852,000183: 24,3615 77606 PUSH # PD 12D 10-11D= COS(NODI) B-1
048853,000184: 24,3616 00025 STORE AVECTR
048854,000185: 24,3617 76405 DMP SL1R
048855,000186: 24,3620 00041 COB # COS(NODI) B-1
048856,000187: 24,3621 14035 STODL BVECTR +2 # PD 10D 20-25D=AVECTR= COB*SIN(NODI)
048857,000188: 24,3622 76405 DMP SL1R # SOB*SIN(NODI)
048858,000189: 24,3623 00043 SOB
048859,000190: 24,3624 14037 STODL BVECTR +4 # PD 8D
048860,000191: 24,3625 41556 SIN PUSH # PD 10D -SIN(NODI) B-1
048861,000192: 24,3626 77676 DCOMP # 26-31D=BVECTR= COB*COS(NODI)
048862,000193: 24,3627 14033 STODL BVECTR # PD 8D SOB*COS(NODI)
048863,000194: 24,3630 00027 AVECTR +2 # MOVE F FROM TEMP LOC. TO 504F
048864,000195: 24,3631 14007 STODL 504F
048865,000196: 24,3632 76405 DMP SL1R
048866,000197: 24,3633 00041 COB
048867,000198: 24,3634 14027 STODL AVECTR +2
048868,000199: 24,3635 00011 SINNODI # 8-9D=SIN(NODI) B-1
048869,000200: 24,3636 76405 DMP SL1R
048870,000201: 24,3637 00043 SOB
048871,000202: 24,3640 14031 STODL AVECTR +4 # 0
048872,000203: 24,3641 06424 HI6ZEROS # 8-13D= CVECTR= -SOB B-1
048873,000204: 24,3642 57525 PDDL DCOMP # PD 10D COB
048874,000205: 24,3643 00043 SOB
048875,000206: 24,3644 63325 PDDL PDVL # PD 12D THEN PD 14D
048876,000207: 24,3645 00041 COB
048877,000208: 24,3646 00033 BVECTR
048878,000209: 24,3647 63361 VXSC PDVL # PD 20D BVECTR*SINI B-2
048879,000210: 24,3650 10003 SINI
048880,000211: 24,3651 00011 CVECTR
048881,000212: 24,3652 53361 VXSC VAD # PD 14D CVECTR*COSI B-2
048882,000213: 24,3653 10001 COSI
048883,000214: 24,3654 77772 VSL1
048884,000215: 24,3655 24041 STOVL MMATRIX +12D # PD 8D M2=BVECTR*SINI+CVECTR*COSI B-1
048885,000216: 24,3656 63361 VXSC PDVL # PD 14D
048886,000217: 24,3657 10003 SINI # CVECTR*SINI B-2
048887,000218: 24,3660 00033 BVECTR
048888,000219: 24,3661 52361 VXSC VSU # PD 8D BVECTR*COSI B-2
048889,000220: 24,3662 10001 COSI
048890,000221: 24,3663 65372 VSL1 PDDL # PD 14D
048891,000222: 24,3664 00007 504F # 8-13D=DVECTR=BVECTR*COSI-CVECTR*SINI B-1
048892,000223: 24,3665 74346 COS VXSC
048893,000224: 24,3666 00011 DVECTR
048894,000225: 24,3667 73525 PDDL SIN # PD 20D 14-19D= DVECTR*COSF B-2
048895,000226: 24,3670 00007 504F
048896,000227: 24,3671 52361 VXSC VSU # PD 14D AVECTR*SINF B-2
048897,000228: 24,3672 00025 AVECTR
048898,000229: 24,3673 77772 VSL1
048899,000230: 24,3674 14033 STODL MMATRIX +6 # M1= AVECTR*SINF-DVECTR*COSF B-1
048900,000231: 24,3675 00007 504F
Page 1140 |
048902,000233: 24,3676 74356 SIN VXSC # PD 8D
048903,000234: 24,3677 71525 PDDL COS # PD 14D 8-13D=DVECTR*SINF B-2
048904,000235: 24,3700 00007 504F
048905,000236: 24,3701 53361 VXSC VAD # PD 8D AVECTR*COSF B-2
048906,000237: 24,3702 00025 AVECTR
048907,000238: 24,3703 57572 VSL1 VCOMP
048908,000239: 24,3704 34025 STCALL MMATRIX # M0= -(AVECTR*COSF+DVECTR*SINF) B-1
048909,000240: 24,3705 00051 EARTHMXX
048910,000241:
048911,000242: # COMPUTE X=X0+(XDOT)(T+T0)
048912,000243: # 8-9D= XO (REVS B-0), PUSHLOC SET AT 12D
048913,000244: # 10-11D=XDOT (REVS/CSEC) SCALED B+23 FOR WEARTH,B+28 FOR NODDOT AND BDOT
048914,000245: # AND B+27 FOR FDOT
048915,000246: # X1=DIFFERENCE IN 23 AND SCALING OF XDOT,=0 FOR WEARTH,5 FOR NODDOT AND
048916,000247: # BDOT AND 4 FOR FDOT
048917,000248: # 6-7D=T (CSEC B-28), TIMSUBO= (CSEC B-42 TRIPLE PREC.)
048918,000249:
048919,000250: 24,3706 54345 NEWANGLE DLOAD SR # ENTER PD 12D
048920,000251: 24,3707 00007 6D
048921,000252: 24,3710 20617 14D
048922,000253: 24,3711 72371 TAD TLOAD # CHANGE MODE TO TP
048923,000254: 24,3712 01707 TIMSUBO
048924,000255: 24,3713 00155 MPAC
048925,000256: 24,3714 14017 STODL TIMSUBM # T+T0 CSEC B-42
048926,000257: 24,3715 00020 TIMSUBM +1
048927,000258: 24,3716 77605 DMP # PD 10D MULT BY XDOT IN 10-11D
048928,000259: 24,3717 43257 SL* DAD # PD 8D ADD XO IN 8-9D AFTER SHIFTING
048929,000260: 24,3720 20206 5,1 # SUCH THAT SCALING IS B-0
048930,000261: 24,3721 67206 PUSH SLOAD # PD 10D SAVE PARTIAL (X0+XDOT*T) IN 8-9D
048931,000262: 24,3722 00017 TIMSUBM
048932,000263: 24,3723 41261 SL DMP
048933,000264: 24,3724 20212 9D
048934,000265: 24,3725 00013 10D # XDOT
048935,000266: 24,3726 43257 SL* DAD # PD 8D SHIFT SUCH THAT THIS PART OF X
048936,000267: 24,3727 20213 10D,1 # IS SCALED REVS/CSEC B-0
048937,000268: 24,3730 77600 BOV # TURN OFF OVERFLOW IF SET BY SHIFT
048938,000269: 24,3731 51732 +1 # INSTRUCTION BEFORE EXITING
048939,000270: 24,3732 77616 RVQ # MPAC=X= X0+(XDOT)(T+T0) REVS B0
048940,000271:
Page 1141 |
048942,000273: # ..... EARTHMX SUBROUTINE .....
048943,000274: # SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE EARTH
048944,000275:
048945,000276: # CALLING SEQUENCE
048946,000277: # L CALL
048947,000278: # L+1 EARTHMX
048948,000279:
048949,000280: # SUBROUTINES USED
048950,000281: # NEWANGLE
048951,000282:
048952,000283: # INPUT
048953,000284: # INPUT AVAILABLE FROM LAUNCH DATA AZO REVS B-0
048954,000285: # TEPHEM CSEC B-42
048955,000286: # 6-7D= TIME CSEC B-28
048956,000287:
048957,000288: # OUTPUT
048958,000289: # MMATRIX= 3X3 M MATRIX B-1 (STORED IN VAC AREA)
048959,000290:
048960,000291: 26,3657 BANK 26
048961,000292: 26,2000 SETLOC PLANTIN1
048962,000293: 26,2000 BANK
048963,000294: 26,3657 COUNT* $$/LUROT
048964,000295:
048965,000296: 26,3657 40220 EARTHMX STQ SETPD # SET 8-9D=AZO
048966,000297: 26,3660 00051 EARTHMXX
048967,000298: 26,3661 00011 8D # 10-11D=WEARTH
048968,000299: 26,3662 77770 AXT,1 # FOR SL 5, AND SL 10 IN NEWANGLE
048969,000300: 26,3663 00000 0
048970,000301: 26,3664 65345 DLOAD PDDL # LEAVING PD SET AT 12D FOR NEWANGLE
048971,000302: 26,3665 01712 AZO
048972,000303: 26,3666 10021 WEARTH
048973,000304: 26,3667 45006 PUSH CALL
048974,000305: 26,3670 51706 NEWANGLE
048975,000306: 26,3671 41401 SETPD PUSH # 18-19D=504AZ
048976,000307: 26,3672 00023 18D # COS(AZ) SIN(AZ) 0
048977,000308: 26,3673 65346 COS PDDL # 20-37D= MMATRIX= -SIN(AZ) COS(AZ) 0 B-1
048978,000309: 26,3674 00023 504AZ # 0 0 1
048979,000310: 26,3675 65356 SIN PDDL
048980,000311: 26,3676 06424 HI6ZEROS
048981,000312: 26,3677 73525 PDDL SIN
048982,000313: 26,3700 00023 504AZ
048983,000314: 26,3701 65276 DCOMP PDDL
048984,000315: 26,3702 00023 504AZ
048985,000316: 26,3703 63346 COS PDVL
048986,000317: 26,3704 06424 HI6ZEROS
048987,000318: 26,3705 41525 PDDL PUSH
048988,000319: 26,3706 06422 HIDPHALF
048989,000320: 26,3707 77650 GOTO
048990,000321: 26,3710 00051 EARTHMXX
048991,000322:
Page 1142 |
048993,000324: # ..... EARTHL SUBROUTINE .....
048994,000325: # SUBROUTINE TO COMPUTE L VECTOR FOR EARTH
048995,000326:
048996,000327: # CALLING SEQUENCE
048997,000328: # L CALL
048998,000329: # L+1 EARTHL
048999,000330:
049000,000331: # INPUT
049001,000332: # AXO,AYO SET AT LAUNCH TIME WITH AYO IMMEDIATELY FOLLOWING AXO IN CORE
049002,000333:
049003,000334: # OUTPUT
049004,000335: # -AX
049005,000336: # MPAC= -AY RADIANS B-0
049006,000337: # 0
049007,000338:
049008,000339: 26,3711 57545 EARTHL DLOAD DCOMP
049009,000340: 26,3712 01716 AXO
049010,000341: 26,3713 14017 STODL 504LPL
049011,000342: 26,3714 01714 -AYO
049012,000343: 26,3715 14021 STODL 504LPL +2
049013,000344: 26,3716 06424 HI6ZEROS
049014,000345: 26,3717 24023 STOVL 504LPL +4
049015,000346: 26,3720 00017 504LPL
049016,000347: 26,3721 77616 RVQ
049017,000348:
Page 1143 |
049019,000350: # CONSTANTS AND ERASABLE ASSIGNMENTS
049020,000351:
049021,000352: 26,3722 11,2272 1B1 = DP1/2 # 1 SCALED B-1
049022,000353: 26,3722 0000050 RPREXIT = S1 # R-TO-RP AND RP-TO-R SUBR EXIT
049023,000354: 26,3722 0000051 EARTHMXX = S2 # EARTHMX,MOONMX SUBR. EXITS
049024,000355: 26,3722 504RPR = 0D # 6 REGS R OR RP VECTOR
049025,000356: 26,3722 SINNODI = 8D # 2 SIN(NODI)
049026,000357: 26,3722 DVECTR = 8D # 6 D VECTOR MOON
049027,000358: 26,3722 CVECTR = 8D # 6 C VECTR MOON
049028,000359: 26,3722 504AZ = 18D # 2 AZ
049029,000360: 26,3722 TIMSUBM = 14D # 3 TIME SUB M (MOON) T+T0 IN GETAZ
049030,000361: 26,3722 504LPL = 14D # 6 L OR LP VECTOR
049031,000362: 26,3722 AVECTR = 20D # 6 A VECTOR (MOON)
049032,000363: 26,3722 BVECTR = 26D # 6 B VECTOR (MOON)
049033,000364: 26,3722 MMATRIX = 20D # 18 M MATRIX
049034,000365: 26,3722 COB = 32D # 2 COS(B) B-1
049035,000366: 26,3722 SOB = 34D # 2 SIN(B) B-1
049036,000367: 26,3722 504F = 6D # 2 F(MOON)
049037,000368:
End of include-file PLANETARY_INERTIAL_ORIENTATION.agc. Parent file is MAIN.agc