Chapter 5 Detailed Applications
- 84 -
5.8 Modifying MR308 Startup Program
MR308 comes with two types of startup programs as described below.
start.a30
This startup program is used when you created a program using the assembly language.
crt0mr.a30
This startup program is used when you created a program using the C language.
This program is derived from "start.a30" by adding an initialization routine in C language.
The startup programs perform the following:
Initialize the processor after a reset.
Initialize C language variables (crt0mr.a30 only).
Set the system timer.
Initialize MR308's data area.
Copy these startup programs from the directory indicated by environment variable "LIB308" to the current direc-
tory.If necessary, correct or add the sections below:
When using HEW, the user can choose to automatically generate a sample during project generation or use an
already created one.
Setting processor mode register
Set a processor mode matched to your system to the processor mode register.
Adding user-required initialization program
To add an initialization program needed for the user, add it at a p lace immediately preceding the ini-
tialization of standard input/output functions in the C language startup program (crt0mr.a30).
If the standard input/output functions are unused, make the relevant part a comment.