Using Intel RL51 Utility in a Batch File
This article explains how to use RL51 via PC-DOS batch files. It utilizes the
input redirection feature of PC-DOS to get around the 128-character command
line limitation of PC-DOS batch files. It also shows how to pass parameters
to the batch file. These examples will use PL/M-51 and RL51.
After errorlessly compiling your module or modules, link them together with RL51.
Most likely, you will have more than two or three modules to link up, plus
libraries and all the linking and locating controls you need. Usually, this
will not fit on one command line.
The easiest way to accomplish the linking process is to enter the following:
prompt> RL51 & < LNK51.CON
where LNK51.CON contains all the linkable object files, libraries, and controls
you need. For example,
MYPROG1.OBJ, MYPROG2.OBJ, &
MYPROG3.OBJ, MYPROG4.OBJ, &
MYLIB.LIB, PLM51.LIB TO ALLPROG.ABS &
DATA(?PGM1?DATA(20H),?PGM2?DATA(30H),?PGM3?DATA,?PGM4?DATA) &
CODE(?PGM1?PR(100H))
NOTE:
PGM1 is the module name. You can find references to segment names produced by PL/M-51
in the PL/M-51 User's Guide for DOS System, Chapter 16 titled "Object Module Sections."
You can also pass the module names as parameters. First, make a batch file. In this example,
our batch file is LNK51.BAT.
The file LNK51.BAT contains:
RL51 %1.obj, %2.obj, %3.obj, %4.obj, & < LK51.CON
REN ALLPROG.ABS %5.ABS
The file LK51.CON contains the following:
MYLIB.LIB, PLM51.LIB TO ALLPROG.ABS &
DATA(?PGM1?DATA(20H),?PGM2?DATA(30H),?PGM3?DATA,?PGM4?DATA) &
CODE(?PGM1?PR(100H))
Invoke the batch file and pass the parameters with the following command:
LNK51 MYPROG1 MYPROG2 MYPROG3 MYPROG4 FINAL
This command generates the same link as the one above, thus generating the same
ALLPROG.ABS, and renaming it to FINAL.ABS.
These examples can be applied to all the utilities that INTEL has running on
PC-DOS based systems.
|