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   
Text File  |  1985-05-18  |  6KB  |  123 lines

  1.                    ======  AMEBAT.DOC ======
  2.  
  3.             Jay Jervey, Fountain Valley, CA, 6-May-85
  4.  
  5.  
  6.      This document provides additional information about the operation and 
  7. modification of the AMEBAT utility. As you may know, AMEBAT provides a way to 
  8. start up a CP/M program under AME86 automatically - much the same way as an 
  9. MSDOS batch file can. However, AMEBAT is faster and there is no messy batch 
  10. file echo; thus, you can virtually forget that you're running a CP/M program. 
  11. The source file (AMEBAT.ASM) is effectively a skeleton program which you 
  12. modify to meet your own needs. You need to ask yourself the following 
  13. system-specific questions before you implement AMEBAT:
  14.  
  15.      1) On what drive and directory path does AME86.EXE reside?
  16.      2) What option switches do I want to use with AME86?
  17.      3) Which CP/M program do I want to execute with AME86?
  18.      4) On what drive and directory path does this CP/M program reside?
  19.  
  20. The answers to these questions will provide you with the information that you
  21. will need to customize AMEBAT for your own system.
  22.  
  23.     AMEBAT.ASM contains some data structures at the bottom. These data
  24. structures are filled in with the information you gathered above. If you look
  25. at the last lines in AMEBAT.ASM, you should see the following:
  26.  
  27. -----------------------------------------------------------------------------
  28.  
  29. FCB5C_SEG       DW      0
  30.                 DW      OFFSET FCB
  31. FCB6C_SEG       DW      0
  32. FCB             DB      5               ;Change to drive of CP/M program
  33.                                         ; 1=A, 2=B.... 5=E etc.
  34.                 DB      12 DUP (20H)
  35.                 DB      0,0,0,0
  36.  
  37. AME86           DB      'E:\AME86.EXE',0  ;Point to AME86 here (ie. path etc.)
  38. COMMAND_BLOCK   DB      STRLEN
  39. COMMAND_STRING  DB      ' E:\\KEDT.CMD/C' ;Command line for AME86
  40.                                           ;Note: the double backslash indicates
  41.                                           ;the root directory. This is an AME86
  42.                                           ;feature only. Other directory paths
  43.                                           ;are specified normally.
  44. STRLEN  = $ - OFFSET COMMAND_STRING
  45. TAIL            DB      0DH
  46.                 DB      300 DUP (?)
  47. STACK           DB      ?
  48.  
  49. CODE            ENDS
  50.                 END     BATCH
  51.  
  52. ------------------------------------------------------------------------------
  53.  
  54. The labelled data structures of interest are FCB, AME86, and COMMAND_STRING.
  55.  
  56. The structure FCB contains the drive number where the CP/M program that you 
  57. want to execute will always reside. Note, this is a decimal NUMBER - not a 
  58. letter. If it's on drive A:, put a 1 here. If drive G:, a 7, etc.
  59.  
  60. The structure AME86 contains a string which is the drive, path, and filename
  61. where AME86.EXE will always reside. Do not embed any unnecessary spaces here.
  62. This should be a fairly easy one to change.
  63.  
  64.  
  65.  
  66. The structure COMMAND_STRING contains a string which is the command line to 
  67. pass to AME86 to tell it which CP/M program to run. When you previously ran 
  68. AME86 from the keyboard or a batch file, you always passed a command string to 
  69. AME86. Right? What ever that command string was, put it here. The leading 
  70. space is necessary. For example, if you always say 'AME86 E:\BIN\RED.CMD/C' to 
  71. invoke the CP/M RED editor with AME86, then you would put ' E:\BIN\RED.CMD/C' 
  72. in the COMMAND_STRING structure. However, do not include variables such as 
  73. file names that you would pass to RED. You'll want to pass those interactively 
  74. through AMEBAT (more on that later).
  75.  
  76. Now for a full example. Let's assume you are modifying AMEBAT so that you can
  77. invoke the RED editor. Assume RED.CMD is on E:\BIN\CPM and AME86.EXE is on
  78. E:\BIN. Your data structures should look like this. Right?
  79.  
  80. FCB             DB      5
  81.  
  82. AME86           DB      'E:\BIN\AME86.EXE',0
  83.  
  84. COMMAND_STRING  DB      ' E:\BIN\CPM\RED.CMD/C'
  85.  
  86.  
  87. Now you would build AMEBAT.ASM so you can run RED.
  88.  
  89. ; Assemble, link, and convert to .COM as follows:
  90. ;
  91. ; MASM AMEBAT.ASM AMEBAT.OBJ NUL NUL    ;Note NO commas
  92. ; LINK AMEBAT.OBJ,AMEBAT.EXE,NUL,NUL    ;Note commas (ignore stack error)
  93. ; EXE2BIN AMEBAT.EXE RED.COM            ;Creates RED.COM
  94. ;
  95. ; !!! The source file AMEBAT.ASM refers to 'AMEBATCH.ASM' in the above command
  96. ; !!! lines. Ignore that. The program is now officially dubbed AMEBAT (thanks
  97. ; !!! to CIS's 6 character limit on file names).
  98.  
  99. Note, the last step creates a file called RED.COM instead of AMEBAT.COM. Now, 
  100. if you type 'RED', MSDOS will run RED.COM which will in turn run 
  101. E:\BIN\AME86.EXE which will in turn run E:\BIN\CPM\RED.CMD and, presto, the 
  102. CP/M RED editor starts up transparently. Fine. But you'll probably get a RED 
  103. error message saying you didn't supply the name of the file to edit. Well, 
  104. here comes the neat part. If instead you type 'RED filename', then RED.COM 
  105. (actually AMEBAT) will intercept the command string (ie. ' filename') and tack 
  106. it onto the command string for AME86 who will then pass it to the real RED. 
  107. This is actually the exact same mechanism that the MSDOS batch facility uses 
  108. for invoking programs with variable command lines. But AMEBAT is a little
  109. cleaner, don't you think?
  110.  
  111.    With this example you should now be able to modify AMEBAT.ASM and generate 
  112. .COM files for all your CP/M programs. All you'll really need to change each 
  113. time is the name of the CP/M program (if you have them all on the same drive & 
  114. path) and then just rebuild AMEBAT.
  115.  
  116.    To tell you the truth, AMEBAT.ASM has no special attachment to AME86. You 
  117. can create all kinds of little .COM files that go run other MSDOS programs and 
  118. pass fixed command lines. Effectively, it's a single command line batch 
  119. facility. For example, I have many .COM files made from AMEBAT which run 
  120. LCTERM with different script files. You just need to subsitute AME86.EXE with 
  121. another MSDOS program name and setup the desired command line. The 
  122. possibilities are endless for creating clean custom MSDOS commands.