
aPPendix C deVeLoPMent tooLs
aP-C-2
ePson
s1C33L17 teChniCaL ManuaL
C.2 Precautions on use of s5u1C33001C
This section describes the precautions to develop an S1C33L17 application using the S1C33 Family C/C++
Compiler Package (S5U1C33001C). For common precautions and details of tools, see the S5U1C33001C manual.
Version of s5u1C33001C
Use the S5U1C33001C (Ver. 3) or later.
Precautions on use of C/C++ compiler and assembler
Compiler and assembler options
When executing the compiler or assembler (or when creating a makefile), specify the -mc33pe option
to generate the codes for the C33 PE Core.
In GNU33 IDE, be sure to select C33 PE Core for the target CPU (select “PE” from [Properties] dialog
for the project > [GNU33 General] > [Target CPU Macro type]).
CPu registers
Table C.2.1 General-Purpose Register Usage
Register
%r0
%r1
%r2
%r3
%r4
%r5
%r6
%r7
%r8
%r9
%r10
%r11
%r12
%r13
%r14
%r15
Method of use
Register used as a frame pointer
Register that need has to their values saved when calling a function
Registers that need have to their values saved when calling a function
Register for storing returned values (8/16/32-bit data, 32 low-order bits of double-type data)
Register for storing returned values (32 high-order bits of double-type data)
Register for passing argument (1st word)
Register for passing argument (2nd word)
Register for passing argument (3rd word)
Register for passing argument (4th word)
Scratch register/unused
Default data area pointer register*
* When the -medda32 option (default data area is not used) is not specified
The C33 PE Core does not include the %dp register. Do not describe the %dp register in sources and do
not specify functions that use the %dp register.
Before the %r0 to %r3 registers can be used, the contents must be saved to the stack using the pushn
instruction. Also, the saved contents must be restored from the stack using the popn instruction.
The %r4 and %r5 registers can be used without saving/restoring the contents until a returned value is set
in the register before returning.
The %r6 to %r9 registers can be used after the stored arguments are used. It is not necessary to restore
the contents before returning.
The %r10 to %r15 registers are reserved by the as assembler and ld linker for referencing symbols. Try
to use these registers as little as possible.
Passing arguments to the function that returns a structure data
If the length of the structure data that is returned from a function is 8 bytes or less, the structure data
is stored in the %r4 and %r5 registers used for storing returned values. In this case, the pointer to the
structure that is normally sent as the 1st argument is not passed to the function.