[A83] Re: 80X86 CPU programming


[Prev][Next][Index][Thread]

[A83] Re: 80X86 CPU programming




> (And if you do want to learn this stuff, you should take
> the A86 compiler, it's free and much better than the others)

You sure it's free?  I used A86 a long time ago (6 years) when I did
assembly programming on the x86 in DOS.  But at that time you needed a
license for it to be able to distribute any programs made with it.  And it
also had something about it emitting detectable patterns in the bytecode
that could be demonstrated in court if you pirated the assembler (strange
that I remember that).  Remember that free as in beer is nowhere near the
same as free as in speech.  If you can't modify the source code and
distribute the changes, then you are lacking freedoms for using the
software.  And just because you can download and use it, as in the case of
shareware, does not even make it free as in beer.  Winzip is "free", but
legally you still have to register it.  Windows 2000 is "free" if you copy
it from someone, but that doesn't make it legal.

There are many truely free assemblers for x86 available.  The two most
commonly known ones are as86 (from the bin86 package), and NASM.  as86 is
Linux only, and probably not the best assembler for writing assembly
programs.  NASM is what most people use to write assembly programs.  There
is also GASM, which claims to be 99.7% compatible with NASM, with the
differences being things he didn't like about NASM.  It might be worth
checking out, though it doesn't have a manual like NASM (just some tidbits
in the text files).

http://www.web-sites.co.uk/nasm/what.html
http://www.gaztek.org/gasm/

A word of warning about programming in assembly for a modern computer: it's
interesting, fun, and you might even learn something.  But it's probably not
as useful, like learning C or C++.  At the company I work for, we do a lot
of programming in PHP, and "system level" programming in C.  We even get to
do a lot of interesting programming like web server development, that you
wouldn't do in a lot of companies.  But we would have no use for assembly
language programming.  Writing portable code is much more important.

In modern computing environments, most time is spent in system calls in
"normal" code.  Nothing is really time critical, compared to the necessity
of being portable.  About the only two types of applications that really
need to be fast are emulators and games.  With games, things like blitters
can be written in assembly language (SDL's are, for example), but with
modern hardware most things are done in hardware.  I would imagine that
Quake III has very little or no assembly language, since all the rendering
is done using OpenGL.  In fact, even DOOM used very little assembly language
(it was developed on a NeXT workstation and ported to DOS in around a week).
Many emulators now are written in C or C++ so as to be portable.  For
something like MAME, it's better to be portable than be a little faster
(from a certain standpoint).  Also, programmer time is important.  You can
write more code in a high level language, and will be more willing to
rewrite it if you didn't spend a long time optimizing the code in assembly.
A bad algorithm is a bad algorithm, no matter what it's written in.






References: