Invoking Application's Entry Point in Startup Function

The startup code must call the application's entry point, located in the ROM library. You must explicitly call this function by name. Ideally, call the application's entry point just before calling the application's main routine (refer the following listing).

Listing: Invoking the Application's Entry Point

void _Startup(void) {
  ... set up stack pointer ...

  ... zero out ...

  ... copy down ...

  CopyCode();

  ... call main ...

}