 |
|
 |
MESC TOOL NEWS:
MESCT-NC308WA_1-010216D
NC308WA V.3.10 Release 1 Precaution
|
Please take note of the following problems in using C compiler with an assembler and integrated development environment NC308WA V.3.10 Release 1 for the M16C/80 series of MCUs:
- On testing bit fields in an array
- On arithmetic and logical shift instructions
- Problem on Testing Bit Fields in an Array
- 1.1 Version Concerned
- NC308WA V.3.10 Release 1
- 1.2 Description
- When a bit field of 1 bit wide in an array is tested in the controlling expression of an if statement, an assemble error may arise with the error message shown below.
- Error (asp308): Addressing mode specifier is not appropriate '19'
- 1.3 Conditions
- This problem occurs if the following three conditions are satisfied:
- (1) The controlling expression of an if statement tests a bit field of 1 bit wide in an array.
- (2) The bit field in (1) above is the high-order bit of a byte in memory.
- (3) The subscript of the array in (1) above is a variable.
- 1.4 Example
-
------------------------------------------------------------------
struct bits {
unsigned char dmy : 7;
unsigned char b7 : 1; /* Conditions (1) and (2) */
} s[10];
int func(int i)
{
if (s[i].b7 == 1) { /* Conditions (1) and (3) */
i++;
}
return i:
}
------------------------------------------------------------------
- 1.5 Workaround
- Temporarily assign an element of the array of structures to an automatic variable and then test it.
------------------------------------------------------------------
int func(int i)
{
struct bits tmpbuf; /* Declares a temporary variable */
tmpbuf = s[i]; /* Assigns an element of the array
of structures */
if (tmpbuf.b7 == 1) { /* Tests the temporary variable */
i++;
}
return i;
}
------------------------------------------------------------------
- 1.6 Schedule of Fixing Problem
- We plan to fix this problem in our next release.
NC308WA V.3.10 Release 1 Precaution MESCT-NC308WA_1-010216D
- Problem on Arithmetic and Logical Shift Instructions
- 2.1 Version Concerned
- NC308WA V.3.10 Release 1
- 2.2 Description
- In assembly language or inline assemble descriptions, using an immediate value as the operand of arithmetic shift instruction "SHA" or logical shift instruction "SHL" may cause the shift count to be coded incorrectly, with no errors being detected even if the immediate value outgoes its allowable range.
- 2.3 Conditions
- This problem occurs if the following two conditions are satisfied:
- (1) The size specifier of SHA or SHL is '.L'.
- (2) An immediate value within a range from -32 to -17 or from 17 to 32 is used.
-
Example:
----------------------------------------------------------------
sym1 .EQU 30
SHA.L sym1,mem
SHL.L #-18,mem
----------------------------------------------------------------
- 2.4 Workaround
- Use an immediate value within a range from -16 to 16 (except 0) as the operand of arithmetic shift instruction "SHA.L" or logical shift instruction "SHL.L".
- 2.5 Schedule of Fixing Problem
- We plan to fix this problem in our next release.
|
 |