Hi,
I have a function like below. How could I make it compile?
MacroTest.c below
#include "MacroTest.h"
void main() {
char var1;
var1 = 80;
SaveBankSelectRegister(var1);
}
MacroTest.h below
#ifndef __Macro
#define __Macro
#define SaveBankSelectRegister(SaveVariable) asm { movff BSR, SaveVariable }
#endif
Undeclared identifier '_var1' in expression MacroTest.c
Normally, if I use this as a function, I put a "_" infront of the variable in asm like below. What about using it in macros?
void SaveBankSelectRegister(char saveVariable)
{
asm { movff BSR, _saveVariable }
}