Hi everyone,

the C68 compiler for QDOS is the bee's knees and I love it. I stumbled
into a minor problem with it the other day and I thought to post this
just in case someone else happens to run into it also.

C68 compiler documentation mentions that it is possible to reduce
binary size by about 12k if one doesn't need things like environment
variables, command line parameters, etc. The documented way of
achieving this is to declare the following at global scope:
(*_Cinit)() = main;
Well, since I'm targeting the original QL and want to squeeze out
every kb possible I gave this a go and ended up with illegal
instruction trap every time...

I contacted Dave Walker who is one of the authors and he was extremely
kind and helpful and took a look. It seems that this is a
documentation bug. The correct vector to override is actually _Cstart:
(*_Cstart)() = main;
does the trick.

Best regards,
Petri


A more detailed explanation from Dave below:

======================================================
What I found is that your problem is actually a mistake in the
documentation.   The vector that is meant to be initialised to point to
main() is the _Cstart one and not _Cinit as the documentation says.   After
making that change your program works as expected.

I think that the reason for the confusion is that if you do not explicitly
provide a value for the _Cstart vector, then the default for the _CStart
vector is to point to the _Cinit label (which is the beginning of the code
that carries out the initialisation of the full C environment - exactly the
code you are trying to omit!).
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to