IF "%1"=="new" GOTO Set_new

SET L51_SRC=l51_main.a51
SET OH51_BANK0=page4.hex
SET OH51_BANK1=page5.hex
GOTO Make_start

:Set_new
SET L51_SRC=l51_bank.a51
SET OH51_BANK0=page4.hex
SET OH51_BANK1=page5.hex
SET OH51_BANK2=page7.hex
SET OH51_BANK3=page8.hex
GOTO Make_start

:Make_start
A51 %L51_SRC% EP XR DB PW(80) RB(0) OJ(l51_main.obj)
A51 STARTUP.A51
C51 main.c %C51_OPT%
C51 p_modem.c %C51_OPT%
C51 convert.c %C51_OPT%
C51 v_task.c %C51_OPT%
C51 ac97_1.c %C51_OPT%
C51 chip.c %C51_OPT%
C51 keypad.c %C51_OPT%
C51 update_1.c %C51_OPT%
C51 sdram.c %C51_OPT%
C51 function.c %C51_OPT%
C51 funcvida.c %C51_OPT%
C51 std_func.c %C51_OPT%
C51 dtmf.c %C51_OPT%
C51 callrec.c %C51_OPT%
C51 dialplan.c %C51_OPT%
C51 etalk.c %C51_OPT%
C51 rtp.c %C51_OPT%
C51 rtcp.c %C51_OPT%
C51 p_case.c %C51_OPT%
C51 asn1util.c %C51_OPT%
cd ..\p_apps
C51 ac97apps.c %C51_OPT%
C51 dsp_apps.c %C51_OPT%
C51 dspcode.c %C51_OPT%
C51 telnet.c %C51_OPT%
C51 serial.c %C51_OPT%
C51 sntp.c %C51_OPT%
C51 options.c %C51_OPT%
C51 http_options.c %C51_OPT%
C51 telnet_options.c %C51_OPT%
C51 version.c %C51_OPT%
C51 speeddial.c %C51_OPT%
C51 mapMsg.c %C51_OPT%
C51 upgrade.c %C51_OPT%
C51 report.c %C51_OPT%
C51 http.c %C51_OPT%
C51 key.c %C51_OPT%
C51 lcd.c %C51_OPT%
C51 display.c %C51_OPT%
C51 boot.c %C51_OPT%
C51 default.c %C51_OPT%
C51 slic.c %C51_OPT%
C51 fake_fxo.c %C51_OPT%
C51 stun.c %C51_OPT%
C51 ne2000.c %C51_OPT%
C51 ne2000_2.c %C51_OPT%
C51 p_sdp.c %C51_OPT%
C51 p_http.c %C51_OPT%
C51 p_line.c %C51_OPT%
C51 http_auth.c %C51_OPT%
cd ..\main

BL51 @linkfile.txt
OC51 main.abs
OH51 main.b00 HEXFILE(%OH51_BANK0%)
OH51 main.b01 HEXFILE(%OH51_BANK1%)

IF "%1"=="new" GOTO OH51_bank2
GOTO End

:OH51_bank2
OH51 main.b02 HEXFILE(%OH51_BANK2%)
OH51 main.b03 HEXFILE(%OH51_BANK3%)
GOTO End

:End
