Tool News
 
 
 

Tool News

Products Info
Downloads
Tools FAQs
MAEC TOOL NEWS: MAECT-M3T-NC30WA-021216D

A Note on C Compiler
M3T-NC30WA

Please take note of the following problem in using C compiler (with an assembler and integrated development environment) M3T-NC30WA for the M16C/60, M16C/30, M16C/20, and M16C/10 series MCUs:
  • On calling assembler macro functions


  1. Versions Concerned
    M3T-NC30WA V.5.00 Release 1 and Release 2

  2. Description
    An rts or exitd instruction may not be generated at the final line of the function calling an assembler macro.

  3. Conditions
    This problem occurs if the following four conditions are satisfied:
    (1) A function calls an assembler macro at its final line.
    (2) The function calling an assembler macro is described such a way that no stack frame is constructed.
    (3) The optimizing option -OR or -OS is selected.
    (4) The -genter option is not selected.

  4. Example
    ---------------------------------------------
       static void b(int);
       #pragma __ASMMACRO b(R0)
    
       #pragma ASM
       _b  .macro
           mov.w  R0,R1
       .endm
       #pragma ENDASM
    
       void a(void)               /* an rts instruction not created 
                                         at the last of the function a */
       {
         b(2);
       }
    ---------------------------------------------
  5. Workaround
    This problem can be circumvented in either of the following ways:
    (1) Select the -genter option.
    (2) Place a dummy asm function immediately after the line calling an assembler macro.
    [Example]
    ---------------------------------------------
       static void b(int);
       #pragma __ASMMACRO b(R0);
    
       #pragma ASM
       _b  .macro
           mov.w  R0,R1
       .endm
       #pragma ENDASM
    
       void a(void)
       {
         b(2);
         asm();    /* Place a dummy asm function */
       }
    ---------------------------------------------
  6. Schedule of Fixing the Problem
    We plan to fix this problem in our next release of the product.




© 2008. Renesas Technology Corp., All rights reserved. Privacy | Legal