<b>inc_ser.bat</b>-increments serial number (run with no parameters for help):
<font size="-2">
@echo off
if "%1"=="" goto errorxx
if not exist %1 goto errorxx

srec_cat %1 -i -crop 0x3ffe 0x4000 -fill 0x01 0x3ffc 0x3ffd -fill 0x00 0x3ffd 0x3ffe -l_e_c_p 0x3ffe 2 2 -crop 0x3ffe 0x4000 -multiple -o tmp.hex -i
srec_cat %1 -i tmp.hex -i -multiple -o %1 -i
del tmp.hex

goto end

:errorxx
@echo increments (word) checksum in intelhex file at address 0x3ffe-0x3fff
@echo Usage: %0 filename
goto end

:end
</font>
-------------------------
<b>set_ser.bat</b>-sets serial number (run with no parameters for help):
<font size="-2">
@echo off
if "%1"=="" goto errorxx
if "%2"=="" goto errorxx
if "%3"=="" goto errorxx
if not exist %1 goto errorxx

srec_cat %1 -i -excl 0x3ffe 0x4000 -fill 0x%3 0x3ffe 0x3fff -fill 0x%2 0x3fff 0x4000 -multiple -o %1 -i

goto end


:errorxx
echo sets checksum in intelhex file at address 0x3ffe-0x3fff
echo Usage: %0 filename highhex lowhex
echo example: %0 gnsas.obj f2 4c
goto end

:end</font>