Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/13/02 12:02
Read: times


 
#22880 - RE: Keil C51: Absolute code-address


Markus Hafner wrote:
-------------------------------

Does anyone knows a methode, to declare a const struct in code-space at a specific CODE address in Keil C51?


Background:

I use a philips 87LPC767-MC and i want to store some code-revision-info in the 32Byte customer code space.
I will define a C-Structure like

typedef struct
{
unsigned char uc_software_code;
unsigned char uc_main_version;
unsigned char uc_sub_version;
unsigned long ul_checksum;
} CodeRefInfo_ts;

CodeRefInfo_ts tsCodeRefInfo=
{
0x04,
0x01,
0x01,
0x012345678
} at 0xFC0E;

But it seems it is not possible to use the at-Keyword to locate a struct in the codespace?!

Any suggestion?

Thanks
Markus

Or get away from Keil and switch to Raisonance.

#include <stdio.h>

typedef struct
{
unsigned char uc_software_code;
unsigned char uc_main_version;
unsigned char uc_sub_version;
unsigned long ul_checksum;
} CodeRefInfo_ts;

code const at 0xFC0E CodeRefInfo_ts tsCodeRefInfo=
{
0x04,
0x01,
0x01,
0x012345678
};

void main ( void )
{

printf ("%x is the first element.n",tsCodeRefInfo.uc_software_code);
while (1) {};
}

Works perfectly in Raisonance.

Bryan Whitton
American Raisonance



List of 6 messages in thread
TopicAuthorDate
Keil C51: Absolute code-address            01/01/70 00:00      
RE: Keil C51: Absolute code-address            01/01/70 00:00      
RE: Keil C51: Absolute code-address            01/01/70 00:00      
RE: Keil C51: Absolute code-address            01/01/70 00:00      
RE: Keil C51: Absolute code-address            01/01/70 00:00      
RE: Keil C51: Absolute code-address            01/01/70 00:00      

Back to Subject List