-
Notifications
You must be signed in to change notification settings - Fork 0
/
gt40-2.html
288 lines (245 loc) · 16.5 KB
/
gt40-2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>fritzm.github.io - GT40 Terminal II: Lunar Lander</title>
<meta name="description" content="">
<meta name="author" content="Fritz Mueller">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="https://fritzm.github.io/theme/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link href="https://fritzm.github.io/theme/bootstrap.min.css" rel="stylesheet">
<link href="https://fritzm.github.io/theme/bootstrap.min.responsive.css" rel="stylesheet">
<link href="https://fritzm.github.io/theme/local.css" rel="stylesheet">
<link href="https://fritzm.github.io/theme/pygments.css" rel="stylesheet">
<!-- Photoswipe -->
<link rel="stylesheet" href="https://fritzm.github.io/theme/photoswipe.css">
<link rel="stylesheet" href="https://fritzm.github.io/theme/default-skin/default-skin.css">
<script src="https://fritzm.github.io/theme/photoswipe.min.js"></script>
<script src="https://fritzm.github.io/theme/photoswipe-ui-default.min.js"></script>
<script src="https://fritzm.github.io/galleries.js"></script>
<script type="text/javascript">
var pswipe = function(gname, index) {
var pswpElement = document.querySelectorAll('.pswp')[0];
var items = galleries[gname];
var options = { index: index };
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
gallery.init();
};
</script>
<!-- So Firefox can bookmark->"abo this site" -->
<link href="https://fritzm.github.io/feeds/all.rss.xml" rel="alternate" title="fritzm.github.io" type="application/rss+xml">
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="https://fritzm.github.io">fritzm.github.io</a>
<div class="nav-collapse">
<ul class="nav">
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="content">
<div class="row">
<div class="span9">
<div class='article'>
<div class="content-title">
<h1>GT40 Terminal II: Lunar Lander</h1>
Fri 01 September 2023
by <a class="url fn" href="https://fritzm.github.io/author/fritz-mueller.html">Fritz Mueller</a>
</div>
<div><p><em>[Continuation of restoration work on a DEC GT40 graphic display terminal; part one
<a href="https://fritzm.github.io/gt40.html">here</a>.]</em></p>
<p>At this point, Scott had taken over the restoration work as I had had to leave town for work. We consulted a
few times via IMs and video calls over the next couple weeks; the following is a narrative of Scott's
continued work on the project as I understood it remotely.</p>
<p>The next thing that needed doing was to replace the failed microcode PROM described at the end of the previous
article. I did some work to manually transcribe the PROM contents from the binary microcode listings included
in the engineering drawings (4 bits x 256 microcode locations). Scott double-checked my work here and found
and fixed at least three transcription errors (always good to have a double check on tedious tasks like this,
and I seem to be developing a worsening dyslexia with age -- thanks, Scott!)</p>
<p>Scott tracked down and burned a replacement PROM and replaced the failing one on the board, and we were back
again to the previous high water mark (able to run toggle in programs and the ROM bootstrap terminal emulator,
with the same linefeed and binary load failures I had seen previously).</p>
<p>Scott played around with the binary loader for a bit, but it seemed to be suffering a pretty frustrating blend
of several different issues. Attention was turned back to the bootstrap ROM terminal emulator LF handling
problem, which was consistent and repeatable. Scott began single stepping the code by instruction, using the
listings in the GT40/GT42 User's Guide, and soon made two discoveries:</p>
<ul>
<li>
<p>The unit has the GT42 version of the boostrap ROM, and not the GT40 version (this can be seen because
the bootstrap terminal emulator correctly handles TAB characters).</p>
</li>
<li>
<p>Upon receiving a LF char, the bootstrap code got to a loop which was scanning the input buffer looking for
LFs, but failed to find any and looped indefinitely.</p>
</li>
</ul>
<p>The malfunctioning ROM code scanning for LFs can be seen at location 166310, in the listing on PDF page 81 of
the GT40/GT42 User's Guide, and is as follows:</p>
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4
5
6</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="nt">166310</span> <span class="nt">122300</span> <span class="nt">LFLOOP</span><span class="o">:</span> <span class="nt">CMPB</span> <span class="o">(</span><span class="nt">SCAN</span><span class="o">)+,</span><span class="nt">CHAR</span> <span class="o">;</span><span class="nt">AND</span> <span class="nt">LOOK</span> <span class="nt">FOR</span> <span class="nt">A</span> <span class="nt">LINEFEED</span>
<span class="nt">166312</span> <span class="nt">001406</span> <span class="nt">BEQ</span> <span class="nt">LFOUND</span> <span class="o">;</span><span class="nt">GOT</span> <span class="nt">IT</span><span class="o">,</span> <span class="nt">SEARCH</span> <span class="nt">HAS</span> <span class="nt">ENDED</span>
<span class="nt">166314</span> <span class="nt">020327</span> <span class="nt">007000</span> <span class="nt">CMP</span> <span class="nt">SCAN</span><span class="o">,</span><span class="p">#</span><span class="nn">BLIMIT</span> <span class="o">;</span><span class="nt">ARE</span> <span class="nt">WE</span> <span class="nt">AT</span> <span class="nt">END</span> <span class="nt">OF</span> <span class="nt">BUFFER</span><span class="o">?</span>
<span class="nt">166320</span> <span class="nt">103773</span> <span class="nt">BLO</span> <span class="nt">LFLOOP</span> <span class="o">;</span><span class="nt">NOPE</span><span class="o">,</span> <span class="nt">KEEP</span> <span class="nt">ON</span> <span class="nt">LOOKING</span><span class="o">.</span>
<span class="nt">166322</span> <span class="nt">012703</span> <span class="nt">001000</span> <span class="nt">MOV</span> <span class="p">#</span><span class="nn">BSTART</span><span class="o">,</span><span class="nt">SCAN</span> <span class="o">;</span><span class="nt">IF</span> <span class="nt">AT</span> <span class="nt">TOP</span><span class="o">,</span> <span class="nt">RESET</span> <span class="nt">TO</span> <span class="nt">BOTTOM</span> <span class="nt">OF</span> <span class="nt">BUFFER</span>
<span class="nt">166326</span> <span class="nt">000770</span> <span class="nt">BR</span> <span class="nt">LFLOOP</span> <span class="o">;</span><span class="nt">AND</span> <span class="nt">KEEP</span> <span class="nt">ON</span> <span class="nt">LOOKING</span><span class="o">.</span>
</pre></div>
</td></tr></table>
<p>Scott began microstepping at address program address 166310, which is machine code 122300, <code>CMPB (R2)+,R0</code>.
The microcode flow traced through is as follows, using state names from the microcode listings in the
engineering drawings:</p>
<ul>
<li><code>H-2</code>: Tracing activity starts with the machine halted and looping in microstate H-2. The KM11 is set to
manual clock mode, front panel CONT switch depressed and held, and several manual clocks taken causing
microbranch to...<br><br></li>
<li><code>CCS-1</code>: Loads B←PC, causing PC to be displayed on console lights.</li>
<li><code>CCS-2</code>: Loops waiting for CONT switch to be released.</li>
<li><code>CCS-3</code>: Turns on RUN light.<br><br></li>
<li><code>F-1</code>: Loads BA←PC, and initiates asynchronous bus cycle to fetch instruction.</li>
<li><code>F-2</code>: Loads B←PC+2, causing next instruction address to be displayed on console lights.</li>
<li><code>F-3</code>: Loads PC←B, updating the PC, and suspends processor clock until instruction fetch bus cycle reaches
SSYN.</li>
<li><code>F-4</code>: Resumes here when fetched instruction is on bus; latches into B (displaying instruction on console
lights) and also into the IR decode register; releases the bus.</li>
<li><code>F-5</code>: First big microcode branch based on instruction type.<br><br></li>
<li><code>S2-1</code>: Source addressing mode 2 (register auto-increment). BA←R[S], and initiates asynchronous bus cycle to
read source operand from memory.</li>
<li><code>S2-2</code>: B←R[S]+1+BYTE.BAR, which increments the source register by 1 or 2 depending on byte or word
instruction.</li>
<li><code>S2-3</code>: R[S]←B (stores back incremented source register), suspends processor clock until source operand
fetch bus cycle reaches SSYN.</li>
<li><code>S1-2</code>: Resumes here when source operand is on bus; latches into B (displaying source operand on console
lights) and releases the bus, then branches on byte even, byte odd, or word.</li>
</ul>
<p>So far so good. In the case being traced, we happen to be doing a byte read from an odd address. In this
case, the fetched source data must next be shifted right 8 bits; this is done over the course of the next 8
microsinstructions, <code>SBO-1</code> - <code>SBO-8</code>. Here Scott noticed a problem: bit 3 was always set in the B register
after <em>any</em> single right shift, even if the bit4 to the left was zero. This points directly at E044 on sheet
DPA, a four bit shift register which implements bits 0:3 of the B-register:</p>
<p><img style="display:block; margin-left:auto; margin-right:auto" src="/images/pdp11/KD11-B-bad-BREG-shift.png" title="KD11-B data path bad BREG shift register" width="85%"/></p>
<p>This part was pulled and replaced, and the ROM terminal emulator could then correctly handle LFs! After a
few additional red herring to do with loose power connectors and occasional accidental bumping of the test
switches on the M7013 display control board, Scott was also able to get the lunar lander code to load and run
via the ROM bootstrap binary loader, though still with some display problems:</p>
<p><img src='/images/pdp11/gt40-line-feeds_thumbnail_tall.jpg' title='GT40 displaying multiple lines after CMPB (R2)+,R0 LF fix.' onclick='pswipe("pdp11",113);'/>
<img src='/images/pdp11/gt40-first-lunar-run_thumbnail_tall.jpg' title='GT40 running the lunar lander game, but still with some display issues.' onclick='pswipe("pdp11",114);'/></p>
<p>Scott discovered a major clue concerning remaining loader problems: some GT40 binary-loader encoded binaries
we had been using which were downloaded off other enthusiast web sites contained erroneous extra linefeed and
"!" characters, which confused the loader and/or triggered bad checksums. After stripping these out, the
loader was seen to work quite reliably.</p>
<p>With diagnostics now in hand, Scott was able to track down a few remaining hardware issues on the display
boards (a bad register with a stuck high bit, and a swap of one of the DACs which had been acting flaky with
one from a spare board. I don't have precise details on these particular fixes, but will expand here later
if/when I get more information.)</p>
<p>Below, screen shots of some diagnostics, and at long last, Scott lands on the moon and gets his cheeseburger!
Drop by and visit Scott at his booth at VCFMW this weekend, see and play game, and hear tales of the
restoration first-hand!</p>
<p><img src='/images/pdp11/gt40-diags_thumbnail_tall.jpg' title='Repaired GT40 running diagnostic MAINDEC-DDGTE.' onclick='pswipe("pdp11",115);'/>
<img src='/images/pdp11/gt40-lunar-better_thumbnail_tall.jpg' title='Repaired GT40 running the lunar lander game.' onclick='pswipe("pdp11",116);'/>
<img src='/images/pdp11/gt40-cheeseburger_thumbnail_tall.jpg' title='Repaired GT40: Scott lands on the moon and gets his cheesburger!' onclick='pswipe("pdp11",117);'/></p></div>
<hr>
</div>
</div>
<div class="span3">
<div class="well" style="padding: 8px 0; background-color: #FBFBFB;">
<ul class="nav nav-list">
<li class="nav-header">
Site
</li>
<li><a href="https://fritzm.github.io/archives.html">Archives</a>
<li><a href="https://fritzm.github.io/tags.html">Tags</a>
<li><a href="https://fritzm.github.io/feeds/all.rss.xml" rel="alternate">RSS feed</a></li>
</ul>
</div>
<div class="well" style="padding: 8px 0; background-color: #FBFBFB;">
<ul class="nav nav-list">
<li class="nav-header">
Categories
</li>
<li><a href="https://fritzm.github.io/category/arcade-games.html">Arcade Games</a></li>
<li><a href="https://fritzm.github.io/category/math.html">Math</a></li>
<li><a href="https://fritzm.github.io/category/micros.html">Micros</a></li>
<li><a href="https://fritzm.github.io/category/pdp-11.html">PDP-11</a></li>
<li><a href="https://fritzm.github.io/category/programming.html">Programming</a></li>
<li><a href="https://fritzm.github.io/category/radios.html">Radios</a></li>
</ul>
</div>
<div class="social">
<div class="well" style="padding: 8px 0; background-color: #FBFBFB;">
<ul class="nav nav-list">
<li class="nav-header">
Social
</li>
<li><a href="http://facebook.com/fritzmueller">facebook</a></li>
<li><a href="http://instagram.com/infrafritz">Instagram</a></li>
<li><a href="http://www.linkedin.com/pub/fritz-mueller/a/679/62/">LinkedIn</a></li>
<li><a href="http://jsfiddle.net/user/fritzm/fiddles/">JSFiddle</a></li>
<li><a href="https://github.com/fritzm">GitHub</a></li>
</ul>
</div>
</div>
</div>
</div> </div>
<footer>
<br />
<p><a href="https://fritzm.github.io">fritzm.github.io</a> © Fritz Mueller 2023</p>
</footer>
</div> <!-- /container -->
<!-- Photoswipe -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="pswp__bg"></div>
<div class="pswp__scroll-wrap">
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://fritzm.github.io/theme/bootstrap-collapse.js"></script>
</body>
</html>