16
Chapter 2. Overview
2.3. Object File Formats
The gnu assembler can be configured to produce several alternative object file formats. For the most
part, this does not affect how you write assembly language programs; but directives for debugging
symbols are typically different in different file formats. Section 6.5 Symbol Attributes.
2.4. Command Line
After the program name
as
, the command line may contain options and file names. Options may
appear in any order, and may be before, after, or between file names. The order of file names is
significant.
(two hyphens) by itself names the standard input file explicitly, as one of the files for
as
to assemble.
Except for
any command line argument that begins with a hyphen (
) is an option. Each option
changes the behavior of
as
. No option changes the way another option works. An option is a
followed by one or more letters; the case of the letter is important. All options are optional.
Some options expect exactly one file name to follow them. The file name may either immediately
follow the option's letter (compatible with older assemblers) or it may be the next command argument
(gnu standard). These two command lines are equivalent:
as o my object file.o mumble.s
as omy object file.o mumble.s
2.5. Input Files
We use the phrase source program, abbreviated source, to describe the program input to one run of
as
. The program may be in one or more files; how the source is partitioned into files doesn't change
the meaning of the source.
The source program is a concatenation of the text in all the files, in the order specified.
Each time you run
as
it assembles exactly one source program. The source program is made up of
one or more files. (The standard input is also a file.)
You give
as
a command line that has zero or more input file names. The input files are read (from left
file name to right). A command line argument (in any position) that has no special meaning is taken
to be an input file name.
If you give
as
no file names it attempts to read one input file from the
as
standard input, which is
normally your terminal. You may have to type [ctl D] to tell
as
there is no more program to assemble.
Use
if you need to explicitly name the standard input file in your command line.
If the source is empty,
as
produces a small, empty object file.
2.5.1. Filenames and Line numbers
There are two ways of locating a line in the input file (or files) and either may be used in reporting
error messages. One way refers to a line number in a physical file; the other refers to a line number in
a "logical" file. Section 2.7 Error and Warning Messages.
Physical files are those files named in the command line given to
as
.
Logical files are simply names declared explicitly by assembler directives; they bear no relation to
physical files. Logical file names help error messages reflect the original source file, when
as
source
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved