Discussion Forum

initialisze xdata and code memory

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Shahsi Banavara
Posted
25-Jan-2002 13:46 GMT
Toolset
C51
New! initialisze xdata and code memory
Can I get some info on how to initialise the Code memory and data memory

1)Unsigned char xdata temp _at_ 0x8000;
2)unsigned char code temp1_at_0x8000;

In the cases mentioned above , how
do i initialise 20 bytes of data conitiugously

Read-Only
Author
Scott deWolski
Posted
25-Jan-2002 14:21 GMT
Toolset
C51
New! RE: initialisze xdata and code memory
You might want to look at;

http://www.keil.com/forum/msgpage.asp?MsgID=4481
Read-Only
Author
Andrew Neil
Posted
25-Jan-2002 15:06 GMT
Toolset
C51
New! RE: initialisze xdata and code memory
This is a very frequent topic - just scroll back through the list, or use the 'Search'

Any particular reason why you need to initialise specific locations?
Read-Only
Author
shashi Ramachandra
Posted
29-Jan-2002 03:29 GMT
Toolset
C51
New! RE: initialisze xdata and code memory
Thanks for the reply

Well I do not have specific reason , to initialise xdata to specfic memory location.
This is for exploring different possibilitis to initialize data ,
a lookup table for example

I have one question below

What are the options to be set in the KEIL to generate the Hex code from 0000 location
Thanks
Regards
SHASHI B R
Read-Only
Author
Andrew Neil
Posted
29-Jan-2002 20:42 GMT
Toolset
C51
New! RE: initialisze xdata and code memory
"This is for exploring different possibilitis to initialize data"

If you're programming in 'C', just leave it to the compiler!

"I have one question below"

Sounds like a new question - so best to start a new thread with it.
Read-Only
Author
Norbert Paul
Posted
7-Feb-2002 08:00 GMT
Toolset
C51
New! RE: initialize xdata
If you really want to hack an initialisation to a fixed memory
location, you could compile a file which might say:
#pragma SRC
unsigned int xdata variable = 0x1234;
then look up the ?C_INITSEG-Part of the generated
Src-file and copy this into a separate assembly - module,
adding:
EXTRN XDATA variable
I've once tried this and it worked fine, but I never tried it
with fixed memory locations.

Norbert
Read-Only
Author
Norbert Paul
Posted
7-Feb-2002 08:00 GMT
Toolset
C51
New! RE: initialize xdata
If you really want to hack an initialisation to a fixed memory
location, you could compile a file which might say:
#pragma SRC
unsigned int xdata variable = 0x1234;
then look up the ?C_INITSEG-Part of the generated
Src-file and copy this into a separate assembly - module,
adding:
EXTRN XDATA(variable)
I've once tried this and it worked fine, but I never tried it
with fixed memory locations.

Norbert

Next Thread | Thread List | Previous Thread Start a Thread | Settings