Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/10/01 14:43
Read: times


 
#8063 - RE: Keil uV2 vs WINDOWS
Here is the solution to avoid Windows problems:

Create a new directory, create some files, named *.c51 in it, which contain all the source code of your project.
Then press "C" and Enter and voila the "main.hex" file was created.
It amazing, only 2 keys must be pressed instead of kilometers running around 1000 menu bars with the mouse.
Following the magic and powerful "c.bat", which make all it for you:


Peter


c.bat:
=========================================

@echo off
if a%1 == an goto new
if a%2 == a goto start
if a%1 == ac goto compile
if a%1 == al goto link
if not a%2 == an goto start

:new
if exist *.out del *.out

:start
set platz=
set name=%1
if a%1 == a set name=main
if a%1 == an set name=main

if a%c51% == a goto error1

set op=%path%
set path=%c51%bin;%path%
set c51inc=%c51%inc
set c51lib=%c51%lib

if not exist %c51lib%*.lib goto error3

if not exist %c51%binc51.exe goto error2

if exist %name%.out goto amake

if exist *.obj del *.obj
for %%f in ( *.c51 ) do call %0 c %%f
echo.
if not exist startup.a51 copy %c51lib%startup.a51 .
if not exist startup.a51 goto error5
echo Assemble: startup.a51
a51 startup.a51

if exist l51tmp.tmp del l51tmp.tmp
for %%f in ( *.obj ) do call %0 l %%f
echo startup.obj to %name%.out PL(30000) & >> l51tmp.tmp
if exist link.opt type link.opt >> l51tmp.tmp
echo.
l51.exe @l51tmp.tmp
goto hex

:amake
call amake %name%.out

:hex
oh51.exe %name%.out

if exist program.bat call program.bat %name%.hex
if exist download.bat call download.bat %name%.hex
goto cleanup

:compile
echo.
echo Compile: %2
c51.exe %2 REGFILE (%name%.reg) INTVECTOR(0x0000)
if errorlevel 1 goto error4
goto end

:link
if a%2 == aSTARTUP.OBJ goto end
echo %2, & >> l51tmp.tmp
goto end


:error1
echo Error, Environment Variable C51 not defined !
goto pause

:error2
echo Error, Environment Variable C51 invalid !
goto pause

:error3
set
echo Error, Environment Space exceeded !
goto pause

:error4
echo Error in Soucre File %2
goto pause

:error5
echo Error, File STARTUP.A51 missing !
goto pause

:pause
echo.
echo Press any key
pause >nul

:cleanup
if a%op% == a goto end
set path=%op%
set name=
set op=
set c51inc=
set c51lib=

:end


List of 5 messages in thread
TopicAuthorDate
Keil uV2 vs WINDOWS            01/01/70 00:00      
RE: Keil uV2 vs WINDOWS            01/01/70 00:00      
RE: Keil uV2 vs WINDOWS            01/01/70 00:00      
RE: Keil uV2 vs WINDOWS            01/01/70 00:00      
RE: Keil uV2 vs WINDOWS            01/01/70 00:00      

Back to Subject List