|
You are correct that in c most programs start with a main(), but that assumes that the Operating systems is present. In embedded systems with no OS _entry is the address that the CPU jumps to at power-up. The entry point usually contains processor initialization code. Since this code must run without the CPU being fully setup the developer usually will use ASM as the c runtime libraries are not available yet. You will notice that this code sets up the stack pointer which points to the memory location that stores function arguments and local variables, initializes floating point, configures memory and then calls _do_cinit () which initializes the c runtime so that c code can be used. The jump to main() is where the c code starts.
Rich
Last edited by Paladino : 27-10-2003 at 12:56.
|