Assembly language programming in unix environment
Kevin O'Gorman
kogorman at gmail.com
Mon Sep 21 05:27:34 UTC 2009
On Sun, Sep 20, 2009 at 5:23 PM, freeburn <hossain at finder-lbs.com> wrote:
>
> the hardest thing will be finding an assembler. i use nasm. but its for
> x86 processor. i dont know any other assembler in linux. i know some in
> windoze but its good to stay away from buggy windoze software(:D)
> in my office the assembler i use for RISC AVR processor is no good for
> you, cause its a native assembler made for AVR processors.
> one of my teacher has expertise in RISC machine, i'll consult with him.
> thanks for asking me this.
>
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
I spent about 25 years making a very nice living writing things in assembler
- from data
capture to an entire (simple) OS. Mostly for Data General 16-bit minis, but
some larger stuff
too. So you know I have a fondness for it.
Starting Tuesday, I'll be teaching machine code and assembler to Sophomores
and Juniors
in computer engineering and computer science. We think they need to know
this stuff to
be good at what they are going to do.
As for finding an assembler, just follow gcc. It's got an assembler built
in (on most architectures)
or uses one that comes with the machine. Use the -S (captial S) switch to
make it output the
assembler code for whatever it's compiling (it will automatically appear
with a .s extension).
The .s files can then be used as input. It's a good way to explore the
relationship between your
high-level language and the resulting assembler code. It's pretty cryptic
but you get used to it
with practice.
Assembler is sometimes still used:
device drivers
a small part of nearly any OS, for parts of hardware management like
interrupts and virtual memory.
considerable code in the standard library (hand optimization)
Also needed by:
compiler writers, obviously
optimizer writers, sometimes
In the past, knowing assembler has allowed me to save the bacon of more than
one industrial company
whose product needed a processor just a bit faster than was actually
designed in. Like a laser printer
company whose C compiler for the intel i960 architecture couldn't make code
to deliver the bits to the
raster engine quite fast enough. Choice: throw away the design and shut
down the production line, or
rewrite a 50-something-line subroutine in hand-coded assembler. Voila - a
10x speedup because there
are sometimes tricks that are so rarely needed that they never show up in
the compiler optimizers.
They ended up changing from fear that the design wouldn't work at all to
regretting that they'd
over-designed a part of the board and could have used a slower (cheaper)
part!
--
Kevin O'Gorman, PhD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090920/ee2ae189/attachment.html>
More information about the ubuntu-users
mailing list