home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
- DO
-
-
- Copyright 1982, 1983 William G. Hutchison, Jr.
-
-
-
- TYPE MULTIPLE CP/M COMMANDS ON ONE LINE
-
-
- "DO" is a C program designed to make it easier to type
- in short commands at the CP/M console. (CP/M is a trademark
- of Digital Research, Inc.) Like the program "/.COM" in the
- CP/M users group collection, it allows the operator to enter
- more than one command on one line, separated by semicolons
- (;).
- It works by imitating some of the functions of the CP/M
- SUBMIT program. It makes a stack of command lines in reverse
- order, terminating each line whenever a semicolon is
- encountered. For those with terminals that allow input lines
- longer than 80 characters, it also starts a new command line
- whenever the current line would become filled. It breaks
- command lines only at semicolons or spaces, thus DIR would
- never be separated into D IR. DO uses dynamic memory
- allocation to store the lines. Thus you might run out of
- memory if you type in a great many lines. In most cases, the
- CP/M command line input processor will not allow you to type
- anyway near this limit, so the error message "Do is out of
- memory!" should never appear.
- After creating the list of commands, DO traverses the
- list in reverse order, writing it to a file called
- A:$$$.SUB. This is a temporary file used by CP/M upon
- restarting ("Warm Boot"). It precedes each line by the
- length of the line and follows each line by null characters
- up to 128 bytes. Finally, DO does a call to a "subroutine"
- at location 0, which restarts CP/M. At this point, CP/M
- reads the commands in A:$$$.SUB. It reverses the order once
- again, so they come out right.
- If the A: disk is full before you run DO, it will fail
- to create the file A:$$$.SUB. If this happens, CP/M will
- probably say "Write error - Disk full". If you get this
- error message, please use STAT on the A: disk to see if it
- is really out of space. If you can delete something from A:,
- you can try DO again and it should work.
- To run the program, you need a compiled and loaded or
- linked version of DO called DO.COM. You must prepare this
- with your own C compiler. Next, just type
-
- DO
-
- This will make DO type out a brief description of its
- operation:
-
- Usage: DO COM1; COM2; ... COMN
- where COM1 ... COMN are valid CP/M commands
-
-
-
-
-
-
- DO.C page 2
-
- Here are some more examples of using DO:
-
-
- DO A:; STAT *.*; B:; STAT *.*
-
- will list files and sizes on both the A: and B: disks, then
- leave you logged in to the B: disk.
- DO A:PIP PRN:=DO.C; A:C DO >LST:; A:AS DO; ERA DO.ASM; A:STAT *.*
-
- will print DO.C, compile it, assemble the output from C,
- erase the intermediate assembly language file, then tell you
- how much space is left on the current disk.
- If you want to do these sequences repeatedly, it is
- better to use SUBMIT. But for improvisation, use DO!
- DO is written in a subset of C called C/80 version 2.
- C/80 is available from the Software Toolworks, 14478
- Glorietta Drive, Sherman Oaks, CA 94123, (213) 986-4885,
- CompuServe 70305,170.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-