??? 12/08/08 22:58 Read: times |
#160770 - Correct Responding to: ???'s previous message |
Jacek Bogusz said:
there aren't the rules of writing the compiler, passing parameters etc (except the syntax)? Anyone can do as he likes? That's right - it is entirely up to the compiler writer how they choose to implement the requirements of the language specification. But note that some of the 'C' requirements are not really (or at all!) compatible with the 8051 architecture - so compiler writers have to make certain compromises. eg, 'C' specifies that 'int' should have the same size as the word size of the underlying architecture - which would be 8 bits for an 8051 - but also requires that 'int' should be at least 16 bits... The 'C' integer promotion rules can cause significant code bloat for an 8051 - so Keil provide an option to disable it. 'C' requires that functions should inherently be reentrant (unless the programmer specifically makes them otherwise): this naturally suggests parameter passing on the stack - but the 8051's stack is totally unsuitable for that. So Keil have their parameters-in-fixed-locations scheme - which gives effecient code, but is inherently not reentrant. etc, etc. If you really want details, you will have to read the Manuals of the specific compilers... |