set COMPILER_OPTIONS=-D__MSP430_2231__ -msave-prologue -mmcu=msp430g2231 -nostartfiles -gdwarf-2 -ffunction-sections -fdata-sections -fshort-enums -fno-rtti -fno-exceptions -Os -fno-unroll-loops -fno-unroll-all-loops --param max-completely-peeled-insns=10

set functions=utoa_builtin_div, utoa_fast_div, utoa_bcd_table, utoa_bcd_add, utoa_bcd_horner, utoa_cycle_sub, utoa_fract

FOR %%F IN (%functions%) DO (
D:\Utils\mspgcc-20110716-p20111105\bin\msp430-gcc %COMPILER_OPTIONS% -DFUNCTION=%%F -c test.cpp
if NOT "%ERRORLEVEL%" == "0" goto exit
D:\Utils\mspgcc-20110716-p20111105\bin\msp430-gcc -mmcu=msp430g2231 -fgc-sections test.o -o test.elf
if NOT "%ERRORLEVEL%" == "0" goto exit
D:\Utils\mspgcc-20110716-p20111105\bin\msp430-objdump -h -S test.elf > %%F.lss
if NOT "%ERRORLEVEL%" == "0" goto exit
mspdebug rf2500 < mspdebug_commands.txt
if NOT "%ERRORLEVEL%" == "0" goto exit
sleep 4  )

:exit
pause