S5U1C17001C ManUal
EPSOn
4-13
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
4 SOUrCE filES
4
SrcFiles
4.4 Precautions for Creation of Sources
(1) Place a tab stop every 4 characters wherever possible. Source display/mixed display with the
gdb
debugger of a
source set at a tab interval other than 4 characters may result in displaced output of the source part.
(2) When compiling/assembling a C source or assembly source that includes debugging information, do not
include other source files (by using
#include
). It may cause a debugger operation error. This does not apply
to ordinary header files that do not contain sources.
(3) When using C and assembler modules in a program, pay attention to the interface between the C functions and
assembler routines, such as arguments, size of return values and the parameter passing conventions.
(4) The C compiler assumes that the address size is 24 bits by default or 20 bits when the
-mshort-offset
option
only is specified. Therefore, be aware that the expected results may not be obtained from an operation using an
unsigned int
/
unsigned short
type variable and a pointer, as
int
type variables are 16-bit size, as
shown below.
int* ip_Pt;
unsigned int i = 1;
ip_Pt += (-1)*i;
The code above is written to expect "
ip_Pt += (-1);
", however it will be processed as "
ip_Pt +=
0xffff;
".
Although it will be processed normally when the address space is 16-bit size, an invalid address will result if
the address space is 24- or 20-bit size.
To perform a pointer operation correctly when the C compiler is under the default condition or when the
-ms-
hort-offset
option only is specified, avoid using
unsigned int
/
unsigned short
type variables, or
add the suffix '
L
' to the constant as shown below so that it will be handled as a
long
type constant.
ip_Pt += (-1L)*i;
(5) In C sources, function names can be used as the pointer to the function, note, however, that the pointer values
cannot be assigned to real type (
float
/
double
) variables and arrays using the function names.
They can be assigned to integer type variables and arrays.
However, if assigning a value to a global variable/array using a function name at the same time the variable/
array is declared, the types of variables/arrays are limited depending on the address space size.
In 24-bit address space (default condition) or 20-bit address space (when
-mshort-offset
only is specified)
The
long
/
unsigned long
type variables/arrays only allow substitution with a function name.
In 16-bit address space (when
-mpointer16
is specified)
The
short
/
unsigned short
/
int
/
unsigned int
type variables/arrays only allow substitution with
a function name.
If it is not at declaration, global variables/arrays in any integer type can be substituted with a function name.
Integer type local variables/arrays always allow substitution with a function name regardless of whether it is at
declaration or not.
Examples: In 16-bit address space (when
-mpointer16
is specified)
1)
short s_Global_Val = (short)boot;
→
A function name can be used to assign the pointer to the
s h o r t
type global variable
s_Global_Val
when it is declared.
2)
long l_Global_Val = (long)boot;
→
An error occurs if a function name is assigned to the
long
type global variable
l_Global_Val
when it is declared.
error: initializer element is not constant
3)
short s_local_val = (short)boot;
→
A function name can be used to assign the pointer to the
s h o r t
type local variable
s_local_val
.
Содержание S5U1C17001C
Страница 6: ......
Страница 17: ...1 General S5U1C17001C Manual 1 General ...
Страница 18: ......
Страница 21: ...1 2 Install S5U1C17001C Manual 2 Installation ...
Страница 22: ......
Страница 29: ...3 SoftDev S5U1C17001C Manual 3 Software Development Procedures ...
Страница 30: ......
Страница 103: ...4 SrcFiles S5U1C17001C Manual 4 Source files ...
Страница 104: ......
Страница 121: ...5 IDE S5U1C17001C Manual 5 gnU17 iDE ...
Страница 122: ......
Страница 365: ...6 Compiler S5U1C17001C Manual 6 C Compiler ...
Страница 366: ......
Страница 385: ...7 Library S5U1C17001C Manual 7 library ...
Страница 386: ......
Страница 404: ...7 18 EPSON S5U1C17001C Manual C Compiler Package for S1C17 Family Ver 1 5 0 7 liBrary THIS PAGE IS BLANK ...
Страница 405: ...8 Assemblr S5U1C17001C Manual 8 assembler ...
Страница 406: ......
Страница 438: ...8 32 EPSON S5U1C17001C Manual C Compiler Package for S1C17 Family Ver 1 5 0 8 aSSEMBlEr THIS PAGE IS BLANK ...
Страница 439: ...9 Linker S5U1C17001C Manual 9 linker ...
Страница 440: ......
Страница 448: ...9 8 EPSON S5U1C17001C Manual C Compiler Package for S1C17 Family Ver 1 5 0 9 linkEr THIS PAGE IS BLANK ...
Страница 449: ...10 Debugger S5U1C17001C Manual 10 Debugger ...
Страница 450: ......
Страница 625: ...10 174 EPSON S5U1C17001C Manual C Compiler Package for S1C17 Family Ver 1 5 0 10 DEBUggEr THIS PAGE IS BLANK ...
Страница 626: ...11 Tools S5U1C17001C Manual 11 Other Tools ...
Страница 627: ......
Страница 695: ...11 68 EPSON S5U1C17001C Manual C Compiler Package for S1C17 Family Ver 1 5 0 11 OTHEr TOOlS THIS PAGE IS BLANK ...
Страница 696: ...S1C17 Family C Compiler Package Quick Reference Reference ...