forked from chrislgarry/Apollo-11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KEYRUPT_UPRUPT.s
136 lines (122 loc) · 3.77 KB
/
KEYRUPT_UPRUPT.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Copyright: Public domain.
# Filename: KEYRUPT_UPRUPT.agc
# Purpose: Part of the source code for Comanche, build 055. It
# is part of the source code for the Command Module's
# (CM) Apollo Guidance Computer (AGC), Apollo 11.
# Assembler: yaYUL
# Reference: pp. 1449-1451
# Contact: Ron Burkey <info@sandroid.org>
# Website: http://www.ibiblio.org/apollo.
# Mod history: 2009-05-07 RSB Adapted from Colossus249 file of the same
# name, and page images. Corrected various
# typos in the transcription of program
# comments, and these should be back-ported
# to Colossus249.
#
# The contents of the "Comanche055" files, in general, are transcribed
# from scanned documents.
#
# Assemble revision 055 of AGC program Comanche by NASA
# 2021113-051. April 1, 1969.
#
# This AGC program shall also be referred to as Colossus 2A
#
# Prepared by
# Massachussets Institute of Technology
# 75 Cambridge Parkway
# Cambridge, Massachusetts
#
# under NASA contract NAS 9-4065.
#
# Refer directly to the online document mentioned above for further
# information. Please report any errors to info@sandroid.org.
# Page 1449
BANK 14
SETLOC KEYRUPT
BANK
COUNT* $$/KEYUP
KEYRUPT1 TS BANKRUPT
XCH Q
TS QRUPT
TC LODSAMPT # TIME IS SNATCHED IN RUPT FOR NOUN 65.
CAF LOW5
EXTEND
RAND MNKEYIN # CHECK IF KEYS 5M-1M ON
KEYCOM TS RUPTREG4
CS FLAGWRD5
MASK BIT15
ADS FLAGWRD5
ACCEPTUP CAF CHRPRIO # (NOTE: RUPTREG4 = KEYTEMP1)
TC NOVAC
EBANK= DSPCOUNT
2CADR CHARIN
CA RUPTREG4
INDEX LOCCTR
TS MPAC # LEAVE 5 BIT KEY CODE IN MPAC FOR CHARIN
TC RESUME
# Page 1450
# UPRUPT PROGRAM
UPRUPT TS BANKRUPT
XCH Q
TS QRUPT
TC LODSAMPT # TIME IS SNATCHED IN RUPT FOR NOUN 65.
CAF ZERO
XCH INLINK
TS KEYTEMP1
CAF BIT3 # TURN ON UPACT LIGHT
EXTEND # (BIT 3 OF CHANNEL 11)
WOR DSALMOUT
UPRPT1 CAF LOW5 # TEST FOR TRIPLE CHAR REDUNDANCY
MASK KEYTEMP1 # LOW5 OF WORD
XCH KEYTEMP1 # LOW5 INTO KEYTEMP1
EXTEND
MP BIT10 # SHIFT RIGHT 5
TS KEYTEMP2
MASK LOW5 # MID 5
AD HI10
TC UPTEST
CAF BIT10
EXTEND
MP KEYTEMP2 # SHIFT RIGHT 5
MASK LOW5 # HIGH 5
COM
TC UPTEST
UPOK CS ELRCODE # CODE IS GOOD. IF CODE = `ERROR RESET',
AD KEYTEMP1 # CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
EXTEND # IF CODE DOES NOT = `ERROR RESET', ACCEPT
BZF CLUPLOCK # CODE ONLY IF UPLOCKFL IS CLEAR (=0).
CAF BIT4 # TEST UPLOCKFL FOR 0 OR 1
MASK FLAGWRD7
CCS A
TC RESUME # UPLOCKFL = 1
TC ACCEPTUP # UPLOCKFL = 0
CLUPLOCK CS BIT4 # CLEAR UPLOCKFL (I.E., SET BIT 4 OF
MASK FLAGWRD7 # FLAGWRD7 = 0)
TS FLAGWRD7
TC ACCEPTUP
# CODE IS BAD
TMFAIL2 CS FLAGWRD7 # LOCK OUT FURTHER UPLINK ACTIVITY
MASK BIT4 # (BY SETTING UPLOCKFL = 1) UNTIL
ADS FLAGWRD7 # `ERROR RESET' IS SENT VIA UPLINK.
TC RESUME
UPTEST AD KEYTEMP1
# Page 1451
CCS A
TC TMFAIL2
HI10 OCT 77740
TC TMFAIL2
TC Q
ELRCODE OCT 22
# `UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
# 1. VBRELDSP
# 2. ERROR RESET
# 3. UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
#
# THE RECEPTION OF A BAD CODE (I.E., CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
# THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
# WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND `ERROR RESET' CODE.
# (IT IS RECOMMENDED THAT THE `ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
# BY 15 ZEROS. THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
# FAILURE).
#
# UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.