Maker Pro
Maker Pro

Reading from Memory

electronicsLearner77

Jul 2, 2015
306
Joined
Jul 2, 2015
Messages
306
Code:
#define value_p  (uint16_t *)(0x1002);
int DataExtract(void)
{
    uint16_t l_localvalue_u16=0;
    l_localvalue_u16 = *value_p;
    return l_localvalue_u16;
}

I have written some test code as above. I want to read from program memory at address 0x1002. But I have not specified that 0x1002 is program memory. Will the compiler understands this and gives me data from program memory? My understanding is that compiler knows the complete memory map of a particular micro. I am programming for micro chip dspic family.
 

Amar Dhore

Dec 2, 2015
129
Joined
Dec 2, 2015
Messages
129
You can check yourself

try in MPLAB, Window --> PIC Memory Views --> Program Memory
 
Top