About me

Course Work




Useful Batch Files - Simple Files

As you start working with your assembler, you will find it cumbersome to constantly type commands with long lists of switches. To quicken your work, you may find it useful to set up a few batch files in DOS to reduce your typing. The common ones that I use are given below. You should reference your book (pp. 27-29) for a detailed description of what these files will do. You are not required to learn how to write, or use batch files for this course. I am providing these only to facilitate your work.

Assemble and Link - this will take a single assembly source file, assemble it and if the assembly is successful, it will link the file. This file does not work with library modules. We'll talk about those later in the semester.

tasm /zi /z /Mx %1,,,;
if errorlevel 1 goto stop
tlink /co /v /m %1,,;
Ex: C:>al myfile

Clean Directory - When you assemble and link files with the above batch file, several reports will be generated. You will probably find it useful to look through the .MAP files when you write up your memory utilization sections on your reports. However, sometimes your directory will get cluttered and this batch file will clean up the report files.

echo off
del *.obj
del *.xrf
del *.lst
del *.map
del *.exe
echo on

NOTE: If you experience problems with these scripts, they were downloaded by your browser incorrectly (lines need to end with 0D0A, not just 0A). To fix, open the file in wordpad and press save. This will convert single line-feeds to carriage-return and line-feed pairs.

Last Modified: April 7th, 1999 - Barry E. Mapen Last Modified: January 26, 1999 - Barry E. Mapen