$3.00

June-July 1986 Special AI Issue

PROLOG On The PC ...... 6 A thorough comparison of PROLOGS available on the PC.

Expert Systems and Logic Programming ...... 12 Expert systems designers are handing out numbers to prospective customers.

Opening Bids In Bridge ...... 18 A great example of how AI works. Grab your PROLOG and start coding.

And More

Building Your Own Logic Analyzer ...... 26 Can't afford a commercial 32-channel logic analyzer? You can afford this one.

86 World ...... 36 Our man in Turkey trots all over Asia looking for the complete supplier of drives, systems, boa_rds.

0'° ,., 256K RAM For Your 83 ...... 44 co Finally, a do-it-yourself RAM upgrade for this venerable Z80 machine. co M °'~ 0 PC-DOS For Non-Clones ...... 54 "- ~ Write a PC BIOS for your 8086-8088 system. ~ "-

0 Brep-by-step tutorial, demo programs with source code included! Turbo Prolog 1.0 Technical SpecitJ.cations Borland introduces Turbo Prolog, ProgzmnmiDt 8yst,em .libatures f!:1' Compiler. Incremental rompller gen­ erating Illl.tlVe ln-llne cxxle and llnkable oQJect malules. The l1nk1ng fonnat la the natural language of romµit.lble with the FCOOS linker. large memmymcxiel support. Complies over 2600 llnea per minute on a standard !EM ro. f!:1' Int.eracttve 1'4tt.or: The E\)'Bt.em Artificial Intelligence. lnCludes a p:iwerful lnterect!Ve 1\J!l-rereen text editor. If the rompller detects an error, the ed!tor auoomatlCalzy pooltJona the curoor epproprlately In the rource cxxle. At run-t!me, Turlxl Prolog ~can call Prolog is probably the most the edit.or, and v1eW the runrung PI'®'Wil's oouroe cxxle. powerful computer programming f!:1' 7Jpe 8yBt:8m: A flexible oQJect,orWnted language ever conceived, which is cype E\)'Bt.em la supported. f!:1' W1Ddowtng Bupport: The E\)'Bt.em wbywe've made it our second supports !xJth graphic and text WlndowB. language-and ''turbocharged" it to f!:1' Input/Output: Full I/O fac111t!ea, Including formatted I/0, streams, and create Turbo Prolog ... random aooeaa files. f!:1' .Numeric P.a.nges: Integel'B: -32:lf!7 to Our new Turbo Prolog brings 32767; Reala: lE-307 to IE+zre supercomputer power to your IBM® f!:1' .Debugg1Dg: Complete bullt-tn trare de­ buggtng CB.IW111t!ea allow1ng Single PC and introduces you step-by-step to st.eppJng of~ the fascinating new world of Artificial Intelligence. And does all this for an ,...... , astounding $99.95. I YES I !~a~~st I Turbo Pascal the wey you I • I could compare Turbo Pascal w I Turbo Prolog at only: I @ :f:/::~fi:ir~ _Q;;J=~:;;~e::, machine language. Pascal® is to Pa.sca.1! ~ our free tutorial will You get the complete Our Turbo Pascal aston1Bhoo get you st;a.rt;ed right away Turbo Prolog = $99.95 =1 eve:cyone who thought of Pascal I To order by phone, You'll get started rlght away I or for a dealer nearest you, 1 as 'Just another language:' We because we have tncluded a $ f;'=~~~Bsystem changed all that-and now Turbo complete step-by-step tutorial as I Call (800) 255-8008 I You get a complete Turbo I in CA call (800) 742-1133. I Pascal 18 the de facto worldwide part of the mpage Turbo Prolog Prolog development system I Send me_ Turbo Prolog at $ __ I standard, With hundreds of Reference Manual Our tuwrl.al tnclud!ng: thousands of enthus1astB Will take you by the hand and I Outside USA add $10 per copy I •The lightn1ng-fast Turbo Prolog I C4 am MA res. add applicable sales tax $ __ I W' • • '·· and users 1n teach you everything you're likely tncremental compiler and the c! universities, I Amount enclosed: $ __ I l#W!IAfi wneed wknow about Turbo tnteracttve Turbo Prolog editor. ·· -... {research I This price includes shipping to all US cities I Prolog and a.rttllcial intelligence. • The mpage reference · •· · V. ·:.; centers, For example: once you\re I Payment VISA MC Bank Draft Check I 1 manual which tncludes the step­ •. I schools, completed the tutorial, you '11 be by-step Turbo Prolog tuwrial. I Credit card expiration date:--'- I L< and With pro- able to desJgn your own expert • The free GeoBaseTM natural I Card~ I I I I I I I I I fessional program­ systems ut111zlng Turbo Prolog's query language database I 11111111 I "' mers, students, powerful problem-oolv!ng tncluding commented oource I b1tfs";5J ~V:,:, !8!' or 1111e corrpatible nmina I and hobby1stB. capabilities. code on d1sk-ready to compile. I My cO/TfJUlers name artJ model is: I You can expect at least the Th1nk of Turbo Prolog as a GeoBare 1s a complete database same impact from Turbo Prolog, Wgh-speed electronic detect1V8. deslgn.ed and developed around • Thedislrsizeluseis·D3'1/ DSW because while Turbo Prolog 1s the First you feed it information and U.S. geography. It tncludes cities, 1 I most revolutionary and natural teach it rules. Then Turbo Pro1og NOT COPY PROTECTED mountatns, rivers, and Wghweys, I *60-DAY MONEY-BACK GUARANTEE I progra.rn.rnrng language, it 1s aloo "th1nks" the problem through and comes complete With natural I Name.- I a complete development enV1ron­ and comes up With all the query language. Use GeoBase ment-juBt like Turbo Pascal reasonable answers-almost immediately "as 18," or mod!zy it I Shipping Address· I. Turbo Prolog radically alters tnstantly. to fit your own tnteresta. I I and dramatically improves the Ifyou think that th1a 18 So don't delay-don't waste a I City.- I brave new world of a.rttllcial amazing, you just need w second-get Turbo Prolog now. I State: lip: I intelligence-and 1nV1tes you tnw remember that Turbo Prolog ls a $99.9518 an amaz1ng]y small I ·Telephone: I that fasctnattng universe for a 5th-generation language-and price wpey to becOme an I ~~mcfi,~~5JsAOld:Jew:;~~[b~e:r:iff:~~ I huma.nJ.y tntelligent $99.95. the kind of language that 21st immediate authorlcy-an instant International Pas/al Money Orrler. I century computers Will use I *YES, if within 60 days of purchase lhi~ product does expert on a.rt1fic1al intelligence! 1 routinely. In fact, you can The 21st century 1s only one I : ~i~c:e~s~;;;~f::;!nra:J:~/¢;1;1 I I arrangearefund. I compare Turbo Prolog w phone call awey. I ;;:~~~~"'A:.'t~'t requlrem1nt1: I I ~~Of1¥Jatibles • ;. ·.;.'.J 4585 SCOTTS VALLEY OR/VE I SUS • ;,.·;.~ «' ~$<<,) SCOTTS VALLEY. C4 95066 ., '~, ·, ., (408) 438-8400 TELEX 112J1J " ------NEW LOWER. ·Features: Kits . All wave Soldered! ! . PRICES .. • 8 MHz 80186 microprocessor with true 16-bit data bus. · · • Full Kit W/O SCSI, serial ports, clock .•. $ 550.00 · • True PC compatability with our own custom • Assembled and Tested ROM BIOS and PC cardslots for the video W/O SCSI, serial ports, clock ••• 1-4 $ 599.00 of your choice. 5-9 $ 525.00 20.00 • Standard 512K zero wait DRAM, ·or SCSI Port ...... add $ Serial Ports ...... each - add $ 12.50. 1 M options.· ~ Real Time Clock and Battery , add $ . ·1~.50 8087 numeric coprocessor support on board. ~ • 112 MEG Add-On ...... :'. ... $ 105.00 . • On-board floppy disk controller for up to • XT Style, Enclosure ...... "$ 75.00 four 5114" drives. • 150 Watt Power Supply, Tested ... $ 105.00. • On-board SCSI hard disk controller port. Call ~ Supports WD1002 SHD., WD1003 ACS, ~087-2 Coprocessor ...... $ ~ OMTI 5100, 5300 ADAPTEC ACB4000. • 2 On-Board Serial Ports. • Battery Back-Up Real Time Clock. Total Solutions: . . Assembled and Tested Systems Designed, Manufactured and Serviced by: • Mono-Chrome System ...... $1,499.00 Includes: 512K, Power Supply, Enclosure, Keyboard, Monitor, Two Drives, and Printer· Port, 1 1 Serial Port, Real Time Clock.· PC [CH :o~·~i~h ~~h street • Quaritity Discounts Upon'·,Requ~st . Lake City, MN 55041 •Call For Info on Add-Ons, Hard Disks, Etc: (612) 345-4555

COD, VISA, MASTER CARO, CERTIFllSD. FUN CS :;MICRO ·, (}ORNUCOPI/\ EDITORIAL

The Micro Technical By David Thompson Journal Over The Wall Editor & Publisher David J. Thompson

Operations & Advertising Morrow Computers Says Goodby David Pogue · George Morrow is still around, but Morrow computers, one of the early powers in this industry, has filed Associate Editors Chapter 11. · . .. . Rebecca Ozrelic Gary Entsminger In his book Quotations From Chpirmqn :Morrow George wrote, '.'Money is the only lethal drug ·available on a non- Accounting prescription basis.'' . . Sandra Thompson "We pissed away $11 milliori,". he commented after the filing. (Something not experienced by·many.) Office Manager If someone doesn't come forth shortiy·with ·something Tracey Anthony that's green and folds and interests bankers, there won't be· another chapter. ~ ,, ,. Technical Department Larry Fogg Mirror Says A Lot Be careful when you sue somecme - you might just be Staff Assistants doing t~em a favor. Crosstalk is' suing Softklone over its Laura Logan Cary Gatton Mirror communications package for the Compatibles, but Renee Katter publicity from the suit could be a super boost for Softklone's new product. I called Softklone to see what the fuss was about. It turns out that Mirror will emulate Crosstalk, from MICRO CORNl]COPIA (ISSN 0747-587X) is communications protocol to configuration files. Mirror published bi-monthly for $16 per year by will also speak Christianson (CRC ·or checksum), Hayes, Micro Cornucopia Inc. 155 NW Hawthorne Bend, OR 97701. Second-class postage paid and Kermit protocols. · · at Bend, OR and additional mailing offices. It has. a built.:in text eoitor, password .protection, data POSTMASTER: Send address changes to MICRO CORNUCOPIA, PO Box 223, Bend · encoding/ decoding, plus it runs in the background. Gust OR 97709. hit both shift keys and the transfer continues in the " background while you use the system for other. tasks. Hit SUBSCRIPTION RATES: 1 yr.(6 issues) ...... $16.00 the shifts ·again and you're back in Mfuor.) ... 2 yr.(12 issues) ...... $30.00 · Mirror. supports practically every· auto or manual dial 3 yr.(18 issues) ...... : . ... $42.00 modem· (Hayes compatible and non-compatible). It will 1 yr.(Canada & Mexico) ...... $22.00 1 yr.(Other foreign) ...... $30.00 even turn a PC into a VT-100 terminal if you wish. Make all orders payable in U.S. funds on a I ordered one. After it arrived I tried it out on U.S. bank, please. · everything . I .could find. I'd been using Mite and CHANGE OF ADDRESS: Please send your Modem740, but. I musf say, this is better, much better. old lcibel and new address. One problem I found is that it holds up the sender while it's writing to disk (in 4K blocks). At 9600 baud this delay MICRO CORNUCOPIA becomes significant and reduces the effective transfer rate P.O. Box 223 · Bend, Oregon 97709 to about 5000 baud ·(rurulir\g on a clone and writing orito · ·a Seagate winchester).. · . · CUSTOMER SERVICE: For orders & sub­ However, at $49.95 (not copy protected),· it's definitely the best deal in scription problems call 503-382-5060, 9 am to commercial modem software I've seen. 5 pm,· Pacific time, M - F. For technical help call 503-382-8048, 9 am to Solid noon, Pacific time, M - F. I have a 'Holliston XT-186 board, and it's turned out· to be a. quick, :·very RBBS - 24 hrs. 300-1200-2400 baud 503-382-7643 dependable performer. Though it doesn't have the video speed or the built-in floppy interface of PC Tech' s X-16, it certainly holds. its. own in the processing Copyright 1986 by Micro Cornucopia Inc. All rights reserved ISSN 0747-587X (continued on page 90)

· 2 MICRO CORNUCOPIA, #30, June-July 1986 June-July 1986 Issue No. 30 CONTENTS

Introduction To PROLOG 68 The Racer's Edge The 68020 is out. Trevor Marshall and Co. tell us how it matches up against the 32032. .

6 PROLOG On The PC There's already quite a collection of compilers and interpreters for this unique new language Fast Step Rate 94 For PC Disk Drives Larry Fogg changes his clone's step rate in software. An easy, quiet mod. 12 Expert KNOWLEDGE · Systems and BASE Logic Knowledge Programming Al:quisltlon And An overview of Refinement Columns expert systems design using PROLOG. NATURA LANGUAC INTERFAC 36 86 World Direct Importing. Laine picks up the baton and runs (all over Asia) with it. Fascinating adventure. 18 Opening Bids In Bridge 44 Kaypro An example PROLOG application. Margaret Sklar lets Folks have been requesting this mod for four years: tin her code do the talking. easy 256K RAM upgrade for the 83 Kaypro II and 4. 48 Pascal Procedures John Jones tries writing a simple draw program for the PC (and enjoys it). More Features 64 C'ing Clearly Porting Code 77 Culture Corner An answer for $7.11. Building Your 26 DC15 78 On Your Own AI recommendations Own Logic. INt!5 Analyzer DCl4 82 In .the Public Domain . Build your own IN14 Another.CPIM emulator, but this one fogic analyzer for DC13 thinks it's a Z80. How about that peanuts. Part one INt3 of a two-part DC12 IN12 S-100 Bus Hardware supporting Turbodos series. 86 96 Technical Tips 54 PC-DOS For Non-Clones Want to write a custom Pc BIOS for your 8088 system? Want to know what's happening inside your clone BIOS? Future Tense· By Gary Entsminger

72 Split Personalities­ 98 Tidbits File recovery under MS-DOS and The V Series . the visible computer The V20 & V30 have been hot replacements for the 8088186. What The Last Page It's recursion: can the rest of the series do? 104 again, and again, and again, and ...

MICRO CORNUCOPIA, #30, June-July 1986 3 Digs The Duck Next I hooked up a scope to pin 6 know what they're guestimating. They I own a DAK ADC modem and have on the CPU to see what the new expected the Amiga to blow away anything had basically good experiences. The 5MHz signal looked like. The wave­ less than an 8MHz 80286, especially for only problem I encountered was that form was quite ragged on the uphill screen 110 which is measured in bench 3. one of the DIP switches did not oper­ side. In addition, the amplitude was See Issue 29 for benchmark details. ate correctly. But since there was an extremely low, just over 2 volts. Just Times are. in seconds. All used 16-bit equivalent command that I could for comparison, I checked the now integers (short ints for Amiga). No speed imbed in my startup file, this was not unused 2.5MHz pin and was amazed optimization was used (like register vars) a big problem. at the difference. The wave had an w~en compiling. · I also found one little "gotcha" amplitude of well over 5 volts and was Benches 1 2 3 which I suspect is not limited to the clean and smooth in appearance. Since Amiga w/Int. 237.9 124.1 225.1 duck. The modem will run in either · I didn't have a replacement for the Amiga w/Short Int. 32.5 21.0 225.0 Atari ST 28.0 18.0 35.5 300 or 1200 baud over the phone line, 74LS293 (U86 on the Micro C schemat­ 6 HHz AT clone 11.2 7.4 34.2 depending on what it detects coming ic), which provides both the 2.SMHz 4.77 HHz 8088 54.7 28.7 73.6 4 HHz Z80 478.2 244.6 39.0 in. However, I found that when I and the SMHz signal, I couldn't see if dialed a BBS which handles both baud it was a bad chip. Instead, I picked a As for power supplies; boy, you've got rates, the BBS tried 300 first. The duck 4MHz signal from pin 6 on U87 and me. I've seen some of the cheapest switch­ obediently "quacked" at the lower fed it to the CPU. Eureka! ing power supplies from Taiwan put up rate after initially connecting at 1200. After installing a switch to allow with all kinds of electrical violence without The solution is simple: turn off the transfer from 2.5 to 4MHz, I left the complaint (and without damaging the sys­ buffered mode (A TBO) before dialing a computer on for about 10 hours. No tem). BBS which you know will handle 1200 failure, and no recurrence. Thanks. The old linear supplies ·(10-20lb 60Hz baud. · Martin Leichtung tranformers and house-warming linear reg­ Larry Blanchard HRC 4260 Kachemak Dr. ulators) I have on my Big Boards weren't 2018 N Valencia Homer AK 99603 cheap, aren't small, and definitely aren't Santa Ana CA 92706 efficient but after almost 6 years they haven't eaten any processors. Amiga Benchmarks You asked for benchmarks on the Curing Keyboard Lockup Amiga in Issue 29; here are mine: One Out Of Two Ain't So Good .Several months ago a friend and I Benches 1 2 3 My first order to DAK was satisfac­ ordered speed-up mods and Pro-8 Amiga w/Int. 237.9 124.1 225.1 tory, although it took four weeks for monitor ROMs from you to upgrade Amiga w/Short Int. 32.5 21.0 225.0 delivery. instead of Mr. Bollinger's four our 2-83s. Using the instructions en­ All times are in seconds and include days. My second order, however, was closed with the kits we had no trouble floppy disk access time. I used Lattice a nightmare. The printer I received successfully completing the modifica­ C. The first times were done with the was a defective, used one that had tions to both machines.· program as you listed it. The second already been se~t back by a dissatis-· After about a half hour of continu­ times were generated with short (16- fied customer in Florida. I found his ous operation my computer developed bit) integers. address label as well as a used candy a case of the dreaded "keyboard lock­ Now I need some info from you: wrapper in the "factory" packing. up syndrome." Afte:i: several tele­ how do you protect your system in the Parts of the case were missing, and phone calls to Micro C, Zilog chip event of a power supply failure? I just . the machine never would initialize. dealers, and MicroSphere, and quite a had a supply go out that cost me a Two calls to customer service went few suggestions that sounded good motherboard and winchester, not to unanswered. When I finally got but didn't work, I got my Issue 26 of mention the supply. Fortunately the through, their reply was, "You may Micro C. It contained a Technical Tip case and fan were just fine. send the merchandise back for a re­ about an aluminum heatsink devel­ Bob Gobeille fund (sans shipping fees both ways).". oped by an English doctor. 805 Laporte Ave A certified letter to the president of Installation complete, power on, ev­ Fort Collins CO 80521 the company produced no better re­ erything looked good .- until an hour sults. had passed. Then my system was off Editor's note: I believe companies which make to la-la land again. I called Micro C for Lance Rutallie also submitted bench­ mistakes should be willing to correct the third time, and that time, I got to marks almost identical to yours (he also them at their cost instead of making talk to Mr. Thompson. During our 10 used Lattice C V3.02). It's interesting to the customer pay for those errors. or 15 minutes on the phone we cov­ see the benchmark comparisons between the Needless to say, I will never do busi­ ered a wide range of possibilities. But Amiga and the Atari ST. ness with DAK again. when I hung up, I had a clear idea of A hunkering of knowledgeable guestima­ David Randles what I needed to do; tors came up with a set of expected times P .0. Box 8461 First I checked the power supply. for the Amiga that showed beyond a doubt Medford OR 97504 No problem ___: steady 5.045 volts. that knowledgeable guestimators don't (continued on page 88)

4 MICRO CORNUCOPIA, #30, June-July 1986 THE CHALLENGER XT-186 SINGLE BOARD COMPUTER FULLY IBM COMPATIBLE BUT FOUR TIMES FASTER

STANDARD FEATURES: •Intel 80186 CPU, 8 MHz •On-board 640K, parity checked RAM memory •8 slots for 1/0 Interface Board 6 · 8 Bit Data 2 · 16 Bit Data •4 channel 8237 OMA •8 channel 8259 Interrupt •3 channel 8253 Timer •IBM PC-AT-like Bus with true 16 bit data path OPTIONAL FEATURES: • 10 MHz operation •8087 Numerical Processor Support •NEW ROM BIOS Version 2.0

The Challenger XT-186 offers full IBM PC-XT compatibility. It --NOW AVAILABLE-- supports industry standard operating systems: MS-DOS, PC­ DOS, 1.0 through 3. 1, CP/ Mand runs all existing software with XT-88 Turbo Board higher performance. The XT-186 mother board can directly A reliable, low cost mother board with IBM PC-XT compati­ replace any existing PC or PC-XT mother board, as it has the bility, running 1.8 times faster. 8MHz hardware selectable to same physical dimensions and mounting holes. The Intel 80186 4.7 MHz. On-board 8087 socket ready for co-processor chip and 640K on-board 16 bit path RAM makes the XT-186 the installation. The 8088-2 processor with 8 1/0 $299 fastest PC currently available. slots, 640K RAM and compatible ROM BIOS •....

MOTHER BOARD, 8 MHz, 640K, RAM, 8 1/0 slots No RAM .....••..•. . $199 NEW LOWER PRICE $695.00 AT-286 Mother Board Here's the power you need to get the job done! IBM PC-AT The XT-186 ROM BIOS version 2.0 supports the IBM PC-T compatibility enables you to run a broad range of programs, combined Hard Dish/Floppy Controller on the Challenger XT- both personal and professional. The board comes with a built­ in Real-time clock and 80287 socket for future co-processor 186 mother board. With the new ROM BIOS installed the insertion. The AT-286 with the Intel 80286 microprocessor XT-186 can support two 1.2 MB floppy drives and two hard disk running at 8MHz with 640K RAM and Phoenix BIOS processes drives with the same fast access time of the IBM PC-AT. No other information faster and more efficiently. Build a high-perform· XT compatible system can offer either the speed or the disk once computer and boost your productivity. storage capacity, (230 Mbytes maximum) of the XT-186. Mother Board, 8MHz clock rate, 640K RAM, $ XT-186 ROM BIOS version 2.0 Upgrade Kit 8 I/ 0 slots, Phoenix ROM BIOS .•...... 995

$50.00 No RAM ...... $895

VISA and MASTERCARD Accepted - Please Add s3.00 Shipping HOLLISTON COMPUTER P.O. Box 615, Chepachet, R. I. 02814 401-568-0522

IBM PC-XT-AT, PC-DOS ore trademarks of International Business Machines Corp .• MC DOS is a registered trademark of Micro-Solt Corp .. CP Mis a registered trademark of Digital Research Inc

MICRO CORNUCOPIA, #30, June-July 1986 5 >PRO LOG On The PC By Gary Entsminger Starting Out In PROLOG·

PROLOG, what's in it for. you? resemblance to a procedure or function describes the Edinburgh· syntax, "mi­ What's it· like to work with? Who's in a conventional language like Pascal, cro-PROLOG: Programming in Logic" got the best ·PRO LOG package for with arguments enclosed in parenthes~ by Clark and McCabe, which describes beginners writing expert systems (or es. For example - the micro-PROLOG syntax, (published experts writing beginner systems)? by Prentice~Hall), or· D.E. Cortesi's SUCC{X Y) if excellent article, "A Tour of PRO L­ Gary has dug up some very interest- SUM{X Y1 Y). . ing information about new implemen­ OG" (in Dr. Dobb's/March '85). tations of this language. describes the successor relationship in micro-PRO LOG. PROLOG.On The PC: For a more detailed introduction to Currently, a nuinber · of PROLOG PROLOG, see "Programming in interpreters and compilers are avail­ he idea .. of logic programming PROLOG" by Clocksin and Mellish able for. the PC, ranging in price from , isn't new - PROLOG (for PRO- (published by Springer-Verlag), which a public domain interpreter from Ada Tgramming in LOGic) was first implemented in Marseilles in 1972 - but its popularity had to wait for the Japanese to select it for their Fifth Figure Ta - Turbo PROLOG Program For Reversing A List Using Append Ge11eration Project language in 1982. domains The Fifth Generation envisions com­ integerlist = integer• puter hardware engineered for logic processing (earlier generations of com­ predicates puters were engineered for arithmetic reverse(integerlist,int~gerlist) _processing) and a logic programming append ( integerlist, · ·' · language (i.e. PROLOG) for interact­ integerlist,integerlist) ing between the logic processing hard­ generate(integerlist 1 integerlist) ware and the upper level software that clauses implements problem solving strategies. reverse([],[]). PROLOG Briefly reverse([XIY],Z):-· Essentially, a PROLOG program is a reverse(Y,Y1), append.(Y1 ,[X] ,Z) ~ append([],X,X). set of logical definitions about rela­ append([XIY],Z,[XIW]):­ tions. Instead of specifying the flow of append(Y,Z,W). actions to be performed (the "how" of generate(O,[]). execution) as we do in a procedural generate(N,[NIY]):- language like Pascal or C, we ·describe M is N-1, "what" is to be executed and leave generate(M,Y). the specifics of implementation to test:- PROLOG. See Figure 1 (benchmark generate(SO,X), tests) and the factorial program in The write ( X), Last Page (this issue) for examples of reverse(X,Y), PROLOG programs. write(Y). Eight fundamental syntactic concepts · compose the PROLOG notation - numbers, variables, constants, lists, Figure Tb - micro-PROLOG Program For Reversing A List w/o Tail-recursion . clauses, .conjunctions, facts, and rules. A PROLOG program consists of a ( () D-reverse · (_X _X)) database of sentences (made up of ( (_x l_y) D-reverse (_Y _Z) if _ clauses, etc.) that define relations. _ y D-reverse (_Y (_xl.-.Z))) A clause (or predicate) is the funda­ c_x· reverse _y if mental way of specifying a relation­ _X D-reverse (_Y ())) ship between terms. For simplicity, you might think of a predicate as a ,·

6 MICRO CORNUCOPIA, #30, June-July 1986 NOW AVAILABLE for MS-DOS PC-DOS CPM-86 CCPM-86 CPM-80 SPEED - POWER - VERSATILITY -EXPRESS 2.0 FULL SCREEN EDITOR (also available. on Micro C MS-Disk HIGH PERFORMANCE AT A FAIR PRICE #19) to the very expensive PROLOG2 compiler from Expert Systems. 95 95 8 Bit Versions 16 Bit Versions In this review, I'll quickly outline the Q NL Y $29. $34. features of each of the PROLOG tools DOES YOUR TEXT EDITOR REMIND YOU OF A 1949 PACKARD •••• I tested and indicate which ones will (I Stop abusing yourself. It's time to retire that doggy old clunker! believe) · serve · the beginner .and the YOU DESERVE EXPRESS 2.0, the 280-Z of the editor world! applications programmer. ·EXPRESS 2.0 FEATURES In general, PROLOG tools have im­ • FULL ACCESS TO CP/M USERS AREAS (up to 32) with any editor command! proved significantly during the . past • NAMED DIRECTORIES supported on MSDOS VERSION! year, and all those· tested have merit. • MEMORY MAPPED VIDEO AVAILABLE FOR IBM PC and PC clones! The principal differences in the imple­ • BU.Ill-IN CP/M LIKE COMMANDS (RENAME, COPY, ERASE, TYPE, DIR, LOG)! .mentations are in syntax, features, • POWERFUL KEYBOARD MACRO'S (as many as you want)! • FULLY RECONFIGURABLE COMMAND KEYS (emulate any other editor if you like)! speed, documentation, and ease of • FAST, FAST, FAST SEARCH! .'use. As usual, ·you get what you pay • TERMINAL DATA BASE •• INSTANTLY configure for over 50 predefined terminals! for, but "higher price" doesn't neces­ • FILES LARGER THAN MEMORY handled with ease! sarily mean "better product." Read • CONTROL and HIGH BIT CHARACTERS maybe entered and edited I on. • DYNAMIC WORD WRAP/UNWRAP• FULL CURSOR CONTROL (and then some) • EASY ot SET TAB STOPS • GLOBAL/SELECTIVE/LITERAL/IGNORE CASE REPLACE • FULL BLOCK INSTRUCTIONS including PRINT, SAVE, INCLUDE, MOVE, COPY, DELETE AdaPROLOG • VARIABLE SPEED (FAST!) Bl-DIRECTIONAL AUTO SCROLL • GOTO PAGE N/ LINEN Ada comes in several flavors, from a • COMPACT on disk and in RAM. (even the 16 bit versions are only 25kbytes)! beginner's public domain version • NOT COPY PROTECTED! • AFFORDABLE •• High performance at a fair price is our motto . (mentioned earlier) through an educa-: • EXPRESS 1.0 SAMPLER available FREE on your Local Bulletin Board or for only $10.00 from : tional and virtual memory yersion to a us. EXPRESS 1.0 is not just a demo. It is a real working editor with enough of the EXPRESS ·full-featured professional implementa..; 2.0 features to demonstrate the POWER of EXPRESS .. tion. The main differences between Notes: ·them are price and features. CP/M-80 version requires a Z-80 CPU running CP/M 2.2 or greater. For $8 you get an Edinburgh core MSDOS version requires MSDOS/PCDOS 2.0 or higher. PROLOG without floating point, a We can support too many 5 inch disk formats to list them all. If you can't use one of the debugging (or tracing) facility, random listed formats, please try to give us several options. · Please allow 4-6 weeks for delivery. access to files, access to DOS com­ mands, virtual memory, etc. But, if you're just wanting a very inexpensive Gentlemen .. : .I'm ready to step up to EXPRESS ... please send the following: taste of PROLOG, this might be the ___ copies of EXPRESS 2.0 for CP/M-80 at $29.95 + $5.00 shipping and handling place to start. Unfortunately, the lack ___ copies of EXPRESS 2.0 for CP/M-86 at $34.95 + $5.00 shipping and handling ___ copies of EXPRESS 2.0 for MS/PCDOS at $34.95 + $5.00 shipping and hand Ii rig · of so many crucial features (particular­ -~-·copies of EXPRESS 1.0 for __ CP /M-80 __. CP /M-86 __ MSDOS/PCDOS ly the debugger) will probably give at $10.00 + $2.00 shipping and handling you a distorted view of PROLOG. If I COD - add $3.50 Wash. Residents add 7.8% state sales tax . wanted to spend as little as possible to Make check or money order Shipping informatiOn: discover what PRO LOG is about, I'd payable to·:· Name spend a little more and get the .FS TCI Address version. 17733 205th Ave. NE City ------State ___ ZIP --- At $49.95, .FS PROLOG includes all Woodinville, Washington 98072 .. the features I mentioned in the last Phone Day Night ----- paragraph except for virtual memory. Disk format desired: __ .Kaypro 2 ssop _Morrow MD2 SSDD . __ 5'.' Xerox SSSD · The syntax is the Edinburgh standard, __ Kaypro 2X/IV /10DSDD __ Morrow MD3 DSDD __ 5". Xerox SSDD so a combination of .FS and· a copy of __ Osborne 1 SSDD _ 5" MS/PCDOS STD SSDD _ 5" Xerox DSDD Clocksin and Mellish will be sUfficient _._Osborne 1 SSSD _ 5" MS/PCDOS STD DSDD - Zenith Z90 SSDD to get you started toward sophisticated __. Epson QX-10 DSDD _ 5" IBM CPM-86 STD SSDD _8"SSSD PROLOG programming. __· Other () ·(continued next page) TOMORROW'S CoMPUTIN°G INNOVATIONS

MICRO CORNUCOPIA, #30, June-July 1986 7 Table 7 - Benchmarks

PROLOG List Reverse(Tail) Search ( 1000 members)

PROLOG2 1 0 ! 50 0:04 0:04 0:06

NOTES: All benchmarks use recursion. The recursion limit was determined by the reverse list test which is heavily stack intensive. Reverse(Tail) uses tail recursion and virtually eliminates the use of the stack. Search is a fundamental speed te~t: searching a 1 rule database. For comparison -- the factorial limit of Turbo Pascal using integers is 7!; 33! using reals. All benchmark results shown were executed with interpreters (except Turbo PROLOG). Times for Arity's and Expert's (PROLOG2) compilers are several times faster.

PROLOG On The PC (continued from page 7) that has Y as its tail, if X is a member front-end (say, for an expert system). of the tail of the list. The possibilities are limited only by The top of the line model from Ada In micro-PROLOG, we'd write - your imagination. APES, an expert (VMA PROLOG) at $250 is almost full­ system shell from Programming Logic featured - including virtual memory, X member (XIZ) X member CYIZ) if X member Z Systems, is an example of such a shell. tree structured domains, and access to micro-PROLOG seems to have few DOS commands, which allows you to Notice the lack of brackets, the "if" problems - lack of a compiler to invoke your own choice of editor. Its instead of ":-", and the lack of punc­ create stand-alone programs and the main drawback is a lack of speed. As tuation. You might think of micro­ oddball syntax are the main ones. Its the benchmarks show (see Table 1), PROLOG as a bare bones PROLOG, documentation is excellent, and its VMA is the slowest of the PROLOGs perhaps a little harder to read initially, speed in the benchmarks was more tested. So if you're going to spend but in the long run, quite powerful. than adequate. more than $50, you might look else­ micro-PROLOG Professional is Pro­ It's $395, and for the money you get where for a PROLOG. gramming Logic Systems' top of the an excellent implementation - worthy line model. It's full-featured, including of beginner or professional. micro-PROLOG Professional a WordStar-like editor, screen cursor micro-PROLOG from Programming control, modules, and the capability PROLOG 1 And 2 Logic Systems is the· oddball in the for interfacing to assembly language. Expert Systems offers two choices of PROLOG world syntactically speaking. subroutines. PROLOGs an interpreter It implements a LISP-like syntax which It comes with a copy of Clark and (PROLOGl) and a compiler/interpreter differs from Edinburgh's in several McCabe's definitive text (a good tutori­ combination (PROLOG2). The compi­ ways, in particular in its exclusive use al) and the SIMPLE front-end which is ler increases operating speed signifi­ of parentheses in list processing. very user friendly. cantly (about 5 times), but does not For example, in the Edinburgh syn­ SIMPLE is a windowed environment compile to standalone programs. At tax an expression containing a member running above the interpreter which $1895, the compiler is out of reach for and a list might look like this - enables you to load files, trace and run all but the professional developer. programs, add and delete clauses, and PROLOGl, Expert's interpreter, is a member ( X, [XL]) • member(X,[_IY]) :- member(X,Y). edit files. good implementation of the Edinburgh Once you've gotten the hang of syntax, including numerous built-in The brackets indicate a list. Loosely PROLOG, you can bypass SIMPLE predicates for screen and window han­ translated the expression means - and its menus and interact with the dling and manipulating the database X is a member of a list that has X as interpreter directly, or if you choose via hash tables. At $395 it's competi­ its head, and X is a member of a list you can write your own interactive tive with other PROLOGs, although

8 MICRO CORNUCOPIA, #30, June-July 1986 Table 2 - Features of PROLOG Implementations

PROLOG VER COST MEM ED FLT DOS CUR FILE WIN STR MOD INT

ARITY 4.0 $350i $795ic

microPRO y y y y y

MPROLOG y n y y y

PROLOG2 1.2 $395i 384K y y y y y y y y y $1895ic

ED-- NOTES: FLT= floating point WIN = predicates for using windows a= accesses your editor i = interpreter from the PROLOG DOS = access to DOS from within STR = predicates for string handling the interpreter (or compiler) c= compiler interpreter MOD = modules 1 = line editor CUR= predicates for cursor control ic = interpreter INT= interface to other languages & compiler y = full screen editor FILE = random access to files (assembler, C, Pascal)

lacking the excellent windowed, user­ For example, given this module - MPROLOG's documentation is friendly environment (complete with MODULE Test. lengthy (running to 500 or so pages) online help) that comes with and useful, but like its editor, cumber­ some to use. I'd have traded most of PROLOG2. AlLglobal. Like micro-PROLOG, PROLOG2 cre­ those pages for a few concise, easy-to­ ates a work space conducive to learn­ locate lists of commands. body. ing PROLOG, but unfortunately, the Although MPROLOG appears to be documentation, while technically. com­ test:- an advanced system in some ways plete (running to about 500 pages) (modules, trace facilities, assembler in­ wouldn't give the beginner much com­ write(X). terface, loads of built-in predicates), it fort (if he could afford it), confirming does not beckon to the beginner and ·my impression that PROLOG2 is not In order to change "write(X)" to lacks important features for the profes­ intended for the first time PROLOG "write(Y)", you would have to focus sional - floating point, full screen programmer. However, PROLOGl the module and rule by entering - editor, cursor control, windows, and (the interpreter) does come with a access to DOS commands. tutorial. f M test Both systems are powerful, perform­ Arity ing very well on the speed bench­ then list the rule test - Arity PROLOG, like Ada PROLOG, marks (although the arithmetic is limit­ comes in a variety of flavors - an ed). list test Edinburgh core interpreter (for $95) which implements the Clocksin and MPROLOG to determine the line number. And Mellish syntax, a full-featured inter­ MPROLOG is a mainframe PROL­ then enter the editor with - preter (for $350), and an interpreter OG translated to the PC, reasonably and compiler (for $795). fast, although (like PROLOG2) limited edit The core ihterpreter cmnes with a for arithmetic. Oddly, it lacks floating copy of "Programming in PROLOG" ·point and includes a· line instead of Then make the change like so - by Clocksin and Mellish and is a good full screen editor - a weak combina­ starting point for the beginner. If you tion. 10:. write(Y) decide later to get serious about The editor is easy to use once you end PROLOG, you can move up to one of get the hang of it, but a ·lot of their professional versions. keystrokes are necessary in order to and return to command mode. It's not modify a clause in a module. a difficult process, but it is tedious. (continued next.page)

MICRO CORNUCOPIA, #30, June-July 1986 9 PROLOG On The PC

(continued from page 9) One of the strengths of a PROLOG necessary, than Turbo PROLOG (or program .is its flexibility, permitting Arity' s low-end model) is the way to the user to modify the program at fly. · Arity' s full-featured interpreter has runtime (wow!). The interpretive And if you know already that PROL­ mostly right ideas about a program­ PROLOGs append and retract data to OG indeed signals the beginning of ming environment.· Although an editor and from the program via (of course) the Fifth Generation, and you intend isn't included you can access your the interpreter. Compiled versions like to write a professional expert system, favorite from within PROLOG. The Arity PROLOG include key features of produce prototypes, construct· natural transfer is clean and quick. the interpreter in the standalone pro­ language interfaces, prove theorems, Arity' s professional versions include grams. and who knows what else, pick in numerous built-in predicates for han­ Borland' s solution again is novel. order of what you can afford - one of dling strings and files, accessing ports, Turbo PROLOG allows you to call the the heavyweights (Arity or and manipulating the database. No editor from a running (compiled) pro­ PROLOG2), micro-PROLOG (odd but fewer than 10 predicates allow you to gram and modify marked areas (data­ very good), or TP (the new kid in access the database via indices, hash bases). Type checking is again a key to town from Borland). tables, and b-trees', significantly reduc­ the implementation. In any event, if you don't ch.eek into ing search times. Apart from the controversial type this fascinating newfangled language, Arity PROLOG is definitely a profes­ checking issue, the only potential limi­ you're missing out. · sional implementation limited primari­ tation I see for TP is its lack of a Cheers. ly by a lack of screen handling predi­ virtual memory facility, a feature of all For more info - cates and a windowed programming other major PROLOGs. environment. It's fast, reliable, and the Turbo PROLOG requires 384K of Arity PROLOG: combination of interpreter and compi­ RAM, and although many PCs have Arity Corp. ler allows the programmer to build been upgraded to 640K, the profes­ 336 Baker Ave standalone. applications without the sional applications programmer might Concord MA 07142 additional expense of licensing fees: be frustrated by so little room for data 617-371-1243 (gee whiz, we used to be thrilled by Turbo PROLOG the seemingly boun.dless space of Ada PROLOG: Borland' s approach is a dramatic 64K). However, databases can be ex­ Automata Design Assoc. departure from traditional thinking. panded to disk which more or less 1570 Arran Way They've chosen a compiled rather than circumvents the virtual memory prob­ Dresher PA 19025 an inte:i;pretive implementation (allow­ lem. 215-646-4894 ing the development of standalone The documentation· is very good programs), and they're using' strict (perhaps excellent) and includes nu­ Turbo PROLOG: type checking. merous programming examples, mak­ Borland International Strictly speaking, type checking ing it an accessible (and enjoyable) 4585 Scotts Valley Dr seems to oppose the freeform spirit of starting point for the first time PROL­ Scotts Valley CA 95066 PROLOG in which data and rules are OG programmer and the just curious. 408-438-8400 often entwined in a knowledge base Al though the version I tested was jungle. , an early beta-test version (0.5) and PROLOGl & 2: But type checking, as any once­ suffered from a few minor bugs, Turbo Expert Systems International bitten C programmer knows., has its PRO LOG looks like it's going to be a 1150 First Ave merits despite the objections of PROL­ winner, for both the beginner and King of Prussia PA 19406 OG purists (I leave the philosophical professional programmer. 215-337-2300 discussion as an exercise to you-know­ who). In particular, in PROLOG, it Wrap It Up micro-PRO LOG: adds speed to program execution. As usual, I don't think any review Programming Logic Systems A decrease . in the bookkeeping can completely express the desirability 31 Crescent Dr (which is required of other compiled or undesirability of a product. Tastes Milford CT 06460 PROLOGs) enables Turbo PROLOG to differ. Your piques differ from mine. 203-877-7988 blast through data and rules in mind In this case, each PROLOG imple­ boggling numbers of logical inferences mentation has merit, and I can't say MPROLOG: per second (or LIPS to the initiated). definitively that any one is THE one. Logicware Turbo PRO LOG. is much faster than If you're only a little curious about 5000 Birch St, W Tower St the other PROLOGs I tested. PROLOG, then save your nickels, Newport Beach CA 92660 In addition, its programming envi­ dimes, quarters, and dollars, and peek 714-476-3634 ronment is exceptionally user friendly, into the public domain or maybe the with Reflex-like multi-windows and ADA .FS version. menus and an array of other features If you think you might be serious, • •• (see Table 2). but hate to spend a penny more than

10 MICRO CORNUCOPIA, #30, June-July 1986 -----EPIC SALES, INC.------FIXED DISK DRIVE SYSTEMS 10MEG 20MEG 30MEG Tl PC (Zobex) $699 $ 749 $ 899 Tl PC (Western Auto.) 999 1049 1199 Tl PC (SASI) 599 649 799 Tl Bus. Pro. 749 799 949 IBM PC and Compatible* 549 599 749 Sanyo 550/555 NIA 799 949 Zenith Z-100 N/A 899 N/A For External Units Add $200 Above include drive, controller, cables, one year warranty and 30 day return privilege. Call for pricing on larger size drives. *Compatibles: AT&T, Compaq, Tandy, Columbia, Corona, Zenith, Others. - TAPE BACKUP SYSTEMS Irwin Internal 10 Meg ...... $ 595 Irwin Internal 20 Meg (for AT) ...... 695 Wangtek Internal 60 Meg ...... 1049 For External Units Add $100

-AT&T PERSONAL COMPUTER - OLIVETTI PERSONAL COMPUTER 6300, Mono, 640K, 2 Floppy, DOS, Basic .... $1995 (Same as AT & T 6300) 6300, Mono, 640K, 1 Floppy, 20 Meg, DOS, Basic . 2395 Mono, 640K, 2 Floppy, DOS, Basic ...... $1895 6300 Plus, Mono, 640K, 2 Floppy, DOS, Basic . 4295 Mono, 640K, 1 Floppy, 20 Meg, DOS, Basic .. 2295 For High Resolution Color Add ...... 459 For High Resolution Color Add ...... 459

- IDS PERSONAL COMPUTER I' I Mono, 256K, 2 Floppy, P-Port, DOS ...... $1195 Mono, 640K, 2 Floppy, 20 Meg, P-Port, DOS 1795

- FIXED DISK DRIVES FOR IBM AT AND -MODEMS Tl BUSINESS PRO Hayes 1200B Internal (IBM or Tl) ...... 399 Prentice Pop Com External (IBM or Tl) ...... 339 20 Meg Seagate ST-225 (65 ms) ...... $ 439 20 Meg Seagate ST-4026 (40 ms) ...... 739 - PC REPLACEMENT POWER SUPPLY 30 Meg Seagate ST-238 (65 ms) ...... 589 150 Watt Side Switch ...... 109 30 Meg Seagate ST-4038 (40 ms) ...... 959 - INTEL MATH COPROCESSOR IC 33 Meg Rodime R0-203E (55 ms) ...... 929 8087-3 (5 MZ) ...... $ 150 51 Meg Seagate ST-4051 (40 ms) (Bus. Pro. only) 1149 8087-2 (8 MZ) • ...... 175 72 Meg CDC Wren (35 ms) ...... 1949 -RAM CHIPS 119 Meg Maxtor 1140 (30 ms) ...... 4595 4164 (150ns) ...... 1.30 - OKIDATA PRINTERS 41256 (150ns) ...... 4.00 Model 182-IBM, 120 CPS, 9 in. Carriage ...... $ 259 - NEC REPLACEMENT PROCESSOR Model 192-IBM, 160 CPS, 9 in. Carriage ...... 439 V-20 (5 MZ 8088 REPLACEMENT) ...... $ 20 Model 193-IBM, 160 CPS, 15 in. Carriage ...... 609 V-30 (8 MZ 8086 REPLACEMENT) ...... 35 - FLOPPY DISK DRIVES - TAXAN COLOR MONITORS Epson SD-521 DSDD 5.25 in. Floppy Drive ...... 119 Taxan Model 630 High Resolution Monitor ...... 539 Shugart SA-465 OSQD 5.25 in. Floppy Drive ...... 159 Taxan Model 640 High Resolution Monitor ...... 639 Siemans FD 200 8 in. DSDD Floppy Drive ...... 185

- EXPANSION CARDS STB Super RIO Plus II Multifunction Card (64K) ...... $ 259 - OTHER PRODUCTS STB Graphics II Plus Card ...... 305 World Media 5.25 in. DSDD Floppy Diskette ...... · $ 10 STB Chauffeur Mono Graphics Card ...... 259 Disk File 120, 5.25 in. Disk Storage . • ...... 9 STB Super 1/0 Plus Card ...... A-8 Switch Box ...... • ...... 55 195 Keytronic KB5151 Keyboard ...... 199 STB Serial Card ...... 95 Cabinet and Power Supply for (2) 5.25 in. Drives ...... 72 STB Parallel Card ...... 79 Zobex ZX2T Controller CARD for TIPC ...... 335 Western Digital WX2S Controller Card for IBM PC 169 Taxan Model 555 Color Graphics Card ...... 229 EPIC SALES INC. Central Point Copy II PC Option Board ...... 89 Microsync dClock Real Time Clock ...... 59 132 WALNUT PLANO CENTER Western Automation S1 Multifunction Card (OK) ...... 355 GARLAND, TX 75042 Western Automation S3 Multifunction Card (OK) ...... 545 TOLL FREE ORDER LINE: 1-800-223-EPIC Western Automation Clock Option ...... 125 512 K Ram Expansion Card for Tl PC ...... 259 TECHNICAL INFO AND INQUIRIES: 1·214-272-5724 · 128K Ram Expansion Card for Tl Bus. Pro...... 169 TERMS: CASH, CHECK, COD, MASTERCARD AND VISA ADD 3%, Epic 1 Meg Ram Expansion Card for Tl Bus. Pro...... 995 AMERICAN EXPRESS ADD 5%. TEXAS RESIDENTS ADD 6.125% SALES TAX. Epic 2 Meg Ram Expansion Card for Tl Bus. Pro...... 1595 Epic 3 Meg Ram Expansion Card for Tl Bus. Pro...... 2195

MICRO CORNUCOPIA, #30, June-July 1986 11 Expert Systems By Ramachandran Bharath And Logic Programming Mgmt, Mktg, & C.I.S. Dept. Northern Michigan University Marquette MI 49855

What is an expert system? How is includes the informal and highly relia­ Eventually, there was a shift to an it created? Why are list processing ble (but not absolutely certain) know­ approach best summarized by Dr. Fei­ languages like PROLOG associated ledge which experts work with and genbaum, the designer of the DEN­ with expert systems rather than more the formal principles which compose DRAL expert system for spectrograph­ familiar procedural languages like Pas­ the knowledge in any field. ic analysis of chemical structure cal? Here are some answers. (generally regarded as the first expert Inference Engine system). The Inference Engine uses the facts "In the knowledge is the power," n expert system is a program and rules in the knowledge base in he said .. Or in other words, the effec­ which can function as a con­ conjunction with the particular circum­ tiveness of an expert depends not only A sultant or advisor with a level stances of a specific situation to draw on his native intelligence but also on of skill and reliability comparable to conclusions (or inferences) and give the vast stores of knowledge he ac­ that of a human expert. advice. quires in a specific field. No all-pur­ Although expert systems currently pose technique will work in all fields. replicate the skills of human experts, Explanation Subsystem This approach led to some useful future systems may be developed in The Explanation Subsystem, at a expert systems - DENDRAL; meta­ areas of problem solving where there user's request, explains the underlying DENDRAL; MYCIN, a program for are no human experts. facts and rules the expert system used diagnosis of bacterial infections; The aim of this article is to outline to draw its conclusions. Part of this PROSPECTOR, a program for geologi­ the characteristics of an expert system subsystem is a facility for explaining cal forecasting; and so on. For more and discuss why logic or list process­ why the system asks for additional details on these programs see refer­ ing languages are more convenient for information. ences 1 and 2. implementing expert systems than procedural languages like C, Pascal, or Natural Language Interface If-Then FORTRAN. The Natural Language Interface ena­ Marvin Minsky of MIT, a pioneer In particular, we'll examine the pro­ bles the user to interact with the and leader in Artificial Intelligence, · gramming language PROLOG, Japan's system in a language as close· to has written: "In a sense, today's ex­ choice of a starting point for "Fifth English (or French, or German, etc.) as pert systems demonstrate a marvelous Generation" or "Knowledge Informa­ possible. fact we did not know 25 years ago: if tion Processing Systems." you write down if-then rules for a lot Knowledge Acquisition And Refine­ of situations and put them together General Principles ment well, the resulting system can solve The important facets of an expert The Knowledge Acquisition and Re- · problems that people think are hard." system are - finement Subsystem allows additions ·In that sense, a conventional pro­ to and revisions of the knowledge and gram makes use of "knowledge" too, 1. Knowledge Base rules in the knowledge base. for any if-then statement in any lan­ 2. Inference Engine See Figure 1, a schematic diagram of guage is the application of knowledge 3. Explanation Subsystem an expert system. to draw a conclusion. But the distinc­ 4. Natural Language Interface tive feature of an expert system is that 5. Knowledge Acquisition And Refine­ Expert Or Conventional the knowledge base can be modified ment Subsystem An expert system differs primarily and· the inference engine (an interpret­ from a conventional program by em­ er) can apply information from the Knowledge Base phasizing the knowledge base. knowledge base to the current situa­ The Knowledge Base includes the In the 1950s and 1960s, the search tion. components of the program which for ways of making computers into The separation of knowledge base contain relevant knowledge for a field more powerful problem-solvers fo­ and inference mechanism could be of expertise. It contains suitable repre­ cused on discovering. GENERAL prob­ achieved in a conventional language, sentations. of facts and heuristic rules lem solving techniques. While this but it's far easier to implement in (uncertain rules which can be relied on approach did yield some results, for languages like LISP and PROLOG. most, but not all, of the time). example in mathematical theorem The key feature of these two Ian.; In other words, the knowledge base proofs, it wasn't very successful. guages is the lack of a clear distinction

12 MICRO CORNUCOPIA, #30, June-July 1986 Figure 1 - Block Diagram For Expert System Figure 2 - Knowledge Base

elections( Country) :- KNOWLEDGE INFERENCE economy( Country, Condition), BASE ENGINE Condition = booming, incumbent(Person, Country), write(' 0.6 chance of win for '), nl, write (Person), Knowledge nl, Acquisition Consultation, I • And Explanation elections(Country) :- Refinement challenger(Person, Country), write( 'challenger '), write( Person), nl, write( 'likely to win'), NATURAL nl, LANGUAGE I • INTERFACE economy(usa,booming). incumbent(reagan,usa). challenger(mondale,usa).

USER

between "data" and "program." The economy is booming, predict a win for PROLOG will match the variable knowledge base is both program and the incumbent, with· a probability of "Who" to the cons~~nt "reagan" and data, so the user can modify not only 0.6. If the economy isn't booming, output - data but the program itself at runtime. predict a win for the challenger. In other words, programs modify If we put in all the information Who .... reagan. themselves as they acquire more infor­ about the incumbent and the challeng­ mation, a key aspect of powerful prob­ er, the rules (discussed above) for Similarly, the question - lem solving. _drawing conclusions, and express it in standard PRO LOG syntax, we'd have ?- challenger(mondale, Where). Knowledge Engineering the knowledge base shown in the The big problem in developing an listing in Figure 2. would generate the response - expert system is extracting and refin­ Let's review the basic principles of ing the set of rules and facts from a PROLOG to see how this works. Where ... usa. human expert. A PROLOG program consists of This task, known as "knowledge facts and rules. based on the principles of pattern engineering," has obvious problems. FACTS · express relationships be­ matching. The fact, Where, is a varia­ For example, an expert may not be tween objects. Fm: example, the fact - ble and can be matched with "usa". aware of all the rules and knowledge incumbent(reagan,usa). - relates the This kind of patt~rn matching is usual­ he or she uses to solve a problem. two objects "reagan" and "usa". ly referred to as "satisfying .a goal." So the knowledge engineer may One standard PROLOG convention In the above examples, w~ set the have to do a great deal of sleuthing as (the Edinburgh syntax) expresses con­ goals - he builds the knowledge base. And, of stants in lower case and variables with course, the more complex the field, an upper case letter as the first letter. ?- incumbent(Who,usa), and ?-chal­ the more difficult the task. PROLOG works by matching the lenger(mondale, Where). Let's consider a simple PRO LOG questions entered by the user to facts program or ''knowledge base'' which in the database. So, if a user enters - and PROLOG met them. makes predictions about election re­ sults using a simple rule - if the ?-incumbent(Who, usa). (continued next page)

MICRO CORNUCOPIA, #30, June-July 1986 13 EXPERT SYSTEMS AND LOGIC PROGRAMMING

(continued from page 13) Figure 3 - Excerpt From Figure 2

elections(Country) :­ · PROLOG Power economy(Country, Condition), PROLOG gets its power from rules. For example, in one of the RULES in Condition = booming, Figure 2 we have the segment shown incumbent(Person, Country), in Figure 3. write(' 0.6 chance of win for '), If we enter the goal - nl, write(Person), ?- elections(usa). nl, ! • the system will match "elections" with the left of the :- sign, and then continue· to match each of the goals on the right of the :- sign in turn. Figure 4 - Addition To Figure 2 Think of the ":-" as signifying "if", so in general a rule states that the goal (after deleting on the left of ":-" (the HEAD OF THE incumbent(reagan,usa), RULE) can be satisfied IF the goals· on challenger(mondale,usa), and the right of the ":-" (the BODY OF · THE RULE) can be satisfied. economy(usa,booming) ). So to satisfy - challenger(Name, Country) :~ ?-elections(usa). write('Who is the challenger?'), nl, the system first matches our question read( Name), . with the HEAD, elections(Country), asserta(challenger(Name, Country)). ' and identifies the variable ''Country'' as "usa". Next, it proceeds to the incumbent(Name, Country) :­ ··BODY of the rule and tries to satisfy the goals one by one. write( 'Who is the incumbent?'), The first goal is economy(usa, Con­ nl,. dition), and it can be matched with the read( Name), fact, economy(usa,booming). The vari­ asserta(incumbent(Name, Country)). able "Condition" is .matched with ''booming''. economy(Country, Condition) :- The next goal is Condition - boom- write( 'Is current state of economy '), ing, and it's now true. · write('booming?(y or n)•), Next, the system tries the goal "in­ nl, cumbent(Person, usa)" and identifies read(y), the variable "Person" with "reagan". asserta( (economy(Country, booming) :- !) ). Then it goes on to examine the other goals. The goals with "write" are self­ economy(Country, Condition) :- explanatory, and "nl" stands for asserta( (economy( Country, shaky) :- ) , "print a new line". fail. To conclude this very condensed review of PRO LOG, let's suppose that instead of - Figure 5 - Rule For Using Expert System economy(usa, booming). economy(Country, Condition) :- we had.- write( 'Is current state of economy•), write('booming?(y or n)'), economy(usa, shaky). nl, read(y), in our knowledge base. The system asserta( (economy(Country, booming) :- !) ). would be unable to "satisfy" the goal '' economy(usa, booming)''.

14 MICRO CORNUCOPIA, #30, June-July 1986 CPM-80 LIVES When agoal fails, the system revers- rule, we can see that the first time we ON YOUR. PC ' es its tracks and tries to find an ask the question, the system will ask CP/Mulator puts a 4mhz 8 bit alternative solution for the next goal for the name of the incumbent and CPM-80 emulator in your IBM-PC on the left. This very important aspect add this to the database. for only $99. of PROLOG is called BACKTRACK­ Having satisfied. all the goals, it will • Execute 8 bit CP/M programs at ING. print the message - 4 mhz. Stop waiting around for In our example, PROLOG will go those slow software emulators down the knowledge base trying the 0.6 chance of win for reagan at twice the price of this speed second rule with the same head '' elec­ demon! tions( Country)". Eventually, it will as before. But now, if we ask - • CP/Mulator makes a fantastic print the message ''challenger mon­ CP/M development environment dale is likely to win". ?-elections( usa). and allows you to use all your CPM-80 tools, and the IBM-PC tools too! Learning it will proceed directly to the message, • Why write off that expensive We can jazz up the above program having "learned" the condition of the package that you bought for to make it a more helpful learning economy and the name of the incum­ CPM-80 just because you up­ program. bent. grade to a IBM-PC? Apply the (Note: the cut operator (!) is, rough­ And just as we can ''assert'' to add $99 solution and keep it working. ly speaking, a way of telling PROLOG information to the database, we can No retraining or· conversion not to look for alternative solutions.) "retract" to remove it. blues! Suppose we don't want to specify Suppose we enter - o CP/Mulator includes the NEC who the challenger is, who the incum­ uPD70108 processor which in­ ;bent is, and what the state of the ?-retract(( economy(usa,booming) :- ! )). creases the speed of your economy of the usa is, as we did IBM-PC by at least 10%. 100% earlier. Instead we want the program and then ask __:, compatible with existing IBM-PC software and 8087 compatible. to get this information by prompting PURCHASE THE SOFTWARE the user. ?-elections( usa). ALONE FOR ONLY $69!! We can arrange this new structure Source Information by deleting the facts about challenger, The system will then ask about the P.O. Box 2974 incumbent, and condition of the econ­ condition of the economy, and if we Warminster, PA 18974 Efrj. .omy currently in the knowledge base now say '' n'' to indicate the economy ~ Phone (215) 628-4719 and adding the new information in is not booming, the system will back­ the listing shown in Figure 4. track, add the information - steps required for finding a solution. Suppose we again ask - There are slight differences in the economy(usa,shaky):- ! various implementations of PROLOG; ?-elections(usa). my examples have been run success­ to the knowledge base, and then try fully with EDPROLOG (from Ada) and After the same train of analysis, we the second rule for elections, asking PROLOG V (from Solution Systems). see that the system will try to satisfy for the challenger's name. That name the goal - is added to the database, and the References: message about the challenger being 1. WINSTON, P.H. and PRENDER­ ?-economy( usa, Condition). likely to win is output. GAST, K.A. (editors) - The AI Busi­ ness: The Commercial Uses of Artifi­ first, but finding no fact to match will Wrap Up cial Intelligence (MIT Press, use the rule shown in Figure 5. I hope this brief introduction to Cambridge, MA 1984). The goal, read(y), is satisfied if the expert systems has whetted your ap­ 2. HAYES, J.E. and MICHIE, D. user types '' y'' to confirm the econo­ petite for more information about the (editors) - Intelligent Systems (John my is booming, and the system pro­ possibilities of this fascinating lan­ Wiley/Halsted Press, New York, NY ceeds further. guage. 1983). See especially the article Now the goal '' asserta'' tells the In PROLO.G, the emphasis is on "Knowledge Engineering: The Ap­ system to add the fact "econo­ describing the structure of the prob­ plied Side" by E.A. Feigenbaum. my(usa, booming)" to the knowledge lem, rather than specifying the steps 3. CLARK, K.L. and MCCABE, F.G. base as a newly learned bit of know­ required in searching for a solution. - PROLOG: A Language for Imple­ ledge, and the next time we ask a You might think of a conventional menting Expert Systems, in MA­ question about "elections(usa)", the language as being "imperative," i.e. CHINE INTELLIGENCE 10 edited by system won't ask for information, but giving specific commands to the com­ Hayes, J.E., Michie, D., and Pao, Y-H will match the goal "econo­ puter, and PROLOG as being "asser­ (Halsted Press, New York, NY 1982). my(usa,Condition)" with the new tional," i.e .. describing or making as­ (added) fact. sertions about the problem, leaving it Similarly, by analyzing the elections to the system to· work out the specific •••

MICRO CORNUCOPIA, #30, June-July 1986 15 8280 Clairemont Mesa Blvd., Suite 117 San Diego, California 92111 ERAC CO. (619) 569-1864 Call tor our Test Equfpment Mailer! KAYPRO EQUIPMENT LOW PROFILE IC SOCKETS *SPECIALS* 8 Pin 50 per Tube ...... $2.50 9" Amber CRT ...... $39.00 ****************** 14 Pin 25 per Tube ...... · .... 1;50 9"Green Monitor .... ; ...... 35.00 Bahco Wire Cutter "Swedish" ... 6.95 16 Pin 25 per Tube ...... ·; .... 2.25 .. 12" Green Monitor ...... 45.00 ****************** 18 Pin 25 per Tube .. .' • .' .. .- .... 2.i50 · .. 81 Series ROM 's ...... 7.00 CPU/SUPPORT 20 Pin 20 per Tube ...... 2.00 Keyboard (Kaypro) : ...... 75.00 , MC68000-8 CPU ...... $12.50 24 Pin 20 per Tube ...... 2:50 Keyboard Siemens w/case ...... 65.00 C80186-3 ...... 27.00 28 Pin . 10 perJube .. : ... , ...... 2.00 Wiring Harness ...... 7. 50 C80186-6 ...... 9.00 40 Pin 10 per Tube ...... : ,. HO ZBO CPU ...... 1.00 KAYPRO MAINBOARDS 16 Pin Component Carrier, Gold .. ~ -: 25 ·. ZBOA CPU ...... "· .... 2.50 PRINTERS . K2 With Sockets ...... $39.00 ZBOA PIO ...... ·...... 2.50 Centronics 703 ..... : ...... $395.00 · K2 Populated - Tested ...... 129.00 Z80A SIO ...... 5.00 Centronics 588 - As Is ...... 125.00 K2 with PR08~3 Mod ...... 239.00 Z80A OMA ...... 10.00 This one runs at 2;4 & 5 MHz, up to 4 NEC2000 w/Single Sheet Feed. 1200'.00 drives SS, DS, or Quad drives. New ROM 8088 ...... 10.00 has screen dump and step speed select. 8089-3 ...... 29. 00 S100 With. manual & software, tested and 08742 CPU/EPROM 12 MHz . .- ... 20.00 CCS 2200 12 slot MF ...... $375.00 guaranteed 30 days. D8284A ...... 3.00 CCS 2810A CPU ...... 210.00 K2 P~08-3 Mod. EXCHANGE ... 149.00 2065 64K RAM , ...... 250.00 We w)/l 4pdate your K2 or K4 as above. 08288 ...... 9:oo 2422 FDC 51/4" & 8" .. ~ ...... 325.00 · Mai( working Main board. 4164~ 15 ...... 1. 50 ; 27181/0 2 Ser:, 2 Par ...... 225.00 We can install double or quad drives 41256-15 ...... 3.00 and check complete package ..... CALL 41256-12 ...... 3.25 POWER SUPPLIES. K10 Populated - Tested ...... 250.00 MODEM - WALL PLUG,;IN TYPE - WD1002-5 Hard Disk Controller . 200.00 TMS 99532 (Modem) ...... $12.00 6VAC/.95A ...... $1 :35 Host Interface Board . ~ ...... 15.00 TMS 99531 (Dialer) ...... : .... 8.00 - LINEAR - CABINETS FLOPPY CONTROLLER Condor Model CP731 DC Power Supply. K2X ...... $45.00 WO 1791 ...... $9.00 + 14V/4A, + 5V/7A, ± 15V/.5A. $16.00 . K10 ·" ...; ...... 45.00 WO 1793 ...... 5.00 Power Supply with Bottom portion with front and back only. WO 1797 ...... 7.00 Nicad Pack 12V/.5AH ...... 6.50 CRT Bezel ...... 12.00 WO 2797 ...... 9.50 14KV DC/DC TV Power Supply ... .4.50 : .-SUBSTITUTE CABINET + 5V/1A, .:_ 5V/.2A, + 12V/1A, BAUD GENERATOR -12V/.2A, -24V/.05A ...... 15.00 This cabin.et has a 12" green monitor on top WO 8116 ...... $4.50 that swivels left to right with a 3-position · + 24V/2.2A ...... ' .•...... 8.00 vertical.movement. The base is 16"x18"x5" MISCELLANEOUS and conta'ins a switching power supply. It UC3524 Sw. Reg ...... $ .85 SWITCHERS 5V/9.5A, 12V/3.8A, -12V/.8A $39.00 .has room· for the main board, two drives. a WD1010 ...... 20.00 modem a.nd whatever else you want to stuff 5V/3A, 12V/2A, -12V/.4A .....'29.00 WD1014 ...... 28.00 · . in it. It comes with a Siemens keyboard with 5V/10A ...... 25.00 · case and is programmed like the Kaypro WD1015 ...... 28. 00 5V/75A, +12V/8A, +12V/8A .. 55.00 · keyboard with many extra Wordstar and MM58167A Clock Chip ...... 5.50 5V/20A ...... 35.00 · CPIM commands. The whole cabinet is CA301 Op Amp ...... 35 color-coordinated and sharp looking. Nobody FLOPPY DISK DRIVES will ever suspect this is a Kaypro. Now you CA083 Op Amp ...... 45 can build the ·classiest Kaypro computer 2N3055 ...... 70 - 1/3 HEIGHT - ever for less than $550.00. The 2N6852 .. : ...... 1.00 Okidata DSDO ...... $99.00 . complete cabinet is a steal at $179.00 Voltage Regulators Supplied wlsub-panel to make Y2 ht. · MISC. CABLES LM323K + 5V/3A ...... 4.50 - 1/2 HEIGHT - 9" ·50 Pin - 50 Pin Header ...... $2.50 LM78H12 + 12V/5A ...... 5.00 Mitsubishi M4851 OSDD 40 Tr . $139.00 14'~.40 Pin - 40 Pin Header ...... 2.25 6116 2Kx8 Static Ram ...... 1. 50 Mitsubishi M4853 DSDD 80 Tr .. 139.00 9". Hard Disk - 20 Pin Header ..... 2.00 VIDEO CONTROLLER Qume Trak 142 51/4" OSOO ..... 99.00 ··.14'' Dual lnline 16 Pin Male (2) ... 2.00 6545 ...... $7.00 Tandon TM 848-1 8" SSDO .... 149.00 6545A-1 ...... 8.00 Shugart 475 OS Quad ...... 159.00 Pfoneer LD700 Laser Video 6845 ...... - ...... 6.00 - STANDARD HEIGHT - Disk Player ...... $299.00 EPROMS Shugart SA460 OS Quad "As is . $36.00 Shugart SA850 8" DSDD ...... 199.00 Wireless Remote Control .. 55.00 2716 ...... ~ ...... $3.50 2732 ...... 3.75 Remex RFD4000 ...... 199.00 ERAC CO. 2764 ...... 2.25 Persci 277 2x8" ...... 399.00 8280 CLAIRE MONT MESA BLVD., SUITE 117 2764-25 ...... 3.50 TERMINALS SAN DIEGO, CA 92111 (61 9) 569-1864 . 74LS SERIES lnterTube II Smart (B&W) ..... $195:00 HOURS: Mon.· Fri. 9 · 6 - Sat. 10 ·4 HCOO ...... $ .35 lnteColor 3602 Smart (Color) ... 329.00 MINIMUM ORDER - $15.00 HCU04 ...... 40 MISCELLANEOUS TERMS: VISA, MasterCard, Certified LS 125 ...... 40 Headset/Boom Microphone ...... $3.95 Checks, Money Order, NO COD. Visa LS 373 ...... 60 Lead Acid 0 Cell 2V/2.5A ...... 1.50 and MasterCard add 3%. Personal LS 375 ...... 60 Nicad Pack 12V/.5AH ...... 6.50 checks must clear BEFORE we ship. 4073 ...... 35 5 Blade Muffin Fans ...... 7.50 Include shipping charges. California 7406 ...... 40 Joystick 4 Switches 1" Knob ..... 5.50 residents add 6% Sales Tax. For more Elgar 400W Un int. Power Sup ... 375.00 info please call - DON'T WRITE! We SOLAR CELLS don't have time to answer your letters. 2112" x 5/16", .5V/ .5A ...... $2.25 10 Ft. Line Cord ...... 1.65

16 MICRO CORNUCOPIA, #30, June-July 1986 VEDIT® Plus Text Editor The Navy charts new ·-··-··-· ··-·-- concepts with it. .. GM engineers the future withcJ.~~~~L3~.=z~.-.· ·-·-- ~- -··~ \ 1_ ... r•• ) .r-···· ····~ .... '-./ .... e it... I~ National Can preserves 1actsc. I'~~ )1. ~ wit,, h it...- GE has b.rig - h-~?-~'C ideas with it. .. Heres why_you ~\n/'· shouldn't be without it. ~

Every day, VEDIT PLUS helps thousands of • SPEED-VEDIT PLUS not only works hard, programmers, writers and engineers get it works fast. Faster, in fact, than any other down to business. text editor on the market. So why do people who could have ANY • EXPERIENCE-Six years ago, CompuView text editor prefer ours? For a lot of reasons, revolutionized the concept of microcom­ including: · puter text editing. And we've been improv­ • CAPACITY-With VEDIT PLUS, file size is ing our products and seNices ever since. never a problem. And virtual disk buffering simplifies editing of even the largest files. • FLEXIBILITY-VEDIT PLUS lets you edit up Special Offer: Order a VEDIT PLUS to 37 files simultaneously. So you can cut text editor for S225 and we'll include our V-PRINT™ document formatter­ and paste. Edit programs. Edit text. Even perform numerous search/replace functions a S120 value-absolutely free. in several files without user inteNention. * • CUSTOMIZATION-With VEDIT PLUS, you Call CompuView today at can create your own on-line editing func­ 313/996-1299. You'll be in good tions with keystroke macros. Develop your company. own on-line help screens. Determine and revise your own keyboard layout easily. CompuView® CompuView'RJ Products Inc., 1955 Pauline Boulevard-Suite 300, Ann Arbor, Michigan 48103, TELEX 701821 Available for PC DOS. MS-DOS, CP/M. CP/M-86. *Free sort. compare. print and main menu macros included; optional 8080-8086 translator or mailmerge. SSO each.

MICRO CORNUCOPIA, #30, June-July 1986 17 Opening Bids In Bridge By Margaret M. Sklar An Expert System Mgmt, Mktg, & C.I.S; Dept. Northern Michigan University Marquette.MI 49855

In the life of every new language 5. Which is the longest suit (or suits if from a player and prints out a listing there comes a point where it's time to there are two or more equally long of the hand and an appropriate bid. stop talking and start writing. In this ones) BRIDGE uses the following rules to article, Margaret lets her code do most 6. A list of all of the cards held in each determine the bid - of her talking. It's not a bad way to suit learn PROLOG and expert system 7. Information about the total points in 1. If the point count is less than 13, _design. the hand pass. 8. The point count and card count of 2~ If the point count is between 16 and each suit 18 inclusive, and there's even distribu­ 9. The bid tion, bid 1 notrump. n an accompanying article ("Expert 3. If there are two equally long suits, Systems And Logic Programming") See Figure 1 - "Facts In The Know­ bid the higher ranking of touching I Dr. R. Bharath discusses the ledge Base." suits; or the lower ranking if the suits fundamentals of expert systems pro­ The facts "major," "minor,'.' and are not touching. gramming. In this article, I'll present a "touching" are static and can be con­ 4. ·.If there's a long suit (6 or more simple expert system (called BRIDGE) sidered definitions .. All of the other cai:ds), bid that suit. for determining opening bids in facts are updatable by information in­ 5. If there's a five-card major st.tit, bid bridge. put by the user. it. BRIDGE decides an opening bid The Knowledge Base also contains 6. · If there's a fout-card · minor suit based on an input hand and a set of the basic rules on which the . system containing an honor, bid it. production rules which evaluate the operates (Figure 2) - 7. If there's no really biddable suit, but holding and determine the bid. While 3 or more clubs, bid clubs. the system can be· expanded to include 1. List processing rules 8. Otherwise, . follow Rule 3 with the more of the bridge auction, I've in­ 2. A rule to determine if a given hand longest of not-so-long suits. cluded only the basic bidding rules. has even distribution The five essential facets of an expert 3. Rules for finding the longest and We want exactly one bid. The rules system discussed by Dr. Bharath next longest suits are evaluated in the order given (Knowledge. Base, Inference Engine, 4. Rules for evaluating the hand above. ·If one succeeds, none of the Explanation Subsystem, Natural Lan­ 5. A rule for constructing a list of others is attempted. The short club guage Interface, and Knowledge Ac­ cards held in the individual suits (Rule 7) · is used when there are no quisition/Refinement System) are all biddable suits but opening hand (13 or present in my expert system. Also included is a more complex rule more) points. Rule 8 is used when i'll review each of the facets and for deciding the opening bid (Figure even· a short club is impossible. show its code (in PROLOG). PROL­ 3). After the bid's· decided, it's printed OG's goal-seeking methods make it · A Knowledge Base can be extensive, and added to the Knowledge Base as a particularly suitable for this type of since it needs to hold all of the fact. program. system's working knowledge. The For simplicity, the bid is always one Knowledge Base includes .basic facts of a suit, one notrump, or pass. Knowledge Base plus the rules which specify how those Deciding '.an opening two or three bid The Knowledge Base contains the facts and how user input will be would be more complex but follow facts and rules necessary to decide a manipulated. similar procedures. bid, the information - · Inference Engine Explanation Subsystem ,., 1. That spades and hearts are major This part of the system uses the An important aspect of an expert suits Knowledge Base to draw inferences (or system is its ability to explain how it 2. That diamonds and clubs are minor conclusions) based on a set of rules. In arrived at a conclusion. This explana­ suits BRIDGE, the inference engine is sim­ tion should include information about 3. Which suits can be considered ply the PROLOG interpreter. the rules and the Knowledge Base that 11 touching' I PROLOG decides the bid by satisfy­ led to the conclusion. ln BRIDGE, 4. Whether the hand has even distri­ ing goals in the decide_bid rule (Fig­ after the bid is decided, the player can bution ure 3). Decide_bid gets information ask- ?-why.

18 MICRO CORNUCOPIA, #30, June-July 1986 and receive an explanation, based on Figure 1 - Facts In The Knowledge Base the facts and rules in the Knowledge Base and the Inference Engine. Figure I* which suits are major and minor */ 4 lists the Explanation Subsystem. major( spades). Natural Language Interface major( hearts). In order to make the system avail­ mirior(diamonds). able to casual users, not just to ex­ minor( clubs). perts, the program is interactive. To begin the decision process, enter the I* which suits are touching */ query: touching(spades, hearts). ?-decide_bid. touching(hearts, diamonds). touching(diamonds, clubs). touching(clubs, spades). prompts BRIDGE to get information about the hand. The get_values rule (Figure 5) is called from decide_bid I* is the hand evenly distributed */ and prints the message - even_distr(no).

Enter your hand at the prompts I* Indicate the longest suit(s) */

It then calls on the get_suits rule longest(spades, 5). four times to ask for information about longest(hearts, 5). each suit. (You answer 'y.' or 'n.' about honors and specify low cards I* Give more detailed information with numbers followed by periods.) on the hand -- one fact To use the system, you need only for each possible honor (ace, know that entering "decide_bid." king, queen, jack) and one fact will start the decision making process for the number of small cards and that entering "why." will explain· in a suit. */ the process. A more sophisticated user could, of course, call any of the other values(clubs, small, 0). rules or query other facts in the know­ values(clubs, y, 1). ledge base as well. values(clubs, n, 2). values(clubs, n, 3). Knowledge Acquisition & Refinement values(clubs, n, 4). The Knowledge Acquisition Subsys­ values(diamonds, small,1.s). tem (l/O) is an ongoing part of the program. Information is entered and I* Contains the .list of ca~ds in saved regarding the hand, suits, etc. the specified suit. */ It can be argued that the bid fact is "learned," so, alternatively, a list of hand(clubs, [jack]). hand(diamonds, [queen,x]). hands and bids could be remembered. hand(hearts, [ace, jack, x, x, x]). The "learned" facts would be hand(spades, [ace, king, x, x, x]). searched before the decide_bid op­ tions were checked. I've ignored this I* Tell the D of points and cards alternative in BRIDGE. in a suit. */ Figures 2 through 5 contain the information-gathering rules. points(clubs, 1, 1). Since these rules also update the points(diamonds, 2, 2). Knowledge Base, they serve the points(hearts, 5, 5). Knowledge Acquisition function as points(spades, .6, SJ. well as their primary function. I* Contains the value of the hand */ ••• hand_count(17). Figures 2 through 5 I* Contains the value of the bid. */ on pages 20 through 23. bid([1,spades]).

MICRO CORNUCOPIA, #30, June-July 1986 19 Figure 2 - Rules In The Knowledge Base balanced_hand :­ retractall(even_distr(X)), asserta(even_distr(no)). List-Processing Rules: /* A hand is considered "balanced" /* Determine whether an item is if there are neither very short an element of a given list. •/ nor very long suits. If either of these is encountered, the member(X, ex I_]). member(X, [_I Y]) :­ default value "no" is kept. member(X, Y). Otherwise, the hand is balanced and the "yes" value is stored. */ /* Tells how to build one list from two distinct lists. •/ balanced_hand :­ points(Suit, Points, Count), append([], X, X). · Count< 3, I. append([XIL1], L2, [XIL3]):­ balanced_hand :­ append(L1, L2, L3). points(Suit, Points, Count), /* Tells how to add a single item Count > 5, f. to a list if the item is not already on the list. •; balanced_hand :­ retractall(even_distr(X)), add_to_list(X, Y, L) :­ asserta(even_distr(yes)) •• not(member(X, Y)), append([X], Y, L). /* The cut operator is used again in this rule. As soon as the system /* When buildirig the list of cards determines that there is either a held in each suit, a small card long or a short suit, checking is represented as an "x". This stops immediately. */ rule is used to add an "x" for each of the small cards held. /* Find the Longest suit(s). *I The rule is called from the I* Initialize the count to O. •1 Xis C - 1, build_list rule; C represents the find_longest_suit :­ number of small cards to add. •/ retractall(longest(Suitname, Count)), asserta(longest(none, 0)). add_small (Suit, 0) : - f • add_small(Suit, C) :­ I* Checks each of the points facts hand (Suit, L) , to determine if a count value is append(L, [x], Newlist), larger than the currently stored retract(hand(Suit, L)), If so, that value and asserta(hand(Suit, Newlist)), its corresponding suit name replace the previously stored values. */ add_small(Suit, X). find_longest_suit :- / • Note how this rule uses points(Suit, Points, Count), recursion. The last statement, longest(Suitname, Suitcount), "add_small(Suit,X)"calls itself Count > Suitcount,value. with the updated value of X retract(longest(Suitname, Suitcount)), (each time, X is one less than asserta(longest(Suit, Count)). previously). Add_small is terminated when X reaches O. /* Looks for a second (or third) The cut operator {f) is important suit having the longest count here because it prevents further as determined above. */ attempts to satisfy the goal add small (Suit, C) in the event find_next_long_suit :­ that C is o. The statements retract longest(Suitname, Suitcount), and asserta are used to erase old points(Suit, _, Count), values and insert new values into not(Suit = Suitname), the Knowledge Base. •/ Count = Suitcount, asserta(longest(Suit, Count)). I* Even.Distribution Rule: */ I* valuating the Hand: */ /* Begins by clearing out any /* Initializes all point and even_distr fact and using the count values to O for the default value "no". *I individual suits. •;

20 MICRO CORNUCOPIA, #30, June-July 1986 val_hand :- I* Sets up a hand_count fact that retractall(points(Suit, Points, Count)), counts the number of total points asserta(points(spades, o, 0)), in the hand based on the suit asserta(points(hearts, o, 0)), points calculated in the above. asserta(points(diamonds, O, 0)), After the hand count is tallied, asserta(points(clubs, O, 0)). a message is printed indicating the point count of the hand. I/ I* Calls on the get-count rule to evaluate each suit, and count_hand :­ finally on the count_hand retractall(hand_count(X)), rule to evaluate the entire hand */ asserta(hand_count(O)). val_hand :- get_count(spades). count_hand :- val_hand :- get_count(hearts). points(Suit, Points, Count), val_hand :- get_count(diamonds). hand_count(X), val_hand :- get_count(clubs). Newpoints is X + Points,rule. val_hand :- count_hand.hand. retractall(hand_count(X)), asserta(hand_count(Newpoints)). I* Counting the Points and the Cards in the Hand: */ count_hand :­ hand_count(Points), I* This rule will be called on print(•Your hand is worth '• Points, ' points•). when evaluating the hand. It is called on once for each I* building the Hand List: •; First, it accumulates into the card count for the I* This rule is invoked to clear individual suit the number of out the suit lists before the "small" cards held in that suit. *I suits are rebuilt based on current information. */ get_count(Suit) :­ clear_suits:- retractall(hand(Suit, Hand)). values(Suit, Honor, Points), clear_suits:- asserta(hand(spades, [])), Honor = small, asserta(hand(hearts,[])), points(Suit, P, Count),suit. asserta(hand(diamonds,[])), Newcount is Count + Points, asserta(hand(clubs,[])). retract(points(Suit, P, Count)), asserta(points(Suit, P, Newcount)). I* This rule calls on the list­ processing rules to build a I* Next it gets the point list from the facts found in count for each the values set. The add_small honor and increments the suit count rule is called on to add an "x" eachtime an honor is encountered. •; for each small card. The add_to_list rule is called get_count(Suit) :­ on to add the name of the honor values(Suit, Honor, Points), to the list when appropriate. */ not(Honor = small), Honor = y,honor (Ace = 4, King = 3, build_hand(Suit) :­ points(Suit, P, Count),Queen = 3, Jack= 1) values(Suit, y, 2), Newcount is Count+ 1, hand(Suit, L), ). Newpoints is Points + P, add_to_list(queen, L, Newlist), retract(points(Suit, P, Count)), retract(hand(Suit, L)), asserta(points(Suit, Newpoints, Newcount)). asserta(hand(Suit, Newlist)). I* Finally, if there are more than 4 build_hand(Suit) :­ cards held in a suit, a point is values(Suit, y, 3), added for each card in excess of 4. hand(Suit, L), Generally, this works as well add_to_list(king, L, Newlist), as the more common method of retract(hand(Suit, L)), counting short suits and is asserta(hand(Suit, Newlist)). preferred by some brioge experts. */ build_hand(Suit) :­ get_count(Suit) :­ values(Suit, y, 4), points(Suit, Points, Count), hand( Suit, L), Count > 4, add_to_list(ace, L, Newlist), Newpoints is Points + Count - 4,4. retract( hand( Suit, L)), retract(points(Suit, Points, Count)), asserta(hand(Suit, Newlist)). asserta(points(Suit, Newpoints, Count)). End of Listing

MICRO CORNUCOPIA, #30, June-July 1986 21 Figure 3 - Making the Decision.; Rules for Determining the Bidding

decide_bid :- ret~actall(~id(X)). decide_bid :- balanced_hand.points - pass. decide_bid :- decide_bid :- retractall(va1ues(Suit, Honor, Points)). even_distr(yes), hand_count(Count), I* After the hand is entered, a Count > 15, listing of the hand is printed. Count < 19, The rest of the cLauses decide print ( '1 no trump'), the bid based on the rules set up as.serta (bid ( [ 1, no trump])), I. in 1 thru 8 (See text) decide_bid :- find_longest_suit. Rule 1: there are fewer than 13 pts •/ decide_bid :- find_next_long_suit. decide_bid :- · decide_bid :- get_values. longest(Suit, Count), decide_bid :- eval_hand. Count > 4, decide_bid :- clear_suits. longest(Suit2, Count), decide_bid :- build_hand(spades). not(Suit = Suit2), decide_bid :- build_hand(hearts). touching(Suit, Suit2), decide_bid :- build_hand(qiamonds). print( '1 '; Suit), decide_bid :- build_hand(clubs). asserta(bid([1,Suit])), I. decide_bid :- pri~t_hand. decide_bid :­ decide_bid :- longest(Suit1, Count), hand_count(Count), Count > 4, Count < 13, longest(Suit2, Count), print(•Pass•), not(Suit1 = Suit2), asserta(bid(pass)), I. print( 1 1 '• Suit2), asserta (bid ( [ 1 , Sui t2])) , I. I* Rule 2: there is even distribution decide_bid :- and between 16 and 18 points - longest(Suit, Count), 1 notrump. */ Count > 5, · print('1 •,Suit), I* Rule 3: Bid the higher ranking of asserta(bid([1, Suit])), ·1. touching suits decide_bid :- or the lower ranking if two long points(Suit, Points, Count), suits are not touching. */ Count > .4, ·major(Suit),suit. /I Rule 4: Bid the long suit. ., print( 1 1 '• Suit), asserta(bid([1, Suit])), I. I* Rule 5: Bid a five-card major ., decide_bid :- points(Suit, Points, Count), /I Rule 6: Bid a four-card minor Count > 3, suit if it has an honor. ., minor(Suit), values(Suit, Honor, Pts), I* Rule 7: Bid one club. *I Honor = y, print( '1 ', Suit), I* Rule 8: Bid the best of suits asserta(bid([1, Suit])), I. which are not biddable by rules decide_bid :- 1 through 6. *I points(clubs, Points, Count), Count > 2, I* The use of the cut operator print( '1 club'), at the end of each clause. It is asser.ta (bid ( '1 club')), I. essential to stop the process decide_bid :- as soon as the proper bid is longest(Suit, Count), determined. */ Count > 3, longest(Suit2, Count), not(Suit = Suit2), touching(Suit, Suit2), print( 1 1 ·•,Suit), asserta(bid( [ 1,Suit])), I. decide_bid :- longest{Suit1, Count), Count > 3, longest(Suit2, Count), not(Suit1 = Suit2), print('1 •, Suit2), asserta(bid([1, Suit2])), I. decide_bid :- longest(Suit, Count), Count > 3, print( 1 1 •,Suit), asserta{bid([1,Suit])), I.

End of Listing

22 MICRO CORNUCOPIA, #30, June-July 1986 Figure 4 - The Explanation Subsystem PORTABLE why:- print_hand. why:- hand_count(Points), Points < 13, POWER print( 1 You have •,Points), print(' points. This is not enough to open•), I. why:- bid([1,notrump]), hand_count(Points), WITH print('Your hand is worth •,Points, ' points•), print('You have balanced distribution 16&18 pts 1 ), MasterFORTH print('In this situation you bid 1 notrump•), I. why:- bid([1,X]), points(X, Points, Count), longest(Suitname1, Count), \JI Whether you program longest(Suitname2, Count), W _ on the Macintosh, the not(Suitname1 = Suitname2), <;::~ IBM PC, an Apple II ser- print('You have 13 or more points•), ~ TM ies, a CP/M system, or the 1 pr1nt( You have 2 suits each with •,Count,• cards.•), Commodore 64, your --- _ print( 1 Bid the higher ranker of two·touching suits•), print(•or the lower if the suits don't touch•), I. program will run un- .T::::~--== why:- bid( 1 1 club'), changed on all the rest. =====~=TM print('You do not have a biddable major suit•), If you write for yourself, print(•Your diamond suit does not contain an honor•), MasterFORTH will protect 1 print( Your club suit isn't biddable, but you must open•), your investment. If you write print('This is a short club situation•), I. why:- bid([1,X]), points(X, Points, Count), for others, it will expand your print('You have 1 , Points, 1 pts and•, Count, •cards in •,X), marketplace. print( 1 Bid your longest suit•). Forth is interactive - 1 •• print_hand:- pript( Your hand is:•). you have immediate feed­ t?g print_hand:- hand(Suit, List), back as you program, every print(Suit, ': •), ~TM tab(5), step of the way. Forth is print(List),nl. fast, too, and you can ~ JM use its built-in as­ I* why" calls on the print_hand rule first to give a complete Cp/ rM sembler to make it listing of the hand as contained in the knowledge base. It even faster. Master­ then checks for a hand worth fewer than 13 points. If this is the case, the message printed is that there are not enough FORTH's relocatable utilities and points to open. If there are more than 13 points in the hand, headerless code let you pack a lot then the bid fact (created by the decide_bid rule) is checked more program into your memory. The to see what the bid was, and other pertinent facts in the resident debugger lets you decom­ knowledge base are 6hecked to help with the explanation. •/ pile, breakpoint and trace your way through most programming prob­ Figure 5 - The Natural Language Interface lems. A string package, file interface and full screen editor are all standard features. And the optional target com­ get_values :- piler lets you optimize your applica­ print( 'Enter your hand at the prompts•), tion for virtually any programming get_suits(spades), get_suits(hearts), environment. get_suits(diamonds), The package exactly matches Mas­ get_suits(clubs). tering Forth (Brady, 1984) and meets all provisions of the Forth-83 Standard. I* get_values is called from decide_bid. It prints a prompt, then calls the get_suits rule for each suit. */

get_suits(Suit) :- MasterFORTH standard package ...... $125 print(Suit), (Commodore 64 with graphics) ...... $100 print( 1 Ace - y/n 1 ), Extensions read( Ace), Floating Point...... $60 asserta(values(Suit, Aoe, ~)), Graphics (selected systems) ...... $60 print( 1 King - y/n 1 ), Module relocator(with utility sources) .. $60 read(King), TAGS(Target Applic. Generation System)­ asserta(values(Suit, King, 3)), MasterFORTH, target compiler and print(•Queen - y/n 1 ), relocator ...... $495 read( Queen), Publications & Application Models asserta(values(Suit, Queen, 2)), Printed source listings (each) ...... $35 print( 1 Jack - y/n 1 ), Forth-83 International Standard ...... $15 read(Jack), Model Library, Volumes 1-3 (each) .... $40 asserta(values(Suit, Jack, 1)), print ( 1 How many small 1 , Suit, 1 are in your hand? '), read(Small), (213) 821-4340 asserta(values(Suit, small, Small)).

I* get_suits(Suit) will build the set of values facts as well as get information from the user. It consists or a series or prompts, each requiring a yes/no answer (or a number in the case of "How many small ••• "). Whe~ the answer is received, a values fact is retained recording this information. These ~CROMOTION facts are then used as input to the rules which build the 8726 S. Sepulveda Bl., #A171 suits, calculate the hand value, etc. These rules help decide Los Angeles, CA 90045 the bid and later explain how the bid was determined. I/

MICRO CORNUCOPIA, #30, June-July 1986 23 dare.to' . ' QRG,4.NIZATION l"'C. compare.

Don't be f.ooled.\I • '!' '• ' "" No hidden costl Complete MS-DOS/CPM Supe·r Turbo Super Turbo Super Price: In keeping with industry trends MSO is bringing our customers high performance P.C. compatibles and $1299 accessories. MSO takes the P.C. compatible to maximum performance with its SUPER TURBO. The SUPER TURBO features the V20-8 chip which runs at three times the speed of the IBM-PC XT* and also runs CPM 8080 software. The SUPER TURBO comes complete with the MS-DOS , Read and Run CPM, full Instructional Documentation, Utility software, plus for our first 100 customers MSO is offering the Mlcropro Wordstar Professional Software package. The Super Turbo P.C. runs IBM This package includes: Wordstar, software and CPM 8080 programs Mallmerge, Correctstar, Starlndex, Datastar and a G.L. Accounting • CPU - V20-8 Sm Hz Super Chip runs *IBM System. The SUPER TURBO is a· compatible software at 3 times the speed complete turnkey system with of the IBM-XT and CP/M 8080 software. everything necessary to plug in and • 8087 Math Processor optional • 256K RAM on mother board expandable to operate. 640K . USER SUPPORT • ROM BK Bios • 6 empty slots for expansion HOT LINE • 2 serial port one optional with expansion kit • 1 parallel port 805/393-2247 • 1 game po'1 • Clock calendar with software All systems carry full 90 day warranty. • Hi-Res monographics video board CASH PRICE ONLY • Floppy controller Special printer Check In adv<1nce. Add 3"Yo for VISA/MC. Shlppjng • Dual Floppy Drives 360K ea. • 135 watt XT Power Supply & handling charges will be added to each order. pricing with • 5150 style compatible keyboard For our catalog with complete details and • Hi-Res ITL Green or Amber 12" monitor purchase of prices, send $2.00 to: • MS-DOS operating system and manual. Micro Supply Organization, Jnc. • Instructional Docu·mentation and Utility above computer. 4909 Stockdale Hwy. #180 Bakersfield, CA 93309 Software • Assembled and tested in U.S.A. MON. - FRI. 7am -Spm PST•SAT. 9am -Spm PST • Optional internal 20 meg sub "IBM is a registered trademark of the iBM Corporation. system for Super Turbo add $499 15% restocking on returned orders

24 MICRO CORNUCOPIA, #30, June-July 1986 1m: tiJ MICRothe

ORGANIZATIONsuPPLv INC. alternat·1ve. The SANYO complete word pr~cessing system The alternative for WANG, Xerox or Get more for your any dedicated word processing system. · money! At Micro Supply Organizatiqn we offer the lowest prices on Sanyo ~ computers and software. With prices like these you can afford the fSSANVO convenience of owning and operating more than one computer. MBC 1160 We also offer the User Support Hotline for questions concerning your computer or about software availability. Whether you need one Including this FREE software: or a dozen computers, Micro Supply • Wordstar • Spellstar Organization is the place to get them! • lnfostarMailmerge • BASIC• Calcstar~~~~i~~i!ii The MBC 1160 Accounting Software 4 We carry a complete line of ADS 8·Bit Integrated Computer accounting business software. Buy with 640KB Formatted Mini --.;.;;;~~~~~~~~~~~::) Floppy Disk Capacity G/L, A//R, A/P, Inventory and receive • Z-80A CPU with no-wait mode and the Payroll module FREE. The large 64KB RAM/4KB ROM memory capacity for fast current retail price is $398. per execution. module. Now from MSO you pay • CP/M operating system with editor. assembler and all standard utilities. only $99 per module. • No-glare amber monitor display screen for easy viewing. • BO-character x 25-line display. 256 characters in 8 x 12-dot matrix 20 meg internal hard di'ive cells. sub-system for SANYO MBC 1150, • Two internal double-sided. double­ 1160 & 1250. density. double-track 5 •;," slim­ $ type mini ttoppy disk drives with 649 640KB formatted capacity. • Interfaces for one Centronics printer and one RS-232C port. • Optional interface for hard disk USER SUPPORT drive and for external 8" floppy HOT LINE disk drive. LEGEND 880 OR SANYO PR 5000 805/393-2247 Dot Matrix Printer Letter quality Daisy Wheel Printer • 80 char/line or dot-image graphics • Letter-quality printer with 96-character • Centronics parallel interface daisy wheel printing element. All systems carry full 90 day warranty. • Tractors or Friction feed •Accepts paper up to 13 inches in width. • Pica, elite, condensed or proportional • 14 cps bidirectional printing. CASH PRICE ONLY • 10, 12 and 15 cpl printing pitches. Check in advance. Add 3% for VISA/MC. Shipping Includes printer cable & full warranty • Centronics parallel interface. • Optional form tractor. & handling charges will be added to each order. Includes printer cable & full warranty. For our catalog with complete details and prices, send $ 2.00 to: This complete package Computer & PriNntLeYr lists for $3194.00 0 $699 Micro Supply Organization, Inc. 4909 Stockdale Hwy. #180 I VISA j •.· Bakersfield, CA 93309 1SO/o restocking on returned orders

MICRO CORNUCOPIA, #30, June-July 1986 25 Building Your Own By Don Fletcher Inexpensive Logic Analyzer University of Missouri at Columbia Rt. 7 Box 120 Columbia MO 65202 (314) 443-7294

Logic analyzers are expensive, mys­ nels to watch what the newer proces­ In summary - the scope is an terious gadgets that experts use to sors were doing. Plus, scopes have a analog, periodic waveform display in­ find subtle problems in inscrutable difficult time displaying aperiodic (one strument while the logic analyzer is a systems. At least that's been the case time) signals. clocked, digital, aperiodic sampler. until now. Since microprocessors are driven by This is the first of two articles on software (much as programmers are Block Diagram Description building your own logic analyzer. driven to drink by it), it would help to The first requirement of a logic ana­ Once you've used one of these gadgets capture the program off the busses, lyzer is input lines, lots of input lines. you'll wonder how anyone debugs and determine the exact path· taken, or For example, if you're working on a· software (and hardware) without one. not taken, by the program. ZBO system, such as the Big Board. Of course, at their usual prices of The magical device that allows us to family, you'll need inputs for 16 ad­ $5, 000 to $25, 000 there hasn't been watch a computer or any other bus dress lines and 8 data lines for a total. too much demand from individuals. structured ·equipment in action is of 24 input channels. With this series, all that changes. called a logic analyzer, and it has been If you're using 16-bit microproces-. There are no more excuses for not with us in different forms and price sors, you'll need up to 24 address knowing what's happening inside a ranges for a couple of decades. lines and 16 data lines, for a total of 40 system. This article will describe the compo­ input channels. nent parts of an ideal logic analyzer Some type of buffering will be re­ and propose a working design that can quired to isolate and reduce loading .of t's late, a. nd you'.ve just completed be used with the PC family of comput­ the system under test. To reduce the the prototype of your automatic ers, at a parts cost of under one logic board density and. the system I canary feeder-burper, the best hundred dollars. under test bus loading, we'll put the microprocessor real time: controller de­ inpt!t signal isolation buffers: .in the signed for :that purpose. You key in · . The Logic Analyzer & The Scope probe. : . · · · the 'code, flip the on· switch, and are Both the logic analyzer and the , If~ tisual~y a good 'idea to> stick ~o greeted by· - nothmg; it just sits ~cope .view a signal.· vs. time. The powers of two for anything ·that must there. scope· displays an analog signal .. (any be filtered thfo~gh TTL logic . .So we'll Or you'.Je just. finished writing a level allowed) continuously in. time. choose 32 input lines, a ' workable wonderful 20,000 line, single module . The logic ·analyzer 'is' a digital· (ITL. : ·compromise. between .maximum num­ assembly language program to auto­ or CMOS) level device which samples ber of signcil lines 'th~t are a power of mate the manufacture of gopher cor­ and stores the logic state of an. input at two. sets. Followirig the procedure taught specific time· intervals (usually deter­ A number. of the input signal lines you by "tune-for-greatest-smoke" Kel­ mined by a system clock along with should be available for comparison ly back in school, you assemble and several clock qualifiers) for later dis­ with a trigger word to .start or s!op the theri run the program only to be play and use. sampling process. treated to the sound of several myopic Therefore, a scope is like your eyes, If, for example, you know the sys­ gypsies singing "Marching to Albu­ viewing surroundings all the time, :tern is running correctly until address querque" on the assembly line stepper while the logic analyzer is .more akin OOFOH, that would be the initial trigger motors. to a camera, preserving and displaying word set for the address line inpt1ts. an instant in time. After vi~wing the block of data ac­ What Do You Do? While the scope is normally trig~ quired starting at this address, a high­ You could reach for the trusty scope, gered on a certain slope and level of er address can be specified to obtain but you'd have a· tough. time trying to an incoming signal, the logic analyzer the next block of data. solve these problems. The scope has compares the logic state present ·on .its its ·uses, but it suffers from two major incoming channels with a set of trigger· High, Low;'Don't Care faults when working on bus-structured states set up by the operator. When Three states are required for signal equipme11:t: ·it has a limited number of the two match, the analyzer starts or· . 'comparison: ,:high, low, and don), ecfre display channels (usuaily 1 to 4), and stops acquiring data. · (input can·. be either high or ::lc)\Y). it must· have a recurrent (periodic) Other bells and· whistles · can .. be · When apprpaching a new protot}rpe waveform to be of much help. added · to enha~ce' .· the basic system ' ' You'd need 30 or more display chan- capabilities as' described bel?W. (continuedonp~-~<:28)

·~ .:

26 MICRO CORNUCOPIA, #30, June-July 1986 Async Clock Oual & Sync Clock Clock, Async Edge Control Clock & Qualifiers

Edge & Oual Control Sample

Host System System Storage Signal Isolation, Under (RAM or Out Bus Host System Bus Isolation Control & Test FIFO) Decoding

Start/ ___ stop Sample

Trigger Trigger Word Control LOGIC ANALYZER Word BLOCK DIAGRAM

MODULAR DATA ACQUISITION SYSTEM We Bring Engineers, Scientists And The IBM-PC Together. Our unique high-performance modular data acquisition system allows you to purchase the configuration that exactly meets your requirements. All of Qua Tech's data acquisition products include LABSTAR, powerful software designed to give BASIC programmers total con- trol of their application. ·

8·BIT AID $490 SYSTEM $690 1.2·BITSYSTEM A/. D

MICRO CORNUCOPIA, #30, June-July 1986 27 BUILD YOUR OWN LOGIC ANALYZER

(continued from page 26) In some logic analyzers, the trigger word with 16 signal inputs. word can be at the beginning or The LED circuit output shows if the (with due caution, they bite), you ending of an acquired block of data. chosen trigger word appeared on the would normally set the qualifiers to Triggering at the end of the data block system bus, while the scope output "don't cares" just to get some idea of allows you to view data before an allows you to externally trigger a scope what's on the busses. event, such as before an endless loop. on the output and thus monitor the The number of samples that can be To try to keep the parts count within signal lines referenced to this point. obtained in one run is determined by reason, we'll define 16 of our 32 input · Remember, the scope won't work un­ the logic analyzer storage capacity. So lines as trigger inputs. less you can create a periodic (repeat­ information about the system bus ac­ ing) signal. If you don't have any tivity is obtained in chunks, each of An LED Circuit 74LS688s in your junk box (pardon which guide you closer to the prob­ See Figure 1 for a simple circuit that me, your surplus parts storage reposi­ lem. allows you to compare a 16-bit trigger tory), you can use 7485s instead.

28 MICRO CORNUCOPIA, #30, June-July 1986 The clock output from the system fier to the -RD line. This is ANDed period clock which would let us simu­ under test, the heart of the logic with the system clock, and allows a late a scope while troubleshooting cir­ analyzer, should be edge programma­ clock transition only when the proper cuits that don't have a master clock, ble allowing sampling of data on either clock edge is present and the read but still require viewing of many input the rising or falling edge. input is low. lines. How would you like to generate Also needed are several qualifiers Several clock qualifiers are necessary an entire logic board timing diagram that allow a clock transition only un­ to allow maximum flexibility. Since the (32 lines) at once? What power! der specific conditions, such as read 7485 allows comparison of four lines, Wnen using the asynchronous clock, status, write status, 1/0 status, and so we'll use four qualifiers in our system. · the qualifiers would be disabled since forth. the object now is to obtain a timing For example, if you're interested in Asynchronous Selectable Period Clock diagram which requires accurate time microprocessor read activity, you An additional "nice to have" option sampling and measurement. would attach an active low clock quali- would be an asynchrono1:1s, selectable Since the asynchronous clock can be simply generated by using the syn­ Advanced Concepts "Mini-Winnie" chronous clock input and a periodic pulse generator such as an LM555, we'll reserve this feature as an option. HARD DISK SYSTEMS Being able to delay after trigger a set For your Z-80 Computer! number of clock cycles helps speed up the sampling process because the trig­ Our EXTERNAL systems install in Our INTERNAL systems do not dis­ ger word can be set to a standard seconds! Includes an attractive place a floppy drive. do not require value 'and only the clock delay vertical cabinet with integral P/S a power supply upgrade, use the changed. and fan. 3 foot cables. Everything highest technology winchesters If you can store 256 samples starting necessary to plug in and go! available. No compromises. from a given trigger word, you can COMPLETE SUBSYSTEMS start with a clock delay of 0 for the Plug in and run! Includes software, documents, cables, brackets as req'd. first block, a delay of 256 for the second block, 512 for the third and so $665. $790. $790. $845. on. 10mb 20mb 10mb 20mb Of course, you could change the External External Internal Internal Kaypro ( 1,2,4,10) ./ ./ ./ ./ trigger word for each block, but it's Big Board 1,11 ./ ./ often difficult to pick a unique trigger Xerox 820-1,11 ./ ./ for every point. Micro Mint SB-180 Add $10. Add $10 A clock delay feature allows the Gemini Zerba ./ ./ Add $20 . Add $20. choice of a single unique trigger word, Osborne I ./ ./ ./ ./ with blocks offset from that unique Sanyo MBC-1150/ 1160 ./ ./ * * AVL Eagle ./ ./ * * point. This feature is much like the Alspa II ./ ./ delayed sweep on a scope. Since this (* Under Development) feature is another "nice to have," SPECIALS ... while stock lasts ... we'll enter it as a desirable option. 5mb External $465. TM602 or equiv. (less P/S enclosure $395.) 10mb External $495. CM5616 or equiv. (less P/S enclosure $425.) 15mb External $535. CM5619 or equiv. (less P/S enclosure $465.) Storage (For Glitches) (call for current specials) Next you'll need some type of stor­ age for all this nice information you're Drives Accessories gathering. There are two choices: fast 20mb 3.5" $495. Drive cable sets 1.5' -10.95 3' (std.) -11.95 6' -14.95 RAM (50ns or less), or FIFOs (first in, 10mb 3.5" $439. Kaypro interface cables (externals) 16.67 20mb 5.25" HH $439. Host extension cable, 1 foot 18.95 first out) which. are fancy shift reg­ 1Omb 5.25" HH $279. "Y" power cable 9.50 isters. 1Omb FH SPECIAL (call) under$200. Document package (incl. with system) 8.00 FIFOs are easier to use, but expen­ 5mb FH SPECIAL (call) under$120. Enclosure 5.25" FH, with P/S - 69.00 without P/S - 49.00 sive and difficult to find. RAM also The key to the Mini-Winnie system is the INSTALL program, which links your drive and your computer, the way YOU want it. Extensive menu options allow selection of any ST-506 compatible drive, as 1 to4 has more capacity so you can store logical drives within CP/M at any drive letter. Diagnostic and format capability provided to match larger blocks of data. Again, trying to the installation. Distributed in SOURCE form. strike a reasonable balance between We have club, user group, OEM/Dealer programs. Call for quantity schedule. If for any reason you are system cost, circuit complexity, parts not satisfied, return for full refund. Special drives warranteed for 30 days. Info and manual $8.00 density, and availability, let's use credited with system purchase. Specials subject to availability. RAM. ORDER INFO: Call (305) 482·7302. Terms:UPScashCOD,checkorM.O.Pleaseallow4 weeks for delivery. Fla. add 5% tax. Shipping extra. Please specify desired floppy format. A glitch is defined as a signal that goes up and down between samples.

Advanced Concepts Engineering & Consulting (continued next page) oc 8926 S.W. 17 St., Boca Raton, FL 33433 MICRO CORNUCOPIA, #30, June-July 1986 29 BUILD YOUR OWN LOGIC ANALYZER

(continued from page 29} into a single 74LS input which a bu~fer states (QUALO -> QUAL3), and if the wouldn't improve. If you're using trigger word has enabled the qualifier Glitches are caused by noise spikes in long lengths of input cable (longer comparator (the 74LS85). When DONE digital circuits, power supply noise, than 3 feet), add another buffer to the goes low, the clock stops and the host asynchronous counters, phase of the probe for the qualifiers and the clock. system, which has been polling the moon, circuit bypassing, operator atti­ If you want to be·· really safe (a belt DONE state, takes control. .tude, and bosses' temper tantrums. and suspenders ·man), separate the A· nice memory option is to provide clock from the rest of the signal lines Clock storage. and pulse stretchers to capture and run it through a coax ··cable. I've Clock edge inversion is provided by the not-so-rare beasts. Unfortunately, had good luck, however, with. unbuf­ an Exclusive Or gate which is used as ·glitch detection requires virtual dupli­ fered, unseparated qualifiers and clock a programmable inverter. When the cation of most of the logic analyzer, inputs. I ran all inputs through a 50 EDGE output is high, the clock is so, as nice as this option is, we won't line, 36 inch length of ribbon cable, inverted; when low, it isn't. include if. · ·· · isolating the ·clock · by bracketing it Since data is strobed into storage on with grounds (the wires on each side the rising edge of the clock, EDGE low PC Interface were connected to ground). would be rising edge transfer, EDGE All that's left in the specification of high would be falling edge transfer. our system is the host computer (the Trigger Word The ADDR INC output allows the host PC/XT) interface. Here we'll need The lower 16 of the 32 input lines system to control the address line some input ports to· get the data from are used to set a trigger word which counters when transferring data. logic analyzer storage to PC storage, marks the starting location in the data Under· remote operation (system un­ some output ports for everything stream. ·The three legal conditions for der test controlling the clock) the we're controlling, and decoding to the trigger word are set by the 74LSOO ADDR INC output is set. When the turn it all on and off at the proper N and gates and the 74LS688 ·Octal host system takes control, EDGE is set time. Comparators. thus driving -WR high, and ADDR Also we'll need a software driver to To handle the high or low states, the INC is pulsed to increment the ad­ . take the raw acquired data and put it data input line from the probe buffers, dress inputs to the RAM. in readable form (HEX display, timing (INO -> IN15) is passed (and inverted) The sanitized, qualified, and purified diagram, disassembled code, etc.) and by setting its matching data compare clock (-WR ·output) strobes the input a way to transfer control information line (DCO -> DC15) high. data (INO - > IN31) into the 2148 RAM between the XT and the logic board. These two lines are NANDed togeth­ array on its rising edge. The same To recap, our ideal logic analyzer er, and the output is passed to· the edge is used. to increment the 74LS393 will have: Octal Comparators, which compares· it address counters, which changes the to the system compare (CMPO -> address about 40 nanoseconds later, 32 input lines CMP15) lines. Since the input lines are setting the address for the next data 16-bit wide trigger word inverted by the Nand gates, the re­ strobe. 60ns sample time spective CMP line must be the inverse When the RAM is full, AlO goes 4 qualifiers (for the clock) of the desired trigger state . high, pulling DONE low as outlined . clock edge select The don't-care condition is handled above. The access time of the RAM by setting the data compare line low used will determine how fast you can '·Circuit By Circuit which blocks the input line and sets acquire data. Generally, slow means The system under test is isolated by the Nand gate output high. The sys­ cheap, fast means expensive, so get the,four 74LS244 buffers placed in the tem compare line is then set ·high to the fastest you can afford. probe module. match this state. More input lines The WINDOW output, when high, could be added to the trigger word by Host Interface tri-states the· buffers isolating the sys­ adding additional N and· gates and O~­ The host system interface is provid­ tem under test from the logic analyzer, tal Comparators. ed by the address decode circuitry such as during transfer of the acquired The final output of the chain of which includes the 74LS04 inverters, .: data from the .logic analyzer to its comparators is used to latch a high 74LS30 8-input Nand gate, and the host. logic analyzer clock enable into · the two 74LS138 decoders. The decoder When low,. the bllffers are enabled 74LS112 JK Flip Flop which is used to controlled by the 110 Write input is to allow data flow from the system enable the 74LS85 Quad Comparator used for the five 74LS374 output ports , under test into the logic analyzer. which handles clock qualification. and the -RESET line. The 1/0 Read · Isolating these four buffers in a sepa­ When the DONE output from the controlled decoder is used for the five, . rate probe reduces capacitive loading Address counters goes high (signaling 74LS244 input ports. The Base address . of the circuit under test while also the start of a sampling session), the for both decoders is 320 Hex which fits . decreasing the logic analyzer circuit clock input to the ..logic analyzer is in the prototype card locations speci­ board density. passed through. the first And gate. The fied by IBM. If you require a different The four· qualifiers and the clock are second And gate passes it if the four address space, change the inputs to ·· not buffered as they. are . terminated qualifiers m_atch their programmed the 74LS30.

30 MICRO CORNUCOPIA, #30, June-July 1986 With some effort, the logic analyzer Bells And Whistles . before then, and you have a modem, could be used by any host such as the Extras not used in this logic analyzer call (314) 443-7294, ask for Don, and Big Board, Xerox, and Kaypro that has along ·with possible ways to include give the coded passage: "I must have access to a bidirectional data port for them are: my software fix!", and I'll transfer DO -> D7, one enable output replac­ 1. Clock delay - could be added by what I have (300 or 1200 baud). ing the 74LS04s and the 74LS30 (con­ including a counter in the clock chan­ I'm also selling a version of the logic nected to the pin 4 on both 74LS138s), nel and the necessary output lines to analyzer (see ad in this issue), or and two outputs for the 1/0 Read and program the count delay. boards and parts as a service for Micro Write (or one output and an inverter). 2. Qualifier don't cares - add 4 C subscribers. Contact me for prices. Nand gates and 4 output lines. Software 3. Stop on trigger word - include See you at SOG V The software can be as simple or as extra logic between the trigger word (Editor's note: Don will be speaking at complex as you wish. In sequence it output and the DONE output. SOG V and he might even have some .must: 4~ Asynchronous clock - add the logic analyzer software with him... ). 1. Set the trigger word, qualifiers, counters, clock, output divide control and clock edge to the desired configu­ lines, and the logic to switch between ration. the synchronous and asynchronous Note: Schematic on pages 32 and 33. 2. Set ADDR INC high and WIN­ clocks. DOW low. 5. Glitch detection - add another 3. Reset the address counters and logic analyzer. You'll need separate ... the trigger word latch by addressing RAM, ports to handle it, and the . the reset location (325 Hex). necessary pulse stretching for each 4. When DONE is low, set WIN­ input. DOW and EDGE high. I didn't add these options because 5. Since DONE is low, the address the parts and cost count were high lines to the RAM are set to zero. Load enough. If you need them, use the the 32 bits of data through the 4 input base circuit and add to it. ports. 6. Toggle ADDR INC, then load the Culmination next 32 bits of data. Since my wife insisted on my doing 7. Repeat 7 until all data is trans­ such non-essential tasks as sleeping :ferred (RAM holds 1024 long words - and eating, the software will be de­ 32 bits each). layed until the next issue. This gives 8. Massage and display the acquired you time to build the system, and me data to your liking. time to find a new hiding place. 9. Go back to 1, or exit the system. If you must have the nasty stuff

I PCB EDIT I I ANALOCIC I

o CREATE PRINTED CIRCUIT o '32 CHAHHEL LOGIC AHAL BOARDS OH YOUR PC OR FOR THE PC/XT

MICRO CORNUCOPIA, #30, June-July 1986 31 -~ N

~ DC7 DC1S () 17 P7 IN7 IN1S - :;.::i 1S PG PG P=Q 19 0 OUT PC DCG DC14 13 PS () 13 PS IN14 0 II P4 11 P4 Q718 CMP1S LOGIC DCS 8 DC13 8 IG -~ P3 P3 QG IN13 c INS G P2 G P2 14 () QS ANALYZER DC4 19 DC12 4 12 0 4 Pl P=Q Pt Q4 IN4 IN12 2 Pf/J 2 PllJ Q3 9 BY DON FLETCH ER ~ DC3 18 Q7 DCll Q2 7 "II= w IN3 IG QG LS lNll L.5688 Q1 s p 688 ._ DC2 DC1{/J Q{/J 3 s:: 14 QS CMP8I 'G ::s IN2 12 Q4 IN111J It) ....!.., DC1 DC9 s:: 9 Q3 '-<"' IN t 7 Q2 G' 1 IN 9 ...... DCi! S QI oca 00'° IN{IJ INS °' 3 Q{/J -= CMPIS 8 CMP8~CMPf5 tG

CMP{/Jl LN7 9 IN7 LNIS INIS LN23 IN31 ti A7 Y7 A7 Y7 A7 Y7 Y7 LNG ING LN14 INl4 LN22 IN22 IN3f/J a AG L YG 12 AG L YG AG L YG L YG LNS 7 INS LNl3 IN13 LN21 LN29 IN29 13 AS s YS AS s YS A5 s Y5 s Y5 LN4 14 IN4 LNl2 IN12 LN28 IN28 G A4 2 Y4 A4 2 Y4 A4 2 Y4 A4 2 Y4 2 MRI 4 4 4 4 LN 15 A3 IN3 LN11 1N11 INl9 LN27 IN27 12 4 Y3 S A3 4 Y3 A3 4 Y3 A3 4 Y3 MR2 LN2 4 tG IN2 LN111J LNl8 INl8 LN2G IN2G A2 Y2 A2 Y2 A2 Y2 A2 Y2 IN1 LN17 INl7 LN25 LNt 17 Al YI 3 LN9 Al Al YI IN25 LN 2 A~ 18 IN INS LN1G IN16 LN24 IN24 CPI a oEi Of.~() A'5E; <5El!IJ 1 19 19 19 LS WINDOW 393 L------~------J 1S A9 16 A8 2 8 RESET MRI 83 17 A7 12 1 MR2 82. t------t9 A6 2 Bl t------tAS 8{/J '"'11 3 t------tA4 13 PULSE CPI CP2 A3 G LS A2 S 4 393 Al 2148 2148 2148 2148 2148 2148 2148 A9' 3 WE cs "WE cs W'E cs 'WE cs 1{/J 8 1¢ 8 1¢ 8 1f/J a WR cs NOTE: A0-+A9 COMMON TO ALL EIGHT RAMs Bl, B31 GND GND DONE PULSE B3 B29 +5V 2 +5V CLOCK 3 row B13 CLOCK iiR Bl4 QUAL" IOR cs A2 i QUAL1 NOTE: ALL ICs BYPASSED D0 c BY fJ.01 uF CAPACITOR A3 A QUAL2 D1 WINDOW 19 Q7 D7 07 A4 R QUAL3 16 I D2 D +5V I L D6 I A5 WINDOW ADDR INC 15 I I D3 I s D5 8 A6 1 IN 11! USED EDGE 12 I D4 BY 3 04 M N 7 A7 p IN1 CARD B! i---M-'A.... T.... 3..., MAT3 9 D5 Q 5 QUAL3 I 4 D3 8 D6 AB u I L B ...,1..... 4_M ..... A_T_.2""'4 MAT2 6 I USED T I 74 QUAL2 2 4 I D2 u A9 ~ I S B1 1t MAT1 t---+-----',f------t MAT1 5 I D7 BY LS QUAL1 I D1 s A11 I OUT 112 MATQ5 'VI ill ~ CARD I QUAL" 8 Bl1! 9 MAT0 2 Q11'5 Dl15 A22 I 5 A= e ....6 ______, 1, I A9 K 06 CPOE N A23 .....______""""""4 IA AB IN30 CLR 3 A>B 4 A24 15 2 Q5324H A7 IN31" -= IB A

Ul Ul TURBO PC/XT XT COMPATIBLE HARD DISK SYSTEM SPECIAL 16 Bit High Speed $1159°0 Personal Computer XT-type motherboard (4.77 mh) with 256K ram expandable to 640Kon board. 10MB hard disk with controller, single Teac floppy with controller, high resolution amber monitor with Hercules compatible monographics card (720 x 348) and parallel printer port, AT-style keyboard (large return, shift, ctrl and tab keys; lighted caps-lock and num-lock indicators), flip-top case, and 135 watt power supply. Aw, what the heck, we'll also throw in a parallel printer cable, assembly and burn-in. · · The Turbo PC/XT ·features an Upgrades: Add-on enhanced version of th industry 4 layer 8mh Turbo . $149 1200 baud modem $179 standard Intel 8088 micro proces­ (fast, reliaql~) (Hayes compatible sor, the 8088-2. In the normal 640K memory $69 internal, with software). mode, the 8088-2 runs at 4.77MHz. 20 MB. hard disk· · $189 Color/graphics card $O When more power is needed, a Extra Teac floppy $109 .with amber simple software command can put Battery clock, serial composite monitor. the Turbo PC/XT in a high speed and game ports $50 mode of 8MHz. Performance is 68% greater than that of the I BM XT Compatible Floppy System Special PC and other PC compatibles. For added user convenience, the high 0 $879° speed mode is clearly indicated by Same as above but with two Teac floppies and no hard disk. an easily visible green LED on the box; WHY 4 LAYERS? For added effectiveness, the CARDS & COMPONENTS Turbo PC/XToffers powerful hard­ 2 layer boards have traces on the ware and advanced software fea­ XT-type motherboard $129 top and bottom of the circuit board. tures to provide a multiple "virtual (2 layers) 4 layer boards have two extra console" environment. This envir­ 8mh Turbo board $250 layers of traces sandwiched be­ onment allows multitasking and (4 layers) Multi l/D card $95 tween the top and bottom of the windowing. Now, users have the (floppy controller board. When comparing a 2 layer ability to accomplish several tasks battery clock, serial, board against a 4 layer board of the more quickly .than ever before. parallel; game ports.) same size, the 2 layer board will The Turbo PC/XT can run on Monographics card $95 have longer trace runs (which both the Concurrent DOS and (Hercules compatible, increases the resistance to the MSDOS operating systems. Thus, includes printer port). signals traveling through the traces) there is a high degree of compati­ Color/graphics card $69 and the traces will be closer bility with the extensive library of Case - flip top $49 together (which increases the software designed for the IBMPC. Power Supply (135W) $89 possibilities of interference from a Utilizing the latest in micropro­ 20 Meg Hard Disk (XT) $489 neighboring trace;. The faster the cessor technology, the Turbo PC/ 20 Meg Hard Disk (AT) $650 signals travel through the traces, XT can deliver stronger perfor­ Amber TTL Monitor $110 the more exaggerated these prob­ mance at higher speed without (hi-res monochrome) lems become. For those who want sacrificing software compatibility. White TTL Monitor $130 to run an XT-type motherboard at The Turbo PC/XT is the ideal (hi-:-res monochrome) 8mh, we recommend a 4 layer computer for .OEM's, VAR's and Amber Monitor $95 board. end users who demand personal (composite with computer performance. together ·tilt and swivel). WARRANTY with PC reliability at an economical TVM Color monitor - RGB $395 All products are warranted for 90 price. days. AT·BASIC AT SYSTEM SKY HIGH CO. INC. • 6/8 MHz· Motherboard • 6/8 MHz compatible 2158 UNIVERSITY AVE. · • 512K RAM • 512K RAM BERKELEY, CA 94704 • 1.2 Floppy· Drive • TTL Monochrome Monitor (415) 549-34 72 • Western Digital H/F Controller •TTL Monochrome Board • AT Keyboard • 20MB Seagate • 1.2 Floppy DEALERS • 2.oow Po·wer Supply • Western Digital H/F Controller Identify .yourself as a dealer and $.1889°0 • Keyboard • 200W • Case we'll send you dealer information. $2499°0 We're reliable, efficient and price competitive. Idea Processing­ Pure and Simple. Announcing the all NEW IUT·THINKTM outline processor. .See your ideas like you've never seen them before!

Capture your fleeting ideas. And keep 'em Once you've entered your ideas, you can get organized with OUT-THINK, the incredible, them out with a full complement of format­ ------Rush me my choice now: new outline processor from KAMASOFT. ting, printing and file conversion options OUT-THINK unleashes the powe:·r in your (including Wordstar compatibility). From a special . workhorse CP/M computer and turns it into two-page report to the Great American OUT-THINK introductory the simple and an Idea Processor. Novel, OUT-THINK will rotate your headers easy to use $4995* and footers with page numbers and give you outline processor: a Table of Contents to boot. Get extraordinary: KAMAS the programmable + ease of use powerhouse: $9995* Most functions are less than 3 keystrokes away I KAMAS COMBO PACK the power and the + ea5e of learning glory: $12995* Completely interactive; no programming! 'Includes SIH U.S. & Canada. Overseas add: $10 + performance for OUT-THINK; $30 for KAMAS or COMBO PACK. Write more and faster than you ever dreamed possible! KAMAS owners: Send us your master disk and $25 for OUT-THINK. + idea leverage L..... OUT-THINK your competition! .....J 0 fE 0 II 0 Payment Enclosed

Card No. Exp. Date· OUT-THINK supports your thinking process Signature and keeps you in touch with your ideas. Name That's because OUT-THINK works the Address way your mind works­ naturally. City State Zip Begin by brainstorming. OUT-THINK lets you jot down ideas quickly, as you think of Telephone them. If you want to elaborate, you can add Our software is available for most text with full screen editing. CP/M computers. Tell us about yours: Then develop your ideas using a familiar Computer Make/Model outline format. Disk Size: 0 5V• • SSDD Change the structure o 5V•"DSDD o a·sssD as easily as you Requirements: CP/M 2.2 or above (48K TPA). change your mind. Minimum 200K of disk storage. 80 column x 24 line Move an idea and all screen. (Note: KAMAS requires 56K TPA and zao attached text moves with it. processor.) Our new OUT-THINK is simpler and easier Terms: All orders prepaid. PC's accepted when You can keep track of your main line of to use than KAMAS. Yet, it offers more print­ accompanied by payment. Foreign checks must be thought by collapsing the details from view. ing and formatting options, better handling drawn on US banks in US funds. Then, expand portions of the outline to and control, and faster operations. And at MAIL ORDERS TO: develop the specifics when you need to. By $49.95 your ideas have never had it so collapsing and expanding, you can maintain good. OUT-THINK is simply spectacular. an overview and literally see how your ideas Try it for 60 days. If you're not completely KlMAllnM fit together. satisfied, return it for a full refund. 2525 SW 224th Ave. P.O. Box 5549 Aloha, OR 97007 And OUT-THINK is If you create and organize text in the fast. Your ideas remain course of your work, you owe it to CALL IN YOUR ORDER: at your fingertips. yourself to get OUT-THINK.* 503-649-3765 OUT-THINK can locate and retrieve by 'But for some people, enough is never enough. Some like the Wordstar is a registered trademark of MicroPro, Inc. ZSO is a keyword-even a challenge; others need the power. For you, we have the . ------registered trademark of Zilog, Inc. CP/M is a registered trademark KAMAS Combo Pack. You get OUT-THIN K's ease of use of Digital Research, Inc. KAMAS, KAMASOFT, and OUT-THINK misspelled one­ coupled with the extra horsepower of the KAMAS programming are trademarks of KAMASOFT, Inc. in less than a second per outline file. environment. And both use the same outline files.

MICRO CORNUCOPIA, #30, June-July 1986 35 By Laine Stump Development Foundation of Turkey Tunali Hilmi Cad. 22 Importing Systems From Taiwan, Part II Ankara Turkey

If you enjoyed the article on doing just to make sure of what we were air freight from Taipei to Ankara; we your own importing in Issue 29 then getting ourselves into. had to send them a telex with instruc­ you must read about Laine's travels tions! through eastern Asia searching for Info And Samples From this experience we knew that new bargains and legitimate suppliers. Last October I began compiling a list the only way to find a good supplier This is the journey we'd all like to of names and addresses of Far East (quality, reliability, and legality) was to make. suppliers of PCs. We picked the 15 go there ourselves and see the compa­ best prospects, sent them each a telex, nies in person. and eventually ordered five samples - o you want some justification three complete units and two mother­ The First Leg for the "World" in 86 World, boards. Then we waited. (We're not When Ergun (coworker) and I ar­ Shuh? · lavished with 48-hour service like you rived in Islammabad from Ankara,. we As I'm writing this sentence, our sultans in the U.S.) discovered the flight to Peking wasn't flight is just leveling off after takeoff until the next morning. So we got to from Hong Kong International Airport You're Selling WHAT?!? spend the night sitting around a table (I'm writing with my brand new toy, a In the meantime, we were still re­ in the restaurant at the airport talking Toshiba 1100 portable). We arrived in ceiving product information from Tai­ to two Chinese meat cutters (horse Hong Kong yesterday afternoon after wan: meat, actually) who had been visiting spending a week in Tokyo attending Please note that we are supplying cards relatives in Turkey. It turned out that Comdex-Japan and two weeks in Taip­ which are copyrighted by some American their family had come from Turkestan ei talking to scores of computer sup­ companies. We are selling these cards at in Western China, but several of them pliers and manufacturers and others much lower prices but we shall not hold had fled to Turkey during the commu­ who professed to be one or the other any responsibility in the event of claims by . nist takeover. Now, after 30 years, (or both) but were neither. But first the original makers at your side. Please they had been allowed to travel to some background ... refer to "ADAPTORS WITH COPY­ Turkey for a reunion. RIGHT INFRINGEMENT" for pricing. Why East Asia? Some of the items available (for $10/ Where Is Your Visa? The company I'm working for has its pc without manual) are: Islammabad is near the western end main office in Ankara and approxi­ CCP/M 3.1, 3.2, 4.1; MS-DOS 2.0, of the Himalayas so as soon as we mately 30 field offices scattered all 2.11, 3.0, 3.1; Sidekick; Turbo Pascal took off we began circling to get up to across Turkey. One of my jobs is to set 1.0, 2.0, 3.0; Lotus 1-2-3; Auto-CAD 30,000 feet before we headed toward up microcomputer systems to be used 2.17B; Microsoft COBOL; Microsoft the "foothills." At first I was amazed for accounting at the field offices. (We FORTRAN; Microsoft C; etc. by the size of the mountains and will eventually have at least 100 PCs, So they have a few things to learn glaciers and the thousands of square several network file servers, printers, about copyright laws. We can still miles of terrain they covered, but after and possibly other equipment.) Be­ surely find SOMEONE to supply us about an hour of mountain after cause of the sinful price and poor-to­ reliably, legally, and promptly. Can't mountain after mountain, I fell asleep. nonexistent service offered by the local we? We landed at the Peking (Beijing) distributors of American and European airport for a one hour fueling stop and equipment, we decided to go direct. Meanwhile The Hardware Shows Up as soon as the ''snorkel'' was hooked We had considered using Slicers We finally got the machines and up and the door was open, the cabin with CCP/M and several terminals, but started playing. They definitely had filled with young soldiers asking to decided that a ·network of PCs would problems. look at everyone's passports. One of provide easier hardware expansion We could tell even from our small them looked at Ergun' s, and gave it capabilities in the future, and using sampling that quality control differed back, then took mine, looked through MS-DOS would give us a greater greatly from one company to the next. all the pages, looked through again, software base. We could also tell that some compa­ called over one of his friends and they Since the cheapest PCs come from nies ·were much more experienced in both looked at every page. Then they the Far East (Taiwan in particular), we dealing with foreigners (and in dealing asked, "Where is your transit visa?" counted that as our best bet, but with computers). One company "What? I didn't know I needed figured we should check it out first couldn't even figure out how to ship one."

36 MICRO CORNUCOPIA, #30, June-July 1986 ''Americans need a transit visa for traveling through China.'' I was led down the hall into a series of rooms by a polite young man who kept smiling and saying, "You just get a visa now, no problem." I wasn't smiling; my mind was racing with thoughts of bamboo under my finger­ nails and meals of dried bean curd and fried locust eggs. It ended up only costing me $14, and I didn't even have to sign a confession of my guilt in the capitalist oppression of the world. After we took off again, one of the stewardesses told me that a few years before, a family of four Americans had been fined $4000 for exactly the same thing. I guess the People's Republic is getting soft in its old age ... stay in Japan for two weeks. "But next .. unless I wanted to order 10,000 or so. Once Is Not Enough time you get a Japanese visa before This company was Citizen (of watch Before we left Ankara, I had asked you come to Japan. And fly Japanese making fame). They had two models one of the secretaries at the office to Air Lines." at their booth, one looking amazingly check every country we were going to like the Kaypro 2000 and another with to see if I needed any visas. She came Tokyo And Comdex-Japan a larger screen and two front loading, to my office later and said, ''I checked Tokyo was quite a change from the super-thin floppy drives. The one that · and you don't need ANY visas for Ankara scene I have become accus­ · looked like the 2000 actually WAS a ANYwhere!" So, she had made one tomed to in the last six months. Huge 2000. It turns out that Citizen makes mistake - maybe it was just an over­ fluorescent light shows on all the the entire 2000 unit for Kaypro, ex­ sight (and maybe boiled chicken feet buildings, clean streets, clean (relative­ cluding the motherboard, for $300 a · really IS a good appetizer ... ) ly speaking) air, Mc Donald's all over copy. In Tokyo my friend passed through town, a wonderful modern subway immigration with no problem. Piece of system, and drivers that actually stop Little Flopsies •cake, I thought to myself. I strutted up for pedestrians. The products I found most interest­ to the counter and handed my pass­ We spent three days at Comdex. ing at Comdex were the 3.5" disk port to the man behind the glass. He (Insidious, these Japanese.) In general drives. All the drive companies were looked through all the pages. Then he we were slightly disappointed with the pushing these little buggers. Three looked through all the pages again. quantity and selection of items on inch drives have been available in the ·Finally came the question: "Where is display, but there were a few products past, but only with capacities up to 1 your Japanese visa?" that made the trip worthwhile. megabyte. Well, Virginia, now you can My stomach sunk. ''I didn't know I store the entire data file for a high needed one." Same old story. "What Citizen Lap-Tops resolution color graphic image of Santa . must I do now?" One thing I was hoping to see a lot Claus (and all his reindeer) (in several "Probably you must leave the coun­ of was lap-top portables (actually I was attractive poses) on a single 3.5" flop­ try and get ·a visa, then come back looking to buy one to use for the rest py. Almost everybody at Comdex had again.'' of the trip). But the only company that models that would store 1.6 Megs After some talking and giving names had a REAL portable on display (un­ (unformatted), and Teac even had a for references,. hotel reservations, bro­ der 10 lbs., quad density 3.5" drive, prototype for a model that would do 2 · chures of Comdex, and all that, finally no bigger than a small box of corn Megs! I was granted special permission to flakes) told me they couldn't sell it (continued next page)

MICRO CORNUCOPIA, #30, June-July 1986 37 86 WORLD

(continued from page 37) source. "Unrotated" is now black and The company's name was AMI, and "rotated" is white. Because the light it had several other products to sell to The 1.6 Meg units are IBM-AT com­ source is always even and always from OEMs, mostly software and designs patible and are just entering mass the same angle, the display remains for hardware based on the 8088-80386 production now; the 2 Meg Teac won't visible under much more adverse con­ processors. go into production until. they get a ditions than a h-aditional LCD display. It's a great idea, designing · some­ sizeable request from a large OEM. Backlit• LCDs will probably cost a bit thing and then selling the design so Most manufacturers are selling their more (but not much) than the normal you don't have to worry about all the ·3,5" drives for about the same price as screens· for awhile and they may use overhead of starting up a factory, but I the 5" equivalents. IBM's new Japa­ just a touch more power, but I would can see one problem that AMI will nese model (the' JX) is using 1 Meg still buy one tomorrow. have, especially in Taiwan. The prob­ 3.5" drives, and I keep hearing that all lem is that software and ·hardware 'of IBM's new machines are going to Legal BIOS· designs are intangibles. Most Tai­ use them, so look for these fellas to One company at Comdex was selling wanese companies we talked to could take over a considerable share of the a legal BIOS for AT compatibles. Since not quite grasp the idea that intangi­ market in the next four · or five the Taiwanese are having a tough time bles had value; the price of a piece of months. getting IBM original software through software should be the price of the ·customs, and Phoenix and_ the other media (disk or ROM chip) plus the . Skinny Flopsies established companies (even ERSO) cost of the labor required to duplicate The other interesting development in are charging' outrageous fees (I heard it. Right? tiny drives was the new trend in someone mention $200,000 for a limit­ "super thin" models. These little jew­ ed license), a New Jersey company has Who's Who At Comdex els are almost exactly half the height of decided to market its own AT BIOS in One thing that both Ergun and I a half-height drive, so I guess that the Orient. They were talking about noticed throughout the entire exhibi­ makes them quarter-height (can't you $30,000 for an UNLIMITED license tion was that everybody who was just see the ads now? "ALL NEW! (you can make as many copies as you selling peripherals or software used Quarter-height, quad density, double want). either IBM original equipment or NEC sided, half power, double track, half wit drives!"). Most companies seemed content with squeezing down only 3.5" models, but Canon had 5'.~ mod'." 1 els as well. It doesn't look like 5 ': starting at s499s · · drives will be used on new models GRAPHICS much longer, but I suppose the super­ thins can be used for replacements in existing equipment. ' · · · versus 2000 w.. X s o.ooos·· Thin Displays Floppies weren't the only thin things 1800 0.0006 at Comdex. Thin screens were. "in" ·J if I too. ·Along with the nortnal ho-hum ii' ~ 1600 0.0007 · · LCD screens were a .few, examples of ' .ag. the new (and expensive) pfasma dis- l 9 . plays· and a new backlit LCD screen. ~ 1~00 ...... 0.0008 " The plasma displays are still too ex­ S1 pensive and use too much power 1 ~ 1200 (although the display quality is heav- 0.0009 . enly), but the backlit LCD (shown by Citizen) is quite interesting. , 1000 ·--.,.---.,...-··--,- 0.0010 Normal LCDs have a black backdrop 0.0 2.5 5.0 7.5 10.0 and when the crystal at a .certain spot time CµS) is rotated, the black shows through. This works, of course, only if there is SCI-GRAF: Produces line, scatter, and FONTEDIT: Easy-to-use full screen font GRAF 3.0: Produces bar, pie, line, scatter, · high/low plots on Epson.or IBM com­ editor allows you to create and modify and high/low plots on .Epson, IBM, sufficient light to reflect off the unro­ . patible dot-matrix graphics printers. fonts for our SCI-GRAF program. Create C.ltoh, or NEC compatible dot-matrix tated crystals but not enough to reflect · Supports images up to 1680x1712 dots Greek, math, and custom symbols in 3 graphics printers. Supports 14 fill-in patt­ (over 3 million pixels!); log & linear sizes. Supports SCl-GRAF's propor­ erns, 8 point-plotting symbols, automatic ·· off the black. scales, graphs in 7.'colors (on a JX-80), tional spacing. Requires IBM compati­ ·scaling, labeling, and legend creation. The backlit LCD works a bit differ­ batch processing. ble 320x200 pixel on-screen graphics & MS-DOS 2 or 3, 192k .....•...•. ,569'5 Requires MS-DOS 2 or 3, 256k ... $99'5 IBM compatible keyboard ...... 5]9'5 CP/M-80: Requires 64k (54k TPA) 549'5 ently however. Unrotated crystals ap­ pear black,. while the backdrop is an Microcomputer evenly distributed internal light - MSc SystemsConsultants -- 27 Forest Avenue Port Jefferson Station New York 11676-1820 (516) 928-7493

38 MICRO CORNUCOPIA, #30, June-July 1986 9801 PCs. The 9801 is NOT a compati­ of RAM, a 140 Meg 8" winchester, would even CONSIDER doing busi­ ble; it is so much better than the IBM and Xenix V version 3.2. Expansion ness with us. that the blue suits should hang their cards are connected via a multibus. heads in shame. The most notable In most cases I would just laugh at On To Taiwan feature is the system's graphics - someone who claimed that their 286 We had met with varying degrees of resolution of something like 900 x 700 system could handle 16 users. I was success/failure with the sample units in color mode! skeptical this time too, until I found we ordered from Taiwan. Some had Something very· obvious in Japan out about the 1/0 co-processors. I'm arrived within a few weeks, some took was that most companies are not so still doubtful about connecting 16 nearly two months, some worked, uptight about being IBM compatible users, but I think the MPZ 2060 would some didn't. . When we arrived in (for domestic units) as manufacturers do just great for about six or eight Taiwan, we planned to see a lot of in other countries. One person told heavy hackers, and even more if some companies and expected to find a few me, "We would rather have higher of the terminals spend most of their good ones and a LOT of bad ones. We resolution graphics and faster process- time twiddling their diodes waiting for weren't disappointed. ing." I'm glad SOMEBODY doesn't the lackey at the desk to type some­ feel the need to follow along with the thing. Colonel Cheng's Taiwanese Fried PCs "crowd." The first "computer company" we General Impression Of Japan ran across was run by a friend of a MPZ 2060 Overall, I must say that the Japanese friend of our boss. His company actu~ One of the Japanese companies we'd companies we dealt with were very ally dealt mainly in chickens and hoped to see at Comdex was Micro formal, full of rules, no nonsense. "If chicken feed. We had been told to Research. MR's main. product current­ we must then .let's do busine~s and contact him for help in getting around ly is a multiuser supermicro called the get it over with." Most everyone in Taipei, but he had somehow gotten MPZ 2060. It uses an 80286 processor wanted a complete history of our wind of the fact we were coming and running at 8 or lOMHz coupled with company along with our current eco­ that we were looking for computE~rs. seyeral 80186 co-processors handling nomic status and our projected sales the 1/0. It comes standard with 3 Meg for the next five years before they (continued next page~

THE PROVEN MICRO FAMILY for all the SLICER® INDUSTRY APPLICATIONS New Low Prices! *Multi-User Slicer Combo ...... • . . . $950.00 Slicer SBC A&T (No RAM) Slicer 1 MEG Board A&T (Complete) Full implementation of "C" with standard floating CCP/M by Digital Research Inc. point, library, and 1/0 subroutines. UNIX VER 7 Slicer SBC A&T 256K . • ...... $445.00 compatible. Produces relocatable 8080 (optional OZ80) *Slicer SBC A&T 128K .•...... $350.00 with double deck sockets for additional 128K assembler code. Relocating assembler and linker *Slicer SBC A&T (No RAM) ...... $295.00 supplied with package or use Microsoft MBO and LBO, *Slicer 1 MEG Board A&T ...... $450.00 510/ZSID debugger interface. FAST COMPILATION *Slicer 1 MEG Board (Full Kit) ...... $295.00 AND EXECUTION. Slicer PC Expansion Board A&T .. ·...... $495.00 CCP/M (Digital Research Inc.) ...... · $250.00 AZTEC Cll FOR CP/M $199 MS DOS (Micro-Soft Corp.) ...... $175.00 (Special price for Micro C subscribers $149) *New Slicer Bias for MS DOS ...... Call Other kit forms available • Enclosures & other support hardware M1\NX in stock • Call or write for latest information & prices!· soft.ware syst.erns. VISA SLICER COMPUTERS INC. Box 55, Shrewsbury, N.J .. 07701 - (201) 780-4004. . 2543 Marshall Street N.E. (612) 788-9481 - Minneapolis, MN 55418 BBS (612) 788-5909 Also available for Apple DOS, HOOS, CPIM-86, PC-DOS

MICRO CORNUCOPIA, #30, June-July 1986 39 86 WORLD

{continued from page 39) different hotel leaving no forwarding the computer companies in T~ipei are address. really just trading camp~nies. We called him up from the hotel and Many times a trading company will he sent fl. ccµ- to get us. When we got We Mak~ SP~<:;:IAL Deal F9r Yqu claim to be the manufacturer. We were to his office, our chicken dealer sud­ Every cQmp~ny seem~d to think that even given a tpur of "~y factory" by denly became a co~p1:1ter m~ufactqr­ it had some unique selling point. They a mari who ran a .trading company. er. He took us into the next room so all clfti.Iped th~t · they ha~ d~sign~d '<~ater .I take yQu te> see my friend that his assistant could give us a test their own hardware, written their own who make~ Rolex watches. He give run of the demonstration unit (ob­ software, and had their pwn factory you SP~CIAL deal! Less than $30!" viously set up just for us) and we "just outsid~ of town." But after a You can ilJlagine the support you'd were swept off our feet py the sounds couple of days I began poticing that all get froip. one of these companies. So if of "Sakura" played by the IBM diag­ the monochrome cards had the same you're going to buy from Taiwan then nostics program. layout, the same manual printed at the you'd better have some schematics · We were deeply moved by the per­ same shop, and were packaged in the and know what's going on, or you're formance but had to throw aside our same box. going to learn real quick. initial infatuation and force· ourselves to leave the building. without confirm­ The Structure Hardware Prices ing an order for a thous~d units. In reality, almost all of the cirqtit Prices varied. Different price didn't boards coming from Taiwan are manu­ necessarily mean different quality, How To Meet Companies factured at one of five or six PC board though. The most expensive boards Within a day after we arrived in factories and distributed to ''sweat were from Multitech, the largest, most Taipei, before we had talked to anyone shops" for hand insertion of the ICs. reputable computer company in Tai­ except the people at the airport and The ICs, by the way, are sold in wan. Multitech was charging about the hotel, we began getting phone packages; for instance a "motherboard $200-$300 more for a complete system calls. chip set'' is purchased as a unit from a (with 20 Meg winchester) than the One of the first persons to be grant­ chip. set company and includes all lowest prices. ed an audience with us was an agent chips necessary for a complete XT The lowest prices were from the chip for a shipping. company. When we motherboard. The companies inserting inserters. Somewhere in the middle asked him how everybody knew our the ICs have no idea WHY the boards were the trading companies. Most names he showed us a little newsletter work; they follow the diagram that trading companies were not a good that was full of names, including ours. tells them to put chip D in slot 5 (and deal. They offered no extra services for Someone at the airport got the scoop light a stick of incense). their cut, although one of them, on us from the immigration office and After the chips are inserted on the Aquarius Systems, was a decent outfit. now so did the whole city of Taipei. board, the boards are usually run Aquarius Systems specialized in as­ They knew who we were, where we across a small wave-soldering ma­ sembling boards from other companies were from, what we were buying, chine, although the smallest compa­ and TESTING them before shipping. where we were staying, and probably nies do their soldering by hand. After One of their systems was based on the even our favorite drink. the parts are glued into place, there Multitech 700 Turbo motherboard, and In other words, in Taiwan, you may or may not be testing. If there's Aquarius was selling it with one flop­ don't have to find sources; all you testing it's usually the Pacman variety py for about $150-$200 less than Multi­ have to do is walk off the plane, put (if the ghosts move then the incense tech. "looking for computers" on your im­ worked). Prices change from day to day, but migration form, and make sure you You may be dealing with a company Figure 2 shows the lowest quotes we get a motel reservation from the count­ at any one of these levels. If you got for quantity 100, given by Auto er at the airport. They'll find you. Of happen to find the right one, you will Computer Company, the largest and course you may not find the best purchase the boards directly from the lowest priced chip inserter we visited. company that way. We felt that our people who insert the chips (I decline Note that these prices are FOB Taipei approach was best; we arrived in to call them manufacturers). Most of for quantity 100. Taipei with lots of names, prices, and ·· information. That· way if somebody was feeding us a line, we would Figure 2 - Prices From Taiwanese Companies know. Our best source of company names Turbo (8MHz) motherboard 640K, w/OK installed $79.00 was Asian Sources Magazine. Figure 1 Floppy controller card, 4 drives $18.50 gives a list of the few best we found; Hercules mono-graphic card w/printer port $42.00 Switching Power Supply, 135 watt $42.00 the worst aren't even worth the cost of Keyboard, AT layout, Cherry keyswitches $33.00 the paper to print a list. XT flip-top metal cabinet $17.00 By the way, after the third day, the Monochrome monitor, 12" (Cheer brand, CHEEP) $55.00 plethora of calls at all hours of the day (Editor•a note: I have a "Cheer" and it's just fine.) and night forced us to move to a

40 MICRO CORNUCOPIA, #30, June-July 1986 If you hunt you can find better Figure 1 - A Short List Of "Good" Companies prices (for instance $51 for 12 inch monitors from Lucky Gold Star in Bison International Co. Ltd. Prices nearly as good as Auto c. Korea), but it's nice to have to worry P.O. Box 8-231 BIOS is "in house" & will be Taipei, TAIWAN R.o.c. approved. about only one LC (Letter of Credit) MSDOS not available. and one shipment. Definitely shop around. Price~ service, and ability to No. 16, Sec. 1 Chung-Shan N. Rd. Turbo Qoard with V20 original communicate are what counts; design Taipei, TAIWAN, R.o.c. ~quipment. quality won't change at all (and work­ manship will cha:µge little) from com­ pany to company. tel: 381-9171 Actually engineers workinglll fax: 381-3175 tlx: 11291 MULTIFOT Disk Drives Disk drives are quite expensive in ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• Taiwan, especially winchesters .. Pur­ chase these from Japan, the U.S., and Auto Computer Co. Ltd. Best prices Singapore. Floppies are another mat­ Can provide legal BIOS 3F, No. 27-1, Sec. 3, ter. A $75 Japanese 5" DD drive cost Roosevelt Rd., $50 or $60 when manufactured in Possibly MSDOS, but Taipei, TAIWAN R.O.C check it out thoroughly Taiwan. The best price we found for 3.5" 1 Meg drives was $85 from tel: (02) 393~4568-9 No engineers, but Toshiba in Hong Kong where I bought tlx: 11888 APEXELEC incredibly high volume. my TllOO. But Ho Shin of Taiwan is planning to start production of their ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• own 3.5" 1 Meggers for about $60 each. Aquarius Systems Trading company, but good. 6F, No. 394 Keelung Rd., Sec. 1 Manager speaks GOOD English. Taipei, TAIWAN R.o.c~ 500 series uses Multitech mboard Is There A REAL Legal BIOS? (and includes licensed MSDOS and Now for the software. You've proba­ P.O. Box 48.;.29 BIOS)(Multitech insists) bly heard lots of rumors about .soft­ ware piracy in Asia. Well, I have to tel: (02)706-9140 tell you that none of it is exaggerated tlx:13138 AQUSYS even a little bit. We must have seen at least 20 retail shops selling everything ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• from AutoCAD to Xenix for $5 per Prestico Associated Corp. Not best prices, but a nice guy. disk. 9F, 41-2 Shin-Yi Rd., Sec. 3 Trading company That didn't really bother me though, Taipei, TAIWAN R.o.c. after I thought about it. A few guys selling a few copies of CCP/M to poor P.O. Box 7-559 Taiwanese students who wouldn't have bought if they had to pay retail tel:(02) 709-4541 tlx: 23561 PRESCIAR anyway can't do much harm. What bothered me was the 10 or so companies who were selling copyright­ ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• ed software to their distributors and Ho-Shin Subsystem Co. Ltd. Floppy drive manufacturer dealers all over the world, perpetrating 3-5, Lane 145, the software to such depths that no­ Hsin Sheng s. Rd., Sec. 5" AT & 3.5" soon body may ever sell another software Taipei 10626 TAIWAN $65-70 per piece in 200s product again. tel: {02)701-3583 tlx: 25525 JOEYPENG Government Actions The U.S. government says it's taken action, and apparently it's been ··························································~········ enough to· put a scare in most of the FROM "IN JAPAN" Section: computer companies in Taiwan; They have no qualms about shipping any· AMI (Access Methods Incorporated) AT BIOS, AT hardware 4e~ign 590 Valley Road EGA compatible graphics board BIOS, legal or illegal, to any country, Upper Montclair 80386 designs EXCEPT the U.S. New Jersey 07043 Interesting new company

(continued next page) tel: {201) 744-9126

MICRO CORNUCOPIA, #30, June-July 1986 41 ED/ASM-86 The first truly integrated Editor, Assembler, Debugger, and Linker is now available from Oliver Computing Company. * The Editor supports block move, block copy partial save and partial load insertion. All text is tokenized for both efficiency or storage and very fast assemoly1 time. FAST screen 1/0 and separate editor/debug windows. * The Assembler can be immediately invoked after any editth1g command. Output can be directed into memory, to a .COM file, .EXE, or to ED/ASM-86's own efficient .LNK file format. 8087/186/286 instructions supported. Macros and most standard pseudo-ops are supported. UNIQUE to ED/ASM is its structured assembly la11guage capability. No more wasted labels and time! Multiple segmented programs can be be sent to .COM fifes.

* The built in debugger supports symbolic disassembly, integration with the assemble~ as well as disassembly of 8087 /186/286 instructions. Dispfay 8087 registers in scienfific decimal format. SPL1 T SCREEN debugging with a dynamic register window is easily invoked. Disassemble programs to disk file for easier analysis. "Single-step" data editting SU,Pported for bytes, words double words, and 8087 floating constants in memory. You can "patch" assemble a hne at a time with symbols from previous assembly (even Clefine symbols as you go!) * The linker supports ED/ASM:..86 link files, which can be created from virtually any valid ED/ASM-86 source file, even lines with multiple external symbols in expressions. (Note: not compatible with usual link format) * And many more features too extensive to be listed here. All of these features exist In one Integrated program. A typical development cy~le with ED/ASM-86 consists of entering a program with the editorl or edittlng an existing J!rogram, typmg "A:,.:J:M" to assemble Into memory, going into the debugger to fmmed ately test the ~rogram. Then )'OU go back to the editor for the next cycle. ED/ASM was developed for Oliver Computing s own use, and has been used for over a year to enhance itself! ED/ASM-86 is only $95. Send check or M.O. to: Oliver Computing Company, P.O. Box 90140, Indianapolis, IN 46290 { (317) 849-4450 } for immediate aelivery via UPS.

86 WORLD it, but we will have to send it air mail that's what ERSO apparently did. (continued from page 41) separate from the rest of the system. When IBM got mad and started hunt­ They don't check there." ing for pirates, one of their first vic­ The Taiwanese government also has So, "legal" actually means "not tims was ERSO. So ERSO modified addressed the situation by prosecuting IBM." And "copyrighted" means the old BIOS so it wasn't quite com­ people who copy IBM software. An "somebody copyrighted it. /1 So be­ patible (i.e., some things don't work). example might help to illustrate the ware when you are told "our BIOS is That's what I heard, anyway. point. copyrighted. /1 It still could be stolen. While talking to all the companies, I MS-DOS got into the habit of asking them BIOS Source If you're looking for a legal MS-DOS whether their .BIOS was legal or not By the way, Gary mentioned ERSO license in Taiwan, forget it, unless and who the source was. At one in issue 29. The story he gives isn't you're dealing with Multitech (and company I was told, "Yes, it's legal." exactly the whole story. ERSO (Elec­ possibly Aquarius). It just don't exist. Then I asked, "Does that mean that, tronic Research and Something Organ­ Well, it does in some places, but it's for example, I could take this BIOS ization) was actually put together difficult to tell who is selling you a through U.S. Customs and it would some time ago to help all electronics license and who is selling just a disk. pass?" oriented companies. Currently their · It's all the same to them. Best bet "Oh, no. You can't do that." work involves mostly computer com­ would be to buy the boards without "Then it's NOT legal." panies, ·and they design disk drives MS-DOS and buy PC-DOS. It's a bit "Oh, yes, it's legal. You· just can't and other things. more expensive (licenses coming with take it through U.S. Customs. We On the outside, ERSO looks like a equipment can be as low as $15), but might get in trouble." · public service organization, but it's safer. That confused me a little until I they've gone commerciaI. Many Tai­ That's it for now. Allahasmarladik talked with another company: wanese companies are not purchasing (ciao, baby). Pray for sun at SOG. "Our BIOS has no copyright prob­ the ERSO BIOS because they say it's Editor's notes: Laine is trying to make it lems at all." too expensive. Instead, they're getting to SOG V. If he does, SOG attendees will "Did you develop it, or are you a license from someone else or just get a look at the guts of the international licensing someone else's?" copying it. trade and copyright business - and Turk­ "Oh, we copied it from UITRA." There are at least eight different ish computer technology· - that will blow ''Then it's illegal.'' BIOSes floating around in Taiwan - their turbans off. "No, no copyright problems. It's not IBS, UITRA, Super Computer, Mega Also, I published an old address for the IBM original. If it was IBM original XT, ERSO, ARC, Phoenix, and of import broker I mentioned in Issue 29. The then we wouldn't be able to send it on course, IBM. Many of these are just real address is: Newman Wilson Co the board, but since it's not IBM, copies of one another; but they're 7212 NE Airport Way Taiwanese Customs doesn't mind. Do changed enough to be legal. Portland OR 97218 you want IBM original? We can supply Speaking of changing to be legal, •••

42 MICRO CORNUCOPIA, #30, June-July 1986 EXPANDING YOUR KAYPRO AND XEROX JUST GOT CHEAPER! CHECK OUT OUR *** SOG SPECIALS *** Most versatile. Easiest to use. Finest quality. Claims are one thing, but the proof is in our products. We guarantee satisfaction.

Nothing can improve your computer's productivity like a hard disk. INTRODUCING THE KayPWS ROM PACKAGE by MICROCode Consulting HARD DISK SYSTEMS by Emerald Mlcroware The most important element in the performance of your Kaypro computer If you have been thinking about moving up to a hard drive, why wait any is its monitor rem. With KayPWS you get all of the advantages of a Kaypro longer? We have everything you need from the host board to a complete 10, even on your Kaypro 2. turn-key system. Runs on the Xerox, Kaypro, or almost ANY Z80 system. • Install up to four floppies and two hard drives • Boots from floppy or hard disk HOS Host Board - The hardware you need to connect your computer to • 32 character keyboard buffer your hard disk controller board. • Automatic screen blanking • Interfaces to the WD1002 controller board • 12 disk formats built in • Plugs into the Z80 socket, no other wiring required • Full automatic disk r~logging • Switch selectable 1/0 addressing • Internal real-time clock and ram card support • Comes fully assembled and tested •Can use 96 TPI and 3 V2 11 disk drives • Includes manual, format, configuration, diagnostics, sysgen, and hard THE WINCHESTER CONNECTION by MICROCode Consulting disk utilities The most comprehensive hard disk software package that you can buy. • No software assembly required •Works with one or two hard disks-5 to 64 meg • Available for '83 and '84 series Kaypros • Menu operated install, no software to assemble KayPLUS ROM Set ...... · ...... $ 69.95 • Complete testing and error handling KayPLUS ROM Set with QP/M ...... ••• $125.00 ••• • Warm boot from hard drive • BIOS drivers install above or below CP/M, your option • Allows custom partitioning and mixed drives types Need to keep better track of your files? •Includes manual, format, test, park, backup, and swap utilities Date stamp them with QP/M.

WD1002-05 HARD DISK CONTROLLER BOARD by Western Digital QP/M by MICROCode Consulting • 51/4 11 profile with standard power connector (+5 only required) • 40 pin host interface Full CP/M 2.2 compatability with many more features. You've seen the • Connects to ST506 compatible drives replacements that eat up memory and need auxillary programs to run. • WD2797 floppy disk controller and interface on board Not QP/M. Fifteen internal commands, automatic disk relogging (no more • Can control up to three hard drives and four 5 1/4" floppies control C), user area selection from colon, 31 user areas, drive search path, archive bit maintenance, and transparent time/date stamping, all in the COMPLETE HARD DISK SUBSYSTEMS by Emerald Microware same space as CP/M 2.2. Installs from a convenient customization me:lu, • Hard disk subsystems with host, cables, software, hard drive, and cabi- without any software to assemble. nets with power supply. Fully tested and ready to go. • Internal hard disk kits availble for Kaypro computers QP/M Operating System, complete bootable copy ...... $ 80.00 • 10 and 20 meg units in stock, others by order QP/M without BIOS ...... $ 60.00 • Available for Kaypro, Xerox, Morrow, and others Still running single density on your 820-1? 10 Meg Hard Drive Subsystem ...... ••• $725.00 ••• 20 Meg Hard Drive Subsystem ...... ••• $895.00 ••• PWS2 ROM by MICROCode Consulting Host board with software ...... ~ .. .' ...... $ 89.00 X120 DOUBLE DENSITY BOARD by Emerald Microware WD1002-05 Controller Board ...... $185.00 20 Meg Kaypro Internal kit w/KayPLUS rom ...... •. $995.00 Clearly the most versatile double density package for the Xerox 820-1. Run up to four floppy disk drives at once, both 811 and 5 1/4 /1 at the same time. ACCESSORIES FOR THE KAYPRO AND THE XEROX 820 Software compatable with Kaypro and Xerox 820. Supports all standard printers, and most add ens like the Ferguson Ram Board. You get mini­ Xerox 820-2 Main Computer Board ...... ••• $ 75.00 ••• monitor functions, autoboot capability, 19 built in disk formats, and bank Xerox 820-2 Floppy Controller board ...... $ 75.00 mode operation for more space in your TPA. Lets you run 48 TPI disks on Xerox 820-2 Main board w/Floppy Controller ...... ••• $125.00 ••• 96 track drives. Works with Uniform and QP/M. Xerox 5 1/4'' Drive cabinet w/cable ...... $ 25.00 PLUS2 ROM Set and X120 Board A&T ...... ••• $ 135.00 ••• Xerox internal video cable ...... $ 8.00 PLUS2 ROM Set and X120 Bare Board ...... ••• $ 62.00 ••• Board mount power connector ...... $. 2.50 PLUS2 ROM Set only ...... $ 49.95 Parallel ASCII keyboard (not standard Xerox) ...... ••• $ 15.00 ••• 120 Bare Board only ...... ••• $ 22.00 *** Dual 51/4'' Disk Drives-DSDD 48 TPI, in cabinet Other kits, parts, and packages available with standard Xerox cable ...... $265.00 Panasonic DSDD 48 TPI Disk Drives ...... $114.00 Panasonic DSQD 96 TPI Disk Drives ...... $129.00 ••• SOG Special prices good through August 31, 1986 ••• EMERRLD We guarantee satisfaction on all of our products or your money back. Include $4.00 shipping and handling, $7.00 for COD, call for Blue Label charges. Phone hours: 8:30am to 5:00 pm weekdays; check our bulletin MICRO/A/RR£ board- RQP/M, 5:30pm to 8:00am seven days a week, for our latest stock and prices. '

WE SUPPORT OUR CUSTOMERS P.O. Box 6118 Aloha, OR 97007 (503) 642-1860 • MICRO CORNUCOPIA, #30, June-July 1986 43 By Dr. Michael W. D. Liddle 21 The Frostings Grenoside 256K RAM Upgrade For 83 Kaypros Sheffield, 530 3NZ England

I've received numerous requests formed, since I was breaking new Table 1 - Connections Between Add-On from those of you who have wanted to ground (for me) rather than following Board and Main Processor build a RAM disk into your 83 a proven design. As a result I learned Signal On Connection on Kaypro. My stock answer was that a lot, some of it the hard way. New Board 83 main board this kind of project didn't lend itself In the hope that I can spare others REFRESH U48 pin 12 to homebuilding since RAM chips are some of the. worry and stress I suf­ MUX U33 pin 1 so sensitive to noise on the supply and fered, here is a step by step guide on A14 U33 pin 11 signal lines. how to turn a Kaypro into a Kaypro 8- A15 u33 pin 10 However, the good doctor has ele­ 256. HA7* U20 pin 9 gantly solved that problem by install­ HAS* U20 pin 1 ing 256K chips in place of the original Kaypro 2 Or 4? PIO 1 Pad E29 PIO 2 Pad E28 64s. I wish you all much luck and Although the case of my Kaypro PIO 3 Pad E31 little static while doing this fine proclaims it to be a II, it has a Kaypro project. 4 motherboard, as I discovered when *Outputs from new board my first Micro C ProMonitor ROM Note: Only 83 Kaypros have didn't work (they exchanged it for the spare PIO control bits. 84 correct one straight away and ex­ series would need additional n article in the September 1985 plained what had happened). latch & latch port decoding. issue of Byte describing a 256K The circuit in Figure 1 should work A upgrade for the Atari 800XL with most Z80 machines that use 64K chips." (If they're in sockets, you prob­ prompted me to try a· similar hardware dynamic RAMs. However, the connec­ ably shouldn't unsolder them.) hack on my pre-84 Kaypro 4. tions shown in Table 1 are obviously Unsoldering will take several hours Although I encountered a number of · specific to the Kaypro 4 motherboard. and must be done delicately. Don't problems I now have a Kaypro with If you have a different Kaypro model use too much heat; don't use more 256K RAM. The resulting improve­ you may need to consult a schematic than minimal force; and don't rush. ment in performance has far surpassed to locate specific signals. Use proper tools. A solder sucker and my expectations. This modification does involve fairly proper iron are essential. (Editor's Perfect Writer can now handle large extensive surgery and an understand­ note: The easiest way to remove 16- files without protracted bouts of swap­ ing of dynamic RAMs, so if you're not· pin ICs is to cut the pins off the body ping and missing keyboard input. IN­ confident you can carry it out, get a first and then heat and remove them FOCOM games run in erie silence friend who knows what he's doing to one by one.) with no · disk drive motor noise and help (i.e., supervise). Whenever you make any modifica­ respond almost instantly: And I've Most of you are aware of the poten­ tions to a circuit you should proceed even buffered my CCP and BDOS so tial for static. damage to ICs. And if stepwise and test at each stage as a that a warm boot is twice as fast. you're like me, you may have become matter of routine. So having removed The 256K RAM in my machine has a little blase about warnings. But be the chips, check the board carefully for been working perfectly for around six warned - 2:56K chips are among the damage. · months now. most sensitive and easily damaged ICs Then install eight 16-pin sockets in you're likely to encounter. place of the RAM chips, and plug 64K Danger Down Under If you want a reliable system and RAM ·chips into them (you could plug This wasn't the first time I'd taken don't like wasting money take full in the originals here if you didn't cut the lid off my Kaypro and delved precautions. I bought my chips from off the leads but you might be smarter inside. Within a year of buying it, I'd Microprocessors Unlimited, who pro­ to have a new set of eight 64's for this speeded the CPU up to 5MHz, added vided good instructions for handling step). Check that they're the right way a ProMonitor 8 ROM, installed a ICs. They also have low prices and up and that no pins are bent out or ZTIME-1 clock board, and fitted it with high quality parts. folded under. After checking a second twin Mitsubishi quad drives. time, switch on and all should work as However, fitting 256K RAM chips The Mod it did before. with address decoding, bank switch­ After unplugging your machine and Run your stiffest memory tests. If all ing, and refresh was certainly the most removing the lid and the motherboard, isn't fine, check that the chips are in frightening upgrade I've ever per- carefully unsolder the eight 64K RAM correctly, that solder joints are good,

44 MICRO CORNUCOPIA, #30, June-July 1986 Need your Kaypro·· at home and at work? Let UniForm and UniDOS help you cut down on the carrying. RFRSH S OD 7 11 OUT 9 7 UnlForm by MlcroSolutlons 4 QD 6 Don't carry your computer, just take the diskette. 10 L 5 The solution to the diskette and computer incompatibility problem. Uni Form allows s 4 you to transfer diskette files between almost two hundred fc.rmats including CP/M, 3 TRSDOS, and MSDOS. Lists computers by name-so you don't have to be a technical expert to use it. Read, write, and format diskettes for the target computer, 2 CLR even on 96 TPI drives. 14 1 +5V Vee UniForm is available from our stock for the Kaypro, Xerox 820-2, Morrow MD2 & MD3, IBM, and 100% compatibles. UI UniForm ...... $ 64.95 UnlDOS by MlcroSolutlons Turn your IBM Into a Kaypro··. . . I• Uni DOS allows you to actually RUN most of your CP/M programs on your IBM com­ patible, almost as fast as on their native system. Use UnlDOS in conjunction with Uni Form and you don't even need to copy your files, just run them as the are, right on your Kaypro" diskette. 8080 code programs run using the NEC V20 chip which ROW/ replaces your 8088. zao programs may be run in emulation mode. The V20 chip ADDRESS speeds up many standard DOS operations as well as maintaining 100% BIT 7 compatibility with your existing DOS programs. ""UnlDOS emulates eleven computers or terminals Including the Kaypro, Osborne, Northstar Advantage, and Apple Softcard CP/M. UniDOS is available for IBM and 100% compatibles. UniDOS ...... $ 64.95 UniDOS and UniForm with V20 chip ...... ••• $139.95 ••• See our full page ad for our other products. Add $4.00 for shipping and handling, $7.00 for COD. Bankcards welcome. EMERRLD MICROWRRE

P.O. BOX 6118 ALOHA, OR 97007 (503) 642-1860

and that no bridges of solder are around (I did the first time). Software shorting out tracks. Also make sure Now power up your motherboard Your Kaypro will behave no differ­ that no tracks have been damaged, (the 64K RAM is still in place). Every­ ently until you install software which and try again. thing should work as before. Run your uses the extra memory. Finally, if it still doesn't work, try stiffest hardware test programs. Use I chose to modify my BIOS to pro­ swapping in a set of 64K RAMs that your machine extensively. When vide a 160K RAM disk, 26.5K printer work in another machine. Don't pro­ you're happy that all works as it buffer, and 5.5K CCP and BDOS buff­ ceed further until your machine works should, replace the 64K chips with er. This works well for me, but you correctly. 256K chips. Test your machine again. may wish to be more ambitious and If all is working, disconnect again If it works, you riow have a Kaypro 8- rewrite the BIOS to provide track and wire all the pin ls of the RAM 256! buffering which, while a better way to sockets together under the board. On The circuit is similar to that in the use RAM, requires a lot of assembly my Kaypro these are not connected to September Byte and I advise you to language programming. If you do it, anything; make sure that the same is get and read it first. then I'd really appreciate a copy. true on yours. . Ul is a twin 4-bit binary counter, Note that plenty of multiplexer is left If your board has· pin 1 of the RAM and these are wired together as a over on IC2 for modification to use 1 chips connected to ground, + 5V, or divide by 64. megabit chips. And with 150 or 120 anything else, then bend pin 1 out and The refresh signal is fed through this nanosecond parts there would be wire the pin ls of each chip together to produce the eighth bit of the refresh room for a further CPU speedup to (when you plug in the 256K chips). address for the RAM chips. BMHz with a ZBOH. . Anyway, this is RAB, the 8th address Although the Z80 has an 8-bit re­ You might ask, "Why go to all this line to the 256K RAM chips. fresh register, it only provides a 7-bit trouble to install a 160K RAM drive Now remove resistor R9 so that the refresh address. U3 is a twin 4 line to when MicroSphere offers cheap RAM RA7 signal is no longer connected to 1 multiplexer. drives with up to a Meg of RAM. My the address line multiplexer U33. This carries out bank switching to answer: "It's fun; it's educational; and Make the circuit shown in Figure 1 produce the new RA7 and RAS for the it cost me less than $40." on prototyping board. (Radio Shack RAM. It also ensures that the same sells suitable boards.) Connect the cir­ bank is selected whenever an access is cuit to your Kaypro motherboard ac­ made to the top 32K of RAM. U2 cording to the wiring instructions in combines RA7 with the refresh ad­ ••• Table 1. Don't forget ground and dress generated by U3 pro,ducing ·the + 5V, and don't get them turned new RA7.

MICRO CORNUCOPIA, #30, June-July 1986 45 ~w CALEN DARf CLOCK "Almost a Sidekick for CP/M" $69 KIT Ted Silveira-Computer Currents, Aug. 27, 1985 D~ ~~ Wj.ATMH FILE "WHM is ingenious and works as intended" 8 PING! Jerry Pournelle, BYTE Magazine, Sept. 1985 (c) McGraw-Hill • Works with any Z-80 based computer. • Currently being used in Am pro, Kay pro Now available for CP/M 2.2, CP/M 3.0 and ZRDOS! 2, 4 & 10, Morrow, Northstar, Osborne, The convenience of Sidekick on your CP/M machine! Trigger Write-Hand-Man with a single keystroke and a window pops open Xerox 1 Zorba and many other computers. • Piggybacks in Z80 socket. to run desk accessories. Exit Write-Hand-Man and both the screen • Uses National MM58167 clock chip, as and program are restored. Use with any CP/M program and most featured in May '82 Byte. any CP/M machine. Takes only SK of memory. • Battery backup keeps time with CPU FEATURES Notepad for quick notes File and Directory viewer power off! Appointment calendar Quick access phonebook • Optional software is available for file HEX calculator 14 digit decimal calculator date stamping, screen time displays, BONUS Add applications written by you or others! No other "Sidekick" lets you add applications. Dump screens, setup printers, etc. communicate with other computers, display the date and time. • Specify computer type when ordering. let your imagination run wild! • Packages available: $49.95 (California residents add tax), shipping included. COD Fully assembled and tested $99. add $2. Sorry, no credit cards or purchase orders. 30 day guarantee. Complete kit $69. Formats: 8 inch IBM, Northstar and most 5 inch (please specify). Bare board and software $29. Write-Hand-Man only works with CP/M 2.2, ZR DOS and CP/M 3.0 · UPS ground shipping $ 3. (please specify). Simple terminal configuration required. Not avail­ MASTERCARD, VISA, PERSONAL CHECKS, able for TurboDOS. Compatible with keyboard extenders, hard MONEY ORDERS·& C.O.D.'S .ACCEPTED. disks, and other accessories. N. Y. STATE RESIDENTS ADD 8% SALES TAX Poor Person Software 3721 Starr King Circle KENMORE Palo Alto, CA 94306 COMPUTER 415-493-3735 TECHNOLOGIES Trademarks: Write-Hand-Man - Po0r Person Software, CP/M-Digital Research, P.O. Box 635, Kenmore, ~ew \'ork 1-1217 (7161 H77·0617 Sidekick-Borland International

Set yourself free from that antiquated and inefficient operating system The Kaypro Z-System is available in five you now use. Z-System makes your Kaypro faster, friendlier, more different versions, determined by model you intelligent and powerful. See columnist Ted Silveira's 2-part article, use. When ordering, please identify your Dec. '85, Jan. '86 Profiles. machine from this list: • Pre-'84 models • ZCPR3 Environment allows features such as Named Directories, multiple command lines, ingenious batch processing, easy use of user • 2, 4-84 or 2X models areas to organize your files. Be capable of editing, proofing, and printing • Kaypro 10 with D BIOS a document in a single keystroke! • Kaypro 10 with F, G, or H BIOS • Any model equipped with Advent TurboROM.™ • Public ZRDOS Plus allows declaration of "public" direetories, programs that use overlay files find them easily. Requirement to warm-boot after changing disk is eliminated, archive files, plus more! Prices: $69.95 for full system on three diskettes, including • Completely compatible with your current CP/M™ programs. Kaypro Z-System Manual; $119.95 for package consisting • 70-page tutorial-style manual explains in detail how to make the most of full system and Kaypro Z-System Manual, plus 350-page of Z .. Numerous examples show use of Z elements: ALIASes·, VFILER, book ZCPR3: The Manual by Richard Conn, and the fast and ZEX, flow control, MENU processing, Resident Commands, and the efficient DISCAT disk cataloging system (a $10 saving). Add utiltiies. $4.00 shipping and handling, continental USA. MasterCard, • Over 60 utility programs included.

46 MICRO CORNUCOPIA, #30, June-July 1986 ii GraJ!hic ~ "Kaypro · makes a nice compu t er-iloesigner too bad it doesn't do graphics" Make that didn't do graphics. ~- Other features flugust SCS-Draw is here, bringing I\ include block Macintosh-style graphics to the'/ moves, four Kaypro computer. built-in fonts, With SCS-Draw, and powerful you can use print options your Kaypro to~....-;;~~. like enlargement, indentation, draw a picture. mirror image and rotation. And Of anything. with SCS-Draw's windowing feature, you can work on images much The first true drawing program for larger than your Kay pro's screen. the Kaypro, SCS-Draw turns your computer screen into a sketchpad .·.: .. : How good is SCS-Draw? Every on which you can draw detailed ~f~~ day, we get unsolicited letters and images like those shown here. :ill~ phone calls from SCS-Draw users These images can be saved on disk ml around the country - here's what - or printed on your dot-matrix or they have to say: letter-quality printer. I ~-; iu~ II "Very easy to use " /!fffl!Jfjj~,, At:-.·'.. There are many applications of SCS-Draw. For example, you could use SCS-Draw to design and !1 ;~~1:~~::~~~:i~·~ii• print party invitations, banners, 111111 - J S Roseburg OR ~\q,,.IW\i''"' or technical diagrams. You could. also use SCS-Draw to promote 1 your business or design your ~ ii:NiEii~~1:~~ ~~ :ftlfri! company logo. ~~ - D • A • ' Kalamazoo ' MI l4i.Ww~=~;q::;& '=~~..:%~:.::::.Y>.'".·i'J:*;·· • "Everything is bug-free!" x:r;W"~~ ~;gfu\~! An~.!~_e be~~-.~~in~ abou~ SCS-Drawllllll - D.C., Los Angeles, CA . · Xtf~tf: .· .-· · .. :~:::·· · ··-. is that it's fun to ~~I~ "Worth m_uc~ more than its cost." .. ,_ 1 '· · ·-~· ·.. i use - when was == - B.H., Birmingham, AL ~: ;.· the last time you == i.,· . ..r:::\: ·L. had some fun - your ··/··· .. ·····-· ,J .•. "1 ·i,: .. ,-/. ,-: .· \ 'r=·i~ with your - \ I 1 1 'i ,i \. ·· \·\ Kaypro? :Banners

...... ,i ...... ········•··· ~l>bdq}, ':. l !· \_.\,.I) :.\, :; :' ,: ·t._:) ?: ~ ~I I :: x #~ SCS-Draw gives you a variety of useful drawing tools to choose dim ..Pf~:;~ ~J~~~ from. You can draw a detailed g ... with SCS-Draw! Available now image dot-by-dot, or do a rough II for all '84, '85 and '86 Kaypro ~~ sketch with straight lines. Need :;::::::::: CP/M computers. Send $59.95 1:$b er-. :I a compass? SCS-Draw can draw /k: (check or money order) to Second circles of any size, wherever'' ········ City Software, Box 267960, ~~ you need them For subtle Chicago, lllinois 60626. shading effects, use one of Call 312-577-7680

23 pre-defined patterns, ~;.w·::i: for COD orders or or create your own. ,... ;. more information. SECOND CITY SOfTWARE NEW for PrintMaster Owners: Now you Hllil SCS-Draw can be used can use your favorite PrintMaster images IYtJt with most popular /A:->---____,.. ,,n1111 1·1 in your SGS-Draw dra.wings. T~e Image 1I§ dot-matrix and Extractor converts PrmtMaster images to ::~:::: letter-quality SGS-Draw image libraries. Price: $24.95 :!~! printers, including .. ------·-/ __,__.,.., SAVE when you buy SGS-Draw and the ~ those from Epson, Star, Okidata, C. Itoh, \,- .. ---.,-' --<-:. Happy Birthday Image Extractor together: Only $79.95 WR Panasonic, IBM, HP, Diablo and Kaypro. ~,,I n . ' .,J~==t.~~y .. ~\! Jl\J..: ~ - r:.t .. SCS·Draw, KAYPRO, Macintosh, CP/M and PrintMaster are trademarks of Second City Software,,-.i/ · --' ___ _.1 Kaypro Corporation, Apple Computer,.Digital Research and Unison World, respectively. ..-r ''·------/··

Turbo Pascal· makes the movement gradual. With a communications and program written in MS-DOS Turbo between CPIM and MS-DOS systems terminal emulation program I can use which discards the 4 byte prefix is all almost triviaL:.The "almost" part is the PC as a terminal for the CP/M-80 that's needed to get to work again. · what John talks abo.ut this time. machine, so l need only one CRT and Following that is. the code to support keyboard. Programs doodling on a Hercules display with a I must admit there are some things The degree of difficulty in moving joy . stick. Some fun. along with the about MS-DOS that make working in programs will depend on three major WO~. . the PC environment very convenient, factors. First, if your programs use even fun. As I type this, every once in only standard features and extensions, a while the machine quietly beeps to there may be no translation needed at ·1 have. resisted. getting an MS-DOS let me know it thinks I've misspelled all. Two situations which may need i. machine. (rea4./:IBM compatible'') something. The gem that makes this significant massaging are operating for . several reasons. The most possible is Borland' s Turbo Lightning, system specific and processor specific important of the~e. i~ that until recent­ a product I can highly recommend. extensions. ly, the price-perfo'rrriance ratio has not Once loaded, it can continually check compared well ·'Vith Z80 based de­ your input for spelling errors, and Processor Differences .signs. Also, becam~e of my personal when found, two or three keystrokes The processor specific extensions fall bias against Big ')lue I've ignored are all that are needed for correction. into two classes. One class is the many oJ t];te go9d·'points of the ma­ INLINE statement; obviously the chine and software, designs. . The Pascal Transition translation will involve conversion It is ~till true. tl\at many application I have a substantial library of Pascal from one processor's machine code to programs will run more efficiently on · code developed in the CP/M-80 envi­ the other. The other class includes all a .4MHz Z80 . tha11 .. on a stock PC, ronment. Since I have a winchester on statements that either return addresses mainly because of the Z80' s 64K mem­ the clone, most of it will eventually be or have . addresses as arguments. ory liJ;nit .. Programs for the smaller transferred. What kinds of problems Eight-bit processors have a 64K ad­ address space hav~. to be written to be are likely to occur in the migration dress space, accessed through a 16-bit compast and efficient; otherwise they between the machines? I'm assuming address. Integers are also represented would not eyen be possible, much less that the primary problem of moving with 16 bits, so conversions between useful.. Many application programs for the data and source has been solved. addresses and integers are fairly the PC are "core ·hogs" badly in need In addition, since it has become the de straightforward. The 8088 can address of streamlining. facto standard for microcomputer Pas"­ a full 10Z4K of memory, so this needs Why then am I writing this column cal, I'm assuming that the conversion a 20-bit address. Because of the way on a PC clone? First,_· with the 8MHz will be between CP/M and MS-DOS the 8088 is structured addresses are clock option and an NEC V20 proces­ versions of Turbo Pascal. represented with 32 bits, a 16-bit seg­ sor, the machine.. is not nearly as ment value and a 16-bit offset within stodgy .as -the stock machine. Next, I Data Files the segment. Turbo Pascal for the 8088 got the. machine at an extremely good The only data files directly compati­ understandably does the same. price,. i.e. I.traded some of my time for ble between the two operating systems Where changes will need to be . it. Most itnportant, however, is future are TEXT files and untyped files. This made: software. Although there will continue is because all typed files for CP /M 1. All references to the pre-defined to be software developed for CP/M-80 have a 4 byte prefix before the first array MEM .. machines, new titles are dwindling record. This prefix contains the record 2. Addresses for ABSOLUTE varia­ and will eventually fade into oblivion. length and record count for the file. bles. Conversely, new software for the PC This information cannot be .derived 3. ORD cannot be used on pointers will be _showing up for years after Big directly from the disk directory entry for the 8088; use SEG and OFS for the Blue has abandoned the product line. as it can for MS-DOS. If you are not variable pointed to instead. I still haye m,y Big 'Board I, and using 8087 Turbo or Turbo BCD, the 4. MEMA VAIL returns its value in continue to use it for several tas~s. It actual data will be compatible between PARAGRAPHS, each 16 bytes. would be prohibitively expensive to the two file systems. 5. ADDR can be used only for buy all .the equivalent software for the . For DOS, "file of byte" is compati­ variables, not procedures or functions. clone, so the transition will be quite ble with any file. A short file copy You can use OFS for these, along with

48 MICRO CORNUCOPIA, #30, June-July 1986 CSEG which returns the code segment value. Listing 2 - Routine To Adjust A Self-centering joystick Also, EXTERNAL procedures are For Zero Offset When At Rest handled quite differently for the two processors. program adjust_center; { First run the program to find Operating System Differences values for max X and Y deflection, CP/M-80 provides services to appli­ then adjust your centering controls cation programs through a standard to the middle of the range. Re-run CALL, and secondarily, allows calls to the program & adjust for = deflection its machine specific extension, the for both directions of stick movement.} . BIOS. CP/M-86 and MS-DOS use stan­ dard software interrupts for these var services. If the equivalent service is x,y : integer; available, conversion of the software is centerx,centery : integer; a fairly simple change to the corre­ sponding procedure or function for the procedure readstick(var x,y:integer); other operating system. 1. BDOS and BDOSHL are replaced var by MS-DOS (BDOS for CP/M-86). Set­ i : integer; up for the call is quite different and pots : byte; will have to be changed. 2. BIOS and BIOSHL are replaced by begin INTR, which generates a software in­ x : = 0; terrupt for the selected function. y : = 0; Since MS-DOS versions 2 and above port[513] := o; have a tree structured directory, the for i := O to 63 do OVRDRIVE procedure has been begin changed to OVRPATH. pots := port[513]; So far, I haven't had too many x :: x + (pots and 1); problems in the conversion. Most diffi­ y := y + (pots and 2); culties have been with "fancy" and end; non-standard software. y : = y shr 1 ; end; The Fun Part I've been spending a bit of time begin exploring the capabilities of the new readstick(centery,centerx); system. Since I spend most of my time while true do on the machine in text mode, I decid­ begin ed on a monochrome display/adapter readstick(y,x); combination because of the higher y := y - centery; quality text. On the other hand, the x := x - centerx; computer is, in part, a toy so the gotoxy(1,23); monochrome graphics capabilities of write ( 'X = ', x: 4,' Y = ', y: 4); the Hercules style video card was my end; final choice. end. I've ordered the Turbo Grafix Tool­ box (which supports the Hercules) but it hasn't arrived yet. In the interim, a doodle on the screen. But it wasn't at rest. READSTICK does not give set of graphics routines for the Her­ very exciting using just cursor control very high resolution for stick position, cules can be downloaded from the keys, so I bought a Commodore joys­ but in this application more is not Borland SIG on Compuserve. (The tick, did a little rewiring, and came up necessary. If you need higher resolu­ files to download are HERC.SUB, with the program in Listing 1. One tion, a. machine language routine HERC.DOC, and HERCDE.PAS.) This note of caution: I'm not sure that my would be best. set of subroutines provides the basic rewired Commodore joystick is totally tools for monochrome graphics. In compatible with a real IBM joystick, so Note: Listing 1 on pages 50 through 53. addition, text at 90 X 43 is available in you may need to modify the READ­ graphics mode. STICK routine to work correctly. At the urging of the kids (it didn't Listing 2 can be used to adjust a self­ take much) I wrote a program to centering joystick for zero offset when • ••

MICRO CORNUCOPIA, #30, June-July 1986 49 LISTING 1 - SKETCH PROGRAM FOR SCREEN DOODLING

program sketch; {$i here. sub} Include support for Hercules style graphics.} label o; const maxx = 719; pixels across ~n range of o •• 719 } maxy = 330; vertical range 0 •• 347, leave room for prompt line at bottom var centerx,centery : integer; { center position joystick values, allow +/­ offsets from center } x,y,x1,y1, xi,yi,colr : integer; { current pos, target pos, position increment, and •color• black or white} ch : char; { for keyboard input } switch : boolean; { fire button(~) on joystick }

procedure cursor(x,y : integer); { This procedure draws or erases a triangular drawing cursor at the current drawing position. A •color• > 127 will XOR with the backgrbund. This means that the cursor can be drawn on top of existing pixels without losing the information to restore them when the cursor is later moved. } begin draw(x,y,x-5,y+10,128); { x & y are the top point or the triangle} draw(x-5,y+10,x+5,y+10,128); draw(x+5,y+10,x,y,128); end; procedure savescreen; { Save a drawing to a file. Just reads the screen memory (32K) and writes it to a file for later restore. } var picture : file; { untyped. file } screen : array[0 •• $7fff] of byte absolute $bOOO:OOOO; { tiote seg & ors } picname : string[30]; { allow for •path' name for file-} begin gotoxy(1,43); { to bottom text line } write ( 'Name of pie ture file: '); { prompt for file } cursor(x1,y1); { erase drawing cursor, don't want it in the picture read(picname); { get filename } if pos(•.•,picname) = O then picname :: picn~me + •.pic'; {default file type} assign(picture,picname); rewrite(picture); gotoxy( 1, 43); ( erase prompt, don't want it· in picture either } clreol; blockwrite(picture,screen,256); { use high speed file write, 256 • 121 bytes } close(picture); { now we're done } cursor(x1,y1); { restore cursor } end; procedure loadscreen; { Performs the reverse operation to SAVESCREEN above with one exception, for some reason, a BLOCKHEAD from a file directly to screen memory doesn't work. A read into a temporary variable followed by a write to the screen does the trick. Any suggestions as to why the direct file to screen. doesn't work? } var picture : file; screen : array[0 •• $7fff] of byte absolute $bOOO:OOOO; temp : array[0 •• $7fff] of byte; picname : string[30]; (llstingcontinuedonpage52}

50 MICRO CORNUCOPIA, #30, June-July 1986 TURN YOUR KAYPRO ON TOHANDVMANl!I

AUTO DIALER APPOINTMENT CALENDAR • Use your modem to make phone • Check your calendar, schedule calls automatically without exiting appointments anytime your Kaypro the program you are already is onlll working onll • Monthly calendars 1752-2099 ADii

NOTEPAD • Write a note, paragraph, letter, a whole file; anytime, from within any other program!! • Edit another file without leaving your current filell

• Check the directory of any disk, WHAT THE CRITICS SAIDI any user number, from within any program Ill " .. .I've been saved! My faith has been restored in • Display the contents of another CP/M and my trusty Kaypro ....performs as ad­ file on your screen at any time!!! vertised ... it's the best thing that's happened to Kaypro owners since we bought the computers in the first place. It all works fast, easily, and SCREEN DUMP without a hitch, and it's got a 1001 uses! (a_t • Print the screen ... any screen least). The documentation is excellent. .. what a (minus graphics), at any timelll blessing it can be. You start to use it and wonder • Dump to your printer, or to a disk how you lived without it." file!!! Peter McWilliams The McWilllams Letter CALCULATOR January 1986 • Punch up a four function • '"Disk Full'" message? calculator anytime, whenever your With HANDYMAN you can check computer· is onll Works in decimal, the disk directory and erase "Doubles the usefulness of the computer. . .. binary, hex!ll Works from within a superfluous files from within any spread sheet, or any other program Ill Installation is easier than opening can of a program!ll peas." Alice Petersen Genealogy Computer Support Group Turn your Kaypro on!!! HANDYMAN is there!!! "One of my favorite tools." Ted Silveira

HANDYMAN Is a plug-in board for your Kaypro!ll HANDYMAN Includes software in ROM and its own working RAM!ll HANDYMAN Works with all Kaypro CP/M models!!! HANDYMAN You never have to load itlll HANDYMAN Easy to installlll HANDYMAN Single stroke commandsll! HANDYMAN We'll talk you through it over the phonelll HANDYMAN is compatible with all CP/M application programslll HANDYMAN Uses no main memorylll

NEW - HIGH TECH K-20 COMPUTER - INTRODUCTORY PRICE - $1,595.00 NEW - HANDYMAN Version 1.3 Includes: All brand new components mounted in a Kaypro 10 case. Now complete with File Manager. Copy files 20 Megabyte Seagate 65 millisecond hard-disk drive. from any drive/user to any other d/u 800 Kybte (quad-density) Panasonic floppy-disk drive. (Reads single and without leaving your original application file. double sided double-density disks too.) Now enter Appointments with a single keystroke. 84 series Kaypro main board with modem and real-time clock. Standard Kaypro software package (WordStar, etc.). Now available with Advent Turbo ROM or Advent. Turbo ROM or MICROCode Kplus Rom. And of course HANDYMAN. MICROCode KPLUS ROM. (Call) And much more. HANDYMAN Stlll UHi No Main These are complete computers- not upgrades. Price and availability subject to change. Allow 3 weeks · Memory. for delivery. Add 3% for credit card purchases (computers only) and $20.00 shipping and handling. Call for prices on 30, 40, 50, & 100 Megabyte computers. 90 day warranty. Stlll only $124.95 ------HIGH TECH RESEARCH 1135 PINE STREET, #107 - REDDING, CALIFORNIA 96001 CALL 1-800-446-3220 - IN CALIFORNIA CALL 1-800-446-3223 YESI Send me HANDYMAN(s) at $124.95 · $___ _ My Kaypro is a ______(model) (model year). My Kaypro signs-on (boots) as CP/M 2.2 --- (letter). I use (Wordstar or Perfect Writer). (Required for 84 series Kaypros only). Yesl Send me HIGH TECH K-20(s) at $1,595.00 .,..$---- Add 3% for credit card purchases (K-20s only) Charge my· California residents add 6% sales tax $. _____ Card # Exp.------Shipping and handling ($5.00 HANDYMAN - $20 K-20) C.O.D. and checks drawn on US banks also accepted. Signature . TOTAL$.____ _ Phone(__ )___ Eve(--)------Trademarks Kaypro (Kaypro Corporation) (MicroPro International Corporation) Perfect Writer (Perfect Software, Inc.) PASCAL SKETCH PROGRAM (continued from page so)

begin gotoxy(1,43); write( 1 Name of picture ,filei •); cursor(x1,y1); read(pioname); . . if pos ( '. ', pioname) = o then picnam.e : = picname, + '·pie'; assign(pioture,pioname); reset(picture); gotoxy( 1,43); clreol; blookread(picture,temp,256); move(temp,screen,$7fff); close(picture); cursor(x1,y1); end; procedure printscreen; { Dump graphics scre~n to ,printe~. T~is ~r~~edure is quite a bit more complex than the file save/restor• procedures above. The g~aphics screen is not a linear array of. pixels but is actually 4 interleaved 8K byte arrays~ This means. that. the pixel on the dot row immediately below the current pixel is actu~lly 8K +90;bytes (90 bytes per/row) away in the linear address space. ·In addition, conversion has to be made between row scan.(screen~·and column scan (printer). } · var screen i array [0 •• 3,0 •• $1fff] of byte absolute $bOOO:OOOO; inp, out .: array co •• 7] of byte; i,J,k,l : integer; begin cursor(x1,y1); { keep the cursor out or the picture } write(lst,A[,•3•,chr(15));· { set 15/144" line reed } for k := O to 43 do { actuaily 43.5 sets or 8 rows begin write(lst,A[,•L•,chr(208),ohr(2)); 720 pixel ~olumns/~ow } for i := 0 to 89 do 90 eight b-yte ceqs/row · begin for j := 0 to 3 do ..· . { get top 4 bytes. ot cell inp[j] := screen[j,i+(k•180)]; if k < 43 then { if not last r~~. gijt bottom 4 } for j := 4 to 7 do inp[j] := screen[J-4,i+(k•180)+90] · else for j. := 4 to 7 do inp[j] :: o; { else blank bottom 4 } :for j := 7 downto 0 do · {horizontal to vertical conversion begin out[j] := o; blank. output byh } . for 1 := o to 7 do begin out[j] := out[j] shl 1 + ord(odd(inp[l])); merge low order bit inp[l] := inp[l] shr 1; ~biit in next bit } end; end; for j := 0 to 7 do outp~t 8 to p~inter } .·write(lst~ohr(out[j])); end; wri teln( 1st); ready for next row } end;. cursor ( x 1 , y1 ) ; . { our~or back tor .. drawing mode end;

procedure readstiok(var x,y:idteger;var switch : boolean); { Read joystick position. A write to the joystick port t~iggers the one-shots connected to the vari~ble resistance or th~ joy~~iok pots. The outputs of the one-shq~s will remain high ~or a· time Pr~p~rtional to the pot resistance. The X one-shot comes. in on bit 0 and_ the Yon bit 1 while the 'fire• buttons are on bits 4 & 5. Inputs from the fire buttons will be low.~he~ presi~d.}

52 MICRO CORNUCOPIA, #30, June-July 1986 var i integer; pots byte; begin x : = 0; y : = 0; port[513] := O; { trigger on~-shots ) for i := O to 40 ·do { loop length determined by trial & error } begin pots := port[513]; { get current value } x := x +(pots and 1); { sum in x one-shot y := y + (pots and 2); { and they } · end; y : = y shr 1 ; { y comes in on bit 1, divide by .2 to get same range} switch := (pots and $30) xor $30 <> O; does NOT distinguish the switches~ either returns true.} end; begin colr := 1; any •color• 1 •• 127 is visible readstick(centery,centerx,switch); get center values for stick } hires; graphics mode } x1 := 359; start cursor in center of screen y1 := 173; cursor(x1,y1); show the cursor while true do loop rorever } begin readstick(yi,xi,switch); new stick position yi := yi - centery; convert to +/- offset xi := xi - centerx; if (abs(xi) > 1) or (abs(yi) > 1) then { stick •chatters• a bit } begin ·{ so ignore changes< 1 } x := x1; new current position = old dest y : = y1; x1 : = x + xi; calculate new destination } y1 : = y + yi; if x1 >·maxx.then 'x1 : =· maxx; don't let us go off screen } if y1 > maxy then y1 := maxy; if x 1 < o then x 1 : = O; if y 1 < o then y 1 : = 0;; cursor(x,y);. . { kill old cursor if not switch then draw(x,y,~1,y1,colr); if not pen~up draw line between current and dest cursor(x1;y1); { cursor at new· ·posi ti.on } end; delay( SO); { it's a bit fast without this } if keypressed then ··~ ('cheok for keyb~ard command} begin read(kbd,ch); get command char ) case ch or •q•, •Q• : ·goto o·i· { Quit ) 'e', 'E': colr :: O; ( Erase ~o4e, draws in background color) •d•,•D•: colr. := 1; ( Draw ~ode } •s•,•s•: savescreen; . ( Save $Creen to ftle } '1 1 , 'L': loadscreen; { Load screen from file } ' p ' , ' P ' ·: prints c re en; ( Print· screen ,} •c•,•c•: ( Clear screen } begin hires; cursor( x1 ·, y1)';. end; { case •c• end; { case·ch or~ •• ) .. ,., end; { if keypressed ·then ••• ·) end; { while true do~•·· 1· 0: " . textmode; end. End of Listing

MICRO CORNUCOPIA, #30, June-July 1986 53 PC-DOS For Non-Clones By Fred Greeb LogiC~m, Inc. P.0; Box 27465 Writing A Custom BIOS Lakewood CO 80227 Interrupt By Interrupt

CPIM-BO systems aren't the only scribed as generic PC-DOS. Software isn't necessary for the BIOS code to be ones affected by the market's streng designed for the IBM-PC (or compati­ in a contigu:ous portion of main mem­ move toward PC-DOS. Even BOBBI bles) which uses only normal DOS ory. On the.IBM-PC ~t's located in the BOB6 based systems such as Fred's S- system calls to perform 1/0 functions top BK of the 1 :megabyte address 100 have been left without support. will run properly. SoftWare which uses space of the 8088 mkroprocessor. In this. article Fred covers, step by unique features of the machine, such DOS can use a maximum of 640K of step, what he went through to write a as graphics, or software which access­ memory so there's a large gap be­ PC-compatible (or mostly compatible) es the hardware directly, will not run tween DOS and the BIOS. If you want BIOS for his system. In the process properly. to put the BIOS code in ROM, this is a he learned a lot about PC-DOS. This good approach to use. is a cook's tour of PC-DOS that no Requirements & Approach self-respecting technical type should In order to run PC-DOS you'll need Interrupts miss. either an 8088, 8086, 80186, or 80286 You can implement PC-DOS either CPU, 128K RAM, a 5.25" disk drive with interrupt driven 1/0 or with and controller (DD), a terminal or polled 1/0.' I set up hardware inter­ as my system obsolete? Did other form of console device, PC-DOS rupts for · the keyboard and a. clock I need to replace it with a version 2.1, a text editor, an 8086 only. The interrupt driveri keyboard W new one? These questions assembler, linker, and loader. provides a type ahead capability, but had been running through my mind The PC contains the primitive 1/0 isn't necessary for operation of DOS. for quite some time. My dual proces­ functions for accessing the various The clock maintains the time and date. sor S-100 system running CP/M.:.so and components of the hardware in its The IBM-PC uses software interrupts CP/M-86 had served me, but most of BIOS (Basic Input/Output System) hex 10 through hex lF to access the the new developments were centered ROM. This ROM contains all the rou­ BIOS ROM fundions. PC-DOS • re­ around PCs running PC-DOS. tines for accessing the available stan­ serves software interrupts hex. 20 I didn't really ·want to replace the dard hardware. through hex 3F for its use. Interrupts computer, but it seemed I needed at The routines are accessed via soft­ hex 08 through hex OF are reserved for least some degree of PC compatibility ware interrupts, so their physical loca­ the various hardware components con­ to keep up. tion isn't critical to proper operation of tained in the PC. Interrupts hex 00 Since one of my processors was an PC-DOS. If the routine is moved, you through· 07 and interrupts hex 40 and 8088 I decided the easiest and least need only adjust the interrupt vectors 41 are also reserved. If you're using a costly route was to get the PC- (or MS) to access the routine at its new ad­ system with hardware interrupts, they DOS operating system to run on my dress. should riot use any of these values. hardware. If your hardware uses a non-pro­ The BIOS grammable approach to hardware. in­ So For Starters I had to write a BIOS module to terrupts and a conflict exists, you need I obtained the IBM hardware refer­ provide· the 1/0 functions for my hard~ to provide some means of distingtiish­ ence manual, which contains a· com­ ware. In it I tried to adequately sup­ ing between a DOS generated · soft­ plete listing of the BIOS ROM used to port normal PC-DOS function calls ware interrupt and a hardware inter­ interface PC-DOS to the IBM hard­ and to retUrn harmless · values for . rupt. This greatly complicates the ware. those functions which return informa­ problem.· After studying the manual, I con­ tion unique to the PC's hardware. cluded that there was ·a good chance This new BIOS is loaded into ·RAM BIOS Initialization that· PC-DOS would run on my hard­ from CP/M-86 in my system, but it · Tlie first function I implemented in ware. This article describes the results could be placed in ROM so that it's the BIOS was initialization of the of 'that effort and outlines the steps always available. The BIOS includes interrupt vect~rs. Ev~n if you're not required.to implement PC-DOS. the boot routine to load PC-DOS from using hardware interrupts, the inter­ By following this procedure an ex­ disk and to begin its operation. rupt vectors must be initialized since perienced assembly language program­ The normal location for the ·BIOS all the BIOS functions are accessed mer should be able to implement PC­ code is at the top of available memory. through software interrupts. DOS on any 8086 computer system. This leaves the largest possible block After the interrupt vectors have been The resulting system· is best de- of contiguous memory for PC-DOS. It set, I initialize the few memory varia-

54 MICRO CORNUCOPIA, #30, June-July 1986 b~es. required by the BIOS. These AH - 07 - Scrolls the active page In the PC this value is determined variables are defined in the detailed down. by reading the switches on the moth­ descriptions of the BIOS interrupts AH-08 - Reads the attribute/char­ erboard. Since my system doesn't and in the BIOS listing. The BIOS uses acter at the current cursor position. have these switches, I set this data a low address memory segment for My BIOS returns AX-0 (character and word in the initialization code. The data storage. I don't recommend attribute) and BH-0 (active page). value is returned from this routine in changing the data segment location, AH-09 - Writes the character/at­ the AX register. since that's where PC-DOS expects it. tribute at the current cursor position. The meanings of the 16 bits which Next, initialize the system hardware. My BIOS treats this as normal charac­ form the equipment definition are as This includes setting the serial device ter output. The main difference is that follows: baud rates, data bits, parity, etc., and the PC BIOS does not advance the Bit 0 - If this bit is 1, it indicates initialization and start up of the dock. cursor position for this function (or for that ·floppy disk drives are present in Interrupts are then enabled and the function 10),, and my BIOS does. The the system. If zero, no floppy disks boot routine to load DOS is entered character . to be output is in the AL are contained in the system. via a software interrupt. register. Bit 1 - Not used, set to zero. AH -10 - Writes the character at Bits 3,2 - Indicate the base RAM Interrupt Descriptions the current cursor position without size. This is a carryover from the Data is passed to the software inter­ advancing the cursor. My BIOS also original IBM-PC, which could accom­ rupt handlers via the CPU registers treats this as normal character output. modate a maximum of 64K RAM on and returned from the handlers both The character to be output is in the AL the motherboard. I don't know if these in the registers and in the processor register. bits are required by PC-DOS, but it's flags. AH -11 - Sets the color palette. best to set them to their maximum The following descriptions define the AH-12 - Write graphics dot. value of 11, indicating 64K of mother­ functions performed by each software AH-13 - Read graphics dot. My board RAM. The other values are 00 interrupt, the data passed to it, and BIOS always returns AL-0. - 16K, 01 - 32K, and 10 - 48K. the data returned from the routine. AH-14 - Teletype (TIY) output. Bits 5,4 - Indicate the initial video This is the normal output mode for all mode for the monitor interface. Set to Interrupt 10 - Video Output of my BIOS output functions. This 11 for 80 by 25 black and white. Other This is one of the most complex function is used by the DOS character values are 00 - not used, 01 - 40 by interrupt handlers in the PC BIOS output function calls. The character to 25 color graphics card, 10 - 80 by 25 ROM. It provides support for both be output is contained in the AL color card. simple character output and black/ register. Bits 7,6 - Indicate number of floppy white and color graphics. Since I have AH-15 - Return the current video disk drives (5.25", IBM format) con­ an ASCII terminal, I wrote my BIOS to state. My BIOS returns AL - 2 (80 by tained in the system. Bit 0 must be support only simple character output. 25 black and white), AH-80 (number one for this parameter to have any The function to be performed is of columns on the screen), and BH-0 meaning, The values are 00 - 1 drive, passed to the interrupt handler' in the (current active page number). 01 - 2 drives, 10 - 3 drives, and 11 AH register. A total of 15 functions are This function becomes a simple char­ - 4 drives. supported by the PC ROM BIOS. acter output routine to send data to Bit 8 - Not used, set to zero. These functions, along with the action the terminal. The terminal is interfaced Bits 11,10,9 - Indicate the number taken by my generic BIOS, follow. My via a serial port, and operates in a of RS-232 serial interface cards con­ BIOS ignores 00, 01, 02, 03, 04, 05, 06, polled 1/0 mode. If the interface isn't tained in the system. Do not include 07, 11, and 12. ready when this routine is called, it the serial interface to the system con­ AH- 00 - Sets black and white or waits until the character can be sent sole. color output, as well as character or before returning to the calling pro­ Bit 12 - Indicates that a game 1/0 graphics mode. gram. interface is present if set to 1. AH - 01 - Sets the cursor type used If you use a different type of console Bit 13 - Not used, set to zero. by the PC. driver (memory mapped video board, Bits 15,14 - Number of printer AH - 02 - Sets cursor position. for example), you may want to incor­ interfaces in the system. This can be AH - 03 - Reads the cursor posi­ porate some of the other features (read misleading, since the IBM BIOS as­ tion. This function is ignored by. my screen, etc.) into your interrupt han­ sumes that printers are interfaced via a BIOS, and always returns· a valu~ of dler. parallel port (Centronics type inter­ zero. Simple character output is the only face). If you use a serial interface to AH - 04 - Reads the light pen posi­ function necessary for operation of PC­ the printer set these bits to zero. The tion. This function is ignored by my DOS. DOS MODE command can be used to BIOS. It returns zero to indicate no redirect the printer output to a serial light pen. Interrupt 11- Equipment Check port. AH - 05 - Selects the active .display This interrupt returns a data word page. . which defines the hardware present in AH-06-Scrolls the active page up. the system. (continued next page)

MICRO CORNUCOPIA, #30, June-July 1986 55 PC-DOS FOR NON-CLONES

(continued from page 55)

Interrupt 12 - Memory Size This interrupt returns a data word (in the AX register) which indicates the number of contiguous lK blocks of memory in the system. The maximum RAM supported by the PC is 640K.

Interrupt 13 - Floppy Disk 1/0 This interrupt handles all floppy disk 1/0 requests for 5.25" disks. the func­ tion to be performed is contained in the AH register. · All of the functions return informa­ DSD86, The PC-DOS Debugger ...... 69.95 tion in the carry flag and the AX DSD87, The PC-DOS Debugger with 8087 Support. 99.95 register. If the carry flag is clear, the DSD80, The CPIM Debugger ...... : ; ...... 125.00 operation was successful. In this case, the AH register is returned as zero, and the AL register contains the num­ ber of sectors of data transferred by the operation. If an error occurred, the SoftAdvances SJll carry flag is set, and AH contains the error code. P.O. Box 49473 •Austin, Texas 78765 • ( 512) 478-4763 The AL register indicates the num­ 1-800-232-8088 ber of sectors transferred (it may not be the same as the number requested). Here are the five functions handled by this routine - . AH - 0 - Resets the disk system. No physical request need be sent to the DH - Contains the head number, 0 or the format code is not included in the disk controller by this command. A 1. BIOS .. memory variable is set indicating the CH - Contains the track number, 0 disk status is unknown and a home through 39. Floppy Disk Controller (seek track zero) operation should be CL - Contains the sector number, 1 l used DMA (Direct Memory Access) performed by the next read or write. through 9. to transfer data between the controller This function should always return AL - Contains the number of consec­ and memory. This isn't a requirement, with the carry flag clear to indicate utive sectors to trans£ er. and a programmed 1/0 controller successful completion, and zero the ES - Contains the segment for the could just as easily be used. Only the AH and AL registers. data. read/write code in the interrupt han­ AH -1 - Reads the status of the BX - Contains the offset for the data. dler would have to be changed. floppy disk system. This function re­ turns the status of the last disk opera­ In other words, ES:BX is the data Interrupts tion in the AL register. The carry flag address. The interrupt handler checks each is set according to the value of the For the disk format operation, ES:BX request and returns a bad-command status word returned. points to a table of parameters which error code if the requested function AH - 2 - Reads sectors from the supplies information for the format isn't available. This check must be floppy disk into memory. operation. made since a hard disk controller, for AH-3 - Writes sectors from memo­ The table contains the track, head, instance, uses additional functions, ry to floppy disk. sector, and sector size code - one which are. also passed in the AH AH .... 4 - Verifies sectors with data entry for each sector to be formatted. register. in memory. No actual data transfer This data is for the NEC 765 floppy The BIOS interrupt vector for the should occur. disk controller chip (standard in the floppy disk 1/0 function is modified by AH-5 - Formats (initializes) the PC and clones). If your system uses the ROM contained on the hard disk track. this same chip, you can incorporate controller card. DOS determines the For the read, write, and verify op­ the format code into the BIOS. presence of a hard .disk by requesting erations, data is passed to the routine My system has a Tarbell double one of these higher numbered func­ in registers in the following manner: density disk controller, which uses the tions. If the BIOS returns a bad com­ Western Digital 1793· controller chip. mand error, it assumes that no hard DL - Contains the drive number, 0 The 1793 requires completely different disk is present in the system, and only through 3. data to initializ~ a disk, and therefore accesses the floppy disk drives.

56 MICRO CORNUCOPIA, #30, June-July 1986 RP/M2TM creates f4 Bit Lab Aeeuraey Industrial Durability CP/M©2.2 compatible IBM PC 1. Remove the 8088 2. Install the NEC µ.PD70108 (V20) 3. Boot PC RP/M2 The µ.PD70108 chip is a fast 8088 that also executes 8080 machine code. PC RP/M2 is an operating system. Either standalone or with MSDOS present, PC RP/M2 provides the solid base of a genuine operating system reliably distinct from the facade created by an MSDOS interface. All 2.2 features are supported with 56.5k TPA, plus file date and time stamping, fast virtual disk, iobyte redirection, terminal The Servo Process Control Board is a general purpose multi-channel analog and digital input/output controller which can communicate with cursor positioning, color console display. DOSDISK acces­ and control most medium-scale industrial processes. Designed to work ses MS DOS drives; MODEM PC transfers files via serial port; with the Servo Industrial Microcomputer, (or other computers which support the SASI Interlace), It offers great accuracy at prices starting SETDISK redefines a drive to any of over 80 formats, allow­ as low as $495. ing PC RP/M2 to directly process existing CP/M files in their I American made I MILSPEC components 11 year warranty native form.Two system disks plus 105 page user and techni­ Maximum configuration includes: I 192 analog Inputs I 64 analog outputs I 128 digital Inputs I 512 digital outputs cal manual $129.Shipping $5 ($10 nonUS) :E • I Based on the INTERSIL 14 Bit A to Dconverter ICommunicates with any micro or mainframe computer I Easily programmed in high level languages (Turbo Pascal, Microsoft Basic, Forth) I PID, FFT, Thermo­ 118 SW First St. - Box G couple linearization and laboratory DAS software supplied. I Custom A software and hardware engineering assistance available. Micro - Warrenton, OR 97146 360-B N. Ellensburg St. IY\et"hods, Inc. (503)861-1765 Box 566 I ~ Gold Beach, OR. 97444 SERVO COMPUTER CORPORATION (503) 247-2021

Disk Accesses data across a 64K boundary .. there's no error, the status parameter The first function performed by the Since it's a feature of the PC, I is set to zero, and the zero flag disk read and write routines is a call to recommend you retain the function indicates no error. the DMASET routine. . and purpose of the DMASET routine, DOS handles all of the retry func­ This routine translates the data seg­ even if it isn't necessary for your tions, so there's no retry logic for the ment and offset (contained in ES:BX) controller. seek or read/write routines in the to a page and offset form. Page refers BIOS. to a 64K bank of memory, and offset MSETUP After a successful data transfer (an to the location within that page. This The MSETUP routine in the BIOS error would terminate the routine), the is done due to a hardware requirement . listing is configured for a single floppy read/write code checks for a multiple of the Tarbell and PC disk controller. disk drive, and must be modified for sector trans£ er request and transfers The Tarbell controller uses a register multiple drives. additional sectors if needed. to hold the top 8 bits of a 24-bit Only the MSETUP routine is affected address for data transfer, with the low by the use of multiple drives. A pause Transferring Multiple Sectors 16 bits set by the DMA controller chip. is built into this routine to allow the I have to deal with multiple sector The top 8 bits are fixed for a single drive motor to come up to speed, transfers because the 1793 controller data transfer, so data transfer across a since the Tarbell does not have a chip isn't set up for the type of 64K boundary isn't possible. There­ means to test the ready condition of multiple sector requests issued by fore, after sending the page number 5.25" drives. If your controller polls DOS. (bank) to the controller and saving the the drives, the delay can be replaced The 1793 can transfer multiple sec­ offset address, the routine checks to with a ready test. tors with a single command, but the see if the transfer will cross a 64K ending sector must be the last sector boundary. If so, the carry flag is set, Data Transfer on the track. So multiple sector re­ and the 1/0 function is terminated The routine MDAMRW initiates the quests are handled as a series of single with a DMA boundary error. data transfer by sending commands to sector transfers by the BIOS, transpar..; I haven't determined if this error the DMA and floppy disk controller. ent to DOS. should be returned if you have a Then after these chips have handled If the number of sectors requires controller which doesn't have this lim­ the job, it tests for an error condition. reading beyond the end of the current itation. For example, a programmed I/ If an error is found, the error code is . track (as specified by the disk parame- 0 controller (like the CompuPro flop­ translated to the code expected by py disk controller) could easily transfer DOS, and the zero flag is cleared. If (continued next page)

· MICRO CORNUCOPIA, #30, June-July 1986 57 PC-DOS FOR NON-CLONES

(continued from page 57) ters, see interrupt lE), the routine is terminated with a Sector Not Found z SETSYOU FREEi error. The common return code for all Z Operating System, an 8-blt OS that fllesf Optimized HD64180/ZBO assembly language functions sets the carry flag according code - full software development system with proven llnkabfe libraries of productive to the value of the status word stored subroutines - relocating fROM and RAM) macro assembler, linker, librarian, cross­ by the 110 handlers, and then returns reference tabfe generator, debuggers, translators and disassemblers - ready to free to DOS. An interrupt return instruc­ your tion can't be used because it would High performance and flexibility/ Productivity results from dynamically customized OS environ­ restore the flags to their original condi­ ments. matching operator. tasks and machine. tion, and the carry flag would no Real-time control kernel option allows quick software development for industrial control longer indicate the function status. . applications, other tools and utilities for office desk-top personal computing functions. local area networks to Ethernet. Apple Talk, Omninet. ArcNet. PC-Net (Sytek) - From micro to mainframe The RET 2 instruction throws away command. control and communications. Distributed processing application programs are easily the old value of the flags, preserving developed. the carry flag as set by the interrupt • Extreme organizational flexibility. each directory another environment handler. The verify command returns • Multiple Commands per line the success status. • Aliases (complex series of commands known by simple names) with variable passing • Named Directories with absolute password security Format • Full-screen command line editing with previous command recall and execution I set up the format command as a • Shells and Menu Generators. with shell variables simple (successful) status return. This • Command-file search Paths, dynamically alterable allows the DOS format command to • Screen-oriented file manipulation and automatic archiving and backup work properly, assuming the disk has • 512 megabyte file sizes. 8 gigabyte disks handled been physically initialized prior to is­ • Auto disk reset when changing floppies • TCAP database handles characteristics of over 50 computers and terminals. suing the command. more easily added DOS FORMAT writes the boot • Tree-structured online help and documentation subsystem record on the disk, initializes the direc­ • 7b syntax-compatible support utilities tory, and optionally writes the operat­ ing system on the disk. Your missing fink has been found - Zf Now fly with eagfesf Fast response, efficient resource utlflzatlon, fink to rest of computing worfd - shop floor to executive suite, If FORMAT returned an error, it micro to corporate mainframe. Calf 415/948-3820 for flterature. wouldn't be possible to generate a bootable disk with the generic PC­ r;;n . DOS system. So you'll need a separate program to initialize a blank disk (a l::.!J Echelon, Inc. 101FirstStreet • suite427 • LosAltos,CA 94022 • 415/948-3820 minor inconvenience). The program I use runs under CP/M, but it could be physical port address. Port number 0 _tialization, prior to booting the system. rewritten for PC-DOS. is the first, communications port, 1 is The system status consists of ·data If you're using a disk controller with the second, etc. ready bits in the AL register, and the the NEC 765 controller chip (or its The functions which are available modem status line conditions in the equivalent, the Intel 8272 chip), you'll are: AH register. The data status bits are probably be able to use code very AH -= 0 - Initializes the port, return­ . bit zero set for data ready to receive similar'to that in the IBM BIOS ROM. ing the full port status in the AX (test with Olh), and bit. 5 for. ready to Except for drive select, motor on, etc., register. transmit (test with 20h). My BIOS uses most of the code should work with AH .... 1 - Sends· the character in the bit 5 of the line status register ·to test very little modification. The port ad­ AL register, returning the line status DTR, and will not transfer data unless dresses will undoubtedly be different, in the AH register. · this line is low. This is reversed from but the commands should be the AH .... 2 - Receives the next character some systems, so if your system hangs same. in the AL register, waiting until a when you try to do serial output, character is available, and returns the reverse (or eliminate) this test. Interrupt 14 - Communications Port line status in AH. I use the serial ports in my system 1/0 AH - 3 - Returns the full port status for the printer and a modem. The This interrupt handles all communi­ in the AX register. serial ports are not required for opera­ cations with the serial ports. The func­ Most of these commands are. tion of DOS. If you do not have any tion to be performed is in the AH straightforward, and should present serial interfaces in your system this register, and the port number is in the no problems. In my system, the initial­ code can be replaced by the dummy DX register. ize command is ignored, and merely return point in the BIOS. If your The port number refers to the IBM returns the system status. All port terminal is interfaced by a serial port, communications port number, not the initialization is done in the BIOS ini- it should not. use this interrupt han"'.'

58 MICRO CORNUCOPIA, #30, June-July 1986 PUBLIC DOMAIN SOFTWARE FOR *ALL* COMPUTERS FROM THE LARGEST LIBRARY IN THE WORLD! Rent or buy complete user group libraries! (Or select individual disk: ONLY $4.00 each.) Since it's not copyrighted, PD software may be freely distributed. Get accounting, dbase, Games, Word Processors, Educational, Communications, Utilities, Spread Sheets and hundred~ more! User Group libraries are expanding every month as new software Is ·contributed, get the latest info: a directory disk and catalog - only $5.00 postpaid! (Specify computer). Browse through a rental library - copying out programs of Interest to build yollr very own special interest library! IBM-PC COMPUTERS Rent Buy CP/M COMPUTERS- 300 Formats Available Rent Buy IBM-PC SIG 454 Disksides ...... $460 $845 SIG/MUG 260 Disksides .•.•••.•...••.••••• $175 $600 PC-Blue 187 Disksides ...... : ...... $190 $375 CP/M UG 92 Disksldes ..••••.•...••.••••... $ 45 $249 Capitol-PC 35 Disksides ...... ; ...... $ 40 $105 CP/M 86 25 Disksldes •.•.•••••....•.••••... $ 25 $100 Author's Showcase 25 Disksides ...... $ 50 · $100 Kaypro .UG 60 Disksldes •..•.•••...... •.•. $ 70 $230 COMMODORE 64 Epson UG 58 Disksides • . . . . . • ...... • . . . • . . $ 70 $220 PC Gold 102 Disksides ...... $100 $200 ATARI ST C-64 28 Disksides ...... •...... $ 25 $ 65 STD PD 25 Disksides ...•...... •.••••.••...• $ 50 $100 Amiga 25 Disksides ...... $ 50 $100 . Diskdownloadingservice-$10.00firstdisk,$5.00thereafter. APPLE (Also CP /M Format Available) No label disk sales $.69¢ with PD order. Rentals are for 7 days, Best of DOS 120 Disksides ...... $120 $200 3 more days grace for return. We use UPS. Macintosh 74 Disksides ...... $ 80 $225 Call (619) 727-1015 for 3 minute info recording. Call (619) 941-0925 for technical info. Call 1(800) 621-5640, wait for tone, then dial "PUBLIC" for orders only. Send large $.39¢ stamped envelope for free catalog. NATIONAL PUBLIC DOMAIN SOFTWARE LIBRARY, 1533-A AVOHILL, VISTA, CA 92084

dler. The communications 110 inter­ reference manual and are simply the For all functions the printer number rupt should be reserved for use only numerical codes assigned to each key. (not the port number) is contained in by additional serial ports in the sys­ I use an interrupt driven keyboard, the DX register on entry to the inter­ tem. but you don't have to. If you use a rupt handler. polled keyboard, make sure you im­ Interrupt 15 - Cassette 1/0 plement the status routine properly so Interrupt 18 - BASIC This interrupt is used to interface a it returns the status without destroy­ This interrupt provides access to the cassette tape recorder to the IBM-PC ing the character (so a subsequent read BASIC ROM in the IBM-PC, and is not and is not used in my BIOS. can retrieve it). This means that the used by my BIOS. status routine must buffer one charac­ Interrupt 16 - Console Input ter. Interrupt 19 - Bootstrap This handles all requests for key­ This interrupt reads the boot sector board data from the system. There are Interrupt 17 - Printer Output (track 0, sector 1) from the disk in the three available functions contained in This interrupt is for printer output first floppy disk drive. The data is the AH register on entry to this rou­ via a Centronics interface. This is the placed at address 0000:7COO (seg­ tine - . default printer mode for PC-DOS. I ment:offset), and if a successful read AH=O - Reads the next key, wait­ did not use this interrupt, but if you occurs, the bootstrap program is then ing until one is available. need it, the following functions are executed from that address. AH .... 1 - Returns the data available available: If an error occurs, the program con­ status in the Z (zero) flag. If the Z flag tinues looping (forever) until a suc­ is set it means that no data is avail­ AH= 0 - Prints the character in the cessful read is accomplished. The disk able. If the Z flag is clear, data is AL register. Returns the status in AH. 1/0 interrupt (interrupt 13 hex) is used available, and the character is re­ Sets AH to indicate a time out error if to access the disk 1/0 routines, so turned. The character read is n~t de­ the character could not be printed. there are no hardware dependent par­ stroyed, but will be available for the Sets any other status bits as appropri­ ameters in the boot routine. next read function request. This is ate. You may want to implement an often referred to as a non-destructive AH ... 1 - Initializes the printer port error message after several retries to read operation. and returns the status in AH. provide some indication that the sys­ AH ... 2 - Returns the shift status. AH ... 2 - Returns the printer status tem isn't completely hung up. The The IBM keyboard is unencoded, in the AH register. The status bits are normal cause for· this error would be and merely puts out a scan code. The defined as follows: an unformatted disk, since the boot ROM BIOS returns the ASCII transla­ routine does not check the data which tion in the AL register, and the raw Bit 0 - Set for a time out error. it loads from the boot sector. scan code in the AH register. My Bit 1 - Not used. terminal outputs ASCII data, and the Bit 2 - Not used. Interrupt lA - Time Of Day scan code is always returned as zero. Bit 3 - Set for 1/0 error. This interrupt either reads the timer If you want to include the extra c;ode Bit 4 - ·set for printer selected. counters (AH ... 0) or sets them· to return the scan codes, it could be Bit 5 - Set for out of paper. (AH= 1). Even if you don't have a done via a look-up table. The scan Bit 6 - Set for acknowledge returned clock in your system, you sh~uld codes for the keys on the IBM-PC are from the printer. listed' in the IBM hardware technical Bit 7 - Set for not busy condition. (continued next page)

MICRO CORNUCOPIA, #30, June-July 1986 59 PC-DOS FOR NON-CLONES

(continued from page 59) Implementing Generic DOS Register Dumps Modify the BIOS source code to The register dump routine uses · preserve this function and the three match your hardware requirements. memory variables in the BIOS code counter locations used by this routine Pay particular attention to those soft­ segment, so if it is incorporated, the so the read time function will return ware interrupt handlers which return BIOS must be in RAM memory. If the last value stored by the set time information in the flags. These rou­ you're going to put the BIOS in ROM, function. tines must not end with an interrupt remove the register dump routine after return instruction, since that would you've debugged the code. Interrupt 1B - Keyboard Break restore the original state of the flags. Proceed logically through the check­ This interrupt is used by some appli­ Assemble the modified program and out procedure. If you don't enter the cation programs to handle a keyboard correct any errors. interrupt 19 (bootstrap) routine, some­ control break input. It should be ini­ When the code assembles correctly, thing is wrong with your BIOS initiali­ . tialized to point to an interrupt return it's necessary to generate an executa­ zation code. If you get to this point, instruction. ble file. This code should be linked to but there is no disk activity, the run in high memory, above the memo­ problem is probably in your disk read Interrupt 1C - User Timer Function ry available to PC-DOS. logic. This interrupt is included in case an After you've generated the executa­ If you get past this point, but there's application program wants to do ble BIOS file, run it to boot PC-DOS nothing on the screen, the problem something special on each tick of the into the system. (With CP/M-86, I type may be in the video output routine. hardware clock. It's executed every in "PCBIOS," the name of my execut­ It's possible the initialization of the time the clock interrupt handler is able BIOS.) serial and parallel ports can be causing entered. It should be initialized to an If all goes well, the BIOS will read the problem, but this can be eliminat­ interrupt return instruction. the boot sector into memory, and ed by using a simple return from execute it to load the rest of PC-DOS. interrupt instruction for these two in­ Interrupt 1D - Video Parameters PC-DOS will request the date and terrupt handlers. This is not an interrupt but is used time, and then display the familiar If you get a sign-on message, but as a pointer to parameters for the A> prompt on the screen. there's no response to the keyboard, video card in the PC. This pointer check your keyboard read routine. serves no useful purpose in my sys­ Debugging The BIOS tem, but it should not be used for any Unless you're exceptionally lucky, Port Contention other purpose. the first run won't be perfect. The Another potential problem area in system will hang up, leaving little some systems is the initialization code Interrupt 1E - Floppy Disk Parame­ indication of the problem. Time for· contained in the file IBMBIO.COM, ters debugging. which is the first file loaded by the This is also a pointer defining the Debugging the BIOS isn't as easy as boot routine. address of the parameters required for debugging a normal application pro­ One of the first things this code does operation of the floppy disk. gram since the first thing the BIOS is output a value of 20 hex to port The pointer is initialized to the data program does is modify all the inter­ number 20 hex. This clears any pend­ contained in the BIOS, but is modified rupt vectors. So any normal debug­ ing interrupt requests. by PC-DOS to reflect the actual disk ging tools you have, such as DDT86 If this port number conflicts with format being used. . under CP/M-86, can't be used. Instead any ports on your system and causes The floppy disk 1/0 routines use we leave messages at the end of the undesirable effects, it'll be necessary to data from · this parameter block to program. patch it out using whatever tools you perform the read/write operations. The have available. data contained in the parameter block Messages The four bytes of code which send includes the sector size and the sectors By including these messages at the this output are BO 20 E6 20 (hex). per track, as well as some data unique entry and exit of the various BIOS Change these bytes to NOP instruc­ to the NEC floppy disk controller chip. interrupts, you can get a good idea of tions (90 hex) to disable the output. what is going wrong. In the program The four bytes are located 1975 bytes Interrupt 1F - Graphics Parameters listing, the message print routines can (decimal) from the beginning of the This is also a pointer which is used be enabled for the disk 1/0 routines by start of the file. In terms of absolute when the IBM video is operating in setting the parameter debug13 true. track and sector number, they begin at the graphics mode. It is not used in Other messages can be incorporated in byte number 439 of track 1 sector 4 on my BIOS. a similar manner. a single sided PC-DOS 2.1 floppy disk. The message print and register There may be other ports in the PC Interrupts 40 and 41 - Fixed Disk dump routines preserve the state of all which could cause conflicts with your These interrupts are reserved for the registers and flags, so they can be hardware. The one listed above (port hard disk controller board which may used without modifying any of the 20H) is the only one I've found which be used in the PC, and should not be parameters passed to or returned from is addressed directly from PC-DOS, used for any other purpose. the interrupt routines.

60 MICRO CORNUCOPIA, #30, June-July 1986 ~INTEGRATED BIU:S t-UH ~ BIGBOARD II This BIOS adds special features to your Bigboard II floppydisk and/orWinchester system. Read, write and format any 5" and/or 8" Table 1 - IBM-PC Port Addresses disk formats. 40 formats included. Use any type of 5" and/or 8" drive. New Port SYSGEN works between 5" and 8". Address Function INCLUDES: • CONFIGuration program that lets you install any new floppy disk format 00-0D 8237 DMA controller chip. INTERACTIVELY. 20-21 8259 interrup~. controller chip. • FORMATIER allows you to format 40-43 8253 timer chip. almost any diskformat. 8255 parallel interface·chip. Used • PC-COPY reads and writes PC disk­ 69-63 ettes on your Bigboard II.; for keyboard, sense switches, and • MONITOR EPROM with serial keyboard cassette tape interface. and translate table. 81-82 DMA page register. • 300 page ZCPR2 manual. 201 Game card. • 60 page BIGBOARD II tech manual. • BOOTABLE DISK contains free ZCPR2 210-216 Expansion box interface. and P2DOS system. With TIME and DATE 278 Printer card #3 base address. stamping. BIOS also has provisions for 2F8 Serial card 02 base address. 256K RAM disk, Centronics, system 320 Hard disk base address. in ROM. Printer card #2 base address. •WINCHESTER FORMATIER and SYSGEN 37 8 Supports XEBEC, W-0 and ADAPTEC 3B4-3BA 6845 video controller chip, BW. type controllers. Subdivides into any 3BC Printer card #1 base address. specified number of drives. 3D4-3DA 6845 video controller chip, color. Price: $99.95 (specify disk] 3F2-3F5 Floppy disk controller. 3F8 ANDY BAKKERS Serial card 01 base address. de Gervelink 12 • 7591 OT Denekamp The Netherlands •Tel: 31-5413-2488 Please pay with US$ Money Order. MC or VISA welcome. rather than via a BIOS interrupt rou­ for those operations which require two Also, some software looks at the tine. diskettes. scan code returned by the keyboard Table 1 lists the ports I've found on rather than the ASCII value of the the PC. If you have ports with these Restrictions key. By setting up the BIOS to return same physical addresses, and are ex­ This system is definitely not the the proper scan codes, more software periencing problems, you may want to equivalent of a PC. In general, pro­ may be available for use with the check for any input or output instruc­ grams which use normal PC-DOS sys­ generic system. This function could be tions to these ports. tem calls for I/O will run OK. Pro­ implemented with a fairly simple look­ This isn't easy without some form of grams which take advantage of special up table. debugging tool. If you can get PC­ features of the PC hardware will not. DOS to run at all, you might be able ROM BASIC, of course, will not. Finally to use the debug program which is Programs which require graphics By taking the software approach part of it. If you're running CP/M-86, capability, such as Flight Simulator, implementing PC-DOS, I have and have a way to move files from the won't run since no graphics capability achieved some degree of PC compati­ PC-DOS disk to one of your CP/M is included in the BIOS. bility without the expense of new disks, you could use DDT-86 for this Copy protected software probably hardware. purpose. won't run, since most of the copy I'll probably expand my PC-DOS Many of the port addresses are 16 protection schemes access the disk implementation to include my second bits long. If your hardware uses only controller directly, rather than using 5.25" disk (a 96 tpi drive), my 8" disk the low 8 bits for I/O port addressing, DOS (or even BIOS) calls. drives, and RAM disk. the 16-bit addresses could inadvertent­ I've tested all the general purpose A nice feature of PC-DOS is that it ly address undesirable ports. utilities on the PC-DOS system disk - lets you add device drivers which are CHKDSK, DEBUG, SORT, etc. loaded when the system boots. So Home Free They're OK. Many compilers and edi­ additional devices can be interfaced After you get PC-DOS to successful­ tors run fine. without changing the BIOS code. ly boot and sign on, the checkout procedure is almost complete. About Additions? Editor's Note: the only things you haven't tested are One useful function would be to set Fred's complete BIOS listing can be the disk write routines. Try copying up the terminal function keys to return downloaded from the Micro C Bulletin some files from one disk to another. If codes compatible with the IBM key­ Board (503 382-7643) or ordered from you have the system configured for board function keys. This would be Fred directly (on disk for $15). only one floppy disk, PC-DOS will tell useful with some DOS functions and you when to swap disks in the drive some application software. •••

MICRO CORNUCOPIA, #30, June-July 1986 61 C CODE FOR THE PC TOTAL CONTROL source code, of course _, -*..._=:.=)- with LMI FORTH™ Concurrent C . . $45 Coder's Prolog in C . . $45 LEX . $25 YACC & PREP . $25 Small-C compiler for 8088 . $20 tiny-c interpreter & shell . . $20 Xlisp 1.5a & tiny-Prolog . . $20 C Tools . $15 For Programming Professionals: an expanding family of The Austin Code Works compatible, high-performance, 11100 Lea/wood Lane Forth-83 Standard compilers Austin, Texas 78750-9409 for microcomputers {512} 1158-0785 For Development: Free shipping on prepaid orders No credit cards Interactive Forth·83 Interpreter/Compilers • 16-bit and 32-bit implementations • Full screen editor and assembler • U~es standard operating system files . • 400 page manual written in plain English • Options include software floating point, arithmetic coproc·essor support, symbolic debugger, native code compilers, a~d graphics support For Applications: Forth-83 Metacompiler • Unique table-driven multi-pass Forth compiler • Compiles compact ROMable or disk-based applications IJ~/11# .. • Excellent error handling • Produces headerless code, compiles from intermediate states, and performs conditional compilation l?Efkf /Pl/N))l/JfJIC'f'S • Cross-compiles to 8080, Z-80, 8086, 68000, 6502, 8051, 8096, 1802, and 6303 • No license fee or royalty for compiled applications Sampler ($35) and/or For Speed: CForth Application Compiler Professionn1 Systems (from $175) for ... • Translates "high-level" Forth into in-line, optimized ·machine code • Can generate ROM able code Apple ProOos Amig11 Support Services for registered users: Hicro VAX • Technical Assistance Hotline Hacintosh • Periodic newsletters and low-cost updates 18/'f PC/AT • Bulletin Board System DEC Falcon Call or write for detailed product Information UNIFORTH is a full-featured, floating-point, FORTH-83 and prices. Consulting and Educatlona/Servlces Standard language available for most micro and mini computers. available by special arrangement. Call or write. for our free catalog or use our Bulletin Board (614-459-7736, 300/1200 Baud) •Laboratory Microsystems Incorporated for more detailed Information. rlPost Office Box 10430, Marina de/ Rey, CA 90295 • ~~hone credit card orders to: (213) 306-7412

UNIFIED SOFTWARE SYSTEMS Overseas Distributors. Germany: Forth·Systeme Angelika Flesch, Titisee·Neustadt, 7651-1665 P.O. Box 21294, Columbus, OH 43221-0294 UK: System Science Ltd., London, 01·248 0962 (614) 459-7735 .France; Micro-Sigma S.A.R.L., Paris, (1) 42.65.95.16 Japan: Southern Pacific Ltd., Yokohama, 045-314·9514 Australia: Wave-onic Associates, Wilson, W.A., (09) 451·2946

. 62 MICRO CORNUCOPIA, #30, June-July 1986 ,.-.------c::cPLUG INTO SAVINGS!------..... FOR YOUR l.B.M. Data Mac 5.25" hard disk controller card. DataMac Dual Async Card (card only) DataMac Dual Async card with 256K, comes with one active port, you add the no memory, requires 8250 l?lus your second 8250 and connector. cable for second port. with documentation $l99S $3995~ s~'-~

RODIME 20 MEG 5.25" CONTROLLER 31/i' FLOPPY DRIVES HARD DISK CARDS SHUGART These drives are brand new in factory cartons. full size with documentation SA300 $29995 (similar to photo) $999SEA D.T.C. 1403-D (shown with optional software and adaptor) •BRANDNEW control two 8" 851 DSDD and two 8" 1000 type •SOOK •80TRACK THE SENSIBLE • 135 T.P.I. 1 •THESE DRIVES GIVE YOU THE SUPER RELIABILITY OFA HARD DISK. THEY 5 /4' DISK DRIVE D.T.C. 520-1 control four 5.25" DSDD ARE COMPATIBLE WITH ANY COMPUTER WHICH USES A 1770, 1771, 1791 and two ST-506 type hard disks OR 1793 CONTROLLER CHIP Closeout •THEY WILL FORMAT SINGLE, DOUBLE OR QUAD DENSITY, DEPENDING CABINET KIT 95 ON YOUR SOFTWARE. ~ $69 Only 10 left •XEROX 820 (LITILE AND BIG BOARD), KAPRO, AMPRO AND LOOK HOST ADAPTER FOR ABOVE CONTROLLERS AUKES AND H.P. SINGLE SIDED ARE JUST A FEW OF THE COMPUTERS (for most popular Z-80 computers) THIS DRIVE CAN BE COMPATIBLE WITH G2J FUSED POWER SUPPLY The Winif Adapter and software SA (

CONSTRUCTED OF HEAVY GAUGE ALUMINUM, THIS UTILITY DISK WE CAN HELP! DRIVE CASE WILL ACCOMMODATE: SW' HARD DISKS, FLOPPY DRIVES, HALF HEIGHTS, FULL HEIGHTS, 213 HEIGHTS, CONTROLLER CARD AND SINGLE BOARD COMPUTER. 12VDC OVERALL DIMENSIONS IOV•" x 10" x 7" ONLY s 11 ft95 COLOR IS TAN ~ STEPPER MOTORS 95 Real Power From a Famous Manufacturer delivers: LESS POWER SUPPLY $79 10 amps at SY, 8 amps at 12V, measures only 8.5'' by 4.5" and is only 2.25" thick 9 with pinouts $ 3 9 s (limited supply on hand) BUSINESS TELEPHONES MONITORS

STOP PAYING MONTHLY PHONE CHARGES These phones are not a cheap import. These are the same reliable l.T.T. phones that UNIVERSAL have served us both for many years. Standard I0 button business telephones serviced STEPPER MOTOR by Bay Telephone Co. DRIVER Ball Brothers TV-120 (shown ab~ve) ·._,.,_j:::!L KITS .IIJ~.-~!L I6mhz. Xerox 820 compatible, P-4 phosphor BfW. 12" UNIVERSAL STEPPER MOTOR limited to color selection DRIVER KIT $599S on hand Ball Brothers TX-7 ~ 1 Pflllf'fCf'O•RO•OTICllAl'IQjllllA .. Y 7", OfHt•APl'LICAllOl'lll Xerox 820 compatible, flat PO Q \) \ ..1tiglare for photography \._ ...... _ BRAND NEW 6 BUTION BUSINESS TELEPHONES $299s so~ ALL THE STANDARD FEATURES INCLUDING BUZZERS AND RINGERS. LOOKS THE SAME AS ABOVE PICTURE. COLOR. CHOC. BROWN. Audio Tronics 964-02 FOR DIRECT CONTROL FROM YOUR COMPUTER Xerox 820 compatible, TIUX-Y input, 9" green screen 95 • Control almost any stepper motor, forward/ ONLY $59 REVERSE and step sequence . (LIMITED QUANTITY) • For stepper motors rated 1.7 voe - 12.0VDC ------11 •Uses a power supply with an output of between 3.0 voe and 12.0 voe • Modifications included for motors rated above 12.0VDC GO ON LINE WITH • Inputs/outputs are on a standard 22 pin edge card connector (.156 spacing) 4V2 x 6 1/i card, UNITED PRODUCTS G-IOepox. 1123 Valley Hours: 9-6 Take advantage of the many items that space does not allow us to advertise. Use Seattle, WA 98109 Sat. 9-5 PHONE (206) 682-5025 TECH NA-KIT TECHNA-KIT your computer to down load our weekly specials and hard to find items. Terms: All orders are shipped F.O.B. Seattle, Wash. On line 24 hours a day, 7 days a week. cat# U.S.M.D.-C SAME SPECS. AS U.S.M.D.-C cat.# U.S.M.D. C.O.D.'s are OK with cash or certified check 300 or 1200 baud, even parity, 8 bits with one stop bit. except a stand-alone driver MasterCard and Visa accepted The phone number is: (206) 682·5593 e On board clock (user optional) $1995 On orders over $50.00 in the continental U.S. we pay the freight. New items are added weekly. Don't miss out, call each week. • No edge connector All advertised items are subject to prior sale

MICRO CORNUCOPIA, #30, June-July 1986 63 By Ron Miller 1157 Ellison Dr. Pensacola FL 3250~ Writing Pascal-Style Tools For C

There is nothing so dear to the provides a BIOS function, a bios(2,0) To obtain unechoed input, you don't hearts of C programmers as tools. call will serve nicely instead. Just don't ·really need to move as close to the Herein, Ron takes on a few goodies expect AC and AS to operate in therr bare metal as you must on your like goto(x,y) and a screen clear. But normal ways, since you'll be avoiding Kaypro. Just invoke bdos(8,0): Micro­ first he covers direct keyboard input, the CP/M interrupt handlers entirely. soft tossed in some extra goodies to wives, and mistresses. Fun stuff. In MS-DOS things get a bit more replace CP /M calls not needed on your complicated, in part because that oper­ clone. Unfortunately, service 8 still ating system offers many more ropes won't let you use the function keys on which to hang yourself. When MS­ (F1...F10, Home, PgUp, etc.) in your n the last column I discussed some DOS was first designed, a good deal programs, since these special keys all of the dilemmas facing anyone who of care was taken to give its lowest­ return an ASCII null on a simple I makes the Hacker's Leap from an numbered BDOS calls the same opera­ character call. implementation of C in CP/M to one tions as the comparable functions in Actually, all keystrokes on IBM running in MS/PC-DOS: buying a CP /M. Thus the listing for grabchar() clones return a word, not a byte. In compiler, porting your favorite rou­ will transfer as is, though the generic ordinary text input the high bytes are tines over into the 86 universe, facing function call name may vary with the ignored, but the high byte, called the a whole new gaggle of ways to crash implementation. Whatever you call it, "scan code," is always there for con­ the machine. it's interrupt 21H, service 1. trolling program flow. If the returned This time I'd like to get more down to earth and generate some conveni­ Figure 1 - grabchar Function ences that Kaypro-laureates will need once they start slinging useful code on #include I* or however your implementation handles */ their newer playthings. Even if some grabchar() I* the registers for interrupt calls */ of you aren't switching at all, perhaps { so far you have shied clear of system­ struct rr regs; rr.ax:O; /* service 0 *I level programming on your PC, and interrupt(Ox16,&rr); the following short routines may help if(rr.ax & Oxff) then return rr.ax & Oxff; get you started. The sky's the limit, else switch(rr.ax >> 8){ /*shift scan code to low byte*/ and there's always the on/off switch to case Ox53: return Ox1; /*mapping function keys*/ case OxS~: return Ox2; /*to AA, AB, etc.*/ return your system to sanity.

Direct Character Input !****** and then, somewhere else, the menu: */ switch(grabchar()){ If all you want to use in your case 'a': programs is buffered input from the case 'b': keyboard (you know - no entry of case Ox1: case Ox2: characters until the carriage return is whacked), standard getchar() will serve your needs, whatever the oper­ ating system. But if you're anything like me, writing neat utilities is an Figure 2 - Service 2 addiction; and for that beautiful little utility you dream of . showing off to gotoxy(row,column) your friends, flashing a response at int row,column; the touch of a key is an aesthetic fix. struct regs rr; For unbuffered input in CP/M, you need to put a simple bdos(l,O) call rr.ax=Ox200; /*2 into AH */ function into your working library: rr.bx:O; rr.dx=Ox100*row+column; /*row into DH, column into DL */ interrupt(Ox10,&rr); grabchar() { return bdos(1,0);} I* the upper corner is (O,O). If you are a Pascal habitue and would like to think of it as (1,1), then use "--row" and "--column" in the algorithm above. *I If you want to avoid echoing on the } screen and if your implementation

64 MICRO CORNU<;OPIA, #30, June-July 1986 character is a null, then the program ered up into a single function - e.g., Only the definition of grabchar() need knows that a special function key has grabchar() - to make the next Hack­ be altered in moving back and forth been hit, and the task is to examine er's Leap a tad easier. between wife and mistress. (Try ex­ the high byte to see which function A direct call to interrupt 16 hex will plaining that to your better halves key it is. also do the job, though any time you whichever they may be.) There are two ways to examine the sally forth beyond interrupt 21 you high byte. MS-DOS function calls 1, 7, increase the risk that the program Screen Control and 8 have been designed so that if won't run on somebody else's ma­ Everybody who writes menus and the character received is a null, the chine. But since prudence is scarcely a needs unbuffered input also needs to very next call to that function will trait of C programmers, let's charge control the screen display. Writing for return the high byte instead. Thus a straight ahead. the Kaypro makes scre~n control a menu might be constructed to use the Because the interrupt 16H return is a breeze. Want to clear the screen? special function keys: word in the AX register, we'll get the Embed a "\032" ("Z) in a string, and character and scan code in single call. poof! things are scrubbed up and switch(bdos(1,0)){ case 'a': ••• This time I'll use the function keys ready to go. A couple of escape codes case 1 b': ••• and with a bit of mapping retain take me to the row and column of my case O: switch(bdos(1,0){ grabchar()'s single-byte output (see choice. Though the ANSI.SYS driver case Ox53: does allow similar games with the IBM case Ox54: ••• Figure 1). Such mapping becomes feasible, of screen, it's slow and, besides, that's and so forth. If you want to avoid course, only if (in this case) "A and "B one more darned thing to fill up the echoing - and echoed scan codes (Ox1 and Ox2) are not used separately. memory with. Using Turbo Pascal has from function keys are rather silly, The benefit gained is system-inde­ gotten me used to calling '' clrscr'' and anyhow - use MS-DOS function 8 pendent code. I use this trick so the "gotoxy" functions, so ~et's write our instead. Good programming practice, cursor key code will be the same on own in C and store them in our of course, suggests that all those fancy my MS-DOS programs and on the CP/ working library. system-~ependent functions be gath- M programs for my beloved Kaypro. To the rescue comes interrupt 10 hex, the video interrupt. Service 2 (Figure 2) sets the cursor at the desired Figure 3 - Service 3 position. curpos() The inverse of this function uses { service 3 shown in Figure 3. struct regs rr; Clearing things is almost as easy. rr.ax=Ox300; Service 10 lets you write a string of rr.bx=O; /*the default screen page •; characters to the screen, beginning at interrupt(Ox10,&rr); · the cursor position. Therefore writing return rr.dx; t• row in high byte, column in low. Add Ox101 to the return if you are blank spaces (ASCII Ox20) clears a playing (1,1) games. •/ portion of the screen. That means one could clear the screen entirely by going to (0,0) and writing 2000 (25*80) blanks, or clear to the end of the screen from the current position, or Figure 4 - Clear Screen Function clear to the end of the line, depending

1 1 1 1 1 on what number is loaded into the clr(c) t• s :screen, l'=line 1 e =end •/ char c; ex or "repeat" register (Figure 4). Service 10 doesn't change the screen struct regs rr; attributes. Service 9 does. If you want int cp,x,y; 1• storing cursor position 1 / to restore the screen after a fling at 1 cp:curpos(); /*get cursor position / reverse video or the like I set' Ir.in(·= Oxf x = cp & Oxff; (or Ox7, if you prefer a dimmer screen) y = cp » 6; switch(toupper(c)){ and set rr.ax=Ox900 + ' '. Rich folks case •s•: gotoxy(O,O); with color monitors have inore compli­ rr.cx=2000; ;• 2000 characters on screen 1 / cated choices to make. Obviously, clr() break; could be written to take another argu­ case 1 E 1 : rr.cx=2000-60•y-x; /* 60 chars to the line*/ break; ment or two for fine tuning. With this case 1 L 1 : rr.cx:60-x; and the input routines in place, you'll break; be able to give Peter Norton a run for default : return; ) his money. You just won't get rich rr.ax=OxaOO+' •; / 1 blank with ASCII 32 string•/ and famous doing it at so late a date. rr.bx=O; /*page again 1 / interrupt(Ox10,&rr); } (continued next page)

MICRO CORNUCOPIA, #30, June-July 1986 65 C'ING CLEARLY

(continued from page 65) the RAM disk file allocation table we C programmers have just forgotten information. to put in the loop test or have written Addendum: A Nice Find Well, I still don't have the full "great.er than" when we really meant Last time I also grumbled awhile equivalent of the panic button on the "less than." Then the clock interrupt about. the problem of getting out of a back of my Kaypro, but things have escape route surely helps. Try it; lock-up without zapping: the memory· gotten better since I started loading a you'll like it. The magazine~ s listing of a compatible. If the dead end little (i.e. 128 byte) resident program requires BASIC, so if you're really routine happens to call one of the MS­ "uncrash.com" offered in a recent fastidious, give me a call and I'll let DOS function calls, a "C will often issue of PC Magazine. This little gem you have a copy of my sanitized COM break you back to the operating sys­ uses the clock interrupt to snatch file. At 128 bytes, it transfers some­ tem with all data intact. If it's a closed control away from the lock up, testing what fast via XMODEM. arithmetic loop or something more for a control-Break (not a "C) and exotic, however, the computer just sits popping you back to the ·operating there~ and sits there, and sits. there - system if one is detected. Unless the while you bang furiously o:n every~ · program itself captures the printer thing in sight, sounding all the world interrupt in weird ways (as do some like some crazed woodpecker. forms of BASIC), you get a chance to ••• Of course, there's always ALT-CTL- . bail out 18 times a second. Many DEL, but on IBMs and I don't know hours and not a few boxes of Kleenex how many clones, an ALT-CTL-DEL saved. nulls the memory, making recovery of If the entire keyboard interrupt code data from working buffers and RAM has been zapped; of course, no bang­ disks a task leading to tears and/or ing on the break key (or on ALT-CTL­ strong drink. My Zenith, may the Break, for that matter) will catch any­ Lord be praised, just leaves the higher body's attention. Then I still dream of memory alone, unless the RAM disk is jolly red buttons on the back. allowed to re-form itself and eat up Ninety percent of the time, however, C SOURCE CODE

XL T MACRO PROCESSOR w/source .... ·..... 95.00 XLT can be used as a preprocessor, text translator, or simple cross-assembler, depending on your macro definitions. Comes 'with manual, C source and macro files .. Q/C 4.0 CP/M C COMPILER w/source . ONLY 95.00 Save $70.00. Fast, full featured compiler from the Code Works includes longs, single-precision floats, excellent manual.

C-BUNDLE $99 QC88 C COMPILER FOR PC's w/source ONLY 125~00 . VIEW: CRT Based Disk Diagnostic Save $70.00. As above but no floats or longs. Runs on PC clones. EZZAP: ROM Burning Utility includes schematic QCX C CROSS-COMPILER w/source .....•..· .. 495.00 . C-PACK: Utilities in C Runs on PC, generates code fit to run on 280 CP/M or ROM base controller C-Games: User Modifiable Maze Game system.· All are written in C, include Source Code, • Tony Ozrelic's L.A. Software is now KYSO Technology • and available separately. TO ORDER: Add $5.00 to total for shipping and handling. Personal . ICX TOOLKIT check or M.O. are OK. Sorry, no COD's, PO's, or plastic money. 30-day money-back guarantee. Most order shipped 1st· class within 5 working· ICX: ISIS to CP/M or MS-DOS exchanger. days.. · · for MOS and iPDS each $89 ISE: ISIS Emulator for CP/M $89 KNOCK YOUR SOCKS OFF

CP'MTMC\qitalR-"'h

,'. l ~ Weslern ~~'~-~-:-'~-:----- T E C H N 0 L 0 G, Y 303-327-4898 I Box C • Norwood, CO 81423 • P.O. l3ox 5246 • Bend, Oregon 97708 • (503) 389-3452 • 66 MICRO CORNUCOPIA, #30, June-July 1986 MICRO CORNUCOPIA'S C CONTEST If you've been going so hard you just can't·C straight, then drop everything, dig out the old compiler, brush off the cobwebs, and C what you can C. ·Any kind of C. From Small-C to large, from a hundred lines up, this is your chance to C'cure fame and glory (plus valuable prizes).

SCORING - The programs will be judged by the Micro C staff on the following: 0-15 for ALGORITHM 0-25 for CODE ORGANIZATION & READABILITY GRAND PRIZE: 0-40 for PROGRAM FUNCTION • DSI-32, I meg, 10 Mhz 32032 computer board with . 0-20 for USER DOCUMENTATION assembler/linker from Definicon Systems 21042 Vintage St., Chatsworth, CA 91311 1st & 2nd Place • Optimizing C Compiler (large model) • Optimizing C Compiler (large model) from Manx Software, Box 55, Shrewsbury, NJ 07701 • Essential Software's C Library (graphics, 1/0, everything) • 2 year·subscription to Micro C • Essential Software's C Library (graphics, 1/0, everything) 3rd - 5th Place from Essential Software, Inc. • Aztez C Prime Package Box 1003, Maplewood, NJ 07040 (interpreter & compiler) from Manx Software • 3 year subscription to Micro C • 1 year subscription· to Micro C · ----~----CONTEST DEADLINE November. 1, 1986------ENTRYFOR·M

Program Title------

Purpose------Which C compiler? ______Target system(s)------

NOTE: Pleas'<: include source and object files on disk. ' ' I hereby release this prqgram to the public domain and give Micro Cornucopia the right to print the listing. Signature ------

Name ______MICRO CORNUCOPIA Address ______P.O. Box 223 Bend, Oregon 97709 City ______State _____ Zip-----

MICRO CORNUCOPIA, #30, June-July 1986 67 The Racer's Edge By Trevor Marshall Caching And Floating (with Sigi Kluger and Chris Jones) Definicon Systems, Inc. 21042 Vintage St. On The 68020 Chatsworth CA 91311 (818) 341-5654

The DSI-32 introduced a lot of us (RISC) architectures vs. faster, larger in the cache. If it's not there, it reads to the world of power computing. I versions of the 32032 and 68000; real it into cache, four bytes at a time, from admit it, even though I'm harassed by silicon vs. expectations; fast math co­ main memory. my family, prodded by my readers, processors and memory management Once the code is in the cache it's and ignored by my coworkers - when chips (MMUs) vs. little or no support flushed only when the cache gets full, I strap into my black leather anti-g - we chose the 68020 family. and then only after all the other less suit and sit down at my 32032 I have The 68020 is significantly faster than frequently used locations have been power! Pthththththth! . the 32332 (National's latest version of replaced. When it was introduced just a year . the 32032). The 68020's math chip, Consequently, at any one time, code ago, the 32032 and ,its· companion which we will discuss shortly, is more from all over the memory can be in floating poirit:;proc~ssor ivere the fast­ powerful than the 32032' s. .On the cache, depending on what your pro­ est things ydu could. hide in a micro. other hand, the 68020's MMU chip gram is using. A frequently used sub­ Now, however, there is something _(really important for multi-user, multi­ routine, for instance, may take up faster (surprise). It comes from Moto­ tasking environments) is not yet ready permanent residence in the cache. rola and it ·resides ·on two newer, for prime time. So there are some faster, but no more expensive, DSI trade offs. More Cache boards. The cache is one of two key reasons Speed the 68020 family is so speedy. The 68020 is tremendously fast. To When an instruction is found in understand why, look at the program cache the 68020 takes only ONE her.e is something about design­ in Figure 1. CLOCK CYCLE (80ns at 12.SMHz or ing which says you can't do just The 68020 has an instruction cache 60ns at 16.7MHz) to read it to the Tone. So, ,ever since we released - 64 tags, each holding four bytes of (pipelined) execution unit. This con­ our 32032 based DSl-32 we've been code. These are the most frequently trasts with the four clock cycles (in­ looking arouhd for our next product. used pieces of your program. cluding one wait state) for main mem­ With the transputer, the 32332, and The cache can't store data because ory accesses. a number of other interesting chips external devices (such as DMA) would We added a jumper to the DSI-020 either coming down the pipe or al­ have difficulty deciding whether the so you can turn this cache off. ready trickling out the end, there were data you just modified was still in Photo 1, taken with the cache disa­ certainly some interesting choices. cache or in main memory. bled, shows the bus activity during the However, when we looked at the When the CPU asks for an instruc­ loop from MOVIT to the branch, options - reduced instruction set tion, the cache control logic looks for it which occurs three instructions later.

Photo 1 - Cache Off Photo 2 - Cache On

68 MICRO CORNUCOPIA, #30, June-July 1986 When the (address strobe) signal is VAX,. Floating Along low then the CPU is reading from The second difference between the main memory (240ns each time). speed of the 32032 family and the When it's high the instruction is being 68020 is the 68881 floating point pro­ processed (80ns plus). power cessor. A number of DSI-32 users The reference point (after the complained that the 32032 was only 2 BRANCH instruction) is followed by or 3 times faster than their AT, not 10 1nyour the read of the indirect register to as the benchmarks suggested. The register move opcode. reason is simple. The 32081 floating This is followed by the fetch from point unit, although many times faster "AO" and the store to "Al". The than the 8087/80287, only performs the PC SUBQ executes internally very quickly primitive +-I * operations. (and so only one clock elapses be­ Functions such as COS, SIN EXP, or tween the final two accesses). LOG have to be performed by a The scope is set to SOOns per divi­ software subroutine. The 8087/80287 sion so the total loop time is approx has these partially coded in hardware, 2.3us. Photo 2 shows the bus activity and thus they execute them more when the cache is working. Note that quickly. the entire program easily fits within The 68881 floating point unit not the cache, so only data is fetched from only performs the basic arithmetic at main memory. high speed but also all the commonly The first thing to notice is that the used mathematical functions. In addi­ total loop execution time is now only tion, they're calculated internally to 1.2us. The second thing is that the two 80-bit accuracy. data fetches are closer together. This is because the CPU is pipelined internal­ Numbers ly. Since it doesn't have to go out to The 68020 family does over a million the bus to get the opcode, instruction single-precision whetstones. At 10671<, execution is faster. the 16.7MHz DSI-780 is almost as fast The 68020 is the first microprocessor as the VAX 11/780 (1152K). IBM's with a cache. The cache gives it blind­ super-fast PC-RT plods along at 200K. ing speed for things like integer opera­ (What a delight it is to have that tions (2 to 3 times a VAX 11/780) - machine as a competitor!) much faster than the 32032 or the Since all calculations are performed 32332. The Sieve of Eratosthenes takes to 80-bit accuracy, the 68020 easily less than 0.9 seconds on the 16.7MHz outpaces the VAX 11/780 on the dou­ 68020. (Editor's note: Makes it kind of ble precision whetstones (at 902K per for less than hard to time the standard benchmarks, second). doesn't it?) (continued next page) $1500 FREE Figure 1 - Byte Transfer Program BOOKLET

TEST PROGRAM • 10MHz 32032 THIS PROGRAM CONTINUOUSLY MOVES 458,752 BYTES FROM CPU no"'.wait­ ONE LOCATION IN MEMORY TO ANOTHER. states ORG $00004000 • Floating .,,. .. ; point pro ce sso r ,,.,,.,..,,,.. ,..,,,,,., .... START: HOVE.I. #$8000,AO SOURCE ADDRESS MOVE.L 1$80000,A1 DESTINATION ADDRESS • 1 MB to 8MB RAM """ MOVE.L 1114688,DO COUNT • Virtual memory with ...... o.m .. •o• LOOP: MOVEM.L DO/AO/A1 1 -{A7) PUSH REGISTERS M S-D 0 S and UN IX™ ~~i~:t:.~i~;:~:.:~i~ HOVIT: MOVE.L {AO)+,{A1)+ HOVE 4 BYTES AT A TIME SUBQ.L 11,DO DECREMENT COUNTER BNE.B MOVIT LOOP UNTIL DONE i•1#fii#l:il+J•U' SYSTEMS! MOVEM.L {A7)+ 1 DO/AO/A1 POP REGISTERS BRA.B LOOP AD NAUSEAUM END 31324 Vfa Colinas, Suite 108 Westlake Village, CA 91362.USA (818) 889-1646 Telex: 272849 OSI UR (818) 889-1646

MICRO CORNUCOPIA, #30, June-July 1986 69 THE RACER'S EDGE

(continued from page 69) the 8- or 16-bit bus (with 16 bits you real RAM into a micro. Would gain 10 percent on disk 1/0). they????) (The whetstone is a floating-point The DSI-020 has 1 Meg of memory benchmark written in the late 60s by a (although Micro C will no doubt tell Compilers fellow named Curnow. Whetstone you hackers how to expand it to 2) The compilers are from Silicon Val­ programs are available in the public and a 12.5MHz chipset (only gives ley Software this time. Although a domain for CP/M and MS-DOS sys­ 770K whetstones, sorry). You can pur­ little slower than Green Hills, they are tems. The program "dhrystone" is an chase it, assembled and tested, for the more complete and have much better integer variation.) price of the DSI-032 starter kit. manuals. (The Pascal even comes with Parity and serial ports are a little strings!) The FORTRAN is ANSI-F77, Details extra. The DSI-780 is the up-market not derived from UNIX. The DSI-020 and DSI-780 both use product, with a 16.67MHz chipset and Lattice Logic '

Figure 2 - Copy Program

COPYF IDNT 1,0 ; VERSION 1.0 , ERRORD: HOVE.L #HERRD,AO THIS SAMPLE PROGRAM COPIES ONE FILE. IT SHOULD BE BRA.B ERROR CALLED WITH 'IWO ARGUMENTS, THE SOURCE AND DESTINATION i PATHNAMES. FILts HAY BE OF ANY SIZE AND TYPE. ERRORR: HOVE.L #HERRR, AO WRITTEN BY S. KLUGER, DEFINICON SYSTEMS INC. BRA.B ERROR ; ORG $00004000 ; STANDARD DSI-020 ORIGIN ERRORI: HOVE.L #HERRI,AO ; BRA.B ERROR START: HOVE.L 8(A7) ,DO ; GET ARGC PASSED ON STACK ; HOVE;,L 4(A7),AO ; GET •ARGY PASSED ON STACK ERRORO: MOVE.L #MERRO,AO CHPI.W #3,DO ; HUST BE 2 ARGUMENTS ERROR: HOVEQ #1,DO ; USE 11 BDOS 11 CALL FOR ERROR MESSAGES BNE.W ERRORA HOVEQ #9,Dl HOV EA AO,A5 ; SAVE 'ARGY TRAP #14 HOVE.L #COPY1 ,AO ; SAY, "COPYING II CLR•W DO BSR.W PRINTS RTS HOVE.L 4(A5),AO ; GET FILENAME PTR INTO AO BSR.W PRINTS ; PRINT SOURCE FILENAME THIS ROUTINE COPIES THE NULL-TERMINATED STRING AT (AO) HOVEQ #5,DO ; OPEN REQUEST TO 11 STDOUT 11 (DISPLAYS IT ON THE SCREEN) HOVEQ #O,D1 ; READ MODE ; TRAP #14 PRINTS: HOVE.L AO,-(A7) SAVE STRING POINTER CHPI.W #$FFFF,DO ; IF FILE NOT FOUND .. PSL: TST.B (AO) SEE IF AT END BEQ.W ERROR I ; THEN ABORT WITH ERROR BEQ.B _x DONE IF END OF STRING HOVE.W DO,INHDL ; STORE INPUT HANDLE HOVEQ #1,D1 STDOUT = HANDLE 1 HOVE.L #COPY2,AO ; SAY, II TO • HOVEQ #1,D2 ONE BYTE ONLY BSR.W PRINTS HOVEQ #9,DO WRITE REQUEST MOVE.L 8(A5),AO ; GET DESTINATION FILENAME TRAP #14 BSR.W PRINTS ; DISPLAY IT ADDQ.L #1,AO POINT TO NEXT BYTE HOVEQ #7,DO ; CREATE OUTFILE BRA.B PSL AND·LOOP TRAP #111 ; CHPI.W #$FFFF,DO _x: HOVE.L (A7)+,AO ; POP STRING POINTER BEQ.W ER RO RO ; ERROR IF CANNOT CREATE RTS ; RETURN TO CALLER HOVE.W DO,OTHDL ; STORE OUTPUT HANDLE LOOP: HOVE.L #BUFFER,AO ; POINT TO RAM BUFFER ,HERRA: DC.W $0DOA HOVE.W INHDL,D1 ; GET INPUT FILE HANDLE DC.W •USAGE: LOAD COPYF·INF.ILE OUTFILE 1 HOVEQ #8,DO ; READ REQUEST DC.W I (FULL PATH. OK)•,$ODOA,•$ 1 HOVE.L #$80000,D2 ; READ UP TO 512K , TRAP #14 MERRD: DC.W $0DOA TST.L DO IF WE READ ZERO BYTES DC.W •ERROR DELETING FILE 1 ,$0DOA, 1 $1 BEQ.W DONE THEN WE HUST BE.FINISHED MERRR: DC.W $0DOA HOVE.L DO,D2 ELSE HOVE ACTUAL BYTE COUNT DC.W •ERROR RENAMING FILE 1 ,$0DOA, 1 $1 HOVE.W OTHDL,D1 ; GET OUTPUT HANDLE . MERRI: DC.W $ODOA HOVEQ #9,DO ; DO A WRITE DC.W •ERROR OPENING INPUT FILE•,$ODOA, 1$1 TRAP #14 HERRO: DC.W $0DOA BRArB LOOP ; NOW GO GET HORE DC,W •ERROR CREATING OUTPUT FILE 1 ,$0DOA, 1$1 ; ; DONE: HOVE.W OTHDL,D1 ; GET OUTPUT FILE HANDLE COPY1: DC.W $0DOA HOVEQ #6,DO ; CLOSE IT DC.W 'COPYING •.• o TRAP #111 COPY2: DC.W 1 To •,o CLR.W DO , RTS ; NOW, BACK TO OPERATING SYSTEM INllDL: DC.W 0 INPUT FILE HANDLE , OTHDL: DC.W 0 OUTPUT FILE HANDLE ERRORA: HOVE.L #HERRA, AO ; BRA.B ERROR BUFFER: DC.B 0 START OF BUFFER END

70 MICRO CORNUCOPIA, #30, June-July 1986 tioi:t..s have been expanded and im­ r---~------proved, building on our DSI-32 exper­ Layout of l 01 PARITY Sl74F0e

Summarizing l14F16tAS 'GI. The DSI-020 represents second gen­ WIRE WRAP AREA eration 32-bit technology. The 68020 .1 ~ s . ~ 00 family represents technology that is '-DUAL PORT PAL ~00 74HCT541 unequalled in silicon today. I ~ D 12.5 MHz The 32332, although significantly 0 $16.7 MHz faster than the 32032, is not as fast as I AT20

MICRO CORNUCOPIA, #30, June-July 1986 71 Split Personalities By Dean Klein The V Series (20-70) & The 80386 904N 6th St. Lake City MN 55041

NEC has shown that it can take the The execution unit obtains an in­ Two new bit field instructions, INS latest features of the B0186, add BOBBI struction and decodes it to determine and EXT, allow bit 9perations on BOB6 pin compatibility, an BOBO in­ the appropriate set of microcodes to strings of bits made up of bit fields. struction set, some new instructions, use. Think of this decoding as a Bit fields are variable length data and put it all together in a low-power breaking down of instructions into structures from 1 to 16 bits long. CMOS package. Super! classes of instructions. They're pointed to by ES:DI:reg8, However, what about NEC's new The microcode then further differen­ where reg8 is any byte register or an V40, V50, . V60, and V70? What are tiates the instructions by looking at the immediate value. they? Are they winners, or is NEC various fields within the instructions The INS (insert) instruction moves having trouble making product deci­ which specify the instruction operands data from AX to the destination string. sions when it's leading instead of (e.g. memory location or register The EXT instruction extracts data from following? type). the source bit string and puts it in AX. Microcode then controls the transfer · The 8086 family is somewhat lacking (and path) of operands from source to in the BCD arithmetic department, so chizocentralprocessingunitis. destination. For example - NEC added new instructions for oper­ What is it? It's the latest - a ating on BCD strings of 1 to 254 digits Sfamily of processors with split ADD AX,BX or as BCD bytes. personalities, i.e. dual instruction sets. The new ADD4S, SUB4S and NEC' s family name begins with moves the contents of register AX and CMP4S instructions add, subtract, and "V"; the V20 and V30 were the first BX to the ALU where they're added. compare BCD strings. The pointer to members. Two are just out - the V40 The results are put (returned) in the the source string is DS:SI; the pointer and VSO (with integrated peripherals AX register. · to the destination string is ES:DI. much like Intel's 80188 and 80186); Intel and NEC saw the faults of the rwo BCD rotate mstructions are use­ and two more are announced - the 8088/86 microcode and improved the ful for unpacking and packing BCD 32-bit V60 and V70. microcoding in their later chips. The V digits. ROL4 and ROR4 rotate the Intel's latest baby is also 32-bit, the series and the 80186/188/286 have simi­ operand one digit. 80386, and it, too, falls in with this lar, speedier microcode. split personality group, designed for The Alternate Instruction Set compatibility with previous Intel chips. Effective Address Cale In emulation mode the V series As I mentioned in an earlier Micro C processors can execute two complete V20, V30, V40 & VSO (Issue 27), the effective address calcu­ instruction sets - its own and the The V20 and V30 are pin compatible lation has been sped up by dedicated 8080's. with the Intel 8088 and 8086. And the hardware adders. This lets address Emulation mode is initiated by set­ V20 and V30 can, in most cases, calculation proceed while an· instruc­ ting the mode flag in the program replace their counterparts. tion is executed, saving several clock status word (also known as the flag The V40 and VSO cannot. Although cycles. register, or PSW). The special instruc­ they have integrated peripherals (like tion, BRKEM, sets the flag. the 80188 and 80186), they ARE NOT New Instructions In 8080 emulation mode the proces­ pin compatible. The V series and the 80188/80186 sor registers are used differently - All of the NEC V series processors share new instructions, except for a 8080 register VxO register have -been built (using the CMOS few V series goodies like bit manipula­ ===~~======A AL process) to consume less power and to tion instructions and BCD string func­ B CH operate cooler. One undesirable effect tions. c CL of this is a slightly diminished bus The new bit manipulation instruc­ D DH E DL drive capability which can cause prob­ tions allow setting, clearing, and com­ H BH lems in some PC clone boards. plementing individual bits in registers L BL SP* BP* or memory. These instructions are pc•• IP•• Improved Microcode similar to the Z80 instructions for bit • Stack pointer Most CPUs use microcode (a low operations. The new mnemonics are: ''Instruction pointer· level translator) to implement machine The use of BP as a stack pointer code instructions. SET1, CLR1 and NOT1 allows the 8080 program to keep a

72 MICRO CORNUCOPIA, #30, June-July 1986 separate stack (other CPU registers are tion set as well as 8080 emulation In Real Address mode the 80386 inaccessible to the program). mode. looks like an 8086 to the program, When interrupts occur the processor However, the V40 cannot replace except for several new instructions and saves the machine state on the main any existing processor. Its saving grace two new segment registers. The total stack and executes the interrupt han­ is that its chip peripherals are similar address space in this mode is lM bytes dler in native (8086) mode. to those in an IBM PC. The interrupt (same as in the 8086). The 8080 code can also call native controller is identical to the PC's as The new 80386 instructions are dedi­ mode interrupt handlers by using a well as the timer counter. The DMA cated to bit manipulation. The BT special instruction, CALLN. 8080 controller and serial port aren't com­ instruction tests a bit; BTS tests and mode can be abandoned with the patible. sets a bit; BTR tests and resets a bit; RETEM instruction. The addresses of the V40 on-chip and BTC tests and complements a bit. peripherals can be programmed to In addition, even enormous bit Integrated Peripherals match the PC's. The base address of strings of up to 4G bits long may be The NEC designers built a winning the peripherals is set to a 256-byte defined and manipulated. IBTS inserts peripheral set into the V40 and V50, block by writing to an internal CPU a bit string; XBTS extracts a bit string; similar to the Intel 80188 and 80186, register. The offset of each peripheral BSF scans a bit string; and BSR scans but superior for most applications. is then set by writing to a register for it in reverse. These peripherals include an 8253/4 each device. The bit instructions are useful for compatible timer counter, an 8259A The DMA controller can be used to bit-mapped graphics operations. compatible interrupt controller, a serial provide enhanced functions such as When the 80386 is reset the proces­ port similar to the 8251, and a good SCSI and networking, functions which sor automatically performs extensive DMA controller. RAM refresh is also aren't found in the standard IBM PC. on-chip diagnostics which test as built into the V40 and V50. I must admit I was really excited much as 85 percent of the chip. The The serial port is limited in some after reading the V30 data sheet (just results are returned as the contents of applications because it lacks the syn­ ask my wife). I thought, "If the V30 is the processor registers and can be chronous modes of the 8251. Another this close to being 'just right,' the V40 tested by the boot program. more serious limitation is a shortage of must be perfect.'' Then NEC let me pins, which forces some sharing be­ down - the peripherals aren't really 80386 Real Address Mode tween peripherals. For example, the integrated; they're external to the After reset the 80386 is in Real serial port Receive Data pin is shared chip. Address mode. All registers are 16 bits with the DMA Request Input, DRQ3. The big difference is that the V30 long, as in the 8086. The bus width Similarly, TxD and DACK3 share. (and the IBM PC) uses address line AO can be 16 or 32 bits wide and selected Interestingly, the parts are also of­ to access peripheral registers. The V40 on a cycle by cycle basis. fered in packages with more pins, but starts with Al. The Bus Interface portion of the the designers still didn't separate these Recall that the V40 bus is 16-bit and 80386 checks an input, BS16, late in signals. the V30's is 8. This slight difference the bus cycle to determine if the The V40 and V50 DMA controller means no integrated peripherals can operation run on the upper half of the has four channels, and each channel be used to replace those in a PC data bus needs to be run again. This has its own DRQ and DACK pins, compatible design. signal can be permanently strapped to making it superior to the 80188/186's. Despite it all; the V40 is still superior either bus size as well. The DMA controller is compatible to the 80186. But would I use it? with NEC' s existing stand-alone Probably not, unless 8080 mode be­ 80386 Protected Address Mode DMAC, the 71071. This controller pro­ comes an absolute requirement. The 80386 and 80286 Protected vides a full 20-bit address (unlike the While the V40 is built only by NEC, modes are compatible, with up to four 8237 used in the PC). the 80186 has several manufacturers, privilege levels of protection for differ­ The availability of separate DRQ and which helps drive the price down. ent tasks (such as operating systems DACK lines allows the DMA controller And there's a lawsuit pending against and application programs). to transfer data directly between the NEC. Intel's charging that NEC has Two restrictions which plagued ear­ requesting peripheral and memory, copied their microcode in the V series. lier Intel 16-bit CPUs may be removed rather than first reading the data from in protected mode: program size and the source and then writing it to the The 80386 segment size. destination (80188/186 style). This al­ Intel's late entry into the 32-bit CPU Since protected mode is a virtual lows for data transfers up to twice as arena is the 80386, which maintains memory mode, the program size can fast as the 80188/186 DMA. compatibility with the 8086 while be as much as 64 Terabytes (virtually adding many features, new instruc­ infinite). The physical address space is Applications For The V tions, new registers, and an improved 4G bytes, and the segment size may The V20 and V30 can directly replace memory management scheme. be set up to 4G bytes as well. the 8088 and 8086 in most cases, The 80386 operates in either of three adding a substantial boost in speed. A modes ---' Real Address, Protected Vir­ side benefit is the enhanced· instruc- tual Address, and Virtual 86. (contlnued next page)

MICRO CORNUCOPIA, #30, June-July 1986 73 SPLIT PERSONALITIES - THE V SERIES

(continued from page 73) as in Real Address mode except that ting this bit the OS can determil)~ the Memory Management Unit man­ whether or not the page has . bee!l The split personality of the 80386 is · ages program addresses. . used recently. If not, the page i~ a subtle and can only be found in The program still sees a logical ad­ good candidate for freeing, since p~ges . protected mode. dress space of lM. The .actual physical that haven't been used recently ,.are The architects of the 80386 wanted address isn't important. The operating less likely .. to be used in the near .their CPU to be upwards compatible system can have several VM86 tasks in future. The page alsohas a Dirty Flag ·with the 80286 and true 32-bit. So they memory simultaneously and switch which tells the OS the page has been created a 'D' bit flag in a processor between them and 32-bit applications written to and must be saved. 1 register to tell the processor its oper­ at will. To speed the paging operations the and size default...... Several types of, .instrU:ctions are page table entries. for t11e. most. rece11tly If D ... 0, the ·registers and operands trapped when executing in: VM86 accessed pages are cached by the default to 16 bits (like the 80286). To mode. All input and output instruc- processor in a special Translation Loo:­ override this default width .use an .. tions and any instructions . which at"'.' kaside Buffer. Additional page table instmction prefix. tempt to affect the 'interrtipt mask flag entries are store.cl in memory. If a task ·For 32-bit mode, set the .D bit. This can be ·trapped. Software interrupts attempts_ .to access a .page which isn't happens when the CPU switches and instructions relating to protected present, an exception occurs which tasks, and a new Code Segment De-· mode operation, too, can be· trapped. allows,,the operati~g system to get the scriptor is loaded. Trapped instructions· are summarized missing page. In. 32-bit mode there are 8 new below: ' ' . registers - EAX, EBX, ECX, EDX, ESI, 80386 Applications EDI, EBP, and ESP. INS, IN, OUTS, OUi ;optionally 11).e ·~0386 "Yill likely find a home. in ;~rapped if' In the 80386 assembly language a ;IOPL<3 many» PC/AT type designs. In the WORD is still 16 bits and a DWORD is· simplest of these, the• bus size can be 32 bits, making the transition from STI, CLI~ PUSHF, POPF, IRET, INT n strapped as, 16 bits, making the 80386 8086 assembly language almost pain­ a. drop in replacement for the 80286 less. IOPL is the task's IO Privilege Level (not pin compatible, however). In protected mode the 80386 can and is set. by the operating system With a good design, . these PC/AT calculate the effective address either when the VM86 task is entered. types should . be : up . to three times from 16-bit components or from 32-bit faster ,than 'the IBM PC/AT, since .the components. The default again is sup­ 80386 Memory Paging initial:· p~oce~~or speed~ offered from plied by the D bit. Demand paged. virtual memory is Intel is 12.SMHz to 16MHz. An example of effective address cal­ implemented in· the 80386 CPU as an The .true power of the 80386 won't culation would be an instruction which optional extension of the 80286 memo­ ~e released until a good operating calculates the offset of an array ele~· · ry 'mahagement scheme. syste~ is written. to support it. That ment using a CPU register as a point­ The page size is fixed at 4K bytes. operating system might even run PC­ er. The default effective address size Paging is designed to be managed by DOS as a VM86 task. . can be overridden either way by the the operating system. ·Each· page has Less dependence on hardware com­ Effective Address Size Prefix to an ,, several flags associ~ted with it that tell patibility with older machines might ·instruction. the operating system whether it is a allow, a high .. performance worksta~ion . This system of having default oper­ candidate for swapping out or rewrite. to be, built which could take advantage and and EA sizes is very flexible and A page has an Accessed flag that of 1:1:1any alr~ady available high~r per­ .allows each CPU task, to default to the tells the· processor the page has been formance peripherals. These include appropriate condition. The availability read or written. By periodically reset- DMA, video. and disk . controlle!s, of an easy override 'further enhances the system.

·Virtual Mode 86 THE COMPUTER.JOURNAL The major obstacle to the acceptance ·of the 80286 protected mode has been Practic~ Programming & Hardware Projects that once protected mode is entered, the usage of the segment registers The Computer Journal is published bimonthly for those interested changes sufficiently that the CPU can in programming their computers, interfacing to pe~ipherals, no longer run ·most programs written and hardware construction. to run in Real mode. Thus the IBM Now expanded with in-depth articles covering Turbo Pascal, :PC/AT isn't allowed to operate at peak "C", Assembly Language, Kaypro, Ampro, Interfacing, plus efficiency for multi-tasking. The 80386's Virtual Mode 86 (VM86) ad­ CP/M and other operating systems. dresses this problem. 6 IHues (1 year) Sl4 in US - VISA & MasterCard accepted · In VM86 the processor· behaves just 190 Sullivan Crd., Columbia Falls, MT 59912 (406) 257-9119

74 MICRO CORNUCOPIA, #30, June-July 1986 XT CIDNE COMPLErE SYSTEMS M:>THERBOARD WITH 640K INSTALLED 150 WATT POWER SUPPLY FLIP 'IDP CASE AT STYLE KEYBOARD CCI.DR GRAPHICS VIDID communication devices, and parallel SERIAL PORT PARALLEL PORT RFAL TIME CIDCK processors, all better than currently FI.DPPY DISK CONTROLLER used devices. 'B\O FIDPPY DISKS $750.00 Fast multi-tasking with a high reso­ lution video system and windowing ABOVE WITH ONE FIDPPY AND 20 MEG HARD DRIVE sound good to me. I'd like to be able $1175.00 to fly Flight Simulator in one window TESTED AND ASSEMBLED WITH ONE YFAR GUARANTEE while I'm working in several others. (Editor's note: Make sure one of those KEYBOARD (MICROSWI'IOI) 113 KEYS 8 BIT ASCII other windows has a good autopilot or you might crash the system.) PARALLEL OUTPUT WITH CASE AND COMPLETE DOCUMENTATION $40.00 TheV60&V70 Yes, there's more. NEC has an­ SA800-2 DISK DRIVE CLEAN - USED $59.00 nounced two new 32-bit processors to SASSO DISK DRIVE CLEAN - USED $99.00 compete with the 80286 and 80386. STANDARD MOUNTIID - GUARANTEED 60 DAYS The native mode instruction set isn't compatible with the 8086, however. CABINET FOR ABOVE HOIDS 'lW) DRIVES And it probably isn't compatible with POWER WIRIID COMPLEI'ED (AC AND DC) the 80386 either. Compatibility with FAN AND INPUT AC WIRiro DONE the 8086 is provided by leaving 32-bit 20 X 9 1/2 X 17 DEEP mode and entering what NEC calls AIL MOUNTIID HARDWARE Emulation Mode. It isn't clear whether there's 8080 emulation. POWER SUPPLY FOR 'lw:> DRIVES (SWI'IOIIID) One interesting feature of these pro­ WILL POWER DRIVES AND SBC 6 X 8 X 2 1/2 cessors is on-chip floating point sup­ 5VDC @ 8 AMPS, +12VDC, -12VDC, -5VDC @ port. This has the advantages of mini­ .• 5 AMPS FA AND 24VDC @ 2 AMPS mizing the support circuitry required CABINET AND POWER SUPPLY TCX;E!'HER $100.00 and standardizing the program inter­ face, but has the disadvantages of HARD DRIVE poorer performance, lower precision 2Cf'"MOO RODIME HARD DRIVE and fewer operations. 8 HEADS 320 CYLINDERS The V60 and V70 don't have dynam­ 6 IDNTH GUARANTEE $310.00 ic bus sizing (like the 80386). Instead CONTROLLER FOR RODIME WITH CABLES $125.00 the V60 has a fixed 16-bit bus, and the V70 has a fixed 32-bit bus. XT CLONE·PARTS ONE YFAR GUARANTEE V60 & V70 Applications ~ARD 'lURBO (6.67 AND 4.77 MHz) $145.00 The success of these processors is IDTHERBOARD UP 'ID 640 K ON BOARD $125.00 probably going to be inversely propor­ CCI.DR GRAPHICS CARD $ 75.00 tional to the success of a good operat­ FI.DPPY DISK CONTROLLER UP 'ID 4 DRIVES $ 40.00 ing system for the 80386. It isn't clear HARD.DISK CONTROLLER $125.00 whether these processors have the DISK I/O CARD - FI.DPPY DISK CONTROLLER important 80386 VM86-like mode. RS-232 CLOCK PARALLEL GAME ADAPI'ER $110.00 One possible application might be as CASE FLIP 'IDP STYLE $ 45.00 a graphics engine where the on.;.chip floating point and bit manipulation POWER SUPPLY 150 WATT $ 75.00 instructions could be effectively used KEYBOARD AT STYLE $ 59.00 for graphics operations. We'll have to wait for more details in order to reach QUME 142 HALF-HEIGHT FI.DPPY DRIVE a verdict. IBM COMPATIBLE (LIMITED SUPPLY) $ 89.00 CASCADE ELEX::TRONICS • •• ROUTE 1 BOX 8 FREE .RANIX)LPH MN 55065 SHIPPIID 507-645-7997 ON PREPAID ORDERS

COD ADD $3 CREDIT CARD ADD 5% MN ADD 6% LIMITED TO STOCK ON HAND E.VENIID CALL OK

MICRO CORNUCOPIA, #30, June-July 1986 75 CACHE22+CP/M 2.2 =CP/MMaxl

CACHE22 is a front-end system pro­ gram that buries all of CP/M 2.2 in banked memory. It helps 8080/Z80 computers to survive by providing up to 63.25K of TPA plus the ability to. speed disk operations, eliminate system tracks, and run Sidekick-style Enclosure & software without loss of transient power supplies program space. Complete source and for installation manual, $50.00.

FLOPPY, CP/M is a trademark of Digital Research Inc. WINCHESTER, Sidekick is a trademark of Borland International TAPE DRIVES, SINGLE BOARD COMPUTERS • S·100 SYSTEMS 8inch 5inch 3inch PROMPT DELIVERY!!! CUSTOMIZING SAME DAY SHIPPING {USUALLY) ICS QUANTITY ONE PRICES SHOWN AVAILABLE

DYNAMIC RAM Call or write 64Kx4 150 ns $4.85 2ss1

RESEARCH CORPORATION NO EXTRA COST MasterCardNISA or UPS CASH COD . p 8620 Roosevelt Ave. •Visalia, CA 93291 FOR FED-ex Factory New, Prime Parts .lJ oo 209 I 651-1203 · ~:~~v MICROPROCESSOR UNLIMITED, INC. RECEIVED BY 24,000 s. Peoria Ave., (918) 26~ 4961 . TELEX 5106012830 (INTEGRAND UD) Th: Sid Air $6/4 lbs BEGGS, OK. 74421 t • 51312 EZLINK 62926572 Fr: P-One lbs Prices shown above are for April 28, 1986 Please call for current prices. Prices suqea to change. Please expect higher or lower prices on We accept BankAmericard/Visa some parts

76 MICRO CORNUCOPIA, #30, June-July 1986 THE CULTIJRE c 0 Puzzles Part II R N E R n Issue 29 we posed the problem: 3x(711x(10"6)/N)"(1/3). Using this, Tom Wi/heit's MBASIC Program "Two boys were having their pur­ some simple computations will show that all the terms must be in the range I chases totalled at a cash register 10 FOR M:1 TO 4 when the first boy noticed that the 75-319. One of these terms must con­ 20 FOR N=3 TO 12 checker was hitting the times button tain the largest prime: 79. In order that 30 IF N=7 THEN 150 rather than the plus. When he com­ the term remain in the permitted 40 IF N=11 THEN 150 mented to the second boy, his friend range it can be multiplied by 1,2,3, or 50 F1=79*M told him not to worry, the total would 4. At least one of these remaining 60 F2:25*N come out the same either way. three terms must have at least two 70 PROD=(711/F1)*(40000l/N) factors of 5 (i.e. 25). The resulting 25 80 SUM:711-F1-F2 "They purchased four items. They 90 DISC:SUM*SUM-4*PROD paid $7 .11. What was the price of each can be multiplied by any integer from 100 IF DISC

1the sum of the remaining terms must would involve a sales tax of 12%. ·be equal to or greater than Pretty high, even for Washington!" •••

MICRO CORNUCOPIA, #30, June-July 1986 77 By David Thompson Weird Projections & Artificial Intelligence

I hate to admit it but after the last wouldn't put much credence in their into a stock database, search for infor­ "On Your Own," this column is stabs at 1986. mation significa~t to companies you're almost mundane. "86 World" However, numbers do tell you what currently holding and have a summa­ grabbed . the baton this issue on im­ the writer guesses will happen. When tion ready by breakfast (and it might porting your own systems and I'm the numbers go up, the writer is add suggestions for new purchases). really excited about all the AI articles. saying he's excited about that area, What if a music package could digi­ In fact, you could think of this and vice versa. (See Figure 2). tize sounds, analyze the uniqueness of entire issue as a sort of "On Your a sound or song, modify it based on Own." If you 're looking for some­ Flies In The Projections its /1 experience" with other songs or thing with immediate commercial val­ Before you start spending the mil­ sounds and then play this new crea­ ue, look no fu.rther than AI. lions you're going to make selling Ada tion? programs to the Defense Dept., let me If a song springs full-blown to mind point out something. you could just hum a few bars, tell the The computer industry was trucking pa~kage which ·instruments you want­ couple of months ago a quick­ along on these kinds of projections a ed and presto. Show that to your kids. printed, computer output, year ago when suddenly the market Do you think they'd go back to driv­ A pamphlet called "Computer went south (it was a cool . spring). ing a turtle around the screen?. Do you Industry Abstracts" (CIA!) showed up Hardware ·manufacturers discovered think composers would still be scratch­ on my desk. that computers in the warehouse don't ing little round .dots on blank staffs? Paper-clipped to the front was a equal dollars in the · pocket and soft­ (But then people are still writing boo~s /1 letter which began Attention: David ware folks found out that those same on ancient Royals.) J. Thompson, Editor.'' lonesome computers don't buy soft­ Taking .that to mean me, I read ware. Programming further. 11 Abstracts are mailed quarter­ Oh, the market didn't go away But you don't have to come up with ly for an annual subscription of $195." exactly, it just stopped growing, and a new "spreadsheet" to take advan­ One of the sheets was askew (a sloppy believers in all those super growth tage of the AI movement. There is foreign agent perhaps?). I looked it numbers found out that their numbers already substantial demand from busi­ over carefully before sliding it back were really just that, numbers. ness and industry for people who can into place. take expertise and put it into a com­ Obviously this was no cheap publi­ AI puter. AI appears to be the best meal cation (despite appearances) so I had Another problem with projections is ticket available at this time. to check it out. It was covered with that the projectors (projectionists?) ap­ Anyway, use the above numbers as numbers - plain, unadorned, dry, . pear to have the old NMOS crystal you wish. But if anyone tells you there lifeless numbers. And worse yet, the balls. are no longer any opportunities for numbers were projections pirated from Look at the Al projections. I think individuals in the computer business such radical hacker rags as Computer they're way, way low. It's obvious to he'll only be displaying his own (artifi­ Systems News, Datamation, Info­ me that AI will be the next spread­ cial) intelligence'. world, Fortune Magazine and Business sheet, so to speak. LANs, communica­ Week. tions talkers, accounting calculators, database finders, graphics scribblers, •••• Projections music generators, even compilers and Let ·me give you some numbers as assemblers will contain bits and pieces reported by CIA. from AI. · The sales projections shown in Fig­ What if your accounting package .ure 1 were reportedly made by Com­ understood what was going on in your puter Merchandising and Computer­ business? What if it contained the World during Oct. 1985. expertise of a CPA? · I don't know if any of these num­ What if your modem package. could bers can be real, but they can't all be. log onto Compuserve at 2 a.m., check So if projections differ that wildly for messages, leave messages, and when the year's almost over I then log off? Perhaps it could also get

78 MICRO CORNUCOPIA, #30, June-July 1986 Figure 1 - Contrasting Sales Figures & Projections (in $Millions) Compu te.r. Merchandising ComputerWorld 1985 1986 1985 1986 IBM AT 1 ,()90 3.. ·•fit ...~_ .. Q 94 342 AT Clones 490 1 , 570 292 568

Figure 2 - Retail Sales Projections & Totals For 1984 through 1990 (in $Millions)

1984 1985 1986 1987 1990 HARDWARE Personal Computers (all} 2,500 9,000 Desktop publi~hing hrdware 230 .1,000 Process Control Systems 1 11 2,, 090 Local Area Network Hrdware 4,600 Modems 760 1,000 1, 3 00 2,400 SOFTWARE Al 1 .IJ3tf .. Softwal"~.. 31499 4,300 5,800 19,500 Ada (Defense Depp 850 15,000 AI ~oftware. CI>G}, 65 130 230 Self improvement software 75 100 133 317 PC_ Acco~11t"ing_._ .• §e>f~w.a.I'~ 1, 400 2,390 3,800 Micro to Mainframe link soft. 72 130 233 420 Da·~-•a. .. _.communica~J()h~ soft. 40 360 Networking software 13 500 TOTAL Al:~ ·nii<:JI'()~j lla.tg~ .± Soft. 2~,0QQ ?§, Q~.o 31t,OOO 58,000

~ THE NEW 65/9028 VT 0 Assembled. => ANSI VIDEO TERMINAL BOARD! XEROX 820-1 & 2 · ·& Tested g * FROM LINGER ENTERPRISES * . 820-1 $50.00 820..:.2 $70.00 ~ A second generation, low cost, high performance, mini sized, CP/M (8") 2 single board for making your own RS232 Video Terminal. Use CP/M (8") 35.00' 35.00 :::> as a computer console or with a MODEM for hook up to any of 820-1 w/CP/M · 70.00 820-2 w/CP/M 90.00 ~ the telephone-line computer services. Xerox is a tra1emark _,t Xerox Corporation. CP/M is a trademark of D.!.2.. ital Research. 0 FEATURES: MICRO SIZE! . ~ * Uses the new SMC 9028 Video OEM· • HOBBYIST w Controller Chip coupled with a Sips Inductors Pots 7 400 Dips ff: 6502A CPU. Sockets Regulators Caps 7 4LS Chips > * RS-232 at 16 Baud Rates from 50 Linears Resistors Some EGL and more ... !Z to 19,200 ground or reversed. @20MA. Z80-B 6MHz $4.SO 0 * Mini size: 6.5 X 5 inches. SOURCE DISKETTE: Composite or split video. ~ * PC/XT FORMAT CJ) * 5 X 8 Dot Matrix characters 51/4 IN. $15 3P+N POWER SUPPLY ~ (U/L case). w * Answer back capability. Single board power supply kit with ~ * Battery backed up status memory. ADD $40 FOR A& T 2 positive fixed voltages. + 1 and -1 ::c · * For ASCII parallel keyboard. 1-1--~~~~~~~~~~~~~~~~~~~~~---f variable. •O KIT $54.95 I­ Digital Research Computers I­ u (OF TEXAS) 2 w..., P.O. BOX 381450 • DUNCANVILLE TX 75138 • (214) 225-2309 E 1 COMPUTER PRODUCTS mt--~~~~~~~~~~~~~~~~~~~~~--1 :::> 2273 Amei-ican Ave. -#8 - Hayward, CA 94545 en Call or write for a free catalog on Z-80 or 6809 Single Board en w Computers, SS-50 Boards, and other S-100 products. (415) 786-9203 ~i--~~~~~~~~~~~~~~~~~~~~~-- en TERMS; Add $3.00 postage. We pay balance. Orders under $15 add 75C handling. No -1 C.O.D. We accept Visa and MasterCard. Texas Res. add 5·1/8% Tax. Foreign orders TERMS: All or1ers are F.0.8. Hayward Cahforn1a - Prepayment or C.0.0. - California resi1ents a':l".1 sales tax•· Prices sub1ecr to change without notice,·~ .Juan1ities.tim1te1.10 stock on hand. ~,___(e_xc_e_pt_c_an_a_da_l_ad_d_20_%_P_&_H_._o_rd_er_s_ov_er_s_so_a_dd_8_s_c_ror_i_ns_ur_an_c_e.~~~---'

MICRO CO~NUCOPIA, #30, June-July 1986 79 ···If you've tried some of the earlier CP/M-80 add-ons such as Microshell™ and ZCPR™. !hen you ·know it's possible to add new features to CP/M. Now you can have much more without .~11 the trad~offs when you use ConlX- the latest and greatest upgrade for CP/M! , ·.. (ConlX) goes a great deal,farther in flexibility than any other CP/M shells ... this system has all of its competitors beat." Computer Language. 6/85.

. ~orif X O~e~ating System: List $9~5 5yec\a\ ConlX Progr~mming System: List $9~5 5~"\J~ . '. A co~plete upgrade for 48K+ CP/M 2.2/3.0 and A full programming language for ConlX extends CP/M -· ·equivalent systems. Provides professional capabilities· SUBMIT capability. Features conditionals. loops, ·.with 'blinding speed. as often found on more expensive subroutines. labels, nesting, interrupt processing, error ·MS-DOS™ and UNIX™ machines. Installs easily in 1 traps, and debugging facilities. Design intricate menu · , miriute to add over 100 new commands and features. systems. Includes a special "compiler" that provides Eliminates all points of user frustration with CP /M. string and numeric variables, an integer math package, ·Uses only 1/2K TPA. 0- 27K disk minimum. a relocatable assembly code generator, and much more. A must for CP /M power-users and developers! Con !X is the greatest, most powerful 8-bit upgrade. with speed. and capabilities that are so incredible it's bringing users back to CP /Ml Con IX Library I - XCC Utilities: List $4~5 $~"\J~ Over 25 utilities written in the ConlX shell language, Co_nlX._PuU-Down Menu: List $3~5 5yec\a\ including hierarchical directories with overlay - adds pathname capability to existing software, interactive A u~er'.".friendly. interface to Con IX that is fully menu­ debugger, move/copy/link multiple files, print files with dri~en, with helpful prompts and easily understood pagination, review disk files for deletion. unerase disk : explanations of all menu functions. Loads with a single with stats, full-screen TYPE. and more. Source code keystroke at the prompt level. Source code included! included/ Does not require Programming System.

: I •' ' ~ ,~ •

NEW YEAR SPECIALS - SAVE 30% TO 100% OFF! ·,, ,· • ConiX O.S. or Programming System: $49.95 each • ConlX Menu System: FREE with Con/XI •·Con IX Q.S. and Programming System: $19.95 for both • ConlX Library I: $34.95 with any Con/X product •SUPER SAVINGS WHEN YOU BUY 'EM ALL: ConlX O.S., Programming System, Menu System, L:ibrary I - Only $99.95!!

. N~wthat we've knocked the bottom out of our prices. you should have no reason to suffer along with plain-old .... CP/M or incompatible half-baked add-ons any more! Get started with ConlX for $49~95. or steal us blind and . get e~erything for. only $99.95. Either way. you get the Menu System absolutely FREE! Get on the bandwagon with a company that's committ'ed to you with the ongoing development of products for CP/M and ConlX.

Prices include manual, 8" disk; and end-user support. 51/4" disk conversions: 48TPI $6, other $10. Shipping: $4.50 UPS, $10 Canada, $15 overseas. NY residents add sales tax. Discount incentives for Dealers. OEMs. User Groups - CALL! r::t::lh Computer Helper Industries Inc. • P.O. Box 680 • Parkchester Station, NY 10462 'l:iJ' 800-.628=-2828 X513 24hr. order hotline - COD only• 212-652-1786 M-F:10-6 sales/technical staff "We're helping your computer work better for you!" Trademarits' CP/M: Disital Research. ConlX: C0111>uter Helper Ind .• Microshell: New Generation Systems. ZCPR: Richard Conn/Echelon, MS·DOS: Microsoft. UNIX: AT&T Bell Labs THE BEST OF BOTH WORLDS Run your CP/M programs on any IBM PC or compatible. RUN/CPM transforms your PC's floppy drives Into CP/M drives able to directly read, complete write and format over 100 CP/M disks. RUN/CPM directly executes your 10MB Kit CP/M programs. Kaypro, Morrow, Osborne, Cromemco, Heath, many more. Because this Is a hardware solution, your programs run up to 30% faster. speclal, * RUN/CPM only $79 (Requires NEC V20 chip below) only $398 PC SPEEDUP KITS • complete internal 112-high 10MB kit, incl. * NEC's V20 chip will increase the throughput of your system up to 90%. controller and cables, special $398. That's almost double your present processing speed. 5MHz kit $24. 8MHz $29. • complete 1OMB kit with low power 3- 112" half-high drive, fits 5-1/4" slots, ADD-ON CARDS SBC PLEDGE $469. • 3- 112" 10MB Winchester drive alone • multifunction card 384K, elk/cal' w/bat­ * service after sale * technical support HD-3 just $380. tey, serial, parallel, and game ports, with * low prices * one year warranty • 20MB half-high drive HD-2 now $395. OK save $50 Model MFC-4 $135 HARDWARE SPECIALS • monochrome graphics card runs 1-2-3 graphics, w/printer port, 720 x 348, - full IBM PC/XT • keyboard 5150 style regularly $125, MGC-1 now $135 (Hercules equiv.) compatibility Model KB-3 only $85 - 8 1/0 slots • keyboard 5151 style regularly $175, . • floppy controller for 1-4 48tpi or 96tpi - runs IBM's PC- Model KB-3 on_ly $99 drives, w/cable save $25 Model FDC-2 DOS 3.1 now only $74 • memory nine 150ns DRAMs Set ID-256 - BASIC inter­ 256K reg $55, now $34 preter available • color adapter w/light pen port, RGB a·nd - great foundation • no better DS/DD drives anywhere, 48tpi composite outputs reg $140 Model CC-1 for business or F-4 $99; F-9 96tpi $129 now just $116 personal system Smarteam modem (fully Hayes - 1 year warranty * * better than the Super 7: floppy disk equivalent) 300/1200 baud auto controller, elk/calendar, serial, parallel & ans/dial, reg $399, now just $249 game ports, spooler & RAMDISK s/w * Model MB-1 256K motherboard with OK .,______Sale $145 ideal mate for 640K mother­ regularly $295, now $199 boards POWER SUPPLY * Model MB-3 640K motherboard with OK • clock/calendar card reg $58, CL-1 $149 regularly $399, now $250 135 Watts * OMTI hard disk controller card (this· card side switch is super fast) reg $220, Model HDC-1 * Model MB-2 640K motherboard, 4.77 top quality and 7 + MHz clock, w/256K Reg $399, now $175, w/cables one year warranty - ~ now $297, this is a fast board. standard cables for 4 disk drives CASES ABOUT OUR MOTHERBOARDS • Model PS-135 power supply .regularly $129, now only $85 - the most IBM PC compatible mother- 1------1• boards available LAST "INUTE SPECIALS - each runs a// commercially available "* RUN/CPH only $79--see details in software upper left corner of this ad - each works with all commercially • IBH PC-DOS 3.1 $85 (only $65 with available add-on cards 1otherboard); Ellis PASCAL, COBOL, These FOUNDATION motherboards are the FORTRAN, BASIC co1pilers only $34 high quality IBM PC look alike w/side­ most compatible you can buy. All work with ea; "S 1ouse w/PC Paintbrush $145 switch, flip-top or slide chassis V20 chips, have parity checked memory, an any-combo disk drive brackets 8087 socket, a adapter slots, four empty -k COMPLETE 1001 IB" PC eqiv syst S987 heavy steel, 8-cutout style ROM sockets. Super manual includes com­ "* 96tpi drive gackage: over BOOK plete data on how. to put together a com­ on a single floppy, co1plete kit • Model CA-8 ·reg $95, now $69 plete PC system. It even includes schematics. with 96tpi drive, software $149 Shipping and handling: drives/motherboards/cases/power supplies $4.50 ea, cards $2 ea, software $2.50 ea, keyboards/modems $4 ea, speedup kits $2 ea, memory $1/set, COMPUTERFACTS $3 first set then $1/set. CA residents add 6% sales tax. To order or for further information: CALL (619) 375-5744

The SBC MART, P.O. Box 1296, Ridgecrest, CA 93555 AMERICAN EXPRESS The SBC Mart is part of Computing Technology, 821-8 Commercial Street, Ridgecrest, CA 93555

MICRO CORNUCOPIA, #30, June-July 1986 81 By Stephen M. ·Leon 200 Winston Drive Cliffside Park NJ 07010 PC Garn.es & A Z80 Emulator

Steve receives a commercial, copy Guide for The Care and Feeding of many ·useful modules on these disks to protected word processor, and guess Your Imaginary Z80, or Fakeware For go into detail~ Suffice it to say, for what? The same program is available the Techie Masses!" anyone doing assembly language pro­ in the public domain. But, the big There I was - no V20 chip, but gramming in CP/M-86 or Concurrent, news this time is the Z80 emulator running Turbo Pascal ZBO CP/M pro­ you must get these disks. that runs on the 8088. You can run grams on the PC. Sure they could For CP/M-80 assembly language pro­ Z80 Turbo on a PC - slowly, but have run faster Ooan is working on grammers, Rich Conn has done it surely. that). Sure some of the screen display again. We now have "grandson of· needed reworking, etc. However, this SYSLIB." The updated SYSLIB 3.6 disk is a significant contribution to the Library of Routines is available on computer magazine arrived at public domain (this is not a "send me SIG/M volumes 261 to 264. Take this my house recently with a rela­ money program"). It comes with as a hint that an update to ZCPR is A tively new innovation in source code, a good manual, and it due out shortly. software distribution - a program disk works! What more can you a~k? Another recent addition to the SIG/ sealed in light cardboard bound into M library is an implementation of the the magazine. The gimmick was that Drivers, SYSLIB, Etc. IE.EE 855 ·(MOSI) interface by Professor the copy protection scheme allowed · I suspect that Micro C probably has James D. Mooney of the Department you to run the program a limited a higher percentage of the CP/M-86 of Statistics & Computer Science at number of times. For something like and Concurrent CP/M users than any West Virginia University. MOSI stands $70 they would give you the unlocking other magazine. For those of you in for Microprocessor Operating System key. that category, we have four new Interface and is independent of the It was a word processor, but having "must" volumes in the SIG/M library. programming language. The programs just updated to NewWord3 (a phe­ DRI recently sent over their GSX on SIG/M Volume 253 contain an nomenal improvement over both drivers, and we released them as interface for CP/M 2.2 and for Pascal WordStar and the old NewWord), and volumes 257 to 260. There are too MT+ together with comprehensive being inherently cheap, I was more interested in the free floppy than the program. However, we ran it just to see what it was like - and it seemed 20 pin to have a familiar face! to host Shugart 1610 adapter to drive It appears that this same word controller processing program without copy pro­ so pin 34 pin tection is in the PC/Blue library as shareware. The same holds true with SASI to ST506/412 many ·other programs both in the D.OS 51/4" HARD DISK CONTROLLERS and CP/M worlds. There. are lots of These new factory sealed Shugart controllers have manuals and schematics things for free that are equal to, better available. They will control up to two SW' hard disk drives with up to 16 heads than, and in some cases identical to, each. These unique controllers will mount directly on the drive. By the change commercial products. of an EPROM they change their instruction set. to emulate other popular controllers. Z80 Emulation On The PC *Shugart 1610-3 emulates Xebec S1410 I still use my TRS-80 Model 1 to 1610-1 emulates OTC 510 check some of the Z80 contributions to 1610-4 SCSI version SIG/M. However, thanks to Joan Riff Using standard host adapters they work with: of Computerwise Consulting Services, * Apple II, II+, llE - * Wavemate Bullet I may be able to finally send the * MAC (see Sept. Dr. Dobbs) * All AMPRO boards (little board, etc.) Model 1 to its long earned rest. Joan * TRS 80 model Ill, IV · * And other systems with SASI Ports has written and donated to the public * ISi 5160 & ACS 1000 (PC clones) or host adapters domain Z80MU (PC/Blue 185). The 1 for $99. ea. 2 for $90. ea. 100 for $75.ea. Manual and schematic available. title of her documentation says it all: • Computer Surplus Store (408) 280-1746 • "ZBO and CP/M 2.2 Emulator User's Other controllers also available for 5W', 8" and 14" drives including Shugart SA1000, 4000 SERIES and Quantum 2000 SERIES OTC 5108, 1404, 14040, 1403, 14030, 14081, 1420-1, OMTI 20C, 20L).

82 MICRO CORNUCOPIA, #30, June-July 1986 documentation designed to whet the There certainly is no shortage of cial product (for example, Tommy Ret­ appetite of the user into additional word processing programs in the PC/ tig' s dGENERATE). Naval War Simu­ implementations for other languages Blue library. Working our way back­ lator is a sample game - hence a and systems. wards through the catalog, on 185 is. simulated game - that has· the audaci­ Our friend from Mexico, Professor NYW ord. On 182 we have Freeword. ty to ask for a $5 donation if you like Harold Mcintosh, has come up with A scientific notation word processor the sample. Then it pitches you to buy an update to his multi-column printing (ChiWriter) is on 173. PC-Write ver­ the "enhanced version." This kind of disk. SIG/M Volume 254 lets you print sion 2.55 (a· much acclaimed word · garbage belongs in a waste basket, not up ·to four columns and four files on processor) is on 167 (version 2.4 is on in a library or on a bulletin board. one or two sides of a page. As is usual 130). Volume 95 contains a word As a saving grace, Henry also in­ with the good professor, code is pro­ processing program for children. The cluded on 178 CaveQuest, a dungeons vided in both CP/M-80 and 86. MS-DOS version of ROFF is on 86. and dragons game. CaveQuest is well We haven't seen a great rush to CP/ There are a few more, but I think the worth getting. What I suggest you do M 68K. SIG/M Volume 256 contains message is clear. If you need a word is get volume 178 and send a nasty two utilities (file compare and query processor for your PC, you certainly note to Shadow Mountain Software erase), but we're always looking for should be able to find it in the library. after you erase NWS. more. On the same disk is a program Other games in the PC/Blue library to transfer. files between MS-DOS. and Games include: Twenty miscellaneous games -CP/M in Turbo Pascal. A program of Got a note the other day from on 153 and thirty more on 147. If you interest to Kaypro owners is a dynam­ someone complaining that we rarely want more, Spacewar is on 128, and ic trace disassembler on Volume 252. mention games. The PC/Blue library four other game programs are on 102. However, it works only on older mod­ does have games. However, I have to A three volume multi-user SuperTrek els with the non-graphic screen. ask - when is a game not a game, but is on 90-92. Twenty-one other games rather an insult? Take for example (including Chess, Eliza, Othello, News From PC/Blue Naval War Simulator on PC/Blue 178. I PCPONG, etc.) are on Volume 25. New and worth mentioning from know Hank Kee is one of those people Volume 24 has another 19 games, PC/Blue is DISKIT, a disk repair utility you can find on the job at almost any including Blackjack, Cribbage, Slot on Volume 176. On 178 we have the hour day or night. On this one, I think Machine, etc. Most games require a PC MAGAZINE benchmark test serie.s. he may have been sound asleep when color monitor. SuperTrek requires an Volume 181 has PC-Kat, a diskette he let it by. 8087. cataloguer. On 182 we have Cut/Paste I won't give a nickel to ''ask for and Notepad, memory resident utili­ money" software unless the program Computer Hobbyist Of The Year ties like Sidekick. A new version of is something I find of such value that I The Computer Hobbyist of the Year PRO LOG is on PC/Blue 183. would go out and buy it as a commer- Award is presented at the Trenton Computer Festival to the individual who has made an outstanding contri­ bution to amateur personal computing. @ It is, in effect, the "Oscar" of amateur Ever Wondered What Makes CP/M 'lick'! personal computing. Source Code Generators The nominees for the 1986 award by C. C. Software can were William Bolton of New South give you the answer. Wales, Australia, Jud Newell of Toron­ to, Canada, Irvin M. Hoff of Los Altos "The darndest thing. Hills, California, and Sol Libes of I ever clid see~~ . 11 Mountainside, New Jersey. 11 ••• if you're at Bolton was cited for his efforts to ~11 intereste~ in bring amateur computing to Australia what's going on in and New Zealand through his pioneer­ your system, it's ing efforts in setting up bulletin board worth it. 11 The S.C.G. programs produce systems, acting as a distributor of Jerry Pournelle, fully: commented and labeled public domain software, and contribut­ BYTE, Sept 'SJ source.code for your CP/M .system (the CCP and BOOS. ing a vast number of original programs area~). To modify the system to your liking, and translations to the public domain. j~st edit an4 assembie with ASM. CP/M 2.2 ·$45, Newell was nominated for his contri­ CP/M+ $75, + $1.50 postage {in Calif add 6.5%). butions to the development of amateur computing and bulletin board opera­ c. c. ·software,· 1907 Alvarado· Ave. tions in Canada as well as for his Walnut Creek, CA 94596 (415)939-8153 efforts in implementing the Canadian CP/M is a registered trademark of Digital Research, Inc. (continued next page)

MICRO CORNUCOPIA, #30, June-July 1986 83 IN THE PUBLIC DOMAIN

even gets nasty calls on why the accountant, but if you developed soft­ (continued from page 83) material isn't yet out. However, most ware for commercial purposes and of his releases ask for donations, have a cost basis on it, you might be distribution of public domain software. hence the impatience.) able to get a tax deduction out of the Hoff was cited for his work upgrad­ Making a donation to your col­ contribution. (I would suspect, how­ ing Christenson's MODEM into the leagues in computing is not that hard. ever, that if your commercial sales MDM series and IMP. He was further All you do is fill in the donation form have reached the point where you are cited for his assistance to newcomers (found on most library disks) and send giving it away, you are in a loss to computing via Coin.puserve. the disk to either SIG/M or PC/Blue. position.) Libes was nominated for service over The SIG/M donation form differs So why not share that software with an 11-year period in promoting per­ slightly from the PC/Blue form in that the rest of us, and support public sonal computing as a founding mem­ we ask you to state that the program domain software with a contribution. ber of the Amateur Computer Group does not contain a request for money. of New Jersey, editor of Microsystems PC/Blue allows shareware. 5" Disk Formats On SIG/M and Micr.osystems/Journal, and author SIG/M disks also usually contain While SIG/M has traditionally dis­ of numerous books on computing and source code. Not so with PC/Blue, tributed programs only on 8" SSSD electronics.· although as mentioned before, Joan disks, we have for some time recog­ The 1986'winner was Sol Libes. Riff's ZBO emulator not only contains nized the need for 5" distribution. source code, but it also is a true public Thanks to a Maynard disk controller Joining The Public Domain Parade domain program. There are many oth­ and Uniform on a PC, we are experi­ There is no shortage of contributors er such contributions in the PC/Blue menting with distributing 5" disks. to both the SIG/M and the PC/Blue library, and yours truly would person­ (We still prefer that you get your libraries. I must have about· 30 vol­ ally prefer to see less shareware and volumes locally or via BBS systems). umes of material that I have yet to more true contributions there. The charge for 5" disks is $7 per review for new releases for SIG/M, If you make a donation to SIG/M volume. However, for SSSD formats, and new material comes in every and we publish it, we give you your or any format which requires more week. (Henry Kee, PC/Blue disk edi­ choice of two free library disks. You than one disk, please add another $2 tor, probably has a bigger backlog. He may want to check t~is out with .your per volume.

Eco-C88 is a full C compiler for MSDOS machines. Everything you need is included We've continually improved Microstat since it was introduced in 1978, and in the low price of $59.95, including a full-screen editor. Here's what some the latest release includes many new features you've wanted. reviewers are saying about the Eco-C88 C Compiler:

Interactive and Batch Processing Data sets that can exceed memory "Eco-C. performed well on all the benchmarks, generating code that was quite comparable to that of compilers 10 times as costly." Expanded Data Management Multiple Regression (including Christopher Skelly, Computer Language, Feb .. J.986 Subsystem with New Data Stepwise) "This compiler does handle syntax errors much better than average Transforms - no avalanche of spurious messages here." Scatterplots (including best fit · William Hunt. PC Tech Journal. Jan., 1.986 Reading data files created by other regression) programs (e.g., Lotus) "Eco-C88 is a high-quality package ... convenient to use ... " Correlation Analysis Dr. David Clark. Byte. Jan .. 1.986 3 types of Analysis of Variance "Eco-C is definitely a bargain ... it includes both the compiler and an 12 Nonparametric tests excellent Turbo-style editor ... a useful compiler for advanced applications, Time Series and will s~rve far beyond the beginning phase." 8 Probability Distributions Gary Entsming~r. Micro Cornucopia. April-May, 1.986 Crosstabs and Chi-Square Descriptive Statistics The compiler comes with a standard library of over 200 functions, cc and "mini-make" utilities, ANSI language enhancements (e.g., Factorials, Permutations, and prototyping), expanded user's manual, plus much more, all for the low Combinations Easy Installation price of only $59.95. Also ask about our support products! Hypothesis Tests

If 9rdered with the compiler, the C library source code (excluding transcen­ Microstat's algorithms have been designed to prevent numeric overflow errors dentals) is $10.00 and the ISAM file handler (as published in the C and yield unsurpassed accuracy. Microstat's price is $375.00 including the Programmer's Library, Que Corp) in OBJ format is an additional $15.00. Please user's manual and is available for the Z80, 8086, 8088 CPU's and CP /M80, add $4.00 for shipping and handling. To order, call or write: CP /M86, MS-DOS, and PC-DOS. To order, call or write . Ecosoft Inc. • 6413 N. College Avenue 1-800-952-04 72 Indianapolis, IN 46220 (orders only) (317) 255-6476 • 8:30-4:30 E.!/i .1•1~• Trademarks: Eco-C88, Microstat (Ecosoft), CP /M (Digital Research), MSDOS (Microsoft), PC-DOS (IBM), Z80 (Zilog), 8086, 8087, 8088 (Intel).

84 MICRO CORNUCOPIA, #30, June-July 1986 Byte Magazine called it, "C/ARCIA'S How To Order on two disks (SSSD formats with less SIG/M volumes are available on 8" than 240K), please add $2 extra per SUPER A"'' volume. The distributor list is included . SSSD disks for $6 each ($9 foreign) SYSTEM" ~6ff,,,, .. ~·" directly from SIG/M, Box 97, Iselin, NJ with the printed catalog. A disk ver­ 08830. Printed catalogs are $3 each ($4 sion of the catalog (Volume 00) is 4f' foreign). Disks in a variety of formats available for $6. PC/Blue volumes are may be obtained through the world­ $7 each ($10 foreign). The printed wide SIG/M distribution network. For catalog is $5. Both are available from those of you unable to get the stan­ the New York Amateur Computer dard 5" formats through the distribu­ Club, Box 100, Church Street Station, tion network, you can now order most New York, NY 10008. of these formats through SIG/M. The price is $7 per volume ($9 foreign). If the format requires that the volume be •••

The SBl80 Computer/Controller

Featured on the cover of Byte, Sept. 1985, the SB180 lets CP/M users upgrade to a MULTl-USER 68000 fast, 4" x 7'1:/' single board system. SINGLE BOARD COMPUTER • 6MHz 64180 CPU (ZBO instruction superset). 256K RAM, BK Monitor ROM with device test, disk format, read/write. • Mini/Micro Floppy Controller (1·4 drives, Single/Double Density, 1·2 sided, 40/77/80 track 3%'; 5~" and 8" drives). • Measures 4" x 7~·: with mounting holes • One Centronics Printer Port • Two RS232C Serial Ports (75-19,200 baud with console port auto-baud rate select). • Power Supply Requirements +5V +/-5% @500 mA +12V +/· 20% @40mA • ZCPR3 (CP/M 2.2/3 compatible) • Multiple disk formats supported • Menu-based system customization

SB1B0-1 SB 180 computer board w/256K bytes RAM and ROM monitor ...... $369.00 SB180-1-20 same as above w/ZCPR3, ZRDOS FEATURING: and BIOS source ...... $499.00 -Quantity discounts available· • 8 MHZ 68000 CPU • 2 Mega Bytes RAM NEW • Memory Mapping I Manager ~OMM180-M·S • HD 64180 Co-Processor optional peripheral board adds • 8 Serial Ports 1200 bps modem and SCSI hard disk interface. • Floppy Controller • SCSI I SASI Interface TO ORDER • Parallel Printer Port CALL TOLL FREE TELEX 1-800-635-3355 643331 Price: $1500.00 For technical assistance or to request a data sheet, call: 1-203-871-6170 HAWTHORNE TECHNOLOGY 8836 S.E. Stark, Portland, Oregon 97216 (503} 254-2005

MICRO CORNUCOPIA, #30, June:July 1986 85 By Dave Hardy 736 Notre Dame ICM's ·S-100 Boards Grosse Pointe MI 48203

Dave reviews ICM's single board After . using two CPZ-48000 boards Olympia, WA. Matt is currently run­ ZBO processors and slaves. It's ob­ for the last four years, my only com­ ning a plain vanilla CP/M system, but vious that in the S-100 world, the plaint is that a shorted regulator on an is planning to upgrade to TurboDos as ZBO is still alive and processing. RS-232 personality module can cause soon as ·he can get the hardware put SERIOUS damage to the main CPZ- together · and debugged. Within his 48000 board, including destroyed description . of the hardware he is is column is the second in a traces and component failure (I've lost assembling, he mentions that .he has eries of mini-reviews of Turbo­ two boards this way). An added fuse p1cked · up two Mitsubishi 8" half­ Ti. Dos-capable S-100 hardware. has saved me from any additional height floppy drives and has heard Along with the usual S-100 tips, cir­ failures. However, this problem exists that they're reliable, but is being driv­ cuits, and reader feedback, future col­ in all S-100 boards that use personality en crazy by the clatter they make each umns will include a brief look at the modules (sometimes called "Paddle time the heads are loaded. offerings of each manufacturer of S- Boards"), and is not restricted to just Matt also mentions that some· of the 100-based TurboDos products. ICM. S-100 cards he's using (particularly the single-board computers) are "real blast Intercontinental Micro Systems Slaves furnaces," and that he's thinking Intercontinental Micro Systems' ICM's 8-bit slave· processors, the about bypassing· the heat-generating product list is like a supermarket for S- CPS-MX 64K and CPS-BMX 128K, are regulator· ICs on;.board and supplying 100 shoppers. Besides offering their just as impressive· as .their SBCs. Run­ the boards directly with regulated own S-100 product line,· they also have ning at 4 or 8MHz, · the ICM slaves power. He wants to know if anyone bought the rights to MUSYS Corpora­ have most of the features of the SBCs, else has ever tried running S-100 cards tion's S-100 bus boards. In fact, ICM including on-board MMU and full with off-board power regulation. has more S-100 products than I can DMA capability. Running as a i:nemo­ ·, I can offer · some advice about the mention in a single mini-review, so ry-mapped slave· 'under TurboDos, the Mitsubishi floppies because I've been their name will probably crop up in CPS series slave processors are much using them myself for the past couple future columns. For now, I'll just faster than most of the 1/0-mapped of years on my RCPM system. I can cover most of the single-board com­ slave boards I've seen. vouch for their reliability, since two of puter products. Like the SBCs, each CPS board has them have . been 'running non-stop two serial ports, two parallel ports, without any failures or alignments 8-Bit SBCs and two CTCs. Most of the TurboDos since the spring of 1983. I'll start with the 8-bit boards. The gurus I've talked to have said that As for the noise, there's a simple first product is the CPZ-4800x series of they find memory-mapped slaves fast­ solution to that. The most annoying Single-Board Computers (SBCs). Based er than regular 1/0-mapped slaves, but part is the· loud snap, made by .the on the Z80A processor, these boards a great deal more difficult to imple­ door locks every time the drive is offer a Memory Management Unit ment. If you're running ICM's version accessed or the head is loaded. Be­ (MMU), 4-channel DMA, Vectored or TurboDos, then this shouldn't be cause the door lock is a useless feature Prioritized Interrupts (VPI), an SIO (or much of a problem, since they do it in most cases, you can simply defeat it DART), a PIO, a 2793 FDC, 64K for you. by unplugging it or cutting the door DRAM, and a built-in monitor in Hmmm ... Out of space already. lock relay wires. EPROM all in the same package. Low­ We'll have to continue this mini-re­ If your equipment de-selects. the level 110 (like RS-232 drivers and view next time (starting with the ICM drive automatically when it isn't being receivers, and floppy 1/0 configura­ 16-bit stuff). used (and thus turns off the DC tion) is done via small "personality spindle motor of the Mitsubishi), you boards'' that contain additional I Cs First Letter can.cut down the noise even more by and connectors. Using optional per­ I've received several interesting let­ defeating the head-load relay and leav­ sonality boards, the CPZ-4800x can ters since last time. Much to the relief ing the heads loaded all the time. support 5.25" or 8" drives, RS-232, of my editors, I'm sure, I can't possi­ Because of the design of the drive, the SASI, Centronics, and many other bly answer all of them here. However, heads are automatically separated peripheral devices. If you don't want I do have room for a couple of them, when the disk door is open, even if to use them as masters in a TurboDos so here goes: the head-load relay is energized, so no system, these boards also make. dandy Letter number one is from Matt damage-can result from this. stand-alone CP/M systems. Swarm of The S-100 Board Bank in I've modified all four of my Mitsubi-

86 MICRO CORNUCOPIA, #30, June-July 1986 BEST DEAL EVER ON 45 CPS DAISY WHEEL

Qume Sprint 3 with Serial Interface with Logic Seeking Bi-directional Proportional Printing at 300 or 1200 Baud - DTR or Xon Xoff. Has full keyboard so can Double as shi half-heights this way, and they're typewriter. so quiet I can't even tell when they're Guaranteed 90 days ...... :...... $375. being accessed. (These tricks can often Working but not thoroughly tested ...... $329. be applied to other drives too, but you Spare parts available should be very careful about forcing a SOFTWARE LIQUIDATION · HARDWARE LIQUIDATION "head loaded" condition, particularly Accounting Plus (One of the Best) - Shugart 410 51/4 SS DD if the drive' s spindle motor runs con­ Buy General Ledger ...... $49.95 (2 drives In case) ...... $89. tinuously, or if the heads must be (Originally $495 - $595 per module) With Xerox 820 connector ...... $99. unloaded prior to removing or insert­ Big 3) and we'll toss in A/Rand A/P for only Tee 51/4 SS DD for many different $29.95 each or pick your modules for ing a diskette.) computers ...... $39. $39.95 each -features password About bypassing the on-board vol­ protection, audit trail, double entry, Diablo 630 ECS ...... $895. tage regulators on S-100 cards to pre­ open item, error checking, etc. Diablo 630 API ...... $795. vent excessive heat: Be Careful! If you Buy the whole set G/L, AIR, A/P, Diablo 630 PPI ...... $695. do it right, you should have no prob­ Inventory, Payroll, Point of Sale, Diablo 1640-50 ...... $495-595 lems, but you should beware of sever­ . Sales Order, Purchase Order Xerox 820-1 Single Board Computer Big 8 for...... $199. al things before you do it. One of the complete, tested and These disks are in 96 TPI format but we can guaranteed ...... $79.95 reasons for the on-board regulators in download to almost any format CPM 86, IBM, or Enclosure for above or the · first place is to prevent garbage CPM 80for1.95 per disk. We have about 80 sets of other SBC ...... $229.95 signals from passing between boards the Big B package and 60 of the Big 3 (Motorola Monitor, Power Supply CPM 86 for IBM and Compatibles ...... $29. via the power supply. Running two S- connectors etc.) 100 SBCs from the same power supply Either Tee or Shugart drives above + SBC & this way, for example, will probably Enclosure will make a full system but you not work. So be sure that the power need a Keyboard (sold only with system) lines going to the un-regulated board Keytronics full keyboard ...... $51. are adequately filtered (not just for Complete System 820-1 with, '.'smooth" power, but also to trap out 2 disk drives and keytronics...... $399.95 high frequency noise, switching tran­ Power Supplies 200 watts ...... $39.95 CPM with Xerox 820 Bios and sients, and the like). full Manual...... $39.95 Many of the single-board S-100 com­ puters require extremely clean input Shipping and Handling power, and, after bypassing the regu­ charged on all orders lators, will run reliably only with addi­ CRAIG'S tional filter capacitors installed on the board itself. In addition, if forced-air cooling was required before the regula­ COMPUTERS tors were removed, it will probably (213) 371-4428 (Days) (213) 379-1342 (Nights and Sundays) still be required afterward. Also, if you decide to remove the on-board regulators, be careful to do it hackers who would be very interested a few timing tricks needed to shoe­ in a way that prevents the board from in seeing such an article.'' horn the 68K into the 5-100 bus, too. being inadvertently connected to an Interestingly, I have a column (actu­ Peak's design lets the 68K reside in a unregulated S-100 supply, or else the ally two) planned for just what you system with another host processor board will change from a blast furnace have mentioned - using 16-bit devices that it uses for I/O, which makes to a pile of carbonized shredded on the S-100 bus, with and without installation painless. wheat. other 16-bit cards. Although the IEEE-696 standard al­ Next Time Second Letter lows for 16-bit stuff on the S-100 bus The next mini-review will cover the Letter number two is from Jeff J. without any "tricks" like multiplexing popular Earth Computers Z80 slave Henkels (via GEMail). Jeff is designing data/address lines, etc., there are sev­ processor board. If you would like to a 68000-based CPU card to replace the eral different schemes for "sneaking" see a mini-review of a certain 5-100 .ZBO card he's currently using in his S- 16-bit processors into an S-100 bus that product, please let me know, and I'll 100 system and would like additional has only 8-bit cards. Many manufac­ be happy to give it the once-over. information on how to control the turers make 68K-based boards that use Of course, future columns will also interface between the 16-bit 68000 and existing 8-bit cards, including Viasyn include more letters from readers, S- the 8-bit memory, disc controller, and (a.k.a. Godbout; CompuPro) and 100 tips, and hints. As always, I l/O cards. Peak. Viasyn' s scheme does some neat encourage reader feedback, and wel­ "To date," Jeff writes, "I have not hardware tricks to allow the 68K' s come questions, suggestions, com­ seen this material covered in detail in memory-mapped I/O to be translated ments, and ideas for future S-100 Bus any of the S-100/IEEE-696 literature. I to l/O mappirig for S-100 peripherals, columns. am sure that there are many S-100 for example. And, of course, there are •••

MICRO CORNUCOPIA, #30, June-July 1986 87 (continued from page 4) feel for when that's going to happen. two SA465s, and everybody runs on Anyway, all you need to do is re-boot that switcher that BCD Electro has PC Hard Disk (you don't need to reload Kickstart). been selling for $25. Excellent supply, My computer is an Epson QX-10 The DOS that originally came with the by the way. with a Titan PC-II board which makes machine (Version 1.0) had a few bugs Watch out for solid-state Scientific . it run almost like a PC. I'd love to add (notabiy the serial drivers), but DOS HCMOS. I've had a couple of bus­ : a hard disk to my system. I can buy 1.1 seems to have solved that. killer failures with their 74HC245 ( + 5 one, but it costs $1200 with the inter­ shorted to a data bit). I'm keeping my face and control boards. I see hard My only complaints are: eye on them. I got the parts from disks advertised for the PC for urtder 1. No software. I have Delux Paint Jameco. $500 including the controller. and Lattice C, but there's no business Carroll R. Bryan III WBlHKU/6 However, on my system (like the software out yet (Maximillian looked 7311 V ariel Ave #4 Kaypro) I still need an interface to the promising, but it wasn't compatible· Canoga Park CA 91303 controller. I know it isn't worth your with DOS 1.1), and even the games time to publish an article just for the are scarce so far. But with the open Epson QX-10, but an article which architecture and easy access to docu­ Reader Comments would show how a Kaypro and any mentation, I think this will be short­ As I filled out the Micro C renewal other system could use a PC hard disk term. questionnaire, it was difficult to assign might appeal to many of your readers. 2. The software I do have (especially ratings to many of the things listed. John A. Clinkenbeard Lattice) seems to be of the opinion Even though I gave (for instance) a 5810 Woodbridge Lane that, since there's lots of memory and zero to BBi, I still read most of the Midland MI 48640 disk space, there's no need for effi­ articles about the BBi because I often ciency. For instance, the Lattice pack­ find something of interest in each Editor's note: age takes up an entire 880K disk, with article. I really read your publication Excellent suggestion, John. However, no room for the DOS functions. The from cover to cover. I'm mainly inter­ check the PC-BIOS article in this issue. It familiar "Hello. C" program compiled ested in my 280 machine and now the would appear from that article that it to 15K. Where, oh where, are the days 68000 machine. There is already much would be much easier to do a SCSI when you could fit your BASIC graph­ out there on Unix, so I don't think interface, and add the winnie support to ics program into 41<, with another 4K Micro C should get into that yet. Unix CP/M's BIOS (or as a driver in MS­ for the BASIC interpreter and operat­ isn't so prevalent in the hobby, do-it­ DOS). ing system? yourself world (yet). It's big and quite Anyone have any other suggestions? Lloyd Sumpter complex. #203 - 1740 Southmere Cres. I'd like to see things on 68000 D-1-Y · Amiga Aficionado White Rock B.C. Canada V4A.6E4 machines, especially S-100, because I just read Issue 28 and feel I should that's what I have. I would really like speak out in defense of the Amiga. I to see some articles on CDOS. I'm bought mine in November (for some Tips & Gotchas sure there are people out there with reason, we Canucks seem to have In case you didn't know, the Ampro more knowledge than I· have about been blessed with availability well be­ Little Board (and the Big Board, too, how to· get in ·and do the things that fore otir southern friends), and use it for all I know) can· talk .MIDI with a one can do with CP /M such as hard daily for writing letters, .communicat­ silnple $10 interface. It can run port B disks (without going to Cromemco). ing with l3BS'es, keeping track of at 31.25Kbps; the rest is a 2mA current Speaking of Cromemco, it really marks, and programming in C. loop to RS-232 adaptor using a 6N138 frosts me that they don't support There's no. question that the graph­ opto (GI sells th~m for. a lot less than CDOS and yet won't release the ics are mind-blowing (the Electronics HP). source code. They've forgotten those Arts demo disk that comes with the If you're building a bare-board L­ of us who bought their machines machine is a good substitute for cheap Band spooler, be advised that It will when they were working out of a drugs), but I like the AmigaDOS envi• rteed a hardware patch if it's to ·use garage iri San Jose. We had confidence ronment for business and program­ Tl's TMS4164s. They're 8-bit-refresh 4 in them and helped make them a ming applications as well. It's great to millisecond parts; the 280 holds d7 reasonably large company (our depart­ have a full-sci::'eeh editor, text file sort low during RFSH* time, so half of ment at USC bought four machines» utility, and file joiner all built into the each chip never gets a refresh. The and now they turn their backs on us DOS (not to mention the built-in board layout is quiet enough (free of unless we fork over more big bucks. RAMdisk!). It's also great to be down­ electrical crosstalk) to use just about They completely ignore the hobbyists loading a file, printing a report, and any Japanese 7.. bit/2 millisecond RAMs that they themselves were a part of. editing a program - all at the same that meet the access time, so why pay 'Nuf said. time. the extra? Good product, once I got Robert L. Amen Speaking of DOS, I haven't seen the that bug killed (I used TMS4164s). It's Chesapeake Bay Institute rumored crashes, except when I run happily sitting in the rack box that 4800 Atwell Rd. out of memory, and you sort of get a holds the Ampro, two SA455s, and Shady Side MD 20764

· 88 MICRO CORNUCOPIA, #30, June-July 1986 v Digital dynamics INVENTORY CLEARANCE •NEW - SEETIME has alarms! EPROM PROGRAMMER inLerfaces Lo Lhe BBi (XEROX 820) parallel porL You can set up to 4 alarms, each Requires +5Y. I .3A, +25Y. • JA, inLerface cable & containing date, time message. Program, Verify, Load and Erase check • NEW - Screen saver feature turns 2716, 2816A, 2516, 2732(Al 2532, 2764, 2564, 27128 off the screen after a set time with 1. SofLw&re and schemaLic 15.00 2. Bareboard and schemaLic 15.00 no keyboard activity. 3. SofLware and bareboard 25.00 4. SofLware and kiL (less ZIFs) 60.00 • NEW - Configurat10n program to 5. SofLware and full kiL SOLD set SEETIME parameters: 6. Programmer A ... T 0 UT Sold Out - time/date location on screen Big Board II sofLware and source (uses BB II sockeLs for programming) 15.00 - military or civilian display format Utility Disk 1 - cursor blinking or steady PEG - Universal ObjecL File TranslaLor. FormaLs supporLed ... 8/16 biL lnLel and MoLorola hex BHLF .COM BPNF ASCII - screen saver timeout Merge and spliL of 16 biL daLa also supporLed. HEXED - A £ull screen hex file ediLor (simu!Laneous ediLing of boLh hex and ascii) • SEETIME can input the time or Full source and documenLaLion on disk Hi.CO date into any program, print the WADE-I screen and display alarm.s. - 256k byLes of RAM wiLh DMA capabiliLy - 4 fully buffered 8 biL parallel porLs • SEETIME is part of TIMEPRO: - configurable EPROM sockeL (2716 Lhru 27256) - 4 fully buffered 8 biL parallel porLs - APPT personal schedule manager - 2 configurable RS232C serial porLs - TD file time/date stamping & backup - CompleLe documenLaLion - LOG computer usage logging 1. Bareboard 39.00 2. PrinLer buffer EPROM 10.00 TThIBPRO runs on '84 & later Kaypros with 3. PrinLer buffer source 15.00 Kaypro, Kenmore or Advent clocks ...... $49.95 Specify 8" SSSD or 5.25 Kaypro diskeLLes *U. s. FUNDS* include S3.00 for S/H SEETIME upgrade for TIMEPRO owners ... $14.95 Shipping and Handling - $2.50 Biegun and Associates (206) 772-0291 Visa, MasterCharge P.O. Box 4071, Stn •gi Winnipeg, Manitoba CANADA R2W 5K8 12448 83rd Ave S., Seattle WA 98178

MODULAR DISTRIBUTED DATA ACQUISITION SYSTEM

AD1208 CN100 MPSOOO DATA ACQUISITION SUBSYSTEM RS232 MULTIPLEXER CONTROLLER RS232 MULTIPLEXER

• 8 single ended channels • Connects to host via standard RS232 cable • 8 channel RS232 multiplexer expansion board • 12 bits plus sign resolution • 300 to 19200 baud operation • LED numerical display for selected channel • Input range + -4.096V standard, + - .4096V · • Controls up to 16 MPSOOO multiplexer boards • Easy connection to CN 100 via 20 wire ribbon cable dptional • Simple two character command from any language expansldh bus • User ihstallable input attenuator option for each (BASIC, PASCAL, ASSEMBLY etc) • Expandable up to 128 serial channels with one channel • Requites at least one MPBOOO multiplexer board CN100coiltroller • 15 samples/sec sampling rate for complete RS232 multiplexer • Interfaces to any host via AS232 port 300 to 19200 baud Assembled and tested ...... $115 Assembled and tested ...... $125 • Stand alone (requires RS232 to modular jack adap· ler) or inultisystem (connects to MPSOOO multi­ NOTE: CN 100 and MPBOOO are designed for family of STELCOR Data Acquisition and Control subsystems, but plexer) operation may be used as a general purpose RS232 multiplexer for applications not requiring an active handshake signals. • Simple one or two character commands from any language (BASIC, PASCAL, ASSEMBLY etc) • Programming examples included • Modular interface cable included STELCOR P.O. Box 51362 Assembled and tested ...... $199 PALO ALTO, CA 94303 TERMS: Check or Money Order. California residents 25 pin RS232 to modular jack adapter kit (specify male (415) 968-0558 add 6V2% sales tax. Add $5 for shipment outside USA. or female) ...... $10.95 Allow 2 weeks for delivery. 4 channel analog output plus 16 digital 110 subsystem coming soon

MICRO CORNUCOPIA, #30, June-July 1986 89 Little Board™ •••• $149 EDITORIAL The World's Least Expensive CP/M Engine

(continued from page 2) ~ I arena. (Our $3,000+ Kaypro .286i isn't perceptibly faster and · its AT · style floppy/wim;1ie controller has been .a pain.) ·· . · The .only thing I. miss 'on the Hollistcm poard .• (and on Gary's X-1_6 board) is. the mat~ co-processor. However, both Holliston and PC: Tech are supposed to be finishing 8087 upgrades as I write this. · · . . Holliston's will be an, add-on board, PC Tecl~'s 8087 ~ill m~u~t ~irectly OR thefr latest version of the proces- sor boatd. · ·

• 4 MHz Z80A CPU, 64K RAM, Z80A system with ZCPR3 CTC, 4-32K EPROM • Read/write/format dozens of Floating Point Sp~ed . • Mini/Micro Floppy Controller floppy formats (IBM PC-DOS, · It was The Culture Comer problem in Issue 29 that (1-4 Drives, Single/Double Density, KAYPRO, OSBORNE, MORROW ... ) graphically pointed out the value of hardware . floating 1-2 sided 40/80 track) . • Menu-based system customization • 2 RS232C Serial Ports (75-9600 baud • Operator-friendly MENU shell point. (The probleq1 was to find four numbers. whose & 75-38, 400 baud), 1 Centronics •OPTIONS: sum and produd. is· 7.11.).'I _cpuld have substituted Printer Port • Source Code integ~rs fox; .floats · in this. probiem, but ·that kin.d of • Power Requirement: +5VDC at .75A; • TurboDOS + 12VDC at .05A I On board -12V • ZRDOS substitution wouldn't have ~o.rked in ,most other.flpating converter • Hard disk expansion to 60 megabytes point situations. , · · ·. · .· · , . • Only 5.75 x 7.75 inches, mounts • SCSI/PLUS'" multi-master 1/0 directly to a 5-1I4* disk drive I used a brute fore~ 'methC>d. to search for the answer, expansion bus • Comprehensive Software Included: • Local Area Network which means that.my'program'does lots of floating poii;lt • Enhanced CP/M 2.2 operating • STD Bus Adapter ,operCltions.. . . · .· · , . · . . Let's see, to test every possible number between 0 and 71i. to 'see if its. sum and product were equal it would BOOKSHELF™ .s'etie~ 100 take 711 x 711 x 711 x. 711 passes ... The program wouid Fast, Compad, High Quality, Easy-to-use CP/M System do addition'. and multiplication of four floating . point ~µm~er~.. in .adqitiqn to m~me~ous, floating ·inc~~mentp (much better than sinking · .i~crements) •. and. fl?ating Priced from · comparisons. . $895.00 . I wh,lttled ~he: number of passes down significantly. (to 10MB System ,about 355 .x. ~55 x 355) 'wp.ich, made' the. times at least Only $1645.00 workabl~.. . , . . . :,, ... ·' ' ... ··: ... :. Peter .Casey (the C instructor who· suggeste.d. .the problem) tried running his brute force version on the college's PDP 11. After an overnight grind and no • Ready-to-use professional CP/M. • Comprehensive Software Included: computer system • Enhanced CP/M operating system solutiqn he gave up'. (they charge his account ~or ~ach • Works with any RS232C ASCII with ZCPR3 minute of Cf.Utime). ,, · · · · · · terminal (not included) • Word processing, spreadsheet, . , I tol

Boots IBM PC-DOS fnot Included)

Puzzles Speaking of puzzles, we're getting a delightful number of really interesting responses to the puzzle in The Culture Comer in Issue . 29. Again, see The Culture Comer for the solution to our insolvable product. One intrepid soul found the solution. in under 27 min. 12 sec. using only paper and pencil. (Definitely not artificial ·intelligence.) I'm looking for more such problems that we can solve.

We received one for this issue, but we definitely want • Three times the COMPUTING POWER of • SCSI/PLUS'" multi-master 1/0 more, more, more. Look, in my spare time I'm either a PC expansion bus • Data and File Compatible with IBM PC, • Software Included: solving puzzles or making the editorial longer. It's your runs "~generic" programs • PC-OOS compatible ROM-BIOS boots choice. • SMHz 80186 CPU, OMA, DOS2.xand 3.x Counter /Timers, 128/512K RM\ zero • Hard Disk support wait states, 16-128K EPROM •OPTIONS: The Real Winner • Mini/Micro Aoppy Controller • Expansion board with: (1-4 Drives, Single/Double Density, • 128 or 512K additional RM\ Meanwhile, my brute force solution pointed out the 1·2 sided, 40/80 track) ' • 2 Sync/~c RS232/422 value of a good floating point co-processor. National' s • 2 RS232C Serial Ports (50 ·38,400 serial ports baud), 1 Centronlcs Printer Port • Battery backed Real Time Clock floating point chip is obviously the fastest thing since the • 8087 Math Co-Processor • Only 5.75 x 7.75 Inches, mounts • Buffered 1/0 Bus Turbo Porsche. (What, another Borland product?) directly to a 5· 1I4• disk drive • STD Bus Adapter On the other hand, you can add a crystal, a V20, and • Power Requirement: +5VDC at 1.25A; +12VDC at .05A; On board -12V • Utilities source code an 8087 (get the 8MHz version) to a pokey little clone and converter • TurboDOS I Networklng do quite well. Oust be sure that the compiler you're using supports the 8087.) Also, take a look at Trevor's article in this issue for information on Motorola's new 68881 BOOKSHELF™ ~'litl~ 200 floating point co-processor. Fast, compact, high quality, versatile PC·DOS system Anyway, you can see why the OSI board has been so Three times the COMPUTING POWER ot a PC popular with the universities. Research data is usually of Priced from the floating point variety, and crunching floats is usually either slow (in software) or expensive. · · $1295.00 In fact, one of the reasons IBM chose the 8086 series for 10MB System the PC was the availability of the 8087. Though Motorola Only $1945.00 has had the 68000 out for a· long time, it has had a devil of a time making the 68000' s math chip go. (Math chips are about three times as complex as their CPU partners.) • Data and File compatible with IBM Software Included: PC-OOS 2.x and 3.x • PC·DOS Compatible ROM-BIOS boots • Runs "MS-OOS generic" programs DOS 2.x and 3.x Time (Dbasc II, Multlplan, Wordstar, • Hard Disk Support Supercalc 2, Turbo Pascal, Fortran 77, • T/Maker Ill -Word processing, Speaking of system speed, I've recently discovered that Microsoft C, Lattice C, IBM Macro spreadsheet, relational database, time is only relative (my mother,· who is about as relative Assembler, Intel compilers & tools, spelling checker, and data GN Basic, etc...... ) encrypt/decrypt as anyone I know, has no doubt mentioned this to me • WorkS with any RS232C ASCII terminal from time to time). It turns out that when you speed up· (not Included) Expandable: • Compact 7.3 x 6.5 x 10.5 inches, • Floppy expansion to four drives · (continued next page) 12.5 pounds, all metal construction • Hard disk and tape expansion •Based on Little Board/186 • SCSI/PLUS'" multi-master 1/0 • 512K RAM,no wait states expansion bus • Two RS232 serial ports • One Centronlcs printer port Figure 1 - Puzzle Solution Times • One or two 360 Kb floppy drives • 10MB Internal hard disk drive option DISTRIBUTORS System time to solution: FP proo.? ARGENTINA: FACTORIAL, SA, (1) 41·0018, MICROCOMPUTERS, (613) 500-0628 min 12 aeo yes nx 22408 BELGIUM. CENTRE BRAZIL: CNC·DATA LEADER lJDA., DSI-32 27 EL£CTRONIQUE LEMPEREUR, (041) 23-4541, ( 41) 262-2262, TlX 041-6364 DENMARK: XT-186 8HHz 186 9 hrs 43 min no nx 42621 CANADA: DYNACOMP DANBIT, (03) 66-20-20, TlX 43558 7.33 HHz V20 2 hrs 56 min yes COMPUTER SYSTEMS lJD., (604) 872-7737 FINLAND: SYh'IMETRJC OY, (0) 585-322, 7.33 MHz V20 15 hrs 49 min no ENGLAND: QUANT SYSTf.MS, TlX 121394 ISRAEL: ALPHA TERMINALS, 4.77 MHz V20 4 hrs 31 min yea (01) 253-8423, TlX 946240 REF:19003131 lJD, (3) 49-16-95, TlX 341667 SWEDEN: 4.77 MHz V20 24 hrs 19 min no FRANCE: EGAL+, (1) 502·1800, TLX620893 ABAKTA, (08) 54-20-20, TlX 13702 USA: 4.77 MHz 8088 41 bra · SPAIN: XENIOS INFORMATICA, 593-0822, CONTACT AMPRO COMPUTERS INC., 18 min• no TlX 50364 AUSTRALIA: ASP TEL: (415) 962-0230 TELEX: 4940302 • The 8088 1 s time was calculated from its perrorm­ IBM®, IBM Corp.; 80186®, Intel, Corp,; TurboOOS®, Software 2000, Inc, Dbase II®, ance relative to V20 in a similar (but much shorter) Ashtorl-Tate; Wordstar®, Mlcropro, Inc.; program. There's a limit to the amount of perverse Superc:alc2®, Sorcim, Inc.; Turbo Pascal®, pleasure I can stand. Borland, Intl, Inc.; Microsoft C®, Gill Basic®, ~Fl=ICI Multlplan®, Microsoft, Inc.; l.4ttlce C®, COMPUTERS. INCORPORATED Lattice, Inc. 67 EastEvelYnAve.• MountainVlew.CA94041 • (415)962·0230· TELEX4940302 MICRO CORNUCOPIA, #30, June-July 1986 91 E X p A N D EDITORIAL ·YOUR Productivity (continued from page 9?) c~I~ ~Sb. Os an XT clone you also speed up its clock - that is, the New: The NEC V-20 improved 8088 Microprocessor hours; minutes, and seconds variety. (Smlu) - 10-45% increase in speed - just plug it in Some people have called and complained: "Hey, the -MS DOS only ...... $25.00 time isn't right any more." (Only. the system clock speeds . up - a battery-backed real-time clock will be Increase Memory ••• oblivious to the change.) 1. Kaypro 16 256K-512K Memory.Expansion ...... $69.95 What they're really saying is .that time is different, Ws 2. Kaypro PC 256K-640K Memory Expansion ...... $69.95 Both are simple plug-in installations; includes public domain RAM faster. Stop for a (6.67MHz) moment and consider the Disk software and other utility programs possibilities. · Let's say you have an 8-:-hour per day job compiling Increase Visibility ••• software. All you have to do is speed up your system 1. Composite Video Generator adds standard composite monitor and use it for both your compilations and to keep track of to a Kaypro II or IV ...... ~ $44.95 your time. You'll get the same amount of compilation 2. Composite Video Generator adds an unmodified composite done, but the day will go faster. monitor for Kaypro 1, 2-84, 2X, 4-84, 10 ...... ~$84.95 3. External Monitor Adapter adds a TIL monitor to a Kaypro 1, With your system running a mere 6.67MHz you could 2-84, 2X, 4-84, 10 ...... : ...... ~$44.95 be out enjoying the outdoors in under six (4.77MHz) hours. With a 23MHz RISC processor, you might just Increase Programming Tools ••• have time for one pass and lunch (1 hr, 39 minutes) 1. Color Graphics Board gives 16 colors, 32 sprites w/bit-mapped before streaking home. graphics; r~quires external monitor or TV; for any CP/M Kaypro Of course, you couldn't have your timer running at ...... ~$130.00 2. Deluxe TLC Logo "turtle" graphics language; for use with color 23MHz all the time. After all, two-hour movies would graphics board ...... $129.95 last about four commercials and a station break (some­ 3. Color Board and Deluxe Logo package ...~ $179.95 times that happens already). Weekends would take about 4. Instant Grapher 2.1 gives labeled bar and line graphs; prints 10 hours flat. (I wonder what effect this would have on separate pattern for each color; use with color board only the space-time continuum.) ...... ~$29.95 So. you need two systems - a fast one for work, a 5. Standard TLC Logo "turtle" graphics language uses internal really_. slow one at ·home, which probably .explains· why graphics of Kaypro 1, 2-84, 2X, 4-84, 10 ...... -~ $79.00 Apples have been so popular as home computers. · Increase Speed •.•• 1. Electronic RAM Disk and Printer Buffer Combination - the PROLOG ultimate add-on for Kaypro I, II, IV, 2X, 2-84, 4-84 & 10 computers. Borland has been developing PROLOG for the last 2 1/ No longer will you need to wait for your Kaypro to slowly finish 2 years, and it's been the best kept secret that I haven't mundane tasks such as running a printer or waiting for floppy drives to been privy to. I pride myself with keeping my ear pretty turn when you have better things to do. close to the ground (so _moles can whisper in it) and all Tested RAM Disk without RAM chips .. ·.. ·~·.. !... . . $245.00 I'd gotten on this one was a dirty ear canal. · . . 256K RAM Disk ...... , ...... $295.00 Anyway, one week Philippe called AI "so much bunk 512K RAM Disk .... ~ ... : . ... ·~·...... $345__~00 768K RAM Disk ...... $395.00 and rubbish" and the next week he announced PROL­ lMB RAM Disk ...... $445.00 OG. He figures he'll sell ten times as many copies of * Prices include all installation materials except for PlO Adapter PROLOG as Pascal. That means about 5 million copies! Board required for Kaypro 10 w I out an external modem and optional At $100 each! on 1, 2-84, 2X, and 4-84. 2. Kaypro II to IV Upgrade includes 2.5 Mhz to 5 Mhz speed up, AI . two 390K disk drives (DSDD) to replace the single sided drives; price Much of the problem with AI is that people have does not include shipping...... $395.00 expected too. much. Even the name has something magically unreal about H. If it's going to be magic, let's WITH Parts NOW INCLUDED RAM DISK:· make really good magic. Let's have! AI understand the layout, schematic and instructions to build a battery spoken word (even though humans can't do that after back-up power supply for the RAM Disk. · years of training). . With Al, computers should be able to solve problems (such as playing chess) more efficiently as they learn to CATALOG and COMPLETE DESCRIPTIONS AVAILABLE deduce specific responses from general rules and create . lOO's OF SOFTWARE LISTINGS FOR CP/M NOW AVAILABLE general rules from more specific experiences. MicroSphere, ·Inc. Of course, anyone who's seen 2001 knows exactly what P.O. Box 1221 AI will be able to do . 1 . Bend, Oregon 97709 y,- 151 "Hello, David. How are you today?" 503-388-1194 92 MICRO CORNUCOPIA, #30, June-July 1986 • Watch your mailbox ...

'I'm fine, Hal.' "Does that mean that you had no parity errors this morning, Dave?" 'Not that I can recall, Hal.' Our expectations for smart computers have come from the science fiction writers, and the writers have, so far, avoided the fetters of reality. When reality intrudes, Al has problems. In real time, we're limited to poking around the edges. The computer needs senses and it needs a method· for thinking. For the senses, we are working on speech recognition, pattern recognition, odor detectors, ultrasonic positioning information, etc. For the thought, we are using languages like PROLOG to create giant condition tables.

If this is Wednesday, and I'm still with the tour group, ... for and a car bomb hasn't blown up my hotel, ,,''the new and our plane wasn't hijacked, then Micro C this must be Dallas. Catalog But thought? No. Computers aren't really thinking. At least not like people. And cognition isn't something that will be solved by more speed or more memory: It will be If you are a subscriber or have ordered solved when cognition understands itself. recently you'll be receiving the new catalog. If you don't receive one give us Where To For Micro C? a call. MS-DOS people complain that we're still just a CP/M magazine. CP/M people complain that we've become another PC rag. Well, we're a CP/M magazine becoming an 8086 magazine, a 68000 magazine, a hardware maga­ Including these new MS-DOS disks: zine, a software ·magazine, an AI magazine, a fun MS-20 From The Pascal Runoff (1) magazine, a serious magazine, and a CP/M magazine. Foreign language vocabulary builder, fractal geometry graphics, And through it ·all we'll remain a build-it~ prod-it~ poke­ and hard disk tree directory programs (all with source). around-in~it, SOGing, arid puzzling kind of journal. MS-21 Small C and C Windows C compiler with source and 2 window building programs with SOG source. Meanwhile, if you're coming to SOG V, great. You'll MS-22 Dynamite Utilities be in super company. Calls and letters are pouring in CP/M emulator, Turbo Pascal inline & resident building programs (with source), step rate mod for drives, and the secret system. from prospective attendees. The event is free and it's really the J_ligh point of our MS-23 EXPRESS Laine and Cecil Stump's speedy little programmer's editor (best year. I hope you'll plan to join us. See the SOG page ·in editor deal in the public domain). this issue for more information.

Micro P.O. Box 223 ••• Cornucopia Bend, OR 97709

Order #503-382-5060

MICRO CORNUCOPIA, #30, June-July 1986 93 Fast Step Rate For PC Disk Drives By Larry Fogg Micro C Staff

Anything worthwhile requires ef­ tents of the step rate nibble is -to enter More Experiments fort. In this case, however, Larry has a little assembler routine with DEBUG. I've read that altering the. head set­ found something very worthwhile that See Listing 1 ·for this procedure. tling time can: improve disk perform­ requires almost no effort at all. So, Note that the segment has· been ance, but -I saw no change at all using stepping right along ... - shown as????, because DEBUG choos­ a range of values from 0 to 40. es a value for CS which will vary Try experimenting with head settling according to the configuration of your and other parameters -- in the DPT as system. It's not really important what well. With a little creativity you can n recent issues we've shown how that value is.--Also, don't add a trailing get yourself into all sorts of trouble. to speed up the disk drive step rate 'h' to any numbers. DEBUG assumes (What fun would it be otherwise.) So I for CP/M Kaypros. Now it's time hex values and will be offended by there you have it - quick, quiet drives for a Personal Clone version. But first, your attempts to be explicit. Once the without the need to molest your hard­ put down those soldering irons! This program has been saved it can be ware. is a job for software. added· to your AUTOEXEC.BAT file for execution on cold boot. Why Bother? • •• There are two benefits from chang­ ing the step rate. The obvious one is faster disk accesses. The CRC of a full Listing 1 - Assembler Routine disk went five percent faster when I cut the step rate from Bms to 4ms. B>DEBUG But just as important is quieter drive -A invoke DEBUG's assembler ????:0100 XOR AX,AX set AX register to O operation. The neighborhood dogs ????:0102 HOV DS,AX data segment starts at 0 used to surround my house and howl ????:0104 HOV BX,522 522 is the offset of the DPT at the drives as they ground their way ????:0107 HOV BYTE PTR [BX],EF move new step ~ate (4 msec) into DPT through long compilations. Now I can ????:010A INT 20 return to DOS - nap contentedly at the keyboard dur­ ????:010C here exits assembler mode ing even the wildest disk activity. -HFASTSTEP.COM name file and set up FeB -RCX ex register must get file length ex 0000 current value in ex DPT Surgery :C change to e (file is e bytes long) · In order to change the step rate -W ' write the file to disk - · you'll need to perform a little surgery Writing OOOC bytes on the disk parameter table (DPT). -Q quit DEBUG This table contains a wealth of infor­ mation on disk drive characteristics (see Table 1 for a complete descrip­ tion). Table 1 - Disk Parameter Table -The ffrst nibble ( four bits ) of the DPT determines the step rate. Hex Byte Action IBM Value values of C, D, E, and F give _step rates of 8, 6, 4, and 2ms. 1 high order:step rate low order:head unload time CF Presumably a value of G would yield 2 high order.=head load time low order:mode (DHA) 02 3 delay for turning motor off ' 37 a Oms step rate and the fastest drives 4 sector size in bytes ( 0:128 1=256 2=512 3=1024 ) 02 in town. Bms is used by both the IBM 5 last sector number on a track OB BIOS and the Z-NIX BIOS which came 6 gap length between sectors 2A with my clone. Teac 55BVs will run at 7 data length FF 8 gap length for use in format 50 4ms while Mitsubishi 4851s are happy 9 fill byte ( written to disk during format ) - F6 all the way down to 2ms. Experiment 10 delay for head settling ( in milliseconds ) 25 with your drives to find the best step 11 delay for m~~or start-up ( in 1/B seconds ) 04 rate. The easiest way to change the con-

94 MICRO CORNUCOPIA, #30, June-July 1986 DISK DRIVES 3.5" EPSON SMD 100 ••...... •..•.• $89.00 - DOUBLE SIDED, 1 MB UNFORMATTED - HARDWARE COMPATIBLE WITH 5-1/4" 96 TPI DRIVES - WITHOUT FRONT PANEL SPECIAL OF THE MONTH 5-1/4" OKIDATA HALF HEIGHT...... $89.95 -48TPI 80286 (8MHz) - DOUBLE SIDED 95 - 360 KB FORMATTED CAPACITY $ 4 9 • Regular Price $99.00 --~ - IBM COMPATIBLE LIMIT 2 PER PERSON 5-1/4" OKIDATA 1/3 HEIGHT ...... $89.95 SOCKET FOR ABOVE $7.50 -48TPI - DOUBLE SIDED - 360 KB FORMATTED CAPACITY - IBM COMPATIBLE 5-1/4" TEC FB504 ...... •....•... $95.00 - 96 TPI HALF HEIGHT IBM* COMPATIBLES - DOUBLE SIDED All of our IBM* Compatible Products were carefully tested : - 720 KB FORMATTED CAPACITY and chosen for full compatibility. -QUIET! - RUNS ON IBM XT WITH J FORMAT FLIP TOP CASE ...... $ 49,95- SOFTWARE (NOT SUPPLIED) . 130 W POWER SUPPLY ...... $ 89.95 8" SHUGART SA801 R ...... $179.00 150W POWER SUPPLY ...... $ 99.00 - FULL HEIGHT . KEYBOARD DKM 2000 ...... $ 79.95 - SINGLE SIDED . - 600 KB FORMATTED CAPACITY KEYBOARD KB 5151 (Enhanced) ...... $ 99.00 - BRAND NEW! NOT RECONDITIONED 640K XT* MOTHERBOARD (OK RAM) .. $159.00 BIOS ROM (SIDEKICK COMPATIBLE) .. $ 29.95 .MULTI 1/0 WI FDD CONT ...... $129.95 COLOR GRAPHICS CARD ...... $ 99.95 TELEVIDEO TS804 MONOCHROME CARD ...... $119.95 Main Logic Board ...... $75.00 MULTIFUNCTION CARD ...... $129.95 - CP/M 4 USER COMPUTER • FLOPPY CONTROLLER ...... $ 49.95 - COMPLETE WITH ALL IC'S & RAM .· ·. - TESTED GOOD : HARD DISK CONTROLLER ...... $175.00 INTERNAL 1200 BAUD MODEM ...... $199.00 TELEVIDEO TS1603 'H ·H~!c · 2 MB RAM EXPANSION FOR XT* ...... $199.00 Main Logic Board ., ...... ~ .. $75.00 · 3 MB MULTIFUNCTION CARD FOR - CP/M 86 OR MS-DOS COMPUTER IBM AT* WITH OK RAM ...... $225.00 - COMPLETEWITH ALL IC'S & RAM EPROM PROGRAMMER (27xxx) ...... $129.95 - TESTED GOOD EGA CARD (IBM* COMPATIBLE) ...... $295.00 'XT, AT and IBM are Registered Trademarks of International Business Machines Corp. HALTED SPECIALTIES otters unique super­ market style shopping for your electronic needs. We stock ACCESSORIES thousands of parts, from the newest IC's to some of the first Parallel printer cable ...... $ 9.95 transistors. We also have computer accessories and test Swivel monitor stand ...... $12.95 equipment. Y power cable for disk drive ...... $ 2.95 3 Convenient Locations NEC V20 processor 5mhz. (8088) ...... $19.95 HSC Electronic Supply Halted Specialties 5549 Hemlock St. 827 E. Evelyn Ave. NEC V20 processor 8mhz. (8088) ...... $24.95 Sacramento, CA Sunnyvale, CA (916) 338-2545 . (408) 732-1573 4164 150 ns 64K ram chips ...... 9 for $1O.71 HSC Electronic Supply of Santa Rosa 41256 150 ns 256K ram chips ...... 9 for $31.41 (Opening May 31) NEC V30 processor 8mhz. (8086) ...... $25.00 6819 S. Santa RosaAve. Cotati, CA (707) 792-2357 8087 math coprocessor ...... $139.00 ·HALTED SPECIALTIES co., INC. ['.~I 827 E. EVELYN AVE. SUNNYVALE, CA., 94086 , . {408)' 732-1573 Store Hours: In Sacramento Call Mon.-Fri. 8:00-7:00 (916) 338-2545 Iii WE SHIP C.O.D. Saturday 9:oo-s:oo TERMS: Minimum order $10.00. California residents add 6-1/20/o sales tax. Prepaid orders sent freight C.O.D. or call for charges, shipping will be · added tb ·credit card and C.O.D. orders. Prepaid orders~over $100.00 use· mo'ney order or certified check. Please do not send cash. Some items limited to stock on hand. Pric;es subject to change. Big Board II Tips Kaypro Cursor Location program· to load the value, will do the I've made a couple of changes to my We recently got a call from Richard trick. · BBII that other readers might find Hudson wanting to know how to find (For those of you with Pro 8s on interesting. the cursor value storage location on your system, the cursor change is The first problem I had was with the his Kaypro II and then alter the cur­ easy; Type Esc C followed by the · power-on reset. Half the time on pow­ sor . character you·want for the cursor.) . er up (or if there was a glitch in the Here's what we suggested: find the Richard wrote back to us a short power line) the processor wouldn't storage location for the cursor type time later to say that ·he'd found the reset properly. To make things worse, using DDT; change the value with storage· location at FE91h (this is true the reset button didn't work either CONFIG 83; then go back and look at only for a standard Kaypro II BIOS). .due to the lack of an Ml cycle. So I that location. If the value hasn't Poking 1Fh restored the block. He also · decided to fix it once and for all. changed, you weren't at the right me~tioned that much of the new pub­ The circuit diagram shown below address. (This is obviously a hit and lic· domain software seems to alter his was built in the bread board area of . miss technique.) If the value has cursor. the BBII. The main feature is that the changed, a short BASIC program to Micro C Staff TI7705A senses the + 5V line and poke the cursor value, or an assembler doesn't start its delay until the + 5V line is > 4.75V. Also, if it drops below 4.75V, the chip will start a reset cycle. Figure 1 - New Big Board II Reset Circuit ·Since I installed this circuit I have not had a single problem. While I was at it, I also modified the ADDED Cl RCUITRY . ORIGINAL BB II CIRCUITRY clock circuit a bit. l changed U19 (a +sv 74LS04) to a 74HC04. This cleaned up +sv +5\! the drive waveform tremendously and . decreased its rise time due to the 10K larger dynamic range of the CMOS 8 part. 2 5 11 I Ken Carlson OPT HARD U17 TL7705A I 4711F RESET ,, 1206 SE 140th Ave. ·1 REMOVE Vancouver WA 98684 3 I. . ~ :.::·· I I·1f1F:I ':" I I

25th Line Blues Fix Figure 2 - Status Line Maintenance Program After installing the Pro-884 and the 8" drive adapter board in my Kaypro ;This program will clear'the 25th line on 4-84, and enabling the 25th line for ;the Kaypro, aMd rest6r~·the date-ti~e display. time and date, I noticed that for ; Cal 1 it on exit from •iarious programs. approximately 15 minutes after turn Version 1.0 Written by on, the 25th line randomly filled with 12 Sep 85 · E.J. Pierce graphic characters. After 15 minutes ; everything worked okay (obviously ESC EQU 1BH BDOS EOU 5 heat related). ; My solution? Using a heat gun and a START ORG 100H can of quick freeze, I found that the MVI C,9 ;save cursor position 1st octal latches U13 and U14 were the LXI D,SAVEC CALL BOOS culprits. They are located on the main MVI C,9 ;console out board near the rear left corner. They' re LXI D,CMSG :;the clear routine both 74LS373s and cost about $1 from CALL BDOS ;do it! JIM-PACK. MVI C,9 .; restore cursor LXI D,RESTC The small program shown below will CALL BOOS clear and restore the 25th line at any JMP 0 ;return time. ; CMSG· DB ESC,'C7',£SC,'B7',ESC,'BB','$' Edward J. Pierce SAVEC DB ESC,"B6','$' 310 Hemingway Dr. RES TC DB ESC,'C6",'$' Bel Air MD 21014 ;so be it.

96 MICRO CORNUCOPIA, #30, June-July 1986 PROGRAMMER/4+

CP/M Turbo Pascal V3.00A Patch Tired of saying YES (or NO) to Turbo's "Include error messages (YI N)?" If you are, then use this patch to have Turbo always (or never) load the TURBO.MSG file. Use DDT to load a copy of your compiler (TURBO.COM) into memory. Then simply change the three bytes at locations 222Ch-222Eh. To have Turbo always load the error messages, change as follows: . 222C CD-> AF 222D 21-> 3D 222E 2D -> 00 To have Turbo never load the error messages, change as follows: 222C CD-> AF 222D 21 -> 00 222E 2D -> 00 Then exit DDT and do a ''save 121 ". After you verify that the change works and the compi­ ler is intact, rename the file "TUR­ BO.COM" for your working disk. A LOW COST ALTERNATIVE D.K. Smith TO EPROM PROGRAMMING 1747 Attridge Rd. Reads and program~ 2716, 2732, 2764, and 27128 EPROMS. Churchville NY 14428 Reads 2-16K ROMS. Direct connect to any RS232C terminal or computer. Plug selectable as either a data set or data terminal. All voltages made on board, (no power supplies needed). (User supplies power Xformer, 25.2 to 30 VAC C.T.l Amp.). Fixing 1 Meg RAMdisk Power electronically switched, (can't damage EPROMS). The new Bl/820-lM one megabyte Zero insertion force socket for EPROM. board for the Big Board recently adver­ Programs, verifies, and dumps in both ASCII and hex. tised by Jim Ferguson in Micro C Edit buffer (like DDT). doesn't work as shipped. If you write Saves hex and/ or image files to and from disk. a byte at 4000H, for example, it will Saves or loads all or partial buffer. read back at BOOOH, and so on for Completely menu driven for ease of operation. other banks. There is a pin inversion Commands of Test, Read, Display, Save, Load, Program and more. Check sum calculation. on the schematics and on the printed All software on disk including well commented source code. circuit board at (U43-4, U43-5), (U46-4, Detailed owners manual including schematic U46-5). All chips socketed. ·,,:i1··. For U43 and U46: RA is pin 5, RB is Not a kit! Completely built and tested. pin 4. To correct the problem, do the 48 hour dynamic burn-in and test bef or~ shipment. following: 90 day limited warranty qp parts and workmanship. 1. Cut the trace on top of the board, 24 hour ret4rn policy on repairs. from U44-9 to the hole. Delivery frqJTI st9ck. 2. Cut the trace under the board, PROGRAMMER 4+ WITH OWNERS MANUAL AND DISK. $199.95 from U44-11 to the hole. M$-DOS DISK ONLy $is.oo . ' 3. Jumper (under the board) U44-11 to the hole that· was going to U44-9. Order froTT1 4. Jumper (under the board) U44-9 to ~peripfico. '',: the hole that was going to l,J44-11. ,,,,.~ a3) 1_659$coh. Blvd~ 1 Suite 1 Note that this new board, as well as ~I . Sa.nta Cl.ara, CA 95050 354-5084 . . the old 256K board, works perfectly at u . (40~) 6MHz with 150ns DRAMs. VISA and MASTERCARD telephone oraers welcpme. Guy Royer Please specify Disk format. 2828 Le Noblet CP/M 8" IBM format, KAYPRO II, XEROX ?20, OSBORNE I, others. Sainte-Foy Quebec Canada GlV 2E7 . Ple.ase specify method of shipment, UPS or Postal SerVice . ••• California residents add 6'>o Sales Tax. Dealer Inquiries invited.

MICRO CORNUCOPIA, #30, June-July 1986 ·97 By Gary Entsminger But It's On That Disk, I Know It!

File Recovery In MS-DOS Track 0, Side 1, Sector 6, the first limited (it only recovers text), it solved Every now and then, no. matter how sector of the directory, was shot, my probl~m. . . , conscientious I think I've been, I for­ caput~. incapacitated, out-to-lunch. It When it finds text, SSAR transfers it get to back up a working disk. Most was no laughing matter. to a special file on a disk in drive b. recently, my forgetfulness began to The problem is that most programs The transferred data is marked with haunt me just after I'd accumulated a capable of reading disk sectors suc­ sector and end-of-file ·boundaries, dozen articles for this issue of Micro ceed only when they can access direc­ making it easier to reconstruct files. c. tory or file allocation data, and that So I put it to work, and 25 minutes Naturally, I didn't know I'd been was precisely what I didn't have. later (yes, it does take time. to recover forgetful (negligent is too strong a I needed a program which bypassed from forgetfulness) I had a text fµe word!) until my disk failed to respond the directory and file allocation table 2271< long ready for editing. · to a prompt. "Disk error reading drive and checked each sector directly. For­ Relieved? You bet I was. B:", DOS reported. "Abort, Retry, tunately, I found just the program (if For more information contact - Ignore?". I tried all three with equal I'd had to write a program to rescue success. my text, Issue #30 would have un­ Peter Norton Then I tried several utilities (DE­ doubtedly followed #31). 2210 Wilshire Blvd BUG, EASY-ZAP, CHKDSK) and SSAR (for Special-Search-And-Re­ Santa Monica CA 90403 equalled my previous success, con­ covery) came to my rescu:e. It's one of 213-349-3948 cluding that I had a problem. the Norton Utilities, and although $50 (whole set) MODULA-2 CP/M, MS-DOS EPROM DEVELOPMENT BUILDING BLOCKS PROGRAMMING SYSTEM REPERTOIRE, from PMI. High-performance tools. 2708 2732A Screen display system. Multi-window editor. 2758 2764A Full source·, so your programs can 2516 27128 follow when you change machines. 2716 27128A 2732 27256 Screen System. 2764 27CXX REPERTOIRE won't bloat your programs because it doesn't generate code. Create screens exactly as they will look, then compress them into one dense, rapid-access file. REPERTOIRE - SOPTWARS AVAJLABLB POR CP/M-~? CP/M-86 AND MS-DOS SYSTBMS - STAND AWNS BOARD - BLBCTRVNIC1 SWITCHING OP SPROM TYPBS lets your program display a screen instantly in any window with a - USBS 24 VOLT XPMR POR POWBR - ALL SUPPLIBS/TIMING ON BOARD single function call. Screens check user input, scroll within - NO PBRSONALITY MODULSS TO BUY - LARGB COMPRGHBNSIVS MANUAL windows, give context-sensitive help, and conditionally. branch to * * PARALLEL PRINTER INTERFACE * * other screens using natural-language analysis functions that you CONNBCTS TO ANY PARALLBL PRIN1'8R JNTSRPACB - USSS B OUTPUT imbed in the screens. DATA BITS AND ON8 INPUT DATA BIT (BUSY (,INS) BUSY LINS IS A HIGH SPBBD SSRIAL INPUT. PULL BPROM RBADING AND PROGRAMMING. Editor. UNIT MAY ALSO BB CONNSCTBD TO ONB 8 BIT INPlfl'/OUTPUT PORT. REPERTOIRE's full-screen multi-winaow editor fits neatly into * * CONTROL P.ROGRAM COMMANDS * * your programs. It lets your users create and edit multiple files - PROGRAM BPROM(S) PROM DISK - SAVB BPROM{S) TO DISK concurrently. - RBAD DISK PILB IN'fO RAM - PROGRAM BPROM(Sl PROM RAM - RBAD BPROM(S) INTO RAM - COMPARS BPROM wrm RAM - VBRIPY BPROM IS BRASSD - COPY BPROM High-Performance Low level Routines. - DISPLAY /MODIPY RAM - (MONITOR MODBl WITH 11 SUB COMMANDS REPERTOIRE provides improved DOS and BIOS access, PILL-DUMP-XPBR-BXAMINS-MODIPY-BIAS-·PROGRAM-VE'RIPY, BTC.) speaker control, string tools, list handling, and a sample ------directory manager. ~6~n~~~M1~t~ s~t~~i~d ~~6r~Ws~·T8 --> $199 PARTS KIT WITH SOPTWARB AND DOC->$179 PCB,SOPTWARB .I. DOC->$69 Excellent for educational software or any other screen-intensive SOPTWARB ON 0 .I. 5 1/4 DISK POR KAYPRO, OSBORNB, IBM .I. OTHBR PMTS application. For IBM compatibles. Manual and two 360K ------TO ORDBR S8ND CHECK, MONSY ORDSR, WRITS OR CALL .diskettes. Logitech & ITC versions, $64 each. Both versions for ANDRATECH . $84. Check/MC/VISA. Send for FREE documentation and · P.O. BOX 222 demo disk to find out more. MILFORD, OHIO 45150 •ll 114536 S.E. 50th Portland, OR 97206 (503) 293-7706 (513) 752-7218 . 1 Y..IJ MCI Mail: PMI; Compuserve: 74706,262 CALL OR WRITS POR MORB INPORMATION -- ADD $4.00 POR SHIPPING. P OHIO RBS. ADD 5.5% TAX -- VISA/M.C. ACCBPTBD -- $3.00 POR COD

98 MICRO CORNUCOPIA, #30, June-July 1986 SOFTWj\RJS

Metamagical Themas • Only $49.95 plus shipping. If you haven't read a Douglas Hof­ • 8080 to Z80 Source Code Converter. stadter book or article, you're missing • Generates Microsoft compatible REL files or INTEL compatible hex files. out. • Compatible with Digital Research His Pulitzer Prize winning ''Godel, macro assemblers MAC & RMAC. • Generates Digital Research Escher, Bach" turned heads back in compatible SYM files. '79, with a blend of philosophy, wit, • Conditional assembly. • Phase/dephase. and humor encompassing a range of • Cross-reference generation. subjects from the structure of DNA, • Full Zilog mnemonics. •INCLUDE and MACLIB FILES. self-reproductive art, incompleteness • Separate data, program, common, theorems, the Turing machine, and and absolute program spaces. artificial intelligence to fugues, coun­ •Supports Hitachi HD64180. • Z80 Linker and Library Manager for terpoint, and poetry (including limer­ Microsoft compatible REL files icks). available as an add-on to Assembler. His most recent book, ''Metamagical Themas,'' is equally intriguing, de­ T9. ~RDERt CALL TOLL FREE: PRICE LIST i: .. · : 1-800-367-5134; ext. 804 ZSO Macro Assembler: $49. 95 · spite an almost presumptuous subtitle, Forinfqrrpation or technical assistance: Assembler, Linker, and Library Manager:$95.00 . . (808) 623-6361 Manual Only: $15.00 · · ''Questing for the Essence of Mind ZSO Symbolic Debugger: $49.95 and Pattern.'' Specify clesired sw• or a·• format. Personal Manual Only: $15.00 · chec~ c~hier's check, money order, VISA, MC, Assembler, Linker, Library Manager, and Debugger: Three chapters in particular should · · or COD welcomed. $134.95 appeal to the would-be (or already Include $5 tor shipping and handling. groomed) computer guru - LISP: At­ oms and Lists, LISP: Lists and Recur­ P. 0, Box 2151 Honolulu, HI 96605 sion, and LISP: Recursion and Gener­ ality. Together they compose a tidy and stimulating introduction to LISP, A.I. you bottom out at the embryonic case ... (TVC, a sophisticated debugger) simu­ (from a programmer's perspective), Now, I'll have td admit that you have to lates the PC's processor, taking you and recursion. Here's a bit of his wit keep track of where you are in the process, inside the 8088 as it executes pro­ in an explanation and solution of the and that may be a bit tedious - but that's grams. An attractive display of a half Towers of Brahma (or Hanoi) puzzle. merely bookkeeping. In principle, you dozen windows allows you to monitor "In the great Temple of Brahma in could actually carry out the process - if CPU registers, memory, flag status, Benares, on a brass plate beneath the dome you were bent on seeing the world end!" and instruction execution simulta­ that marks the Center of the World, there It's 800-plus pages of structure and neously. are 64 disks of pure gold which the priests strangeness from Basic Books. $24. 95 A variable step rate function lets you carry one at a time between three diamond in H/C. determine the rate of execution (so needles according to Brahma's immutable you don't have to miss an iota of law: No disk may be placed on a smaller Pascal Runoff Take 3 micro code). And a command line disk. In the Beginning of the World, all 64 Of course you're not going to be­ allows you to interrupt and direct disks formed the Tower of Brahma on one lieve it, but we omitted another Pascal simulation with a keystroke. needle. Now, however, the process of Runoff entrant . The book. is an excellent 350-page . transfer of the tower from one needle to Frank Jones was indeed a bonafide introductory (assumes nothing) text the other is in midcourse. When the last participator, and his program, NFI­ written with wit and style (it even disk is finally in place, once again forming LELST, was considered and judged makes segment addressing sound the Tower of Brahma but on a different along with the 126 other entries. easy). needle, then will come the End of the It's just that, well, we have serious And once you've gotten the hang of World, and all will turn to dust. trouble keeping up with slips of paper assembler, you can use TVC to debug "Earlier I pointed out that recursion is (especially ones with names on them) sophisticated programs (most of the evident enough: to transfer 64 disks from around here. (Obviously, no one sub­ commands and capabilities· are com­ one needle to another (using a third), it mitted a Pascal Runoff Contestant patible with DEBUG). suffices · to know how to transfer 63 disks Name Preservation and Organization In short, ''The Visible Computer: from one needle to another (using a third). Program.) 8088'' is a winner; we highly recom­ ''Now someone might complain that I Sorry, Frank. mend it. left out all the hard parts: magically For more info contact - assuming an ability to move 63 disks! So The Visible Computer: 8088 Software Masters Costs $79.95 it might seem, but there's nothing magical This is it - the best 8088 assembly 2714 Finfeather about it. After all, to mqve 63, you merely language tutorial we've encountered Bryan TX 77801 409-822-9490 need to know how to move 62. And to (almost too good to be true). And that, friends, is all the Tidbits move 62, you merely need to know how to "The Visible Computer: 8088" is a fit to bite into this issue. move 61. On it goes down the line, until program and a book. The program •••

MICRO CORNUCOPIA, #30, June-July 1986 99 lllTIDS T-SHIRTS

The foll(!wing f~lks ~ r!!aclting you ·for only 20 cents CPIM 68K Macro Assembler - Native Assembler for CP/M per wc_ird. If you lVOu~4 like to reacl'! thl? same audi~pc;e, 68K. About 3 times faster than DRl's. Full Macro facilities, !lend rour wor~s an~ 2q cents for each ti? ¥icro ari4 pr()du'ces ex~cutable fil!!s directly, qr files that work Co~ucopia. . with linl.NET Vol 1-34 on 17 8" flippies, $25, Micro C user disks. All this for only $600 US or best offer. T-SHIRT TODAY! Pascal-Z UG Vol 1-30 13 8" flippies, $25, KUG (Char­ C. Phaneuf, 972 Guillaume Boisset, Cap-Rouge P.Q. lottesville) 55 disks, $65, IBM-PC SIG 1-454 PC-DOS, Canada GlY 1Y9. Eves (418) 658-1086. 30 $475, PC~Blue 1-175 MS-DOS, $185, directory disks $5 PP. These user-friendly cream-colored Also available on 209 5.25" formats. Rental is for 7 days Big Board I Hard Disk Do-It-Yourself Manual. Why pay shirts are formatted in mahogany after receipt with 3 more days grace for return. Credit big bucks? Includes schematics for SCSI disk controller cards accepted (preferred). Downloading-disk format con­ adaptor, Z80 source code for monifor ROM and CBIOS border with black enhanced mode versions. Call. User Group Softw.are Automatic Update modifications, plain English detailed descriptions of all design. The fuily integrated sys­ 0 9 5 software and hardware, construction photos, arid where ~~~i~f9-~·f_

100 MICRO CORNUCOPIA, _#30, June-July 1986 See yourself 1n Bend this summer for three days of technical farums among the pines and junipers on the campus of Central Oregon Community College

\ \

Thursday, July 24th Friday - Sunday July 25th - 27th SOG KICK-OFF FREE TECHNICAL CONFERENCE Once again we're kicking off the SOC with white You'll meet the people who are writing the compilers (C, Modula, Pascal) water rafting followed by the kick-off cookout. If and the interpreters (PROLOG ), who are designing the boards (32032, you're interested in safe thrills then sign up for 68020 ... ), and who are writing the articles. one of these professionally guided trips. • George Morrow (Morrow Computers) will be talking about computer directions. • All day - includes transportation from the col­ lege, box lunch, 4 1/2 hours on the lower Des­ • Trevor Marshall (Definicon Systems) will be talking in depth chutes River, and the Kick-off Cookout. about the 68020. • 2 1/2 hour.- includes transportation from the • Michael Frieling (Al researcher) will discuss designing expert college, l 112 hours on the river, and the cook­ systems tools. out. • Allyn Franklin (Drive Masters) will rim a workshop on drive aligning. Raft trip prices will be in the SOG registration packet. • And much more! The schedule expands daily. iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiimiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii TO REGISTER Call or write for the SOC registration packet.

DORM The one dorm has 50 rooms which hold 2 people each. A room for Wednesday night through Sunday noon is only $80 (that's MICRO CORNUCOPIA $40/person). If you have your heart set on a dorm P.O. Box 223 room (the center for late-night discussions) call Bend, Oregon 97709 and tell us right away. (S03) 382-5060, 9-5, M-F

MICRO CORNUCOPIA, #30, June-July 1986 101 Coinplete Your Education

If you're not working with a full set, fill out your collection of Micro C today.

BACK ISSUES OF MICRO C. ,Only $1.50 each when you order 6 or more " · All Foreign $2.00 each for 6 or more (includes surface postage)

ISSUE #20 (10/84) ISSUE #27 (12/85) HSC 68000 CO-Processor Build An $800 Clone DynaDisk For The BBII Fixing Your Own System Serial Printer On BBi Sans SIO NEC V20 Processor ISSUE #14 (10/83) Cheap & Dirty Talker For Kaypro Selling Your Own Software BBII Installation Extended 8' Single Density Inside Small C Compiler The Perfect Terminal 72 pages 104 pages Interface To Electronic Typewriter BBi Video Size ISSUE #21 (12/84) ISSUE #28 (2/86) Video Jitter Fix Analog To Digital Interface Pascal Runoff Winners Slicer Column Begins . Installing Turbo Pascal Rescuing Lost Text From Memory Kaypro Color Graphics Review Low Intensity BBi Video Introduction To Modula-2 48 pages Turbo Pascal, The Early Days First Look At Amiga 80 pages Inside The PC ISSUE #15 (12/83) 104 pages ISSUE #1 (8/81) ISSUE #8 (10/82) Screen Dump Listing ISSUE #22 (2/85) Power Supply Drive Maintenance Fixing Serial Ports Xerox 820-11 To A Kaypro-8 ISSUE #29 (4/86) RAM Protection Interfacing Drives Playing Adventrue Sound Generator For The STD Bus Speeding Up Your XT Video Wiggle Installing A New BIOS SBASIC Column Begins Reviews Of 256K RAM Expansion Importing Systems From Taiwan 112 PFM.PRN Flippy Floppies Upgrading' Kaypro II to 4 In The Public Domain Begins Prototyping In C · 16 pages C'ing Clearly Begins Upgrading Kaypro 4 to 8 88 pages C Interpreters Reviewed Xerox 820 Begins 48 pages Benchmarking The PCs ISSUE #2 (10/81) 28 pages ISSUE #23 (4/85) 104 pages Parallel Print Driver ISSUE #16 (12/84) Automatic Disk Relogging Drive Motor Control ISSUE #9 (12/82) Xerox 820 Column Restarts Interrupt Driven Serial Printer Shugart Jumpers BBII EPROM Program BBi Double Density Low Cost EPROM Eraser Progr"m Storage Above PFM Relocating Your CP/M BBII 5' /8' Interface Fix Smart Video Controller 1/2PFM.PRN Serial Print Driver Kaypro ZCPR Patch Review: MicroSphere RAM Disk 16 pages Big Board I Fixes Adding Joystick To Color Graphics Future Tense Begins Bringing Up WordStar Recovering Text From Memory 86 pages Cheap RAM Disk 52 pages ISSUE #3 (12/81) 32 pages ISSUE #24 (6/85) 4 MHz Mods ISSUE #17 (4/84) C'ing Into Turbo Pascal Configuring Modem 7 ISSUE #10 (2/83) Voice Synthesizer 8' Drives On The Kaypro Safer. Formatter Saving A Fla~~')isk 820 RAM Disk 48 Lines On a BBi Reverse Video Cursor Hooking Wir~ roBII Kaypro Morse Code Interface 68000 Versus 80X86 FORTHwords Begins The Disk J· O.ctor 68000-Based System Review Soldering: The First Steps 16 pages JRT Fix " . Inside CP/M 86 88 pages Serial Q"f ooard Interface 56 pages ISSUE #4 (2/82) Pas~<'a- rocedures Begins ISSUE #25 (8/85) Keyboard Translation 36 pages ISSUE #18 (6/84) Why I Wrote A Debugger More 4 MHz Mods Kaypro EPROM Programmer The 32-Bit Super Chips Modems, Lyne, and S!Os ISSUE #11 (4/83) 110 Byte: A Primer Programming The 32032 Undoing CP/M ERASE BBi Expansions A Kaypro Joystick Modula II Keyboard Encoder BBII Details Q...;) • Serial To Parallel Interface RS~232C: The Interface 20 pages Dyna, RA1'' ~k Review Business COBOL ' 104 pages Easier R·:.$).;e Video Cursor 60 pages ISSUE #5 (4/82) Plan~q,O .1c Review ISSUE #26 (10/85) Word Processing Kayp1 Column Begins ISSUE #19 (8/84) Inside ZCPR3 Two Great Spells 36 pages Adding Winchester To BBII Two Megabytes On DSI-32 Two Text Editors 6 MHz On The BBi SOGIV Double Density Review ISSUE #12 (6/83) Bulletin Boards The Future Of Computing Scribble, A Formatter 256K For BBi Track Buffering On Slicer MS-DOS In The Public Domain 20 pages Bringing UP BBII 4 MHz For The 820-1 Graphics In Turbo Pascal dBase II 64 pages 104 pages ISSUE #6 (6/82) Look At WordStar BBi EPROM Programmer Double Sided Drives For BBi Packet Radio Customize Your Chars 5 MHz For Kaypro Double Density Update 40 pages Self-Loading ROM BACK ISSUES Terminal In FORTH U.S. Regular Price ... ~ ...... $3.00 each ISSUE #13 (8/83) 24 pages CP/M Disk Directory 6 or more 1/2 price ...... $1.50 each More 256K FOR BBi ISSUE #7 (8/82) Mini Front Panel 6 Reviews Of C Cheap Fast Modem Regular Foreign Price (air mail) ...... $5.00 each Adding 6K of RAM Nevada COBOL Review Viewing 50 Hz BB!Printer Interface 6 or more (including Canada) ...... $2.00 each On Your Own Begins Kaypro Reverse Video Mod (surface postage) 24 pages 44 pages

102 MICRO CORNUCOPIA, #30, June-July 1986 ADVERTISER'S INDEX

Advanced Concepts Engineering .•••. 29 Am pro Computers •.•••....•..••• 90, 91 Andratech ..•••....•..••..••••..••••• 98 so•··s9t!Warn,JQc·.·,.· •. fu~~er ·otthe•··ariginal Austin Codeworks •••••.•••...••..••• 62 BO Software ...... 103 ·cP1~:~~ti•6:t;ng4.~·rie'.'oeJ~1b·~~:ent···· ·. Biegun & Assoc. • .••....•••.••.•••.• 89 >·· ...· .. ·· Bakkers, Andy .••..••..••••...•••..•• 61 Borland International •.. Inside Front Cover Carolina Engineering Labs ••.••..•••. 37 Cascade Electronics •••••.•••.••••.•• 75 C Contest ...... •..•••.••..•..•. 67 C.C. Software •..••.•.••••••..••....• 83 Computer Helper Industries ••.••••••. 80 Computer Journal .•.•..•..•.•.••.... 74 Computer Surplus Store ..•.••.•.•..• 82 Computing Technology •••..•..••.... 81 CompuView ..•.•••.••.•.•.•••••••.•• 17 TiblB·•········is•··········•ttaCiPUS,. ·...... ·_,:.<. ·...... , ··<<\ ··::.. ,. ··: .·:· .~ :.. ·<.. ·, :.. ·· Craig's Computers .•.....••..•••.••. 87 ··.• / : <. :'f::)<: ..· 7/. .... · So Data Desk. . . . • . . • • . . . • . . . • • . Back Cover t.he.compUati~n:,. linkag~··aQq~xec~t!on Definicon ...•..•••.•••. : •••.•••.•.•• 69 speeds of BOS C~re the fast~.~f availa~.I~. even Digital Dynamics ..•...•....•..••.•.. 89 Digital Research •....•..•••...••.•••• 79 (especially!}on f!oppy-based.~xs~e(lls:Just ask ·any user! Wi~h·15;000+ packages sold since Echelon, Inc...•..••••...•••••••• 46, 58 EcoSoft .••.•...•••.•.•...•.••...•••• 84 1979, there are lots of users ; . . · Emerald Microware •.•..•..••.••. 43, 45 Epic Sales •...•..•.•...... •..••••... 11 ERAC Co ..•.....•••.•••.••.•••.•••.• 16 New! Ed Ream'i RE~ fext~~it.or has p~en E21 Computer •••..•••...••.•.•••...• 79 <.. integrated into the pac~~~e:·making BD~pa. Fletcher, Don .•.•.•....••••.•.•..... 31 · · .. ·· •tr~ly complete, self.,confained Cg~yeJ()pment system. Halted Specialties ..•••...... •...•. 95 Hawthorne Technology .....•...•.••. 85 High Tech •..•.•••....•...••..•.•••. 51 Holliston Computer ..•••.••.•..•.••... 5 Po"".~r!ul original features: cos symbolic spwc~7J~vel debugg~r. fully customizable Integrand ...... • : ..••....••••••••.•• 76

Hprar}' a~d run;.time packag~ (for cpnvenient Kamasoft ••.....•••••..•.•...••...•• 35 ROM~ing pt code), XMOOEM-,coinpatible Kenmore Computer Technologies .•.. 46 KYSO Technology ...•..•.•..••••...• 66 ~~l~CO(Jlrnunications package, and other sample applications~ Laboratory Microsystems •....••...•. 62 Logitech, Inc .••.•...••• Inside Back Cover

.. N:ation~rcuser's Group provi9~~ directaccess Manx Software .•••.•••..••..••...••. 39 Microcomputer Systems Consultants . 38 ~o the w~alth of public-domai~ ~oftware written Micro Cornucopia ....•..... 93, 100-102 in BOSC, including text edito~a.~d formatters, Micro Methods •..•...... •••....•.•. 57 Micromint ...••.•...•••...... •.•• 85 BBS's, assemblers, c complier~~ games and Micro Motion ••....•.....••. ·•••..••.. 23 much more. Microprocessors Unlimited .•.•.••..•. 76 MicroSphere •.....••..••.•.••.•.••.. 92 Micro Supply ...... ••.....•.•.... 24, 25 Complete package price: $150. Miken Optical Co ..•...•••...•..•.•.. 76 Mitek •....•...•••...••...•...•••.••. 99 All soft-sectored disk formats, plus Apple · National Public Domain Software •.... 59 CP/M, available off-the-shelf. Shipping: free, by UPS, within USA for prepaid orders. Canada: $5. Oliver Computers •...••...... •.. 42 Other: $25. VISA, MC, COD, rush orders accepted. PC Tech ..••...•••..•••...•...... 1 Periphco .•...•..•.•.....•.•.••...••• 97 PMl ....•...... ••...... •..•.••. 98 Poor Person Software ...••...••..••. 46

Qua Tech ...•...•.•....•....•..•...• 21 SBC Mart ...•...... •...•.•...•..... 81 Second City Software ..•.....•.....•. 47 BD Software, Inc. Servo Computers ...••....•..•.•...•• 57 Sky High Co ...... •...•..•..... 34 P 0 Box 2368 Slicer ...... •...... ;, .•. 39 Cambridge MA 02238 Soft Advances ..•.•.••....•...•...••. 56 Source Information ...... •...•...•... 15 617 • 576 • 3828 Stelcor Inc...... 89

Tomorrow's Computing •...••....•...• 7

Unified Software ...•...... •.... 62 United Products ...... •...... 63

Western Wares .....•...... •...... 66

MICRO CORNUCOPIA, #30, June-July 1986 103 THE LAST PAGE

(( ( ( ( ((Recursion))))))) By Gary Entsminger

Recursion · In Turbo Pascal And Control is then returned to the calling We define a fact (the factorial of 1 is PRO LOG procedure. 1) and a rule (x factorial y if... ) for When a function (or procedure) in­ If a procedure calls itself (recursion), finding factorials greater than 1. vokes itself we· call the process recur­ the same pushing and popping occurs. If you're unfamiliar with PROLOG, sion. A simple, and fundamental, ap­ Each time the procedure calls itself, it try reading the function this way - plication is a function _for calculating pushes another set of variables _and Given x, to find y such that x the factorial of a number. parameters onto the stack. .Eventually, factorial y, if x = 1, y = 1 (1 factorial 1) A factorial is the product of a num- - if the procedure calls itself too many or if x > 1 (1 LESS x), subtract 1 from ber times itself minus 1, times itself times, the stack overflows (fills to the x to get xl (SUM(xl 1 x), and find yl minus 1, times itself _minus 1/ ·etc., -point that it starts writing over other such that xl factorial yl, and multiply down to 1. For example, 6!(factorial) is data) and crashes the system. x by yl to get y. It's always possible, in principle, to Or in other _words, call the factorial find a non-recursive solution, and al­ function recursively until x ... 1. 6~5*4*3*2*1 though the non-recursive solution may In the Edinburgh syntax - be slightly more efficient (sometimes), or 720. (It adds up quickly.) it can obscure the algorithm. For ex­ If we look closer, we see that 6! is ample, we could use iteration to solve factoria1(1,1). also equal to 6 * 5!. And 5! is equal 5 * a -factorial - factorial(X,Y) :­ X > 1, 4!, etc. Or - Z is X - 1, Begin factorial(Z,A), N_! - N * (N-1)! p:: 1; Y is A * X. While n > 1 Do p:: n * Pi In other words, to solve N!, we call n:= n -1 the factorial ·function substihitfog ''N~ End; gives the same result. 1" for "N" until we reach the limiting cbndition, N-1 .... 1. More Recursion The obscurity becomes more obvious Although recursion has been around In Pascal in complex problems, such as the 8 as an idea for centuries (an obsolete Let's look at the recursive function Queens solution, the Quicksort (in­ definition in the O.E.D. defines it as in Turbo. ·.- vented by C.A.R. Hoare), and in pro­ "a backward movement"), the increas­ grams to generate permutations (see ing popularity of PROLOG (and de­ scriptive programming in general) will Function Factorial(N:integer) :integer; "Programming In Modula-2" by Nik­ laus Wirth). (Obvious obscurity, an no doubt lead to more and more t • ~. ' Begin oxymoron perhaps?) discussions about it (which will no If N > 1 then --. >> doubt lead to more and more discus­ Factorial := N • Factorial(N-1) else Factorial ·- 1 .. _ In PROLOG sions about it). End; A logic programming language, Recursion is a powerful technique PROLOG (for PROgramming in LOG­ for describing structures and programs .-,t System Perspective __ :·: . ic) relies (you might say, thrives) on succinctly, now affordable on micro­ From the computer'fa..· 'perspective, recursion, since it lacks primitive func­ computers thanks to the larger memo­ when a procedure (or_: function) calls tions for iteration. Let's examine the ries currently available on PCs. another procedure, its _Jbtmal parame­ factorial function in the two principle For more information about recur­ ters and local variable~ are pushed PROLOG syntaxes - micro-PROLOG sio:n and PROLOG in general, see onto the stack,. along with the retµrn and Edinburgh. "Programming in PROLOG" by address of the c~lling 'procedure. (The First in micro-PROLOG - Clocksin and Mellish and ''micro­ system heeds to know where to return PROLOG: Programming in Logic" by control after it's finished handling the Clark and McCabe. 1 factorial 1 procedure.) Then control is passed to x factorial y if the called procedure. 1 LESS x & When the procedure has finished SUM(x1 1 x) & executing, it retrieves the return ad­ x1 factorial y1 & ••• TIMES(x y1 y) dress from the- stack and then pops the variables and formal param~ters.

104 MICRO CORNUCOPIA, #30, June-July 1986 This is the Modula-2 compiler everybody's been waiting for ...

··~~.~

j~:r·~· ~ij·tapg_oss the bridge MQl 2Jij ~A1{86=::~ .• ~. ...d!l.fll!~;!'I. :'l·., .~J~~'.~r:~i:~:

information on this package. : •••• 0 •••••••• ~;1;~~~~: !~ ~2.1: ?:!:~5•••••• 0 ••••••• Please call our 800 line for: o Information on our *VAX version o Site License and University Discounts o Dealer and Distributor information "Turbo Pascal is a registered trademark ot Borland lnternat1onal ------~ - RISK FREE 30-DAY MONEY-BACK GUARANTEE ANO coMPA\\BLES * rOR YOUR \BM PC, X1,

Both Hardware &Software ff!S! \~.ua;~ \~I~

THE PC fflOOAT-STYLE KEYBOARD INCORPORATES EVERY IMPROVEMENT IBM DESIGNED INTO THEIR ADVANCED "AT" KEYBOARD. QUALITY SO RETAILS ALONE FOR $69.95 GOOD, IT'S BACKED BY AN UNPRECEDENTED TWO-VEAR WARRANTY! CRITICS CHOICE Advanced design features include: "The·keyboard's construction is solid . .. also quick and responsive to the touch. It is ideal for anyone who wants to or •Separate Numeric Keypad simplifies • Selectric layout for Office bas to replace their PC keyboard . .. At 1129.95 DataDesk 's data entry Standardization keyboard is a bargain. The PC 8700 keyboard with SuperKey •Status Lights for Cap, Num and Scroll • Positive Tactile Feedback for that price is a steal." Lock helps eliminate typing errors • Keyswitches rated for 50 million Computer Shop Talk, 3-3-86 • Extra-wide Control and Return Keys for keystrokes ease of use "DataDesk International bas designed a sturdy and •Made in USA handsome keyboard that has a tactile response ... and • Return Key placed in "standard • 2¥ear Warranty typewriter" position for touch typists bundled with SuperKey is the PC hardware bargain of the year." Charles Humble - Computer Editor, .The Oregoniqn BORLAND'S AWARD-WINNING SUPERKEY INCLUDED! GET THIS BEST­ ORDER NOW - CALL TOLL FREE 800-826-5398; IN CA 800-592-9602 SELLING KEYBOARD ENHANCER SOFTWARE -VALUED AT $69.95 -AS or fill out coupon and include check or credit card number and mail to DataDesk PART OF THIS AMAZING OFFER AND CAPTURE THE POWER OF MACROS! International, 7650 Haskell Ave., Suite A, Van Nuys, CA 91406.

SuperKey's macro capability is remarkable. It literally turns a thousand keystrokes into one. Features include: 1------­; S/Jf!_BPMBCPO KBVS • Exclusive screen data Cut & Paste • Keyboard Lock • Screen Privacy and Protection • Keyboard layout customization I PLEASE RUSH ME __KEYBOARD/SUPERKEY BUNDLES AT •Time & Data Stamping •Integration with SideKick I $99.95 EACH. PLUS $10 SHIPPING AND HANDLING IN THE U.S.A. • ProKey Compatibility • Pull-Down Menus I • Data Encryption • On-Line Help and much, much more! I O ENCLOSED IS MY CHECK FOR $109.99 FOR EACH BUNDLE Corporate and Institutional Purchase Agreements Available I ($116.45 FOR CA RES. - SALES TAX INCL.) I O VISA D MC NUMBER ______;__ I EXP. DATE __ SIGNATURE ______7650 Haskell Avenue Suite A datacdk®~~ Van Nuys, CA 91406 I NAME ______~------INTERNATIONAL • ADDRESS ______

• PC Jr., AT&T and Corona computers require adaptors available at a nominal fee. Call for pnang. I CITY ______STATE ____ ZIP ____ SuperKev and SIDEKICK are registered trademarks of Borland International, Inc. I COMPUTER TYPE & MODEL ______IBM, PC, XT and AT are registered trademarks of International Business Machines Corp. •