The screenshot below shows a very simple example of the managed-PSV feature
The space attribute places the variable into the program memory space, and the new __prog__ qualifier tells the compiler to manage the PSVPAG for this variable.
You can also see the generated assembly code. You'll notice that the compiler saves and restores the current value of PSVPAG. This is to ensure compatibility with modules built with the older const-in-code model.
Older libraries that don't know how to manage the PSVPAG may assume that PSVPAG is currently set to the .const section. Code generated using the managed-PSV feature must respect this assumption and save/restore the PSVPAG.
I hope this post helps you get up to speed with the new feature (even though all of this information is documented in the updated C30 User's Guide). Have fun flipping pages!
No comments:
Post a Comment