This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to use control-D character?
ali hagigat <hagigatali@gmail.com> writes:
> Thank you to reply to my message. Ian, I am using Linux, Fedora 12.
> I typed 'as' as you wrote:
> root> as
> Then I wrote the name of my input file:
> root> asm1.s
> Then i pressed <ENTER> and then <ctl-D> and nothing happned!
> For the second time I pressed <ctl-D> and now I have the following
> error message:
> {standard input}: Assembler messages:
> {standard input}:1: Error: no such instruction: `asm1.s'
>
> I think you meant writing some assembly instructions before <CTL-D>.
> But when I type:
> root> as <ENTER>
> root> mov $0, %eax <ENTER>
> root> <CAPS LOCK> <CTL-D>
> nothing happens!! but if i press <CTL-D> for two more times, it will
> exit from as and returns back to my shell prompt!
> So what happened? Did it assemble the line? Why this <CTL-D> is
> useful, how it is used?
As noted in http://en.wikipedia.org/wiki/End-of-file , ^D is the
standard Unix end-of-file indicator from the terminal. You don't need
to use the caps lock or the shift key; pressing the control key and the
D key simultaneously is sufficient.
The fact that you have to type ^D more than once seems like a bug in the
GNU assembler. Please consider reporting it at
http://sourceware.org/bugzilla/ .
And, yes, when you do type it more than once, and the assembler exits,
then it has assembled the line you typed. You will find the results in
the file "a.out".
Ian