 |
|
 |
MAEC TOOL NEWS:
MAECT-NC308WA_1-010701D
NC308WA, NC30WA, NC79WA, and NC77WA Precautions
|
Please take note of the problem shown below in using C compilers (with an assembler and integrated development environment) NC308WA, NC30WA, NC79WA, and NC77WA.
- Descriptions of inline assemble functions have been omitted in User's Manual and Release Note
- Products and Versions Concerned
| For the M16C/80 series MCUs | : NC308WA V.1.00 Release 1 -- V.3.10 Release 3 |
| For the M16C/60 and M16C/20 series MCUs | : NC30WA V.1.00 Release 1 -- V.4.00 Release 2 |
| For the 7900 series MCUs | : NC79WA V.2.00 Release 1 -- V.4.10 Release 1 |
| For the 77xx series MCUs | : NC77WA V.3.00 Release 1 -- V.5.20 Release 4 |
- Descriptions to Be Added
Please supplement User's Manual and Release Note with the descriptions shown below.
C compilers generate code of arguments to be passed via registers and of register variables by analyzing their scopes. However, if manipulations of register values are described using inline assemble functions (such as #pragma ASM/#pragma ENDASM directives and asm function), C compilers cannot hold information on the scopes of the above-mentioned arguments and register variables. So, be sure to save and recover register contents on and from the stack when registers are loaded using inline assemble functions described above.
Example of Descriptions in NC308WA and NC30WA:
--------------------------------------------------------------------
int k;
int func(int i)
{
int j;
asm( " pushm R0,R1" ); /* Saves register contents */
asm( " mov.w #000AH,R1" );
asm( " add.w R1,R0" );
asm( " mov.w R0,_k" );
asm( " popm R0,R1" ); /* Recovers register contents */
j = i + 100;
return j;
}
--------------------------------------------------------------------
Example of Descriptions in NC79WA and NC77WA:
--------------------------------------------------------------------
int k;
int func(int i)
{
int j;
asm( " pha" ); /* Saves register contents */
asm( " lda.W A,#000AH" );
asm( " sta.W A,DT:_k");
asm( " pla" ); /* Recovers register contents */
j = i + 100;
return j;
}
--------------------------------------------------------------------
|
 |