Ravi Gautam

#pragma use

Discussion created by Ravi Gautam on Apr 28, 2008
Latest reply on May 8, 2008 by Pascal Irrle
Dear all,
I still do not understand how to use variable(s) declared using the #pragma DATA_SEG syntax. You are dealing with a novince programmer - needless to say - so please bare with me and my questions!
1. I want to store a bunch of variables in data memory inside my bootloader code like a int *, int [], char etc. at memory location(s) ALPHA, BETA, THETA.. etc (for argument sake lets assume these addresses are valid). 
My  bootloader invokes my RTOS code ( In Keil I simply do: ((void (code *) (void)) CVECT_BOOT)(); - the bootloader transfers control over to the RTOS residing at address location CVECT_BOOT - Still need to figure how to do this in CW but thats another question Ill be bothering you later with). Once inside my RTOS how do I access those same variables declared and defined in my bootloader? For this I am assuming I need to know the "physical" address location and not the "name" of my data segment?
2. What would I do if I needed to do the same thing but this time my information is in program memory and not in data memory? I want to share my decode and encode array for manchester encoding in program memory.  
 
Since my foundation is so shaky I would appreciate if you could suggest some books/notes as well.
Thanks.
NeedHelp - no kiddin!

Outcomes