ABC
 
ABC Simulator
Automatic Operation Program
 

The following is an example of an OttoScript program which the ABC simulator generates and executes to solve a set of equations. OttoScript is a simple language which directs a simulated mouse (Otto the Auto-Mouse) through a sequence of screen operations.



-- OttoScript Program for the ABC Simulation for N=2
1: message Solving for N=2

-- begin with some cleanup
2: execIf same AutoSpeed 3
3: push SimRate 4
4: execIf ovfLamp
5: push ClearOvf
6: skipIf same B10CardReader 0
7: drag B10CardReader to Trash
8: skipIf same B2CardReader 0
9: drag B2CardReader to Trash
10: skipIf same B2CardPunch 0
11: drag B2CardPunch to Trash

-- Stage 1: Base-10 to Base-2 Conversion
12: message
13: message Stage 1: Base-10 to Base-2 Conversion

-- preparation
14: skipIf same SignChange off
15: set SignChange         off
16: skipIf same ZeroDetect off
17: set ZeroDetect         off
18: skipIf same Bank1  on
19: set Bank1          on
20: skipIf same Bank6  off
21: set Bank6          off
22: skipIf same Bank11 off
23: set Bank11         off
24: skipIf same Bank16 off
25: set Bank16         off
26: skipIf same Bank21 off
27: set Bank21         off
28: skipIf same Bank26 off
29: set Bank26         off
30: skipIf same EnableOut10 off
31: set EnableOut10         off
32: skipIf same ReadIBMCard on
33: set ReadIBMCard         on
34: skipIf same ReaderSelect RS10
35: set ReaderSelect         RS10

-- 10 to 2 conversion: row 1
36: message row 1
37: push ClearCA
38: drag Bin1_1 to B10CardReader
39: waitFor ABCIdle Read10
40: push Read10
41: drag B2Blanks to B2CardPunch
42: waitFor ABCIdle B10CardReader
43: drag B10CardReader to Trash
44: push Punch2
45: waitFor ABCIdle B2CardPunch
46: drag B2CardPunch to Bin1_1

-- 10 to 2 conversion: row 2
47: message row 2
48: push ClearCA
49: drag Bin1_2 to B10CardReader
50: waitFor ABCIdle Read10
51: push Read10
52: drag B2Blanks to B2CardPunch
53: waitFor ABCIdle B10CardReader
54: drag B10CardReader to Trash
55: push Punch2
56: waitFor ABCIdle B2CardPunch
57: drag B2CardPunch to Bin1_2

-- stage 1 cleanup
58: set Bank1 off
59: set ReaderSelect RS2
60: set ReadIBMCard  off

-- Stage 2: Forward Elimination (column-by-column)
61: message
62: message Stage 2: Forward Elimination (column-by-column)

-- eliminate 1
63: set SignChange 1
64: set ZeroDetect 1

-- pair-combine
65: message pair-combine: eliminate 1, rows 1 2
66: drag Bin1_1 to B2CardReader
67: push Read2
68: waitFor ABCIdle Transfer
69: push Transfer
70: drag B2CardReader to Bin1_1
71: observe NegLamp
72: observe SubLamp
73: execIf same SubLamp NegLamp
74: push AddSub
75: drag Bin1_2 to B2CardReader
76: waitFor ABCIdle Read2
77: push Read2
78: waitFor ABCIdle NegLamp
79: observe NegLamp
80: execIf NegLamp
81: push AddSub
82: push Go
83: drag B2Blanks to B2CardPunch
84: drag B2CardReader to Bin1_2
85: waitFor ABCIdle Punch2
86: push Punch2
87: waitFor ABCIdle B2CardPunch
88: drag B2CardPunch to Bin2_2

-- Stage 3: Backward Elimination (row-by-row)
89: message
90: message Stage 3: Backward Elimination (row-by-row)

-- row 1
91: drag Bin1_1 to B2CardReader
92: push Read2
93: waitFor ABCIdle B2CardReader
94: drag B2CardReader to Bin1_1

-- pair-combine
95: message pair-combine: row 1, eliminate 2
96: drag Bin2_2 to B2CardReader
97: waitFor ABCIdle SignChange
98: set SignChange 2
99: set ZeroDetect 2
100: push Transfer
101: waitFor ABCIdle NegLamp
102: observe NegLamp
103: define _neg NegLamp
104: push Read2
105: waitFor ABCIdle NegLamp
106: observe NegLamp
107: define _same no
108: execIf same NegLamp _neg
109: define _same yes
110: skipIf same SubLamp _same
111: push AddSub
112: push Go
113: drag B2CardReader to Bin2_2
114: drag B2Blanks to B2CardPunch
115: waitFor ABCIdle Punch2
116: push Punch2
117: waitFor ABCIdle B2CardPunch
118: drag B2CardPunch to Bin2_1

-- Stage 4: Solution
119: message
120: message Stage 4: Solution

-- preparation
121: invoke AbcAutoSupport ResInit
122: set EnableOut10 on
123: drag Output10ConversionCardBin to B10CardReader

-- 2 to 10 conversion: row 1
124: invoke AbcAutoSupport ResBegin
125: drag Bin2_1 to B2CardReader
126: push Read2
127: waitFor ABCIdle ReaderSelect
128: set ReaderSelect RS10

-- numerator
129: set SignChange 3
130: set ZeroDetect 3
131: execIf B10Display
132: push ClearB10Display
133: waitFor ABCFullCycle NegLamp
134: observe NegLamp
135: invoke AbcAutoSupport ResSign NegLamp
136: observe SubLamp
137: execIf same SubLamp NegLamp
138: push AddSub
139: push Read10
140: drag B2CardReader to Bin2_1
141: waitFor ABCIdle B10Display
142: observe B10Display
143: invoke AbcAutoSupport ResNumerator B10Display

-- denominator
144: set SignChange 1
145: set ZeroDetect 1
146: execIf B10Display
147: push ClearB10Display
148: waitFor ABCFullCycle NegLamp
149: observe NegLamp
150: invoke AbcAutoSupport ResSign NegLamp
151: observe SubLamp
152: execIf same SubLamp NegLamp
153: push AddSub
154: push Read10
155: waitFor ABCIdle B10Display
156: observe B10Display
157: invoke AbcAutoSupport ResDenominator B10Display
158: set ReaderSelect RS2

-- 2 to 10 conversion: row 2
159: invoke AbcAutoSupport ResBegin
160: drag Bin2_2 to B2CardReader
161: push Read2
162: waitFor ABCIdle ReaderSelect
163: set ReaderSelect RS10

-- numerator
164: set SignChange 3
165: set ZeroDetect 3
166: execIf B10Display
167: push ClearB10Display
168: waitFor ABCFullCycle NegLamp
169: observe NegLamp
170: invoke AbcAutoSupport ResSign NegLamp
171: observe SubLamp
172: execIf same SubLamp NegLamp
173: push AddSub
174: push Read10
175: drag B2CardReader to Bin2_2
176: waitFor ABCIdle B10Display
177: observe B10Display
178: invoke AbcAutoSupport ResNumerator B10Display

-- denominator
179: set SignChange 2
180: set ZeroDetect 2
181: execIf B10Display
182: push ClearB10Display
183: waitFor ABCFullCycle NegLamp
184: observe NegLamp
185: invoke AbcAutoSupport ResSign NegLamp
186: observe SubLamp
187: execIf same SubLamp NegLamp
188: push AddSub
189: push Read10
190: waitFor ABCIdle B10Display
191: observe B10Display
192: invoke AbcAutoSupport ResDenominator B10Display
193: set ReaderSelect RS2

-- stage 4 cleanup
194: set EnableOut10 off
195: drag B10CardReader to Output10ConversionCardBin
196: set SignChange off
197: set ZeroDetect off
198: terminate



  Automatic Operation Program
Proof-of-Concept | Architecture | ASM | Manual | Simulation
ABC
bhilpert
2002