User`s guide

System LSI Division, Semiconductor Business
Fixed: When some initialized and un-initialized variables are defined together within the
same ‘data_seg’ of ‘pragma’, the section of the variables is generated incorrectly.
Ex>
#pragma memory=data_seg(DATASEC)
int uninitialized_data0; // should have ‘zdata’ section attribute
int initialized_data = 7; // should have ‘idata’ section attribute
int uninitialized_data1; // should have ‘zdata’ section attribute
// All variables defined with ‘pragma’ should be initialized additionally in ‘cstartup’.
#pragma memory=default
V1.55r
Jul. 11
th
,
2005
Fixed: When over optimization level 1 accessing a global variable, it is accessed through
the wrong calculated address. It occurs only when 1byte structure is set as the base
for global variable access.
Ex>
#include <stdio.h>
typedef struct {
char bit0;
} BITFIELD_ONESIZE;
typedef struct {
char c;
} STRUCT_ONESIZE;
BITFIELD_ONESIZE bf; // &bf = 0x200058
STRUCT_ONESIZE st; // &st = 0x200059
int i; // &I = 0x20005A
void main(void)
{
st.c = 0; // ‘st’ is set as base for global variable access
i = 0x1122; // but ‘I’ is accessed by wrong calculated address ‘&st+2’
if (i != 0x1122)
printf("fail\n");
}
Fixed: The operation of option “-code” is wrong. A initial value of local variable that has
‘float’ and ‘double’ is stored in some tables and so under option “-code” tables of
initial value should be located in ROM and be initialized by accessing ‘ldc’
instruction. It is same for local variable of ‘char array’, too.
Ex>
#include <stdio.h>
void main(void)
{
float f = 1.0; // initial value is placed in ROM and when initializing ‘f’
// initial value should be accessed by ‘ldc’ instruction
char arr[] = “abc”;
if ((int)f != 1)
printf(“fail\n”);
}
Property of Samsung Electronics Co., Ltd. 13