How does one refer to macros defined in msp430*.h from within inline assembly in a C source file compiled by MSP430 TI compiler?
#include <msp430.h> int main() { asm ( " BIS.B #BIT0, &P1OUT " ); }
results in
"/tmp/005274EP3KP", ERROR! at EOF: [E0300] The following symbols are undefined:
BIT0
P1OUT
1 Assembly Error, No Assembly Warnings
Including the following at the top of the C source file or before the above 'asm' statement:
asm ( " .cdecls C,LIST, \"msp430fr5969.h\" " )
results in either
"../src/main.c", line 10: error #1120: this assembly directive not allowed at this scope
"../src/main.c", line 96: error #1118: this assembly directive not allowed inside a function
An attempt to use parameters defined in the C source (implied in this post):
asm ( " BIS.B #BIT0, %[portreg]" : [portreg] "m" (P3OUT) );
results in
"../src/main.c", line 98: error #18: expected a ")"
I could not find info in neither of the following:
SLAU132J : MSP430 Optimizing C/C++ Compiler v 4.4 (Sections 5.10 and 6.6.5)
SLAA140 : Mixing C and Assembler With the MSP430
Closest related post: http://e2e.ti.com/support/development_tools/compiler/f/343/t/219557
Compiler version: cl430: MSP430 C/C++ Compiler v4.4.3 (CCSv6)
Host: Linux x86