 |
|
 |
MESC TOOL NEWS:
MESCT-NC77WA-980916D
NC77WA V.5.00 Release 1 Precaution
|
Please take note of the following problem in using C compiler NC77WA V.5.00 Release 1 (with assembler and integrated tool manager) for the 77XX series of microcomputers. You are kindly requested to circumvent this problem by the workaround described below.
Problem at Accessing Arrays of Type far
- Description
Arrays of type far with data size of greater than 32 Kbytes and less than or equal to 64 Kbytes may not be accessed correctly.
- Conditions
This problem occurs if the following four conditions are satisfied:
- An array is of type far.
- The size of the array is greater than 32 Kbytes and less than or equal to 64 Kbytes.
- The type of subscripts of the array is any of type signed char, unsigned char, or signed int.
- An element of the array whose area is greater than the 32 Kbytes and less than or equal to the 64 Kbytes from the beginning of the array is accessed.
- Phenomenon
When the element is accessed as described in the condition 4 above, it is not done but another address is referenced instead.
- Example
[C source file]
-----------------------------------------------------------------------
extern far int arr[20000];
void func(int i)
{
return arr[i];
}
main()
{
int i;
i = func(100); /* OK because arr[100] < 32K */
i = func(19999); /* NG because 32K < arr[100] <= 64K */
}
-----------------------------------------------------------------------
- Workaround
Cast the type of subscripts of the array to "unsigned int".
Example: return arr[(unsigned int) i];
|
 |