III.2 Batch File Operation under MS-DOS

If serial I/O is only used for program upload, batch file operation may be the most convenient way of testing with the shortest turn-around cycles. The sample batch job below, shows the principles of operating BOOT-51 from a PC with MS-DOS batch commands:

MODE COM2:9600,N,8,1,P
RESET51 LPT1
SLEEP 9600
ASEM %1
ECHO U >COM2
COPY %1.HEX COM2
ECHO G 8000 >COM2

In this example, serial I/O is done over serial port COM2, and the target system can be reset over printer port LPT1.
First of all, the serial port COM2 is initialized to the desired baudrate of 9600 Baud, 8 data bits, 1 stop bit, and no parity with the MODE utility. Then the RESET51 program provided is executed to reset the target system via printer port LPT1. After that, the SLEEP program waits until BOOT-51 has fully output its sign-on message at 9600 Baud and is ready for a command. To give the MCS-51 board some more time to recover from reset, ASEM-51 is now invoked to assemble the application program.
When finished, the BOOT-51 upload command 'U' is ECHOed to COM2, and the Intel-HEX file is also simply copied to the serial port.
Finally the application program is started at address 8000H with the command ”ECHO G 8000 >COM2”.
To test an application program MYPROG.A51 with the above batch job (stored in a file TEST51.BAT), simply type

TEST51 MYPROG

at the DOS prompt, and see what you get.
Of course this was only a minimized example! In general you will not only have to modify serial port, baudrate, reset port, and start address for your local requirements, but also to do something for plausibility checking and error handling.
For this, the more sophisticated batch file BOOT.BAT has been provided. It allows an easy change of all configuration parameters with any ASCII editor. For further information see the commentary inside BOOT.BAT. In principle, BOOT.BAT contains only those configuration data! (The actual work is done by another batch file UPLOAD.BAT provided, which is invoked by BOOT.BAT.)
A program MYPROG.A51 can now be assembled, uploaded and started with

BOOT MYPROG