Using keyword static at modular level , i.e functions/variables which are used in same module only are declared as static, is it helpful in generating better code.
I read in 8051 declaring static at modular level is good ,as it helps in generating smaller code. Because compiler can now use ACALL inst. instead of LCALL. So faster calling & smaller code is generated.
Does samply apply to cortex M3 or not ? There is no ACALL or LCALL in it but is there any similar to it.
Yes it is better to use static for better modularity.
But I want to know will it bring some optimization like in 8051 where LCALL & ACALL inst are used. I tried this & saw some shortage in coed memory & I am not sure how it happens
Tried what, exactly?
And what, exactly, did you see?
Depending upon the optimization level, you may see some static functions being automatically inlined and various other clever similar code shuffling operations being done by the compiler.