Assembler

Difference between version 14 and 15 - Previous - Next
3An '''Assembler''' is a program that ca pronvegrts a human- writteadablen (in and, more p[articussemblarly, hum
lan-wrguage] into able) fprogram of machin the instructions (often called ''Assemblyt Language'' orf ''Asseombler'') into a machine-readable form.
For the Tcl Assembly language corresponding to its bytecodes, see [TAL].

** See Also **
   [bytecode]:   

   [IA-32/x86 assembler in Tcl]:   

   [Assembly code example]:   

   [Playing Assembler]:   For some 8080 memories...

   [Tclas - an assembler]:   x86 assembler with AT&Tish/gas syntax.

   [risc-v assembler]:   Written in Tcl.



** Description **

There are often several different ''machine-readable'' forms of output possible.
   * Linkable, absolute location formats
   * Nonlinkable, absolute location formats
   * Linkable, relocatable formats
   * Nonlinkable, relocatable formats

[escargo] 2004-08-09: The key question with regard to the machine-readable format is, ''What are the capabilities of the
tool chain programs that come after the assembler?'' There must be a loader (which loads the code
into the executing machine's memory); there might be a linker (which combines different programs
together into a single loadable program).  The loader might be an absolute or relocating loader.
These two processing programs are often underspecified and ignored, but they are crucially important
to real program operation.

[escargo] 2014-05-26: I would be remiss not to reference the one book I know that deals specifically with
linkers and loaders: http://www.amazon.com/Linkers-Kaufmann-Software-Engineering-Programming/dp/1558604960
(I am mentioned in the acknowledgements: http://www.iecc.com/linkers/linker00.html )

----

[DKF]: The #1 feature of assemblers is that they work out jump offsets and addresses for you.  (I've done it by hand for the Z80, but it is very difficult.)

The second feature of assemblers for some modern processors is that they can do certain kinds of ugly low-level peephole optimizations.  Exactly how much varies, but even so.

Third obvious feature is that they save you from having to look up each machine code word to use the instruction. :^)

----

[CL]: has been thinking about writing an explanation of why [Tcl] and assembly language can be good partners,
a practice briefly described in, for example, [https://web.archive.org/web/20050416210724/http://www.unixreview.com/documents/s=1357/ur0402i/%|%Regular Expressions: Programming Down to the Silicon], by [Cameron Laird] and Kathryn Soraiz, 2004-02

In the meantime, here's the [Mac OS X] [https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/Assembler/000-Introduction/introduction.html%|%Assembler Guide]


** See Also **

   [bytecode]:   

   [IA-32/x86 assembler in Tcl]:   

   [Assembly code example]:   

   [Playing Assembler]:   For some 8080 memories...

   [Tclas - an assembler]:   x86 assembler with AT&Tish/gas syntax.

   [risc-v assembler]:   Written in Tcl.

<<categories>> Development