@echo off 
cd %2
\Utils\Vasm\vasmZ80_OldStyle_win32.exe %1  -chklabels -nocase -gbz80 -Dvasm=1 -DBuildGBC=1 -Fbin -o \RelGB\cart.gbc -L \RelGB\Listing.txt
if not "%errorlevel%"=="0" goto Abandon
taskkill -im VisualBoyAdvance.exe
copy \Emu\VisualBoyAdvance\gbc.ini \Emu\VisualBoyAdvance\vba.ini
start \Emu\VisualBoyAdvance\VisualBoyAdvance.exe \RelGB\cart.gbc
exit
:Abandon
if "%3"=="nopause" exit
pause
