set _comport_=COM1

del log.txt

rem ---------------- test the link --------------------------------

rem host.exe /PORT=%_comport_% /ADDR=FFFE0000 /OP=d /LEN=4000 /FNAME=test.dat > log.txt
rem IF ERRORLEVEL 1 goto end_fail

rem ---------------- start the BIOS update ------------------------

host.exe /PORT=%_comport_% /ADDR=FFF80000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF81000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF82000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF83000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF84000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF85000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF86000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF87000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF88000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF89000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF8A000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF8B000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF8C000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF8D000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF8E000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF8F000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail



host.exe /PORT=%_comport_% /ADDR=FFF90000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFA0000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFB0000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail

host.exe /PORT=%_comport_% /ADDR=FFFC0000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail



host.exe /PORT=%_comport_% /ADDR=FFFE0000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe1000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe2000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe3000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe4000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe5000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe6000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe7000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe8000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFe9000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFeA000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFeB000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFeC000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFeD000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFeE000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFeF000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail



host.exe /PORT=%_comport_% /ADDR=FFFF0000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf1000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf2000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf3000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf4000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf5000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf6000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf7000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf8000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFf9000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFfA000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFfB000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFfC000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFfD000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFfE000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFfF000 /op=e >> log.txt
IF ERRORLEVEL 1 goto end_fail






host.exe /PORT=%_comport_% /ADDR=FFF80000 /op=u  /FNAME=SALSA.001 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF84000 /op=u  /FNAME=SALSA.002 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF88000 /op=u   /FNAME=SALSA.003 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF8C000 /op=u  /FNAME=SALSA.004 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF90000 /op=u /FNAME=SALSA.005 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF94000 /op=u /FNAME=SALSA.006 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF98000 /op=u /FNAME=SALSA.007 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFF9C000 /op=u /FNAME=SALSA.008 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFA0000 /op=u /FNAME=SALSA.009 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFA4000 /op=u /FNAME=SALSA.010 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFA8000 /op=u /FNAME=SALSA.011 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFAC000 /op=u /FNAME=SALSA.012 >> log.txt
IF ERRORLEVEL 1 goto end_fail

host.exe /PORT=%_comport_% /ADDR=FFFB0000 /op=u /FNAME=SALSA.013 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFB4000 /op=u /FNAME=SALSA.014 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFB8000 /op=u /FNAME=SALSA.015 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFBC000 /op=u /FNAME=SALSA.016 >> log.txt
IF ERRORLEVEL 1 goto end_fail


host.exe /PORT=%_comport_% /ADDR=FFFC0000 /op=u /FNAME=SALSA.017 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFC4000 /op=u /FNAME=SALSA.018 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFC8000 /op=u /FNAME=SALSA.019 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFCC000 /op=u /FNAME=SALSA.020 >> log.txt
IF ERRORLEVEL 1 goto end_fail


host.exe /PORT=%_comport_% /ADDR=FFFE0000 /op=u /FNAME=SALSA.025 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFE4000 /op=u /FNAME=SALSA.026 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFE8000 /op=u /FNAME=SALSA.027 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFEC000 /op=u /FNAME=SALSA.028 >> log.txt
IF ERRORLEVEL 1 goto end_fail

host.exe /PORT=%_comport_% /ADDR=FFFF0000 /op=u /FNAME=SALSA.029 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFF4000 /op=u /FNAME=SALSA.030 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFF8000 /op=u /FNAME=SALSA.031 >> log.txt
IF ERRORLEVEL 1 goto end_fail
host.exe /PORT=%_comport_% /ADDR=FFFFC000 /op=u /FNAME=SALSA.032 >> log.txt
IF ERRORLEVEL 1 goto end_fail

echo BIOS updated successfully
goto end
:end_fail
echo Error was occured while updating BIOS. Please retry BIOS update
:end
pause

