Monday, 8 August 2011  Mapping the Absolute Addresses of
Registers from a C Header  Why am I doing this, you may ask?
Doesn't the microcontroller manufacturer provide the absolute
addresses of the registers? Well in this case, no they don't,
and I need them to complete the plugin for the Keil µVision
debugger which will make them visible and editable via human
readable names.  There are a number of ways of mapping hardware
into C but due to the limitations of the const keyword [did you
know you can cast the const away? add it to the list of things
in C like = actually being assign, declare a pointer with * and
then deference it's content with *, etc., etc.] most
microcontroller manufacturers end up using #define statements as
they can be made to result in fixed numeric constants that can
then be optimized correctly in all situations.  [For a quick
counter example create a function that accesses a global const
pointer, call it and then look at the ASM. Does that look
optimal to you? But don't blame the compile