set CA_DIR=%~dp0..\
set CA_COM="BKTurbo8.exe"
set CA_B2O="BKbin2obj.exe"
set CA_BTL="BKTools.exe"

set ASSEMBLER=%CA_DIR%%CA_COM%
set BIN2OBJ=%CA_DIR%%CA_B2O%
set TOOLS=%CA_DIR%%CA_BTL%

%ASSEMBLER% -l -o co rm3_1_main.asm 
%ASSEMBLER% -l -o co rm3_2_ovl.asm
%ASSEMBLER% -l -o li rm3 rm3_1_main.obj rm3_2_ovl.obj  
%ASSEMBLER% -l co rm3_3_patcher.asm

%TOOLS% -tBKPACK rm3.bin
ren rm3.bkp rm3.bkp.bin

md out
copy rm3.bkp.bin out\*
copy rm3_3_patcher.bin out\*
copy *.lst out\*

del *.bin
del *.obj
del *.lst
