From: bson@gnu.ai.mit.edu (Jan Brittenson)
Newsgroups: comp.sys.hp48
Subject: Re: <--- need to know basics of machine code progr.
Date: 20 Dec 92 06:55:59
Organization: nil
Distribution: world
	<724738334detlef.detlef@dmhh.hanse.de>
NNTP-Posting-Host: churchy.gnu.ai.mit.edu
In-reply-to: detlef@dmhh.hanse.de's message of Sat, 19 Dec 92 04:12:14 GMT

In article <724738334detlef.detlef@dmhh.hanse.de> detlef@dmhh.hanse.de (Detlef Mueller) writes:

 > BTW, the listing for the invallid example above of the HP assembler
 > SASM (PC based):
 >   *** ERROR: Illegal mnemonic ***
 >      1 00000         d=a a

   Which is precisely what I said. The diagnostic is useless, as it
doesn't tell you -why- the mnemonic is illegal. The assembler might as
well have said ``burrrp!''


 > Well, I've some experience in 680x00, Z80, 6502 and at least 80x86 (urgh) -

   Let's see... I've programmed pdp-8, pdp-10, pdp-11, VAX-11 Macro
(as it was called early on), Z80, 6502, NS32000, 8088, 80486, a bunch
of microcontrollers (Z8, 80188, 8049, and probably a few more), and of
course 6800 and 6802, over the last... 15 years or so. Oh, and yes, I
had fling with S\370 (Assembler XF under CMS) as well. The first thing
I wrote on the 370 was a preprocessor to translate a column-
independent format to XF's dumb case-sensitive fixed-column syntax. I
like some of XF's macro features, though (which were carried into
STAR).

   It is with horror I think back at having to deal with the
occasional syntactically weak assembler.


 > IMO the HP Saturn assembler is only another one to learn (I agree that
 > it is funny :).

   That's a good start. The next phase of your evolution will be to
immediately recognize poor practises. There aren't many real
assembler-written systems around these days (the HP-48 isn't among
them) -- but if you ever get the chance, I'd recommend you to take a
look at the RSX-11 (M or M+) executive. I can get you an account on an
RSX host on the Internet (it's in northern Europe) if you'd like. It
will immediately become obvious how important it is to have effective
means of declaring data structures (such as priority queues) to write
any real software that's also intelligible.


 > Why not program a CPU using the mnemonics specified by the manufactor
 > of this CPU ?

   This is akin to asking why people aren't writing applications in
TECO! The answer ought to be obvious: because it's write-only, and
because some of us refuse to write unreadable and unmaintainable code.
The impracticality of not using HP's syntax (an assembler is much more
than just a translator of ``mnemonics'') is by far outweighted by the
more intelligible code. Like TECO, assembler programming as a serious
practise is reflected negatively upon by junk assemblers and the
unstructured code that results from using them.

   Heck, even Intel had a more useful assembler for their 8080
development system, and while it had some tendencies towards baking
everything into the instruction name, it was usually only to reduce
redundancies. Of course, Zilog eventually got it all right (and I'm
not refering to the ``extended 8080 mnemonics''), so hacking DR's
Macro-80 on CP/M and (briefly) MP/M was quite an enjoyable experience.

   Just because the computer is a toy doesn't mean I have to write toy
software.

--
						-- Jan Brittenson
						   bson@gnu.ai.mit.edu