Re: What do I do with Art Of Assembly?

From: Randall Hyde (randyhyde_at_earthlink.net)
Date: 01/18/04


Date: Sun, 18 Jan 2004 05:20:15 GMT


"Annie" <annie@oal.com> wrote in message
news:bucao5$1cfc$1@news.f.de.plusline.net...
> _____
> This is getting REALLY silly. ((( `\
> The facts are quite clear: _ _`\ )
> (^ ) )
> HLA translates a text file of ~-( )
> semi-proprietary mnemonics, _'((,,,)))
> into ANOTHER text file. This ,-' \_/ `\
> second text file, which HLA ( , |
> generates, contains mnemonics `-.-'`-.-'/|_|
> which MA$M can then assemble to \ / | |
> binary. =()=: / ,' aa

HLA is a *compiler* for an *assembly langage*.
Of course, had you read the first section of the manual
to *learn* something about HLA, you'd know that.

Now as a lot of assembly hackers cannot differentiate
between a *language* and the *implementation* of a
language (and you seem to be one of these), allow me
to briefly describe the difference:

1. A "language" is a *formal* definition. Typically using
a grammar (usually a context-free grammar) and a
certain set of semantic actions to apply or check when
a given production in that language is matched. A
"program" (or more formally, a "sentence in the language")
is a sequences of items that the context-free grammar could
generate from a given starting symbol (or, in the case of a
compiler, that the equivalent push-down automata could
recognize). Put in simplistic terms, the *language* is the
set of all programs (an infinite set, of course) that abide
by the rules of the syntax for that language.

2. An implementation of a language is a particular translator
that does the translation in a specific fashion. There are
assemblers, compilers, interpreters, preprocessors, and
other entities out there. Note that you can have *two*
different implementations of *exactly* the same language.
In the case of the HLA *language*, HLA v1.x is a "compiler"
implementation of the language. HLA v2.0 is an assembler
implementation of the HLA language. The idea is that they
will be different implementation of *roughly* the same language
(technically, if they are not exactly the same, they are not
the same language, and as HLA v2.0 will have some extensions,
the two languages are not the same; but we'll ignore that for
the time being).

Now imagine the poor user of HLA - how confusing.
They write a source file with HLA v1.x and run it through
the translator. Because it is a "compiler" and not an assembler,
some people are trying to claim that this poor HLA user
is not writing "assembly language". OTOH, they take that same
program and run it through the HLA v2.0 translator, which is
an assembler, and voila - they are automatically assembly
language programmers without having changed one line of
code in their program.

This is exactly the contradiction that occurs when you attempt
to define a language by its implementation rather than by a
formal grammar. And that's why all these arguments about
HLA not being a "true assembler" because it is implemented
as a compiler are just so much malarky.

>
> So while HLA might "assemble" one
> text file into another text file, it cannot "assemble"
> a text file to binary machine code. HLA requires MA$M
> (or some other external program) to do that.

HLA v1.x uses an external program file to translate its intermediate
form to binary machine code.

Most assemblers have their native code generator phase built into
the same executable.

A mere implementation detail.

To the HLA user, they type "hla somefile.hla" from the command
line and the end result is an executable file. That's all that matters.

> HLA, therefore, is not an "assembler" in the classic
> and commonly-accepted sense of the term.

No. It is a compiler for an "assembly language".

>
> Instead, HLA is a "mnemonics translator." It's a third-
> party add-on utility; a "front end" for use with MA$M.

Or maybe MASM is a "back end" for use with HLA?
Actually, HLA is a system consisting of several programs:

1. HLA.EXE is a "shell" that guides the translation process.
2. RC.EXE is a program that compiles resources, and gets called by HLA.EXE.
3. HLAPARSE.EXE is a program that translate HLA source files to an
    intermediate form.
4. MASM.EXE, FASM.EXE, TASM.EXE, or GAS are programs that
    translate the HLA intermediate files into OBJect files (note that we're
    still not talking binary machine code here, a basic flaw in your
discussion
    of MASM given earlier).
5. LINK.EXE or LD that combines object modules to product a PE or ELF
    executable file (which, technically still isn't a pure binary
executable, but
    close enough for our purposes).

>
> SpAsm/RosAsm, on the other hand, DOES have the native
> ability to "assemble" a text file of ASM-like mnemonics
> into binary machine code.

No, it does not. It has the ability to create PE file which is a fancy
data structure containing some binary machine code along with a lot
of other stuff to guide the loader that performs relocation, dynamic
linking, and other things. IOW, PE is just another form of an
intermediate file that needs further processing. Binary machine code,
the stuff that you can actually execute generally exists only in memory
under most OSes.

Even .COM files are not exactly pure binary executable images.

So why is one intermediate format more priviledged than the rest?

>
> SpAsm/RosAsm, therefore, -IS- an "assembler" in the
> classic and commonly-accepted sense of the term.

Yep. Every classical assembler I've seen as a built-in disassembler,
an editor, an ASCII chart, and various code generating wizards.
You have a bizarre idea of what a classical assembler is.

>
> It's all SOOOOO simple, guys.
>
> Now stop wasting bandwidth with all this ridiculous
> ax-grinding, and get back to work on improving your
> respective products...you slackers. Hehehe!

Your post is a great example of this wasted bandwidth.
Just a troll to elicit a response.
cheers,
Randy Hyde



Relevant Pages

  • Re: What is an assembly language?
    ... HLA is an assembler. ... So what is this essential ability of an assembly language that is ... > that Randy-HLA isn't an x86 assembler. ...
    (alt.lang.asm)
  • Re: HLA StdLib2 criticism
    ... Assembler" (HLA). ... Can that person call this the "FASM language?" ... but also of course not he can call it an assembler ... Therefore HLC.EXE can't be called a compiler. ...
    (alt.lang.asm)
  • Re: What is an Assembler
    ... >> converts a HLA source to an executable. ... > knows the first thing about formal language design. ... convert an assembler source file to an executable (comparable ... it is a full compiler in every sense of the word. ...
    (alt.lang.asm)
  • Re: What is an Assembler
    ... > Salomon offers the following definitions for a High Level Assembler (or ... > A high-level assembler language is a programming language ... > Here you use the same abbreviation (HLA) for two total different ... refer to these languages by the name of the compiler. ...
    (alt.lang.asm)
  • Re: Rocket Science
    ... >> Also, logically, if MASM is the underlying assembler being used by ... then MASM must always be being run in addition to HLA so ... the MASM or FASM or whatever underlying assembler's speed into its own ...
    (alt.lang.asm)