Computer Science 281
Computer Organization

Denison
CS281 Examples

Cache PDF Figures

DSCPU Test Programs

Lecture Notes

Examples

Assembler Instructions

Building an executable from an assembly language source file is a two step process. In the first step, we convert the assembly source into an object file. This contains machine code instructions but also has a symbol table so that the object can be linked together with other object code into an executable. This, then, is the second step. Part of the linking into an executable is to combine the object file from the assembly language with the object from our asio (assembler io) functions along with libc, the general purpose runtime library. The last is implicit.

In general:

> as -o <file>.o <file>.s
> gcc -o <file> <file>.o asio.o

For our addAB program as an example:

> as -o addAB.o addAB.s
> gcc -o addAB addAB.o asio.o

 

References