This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: break statements
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: 'Turny Dávid' <Turny dot David at stud dot u-szeged dot hu>, <binutils at sourceware dot org>
- Date: Wed, 18 Oct 2006 15:17:16 +0100
- Subject: RE: break statements
On 18 October 2006 01:49, Turny Dávid wrote:
> I am beginner. I try to break a line, exactly a statement in my
> assembly source file, but I cant :) I read that I have to use the "\"
> character, but the arm-elf-as did not recognize that :( This is my
> test code:
>
> PCK = 0
> PCK1= 1
> PCK2=2
> PCK3=3
>
> .equ PMC,( 1<<PCK )|\
> ( 1<<PCK1 )|\
> ( 1<<PCK2 )|\
> ( 1<<PCK3 )
>
> .arm
> .text
> _start:
> mov r0,#PMC
>
> I got this message:
> header.s: Assembler messages:
> header.s:6: Error: bad expression
> header.s:7: Error: junk at end of line, first unrecognized character is `('
> header.s:8: Error: junk at end of line, first unrecognized character is `('
> header.s:9: Error: junk at end of line, first unrecognized character is `('
> ARM GAS header.s page 1
>
> How can I break those lines?
The assembler doesn't understand line breaks. You can pass .s files to gcc,
and it will know what to do with them by the file type (.s), and it will also
run the C preprocessor over them, which will let you use line-continuation
backslashes as you have tried above. (Additionally, you can use #include,
#define, #ifdef etc!)
So try using "arm-elf-gcc -c -x assembler-with-cpp" in place of
"arm-elf-as".
cheers,
DaveK
--
Can't think of a witty .sigline today....