Hi Mike,
Good to hear you got it to work!
Your second question should be solved using this construct:
However, it appears to trip the parser, resulting in this error message:
It's something I need to pick up with development, as well as your preference to replace the current vector table implementation with the more versatile one that we've been discussing here.
Dealing with the above restriction might be a bit of a challenge. The assembler supports a string operator that, when used in an assembler macro, can turn its argument into a string. So that might do just what you want. However you'd need to think about either using it in a separate assembly module or use __asm to both create and call the macro from C. For the latter I recall having done that a long long time ago. It did eventually work, but it was a bit of a struggle.
Best regards,
Henk-Piet Glas
Technical Product Specialist
Good to hear you got it to work!
Your second question should be solved using this construct:
Code:
#define STRING(n) #n
#define STRING_ID(n) STRING(n)
_Pragma("alias _vector_" STRING_ID(0) "=default_handler");
_Pragma("alias _vector_" STRING_ID(1) "=regular_handler");
_Pragma argument should be a single string literal
Somehow the parser doesn't work out that it must concatenated the three strings, like it will for a normal C function call:Code:
printf("alias _vector_" STRING_ID(0) "=default_handler");
Dealing with the above restriction might be a bit of a challenge. The assembler supports a string operator that, when used in an assembler macro, can turn its argument into a string. So that might do just what you want. However you'd need to think about either using it in a separate assembly module or use __asm to both create and call the macro from C. For the latter I recall having done that a long long time ago. It did eventually work, but it was a bit of a struggle.
Best regards,
Henk-Piet Glas
Technical Product Specialist