small c subroutines for use in msp430f5529