ECHO31.DOC Manual for ECHO31.ASM 4/22/87 Copyright 1987, Logic Associates, Chicago Roy Lipscomb For free distribution only. Usable with CP/M 2.2 and CP/M+ ----------------------------------------------------------------------------- Version 3.1: [] Employs an improved ECHO ON algorithm, one compatible with 4/22/87 utilities that clone the BIOS jumptable. (Thanks to Stan Shaffer for pointing out this problem.) [] Corrects out-of-place quotation marks in help screen. Files updated in this version: ECHO31.ASM ECHO31.DOC ECHO.COM The full version-history is contained in ECHO31.ASM. ----------------------------------------------------------------------------- A. INTRODUCTION. ECHO is a utility program that enables and disables console output. During batch jobs, this lets you bypass the display of data that holds no interest. ECHO can also displays text to the screen, even if console output has been disabled. [] ECHO is a transient program. It is completely removed from memory as soon as the system returns to the "A>" prompt. So ECHO does not diminish the space available to run other programs. [] ECHO is compatible with most other software. [] The source file for ECHO.COM is ECHO31.ASM. If you reassemble ECHO31.ASM, you may rename the resulting ECHO31.COM to ECHO.COM for consistency with the name used in this manual. B. INSTRUCTIONS. Instructions for using ECHO are as follows: ECHO31 Enables-disables console output. Copyright 1987, Logic Associates, 60660 For free distribution only. --------------------------------------- Disable output: ECHO OFF Enable output: ECHO ON Display "text," whether on-off: ECHO text Display help: ECHO HELP or ECHO H or ECHO ? * "/" means "Toggle upper-lower case": Write "/ram/ disk" for "RAM disk". * "~" means "Control-". (E.g., "~Z".) * "+" means "Ignore carriage return." * Bypass above by "//", "~~", or "++". --------------------------------------- In more detail: [] Why the need to translate characters to upper/lower case? Because SUBMIT translates each command line entirely to upper case, and totally ignores the case in which the command line was originally typed. [] ECHO defaults to lower case at the start of each line. [] If the two characters "~" and "Z" are paired together in "text", ECHO will convert them into the single character Control-Z. The same strategy will apply to all other control characters. This bypasses the problems that CP/M has digesting certain control when they appear on the command line. [] If you do not want a carriage-return/line-feed pair to be output at the end of "text", put a "+" sign at the end. [] The special meanings assigned to "/", "+", and "~" above can be nullified by pairing the character in question with itself. In that case, a single copy of the character will be displayed. Examples: Originally typed: ECHOed as: ------------------------- ------------------- ECHO This is line one. this is line one. ECHO THIS is LINE two. this is line two. ECHO /This is line three. THIS IS LINE THREE. ECHO /t/his is line four. This is line four. ECHO //this is line five. /this is line five. ECHO ~~ ++ // ~ + / ECHO line 5a )+ line 5a )( line 5b ECHO ( line 5b C. THEORY [] ECHO operates by poking a single byte in the operating system. For assembly-language hackers: The location is BIOS+0ch. The value poked into that location is either 0C3 Hex or 0C9 Hex. These are the machine-code instructions for the opcodes "JMP" and "RET" respectively, and represent "ON" and "OFF" respectively. [] The address of the "echo-switch" is normally computable from the contents of memory locations 1 and 2. There is only one program I know of that changes these contents: XSUB. Fortunately, XSUB saves the original contents before making its change, and they can be retrieved from a fixed location within XSUB. D. COMPATIBILITY ECHO should be compatible with virtually all programs that run under CP/M 2.2 or CP/M+. There are two notable exceptions. SUPERMIT3 modules IF.COM (v3.0) and #.COM (v3.0) will not execute while the console is disabled by ECHO. However, compatibility can be achieved by SUBMITing the batch jobs FIXIF.SUB and FIX#.SUB, found in the ECHO31 library. SUPERMIT3 modules IF+.COM and #+.COM have no problems with ECHO. (SUPERMIT is an batch-language extension that brings BASIC-like capabilities to most batch processors, including SUBMIT, EX15, SUPERSUB, and others. SUP- ERMIT can be found on many RCP/Ms, or can be ordered from Logic Associates.) E. SPEED TIPS ECHOing text can be a slow process. For each line of text, the command line must be read from a disk file, and then ECHO.COM must be read from disk. This movement of the disk head may cause a noticeable delay after each line. Apart from getting a RAM disk, the best way to speed things up is to use a RAM-resident batch utility, like EX15.COM. This will completely eliminate the need to access the disk when ECHOing text. If you need to use a disk-resident batch utility (one that, like SUBMIT, uses a $$$.SUB file during execution), here are two tips that will speed up the ECHOing of multiple lines of text. Your batch job can use either or both. 1. (NOTE: This technique can also work with most other programs, but not all. Test this technique with each intended program to see if it performs as expected.) Re-execute the copy of the program already loaded. To do this, [] Insert the command-- SAVE 0 A:RE.COM near the head of your batch job. [] Optionally: Insert-- ERA A:RE.COM near the end of your batch job. [] In each continous stream of ECHOed lines, change all all references to "ECHO" (except the first) to "RE". For example, SAVE 0 A:RE ECHO OFF A:RE Starting the batch job. A:RE Please stand by... PIP B:=A:XYZ.* ECHO Remove disk B: and save. A:RE Job now completed. A:RE ON 2. (NOTE: This tip requires time for the batch job to set itself up. For small batch jobs, this added time might not outweigh the time saved. So use this tip judiciously.) Insure that the $$$.SUB file created is as close to the outside of the disk as possible (as near to the directory as possible). This minimizes movement of the disk head during the batch run. To use this tip, do the following: [] Permanently keep a file called "RESERVED" as the first file on the A: disk. The size of this file in pages is equivalent to the number of lines in your longest batch job, divided by 2 and rounded up. Thus, if your longest batch job has 31 lines, RESERVED should have 16 pages. To create RESERVED, type-- SAVE pages A:RESERVED where "pages" is the required number of pages. For our example above, you would type-- SAVE 16 A:RESERVED [] Optionally: To the space immediately after RESERVED, copy any other programs and data files that will be used by your batch job. [] Include the following lines near the start of each batch job that will ECHO multiple lines: PIP RESERVED=RESERVED PIP $$$$$$.SUB=$$$$$$.SUB The above commands swap $$$.SUB into the preferred disk area normally occupied by RESERVED. [] Include the following lines at the end of the batch job: SAVE pages TEMP.$$$$$$ PIP $$$$$$.SUB=$$$$$$.SUB ERA TEMP.$$$$$$ PIP RESERVED=RESERVED where "pages" is determined as above. These commands move RESERVED back into the preferred disk area, reserving it for use by a future $$$.SUB. F. ECHO1.LBR For those interested in the historic origin of ECHO, or in comparing the original version to the current version, ECHO1.LBR is included in this library. To get at its contents, extract ECHO1.LBR from ECHO31.LBR, then extract the members of ECHO1.LBR. ECHO2 was a pre-release version of ECHO3. G. SUPPORT If you have any comments or questions about ECHO (or would like a catalog of our commercial software for CP/M), we would be happy to hear from you. Our address is-- LOGIC ASSOCIATES 1433 W. Thome Chicago, IL 60660 Please mention where you obtained your copy of ECHO. [end]