LinuxAsmTools





Introductory FAQ
Advanced FAQ
Complete Novice FAQ




I
ntroductory FAQ

Why another FAQ on assembly programming?

There are several FAQ's on assembly programming and each
includes the opinions and views of the authors. Hopefully,
this FAQ provides a different view of assembly.

Is assembler primary for optimizaton and fast graphics?

No, assembler is just another language that can be used
in many ways. This site is focusing on terminal programs
that perform tasks or present data.


What is different about LinuxAsmTools?

AsmTool programs run in a text terminal and present
character based menus. They avoid graphics and
the UNIX command line style. This type of programming
can handle many applicatons without loss of usability
or friendlyness. In most cases the code is much smaller
and faster than graphical applications. Also, it is
friendlier than command line applications.


Isn't it difficult to code in assembler?

Many programmers find assembly both difficult and tedious.
A few find it easy and enjoyable. Programmers are a diverse
group.

Why would anyone want to code applications in assembler?

Each project has different objectives and goals. Someone
wrote in a FAQ that assembler should be used for HLL optimization
and not used for projects. Statements like this assume a lot
about the programmer involved and their application. Fortunately,
Linux is open system and people can make their own choice.

My personal belief is that assembler gets a lot of bad press
because many people find it difficult to understand and it scares
them. On the other hand I find assembler easy and can write
many utilities faster in assembler than in other languages.

Is it possible for assembly coding to be easy?

Most assembly programms use 8-9 simple instructions
over and over. That can be tedious but seldom difficult.
The problems with assembly are elsewhere.

Does assembly fit the unix and Linux enviornment?

No, assembly does not fit Linux very well. Most of
the code is in C and the documentation is written for
C programmers. The tools are not ideal for assembler
and few assembly programmers exist. This is changing
and as of 2004 it is now possible to write programs
without a major struggle.


What are the big problems with assembly programming

The biggest problem with assembly is its lack of
structure. Novice programmers quickly get into trouble
and create a nightmare. This, combined with the
number of instructions needed to build a program
creates much work and pain.

Isn't assembly tedious?

Yes and No. If you have good libraries and tools,
assembly is similiar to a HLL language. On Linux many
tutorial talk about debugging with GDB and using
existing libraries. That is painful. GDB is difficult
to use and existing libraries are a poor fit for most
assembly programs. It is the intent of the AsmTools
project to move Linux assembler into user friendly.

Isn't assembly prone to large unmaintainable projects?

Yes.

Shoud we use a standard assembly coding style?

There is a FAQ somewhere on assembly coding style.
It has some good ideas but feels constricting. Also,
it misses the big issues of simplicity and structure.
A terrible design or program can hide behind style.
A better idea might be to focus on simplicity and
a well organized program structure. Avoid excess
macros, equates, and other embelishments. Instead
focus on modular blocks and clear descriptions.


I'm a novice at assembly, where is the best place to begin.

Assembly can be very easy to understand if one knows
major blocks of a CPU and a little about hex arithmetic.
The computer can be understood in about ten minutes of
discussion or a basic computer book. Hex takes a little
longer to understand. Both of these topics are essencial
knowledge for other programming languages.

Probably the best place to start is a beginning assembler
book. Another approach is to study the HOWTO for writing
a simple program. This is the approach I prefer and it
gives a quick look at a working assembler program.

______________________________________________________________________________________

Advanced FAQ

Which is better ATT syntax or Intel syntax?

Most code is in Intel syntax and it may be
the best choice. On the other hand, programmers
may want to pick the syntax they feel comfortable
with. The GAS assembler uses both syntax forms,
so it isn't a big issue for most projects.

Which is the best assembler to use?

Nasm and Gas both work well. Some reports
say Fasm also works. The newer versions of nasm
now have "stabs" debugging support which is useful.
Another quasi-assembler to look at is High Level
Assembler or HLA. There is also, Yasm which allows
several syntax variations. They are all good assemblers.
This site uses nasm.

What is the best debugger to use?

see the tutorial on debugging.

How can I justify using assembler on my next project?

Justifying assembler to others is usually a waste of
time. It is difficult to prove other langages will
be significantly slower or bloated, or that assembler
can be easy to work with. Also, few people are
skilled in assembler development.



Complete Novice FAQ

Where is the console or X terminal?

If you are using a major Linux distrubition, it will boot to the
X window system and present a launch button.  The launch
menu almost always has a terminal program on it somewhere.
Typically they are called: rxvt, terminal, xterm, konsole,
gnome-terminal, aterm, etc. 

How do I set up a terminal?

Each terminal program is different, but one of the easiest is the
KDE konsole program.  Konsole starts with a menu at the top
which allows the terminal to be configured.  This includes fonts,
size, color, etc.

Can I attach programs to an icon

From within KDE, right click on an empty space within the desktop and select :
  Create new
  Link to Application
  Application  >  Command
  (enter executable name as Command)
  click on Advanced Options
  select run in  terminal
  (click OK and return to  first menu)
  if you want a special picture for icon, click on the icon.





Fork me on GitHub