Re: ASM vs HLL : absurd war
From: Alex McDonald (alex_mcd_at_btopenworld.com)
Date: 07/10/04
- Next message: wolfgang kern: "Re: ASM vs HLL : absurd war"
- Previous message: Alex McDonald: "Re: push pop ebp"
- In reply to: Percival: "Re: ASM vs HLL : absurd war"
- Next in thread: Betov: "Re: ASM vs HLL : absurd war"
- Reply: Betov: "Re: ASM vs HLL : absurd war"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 10 Jul 2004 20:38:26 +0000 (UTC)
"Percival" <pr_tiglao@yahoo.com> wrote in message
news:cck03k$2ji3$1@news.wplus.net...
> Betov wrote:
> > psi <i@m.t> écrivait news:9fsqe0dffka71i13m1lttffelbg94iprar@4ax.com:
> >
> >
> >>I'm a beginners so not a sage, so I can make errors.
> >>For me all are compilers:
> >>an assembly language is a language that *can* control every single bit
> >>of the executable (the result of the compiler). Is it right?
> >
> >
> > No.
No beating about the bush there, eh?
> >
> >
> > Betov.
> >
> > < http://betov.free.fr/RosAsm.html >
> >
> >
>
> I do not understand either...
> What is the difference between a compiler and assembler, other than the
> language that it deals with?
Assemblers take and assemble or compile operations that are specific to a
processor, or a family of processors; NASM/FASM/TASM/RoSAsm/HLA/etc are all
run on and generate code for the Intel x86. Source for assemblers is
platform dependent. Source for processor type A (say, SPARC) will not
assemble and run on processor type B (say, x86). Cross assemblers are run on
platform A but generate code for platform B. In general, assemblers do not
have backend code generators, although those that make heavy use of macros
may generate intermediate assembler source code for a second pass assembly.
In essence, assembler language A has a single target; the machine described
by A.
Writing a platform portable assembler is an oxymoron; by definition, it
would be a compiler, or .Net. Compilers take and assemble or compile
operations that are not specific to a family of processors;
C/C++/Ada/Prolog/Fortran/etc programs can be written and compiled for just
about every processor there is out there. Source for processor type A (say,
SPARC) will probably and run on processor type B (say, x86). Probably, in
that there may be different libraries or considerations such as endianness
or word size that may make the source dependent on a specific platform. Such
code is often described as "not portable"; others may describe it as "badly
written". Writing platform portable C code is difficult, but not impossible.
Other langauges, such as Fortran, are very portable. Some compilers are tied
to a specific platform, such as MSVC (WIndows on Intel); some are not, such
as gcc. They often, but not always, use assembler backends such as gas to
generate code for a specific target.
In essence, compiled language Z has several targets; the "virtual
environment" described by Z can be run on targets A, B C etc.
Microsoft's .Net environment contains several compilers (C#, VB etc) and one
assembler (ILASM). C# is definitely a compiler; it has a target that is a
"virtual environment". ILASM is platform dependent; it takes code generated
for a virtual machine (generally by C#, VB et al) and creates specific code
code the platform on which it is to execute (normally x86, but it can be
extended to other targets). ILASM is as close as an assembler gets to being
a compiler; but it has only one target; some would argue that makes it an
assembler (hence the name). MSIL (the language in which it is written), is a
CPU-independent set of instructions that can be efficiently converted to
native code. So some would argue that it is also a compiler, as MSIL is a
"virtual environment". Some would argue that it is also an interpreter, as
some of the "virtual environment" is never executed as native code.
In essence, .Net changes the rules; the bit "nearer the metal" is the
assembler, and the bit that sits on top is the compiler. Or it's a compiler
for an interpreter. Perhaps.
You'll note that there's no "high-level" argument here. That nonsense we'll
have to reserve for another thread.
HLA is an assembler. Or compiler. So is RosAsm with macros. Of course, you
may disagree with all or any of the above. In which case, welcome to the
hell that's ala.
-- Regards Alex McDonald
- Next message: wolfgang kern: "Re: ASM vs HLL : absurd war"
- Previous message: Alex McDonald: "Re: push pop ebp"
- In reply to: Percival: "Re: ASM vs HLL : absurd war"
- Next in thread: Betov: "Re: ASM vs HLL : absurd war"
- Reply: Betov: "Re: ASM vs HLL : absurd war"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|