| ??? 11/24/03 16:49 Read: times |
#59317 - RE: Problem/doubt on Keil C51 compiler Responding to: ???'s previous message |
Donald:
The original poster seemed quite concerned about how quickly _his_ C code started to run after a reset. The loops to zero RAM that are part of STARTUP.A51 take some amount of time to complete and in some cases it may be legitimate to disable the zeroing in the startup in order to get the actual code code kicked off sooner. I also perfer to manage all variable initialization in the code flow. That way it gets done at the time of my choosing and only as applicable. To me it is silly to zero memory if it is not needed at zero initially anyway. The other issue is that if you write something like: unsigned char xdata myvar[]="InitializedString"; The compiler initialize support that is (in the case of Keil in INIT.A51) provided is only done once. If I have a string that is in XDATA that never gets changed after the initial then it should instead be written as: unsigned char code myvar[]="InitializedString"; On the other hand if the string is a changing string then it is far more likely that the string initialization can be done with code that is involved with changing the string value anyway. Besides that I feel it is far more self documenting to be able to put appropriate comments in the code where the strings are setup. There is one more issue too. I tend to like to manage what goes into the code space too. If you let the default initialize process take place then the linker is having free will to attach a table onto your code image from which either the DATA, IDATA, or XDATA space is initialized from via the code provided by INIT.A51. Michael Karas |
| Topic | Author | Date |
| Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 | |
| RE: Problem/doubt on Keil C51 compiler | 01/01/70 00:00 |



