@echo off
if exist %1.gds goto a
echo usage: gasm file_name [jedec file name (optional)]
echo source file not found %1.gds
echo make sure you entered the filename without an extension, and
echo that the filename has a .GDS extension, like test.gds
echo example: gasm test
goto b

:a
pregasm %1.gds >tmp_ga
if not "%2" == "" gdsasm tmp_ga %2
if "%2" == "" gdsasm tmp_ga
if exist %1.jed del %1.jed
if exist %1.doc del %1.doc
if "%2" == "" rename tmp_ga.jed %1.jed
rename tmp_ga.doc %1.doc
:b

