Hi,
I am attempting to figure out how to avoid the use of __intrinsic in my C code. This is because our test and verification department has an issue of using code that isn't ANSI C89 compliant. There are constructs such as the following:
__irq __arm void irq_handler(void) { switch((0xff & IRQIVEC)-1) { case CIM_COMP1 : COMP1_irq_handler(); break;
} }
These aren't actually the regular C functions and are translated by the C compiler into inline assembler (based upon "intrinsic" definitions particular to the IAR compiler, i think in the header is "prototyped" sort of like "__intrinsic __irq__arm(void);" another one is "__intrinsic __no_operation(void)" ). Our test guy says I should be looking at instead making a C callable function assembler routine which would be the equivalent; the reason being is that we can use test procedures which are standard (C89) and not have platform/compiler dependent code. I've always worked in C or assembler, and I've never had to try to combine them. And add to this the utilization of the intrinsic keyword and I'm just flat confused. Has anyone encountered this problem (and hopefully fixed it) ?
I know the __intrinsic keyword is used to trigger the compiler to use inline assembly as well as being a cue to be able to include the code into it's optimization, whereas it couldn't with directly instantiated assembler. Our test team has a real problem with using inline assembly when it comes to testability; which to me seems counterproductive when doing an embedded application. And since I am low guy on the totem I don't have much say in the matter; all I can do is capitulate and find a fix, or come up with some damn good reasons why it won't work any other way.
Thanks!
--wulf