On 16/10/11 3:11 PM, Chuck Guzis wrote:
On 16 Oct 2011 at 14:17, Toby Thain wrote:
Indeed. You're probably familiar with the
epic hacks that make, e.g.
MACRO-11 assemble for a completely different instruction set :) (A
gentleman named Tom Evans showed me this.)
I posted about it here:
https://groups.google.com/d/msg/comp.arch.embedded/B6fK5z2lUww/BoBL2S_uITEJ
Early in my career, I was placed under the tutelage of
a consultant--
an ex-IBMer who was quite an authority on COBOL ...
he proposed a fictitious machine that, instead of bits and bytes,
handled abstract data types, such as tokens and had a very simple set
of instructions that could query and alter properties of tokens as
well as generate some on its own. It had its own symbol table
primitives as well as a way to generate output.
I was a little dubious, but we put it together anyway; we invented
some instructions and the support software for this machine (my job)
and wrote a bunch of very funny-looking assembler code using the
macro facility of the assembler.
The initial run was ready in an amazing 3 months ...
Because of the huge macro content, assembling the translator took the
better part of an hour (on one of the fastest CPUs of the time). And
because execution was interpretive, it was awfully slow.
Yes, Evans remarked on this as well as you see :)
The next step was to rewrite the macros for the instructions to have
them generate native code and demote the interpreter to a bunch of
support routines for the native code. Things sped up by almost an
order of magnitude and the end result turned out to be extremely
stable, so much so that my job and his disappeared and maintenance
was turned over to the COBOL compiler group, who didn't udnerstand
one iota of what it was about.
I learned a lot from that process ...
Thanks very much for the anecdote.
--Toby
--Chuck