<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Past Future Plus Dot</title><link href="https://ben.writesthisblog.com/" rel="alternate"/><link href="https://ben.writesthisblog.com/atom.xml" rel="self"/><id>https://ben.writesthisblog.com/</id><updated>2026-08-06T16:00:00-04:00</updated><subtitle>Mostly retro computing, mostly Forth</subtitle><entry><title>Introduction: Executive Computing</title><link href="https://ben.writesthisblog.com/posts/Introduction-Executive%20Computing.html" rel="alternate"/><published>2026-08-06T16:00:00-04:00</published><updated>2026-08-06T16:00:00-04:00</updated><author><name>Ben Chapman</name></author><id>tag:ben.writesthisblog.com,2026-08-06:/posts/Introduction-Executive%20Computing.html</id><summary type="html">Introduction: Executive Computing</summary><content type="html">&lt;h1&gt;Introduction: Executive Computing&lt;/h1&gt;
&lt;p&gt;Around 1980, a computer consultant in Boston, John M. Nevison, wrote a book entitled &lt;em&gt;Executive Computing&lt;/em&gt;, with the enticing sub-title, &lt;strong&gt;&amp;ldquo;How to get it done on your own&amp;rdquo;&lt;/strong&gt;. The book was published by Wiley and was popular enough to go through multiple printings. I own a copy of the fifth printing from 1985.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Executive Computing" src="cover.jpg" title="So much going on in this image!"&gt;&lt;/p&gt;
&lt;p&gt;The cover does an excellent job of conveying the goal of the book, as well as a bit of the flavor of the times. The idea is to free yourself from the tyranny of the mainframe. Do it all yourself with a relatively inexpensive business computer. The book is truly excellent, with a nice blend of appropriately cheesy instructional scenarios and very clear, well-explained code. &lt;/p&gt;
&lt;p&gt;The book was targeted at users of Radio Shack &lt;a href="https://www.trs-80.org/level-2-basic.html"&gt;Level II BASIC&lt;/a&gt; on a TRS-80 computer. Level II BASIC was a 16K BASIC, written by Microsoft, that included floating point numbers in both single and double precision. The computer was available starting in 1978. According to Nevison&amp;rsquo;s book, a TRS-80 Model I with 16K RAM and Level II BASIC cost $849 (approximately $3,440 in 2026). This got you a monitor and a keyboard with real keys. Data storage was via cassette tape. &lt;/p&gt;
&lt;p&gt;There are a number of TRS-80 emulators out there. I&amp;rsquo;m using &lt;a href="https://48k.ca/trs80gp.html" title="trs80gp - A TRS-80 Model 1,2,3,4,12,16,6000,Tandy 10,MC-10,Color Computer,DT-1,Green Thumb,Videotex Emulator"&gt;trs80gp - A TRS-80 Model 1,2,3,4,12,16,6000,Tandy 10,MC-10,Color Computer,DT-1,Green Thumb,Videotex Emulator&lt;/a&gt;, which seems to work just fine. It&amp;rsquo;s cross-platform; I&amp;rsquo;m currently running it on a Mac.&lt;/p&gt;
&lt;p&gt;To run the emulator and boot into the Level II BASIC ROM, try: &lt;code&gt;./trs80gp -m1 -l2 -mem 16 -dx&lt;/code&gt;. The most important thing to know is that the BREAK key from the TRS-80 is mapped to the ESC key, at least on my Mac. If you type AUTO to auto-number BASIC program lines, you&amp;rsquo;ll need to hit ESC to get back to the prompt.&lt;/p&gt;
&lt;p&gt;Incidentally, one of the interesting things about Nevison&amp;rsquo;s book is that it is written in the looming shadow of &lt;a href="https://en.wikipedia.org/wiki/VisiCalc"&gt;VisiCalc&lt;/a&gt;. Appendix D introduces VisiCalc and notes that many of the programs in the book could be re-written to run in newfangled VisicCalc. Forty-odd years later, we know how that turned out.&lt;/p&gt;
&lt;p&gt;Anyway, I&amp;rsquo;d like to use Nevison&amp;rsquo;s book to explore &lt;strong&gt;an alternate future&lt;/strong&gt;, where Forth was the bundled language and business users adopted Forth as their &amp;ldquo;basic&amp;rdquo; language of choice. Stop laughing! It could have turned out this way, &lt;em&gt;maybe&lt;/em&gt;. Just think of HP&amp;rsquo;s calculators and their success in scientific and financial applications.&lt;/p&gt;
&lt;p&gt;I am not an expert Forth programmer - quite the opposite. After using BASIC as a youngster, I spent some years with Pascal and then many years with Python. Forth does &lt;em&gt;not&lt;/em&gt; come naturally to me. That&amp;rsquo;s the challenge and the fun of it. Join me next time as I make my way down this rabbit hole.&lt;/p&gt;</content></entry><entry><title>Using blag to host a small static blog site</title><link href="https://ben.writesthisblog.com/posts/using-blag-for-small-site.html" rel="alternate"/><published>2026-08-05T11:05:00-04:00</published><updated>2026-08-05T11:05:00-04:00</updated><author><name>Ben Chapman</name></author><id>tag:ben.writesthisblog.com,2026-08-05:/posts/using-blag-for-small-site.html</id><summary type="html">Using blag to host a small static blog site</summary><content type="html">&lt;h1&gt;Using blag to host a small static blog site&lt;/h1&gt;
&lt;h2&gt;Set-up directories and install blag&lt;/h2&gt;
&lt;p&gt;I use an older Macbook Air running Sonoma as my local desktop. The focus of this article is how to set up &lt;a href="https://github.com/venthur/blag" title="venthur/blag: blag is a blog-aware, static site generator -- it uses Markdown and is written in Python."&gt;blag&lt;/a&gt; on this local Mac. Blag is a blog-aware, static site generator – it uses Markdown and is written in Python. Because it also uses Jinja2 as its templating engine, it should be relatively easy to modify the menus and even the theme later on. Later the generated static html and css are uploaded to a server that uses caddy to securely serve static files.&lt;/p&gt;
&lt;p&gt;Here are the steps to get started with blag. Create a working directory &amp;ndash; I just created &lt;code&gt;blag/&lt;/code&gt; in my usual projects directory.  Create and activate a Python virtual environment and then activate the environment. Once activated, install blag.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;python3&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;venv&lt;span class="w"&gt; &lt;/span&gt;.venv
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;.venv/bin/activate
&lt;span class="w"&gt;  &lt;/span&gt;python3&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;blag
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To exit the virtual environment, use &lt;code&gt;deactivate&lt;/code&gt;. I always forget and type
&amp;lsquo;exit&amp;rsquo;, which will just close your terminal window. Probably not what you want!
Also, don&amp;rsquo;t forget that you will have to do &lt;code&gt;source .venv/bin/activate&lt;/code&gt; any
time you want to use the blag program.&lt;/p&gt;
&lt;h2&gt;Modify blag to support footnotes&lt;/h2&gt;
&lt;p&gt;Currently, the version of blag available via PyPi for installation via pip does
not contain support for footnotes. To enable footnote support in the downloaded
version, do the following:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;.venv/lib/python3.14/site-packages/blag
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Open &lt;code&gt;markdown.py&lt;/code&gt; in your favorite editor and locate these lines:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    &lt;span class="n"&gt;md&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Markdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;extensions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;meta&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;fenced_code&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;codehilite&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;smarty&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;MarkdownLinkExtension&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;output_format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;html&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;md&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Modify the file to activate the footnotes extension:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    &lt;span class="n"&gt;md&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Markdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;extensions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;meta&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;fenced_code&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;codehilite&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;smarty&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;footnotes&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;MarkdownLinkExtension&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;output_format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;html&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;md&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Save the file and you have now enabled support for footnotes&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt;. Blag uses the Python system-default markdown library and extensions, so you can turn on (or off) support for various features. See the &lt;a href="https://python-markdown.github.io/extensions/" title="Extensions — Python-Markdown 3.10.3 documentation"&gt;markdown extensions documentation&lt;/a&gt; for more detail.&lt;/p&gt;
&lt;p&gt;At some point, the blag author may release his updated version; in that case, pip will install the latest version with footnote support built in and you won&amp;rsquo;t need to hand-edit the file, unless you want to turn on support for other extensions.&lt;/p&gt;
&lt;h2&gt;Minor template modifications&lt;/h2&gt;
&lt;p&gt;Blag is a very simple system. Both &amp;ldquo;pages&amp;rdquo; and &amp;ldquo;articles&amp;rdquo; can be kept in the same content folder. &amp;ldquo;Articles&amp;rdquo;, which contain a header at the top of the document with the date, are blog posts. &amp;ldquo;Pages&amp;rdquo; are static pages, such as an &amp;ldquo;About&amp;rdquo; page, etc. They do not contain a date header.  Read the &lt;a href="https://blag.readthedocs.io/en/latest/manual/"&gt;manual&lt;/a&gt; for all of the details and don&amp;rsquo;t forget to edit the &lt;code&gt;config.ini&lt;/code&gt; to add in default blog information.&lt;/p&gt;
&lt;p&gt;I decided to create a folder in the content directory called &lt;code&gt;posts&lt;/code&gt; for blog content, as well as a folder called &lt;code&gt;pages&lt;/code&gt; for static content.&lt;/p&gt;
&lt;p&gt;I edited the template very slightly to display the about page on the main menu. Here&amp;rsquo;s how to do that. Edit &lt;code&gt;templates/base.html&lt;/code&gt; and locate the &lt;code&gt;nav&lt;/code&gt; section of the template file. Add in a new line for the about page, so that the section now looks like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;site.description&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;h2&amp;gt;&amp;lt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Blog&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;h2&amp;gt;&amp;lt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;/archive.html&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Archive&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;h2&amp;gt;&amp;lt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;/tags/&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Tags&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;h2&amp;gt;&amp;lt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;/pages/about.html&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Save the file, rebuild, and you should now have a link on the navbar of the home page.&lt;/p&gt;
&lt;p&gt;I also changed from a serif to a sans-serif font and made other tiny tweaks to
the style page for the site, which is located in &lt;code&gt;static/style.css&lt;/code&gt;. &lt;/p&gt;
&lt;h2&gt;Configure settings to ease file generation and upload&lt;/h2&gt;
&lt;p&gt;I set up a Makefile to make it easier for me to generate and publish documents.
I used the Makefile from another and much more complicated static site
generator, Pelican, and modified it to work with blag and it simplifies the
process a good bit. Here&amp;rsquo;s the &lt;a href="Makefile.txt"&gt;modified file&lt;/a&gt; if you want
to take a look at it.&lt;/p&gt;
&lt;h2&gt;Workflow for publishing&lt;/h2&gt;
&lt;p&gt;Blag is such a simple system that there is no concept of &amp;ldquo;draft&amp;rdquo; vs.
&amp;ldquo;published&amp;rdquo; articles. If the document is in the content folder or one of its
subfolders, it will get published. I&amp;rsquo;ve just created a folder at the root of
the blag folder called &lt;code&gt;drafts&lt;/code&gt;, where I keep draft Markdown files. This works
for me.&lt;/p&gt;
&lt;p&gt;Once I&amp;rsquo;m satisfied with my work, I move the document into the content/posts
folder and then do &lt;code&gt;make ssh_upload&lt;/code&gt; which rebuilds and posts everything to the
server.&lt;/p&gt;
&lt;p&gt;Blag is about perfect for my needs right now. Thanks to Bastian Venthur for writing and sharing it!&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This is the footnote text, just so you can see how it is rendered by default.&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content></entry><entry><title>XKCD</title><link href="https://ben.writesthisblog.com/posts/xkcd.html" rel="alternate"/><published>2026-08-04T15:30:00-04:00</published><updated>2026-08-04T15:30:00-04:00</updated><author><name>Ben Chapman</name></author><id>tag:ben.writesthisblog.com,2026-08-04:/posts/xkcd.html</id><summary type="html">XKCD</summary><content type="html">&lt;p&gt;The venerable XKCD apparently has a soft spot for Forth.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://xkcd.com/3277/" title="xkcd: Forth"&gt;xkcd: Forth&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Yay!&lt;/p&gt;</content></entry><entry><title>Editing Tali Forth block data in Vim</title><link href="https://ben.writesthisblog.com/posts/editing-block-files.html" rel="alternate"/><published>2026-08-04T08:42:00-04:00</published><updated>2026-08-04T08:42:00-04:00</updated><author><name>Ben Chapman</name></author><id>tag:ben.writesthisblog.com,2026-08-04:/posts/editing-block-files.html</id><summary type="html">Editing Tali Forth block data in Vim</summary><content type="html">&lt;h1&gt;Editing Tali Forth block data in Vim&lt;/h1&gt;
&lt;p&gt;One of my favorite things about Forth, especially older bare-metal Forths, is
the use of 1K &amp;ldquo;blocks&amp;rdquo; for data storage. The Planck 6502 uses block storage on
a CF card. There is no file system, just bytes, arranged in 1024 byte &amp;ldquo;blocks&amp;rdquo;,
traditionally displayed as 16 lines of 64 characters per line. In Tali Forth on
the Planck, I have access to 64MB of persistent storage, all in these 1024 byte
blocks.&lt;/p&gt;
&lt;p&gt;Sometimes, it&amp;rsquo;s easier to edit blocks outside of the Forth system. Here&amp;rsquo;s one
approach, focused on editing the csim simulator&amp;rsquo;s blocks.&lt;/p&gt;
&lt;h2&gt;Using the c65 block file in Tali&lt;/h2&gt;
&lt;p&gt;One of the very cool things about the csim simulator for Tali is that it allows
you to have persistent storage by supporting blocks in a traditional file in
the file system.  This is covered in the manual, but here&amp;rsquo;s a quick summary.&lt;/p&gt;
&lt;p&gt;Create an empty blockfile to hold Forth blocks: &lt;code&gt;touch blockfile.block&lt;/code&gt;. Then
start up csim like so: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$TaliForthDir&lt;/span&gt;
./tools/c65/c65&lt;span class="w"&gt; &lt;/span&gt;-b&lt;span class="w"&gt; &lt;/span&gt;blockfile.block&lt;span class="w"&gt; &lt;/span&gt;-r&lt;span class="w"&gt; &lt;/span&gt;taliforth-c65.bin&lt;span class="w"&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To start up the block system, run the word &lt;code&gt;block-c65-init&lt;/code&gt;. It will return -1
(true) once the block system is available. List, load, and edit blocks as
usual. See the Tali Forth manual for the use of the supplied editing commands.
Make sure to save changes to some blocks and then exit the simulator.
You&amp;rsquo;ll notice that the file is now 1MB in size.&lt;/p&gt;
&lt;h2&gt;Editing the block file from outside of Tali&lt;/h2&gt;
&lt;p&gt;The blockfile is initialized with nuls (\$00) in every character position. This
makes it awkward to edit with an external editor like vim, in part because nuls
are displayed as &lt;code&gt;^@&lt;/code&gt; so every line is twice as long as you would expect. It&amp;rsquo;s
easiest to replace all of the nuls with space characters. You can do that with
GNU sed like this: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sed&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;s/\x00/ /g&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;blockfile.block
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;CAVEAT: If you use MacOS, you have the FreeBSD version of sed, which doesn&amp;rsquo;t
seem to handle nuls. You can install GNU sed by doing &lt;code&gt;brew install gnu-sed&lt;/code&gt;.
After that, run &lt;code&gt;gsed&lt;/code&gt; in place of &lt;code&gt;sed&lt;/code&gt; for the replacement above. Sed is very
cool and you can &lt;a href="https://www.gnu.org/software/sed/manual/sed.html"&gt;read more about it
here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now that the file is one ginormous line of space characters, you can open it
in vim to edit. Here&amp;rsquo;s one way to do it, &lt;a href="https://www.reddit.com/r/vim/comments/n79ryg/editing_forth_block_files/"&gt;from this answer on
r/vim&lt;/a&gt;.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;augroup forth
&lt;span class="c"&gt;  &amp;quot; insert a newline after every 64 bytes when reading&lt;/span&gt;
  &lt;span class="k"&gt;au&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nb"&gt;BufReadCmd&lt;/span&gt; *.block &lt;span class="k"&gt;call&lt;/span&gt; setline&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; split&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;readfile&lt;span class="p"&gt;(&lt;/span&gt;expand&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;\%65c\zs&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c"&gt;  &amp;quot; remove newlines when writing&lt;/span&gt;
  &lt;span class="k"&gt;au&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt; &lt;span class="nb"&gt;BufWriteCmd&lt;/span&gt; *.block &lt;span class="k"&gt;call&lt;/span&gt; writefile&lt;span class="p"&gt;(&lt;/span&gt;[&lt;span class="k"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;getline&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;^&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;]&lt;span class="p"&gt;,&lt;/span&gt; expand&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
augroup &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is really clever. It inserts a hard-return after every 64 characters, so
that we get the 64 character wide lines for blocks, but &lt;em&gt;only when you retrieve
the file&lt;/em&gt;. It then removes the hard returns upon writing the file. Add this to
your .vimrc and restart vim to see the changes. &lt;strong&gt;NOTE:&lt;/strong&gt; Every &lt;em&gt;.block&lt;/em&gt; file
that you bring into vim will have this applied, so be aware of that. This is
also why I chose &lt;code&gt;.block&lt;/code&gt; as the extension for the csim block files in place of
the original &lt;code&gt;.dat&lt;/code&gt;, which might be used for other file types.&lt;/p&gt;
&lt;p&gt;Also, it&amp;rsquo;s still possible to mess up your blocks by deleting lines, etc. during
the vim session.&lt;/p&gt;
&lt;p&gt;Next, you need a way to visualize block boundaries.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/20718849/vim-highlight-every-nth-line"&gt;This solution&lt;/a&gt; from Stack Overflow  provides one approach:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; HighlightEvery&lt;span class="p"&gt;(&lt;/span&gt;lineNumber&lt;span class="p"&gt;,&lt;/span&gt; lineEnd&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;highlight&lt;/span&gt; myhighlightpattern ctermbg&lt;span class="p"&gt;=&lt;/span&gt;darkred guibg&lt;span class="p"&gt;=&lt;/span&gt;darkred
    &lt;span class="k"&gt;let&lt;/span&gt; pattern&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="k"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="k"&gt;a&lt;/span&gt;:lineEnd
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="k"&gt;a&lt;/span&gt;:lineNumber
        &lt;span class="k"&gt;let&lt;/span&gt; pattern .&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;\\%&amp;quot;&lt;/span&gt; . &lt;span class="k"&gt;i&lt;/span&gt; . &lt;span class="s2"&gt;&amp;quot;l\\|&amp;quot;&lt;/span&gt;
    &lt;span class="k"&gt;endwhile&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; pattern .&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;\\%0l/&amp;quot;&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; commandToExecute &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;match myhighlightpattern &amp;quot;&lt;/span&gt;.pattern
    execute commandToExecute
&lt;span class="k"&gt;endfunction&lt;/span&gt;

command &lt;span class="p"&gt;-&lt;/span&gt;nargs&lt;span class="p"&gt;=&lt;/span&gt;* Highlightevery &lt;span class="k"&gt;call&lt;/span&gt; HighlightEvery&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;f&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;args&lt;span class="p"&gt;&amp;gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Put this in your &lt;code&gt;.vimrc&lt;/code&gt;. In vim, call it with &lt;code&gt;Highlightevery 16 2000&lt;/code&gt;. This
will highlight the 16th (last) line of each block through line 2000.&lt;/p&gt;
&lt;h2&gt;Editing caveats&lt;/h2&gt;
&lt;p&gt;You have to be &lt;em&gt;really&lt;/em&gt; careful with this. Turn on non-printing characters in
vim with &lt;code&gt;set list&lt;/code&gt; so that you can see the end of line character, as it&amp;rsquo;s easy
to add a bunch of spaces to the line without noticing.  You need to be very
careful when deleting lines so that you do not accidentally move a subsequent
block back into the block you are editing. However, for cutting and pasting
data into the block file, this may be completely adequate.  It&amp;rsquo;s probably best
to do all of your editing in replace mode.&lt;/p&gt;
&lt;p&gt;Of course, another option is to slurp in the block data using your favorite
programming language and then write the changes back out. After all, it&amp;rsquo;s just
a stream of bytes. I&amp;rsquo;ll share a Python script to do that at some point.&lt;/p&gt;</content></entry></feed>