shasm is character-by-character from-scratch new. It's not based on any
existing assembler. It's based on the old Intel text file 386INTEL.TXT,
i.e. it's based on the 80386 itself. I suspect it's the first utterly new
x86 assembler in quite a while. I'm not an 8086 guy. I hate the pig. I had
Commodore stuff when the 8086 was prevalent. I did use GNU "as" a lot for
checking the output of osimpa, but I avoid looking at existing code when
approaching a project like shasm/osimpa.

Recent Forths and BCPL are built on the concept of a cell, an integer the
size of an address. The 80386 can be looked at the same way vis-a-vis the
real/pmode issues of the machine. shasm takes advantage of this. I'm not
familiar with IA64, but the concept of a cell is a very general and
forward-compatible thing. The 386 is more flexible than the cell concept
as usually needed, because most things can assume the cellsize of the
machine is a constant, and it isn't on x86.

The generality of cells and what I hope is the generality of the asmacs
oper names makes shasm code look general. How general is it? Is there a
truly portable assembler lurking in here? Is the 386 a useful subset of
other desktop CPU's? How many Bash routines on top of shasm constitutes a
compiler?

Assembling the bitfields, bytes and cells of machine code is not what the
unix shell is designed for. A hallmark of unix is simple specialized tools
that do one thing well. That's proven to be an excellent design guide, but
it's subject to some variation. If you must have the costs of a particular
thing, and typically you must incur the cost of a command interpreter on a
computer, then the best thing a thing can be is as versatile as possible
per cost. This is why people carry Leatherman's. And money. Very versatile
stuff, money. This is the great strength of BASIC. It's horrid, but it can
do just about anything. The value of versatility is why unix shells have
accreted features over the years, and shasm shows that Bash 2.x is capable
of just about anything, given a long enough period of time to get it done.
Relative to the functionality of a classico Bourne sh, the addenda
required for complete generality are trivial, and thus a bargain. In view
of the rich interactive conveniences of Bash, echo -e and let are highly
cost-effective. The default interface to the system is the place where
de-specialization makes the most sense. The fact that shasm allows
arbitrary development with just a shell shows this. In other words,
specialization of tools is often good, but your shell is your hands.

An advantage of the shell is ease of implementing a parser. sh case
statements take globbing patterns as switch strings, for example. shasm
therefor has a very accepting syntax. In particular, Intel, AT&T and Plan9
syntaxes can all probably be converted to shasm with simple ed scripts.




.....................................................................
.....................................................................

