home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
misc2
/
amebat.lzh
/
AMEBAT.DOC
< prev
Wrap
Text File
|
1985-05-18
|
6KB
|
123 lines
====== AMEBAT.DOC ======
Jay Jervey, Fountain Valley, CA, 6-May-85
This document provides additional information about the operation and
modification of the AMEBAT utility. As you may know, AMEBAT provides a way to
start up a CP/M program under AME86 automatically - much the same way as an
MSDOS batch file can. However, AMEBAT is faster and there is no messy batch
file echo; thus, you can virtually forget that you're running a CP/M program.
The source file (AMEBAT.ASM) is effectively a skeleton program which you
modify to meet your own needs. You need to ask yourself the following
system-specific questions before you implement AMEBAT:
1) On what drive and directory path does AME86.EXE reside?
2) What option switches do I want to use with AME86?
3) Which CP/M program do I want to execute with AME86?
4) On what drive and directory path does this CP/M program reside?
The answers to these questions will provide you with the information that you
will need to customize AMEBAT for your own system.
AMEBAT.ASM contains some data structures at the bottom. These data
structures are filled in with the information you gathered above. If you look
at the last lines in AMEBAT.ASM, you should see the following:
-----------------------------------------------------------------------------
FCB5C_SEG DW 0
DW OFFSET FCB
FCB6C_SEG DW 0
FCB DB 5 ;Change to drive of CP/M program
; 1=A, 2=B.... 5=E etc.
DB 12 DUP (20H)
DB 0,0,0,0
AME86 DB 'E:\AME86.EXE',0 ;Point to AME86 here (ie. path etc.)
COMMAND_BLOCK DB STRLEN
COMMAND_STRING DB ' E:\\KEDT.CMD/C' ;Command line for AME86
;Note: the double backslash indicates
;the root directory. This is an AME86
;feature only. Other directory paths
;are specified normally.
STRLEN = $ - OFFSET COMMAND_STRING
TAIL DB 0DH
DB 300 DUP (?)
STACK DB ?
CODE ENDS
END BATCH
------------------------------------------------------------------------------
The labelled data structures of interest are FCB, AME86, and COMMAND_STRING.
The structure FCB contains the drive number where the CP/M program that you
want to execute will always reside. Note, this is a decimal NUMBER - not a
letter. If it's on drive A:, put a 1 here. If drive G:, a 7, etc.
The structure AME86 contains a string which is the drive, path, and filename
where AME86.EXE will always reside. Do not embed any unnecessary spaces here.
This should be a fairly easy one to change.
The structure COMMAND_STRING contains a string which is the command line to
pass to AME86 to tell it which CP/M program to run. When you previously ran
AME86 from the keyboard or a batch file, you always passed a command string to
AME86. Right? What ever that command string was, put it here. The leading
space is necessary. For example, if you always say 'AME86 E:\BIN\RED.CMD/C' to
invoke the CP/M RED editor with AME86, then you would put ' E:\BIN\RED.CMD/C'
in the COMMAND_STRING structure. However, do not include variables such as
file names that you would pass to RED. You'll want to pass those interactively
through AMEBAT (more on that later).
Now for a full example. Let's assume you are modifying AMEBAT so that you can
invoke the RED editor. Assume RED.CMD is on E:\BIN\CPM and AME86.EXE is on
E:\BIN. Your data structures should look like this. Right?
FCB DB 5
AME86 DB 'E:\BIN\AME86.EXE',0
COMMAND_STRING DB ' E:\BIN\CPM\RED.CMD/C'
Now you would build AMEBAT.ASM so you can run RED.
; Assemble, link, and convert to .COM as follows:
;
; MASM AMEBAT.ASM AMEBAT.OBJ NUL NUL ;Note NO commas
; LINK AMEBAT.OBJ,AMEBAT.EXE,NUL,NUL ;Note commas (ignore stack error)
; EXE2BIN AMEBAT.EXE RED.COM ;Creates RED.COM
;
; !!! The source file AMEBAT.ASM refers to 'AMEBATCH.ASM' in the above command
; !!! lines. Ignore that. The program is now officially dubbed AMEBAT (thanks
; !!! to CIS's 6 character limit on file names).
Note, the last step creates a file called RED.COM instead of AMEBAT.COM. Now,
if you type 'RED', MSDOS will run RED.COM which will in turn run
E:\BIN\AME86.EXE which will in turn run E:\BIN\CPM\RED.CMD and, presto, the
CP/M RED editor starts up transparently. Fine. But you'll probably get a RED
error message saying you didn't supply the name of the file to edit. Well,
here comes the neat part. If instead you type 'RED filename', then RED.COM
(actually AMEBAT) will intercept the command string (ie. ' filename') and tack
it onto the command string for AME86 who will then pass it to the real RED.
This is actually the exact same mechanism that the MSDOS batch facility uses
for invoking programs with variable command lines. But AMEBAT is a little
cleaner, don't you think?
With this example you should now be able to modify AMEBAT.ASM and generate
.COM files for all your CP/M programs. All you'll really need to change each
time is the name of the CP/M program (if you have them all on the same drive &
path) and then just rebuild AMEBAT.
To tell you the truth, AMEBAT.ASM has no special attachment to AME86. You
can create all kinds of little .COM files that go run other MSDOS programs and
pass fixed command lines. Effectively, it's a single command line batch
facility. For example, I have many .COM files made from AMEBAT which run
LCTERM with different script files. You just need to subsitute AME86.EXE with
another MSDOS program name and setup the desired command line. The
possibilities are endless for creating clean custom MSDOS commands.