Re: Startup code




"Meindert Sprang" <mhsprang@xxxxxxxxxxxxxxxxxxx> wrote in message
news:11c4uoqp2qdc8f5@xxxxxxxxxxxxxxxxxxxxx

> Again, all startup codes I have seen so far, were written in assembler.
> Probably because at startup time, there is no environment set up yet to
run
> compiled C code at all. But this only holds true with "my" definition of
> startup code, where the call to main() is not executed yet.

I tend to get some semblance of a limited C environment ready first, then
call something (in C) perhaps called _premain, which sets things up some
more
and then calls main. _premain would typically operate under certain
restrictions (like no/limited stack, no assumption that .bss is zeroed,
cpu running at a low clock speed. It then alters those and then calls
the real main().

Richard [in PE12]




.