-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasm.bat
More file actions
62 lines (54 loc) · 1.32 KB
/
asm.bat
File metadata and controls
62 lines (54 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
if not "%2"=="" goto :checkdir
if not exist "code\%1.ASM" goto :nof
goto :bld
:checkdir
if not exist "code\%2\%1.ASM" goto :nofdir
goto :bldir
:bld
mkdir out > NUL
cd out
mkdir %1 > NUL
cd c:\
tasm\TASM.exe /zi code\%1.ASM > out\%1\compile.txt
tasm\TLINK.exe /v %1.OBJ > out\%1\link.txt
del out\%1\%1.MAP > NUL
del out\%1\%1.OBJ > NUL
del out\%1\%1.EXE > NUL
ren %1.MAP out\%1\%1.MAP
ren %1.OBJ out\%1\%1.OBJ
ren %1.EXE out\%1\%1.EXE
if exist "out\%1\%1.EXE" goto :cmp
echo Your code couldn't compile! Check 'out\%1\compile.txt' to see your errors.
goto :end
:cmp
echo '%1' is compiled! Use 'td %1' to check your code or 'r %1' to run it.
goto :end
:bldir
mkdir out > NUL
cd out
mkdir %2 > NUL
cd %2
mkdir %1 > NUL
cd c:\
tasm\TASM.exe /zi code\%2\%1.ASM > out\%2\%1\compile.txt
tasm\TLINK.exe /v %1.OBJ > out\%2\%1\link.txt
del out\%2\%1\%1.MAP > NUL
del out\%2\%1\%1.OBJ > NUL
del out\%2\%1\%1.EXE > NUL
ren %1.MAP out\%2\%1\%1.MAP
ren %1.OBJ out\%2\%1\%1.OBJ
ren %1.EXE out\%2\%1\%1.EXE
if exist "out\%2\%1\%1.EXE" goto :cmpdir
echo Your code couldn't compile! Check 'out\%2\%1\compile.txt' to see your errors.
goto :end
:cmpdir
echo '%2\%1' is compiled! Use 'td %1 %2' to check your code or 'r %1 %2' to run it.
goto :end
:nof
echo 'code\%1.ASM' does not exist!
goto :end
:nofdir
echo 'code\%2\%1.ASM' does not exist!
:end
echo on