About me

Course Work




Useful Batch Files - Library Based 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.

Add Module to Library - When you are ready to add your files to a library this batch file will first compile the source file to make sure it is up to date. Once it is assembled, the module will be added to the library if it is not already a part of it, or it will replace the existing instance within the library. This file has the name of the library fixed as 'generic'. If you want to make it the second parameter to the .BAT file, replace 'generic' with '%2'

tasm /zi /z /Mx /w2 %1,,,;
if errorlevel 1 goto stop
tlib generic -+%1
if errorlevel 1 goto stop
Ex: C:>add myModule

Assemble and Link with Library - In order to assemble and link a program that uses library modules, you will need to include the library in the command. This file (which QM=QuickMake since you don't have to recompile all of the code in the library) will work with the 'generic' library. Modify this file to work with any library you decide to create.

echo off
tasm /zi /z /Mx /w2 %1 ,,,;
if errorlevel 1 goto stop
tlink /co /v /m %1 ,,, generic
if errorlevel 1 goto stop
echo on
Ex: C:>qm myProgram

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: January 26, 1999 - Barry E. Mapen