A.5.2 Initializing RAM

The _INITSCT function in the resetprg.c file of the startup routine is used to initialize uninitialized areas. To add a section to be initialized, add the following description to the dbsct.c file.

[Example]

<dbsct.c>
...
#pragma section C C$BSEC
extern const struct {
     _UBYTE *b_s;         /* Start address of non-initialized data section */
     _UBYTE *b_e;         /* End address of non-initialized data section */
}   _BTBL[] = {
     { __sectop("B"), __secend("B") },
     { __sectop("B_2"), __secend("B_2") },
     { __sectop("B_1"), __secend("B_1") }
};
...

In the above example, the addresses used in the INITSCT function are stored in the table in order to initialize the B, B_2, and B_1 sections.