We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I want to write a text e.g. the Version Number to a Specific memory Location in the Code area. EG the _at_ command by variables. The text should be seen in the hex file in ascii format (for version control). is this possible ??. Greetings Markus
It is possible but it is a bit of a hassle - because _at_ cannot be used with initialisers. This topic has been discussed many times before - search the forum for _at_. Stefan
char code *gVersion="#ver 00#";
"char code *gVersion="#ver 00#";" That doesn't locate the version number at a specific memory location. Stefan
You can use the #pragma USERCLASS to put an initialized string at a specific address:
#pragma USERCLASS (CONST=VERSION) code const char* gVersion="#ver 00#";
CONST (C:0x0000-C:0x00FF, C:0x0200-C:0xFF7F), CONST_VERSION (C:0x0100-C:0x01FF),
>"char code *gVersion="#ver 00#";" >That doesn't locate the version number at a >specific memory location. Yes, it's true. My bad english have done the mistake (I'm so fastly read the message with question). I'm from Russia :)
See my reply to Stefan.
hi, why do not create code segment (via stand-alone C-module) and then ask linker to put it at requested address? It is described in Keil C51 manual. cu
"ask linker to put it at requested address?" Absolutely! Assigning addresses is the Linker's job; it should have nothing to do with the compiler.