home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-09 | 50.3 KB | 1,373 lines |
-
-
-
-
-
-
-
-
-
-
-
-
- 22NICE - A NEW INSYSTEM CP/M 2.2 EMULATOR
-
-
-
- Version 1.25, October, 1989
-
- Copyright 1989, Sydex. All Rights Reserved.
-
- SYDEX
- 153 North Murphy Ave.
- Sunnyvale, CA 94086
- (408) 739-4866
-
-
-
- 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 - this is a fully
- functional version of 22NICE 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 a check or company P.O. for the appropriate amount to:
-
- Sydex
- 153 North Murphy Ave.
- Sunnyvale, CA 94086
-
-
-
-
-
-
-
-
-
- Please indicate what product you are ordering and if you have a
- requirement for 3.5" media. We normally ship 5.25" 360K dis-
- kettes, but will furnish 3.5" 720K media upon request. Customers
- outside of the United States and Canada should add $5.00 for air-
- mail shipping.
-
- 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 $10.00 for printed documentation to
- cover duplication costs.
-
-
- 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 evalua-
- tion 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 dissemination only. Such
- charges must be clearly identified as such by the originat-
- ing 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 documentation 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 ex-
- pressly forbidden without the written consent of Sydex.
-
-
-
-
-
-
-
- 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. Some
- products of Lear-Siegler, Kaypro, Osborne and Televideo are also
- trademarked.
-
-
-
-
-
-
-
-
-
- Table of Contents
-
-
- 22NICE IN BRIEF..............................................1
-
- QUICK INSTALLATION AND OPERATION OF 22NICE...................1
-
- ABOUT THE 22NICE CP/M EMULATOR...............................2
-
- HOW 22NICE WORKS.............................................3
-
- COMMAND SYNTAX CONVENTIONS...................................4
-
- INSTALLING 22NICE............................................5
-
- INSTALLATION AS A DEVICE DRIVER..............................6
-
- INSTALLATION AS A TERMINATE-AND-STAY-RESIDENT PROGRAM........7
-
- INSTALLATION AS A LOAD-ON-DEMAND PROGRAM.....................7
-
- THE GENCOM UTILITY - GENERATE A PRE-LOADER...................8
-
- LOCATING CP/M PROGRAM FILES.................................12
-
- A SAMPLE 22NICE INSTALLATION................................13
-
- USE OF CP/M SUBMIT AND XSUB.................................15
-
- USER NUMBER SUPPORT.........................................15
-
- SAVING MEMORY IMAGES - THE CSAVE COMMAND....................16
-
- MISCELLANEOUS TOPICS........................................17
- Accessing I/O Ports........................................17
- Accessing PC Memory........................................17
- IOBYTE Support.............................................17
- Physical Disk Addressing...................................18
- Maximum Program Size.......................................18
- Disk Drive Reassignment....................................18
-
- IN CLOSING..................................................19
-
- The Sydex Product Line......................................20
-
-
-
-
-
-
-
-
- 22NICE IN BRIEF
-
- 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.
-
- * 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 and LSI ADM-3X.
-
- * Supports CP/M user number to DOS subdirectory transla-
- tion.
-
- * Allows use of DOS "pipes" and utilities with CP/M
- programs.
-
- * Supports a complete set of BDOS and BIOS function in-
- terfaces, including direct disk read/write.
-
- * CP/M programs are fully integrated into the DOS en-
- vironment; the user is unaware that a program is CP/M-
- or DOS-based.
-
- All this for a nominal registration fee! You'd easily pay over a
- hundred dollars for a commercial package with far fewer
- capabilities. In addition, we include the 22DISK CP/M-to-DOS
- conversion package with every 22NICE registration.
-
-
- QUICK INSTALLATION AND OPERATION OF 22NICE
-
- To use 22NICE to provide a CP/M environment, you'll need to do
- the following:
-
- 1. Copy the CP/M program files that you want to execute
- onto a DOS disk, changing the ".COM" file extension to
- ".CPM".
-
- 2. Run the GENCOM utility on each ".CPM" file, specifying
- the console, keyboard and processor type.
-
- 3. Copy the file 22NICE.COM to a directory within your DOS
- command search path.
-
- 4. Run the CP/M program(s) as if they were normal DOS
- programs.
-
-
-
- Page 1
-
-
-
-
-
-
- Detailed information and discussion of special cases is presented
- in sections which follow.
-
-
- ABOUT THE 22NICE CP/M EMULATOR
-
- The emulation of 8080 and Z80 processors on the PC is not a
- recent development. Almost since the beginning, co-processor
- cards have been available for the PC and various efforts have
- been made to include CP/M 2.2 support in the general scheme of
- things. CP/M 2.2 on an MS-DOS machine is a tempting prospect -
- after all, MS-DOS was based on CP/M 2.2 (and not CP/M-86).
-
- In 1985, NEC introduced a pin-compatible 8088 work-alike called
- the uPD70108 or V20. The curious thing about this chip is that
- it's really two processors in one - an 8088 for PC-based ("16
- bit") software, and an 8080 for the older CP/M ("8 bit")
- software. Switching between the modes is done with special
- machine instructions. What could be a more natural product than
- a CP/M emulator running on the PC?
-
- It happened that a lot of people got this idea and offered a host
- of packages differing in appearance and function to do essen-
- tially the same thing - emulate a CP/M environment. Sydex
- developed 22NICE, but decided against marketing it for or three
- years, primarily because of the number of similar products al-
- ready being offered.
-
- The fuss has died down now. Intel is still suing NEC on charges
- of copyright infringement over the V20, but by and large, CP/M
- support is of no great interest. The V20, alas, would not emu-
- late a Z80, and it does have a few unfixed "bugs" in its emula-
- tion mode. Besides, PC-AT clones are really selling now and you
- can't drop a V20 into one of those.
-
- So Sydex has dusted off its emulator, 22NICE and put it out in
- the shareware market. 22NICE offers the following advantages
- over its competition:
-
- * 22NICE will use a V20 if it's present and do software
- emulation if it's not. This means that you can run
- your old CP/M programs on your PC-AT.
-
- * 22NICE contains an emulator for both 8080 and Z80
- processors. In addition, 22NICE has a "test" mode,
- which will allow you to identify the appropriate
- processor that you need to emulate. It will also tell
- you if your program will run afoul of one of the V20
- bugs.
-
-
-
-
- Page 2
-
-
-
-
-
-
- * 22NICE supports a user number-subdirectory mapping that
- allows your CP/M program to access DOS's directory
- structure.
-
- * 22NICE contains terminal emulation routines for a few
- common terminal types which will usually allow you to
- run a program without re-installing,
-
- * If terminal emulation isn't important, 22NICE allows
- your program to use DOS console input and output
- facilities. This means that you can use a CP/M program
- as part of a DOS "pipe".
-
- * And finally, 22NICE fits CP/M into the DOS environment
- - CP/M programs use the DOS facilities and are not dis-
- tinguishable from other DOS programs. This means no
- special CP/M-like command interpreter is needed.
-
- Together with the diskette data conversion programs, support of
- CP/M 2.2 applications on a PC can really be painless.
-
-
- HOW 22NICE WORKS
-
- There are several ways to implement a CP/M-like operating en-
- vironment on a PC-class computer:
-
- (1) Emulate an 8080 or Z80-based computer system and run
- CP/M 2.2 more or less "straight out of the box". This
- approach leads to difficulties in making use of DOS
- data files and system functions. It also requires that
- you "shift gears" mentally each time you make the tran-
- sition from CP/M to DOS and vice-versa.
-
- (2) Emulate the CP/M operating environment and provide 8080
- and Z80 emulation. This might take care of some of the
- DOS data interchange problems, but "crossing over" to
- DOS is difficult and few of the benefits and resource
- of DOS are available to CP/M users.
-
- (3) Support the CP/M I/O interface and provide 8080/Z80
- emulation, but leave DOS in control as the host operat-
- ing system. This involves the greatest effort and re-
- quires an intimate knowledge of CP/M 2.2 and MS-DOS in-
- ternals to really work properly. However, all DOS
- facilities are at your disposal and "mixing" of CP/M
- and DOS applications happens naturally. This is the
- approach taken in 22NICE.
-
-
-
-
-
- Page 3
-
-
-
-
-
-
- 22NICE puts the bulk of the emulation in a DOS installable device
- driver package called 22RES.SYS or the resident emulation program
- 22NICE.COM. 22RES and 22NICE not only contain support for CP/M
- functions, but also provide software emulators for both the 8080
- and the Z80 instruction sets.
-
- CP/M programs are loaded by having DOS first execute a "pre-
- loader", which provides information to 22NICE about the program
- to be executed. 22NICE then allocates the necessary memory,
- loads the CP/M program code, and begins emulation.
-
- A CP/M executable file normally has a file name extension of
- "COM". This creates problems, however, with existing DOS
- programs having the same extension. DOS does no checking on the
- contents of "COM" files -- executing a CP/M file in DOS 8088 mode
- could lead to disaster.
-
- 22NICE handles this by renaming all CP/M executable files with a
- "CPM" file name extension. CP/M programs, therefore, are not
- directly executable by DOS. The "pre-loader" for each CP/M
- program carries the "COM" name extension and the name of the CP/M
- program to which it is related. The pre-loader is short -- about
- 400 bytes, but one is needed for each CP/M executable file. This
- can get to be a nuisance if you're not running with a fixed disk,
- so we've also provided a "bound" program form, where the CP/M
- program is combined with the pre-loader in a single program file.
-
- This "pre-loader" concept is very powerful -- it allows different
- programs to execute with different operating parameters.
- MicroPro's WordStar, for example, best runs in a mode where the
- numeric keypad is re-mapped to provide WordStar cursor movement
- codes. CP/M system utilities, however, best run with no terminal
- emulation, allowing console input and output to be redirected if
- desired. One program may require Z80 software emulation, where
- another might not.
-
- 22NICE has been in use within Sydex for some time - currently we
- have it running in AT's and XT's and on at least one CompuPro
- 8086 machine in modified form.
-
-
- COMMAND SYNTAX CONVENTIONS
-
- In order to discuss the general form of various 22NICE commands,
- a number of conventions have been adopted in this document:
-
- (1) All commands are assumed to be followed by depression
- of the ENTER key. Sometimes this key is referred to as
- RETURN or CARRIAGE RETURN.
-
- (2) All upper-case (capital) letters are entered exactly as
- shown in the command description. For instance,
-
- Page 4
-
-
-
-
-
-
-
- CFMT
-
- is entered as depressions of the "C", "F", "M" and "T"
- keys. Actual case of the entered characters is ir-
- relevant; that is, either upper- or lower-case letters
- may be entered.
-
- (3) Any item enclosed in quotes (") refers to a name of a
- particular type of item and is not to be entered
- literally. For example:
-
- "CP/M file"
-
- refers to a general CP/M file designator and NOT the
- characters "CP/M file".
-
- (4) Any item enclosed in parentheses ("(" and ")") refers
- to an item which may be omitted from the command line.
- For example:
-
- ("disk type")
-
- refers to a disk type item which may be left out com-
- pletely from the command statement.
-
- (5) Any blank character may be replaced by more than one
- blank character.
-
- These conventions will be used throughout this document with ad-
- ditional explanations where required.
-
-
- INSTALLING 22NICE
-
- The files associated with CP/M emulation are the following:
-
- 22RES.SYS the resident support driver
- 22NICE.COM an alternate support program
- RMVNICE remove 22NICE from memory
- CUSER.EXE user number information utility.
- GENCOM.COM generate a DOS *.COM file.
- CSAVE.COM SAVE command a la CP/M SAVE
-
- Before you install 22NICE on your system, you'll need to make a
- decision about the resident support program. This program can be
- employed in any of three modes:
-
- 1. As an installable device driver. The file 22RES.SYS is
- installed as a device driver as described below. This
- mode has the advantage that installation of the resi-
- dent is "automatic" and downward-compatible with ear-
-
- Page 5
-
-
-
-
-
-
- lier versions of 22NICE, but has the disadvantage that
- approximately 20K of memory is unavailable for any
- other use.
-
- 2. As a terminate and stay resident (TSR) program. If the
- file 22NICE.COM is executed as a DOS command, the resi-
- dent will install itself in a manner similar to that of
- the device driver 22RES, above. However, this proce-
- dure has the advantage that 22NICE may be removed from
- memory using the RMVNICE command, freeing up the 20K or
- so used by the resident.
-
- 3. As a load-on-demand program. If you have a hard disk,
- this option is probably the most convenient. With this
- mode, 22NICE is loaded when needed for execution of a
- CP/M program and "unloaded" or removed from memory when
- execution of a CP/M program terminates. This mode re-
- quires no additional memory for operation of 22NICE but
- incurs the expense of a slight amount of "startup"
- overhead.
-
- The following sections describe installation of 22NICE for the
- various modes.
-
-
- INSTALLATION AS A DEVICE DRIVER
-
- To install 22NICE as a device driver, you'll need to insert a
- line in your CONFIG.SYS file on your boot drive. The line should
- read as follows:
-
- DEVICE=22RES.SYS
-
- A statement to insert the required text into CONFIG.SYS is:
-
- ECHO DEVICE=22RES.SYS >X
- COPY /A \CONFIG.SYS+X CONFIG.SYS
- DEL X
-
- You may also use any ASCII text editor, such as EDLIN, to ac-
- complish the same thing.
-
- Make sure that 22RES.SYS gets placed in the root directory on
- your boot disk so DOS can access it. You can also put it in
- another directory and include the path specification with the
- file name on the DEVICE= line. For example,
- The file 22NICE.COM is used to provide emulation facilities
-
- DEVICE=\CPM22\22RES.SYS
-
-
-
-
- Page 6
-
-
-
-
-
-
- 22RES needs two hardware interrupt vector slots to function. If
- you don't specify which interrupt to use, 22RES starts looking
- for an available one beginning with interrupt 128. If you need
- to specify the interrupts to be used, the CONFIG.SYS line should
- look like this -
-
- DEVICE=22RES.SYS ("i1") ("i2")
-
- where "i1" and "i2" are interrupt ordinals expressed as decimal
- numbers. If just "i1" is specified, interrupt vectors "i1" and
- the one immediately following ("i1"+1) will be used. An example
- of valid CONFIG.SYS lines for 22RES are:
-
- DEVICE=22RES.SYS
- DEVICE=22RES.SYS 128 143
-
- At this point, it is 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 22NICE conversion utilities do this automatically,
- but if you've used some other means to obtain your files, you'll
- need to rename them manually.
-
-
- INSTALLATION AS A TERMINATE-AND-STAY-RESIDENT PROGRAM
-
- To install 22NICE as a terminate-and-stay-resident program or
- TSR, the file 22NICE.COM is executed as a DOS command. The for-
- mat of the invocation is:
-
- 22NICE ("i1") ("i2")
-
- Where i1 and i2 are optional interrupt numbers as described in
- the preceding section. 22NICE will remain resident in memory un-
- til removed explicitly with the RMVNICE command or until a system
- re-boot. Examples of valid 22NICE commands are:
-
- 22NICE
- 22NICE 134 144
-
- RMVNICE may be used to remove 22NICE by executing the following
- DOS command:
-
- RMVNICE
-
- INSTALLATION AS A LOAD-ON-DEMAND PROGRAM
-
- This is perhaps the simplest way of using 22NICE. Copy the file
- 22NICE.COM into a directory which lies in the command search path
- for your installation. For details on specifying the command
-
-
-
- Page 7
-
-
-
-
-
-
- search path, consult the DOS reference manual on the PATH inter-
- nal command. Run GENCOM for each of the CP/M programs that you
- wish to execute, as described in the next section.
-
- Unlike the two installation modes described above, no interrupt
- ordinals may be specified; 22NICE will search for and use the
- first two that are available. Neither may the SAVE command be
- used in this mode.
-
-
- THE GENCOM UTILITY - GENERATE A PRE-LOADER
-
- At this point, it is 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 conversion utilities do this automatically,
- but if you've used some other means to obtain your files, you'll
- need to rename them manually. Consult the RENAME internal com-
- mand discussion in your DOS reference manual for details.
-
- The GENCOM utility is used to create "COM" files which can be
- loaded and executed by DOS. These files interface to the 22RES
- driver and serve as pre-loaders for execution of the associated
- CP/M program ("CPM"-type) files.
-
- GENCOM produces a very short (about 500 bytes) DOS program file
- which, when executed, performs the following actions:
-
- (1) Determines if the 22NICE resident has been loaded. If
- the resident cannot be located in memory, a copy is
- automatically loaded.
-
- (2) Passes an information packet concerning the operating
- environment for the CP/M file and the name of the file
- to be executed in emulation mode.
-
- (3) Relinquishes control to the 22NICE resident for actual
- CP/M program loading and execution.
-
- Note that a "COM"-type file produced by GENCOM serves both as an
- interface between DOS and the resident and also as a container
- for information concerning the CP/M program environment needed.
-
- The syntax of the GENCOM command is as follows:
-
- GENCOM "file" (DISPLAY="dtype") (KEYBOARD="ktype")
- (PROCESSOR="ptype") (BIND="filename")
-
-
-
-
-
-
- Page 8
-
-
-
-
-
-
- "file" is the name of the CP/M program file to be executed,
- and is specified without a file extension. A "wildcard"
- file specification may be used here; GENCOM will
- produce ".COM" files for all CP/M files matching the
- specificaton.
-
- DISPLAY="dtype" is optional and specifies the type of con-
- sole display to be emulated. Any of the following may
- be specified for "dtype":
-
- NONE - Use DOS for output. No special handling of
- characters is performed unless the ANSI.SYS device
- driver has been specified in the DOS CONFIG.SYS
- file. 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
- specified.
-
- TVI - Emulate a Televideo 925/950 series terminal.
-
- ADM - Emulate a Lear-Siegler ADM-3/ADM-31 type ter-
- minal.
-
- OSBORNE - Emulate the display on an Osborne I/II/Nuevo
- computer.
-
- KAYPRO - Emulate the display on a Kaypro I/II computer.
-
- ANSI - Emulate an ANSI (DEC VT-100) display.
-
- VT52 - Emulate a DEC VT-52 display.
-
- H19 - Emulate a Heath/Zenith H19/Z19 or H89/Z89 dis-
- play.
-
- DISPLAY may be abbreviated to DIS.
-
- KEYMAP="ktype" is optional and specifies the map for the
- console keyboard. Any of the following may be
- specified for "ktype":
-
- NONE - Use 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 or file, NONE must be specified.
-
- TVI920 - Emulate a Televideo 920/925 series terminal
- keyboard.
-
- ADM - Emulate a Lear-Siegler ADM-3/ADM-31 type terminal
- keyboard.
-
- Page 9
-
-
-
-
-
-
-
- OSBORNE - Emulate the display on an Osborne I/II/Nuevo
- computer keyboard.
-
- WS - causes the keypad keys to generate codes suitable
- for MicroPro WordStar.
-
- KAYPRO - Emulate the keyboard on a Kaypro I/II com-
- puter.
-
- ANSI - Emulate the keys on an ANSI (DEC VT-100) ter-
- minal.
-
- VT52 - Emulate the keyboard on a DEC VT-52 terminal.
-
- H19 - Emulate the Heath/Zenith H19/Z19/H89/Z89
- keyboard.
-
- 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":
-
- V20 - Indicates that 22RES should use the hardware
- emulation 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 be automatically used. V20
- is the default if the PROCESSOR expression is
- omitted.
-
- E8080 - specifies that 22RES should use an 8080
- software emulation, even if a V20 or V30 is
- present. E8080 is primarily used when the TEST
- mode indicates that there will be problems using
- the V20 or V30 hardware emulation facility.
-
- Z80 - specifies that 22RES should use a Z80 software
- emulation. Note that the NEC V20 and V30 do not
- support the extended instruction set of the Z80
- processor.
-
- TEST - specifies that 22RES should implement a Z80 in-
- struction set and observe the execution of the
- current program. At the conclusion of program ex-
- ecution, 22RES will report on the following:
-
- * Use of Z80-only instruction codes. If
- present, PROCESSOR=Z80 should be used.
-
-
-
- Page 10
-
-
-
-
-
-
- * Use of I/O instructions. If these are
- present, the program should be examined and
- the instructions modified or eliminated so
- as 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 mode should
- be selected.
-
- * Presence of "illegal" Z80 instructions. Some
- instruction codes not documented by Zilog
- will execute on a "real" Z80; if a program
- contains this type of code, a warning message
- will be displayed, showing the location of
- the instruction and its value.
-
- 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-class machines, the
- software emulation modes compare favorably with a
- PC-XT class machine using a V20 processor.
- PROCESSOR may be abbreviated as PRO.
-
- BIND="filename" is an optional parameter to produce a
- "unitized" *.COM using the contents of "filename"
- as the image of the CP/M object. In this case, a
- ".COM" file will be produced that includes the
- pre-loader and the CP/M program file. Observe
- that since the BIND option generates a file con-
- taining the CP/M object code, you must re-GENCOM
- this file each time the CP/M object is changed.
-
-
- Here are some examples of the GENCOM command:
-
- GENCOM DDT
-
- Builds a file, DDT.COM, containing the pre-loader only. If a V20
- is present, its emulation capabilities will be used. Otherwise,
- 8080 software emulation will be performed. Standard DOS input
- and output will be performed.
-
- GENCOM WS KEY=WS DIS=ANSI
-
-
-
-
-
-
- Page 11
-
-
-
-
-
-
- Builds a file, WS.COM, containing the pre-loader only. If a V20
- is present, its emulation facility will be used. Otherwise 8080
- software emulation will be performed. A special WordStar
- keyboard mapping will be used; console output will emulate a
- standard ANSI terminal.
-
- GENCOM ZSID PRO=Z80 BIND=ZSID.CPM
-
- Builds a file, ZSID.COM, containing the pre-loader and the
- program file ZSID.CPM. Z80 software emulation will be performed
- and standard DOS input and output will be used.
-
- GENCOM MYPROG PRO=TEST
-
- Builds a file, MYPROG.COM, containing the pre-loader only. Z80
- software emulation will be performed and a note will be made 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.
-
-
- LOCATING CP/M PROGRAM FILES
-
- It has been mentioned that GENCOM generates a "pre-loader" for a
- CP/M program in order to interface to 22RES. 22RES, however,
- needs to know where to find the program file itself. 22RES lo-
- cates program files the following way:
-
- (1) If the environment variable CPMPATH is defined, 22RES
- will search the drives and directories given by it.
- The syntax for describing a search path with CPMPATH is
- identical to that used for PATH; namely, a list of
- directories or drive names, separated by semicolons.
-
- (2) In the absence of any other indication, 22RES searches
- for a program according to the PATH environment vari-
- able specification. That is, 22RES will look for a
- program in the same places and in the same order as the
- DOS command processor.
-
- (3) If neither a search of PATH nor CPMPATH results in the
- requested file being found, the current directory is
- searched for the file.
-
- 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 22RES by means of the following DOS statement:
-
-
- Page 12
-
-
-
-
-
-
- SET CPMPATH=\USR\CPM22
-
- Observe that, since DOS is responsible for loading the "COM"
- pre-loader files, only the PATH environment variable has any ef-
- fect on the main DOS search path. In other words, CPMPATH only
- has relevance when "CPM" program files are involved.
-
-
- A SAMPLE 22NICE INSTALLATION
-
- Suppose you'd like to run some of the programs from your Osborne
- I on your PC-XT clone. You haven't installed a V20 chip in place
- of the 8088 processor yet, but you're considering it. You al-
- ready have the 22NICE files downloaded from your local BBS.
- Let's look at what's needed to get your system going with 22NICE.
-
-
- 1. COPY 22NICE.COM INTO A COMMAND DIRECTORY. Assume that
- 22NICE.COM is present on diskette drive A: and that
- your hard disk AUTOEXEC.BAT file has the following
- statement:
-
- PATH=.;C:\DOS;C:\PROGS
-
- The file 22NICE.COM can be copied into C:\PROGS thus:
-
- COPY A:22NICE.COM C:\PROGS
-
-
- 2. DETERMINE WHERE CP/M PROGRAM FILES WILL BE KEPT. As
- mentioned earlier, any CP/M ".COM" program files need
- to have the extension part of their file names changed
- to ".CPM". Also note that 22RES will need to know
- where these files are located. On your fixed disk,
- you've decided to keep them in a directory called
- "CPM22", so you need to add the following line to our
- AUTOEXEC.BAT file:
-
- SET CPMPATH=C:\CPM22
-
- to inform 22RES where to find the CP/M program files.
- You will also make the appropriate directory with the
- following DOS command:
-
- MKDIR C:\CPM22
-
- 3. COPY THE CP/M FILES TO DOS. Suppose that you'd like to
- run two programs from our Osborne:
-
-
-
-
-
- Page 13
-
-
-
-
-
-
- PWP.COM, a proprietary word processing package. This
- requires Televideo 920-type console display
- capabilities. You'd also like the keypad to func-
- tion in WordStar mode. You don't require the Z80
- instruction set, however.
-
- MLP.COM, a mailing list program. This requires no spe-
- cial console I/O, but does make use of the Z80 in-
- struction set.
-
- You can copy PWP from your Osborne diskette in the PC's
- A: drive with the following 22DISK CTOD command:
-
- CTOD A:PWP.COM C:\CPM22
-
- Or, if you already have PWP.COM in the CPM22 directory,
- you need to rename it to have a "CPM" extension:
-
- REN PWP.COM PWP.CPM
-
- In the same manner, MLP can be copied from the same
- diskette with this command:
-
- CTOD A:MLP.COM C:\CPM22
-
- After the copying or renaming is finished, you check
- the CPM22 directory and find that two files, PWP.CPM
- and MLP.CPM have been placed there by CTOD.
-
- 4. RUN GENCOM FOR THE PROGRAM FILES. You need to generate
- two pre-loader files which contain information for
- 22RES concerning our programs. You use GENCOM to gen-
- erate the files:
-
- GENCOM PWP DIS=TVI920 KEY=WS
- GENCOM MLP PRO=Z80
-
- After running GENCOM, you discover that two short
- (about 500 bytes) files have been created: PWP.COM and
- MLP.COM. These are the files that DOS will execute
- when you call for PWP or MLP.
-
- 5. COPY ANY NEEDED DATA FILES.
-
- If you require any data files, you can use CTOD to copy
- them also. For example, suppose a customer address
- file for your mailing list program is needed. You copy
- it using CTOD:
-
- CTOD A:CUSTLIST.DAT
-
-
-
- Page 14
-
-
-
-
-
-
-
- 6. RUN THE PROGRAMS. To run PWP, just type
-
- PWP
-
- the same way you'd have entered it on your Osborne.
- After this, PWP and MLP will behave as ordinary DOS
- programs. You may re-specify the operating parameters
- of PWP by running GENCOM again.
-
- Remember that the DOS file PWP.COM contains the name of
- the CP/M file PWP.CPM. If you rename PWP.COM, it will
- still cause PWP.CPM to be executed.
-
-
- USE OF CP/M SUBMIT AND XSUB
-
- If you have "batch" files which operated with CP/M 2.2's SUBMIT
- facility, you'll need to alter them to use DOS's batch file
- capability. Usually this will entail no more than the following:
-
- 1. Change the file name extension from "SUB" to "BAT".
- This is done with the DOS RENAME command.
-
- 2. Edit the 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,
- just use "filename" as a command.
-
- 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 <x
- DELETE X
-
- Of course this is only one possibility; you may wish to make use
- of the "pipe" facility of DOS, if the input to your program comes
- from another program.
-
- Page 15
-
-
-
-
-
-
-
-
- USER NUMBER SUPPORT
-
- You may specify that CP/M user numbers used by some programs be
- converted to DOS subdirectory references. This is done by set-
- ting an environment variable of the form USERx to the directory
- name to be used for that user number.
-
- For example, suppose that all user number 13 references are to be
- converted to reference the directory C:\COMPANY3. The following
- DOS command would accomplish this:
-
- SET USER13=C:\COMPANY3
-
- You can get a map of user number-directory correspondence by ex-
- ecuting the CUSERS command. The following is sample output from
- CUSERS:
-
- CUSER Copyright 1988, Sydex. All rights reserved.
-
- User 1 = \CPMFILE1
- User 2 = A:\
- User 3 = \DATA\DB
-
- Search path: C:\CPMFILES, then
- .;C:\SYS;C:\USR;C:\BIN
-
- Note that CUSER also displays the search path used by 22RES.
-
- A command corresponding to the USER command of CP/M is not
- provided in 22NICE - the DOS CHDIR command accomplishes the same
- purpose. If a USER command is required, consider the following
- DOS batch file:
-
- REM USER COMMAND
- IF %1==1 CHDIR %USER1%
- IF %1==2 CHDIR %USER2%
- IF %1==3 CHDIR %USER3%
- ...and so on...
-
- which works for DOS 3.1 and later.
-
- Observe that User 0 is always the current directory. A defini-
- tion of the environment variable USER0 will be ignored by 22NICE.
-
-
-
-
-
-
-
-
- Page 16
-
-
-
-
-
-
-
- SAVING MEMORY IMAGES - THE CSAVE COMMAND
-
- DOS provides more-than-adequate substitutes for most CP/M resi-
- dent commands, with the exception of SAVE. 22NICE provides a
- command, CSAVE, with the same syntax and operation as CP/M SAVE:
-
- CSAVE "count" "filename"
-
- As in CP/M, "count" is the number of 256-byte blocks to be writ-
- ten to "filename". Observe that CSAVE will also change the file
- extension to "CPM" when one of "COM" is specified. The CSAVE
- command may not be used with the "load on demand" form of the
- 22NICE resident (See the section on installation).
-
-
- MISCELLANEOUS TOPICS
-
- This section deals with some of the more specialized features of
- 22NICE and reflects Sydex's own experience with using 22NICE.
-
-
- Accessing I/O Ports
-
- 22NICE supports access to 8-bit I/O port numbers via the
- 8080 IN and OUT instructions. Occasionally it may be neces-
- sary to access a PC I/O port greater than 255. This can be
- done by means of the 8080 "RST 3" instructions.
-
- To read a byte from an I/O port, code the following -
-
- LXI D,port number
- RST 3
-
- The contents of the I/O port will be returned in the 8080's
- A register.
-
- To write a byte to an I/O port, code the following -
-
- LXI D,port number
- RST 4
-
- The contents of the 8080 A register will be written to the
- specified port.
-
-
- Accessing PC Memory
-
- During emulation, a program's memory access is limited to
- the 64K addressing range of the 8080. Should it become
- necessary to inspect the contents of a memory location out-
- side of this range, the following "RST 5" call can be used:
-
- Page 17
-
-
-
-
-
-
-
- LXI D,segment
- LXI H,offset
- RST 5
-
- The contents of the memory location at the specified segment
- and offset will be returned in the 8080 A register.
-
-
- IOBYTE Support
-
- The CP/M 2.2 IOBYTE mappings are supported by 22NICE for the
- console, printer, punch and reader as described in the "CP/M
- 2.2 System Alteration Guide". All other mappings will
- result in a null device access; i.e., data output will be
- discarded, input will result in an end-of-file, and input
- status will always be "data unavailable".
-
- The CP/M punch and reader devices are taken to be the DOS
- auxiliary device. Usually, this is a serial communications
- port, or in absence of a serial port, the null device.
-
-
- Physical Disk Addressing
-
- 22NICE contains an interface to disk read and write routines
- present in DOS. When a CP/M program requests a DPB (Disk
- Parameter Block) from 22NICE (BDOS function 31), one is sup-
- plied which defines a 36-sector track with the allocation
- block size and number of tracks varying according to the
- capacity of the disk being serviced. Note that DOS can
- describe drives much smaller (less than 1K) and much larger
- (32,000 K) than CP/M; 22RES attempts to build a DPB which
- best defines the disk in question.
-
- Utilities that directly write to a disk without making use
- of BDOS calls should be avoided, as the DOS structure for a
- disk is quite different from that assumed by CP/M.
-
- 22NICE attempts to emulate the disk interface of CP/M.
- However, because of differences in implementation, disk
- sizes reported by STAT and similar programs should be con-
- sidered to be approximations only.
-
-
- Maximum Program Size
-
- 22NICE has a very small BIOS area and only 6 bytes of BDOS
- with no CCP. This means that a CP/M program has about 60K
- of program memory available for use - as much as any
- "native" CP/M system.
-
-
- Page 18
-
-
-
-
-
-
-
- Disk Drive Reassignment
-
- A number of older CP/M 2.2 programs have diskette drive
- selections "hard-wired" into them. This can be an incon-
- venience, particularly if you use a hard disk system. Use
- of the DOS ASSIGN command will allow you to re-map the drive
- accesses made by CP/M programs.
-
-
- IN CLOSING
-
- Thank you for taking the time to consider Sydex. We hope that
- 22NICE does its job well and that it meets your needs. This
- product represents several months of work and research; if you
- have any suggestions on how it might be improved, please let us
- know.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 19
-
-
-
-
-
-
- The Sydex Product Line
-
- AnaDisk -- The compleat diskette utility. Nothing like it
- anywhere 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.
- Features "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 sup-
- porting 8" and 5.25" single-density diskettes. Contains
- definitions for over 200 different formats. $25.00 ($100.00
- site) registration fee.
-
- 22NICE -- A CP/M 2.2 emulation package. Supports the NEC
- V-series chips or performs emulation by software for both
- the 8080 and Z80 processors. Includes terminal emulation
- and diskette handling for common CP/M systems. Includes
- 22DISK. $40.00 ($150.00 site) registration fee.
-
- TeleDisk -- Turn any diskette into a compressed data file
- and vice-versa. Allows you to send and receive entire dis-
- kettes via modem. Even works with some "copy-protected"
- diskettes. $20.00 ($65.00 site) registration fee.
-
- COPYQM -- Mass diskette duplicator. Format, copy and verify
- multiple diskettes from a single master. Implements "no
- keyboard" interaction mode and drive "round robin" servic-
- ing. Supports all standard DOS formats. $15.00 ($50.00
- site) registration fee.
-
- FORMATQM -- Mass diskette formatter - format a box of dis-
- kettes at a single sitting. Implements "no keyboard" inter-
- action mode and drive "round robin" servicing. Supports all
- standard DOS formats. $10.00 ($40.00 site) registration
- fee.
-
- ...And, soon to be released:
-
- InterDisk - The universal Diskette Interchange utility.
- Features user-programmable media conversion for those for-
- mats not covered by 22DISK. Available 1Q90.
-
- Information on any of these products can be obtained from Sydex
- by calling (408) 739-4866 (voice) or by leaving a request on our
- Bulletin Board System (408) 738-2860 (1200-9600 bps, N81).
-
-
-
-
- Page 20
-