??? 03/17/05 08:24 Read: times |
#89852 - Poor old 'C' Responding to: ???'s previous message |
"One could say that in assembler this (global variables, etc.) is always a problem. It's just that in assembler it's considered acceptable whereas in 'C' it is frowned upon."
Not at all - there are occasions where a 'global', or at least file scope variable makes perfect sense. The art is in choosing when to use them. An excellent reason for using locals with a compiler such as Keil, though, is to minimise RAM usage. "As I get further into my C-based project, I'm really beginning to feel that 'C' on the 8052 is simply a way to generate the assembly code faster than in assembly, rather than really looking to reap the supposed benefits of 'C'." I suspect that is because you are writing 'C' from an assembler programmer's viewpoint. To reap the benefits of 'C' you need to think like a 'C' programmer... |