This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What is Code memory type

I am using the Cx51 compiler.

I declared a array of pointers to characters as

char code *weekday_names[ ] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };

Thinking it would go into the CODE memory space - it did not, and ended up in DATA
space, causing an address space overflow.

I changed it to

code char *weekday_names[ ] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };

and then it was placed into the CODE space.

Can someone explain the difference between these two ?

Thanks