%llen 60 %skip 3 %c SuperSoft Utility Pack II %skip 2 %p Commands in utility packs for the most part have a consistent command syntax. Each command consists of a command name followed by arguments. The arguments are separated by spaces (not tabs). If spaces are desired in an argument, they must be placed in double quotes. The arguments tend to be options, filenames, or input/output redirections. The options are preceded by a dash ('-') in most cases. Filenames must be unambiguous ('?' and '*' are not treated specially). %p These command make use of a "standard input" and a "standard output." Normally, the standard input is equivalent to the console keyboard and the standard output is equivalent to console output. However, these assignments can be changed by adding an input/output redirection argument to the command line. If an argument of the form >filen is added to the command line, the standard output is changed to filen. If an argument of the form '. Input to DC is in Reverse Polish Notation. %p The following is a list of DC commands: %skip 1 %asis - Push number onto stack. 'h' or 'H' - Display online help. 'l'nn or 'L'nn - Pop top of stack into register nn. 'p' - Display top of stack. 'P' - Display top of stack and pop. 'q' or 'Q' - Leave DC. 's' or 'S' - Swap top two stack elements. 'w'nn or 'W'nn - Push register nn onto stack. 'x' or 'X' - Display entire stack. 'z' or 'Z' - Clear stack. '$' - Extended function flag (see below). - Start processing. %asis %p The following is the list of basic mathematic functions that DC performs. These functions operate by popping the top two stack elements, performing the operation, and then pushing the result back onto the stack. %skip 1 %asis '+' - Addition. '-' - Subtraction. '*' - Multiplication. '/' - Divison. '%%' - Modulus. '^' - Exponentiation by an integer. %asis %p There is also a set of extended math functions. These functions are accessed by first entering the extended function flag ('$') and then the function name. All of these functions pop the top element of the stack, compute the result, and push the result back onto the stack. %p All of the functions, except for 'I', approximate their result by evaluating a power or taylor series in "single precision," so it is possible for some results to be less precise than thirteen digits. All trigonometric functions return radians. %p The functions and their names are: %skip 1 %asis 'a' or 'A' - Compute the natural antilog. 'c' or 'C' - Compute the cosine (radians). 'i' or 'I' - Compute the integer part. 'l' or 'L' - Compute the natural log. 'q' or 'Q' - Compute the square root. 's' or 'S' - Compute the sine (radians). 't' or 'T' - Compute the tangent (radians). '!' - Factoral. %asis %p The following functions are also extended math functions, and are accessed the same way, they however operate on the top two stack elements. These functions return '1.000000000000' if the expression is true and '0.000000000000' if false. %skip 1 %asis '<' - Less than. '>' - Greater than. '<=' - Less than or equal to. '>=' - Greater than or equal to. '=' - Equal. '#' - Not equal. %asis %p Up to eighty characters may be entered on the command line at a time. Numbers must be terminated by a space or a command. %skip 2 %asis Bugs: %asis %p IO redirection is not available. %skip 2 %asis Sample session: %asis %p The following is a sample DC session. %skip 1 %asis >00001 2. 3PPPX 3.000000000000 2.000000000000 1.000000000000 > P Stack empty. >1 >2 >3*+p 7.000000000000 >5 6 7x 7.000000000000 6.000000000000 5.000000000000 7.000000000000 >$=x 0.000000000000 5.000000000000 7.000000000000 >q %asis %page %asis DIFF -- Compare two files line by line. Synopsis: DIFF [ -A ] file1 file2 %asis %p DIFF does a line by line comparison of file1 and file2. If a line is found in file1 but not in file2 the line is displayed, prefaced by '^*' on the standard output device. The line is displayed, prefaced by '^.' if in file2 but not file1. If option -A is selected all other lines are displayed, prefaced by '^ '. %asis Note: %asis %p DIFF reads the file into memory. If the file won't fit, DIFF dies. In order to make this less of a problem, DIFF is supplied in four versions: DIFF.COM (24k version), which handles 2,000 lines and 10,000 bytes of source; DIFF32.COM (32k version), which handles 3,000 lines and 17,000 bytes; DIFF48.COM (48k version), which handles 4,000 lines and 24,000 bytes; and DIFF56.COM (56k version), which handles 5,000 lines and 31,000 bytes. (Subtract 0E00h (about 4k) from these figures to get the required TPA size). %p SPLIT can also be used to keep DIFF alive. %skip 2 %asis See also: %asis %p CMP (Utilities I), SPLIT (Utilities II). %page %asis INUSE -- Reserve a terminal. Synopsis: INUSE %asis %p INUSE clears the terminal screen and displays 'IN USE' in large letters across the screen. INUSE ends on any keystroke. %p INUSE should request a password to prevent unauthorized access to the terminal. However, under CP/M, control-C cannot be ignored by a program waiting for input. %p INUSE does not use IO redirection. %page %asis PR -- Output formatter. Synopsis: PR [ -Lnn -Wnn -nn -T -PR -PU -Hstring1 ] [ filen ... ] %asis %p PR prints the list of files on the standard output with optional header/trailer lines. The header contains a page number, the filename of the file being printed, and the date_string (if present--see DATE). PR expands tabs and form feeds using the appropriate linefeed or space characters. %p -Wnn sets the line length to nn (default is 79). -Lnn sets the page length to nn (default is 66). -nn causes the output to be formatted into nn columns (default is 1). -T deletes the header/trailer lines. -PR sends the output to the printer device. -PU sends the output to the punch device. -Hstring1 substitutes string1 for the filename in the header. %skip 2 %skip 2 %asis See also: %asis %p CAT (Utilities I), DATE (Utilities II), WIDTH (Utilities I). %skip 2 %asis Bugs: %asis %p IO redirection is not available. %page %asis RPL -- Substitute strings. Synopsis: RPL string1 string2 file1 ... %asis %p RPL replaces all occurences of string1 with string2 in the list of files. The original of each file is renamed using the extension of '.BAK'. %skip 2 %asis Bugs: %asis %p IO redirection is not available. Files with the extension of '.BAK' cannot be specified to RPL. %skip 2 %asis See also: %asis %p GREP (Utilities I), TR (Utilities II). %page %asis SLEEP -- Pause. Synopsis: SLEEP nn %asis %p SLEEP executes for nn time units (a time unit is one second on a 4MHz system). This is useful in a 'submit' file when a pause for operator interaction is needed, such as when a disk needs to be mounted, or forms need to be changed in a printer. %page %asis SPLIT -- Split a file. Synopsis: SPLIT [ -nn ] file1 %asis %p SPLIT copies file1 into multiple files of one hundred lines each. These files are names XAA, XAB, and so on. %p If -nn is specified, the file is split at multiples of nn lines. %p A maximum of 26 files will be created. %skip 2 %asis Bugs: %asis %p IO redirection is not available. %page %asis TR -- Translate bytes. Synopsis: TR string1 string2 file1 [ file2 ...] %asis %p TR performs a byte by byte translation. string1 and string2 are made up of ASCII characters or '\' followed by three decimal digits which will be taken to be the decimal value of the byte's code. string2 must at least contain as many byte values as string1. '\\' represents a single slash, and '\F' indicates that the rest of the string is to be taken as the name of a file to read in order to form the translation information. The file is taken to contain pairs of strings: each a string1-string2 pair, carriage returns, line feeds, spaces, tabs, and control-Z's are string separators. %p In the following example 'A' is translated into 'Z', byte code 5 into byte code 6, and byte code 10 into 'P' for the files 'TEST1.DAT' and 'TEST2.DAT'. %p Note that the command line processing of CP/M requires that lower case ASCII characters be entered to TR via the '\' escape convention. %asis TR A\005\010 Z\006p TEST1.DAT TEST2.DAT %asis %p Byte codes must be 3 digits long, padded with leading zeros if necessary. Valid byte codes run from 0 to 255. %p Note that text files usually are padded at the end with control-Z's, therefore translating control-Z produces files that are hard to manipulate with standard CP/M programs. %skip 2 %asis Bugs: %asis %p IO redirection is not available. Files with the extension of '.BAK' cannot be specified to RPL. %skip 2 %asis See also: %asis %p RPL