| An Introduction to GCC - for the GNU compilers gcc and g++ by Brian J. Gough, foreword by Richard M. Stallman Paperback (6"x9"), 144 pages ISBN 0954161793 RRP £12.95 ($19.95) "A wonderfully thorough guide... well-written, seriously usable information" --- Linux User and Developer Magazine (Issue 40, June 2004) Get a printed copy>>> |
11.4 The assembler
The purpose of the assembler is to convert assembly language into machine code and generate an object file. When there are calls to external functions in the assembly source file, the assembler leaves the addresses of the external functions undefined, to be filled in later by the linker. The assembler can be invoked with the following command line:
$ as hello.s -o hello.o
As with GCC, the output file is specified with the -o option.
The resulting file ‘hello.o’ contains the machine instructions for
the Hello World program, with an undefined reference to
printf.
| ISBN 0954161793 | An Introduction to GCC - for the GNU compilers gcc and g++ | See the print edition |