views:

37

answers:

2

Hi while i cross compile an startup.s file (arm-none-eabi-as file.s) (*-gcc)

I am getting in each commentary line some errors - junk at end of line, first unrecognized character is /

when i delete the // some comment lines i get errors about undefined symbols even i defined them at beginning of the file.

anyone know whats wrong?

+1  A: 

(arm) Assembler does not support // comments or defines, you have to use .equ and @ for comments. If you let gcc parse it you can put C isms like that into your assembler. Personally I avoid such C isms and keep the assembler clean. if you cannot do that or need includes with defines for example let gcc pre-process the file before sending it to gas.

dwelch
A: 

If you want to use macros or C comments, then you have to preprocess the source file with the C preprocessor. The C preprocessor removes comments and interprets macros. The GNU assembler should run the C preprocessor automatically if the source file name ends with .S, with an uppercase 'S'.

Thomas Pornin
yes i figured it out some days ago. Thx anyways.
Gobliins