<<

Upward Migration Part 2: A Comparison of CP/M-86 and MS-DOS An end user and a systems programmer examine the two operating systems vying for dominance in the idbit arena.

Roger Taylor and Phil Lemmons /o BYTE Publications Inc. POB 372 Hancock, NH 03449

Last month, we looked at programs as applications programs for both level languages like BASIC and that translate &bit CP/M-80 CP/M46 and MS-DOS; and one was Pascal. For these users, comparing to 16-bit MS-DOS or CP/M-86 soft- written by the head of a company 's CP/M-86 and ware. In this part, we look at what that manufactures 8086-based S-100 's MS-DOS (sold by IBM as the translated software will when systems and processor boards. PC-DOS and by it reaches the new world of MS-DOS If any pattern of opinion seems to as SB-86) is a study in trade-offs. We and CP/M-86. We first examine the be emerging, it is that MS-DOS is a will first examine some of the trade- two operating systems from a non- better and faster single-user, single- offs in the current versions of MS- technical user's perspective and then tasking for nontech- DOS and CP/M-86. Then, we will turn to a close technical look at how nical users (consumers). CP/M46 of- describe what additional trade-offs they make functions available fers superior ; may appear in the enhanced versions to programmers. Along the way, we development into a multitasking, promised for later this year. will report the results of some bench- single-user operating system; and an marks. easier upgrade to a multi-user Speed and Space We have also invited other in- operating system. The issues, how- The most obvious general advan- dividuals to express their opinions ever, are complex, and many dissent- tages of MS-DOS are its greater speed about MS-DOS and CP/M-86. These ing voices are heard. To complicate in disk input/output, greater efficien- opinions appear in text boxes accom- matters further, vendors of both cy in use of disk space, and its ability panying this article and represent a operating systems are promising to from errors. variety of perspectives. One expresses major changes this year. You will MS-DOS is faster primarily be- the view of a systems integrator; one have to make the decision in light of cause it buffers data in each states the view of an assembly-lan- your exact needs in an operating gulp and because it keeps the File Al- guage programmer at a large applica- system. location Table in memory rather than tions and languages software house; on disk. CP/M-86 keeps information one comes from an applications pro- The Nontechnical about file locations stored on the grammer working in high-level lan- User's Perspective disk, and buffers data in small guages; one comes from a software Most users spend mouthfuls. Tables 1, 2, and 3 give house that produced a BIOS (basic in- their running off-the-shelf ap- some timings of MS-DOS and put/output system) for CP/M-86 on plications programs and, to a lesser CP/M-86 on the same hardware. It the IBM Personal , as well degree, writing programs in high- should be noted, however, that the

330 July 1982 O.BME Publications lnc tual data in the file is only a few System X System X System X bytes-like letting a mouse sleep in a CPIM-86 1.0 CPIM-86 1.0 Preliminary MS-DOS Benchmark BASIC-86 Rev. 5.21 BASIC-86 Rev. 5.22 BASIC-86 Rev. 5.21 separate queen-size bed. With larger data files, of course, CP/M-86's Empty do-loop 7.2 7.3 7.8 methods of allocation are less waste- Division 25.0 20.6 21.8 Subroutine jump 15.5 15.4 16.9 ful. But if your system's disk space is MID$ (substring) 23.6 23.6 24.6 limited, wasting 2K bytes to store a Prime number few bytes can be important. program 199.2 189.9 197.0 Disk write program Error recovery in an operating - (64K-byte file) 60.8 60.8 50.3 tem functions like the shoulder on a Disk read program mountain road: in its absence, one (64K-byte file) 20.6 20.3 21.3 wrong can plunge you into the Table 1: Timings of benchmark programs run in Microsoft BASIC-86 under abyss. Error recovery is especially CP/M-86 and MS-DOS. The three sets of timings differon the computational bench- crucial to new and nontechnical com- marks (the first five) because the themselves are different. BASIC-86 comes puter users. MS-DOS provides error in two different versions for CP/M-86, as well as a version for MS-DOS. MS-DOS's recovery as part of the disk operating superior speed in the disk-write benchmark is remarkable because the version run system; as for CP/M-86, there is no was a preliminary version that had not yet been optimized for disk input/output on provision for error recovery in the system X. , although there is nothing to stop a hardware manu- L facturer from writing error recovery into its own BIOS for CP/M-86. System X System X Manufacturers don't always do so. CPIM-86 1.0 Preliminary MS-DOS With CP/M-56 (unless the manu- Load BASIC-86 facturer does add error recovery), if 30K bytes 5.7 2.7 you try to read a disk in an empty drive, or forget to turn on the Table 2: Timings for loading BASIC-86 under CP/M46 and MS-DOS. Again, note before trying to a file, the that this preliminary version of MS-DOS had not yet been optimized for disk in- put/output on system X. system either "hangs" (no message at all) or presents a farewell message ex- plaining why the system is shutting I down. This is about as useful as hav- ing a note pinned to your chest to in- IBM-PC IBM-PC Compuview CPIM-86 MS-DOS 1.1 you that you are dead. If you're PIP trying to save new data on disk, the data is lost. If the problem is a bad File copy: Copy three files 36.9 19.3 13K, 13K, 6K sector on the disk, you can't swap Load 30K file using VEDlT 10.1 18.8 disks and try again. You have to reload the operating system and do Table 3: Timings for file-copying and file-loading under CP/M-86 and MS-DOS on again whatever work was wasted. the IBM . MS-DOS's COPY command is faster, partly because it MS-DOS responds to errors by offer- resides in system memory rather than on disk, and despite the fact that the BIOS in the Compuview CP/M-86 seems quite fast. The speed of the Cornpuview BIOS is ing you a chance to salvage the situa- reflected in the time required to load Compuview's editing program VEDIT with a tion. A typical message is: 30K-byte text file. The CP/M46 version of VEDIT is actually faster than the MS- DOS version. (BASIC-86 is unavailable for use with CP/M-86 on the IBM Personal Data error reading drive B Computer.) Abort, Retry, Ignore?

If the problem is a bad disk, you can differences in speed are proportional- DOS or CP/M-86 is so fast that any insert a new disk in B and retry. If the ly less on large operations because differences are negligible. The fact re- printer is off, you can turn it on and CP/M46 has to find a file only once, mains that MS-DOS is significantly retry. You can also abort the opera- at the beginning. Different versions of faster on floppydisk-based systems, tion and start over without reloading CP/M-86 also vary greatly in speed. as the benchmarks in table 1 show. the operating system. Hardware manufacturers write a MS-DOS uses disk space more effi- CP/M-86 BIOS for their own sys- ciently because it can have files rang- tems, which vary in performance. ing in size from tiny to huge. CP/M-86 comes with a large HELP Finally, on systems using hard disks, CP/M-86 allocates disk space in file. Whenever you are puzzled about disk input/output under either MS- blocks of 2K bytes even when the ac- what to do, if you HELP and the

332 July 1982 O BYE Publications Inc r, % -. -, . >-. .~ ' . .:-.--. . ' , ' -. :...... '. . :. .,...... '. ' : : , ~a~~~~i:Caveats :,. . ' ...... ,'~i~h

[Mr. Wilson is & tq

. .ture. On the ofher hand, the 'CHAM storage allocation) space. Howeoer; . in supporting the software author, but . statem* lets you hEPnAIelarger pro- like EMSIC'S DEF SEG, .the ADS data key. pieces are missing: overlays and, gram+ so that the limitatio~.on pro- - tyBe allows you to - dress any. . 'most important, comprehensive tech-

gram size & not 9eyYprle... ,. - ...... memo@ {a~atiotl,.&en . outside.-$he nit$ dqenSati~n.AbWfieme usqs But BASIC- is not h hgtaage fur ,, &k-&te -'.data.segment. But om&-. . are .prm,@ed :wEth. : ~Ogfa~.logic writing carnplex. programs, both . . again, S(QU have to do your own ;~wh,[email protected]~mqntafion. . . because of,&~jrxefJic&ricya@ urn- stoytap. &~bl$ah~ngyithi~ tki. . . +a Why *no$P&sdnal .':Go@@ter users bersomeness. BASIC is intended as a segnients. too?".' name of a command, CP/M-86 will learn by doing. It can therefore be ating system resident in the provide instructions for the com- argued that the Microsoft operating computer's memory. You can also use mand. If you can set aside 22K bytes system doesn't need . But CP/M-86's DDT-86 (dynamic - of disk space for the HELP file, both error recovery and online HELP ging tool) to change device assign- CP/M-86 is much friendlier than are necessary if a system is to be real- ments lastingly in the operating sys- CP/M-80 used to be. Moreover, the ly friendly. tem on the disk. This changes CP/M's new CP/M-86 user's guides are much famous IOBYTE-the byte in which better than their predecessors. These the operating system keeps device include a CP/M46 Operating System Reconfiguration assignments. Neither of these ways of User's Guide, CP/M-86 Operating This is where CP/M-86 shines and changing device assignments is clear System Programmer's Guide, and MS-DOS emphatically does not. to novices, but you can often get CP/M-86 Operating System System CP/M-86's STAT program provides computer dealers to change IOBYTE Guide. The user's guide and the HELP a way to change device assignments. for you or give you written instruc- command make learning CP/M46 a If, for example, you want to use a tions for making the necessary less forbidding challenge for novices. serial printer as the LST (list) device changes. MS-DOS's provision for error re- or printer in your system, you can use If you have an MS-DOS system covery makes it safe for novices to STAT to make a change in the oper- and buy some new hardware, you

334 July 1982 O BYE Publications lnc may have to be a skilled assembly- mon operations in each operating write memory), i.e., the number of language programmer to reconfigure system. bytes free. Both STAT and CHKDSK your operating system to use the reside on disk, and their speed of hardware. In this respect, MS-DOS is COPY Versus PIP operation is similar. like a Ferrari that requires a MS-DOS keeps its file COPY pro- Both MS-DOS and CP/M-86 haw mechanical engineer to change a flat gram (and its , a directory command, , residing tire. as noted earlier) resident in memory. in system memory. In CP/M-86, the Microsoft prides itself on Before actually starting to copy a file, DIR command just lists the names of MS-DOS's device-independent input/ CP/M-86 must read from the disk files. In MS-DOS, DIR tells you the output. Promotional literature for both its Peripheral Interchange Pro- exact size of each file and the date MS-DOS explains the happy result: gram (PIP) and the location of the file that it was last written to disk. The 'There is no need to rewrite programs named for copying. The result is that DIR command is fast in both systems. when a new device is added to the COPY transfers a file much faster system." The concept of device- than PIP does. The Technical independence is attractive. The User's Perspective operating system can treat devices Both Microsoft and We will now make some observa- just as if they were files. But this is Digital Research are tions about a few MS-DOS features small solace to the many IBM Per- that differ from CP/M-86. Then we sonal Computer owners who acquire moving to correct will make a close comparison of the a serial printer they would like to use. deficiencies. way the same basic operating-system The only way for people with little functions are made available to the technical knowledge to use a serial In defense of PIP, it does more than programmer under CP/M-80, printer with this computer is to write just copy files. Placing single-charac- CP/M-86, and MS-DOS. Finally, we a BASIC program that asks for a file ter switches after the PIP command will show the results of some simple specification. The file specification in causes it to do such things as benchmarks of CP/M-86, MS-DOS, the PC-DOS version of BASIC-86 can transferred data to the console (video and EM-86 running under MS-DOS, include such things as COMl (the display), filter formfeeds out of the which lets MS-DOS emulate ), the data-transmission file, check data for proper hexa- CP/M-86. rate, etc. While this adaptability in decimal , translate uppercase file specification is commendable, characters to lowercase or vice versa, DEBUG Versus DDT-86 who wants to load BASIC, run a add line numbers to the destination With one important exception, BASIC program, and enter a long file file, set page length if the file is going DEBUG is the rough equivalent of specification just to print a text file? to a printer, quit or start copying DDT-86. While DDT-86 has an As- Or to hit the IBM's PRINTSCREEN after finding a certain string of char- semble command, DEBUG does not. key only to be told that the printer acters in the file, expand tabs in the As a result, MS-DOS gives program- device is unavailable? file by adding spaces, verify that the mers no quick way to test ideas or The glaring omission of a handy file has been copied correctly, and hardware or to install patches by way for people with little technical mask the eighth bit in each byte trans- writing a small assembler program in knowledge to reconfigure MS-DOS ferred. PIP is larger because it does memory. has forced many to beg their dealers more. But most of PIP'S extra func- for software fixes or to spend hun- tions have less appeal to nontechnical Error Trapping dreds of dollars for a redundant users than to assembly-language pro- MS-DOS permits an applications parallel printer. The dealers queried grammers. For most of us, the main program to trap disk errors so as to were either supporting a single model thing is that COPY runs like light- invoke appropriate routines to keep of serial printer or, more often, none ning. the program running or to shut down at all. A call to Microsoft a few gracefully. Since CP/M-86 doesn't months ago brought the advice, CHKDSK and DIR permit such error trapping, pre- "Don't expect support for serial Versus STAT and DIR mature exits from applications pro- printers on the Personal Computer STAT, the CP/M-86 utility that grams do happen. until IBM is selling a serial printer." reports statistics about the contents There is hope, however. Microsoft and status of a disk, also lets you The FORMAT Programs president promised Per- change device assignments (as noted Under MS-DOS, you must specify sonal Computer followers at the West above). STAT will give detailed in- when you format a disk that you Coast Computer Faire that a future formation about each file on a disk. want to create a "bootable" MS-DOS version of MS-DOS will include sup- The MS-DOS program CHKDSK (for disk. You can't put a bootable system .port for serial printers. Check Disk) reports only a summary on an existing data disk. The MS- Now for comparisons of utilities of the status of a disk and the status DOS approach permits a data disk to that perform some of the most com- of system RAM (random-access read/ have more room than a bootable

336 July 1982 O BME Publications lnc in - tm.can allocate space for other '

._A-- disk, but it requires greater foresight. in the AL register and, in some cases, in memory and for the memory allo- You must make the decision to have a also in the ES register. CP/M-86's use cation to remain as it is. bootable disk at the time of format- of the ES register in this way can com- Function 1-Console Input with ting. plicate matters. The impact follows Echo: CP/M-80 and CP/M-86 ex- when CP/M-86 loads an executable pand tabs and look for the characters Access to Functions of CP/M-80, file and gives control to the applica- Control-S for scroll control and Con- CP/M-86,and MS-DOS tions program. CP/M-86 sets the four trol-P for printer copy; MS-DOS We will now discuss how the pro- segment registers, including the ES looks for Control-Break for scroll grammer can make these three oper- register, to the proper values when control. ating systems perform useful func- the program is loaded. But if the pro- Function 2-Console Output: Same tions. Some familiarity with gram makes a BDOS (basic disk oper- as for function 1. CP/M40 is assumed. ating system) call to CP/M-86, the Function 3-Reader Input: CP/M-80 To interact with the disk operating value in the ES register may be and CP/M-86 have device assignment system, the programmer must first changed. That means you have to through the IOBYTE facility if the place in the appropriate register the take care to restore the ES register to OEM (original equipment manufac- function codes listed below. The ap- the value it held when the applica- turer) chooses to implement it. MS- propriate registers are as follows: for tions program was loaded. DOS supports only one auxiliary in- CP/M-80, the C register; and for If the information to be returned by put device. CP/M-86 and MS-DOS, the CL reg- the operating system is more than one Function 4-Punch Output: Same as ister. Any information that the oper- byte, CP/M40 returns it in the HL function 3. ating system needs must be placed in register pair, and CP/M-86 and MS- Function 5-List Output: Same as another register or set of registers: for DOS return it in the BX register, function 3. CP/M-80, the E register or DE reg- Function 6-Direct Console I/O: ister pair; and for CP/M-86 and MS- The List of Functions CP/M-80 and MS-DOS respond the DOS, the DL register or DX register. We'll take the BDOS functions one same: if OFF hexadecimal is passed, a Finally, the programmer has to tell by one in numerical order and com- status check on the console is per- the operating system to perform the pare how the operating systems re- formed; if there is no character wait- requested service. To do this, spond to them. We're using the dec- ing to be returned, a value of 0 is CP/M40 requires a CALL 5 instruc- imal numbers as the Digital Research returned; otherwise, the character is tion, CP/M-86 requires an INT 224 documentation does, rather than the returned. If a value other than OFF instruction, and MS-DOS requires a hexadecimal numbers used in the hexadecimal is passed to the operat- CALL 5. (MS-DOS also allows Microsoft documentation. ing system, it is considered to be a another way to request service by legal ASCII character that must be placing the function in the AH reg- Function 0-System Reset: CP/M-80 printed on the console. CP/M-86 re- ister and then executing an INT 33, and MS-DOS respond the same; quires OFE hexadecimal to be passed but this complicates the conversion of CP/M-86 requires a value to be in order to do a status check; OFF programs from CP/M-SO. ) placed in the DL register to designate hexadecimal passed will cause a wait If the information to be returned is an abort code. The value 0 asks for a until a character is ready before only a byte, CP/M-80 returns it in the termination and return to CCP (the returning to the user. Any value other A register, MS-DOS returns it in the console command processor). The than OFF or OFE will be treated as a AL register, and CP/M-86 returns it value 1 asks for the program to stay valid output character. For all three

340 Juiy 1982 O BME Publications Inc systems, no check for special char- editing characters and implements the 10 (referring to the functions on this acters is performed. template scheme to make command list). These functions result in waiting Function ?-Get IOBYTE: CP/M-80 editing easier. MS-DOS also places a for a new character to be typed. and CP/M-86 both support this func- Carriage Return after the last char- Function 13-Reset Disk System: tion the same way. MS-DOS, how- acter in the buffer, but the Carriage This function is treated the same by ever, treats this function as direct Return is not counted in the character all three systems. Disk A is selected as console input without echo and with count, in order to retain com- the default drive. no Control-Break check. patibility with existing software. Function 14-Select Disk: CP/M-80 Function 8-Set IOBYTE: CP/M-80 Function 11-Get Console Status: and CP/M46 treat this the same and CP/M-86 treat this function the CP/M-80 and MS-DOS return OFF way, naming the disk drive desig- same. MS-DOS treats this the same as. hexadecimal if a character is ready, nated in the DL register as the default function 1, console input without and 0 if it is not ready; CP/M46 drive, with the value 0 designating echo. returns a 1 if a character is ready, and drive A, 1 designating drive B, etc. Function 9-Print String: CP/M-80, 0 if it is not ready. MS-DOS uses the DL register in the CP/M-86, and MS-DOS all treat this Function 12-Rehun Version Num- same way and also returns the total function call the same way. ber: CP/M40 and CP/M46 return number of disks in the AL register. Function 10-Read Console Buffer: the version number. MS-DOS treats Function 15-Open File: CP/M-80 CP/M-80 and CP/M-86 treat this the this function as a clear keyboard buf- and CP/M-86 treat this function the same way, .with the regular CP/M fer and invokes an input function, same, returning in the A or AL reg- editing characters, MS-DOS allows where the function code is in the AL ister a directory code of 0, 1, 2, or 3, the buffer to be edited with its own register and is function 1, 6, 7, 8, or indicating success, or OFF hexa- Text continued on page 348

; either envhtm . - ?.' I. tion of tksper - ad enhanced hASDOS M--M& E E 110 PROGRAM RECORDER $75 ORDER: 1101:RR~"c?%~S:S:RoE"d3c'~~~~~)A.Z DISK DRIVE 1379 810 DISK DRIVE $429 020 PRINTER $249 IN OREGON CALL A.~O 822 PRINTER $339 #TROLLER - 3.3 3.2 $79 025 PRINTER $519 CCS 7710A SERIAL INT 030 $149 CCS 77100 SERIAL INT :l$f OblNTERFACE MODULE $165 FOR TECHNICAL ASSISTANCE VIDEX M) COLUMN #:f 853 16K MEMORY EXPANSION $79 VIDEX ENHANCER ll MIC 12K $149 LOWER CASE ADAPTOR $39 (503) 479-47 11 or (503) 479-41 50 16K RAM CAR0 MICROSOFT OR MPC $149 SOFlWARE ALS $139 ATARI) $119 z.%B~J~#&FT) !k7Fi:zi~~) $49 $8 $179 ~h:~~$M$&f~~~AA'~~~l:% VlSlDEX $179 NO TlON VISIPLOT $141 AYkE CAT $309 VlSlTERM $71 EPSON w/GRAFTRAX AUTO CAT VUITRENDIPLOT $214 1.D.S. CAT VISIPAC $499 D CAT DESK TOP PLAN Sl $179 MX-80 $439 560G Printer $999 MOUNTAIN CLOCK :;$; DESK TOP PLAN *3 $214 MX-80FT $539 Prism 80 wjcolor $1249 ;~~",~+~;g$;~;; $139 WORDSTARSUP.R.TEXT II $109 hrlx-100 $699 Prism 132 w/coIor $1549 g$;;gy$.t $349 SUP.R.TERM (00 COLUMN; $299 0.P.l. SOFTWARE ("chi $319 SUP.R.MOD R.F WDULA OR a4 )TOCKFILE INVENTORY RANA DRIVES VlC $245 btYsl%oQi4.dR I ANY01 $3 ZORK $269$35 Controller 4 Drives $1 19 SARGON CHESS $79 - - TRS- 80 , ZKZ msKs $W$22 Ellte 1 $32 $3T9 (CALL FOR PRICES) $05 TERMS: g"g$,\P*RgFp;\ip; 3;i$yo) :jw -y,":;;:g;Ks SHIPPING: Add 3% of total transaction for UPS brown (ground) or 5% for UPS blue (a~r),Parcel post, %~%EI?$~~$$T"E~TOR ::8 MINIMUM ORDER-$IOO.OO or my rwclal arrangements. PAYMENT: Cashle~'schecks. cntlfltd checks, money ordus, and bank wlrn honored Immedhtely. MINIMUM SHIPPING CHARGES-$4.00 Wire transfn funds to US. NatlomI Bank of Oregon, South Grants Pass Branch. Credit RCE. acwunt number 501-981. Add 3% for visa and Muter Charge. AIIOW 20 days for personal checks to CIW. PRICES SUBJECT TO CHANGE WITHOUT NOTICE REFUNDS: 10%rnlocldng charge on all rerurns or exchanges. No refunds on opened software. Call first. GUARANTEE: All products wlth full manufacturer's warranty. Sanyoad Apple warranty amllable. We have full repair and micefacllltle$ for all electronic repairs wlth HP Dynascm Ploneer Sanyo and Apple trained and certlfled technlclanr. For any technical $orvice call thim for infin1 rdvlci or qucrtlons rlght on their benches at (503) 479-41 50. REPAIRS: Out of warranty guarantee: Labor 30 days from date of your receipt, 90 days on parts. QII for detallr on qualit guaranteed dlxount repalr and reconditlonln rmlce. We have been repalrmp electronic epuipment for 12 yenrsand loveftl SPECIAL ON APPLE REPAIRS - ALL PRICES PLUS PARTS APPLE II $50 DRIVES $40 PRINTERS $100 APPLE Ill $100 SILENTYPE $50 PERIPHERAL CARDS $45 ELECTRONICS "A UMaue COfnblnatlOfI of 530 N.E. 'E' Street Grants Pass, Ore. 97526 I---IY. -am.- I----am.- --a n-u.i--o .Lb11; I' ,I1 'I' ALL BRAND NAMES ARE REGISTERED TRADE MARKS

Circle 332 on Inquiry card. Text continued from page 342: decimal, indicating failure. MS-DOS ure). CP/M-86 and MS-DOS both the same manner. CP/M-86 has an returns a 0 to indicate success and OFF return a O if the operation is success- additional system call to set the DMA hexadecimal to indicate failure. In ad- ful or OFF hexadecimal if unsuc- segment base. MS-DOS includes the dition, MS-DOS will update the disk cessf ul. segment in this function by using the designator in the FCB (File Control Function 20-Read Sequential: All DS segment register. Block) if the default disk is requested. three systems treat this function the Function 27-Get Address of Allo- This allows changing the default disk same way. cation Vector: CP/M-86 returns the after the FCB is opened without get- Function 21-Write Sequential: All allocation vector offset in the BX reg- ting into trouble. three systems treat this function the ister, as you would expect for com- Function 16-Close File: CP/M-80 same way. patibility with CP/M-80. But and CP/M-86 both return a directory Function 22-Make File: CP/M-80 CP/M-86 also returns the segment code for successful completion (0, 1, and CP/M-86 both return a directory base of the vector in the ES segment 2, or 3) and OFF hexadecimal for fail- code of 0, 1, 2, or 3 if successful and register. MS-DOS returns the same ure. MS-DOS returns a 0 for success OFF hexadecimal if unsuccessful. MS- segment information in the DS seg- and OFF hexadecimal for failure. DOS returns a 0 if successful and OFF ment register. In addition, it returns Function 17-Search For First: hexadecimal if unsuccessful. the number of allocation units in the CP/M-80 and CP/M-86 return 0, 1, Function 23-Rename File: All three DX register, the number of records 2, or 3 in the A or AL register to in- systems treat this function the same per allocation unit in the AL register, dicate the file is present, or OFF hexa- way. and the size of the physical sector in decimal to indicate failure. MS-DOS Function 24-Return Login Vector: the CX register. Note that the MS- returns 0 to indicate success or OFF CP/M-80 and CP/M-86 treat this the DOS allocation vector is in a format hexadecimal to indicate failure, a; same way, but MS-DOS does not use different from that used in CP/M-80 noted in function 15. this function at all. and CP/M-86. Function 18-Search For Next: Same Function 25-Return Current Disk: Function 28-Write Protect Disk: comments as for function 16. All three systems treat this function CP/M-80 and CP/M-86 treat this Function 19-Delete File: CP/M-80 the same way. function the same way. MS-DOS returns a directory code (0, 1, 2, 3 for Function 26-Set DMA Address: does not use it at all. success, or OFF hexadecimal for fail- CP/M-80 and CP/M-86 treat this in Function 29-Get Read/Only Vector: Same comment as for function 28. Function 30-Set Fie Attributes: Same comment as for function 28. Function 31-Get Address of Disk - CO. Parameters: CP/M-86 returns the off- HOW TO START YOUR OWN SYSTEMS HOUSE $36. set of the BIOS-resident DPB (disk 7th edition. November 1981 r++ I parameter block) offset of the cur- Written by the founder Of a sW~~3fulsystems house, this fact-filled 220-page manual covers virtually all aspe&s'W$tarting and operating a small systems com- rently selected drive in the BX reg- pany It is abundant with usefulllt681-life samples: contracts, proposals, agree- ments and a Complete business plan are included in full, and may be used im- ister, as expected, and the segment mediately by the reader. Proven, field-tested solutions to the many problems facing small turnkey vendors gre prftsented. base of the BIOS-resident DPB in the %7 1s: ES segment register. MS-DOS does HOW TO BECOME A SUCCESSFUL COMPUTER CONSULTANT $28. by Leslie Nelson. 4th revised edition. December 1981 not use this function at all. Independent consultants are becoming a vitally important factor in the micro- Function 32-Set/Get User Code: computer field, filling the gap between the computer vendors and commercial1 industrial users. The rewards of the consultant can be high: freedom, more satis- CP/M40 and CP/M-86 both treat fying work and doubled or tripled income. This manual provides comprehensive Dackground information an& step-by-step dtrections for those interested to ex- this the same way. MS-DOS does not plore this lucrative fteld. , ... support this function at all.

FREE-LANCE SOFTWARE MARKETING $30. Function 33-Read Random: All by B.J. Korites, 3rd edition. June 1980 three systems return the same code Writing and selling computer programs as an independent is a business where. you can get started quickly, with little capital investment you can do ttfulltimeor for success, 0. MS-DOS has different part ttme .the potential profits arealmost limitless. This best-seller by Dr. Korites explains how to do it. failure codes from CP/M-80 and CP/M-86. HOW TO START YOUR OWN WORD PROCESSING SERVICE $39.50 Function 34-Write Random: Same by Leslie Nelson. May 1982 Turn a small investment into asteady. money making business that adds $10.000. comment as for function 33. $50.000 or $100.000 to your income. Detailed start-up, marketing and operations plans are included. Function 35-Compute File Size in Records: CP/M-80 and CP/M-86 have no error-return codes, while Send check, money order. VISA. Master Charge or American Express # and exp. date. Publisher pays 4th class shipping. Add $1.00 per book for UPS shipping MS-DOS returns 0 for success and (USA only). NJ residents add 5% sales tax. For faster shipment on credit card orders call (201) 783-6940. OFF hexadecimal for failure. Function 36-Set Random Record: ESSEX PUBLISHING CO. Dept. 2 285 Bloomfield Avenue Caldwell, N.J 07006 Same comment as for function 35. I). I 348 July 1982 O BMEPublications lnc Circle 160 On Inquiry card. Circle 289 on inquiry card.

MS-DOS emulating CP/M-86 1.0 CP/M-86 (EM-86) Benchmark BASIC-86 Rev. 5.21 BASIC-86 Rev. 5.21

Empty do-loop 6.04 6.04 Division 22.12 22.12 Subroutine jump 11.99 11.99 MID$ (substring) 20.94 20.94 Prime number program (only 2000 primes) 47.97 47.97 Disk write program (64K-byte file) 18.3 15 Disk read program (64K-byte file) 9.1 10.1

Table 4: Timings of benchmark programs run in Microsoft BASIC. The programs were run on a Compupro 8085/8088 machine running at 5 MHz with one wait state on input/output. In one case, BASIC was running under CP/M-86; in the other, under MS-DOS, which was itself running EM-86, a program that emulates CP/M-86. Since the first five benchmarks were computational, the BASIC was the same, and no file loading was involved, it is not surprising that there was no dif- st Program...... 48. II ...... 12% ference in the times. The times on the last two benchmarks, which involve disk in- 1 ...... 235. put/output, are surprising. MS-DOS can support the emulation program and run the BASIC disk read program almost as fast as CP/M-86 can. In running the disk write program, MS-DOS emulating CP/M-86 is actually faster than CP/M-86 itself.

L

CP/M-86 1.0 , MSlDOS EM-86 PIP COPY PIP

File copy: Copy 9.9 5.75 16.15 22K-byte file

Table 5: Comparison of file-copying speed of CP/M-86, MS-DOS, and MS-DOS running EM-86. The copy utilities were run on a Compupro 8085/8088 machine run- ning at 5 MHz with one wait state on input/output.

mulator...... Benchmarks must be alert to some significant dif- Tables 4 and 5 show the results of ferences. some benchmarks of MS-DOS and What About the Future? ...... 169. running On a Com~u~ro ...... 159. But now we come to the question 808518088 system at 5' MHz. The of promised revisions of the two most notable result in table 4 shows operating systems and learn that that an system Digital Research has a strategy for CP/M-86 performed the BASIC disk Prices valid for stock on hand redressing the balance. d subject to change without notice. write benchmark faster than te for our FREE catalog. CP/M-86 itself. Concurrent CP/M-86 The most important revision com- For Peripherals ing in CP/M-86 will mean that users see our other ad, page 158 Summing Up the Current Version Based on the comparisons made so can do more work with the same far, the serious drawbacks of machine. Digital Research previewed CP/M-86 would seem to outnumber Concurrent CP/M-86 at the West those of' MS-DOS. MS-DOS wins Coast Computer Faire in March. In points for superior speed, more effi- an operating system, concurrency cient use of disk space, and error means that a computer can do more ORDER TOLL FREE - Outside WI recovery. CP/M-86 wins points for than one thing at a time. Under Con- 1-800-826-1689 reconfigurability and online help. current CP/M-86, for example, you - - .. 1 . From the assembly-language pro- can simultaneously edit one file, run grammer's viewpoint, although an automatic spelling checker on a CP/M-80, CP/M-86, and MS-DOS second file, and print a third file. You are quite similar, the programmer can run one BASIC program while

350 July 1982 O BME Publications Inc compiling a second program, debug- the next with a single keystroke. during transfer, now controlled in ging a third program, and receiving Frank Hollsworth, head of the CP/M-86's BIOS, to the BDOS. As electronic mail through a com- 8086-operating-system development things stand, the BDOS asks for an munications port. How do you keep group at Digital Research, also prom- absolute track and sector number, track of all that's going on7 Concur- ises a doubling or tripling of the speed and the BIOS has to translate that in- rent CP/M46 constructs "virtual ter- of CP/M&. "Hashing"-transform- formation before doing a read or minals," each of which is a window ing index keys into a shorter, more write. Moving the blocking and de- on one operation. On machines with easily manipulated form-will be blocking to the BDOS will speed mat- integrated consoles (like the IBM Per- used to speed up file access. Speed ters up by eliminating some cal- sonal Computer), you will be able to will be increased further by moving culations. change from one virtual terminal to the blocking and deblocking of data Promotional literature promises Clrcle 253 on lnqulry card. - that Concurrent CP/M-86 will also MS-DOS 2.0 sentation Level Protocol for graphics i offer: Microsoft will be improving MS- and text, which will make it easier for @extensiveerror-handling and error- DOS, too. At a seminar held in New MS-DOS systems to interface with reporting York on March 10, Microsoft's co- cable networks and many .date and time stamping of files founder and executive vice-president systems. erecord and file locking outlined the company's MS-DOS 2.0 will also support - .password protection of files, so that plans for MS-DOS version 2.0, due in working, both local networking of you can your computer without the third quarter of 1982. MS-DOS systems and hybrid net- sharing your secrets (e.g., the payroll Perhaps most important, Microsoft works of MS-DOS systems with sys- in your office) will give MS-DOS a new '"-the tems running Microsoft's - metworking compatibility face the operating system presents to sion of Unix. Microsoft is weighing .real-time capability (useful, for ex- the user. Instead of a simple com- the use of the Xerox networking pro- ample, for leaving the computer to mand line, MS-DOS will give you a tocols or the Department of Defense send a message over the telephone sueen full of information divided IP/TCP protocols. Microsoft will while you dine out) into "windows" by category: files, prototype its network on IBM Per- utilities, applications -programs, - etc. sonal . Hollsworth also noted that Digital You will be able to select files and An important new utility routine in Research is developing an interactive programs by cursor movement. This MS-DOS 2.0 will be a print spooler. BASIC to fill the void left by Micro- means no more typing of file names In other words, MS-DOS will let you soft's decision not to provide future and program names. print a file simultaneously with run- versions of BASICS6 for CP/M-86- There will also be online help. You ning a program. based machines. Also in the works is will be able to get help at any time by - An enhimcement of the DEBUG CP/M-68K, for the typing a question mark, and the help utility will permit direct typing in of processor, due sometime this year. will be "context sensitive." And you assembler mnemonics, a number of The family of CP/M operating will be able to customize the shell. Xenixderived utilities will permit systems will then support networking MS-DOS 2.0 will use program and filtering files in various ways, and a mixture of systems based on the driver interfaces that enable applica- EDLIN will become a more powerful 8080, 8085, 8088, 8086, and 68000. tions programs to talk to the screen line editor. Both Hollsworth and Dr. Gary and keyboard using ANSI (American As noted earlier, Bill Gates has Kildall, head of Digital Research, National Standards Institute) stan- promised to make MS-DOS recon- were at pains to emphasize that dard Escape sequences. That should figurable so that owners will be able Digital Research is looking at ways of simplify the writing of applications to use serial printers. adding Unix-like functionality to its programs for MS-DOS and therefore Microsoft also plans to improve the operating systems. The Digital encourage more authors to write for already very fast performance of disk Research staff has several members the MS-DOS market. Furthermore, input/output by using multiple buf- with Unix backgrounds. MS-DOS will support AT&T1s Pre- fers.

354 July 1962 B BYIE PubhUona Inc Codi~lredfrom page 354: While early vdmcohfahed mbre v%pedor'U~errnteh? Terminal Support . .-. _. . tha few bugs, and som critichm When it comes to the , Anotker $iffezwe ktween the two has been leveled st the ekgan~eof the MH?OS&emonset.@ttw a fam imjwouq- systetus. en t&q .JBM Persond, Co&- :; translation of an &bit system r~the mts over Digital ,&zsevch's line. puter is tkt MS-DOS. does llpt emu- .'

16bit world, several vendors have ' Silnce the copy program is resident, late shy k'erinina2, whfle CP/M-% does ' been wing CP/M-@, and some ap- there% no more frunblifigfor ,a system (the IBM 31M), While this difference is f pN&fions progmms Me'been appear- d&k ~ithPEP ad enough room.- fir- wt inheregltr. kt Wwht mb&id by. ing on it. MS-DOS 'kas adear peifar- themzo~e,the -sgntlz;w of oper&'om fie BlO5- (rnaeEine-Z~Wtjimplemen- . mance advmtage over CP/M-86,but sopxpy is abit more logical to the htjm fqf@n>it may .be tht-most,cqntrover- , thds is mainly due to soms&nckment~I mid (copy from-to). Not having to sical, Sipe B105 content was ynder the &s@ hcisions, and not kit of haw- type bntro1-C after a floppy change E control of Microso$ d Digital , 'lation overhead. Neither sy&m is my a step in the right direction, and an Research, we must conclude that they dram domputer environmeai%In fact, auto-execute feature allows the crea- are significant aspects of the plans of . . neither system fs entir8Zy acceptable tion of "bootRe,Iemapplications ioith- the-respective vendors. Tke kzck of a according fo my criteria. . out having to +&cF the BIDS. The simple way to specify bfdeo kwntroTs. . ' ability to trap system eyrQwshelps in .(Suchps wrwr posifion a& display af- ; tlre conjtructiofi uf p ugram rhat @butw) wit3 priwnt hhny, .@lLa- . . '":An Ap~Bmtiand . . never confound the user. A13 b all- ., tioi fr&- beebrqughYozrer.to MS- -:. Progmmmer"~Dram though, $hesyste* laaks too muck like DO8 quick& .fad, pei.haps, ~optimak- ktrlaat b mg dream operating ~4 ' CP/M .to ofier much. c$ m imprwe= Zy). Ma~ydiqbap-orjeated pf~guw.. tew? First and firnost, it will albw wynt itz flbe human .in&tfa~e+reg, . . @cL,as ~ordprae4ors)t)iat.p~ :. :: the support of user-friendly software White Microsoft claims 'flu& all i&. . $i-fke~CP/MWQ~G of micropi"oces+@ '' solwtio~ for noncomputer peoph. , bpmating systems retain certain high* connected to tenninab are poded via . These solutions mWZbeabte to BIly . level fiature, such :as ': dkplgy drive9s wi~gcqartrel se- ' exploit the host;hi&&we, .frt this @&a, in&p&t 140, it mwt .be sdsriqoEuzt @Qmces:Eviritudly, &amfmfer+ersof :' one of considerable flexibilbfy and -.of an embarr~ntthat the syst:&t.' .. @chIj?es9 wifhintegratcld db$hys pp- powL The dmns npemting sysiPni -doesn't suppqt fte IBM' 'Pekpiittj ,.--p!ieZBIQ% that in;teiwp'tec;%tfw CQXL-. -' will all* mg progrgm full contrul of . : CarnputerZ sYd i~tetface(and thus ' ' .-,tpl:seq~dencebfsome pop~la~fegmirrd. the user's environment. If that user has most .IjpintersJ, T+- hwpogetief&. '- -.in or&r tp .alhio- a ~roftlsiotr:oJ'p~b~' any pr$bIems, I know if's my fault. .- thii line of operating systems seems td-. .- abets to b brou~htto ,their ~ster&.. The perj&t sydem will dtarge a mhb , lem a fetu holm tw'the Pemnal.' -$h~e~-eit~ina~emwlb~o~s inb?alv& .*.. mrpm of ov&rkH for these semles,. C-uter? owner niwt hl~g~tia~&.. . .~ngehmwe.-ow&~d than direcd ~idteo . ktwillsuppotz full graphics, consale; . . , mmury ;ac:cess, rkt? ctxpahiliIes.:.af ' disk, an.d communications l/0, md a , ' : . . ' .. thes.e ihtegrated disphy Cystems me, .- host of other faditia provided .by a A &&r. F&I~$ , .": "".-'. . ' ' oft.%nor ~xploiteii. ..' ...... :: computer as advanced as the IBM Fer- CP7M-86-is &D pwtwf in &a+#& I*.-& 4pt;Cmt att&tpt to Pp&ik!)ks sonal Computer. All these .re- , i-ew wily'; Ph& -fa$&,..kow - prafwim afm&d.ptatia&;~*MS-DQ&. qtn'mnts must.k md by wny system dmi;6 is&-re &~d&.-. ...'..forps an aufbpr 6a the - pmporting to be uswle. Ln &ition, om0. , Q ~kr'& t+ bf murk .e~CLn&w&o& myzpal;ticwlardream aperating system - @&B+B ,t$ .-tkk [email protected]&&&. . 'mf Pebonacl .&mpu@ delay:mcess. .' will aZIow me to easily deveI~pthose , MP?Mi@,". m~IH~r~~sss'~~arzd.tb ..; 'Reflg~tjqg.ifs hwkge, CP/M-86'C i%-. . . applications. Keep in mind that 1 sin wy' ;' CWZ&&~~.CPI:M. :. .biting ks mwh. s+fcuj~3*e20 .-a? &I . W &=ssing these systems pi.Imuri?y far apWzwctkge'&iep . tHelBM ~erso~alCompute~ar$an ng ' ...... frb~4.the~~kpednt of ~ofh.~we.ded- a= - sn& :&m~&$aB%; t~.nbn-6, : possdbk, , . - . I. . ~pm,but frem that of the fi.rseMal . fa~BE$ecmp~iO~j..t&@& rea* &i#&f2>' - , ...... _ --%... . Computer omrs who will use my ~eswcRb~@i496~+@&M6- .: mdby.:~eb~e*:" I. -.ic ' software. .s~~~PI-~ow&~&~~~~~~A'a .: - - Anal yis, I how.'l.,pr~&~d @Bas l .gab ded~pe'd &W 'CP[cfi~&--. . was- sQdr&dizg gfhemehxi. &$.&us, ' fkcdkhg Mema* afi emaB~&me ~f mm :.'. .,n~f-s+s dev~I~p&~~:1% dmt. . ; Management go Gain Speed? . . w&h nQ'co&er&im'+#&~~ ,hd@- fb =. . .fqr .OF momertS, 2728 MS-DOS &w- - MS-DQS is the single-user.member ~m&I@~.-~de~a@&+g @&Y&. ger k.q'yle adeqtrrate, &ufsuffm'fidk .. : of a line of operaw .sptems from ~~hkE~odE~ufc~..wit 6- :' ., jbe'izuld&ifig om+.ssion of ~H'ASS~+-'. Microsoft. To move to the world of - mcn~. tat&.PimI; Cmnp- .bk ;qomma&. Aq*)m at. ail.'Yqnifiar multi-users, netwarking; or multitask- L ,adf me11 m$ed 40 mif&a&&$&as7 . .mi~k!the encv&ng-.af the 8086 &$k& ing, Mr'crosoft seato su&st buying .:ti-, *- @~~~R~~IY~~~~~'tb& $sit. .~ttder'af611&.Ehe &,~.-@f.. a DEC VAX. MS-DOS contains none " Wt. nt$nh$ -~smeruP..-ks. &%@- i'<.iwWpr~gram%. bf &Q&. _ . . of the, ;wzemmy~.mnnagem~tad do- :taue~li&) is. ~ng::.D$~~~ tzkzkbJy Mktxkinft's:DEBUG .j%r@ds. & 1:&'0n facili@s supplie4 by CPfMrB6. 8e~~ck~&~;kd.~~~e~.-::'- PiZlfUm *@ 'li&ics.' On khi e.hd.'; One immediqzte +mefit of this design W.&t.-fl~@i% B~d.Fs*.im~te ... ftk'o+, @& &ver@,..~.wk. ' deeiyian &' performance. Showitzg the saq&. and ..€beya.&r- .otk oi%m 'm&d hp'baen w3Ld f.0 locate a:bg% . ' effects of 60th. a dmpler operati'ug- - 0&6&d qy&eM Wasoft dfAb&.. patim&,mmoty,.@haugh ke~g. .. sys&m ddp&d.a rethinking of file bh&pf~~Ob'wd$ke r?&&&." ' . &&liaf.E*relatl~~edl in.&&-'&+ SB . . ..structure, MS-DrZ;$ cm~~mfloppy ' qf:f@E%PW *&ff@mfly; tzt ke-h.ti :- :@xix+perat&; it !e$zst. ym 'QPLF.utdg.ta ' - - disk w&k imprkve sped, Using A f@lpio%. A&'Wie @4e@1~t%ie.. kqte,' fhk .%%@@ :TO& -v&$.. . @.

, hea$ii overkd application and a , ogk ia&~-&';b'#&hg.a,@&sd& --- . it'!^. ~~:-%-:i;p.@r&tp~~~.: hard dGk, MS-DGS made fhe overlay : @+?IP@ Pd*@ 6:-'- ' Calk 'e9fLp.w =@a&iniwf++ loads' imperce@+6&,wh& CPPM-86 {yes .Yi&~ia;&re %iJl'be mcdk. Wres c$ these WQMfmns s~prodvok ,' intrsdaed fag second . hw . ane kkof a colizpirti?. d hope &the; - a ttoticeable of a bql, 1M&+omft ~otbmn'pm& -. . . spw. .ingEanyfhAg: ' ' ...... bffe'dotp it-so&n$ ...... -

July 1982 O BYTE Publications Inc 355 Conclusions space, and, most important of all, price of memory chips should encour- Despite its lack of an online HELP recovery from errors. age Digital Research to enlarge facility and a utility for reconfiguring CP/M-80, designed for systems CP/M46 as necessary to meet the the system to use new devices, MS- with limited memory, had to be a higher standards of convenience that DOS is a better operating system for small operating system. As a result, are sure to arise as microcomputer users with little technical knowledge no space was available to devote to ownership becomes more common. than is CP/M-86. MS-DOS has sig- things like code for error recovery. Throughout its seminar in March, nificant advantages in speed of disk CP/M-86 has inherited some of these Paul Allen and other Microsoft input/output, efficiency of use of disk deficiencies. The continuing fall in the spokesmen described MS-DOS as "Microsoft's single-user, single-task- ing operating system." That appears to leave a big opening for Digital Research's Concurrent CP/M-86. The importance of concurrency cannot be overstated. Two years from now, all 16-bit will have con- currency. Failure to support concur- rency is a waste of computing power. Computer users will not settle for doing one thing at a time when they know their computers can do three things at a time. Up to now, Microsoft has advised people who want multitasking to buy Xenix. At Microsoft's reception dur- ing the West Coast Computer Faire, however, Allen would not rule out the development of a Microsoft oper- ating system that supports multitask- ing but stops short of being full Xenix (XE-DOS7). In short, both Microsoft and Digi- tal Research are moving to correct deficiencies. MS-DOS will be provid- ing online help and support for a greater variety of hardware; CP/M-86 will increase speed and add error-handling capabilities. CP/M-86 already provides an upgrade path to MP/M-86, and MS-DOS will provide an upgrade path to Xenix. Despite MS-DOS's present impressive superi- ority in speed and error-handling, Digital Research's Concurrent CP/M46 will give people a means of getting more work out of their com- puters. Competition between CP/M-86 and MS-DOS will bring dramatic im- provements in both operating sys- tems. Much depends on when the promised improvements actually become available to the average user. If Microsoft and Digital Research do not deliver the improvements in a timely fashion, Unix may take up res- idence in more microcqmputers than CP/M46 and MS-DOS combined.

3% July 1982 0 BYTE Pubkatiom Inc