This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CoMUL instruction in MAC unit

Hi there

I use ST10F269 with Keil mVision 3 with C compiler 6.04.

I wrote includes in C-file:
#include <ST10MAC.H>
#include <regst10F269.h>

and

#pragma MAC

but I can not compile c-file with Sine generation, for example:
...
__inline void Generate_Sine (struct tone near *t)
{ __asm { MOV R4, [t+] // cos factor MOV R5, [t+] // y[-1] CoMUL R4, R5 }
}

...

Should I define some misc controls in project C options (ex. EXTMAC or MODV2 or MOD167) or do something else?

PS:Without CoMUL instruction it can be compiled (only two MOVs).

Thanks for help, anyway

  • Alexey,

    The pragma MAC useful when compiling C-code to make sure the MAC instructions will be created by the compiler.

    In order to get inline asm compiled, do as follows:
    1. Have IDE loaded with your project
    2. Right-click on project in Project Workspace
    3. Select Options for Target...
    4. Go to the tab "C166" in popup options window
    5. Put EXTMAC into the Misc Controls line (I have MOD167 as well there)

    P.S. Note, I failed to get MAC simulated in a right way in IDE :-( (but it runs OK on real h/w).

    Regards,
    Nikolay.