[Icc-430] Assembly Module

llchisho at paradise.net.nz llchisho at paradise.net.nz
Mon May 5 17:03:13 PDT 2008


Bill Garmer asked :
Is there an include file I should be using in an assembly module to
define the register names?  It is a bear to have to type in the address
each time.

If all you want is the register names and addresses, you can fairly quickly
process the .h file for your chip from the ICC430 include directory.
1) grep for volatile to a new file which will give lines like :
   #define MAC                (*(volatile  unsigned int *)  (0x0134)  )
2) globally edit out the leading "#define "
3) globally edit out the trailing ")<spaces>)"
   regexp \) +\)
4) globally change the bit in the middle from "(<anything>x" to " = 0x"
   regexp \(.+x

and you're there. It could probably be done with a single SED line but my SED is
rusty :-)
Processing the register bit definitions is a bit harder.
NoICE has a preprocessor called Msp430equates.exe which generates a .noi file of
register names and addresses - this also needs similar manipulation afterwards
but is slightly easier if your editor doesn't do regular expressions.

Len Chisholm.



More information about the Icc-430 mailing list