Sydex 22NICE A New Insystem CP/M Emulator Sydex P.O. Box 5700 Eugene, OR 97405 Voice: (503) 683-6033 FAX: (503) 683-1622 Data: (503) 683-1385 Table of Contents 22Nice, Briefly..............................................1 Quick Installation And Operation of 22Nice...................1 If You're Upgrading..........................................2 How 22Nice Works.............................................3 The GENCOM Utility--Generate A Loader........................4 Specifying a Custom Keyboard Layout..........................8 Running 22NICE.COM..........................................11 Support of User Areas.......................................12 CSAVE - Write the CP/M Area to Disk.........................12 Disk Drive Reassignment.....................................13 Locating CP/M Program Files.................................14 Interrupts and 22Nice.......................................14 Setting GENCOM Defaults.....................................15 Use Of CP/M SUBMIT And XSUB.................................16 Accessing I/O Ports.........................................16 Accessing PC Memory.........................................17 IOBYTE Support..............................................17 Absolute Disk Read and Write................................18 Maximum Program Size........................................18 A Sample 22Nice Installation................................18 A Short Glossary of CP/M Terms..............................19 What's New in Version 1.3...................................21 The Sydex Product Line......................................22 22NICE A New Insystem CP/M 2.2 Emulator Version 1.3, July, 1990 Copyright 1985-1990, Sydex Sydex P.O. Box 5700 Eugene, OR 97405 Voice: (503) 683-6033 FAX: (503) 683-1622 Data: (503) 683-1385 All Rights Reserved NOTICE THIS IS NOT FREE SOFTWARE! If you paid a "public domain" vendor for this program, you paid for the service of copying the program, and not for the program itself. Rest assured that noth- ing ever gets to the originators of this product from such a sale. You may evaluate this product, but if you make use of it, you must register your copy. We offer several inducements to you for registering. First of all, you receive the most up-to-date copy of the program that we have -- and we do update the product on a regular basis. You also receive support for 22Nice -- which can be quite valuable at times. And finally, we have a few utilities not included in the evaluation package. Make no mistake, however - the evaluation version is fully functional and not "crippled" in any way. Registration Information The non-commercial single-user registration fee for 22Nice is $40.00 US, which includes a copy of 22Disk, our CP/M diskette transfer utility. The commercial and multisystem site fee for 22Nice (including 22Disk) is $150.00. Send your payment to: Sydex P.O. Box 5700 Eugene, OR 97405 Voice: (503) 683-6033 FAX: (503) 683-1622 We can accept telephone or FAX orders and honor VISA and Master- Card charges, as well as corporate and government purchase or- ders. All payments must be made in U.S. dollars. Orders from outside the U.S. and Canada should include an additional $5.00 for airmail shipping. Please indicate if you have a requirement for 3.5" media; we normally ship 5.25" 360K diskettes, but will furnish 3.5" 720K media upon request. If you are a registered user of this product and desire an up- date, please send $5.00 for handling and we will ship you an up- to-date copy. Please add $7.50 if you also need printed documen- tation to cover our printing costs. You may also download a registered copy from our bulletin board system; you'll need the five-digit number from your invoice for validation. Our bulletin board system operates 24 hours per day, 365 days a year and sup- ports data rates from 1200 to 9600 bits per second, no parity, 8 data bits. Distribution Notice This is "user-supported" software. You are hereby granted a license by Sydex to distribute this evaluation copy of 22Nice and its documentation, subject to the following conditions: 1. 22Nice may be distributed freely without charge in evaluation form only. 2. 22Nice may not be sold, licensed, or a fee charged for its use. If a fee is charged in connection with 22Nice, it must cover the cost of copying or dissemina- tion only. Such charges must be clearly identified as such by the originating party. Under no circumstances may the purchaser be given the impression that he is buying 22Nice itself. 3. 22Nice must be presented as a complete unit, including this documentation. Neither 22Nice nor its documenta- tion may be amended or altered in any way. 4. By granting you the right to distribute the evaluation form of 22Nice, you do not become the owner of 22Nice in any form. Any other use, distribution or representation of 22Nice is expressly forbidden without the written consent of Sydex. 1 -------------------- 1. CP/M, CP/M-80 and CP/M 2.2 are trademarks of Digital Research. MS-DOS is a trademark of Microsoft. IBM PC, PC-XT and PC-AT are trademarks of International Business Machines. V20, V30, uPD70108, uPD70116 are trademarks of NEC Electronics. WordStar is a trademark of WordStar Corporation. Some products of Lear- Siegler, Kaypro, Osborne and Televideo are also trademarked. Getting Started ____________________________________________________ 22Nice, Briefly 22Nice is a Z80/8080 CP/M 2.2 emulator for use on PC-compatible computers. The 22Nice CP/M Emulation package offers the follow- ing features: * Emulate 8080/8085/Z80 processors with or without NEC V-series chip installed. 22Nice contains an emulator for both 8080 and Z80 processors. 22Nice also has a test mode, which allows identification of the ap- propriate processor needed for emulation. * Provides terminal emulation for most common CP/M machines with terminal types for Osborne, Kaypro, Heath/Zenith, Morrow, Actrix, DEC VT-100/VT-52, Televideo 925/950 and LSI ADM-3A. * Supports CP/M user number to DOS sub-directory transla- tion. * Allows use of DOS "pipes" and utilities with CP/M programs. * Supports a complete set of BDOS and BIOS function inter- faces, including direct disk read/write. * CP/M programs are fully integrated into the DOS environ- ment; the user is unaware that a program is CP/M- or DOS-based. Quick Installation And Operation of 22Nice NOTE: If you're upgrading from a version of 22Nice earlier than 1.3, consult the next section on special upgrade considerations. There are quite a number of differences between Version 1.3 and earlier versions of 22Nice. The following files should be present on your 22Nice distribution diskette or archive file: 22NICE.COM The emulator program itself GENCOM.COM Execution environment specifier CSAVE.COM Analog to CP/M SAVE function Page 1 Getting Started ____________________________________________________ USERS.EXE Shows user-to-directory mapping 22NICE.DOC Printable documentation file for 22Nice WHATS.NEW Latest bulletin on 22Nice enhancements To use 22Nice, you'll need to do the following: 1. Copy the contents of the 22Nice distribution diskette or archive file into a subdirectory, preferably located on a hard drive. 2. Copy the CP/M program files that you want to execute into this directory, changing the .COM file type to .CPM. If you've used our 22Disk diskette transfer utility to read your program files from your CP/M dis- kettes, the .COM file types have already been changed to .CPM. Otherwise, a simple way to change names is to use the following DOS command: REN *.COM *.CPM 3. Run the GENCOM utility for all .CPM files, specifying the console, keyboard and processor type. For example, a WordStar-type keyboard layout with a Kaypro-type dis- play can be done thus: GENCOM * DIS=KAY KEY=WS The GENCOM utility has many options to modify 22Nice operation; refer to the GENCOM section later in this document for more details. 4. Run the CP/M program(s) as if they were normal DOS programs! That's all there is to it--but there are many special features of 22Nice that you'll undoubtedly want to take advantage of--so keep reading! If You're Upgrading... If you're upgrading from an earlier version, there are some dif- ferences between the current version of 22Nice and previous ver- sions that you should know about: Page 2 How 22Nice Works ____________________________________________________ 1. The device-driver form of 22Nice (22RES.SYS) has been discontinued. The terminate-and-stay-resident form of 22Nice takes its place. 2. The BIND option of the GENCOM utility has been discon- tinued. The difference in loading time between the separate and the "bound" versions of a program were neg- ligible. 3. Interface conventions between the 22Nice resident and GENCOM-produced programs have changed. You'll have to re-GENCOM your programs. 4. The RMVNICE program has been moved into the 22NICE.COM resident. 5. The default processor mode for GENCOM is now Auto. 6. Two environment variables have been introduced to simplify specification of defaults: GENCOM and 22NICE. 7. The support of user areas has been greatly enhanced. 8. All file functions are now performed using DOS handle- type I/O rather than FCB-type I/O. How 22Nice Works In addition to supporting the functions of the CP/M operating sys- tem under DOS, 22Nice supports the instruction set of a microprocessor different from that used in the IBM PC. On PC XT- type machines, this microprocessor support function can be be facilitated through a plug-in replacement processor to the Intel 8088, known as the NEC V20. But in the case of PC AT- and 386- class systems, emulation of the 8080 or Z80 processor must be per- formed by 22Nice. All emulation is implemented in a single program, 22NICE.COM. 22NICE.COM may be loaded "on demand" by CP/M programs, or may be run as a terminate-and-stay-resident program. Page 3 How 22Nice Works ____________________________________________________ CP/M programs are executed by having DOS first execute a short "loader" program, which provides information to 22Nice about the program to be executed. In addition, the "loader" executes the 22NICE.COM program if necessary. As implemented, a CP/M executable file normally has a file name extension of .COM. However, this creates problems by conflicting with DOS .COM-type programs. Because DOS does little checking on the contents of .COM files, executing a CP/M .COM file under DOS could lead to disaster. By renaming all CP/M .COM files to .CPM the conflict is resolved. As part of CP/M emulation, 22Nice changes all CP/M .COM file references to .COM and vice-versa, so that the name change is transparent. The short "loader" for each CP/M program is a DOS-mode program with the .COM file type. This short (about 500 bytes) program contains the following information: * The name of the CP/M program to be run. * The type of microprocessor to be emulated--8080 or Z80--and if a NEC V20 can be used, if available. * The type of terminal display to be emulated. Unlike DOS, CP/M usually provides only a simple terminal-style display rather than the full-screen text and graphics display of the PC. However, each manufacturer's CP/M system differed in the type of terminal supported. * How the cursor and function keys are to be translated. One CP/M program may require a WordStar type of keyboard mapping, while another could require a Perfect Writer style of keyboard. All of this information is provided by the output of the GENCOM utility as a very small .COM-type file. The GENCOM Utility--Generate A Loader At this point, it's assumed that you've gotten your CP/M files over to your PC somehow. Remember that CP/M program files with an extension of .COM need to be renamed to have an extension of .CPM. The 22Disk diskette conversion package does this automati- cally, but if you've used some other means to obtain your files, you'll need to rename them manually. Page 4 GENCOM Operation ____________________________________________________ The GENCOM utility is used to create a .COM file which can be ex- ecuted by DOS for each .CPM file. This .COM file interfaces with the 22NICE.COM support program and brings the associated CP/M program into execution. The syntax of the GENCOM command is as follows: GENCOM file DISPLAY=dtype KEYBOARD=ktype PROCESSOR=ptype "file" is the name of the CP/M program file to be executed, and is specified without a file extension. DOS path names are allowed as well as "wildcard" file specifiers (i.e., "*" and "?"). All .CPM files matching the file specification will be processed by GENCOM and the .COM files which are generated will be placed in the same directory as the original .CPM files. DISPLAY=dtype is optional and may be omitted. If specified, it indicates the type of console display to be emu- lated. Any of the following may be specified for dtype: NONE uses DOS character I/O for output. No special han- dling of characters is performed. If the DISPLAY expression is omitted, this is the default. If program output is to be "piped" to another program or file, NONE must be used. TVI emulates a Televideo 925/950 series terminal. ADM emulates a Lear-Siegler ADM-3 or ADM-31 type ter- minal. OSBORNE emulates the display on an Osborne I/II/Nuevo computer. KAYPRO emulates the display on a Kaypro I/II computer. ANSI or VT100 emulates an ANSI (DEC VT-100) display. VT52 emulates a DEC VT-52 display. H19 emulates a Heath/Zenith H19/Z19 or H89/Z89 display. Page 5 GENCOM Operation ____________________________________________________ DISPLAY may be abbreviated as DIS. Certain display-specific features cannot be accommodated by 22Nice, such as the 132- column mode of a VT-100 terminal. KEYMAP=ktype is optional and specifies the map for the con- sole keyboard. Any of the following may be specified for ktype: NONE uses DOS for input. No special handling of keyboard characters is performed. If the KEYMAP expression is omitted, this is the default. If keyboard input is to be "piped" from another program, this option must be used. H19 emulates the Heath/Zenith H19/Z19/H89/Z89 keyboard. ANSI emulates a VT-100-style keyboard. WS implements a WordStar cursor keyboard mapping. TVI emulates a Televideo 925/950-series keyboard. OSBORNE emulates an Osborne 1 keyboard in non-WordStar mode. Anything else indicates a custom keyboard map is to be used and the value given is the name of the file containing the keyboard information. See the sec- tion entitled Defining Custom Keyboards for more information. KEYBOARD may be abbreviated as KEY. PROCESSOR=ptype is optional and specifies the processor emulation type required for this program. Any of the following may be specified for ptype: AUTO indicates that 22Nice begins execution in emulated Intel 8080 mode and switches to Zilog Z80 emula- tion if a Z80-specific instruction is encountered. If PROCESSOR is not specified, it defaults to AUTO. Page 6 GENCOM Operation ____________________________________________________ V20 indicates that 22Nice should use the hardware emula- tion capabilities of the NEC V20 or V30 processor, if one is installed in this computer. If no V20 or V30 processor can be found, an 8080 software emulator will automatically be used. E8080 specifies that 22Nice should emulate the Intel 8080 processor, even if a NEC V20 or V30 is detected. E8080 is somewhat faster than Z80 emula- tion mode. Z80 specifies that 22Nice should use a Z80 software emulation. Note that the NEC V20 and V30 microprocessors do not support the extended in- struction set of the Z80 processor. TEST specifies that 22Nice should emulate the Z80 in- struction set and observe the execution of the cur- rent program. At the conclusion of program execu- tion, 22Nice will report the following informa- tion: * If any Z80-specific instruction codes were executed. If this is noted, PROCESSOR=Z80 should be used for further program execution. * Any use of I/O instructions. If these are present, the program should be examined and the instructions modified or eliminated to be compatible with the PC hardware. * Presence of code likely to activate one of the V20 bugs. If a message indicating this is present, a software emulation (E8080 or Z80) should be selected. Hardware-supported emulation (V20) results in the fastest execution speed for a program. 8080 software emulation (E8080) is approximately 4 times slower, with Z80 software emulation (Z80) about 6 times slower than V20/V30 supported hardware emulation. On PC-AT- or 386-class machines, the software emulation modes compare favorably with a PC-XT class machine using a V20 processor. Page 7 GENCOM Operation ____________________________________________________ PROCESSOR may be abbreviated as PRO. Here are some examples of the GENCOM command: GENCOM DDT PRO=V20 Builds a loader file, DDT.COM. If a V20 is present, its emula- tion capabilities will be used. Otherwise, 8080 software emula- tion will be performed. Standard DOS input and output will be performed. GENCOM * KEY=WS DIS=ANSI Builds .COM loader files for all .CPM files present in the cur- rent directory. AUTO processor mode is assumed. A special WordStar keyboard mapping will be used; console output will emu- late a standard ANSI terminal. GENCOM F:\CPM22\* PRO=Z80 Builds .COM loader files for every .CPM file present in the direc- tory F:\CPM22. Z80 software emulation will be performed and stan- dard DOS input and output will be used. GENCOM MYPROG PRO=TEST Builds a .COM loader file, MYPROG.COM. Z80 software emulation is used and a message will be displayed if any Z80-only instructions are used. In addition, any code likely to run afoul of V20 bugs will be noted, as well as usage of any I/O instructions. GENCOM Displays a summary of GENCOM command syntax. Specifying a Custom Keyboard Layout In addition to several pre-defined keyboard layouts, a custom- tailored keyboard "map" can be specified for individual programs. No longer is it necessary to remember that "cursor Page 8 Custom Keyboard Definition ____________________________________________________ back" is Control-B for Perfect Writer, but Control-S for WordStar--a separate keyboard "map" can be created for each program. A keyboard map affects only the cursor keypad and the function keys; "normal" keys, (i.e., letters, numbers and symbols) cannot be mapped. To define a set of key mappings, a file must first be created (using any convenient ASCII editor) containing lines of the following form: key-name "key-values" Key-name is the name of the key being mapped and may be one of the following: F1, F2, F3...F10 Function keys F1 through F10 SF1, SF2, SF3...SF10 Function keys Shift-F1 through Shift-F10 AF1, AF2, AF3...AF10 Function keys Alt-F1 through Alt-F10 CF1, CF2, CF3...CF10 Function keys Ctrl-F1 through Ctrl-F10 Up, CUp Keypad up-arrow, Ctrl-up-arrow Down, CDown Keypad down-arrow, Ctrl-down-arrow Left, CLeft Keypad left-arrow, Ctrl-left-arrow Right, CRight Keypad right-arrow, Ctrl-right-arrow Home, CHome Keypad Home, Ctrl-Home End, CEnd Keypad End, Ctrl-End PgDn, CPgDn Keypad PgDn, Ctrl-PgDn PgUp, CPgUp Keypad PgUp, Ctrl-PgUp Ins, CIns Keypad Ins, Ctrl-Ins Del, CDel Keypad Del, Ctrl-Del Break Scroll Lock The key-values part of the definition represents the codes to be generated for each key; note that the key-values are enclosed in double quotation marks. As many values as can fit on a 255- character line may be specified. Commentary can be placed on a line after the closing quotation mark, provided that at least one space follows the quotation mark. Lines beginning with an asterisk (*) are ignored and may be used for commentary. Control characters are specified by preceding the corresponding printing character by the caret (^). Thus, ^C generates a Control-C or ASCII value of 03. A carriage return or Enter Page 9 Custom Keyboard Definition ____________________________________________________ character is represented by ^M. A double-quotation mark is repre- sented by a pair of double quotation marks (""); a caret (^) is represented by a double-quotation-mark-caret sequence ("^). A keyboard mapping file to be used by a CP/M program is specified with the KEYBOARD= parameter in the GENCOM command. GENCOM as- sumes that the file type of a keyboard mapping definition file is .KEY, but another extension may be specified explicitly. Let's try an example: Suppose that we want to provide a cursor keypad and simple function key map for WordStar. We first create a file (using either WordStar's nondocument mode or the DOS EDLIN utility) called STAR.KEY with the following contents: Up "^E" Line up Down "^X" Line down Right "^D" Character right Left "^S" Character left PgUp "^R" Page up PgDn "^C" Page down Home "^QR" Start of document End "^QC" End of document Ins "^V" Toggle insert mode Del "^G" Delete character F1 "^J" Help F2 "^PS" Start/Stop underline F3 "^PB" Start/Stop Bold F4 "^PI" Start/Stop Italic F5 "^KB" Start block F6 "^KK" End block F7 "^KV" Move block F8 "^KC" Copy block F9 "^KS" Save file, continue edit F10 "^KD" Save file Suppose also that our copy of WordStar requires a TeleVideo 925 terminal for display. The GENCOM com- mand to produce our WordStar WS.COM loader file is: GENCOM WS DIS=TVI925 KEY=STAR Page 10 Running 22NICE.COM ___________________________________________________ Note that a keyboard mapping file should not have the same name as one of the pre-defined maps that GENCOM supports. This is why the mapping file just defined was not called WS.KEY--GENCOM already has a predefined map named WS. The contents of the keyboard mapping file are included in the .COM loader generated by GENCOM; use of a keyboard mapping file increases the length of a .COM loader file by 256 bytes. Running 22NICE.COM 22Nice's support routine, called 22NICE.COM, provides all of the emulation and CP/M support facilities needed to execute a CP/M program under DOS. 22NICE.COM can be run in two ways: 1. As a program that is loaded automatically every time a CP/M program is executed. When the CP/M program has completed executing, 22NICE.COM is removed from memory. This mode of operation suits most applications. It is only necessary that the file 22NICE.COM be placed where it can be accessed as a normal DOS program. On most systems, this will be in the subdirectory usually called \DOS. However, 22NICE.COM may also be placed in the same directory used to store CP/M programs to be run. 2. As a "terminate and stay resident" (or TSR) program. In this operating mode, 22NICE.COM is loaded explicitly by entering the DOS command: 22NICE 22NICE.COM will load and stay resident until explicitly removed with the command: 22NICE OUT This operating mode is most useful when the CSAVE com- mand is used to save the contents of the CP/M memory area for later inspection. Like the load on demand mode, the file 22NICE.COM must be placed where it is Page 11 User Area Support ___________________________________________________ accessible as a normal DOS command file. While 22NICE.COM is resident in memory, it occupies about 23K. CP/M program operation in either mode is the same; to execute a CP/M program, simply type its name as if it were a DOS program. Support of User Areas CP/M implements the capability to segment a file directory into numbered "user areas". Files created in one user area are not visible to another. DOS departs from CP/M in this area and imple- ments subdirectories, or "files of files". 22Nice provides a simulation of user areas by mapping DOS sub- directories to CP/M user area numbers. The mapping information is supplied by a set of DOS environment variables, defined by the DOS SET statement. As an example, let's "map" the DOS subdirectory \MYCODE to CP/M user 2. To do this, the following DOS statement is used: SET USER2=\MYCODE All accesses by a CP/M program to user area 2 will result in ac- cessing the DOS subdirectory \MYCODE on the current disk. Up to 31 user areas can be defined, but user area 0 is predefined to be the current (default) directory. That is, the DOS environment variables USER1 through USER31 may be used. The command USERS can be used to show what user areas are defined. The syntax of this command is: USERS A display of user area-to-DOS subdirectory correspondence will be displayed. CSAVE - Write the CP/M Area to Disk 22Nice provides an analog to the CP/M SAVE command, called CSAVE. The syntax of CSAVE is identical to its CP/M counterpart, namely: Page 12 Miscellaneous Topics ____________________________________________________ CSAVE page-count file-name Page-count is the decimal count of 256-byte pages to be saved to file-name, beginning with the first byte of the transient program area (TPA), located at 100 (hexadecimal). Up to 255 pages can be written in this manner. For CSAVE to operate, 22NICE.COM must have been run in the terminate-and-stay-resident operating mode. Disk Drive Reassignment Most CP/M programs can be reconfigured to make use of any combina- tion of available disk drive units. However, a few of the older CP/M programs require that drive A: contain CP/M programs and drive B: contain data files. While operation under DOS can be performed using actual A: and B: drives, it is often desirable to make use of the hard disk exclusively. If you're using DOS 3.1 or later, you can use the DOS SUBST com- mand to reassign a drive letter to a hard disk subdirectory. For example, to reassign drive A: to access files in the subdirectory \MYDISK on the C: drive, the following command could be used: SUBST A:=C:\MYDISK To make the "real" drive A: accessible again, use: SUBST A: /D If you're using DOS 2.1, the DOS ASSIGN command can be used to reassign one drive letter to another. For example, when ASSIGN A=C is used, all accesses to the A: drive will be changed to access the C: drive. To terminate the drive reassignment, use: ASSIGN Page 13 Miscellaneous Topics ____________________________________________________ Locating CP/M Program Files It's been mentioned that GENCOM generates a loader file for CP/M programs. However, 22NICE.COM needs to know where to find the program file (.CPM) itself. 22Nice locates program files in the following manner: 1. 22NICE.COM first searches the current directory for the .CPM program files. 2. If the environment variable CPMPATH is defined, 22NICE.COM will search the drives and directories named by that variable. The syntax for describing a search path with CPMPATH is identical to that used for DOS PATH; namely, a list of directories or drive names, separated by semicolons. 3. In the absence of any other indication, 22NICE.COM searches for a program according to the PATH environ- ment variable specification. That is, 22Nice will look for a program in the same places and in the same order as the DOS command processor. As an example, suppose all of our system's CP/M program files are located in the subdirectory \USR\CPM22. We could indicate this to 22Nice by means of the following DOS statement: SET CPMPATH=\USR\CPM22 Observe that, since DOS is responsible for loading the .COM loader files, only the PATH environment variable has any effect on the main DOS search path. In other words, CPMPATH only has relevance when .CPM program files are involved. Interrupts and 22Nice 22NICE.COM uses two interrupts to communicate between it and the CP/M program being executed. Under normal circumstances, 22Nice will automatically select a pair of unused interrupts. However, if the message: No Interrupts--Consult Manual and specify interrupts explicitly Page 14 Miscellaneous Topics ____________________________________________________ is displayed when 22NICE.COM is loaded, it will be necessary to specify a pair of interrupts by means of the environment variable 22NICE. This situation usually occurs because of small dif- ferences in BIOS ROM initialization between makers of PC systems. Usually, interrupt numbers in the range of 128 to 159 are avail- able for assignment. Select two numbers from this range and ex- ecute the following DOS statement: SET 22NICE=n1 n2 Where n1 and n2 are the selected interrupt numbers. If, after selecting an interrupt set, 22Nice operates without affecting the normal DOS operation of your system, a valid interrupt pair has been selected. Setting GENCOM Defaults Default options have been selected for the GENCOM utility that reflect what Sydex believes will be adequate for most CP/M ap- plications. However, in some cases, it will be desirable to change the defaults without explicitly specifying them every time GENCOM is run. Default parameters can be specified by setting the GENCOM DOS en- vironment variable to the desired values. Since the DOS SET com- mand does not allow the equals sign (=) to be included within an environment string, the semicolon (;) can be used in its place. Thus, to set GENCOM defaults to generate loader files to make use of the V20 processor chip, a Televideo display, and a WordStar keyboard, the following DOS statement is used: SET GENCOM=PRO;V20 DIS;TVI KEY;WS GENCOM defaults set in this way may be overridden at any time simply by specifying new values explicitly when executing GENCOM. For example, to use the values defined above, but to use Z80 emulation, the following GENCOM statement could be used: GENCOM filename PRO=Z80 Page 15 Miscellaneous Topics ____________________________________________________ Use Of CP/M SUBMIT And XSUB If you have "batch" files which operate with CP/M 2.2's SUBMIT facility, you'll need to modify them to use DOS's batch file capability. Usually this will entail no more than the following: 1. Changing the file name extension from .SUB to .BAT. This is done with the DOS RENAME command. 2. Editing the now-.BAT file, changing all parameter references from $1, $2, etc. to %1, %2 and so on. 3. Instead of using SUBMIT filename to invoke the file, simply use filename to do the same. A special problem arises when XSUB is used in a batch file. DOS has no direct analogue of the XSUB function, but it may be simu- lated by means of input file redirection. Consider the following sample batch file: XSUB SAMPLE $1 line 1 for SAMPLE line 2 for SAMPLE ^Z This file could be rearranged to yield the same results under DOS: echo line 1 for SAMPLE >x echo line 2 for SAMPLE >>x SAMPLE %1 MKDIR C:\OSBORNE 2. Copy 22NICE.COM and GENCOM.COM into C:\OSBORNE: C> COPY A:22NICE.COM C:\OSBORNE C> COPY A:GENCOM.COM C:\OSBORNE 3. Using Sydex's 22Disk program, copy the files WS.COM, WSMSGS.COM, WSOVLY1.COM from the Osborne program dis- kette to C:\OSBORNE. 22Disk will automatically change the .COM file types to .CPM: C> CTOD /OSB1 A:*.COM C:\OSBORNE 4. Run GENCOM on WS.CPM to generate a loader for 22Nice: C> GENCOM WS DIS=OSB KEY=WS 5. Move to the \OSBORNE subdirectory and run WordStar: C> CD \OSBORNE C> WS A Short Glossary of CP/M Terms BDOS Under CP/M the part of the operating system which manages file and console operations at a hardware-independent level. The BDOS receives requests from an application program and translates them into low-level operations that the BIOS can understand and act on. BIOS Under both CP/M and DOS, an acronym for Basic Input/Output Subsystem. This is the portion of the operating system that deals with the lowest-level interface to peripheral devices such as disks and displays. CCP Under CP/M the Console Command Processor. This is the part of the operating system which interprets commands from the console and acts upon them. This interface is only used when CP/M is at a system-level command prompt (e.g., A>); during execution of application programs, it is not active. Page 19 Glossary ___________________________________________________ DDT is the name for the CP/M debugging utility and stands for Dynamic Debugging Tool. The acronym's similarity to a well- known insecticide is not coincidental. FCB stands for File Control Block. In both DOS and CP/M, this is a small memory-resident table used to access a file. When a file is opened or created, CP/M fills in certain fields in the FCB; the user program fills in others. In DOS, the FCB is considered to be obsolescent and has been superseded by the I/O handle facility, which more closely resembles the approach taken by Unix. 22Nice translates CP/M FCB func- tions to their corresponding DOS handle functions. IOBYTE is a name for a memory location which determines where most basic console and printer I/O will be directed. It is possible to redirect console output to the printer by ap- propriately setting this location, for example. PIP is the name of CP/M's Peripheral Interchange Program. It cor- responds roughly to DOS COPY. STAT is a CP/M command used to provide several different serv- ices. Generally, STAT is used to provide information regard- ing file lengths and the amount of storage available on each disk. SUBMIT is the CP/M batch file processor. Unlike DOS, which im- plicitly executes batch files, SUBMIT must be explicitly called to begin batch file processing. TPA stands for Transient Program Area. In CP/M, this the area of memory that is used to run programs. USER AREA or NUMBER is a primitive CP/M facility to provide a logical division between files in a disk's directory. DOS uses the subdirectory facility to achieve the same end in a more general fashion. In essence, a file name is "qualified" by a user number byte to distinguish it. Note, however, that all files in CP/M are still kept in one direc- tory. V20 A plug-in replacement for the 8088 central processor in- tegrated circuit found in most XT-type PC's. The V20 is made by Nippon Electric Corporation (NEC) of Japan and incor- Page 20 Glossary ___________________________________________________ porates not only the 8088 instruction set, but also the in- struction set of the 8080 "8 bit" processor used in many CP/M computers. The advantage that this hardware implementa- tion presents over software emulation is one of much greater speed. V30 A plug-in replacement for the 8086 CPU, otherwise identical in capability to the V20, above. XSUB is a facility within SUBMIT processing that allows not only CP/M commands, but program data to be diverted from the con- sole to a disk file. There is no precisely corresponding facility in DOS. What's New in Version 1.3 Version 1.3 represents a major revision of 22Nice. For a list of differences, consult the section titled If You're Upgrading.... Page 21 The Sydex Product Line ____________________________________________________ The Sydex Product Line AnaDisk -- The compleat diskette utility. Nothing like it any- where else; scan, edit, repair and copy just about any kind of diskette. $25.00 ($150.00 site) registration fee. Con>Format -- Concurrent "background" diskette formatter. Fea- tures "pop-up" operation and "hot key" activation. You've got to see it to believe. Supports all current DOS formats. $15.00 ($50.00 site) registration fee. 22Disk -- Transfer files, format, examine and erase files on "foreign" CP/M diskettes on your PC. Includes tips on supporting 8" and 5.25" single-density diskettes. Contains definitions for over 200 different formats. $25.00 ($100.00 site) registration fee. TeleDisk -- Turn any diskette into a compressed data file and vice-versa. Allows you to send and receive entire diskettes via modem. Even works with some "copy-protected" diskettes. $20.00 ($150.00 site) registration fee. COPYQM -- Mass diskette duplicator. Format, copy and verify mul- tiple diskettes from a single master. Implements "no keyboard" interaction mode and drive "round robin" servicing. Supports all standard DOS formats. $15.00 ($50.00 site) registration fee. FORMATQM -- Mass diskette formatter - format a box of diskettes at a single sitting. Implements "no keyboard" interaction mode and drive "round robin" servicing. Supports all standard DOS for- mats. $10.00 ($40.00 site) registration fee. Information on any of these products can be obtained from Sydex by calling or writing us at: Sydex P.O. Box 5700 Eugene, OR 97405 Voice: (503) 683-6033 FAX: (503) 683-1622 Data: (503) 683-1385 Page 22