M2Assem
Well, having not thought very hard about it I've decided to utilise the VAX/VMS
Modula-2 compiler recently uncovered to compile my final year project at
University which was a 'Meta-Assembler'. In true Wickens fashion the concept was
already a little out-of-date but still potential useful. The concept is simple:
write a program which can process assembly language programs written for
different processors. So for example one program could generate object code for
the 6502, Z80 or 68000. Note that the assembly language you write is
machine-specific - I'm not talking about writing one program and targetting
different processors, but simple that the one program can be made to act like a
machine-specific assembler for more than one processor. The advantage being that
you can utilise common code to implement an assembler for a new processor in
less time. There are various points at which you can implement both commonality
and individuality.
In the case of my implementation in Modula-2 the assembly-language specific code
was implemented a separate Modula-2 MODULE. This is linked into a common set of
code. The format of the input assembly language is also standardized. This works
great if you are using this application for writing all your assembly language
but there is also a distinct disadvantage - the common format chosen for the
operands, operators, qualifiers etc. makes the language incompatible with the
manufacturers assembly language definition (generally).
Although I have all the code contained in my printed and bound project report
book I truely believed I no longer had a machine-readable version until a couple
of years ago when I found it in a directory within my common unix hierarchy that
has migrated between machines as I've upgraded over the years. As I mentioned
last time this version was originally written on the Amiga, but susequently (now
my memory of this is slowly returning) I moved to MS-DOS based Topspeed Modula-2
on an Amstrad PPC-640 and then a Twinhead 8088 desktop (with hard drive woot!)
to complete the project.
In a bizarre conincidence I almost picked up a set of Topspeed Modula-2 manuals
(mine having been sold on long ago) from a guy in Carlisle as I was up there
last week and he'd just listed them on ebay. I can see from the Meta Assembler
source code that there as some machine specifics which don't come from the
Benchmark Modula-2 implementation (I still have the manual for that and there is
no mention of the FIO module for example)
[1].
So I'm now in the process of porting the meta assembler to the VAX/VMS Modula-2
implementation. So far it has been a case of adding EXPORT QUALIFIED lists to
the definition modules and defining LONGCARD and LONGINT as they aren't native
types (on the VAX they are the same as CARDINAL and INTEGER given the 32 bit
nature of the machine). The trickiest part is now going to be implementing a
replacement FIO module as supplied with the TopSpeed compiler with enough
functionality to provide the required services on the VAX.
[1] Benchmark Modula-2 Manual