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.
Dear all,
in my program i declared some variable as constant. After compilation this program gives me some problem related to above declare variable.
Moment i remove constant from those variable my program start working correctly.
I am inital stage of debugging. Please suggest area where i need to see to solve problem.
Regards..
Yogesh
Please use the pre tag for your source code.
What do you mean with "not matching"? You should be aware that, depending on the memory model, the 24bit address of your data as shown in the linker listing is different from a 16bit pointer (address) to that data when debugging. Here is an example:
Say, the address of your constant data is 0xC116E8 in the linker listing. While debugging, you would see this address as 0x56E8. Why? The 16bit address is a 14bit page offset (bits 0~13)
0x56E8 & 0x3FFF == 0x16E8
and a 2 bit data page pointer (bits 14~15)
(0x56E8 & 0xC000) >> 14 == 1 i.e. we use DPP1
The lower 10 bits of each DPP register select one of the 1024 possible 16-Kbyte data pages. In our example, DPP1 is 0x0304, so it selects page 772, i.e. the page base address is 772 * 16384 == 0xC10000 which perfectly explains the listing address:
0xC10000 | 0x16E8 == 0xC116E8
You should check the user manual of your processor for further details on addressing.
Thomas