I'm programming to a microprocessor (Coldfire) and I don't have access every day to the microprocessor trainer so I want to be able to execute some of my code on the computer.
So I'm trying to skip a part of my code when executing on the computer by defining _TEST_.
It doesn't work. It tries to compile the asm code and dies whining about not knowing the registers names (they're defined alright compiling against the Coldfire, not my Intel Core Duo).
Any ideas why it's not working? or maybe an alternative way to run the code on the pc without commenting it out?.
Here's sample code from my project:
inline void ct_sistem_exit(int status)
{
#ifdef _TEST_
exit(status);
#else
asm volatile(
"moveb #0,%%d1\n\t"
"movel #0, %%d0\n\t"
"trap #15\n\t"
:
:
: "d0", "d1"
);
#endif /* _TEST_ */
}
If it helps: using gcc3 with cygwin on Netbeans 6.8
And the way I'm defining _TEST_:
#define _TEST_
#include "mycode.c"
int main(int argc, char** argv)
{
ct_sistem_exit(0);
}