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

code data in bank

Hi,
Could I declare a code data (const data) that
reside in one bank only? I found that the
code data will be duplicated in all bank.
Thank.

  • That's quite certainly not possible. The reason being that banking actual code is possible by doing control flow analysis (i.e. finding out which function calls which other functions). Which is hard, but doable with a bit of hand-holding.

    To allow data in banked code space, you would have to do complete data flow analysis, i.e. find out from where in the entire code a given piece of data may be used. That's so much harder that nobody generally dares even try it.

  • "find out from where in the entire code a given piece of data may be used."

    You can do that with the uVision Browser

  • You can do that with the uVision Browser

    I rather doubt that. Not with pointers being involved.

    Sure, you can find all direct accesses to a given variable by its own name, but there's no way anything short of a work of magic will manage to look at the source code and find all possible ways a given memory address may be accessed. Alan Turing himself proved it to be impossible in the general case.