Because every memory model needs special startup initialization, there are also startup object files compiled with different Compiler option settings (see Compiler options for details).
The correct startup file must be linked with the application depending on the memory model chosen. The floating point format used does not matter for the startup code.
Note that the library files contain a generic startup written in C as an example of doing all the tasks needed for a startup:
-
Zero Out
-
Copy Down
- Handling
ROM libraries
Because not all of the above tasks may be needed for an application and for efficiency reasons, special startup is provided as well (e.g., written in HLI). However, the version written in C could be used as well. For example, just compile the `
startup.c' file with the memory/options settings and link it to the application.
Note:
When using the small memory model, the size of data pointers is (if not specified otherwise) 8 bits. This means that any memory location above
0xFF cannot be accessed using such a pointer. The startup code makes use of pointers when performing the zero-out and copy-down operations. If the application has data above the
0xFF boundary, then the startup code has to use the
__far pointers. To enforce this, the user has to provide
-D__STARTUP_USE_FAR_POINTERS in the command line when compiling the startup code. This is also true when using the banked memory model, since in this situation the pointers are
__paged by default. This means that in a scenario where the pointed data crossing page boundary is not supported, the startup code does not work with the
__paged pointers.