The SPITBOL project is pleased to announce some progress in porting MACRO SPITBOL to x86-64 Linux. (I use MINT, so this should also work on straight Ubuntu.)
This version is able to compile such simple programs as “hello world” but is not yet able to compile itself.
It can be found at http://github.com/hardbol/spitbol
It has the git tag “x86-64-hello-world” and there is a file with this tag in the Downloads section.
Reaching this milestone has been a long slog, albeit an interesting project in relearning X86 assembly language and coding in SPITBOL.
The translator consists of about 3000 lines of SPITBOL code. LEX.SPT consists of about 1000 lines. It produces a file of lexemes which are fed to ASM.SPIT, which consists of about 2000 lines of code. ASM generates assembly code suitable for input to the NASM assembler.
The hard part was to configure ASM.SPT so it can generate code for X86-32 or X86-64.
To try out the system, do
$ make clean;make
$ ./spitbol test/hello.spt
To see the program in action, set Z_TRACE to 1 at the start of ASM.SPT. Then try
$ ./spitbol test/hello.spt >& ad
$ make z
This will produce a *large* file “ae” with an instruction-by-instruction trace of the MINIMAL code, showing the hardware instructions executed and a report of differential changes at the machine register level.
One of the more challenging — and fun — parts of this exercise in porting has been to produce that trace. I found available debuggers, such as GDB and its graphical front-end DDD, of little use in dealing with assembly language, and so had to write my own debugging trace tool.
I’ll keep you posted on further developments.