How to use control-D character?

Ian Lance Taylor ian@airs.com
Wed Oct 13 13:13:00 GMT 2010


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



More information about the Binutils mailing list