U
U
Username2017-02-11 19:51:46
cmd/bat
Username, 2017-02-11 19:51:46

How to catch an error when compiling asm in a batch file?

Good evening, it is necessary to automate the process of assembly and linking, through bat.
Tasm is installed in the following path:
D:\Program\tasm
DosBox:
D:\Program\DOSBox-0.74
In the directory D:\Program\tasm\bin mopl1.bat , which starts DosBox with additional parameters in the form of a batch file for dos internal commands.

start "dosbox" "D:\Program\DOSBox-0.74\DOSBox.exe" "dosbox.bat"

dosbox.bat
mount CD:\Program\tasm\bin
tasm.exe mopl1.asm

In the dosbox.bat batch file, you need to catch compilation errors, I wanted to do it as follows, save the execution text
tasm.exe mopl1.asm > log.txt
, and then either find the line with errors, or compare with the reference file, where there is no error, and then if or go to.
But dos doesn't know any commands like: for, find, FC.
How can I catch an error and, if it is found, launch notepad with the file in which the error occurred?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dude2012, 2017-02-13
@dude2012

When a compilation error occurs, the exe module (obj) is not created. Remove it before compiling. Successful result by the presence of the module.
IF EXIST "filename" (
Echo Success
) ELSE (
Compile Error
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question