next up previous contents
Next: 7 The GWAM Up: 6 The GAMA Previous: 6.3 Defining assembler instructions

6.4 The assembler and loader

In the GAMA, assembler and loader are interleaved: in contrast to most assemblers for native machines which first produce a relocatable object file which is linked together with other object files by a linker and then loaded into memory for execution, the GAMA assembler and loader directly transform assembler code into executable machine code in memory.

In addition to the instructions defined via definstr, the GAMA assembler handles the following pseudo instructions:

The following example shows the usage of some of these pseudo instructions and how the assembler and loader transform assembler code into executable machine code in memory.

Example:

The assembler and machine code (with the corresponding hash table entry) for the function
fac(0) :- & 1.
fac(N) :- >(N,0) & *(N,fac(1-(N))).
is as follows:

tabular1475



Harold Boley (boley@informatik.uni-kl.de)