User`s manual

SuperH Family E10A-USB Emulator Section 6 Tutorial
R20UT0870EJ1000 Rev. 10.00 Page 183 of 292
Aug 10, 2012
Section 6 Tutorial
6.1 Introduction
This section describes the main functions of the emulator by using a tutorial program.
The tutorial program is based on the C++ program that sorts ten random data items in ascending or
descending order. The tutorial program performs the following actions:
The main function generates random data to be sorted.
The sort function sorts the generated random data in ascending order.
The change function then sorts the data in descending order.
The file tutorial.cpp contains source code for the tutorial program. The file
Tutorial.abs is a compiled load module in the Elf/Dwarf2 format.
Notes: 1. Operation of Tutorial.abs is big endian. For little-endian operation,
Tutorial.abs must be recompiled. After recompilation, the addresses may differ
from those given in this section.
2. This section describes general usage examples for the emulator. For the specifications
of particular products, refer to the additional document, Supplementary Information
on Using the SHxxxx, or the online help.
3. The operation address of Tutorial.abs attached to each product differs depending
on the product. Replace the address used in this section with upper 16 bits of the
actually loaded address.
Example: Although the PC address is H’0000006c in the manual, enter H’0C00xxxx
when the loaded address of Tutorial.abs is H’0C00006c (upper bit H’0000 is
changed to H’0C00).
4. When using the MCU with flash memory, specify the end address of the internal
RAM for the stack pointer (SP) and re-compile the program. The internal RAM area
differs depending on the MCU. Refer to the hardware manual of the MCU used.
5. The displayed addresses and data may differ from those given in this section
depending on the MCU/MPU to be used.