s5u1c17001c Epson Electronics America, Inc., s5u1c17001c Datasheet - Page 379

no-image

s5u1c17001c

Manufacturer Part Number
s5u1c17001c
Description
Cmos 16-bit Application Specific Controller
Manufacturer
Epson Electronics America, Inc.
Datasheet
8.7 Optimization of Extended Instructions
The C compiler compiles all codes that reference a global symbol address and some codes that reference a local
symbol address into s∗ or x∗ extended instructions. As shown in the preceding section, these extended instructions
are expanded into a basic instruction with the ext instructions.
If the operand of an extended instruction is an immediate data, the assembler adds zero to two ext instructions to
the basic instruction according to the immediate data size. So the optimization is completed at this point.
If the operand of an extended instruction is a symbol, the assembler adds the required number of ext instructions
for referencing to the entire memory space, as the symbol value is not determined until linkage has completed.
Therefore, unnecessary ext instructions may be output and it increases the code size. The -mc17_ext option is
used for the optimization to remove unnecessary ext instructions.
-mc17_ext option
Optimize procedure
S5U1C17001C MANUAL
(C COMPILER PACKAGE FOR S1C17 FAMILY) (Ver. 1.1)
-mc17_ext filename.dump filename.map
filename.dump
filename.map
Example: objdump -t test.elf > test.dump
The assembler needs the symbol address information determined in the linkage process for the optimization and
gets it from the link map and dump files specified with the -mc17_ext option. Therefore, the optimization
needs a two-pass make process. The procedure shown below should be written in the makefile to perform a
two-pass make process.
1. Compile
2. Assemble (without the -mc17_ext option)
3. Link (with a map file output)
4. Create a dump file from the elf file using objdump.
5. Reassemble (with the -mc17_ext option) * Specify the same input/output files as Step 2.
The makefile created by the IDE contains the procedure above.
as -mc17_ext test.dump test.map -otest.o test.s
File in which global and local symbol information is described. Use objdump to create this
file. The file name extension must be ".dump".
objdump -t filename.elf > filename.dump
File in which object mapping information is described. This file is delivered by the ld linker.
The file name extension must be ".map".
EPSON
8 ASSEMBLER
8-25

Related parts for s5u1c17001c