-
Notifications
You must be signed in to change notification settings - Fork 0
/
Emulator.html
625 lines (481 loc) · 31.2 KB
/
Emulator.html
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Elliott 803B Emulator and OpenGL ES 3 User Interface User Guide</title>
<style>
code {
font-family: Consolas,"courier new";
color: crimson;
background-color: #f1f1f1;
padding: 2px;
font-size: 105%;
}
</style>
<style>
/* Switch numbering on by adding class "countheads" to h1 */
/* Prevent numbering for a single heading via class "nocount" */
body {
counter-reset: h1counter;
}
.countheads ~ h1:before {
content: counter(h1counter) ".\0000a0\0000a0";
counter-increment: h1counter;
}
h1 {
counter-reset: h2counter;
}
.countheads ~ h2:before {
content: counter(h1counter) "." counter(h2counter) ".\0000a0\0000a0";
counter-increment: h2counter;
}
h2 {
counter-reset: h3counter;
}
.countheads ~ h3:before {
content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) ".\0000a0\0000a0";
counter-increment: h3counter;
}
h3 {
counter-reset: h4counter;
}
.countheads ~ h4:before {
content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) "." counter(h4counter) ".\0000a0\0000a0";
counter-increment: h4counter;
}
</style>
<style>
img {
float: left;
}
</style>
</head>
<body>
<h1 class="countheads"></h1>
<img src="NE0004.png" width="100%" height="100%" alt="">
<font size="15"><div style="text-align: center;">Elliott 803B Emulator and OpenGL ES 3 User Interface User Guide</div></font>
<p></p>
<h1>History</h1>
<p>
Development of this version of the 803 Emulator was prompted by the release of the
<a href="https://www.raspberrypi.org/products/raspberry-pi-4-model-b/">Raspberry Pi 4</a> in June 2019. Earlier
versions of the Pi had supported OpenGL ES 2 in full screen mode but this was the first version to support openGL ES 3 and
to provide integration with X Windows so that an open GL ES scene can be rendered in a GTK window.</p>
<p>There have been many previous version of the 803 Emulator stretching back over 30 years. They used a variety of different graphics libraries to
draw the numerous components of the machine. In respect of the number of machine components included, the current version is actually a big step backwards! </p>
<br clear="all">
<p>This is the last version that was based on GTK2 and you can see there are many more components included:</p>
<img src="OldEmulator1.png" width="100%" height="100%" alt="">
<br clear="all">
<img src="OldEmulator2.png" width="691" height="481" alt="">
<p>Development using two hands began in an early GTK3 version: </p>
<br clear="all">
<img src="drawers1.jpg" width="598" height="469" alt="">
<p>A much older GTK2 version had included some OpenGL 2 elements such as a set of drawers for holding paper tapes:</p>
<p>The plan is to add further hardware components over the coming months, starting with a full 3D version of the
Calcomp plotter.</p>
<br clear="all">
<h1>Installing the Emulator</h1>
<h2>Installing and Building the dependencies</h2>
<p>There are a number of tools and libraries that are needed to build the emulator application.</p>
<p>If you don't already have a C compiler installed on your system, add the
"build-essential" package to the command below.</p>
<p>
<code>sudo apt install automake autogen libtool git cmake libgtk-3-dev libgles2-mesa-dev libasound2-dev libiberty-dev
</code>
</p>
<p>Other packages will also be installed to meet all the dependencies.</p>
<p>The package names used above apply for Debian derived distributions and may be different on other distributions.</p>
<p>Two of the required libraries cannot be installed from packages.</p>
<h3>Building and installing CGLM</h3>
<p> The <a href="https://cglm.readthedocs.io/en/latest/">OpenGL Mathematics (glm) for C</a> library needs to be built from source.</p>
<code><br>
git clone https://github.com/recp/cglm.git<br>
cd cglm<br>
sh autogen.sh <br>
./configure <br>
make<br>
make check<br>
sudo make install<br>
sudo ldconfig<br>
</code>
<h3>Installing cgltf</h3>
<p><a href="https://www.khronos.org/gltf/">glTF</a> is the file format used to export the various 3D object models from <a href="https://www.blender.org/">blender</a> and to import them into the emulator.
</p>
<p><a href="https://github.com/jkuhlmann/cgltf">cgltf</a> is a "Single-file glTF 2.0 loader and writer written in C99"</p>
<code>
git clone https://github.com/jkuhlmann/cgltf.git
cd cgltf
sudo cp cgltf.h /usr/local/include
</code>
<h2>Building the emulator code from github</h2>
<p>The 803 Emulator is hosted on <a href="https://github.com/PeterOGB/3D803" target="github">github</a>.
</p>
To build the emulator run<br>
<code>
git clone https://github.com/PeterOGB/3D803-V1.git<br>
cd 3D803-V1<br>
cmake .<br>
make
</code>
<p>The emulator can be run from the build directory or installed in /usr/local/ </p>
<p>To place the executable into /usr/local/bin and other resources into /usr/local/share/803-Resources run <br>
<code>sudo make install<br>
</code>
<br>
</p>
<h1>User Interface</h1>
<img src="OpConsole.png" width="1030" height="799" alt="">
<br clear="all">
<h2>3D navigation</h2>
<p>The position and viewing direction of the 3D camera is controlled by a combination of keyboard key presses and mouse movements.
<br>[Developer Note: I use a tracker ball rather than a conventional mouse, so it could be that my choices of keys and
motion may not be the best when using a mouse. Let me know if you think it could be improved.]</p>
<table border bgcolor="#FFFFFF" >
<tr>
<th>Motion</th>
<th>Keys</th>
</tr>
<tr>
<td>Pan and Tilt</td>
<td>Shift</td>
</tr>
<tr>
<td>Rotate and Up/Down</td>
<td>Shift + Control</td>
</tr>
<tr>
<td>Left/Right and Forwards/Backwards</td>
<td>Control</td>
</tr>
</table>
<h2>Using two hands</h2>
<p>Controlling two pointer-like objects on the screen takes a bit of getting used to. There is still only one mouse
pointer and most of the time one of the hands (referred to below as the active hand) is tracking its position so
the mouse pointer itself can be hidden.</p>
<p>The active hand is constrained to stay over the console so the mouse pointer only becomes visible when the
hand reaches an edge and stops tracking the mouse. When the mouse pointer moves back over the console the active hand
starts to track the mouse again, starting from its previous position. This prevents any unrealistic jumping around
the screen by the hands.</p>
<p>To avoid having to deal with situations where the two hands would touch, the inactive hand is automatically moved
left or right to keep the left hand to the left of the right hand or to keep the right hand to the right of the left hand.</p>
<h3>Swapping Hands</h3>
<p>After trying several techniques this seems the most intuitive. </p>
<h4>When the left hand is the active hand</h4>
<p>Pressing the left mouse button will press the console button under the left index finger.</p>
<p>Pressing the right mouse button will make the right hand the active hand and it will start to track mouse movements</p>
<h4>When the right hand is the active hand</h4>
<p>Pressing the right mouse button will press the console button under the right index finger.</p>
<p>Pressing the left mouse button will make the left hand the active hand and it will start to track mouse movements</p>
<h3>Pressing Buttons</h3>
The hands have a slight "snap to button" behaviour to make it easier to press the required button without having to
position the hand too exactly.
<h3>Pressing the Operate Bar</h3>
<p>The <b>OPERATE</b> bar (see below) is depressed by simply moving the active hand down over it. The hand will be vertically
constrained once the bar is fully pressed.</p>
<h2>Command line options</h2>
<pre>
803 --help
Usage:
803 [OPTION…] - Elliott 803 Emulator
Help Options:
-?, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options
Application Options:
-l, --loadcorefile Load the core store from file.
-s, --savecorefile Save the core store to file.
-w, --windowsize Window size as widthxheight.
-h, --handswap Use old (right click) hand swap method.
-D, --device Select ALSA output device.
--display=DISPLAY X display to use
</pre>
<h3>Loading and saving core files</h3>
<p>These options are used to load and save alternative core store images. </p>
<h3>Window sizing</h3>
<p>The default window is 800x600 pixels and (currently) cannot be resized. Use this option to change the window size e.g. "-w 1024x768" .</p>
<h3>Hand swapping</h3>
<p>Earlier versions of the emulator used the right mouse button to toggle between left and right hands. This option reverts to that behaviour.</p>
<h3>Sound device selection</h3>
<p>The emulator depends on the sound output running at 48kHz sampling to maintain the correct instruction execution rate. It has been found that some video/audio conferencing tools
can cause the sample rate to change on already opened sound streams. This is probably a bug ! When it happens the rate changes from 48kHz to 44.1kHz making the emulator run ~8% slow.
The same effect has been observed with sound from other applications causing speech and music to sound "flat".</p>
<p>This option has been added to allow an alternative output device to be used if one is available.</p>
<p> ALSA device naming is a bit archaic. Use aplay -L to get a list of the available ALSA devices. The list below shows an edited version of the output
with HDMI and surround sound and other inappropriate devices removed (for brevity).
Suitable device names are shown in <b>bold</b> . Names starting with "plug" can be used if the underlying hardware does not support 48kHz signed 16 bit little endian sampling. This is why
"hw:CARD=M2X2,DEV=0" is not in bold as it only supports 32 bit samples.
</p>
<pre>aplay -L
<b>default</b>
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=PCH
HDA Intel PCH, ALC221 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC221 Analog
Front speakers
.....
<b>hw:CARD=PCH,DEV=0</b>
HDA Intel PCH, ALC221 Analog
Direct hardware device without any conversions
<b>plughw:CARD=PCH,DEV=0</b>
HDA Intel PCH, ALC221 Analog
Hardware device with all software conversions
.....
<b>hw:CARD=Pro,DEV=0</b>
SB X-Fi Surround 5.1 Pro, USB Audio
Direct hardware device without any conversions
<b>plughw:CARD=Pro,DEV=0</b>
SB X-Fi Surround 5.1 Pro, USB Audio
Hardware device with all software conversions
....
hw:CARD=M2X2,DEV=0
M-Track 2X2, USB Audio
Direct hardware device without any conversions
<b>plughw:CARD=M2X2,DEV=0</b>
M-Track 2X2, USB Audio
Hardware device with all software conversions
</pre>
<p>See https://www.volkerschatz.com/noise/alsa.html for some more info on ALSA, and a useful tool called "<a href="https://www.volkerschatz.com/noise/alsa.html#alsacap">alsacap"</a> which gives more details on each devices capabilities
</p>
<h1>The Elliott 803 Operator's Console</h1>
<h2>Power Buttons</h2>
<img src="PowerSwitches.png" width="648" height="209" alt="">
<p>The 803's power supply includes a large NiCd battery that could keep the CPU running for a few seconds during a short mains
failure or brown out. These were more common in the 1960s. In normal operation the battery is floating across the battery charger
output with the battery charger providing the power needed to actually run the 803. </p>
<p>The <b>BATTERY ON</b> and <b>BATTERY OFF</b> buttons control the mains supply to the battery charger and connect and disconnect the battery and the charger. </p>
<p>The <b>COMPUTER ON</b> and <b>COMPUTER OFF</b> buttons connect and disconnect the battery and the computer.</p>
<p>The control circuitry keeps the battery connected to the computer during a mains failure, but disconnects them before the battery voltage drops too low.
Although this behaviour is modelled inside the emulator, it's not obvious because there is no display of the battery charger voltage and current meters in the
current release. These meters will be added in a later release.
</p>
<p>The Dymo tape warning about switching the battery off first was attached to the console of the 803 at Loughborough Grammar School.</p>
<br clear="all">
<h2>Control Buttons</h2>
<img src="ModeAndControl.png" width="290" height="215" alt="">
<p>The lower three buttons <b>READ</b>, <b>NORMAL</b> and <b>OBEY</b> are radio buttons so only one can be pressed at a time. These determine the action taken
when the <b>OPERATE</b> bar is pressed. </p>
<p><b>READ</b> The Instruction set on F1 and N1 of the word generator (see below) is transferred to the instruction register ready to be executed. </p>
<p><b>NORMAL</b> The instruction in the instruction register is executed, and the normal fetch / execute cycle continues. The machine is said to "running" and
the <b>STEP BY STEP</b> lamp is extinguished.</p>
<p><b>OBEY</b> After the instruction in the instruction register is executed and the next instruction has been fetched from store, then the machine stops with
the <b>STEP BY STEP</b> lamp illuminated.
Repeatedly pressing the <b>OPERATE</b> bar will thus execute a program one instruction per press.</p>
<p>The normal way to stop the machine when it is running is to press the <b>OBEY</b> button although pressing <b>READ</b> will have the same effect. The machine will finish the
current instruction then stop with the <b>STEP BY STEP</b> lamp illuminated.</p>
<p>The <b>RESET</b> button is pressed to stop the machine if the current instruction cannot be completed for example due to a peripheral fault.</p>
<p>The <b>CLEAR STORE</b> button causes all instructions read from store to be executed as no ops, and for a no op instruction to be written back into the store.
In this way setting the machine to run with <b>CLEAR STORE</b> pressed (it is a latching button) will eventually set all locations to all zeros. This is called a <b>Clear Store</b>.</p>
<p>The <b>MANUAL DATA</b> button is only active during a "70" instruction. This instruction transfers the value set on the word generator (see below) to the accumulator.
If <b>MANUAL DATA</b> is pressed (it is a latching button) the machine will stop with the <b>BUSY</b> lamp illuminated. This gives the operator a chance to change the word generator
value before it is transferred. The 70 instruction is allowed to finish by either releasing <b>MANUAL DATA</b> or by pressing the <b>OPERATE</b> bar.</p>
<br clear="all">
<h2>Selected Stop</h2>
<p>In modern terminology this enables a "Hardware Break Point". In is used in conjunction with the setting on Address 2. When it is pressed, the machine stops
immediately before executing either of the instructions in the location set on the Address 2 buttons. The <b>OPERATE</b> bar is used to continue execution. </p>
<h2>OPERATE bar</h2>
<img src="operate2.gif" width="320" height="240" alt="">
<p>As described above this is used in conjunction with <b>READ</b>, <b>NORMAL</b>, <b>OPERATE</b>, <b>MANUAL DATA</b> and <b>SELECTED STOP</b> buttons.</p>
<p>It is also used if the machine stops due to a store parity error (<b>PARITY</b> and <b>STEP BY STEP</b> lamps illuminated) or due to a
floating point overflow (<b>FLOATING POINT OVERFLOW</b> and <b>STEP BY STEP</b> lamps illuminated). </p>
<p> On the emulator the first condition can never arise (except at power on).
Continuing a program run after a floating point overflow is unlikely to produce useful numerical results!</p>
<br clear="all">
<h2>Status Indicators</h2>
<img src="Indicators.png" width="169" height="550" alt="">
<p><b>PARITY</b> All reads from the 803's core store are parity checked. If this check fails the lamp illuminates and the machine stops.</p>
<p><b>BLOCK TRANSFER</b> This lamp comes on in two situations. 1) When a block of data is being transferred between the core store and a peripheral
2) When the CPU is executing a long instruction such as a shift or multiply. </p>
<p><b>BUSY</b> All peripherals have the ability to make the CPU wait until they are ready. While the CPU is waiting this lamp is illuminated. </p>
<p><b>FLOATING POINT OVERFLOW</b> If the result of a floating point operation lies outside of the range that can be represented the machine stops with this lamp illuminated.</p>
<p><b>STEP BY STEP</b> This is illuminated whenever the machine is stopped.</p>
<p><b>OVERFLOW </b> This lamp is connected to the integer overflow signal. It will often be illuminated during normal program operation.</p>
<br clear="all">
<h2>Word Generator</h2>
<img src="WordGenerator.png" width="637" height="608" alt="">
<p>An 803 word consists of 39 bits, and each bit has an associated latching button. The bits in a word are arranged as into two groups of 19 bits with a single bit between them.
Each group of 19 bits is further divided into a 6 bit group and a 13 bit group.</p>
<p>The 6 bit groups are an op-codes and the 13 bit groups are an address and together they make up a single instruction.</p>
<p>The 39 buttons of the word generator are laid out to match this structure.</p>
<p><b>FUNCTION 1 (F1)</b> The 6 bits of the opcode for first instruction in a word. They are labelled with octal digit values.</p>
<p><b>ADDRESS 1 (N1)</b> The 13 bits of the address for first instruction in a word. They are labelled with their decimal value. This row also has a red button (labelled B) for the bit
between the instructions.</p>
<p><b>FUNCTION 2 (F2)</b> The 6 bits of the opcode for second instruction in a word. They are labelled with octal digit values.</p>
<p><b>ADDRESS 2 (N2)</b> The 13 bits of the address for second instruction in a word. They are labelled with their decimal value.</p>
<p>Each row also has a red release button which sets all the buttons to their up (zero) state.</p>
<p>The instruction F1 N1 is transferred to the instruction register when the <b>OPERATE</b> bar is pressed in <b>READ</b> mode.</p>
<p>The address N2 is used with the <b>SELECTED STOP</b> button for program debugging.</p>
<p>The left most bit of F1 is referred to a the "sign bit". Toggling its state is used to release an Algol system wait. The left most bit of F2 is used to release an Algol data wait.</p>
<p>F1 is often set to octal 40 (a jump instruction) and N1 is set to a program entry address.</p>
<br clear="all">
<h2>Volume Control and Sound Effects</h2>
<img src="Volume.png" width="259" height="157" alt="">
<p>On the real 803 the loud speaker is driven by an amplifier that is connected to the top bit of the instruction register. When the instruction being executed has
that bit set the loud speaker is turned on for the duration of the instruction. The volume control reduces the signal sent to the loud speaker.</p>
<p>In the emulator a similar process is used to generate sample data that is sent to the default ALSA sound device. These samples are mixed with the sound effects
triggered by pressing and releasing console buttons. These sound effects were recorded by operating buttons on a real 803 console.</p>
<p>The volume control is adjusted by pressing on it and moving the hand.</p>
<br clear="all">
<h1>Calcomp Plotter </h1>
<h1>Extra Buttons</h1>
<img src="Widgets.png" width="365" height="87" alt="">
<br clear="all">
<h3>Mains Switching</h3>
<p>A proper mains isolation switch will be included in a later release. For now use these buttons to turn the mains supply on and off.</p>
<h3>Reset View</h3>
<p>This returns the 3D camera to a default position in front of and pointing at the console. Use it if you "get lost" and can't see the console. </p>
<h3>Quit</h3>
<p>While the contents of the core store are saved in a file, other registers are not, so unless a program has explicit suspend and continue features it can only be restarted
when the machine is turned on again.</p>
<h1>The underlying machine emulation</h1>
<p>The actual machine emulation has been unchanged for many years. It is paced by the ALSA device's need for new sound samples to keep its buffers full. The
"buffer empty" condition was originally detected in the GTK main event loop, but this could cause sound under runs if the event loop was stalled handling some graphics events.
In this version the machine emulation and ALSA event polling have been put into their own thread which has eliminated sound under-runs. The emulation thread communicates with the
user interface code via thread safe event queues.</p>
<h2>Accuracy</h2>
<p>There is an "803 simulator" out there on the web which fails to pass the floating point unit test program (X5). It should not be considered to be an accurate simulation because
it produced the wrong (in the sense of being different to a real 803) numerical results.</p>
<p>Internally this emulation operates at the "word time" level, performing exactly the same processing steps to execute instructions as the real machine. This allows it to produce exactly the same
results as the real machine, right down to the nuances of the mantissa rounding used in the floating point instructions.
</p>
<h2>Speed</h2>
<p>The emulation runs ~1.2% slower than the real 803. It creates 14 sound samples for each word time taken by an instruction, which at 48kHz sampling rate gives
14 * 1/48000 = 292 uS per word time compared to 288 uS on the real 803. This is only possible because (as mentioned above) the emulation runs at the "word time level" and exactly
follows the steps taken at each word time by the real machine. </p>
<h1>Beginning Sequence</h1>
<p>Included in the original 803 documentation is T.I.S. 57.2.8.64 titled "GENERAL OPERATIONS AND MAINTENANCE
OF THE 803B COMPUTER". It contains a hand drawn labelled illustration of the operators console, and this has been
recreated using a screen shot from the emulator. </p>
<p>"Learner" operators should take particular note in the bottom right hand corner :-) </p>
<img src="Beginning.png" width="100%" height="100%" alt="">
<br clear="all">
<p>Don't forget to turn the Mains supply on first, otherwise nothing will happen !</p>
<p>The Paper Less Tape Station (PLTS) can be connected to the emulation before the machine is turned on.</p>
<p>The Computer Off, Battery Off and Mains Off buttons <b>should</b> be pressed (in that order) before the Quit button is pressed.</p>
<h1>Using the Algol 60 compiler</h1>
<p>Elliotts provided an Algol 60 compiler for the 803. It is program A104 in the 803 program library and luckily the paper tapes for this have survived.
Successfully running the compiler for the first time (many years ago now) was a major milestone in the emulator development.</p>
<p>The<a href="http://www.billp.org/ccs/A104/"> A104 manual </a> is available online, and also an excellent
<a href="http://www.billp.org/ccs/ElliottAlgol/">analysis of its internal operation</a> by Bill Purvis. </p>
<p>If you have used Algol 60 before your attention is drawn to the manual section <a href="http://www.billp.org/ccs/A104/page05.html">ELLIOTT 803 HARDWARE REPRESENTATION</a>
which lists the conventions used to overcome the limited character set available in Elliott five hole telecode.</p>
<br clear="all">
<img src="803A104Sigs.png" width="418" height="154" alt="">
<p>I was able to get my own copy of the A104 manual signed by the three authors at a seminar they attended in 2008. You may recognise the name "C.A.R. Hoare" as
the inventor of the "Quicksort" algorithm who after leaving Elliotts went on to become a famous computer scientist.</p>
<br clear="all">
<h2>Loading the Algol compiler tapes</h2>
<img src="AlgolTapes.png" width="477" height="274" alt="">
<p>The compiler comes on two paper tapes, known as "Tape One" and Tape "Two" ! If you follow the "Typical beginning" instructions above, and at step 6 (or 9) use the PLTS to
put Tape One into the reader, then after the tape has been read the machine will stop while emitting a steady high pitched tone from the loud speaker so make sure the volume is
turned up sufficiently. This is called the <b>System Wait</b>. At this point load Tape Two and then toggle the sign bit (left most button on Function 1 row) on the word generator.
Once the tape is loaded another System Wait is entered and the compiler is ready to read a program. </p>
<br clear="all">
<h2>Creating your Algol program tapes</h2>
<p>See the Paper Less Tape Station User Manual for instructions on using the Tape Editor. Here is a suggestion for your first Algol 60 program:</p>
<pre>
MULTIPLICATION SQUARE'
BEGIN INTEGER A,B'
FOR A := 0 STEP 1 UNTIL 12 DO
PRINT SAMELINE,DIGITS(3),A'
FOR A := 1 STEP 1 UNTIL 12 DO
BEGIN
PRINT DIGITS(3),A'
FOR B := 1 STEP 1 UNTIL 12 DO
PRINT SAMELINE,DIGITS(3),A*B'
END'
END'
</pre>
<p>After you have typed it in and saved it to a file, make sure you remember to upload it into the reader. Then release the <b>System Wait</b> and watch and listen
in awe as the compiler does its stuff. </p>
<p>When the program has successfully been compiled and is ready to run, the compiler enters a <b>Data Wait</b> which produces a two tone warble from the loud speaker. The wait
is released by toggling the left most button on the Function 2 row of the word generator.</p>
<h2>The Edit/Compile/Run cycle</h2>
<p>The Algol compiler normally runs in a "Load and Go" mode, with the compiler remaining in store while the compiled program runs. In such cases when the program finishes the message
"END OF PROGRAM" is printed and a <b>System Wait</b> is entered. To start compiling the next program simply release the wait.</p>
<br clear="all">
<img src="JumpTo7.png" width="437" height="136" alt="">
<p>However, there are a number of circumstances where the compiler will stop with a <b>Dynamic Stop</b> which produces a slightly higher pitched tone. In these cases the compiler must be manually
restarted by setting up a "Jump to location 7" instruction on the word generator. The sequence <b>READ</b> <b>OPERATE</b> <b>NORMAL</b> <b>OPERATE</b> (which will become second nature) starts the compiler again.</p>
<br clear="all">
<img src="AlgolError2.png" width="816" height="461" alt="">
<p>When the compiler finds a syntax error in the program being compiled it copies the text following the error to the teleprinter then stops with a <b>System Wait</b> to allow the operator
to gently put a mark on the tape in the reader to show the approximate position of the error. This is the reason the the "Reader Echo" feature is provided in the PLTS, to allow the user to
see where the tape stopped after an error. When the <b>System Wait</b> is released the compiler continues to read the program but only checking the syntax for further errors. At the end of the tape
the compiler will stop in a <b>Dynamic Stop</b>.</p>
<p>This example shows where the compiler stopped after detecting the missing "L" in "UNTIL". </p>
<p>Algol error numbers are listed on <a href="http://www.billp.org/ccs/A104/page35.html">pages 35-37</a> of the manual </p>
<p>My favourite error is number 49,"Program too large or complex to be compiled at all." I like that "at all" is added at the end so there can be no doubt about it.</p>
<br clear="all">
<h1>Using the HCode Compiler</h1>
<p>HCode was developed by the Research Division of Brush Electrical Engineering. It has similarities with other "autocodes" of the era.
The <a href="https://www.peteronion.org.uk/803Documentation/HCODE_manual.pdf">HCode manual</a> is available as is an original
<a href="https://www.peteronion.org.uk/803Documentation/HCODE_intro.pdf">tutorial document</a> </p>
<h2>Loading the HCode compiler tape</h2>
<p>The compiler comes on single paper tape. If you follow the "Typical beginning" instructions above, and at step 6 (or 9) use the PLTS to
put the HCode tape into the reader, then after the tape has been read the machine will stop while emitting a steady high pitched tone from the loud speaker so make sure the volume is
turned up sufficiently. This is called a <b>Dynamic Stop</b>.</p>
<h2>Creating your HCode program tapes</h2>
<p>See the Paper Less Tape Station User Manual for instructions on using the Tape Editor. Here is a suggestion for your first HCode program:</p>
<pre>
:SETR(MAIN)
:SETS(R,C)
:DEFINE(MAIN)
'
'
1 £ C
:DO(12)
C:3
1:ON(C)
:REPEAT
1 £ R
:DO(12)
'
'
R:3
1 £ C
:DO(12)
R*C:3
1:ON(C)
:REPEAT
1:ON(R)
:REPEAT
'
'
:STOP
:CLOSE
:START(0,MAIN)
::
</pre>
<h2>The Edit/Compile/Run cycle</h2>
<p>The HCode compiler remains resident in store while programs are run, so there is no need to reload the compiler before each compilation.
The compiler is started by setting a "Jump to 512" ( 40 512 ) on the F1/N1 buttons of the Word Generator (see earlier Word Generator section) followed by a Read/Operate/Normal/Operate sequence.</p>
<p>When the compiler reads the final "::" it will enter a "wait" state. The compiled program is then run by by setting a "Jump to 513" ( 40 513 ) on the F1/N1 buttons of the Word Generator
(see earlier Word Generator section) followed by a Read/Operate/Normal/Operate sequence. </p>
<p>When the running programme reaches the ":STOP" instruction the machine enters a "dynamic stop". The programme can be re-run by jumping to 513 again, to the compiler can be restarted by jumping to 512. </p>
<h2>HCode Error messages</h2>
<p>HCode's error reporting is very simple. On detecting an error the compiler stops reading the input tape and outputs a repeated single letter code on the teleprinter. The meaning of the code
has to be looked up inthe HCode manual.</p>
<h1>Known Problems</h1>
<h2>Overlapping windows</h2>
<p>Under some circumstances when other windows overlap the emulator window and the view has been moved so that one of the hands is out of sight, then sometimes when the mouse enters the
emulator window the cursor is incorrectly warped to a position outside of the emulator window. The exact circumstances are unclear and thus reproducing and fixing the bug is hard !
</p>
<br clear="all">
<h1>Licences</h1>
<h2>Hand Model</h2>
<p>The hand model came from DennisH2010 https://3dhaupt.com/3d-model-anatomy-rigged-hands-low-poly-vr-ar-game-ready-blender/
The licence is "You can use this rigged hand free for non-commercial or educational purpose." I've used the hand mesh but added my own rigging to get the control I needed to
pose the hands and fingers as needed.</p>
<h2>This document</h2>
<p id="terms" xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#" class="license-text"><a rel="cc:attributionURL" href="https://github.com/PeterOGB/Instructions"><span rel="dct:title">Elliott 803B Emulator and OpenGL ES 3 User Interface User Guide</span></a> by <span rel="cc:attributionName">Peter Onion</span> CC BY-NC-SA 4.0<a href="https://creativecommons.org/licenses/by-nc-sa/4.0"><img style="height:22px!important;margin-left: 3px;vertical-align:text-bottom;float:none" src="https://search.creativecommons.org/static/img/cc_icon.svg" /><img style="height:22px!important;margin-left: 3px;vertical-align:text-bottom;float:none" src="https://search.creativecommons.org/static/img/cc-by_icon.svg" /><img style="height:22px!important;margin-left: 3px;vertical-align:text-bottom;float:none" src="https://search.creativecommons.org/static/img/cc-nc_icon.svg" /><img style="height:22px!important;margin-left: 3px;vertical-align:text-bottom;float:none" src="https://search.creativecommons.org/static/img/cc-sa_icon.svg" /></a></p>
<h2>The software</h2>
<p>
<a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPL V3</a> Copyright © 2020 Peter Onion</p>
</html>