1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- This file documents the GNU Assembler "as".
4
5Copyright (C) 1991-2021 Free Software Foundation, Inc.
6
7Permission is granted to copy, distribute and/or modify this document
8under the terms of the GNU Free Documentation License, Version 1.3
9or any later version published by the Free Software Foundation;
10with no Invariant Sections, with no Front-Cover Texts, and with no
11Back-Cover Texts.  A copy of the license is included in the
12section entitled "GNU Free Documentation License".
13 -->
14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
15<head>
16<title>Using as: Input Files</title>
17
18<meta name="description" content="Using as: Input Files">
19<meta name="keywords" content="Using as: Input Files">
20<meta name="resource-type" content="document">
21<meta name="distribution" content="global">
22<meta name="Generator" content="makeinfo">
23<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
24<link href="index.html#Top" rel="start" title="Top">
25<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
26<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
27<link href="Overview.html#Overview" rel="up" title="Overview">
28<link href="Object.html#Object" rel="next" title="Object">
29<link href="Command-Line.html#Command-Line" rel="previous" title="Command Line">
30<style type="text/css">
31<!--
32a.summary-letter {text-decoration: none}
33blockquote.smallquotation {font-size: smaller}
34div.display {margin-left: 3.2em}
35div.example {margin-left: 3.2em}
36div.indentedblock {margin-left: 3.2em}
37div.lisp {margin-left: 3.2em}
38div.smalldisplay {margin-left: 3.2em}
39div.smallexample {margin-left: 3.2em}
40div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
41div.smalllisp {margin-left: 3.2em}
42kbd {font-style:oblique}
43pre.display {font-family: inherit}
44pre.format {font-family: inherit}
45pre.menu-comment {font-family: serif}
46pre.menu-preformatted {font-family: serif}
47pre.smalldisplay {font-family: inherit; font-size: smaller}
48pre.smallexample {font-size: smaller}
49pre.smallformat {font-family: inherit; font-size: smaller}
50pre.smalllisp {font-size: smaller}
51span.nocodebreak {white-space:nowrap}
52span.nolinebreak {white-space:nowrap}
53span.roman {font-family:serif; font-weight:normal}
54span.sansserif {font-family:sans-serif; font-weight:normal}
55ul.no-bullet {list-style: none}
56-->
57</style>
58
59
60</head>
61
62<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
63<a name="Input-Files"></a>
64<div class="header">
65<p>
66Next: <a href="Object.html#Object" accesskey="n" rel="next">Object</a>, Previous: <a href="Command-Line.html#Command-Line" accesskey="p" rel="previous">Command Line</a>, Up: <a href="Overview.html#Overview" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
67</div>
68<hr>
69<a name="Input-Files-1"></a>
70<h3 class="section">1.5 Input Files</h3>
71
72<a name="index-input"></a>
73<a name="index-source-program"></a>
74<a name="index-files_002c-input"></a>
75<p>We use the phrase <em>source program</em>, abbreviated <em>source</em>, to
76describe the program input to one run of <code>as</code>.  The program may
77be in one or more files; how the source is partitioned into files
78doesn&rsquo;t change the meaning of the source.
79</p>
80<p>The source program is a concatenation of the text in all the files, in the
81order specified.
82</p>
83<p>Each time you run <code>as</code> it assembles exactly one source
84program.  The source program is made up of one or more files.
85(The standard input is also a file.)
86</p>
87<p>You give <code>as</code> a command line that has zero or more input file
88names.  The input files are read (from left file name to right).  A
89command-line argument (in any position) that has no special meaning
90is taken to be an input file name.
91</p>
92<p>If you give <code>as</code> no file names it attempts to read one input file
93from the <code>as</code> standard input, which is normally your terminal.  You
94may have to type <tt class="key">ctl-D</tt> to tell <code>as</code> there is no more program
95to assemble.
96</p>
97<p>Use &lsquo;<samp>--</samp>&rsquo; if you need to explicitly name the standard input file
98in your command line.
99</p>
100<p>If the source is empty, <code>as</code> produces a small, empty object
101file.
102</p>
103
104<a name="Filenames-and-Line_002dnumbers"></a>
105<h4 class="subheading">Filenames and Line-numbers</h4>
106
107<a name="index-input-file-linenumbers"></a>
108<a name="index-line-numbers_002c-in-input-files"></a>
109<p>There are two ways of locating a line in the input file (or files) and
110either may be used in reporting error messages.  One way refers to a line
111number in a physical file; the other refers to a line number in a
112&ldquo;logical&rdquo; file.  See <a href="Errors.html#Errors">Error and Warning Messages</a>.
113</p>
114<p><em>Physical files</em> are those files named in the command line given
115to <code>as</code>.
116</p>
117<p><em>Logical files</em> are simply names declared explicitly by assembler
118directives; they bear no relation to physical files.  Logical file names help
119error messages reflect the original source file, when <code>as</code> source
120is itself synthesized from other files.  <code>as</code> understands the
121&lsquo;<samp>#</samp>&rsquo; directives emitted by the <code>gcc</code> preprocessor.  See also
122<a href="File.html#File"><code>.file</code></a>.
123</p>
124<hr>
125<div class="header">
126<p>
127Next: <a href="Object.html#Object" accesskey="n" rel="next">Object</a>, Previous: <a href="Command-Line.html#Command-Line" accesskey="p" rel="previous">Command Line</a>, Up: <a href="Overview.html#Overview" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
128</div>
129
130
131
132</body>
133</html>
134