@echo off
set SOURCE=%1

if not "%SOURCE%" == "" goto cmm_start
echo BATCH FILE TO TRANSLATE C--PIC SOURCE FILE
echo Usage: za source_file_name_without_extention
goto last

:cmm_start
if exist %SOURCE%.dat del %SOURCE%.dat
if exist %SOURCE%.exa del %SOURCE%.exa
if exist %SOURCE%.lsm del %SOURCE%.lsm
if exist %SOURCE%.lst del %SOURCE%.lst
if exist %SOURCE%.rom del %SOURCE%.rom
if exist %SOURCE%.siz del %SOURCE%.siz
if exist %SOURCE%.src del %SOURCE%.src

C--.EXE /oir /lst %SOURCE%
if not errorlevel 1 goto cmm_ok
if exist %SOURCE%.err del %SOURCE%.err
if exist %SOURCE%.lst del %SOURCE%.lst
goto last

:cmm_ok
ren %SOURCE%.bin *.exa
C14.COM %SOURCE%.exa
if errorlevel 1 goto last

D14.COM %SOURCE%.rom %SOURCE%.src
if errorlevel 1 goto last

LT.COM %SOURCE%

if exist %SOURCE%.lsm type %SOURCE%.lsm

:last
