break statements

Dave Korn dave.korn@artimi.com
Wed Oct 18 14:52:00 GMT 2006


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....



More information about the Binutils mailing list