<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Retrocomputing on His Deeds Are Dust</title>
    <link>https://hisdeedsaredust.com/tags/retrocomputing/</link>
    <description>Recent content in Retrocomputing on His Deeds Are Dust</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-gb</language>
    <copyright>Paul Flo Williams</copyright>
    <lastBuildDate>Tue, 24 Feb 2026 14:48:00 +0000</lastBuildDate><atom:link href="https://hisdeedsaredust.com/tags/retrocomputing/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Selecting 8051 tools</title>
      <link>https://hisdeedsaredust.com/posts/2026/8051-tools/</link>
      <pubDate>Tue, 24 Feb 2026 14:48:00 +0000</pubDate>
      
      <guid>https://hisdeedsaredust.com/posts/2026/8051-tools/</guid>
      <description>&lt;p&gt;In 1997, I first dumped the ROM from a DEC VT320 video terminal and decided to
try to decode it. The processor in these terminals is a member of Intel’s MCS-51
family of microcontrollers, in this case a Siemens SAB8031A, with a
64 KiB ROM.&lt;/p&gt;
&lt;p&gt;I wrote a disassembler and simulator (both long since lost) and started trying
to decode the ROM, having never used an 8051 before. I got the disassembler to
only decode the parts that I needed, following the call path so as not to get
confused by what I assumed would be large chunks of data in there. I still have
a printout from February 1998 of the state of annotated disassembly at the time,
tiny lettering on 112 lines-per-page printout, running to 67 pages. I had to
give up soon after coaxing the simulated terminal through the power-on
self-test, thinking that there were probably subtleties of the 8051 instruction
execution that I had got wrong, because I didn’t know how to stimulate it into
doing anything interesting.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&#34;vt320-circuit-cover.jpg&#34; alt=&#34;A close-up of part of the circuit board
of a VT320 terminal, showing the 8031 processor, ROM, 2681 DUART, EEPROM and a
gate array&#34;/&gt;
&lt;figcaption&gt;Close-up of a VT320 circuit board.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Nearly 20 years later, I&amp;rsquo;ve come across that printout and decided that, in the
wake of my &lt;a href=&#34;https://vt100.net/dec/vt100/rom/&#34;&gt;annotated disassembly of the VT100 video terminal&lt;/a&gt;, I&amp;rsquo;d give
my favourite terminal another go.&lt;/p&gt;
&lt;p&gt;The VT100 uses an 8080, and for that project I quite easily found a disassembler
and 8080 simulator core written in C that I could reuse to get the terminal&amp;rsquo;s
code running. Finding 8051 tools has proven slightly more frustrating.&lt;/p&gt;
&lt;p&gt;I started with the disassembler, which was simple enough. Jeffery L. Post&amp;rsquo;s
&lt;a href=&#34;http://www.brouhaha.com/~eric/software/d52/&#34;&gt;D52&lt;/a&gt; disassembler (now maintained by Eric Smith) has a control file which
lets you mark sections as being code or data, so you don&amp;rsquo;t spend time looking at
incorrectly interpreted chunks.  It has an analyse function to produce an
initial control file. In practice, this tends to follow control flow and opts
out of disassembling sections that it can&amp;rsquo;t see a clear call to. However, its
inability to decode jump tables means that it significantly under-disassembles
if you use this option. I don&amp;rsquo;t regret using it, although it took many days of
effort wading through the disassembly, marking &amp;lsquo;binary&amp;rsquo; sections in the control
file back as &amp;lsquo;code.&amp;rsquo;&lt;/p&gt;
&lt;p&gt;The other difficulty with interpreting the disassembly and finding code sections
has nothing to do with D52. The terminal software uses a &lt;em&gt;lot&lt;/em&gt; of jump tables,
and DEC decided to place all the 16-bit addresses in these in little-endian
format, despite the 8051 being a big-endian processor. Obviously marking these
tables as data words with the &amp;lsquo;dw&amp;rsquo; format wasn&amp;rsquo;t going to work, so I decided
that the next tool I was going to need, an assembler, would have to be a macro
assembler.&lt;/p&gt;
&lt;p&gt;I asked on a mailing list for recommendations for FOSS macro assemblers and
simulators for the 8051. The following assemblers were mentioned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ken Stauffer&amp;rsquo;s &lt;a href=&#34;https://github.com/kjs452/as31&#34;&gt;AS31&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;W. W. Heinz&amp;rsquo;s &lt;a href=&#34;https://plit.de/asem-51/download.htm&#34;&gt;ASEM-51&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Alfred Arnold&amp;rsquo;s &lt;a href=&#34;http://john.ccac.rwth-aachen.de:8000/as/&#34;&gt;Macroassembler AS&lt;/a&gt; (got a &lt;em&gt;lot&lt;/em&gt; of votes)&lt;/li&gt;
&lt;li&gt;San Bergmans&amp;rsquo; &lt;a href=&#34;https://www.sbprojects.net/sbasm/&#34;&gt;SB-Assembler 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;AS31&lt;/strong&gt; doesn&amp;rsquo;t have a macro facility, which rules it out for large projects
like this one, but I tried it anyway. As it was written in 1990, the dialect of
C is so old that gcc threw many warnings and I feared that it wouldn&amp;rsquo;t produce
an executable. It uses non-standard directives for data (&amp;rsquo;.byte&amp;rsquo; instead of
&amp;lsquo;db&amp;rsquo;) and I couldn&amp;rsquo;t get the assembly to finish even after pre-processing these,
because the parser has an ambiguity between binary and hexadecimal constants. In
theory it will accept hexadecimal constants suffixed by &amp;lsquo;h&amp;rsquo;, with the usual
caveat that hex numbers starting with &amp;lsquo;a&amp;rsquo; to &amp;lsquo;f&amp;rsquo; should be prefixed by &amp;lsquo;0&amp;rsquo;.
However, AS31 accepts binary literals prefixed by &amp;lsquo;0b&amp;rsquo;, so AS31 choked on my
hexadecimal literal &amp;lsquo;0bch.&amp;rsquo; It seems to be very strict on single quotes versus
double quotes too. At that point I was tired of pre-processing my source code
and tried the next tool.&lt;/p&gt;
&lt;p&gt;I would normally have ruled out &lt;strong&gt;ASEM-51&lt;/strong&gt; as it has no source available. It is
free however, and cross-platform, so I downloaded the Linux binary and pointed
it at my source. There was just one issue, in that I&amp;rsquo;d labelled the start of the
code as &amp;lsquo;reset,&amp;rsquo; when that is a built-in symbol. After deleting that, it
assembled all 40 KiB of source to an Intel HEX file. Running that through
hex2bin.py gave me an image identical to the original ROM.&lt;/p&gt;
&lt;p&gt;Ten minutes later, I had read the manual sufficiently far to create the macro I
needed to get the jump tables in the correct format:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;dwl macro address
    db low(address),high(address)
endm
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And I stopped there: ASEM-51 works for me. I &lt;em&gt;will&lt;/em&gt; try Macroassembler AS at
some point, but for now I&amp;rsquo;m cleaning and annotating the source, safe in the
knowledge that I can rebuild the binary after every change, as protection
against fat-fingering anything.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&#34;trace-trace-baby.jpg&#34; alt=&#34;A back-lit close-up of the VT320 circuit
board, concentrating on the SAB8031 and the ROM.&#34;/&gt;
&lt;figcaption&gt;Trace, trace, baby&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Simulators are rather more thin on the ground. These names came up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Seemanta Dutta&amp;rsquo;s &lt;a href=&#34;https://gsim51.sourceforge.net/&#34;&gt;gSim51&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Jari Komppa&amp;rsquo;s &lt;a href=&#34;https://github.com/jarikomppa/emu8051&#34;&gt;emu8051&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;James Rogers&amp;rsquo; &lt;a href=&#34;https://edsim51.com/&#34;&gt;EdSim51&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;gSim51&lt;/strong&gt; was an almost immediate bust. When you&amp;rsquo;ve navigated the ad-laden hell
of Sourceforge (why is it even still a thing?) and downloaded the code, it won&amp;rsquo;t
build. There are functions missing. The source has crossed-out code in comments
as ideas were changed on the fly. This is some college assignment that has been
dumped on the web. Avoid.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;emu8051&lt;/strong&gt; is simple and rather cute. It doesn&amp;rsquo;t have full debugging facilities
such as breakpoints, but it presents an ncurses-based text interface that shows
the current line, registers, flags and one of the areas of memory that you can
change at will. You can set the PC and then single-step or run the code. I tried
setting the PC and stepping through some of the routines that I&amp;rsquo;d identified
where aspects puzzled me, and it helped out.&lt;/p&gt;
&lt;p&gt;However, it wasn&amp;rsquo;t long before it crashed out with a segfault, with me jumping
around the code. I then ran it over another routine that I was having trouble
decoding, and the results were not at all what I expected. This routine used
some BCD arithmetic and the numbers in registers didn&amp;rsquo;t match what I&amp;rsquo;d
calculated by hand. I took a look at the source and realised that the &amp;lsquo;DA A&amp;rsquo;
instruction was implemented incorrectly, and it was being fed incorrect flags
because the &amp;lsquo;ADD&amp;rsquo; instruction was also wrong. Uh oh. A look at the open issues
with pull requests on Github suggests that this isn&amp;rsquo;t being actively used, and I
don&amp;rsquo;t want to spend my time chasing down segfaults, so I&amp;rsquo;ll look elsewhere.&lt;/p&gt;
&lt;p&gt;Where else? At this point, I&amp;rsquo;m seriously considering writing a small 8051 core
myself, because I have the schematics for the VT320 and I know exactly how the
ports, DUART, EEPROM, video interface, timers and interrupts are wired up.&lt;/p&gt;
&lt;p&gt;I downloaded &lt;strong&gt;EdSim51&lt;/strong&gt; but I haven&amp;rsquo;t found a way to run it on Fedora 43
without it complaining that I don&amp;rsquo;t have the X11 DISPLAY environment variable
set. Setting it does no good, possibly because of the shift to Wayland. At this
point it&amp;rsquo;s a toss-up as to whether I hate Java or Wayland more.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Z80 Quality Indicators</title>
      <link>https://hisdeedsaredust.com/posts/2024/z80-quality-indicators/</link>
      <pubDate>Tue, 30 Jan 2024 21:03:24 +0000</pubDate>
      
      <guid>https://hisdeedsaredust.com/posts/2024/z80-quality-indicators/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m 78% through my annotated disassembly of Tehkan&amp;rsquo;s arcade game Star Force and
I was just wondering what quality indicators other people use to rate Z80 code
that they read? What makes you nod in satisfaction, or sneer in disapproval?&lt;/p&gt;
&lt;p&gt;Positive quality indicators I can see in this code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Excellent use of IX and IY to index structures, which makes it really easy to
comment, by adding equates for structure offsets.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Self-initialising structures, where the assumption is that they&amp;rsquo;ll receive a
pointer to a block of zeroed memory, and the code uses the first byte as a flag
as to whether it is initialised yet. This brings initialisation and usage code
right together in the listing, again easing understanding of code that
manipulates maps, enemy waves and sprite structures.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Great use of jump tables, which enables a lot of common code to be used, while
adding hooks for exceptions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Nice use of flags for interrupt service routines, to limit the amount of data
transfers that needs to be done every frame (OK, this one is specific to game
programming.)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Negative quality indicators I can see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;cp 0&lt;/code&gt; instead of &lt;code&gt;or a&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;BCD arithmetic in some places, but hacky workarounds in others: why would you
do this when &lt;code&gt;daa&lt;/code&gt; is 4 T-states?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Multiple &lt;code&gt;ldir&lt;/code&gt;s with address shuffling (and a bug when they lost count), when
&lt;code&gt;lddr&lt;/code&gt; should have been used.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;mask and shift, instead of shift and mask (which would&amp;rsquo;ve enabled single byte
8080-compatible rotates instead of Z80 extensions)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All of this is reminding me why I loved Z80 coding, 40 years ago!&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>DEC Manual Covers</title>
      <link>https://hisdeedsaredust.com/posts/2023/dec-manual-covers/</link>
      <pubDate>Sat, 11 Feb 2023 23:20:58 +0000</pubDate>
      
      <guid>https://hisdeedsaredust.com/posts/2023/dec-manual-covers/</guid>
      <description>&lt;p&gt;In the late 1970s, Digital Equipment Corporation produced a set of manuals
for their terminal and printer equipment that I think are unmistakably of
their decade, with simple line designs in browns and oranges. I&amp;rsquo;ve always
loved the simplicity of these designs, so during the first pandemic lockdown,
I decided to spend some time with Inkscape, recreating the covers, without
the scratches, fading and curling edges that my physical manuals had
accumulated over the past 40 years.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve come across six different designs so far, and drawn five of them. The
four that are most alike are now on my office wall as a montage, which you
are welcome to print yourself:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;vt-montage.png&#34;&gt;&lt;img src=&#34;vt-montage-cover.png&#34; alt=&#34;Cover montage&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The covers used for this design are cropped from these full ones:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;vt100-ug-cover-small.png&#34; alt=&#34;VT100 User Guide&#34;&gt;
&lt;img src=&#34;la120-ug-cover-small.png&#34; alt=&#34;LA120 User Guide&#34;&gt;
&lt;img src=&#34;vt103-ug-cover-small.png&#34; alt=&#34;VT103 LSI-11 Video Terminal User&amp;rsquo;s Guide&#34;&gt;
&lt;img src=&#34;lp100-in-cover-small.png&#34; alt=&#34;Letterprinter 100 Installation Guide&#34;&gt;&lt;/p&gt;
&lt;p&gt;During the next decade, the covers either had no pictures on them at all,
or had simple line drawings, which is really disappointing!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>VT52 Special Graphics</title>
      <link>https://hisdeedsaredust.com/posts/2022/vt52-special-graphics/</link>
      <pubDate>Mon, 25 Jul 2022 00:00:00 +0000</pubDate>
      
      <guid>https://hisdeedsaredust.com/posts/2022/vt52-special-graphics/</guid>
      <description>&lt;p&gt;I was upgrading the images of the VT100 Special Graphics character set
used in my online transcripts of the manuals today and I wondered about
the VT52 equivalents, which are not shown graphically in any of the manuals
that I could find; only the descriptions exist.&lt;/p&gt;
&lt;p&gt;However, Fritz Mueller dumped the &lt;a href=&#34;https://github.com/fritzm/vt52&#34;&gt;VT52 character generator ROM&lt;/a&gt;
some years ago, so I thought I&amp;rsquo;d take a quick look.&lt;/p&gt;
&lt;p&gt;In short, the VT52 Special Graphics look like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;vt52-special-cover.svg&#34; alt=&#34;VT52 Special Graphics&#34;&gt;&lt;/p&gt;
&lt;p&gt;This is a lazy interpretation of the ROM, using a very similar script to
that which I use to process the VT100 glyphs, so I haven&amp;rsquo;t included the
extra scan lines that appear between text lines on the VT52, which is
either 2 or 3, depending on whether you&amp;rsquo;re running at 60 Hz or 50 Hz, respectively.
I also haven&amp;rsquo;t checked the aspect ratio of the characters; the Maintenance Manual provides
dimensions for the complete raster which I could use.&lt;/p&gt;
&lt;p&gt;Two things strike me as odd about this picture:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The second glyph is marked as &amp;ldquo;reserved&amp;rdquo; in all the manuals I&amp;rsquo;ve seen,
so I have no idea what &amp;ldquo;cd&amp;rdquo; is supposed to represent, and whether the same glyph
is present in all models of the VT52, and&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;a href=&#34;https://vt100.net/docs/vt52-mm/&#34;&gt;VT52 Maintenance Manual&lt;/a&gt; claims that only 7 scanlines are retrieved from
the character generator ROM, which is clearly incorrect, as there is a glyph
containing a horizontal line for each of the 8 scanlines that appear on the
display.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</description>
    </item>
    
    <item>
      <title>An old video terminal, in vector form</title>
      <link>https://hisdeedsaredust.com/posts/2009/video-terminal-in-vector-form/</link>
      <pubDate>Fri, 27 Nov 2009 15:03:34 +0000</pubDate>
      
      <guid>https://hisdeedsaredust.com/posts/2009/video-terminal-in-vector-form/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;mayterm-setupa.png&#34; alt=&#34; VT100 Setup Screen A&#34;&gt;&lt;/p&gt;
&lt;p&gt;I still have &lt;a href=&#34;http://vt100.net/vt_history#VT100&#34;&gt;VT100 terminal&lt;/a&gt;, but it&amp;rsquo;s in storage.
I figured I could pretend that it was on my desk if I made a font that looked like the
old beast, including the gaps between scan lines.&lt;/p&gt;
&lt;p&gt;Once I&amp;rsquo;d started, I needed the reverse video form of it, and the forms correctly
underlined, and double width, and double height &lt;em&gt;and&lt;/em&gt; double width. Blinking is
more problematic 😉&lt;/p&gt;
&lt;p&gt;The challenge with the double height, double width font is that the VT100 had
escape sequences that made particular character rows either display just the
top half of characters, or the bottom half. To display characters double height,
you had to put the same characters on two consecutive rows, and set the line
attributes correctly. In fact, you could make up some funky alien characters by
setting the line attributes and typing different characters on each row.&lt;/p&gt;
&lt;p&gt;In order to reproduce this effect (&lt;em&gt;yes, I&amp;rsquo;m carrying on digging&lt;/em&gt;), I had to make
an upper half font, and a lower half font. And &lt;em&gt;that&lt;/em&gt; gives me a problem with
&lt;a href=&#34;http://www.fontconfig.org&#34;&gt;Fontconfig&lt;/a&gt;, because that takes a look through fonts
as it caches them, and marks glyphs as broken if they don&amp;rsquo;t make any marks, but
they are encoded at positions which aren&amp;rsquo;t space characters in Unicode.
My &amp;ldquo;upper half&amp;rdquo; font doesn&amp;rsquo;t have any marks for the underscore glyph, and my
&amp;ldquo;lower half&amp;rdquo; font doesn&amp;rsquo;t have any marks for the double quotes, for example.&lt;/p&gt;
&lt;p&gt;There isn&amp;rsquo;t a way of telling Fontconfig that my font isn&amp;rsquo;t broken just because
it didn&amp;rsquo;t fancy making any marks for a particular glyph, so I&amp;rsquo;ll have to do some
pre-processing when generating &amp;ldquo;screen shots&amp;rdquo; of my old terminal.
I can locally configure Fontconfig to &lt;em&gt;not&lt;/em&gt; do this, but that wouldn&amp;rsquo;t help anyone else.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
