SPITBOL Status Report

Early this summer I started work on what I thought would be a modest change: convert SPITBOL from using the GNU GAS assembler to my favorite X86 assembler, NASM. I also wanted to do some code cleanup as part of this.

Alas! What I thought would take a few weeks took a few months.

I make no excuses. The fault was mine, and I knew it was my job to fix it.

I also soon realized that while it would take longer, the work was needed, as I hadn’t worked on SPITBOL in almost three decades, and my programming skills, especially in X86 assembler were — to say the least — quite rusty.

I had forgotten almost all — which really wasn’t that much — of SPITBOL structures and internals, so it was necessary to reacquire that knowledge — even if I had to do it the hard way.

The process was complicated by the poor support for assembly language programming provided by Linux. I knew about GDB and its visual front-end, DDD. However, I found them sorely lacking, probably because SPITBOL as I found it intermixed data and code in the code section, and this was enough to cause problems using these tools.

As a result, I implemented a variety of instruction-level traces to try to find out what was happening. That itself was an interesting experience, one that made me appreciate even more the power of SPITBOL when it comes to doing this sort of thing.

I plan to write more about this in a future post, but the immediate porting concerns must be addressed first.

The current status is as follows.

The code now available at Hardbol SPITBOL contains a directory b32 with a bootstrap compiler. This is a 32-bit word, 8-bit character SPITBOL using only TCC as the C compiler, MUSL as the library, and NASM as the assembler. The system is thus self-contained in that does not rely on gcc/gnu code.

It doesn’t support floating point.

The OSINT procedures have been cleaned up in that all mention of obsolete systems such as Windows NT, SOLARIS, and MAC (pre OSX) have been omitted.

Going forth, SPITOBL will support only one operating system — Unix.

I have started work on the port for Linux 64-bit word, 8-bit characters. I expect that won’t take too long, but given my track record, we will see…

Once I have that, I’ll try port to OSX. TCC and MUSL support OSX. If that goes well, I’ll put it out. If I run into too many problems, I’ll back off and just do the next — and key — port, for 64-bit words and 32-bit characters, as that is needed for full UNICODE support.

I’ll keep you posted.

About these ads

4 Comments

  1. paul
    Posted December 11, 2012 at 19:34 | Permalink

    I wonder if the code and data can be separated more. It’s known that mixing code and data on the same cache lines (maybe same pages) causes huge slowdowns on modern cpu’s. I can probably find some links about this if you want to see them (measurements from Forth systems).

    • Posted December 11, 2012 at 20:16 | Permalink

      Minimal PPM instructions were formerly generated as just the addresses. That’s been fixed. The code now generates a series on inline tests.

  2. Jack Black
    Posted December 27, 2012 at 03:20 | Permalink

    Hi Dave,

    I’ve been watching your progress reports with interest. I first used SPITBOL in the late 1970s on an IBM 370. I don’t remember if it was SPITBOL/360 or SPITBOL/370 but I do remember it was enough to get me to apply to Illinois Institute of Technology for college and I was accepted there. I didn’t attend after all, but it was a difficult decision.

    Solaris is not obsolete, not by a long shot. Many of us are running it as a primary OS, and development is still continuing on Solaris 10 even though it will eventually EOL and Solaris 11 is going strong. When you say your SPITBOL is going to run on only one platform, UNIX, I hope that will eventually include Solaris and non-Intel platforms, unless your intent is really to only run on Linux/Intel. I think the latter case would be a real shame for those of us who run UNIX (as opposed to Linux) and not only on Intel.

    I’m happy to hear you’re working on reducing runtime dependencies. What about your code generation? Is it modular enough to be ported to platforms and architectures where NASM doesn’t run? I have SNOBOL4 running on 3 different architectures and operating systems right now and it would be great to have SPITBOL coverage there too. I never thought I would say it but maybe targeting portable C for a back end would be a better long term choice than any assembler since you will get the advantage of running anywhere a portable C compiler already exists.

    I have made development systems available in the past for Phil for his SNOBOL4 port and recently to Mark for his SPITBOL SPARC. I was was corresponding with Mark as we waited for an update from Robin but have not received a response from Mark for a month now, so I have no idea what is going on or what the holdup might be. You’re also welcome, if you would like to get your SPITBOL working on Solaris Intel and SPARC in the future. Feel free to contact me offline.

    I run Phil’s SNOBOL4 under OpenBSD on MIPS and Intel. I also have the original Bell Labs SNOBOL4 and IIT’s SPITBOL/360 running on MVS 3.8J under Hercules. Those were the days and they still are! Thanks to all you guys for keeping these great languages and systems alive.

    Jack Black (pseudonym)

    • Posted January 4, 2013 at 15:52 | Permalink

      Jack,

      Thanks for the note.

      The latest version of SPITBOL for Linux can be found at the old Google code site: http://code.google.com/p/spitbol

      I plan no further work on SPITBOL for Solaris, and other legacy versions,

      The architectures of interest to me right now are X86-32, X86-64 and ARM-32 (with ARM-64 when it becomes available).

      While writing SPITBOL in C might be fun, I see more fun — and more promise — in writing an implementation in Javascript so SPITBOL could be run from within a browser.

      thanks,dave


Post a Comment

Required fields are marked *
*
*

  • Pages

  • December 2012
    M T W T F S S
    « Oct   Jan »
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31  
  • RSS The Wayward Word Press

  • Recent Comments

    daveshields on SNOBOL4 for Linux
    Walter Rutherford on SNOBOL4 for Linux
    David Plummer on SNOBOL4 for Linux
    David Plummer on SNOBOL4 for Linux
    Thomas A Naegele on SNOBOL4 for Linux
  • Archives

  • Blog Stats

  • Top Posts

  • Top Rated

  • Recent Posts

  • Archives

  • Top Rated

  • %d bloggers like this: