Compiler doesn't recognize #define in assembly code

12 Jun 2011

The compiler appears not to recognize #define directives in *.s files - it throws an "unknown opcode or Macro" error.

Comments ?

12 Jun 2011

The ARM compiler doesn't use C preprocessor for asm files. You can use ARM-specific directives:

IF :DEF:TARGET_LPC1768        
   RBIT cntrbitrev,index
ELSE
   ; since we need only 16 values, use a lookup table
   ADR cntrbitrev, BITREV16
   LDR cntrbitrev, [cntrbitrev, index, LSL #2]
ENDIF   
12 Jun 2011

That's a bit of a problem. The Keil *.s files appear to be able to use #define and the ARM DSP libraries are full of #defines in *.s files. It's a bit of a worry if we can't easily compile this important software for mbed.

14 Jun 2011

The ARM DSP libraries have been ported by Simon over to the mbed already and are found here: http://mbed.org/users/simon/libraries/dsp/lnub4w. The v29 beta mbed library is required to compile them but there are no problems wrt assembler files.

Rob

15 Jun 2011

Thanks Rob.