.. No. 48 July-August 1989 $3.95 T HE MICRO TECHN I CAL J 0 URN A L

Tools For The Physically Impaired

What's important to people who have handicaps? We asked them. (Their responses may surprise you.)

The Adventure Begins page 8

Dallas Vordahl demonstrates what you can do with a computer, a mouthstick, and a very limited amount of head motion.

Writing Software For page 16 The Blind

Don' t exclude the blind from your next software package.

File Transfer Via The page 20 Parallel Port

The LIMBO Project page 28

Build a maze-running robot. And More ... Debugging A Processor page 44 Growing Your Own page 66 Software Business Great SOGs page 83 And Much, Much, More

07

a 7447019388 3 U[J!]£?[jj) J/@[J!]£? !fJ©llfU/5Ju O[jj)(]@ (j] /JJ@r:'.JQ£?fj[J!]O /LfI1@@£?(JJ(]@£?J/ (j][jj)@ @[jj)@]O[jj)QQ£?O[jj)@] (]@@ODDD

Introducing ... The PC-LabCard Family Only from HSC Electronic Supply Digital 1/0 and Prototype Development IBM PC/XT/AT and it's Counter Card compatible models are moving into Card Industrial/Laboratory applications at • 32 Digital Input Channels • Large breadboard area (3290 holes) - TTL compatible an increasing rate. The reasons for • Independent memory and I/O address - Low loading: 0.2 rnA at O.4V input this include their price/performance decoders built-in • 32 Digital Output Channels ratio and short user learning curve. • Memory and I/O ports are jumper - TTL compatible PC-based data acquisition boards selectable - Driving capacity: Sink 24 rnA, are now taking the place of the • All signals are buffered, marked, source 15 rnA and ready for use • 8253 Timer/Counter traditional data loggers or recorders - 3 channels of timer/counter which cost several times more. PCL-750 ...... $74.00 - Breadboard area for flexible user configuration "PC-LabCard" is a family of add-on cards to turn your PC into a PCL-720 ...... $160.00 high performance data acquisition/ testing system at an attractive price.

It includes not only the hardware cards, but also the software, accessories and application support packages which come together to make a thoughtful solution to your PC-based automation needs. QuickMod V2.0 Compiler. .. Just think what the two of you can do.

You can make software engineering faster And when you need more horsepower. and easier than it's ever been before. The you can move into the Professional high performance QuickMod by Stony Modula-2, Stony Brook's fully optimized Brook delivers a compilation speed that compiler. You get the same high productiv­ exceeds 15000 lines per minute on AT ity environment with code generation machines. And it's a true two-pass, and flexibility you can't find in any other Modula-2 compiler with an intelligent product in the industry. environment that determines dependen­ Stony Brook-we design our products cies automatically and builds your pro­ specifically to improve developer perfor­ gram with a single keystroke. You do little mance. And we. know software engineer­ more than enter the program text-then ing. Put us to work for you. let Stony Brook handle the work load. SOFIWARE Call us direct and we'll mail product QuickMod is more than a supercharged information to you within 24 hours. Your Partner compiler-it is a fully supported package in Software Development backed up by a text editor, a linker, a 800/624-7487 library manager, a symbolic debugger and a runtime library that offers more func­ 805/496-5837 ~.,aJif~~~~~ational tionality than anything else on the market. 805/496-7429 Fax All for $95. Versions available for DOS Reader Service Number 152 and OS/2. 187 East Wilbur Road, Suite 9,

© 1989 Gogesch Micro Systems. Inc. Thousand Oaks, CA 91360 MICRO CORNUCOPIA, #48, July-August, 1989 1 §JERTI01U§ ]])JEIB1UGGRNG at a RJEA§ONAIBJLJE PRTICJE All the speed and power of a RUN CODEVIEW hardware-assisted debugger IN~~LY8K! at a software price I~~~~..

Soft-ll Code View is a great integrated debugger, but it uses over 200K of conventional memory. Hardware-level break points MagicCV uses advanced features of the 80386 REAL-TIME break points on memory locations, memory ranges, to load Code View and symbols in execution, I/O ports, hardware and software . More extended memory. This allows MagicCV to run powerful break points than ANY software-only debugger on the Code View using less than 8K of conventional market. Soft-ICE gives you the power of an in-circuit emulator on memory on your 80386 PC. your desk. Don't let 640K be your limit! Break out of hung programs If you are closing in on the 640K limit and would With a keystroke - no external switch necessary. Even with like the power of CodeView, MagicCV is for you. interrupts disabled. Don't let the debugger hide the bug! Breaks the 640K barrier Even if you're not closing in on the 640K limit, Soft-ICE uses ZERO bytes of memory in the first 1MB of address running Code View with MagicCV makes your space. This is especially useful for those subtle bugs that change debugging environment much closer to the end when the starting address of your code changes. With Soft-ICE user's program environment. You can use your code executes at the same address whether the debugger is Code View to locate subtle bugs that only occur loaded or not. when there is plenty of free memory, or those difficult bugs that only occur when your program Works with your favorite debugger is running with a couple of TSRs loaded. Soft-ICE can be used as a stand-alone debugger or it can add its powerful break points to the software debugger you already use. How MagicCV works You can continue to use your favorite debugger until you require MagicCV uses the 80386 to create a separate Soft-ICE. Simply pop up the Soft-ICE window to set powerful virtual machine for CodeView. MagicCV uses real-time break points. When a break point is reached. vour between 4K & 8K of conventional memory as a debugger will be activated. - . ~ bridge between the DOS environment and CodeView. Solve tough systems problems too Soft-ICE is ideal for debugging TSRs, handlers, self MagicCV is easy to use booting programs, DOS loadable device drivers, non-DOS If you are a Code View user, you already know how to use MagicCV too. Just type MCV instead of operating systems, and debugging within DOS & BIOS. Soft-ICE is also great for firmware development because Soft-ICE's break CV; everything else is automatic. points work in ROM. Save $86 How Soft-ICE Works Soft-ICE uses the power of the 80386 to MagicCV $199 surround your program in a virtual machine. Soft-ICE $386 MagicCV This gives you complete control of the DOS environment, while Soft-ICE runs safely in Buy Both and Save $861 with Soft-ICE protected mode. Soft-ICE uses 80386 CALL TODAY Using Soft-ICE with Code­ protected mode features, such as paging, I/O (603) 888 - 2386 View gives you the features privilege level, and break point registers, to or FAX (603) 888 - 2465 necessary for professional provide real-time hardware-level break points. level systems debugging. 30 day money-back guarantee Visa, Master Card and AmEx accepted MagicCV and Soft-ICE can "Soft-ICE is a product any MS-DOS work in concert with Code­ developer serious enough to own a r"u - r~lEGl\ TECHf"OLOGIES View to provide the most 386 machine should have." powerful debugging Dr. Dobb's Journal -May 1988 P.O. BOX 7607· NASHUA, NH 03060-7607 platform you will find anywhere. Both require 80386 AT compatible or IBM PS/2 Model 80. MagicCV requires at ~••• R.ea.deirliseir,Viiice.Niiuiiimiibeiir.lil0 ..... least 384K of extended memory. CodeView is a trademark of Microsoft Corporation.

2 MICRO CORNUCOPIA, #48, July-August 1989 THE M I C R 0 TECHNICAL JOURNAL MICRO CORNUCOPIA

JULY/AUGUST 1989 - ISSUE #48 FEATURES COLUMNS

Dallas Vordahl 8 The Adventure Begins 44 86 World How does a quadriplegic declare independence? It's not easy, but with a mouth stick and a computer, almost anything's possible. 50 C'ing Clearly Debee Norling 12 Selecting A Talking Computer For A Blind Friend There are a lot of well-meaning people who'll help you pick out a computer for 60 ShareWare a blind friend. Debee's a lot more than well-meaning.

Debee Norling 64 Culture Comer 16 Writing Software For The Blind Debee suggests some not-sa-obvious things you can do to make your software easier to use for the blind (things all your customers will appreciate). 66 On Your Own

Bruce Eckel 20 File Transfer Via The Parallel Port 77 Units And Modules Tired of moving data one bit at a time? Think there might be a faster' way? A much faster way? There is, and here's everything you need to do it. 83 SaG Information Bob Nansel 28 The LIMBO Project-Part Two Bob begins his mechanical rllg rat. (And you thollght you'd be left in limbo.) 76 CP/M Notes

Chris Howard 90 Tech Tips 34 PCX Compatibility As we create fancier graphics we place more demands on our standard graphics file formats. Can a standard format support change? FUTURE TENSE Karl Lunt 38 A 68000-Based Multitasking Kernel As long as you're going to design your own ROM it might as well do two 86 Tidbits things at once. Right?

Jack Crenshaw 96 Last Page 80 The Very Early Days Of Computing Jack describes NASA's first multiprocessor. (It sat at many desks.) COVER

Cover Illustration by Paul Leatherwood.

MICRO CORNUCOPIA, #48, July-August, 1989 3 THE MICRO TECHNICAL JOURNAL By David J. Thompson MICRO CORNUCOPIA

Editor and Publisher David J. Thompson

Associate Editors Gary Entsminger Larry Fogg AROUND Cary Gatton HE BEND Contributing Writers Anthony Barcellos Bruce Eckel Michael S. Hunt Scott Ladd Laine Stump Computers Shouldn't Be Limitations Advertising & Distribution A handicap is a limitation. A limitation is a handi­ Jeff Hopper cap. At least that's the way it appears. But if you talk to Accounting live-wire folks (handicapped or not), you'll find them Sandy Thompson (ignoring, fighting through, beating, exceeding, strain­ ing) their limits. Order Department So the computer (their computer, perhaps the only Tammy Westfall thing they can use, can communicate with, that doesn't Graphic Design go home at 5 p.m., doesn't get bored, or hoarse, or ob­ Carol Steffy noxious) is very important. And, it better not limit them. For instance: MICRO CORNUCOPIA (lSSN 0747-587X) is I just received a call from a fine lady who's visually published bi-monthly for $18 per year by Micro Cornucopia, Inc. 155 NW Hawthorne, Bend, OR impaired (she's lost most of her central vision). She 97701. Second-class postage paid at Bend, OR and wants to work at home and she's interested in getting a additional mailing offices. POSlMASTER: Send computer so she can do word processing and database address changes to MICRO CORNUCOPIA, PO projects for businesses in her area. Wonderful idea. Box 223, Bend, OR 97709. However, she can't read normal-sized characters on a SUBSCRIPTION RATES: 12" screen. (The characters have to be 1.5 times normal 1 yr. (6 issues) $18.00 before she can read them.) 2 yr. (12 issues) $34.00 Then a friend of hers called. The two of them had 3 yr. (18 issues) $48.00 wandered over to Emerald Microware to see if Brian 1 yr. Canada & Mexico $26.00 1 yr. Other foreign (surface) $36.00 could locate any 25" displays that would take standard 1 yr. Foreign (airmail) $50.00 Hercules or EGA output. No luck so far. Then the friend mentioned he might call Jim Button of Buttonware and Make all orders payable in U.S. funds on a U.S. bank, please. see if Jim would write special word processor and database packages. The packages would display fewer, CHANGE OF ADDRESS: larger, characters. Please send your old label and new address to: MICRO CORNUCOPIA P.O. Box 223 Bend, Oregon 97709

CUSTOMER SERVICE: For orders and subscription problems call 503-382-8048, 9 am to 5 pm, Pacific time, M-F.

TECHNICAL ASSISTANCE For help call 503-382-8048, 9 am to noon Pacific time, M-F

BBS - 24 hrs. 300-1200-2400 baud 8 Bits, No Parity, 1 Stop Bit 503-382-7643

Copyright 1989 by Micro Cornucopia, Inc. All rights reserved ISSN 0747-587X

Audit Bureau of Circulations Continued on page 71

4 MICRO CORNUCOPIA, #48, July-August 1989 kon Top!

The Leader in Performance tool lmk, which is an advanced Lattice C 6.0 for DOS and OS/2 is version of the UNIX make utility. the fastest compiler overall on 60 Build, diff, extract, file, splat, touch, the ei~ht PC Magazine bench­ and wc enable you to easily main­ marks in both large and small 50 tain your source files, and cxref model. Lattice C is over 10% produces comprehensive cross­ faster than Microsoft 5.1 and over reference reports. Lbind prod uces 15% faster than Borland 2.0. These 40 family-mocfe executables that can results are due to our new op­ run under both DOS and OS/2. timizer and the many perform­ Lattice is the productivity leader. ance improvements in the library. 30 You can make your applications The Leader in Libraries run even faster by using our new 20 Our library has often been praised register variable support and forits comprehensive and sophis­ built-in functions. Lattice 6.0 is the ticated features. Now we include performance leader. 10 graphics, communications, and curses libraries. The communica­ The Leader in Compatibility tions library supports XMODEM, Lattice C is fully compliant with YMODEM, KERMIT and ASCII the ANSI standard. We pass not ANSI Libraries protocols. The graphics library only the Computer Language ANSI provides a graphic windowing Test Suite but 100% of the And the benchmarks model. Curses provides a UNIX Plum Hall Test Suite Version 1.09. compatible screen manager. Lattice is the compatibility leader. show it. Lattice is the library leader. The Leader in Debugging The Leader in OS/2 The Leader in Convenience Lattice C includes CodePRobe™, a Lattice C includes bindings and Lattice C uses an automated installa­ new full-screen symbolic debugger header files so that you do not need tion procedure that has been praised for DOS and OS/2. CodePRobe nas to buy an expensive OS/2 develop­ by reviewers. The compiler au tomati­ the familiar look of the CodeView, ment kit. Tne library also supports cally configures itself so that you do and can be used with a mouse. It also multithread programming with no not need to specify complicated enables you to easily debug family built-in limits to the number of options. Yet, a full set of options is mode programs, Presentation Man­ threads. The Lattice linker,librarian, available to the professional who ager apphcations, and OS/2 mul­ editor, debugger and utilities run in needs to customize to a particular tithreaa applications. And, for those DOS, OS/2 and family mode. Lattice environment. Lattice is the conven­ humongous programs and system is the OS/2 leader. ience leader. killer bugs, CodePRobe can be used remotely from a different PC. Lattice The Leader in Productivity The Leader in Documentation is the leader in debugging. The Lattice C Development System Lattice C includes over 1500 pages of now includes the utilities that high quality documentation in ring The Leader in Innovation our customers-professional C pro­ binders. It contains all the informa­ Lattice has long supported popular grammers-use most often. Of course, tion that professional programmers language extensions such as near, far, the system is based upon our C com­ need in a tboroughly inoexed format. and pascal. In our previous version, piler, editor, linker,librarian, and de­ Lattice is the documentation leader. we Introduced allgn, chip, volatile, bugger. In addition, wenow include interrupt, nopad, and pad to handle our powerful project maintenance The Leader in Support im}Jortant memory management Bestof all, Lattice support comes free problems in DOS, OS/2, and embed­ with Lattice C. Lattice's bulletin aed systems. Version 6 continues board and telephone support are the this evolution with critical and best in the business. Lattice is the private. Critical defines a function ~~. support leader. that must run as a critical section, and private defines data that must be O~<>o 30 Day Money Back Guarantee replicated for each execution thread. Lattice C 6.0 is available for $250. To Future versions will continue to order, send check or money order to: improve the language for use in Lattice Lattice, Inc., 2500 S. Highland Ave­ cutting-edge environments such as Professional Programming Tools Since 1981 nue, Suite 300, Lombard, IL 60148. OS/2 and AmigaDOS. Lattice is the 2500 S. Highland Avenue, Lombard,IL 60148 Or order by credit card at (800) 444- innovation leader. 4309. FAX # (312) 916-1190, TELEX 532253. *Send to Lattice for a free complete report on the benchmark analysis.

Reader Service Number 153 MICRO CORNUCOPIA, #48, July-August, 1989 5 Letters

Interactive Disassembly David E. Michener My congratulations to Mr. Flusche Custom Computer Service for his well-written article, "The Art of 10525 S.E. Cherry Blossom Dr. Disassembly," in Issue #46 of Micro C. Suite 200 This is a subject near and dear to me, as Portland, OR 97216 well as many of your other readers. My company, C.C. Software, has been Editor's note: Let's see. Modula 2, Pas­ marketing the Masterful Disassembler cal, 8088 and 68000 assembly, Prolog (oh, (MD) for many years now, starting with and C). You're right; we need to cover more a Z-80 version and then the 80x86. languages. Perhaps Pilot and RPG would be I have personally disassembled fun. Seriously, we use the language most 50,000+ lines of code and can attest that appropriate for the task. I wouldn't twiddle this is not a simple task. But good, bits with Pascal any more than 1'd write a usable, source code can be generated biorhythm generator in assembly. with the tools we have today. I realize this was not intended to be a New Slant On SEA vs. PKWare comparison of disassemblers, but only a I'd like to add my own two cents to report on the use of one product the discussion in Micro C Issue #46, re­ (Sourcer). However, a few additional garding the SEA vs. PKWare con­ points would be worth mentioning. Mr. troversy. Flusche's five-step procedure for disas­ You can copyright the expression of sembly is required only for non-interac­ Nasty Language an idea, but not the idea itself. If you tive disassemblers. These are the type Periodically I go through old ma­ write a book with the same plot as that require users to examine listings gazines, cut out articles I want, and then someone else's book, but you do so in (step 3), edit a "command file" (step 4), throw the mags away. I keep trying to different words, you do not infringe. and repeat the process (steps 2-5) until do that with yours, but have been un­ Even if, by some fluke, your book has you like the result. able to because the magazine has too exactly the same text as the other book, Step 3 is the real ca tch. This is fine many useful articles. Consequently, I your book still doesn't infringe if you only for short programs. When I disas­ have no choice but to order another sub­ wrote it independently. sembled the Turbo Pascal compiler (a scription. Note the difference here between a 21,000 line assembly program), this step However, this subscription is only copyright and a patent-you can in­ would take about four hours on a fast for one year because you seem to have a fringe someone's patent even if you in­ printer. And to repeat this over and fatal disease. If you move quickly you vent something totally on your own, over again is prohibitive. might be able to get help for it, but I with no contact with the outside world. Interactive disassemblers (like MD) don't have high hopes for you doing Not so with a copyright. replace these ·steps with a visual dis­ that. OK, OK. I'll tell you: the dreaded But there's more: if there is only one play. If you don't like some part of the "c" disease. reasonable way to express an idea, then disassembly, you can change it and im­ You are doing just what all too many you can use the same words as another mediately see the results on the screen. used-to-be-good magazines have done: book and not infringe its copyright, Video screens are much faster than You're selling your body and soul out to even if you do so with full knowledge printers. Also, you don't have to switch the C language. How many times did of the other book. The reasoning here is over to DEBUG to understand what's you get dropped on your heads? Or that if only one way of expressing the happening. maybe you ran the rapids one too many idea exists, then copyrighting this ex­ times and hit your head on a rock. pression would constitute protecting the Oh, what the heck, you probably idea, and that cannot be done by a Clark A. Calkins, Owner have six good issues left, notwithstand­ copyright. c.c. Software ing the fact you haven't had any good The extension of these ideas from 1907 Alvarado Ave. assembly language articles for some Continued on page 58 Walnut Creek, CA 94596 time now.

6 MICRO CORNUCOPIA, #48, July-August 1989 Introducing ... The 1st Family of Low Cost, Powerful Text Editors

VEDIT Jr. $ 29 VEDIT $ 69 VEDIT PLUS $185

Finally, you can choose the best editor for your needs without compromising performance or paying too much. And organiza­ FREE Evaluation Copy* tions that want the "same" editor for everyone can pick VEDIT® for most users and VEDIT PLUS for their power users. Call1·800·45·VEDIT The new family of VEDIT text editors are upwards compatible, easy to use and offer exceptional performance, flexibility and stunning speed. (3 to 30 times faster than the competition on large files where speed really counts.) Compare Features and Speed Call for your free evaluation copy today. See why VEDIT has been the #1 choice of programmers, writers and engineers VEDIT BRIEF 2.10 Norton 1.3 QEdit 2.07 since 1980. Pull-Down menus Yes No No Yes Pop-Up ASCII table Yes No No No VEDIT Jr.-Unmatched performance for only $29. Keystroke macros 100+ 1 No 100+ All VEDIT editors include a pull-down menu system with "hot Regular Expressions Yes Yes No No keys;' context sensitive on-line help, pop-up status and ASCII "Cut and Paste" buffers 36 1 1 100 table, a configurable keyboard layout and flexible, unlimited Text (book) markers 10 10 No No Undo keystroke by keystroke Yes Yes No No keystroke macros. Edit files of any size and any line length. Undo line by line Yes No No No Perform block operations by character, line, file orcolumn. Undo Normal/max Undo levels 500/1000 30/300 - - up to 1000 keystrokes- keystroke by keystroke, line by line, or Variable tab positions Yes Yes No No deletion by deletion. Automatic indent, block indent and paren­ Configurable keyboard Yes Yes No Difficult theses matching speed program development. Word wrap, Integrated mouse support Yes No Yes No paragraph formatting, justification, centering, adjustable mar­ FILE LIMITS gins and printing for word processing. Run DOS programs. Edit files larger memory Yes Yes Difficult No Maximum line length >8096 512 65,535 512 VEDIT-A best value at only $69. Maximum lines/file 8,388,607 65,535 >65,535 20,000 Simultaneously edit up to 36 files and split the screen into win­ COMPILER SUPPORT None None dows. Search/replace with regular expressions. Includes the Menu driven Yes No - - best compiler support available-menu driven, easy selection Select Compiler options Menu Difficult -- . Yes of compiler options, supports "Include" files and MAKE utilities. Support "Include" files No -- BENCHMARKS 5DK FILE VEDIT PLUS-Ultimate programmer's tool for only $185. Simple search 0.2 sec 1 sec 1 sec 0.3 sec VEDIT PLUS adds the most powerful macro programming Save and continue 1 sec 2 sec 2 sec 1 sec language of any editor. It eliminates repetitive editing tasks and 1000 replacements 3 sec 19 sec 17 sec 2.5 sec permits creating your own editing functions. The macro BENCHMARKS 3 MEG FILE language includes testing, branching, looping, user prompts, Simple search 1:40 min 1:36 min Cannot Cannot keyboard input, string and numeric variables and control over Save and continue 1:05 min 3:23 min Cannot Cannot the size, pOSition and color of windows. Source level macro 60,000 replacements 3:18 min 1:44 hour Cannot Cannot debugging with breakpoints and tracing. Macros developed Block-column copy (40 x 200) 2 sec 30 sec Cannot 2 sec Insert 1 Meg file in with VEDIT PLUS also run under VEDIT. middle of 1 Meg file 1:11 min 15:13 min Cannot Cannot 30 day money-back guarantee. Call for pricing of XENIX, OS/2 PRICE $69 $195 $75 $54.95 and FlexOS versions. Very attractive quantity pricing is avail­ able for schools, hardware and software vendors.

VEDIT and CompuView are registered trademarks of CompuView Products, Inc. BRIEF is a trademark of UnderWare, Inc. Norton Editor is a trademark of Peter Norton Computing Inc. OEdit is a trademark of SemWare. 'Supports IBM PC, XT, AT, PS/2 and clones with CGA, MGA, EGA, VGA, Wyse 700, Amdek 1280 CompuView and other displays. Also supports Concurrent DOS, DESOview, Microsoft Windows, PC-MOS/386 and most networks. 1955 Pauline Blvd., Ann Arbor, MI 48103 'Also available for MS-DOS (CRT terminals), TI Professional and others. 'Free evaluation disk is fully functional and can edit small files. Reader Service Number 7 (313) 996-1299, Fax (313) 996-1308 MICRO CORNUCOPIA, #48, July-August 1989 7 ,,( '.,. , .. COIllP\l-IterAid~d, In~den The,Adv'e1{ture Begins . \...... ~, \,

8 MICRO CORNUCOPIA, #48, July-August 1989 By Dallas Vordahl 13720 E. 26 th Ave. Spokane,.WA 99216

decision-the decision to buy a Radio published my letter. The result was When I first spoke with Dallas all the Shack IRS-80 Model I with 16K RAM Toggle Key, a TSR program written by phone, there was no indication that he'd and a cassette recorder. Recalling the mo­ Ernest Kraut. His program turns the spent days entering the letter proposing this ment it was first turned on reminds me Control, Alt, and Shift keys into toggle article. It was only later that I found out of the beginning of an adventure ... You switches and displays their state on the how much work it had bee1l for him. are standing at the end of a road before a screen. But right up front, he made it clear he'd small brick building. Around you is a forest. David Rose of RoseSoft, whom I also not accept help with the writing (even from A small stream flows out of the building and asked for help, wrote a "one finger his 24-hour live-in aid). So, this article is down a gully. mode" into the following version of Pro­ the product of months of effort by a man Key (ProKey is a TSR macro program). who's found INDEPENDENCE in a com­ Keyboards: The First Barrier He took a different approach to the prob­ puter. Computer keyboards were designed lem than Kraut. for people with two hands and ten fin­ He kept the Control, Alt, and Shift gers. I have two hands and ten fingers, keys toggled for one keystroke. That n my electric wheelchair, I drove up but they don't work. So I use a mouth­ saved a keystroke each time I used a to the counter at the local Radio stick. single control-key command. (Superkey, IShack and told the salesman I wanted I can do a lot of things with a mouth­ by Borland, has a similar feature.) to see a computer. He looked at me stick. I can turn the pages of books and rather curiously-wondering, I sup­ magazines, use a typewriter, pilot a Other Solutions posed, what a guy paralyzed from the radio-controlled model sailplane and race PC Magazine readers offered many neck down wanted with a computer. He a radio-controlled model sailboat; dad other solutions ranging from TSR pro­ pointed to a nearby display. and I put a lot of time into making them grams, to mechanical arms, to using I turned my wheelchair and there, work. The TRS-80 keyboard, however, weights to hold down those keys. The re­ next to a telephone answering machine was beyond us. sponse was terrific, and their help made and· a pile of stuffed-toy radios, sat a Try holding down one key while it possible for me to use IBM-type com- . small gray-and-black television attached pressing another. Do it with one finger, puters. to a keyboard. The screen was blank ex­ and you'll understand the biggest dis­ However I'm now faced with three­ cept for "READY" displayed in the advantage of using a mouthstick. So, al­ button mice and 101-key keyboards. I can upper left comer. most before it began, the adventure had just manage the width of 101-key key­ So that's a computer, I thought, rather stopped .... A huge green fierce snake bars boards with my mouthstick, but mice are disappointed. It didn't seem like much. I the way! simply out of the question-it seems that tried out the keyboard with my mouth­ Adapting the TRS-80 keyboard every advance leaves me farther be-' stick, making sure I could reach all the proved easier than I thought. That key­ hind .... Out from the shadows behind you keys. All the while the salesman pitched board had no Control or Alt keys, only pounces a bearded pirate! He snatches your the computer as he would have pitched a two Shift keys. A computer repair shop treasure and vanishes i1lto the gloom. stereo or CB radio. He didn't know what installed a mechanical Shift-Lock, and in And the problem isn't exclusive to 16K RAM was, any more than I did. an astounding flurry it drove the snake hardware. Programs sometimes use I sat there staring at that blank screen, away. strange key combinations or require a wondering how I could justify $600 for a mouse. Worse yet, some programs defeat computer. Ostensibly, I needed it for The IBM Keyboard ProKey and Toggle Key by taking control keeping the books of our three family­ Four years later when I encountered of the keyboard or other BIOS functions. run variety stores. Frankly, it was a com­ an IBM XT, I found a larger barrier. Im­ puter, and I wanted it. agine disassembling an IBM keyboard There Is Another Way It was a big decision. Not until later and installing a mechanical Control-Lock, There are, in fact, many other ways did I realize it was a decision that would Alt-Lock, and Shift-Lock. Not a job for around the standard IBM keyboard. completely change my life. I shudder at just anyone. I hoped there was a better There are keyboards and keyboard emu­ how easily I could have decided not to way. lators designed specifically for the physi­ buy that computer. I wrote to PC Magazine, describing the cally disabled: optically controlled, zero . It's been ten years since I made that problems of using a mouthstick, and they pressure, on-screen single-switch scan-

MICRO CORNUCOPIA, #48, July-August 1989 9 ning, flat membrane, add-on function, Learning BASIC was at first just My TRS-80 didn't have a word pro­ calculator style, and voice controlled. something to do. I had no plan or goal­ cessing program, and when I bought one Several years ago I beta tested a Key just curious how to tell the computer for my XT I wondered if I was throwing Tronics voice-controlled keyboard. For what to do. My first program simply dis­ my money away. Surprisingly, the word someone who can't use a keyboard but played the word "Hello." processor has become the program I use has the ability to speak, it would seem a But with that simple program I be­ most. I use it to write everything from natural solution. It is, but only for rote came more independent; I was control­ fiction to BBS messages to this article; applications. It wouldn't have, for ex­ ling something, even if it was only char­ and letters too many to count (now ample, been of much help writing this ar­ acters on a screen. I had lost most of that everyone's entitled to my opinion!). ticle. (And when I write that steamy sex kind of control when I became a quadri­ Using my computer, I've learned to scene into my next novel, it wouldn't do plegic, confined to a wheelchair, five do what other people are doing, despite to write it out loud.) years earlier. Programming the computer my being paralyzed from the neck down. The voice-controlled keyboard gave me back some control. Still, I didn't The computer has changed my thinking; worked like a macro program, except see what the computer could do for me. I no longer think about the things I can't that spoken words replaced keystrokes do, I think about the things I can do. as macro names. It could store about 300 Keeping Track words, each word representing one or At the time, I used a calculator and a Taking Inventory more keystrokes. By assigning a spoken typewriter to do my bookkeeping work. In the ten years I've been using per­ word to each key and using macros for It was a hard job, considering the hassle sonal computers, I've progressed through frequently used commands and text, I of getting someone else to shuffle a lot of hardware: three computers, three could avoid the keys altogether. through papers and forms and note­ monitors and printers, five floppy and However, . the voice-controlled key­ books, filing and finding certain records, three hard disk drives, five keyboards, board was just too cumbersome; I had to and setting them all where I could see and two modems. In the process, my train it to recognize my voice by saying them. Then it dawned on me that maybe RAM requirements have grown from each word at least six times. It was a pain I could use the computer, and I began to 16K to 1,664K. entering and editing long sequences of write programs with that in mind. In that steady progression of older keystrokes. I mumble a lot. And I don't First I wrote programs to enter and hardware to newer hardware, the move like wearing a microphone headset. store check stub entries and cash transac­ from cassette tapes to floppy disks for Someday, I imagine, I will use a voice­ tions, then general journal entries and storage was a big jump, but the 10MB input device. That'll happen when: the payroll records. I wrote a program to hard disk was magic.... A hollow voice units become speaker-independent and bring all that information together and says "PLUGH." require no voice-recognition training, print it out in financial statements. Soon I No longer did I have to ask someone when they have built-in and user-defined was able to do my bookkeeping using to switch floppies every time I wanted to vocabularies of thousands of words, not the computer almost exclusively, with change programs, or needed last year's hundreds, or when they convert words minimum outside help. I even took on a financial records (or to play Frogger, directly into text. few outside bookkeeping jobs. when everyone thought I was hard at A better solution might be a keyboard work). No single component has given designed for mouths tick users. One such Expanding The Horizons me as much autonomy as the hard disk. keyboard, The Magic Wand Keyboard, When I bought an IBM XT, its power Soon, CD technology may become as features 96 negligible-force metal key­ expanded my options. Its speed, important to me as the hard disk is pads contained in a 5.4" x 3" area. This memory, hard disk, and graphics capa­ today. I already have a spelling checker keyboard doesn't force you to press two bilities opened the door to things I never and a thesaurus on my hard disk, but a or more keys simultaneously. imagined I could do.... You are in the Hall CD-ROM drive would allow me to use a It also features a switch to regulate the of the Mountain King, with passages off in real dictionary and encyclopedia, and a sensitivity of the keypads, and has six all directions. host of other reference materials. programmable keys-up to 200 charac­ With my mouths tick and the XT, I I wouldn't have to ask someone to ters per key. Its only drawback is the could use a spreadsheet to calculate come pull the dictionary from the shelf price: $1,200 .... I am prepared to offer you a depreciation, keep payroll records, and and set it up for me. I wouldn't ever hint, but it will cost you points. chart sales. (Figuring income and payroll have to turn a page (turning from the I have not tried The Magic Wand taxes and filling out the forms is still a front to the back of a 1,200 page diction­ Keyboard, and at $1,200 I probably pain, even with a computer.) Using a ary using a mouthstick gives me second won't. I'll continue to use my standard desktop publishing program, I learned to thoughts of whether I really need to keyboard until mouthstick keyboards be­ design and print notices and advertising know the meaning of zymurgy). come affordable or voice-input devices flyers. Another piece of hard ware, the become practical. When one of my bookkeeping clients modem, has also become an important bought a Compaq, I used the skills I part of my computer system. Beyond its Exploring The Cave learned from writing my own bookkeep­ ability to upload and download pro­ After solving the pressing problem of ing programs to write him a general grams and information from other com­ pushing two or more keys simul­ ledger program. He still uses that pro­ puters, the modem provides an easy way taneously, I began to explore the TRS-80. gram, and so do four other people. for me to be a part of society. Society­ It came with only two programs: black­ I learned to fly an airplane using Mi­ groups and activities and almost every­ jack and backgammon. I played them, crosoft's Flight Simulator (flying a Cessna thing else-is geared for people with able but the fun quickly faded. There re­ 182 with a mouthstick-now that's a bodies, and that often makes it hard for mained only one other direction: I moved challenge), and I learned to play games, someone in a wheelchair to join in. ... NORTH ... into BASIC. like Monopoly. On-line computer forums and special

10 MICRO CORNUCOPIA, #48, July-August 1989 interest groups, and especially BBSs, are only a few ways to relieve that frustra­ Without a computer, I would be without groups of people interacting almost tion. Today, as I figure the quarterly pay­ the most important tool I have for solely through their computers. Whether roll taxes or land an F-16 on the deck of making my life worthwhile. a person is sitting in a wheelchair typing an aircraft carrier, or write this article-as I haven't scattered bread crumbs with a mouths tick makes no difference. I press each character with my mouth­ along the way or made marks in the Without a modem I wouldn't know stick-I am doing it by myself, without walls, nor do I have a map. I don't care, nearly as much as I do about computers the help of anyone. That is independence. because I'm never going back. I'm and how to use them, and I'd miss That is the hidden treasure. forever lost in this computer adventure. knowing and interacting with a lot of in­ And that's just fine. teresting people. Forever Lost There are many paths in this adven­ Products Mentioned The Hidden Treasure ture with computers that I have yet to Most adventures have hidden follow. I will explore the technology as Toggle Key treasure, but usually they're only bars of far as it allows, taking detours around Ernest A. Kraut silver or sparkling gold nuggets. In my ad­ mice and other devices designed only for 11 Haystack Road venture with computers, however, I people with able bodies. Reading, MA 01867 found a different and more valuable kind I imagine computers becoming a part of hidden treasure. It was lying just be­ of my life in many other ways. I imagine Pro Key 4.10 yond that "READY" prompt of my first smart TVs, stereos, and other electronic RoseSoft computer... my independence. Not gear-smart in that they will respond to P.O. Box 70337 complete independence, not nearly. But a a voice or a thought or a blink of an eye. Bellevue, W A 98007 lot more than I had. I imagine a computer linked to a robot Paralysis is not just a loss of move­ arm that obeys my spoken commands, The Magic Wand Keyboard ment and feeling in one's arms and legs, pOSSibly even a robot capable of moving In Touch Systems paralysis is a loss of independence. That from place to place. (While mobile robots 11 Westview Road, Dept 11 means relying on someone else to do the exist now, they are merely toys.) Spring Valley, NY 10977 things you would normally do yourself. Meanwhile, I've used present com­ (914) 354-7431 It is intensely frustrating being unable to puter technology to improve almost do anything for yourself, unable to do every aspect of my life: the way I work anything without the assistance, coopera­ and play, the way I communicate and in­ • • • tion, and permission of someone else. teract with other people, and the way I Before I owned a computer, I had learn and think and challenge my mind.

The Complete Diagnostics Solution for Your PC/XT, PC/AT, or Compatible

INCLUDES ... PC/XT System Diagnostic Software $ 29 DRIVE TESTS-Complete diagnostics for Hard and Floppy PC/XT Disk Diagnostics (wI test diskettes) $ 29 drives. including controller cards. Tests read. write, and format PC/XT 110 Loopback Test Plugs $ 19 capability as well as seek timings, hysteresis and rotation COMPLETE PCIXT DIAGNOSTICS SET (save $28) $ 49 timings. PCI AT System Diagnostic Software $ 29 I/O PORTS-For both parallel and serial ports, confirms internal PCI AT Disk Diagnostics (wI test diskettes) $ 29 and external loopback capabilities at all baud rates and PCI AT 110 Loopback Test Plugs configurations. $ 19 COMPLETE PCI AT DIAGNOSTICS SET (save $28) $ 49 MEMORY-Performs over eight different tests to check standard. extended, and expanded memory. BOTH PCIXT and PCI AT SETS (save $75) $ 79 KEYBOARD-Verifies that all keys send correct key codes, including shift. CNTL and AL T modes. Capital Software presents the definitive disk-based diagnostics package for the IBM PC AT and Xl Atechnical tool detailed CPU. NUMERIC COPROCESSOR-Verifies that all single and enough for the repair technician. A friendly interface that multiple instructions perform correctly and accurately, as well places problem-solving skills in the hands of the end user. as testing all internal registers. An uncompromising solution. VIDEO DISPLAY-Checks video controller cards. Confirms attributes. graphics, colors (if applicable). and CRT alignment SEND CHECK OR MONEY ORDER TO USE YOUR VISA OR MASTERCARD patterns. CAP IT AL SOFTWARE CALL TOLL FREE (800) 541-0898 REAL TIME CLOCK-Verifies correct timing. all internal 951-2 OLD COUNTY ROAD SUITE 224 registers. and battery backed-up RAM. BELMONT, CALIFORNIA 94002 FOR INFORMATION CALL: .Nand many more features to Insure the Integrity of your computer. 408-293-5279

MICRO CORNUCOPIA, #48, July-August 1989 11 Selecting A Talking Computer For A Blind Friend

• A dealer knowledgeable in the sizers are little more than speech chips­ It was a real eye-opener for me when needs of the blind could have capable of generating simple phonemes. Debee demonstrated her vociferous Toshiba guided him to a more appropriate Since hobbyists mainly make up the laptop at SOG VII. In fact, it was an ex­ purchase. speech synthesizer market, synthesizers perience for a lot of us. Though totally Since the IBM PC is "the" business seldom include sophisticated ASCII-to­ blind, Debee can write text and code with computer, it's the obvious choice if the speech conversion software. the best of us, and she does it all by ear. blind person will use the computer pro­ fessionally. If the user is a grandfather, a Types Of Speech school child, or a housewife, then select­ Digitized speech can sound very hen Ray's wife Tina began to ing an IBM PC compatible may not be so human, but it requires huge amounts of lose her vision, Ray decided to important. A few CP 1M machines, the hard disk space, even for a small vocabu­ Wget her a talking computer. He Apple II family, and some Radio Shack lary. I don't know of any screen access found just what he was looking for at TRS-80 models can also talk. Several soft­ program which uses digitized speech. the local Computer Heaven. It was IBM ware packages have been written for the Rule-based speech sounds more me­ PC compatible and included a speech Apple II family, especially for children. chanical and sometimes mispronounces a synthesizer with speaker. word, but it has an unlimited vocabulary. Unfortunately, acquisition is easier Fast & Slow, Up & down Algorithms make their ''best guess" than implementation. He quickly learned Speech devices don't magically talk about the pronunciation of each word. that the "speech synthesizer" was merely any more than printers magically print. The more recent and the more expensive a chip. The fact that a speaker was at­ Both synthesizers and printers need synthesizers usually have better algo­ tached didn't mean that the synthesizer special software. You must select a syn­ rithms. had anything to say. thesizer which will turn ordinary ASCII Consistency and phoneme clarity are So Ray started writing code. His code text into intelligible speech. far more important than a human-like made explosive sounds, siren sounds, fly­ Many of the ''built-in'' speech synthe- voice and correctness of the English pro­ ing saucer sounds, breaking saucer nunciation. The DECtaik synthesizer has sounds, rainy weather sounds, and chirpy bird sounds. He even made the synthesizer count from one to ten and made the program menu driven. (The sounds were almost intelligible.) Ray had a wonderful toy, but unfortunately Tina didn't have a talking computer.

Important Points Ray and Tina's situation is common. Ray could have done much better, if he had known four simple facts- • Many synthesizers in today's market do create terrific speech .. • A speech synthesizer isn't enough. The blind user needs screen access software-the high level interface between the talking box and the computer's operating system. • The right word processor, database, or spreadsheet must be purchased. Ease of use for a blind person is much more complicated than it is for the sighted. Debee Norling at her computer work station.

12 MICRO CORNUCOPIA, #48, July-August 1989 By Debee Norling Grassroots Computing P.O. Box 460 Berkeley, CA 94701

the most natural-sounding, unlimited-vo­ ternal synthesizer may create IRQ con­ cabulary speech available. Even though I flicts. have a DECtalk, I continued to use my Some internal cards are designed $250 Echo PC for a long time. Speech devices specifically to fit in some of the popular I found the Echo's quick response and laptop computers (especially the To­ crisp (although often not very human­ don't magically talk shibas) and run off the laptop's battery. sounding) speech more useful than the An external synthesizer has its own DECtalk's ponderous, marvelous voice. any more than power supply and usually communicates My primary speech source is now an with the computer via a serial or parallel Aicom Accent. It combines the con­ printers magically interface. A lightweight, durable, external sistency and quick response of the Echo, synthesizer is a good choice for someone with better pronunciation and a large print. Both who must move from computer to com­ predefined vocabulary. As a technical puter. Because of its exposure and porta­ writer and programmer, I use the Accent synthesizers and bility, it's more susceptible to damage or for most of my work, but still occasion­ theft than an internal unit. So far, no ally use the Echo when writing code. The printers need battery-powered external synthesizer has $4,000 DEC talk continues to gather dust. had a major effect on the market. In speech synthesis, there is such a special software. A good speech synthesizer still isn't thing as being Too Smart. Take the letter enough. Suppose you send a print screen combination PGUP, for example. A to your printer. Imagine that you can primitive synthesizer will simply spell it only read that printout by starting at the out: P G UP. A more sophisticated syn­ The synthesizer must have a way to first word and reading nonstop to the thesizer will see the vowel, decide that it change the volume and pitch. A tone last word. Do you remember the spelling must be pronounceable, and make a best control is also desirable. of the syntax error on line seven and the guess. The result will be a pseudo-Eng­ An easily definable substitution table, typo on line three and the faulty in­ lish word, such as "peggup" (or worse). often called an exception dictionary, is a denting on line sixteen? This isn't the A speech synthesizer must be able to nice enhancement, though hardly man­ best system for a blind operator. He shut up. To a blind user, quick silence is datory. Some synthesizers have a diction­ needs a way to conveniently and interac­ more important than correct pronuncia­ ary of correct pronunciations built-in. tively read selected portions of .the tion. If I look up a phone number in my Acronym processing is handy, but screen. database, I want to hear the information, you should be able to tum it off. I once then immediately stop the speech. If I beta tested a synthesizer which said Screen Access Software Is The Key have to wait while it reads the entire "New York" every time I typed "F7 n y" A screen access package provides a screen, I'll probably forget the number. for exiting WordPerfect. link between the speech syntheSizer, the Choose a synthesizer that has several Remember-all synthesized speech computer, the blind operator, and the speech rates. A slow speech rate is im­ requires getting used to. mainstream applications program. portant for beginners and for carefully I use Video Voice, a TSR utility that studying a complex screen. A fast rate is Innies & Outies watches the keyboard and can speak the useful for quickly finding information in SyntheSizers are either internal cards keystrokes either character by character a mass of text. As I become more ex­ or external boxes. or word by word. perienced with a synthesizer, I can in­ Internal synthesizers are safe from Video Voice also checks for the appli­ crease the speech rate. spills and falls and they're less likely to cation program's keystrokes and per­ Editor's note: No kidding. Debee demon­ be stolen. There are no power or com­ forms various routines based on the strated her synthesizer at SOG. At the munications cables to become entangled user's keypresses. For example, when I slowest rate, we could understand it after a or unplugged. They also tend to be less· press the down cursor, Video Voice few minutes, adjusting to some off-the-wall expensive than their external equivalents. monitors the cursor, waits for it to land sounds. At her normal rate (probably four You don't have to bother with dip on the new line, then speaks the text of times normal speech), the sound was switches and baud rates. However, if the the line or the character under the cursor. completely unintelligible to our sighted ears. computer will contain many cards, an in- When I press control-left arrow, Video

MICRO CORNUCOPIA, #48, July-August 1989 13 Voice reads the word that the cursor has in memory. So in the technical sense, the person. A few dealers have even made it moved to. When I press tab, Video Voice software "works" with speech. However, . a regular sideline. They typically know speaks either the row and column posi­ features which make a program easy to nothing about the blind person's special tion of the cursor or the previous word use for the sighted often make it difficult needs, sell the wrong equipment, and are (as in a database prompt). for a blind person. incapable of providing meaningful sup­ Video Voice "environments," which A program which works well for the port. are loaded for major application pro­ blind should have an uncluttered screen. A few companies which have special­ grams, control these actions. Thus I can WordPerfect is a good example. When a ized in selling other products to the blind move rapidly within a document, editing blind person writes, the only thing on the

14 MICRO CORNUCOPIA, #48, July-August 1989 Two great tools. SAYWHAT?! TOPAZ The lightning-fast The breakthrough toolkit for screen generator. Turbo Pascal ~.o and s.o Whether you're a novice If you'd like to combine the raw power~~O~ ~ programmer longing for and speed of Turbo Pascal with the ~ ~~~SC~ simplicity, or a seasoned simpli~i~ and eleganc~ ofdBASE, .?--~~'~ pro searching for higher Topaz ISJustwhatyou re look- L.... ~ ~'7~t productivity, you owe it ing for. That's because Topaz ?-'~" / I to yourself to check out (our brand new collection of I ~~ 1/' 0<., I J Saywhat. You see, with units for Turbo Pascal 4.0 ~ ) \ \ //;; S aywh at, you can build and5.0)wass.peciaIlYcreatc~~..t>.4eo,} '. )/) I beautiful, elaborate, color­ to let you enJoy the best of OV; "---rI "1~ coded screens in minu tes! both worlds. The resu1t?you {(. <: '\'\ fcj~ A ~~ {/ That's right. Trulyfantastic can create truly dazzling \~~'~~ \ 1'-\ ~' screens for menus, data applications in a very short time. And no \J ----- ~ entry, data display, and wonder. Topaz is a comprehensive toolkit ~ \ '\\ help-panels that can be of dBASE-like commands and functions, LL\l displayed with as little as one designed to help you produce outstanding, polished line of code in any language. programs, fast. Check out these powerful features: Here's what you get: • Over 200 routines all with easy-to­ ORDER NOW. use, dBASE-like syntax. YOU RISK NOTHING. • Design screens, windows, and Thousands of satisfied customers • Data entry routines like SAY, GET, moving bar menus! have already ordered from us. Why PICTURE, RANGE, color selec­ • Easy-to-use, powerful editor lets not visit your dealer or call toll-free, tion, unlimited data validation. you create screens in a jiffy. right now and put Saywhat and Topaz • Open up to 10 DBF files, with up to • Pop up your screens and menus to the test yourself? They're fully 7 indexes each with database with one line of code in dBASE. guaranteed. You don't risk a penny. routines like USE, SELECT, all the dBASE compilers, your Special limited-time offer! Save $26. SKIP, APPEND, PACK, INDEX favorite BASIC, Pascal, or any Buy Saywhat?! and Topaz together ON, SET INDEX TO, and FIND. for just $99 (plus $5 shipping & other language! • No need to buy dBASE. CREATE, handling). • Screen Library Manager. BROWSE and REPORT utilities Visit your nearest dealer included. • Generates runtime code. or call toll-free: 800-468-9273 • Easily implement Saywhat and • No runtime license or royalty fees. Lotus-style moving bar menus. In California: 800-231-7849 • Comes with a 100 page manual, International: 415-571-5019 • BROWSE any DBF file with just plus dozens of sample programs The Research Group one line of code! Programmable and free utilities. Software Science. Inc. and windowed too. 100 Valley Drive. Brisbane. CA 94005 • Comprehensive Time & Date t2n. _ math in 7 international formats . ....-u,,3 ," > ') ) TTs ') ') ) ") ,),-)-,-) \'") - -)-~-;\ ~.> ,\~ I MONEY BACK GUARANTEE. i. Powerful . code and REPORT ~ /{}.t:f / /3 Ifyouaren·tcompletelydelightedwithSa~h.at generators Included! l~' P or Topaz. for any reason. return them wlthm . (0 _,J I 30 days for a prompt. friendly refund. • Comes WIth a complete 250 page Ct c: ~ .s:': ~ manual, plus sample programs to

Dealers: SAYWHAT?! and TOPAZ. are get you started. $749 5 available from Kenfil Distribution. comFraiiieed!and in Europe from THE RES EAR C H G R 0 U P

Reader Service Number 129 MICRO CORNUCOPIA, #48, July-August 1989 15 Writing Software For The Blind Making It Perfectly Clear

Unfortunately, modern software tends Just as there are ways to optimize menus to park the cursor up on row 1 column 1, for the sighted user, there are ways to op­ destroying any opportunities for the timize them for the blind. Debee should blind person to find his "current" place. know the field well-she writes software Even worse are those programs which and she's blind. move the cursor off the screen, say to row 26. Figure 1 shows a C program which n some ways, writing user-friendly can turn off the blinking cursor so that software for an audience that in­ sigh ted folk won't see it move. Call this Icludes users with visual impairments routine and, with the cursor invisible, isn't all that different from writing user­ continue to use it to point to the user's friendly software for everyone else. In current location on the screen. For ex­ general- ample, put the cursor after the "Enter • Keep modes to a minimum. your choice" prompt. In a database, put • Keep the screens consistent. it at the beginning of the data entry field. • Keep the keystrokes consistent. If you don't have a specific screen • Keep the messages simple. coordinate defined as the "current" loca­ In some ways, however, writing user­ tion and you use a reverse video blob or friendly software for the blind is quite color highlighting to indicate a variable size pseudo-cursor, move the system cur­ different. Remember that the blind can't Debee and Duchess. take in a whole screen at once. Even sor to the first character within the when the blind have the best screen highlighted area. access packages (which verbalize charac­ ware enlarges a portion of the If you turn the blinking cursor off, use ter attributes), highlighting and screen screen (for partially sighted). This the method in Figure 1 to disable the cur­ formatting can become distractions. enlarged window must be moved sor. Don't use ANSI.SYS as that just It's important to keep the screen as in order to see the whole screen. moves the cursor to row 26. Don't use simple as possible. Blind people must al­ the technique in Robert jourdain's book, ways know where to find the most im­ Cursors & Pseudo-Cursors which positions the cursor offscreen. In­ portant piece of information. Virtually all screen reading programs stead, turn it off by calling the BIOS func­ know where the system cursor is; they tion to set cursor size, and set bit 5 of the usually query the BIOS. My screen access scan lines, signaling the BIOS to make the How Blind People "See" program, Video Voice, queries the 6845 cursor invisible. . Basically, a blind person can access a video controller directly. Keep the cursor invisible, but let it computer screen three ways- Screen access software has a more dif­ shadow your pseudo-cursor. Screen • Speech access consists of a speech ficult time finding a pseudo-cursor or access software will find the system cur­ synthesizer and a screen reading moving highlight bar. These screen pro­ sor, even when you have made it invis­ program which lets the blind per­ grams tend to depend on the system cur­ ible. son interactively review portions sor to indicate the user's current screen of the screen. location. Screen Layout • Braille displays consist of rows of For example, if you ask Video Voice to When formatting your screens, re­ pins which rapidly rise and lower read the previous sentence, it must first member that the simpler they are, the to create a changing pattern of determine the location of the current sen­ easier they'll be for the visually impaired dots. The braille window is usu­ tence. It does this by scanning both ways to read. Think about the placement of ally only 20 characters long (a few from the cursor, searching for the current columns, the layout of windows, and the are 40). The window must be sentence's start and end. If a blind user organization of menus. Above all, re­ moved about on the screen to take asks his screen reading package to read member that displaying trivia is espe­ in the information. the current line, "current" is determined cially frustrating for the blind user, he • Large-print screen display soft- by the line where the cursor rests. can't avoid (listening to) it.

16 MICRO CORNUCOPIA, #48, July-August 1989 By Debee Norling Grassroots Computing P.O. Box 460 Berkeley, CA 94701

overlay the whole screen, obscuring any­ Figure l-Tuming Off The Cursor thing behind it, never sharing the stage with other actors. /* Call with the parameter off set to TRUE (1) or FALSE (0). The parameters high and low are for top and bottom scan lines of the cursor. We actually turn off the cursor by calling a routine Be Consistent, Be Consistent in the BIOS to change its size.*/ If you display hunks of information #include repetitively, try to display each category in its own screen location. For example, if the user always knows that error mes­ int setcursor (off, high, low) int off; sages are on row 24, then he can check int high; that row periodically. Turbo Lightning is int low; hard for blind novices because it doesn't union REGS inregs,outregs; /* General registers */ always pop up its information in the same place. Few screen-access programs if (off) /* Set bits 4 and 5 if */ high 1= Ox0030; /* turning cursor off */ can dynamically locate pop-up boxes. inregs.h.ah = 1; If your program puts text (such as a inregs.h.ch = (unsigned char) high; status line) on a certain row, keep it inregs.h.cl = (unsigned char) low; int86(Ox10,&inregs,&outregs); there. Don't let the information get pushed around the screen by pull-down return(off); windows, pop-up boxes, and error mes­ sages. The blind user will lose track of his information if it drifts aimlessly from one This program will turn off the cursor and leave it in the same location so that screen access software will correctly find screen location to another. The best place it but sighted folk won't see it move or blink. for a status line is the very bottom row. The second best is the top row. Find a Note that the cursor can be turned off without being repositioned. Most software authors don't realize that, so they park the cursor safe place to put your messages, then on row 26 to make it invisible. keep them there. If Even if the cursor is on the screen, the system cursor is often you use colors, use them con­ parked in the wrong place. 'Software which uses the system cursor sistently. Red can always indicate errors, (even if invisible) works much better with speech, since the blind blue the current choice, and magenta the user always knows where he is. 'status line. Screen access programs can search for specific attributes, and then • • • read only that information. Thus, if a blind person hears a beep, she can search for red just to get the error message, Avoid Multiple Columns give the screen access program some­ without having to read the entire screen. When possible, avoid displaying data thing to find. Give the user a way to reassign the in several columns. If you must use Though Video Voice can find the colors of each type of information. If you columns, space them as widely apart as graphics frame and box drawing charac­ use drop shadows, provide a way to dis­ possible so that screen access software ters, some other screen review programs able them. can tell where each column ends. aren't as sophisticated. If your window is within a frame, or in a color not used Menu Dos & Don'ts Don't Overlap Windows elsewhere on the screen, Video Voice can Menus which display the "trigger" Avoid overlapping windows. If you find it. character in an attribute different from must have a previous window peeking If a frame consistently resides in a the rest of the word are difficult for the out from underneath the current win­ specific screen location, then virtually all blind. They are usable if the trigger char­ dow, make sure you display it in a differ­ screen access software can be configured acter is always the first character of the ent color, or surround it by IBM ex­ to find it. But the best way for the blind c;hoice. If the trigger is embedded within tended ASCII frame characters. You must is to have menus a la WordPerfect. These the choice, the screen gets confusing. '

MICRO CORNUCOPIA, #48, July-August 1989 17 Let's use the following menu line as an example:

Look Ma, No Dots Add Delete eXit Communicating, Dot To Dot Assume that the text is normal white What about Braille? Unfortunately, only a small on black and that the A, D, and X are in percentage of the blind population reads braille. bright yellow, except that the current choice (A) is in green. Read white says The world's largest circulation magazine for the "dd elete e it." Read yellow says "d x." blind has only 4,600 braille subscribers, even Read green says "a." The information is though the subscription is free. there, but it takes a lot of keystrokes to Since so few people use braille, the market for braille devices is quite small. get to it. Put the cursor at the first character of Nevertheless, through grants and goodwill, there's a plethora of braille equip­ the current choice so "read current ment. word" can speak the current choice. Or Braille has some definite advantages. Unlike speech, which often mispro­ write part of the text of the prompt in the same color as the screen background. nounces and sometimes misinterprets, braille is accurate-the blind person can That way, this sort of menu: "see" every character. It's a marvelous tool for proofreading. Braille has some disadvantages, too. It's hard to utilize interactively. Using a Print Save Exit hard-copy embosser as your primary access is like having to print your docu­ can speak without interfering with the ment every time you want to see your screen. Using a soft braille device requires visual aesthetics. I add an "invisible" trig­ you to move your hands to the braille display. However, your hands also need to ger letter and equals sign before each remain on your keyboard for typing. menu choice. On the screen the real menu Braille embossers must punch the dots into very heavy paper, typically 100# looks like this:

card stock. This makes a lot of noise. P=Print S=Save E=Exit Paper braille output is bulky and expensive. The standard braille page is 11" x 11.5", yet it holds only about a third of the text of an 8.5" x 11" printed page. A Light bar menus, especially reverse video ones, are generally easy enough to standard desktop dictionary sold by a major agency takes 72 volumes; it requires use, so long as there is nothing else of the about 24 feet of oversized shelving. same color on the screen. Soft-braille devices have a display composed of pins which move rapidly up Keep your borders simple. Sighted and down to create a changing dot pattern. These devices "show" only 20 or 40 people tend to underestimate how te­ dious repetitive speech can become. In­ characters at a time. The blind user is obliged to move this braille "window" stead of using hyphens and vertical bars, around in screen memory in order to get a "feel" for the whole screen. which are spoken, use the line draw Soft-braille devices have too many moving parts. A standard 40-cell braille characters of the IBM extended ASCII character set. display has 240 pins to move up and down, plus the actuators to move the pins, Screen access software either doesn't thousands of minute parts, each of which must be machined to a fine tolerance read graphics characters or lets you op­ and protected from damage. tionally tum graphics off. Braille devices are very expensive, and there's no mass market to amortize Runs of alternating characters, such as "-*-*-," are extremely tedious, since each development costs. A very desirable "photocopy" machine that makes raised line character gets spoken. A continuous run drawings has sold fewer than 100 units since it was invented several years ago, of any single character can be sensed and despite a constant sales effort. counted. Thus, most modem screen The cheapest embosser on the market costs a little under $2,000 for a kludged access packages pronounce a row of "equals" signs something like: "c'Ounted rework of a daisy-wheel printer that puts out barely readable braille. There are 40 equals signs." Not great, but definitely several embossers in the $3,500 to $4,500 range. The user must also purchase text acceptable. However, remember that a to braille translation software. box framed with characters other than the IBM extended ASCII character set Among the cheapest soft-braille displays is a unit which costs around $1,000. won't be seen as such by a screen access It is so sensitive to damage that if you don't protect the pins with plastic wrap, program. you void the warranty. A very nice soft-braille device that attaches to the com­ puter's serial port has recently been introduced for about $4,000. "Helping" Don't misspell words so the synthe­ Meanwhile, you can obtain a speech synthesizer with screen access software, a sizer will pronounce them correctly. usable tool, for as little as $500. No wonder speech, despite its potential for error, There are many speech synthesizers is more popular. popular with blind users. Each has differ­ ent pronunciation rules. Some pronounce • • • better than you think.

18 MICRO CORNUCOPIA, #48, July-August 1989 Use sound effects sparingly and make sure they can be disabled. When you change modes, a sound is helpful. Blink­ ing characters or an enlarged cursor • SEE HOW PROGRAMS WORK warn the sighted user of a mode change. • EASILY MODIFY PROGRAMS How I long for a text editor which would make a squishing noise whenever I ac­ SOURCER'M creates detailed commented source code and listings from memory and executable files. Built in data analyzer and simulator resolves data across cidentally tum off insert mode. I'd like to multiple segments and provides detailed comments on interrupts and subfunctions, hear those little characters squeal as I 1/0 ports and much more. Determines necessary assembler directives for reassem· type over them by mistake. bly. Includes a definition file facility to include your own remarks and descriptive Procomm Plus uses a distinctive rising labels, force data types, and more. Complete support for 8088/87 through 80286/287 tone to indicate when a window opens and V201V30 instruction sets. We welcome comparisons with any other product, because no product comes close to the ease of use and output clarity of SOURCER. onscreen and a descending tone as the On my Jist of programs that I simply won't do without! window closes. Backit uses a pretty flute­ -Robert Hummel, Senior Technical Editor, PC Magazine, 4/26/88 like warble to prompt for a new disk. As an example of incorrect use of SAMPLE resetprn. ht ResetPRN vl.OI Sourcer Llsttng 2-Har-89 4:46 pm Page I sounds, I have a notetaker which beeps OUTPUT PAGE 60,132 RESETPRN whenever it finds a search string or gets Fully Created: 15-Apr-88 automatic Verston: 1.01 a disk or printer error. Since it uses the Passes: 3 Analysts Flags on: H same beep to indicate success and to an­ Program header - 0008 data.le equ ; (0040:0008-378h) nounce an error, it "cries wolf" too many :------seg.a ----- seg.a segrrent para public times, and I ignore its warning. Assembler assume cs:seg.a. ds:seQ.a, ss:stack.seg.b Make the important obvious, and get directives resetprn proc far 65&:0000 start: 65&:0000 EB 23 jill' short loci rid of the trivial. When I log on to a BBS, 65&:0002 52 65 73 65 74 50 db 'ResetPRN·vI.OI'. OOh 65&: ooca 52 4E 20 76 31 2E it invariably greets me with a gabble of 65&:000E 30 31 00 Determines 65&: 0011 0040 data 2 d. 40h tedious statistics. I don't care that I am 65&:0013 00 OA 52 65 73 65 data) db COh. OAh, 'Reset Prtnterl S' data areas 65&:0019 74 20 50 72 69 6E caller number 3,465, that I have logged and type 65& :OOIF 74 65 72 3F 20 24 65&:0025 on 20 times before, and that I have 65& :0025 OE push cs 65& :0026 IF pop ds Detailed 65& :0027 .BA 0013 ""'v dx.offset data 3 : (658E:0013-0Dh) downloaded 14 files and uploaded 2. 65&:002A B4 09 "",v ah,9 - comments 65&: 002C CD 21 tnt 21h : DOS Servtces .h-functlon 09h If I wanted statistics, I'd ask for statis­ : dIsplay char strIng at dS:dx 65& :002E B4 01 "",v ah,l tics. Unlike the sighted user who can skip 658E:0030 CD 21 Int 21h : DDS ServIces ah-functlon Olh • get keybd char al •• ith echo over that which he doesn't care to see, 65&:0032 3C 79 Clll' al.79h : 'y' 65& :0034 75 16 jne loc 3 : JUIll' If not equal I'm forced to sit through a cacophony of 65&:0036 8E IE 0011 ""'v ds,data 2 : (65SE:001l-40h) 658E:00lA 8B 16 ooca ""'v dx,ds:data Ie : (0040:000S-378h) Simulator 65&: 003E 83 C2 02 add dX,2 . data just to find out if I have any elec­ 65&:0041 BO ca "",v aI,S follows 65&:0043 EE out dX,al : port 37Ah, prlnter-2 control tronic mail. ; al - B, initialize printer segment 65&:0044 B9 8000 eX,SOOOh 65&:0047 changes 65&:0047 E2 FE loop loeloop 2 : loop If ex > 0 Heard But Not Seen 65&:0049 BO OC al,Oth • 658E:004B EE out dx.al : port 37M, prlnter-2 control ; al - OCh, Intt & strobe off Your software can talk by writing to 65&:004C 658E:004C B4 4C "",v ah,4Ch : 'l' the screen via the BIOS. When you call a 65SE:004E CD 21 Int 21h : DOS ServIces ah-functlon 4Ch Easy to : termInate .Ith aI-return code BIOS screen service using interrupt 10 resetprn endp read seQ.a ends hex, screen readers watching that inter­ format ;· ... ------.. ------... ------r-- stack seg b ---- stack.seQ.b segrrent para stack . - rupt can intercept the data and send a 6593:0000 OOCO[FF] db 192 dup (OFFh) copy to the synthesizer. stack.seQ.b ends I use an interesting trick to make my end start software talk while keeping my screen (Source code output and inline cross reference can also be selected) displays fast. First I write the entire screen directly to video memory. Then I repaint it using the BIOS. If I only want • CHANGE AND ADD FEATURES part of the screen spoken, I just repaint BIOS SOURCE • CLARIFY'INTERFACES that part. There's no flicker and the for PS/2, AT, XT, PC, and Clones screens snap into place as rapidly as if I The BIOS Pre·Processor'" with SOURCER provides the first means to obtain weren't doing any BIOS screen writes at accurate legal source listings for any BIOS! Identifies entry points with full expla· all. nations, Resolves PS/2's multiple jumps for improved clarity. Provides highly descriptive labels such as "video_mode" and much more. Fully automatic, Summary SOURCER Commenting disassembler $99.95 UNPACKER ™ Unpack packed EXE files and more $39.95 Avoid multitudinous modes, screen SOURCER with BIOS Pre-Processor 139,95 ASMtool'M Assembly source analyzer and flowcharter 89.95 clutter, and overlapping windows. Use USA Shipping & Handling $3; OutSide USA $15; CA Res, add sales tax; PS/2, Al Xl and PC are trademarks of IBM Corp, consistent screen locations, consistent All our products come with a 30 day money back satisfaction guarantee, Not copy colors, consistent layouts, consistent mes­ protected. To order or receive additional information just call! sages, and consistent keystrokes. En­ hance the information with well-thought­ 1-800-662-8266 out sounds. Try some little tricks to im­ prove your screen's listenability. Most V COMMUNICATIONS, INC. importantly-don't banish the cursor! 303 t Tisch Way, Suite 905, Dept. M3, San Jose, CA 95 t 28 (408) 296·4224

• • • Reader Service Number 62

MICRO CORNUCOPIA, #48, July-August 1989 19 File Transfer Via The Parallel Port And An XT Controller Update

The most involved angle will be re­ settings, DOS & BIOS summaries (includ­ You've perhaps heard about these paral­ writing the ROM to use static RAM in­ ing the BIOS entry point addresses), AT lel file transfer packages that pass data at stead of dynamic RAM (eliminating the CMOS memory, programming informa­ the speed of light. Pretty fancy, with all that RAM refresh interrupts) and executing a tion about the important chips on the file handling. Right? Well, Bruce's is just as program in EPROM instead of looking motherboard, etc. fancy and it's a lot cheaper. (Free.) for a floppy disk. It also has one small, fascinating page For those of you who have to know called "User ROM Scan," which starts how to do it now, I've received a couple like this: "The BIOS provides a means eady? This time I'll show you of excellent leads which should get you whereby builders of adapter cards may how to transfer files (very going. hook into the power-on initialization Rquickly) via the parallel printer Laine Stump (who's back in Turkey sequence." Hmmm, very intriguing. port. I've successfully transferred files at by now) has written several BIOSes for A warning: this booklet assumes you speeds of 1/4 megabyte per second be­ PC Tech. He suggested the following: get already know what you're doing. Don't tween a 10 MHz XT and a 6 MHz AT. an EPROM burner which can read and get it expecting to learn the basics. If you So with a couple of cheap printer cards write (you can find these for the PC at do know something about the inside of ($20 each from MicroSphere) and a little under $150), and suck the contents out of an XT or AT, though, it's a wonderful rewiring on a cable, you can create a 2- your XT ROM BIOS. Then find the summary, and a good jumping-off point node tiny LAN (well, the file transfer power-on reset vector and change that to if you are delving into a particular mys­ part of a LAN, anyway). an adjacent ROM socket in your XT tery. This article temporarily diverts from. (there are usually several). They also create some very reasonable my "tum your XT into a controller" ser­ Blow the modified ROM BIOS con­ kits for modifying the low-level software ies (although I could try to slide it in tents into a new EPROM, and put it back inside your computer. One of these, the under the auspices of "communicating into the original socket. After figuring out PromKit (which I haven't seen yet), pro­ with a controller"). In the meantime, I do where the entry. points to the various mises to "put anything into PROM that have an update on the XT controller pro­ ROM BIOS routines live (more about that you can put on a disk-even DOS." ject which should keep you happy until in a minute), you write your own code in The other, which I have, but haven't next time, when I return to the series. C, which picks and chooses from the used yet, is the XT BiosKit which-get routines in the ROM BIOS. This is much this-is the whole XT BIOS rewritten in XT Controller Project Update easier than rewriting (and-ugh-rede­ C! You can modify it to your heart's con­ Your response to the XT Controller bugging) the ROM BIOS from scratch. tent, bum it into an EPROM, and you're series has been great. I guess a lot of you If you have to build the ROM BIOS done! Boy, I'm glad somebody did this, be­ realize that "XTs don't die, they just get from scratch, don't: I found two guys in cause I sure wasn't looking forward to it. cheaper." DOS is the most powerful San Diego who have done all the work The price is incredibly reasonable ($99, development environment around for the for you! John Foster & John Choisser with a $2 production royalty) and they price, so why roll your own hardware have created a small, friendly (they an­ have one for the AT ($199, with a $4 pro­ when you can use an XT? . swer the phone "this is John," although I duction royalty). In one of the upcoming projects in this can't tell which one), Micro C style com­ My only criticism 'of John & John is series, I'll look at modifying the ROM pany which puts out very interesting, that they've done too much pioneering BIOS. This is fundamentally important to self-published books and products for work and put too little of it down on making an XT controller. It's the ROM getting into the guts of the Pc. paper! The XT BiosKit has a brief intro­ BIOS which requires a keyboard, a moni­ One of their products is a little hand­ duction which gives you the bare necessi­ tor, RAM, and all those other doodads book called The XT-AT Handbook for En­ ties (the rest of the manual contains the C you may not want on your controller. I gineers, Programmers, and Other Serious source listings), and the XT-AT Handbook plan to look at this problem from several PC/XT and PC/AT Users. It's a brief sum­ is really a large summary card. It's ob­ angles. The simplest angle will involve mary of all the hardware and low-level vious these two know a 10.t about the in­ disabling the keyboard and monitor software facts and features of your XT or sides of the PC, and I think they should check routines, so you can run your con­ AT. It includes the bus, memory map, write about it. Come on, you two-get troller as a standalone box, but still boot I/O map, hardware interrupts, DMA busy. from a floppy disk. channels, power-on error signals, switch I'll be giving the details of BIOS modi-

20 MICRO CORNUCOPIA, #48, July-August 1989 By Bruce Eckel Eisys Consulting 501 N. 36th Street, Suite 163 Seattle, WA 98103

fications (including How To Put Pro­ Cabling grams Into EPROM) in the future (once I The hardware portion of this project is figure it out!). quite simple: it consists of wiring a cable. So I've come to Both ends of the cable are male DB-25 John Foster & John Choisser connectors, which plug into the parallel Annabooks this conclusion-if printer cards of each machine. 12145 Alta Cannel Ct., Ste. 250-262 You can approach the cabling in two San Diego, CA 92128 you want to build ways. The easy (but more expensive) (619) 271-9526 way is to buy two DB-25 ribbon cable this project, you connectors, and a length of ribbon cable Parallel Port File Transfer long enough to connect your two ma­ When I began the controller series, I should buy two chines. Ribbon cable is convenient be­ used the parallel printer port that came cause it keeps all the wires in order for with the cheap Hercules imitation card cheap printer you. Use a vise to clamp the connectors on my XT clone. After a few experiments, onto the cable, cross a few wires, and the card mysteriously stopped working. cards, the kind that you're done. Knowing what I did about the parallel If you want a hard (but cheap) way, printer card, I was certain there was no are about $20 and buy a printer cable with a male DB-25 way the printer port could be damaged. connector at each end, slice it open, and Upon further investigation, I dis­ chock full of TTL switch some wires around. You'll need to covered that the circuit used for the par­ trace each wire with a continuity checker. allel printer port on Hercules clone cards chips. DB-25 connectors usually have some (and, I assume, the original Hercules kind of numbering next to the pins; some card) is very different from the hardy connectors only number one or two pins TTL parallel printer cards you can buy so and some connectors number all the cheaply. The cheap printer cards also have a pins. Building your cable this way is The printer port consisted of one chip! full set of address jumpers, so you can more tedious, but it will keep your mind And the chip was CMOS, which can be place the card anywhere in the PC's I/O off real work. fragile (especially when exposed to static space instead of just LPTl: or LPT2:. electricity). So I tried to replace the chip More expensive cards use DIP switches The Circuit (attempting to blow it up again with the and restrict your choices. Figure 1 shows the cable connections. same circuit, thus proving the destructive I've found it convenient to put the This circuit uses the fact that each paral­ nature of the circuit, or at least the de­ printer cards for both machines in an un­ lel printer card has 8 lines which are out­ structive nature of the experimenter). used I/O area so they won't interfere put only, 5 lines which are input only, But after a long search I found that with normal operations. (See Chapter 7 and 4 lines which can be configured with only one company manufactures the of my book Computer Interacing With Pas­ software to be inputs or outputs. It uses chip, and an obscure one at that. I'm not cal & C for details about changing the the 8 output-only lines to send informa­ sure if it's even possible to buy this chip address jumpers.) tion from the card to the remote com­ through regular channels. Perhaps the One of the most useful places you puter, and it uses the 5 input-only lines designers of the card expect you to throw might use this program is to transfer files and 3 of the bidirectional lines to receive it away if you break it. between your laptop and your desktop information from the remote computer. So I've come to this conclusion-if computers. Alas, I don't know what kind It uses the remaining bidirectional line you want to build this project, you of circuit they use for the parallel printer as a handshake, to see when a byte is should buy two cheap printer cards, the port in a laptop, so I don't know if it's available during receiving or to indicate a kind that are about $20 and chock full of safe to use this scheme. However, there byte is ready during sending. TTL chips. I've had success with these, are several packages on the market that The handshake line is configured to and if you have an accident, you'll prob­ appear to use the parallel port to transfer send or receive depending on whether ably only damage one chip, which you files, so it's probably safe. Don't hold me you run the program in send mode or re­ can easily and cheaply replace. to it, though. ceive mode. You must make the determi-

MICRO CORNUCOPIA, #48, July-August 1989 21 nation when you start up the program, by a flag on the command line which in­ Figure l-Parallel Port Transfer Cabling dicates "send" or "receive." Figure 1 shows the line configurations when the Machine A Line Configuration for Machine B Printer Port Machine A Sending Printer Port machine on the left is sending and the DB·25 Connector Machine B receiving DB·25 Conneclor - r-- machine on the right is receiving. / -BYTE RECEIVED The byte organization of the printer -STROBE 1- "- rL- DO DATA 0 "- card lines guided the selection of most of DO 1- / 1- -STROBE DATA 1 "- 01 .L... J..L. -AUTO FEED the wires. I attempted to minimize the DATA 2 ~ bit-twiddling necessary to reconstruct a 02 ~ / J.L -INITIALIZE DATA 3 "- byte from the data on the wires. How­ 03 L- elL -ERROR DATA 4 -~ ever, the handshake line had to be a bi­ 04 §..- J..L SELECT DATA 5 ~ directional line, so the handshake signal 05 1- ~ PAPER END DATA 6 ~ could flow in either direction. The hand­ 06 §..- / ,!L -ACK DATA 7 "- shake line is the printer port's SELECT 07 L- / ~ BUSY INPUT line, pin 17. Notice that pin 17 -ACK 1L 1L- 06 and the ground wires are the only lines BUSY ~ L- 07 left undisturbed from the original cable PAPER END .!L 1...- 05 configuration. SELECT P- §..- 04 It uses an additional signal to indicate -AUTO FEED' ~ .L... 01 that the receiving computer has read the -ERROR ~ L- 03 byte. This signal, however, doesn't need -INITIALIZE ~ ~ 02 -DATA VALID "- to be bidirectional. The receiving com­ -SELECT INPUT pL / lL -SELECT INPUT puter uses the DO line to signal the send­ GND ~ lL GNO ing computer (via the sending com­ GND flL 1L GNO puter's STROBE line) that it has received GND ~ ~ GNO a byte. Note that the receiving computer GND fll- ~ GNO doesn't need its data lines, so they're GND ~ R.... GND available. GND ~ .?L GND The byte-transfer sequence goes like GND ~ E.L GNO this: the sending computer places a byte GND ~ .£L GNO on its printer data port (DO - 07), and lowers its SELECT INPUT line to indicate that data is valid. The receiving computer sees that data is valid, reads the byte, and to "idle." The sender begins each file ceiver lion hold" after the last file is lowers its DO line to indicate it has transfer with a block of information, transferred. This way you can send a successfully received the byte. called a control block. A control block batch of files, move to another sub­ The sending computer sees this, raises begins with the ATTN character (estab­ directory, send some more files, etc. Try its SELECT INPUT line to acknowledge lished by a #define in the header file-an changing the program so you can send that the receiving computer got the byte, ASCII "escape" is used here), which gets messages to the receiver and make it and waits for the receiving computer to the receiver's attention. change directories, too (and even make lower its DO line. When the receiving The word "filename" and several new ones!). computer lowers its ~O, the cycle is pieces of information about the file fol­ completed, and a new byte transfer can low the ATTN. There are only two pieces Software In Turbo C begin. in this program: the file's name and its To understand the code, you'll need size in bytes. Each piece of information is to study Figure 2, the map of the bytes File Transfer Protocol called a "control message." If you want on the parallel printer card. You can see Now that bytes can be transferred, we to add more information (a checkvalue, the pin numbers on the OB-25 connector need a way to transfer entire files. This etc.), simply add more control messages. shown in the cells representing the bits. program uses a very simple file transfer A control message can be any length and The I/O location of the bytes is rela­ protocol, which you might want to im­ is delimited by the characters LOELIMIT tive to a value called BASE, which the prove with some error checking (i.e., a ("{" used here) on the left and jumper selections on your printer card checkvalue at the end of each file), partic­ ROELIMIT {"}" used here) on the right. established. The byte at BASE is the ularly if you're in a noisy environment. When the receiver gets a complete printer data port, which you can write (See Figures 3 through 6 for all the code.) control block, it opens a file and starts and read, although on an unmodified A file transfer goes like this: when the putting bytes into it. It counts each byte card you can only read what you've program starts on the receiving computer until it reaches the size specified in the written. BASE + 1 is read only. BASE + 2 (established by the -r flag), it sets its control block, then it closes the file. At can be read or written. If you want to printer port to "idle" and waits for the this point, the receiver looks for another read bits 0 through 4, you must write a 0 sending computer to say something. You ATTN followed by a new control block. to bits 0, 1 and 3, and a 1 to bit 2. have to start the program on the receiv­ This can be information about the next I know it sounds a bit like voodoo ing computer before you start the pro­ file (so you can send a batch of files) or economics, but you'll have to stare at the gram on the sending computer. the special string "end of transaction." circuit for the printer card (in Computer When the sender (established by the -s The sender can be told, with the -h Interfacing In Pascal & C) if you really flag) starts up, it too sets its printer port flag in the command line, to leave the re- want to understand how it works. Or

22 MICRO CORNUCOPIA, #48, July-August 1989 You Asked for Precision ...

And Tele™ created a World of Possibilities

Berry Computers presents The Tele Toolkit - a complete Operating Systems Kernel

Need to get all possible performance from your embed­ Tele uses overlayed windows to allow independent tasks ded controller? Using tele will save you a lot of work. to share a common display screen. Each task can create Tele measures all tasks with better than 1 usec precision. any number of virtual displays. The operating system then Tele is an operating system requiring the in­ maps rectangles from selected virtual displays to the con­ struction set. sole. Tele's scheme is over 5 times as efficient as the standard BIOS display driver- and the BIOS doesn't Tele is designed to be efficient and precise. It's most im­ do windows. portant features for controlling equipment are multitask­ ing and windows. Full C source code is provided, An MS-DOS file system is also available, but that is a story including diagnostic programs to verify operation. for another advertisement. Tele is available in the follow­ ing components: The multitasking scheduler is preemptive. Tasks are scheduled by an initiator task that automatically Demo Diskette $ 5 (refundable with purchase) reschedules itself. It is easy to customize one or more in­ SK system kernel $50 (multitasking) itiators for specific scheduling algorithms. CD console display $40 (windows, requires SK) FS file system $40 (MS-DOS media, requires SK) The scheduler can easily be locked out, allowing high speed experimental data to be collected during interrupt service. Telephone support is freely available. Another task, running under control of the scheduler, can merge the data with that from other experiments or store The Tele Toolkit is available from: it for later analysis. Multitasking often simplifies program design by reducing or eliminating communication and Crosby Associates synchronization issues. P.o. Box 248 Sutter Creek, California On a 10 MHz processor with 16 bit bus, the Tele task 95685 scheduler requires 5.2% of processor cycles. Because that represents a fixed number of instructions, Tele's overhead CALL NOW TO ORDER: is inversely proportional to the processor clock speed. (209) 267-0362 Therefore it takes 2.6% at 20 MHz. Tele also runs on the original Pc. Visa, Mastercard, American Express ex Discover Card accepted.

MS-DOS is a trademark of Microsoft Corporation

Reader Service Number 147 MICRO CORNUCOPIA, #48, July-August 1989 23 Figure 2-Printer Port Registers

110 Address Bit 7 Bit 6 Bil5 Bit 4 Bit3 Bit2 Bit t BitO

BASE

Pin 9 Pin 8 Pin 7 Pin 6 Pin 5 Pin4 Pin 3 Pin 2

Bit 7 Bit 6 BitS Bit4 Bit3 Bit 2 Bit 1 Bit 0 X = Don't Care BASE + 1 BUSY' ACK~ PE SELECT ERROR~ X X X (Read Only) • ~ Signal Gets Pin 11 Pin 10 Pin 12 Pin 13 Pin 15 Inverted

Bit7 Bit6 Bit 5 Bit4 Bit3 Bit2 Bit 1 Bit 0

BASE + 2 X X ENABLE 'SINP~ INIT~ 'FEED~ 'STRBE~ INT Pin 17 Pin 16 Pin 14 Pin 1

you can just trust me. The code comes with a makefile. To Now here's where I need some reader The software is broken up into func­ build it, simply type "make" (assuming feedback. I'm considering creating a tions: receive_byteO and send_by teO cre­ you've installed Make with Turbo C). printed circuit board so this project will ate receive_filesO and send_filesO, which be easy to build. I suspect there'll be a lot are in tum incorporated into mainO. It's A Design Alternative of interest, but I need a show of hands straightforward except for the bit twid­ With a slight modification to the before I sink my hard-earned money into dling, which you'll just have to stare at board (shown in Chapter 7 of CIWP&C), something like this. The board will in­ until it makes sense (at least, that's what you can tum the 8-bit output-only port clude a complete manual, parts list, and they told me when I was 16 and learning on the printer card into an 8-bit I/O port. assembly instructions (including those to rebuild the transmission on my Then you can use any cable without for soldering, if you haven't done that MG ... ). changing it, and rewrite the software to before), as well as the software and test A problem might arise-what if you control the direction of both 8-bit I/O programs on disk. tell the remote machine to create a file, ports and use pins 1, 14, 16 & 17 as Please call Micro C or write me. I and it can't? I've added one more control handshaking lines. need to know who you are. Do you want line-"Abort" -going from the receiver You could even designate one com­ to do this project? If so, are you the "do back to the sender (Data bit 1). The re­ puter as the "server," and the other as everything yourself" type who wants to ceiver can assert this line if it's having the "client," and use the parallel port in­ build things from scratch, or do you problems and call the whole transaction terrupt (or modify the board to use a want a circuit board and instructions? If off. Check the code to see how it's used. different interrupt). So the client can let you want the board, do you want the the server know it has a request. And the board, all the parts, and the instructions, Faster, If You Have MASM request can be either to send a file or re­ or just the board all assembled and I found that the C code for byte trans­ ceive a file (since you have more than tested? fers was a bit slow. If I had an optimiz­ one handshake line now). This is much Get in touch. I need to make an edu­ ing compiler, perhaps I could have saved tougher, but for those of you who love a cated guess about whether to leap or not. myself some trouble, but instead I wrote challenge and have time on their the time-critical routines in Turbo C in­ hands .... Acknowledgement line assembly. If you make improvements (or, un­ Thanks to OrCAD for their excellent These routines move a block at a time, thinkable as it might sound, bug fixes), circuit drafting program. instead of a byte at a time. The fast trans­ please post them on the Micro C BBS for Editor's note: Bruce often refers to articles fer times are achieved with the assembly all to share. in previous issues. You can get a book of his routines receive_blockO and hardware articles, Computer Interfacing send_blockO. Unfortunately, you must Future Shocks with Pascal & C, and a disk of source code have MASM to make them work. If you I plan to design a board to handle by sending a check for $30 to Micro Cornu­ don't, you'll just have to use the C many interrupts using 8259 interrupt copia, P.O. Box 223, Bend, OR 97709, or routines. controllers (like the one on the mother­ phoning (800) 888-8087 with Visa/Me. board of the XT). All these interrupts will Nails & Glue be fed into a single interrupt line on the To finish the program, mainO must XT bus. The C++ software will make • • • handle an arbitrary number of files and adding a new interrupt almost effortless. allow wildcards in the command line. You just tie a wire to the board, do a little MainO uses the Turbo C library functions software configuration and a little plain findfirstO and findnextO to expand the C programming, and voila-you'll have command line arguments. a new interrupt!

24 MICRO CORNUCOPIA,. #48, July-August 1989 C CODE FOR THE PC source code, of course MS-DOS File Compatibility Package (create, read, & write MS-DOS file systems on non-MS-DOS computers) · $500 Bluestreak Plus Communications (two ports, programmer's interface, terminal emulation) . . $400 CQL Query S~tem (SQL retrievals plus windows) • . . : . • • • • • • . • • . . . . . · $325 GraphiC 4.1 (high-resolution, DISSPLA-style scientific plOts in color & hardcopy) ..•.. · $325 PC all'Ses~Aspen, Software, System V compatible, extensive docum~ntation) •....•. · $290 NEW! Code Base database manager, dBase and Clipper compatibile indes & data tiles; Version 4.0). . . . $260 Greenleaf ata Wmdows (windows, menus, data entry, interactive form designj specify complIer) . . $220 Greenleaf Communi~tions library (inte'!'lpt mode, modem control, XON-XOFFj specify compiler) $175 ThOO'IFX (TRIP certifiedj HP, PS, dot dnvers; CM fontsj La'l£X) • • • • . • . . . • . • . . . $170 Sherloc1C~(C debugging aid) . • . • • • . • • . • . • • • . • . • • . . • ...... $170 CB'free +tree lSAM driver, multi~levariable-length keys) ••...... $165 NEW! AT BIO Kit (roll your own BIOS Wlth this complete set of oosic in{lut/output functions for ATh) .. $160 Greenleaf Functions (296 useful C functions, all DOS servicesj Spec1fy compiler) •. . • • • . • . $160 WKS Ubrary Version 20 (C program interface to Lotus 1-2-3, dBase, Supercalc 4, Quatro, & Clipper) $155 OS/88 ~ ..x-like operating system, many tools, aoss-dcvelopment from MS-DOS) . . • . . • . . . . • $150 ME Vei'slon 21 (programmer's editorWlth Clike maao language by Magma Softwarej Version 1.31 still $75) $140 VmemJC (virtuafmemory manager, least-recently used pager, dynamic expansion of swap file) .., . . . $140 ThOO G Graphics library (all popular adapters, hidden line removal) . . . • ...... • ...... $135 ThrboGeometry (library of routines for computational geometry) • . • ...... $125 Updated! Install 21 (automatic installation programj user-selected partiallnstallationj CRC checking) ...... $120 TB Editor Developer's Kit (full saeen editor, undo command, multiple windows) . . . . . $105 Minix Operating System (U ..x-like operating system, includes manual) . . • . . . . • . $105 NEW! Hyper'lCXt Viewer (simple hypertext systemj mUlti-file documentsj includes Tiny Curses) . . $100 PClIP (CMU/MIT'I'Ql/lP implementation forPCs) .••.•.•.•...... $100 B-1i'ec library & lSAM Driver (file system utilities by Softfocus) • . . . . • . . . . $100 Thle Operating System (ICleKernel, ThleWmdows, ThleFile, & '!eleB'free by Ken Berry) $100 The Profiler (program execution profile tool) ...... • . . • • ...... $100 QC88 C compiler (ASM output, small modd', no longs, floats or bit fields, 80+ function library) $90 C Wmdows 'Ibolkit (pop-up, pull-down, spreadsheet, CGAJEGA/Hercules) ...... $80 JAm Async 'Thrminil EmUlator (includes file transfer and menu 8u~tem) ...... $80 Poly~ot Lisp-to-C 'Ihlnslator (includes Lis!, interpreter, Prolog, and Simple calculus prover) . $80 MulUDOS Plus (DOS-based multitasking, mtenask messaging, semaphores) • • . • • . . . $80 NEW! cvalU (C function to evaluate ASCII infix expression stringj 17 built-an functions) ...... $75 Kinetic lmas.e SYllthesizer (3-D animation system ... Saturday morning on your :PC!) ...... $75 XT BIOS Kit (roll your own BIOS with this complete set of basic input/output functions for X1S) $75 Professional C Wmdows (lean & mean window and keyboard handler)...... $70 Heap Expander (use UM-standard expanded memory as an extension of the heap) . . • . . . $65 Ip (flexible printer driver, most popular printers supported) . . • . • ...... $65 rcon-'Ibols (full-featured icon display and editin$ system) • • • . • . . • . . . $65 NEW! SYSKIT (rommable or TSR debUg/monitor, easily cx:pandaded) • . . • • . $60 Quin~ (mteractive C interpreter) • • . . . . • . . • • . . • • . • . . $60 NEW! Symtab (general-purpose symbol table construction and management package) $60 P'Iree (general-purpose parse tree construction and management package) ...... $60 NEW! Backup & Restore Utili~by Blake McBride (multiple volumes, fife compression & encryption) . . . . $50 SuperGrep (exception~l filst, revolUtionary t~ searching algorit~mj also searches sub~irectories) . . $50 OBJASM (convert .0bJ fi es to .asm files; output IS MASM compatible) ...... $50 Polyglot TSR Package (includ~ reminder, bOokmark, virus catcher, cache manager, & speech generator) $50 HELPI (pop-up help system budder) . • ...... • . . . • ...... $50 MUlti-UserlJBS (chat, mail, me~usl sysop displaYSj uses Galacticomm modem cardj Version 4.1.1) . $50 Make (macros, all languages, bwlt-an rules) . • ...... $50 Coder's Prolog (inference engine for use with C programs) ...... $45 Virtual Memory Manager by Blake McBride (LRU pager, dynamic swap file,' image save/restore) $40 H~ap I/O (!reat all or part of a ~sk fil~ as ~eap storage) . '...... $40 Biggerstaff s System Thols (multi-tasking Wlndow manager kit) ...... $40 OOPS (collection of handy C++ classes by Keith Goden ofNIHj Version 2.2) ..•...... $35 Bison & PREP (YACC workalike Frser generator & attribute grammar preprocessor; now includes documentation) $35 PC-XINU (Comer's XINU operatang system for PC) ...... $35 CUPS (rule-based expert system generator, Version 4.2) .... $35 TIny Curses ~rkeley curses package) . . . • . • . • • . . . $35 POlyglot RAM Disk (Change dIsk size on the fly; includes utilities) . $30 SP (spc:lling checker with dictionary and maintenance tools) . . . $30 Clisp (Usp interpreter with extensIVe internals documentation) . . . . . • . . . . . $30 'Ihllis18te Rules to C (yACClike function generator for rule-based systems) . . . . . $30 6-Pack of Editors (six public domain editors for use, study & hacking) ...... • . $30 Crunch Pack (14 file compression & expansion programs) ...... $30 Pascal P-Code Compiler & Interpreter or Pascal-to-C 1hinslator (Wirth standard Pascal) . . $25 ICON (string and list processing language, Version 7.5) . . • ...... $25 FLEX (fast fexical analyzer generator, new, improved LEX; Version 1.1)...... $25 LEX (lCxical analyzer generator, an oldie but a goodie) ...... $25 Auto1htce (program tracer and memory trasher catcher) •...... $25 Data Handbng Utilities in C (data entry, validation & dlsplaYj specify Thrbo C or Microsoft) $25 Arrays for C (macro package to ease handling of arrays) . $25 A68 (68000 cross-assembler) ...... $20 list-Pac (C functions for lists, stacks, and queues) '" $20 XLT Maao Processor (general purpose text translator) . $20 C/reativity (Eliza-based notetaker) . • . . . • .'. . . $15 Data Updated! GenBank DNA Sequences (Release 59.0j includes demo disk of Pearson FAST/A programs) ...... $150 Protein Sequences (over 10,000 sequencesj includes demo disk of Pearson FAST/A programs) ...... $60 NEW! Smithsonian Astronomical Observatory Subset (right ascension, declination, & magnitude of 258,997 stars) $60 Dictionary Words (234,932 words in alphabetical order, no definitions) ...... $60 U. S. Oties (names & longitude/latitude of 32,000 U.S. cities and 6,000 state boundary points) . $35 The World Oigitized (100,000 longitude/latitude of world country boundaries) ...... $30 KST Fonts (13,200 characters in 139 mixed fonts: specify 1J3X or bitmap format) ...... $30 NEW! USNO Interactive Computer Ephemeris (high-precision moon, sun, planet & star positions) $30 King James Bible (Old and New ThstamentsJ ...... $25 NBS Hershey Fonts (1,377 stroke characters in 14 fonts)...... $15 U. S. Map (15,701 points of state boundaries) ...... $15 The Austin Code Works Voice: (512) 258-0785 11100 Leafwood Lane [email protected] BBS: (512) 258-8831 Austin, Texas 78750-3409 USA FAX: (512) 258-1342 Free surface shipping for cash in advance For delivery in Texas add 7% MasterCard/VISA

Reader Service Number 4

MICRO CORNUCOPIA, #48, July-August 1989 25 Figure 3 - Make File for PXFER.EXE dbyte receive_byte(void) { dbyte data: while ( ! (inportb(BASE+2) & (1«3») # PPXFER.EXE transfers files between computers via # parallel ports, using a special cable configuration. data = (inportb(BASE+l) & Oxf8) 1 # Copyright Bruce Eckel. For non-commercial use only. (inportb(BASE+2) & Ox07): outportb(BASE, Oxfe); /* send BYTE RECD signal */ .c.obj: tcc -IC:\TURBOC -c $*.c data "= Ox83: /* flip "inverted" bits */ ppxfer.exe: ppxfer.obj block.obj while ( (inportb(BASE+2) & (1«3») tcc -LC:\TURBOC -eppxfer ppxfer.obj block.obj ppxfer.obj: ppxfer.c ppxfer.h outportb(BASE, Oxff): /* de-assert BYTE RECD sig */ block.obj: block.c ppxfer.h return data; print: +print ppxfer.h block.c ppxfer.c

• • • void send byte ( dbyte data) outportb(BASE, data): LOWER HANDSHAKE: while( ! (inportb(BASE+2) & 1» { Figure 4 - PPXFER.H if (inportb(BASE+2) & 2) { puts ("aborted by receiver"): #define MASM /* comment this if you don't own masm */ exit(l); #define TIME /* program generates timing information */ } /* Base addr for my modified parallel printer card: */ TESTKEYi #define SPECIAL Ox270 } #define LPTl RAISE HANDSHAKE: #define LPT2 while-( inportb(BASE + 2) & 1) { #define HERC Ox3bc if (inportb(BASE+2) & 2) #define MGA HERC ( puts("aborted"); exit(l): } #define BASE SPECIAL TESTKEY; typedef unsigned char dbyte; #define ATTN 27 /* "attention" character (escape) */ #define LDELIMIT '{' /*left delimiter for cntrl msgs*/ #define RDELIMIT '}' /*right delimiter for cntrl msgs*/ void send string( char * string) { #define BUFSIZE 1000 while (*string) ( send byte(*string): #ifdef MASM string++: /* assembly-language routines in block.c. These send blocks of dbytes quickly for fast file transfers */

/* Send a block of dbytes. Send "count" dbytes, located void usage(char * msg) { in "buffer" */ puts ("\nusage: ppxfer -s filel.ext ... "); void send_block(dbyte * buffer, unsigned int count); puts(" to send files through the parallel port \ using the special"): /* Receive exactly "count" dbytes; place in "buffer" */ puts(" cable configuration, (the list of files \ void receive block(dbyte * buffer, unsigned int count); can be any length;"): #endif MASM - puts(" wildcards may be used in the file name) \ or:"); puts("ppxfer -sh filel.ext ... "): • • • puts(" to send files and leave the receiver on \ hold so other"): puts(" files may be sent, or:"): puts("ppxfer -r"): puts(" to receive files."): Figure 5 - PXFER.C puts(msg): exit (1): #include #include #include void send file(char * unambiguous name) #include int i, infile; - #include unsigned long filesize, readsize: #include char buf[30]: #include dbyte filebuf[BUFSIZE]: #include long secs_start, secs_end: /* for timing */ #include /* to calc transfer speeds */ #include "ppxfer.h" /* header file with defs */ if «infile = open(unambiguous_name,O_RDONLY o BINARY» < 0 ) { dbyte base~lus_two; /* global so output value at puts("cannot open file to send:"): BASE+2 doesn't accidentally get changed */ puts(unambiguous_name): #define RAISE HANDSHAKE exit(l): (outportb(BASE+2, base-plus_two &= -(1 « 3») #define LOWER HANDSHAKE filesize = lseek(infile, OL, 2): /* find file size */ (outportb(BASE+2, base-plus_two 1= (1 « 3») lseek(infile, OL, O)i /* reset file ptr to start */ #define TESTKEY if (kbhit(» break ultoa(filesize,buf,10): idle () ; /* Prints a byte in binary (for testing): */ send byte(ATTN)i /* send an escape */ void print_binary(dbyte c) { send-string("filename"): send byte(LDELIMIT): int i = 7; send-string(unambiguous name): send byte(RDELIMIT): do printf("%c",c & (1« i) ? '1' '0'); while(i--)i send-byte(LDELIMIT): - - send-string(buf): send byte(RDELIMIT): printf("sending %-15s -size: %s bytes: ", /* Set the channel to the "idle" state: */ unambiguous_name, buf): void idle(void) { #ifdef TIME outportb(BASE,Oxff); /* all lines high */ time(&secs start): /* initialize for all inputs (handshake is high): */ printf("starting time: %d\n", secs_start): outportb(BASE+2, (base~lus_two = Ox04»; #endif TIME while«readsize = read(infile,filebuf,BUFSIZE» > 0)

26 MICRO CORNUCOPIA, #48, July-August 1989 #ifdef MASM if (argc < 3) usage("not enough arguments"); send block(filebuf, readsize); for(i = 2; i < argc; i++) ( #else MASM /* without MASM, do it the slow way: */ done = findfirst(argv[i],&file_block,O); for (i = 0; i < readsize; i++) while (!done) ( send byte(filebuf[i]); send file(file block.ff name); #endif MASM done-= findnext(&file_block); close (infile) ; #ifdef TIME ) time (&secs end); if (argv[l] [2] 'h') printf("ending time: %d\n", secs_end); (puts("receiver ready for more files"); exit(O);) printf("%f Kbytes/sec\n", send byte(ATTN): (filesize/1000)/(secs_end - secs_start»; send-string("end of transaction"); #endif TIME send:byte(LDELIMIT); ) void receive_files (void) char c; • int i,j, outfile; • • unsigned long incr, filesize, byte count , readsize; char buf[30], filename[30]; dbyte filebuf[BUFSIZE]; Figure 6 - BLOCK.C idle () ; while (1) #pragma inline while ( receive byte() != ATTN ) #include "ppxfer.h" if (kbhit(» if (getch() == 27) exit(l); #define SVE asm push AX; asm push BX; asm push CX;\ /* hunt for ESC from the port or the keyboard */ asm push ox: asm push F; for (i=O; (c = receive byte(» != LDELIMIT; ) #define RST asm pop AX; asm pop BX; asm pop CX;\ buf[i++] = c: - asm pop ox; asm pop F; buf[i] = 0; /* end of control string */ if (strcmp(buf,"end of transaction") == 0) void receive_block (dbyte * buffer,unsigned int count) { puts ("end of transaction"); CX count; exit (0); :BX = buffer; OX = BASE + 2; if (strcmp(buf,"filename") == 0) waitl: asm in AL,OX; for (i=O; (c = receive byte(» != RDELIMIT: ) asm test AL, 00001000B; filename [i++] = C; - asm jz waitl; /* wait for handshake to drop */ filename[i] = 0: hshake_lo: asm dec OX; /* BASE + 1 */ for (i=O; (c = receive byte(» != LDELIMIT; ) asm in AL,OX; ; /* throwaway char; until left delimiter */ asm and AL, 11111000B; /*mask off pertinent bits*/ for (i=O; (c = receive byte(» != RDELIMIT; ) asm mov All,AL; /* stash it */ buf[i++] = C; /* store until right delimiter */ asm inc OX; /* BASE + 2 */ buf[i] = 0; asm in AL,OX; filesize = atol(buf); asm and AL, 00000111B; /* rest of byte */ printf("receiving %-15s size: %s by tes\n" , asm or AL,AH; /* combine the byte */ filename, buf); asm xor AL, 10000011B; /* flip "inverted" bits */ if «outfile = open (filename, O_WRONLY I asm mov byte ptr [BX] , AL; /* store the result */ ° BINARYIO CREAT, S IREADIS IWRITE» < 0) asm inc BX; /* move pointer to next mem location */ putsC"cannot open output file"); _OX = BASE; outportb(BASE,Oxfd); /* set "abort" line */ asm mov AL, 11111110B; switch (errno) ( asm out OX,AL; /* lower "byte recd" line */ case ENOENT: OX = BASE + 2; puts ("path or file name not found"); break; wait2: asm in AL,OX; case EMFILE: asm test AL,00001000B; puts ("too many open files"); break; asm jnz wait2; /* wait for handshake to rise */ case EACCES: OX = BASE; puts ("permission denied"): break; asm mov AL, 11111111B; case EINVACC: puts ("invalid access code"); asm out OX, AL; /* Oe-assert "byte recd" */ OX = BASE+2; exit(l); asm loop waitl;

for (incr = (signed) (filesize - BUFSIZE) > 0 ? BUFSIZE : filesize, byte count = 0; void send_block (dbyte * buffer, unsigned int count) { bytecount < filesize; CX count; bytecount += incr, :BX = buffer; incr = filesize-bytecount > BUFSIZE ? BUFSIZE OX = BASE; filesize - bytecount ) ( send: asm mov AL,byte ptr [BX];/* get a byte to send */ receive block(filebuf,incr); asm inc BX; write (outfile, filebuf, incr); asm out OX,AL; OX = BASE + 2; close(outfile); asm mov AL, 1100B /* lower handshake */ asm out OX,AL; wait3: asm in AL,OX; /*wait for "byte recd" to go low*/ asm test AL,l; asm jz wait3; void main (int argc, char * argv[]) { byterecd: asm mov AL, 0100B; /* raise handshake */ struct ffblk file_block; asm out OX,AL; int i, done; wait4: asm in AL,OX; asm test AL,l; /* wait for byte recd to go high */ if (argv[l] [0] !='-' II (argv[l] [1] !='s'&&argv[l] [1] != asm jnz wait4; 'r'» usage("use '-s' or '-r'''); _OX = BASE; /* receive files: */ asm loop send; if (argv[l][l] == 'r') receive files(); /* send files using wildcards: */ if (argv[l] [1] == 's' ) ( • • •

MICRO CORNUCOPIA, #48, July-August 1989 27 LIMBO Motors On Gentlemen, Gather Your Parts

system specifications make pretty pic­ Dimensions If you'd like to build the ultimate maze tures, but lousy robots. Yes, I believe in As a rule of thumb, LIMBD's widest machine, does Bob have a project for you. structured programming, and I try not to point should be no more than about 2/3 This is Part 2, continuing the design. use global variables on Sundays. I just of the passage width, or 14.5". (The pas­ don't think structured design works very sages are 22".) Its turning radius should well in motion. be less than 11", half of the passage obots are cantankerous creatures, Unlike well-written procedures, the width. lord love' em. Robotic Behavior is subsystems of a robot interact through My observations of other robots in Rconstrained by the sweaty physi- the hairiest global variable of all, the real maze contests told me that LIMBO cal world in ways no respectable micro world. Motors affect batteries, batteries should be circular (as viewed from could long endure. Micros sit safely on affect electronics, electronics affect mo­ above) with no projections to hang up. the desk, gentle breezes fanning their tors, and 'round you go. The mechanical bumpers would have to warm parts-while robots grub about At the same time, you have to begin fit smoothly into LIMBO's body, be the floor dodging dust bunnies and somewhere. The iterative design ap­ rugged, and be easy to build. Twinkie wrappers. proach I use is more like a conversation After a few weeks of searching, I Micros dreamily contemplate the frac­ than a hierarchical list. found that plastic trays used to catch talness of the Mandelbrot set-while I "talk" to my robot by adding or water leaking from flower pots were robots bumble about the room, some­ changing a subsystem. The robot replies ideal. The tray I chose for LIMBO is a times finding their goal, sometimes find­ by working or not. I try to keep the itera­ "Super Pot" with the ''TerraPot'' brand­ ing the basement instead. (Any robot can tions short and frequent. name. The diameter of this tray is about

+

Surplus IMC Magnetic Steppers. Flux-gate Magnetometer Compass. Training Wheels and Swivel Castors. go down stairs. Coming back up is The first thing to ask an unborn robot 13.5", perfect for the maze. The tray is harder.) is, "What's your function?" Most times I also sufficiently flexible to allow the Micros live forever, ending their use­ get a murky answer. With the LIMBO bumpers to bend quite a bit without ful days resting contentedly on a high robot, the answer was a crystal clear, damage (and soak up shocks that the closet shelf-while robots' lives are con­ "Running mazes faster than Murphy." electronics would otherwise have to ab­ stantly threatened by vibration, power With the function known, I settled sorb). spikes, and disrespectful puppies. down with a copy of the Robots Thru the I found this brand tray in three differ­ Maze rules (for a copy, contact the Seattle ent garden supply departments of dis­ Designing A 'Bot Robotics Society or see it on the Issue #48 count stores in Seattle for under $2. I got Designing a robot from scratch is not disk or the Micro eBBS, 503-382-7643 several because I knew LIMBO would a linear, top down process. Hierarchical 24 hr. N, 8, 1). tell me that I cut the first tray wrong.

28 MICRO CORNUCOPIA, #48, July-August 1989 By Bob Nansel 816 North lOSth St. Seattle, W A 98133

When you plan on making mistakes, you Batteries stand a fair chance of correcting them. Lead/ acid gelled electrolyte cells have Now I had basic dimensions and an energy density of about 16 watt-hours some fine flower pots. The next step was Unlike well-written per lb. Two phases of each stepper to select a motor drive. would be energized at anyone time, for procedures, the a current draw of 4 amps. The electronics Stepper Motors could be expected to add another amp, I chose stepper motors for the con­ subsystems of a for a total of 5 amps. This current multi­ venience of open loop operation. A look plied by the time LIMBO could spend through catalogs of new motors quickly robot wandering through the maze would give showed that this convenience would be the required amp-hr. rating (hence expensive. Okay, how about the surplus interact through the weight) of the battery. market? With each run limited to 10 minutes, I found a likely motor in the C&H hairiest global three runs would be half an hour at 5 Sales catalog, an IMC Magnetics #023- amps, or 2.5 amp-hr. Choosing a 6 volt 2024-12. This stepper is a 5V, four phase variable of all, the battery system for the sake of the 5 volt unit with 200 step/rev. The catalog listed steppers, that meant a minimum battery running torque as 35 oz.-in. and the real world. weight of about one lb. (6V x 2.5 amp-hr. holding torque as 53 oz.-in. with a cur­ = 15 Watt-hr.). But, each contestant rent draw of 1 amp per phase. The di- would get three runs through the maze, I )) . ) }

+

Prototype of Driver Board. Test Set-up in Dangling Wire Stage. LIMBO mensions are 2.25" dia. x 2.05" deep, process that you must make a few in­ so more battery mass would be required. plus two 1/4" shafts, front shaft .7" long, formed guesses. Panasonic makes a 6 volt, 10 amp-hr. rear shaft 1.55" long, for a total length of I reckoned by guess and by golly that rated battery, which would give two 4.3". Two of these beauties would easily LIMBO would weigh in somewhere hours total running time. This allows fit within the 13.5" bumper contact skirt. around eleven pounds. Five pounds of four contestants to complete three maxi­ Price: $22.50. that would be stepper motors and struc­ mum time limit runs each before LIMBO But how well would these motors tures; most of the rest could be allotted to would pass out with a drained battery. work driving LIMBO around the maze? the battery. I arrived at these figures by The Digi-Key catalog lists this battery That would depend on how much robot considering power consumption versus (#P170) as weighing 3.86 lbs. and priced they would have to move. This is the first battery life required for a day at the at $19.35. of many times in the robot design races. I decided for the sake of cost to use

MICRO CORNUCOPIA, #48, July-August 1989 29 just one of these batteries. LIMBO con­ (except for the new apple flavor ... ). testants would be advised to provide Fine. Push it with a pound of force, their own fully-charged batteries during and LIMBO will accelerate at 1/10 gee. the competition to assure adequate But what does that mean in terms of mo­ power reserves for the inevitable pre­ tors? Now we talk torque. and post-contest fiddling and demonstra­ The relevant torque here is the stepper tions. After sensors and software, batter­ motor holding torque. This is the torque ies are the weakest link in robotics. (Now developed by the stepper when the rated about that cold fusion ... ) DC currents flow continually to two of the phases of the four phase motor. The A Moving Moment (Of Force) holding torque happens to be the maxi­ Would the steppers move an 11 lb. mum torque of the stepper, 53 oz.-in. LIMBO? By Newton's formula, F=ma, here (0.374 N*m). the force required to accelerate a mass is But torque alone can't move LIMBO. given by that mass times the acceleration There has to be a way to translate that of the mass. A good sports car will accel­ rotational torque into a linear force, and 2 erate at half a gee, about 16 ft./sec. • To

Figure 1-LIMBO Drive System

Print PostScript Language Text and Graphics On~~o4-ANY Printer

Motion

GoScript Software, the Low-Cost PostScript Language Printing Solution

Choose the one that fits YOUR needs: GoScript - $195 - With 13 Fonts! GoScript Plus - $395 - With 35 Fonts! Both include our High Quality, Scalable Outline Fonts keep from spinning its wheels and get­ wheels are the simplest answer. The size ting lost in the maze (despite the wheel to use should be about 1/3 the *Includes Drivers for: NEC Pinwriter; "LIMBO" name), it would be better if maximum diameter of LIMBO; 4" would HP LaserJet, DeskJet, PaintJet; Canon LBP-811, BubbleJet BJ130; LIMBO accelerated at a more sedate 1/10 work well, but 5" wheels are easier to Epson LQ and FX; Toshiba 24-Pin; gee, 3.22 ft./sec ..2 come by. Fujitsu DL 24-Pin; Panasonic KX 24-Pin; To calculate the force required to ac­ The linear force developed by the IBM ProPrinter, Quickwriter, Quietwriter 2 celerate 11 Ibs. at 3 ft./ sec. , you need to wheel at the ground is F=T /r. ''T'' is the ORDER TODAY! first convert the 11 lb. weight to a mass. torque, "r" is the radius of the wheel (see Contact Your Local Dealer In the English system of units, mass is Figure 1). Plug in the values for torque measured in the unfortunately named and wheel radius, and you get F=(53 oz.­ or call the LaserGo Order Line unit, the "Slug," which is just the weight in.)/(2.5 in.) = 21.2 oz. for each (800) 451-0088 (outside Calif.) divided by 1 gee (32.2 ft./ sech. motor/wheel combination. Since LIMBO In Canada, Contact: COP Communications, Toronto, ON, TEL: (416) 323-9666 FAX: (416) 323-3878 An 11 lb. weight corresponds to a uses two such motor/wheel combos, Exclusive European Distributors: Graphic Sciences Ltd., mass of 0.342 slug, and the force required each will contribute 21.2 oz. of force, for Surrey, England TEL: (01) 940-9480; FAX: (01) 948-2851 to accelerate it is F=ma=0.342 slg x 3.22 a total of 42.4 oz., or 2.65 Ibs. 2 LLaserGo, Inc ft./sec. : 1.10 lb. I prefer to use SI units It looks as if our motors are more than TEL: (619) 530-2400 because, like most right-minded people adequate. To be sure, we need to make (~ in the Pacific Northwest, I hate slugs: F = the same series of calculations using the U FAX: (619) 530-0099 2 9235 Trade Place, Suite A, San Diego, CA 92126 5 Kg. x .981 m/sec. = 4.9 Newtons Running Torque, which is less than the laserGo, GoScnpt are trademarks of LaserGo, Inc. PostScnpf® IS a regIstered trademark of Adobe Systems. Inc. All other product names are trademarks of their manufacturers (round up to 5 N). I like Newtons better holding torque (after all, we do want Reader Service Number 144 30 MICRO CORNUCOPIA, #48, July-August 1989 LIMBO to move around). A few strokes (1) Bumper contact sensor array BORLAND PROGRAMMERS! of the calculator will reveal that the force (2) Battery power supply produced by the two wheels acting (3) Drive system under this torque is 28 oz., or 1.75 lbs., (4) Flux-gate magnetometer compass which still gives us plenty of margin. (5) Infrared range-finder array the (6) Status console Training Wheels (7) Controller I've found injection molded plastic Since this is a computer-oriented ma­ training wheels work best for maze gazine, you may think it odd that I list simplest robots (especially young robots). These the controller last. Surely the controlling are available in any K Mart for under $8 intelligence of the robot should be first a pair, so you don't have to steal from on the list? most your kid's bike. The utility wheels nor­ I purposely leave the controller until mally sold in hard ware stores and gar­ last because it, among all the subsystems, den supply centers are too big (the small­ is the least affected by the gritty environ­ complex est are usually 6" dia.) and have ball ment a robot lives in. In effect, I design bearings, which make it impossible to tools Figure 2-LIMBO Subsystems you will ever use

to create a user-friendly interface between

your program and the computer operator.

Thirty functions provide for the design and

control of menus in either a text or graphic

screen and the number of menus is limited

only by your computer memory. Menus sup- drive them directly from the shaft of a robots from the outside in, sensors and port only C & Pascal. Create bit-mapped motor. The training wheels require a motors first, controlling electronics and 3/8" shaft, but the shafts on the motor software last. It works. screen fonts, icons & graphic mouse cursors. are only 1/4", so we'll have to build up The bumper contact system consists of the diameter of the motor shaft. a bumper skirt (the flower pot tray) and The keyboard or mouse will control the pro- Another thing: these wheels are eight snap-action microswitches, plus gram flow. CREATIVE INTERFACE TOOLS is made-in-Taiwan specials, so examine some supporting structure. The battery several pairs closely before buying. You'll power supply includes the battery, yours for only $59.95 want to select the truest, most uniform power conversion circuitry, distribution pair you can find, but there will still be wiring and fuse protection. The drive variations between wheels which soft­ system consists of one stepper motor and ware will have to compensate for. (I one wheel each for left and right, as well didn't say this would be easy, just fun). as swiveling castors, front and back, 1126 S. CEDA~ RIDGE. SUITE 115 DUNCANVILLE. TX 75137 mounted on a simple suspension. 1-800-622-8366 214-298-1384 FAX 214-709-7674 Back To The Design The flux-gate magnetometer compass Now that we have a better idea of the will either be a modified unit available All user modules furnished as source code No run·time system No royalty size, shape, and motive power of LIMBO, from Radio Shack or a home-brew ver­ fee. System requirements: PC. XT. AT. CGA. EGA. VGA. DOS 2.t or greater. 364K RAM. Output routines provided for Turbo C 1.5 & 2.0. Turbo we can skip back up to a higher, more sion. (I'm still evaluating cost vs. per­ Pascal 4.0 & 5.0. TUrbo Prolog 2.0 & Turbo Ba.ic 1.1. MAXX DATA and CREATIVE INTERFACE TOOLS are trademark. of Maxx Data System •. Inc. abstract level of design. LIMBO consists formance between these two options.) Other brand or product names are trademarks or registered trademarks of of seven subsystems (see Figure 2): The presence of ferrous materials such their respective holders. Copyright C 1989 by Maxx Oala Syslems. Inc. Reader Service Number 151 MICRO CORNUCOPIA, #48, July-August 1989 31 as pipes, conduits, and rebar in concrete naturally affects magnetic sensors; To minimize the affects of local distortions Figure 3a-Range Equation in the Earth's magnetic field, the flux­ gate coil will be mounted on a central mast so that it will be at least 36" from any ferrous objects in the floor or maze walls. Further, to guard against magnetic distortions caused by very large steel structures, the compass should only be VA-~------R2 -----r-----t~~~1 used for relative heading readings when making turns. As long as LIMBO turns about its own center, relative change in heading is sufficient to make accurate turns-the ab­ solute heading indicated by the compass is unimportant. Unless the contest area is known to be free from distortions, though, don't try to maintain an absolute heading while the robot is in linear mo­ tion.

Infrared Range I described the IR range-finders last (Rl +Ro )4 1:1. time, but it wouldn't hurt to review. The R14 P2 idea is to J;l1easure reflected IR with two sensor / emitter pairs a known distance apart (see Figure 3a). The two sensor / emitter pairs are aimed roughly along the same line of sight, so the sensor closest to the object will receive the strongest signal. The equation in the figure shows that the ratio of the fourth power of the received Figure 3b-Logarithmic Signal Compression. signal strengths determines the distance to a diffusely reflecting object. Unfortunately, signal intensity varies as the inverse fourth power of the dis­ tance from the wall giving at least a 3-de­ cade dynamic range for distances from 0- 22". On the controller side of things, it IR would be nice to digitize this signal with Sensor/Emitter a cheap 8-bit converter. (You see, I do a-bit To AID Controller think a little about the controller at this stage; like I said, this is not a linear process). But 8-bits is clearly not enough resolution to digitize signals accurately with more than a 1:1000 dynamic range. I haven't even mentioned the necessary IR Sensor/Emitter math routines. What to do? An elegant solution presents itself. Re­ member those peculiar tables in the back of high school algebra texts, those log-a­ rhythms? (This is not the name of a dirt band, really.) If I take the log of a signal, it's the same as compressing the dynamic range of that signal. I can do this with a logarithmic amplifier. Once in the loga­ rithmic domain, I'll perform multiplica­ tion or division by adding or subtracting the logarithms of the numbers I'm so keenly interested in. Powers and roots are found almost as

32 MICRO CORNUCOPIA, #48,lu1y-August 1989 easily with single multiplications or divi­ ting system memory, changing run num­ tiprocessing, and will encourage the sions. In order to get the full benefit of ber, or sending LIMBO tumbling off the development of modular subsystems (vi­ using logarithms, however, I should use table. sion, anyone?). a different form of the equation (see Fig­ Besides the keyswitch, "Start," On a more mundane level, I've in­ ure 3b). With this equation, a simple al­ "Stop," and "Reset" switches are part of cluded an R5-232 port for debugging gorithm leaps forth: the console, performing the functions of from a terminal. Finally, the software will (1) Read converted values for 10g(Pl) starting a run, stopping a run, and reset­ include a monitor running under a multi­ and log(P2). ting LIMBO for a new series of runs. tasking real-time operating system. I'll (2) Subtract the second from the first. have a lot more to say about the control­ (3) Use the above result to index into a The Controller ler in future issues. lookup table of ranges. The last subsystem, the controller, is a Next time, LIMBO stops looking so Even I can understand a program like single board computer expressly de­ much like a garage sale and more like a that. But I get ahead of myself. signed for LIMBO. It uses a 10 MHz robot when we build stepper drive The next subsystem to consider is the HD64180 CPU from Hitachi, 64K CMOS boards (PC layouts included) and as­ Status console. A 7-segment display static RAM, 64K CMOS system EPROM, semble the motor box. We'll also fabri­ shows the current operating status of and a 28-pin ZIF socket for the competi­ cate the bumper contact skirt, wire the LIMBO: "r" for "Ready"; "S" for tor's firmware. switches, and more. "Stopped"; ''L'' for "Locked"; ''b'' for There are 48 bits of parallel I/O, 22 of low battery. Digits 1 through 3 show the which are available for expansion. A Mail Order Firms number of runs executed through the Counter /Timer chip generates the pulses maze. to drive the left and right stepper motors, C&H Sales Company "Ready" denotes that LIMBO is ready so the CPU needn't spend time twiddling P.O. Box 5356 to start a run through the maze. bits just to run the motors. An 8-bit AID Pasadena, CA 91117-9988 "Stopped" shows after a completed run, chip with 16-channel MUX handles the (800) 325-9465 and "Locked" indicates the keylock flux-gate compass, 8 IR sensor/emitter switch is in the "Locked" position. pairs, and battery voltage and battery Digi-Key Corp. This last is essential when the robot is temperature sense (very important). 701 Brooks Ave. South in a public maze contest because every­ Although there are extra I/O lines P.O. Box 677 one wants to touch a "real robot." The available, most of the expansion will Thief River Falls, MN 56701-0677 keyswitch interlock allows said touching probably be via the high speed multi­ without such embarrassments as reset- drop RS-485 port. This will facilitate mul- •••

GRAPHICS Break Out of the Text Barrier with your Here, (GA, EGA, or YGA

~ PC)( PROGRAMMER'S TOOLKIT $195 Over 55 routines to display, save, print PCX bitmapped graphics - Fast, easy to use - Display windows or full screen - Image library manager­ use images from Paintbrush, Scanners, Clip-Art, or Capture Screens - No Royalties I sag 0/111 ~ PC)( TEXT $99 Display text in any graphics mode - Ineludes 12 1\.eservation fonts - Create custom fonts with dual font editor - All packages support 12 User input routines - Font scaling - Additional 'Deadlines compilers for fonts available. Port .9t[6erni, 13.C., Canada ...... June 15 BAS, PAS,C, ':RgcKy Mountain, (junnison, Co...... Ju[y 1 FOR,ASM ~ PC)( FIX $99 and Clipper. Add Special Effects ('FX')1 Fade, wipe, push, roll, SO(j 'East, t]'or~ Pent1.5y[vannia ...... 9tugust 1 Source slide, split, crush, spiral, explode your graphicsl Longfiorn, 'lJa[[as, 'Te~as ...... Sept.15 available. Palette manipulation - Animation - Sound Effects

See .9t[[ tfie 'lJetaifs on pages, 83·85.

MICROPROGRAMMING 11315 Meadow Lake • Houston, Texas 77077 • (713) 870-0737

MICRO CORNUCOPIA, #48, July-August 1989 33 PCX Compatibility Trying To Create A Graphics File Standard

"cutout" (smaller than the screen) file. you can create with programs like these When is a standard a standard? When When Zachmann decided to implement (which create vector-mapped images) are there are many incompatible versions run­ his compression algorithm, he intended limited. And sometimes you need the bit­ ning around. When is a standard an im­ to only compress PCX images. Eventu­ mapped images generated by programs pediment? When it outgrows its intended ally, he compressed both, and PCC and like PC Paintbrush. (As far as I know, no use. How does the pcx file format fit into PCX images are now in the same format. toolkits exist for displaying vector­ this picture? Read on. Since then, the PCX format has be­ mapped images from within your appli­ come a widely-supported graphics stand­ cations. So a vector-mapped project starts ard-partly because major OEM hard­ by reinventing the wheel.) n the PC world there's a plethora of ware vendors, such as Tecmar and Mi­ As long as we have different video "standards" for storing graphics im­ crosoft, bundle PC Paintbrush with their modes, we'll have problems with Iages. The most popular standards are video boards and mice. graphics applications. I don't want to TIFF (Tagged Image File Format), GIF Z50ft has also managed to support sound unsympathetic, but 1'd like to en­ (popular on Compu5erve and BB5s), hundreds of display adapters, printers, courage developers to move their sup­ and PCX. The PCX format has emerged scanners, and drawing devices-making port to higher resolutions (EGA and as a de facto industry standard, largely PCX a very widely-used format for stor­ VGA) instead of CGA. Programs that try because of the wide range of 'software ing bit-mapped images. to support the lowest common denomi­ packages and hardware device drivers nator are forever penalizing the users of that support it. Device Dependence higher resolution monitors. I think EGA ZSoft Corporation originally de­ PCX is a "device dependent" for­ should be the new bottom end. veloped the PCX format for its PC Paint­ mat-meaning that an image created on brush family of products. Most desktop a CGA will only look right on CGA (or The Format publishing programs (such as Aldus CGA mode). Likewise, a picture created A PCX file is identified by a PCX or PageMaker and Xerox Ventura), paint using a VGA 16-color mode can't be dis­ PCC extension, and a OAH (10 decimal) and scanning software, fax boards, clip played on a CGA (i.e., 2-color or 4-color as the first byte of the file. The PCC ex­ art, and file conversion programs can mode). This causes some problems for tension merely identifies the image as a read it. Although Z50ft makes the format developers who want to support Her­ partial screen image, or cutout. The first of PCX images known, developers (like cules, CGA, EGA, VGA, and extended 128 bytes of any PCX or PCC file consists myself) have had to start from scratch VGA modes with one image file. Put of an image file header. This header de­ when writing PCX routines. simply, you can't support all modes with fines the width and depth of the image, So you won't have to reinvent the one file. the number of planes, the bits per pixel, wheel, I developed a PCX toolkit which One way around the problem is to and other information necessary for re­ allows you to manipulate PCX images draw two copies of every image-one for creating the image (see Figure 1). from within almost any program. While CGA and one for EGA/VGA modes. developing the toolkit, I uncovered some Another is to use only black and white Run-Length Encoding interesting information about PCX im­ images which can be displayed on any After the header comes the image ages which 1'd like to share. adapter. But black and white alone won't data. An uncompressed CGA screen solve the problem since the display's takes 16K, an EGA 112K, a VGA 154K, Some History aspect ratio will distort the image, elon­ and some extended VGA screens can be Mark Zachmann, Z50ft's founder and gating circles ... as large as 480K or more. A scanned, 8 president, invented PCX and PCe. He To achieve device independence, you 1/2" x 11" 300 dpi 8-bit grayscale image chose the name "PCX" because it must use a graphics primitive package. would require 8.5 MB! Fortunately, a sounded like "PICTURE." In early This means you must create the image method called Run-Length Encoding development, PCX was an uncompressed with lines, circles, squares, etc., then re­ (RLE) compresses PCX image data. format. But at the eleventh hour, as Z50ft draw it later on the screen. You've seen In RLE, any repeating data is stored as was about to release PC Paintbrush 1.0 in this method used in CAD/CAM pack­ a count byte and a data byte. If, for ex­ 1983, Zachmann decided to adopt a run­ ages and programs like Micrografx De­ ample, 60 bytes of the image repeat, only length compression algorithm. signer. 2 are stored instead of 60. This will save The extension "PCC" designated a Unfortunately, the types of drawings (here) 97%.

34 MICRO CORNUCOPIA, #48, July-August 1989 By Chris Howard Genus Programming 11315 Meaaow Lake Houston, TX 77077

What's A Palette, Anyway? Figure.1- PCX File Header Display palettes have always been a bit of a mystery but they're conceptually typedef struct pcxheader ( char manuf; /* Always =10 for Paintbrush simple, analogous to a painter's palette char hard; 1* Version information (where the term comes from). Although char ancod; 1* Run~length encoding (=1) the painter may have thousands of jars of char bitpx; 1* Bits per pixel unsigned xl; 1* Picture dimensions (incl) paint on his shelf, he can only fit a unsigned yl; limited number of colors on his palette. unsigned x2; On an EGA, you can choose 16 colors un$igned y2: unsigned hresj 1* Display horizresolution *1 for your palette, out of 64 possible colors unsigned vreSi 1* Displayve:rt resolution */ (or jars). The VGA can display 256 colors char clrma(48); 1* Pallete *1 out of thousands. char vmode: 1* (iqnored) *1 char nplanesj 1* Nuinberofplanes (ver 2;5",0)*1 unsigned bplin; 1* Bytes per line -I eGA unsigned palinfo; 1* Palette Info (l"'col, 2=gray)*1 unsigned shres; 1* Scanner resolution *1 The first byte of the eLRMA array is unsigned syres; 1* *1 the eGA background. The top four bits char xtra[541i 1* Extra space (filler) *1 of the byte represent a background color PCXHEADER; between 0 and 15. The fourth byte of the array is the eGA foreground palette. The upper 3 bits control the palette settings as follows- Here's the pseudo-code for data un­ ... repeatcount on compression- write count byte bit 7: Color burst o = color write data byte 1 = mono For each byte read X, end if bit 6: Palette o = yellow if top 2 bits of X are 1, then end if 1 = white repeatcount=(6 low bits of X) bit 5: Intensity o = dim data = (next byte after X) For a compression scheme, the pex 1 = bright else format is as straightforward as they repeatcount = 1 come. It could be used to encode almost EGAIVGA 16 color data = X any kind of data-but is really only effec­ The palette is stored as 16 triples. A end if tive where bytes repeat, such as image triple is a three-byte value representing data. RGB-one byte of red, one of green, and The data compression algorithm is ex­ one of blue. On the EGA and VGA, there actly the opposite- Finding The Data are four levels of Red, four of Green, and You might assume that you'd display four of Blue. Divide each byte by 4 to get For each byte read Y, an image by reading a byte, testing it, the appropriate level, as follows- if byte Y = next byte, then writing it to the display, etc., until you repeatcount = repeatcount+l reach the end of the file. But this method Divided Bvte Level Xx else has a serious problem-data isn't always if (repeatcount = 1), then contiguous. 0 - 63 Level 0 00 if top 2 bits of Yare 1 Sometimes you may include extra 64 -127 Level 1 01 set top 2 bits of ... data at the end of each scan line, to 128-192 Level 2 10 ... repeatcount on round the number of bytes per line to an 193-254 Level 3 11 write count byte even word boundary. You may also in­ end if clude extra data at the end of the file, To format this as a BIOS palette value, write data byte either to round the number of lines up to which expects a byte formatted as else a multiple of 16, or for additional palette OORGBrgb, takes some bit manipulation. set top 2 bits of ... data. Use the Xx value above to match the

MICRO CORNUCOPIA, #48, July-August 1989 35 level to the appropriate bit values. For in­ Maintaining A Standard (3) Design an expandable header. stance, a Red level of 2, a Green of I, and When anything claims to be a stand­ Fixed length headers may be easy to a Blue of 0 yields a byte of 00100010. ard, we generally infer that it's well-de­ write, but lead to dead ends. The fields fined, accepted, and supported. With always remain constant (i.e., at the same VGA 256-Color PCX, the format meets two of those locations) at the top of the header. One of The VGA palette format for 256-color three: it's accepted and supported, but the fields is, of course, a "header length" modes won't fit in the CLRMA array, it's not well-defined. field. This allows for header expansion at since it takes 768 bytes. For awhile, ZSoft In other words, there's no outline (in any time (say, to accommodate that 1024 didn't support the 256 color palette. It my opinion) for future revisions, and no color palette .. .) for new fields. Programs then started storing the palette in the sep­ way for developers to know which revi­ that support previous formats wouldn't arate PA TIERNS file, at the end of the sion of the PCX format they're dealing use the new fields. They'd automatically patterns. with. There is a version byte in the skip over them. In the PCX Programmer's Toolkit, we header (which references a PC Paint­ (4) Variable field placement. Keep in chose to extend the format by storing the brush version), but this version byte mind that field locations should vary palette at the end of the encoded image hasn't changed. without causing problems. By this I data. The palette was identified by the Take, for example, the 256-color mean that the header field can hold an same OAH (10 decimal) as the PCX 10 modes. Granted, it was impossible to OFFSET to the actual data. The offset byte, by preceding the palette with the 10 predict (in 1983) we'd be supporting field has a fixed pos·ition, but the data byte. The format of the palette is BIOS huge palettes when at the time there can be located anywhere in the file. This compatible (RGB triples). were only CGA and Hercules adapters. works well with variable length data The latest versions of PC Paintbrush But it's not excusable for the company (such as palettes) and string information. now.also store the palette at the end of controlling the standard to issue a "tem­ (5) Allow "information areas." Put op­ the file. However, they shift each byte left porary" work around (i.e., storing the tional fields in there for file information two bits to match their internal palette 256-color palettes in the Paintbrush PAT­ strings, copyright areas, etc. format. We requested that the 10 byte be TERNS file), and then finalize on a for­ (6) Backward Compatibility. The for­ different so that the toolkit could auto­ mat six months later. mat must always be backward compat­ matically identify and compensate for the Developers who went ahead and sup­ ible. palette differences transparently. The 10 ported the pattern file format were left (7) Maintain a Format Specification. A byte for the new format is OCH (12 deci­ out in the cold, since Paintbrush now format specification guarantees consistent mal). The toolkit can read either palette doesn't even support the separate palette support in not only your own programs, format but now only writes new images in current versions. but in other software vendors' programs. in the new format. I'm not finding fault with 250ft, but Never release an "intermediate" version. raising a question-how do you maintain If the format must change in a way thafs The Hard Part a standard so that it's expandable and al­ not backward compatible, solutions must The hard part is programming the lows for future innovations, while allow­ be made available to developers video hardware. To compress the image ing other developers to support it? supporting the format. data, you must read and access video This happens time and again in the (8) Release a Toolkit. A toolkit serves memory and align it in a linear format. computer industry. A program stores in­ both the format developer and other This varies with almost all display formation in its own private format, and supporting developers. It makes it easy modes. For instance: CGA memory is in­ then without the vendor's permission, for other vendors to support your files, terleaved, EGA memory is planar, VGA the format becomes widely supported. and it also allows you to change the for­ is planar, Hercules is interleaved (differ­ The original vendor gets locked in, no mat transparently and consistently ent from CGA), and extended VGA longer having control. He's now re­ without affecting everyone adversely. modes ... well, there is no standard. sponsible not only for maintaining his To get a better handle on the hard own products, but for maintaining "The Conclusion part, I recommend the following books- Standard." In summary, the PCX format is a powerful way to break your graphics ap­ • Programmer's Guide to the PC and Some Suggestions plication into the myriad of software PS/2 Video Systems, by Richard Although I don't have the whole solu­ packages that now support PCX. The Wilton, published by Microsoft tion for this kind of problem, I do have easiest and most reliable way of doing Press. some suggestions for developers who this is through the PCX Programmer's • Programmer's Guide to the EGA and find it necessary to create a new format: Toolkit, since it handles the PCX support VGA Cards, by Richard Ferraro, (1) Uniquely identify the file. Don't issues for you automatically, ensuring published by Addison-Wesley. rely on extensions for identifying files. backward compatibility. • Programmer's Guide to the Hercules Maintain an 10 byte, usually the first If you decide to implement your own Graphics Cards, by David Doty, byte of the file. Multi-byte IDs are better. standard, keep the above design points published by Addison-Wesley. (2) Maintain a version field. Always and issues in mind. You may be the only put a version number in the header. one using the format at first; but by look­ In general, a planar image is stored However, this must be other than the 10 ing ahead and allowing expansion, you one scan line at a time, one plane after field-don't encourage developers to key can avoid being "locked in" to a dead­ the other. For instance, start at line 1 and on it, but encourage its use as a "features end format. This will also encourage encode the Red plane, the Green plane, supported" number. New versions of the developers to standardize on your for­ the Blue plane, then the Intensity plane format must be backward compatible, mat, without the worry of needless or for that line. Then store line 2 RGBI, line with new features available if the soft­ spontaneous changes. 3 RGBI, etc. ware supports it. •••

36 MICRO CORNUCOPIA, #48, July-August 1989 McTek LCD Portable (Also available in PLASMA PORTABLE) (Including Hard Disk Only 191bs.) ~DD/T286

The McTek Rabbit-286 LCD Portable composite monochrome moni· combines the fastest, most reliable AT tor. Included also is an exter­ motherboard available with most nal 5%" floppy port for read­ visible full-size LCD portable ing and converting to 3V2 " screen on the market. Run- disks (5 %" external drive wI ning at a switchable 8 or case: $179 when purchased 10 MHz 0 wait state, it with LCD Portable). The Mc­ includes a 20MB Tek Rabbit-286 LCD Portable hard disk, comes fully assembled with 1.44MB 3V2" floppy drive, our one-year parts & labor parallel & serial ports, Award guarantee, and sells .for an 3.03 bios, 640k & turbo indica­ resolution 640x400 super twisted LCD with adjusta­ a~azing, complete 117rllll , tor LCD. The screen is a fantastical- ble intensity and screen-angle. The screen size is pnce of only 77, ly readable, electroluminescently 9.5"x6". It's as readable as a CRT. You can also plug backlit, 80-column by 25-line, high in a digital or analog color monitor or a digital or ~~I~~O MHz $2599

$129900 $189900 $219900 12MHz/O Wait State 16MHz/O Wait State 20MHz/O Wait State Assembled & Tested IBM\!) AT Compatible Assembled & Tested IBM@ AT Compatible Assembled & Tested IBM@ AT Compatible MS·DOS@ OS/2@ Compatible MS·DOS@ OS/2@ & UNIX@ Compatible MS·DOS\!) OS/2@ & UNIX@ Compatible • 8028612/6 MHz • 803861618 MHz Norton V4.0 SI17.6 • 803862018 MHz Norton V4.0 SI 22 • Phoenix BIOS • Phoenix BIOS • Phoenix BIOS • 640K of RAM Expandable to 4MB • 1MB expandable to 16MB RAM • 1MB expandable to 16MB RAM • 0 Walt State • 80387 Coprocessor Socket • 80387 Coprocessor Socket • 200W Power Supply • 200W Power Supply • 220W Power Supply • 1.2M B Floppy Drive • 1.2MB Floppy Drive • 1.2MB Floppy Drive • Ports: 1 Serial, 1 Parallel, 1 Game • Ports: 1 Serial, 1 Parallel, 1 Game • Ports: 1 Serial, 1 Parallel, 1 Game • Dual Floppy/Dual H.D. Controller • Dual Floppy/Dual H.D. Controller • Dual Floppy/Dual H.D. Controller • Monochrome Graphic Card • Monochrome Graphic Card • Monochrome Graphic Card • 101 Key Enhanced Keyboard • 101 Key Enhanced Keyboard • 101 Key Enhanced Keyboard • TTL Monitor 12" • TTL Monitor 12" • TTL Monitor 12" • 20MB Hard Disk • 20MB Hard Disk (28MS) • 40MB Hard Disk (28MS) • MS DOS 4.0 NGW BASIC • MS DOS 4.0 NGW BASIC • MS DOS 4.0 NGW BASIC Options: ...... Call Options: ...... Call Options: ...... Call

McTek Systems, Inc. • 1521 San Pablo Avenue • Berkeley, CA 94702 • 415-525-5129 DISI{ DRIVES PRINTERS MONITORS PC/XT PC/AT MISC.

Fujitsu 360k •...... •. $69 CItizen CD 120 .•...•... $149 Samsung amber ...... $79 640k TurboMothrbrd ..... $80 McTek286·20MHz ...... $449 Klngtech CRT Portable Kits: Fujitsu 1.2MB ...... •.•. $89 Citizen CD 180 ..•...•.. $189 Samsung EGA color .... $359 10MHz TurboMothrbrd ... $85 Baby McTek 286B·AT XTIAT (power supply, case Teac ...... •.•. $75 HPLASAR Serlal2 ..... $1699 Samsung RGB color .... $259 Multi 110 wldlsk contrlr ... $59 8110 O·walt .•.....•... $249 keyboard. monitor) Teac 1.2MB ...... $95 Epson LX·800 ...•...... $219 NEC Multlsync ...... $559 640k RAM card ...... $39 McTek 386·16MHz ...... $799 """"""'" ,$3801$410 Toshiba 3'12" 720K ...... $89 Epson LO·500 ...•..... $379 Sony Multiscan .....•.. $619 2M B Expansion card .... $89 McTek 386·20MHz ...... $859 Eprom burner 4·socket,. $139 Teac 3V." 1.4MB ...•... $105 Toshiba 321 XL ..•..... $519 HGC·compa!. mono card .$49 RS232 2·pcrt card ...... $35 McTek 386·24MHz ...... $999 LCO Portble ..... , , . , , ,$759 20MB Hard Disk Kit .•.. $279 NEC P2000 ..... " ..... $369 Color graphic card .....• $49 4·serlal port card •...... $79 Locking slide case ..•.. , $59 Plasma Portable Kits ". $999 30MB Hard Disk Kit .... $309 Call for prices of other brands EGA Paradise 480 ...... $149 Game 110 card .....•.... $15 200W power supply" .. , ,$65 AC power strips. ""'" ,$15 ST·225 ...... $215 VGA Paradise ..... '" .$279 384k Multifunction card .. $69 Enhanced keyboard ."., $59 Diskette file box"., .. " ,$9 8425 Mlnlscrlbe ...... $249 MODEMS Genoa Super VGA ...... $299 FCC·app. slid XT case '" $29 WD FDIHDC."., .•. ,' .$129 Printer or serial cable, , •. ,$8 8438 30MB Mlnlscrlbe .. $259 150W power supply ...... $49 OTC FOCIHOC 1:1., .. , ,$189 Archive Tape Backup Everex In!. 30011200 ..... $79 3650 40MB Mlnlscrlbe .. $349 MOUSE XT keyboard ...... $42 3MB EMS (OK) ...... , .. $99 40MB. , .. , , •. , , •.. , , . $339 Everex 2400 external .... $195 3675 60MB Mlnlscrlbe .. $379 Clock Card ...... $19 Everex 2400 Internal .... $179 Loglmouse C7 ...... $69 ST·157 49MB 3W' ...... $479 Floppy Controller ...... $19 DESKTOP XT 10MHz 640k Loglmouse H1 Res •..... $99 2 Drive System, .. , , .. , ,$699

Reader Service Number 42 MICRO CORNUCOPIA, #48, July-August 1989 37 A 68000-Based Multitasking Kernel Or, How To Fix A Perfectly Good Singletasking System

The Usual Way ... console device or serial port, the sched­ Well, here it is, multitasking, Micro C Most often, multitasking refers to an uler gets activated instead. It temporarily style. Karl shows us how he's written a interrupt-driven task switching system. suspends the I/O request and activates multitasking supervisor for his truly unique Here, hardware routinely interrupts a the next task. Eventually, the original 68000 system. (And guess what he's work­ task's operation and control passes to the task comes up for scheduling again, at ing on-a 68000-based embedded controller scheduler. which time the I/O request gets handled. for around $30/ Great robot guts.) This is usually a simple system to im­ Some computationally-intensive tasks plement. You need a source of periodic (such as fractal calculations) would not interrupt signals (such as a 555 timer or a release the CPU for a long time. For these s I'm writing this, my surplus divider circuit driven by the CPU's clock) cases, a special routine provides a forced 68000 system is running three and an interrupt handler program to pass scheduler call. Obviously, the program­ Atasks simultaneously; the SK*DOS control to the scheduler when the inter­ mer must imbed such calls at key points operating system, my ROM monitor, rupt occurs. Of course, you also need the in the program if the cooperative system and a simple LED blinker. No collisions, scheduler. is to work smoothly. no crashes, no muss, no fuss. All made The main drawback to this system lies If you want to play with a truly ele­ possible by a tiny, home-brew multi­ in the hardware interface. The hardware gant implementation of a cooperative tasking kernel called MT ASK. design and the software design must multitasking system, try the public­ play together perfectly. The software domain Forth-83 system (check your Tasks And Scheduling must know where the interrupts come local BBS). Multitasking uses two types of pro­ from, how often they will occur, and how For an elegant description of how the grams: tasks, and task schedulers. Any they can be controlled. Thus, the sched­ F83 scheduler and multitasking system program, whether ROM or RAM based, uler design is unique for each hardware work, consult the book Inside F83 by Dr. qualifies as a task. A scheduler program design. C. H. Ting. This superb explanation of controls the switching of tasks. The pro­ F83's internal workings may be ordered grammer defines tasks to the scheduler An Alternative from Mountain View Press. using a table of parameters, appearing in The cooperative multitasking system memory as a block of data. uses a different approach for passing con­ More On Cooperation Each task definition block (or TDB) trol to the task scheduler. Here, each task The cooperative system usually relies must contain (as a minimum) the execu­ voluntarily abdicates to the scheduler, on I/O calls to trigger the scheduler. This tion address of the task, the task's stack which then wakes up the next task. There means that the scheduler must somehow pointer and some form of validation flag. are no hardware-induced interrupts. intercept each I/O request, yet it must The flag gets checked by the scheduler Each task knows precisely where it will also complete the I/O request properly. prior to task startup, protecting the sys­ give up control to another task and pre­ This I/O interception can be handled in tem against corrupted TDBs. Additional cisely where it will regain control.. various ways. roB information may be provided for This technique requires no special If a system uses software interrupts to controlling I/O and system resources, as­ knowledge of the system's hardware. It is trigger an I/O request, the scheduler can signing task priority, and aiding inter­ necessary, however, to know how it han­ simply overlay a transfer to itself into the task communication. dles low-level I/O. Developing a interrupt vector location. For example, if CPU control passes periodically to the cooperative kernel involves blending a 68000 system relies on TRAP 0 for pro­ scheduler. The scheduler shuts down the these I/O calls with the scheduler code. cessing I/O requests, the scheduler previous task, checks for the next task, The major drawback to the coopera­ would simply write its own entry and transfers control to it. As each task tive system lies in its name. Each task address into location $80. I/O requests gets switched on or off, the scheduler up­ must release control to the scheduler would then be routed through the sched­ dates the appropriate TDB. properly and in a timely manner, or uler, which would eventually direct them The signal that interrupts a task and other tasks won't be run. Generally, the to the original I/O code. activates the scheduler defines the type of cooperative system forces release of the If, however, a system uses explicit multitasking kernel used. Two main CPU by embedding the scheduler trans­ calls to I/O subroutines, the scheduler types of kernels exist: the interrupt­ fer inside an I/O call. must insert a hook into those sub­ driven, and the cooperative. Whenever a task transfers data to a routines. This is not normally a problem,

38 MICRO CORNUCOPIA, #48,July-August 1989 By Karl Lunt 7349 W. Canterbury Peoria, AZ 85345 (602) 878-0305 (H) (602) 869-6146 (W)

as any self-respecting OOS uses RAM­ of outgoing characters. KEYVO and based I/O routines. In this case, you'll KEYV1 check for a pressed key on the need to know precisely how these I/O corresponding terminals. Tasks may use routines behave. Calls to the scheduler EaCh task either serial port for I/O; the entry points then overlay the entry points, providing placed into a task's TDB by the program­ the needed interception. knows precisely mer determine which port gets used. Even if the machine uses ROM-based The scheduler writes the selected I/O modules, you can still create a where it will give three low-level entry points into the cooperative multitasking system. In my monitor's RAM vector locations before case, all I/O requests pass through a up control to switching tasks. Thus, each task gets its RAM-based vector before returning to own set of I/O handlers. In an expanded the ROM for processing. This RAM vec­ another task and version of MTASK, these vectors may not tor gives me an intercept point. even point to the ROM-based I/O precisely where it routines; instead, they might point to a AboutMTASK queue handler or other special-purpose The program MT ASK, written in will regain control. subprogram. 68000 assembly language, provides a Transfer to MTASK occurs when the simple multitasking kernel. (See Figure 1 program first executes. MTASK builds for listing.) It is capable of considerable up a TDB for task O. This consists of writ­ power-in fact, it gives two users full SK*OOS. That doesn't concern me right ing the channel 0 I/O vectors into the access to my ROM monitor. This simple now, as SK*DOS' file control system does RAM links and putting an initial stack multi-user capability results from careful not support multi-user operation any­ pointer address into the TDB. MTASK monitor design. way. In the future, I will probably imbed then pushes the monitor entry point onto But this discussion deals with MTASK MTASK (or son of MTASK) in ROM and the stack and jumps to the monitor using as a multitasking kernel. MTASK con­ add system service routines to support an RTS instruction. tains several modules: the I/O overlays, external control of task assignments. This PAUSE does the task scheduling; I the startup sequence, the scheduler would get around the position-inde­ gave it the same name as the F83 task routine and a special program for dis­ pendence imposed by SK*DOS. scheduler. Though PAUSE seems short, a playing information about scheduled For now, I have to work around great deal takes place here. (Refer to Fig­ tasks. SK*OOS to run MT ASK. This involves ure 1 for the following discussion. Bear in Development of MTASK started even changing SK*DOS' end of memory mind that the stack pointer used by before I got SK*OOS running on my sys­ pointer (MEMEND) to $3CFFF, then PAUSE upon entry seldom matches the tem. The design seems rather schizo­ loading MT ASK into RAM at its default stack pointer upon exit. This can get phrenic because I changed vital system origin of $3DOOO. This sequence prevents quite confusing as you go through the details in midstream. For example, SK*OOS from loading a program on top code. It might help to grab a pencil and SK*OOS requires all programs to be posi­ ofMTASK. paper.) tion independent, able to run properly I then transfer control to my ROM PAUSE first pushes all registers, in­ regardless of load address. I wrote 99% monitor from SK*DOS. Finally, I use the cluding the stack pointer, onto the cur­ of MTASK that way, simply out of habit. monitor's GO command to start up rent task's stack. It then generates a However, it was impossible to pro­ MTASK To return to SK*DOS with pointer to the roB of the current task, vide the execution address of tasks to the MTASK still running, I then GO to where it tucks away the current stack scheduler if I didn't know what they SK*DOS' warm-start entry point, $1006. pointer for later use. were going to be. For test purposes only, Next, PAUSE determines the number I ORGed MTASK to run at location Inside MTASK of the next potential task and generates a $3DOOO. This locks the internal entry Six entry points support the low-level pointer to that roB. The validity flag is points into place, allowing me to give ac­ I/O functions for the two serial ports on checked and, if not okay, the routine re­ tual addresses to the scheduler routine. my system. INVO and INV1 handle in­ peats the procedure with the next task. This means that MTASK, in its current coming characters from ports 0 and 1, re­ After arriving at a valid user and form, will not run properly under spectively. OUTVO and OUTV1 take care roB, PAUSE checks the task status bits.

MICRO CORNUCOPIA, #48, July-August 1989 39 40 MICRO CORNUCOPIA, #48, Iuly-August 1989 CP/M, NorthStar, Macintosh, Apple II, MS-DOS, and PS/2 Don't let incompatible diskette formats get you down read them all with your PC!

Megamate by MicroSolutions Teach your PC This is the 31/2" drive package that you've been Special Purchases!! waiting for. Run 720k or 1.44M diskettes in this to speak CP/M attractive external drive. Comes complete with PC·Mastercard its own controller card. Easy to install, just plug by Magnum Computer UniDOS zao Coprocessor Board it into your PC or AT and go. This is probably the BEST multi-function card by MicroSolutions Megamate ...... $ 329.95 on the market. Use mixed banks of 64k and 256k Run your Z80 and 8080 code programs at LIGHT­ chips to install up to 1.5 Megabytes of RAM DISK, NING speed on your PC or AT with the UniDOS MatchPoint·PC by MicroSolutions and PRINT SPOOLER (or fill your system up to 8MHz. Z80 coprocessor board. UniDOS auto­ The MatchPoint-PC board for the PC/XT/AT 640k). Serial, parallel, game ports, and real time matically switches from MS-DOS to CP/M mode works with your standard controller card to let clock installed! Comes with complete software. when your CP/M program is executed. UniDOS you read and write to NorthStar hard sector and PC-MASTERCARD emulates most common computers and terminals Apple II diskettes on your PC. INCLUDES a copy (Ok installed) ...... $ 69.95 such as Kaypro, Xerox 820, Morrow, Osborne, of the UniForm-PC program, as well as utilities to and VT100. All standard CP/M system calls are format disks, copy, delete, and view files on Apple Turbo Editor Toolbox supported. Includes UniDOS and UniForm-PC. DOS, PRODOS, and Apple CP/M diskettes. by Borland International '" $ 29.95 UniDOS Z80 Coprocessor Card ... $ 169.95 MatchPoint-PC Board ...... $179.95 Ever wanted to add text editing to your Turbo Pascal application, or write a word processor that MatchMaker by MicroSolutions does things the way that YOU want? Comes with UniDOS by Micro Solutions Now you can copy your Macintosh diskettes right source for two sample editors, modules for win­ Equip your PC/XT with an NEC V20 chip and on your PC/XT/AT with the MatchMaker. Just dowing, multi-tasking, and many other options. run your favorite CP/M programs without taking plug your externaI31f2" Macintosh drive into the Requires PC or compatible and Turbo Pascal 3.0. up another card slot. Runs 8080 code directly MatchMaker board and experience EASY access on the V20, and uses emulation mode for Z80 to your Mac diskettes. Includes programs to COpy II PC by code or systems without a V20. read, write, initialize, and delete files on your UniDOS by MicroSolutions ...... $ 64.95 Central Point Software .. '" $ 24.95 single or double sided Mac diskettes. Stop worrying about your copy protected disks. UniDOS w/UniForm & MatchMaker Board ...... $ 139.95 V20-8 chip ...... $ 135.00 COpy II PC lets you back them up, so you can MatchMaker w/External keep going when your master disk can't. Mac Drive ...... $ 325.00 UniForm·PC by MicroSolutions Printer/Data Switches Hard Disks for CP/M systems How have you ever wished you could use your Quality with economy. These boxes switch all CP/M diskettes on your PC? Now you can access Pep up your CP/M computer with hard disk per­ 25 lines so they can be used with either RS232, your CP/M files and programs on your MS-DOS formance. Our simple to install kits allow you to or IBM parallel (DB25) printer cables. computer just as you would a standard MS-DOS connect up to two 5%" hard drives to your Z80 Four port data switch ...... $ 39.95 diskette. Install UniForm and use standard DOS system. The Winchester Connection software Two port data switch ...... $ 34.95 commands and programs right on your original customizes your system from an easy to use IBM style Parallel Printer Cable. . .. $ 12.00 diskette without modifying or copying your files. menu, with flexible drive parameters, partition Three cable set ** Special ** '" $ 30.00 UniForm-PC allows you to read, write, format, and block size, and includes complete instal­ and copy diskettes from over 275 CP/M and lation and diagnostic utilities. A complete system MicroPro Manuals MS-DOS computers on your PC, XT, or AT. With requires a HDS daughter board, WD1002-05 WordStar V3.3 Manual ...... $ 12.00 UniForm-PC and the Compaticard, you can use hard drive controller board, hard drive, software InfoStar Set 5%" high density, 96TPI, 31/2" (720k/1.44M), and package and cables. (DataStar & ReportStar) ...... $ 18.00 even 8" drives. HDS Host Board with Software . .. $ 79.95 UniForm-PC by MicroSolutions ... $ 64.95 HDS Board, WD1002-05, Also available for Kaypro, & other and software ...... $ 245.00 Call or write for our complete catalog of software, CP/M computers WD1002-05 Controller Board only . $ 185.00 parts, accessories and complete repair services External drive cabinet for the Kaypro, Xerox 820, and IBM PC/AT. with power supply ...... , $ 139.95 CompatiCard by MicroSolutions Prices subject to change without notice. VISA and THE universal four drive floppy controller board Parts and accessories for the Mastercard accepted. Include $6.00 shipping for the PC or AT. Run up to 16 disk drives (4 per Kaypro and Xerox 820·1 and handling, $8.50 for COD, UPS-Blue or RED CompatiCard), including standard 360K, 96 TPI, Plus2 ROM Set for Xerox 820-1 . .. $ 39.95 Label additional. Please include your phone high density 1.2M, 8" (SSSD or DSDD), and Plus2 ROM with X120 bare board . $ 49.95 number with all correspondence. 720k/1.44M 31/2" drives. Comes with its own KayPLUS ROM for Kaypro 2, 4, 10 - MS-DOS driver and format program. Use it with specify ...... $ 69.95 UniForm-PC for maximum versitility. Kaypro 2X Real-time Clock CompatiCard Board ...... $ 119.95 parts kit ...... $ 29.00 CompatiCard with UniForm-PC ..... $ 179.95 Kaypro 2X Hard disk interface 8" Drive adaptor ...... $ 15.00 parts kit ...... $ 16.00 (EMERRLO External 5114" drive cable ...... $ 15.00 Kaypro 10 Hard Disk controller ~~ board ...... $ 185.00 Kaypro four drive floppy (MICROIAIRRE) Compaticard II by MicroSolutions decoder board ...... , $ 35.00 Two drive version of the CompatiCard, sorry no QP/M Operating System - 8" or single density. bootable - specify system ...... , $ 64.95 CompatiCard II ...... $ 89.95 QP/M without CBIOS CompatiCard II with 1.2M or (installs on any Z80 system) ..... $ 49.95 (503) 641·8088 3W' internal drive ...... $ 199.95 Complete parts and repair services available

I VISA I • P.O. Box 1726 • Beaverton, OR 97075

Reader Service Number 10 MICRO CORNUCOPIA, #48, July-August 1989 41 42 MICRO CORNUCOPIA, #48, July-August 1989 If the status bits show the task as inac­ into EPROM might make sense. Pro­ tive, PAUSE skips the task and resumes grams needing scheduler support could the search for another valid task and then enter the service routine via a ROM CONSULTANTS ~~ IDB. If the task's status bits show it's not vector. yet started, PAUSE resets the bits to PROGRAMMERS,.. show the task as active and proceeds Uses For MTASK ANALYSTS get with startup. Even in its present form, MTASK can Starting a task requires updating the handle such jobs as data collection, data current user number, incrementing the buffering, monitoring of external condi­ ' task's activation count (contained in the tions, and anything else not directly in­ Dis-Doc " IDB), and loading the task's I/O vectors volving SK*OOS. Because of my ROM into RAM. Finally , PAUSE pulls the monitor design, I can even hook two se­ the most advanced task's stack pointer from the TDB, re­ rial tenninals to my Mini-Frame and SOURCE GENERATING loads all registers (including the stack have two users running my ROM moni­ DISASSEMBLER AVAILABLE pOinter) and executes an RTS, returning tor simultaneously. In fact, the IDB for for the IBM PCIXT/AT/PS2/compatibies control to the now-active task. task 1 in the listing shows how to set this PST AT provides a visual check of the up. DIS-DOC can help you multitasking kernel. Executing PSTAT To demonstrate MTASK's power, I - find and fix bugs in any program gives a short display of all tasks defined once wrote an assembly language pro­ - re-create lost source code by the IDBs. Information supplied by gram for a two-player hunt-the-battleship - a great companion utility to compiler and assembler PST AT includes the task name, stack game. The program lets each user run in - able to give you a great source of pointer, activation count, and current real-time, entering commands and seeing professional programming examples. I/O device assigned. The activation the results immediately. The program - And Much Much More! count, contained in each TDB, is simply made quite an impression at our com­ the number of times PAUSE has started puter club meeting. DIS-DOC is: that task. It allows external programs to Even though SK*OOS does not (pre­ FAST monitor a task's progress and trigger sently) support multiple users, I can use - Disassembles files up to 500kb in size OR RAM/ROM memory at a rate of other events based on the count. MTASK to run SK*OOS as the primary 10,000 lines per minute. Finally, BLINKER demonstrates that task, with a secondary task running my ACCURATE It monitor from another serial port. The the multitasking system works. turns a - Uses seven passes and over 20 SECRET status LED on and off at a two-second BLINKER task and both serial ports be­ algorithms to separate code from data rate. Because BLINKER's status bits are have perfectly; SK*DOS never even to make the most accurate listing on initially set to active and not started, it knows other programs are running. the market. will start the first time it becomes a can­ The problem of SK*DOS overwriting FLEXIBLE didate task. MTASK can be solved one of two ways. - Creates a MASM ready listing for easy MTASK could be burned into EPROM, re-assembly of your disassembly and Improvements, Anyone? as I discussed above, or you could hide a only needs 320kb of memory. MTASK offers considerable power, section of memory from SK*DOS (using TECHNICALLY ADVANCED but you can always add features. The SK*OOS' DOSP ARAM command). Then - The only disassembler that disassemles first upgrade that comes to mind con­ MTASK could be loaded into this area. all instruction sets including 80386/80387. cerns communication with the scheduler. - And has a built-in patcher to make You could write a .BAT file to handle changes without having to re-assemble. Currently, changing values inside a IDB this. requires a rewrite and reassembly; hardly DIS-DOC also includes BIOS labeling and a robust procedure. Better would be a set In Conclusion its own word processor in its package. of routines directly supporting manipula­ MTASK offers considerable power in DIS-DOC is a proven programmer's tion of the IDBs. This would permit ex­ only lK of code. I believe that the tool and is simply a must for the ternal programs to start and stop tasks, cooperative nature of MT ASK will per­ consultants, programmers or analysts. determine status of the tasks, or alter task mit others to easily stage it on their 68000 systems. MTASK serves as an excellent We CHALLENGE you to find parameters. anything that can beat Dis-Doc! An obvious way to provide this com­ tool for exploring multitasking. If any munication lies with the TRAP instruc­ readers add to MT ASK, please share DIS-DOC $99.95 tion. I might choose a presently unused your efforts with the rest of us. EXE Unpacker $29.95 TRAP vector (such as 7) and write into it FREE DEMO DISK the address of a dedicated program for add $4.00 for S&H in the USA servicing scheduler requests. To invoke a ••• $10.00 for outside USA scheduler service request, a program 30 day money back guarantee could load AO with a service request To order or get more information code, load Al with a pointer to a block of CALL 800-446-4656 today! data, and execute a TRAP 7. RJSwantek, Inc. Another possible way to handle ~ 178 Brookside Road ~ scheduler service requests could be via a ~ Newington, CT 06111 ~ vector in the monitor ROM. Since (203) 560-0236 MTASK doesn't have to be in RAM (only the IDBs and a few support variables need to be changeable), burning MTASK Reader Service Number 142

MICRO CORNUCOPIA, #48, July-August 1989 43 Debugging A Processor Or: You Can't Always Execute An Address

By Laine Stump Since nearly every program written these If you've had an itch to get into debuggers-C days executes an 8087 instruction to see if an % Redhouse Press Merkez PK 142 debuggers, assembly debuggers, TSR debuggers, 8087 is present, we couldn't run any software 34432 Sirkeci smart debuggers, and not-50-smart debuggers, then without the machine crashing. Istanbul, Turkey park your flea and read on. (Laine's not starting By trapping the Coprocessor Exception in­ from scratch.) terrupt, we discovered that an exception was occurring. So we wrote a more permanent in­ terrupt service routine which incremented IP ere I am, back at the threshold of Ana­ (the Instruction Pointer) past the offending in­ tolia again. Time to unpack my bags and struction and any possible operands, and re­ Hmake sure the Bactine didn't leak all turned. This mimics the operation of an Intel over the PostScript books. Time to unroll the processor with no 8087: all 8087 instructions are boat and check for rot. Time to renew all my treated as NOPs. old contacts in Istanbul and Ankara. Time to Since Intel processors (or any of the NEC dredge through all those things I did at PC processors you've ever heard of) don't need Tech and find something to fill in this column this facility, I haven't included that part in the in place of my planned topic (which I left, example program. Too much clutter causes along with my common sense, somewhere in confusion. (I think.) the passenger's lounge at JFK International. .. ).

A Little Trick Invalid Opcode Exception A while back, I was helping out with the de­ Another "bad" interrupt we trapped was bugging of a PC Tech design based on a new the "Invalid Opcode" interrupt. This interrupt NEC processor (sorry, but I'm not sure how is generated whenever the processor encount­ much I'm supposed to say, so I won't say ers an instruction it does not recognize. (The much). As with most new hardware products, same interrupt is also available on the 186, 286, this one seemed to be branching off to Never and 386). Never Land at random times. Of course, we It turned out that some of the crashes re­ were a bit curious about it. sulted from attempts to execute invalid instruc­ The first step was to make an interrupt serv­ tions. Being able to see when this happened ice routine that would intercept all the "bad" helped, but it didn't show us why. After all, the interrupts and print a register dump. Then we software we were running was all debugged. could look at CS:IP and see what caused the Something earlier was causing the machine to problem. The interrupt service routine (or jump to a nonsense location and execute non­ "trap") was written in assembly language and sense opcodes which, eventually, meant an in­ assembled into a TSR (Terminate and Stay Resi­ valid instruction. In fact, the machine bombed dent) program, which installed itself at system at the same location somewhere down in low startup. memory every time. Then Earl (at PC Tech) had an idea: the most Coprocessor Exception common cause of jumping to nonsense loca­ The TRAP program was useful for figuring tions is an uninitialized pointer. The most com­ out a few problems. For example, this particu­ mon value of an uninitialized pointer is lar NEC processor would generate a "Co­ 0000:0000. "Go into SYMDEB and type processor Exception" interrupt when it en­ 'g=O:O'," he said. countered an 8087 instruction. The same facility I tried it. Sure enough, up came the "Invalid is available on the 186,286, and 386, and it can Opcode Encountered" message. At the same be selectively enabled/disabled by software. It address! Now I knew that, somehow, someone turned out, however, that the NEC processor was trying to execute code at 0:0. The next step had this feature permanently turned on. was to backtrack and find out why.

44 MICRO CORNUCOPIA, #48, July-August 1989 Divide By 0 Exception Simple enough, since 0:0 contains the Location 0:0 is the base of the 80x86 least significant byte of the interrupt (and compatibles) interrupt vector table. handler address. So, we put an ORG This is an array of long pointers to in­ Here I am, back xx66h just before the start of the Divide terrupt service routines. The first entry, by 0 handler. at 0:0, contains a pointer to the interrupt at the threshold of Now we can report both a Divide by service routine for a "Divide by 0" ex­ o and an attempt to execute at O:O! ception. When a program attempts to Anatolia again. A potential problem with making execute a divide instruction with a divi­ our own Divide by 0 trap is that COM­ sor of 0, this service gets called. Time to unpack my MAND.COM installs the default one. It On the other hand, when a program prints a message and then terminates tries to execute code at 0:0 (usually by bags and make the current program. The behavior of jumping or calling indirectly through a TRAP's Divide by 0 is slightly different, pointer), it ends up interpreting the sure the Bactine but this will only show up with buggy pointer to the Divide by 0 interrupt programs, anyway. The information service routine as opcodes. Obviously, didn't leak all over given is so much more useful that it's this creates complete gibberish. Eventu­ worth any inconvenience. ally the machine works its way into a the PostScript state which causes some kind of excep­ TRAP tion. Usually, in the process, the proces­ books. The resulting program (see Figure 1) sor obliterates all evidence of where it's is installed from the DOS command been. line. It traps out and reports: (1) execu-

To detect execution at 0:0 immedi­ causes execution to branch to the In­ tion of invalid opcodes; (2) attempts to ately, we must make the first byte at 0:0 valid Opcode interrupt handler. The execute at 0:0; and, (3) divide by 0 ex­ some known opcode which branches to handler for invalid opcodes can then ceptions. a known place. The first opcode that check to see if the opcode in question is When encountering one of these con­ comes to mind is opcode CCh, the at 0:0, and prints a message accord­ ditions, it prints a message and register breakpoint instruction which causes a ingly. dump, along with a few bytes of the branch to the interrupt 3 handler. De­ What about the pointer to the Divide code at the last known CS:IP. Then, bugging programs use INT 3, though, by 0 routine? That should be at 0:0, after after waiting for a key to be pressed, it so it would be more convenient to use all. And we just trashed it! executes an INT 3. The idea is that you something else. The solution to that problem is to can run the program in question under I came up with the solution to put a force the address of the divide by 0 in­ DEBUG or SYMDEB, then use the de­ 66h at 0:0. This is an invalid opcode (on terrupt handler to an address such that bugger to examine the area of the pro­ the 186 and 286, but not the 386), and the byte at 0:0 is guaranteed to be 66h. gram in question after the crash.

MICRO CORNUCOPIA, #48, July-August, 1989 45 Computers For The Blind Talking computers give blind and visually impaired people access to electronic information. The question is how and how much?

The answers can be found in liThe Second Beginner's Guide to Personal Com­ puters for the Blind and Visually Impaired" pub­ lished by the National Braille Press. This compre­ hensive book contains a Buyer's Guide to talking microcomputers and large print display processors. More importantly it in­ cludes reviews, written by blind users, of software that works with speech.

This invaluable resource book offers details on training programs in com­ puter applications for the blind, and other useful information on how to buy and use special equipment.

Send orders to: N ationa! Braille Press Inc. 88 St. Stephen Street Boston, MA 02115 (617) 266-6160

$12.95 for braille or cassette, $14.95 for print. ($3 extra for UPS shipping'

NBP is a nonprofit braille printing and publishing house.

46 MICRO CORNUCOPIA, #48, July-August 1989 Possible uses of TRAP are to detect invalid opcodes in long strings of "in­ line" code of the Turbo Pascal variety, find the source of that pesky Divide by o bug, or figure out which long pointer to a subroutine wasn't initialized. Load TRAP before you start up the debugger! (It's a TSR, remember?) I used MASM 5.1 to assemble TRAP. You could probably twitch it around to work with earlier versions, but I would recommend just upgrading to 5.1 and getting it over with. Trap uses a few subroutines for printing numbers and strings which, though not listed in the magazine, are available on the Micro C BBS or on the Issue #48 disk.

8088s Sorry about this, all you 8088 users, but TRAP just won't work on an 8088 or 8086 system. They don't have the facilities to trap out invalid op~odes. It will work on the V20, V30, 186, and 286. It won't work as is on the 386, since 66 is a real live opcode. With all the hard­ ware debugging options of the 386, though, that shouldn't be much of a problem.

Of Mice And Me Every year when I leave Istanbul, someone wants to buy my mouse. Since mice are quite expensive on the local market (although rats can be had dirt cheap-I know, I had a kitchen full of them), I am usually willing to oblige. I have always bought Logitech mice, and have always been happy with them, as have the people I sold them to. This year when I was packing up to go, I was planning on just getting another one of the standard, 200 dpi, boxy square Logitech mice. Then I saw an ad for their new "ergonomic" model. I immediately began to salivate. (Love those little miceys, Miceys what I love to eat .... ) I have now used the new Logitech mouse for three weeks, and I can say that everything in the ads is true. The new shape fits my hand perfectly. The "ballistic" control of mouse movement (faster movement causes greater changes in position) really works. Plac­ ing the ball further forward gives more fingertip control of the mouse pointer. Finally, their new punk logo and bone­ white color give my desk that decadent, graffiti-esque look we all strive for. I think I'll keep this one. The same mouse can be plugged into either an RS-232 port, or the mouse port of an IBM PS/2. This will never become an issue with me (unless PC Tech de-

MICRO CORNUCOPIA, #48, July-August, 1989 47 cides to put a PS/2 mouse port on one of their designs), but it may be useful information to those of you closer to the "mainstream." (\i i :·L:o By the way, the books indicate that •••.••... > :t!)al1\~

The Logitech Mouse $139 Logitech 6505 Kaiser Drive Fremont, CA 94555 (800) 231-7717 (800) 552-8885 (in Calif.) ++41-21-869-9656 (in Europe)

Zortech Debugger Since Scott Ladd said in his last column that he might talk about the new Zortech Debugger (ZTCDB) this issue, I won't spend a lot of time on the subject. There are a few things that I just can't bear not to mention, though. The first thing a CodeView user will notice about ZTCDB is how many win­ dows there are. There is a window for the source, of course. But it also has a window that shows all global data items, one that shows all automatic data items (local variables), one with a directory listing, one that lists all func­ tions in the program, and several others. Things difficult to impossible to see with CodeView are simple with ZTCDB. For example, you don't have to spend the time typing in all the varia­ bles you want to watch. They're already there, in the Data or Auto window. If you want to dereference a pointer, just hit the Ins key (the same trick shows the members of a structure, or items in an array). Also, the debugger recognizes that the compiler places some variables in registers, so these can be properly moni­ tored. There is a Functions window, too, which gives the name of all functions in your program. You can bring the source code of any function up on the screen .····11 .} ..Y by moving the cursor to the function .•..•...... •...... •...... •..•...... •...• i.i'..i •.•.. •;.. } .. ·•.••.••. \.•..••• i .. ·····.··;iIii ..•• ;., •.. 1··'· .. . name and typing Enter. .il...... ZTCDB handles breakpoints much ··I}II····· . easier, too. There are several commands to set breakpoints on; for example, all lines of a function, the first line of all functions, and all lines of the program. This is much more powerful than CodeView's BP command, which only

48 MICRO CORNUCOPIA, #48, July-August 1989 much, since neither Earl nor I could coax CodeView to do anything over 25 IP_StringOut lines reliably. Someday developers will Tech Invalid Opcode & Divide by 0 Exception Trap' I CR,LF Copyright (c) 1989, PC Tech, Inc.' ,CR,LF,O all have huge displays; then program­ SI,SI mers will write programs to run on huge displays. If they would just figure out that all they had to do was look to 40:4Ah for number of columns, and 40:84h for number of rows (-1), and for­ get about all those stupid VGA equip­ ment checks. PrinterFlag , .. ReportToPrinter OX, (LASTBY'rE-FIRSTBY'rE+lS) /16 No Assembly AL,O KEEP_PROCESS The biggest problem, with the cur­ rent version of ZTCDB anyway, is that it is restricted to debugging C programs (and c++ in a limited fashion). I tried several different attacks and could never get it to accept an assembly lan­ guage module. No assembly is a big minus for me. After all, at least two­ thirds of all my work is in assembly lan­ guage. This is disappointing, since it allows a single breakpoint at a time. ZTCDB mouse commands and MS means I will have to keep at least two You can select eight different "condi­ Word mouse commands (especially the different debuggers on my machine. tional" breakpoints in the same way. A method of scrolling). Also, I sorely miss ZTCDB has already replaced conditional breakpoint will be taken having a simple mouse command that CodeView as my debugger for C pro­ only if an expression you supply evalu­ says "execute up to this line." grams. If Zortech makes it compatible ates to TRUE. This can be useful for I would also much rather see the as­ with MASM, and if CodeView doesn't pinpointing the spot where a certain sembly language listings in the source get off its tail and make some drastic variable is modified, or where a bound­ window in upper case instead of lower improvements, I think I will switch over ary condition is reached. case. This helps to visually separate the completely. ZTCDB also has the ability to set C source code from the assembly lan­ And if they make it support a screen Tracepoints. A tracepoint is a break­ guage it was compiled into. that is 160 columns by 66 lines? I might point which, instead of halting execu­ Something completely missing from just die of ecstasy. tion, increments a counter and con­ ZTCDB is the ability for a breakpoint to tinues. With this tool, you can profile trigger execution of a list of debugger Footnote the execution of your program and de­ commands. CodeView makes this avail­ Keep in mind, no matter how ad­ cide which portions you should spend able, and it can be very useful. vanced all these hot new debuggers get, time optimizing. And I like CodeView's register dis­ they can still never replace SYMDEB. At For example, I ran the DISKEDIT play format much better. least not for me. Although I've been program from the last issue after setting Those are just details, though. I can using CodeView for over a year now, a tracepoin t on every line of the pro­ live without them. I guess. and ZTCDB for the last month, I still gram. I learned that, as I had expected, My first real complaint, as with al­ use SYMDEB at least as often as the the program was spending about 80 most every program on the market, is a other two together. times as much time in the procedures lack of TRUE support for large screens. Why? Because I can run SYMDEB cprintfO and Write16BytesO as in any ZTCDB does handle 43 line EGA and 50 without giving it a program name to other part of the program. If more line VGA displays, but it doesn't know debug. I spend a lot of time just looking speed concerned me, I would rewrite what to do with a 66 line display. I was at interrupt tables and ROM BIOS code these functions in assembly. able to fool it into thinking that my and playing with internals. The power Finally, in the breakpoint depart­ 34010 Mono board was a VGA, and got of the new debuggers brings with it a ment, ZTCDB saves all your break­ 50 lines out of it. But then it kept more stringent form, which doesn't points in a configuration file so you can switching back to 25 lines every time I exist in the free and easy "do what you use them the next time you debug the stepped through a DOS or BIOS call. like, but be prepared for the con­ program. (This doesn't happen with a real VGA, sequences" world of SYMDEB and though). DEBUG. Negatives Tracing through ZTCDB's code (I I suppose I'll always be a rebel at As with any good program, there are was debugging ZTCDB with SYMDEB, heart. still a few distracting problems with but that's another story), I also noticed ZTCDB. There are always the little that a screen width of 80 columns is "taste" and "preference" kinds of hardcoded into several places. That • • • things, of course. One example is that I means that I can't use the right half of don't exactly like the mouse interface. I my new double page monitor on the can't pin down why, though. I guess it's new 34010 Mono II board. just because of the differences between I shouldn't complain about this too

MICRO CORNUCOPIA, #48, July-August, 1989 49 Searching For A File And Not Just Any File

denced by the number of other people who We all use a directory program of one sort want to hold SOGs in their own areas. By Scott Robert Ladd (sorry) or another, but the generic packages usually By the time you read this, Maria's and my 302 North 12th Street don't do everything. Every time my 20 meg drive first child will have been born. No technology Gunnison, CO 81230 (303) 641-6438 gets full, I'm forced to run through all my directo­ or science has the potential of a newborn baby. ries, looking for duplicates and temp files. How It is remarkable how the bringing of a new life about a directory search routine that digs these out? into the world changes one's perspective. Well, Scott has the answer.

t's springtime in the Rockies, and I'm begin­ ning to have a bad case of "exploration Ifever." Symptoms include a distinct distaste ~ere is more to life for four walls, an urge to saddle up the moun­ tain bike, and a strong desire to head for the than computers ... hills. Moving to Gunnison has been an enlight­ ening and entertaining experience. Just like writing for and reading Micro C. Micro C is a truly unique magazine, as I'm sure you're aware. I feel somewhat privileged (Editor'S new product announcement: Elora to write for this bimonthly tome of wit and wis­ Marjorie Ladd was born Aprill'lh. An "absolutely dom. The May /June issue was especially inter­ perfect" child according to papa Scott.) esting to me, although the reasons for my reac­ Of course, a person's perspectives have to tion have nothing to do with computers. keep changing if they are to grow as a human Larry's article on Creativity (with a capital C) being. This is one thing which sets us apart parallels many of my own feelings on the sub­ from computers: humans always have the ject. potential to better themselves and the world A walk among the aspen and pine really around them. loosens up the creative juices. There are few All that aside, this is a technical column, so I sights more extraordinary than the flight of a suppose I had better say something technical. red-tailed hawk as it glides over the fields (un­ After all, I've got these creative juices flowin' .... less, of course, you're a rodent!). I also enjoy watching deer graze in a mountain meadow. TOOLBOX And, of course, the sight of mountains reflected in a high-altitude lake takes my breath away. Due to the length of C EXPLORATIONS this (Now Dave knows why my columns are al­ issue, I've dropped the TOOLBOX section. ways late!) After all, C EXPLORATIONS has gotten short There is more to life than computers and shrift in the past; I've found that parts of this technology. SOG exemplifies this attitude. It's a column argue with each other if they're not technical conference for people who want to get treated fairly. So, you're not reading this since away from technology. By the end of SOG VII it doesn't exist. in Bend, Maria and I felt that we had spent a weekend with a group of friends. That's a feel­ C EXPLORATIONS ing I've never had at other technical confer­ ences. It's been a while since I presented a signifi­ When Dave announced that Micro C was cant piece of code in this column. So I began not going to hold another SOG, Maria and I de­ looking through my pile of programs, seeking cided we had to keep it going. Thus was born an interesting and educational piece of code. Rocky Mountain SOG. Something as special as What I found were my standard library func­ SOG cannot be allowed to expire; this is evi- tions for doing file searches. While that may

50 MICRO CORNUCOPIA, #48, July-August 1989 seem old-hat, this module presents some often overlooked ideas. MS-DOS provides four INT Ox21 services for directory searches. Services FileSrch (File Search) 1.00 02-Apr-1989 Oxll and Oxl2 are outmoded file-control ANSI C with MS-DOS extensions block (FCB) functions. They appear com­ plicated and restricted when compared to the recommended Ox4E and Ox4F services (introduced in MS-DOS v2.x). Services OxIl and Oxl2 force you to load an FCB with file information. In versions of MS-DOS prior to 3.0, they do

not support the 11 * 11 wildcard character. Services Ox4E and Ox4F use a file specifi­ cation stored in a standard NUL-termi­ nated (C-type) string, and fully support the standard wildcard characters. Service Ox4E, known as FIND FIRST, sets up the directory search and retrieves information on the first file (if any) which matches the given specification. Subsequent calls to service Ox4F (entitled FIND NEXT) will return data on addi­ tional files which match the specifica­ tion. A location known as the data transfer address (DT A) holds the data on the file. The initial location of the DT A is at off­ set Ox80 within the PSP of the present program. Service Ox2F (called GET DTA) retrieves the current address of the DT A, and service OxlA (named SET DT A) sets the DT A to a new address. While it is possible to use the default DT A, it's better to create a buffer and set the DT A to point to it. This lets you de­ fine a structure for the incomi,ng infor­ mation, and also prevents conflicts with other MS-DOS services which may be using the default DTA. There is one other point in favor of providing your own DT A. The file infor­ mation retrieved contains data used by ensuing calls to FIND_NEXT. By using multiple DTA buffers of your own crea­ tion, you can have several different file search operations going simultaneously. Most C compilers provide a pair of functions which use FIND FIRST and FIND NEXT to retrieve file information. Unfortunately, there are several prob-

MICRO CORNUCOPIA, #48, July-August, 1989 51 lems with the "free" function provided by C compiler vendors. First, the ven­ :,.:).:: :::.:,'''::.'\ '. dors do not coordinate, so that Turbo '\" >k\ C's findfirstO and findnextO are slightly different from Microsoft C's equivalent i functions, _dos_findfirstO and _dos_findnextO. Some compilers provide only simplified access to these functions. For .. ".:...... •••••••••••• example, WATCOM's opendirO and readdirO do not allow the specification of file attributes. Zortech's findfirstO and findnextO cannot be used for simul­ taneous searches, since they use a static buffer for the DTA. The hierarchical directory structure of MS-DOS (borrowed from UNIX) is """'. one of its best features. With a properly organized tree of directories, it is theoretically much easier to control your files. I have more than 2,500 files on my 386 system, and you can imagine """ (::;::,' the chaos that would result if they were '<:": .:::'. all in the drive's root directory! Unfor­ " " tunately, the MS-DOS directory services <: ~: :i i.i\ :0.; ".,'" only look in one directory at a time. So ... ;,;,:: ~ .. , we have to write our own functions for ':::i' multi-directory file searches. With all this in mind, I wrote :;". FILESRCH. FILESRCH.H (see Figure 1) ..•••••..•.•••••.•••••••. ~•.••••••••••••• :.•• is the header containing data definitions Continued on page 54 ~; '7 ,'."':::.: i :.-,: ... :::.,".\ ':';::: i' ':\" . 68000 i'::: \ ( 'i SK*DOS· A 68000/68020 ::: .. : DOS containing everything i you expect in a DOS - on-line .. ,::, i:. help, multiple directories, ::\ floppy and hard disk support, RAM disk and/or disk cache, I/O redirection, and more. Supplied with editor, assemb­ ler, Basic, powerful utilities. Supported by Users' Group and BBS. Software available from other vendors includes C compiler, Basic, editors, dis­ assemblers, cross-assemb lers, text formatter, communica­ tions programs, etc. Priced at $165 with configuration kit, less if already configured for your system. HARDWARE • 68xxx systems start at $200. .:::,: :.: "', '---7 Call or write.

?:' Systems Corp. ~.£'. <.... . ' :;:/; P. O. Box 209 i\ '/' Mt. Kisco NY 10549 i{i. ":': (914) 241-0287 / Fax (914) 241--8607 ,::\ Reader Service Number 40 52 MICRO CORNUCOPIA, #48, July-August 1989

----_._------8280 Clairemont Mesa Blvd., Suite 117 San Diego, California 92111 ERAC co. (619 569-1864 AT/BABY AT XT/TURBO ELGAR N~~ Motherboard 6 & 10 Meg Motherboard UNINTERRUPTIBLE AA Cells .6ah ...... $1.00 Zero Wait State 5 & 8 MHz Switchable POWER SUPPLIES 12V Pack AA Cells .6ah ...... 6.50 8 Expansion Slots 8088 - V20 Optional Sub·C Cells 1.5ah ...... 1.50 640K RAM On· Board Optional Co·processor 400 Watt MODEL IPS400 + 12V PackSub·C ...... 10.00 Math Co·processor Option 8 Expansion Slots $650 Double 0 Cell 2.5V 4ah unused ... 8.00 Phoenix Bios ERSO or Bison Bios Power distribution center and sine· C Cells ...... 1.75 200 Watt Power Supply 640K RAM wave UPS. Only 2" high. Hercules Compa!. Video Bd. 150 Watt Power Supply Parallel Port Hercules Compa!. Video Bd. 560 Watt MODEL IPS560 GEL CELLS 2 Serial Ports Active Parallel Port $350 6V 8ah ...... $6.00 Game Port 2 Serial Ports Active Sinewave, 560W complete with 12V 20ah ...... 25.00 Clock/Calendar Game Port batteries. 12V 15ah ...... 15.00 Hard Disk &Floppy Controller Clock/Calendar 12V 2.5ah ...... 8.50 20M Hard Drive Hard Disk and 400 Watt MODEL SPR401 o Cell 2.5ah ...... 2.00 102M 51/4" Floppy Drive Floppy Controller $180 360K 5'1." Floppy Drive 20M 51/4"Hard Drive Supplies may have minor cosmetic ROBOTICS 5061 Keyboard 2 ea. 360K 51/4" Floppy Drive damage, but are electrically sound. 5V DC Gear Motor wIT ach 1"x2" .. $7.50 Case with Turbo & Reset, AT Style Keyboard Squarewave output. Run on inter· Joystick, 4 switches, 1" knob ...... 5.00 Hard Drive Light and Standard Slide Case nal or external 24VDC battery when Z80 Controller with a·Bit AID ..... 15.00 Keyboard Disable Switch Amber Graphics Monitor line goes down. Typical transfer Brushless 12VDC 3" Fan ...... 7.50 Amber Graphics Monitor time = 12MS. Battery supplied. * * For AT, XT & Kaypro. 12V Gear Motor 30 RPM ...... 7.50 Cable: DB9M·DB9F 1 ft. length ..... 2.00 $1581 $999 High Voltage Power Supply EGA ADD $449 EGA ADD $429 Input: 15·30V DC 40M HD ADD $150 40M HD ADD $150 NEW 24V INTERNAL * Output: 100V 400V 16KV ...... 6.50 6 & 12 MHz ADD $73 5 & 10 MHz ADD $21 BATTERY $75 KAYPRO EQUIPMENT BARGAINS 9" Green Monitor - 83 ...... $50 Replacement Power Supply ...... $50 IC'S 9" Green Monitor - 84, K16 ...... 60 Drivetek 2.6M FD ...... 75 81·189 Video Pal...... $15.00 9" Amber CRT ... $45 Keyboard ... 75 CPM COMPUTERS 81·194 RAM Pal ...... 15.00 PRO·8 Mod. to your board ...... 149 K4·83 ..... $350 K2·84 ..... $400 81·Series Char. Gen. ROMs ...... 10.00 Host Interface Board ...... 15 K4·84 ...... 425 K4X ...... 425 81·Series Monitor ROMs ...... 10.00

TEST EQUIPMENT CPU & RAM & MISC. SWITCHERS OSCILLOSCOPES 41256·12 .. $7.50 41256·15 .. $6.00 5V/9.5A, 12V/3.8A, ·12V/.8A ...... $39.00 TEK 7403N/7A18N/7B50A 60 MHz .$650 4164·10 .... 2.50 4164·12 .... 2.10 5V/3A, 12V/2A, ·12V/.4A ...... 19.50 TEK 465 Dual Trace 100 MHz ..... 1000 4164·15 .... 2.00 4164·20 .... 1.25 5V/6A, 12V/2A, ·12V/1A ...... 29.00 ScopeProbex1,x10 100MHz ...... 35 MK48Z02B·20 ...... 10.00 5V/6A, 24V/1 %A, 12V/.6A, ·12V/.6A ... 29.00 USM338 50MHz Dual Trace Dallas D1220Y ...... 10.00 5V/10A ...... 19.00 Delayed Sweep ...... 300 SIP DRAM 256·12 ...... 7.00 5V/20A ...... 24.00 2716 ...... 3.50 2732 ...... 3.75 5V/30A ...... 39.00 ANALYZERS 2764 ...... 4.00 27128 ..... 6.50 TEK 491 10MHz· 40 GHz ...... $4000 5V 100A ...... 100.00 27256 ..... 5.25 27512 ..... 7.00 5V 120A ...... 110.00 TEK2215A Dual Trace 60 MHz ..... 850 MC68000·8 CPU ...... 8.00 Biomation 805 Waveform Rcrdr .... 259 Z80 CPU ... .75 Z80A CPU .. 1.50 Biomation 8100 2·Channel Z80 CTC ...... 1.50 * SPECIAL * Waveform Recorder ...... 795 Z80A PIO .. 2.00 Z80A SIO .. 5.00 IBM PS2 Model 25. Freight HP1600A Logic Analyzer ...... 600 8089·3 ...... 6.50 damaged. Works perfect. $600 HP1600A/1607A Logic Anlyzr ..... 1000 80C85A .... 4.50 8088 ...... 6.50 MISC. 8212 ...... 2.00 Optronics 550 MHz Freq Cntr ..... $100 8251 ...... 1.50 8253·5 ..... 1.50 * SPECIAL * Data Royal Function Gen F21 OA .... 200 8255·2 ..... 3.50 8255·5 ..... 2.50 AT 80286·6 CPU BOARD D8284A ...... 2.50 with reset and mono/color switch 08749 ...... 7.00 HOURS: Mon.· Fri. 9·6 - Sat. 10·4 6845 ...... 5.00 Connector for KB, Battery & SPKR MINIMUM ORDER - $15.0q 1793 ...... 6.00 1797 ...... 7.00 Phoenix Bios TERMS: VISA, MasterCard, Certified (tested with Award 3.03) Checks, Money Order, NO COD. Visa 6MHz, can be upgraded to 8 or 10MHz and MasterCard add 3%. Persona~ checks must clear BEFORE we ship., * SPECIAL * Used with backplane, add memory Include shipping charges. California External 3%" Floppy Drive, 720K, Top board, I/O board, etc. residents add 7% Sales Tax. For Loading, 5V Only, w/Docs $55 more information please call. ONLY $125

Reader Service Number 93 MICRO CORNUCOPIA, #48, July-August, 1989 53 and function prototypes, and must be ·······.·ii. is>

#inc1uded into any program which uses •••••••••• the functions defined in FILESRCH.C ••••••••• (see Figure 2). While FILESRCH pri­ marily focuses on searching for files, the module illustrates several other interest­ ing facets of C programming in the MS­ DOS environment. The first functions I wrote were those for accessing FIND FIRST and FIND NEXT. Oddly enough, I named these functions find_firs to and find_nextO. Since, as I stated earlier, some compilers already have functions of this type, it may seem strange that I would "rein­ vent" the wheel. My purpose was twofold: to provide portable directory search functions; and to furnish these functions for compilers such as WAT­ COM and Zortech which did not have built-in functions. find_firs to accepts three parameters: the file specification (which may contain standard wildcards); the file attributes desired; and a pointer to a file informa­ tion buffer. You can assign attributes « .••••• .: ...... manually, or with the defined ..... ATTR_xxxx constants in FILESRCH.H. ... . The header file also defines the format of the file information buffer. It is particularly important that you compile this module, and any which call it, with byte alignment in structures. The FILE_DATA structure, like most MS-DOS structures, aligns some infor­ mation on odd-byte boundaries. A pragma takes care of the problem for Microsoft and WATCOM compilers; Turbo C defaults to byte alignment, and Zortech C requires the -a compiler op­ tion when compiling the module. I prefer the way Microsoft and WA T­ COM handle this situation: with the pack pragma, only the structure need­

ing byte alignment compiles that way; .... \ ) ~~ ,; ··yi\.i everything else compiles in the default .... .\.... mode. Not only does this make it ...... }} ~,;\ ...... i harder for the programmer to miscom­ ...... pile the module, it also avoids problems . XLii i)·> •.• •••••. .• •••••••••••• i ... with modules compiling with different i······.··· •• i .••.•• <\. Xi ...... alignments. :;;;; >i,. ·;L mil/i} ...... First, find_firstO calls a function to ·... ·>.· .... i· t ..-. \ .... set the DTA to the location of the user­ S··I supplied buffer. It then calls FIND ...... , /, FIRST, saves the value of the carry flag, ...... i calls a function to reset the DT A, then ...... ,-: .. iir · ...... \ returns the stored value of the carry flag ;, : .. :. as an error indicator. ~~i?J find_nextO is much simpler. It ac­ cepts only one parameter, a pointer to a FIELD_DATA structure already initial­ ized by find_firstO. It sets the DTA to point to the buffer, calls FIND_NEXT, and then resets the DT A to its former ...•. location. As with find_firstO, find_nextO

54 MICRO CORNUCOPIA, #48, July-August 1989

. __ ..• -.------static void set_dta(void * new_dta) { int find_first (char * spec, char attrib, FILE_DATA * regs.h.ah = Ox2F; fd) intdosx(®s,®s,&sregs);

unsigned res: old dta seg = sregs.es; old-dta-off = regs.x.bx: set dta(fd); regs.h.ah = OxlA: regs.h.ah = Ox4E: #ifdef SMALL DATA PTRS regs.x.ex = (unsigned)attrib: regs.x.~ = (~nsigned) (new_dta); #ifdef SMALL DATA PTRS intdos(®s,®s); regs.x.~ = (unsigned) spec; #else intdos(®s,®s); sregs.ds = FP_SEG(new_dta) #else regs.x.dx = FP OFF(new dta) segread(&sregs) ; intdosx (®s,®s, &sregs) sregs.ds = FP SEG(spec): #endif regs.x.dx = FP-OFF(spec): } intdosx(®s,®s,&sregs); #endif static void reset dta(void) res = regs.x.cflagi ( - reset_dta () : segread(&sregs): return res; } regs.h.ah = OxlA; sregs.ds = old_dta_seg; int find_next (FILE_DATA * fd) regs.x.dx = old_dta_off; { intdosx(®s,®s/&sregs); unsigned res; }

set_dta(fd); regs.h.ah = Ox4F: intdos(®s,®s); res = regs.x.cflag; reset_dta () ; retuJ;'n res: }

PROMPT DELIVERY!!! SAME DAY SHIPPING (USUALLY) ICs QUANTITY ONE PRICES SHOWN for APRIL 30,1989

DYNAMIC RAM SIMM (1) 256Kx36 80 ns $450.00 SIMM I 1Mx9 80 ns 250.00 SIMM \ (2) 1Mx9 85 ns 210.00 SIMM 256Kx9 80 ns 99.00 1Mbit 1Mx1 100 ns 17.95 41256 256Kx1 60 ns 9.95 41256 256Kx1 80 ns 7.95 41256 256Kx1 100 ns 7.75 51258 (3) 256Kx1 100 ns 7.95 41256 256Kx1 120 ns 7.50 41264 (4) 64Kx4 120 ns 8.50 EPROM 128Kx8 200 ns $28.50 64Kx8 200 ns 12.95 32Kx8 150 ns 8.25 16Kx8 250 ns 4.75 STATIC RAM 62256p-10 32Kx8 100 ns $26.50 6264p-12 8Kx8 120 ns 8.50 6116AP-12 120 ns 5.5

Reader Service Number 37

MICRO CORNUCOPIA, #48, July-August, 1989 55 returns the carry flag as an error indica­ the given directory. Once it determines can't look at the value of local static tor. the starting directory, it calls variables, for instance. It also requires The implementation of these func­ subjind_workO. After sub_find_workO using both the /CO (CodeView info) tions deserves some comment. Because is done, sub_findO cleans up after itself and /Ll (line number info) options of the existence of multiple memory and returns. when linking. This seems strange, since models in MS-DOS C compilers, point­ Why do I use several global varia­ the /Ll option is a subset of the /CO ers come in different sizes (see Micro C bles, instead of passing information on option, according to Microsoft's docu­ #41 for my discussion of memory mod­ the sub_find_workO as arguments? mentation. els). MS-DOS services work with far, or sub_find_workO is recursive so globals The biggest disappointment is that it 32-bit, pointers. This is fine when work­ reduce stack overhead. The search does not truly support C++. They are ing with the large or compact models, specifications which don't change (file releasing a version which does. Soon. but causes problems in the small and spec, attributes, and handler function With a little refinement, Zortech will medium models, where data pointers pointer) would merely waste stack have one of the top debuggers available are only 16-bit offsets in the data seg­ space if they had to pass as arguments forMS-DOS. ment. every time sub_find_workO got called. FILESRCH handles this problem. All Placing this constant data in global RESOURCES MS-DOS C compilers define macros to variables also makes it accessible. (I indicate which memory model it uses used the static qualifier on the global Rocky Mountain SOG, of course, will for the current compilation. When items so they wouldn't be visible out­ be a great resource. It excited people in FILESRCH detects that it's using a side the scope of FILESRCH.) Denver so much that they merged the memory model which has near (16-bit) sub_find_workO does two things. Micro Assembly conference (which I've data pointers, it defines a macro called First it reads file data for all the files in mentioned in past columns) into Rocky SMALL_DATA_PTRS. The find_firs to the directory specified by the dir_spec Mountain SOG! Check the SOG ads in and set_dtaO functions then know what parameter. Your own handler function this issue for more details on what will type of pointer they are working with, can then process those files which have be the best SOG ever! and can adjust themselves at compile­ names and attributes matching those As for books, I highly recommend time. passed to sub_findO. If a file is a one called Concrete Mathematics by This is an excellent example of how directory, it gets stored in a linked list. Ronald Graham, Donald Knuth, and you can use the C preprocessor to make Second, after all files in the directory Oren Patashnik (1989, Addison Wesley, one source file handle multiple situa­ are processed, sub_find_workO calls it­ ISBN 0-201-14236-8). Its subtitle, A tions. The preprocessor is the C facility I self (recursively) for each directory. Foundation for Computer Science, de­ miss most when working with other Thus, it reads the file data for the scribes the contents of the book quite compilers. directory specified and all subdirecto­ succinctly. We now have functions to handle ries thereof. Have you ever wondered how algo­ simple directory searches. The next You may want to refine and expand rithms are analyzed and created? This is problem is to create a function to search on these functions. They provide a basis the book for you. Fun to read, it even a directory tree. The sub_findO function, for developing programs which can has graffiti in the margins. The graffiti and its workhorse slave function, access files in multiple directories. And, was taken from used copies of the text­ sub_find_workO, handle this problem. they show several aspects of working book (this is Stanford graffiti, folks). sub_findO is lazy; it receives the infor­ around and with MS-DOS. mation from the caller, then makes All memory models of Borland WRAP-UP sub_find_workO do all the work. Turbo C 2.0, Microsoft C 5.10 and The parameters for sub_findO are: a QuickC 2.0, WATCOM C 7.0, and Zor­ Another issue, another column! I pointer to a file specification (once tech C 1.07 have tested FILESRCH.C. It have definite plans for the next three. In again, it can include wildcards); a byte should work with any MS-DOS C com­ September/October (#49), I'll present containing the file attributes being piler which supports intdosO or another ways of doing very accurate calcula­ searched for; a pointer to the name of similar function. tions-by showing methods of generat­ the directory in which the search should ing pi to hundreds and thousands of start; and a function pointer. This last NEWS AND REVIEWS digits. parameter points to a function which Following that, in issue #50, I'm en­ will be called with file information each Here's a shocker: not much is hap­ tering Larry's realm to talk about using time a file is found. pening this month in the world of C. At fractal geometry to generate alien land­ sub_findO begins by checking to see least I'm not aware of anything. But scapes and planets. Finally, we'll go a if the file specification is a NULL don't worry, things are just getting little further afield as I submit a star pointer. If so, it assumes that we want going for 1989. Microsoft is busily at chart generator for your pleasure in to search for all files (*.*). Whatever the work on C 6.0, and it looks very good. I issue #51. And as always, I'll update file specification turns out to be, a can't say much now, but I think Micro­ you on what is happening in the world global variable stores it. Next, soft is about to provide programmers ofC. sub_findO saves the attribute and func­ with a quantum leap in development We hope to C you at Rocky Moun­ tion pointer parameters in global varia­ environments. tain SOG in July. Until we next meet, bles. Zortech has finally released their C good luck! If the directory parameter is NULL, debugger. I haven't had much time to it assumes the search should begin in work with it, but it looks good. I have the current directory; otherwise, it uses noticed some minor problems. You • • •

56 MICRO CORNUCOPIA, #48, July-August 1989 Micro Cornucopia Schematics MICRO CORNUCOPIA Xl SCHEMATIC

1"'1 X M 1"'1x ;;C ~ Z ;;c » z r » » r c c 0 ;;c » -I 1"'1 (I) » (I) tIl CD C C (J) (I)

At last you can plumb the mysteries of your computer with this single sheet schematic of the IBM Xl's main board. A wealth of information for both True Blue and clone owners.

Need to know just how a non-maskable interrupt occurs (and how to mask it)? Is your keyboard dead (or do you just want to know how to disable it)? A trip through our schematic will answer your questions.

Although clones use Slightly altered board layouts and different chip location names, they're close enough to the original for this schematic to be very useful. As an example - you have a dead clone. Lil sucker won't even beep. A look at the schematic shows the location of parallel port A. You know that the power-on self test loads a checkpoint number into port A before each test. So now all you have to do is read port A with a logic probe to see how far the system went before it puked.

We include these checkpoints and other trouble shooting information with the schematic.

IBM PC-Xl Schematic ...... $15.00 CP/M KAYPRO SCHEMATICS

Of course, we still provide a complete schematic of the processor board in your CP/M Kaypro. It's logically laid out on a single 24/1 by 36/1 sheet and comes complete with an illustrated theory of operation that's keyed to the schematic. You get detailed information available nowhere else.

For instance, those of you with the 10 and newer 84 systems get a thorough run down of the processor board's video section complete with sample driver routines. All packages contain serial and parallel port details and programming examples. Also coverage of the processor, clock, I/O, and disk controller (information that's not even available in Kaypro' s own dealer service manual!).

Kaypro II & IV (pre-84) ...... $20.00

Kaypro 10 (without modem) ...... $20.00

Kaypro 2, 4, and 10 (84 series) ...... $20.00

NOTE: These packages cover only the main boards. You're on your own when it comes to disk drives, power supplies, video cards, etc. Phone Orders: (503) 382-5060 or 1-800-888-8087 Monday-Friday, 9 AM - 5 PM PST MICRO CORNUCOPIA, #48, July-August, 1989 57 Letters Continued from page 6 books to software still requires time to server, considering the accused micro­ #47.) Congratulations on the new course be completely defined, but it would ap­ code as a whole, would ... recognize it you've found for yourself, and for af­ pear that some of the arguments, which as having been taken from the copy­ firming it in print. were given in Micro C as being offered righted sources." I began taking yoga classes a little by SEA against PKWare, contradict Here is a clear case where: (1) except over a year ago, and I'm completely these established principles. for some improvements, the NEC code hooked. Apparently, something pushed For example, on page 61 is a state­ was clearly designed to achieve the me into a bit of an identity crisis then ment that SEA asserts PKWare same result as the Intel code; (2) be­ (my job at the fire department, no " ... would be in violation of copyright cause it did the same job, it had many doubt), and I got busy looking for ways law even if [they] hadn't copied any of similarities; (3) NEC apparently had dis­ to figure out who I really am. SEA's code.... Henderson argues that assembled Intel code; (4) NEC had even Yoga was one of several, and I con­ Katz's admission of seeing SEA's pro­ copied a part of the code which was re­ tinue to be amazed at what it does for gram code ... establishes a presumption quired to overcome a hard ware prob­ me. I think you'll find that it will keep of infringement. ... " lem. And yet the court found that NEC paying big dividends over a period of Although there exists a court settle­ did not infringe. time if you stick with it. ment between SEA and PKWare which, Obviously there is more to the story In the East (Asia, not Kansas), the according to your article, appears in than SEA says. The only way to decide path towards self-knowledge is re­ SEA's favor, please note that a settle­ copyright infringement is to examine garded as an intensely spiritual one. It ment does not indicate who is right or the actual code. Even then, when the also tends to be pretty exclusive. You wrong. The matter was not judged by a code implements the same algorithm or choose a path and stick to it, often dic­ judge or jury; a settlement merely indi­ procedure-which is not copyright­ tated by the culture you live in. We cates a compromise between the parties. able-and there is a particular way in westerners are more eclectic; we have a Sometimes (as in the GEM suit be­ which any reasonably skilled program­ menu-oriented approach to life. tween Microsoft and Digital Research) a mer would implement that algorithm, Who knows where you'll end up. It larger opponent can force a smaller op­ code similarity does not prove infringe­ may not be such an exotic experience. ponent into an unfavorable settlement ment. You sound like you've already found under threat of a costly court process. It something that has you moving in the would be presumptuous of us to judge Peter A. Stark direction you want, and there are risks who is right or wrong in the SEA vs. P.O. Box 209 in dabbling in too many things at once. PKWare case merely by the terms of the Mt. Kisco, NY 10549 We have a more compulsive left settlement. brain to keep happy than the average If you want to see how the courts Burmese or Nepali, though, so it really view program copyrights, look at the helps to have some reading to keep the four-year-old legal battle between Intel deductive circuits pacified. I have a few and NEC, which was just recently suggestions, but the only one that will settled. Intel claimed that NEC copied definitely be pertinent is to use your their microcode, and that NEC's pro­ own intuition. The people who have grammer "all but admitted in court" something for me are usually the ones that he had used disassembled Intel who offer it with no strings, hoping that code in writing NEC code. I'll find what I need and grow with it. U. S. District Judge William Gray So pitch what doesn't feel right, or file it concluded that, because of a technical­ for later. ity, Intel's copyright was invalid. But I've found that Buddhism offers me even if it had been valid, he held that something that turns out to be nicely NEC still would not have infringed. He complimentary to the yoga. You can agreed that there were routines which read about Buddhism in Buddhist Amer­ were "substantially similar," but ica. (By Don Moreale, perhaps best pointed to some "in which close simi­ ordered direct from him at 1220 1/2 E. th larity in approach is not surprising." He In Support Of New Paths 20 , Denver, CO 80205, $12.95.) further stated that some similarities I've stumbled along for quite a while Chop Wood, Carry Water: A Guide to were unimportant because NEC was wondering whether there were other Finding Spiritual Fulfillment in Everyday forced into the use of certain routines to people out there who shared a combina­ Life has been another good one for me. achieve a required result. tion of interests that don't appear too (By Rick Fields and others. Jeremy In his decision, Judge Gray also obvious on the surface-computers and Tarcher, Inc., 9110 Sunset Blvd., Los An­ quoted an article in a UCLA law jour­ what I guess I'll call self-actualization. geles, CA 90069. $11.95 and often on the nal, which stated that "courts do not My house guests are fascinated to shelf at B. Dalton.) allow the accused work to be dissected find Micro C underneath a book on It is nice to know that there are into pieces, and the pieces isolated as if meditation. Imagine my surprise to kindred souls out there. You'll find' em each stood alone." One criterion he open the last issue and find your little around you, too. Oregon's not exactly a used was whether "an ordinary ob- manifesto. (See the Editorial in Issue desert in this regard. Life doesn't al-

58 MICRO CORNUCOPIA, #48, July-August 1989 ways seem easier once you get started The original statement simply identified is one of the chemicals (an amino acid) with this stuff, but it is fuller and more you as some kind of teacher. Most that the body uses to produce Sero­ meaningful. Once started, it's hard to people can· quickly map this to them­ tonin. Serotonin is one of four major stop. selves (professional teachers, parents, chemicals that help send signals around those who help co-workers learn jobs, the brain. Loren Marshall people active in churches or community This increase in Serotonin has the 1705 Bartlett Dr. groups, clubs, etc.}-pretty much a same effect as most prescribed antide­ Anchorage, AK 99507 sure-fire hit. pressant medications. These powerful, Quite possibly, other statements mood-altering medications should be A Skeptical Response were made by the reader which used under close psychiatric supervi­ I was somewhat intrigued by your generated less of a personal match and sion. comments on your search in the May­ so are less likely to be recalled by the Research on the wide use of Nutra­ June Micro C. Each person must ulti­ subject (you). But now you hit a train of Sweet has shown definite side effects in mately choose his own belief system. thought: you revealed your occupation, people of all ages. These side effects are However, I felt the need to comment on narrowing the subject by orders of mag­ similar to those of people taking an in­ common traps in logic, frequently com­ nitude. The next comment contains a appropriate medication: dry eyes; dry mitted in pursuit of things mystical; I couple of guaranteed hits: "write quite mouth; sedation; agitation; irritability; feel these show through in your edi­ a bit ... " and " ... dedicated loyal excitability; change in sleep, appetite, torial. audience." It's hard to imagine anyone sexual functioning or interest; loss of One of the most fertile aspects of the interested in his/her editing work that equilibrium and coordination; blurred human mind (and also one of the most would score this as a miss. vision; constipation; headaches, and tricky) is the ability to map symbols And, "will write a book." Pretty many more. Ask your doctor or read onto events or conditions. This of course straightforward extension for a person the package insert regarding the side ef­ is at the heart of literature and art and alread y a professional writer. I think I fects of Tricyclic Antidepressants. Prop­ creative thinking, but also very easily would bet on that prognostication erly supervised, the side effects of these misleading when trying to solve a prob­ without any belief in the system. medications are minimized. lem. When properly tested, these ap­ So, companies have removed or re­ Many things, such as astrology, psy­ proaches have not shown themselves to duced some chemicals (salt, caffeine, chic readings, Tarot cards, etc., are test­ stand up statistically. However, to the sugar and saccharin) and, in their place, able, at least to a degree, by objective extent that people are willing to believe, added a new one. I think the new warn­ approaches. But this is often overlooked then they will appear to work. ing label should read: by devotees. A classic example is astro­ Anyhow, I enjoy your magazine and "Warning: The Surgeon General has logical prediction, which in general is your free-wheeling approach that .al­ determined that this product contains a flexibly interpreted by the receiver of lowed this discussion in the editorial. powerful mood-altering chemica!''' the prediction. This has been repeatedly P.S. Feel free to drop into the Skepti­ shown through simple tests: give a cal Inquirer conference on Compuserve Allyn R. Franklin, M.A., M.B.A. large group of people their horoscopes, science forum-last Tuesday of the 6275 Canterbury Dr., #204 except mix up some of them and not month, 9:30 Eastern time. This is an in­ Culver City, CA 90230 others. Neither the person distributing formal open discussion (scientific, not the charts nor the recipients know if witch-hunting) of these and all sorts of Editor's note: Boy, put a message like they have the correct one. other controversial fields (UFOs, faith that on all the diet pop and you'd double the Repeatedly, tests like these have healing, creationism, etc). consumption by teenagers. shown that those with the wrong charts have found their charts "true" as often Jay Holovacs as those with the correct charts. (A re­ 95 King George Rd. • • • cent study in Germany in which the Warren, NJ 07060 personality profiles of more than 2,500 CIS 74756,413 people were statistically compared with their full horoscopes-not just sun signs-failed to show a statistically sig­ You Are What You Eat nificant correlation. This test, inciden­ As a licensed psychotherapist, I have tally, was performed by an astrologer in been very concerned about NutraSweet an attempt to provide scientific valida­ (Aspartame) since its introduction to re­ tion for his beliefs.) place saccharin. One of my areas of spe­ This same result often accompanies cialization is Mood Disorders. Your Tarot and other psychic readings, ex­ comments regarding flying apply to cept that here the personal feedback be­ many other areas of our mental health. tween reader and subject can strongly Every container with NutraSweet enhance the apparent power of the re­ says that it contains: "Phenylketonurics: sult. Your anecdote is a prime example. contains Phenylalanine." Phenylalanine

MICRO CORNUCOPIA, #48, July-August 1989 59 Juggling Files And Editing Text

::::::- . ~'

~ . . .• '.'.~~'\ •.•.. ." .L.. '/ '" . .d·.. e ":.1 ~~~:"""":>"""":zi/

Anthony Barcellos P.o. Box 2249 Tony describes a file handling utility, a text edi­ Davis, CA 95617-2249 tor, and the latest in the ARC wars. Speaking of Voice: (916) 756-4866 ARC, you might want to zip right down to the end Data: (916) 758-1002 Almost everyone of this column. has advice for Bill lthough MS-DOS may be the most popu­ Gates and company lar microcomputer operating system in Athe known universe, it doesn't get much on what is wrong with respect. Often called a "mere file loader" or a "CP1M clone" ("CP 1M"?), DOS continues to DOS, but few actually frustrate users. Almost everyone has advice for Bill Gates do something about it. and company on what is wrong with DOS, but few actually do something about it. This time I'll talk about two examples. Both address DOS's limitations in file handling and text executable files). If you want to operate on editing. several files, DL lets you mark them for batch operations. Another DL feature allows you to Helpware's Director 1.0 "shell out" to a text editor to work on a Dan Baumbach created the Director file highlighted text file. management utility because he was dissatisfied Since a file manager needs to keep an eye on with DOS's file-handling abilities and disap­ its working space, DL monitors your hard disk pointed with the numerous alternatives. and will share the information with you at the Don't be misled by the 1.0 in Director's press of a key. name. It's a fairly mature product that recently Sometimes roaming about your hard disk began to sport a new name. Actually a pair of and poking into various subdirectories might programs called DL and DB, the double utility not interest you. If you plan on a file-fiddling reached version 2.5 before Baumbach repack­ session that will be confined to a single aged them under a single name and reset the directory, Director includes the pared-down DB version counter. The components of Director program (which stands for "Dan Baumbach?"). have reached version 3.0. DB saves some time and memory since it DL, which is probably short for "Directory can ignore the directory structure and go List," continues to be Director's mainstay. It directly to the local files. Baumbach says, "Most displays a directory tree and lets you highlight of the time, I used DB instead of typing DIR, to the subdirectory you're interested in. When you see what's in a directory and be able to scroll press ENTER you see the subdirectory's files in through it and view files." sorted order. Baumbach has continued to polish Director The default order is alphabetical, but you and added configuration programs to cus­ can choose date, size, extension, or unordered tomize the features of DL and DB. To assist im­ (the order in which the directory stores the patient users (are there any other kind?), he has files). Press enter on a highlighted filename and written a "quick start manual" that gets right DL displays the file's contents - there's a hex into the program. option so you can view binary files in hexadeci­ His 45-page user manual takes a more lei­ mal. surely approach, describing each feature in You can do practically anything within DL: detail, providing a shareware registration form, copy, delete, rename, move (to another and giving a plug to the Association for directory), print, change attributes, or run (in Shareware Professionals.

60 MICRO CORNUCOPIA, #48,July-August 1989

------_._-- There are two registration levels for Director. At $30 you get the entire suite of programs and a printed manual; for $25 the manual is on disk only and you have to print out your own copy. (I say pop for the five bucks and save yourself the hassle; you'll get both the on-disk version and the printed copy.) Baumbach has made a special ar­ rangement for Director registration with Nelson Ford's Public (Software) Library, one of the more notable shareware dis­ tributors in the country. Call PSL at (800) 2424-PSL and register Director on your credit card. PSL then contacts Baumbach that very same day and he will mail your registered copy to you. (Of course, you can call PSL to order many other shareware products as well.) You may also write directly to Helpware:

Director 1.0 Reg. with printed manual: $30 Reg. with on-disk manual: $25 (CA residents add 6% sales tax.) Helpware 100 Bayo Vista Way, #6 San Rafael, CA 94901

SemWare's Quick Editor Every new computer user soon learns that smirks and laughter are the only proper response to any mention of EDLIN, the text editor that comes with DOS. Although it's a very capable line editor (it can imbed any character in a file), its line orientation and user inter­ face are more Stone Age than Silicon Age. Just as several programmers have striven to shore up DOS's weak file handling with DOS shells and file managers, many others have offered re­ placements for EDLIN. The essential improvement in virtually all cases is screen orientation. If you're not an old-timer in the mi-

MICRO CORNUCOPIA, #48, July-August, 1989 61

-----_._---_...... ------crocomputer business (if, say, you got spiral-bound 100 page manual. The $44 started after 1981), you might not even package contains just the QEdit disk, Rack &Desk know the difference between line edi­ with the user's manual in a text file. tors and screen editors. EDLIN and its SemWare accepts credit card orders by PC/AT Chassis kin require you to specify the line you phone, or you can write to them. want to work on, and there's no simple Integrand's new Chassis/System is not cursor movement to get you to the line QEdit 2.07 another IBM mechanical and electrical above or below. Full-screen editors let Reg. with printed manual: $54.95 clone. An entirely fresh packaging design you move your cursor around freely Reg. with on-disk manual: $44.00 approach has been taken using modular and edit where you will. (GA residents add 4% sales tax.) construction. At present, over 40 optional stock modules allow you to customize our QEdit is one of the best known and SemWare standard chassis to nearly any requirement. most popular shareware text editors. 730 Elk Cove Court Integrand offers high quality, advanced The good folks at SemWare are now at Kennesaw, GA 30144-4047 design hardware along with applications version 2.07 of this small but powerful (404) 428-6416 and technical support aI/ at prices competi­ program. tive with imports. Why settle for less? For example, QEdit is perfectly The Infinite Loop happy in only 128K (meaning that you Taking advantage of a lull in the can run it on a PCjr), although it will ARC wars, we peek out of the bunker take advantage of a full 640K. A single and what do we see: strange new utili­ disk drive suffices, since QEdit requires ties roaming the battle-scarred land­ only 50K on disk. scape. Okay, so QEdit is tiny. What can a Phil Katz (PKWare) has released program that small do? Plenty: PKZIP and PKUNZIP. They represent • Load as many different text files his attempt to launch a new standard as your computer's memory can for file compression and conflation. (I hold. would have said "archiving," but Katz scrupulously avoids the word.) • Open up to 8 windows; each can Naturally mindful of the trouble display a different file or a differ­ ent part of the same file. caused by the legal battles of the ARC wars, Katz is trying to make his new • You get 99 scratch buffers for ZIP format attractive by issuing the fol­ dumping or retrieving chunks of lowing declaration: text. "The file format of the files created • You can even customize the key­ by these programs, which file format is board. original with the first release of this • It lets you create macros by either software, is hereby dedicated to the recording keystrokes or writing public domain. Further, the filename ex­ Accepts PC, XT, A T Motherboards macro scripts in a text file. and Passive Backplanes tension of '.zIP,' first used in connection • Shell out to DOS from within the with data compression software on the Doesn't Look Like IBM editor. Rugged, Modular Construction first release of this software, is also • Customize screen colors and de­ Excellent Air Flow & Cooling hereby dedicated to the public domain, fault format settings. Optional Card Cage Fan with the fervent and sincere hope that it Designed to meet FCC • Modify the Help screen to contain will not be attempted to be appro­ 204 Watt Supply, UL Recognized your own tips and notes. priated by anyone else for their exclu­ 145W & 85Walso available • Invoke "C mode" for automatic sive use, but rather that it will be used Reasonably Priced indenting of source code. to refer to data compression and li­ Is that enough? There's more. This brarying software in general, of a class "Quick Editor" both lives up to its or type which creates files having a for­ ~Q'Ii name and travels light, unencumbered mat generally compatible with this soft­ by companion files. Even the extensive ware." customization is accomplished in a Obviously, PKWare hopes to claim ~Passive "patch area" of the executable Q.EXE the high ground in the battle for market Backplanes file. Once you've used the QCON­ share by disavowing any interest in -- -- FIG.EXE utility to patch Q.EXE, the making ZIP a proprietary format or ...-- ---..-._--~ ...... ,. -..- .....,...... -_...... -----...... Q.EXE file is all you need to run QEdit process. However, do PKZIP and ==~ ~ ~~~ ~~~ with all your special features. Only PKUNZIP have any other features that macros or key redefinitions create exter­ will help them compete with SEA's nal files. ARC? Call or write for descriptive brochure and prices: QEdit is the brainchild of Sammy The speed edge that characterized 8620 Roosevelt Ave. • Visalia, CA 93291 Mitchell. A professional programmer, PKARC and PKXARC is no longer a 209/651-1203 Mitchell has worked with both main­ consideration since SEA's ARC and TELEX 5106012830 (INTEGRAND UD) frames and micros. QARC (Quick ARC) now offer com­ FAX 209/651-1353 We accept Bank AmericardlVlSA and MasterCard SemWare distributes Mitchell's parable performance. (The court settle­ IBM. pc. XT, AT trademarks 01 International Business Machines. QEdit in two forms. The $54.95 registra­ ment between ARC and PKWare re­ Drives and computer boards not included. tion package includes a nicely printed sulted in SEA's acquisition of the

62 MICRO CORNUCOPIA, #48, July-August 1989 PKARC and PKXARC source code. In operators during the ARC wars, there's To enhance their public image in the addition, SEA is optimizing the ARC a natural reluctance to convert all those wake of the legal scuffle with Katz, SEA code.) existing ARC files. Though the UCLA has launched a newsletter called Making However, the ZIP utilities have a PC Users Group has gone over to ZIP Waves!. (It appears to be a quarterly.) brand-new directory storage feature. wholeheartedly, HAL-PC's BBS requests Call SEA for more information on their That is, you can create a ZIP file that that you not upload ZIP files. Yet products and the new newsletter. not only stores and compresses your another battle has begun. files, it also remembers the directory A full registration of the ZIP utilities System Enhancement Associates structure and the location of the files is $47, which includes a disk that con­ 21 New Street therein. Upon unzipping a ZIP file, the tains the files and their user manuals. Wayne, NJ 07470 PKUNZIP utility will recreate the Corporate rates and distribution ar­ (201) 473-5153 directory tree for you and place the files rangements are also available from in their appropriate subdirectories. This PKWare; call them for details. Cloud On The Horizon? is a nifty addition. PKWare's ZIP format is not the only As with PKARC and PKXARC, the PKZIP, PKUNZIP, and PKSFX, v 0.90 contender for ARC's market. A new en­ ZIP programs come with a utility Registration: $47 trant called LHARC has just started to (called PKSFX) to create a self-unzip­ PKWare, Inc. appear on the bulletin boards. While it ping file. Editor's note: It's not what it 7545 N. Port Washington Rd. is not as fast as PKZIP or QARC, sounds like, really it isn't. This lets you Glendale, WI 53217-3442 LHARC's claim to fame is that it distribute a program and its companion (414) 352-3670 Voice couples decent performance with ex­ files in an .EXE file that unzips itself (414) 352-7176 BBS traordinarily effective compression­ upon execution. Phil Katz distributes beating its competitors by 30 percent or his new utilities in a file called The Original more. That could produce major savings PKZ090.EXE. The version number, 0.90, As previously noted, SEA created the in disk space. indicates that this is a new venture. You original ARC program. Once nearly el­ I haven't had a chance to try LHARC should see release 1.00 shortly; in fact it bowed aside by the high-performance to evaluate its claims or examine its may be out by the time you read this. PKWare alternatives, SEA's program is compatibility with the existing ARC I don't know whether the ZIP format now out in a faster version called 5.32. standard. Watch for more news next can carve a niche in the market. While For ev~n greater speed, they now also time. Things are getting interesting all Katz won the sympathy of many BBS offerQARC. over again. • • •

QEditTM .... This small, blazing-fast editor .... The editor's speed, windows, lets program instructions, memos, and other features make it among ADVANCED letters, and assorted text data­ the best text editors I've ever bases flow easily between brain used. ~ ~ and computer. ~ ~ George F. Goley IV, text THE David M. Kalman, Contributing Editor, Data Based J:e~ Zl~; ~~iu~~ ~~ Editor-in-Chief, Data Based Advisor (September, 1988) editor at an affordable price. 4'~ EDITOR Advisor (September, 1988)

If you are looking for the paste or template operations • QEdit supports 101 key key­ To order direct call right combination of price • Exit to DOS (or a DOS shell) boards, EGA 43-line mode, and from within QEdit VGA 50-line mode . 404·428·6416 and value in a text editor, • "Pop-Down" menu system and • Great for use with laptops­ then give QEdit a try. At customizable Help Screen QEdit edits files entirely in memory, l'ffiIIZI.Cards ONL y $54. 95 and a • Column Blocks saving drain on laptop batteries ;' Add $3.00 for shipping-$1 0.00 money-back guarantee­ • Easy to use macro capability • Compact-Even with all these ,for overseos shipping. UPS 2nd' including keyboard recording features, QEdit requires less than you just can't go wrong. DAY AIR available within • Wordwrap and paragraph 50k of disk space the U.S. for ONLY QEdit is fast, easy to use, and simple reformat capabilities $5.00 Full 30 day 'COD'saccepted-:,:-pleaseadd$3.00 j to install. At the same time you get • Recover deleted text ,,~eorgioresideQts add 4% s?',es tax < all of these features and more. • Automatic indentation for C money-back guarantee

• Completely configurable, in­ programming System Requirements ____ M cluding keyboard and colors • Import files and export blocks QEdit requires an IBM PS/2, PC/AT, PC/XT, SEMWARF • Edit as many files simultaneously • locate matching braces and PC, PC/Jr, or compatible. Minimum system 730 Elk Cove Ct. • Kennesaw, GA 30 I 44 as will fit in memory requirements are 64 KB of memory, PC-DOS parentheses 2.0 or MS-DOS 2.0 or greater, 50 KB of disk QEdit and SemWare are trademarks of • Open up to eight windows • Execute command line compilers space. QEdit runs GREAT on floppy based Applied Systems Technologies, Inc. • 99 scratch buffers for cut-and- from within QEdit systems and laptops. © 1989 Applied Systems Technologies, Inc.

Reader Service Number 127

MICRO CORNUCOPIA, #48, July-August, 1989 63 A while back Nate logged on to Micro C's bulletin board Western muck all the time. I think it's gotta be bad for me. By with an unusual problem. I don't know that we were able to the way, I've discovered that my toolbox also tunes to this help him, but at least he found a couple thousand sympathetic particular station so maybe it just comes from the neighbor­ modems. hood.

2431 To: ALL From: NATHAN ENGLE

Hey, I'm a radio! I was play­ You may be on to something ing around with op-amps here. Why don't you have tonight and I hooked up a some fun with it and upload a speaker to the thing. While I submission for the Culture was twiddling with the Corner? Fame and fortune wires on the protoboard, I await. (W infal!lY anyway.) suddenly found that I was Larry tuned in to some AM radio station. The signal only From: comes through when I touch the + input on the op-amp, so I guess I'm the An article about my unfor­ antenna .... tunate condition? I think I'll hold off for a while. I've been Can anybody explain this to listening to this station (my me? I appear to receive station?) for a couple of days. some sort of Rockabilly Yesterday a guy gave a sort of Country station. Is this com­ pseudoscientific explanation of mon? I expected something the Black Hole at the center of more along the lines of a the Milky Way which this guy quiet Mozart or maybe a had identified as Satan. There Celtic band like Silly Wi­ C:S:~ are a lot of truckin' and "you­ zard, but Country & West­ done-me-wrong" songs as ern? well.

2449 To: NATHAN ENGLE This religious stuff is what 00 re ally stymies me. I'm the From: SYSOP o original secular humanist Obviously you've repressed (well, me and Carl Sagan ... ) your true musical nature. and if it got around that I'm Just be thankful that you actually a radio antenna for a heard honest-to-by-God Christian rock-a-billy country American music rather than station .... My prestige would some punk band like the suffer a blow, let me tell you. Dead Milkmen. Larry. 2488 To: NATHAN ENGLE From: SYSOP 2452 To: SYSOP From: NATHAN ENGLE Nathan, I'm surprised. You'd pass up a chance at immorality? (Pardon me, immorTality.) Well, yeah, there is always that ... still it was a shock. I listen How about a collection of these messages. I'll do all the work to Public Radio most assiduously; don't even own a TV. It was and you can take the credit. kind of a shock to realize that I'm receiving that Country & Merry Christmas, Larry

64 MICRO CORNUCOPIA, #48, July-August 1989 By Nathan Engle 6465 Piping Rock Lane #30 Indianapolis, IN 46254

2489 To: SYSOP From: NATHAN an overwhelming experience more than Thanks Nathan! I do wish you'd recon­ ENGLE once, camping out in central Kentucky sider your poster decision. (We'll even with a gang of the most bohemian ar­ let you keep your clothes on ... ) Larry Well, Larry, I've been thinking about it tists and musicians you ever saw. and I may be taking the wrong attitude 2503 To: SYSOP From: NATHAN going into the closet like I had planned. That's a long way away now, some of ENGLE It just doesn't seem to be in keeping those people have died, many have with the spirit of Open Disclosure in changed, but those are my kind of I just don't go onto posters very well. this age of Enlightened Media. I've been people. I can't help but feel that Micro C People keep o~ mistaking me for a 19th listening to this station a lot recently people (writers and readers alike) are century European statesman and it con­ and it may be affecting my thinking, but like that, too. People with passions al­ fuses them. "Why have they put Mr. it seems to me that if we can get to the ways are, whether it's for flying old Gladstone in a poster? I'm confused." root of this, if we can save one single planes, running fast computers, or play­ child from the same dread fate .... Well, ing five string banjo. We'd have to have a big label identify­ darn it! You put it that way, I don't see ing me as a 20th century poster child in­ how I could refuse. Only I'm not doing Thanks for keeping the fires burning. stead, and that might tend to spoil the any posters. Sol Libes going out of business and effect. Anyway, I'm glad you've taken Steve Ciarcia leaving BYTE have really up the cause. Save the children! Oh, by the way, a very merry holiday to hit home with me this year, and made everyone at Micro C. You have helped me more nostalgic than usual.. .. make this a banner year for me. When I • • • was a kid my father used to take me to 2495 To: NATHAN ENGLE From: art fairs where he had a display. It was SYSOP

4.~X 1I.5X I 38X~.4X ~ 170X+ .IX ._____ ~-_12X ~ t----eooKc.---f--- 1I00Ke--Io""'600~kC""'" ~55Ke-'-45!1Ke 45~t

••• W'G @

A.ve ® ItOI(

IF-455KC

Belmont 1947 Schematic

MICRO CORNUCOPIA, #48, July-August 1989 65 Growing A Software Business Succeeding Without Venture Capital And Other Impediments

business good-bye. In working with venture By Patrick o. Conley Occasionally someone expresses an opInIOn in capitalists, the partners must stick together­ President Micro C. I know that sounds strange, especially for but like all strategists,. the venture folks know Abraxas Software, Inc. those of you who join me "Around The Bend," but how to divide and conquer. 7033 SW Macadam Ave. During 1981-1983, I designed graphics con­ Portland, OR 97219 it happens. You'll find that Pat has a few opin­ ions-opinions that I share. trollers at Tektronix, Metheus, and then Micro­ field. I learned my third lesson. At Tektronix, forty of us developed a system. What a mess­ OW I wound up talking to Pat the first time, all the group wanted to do was sit in meetings I don't recall, but I distinctly remember feel­ and eat croissants; the project took two years. Hing I'd connected with an entrepreneur's en- At Metheus, four people did the same thing in trepreneur. So I proposed an "On Your Own." half the time. "But I don't write," Pat countered. Finally, at Microfield, one person did it in "I'll interview you on the phone," I offered. six months. The lesson: one person can do a "Better than that, send me the questions via fax heck of a lot; Alexander the Great taught this to and I'll jot down some answers and return them the his men. Well, it wasn't long before the ven­ same way," he said. ture-some bought me out of Microfield. I used That same afternoon I sent half a page of ques­ that cash to start Abraxas in 1984. tions, and within 24 hours our little fax was spit­ I printed business cards, sold my house ting out the longest single page ever transferred. (zero gain), got rid of my car payment, and for (Guinness, are you listening?) What follows is that the next two years I lived on $500 a month. I page. made $5,000 a month at Metheus. The first year and a half I·did royalty work, You have been working for yourself for quite and in the end averaged about fifty cents an a while. How did you wind up starting hour. Then I tried consulting, and my income Abraxas Software? rose to over $100K a year. In our system, the lack of control an in­ When I was designing graphics controllers, I dividual has over his own life has always used YACC to build C compilers for Bit Slice frustrated me. I realized at an early age that if I engines. I realized at Microfield that the PC were going to be free, I had to own my own market needed a YACC for professionals. In business. Simple things like what time I get up, 1987 I brought out Abraxas' first product, PC­ how much vacation I take, how I spend my YACC. time, and where I live are really important. (Important note: If you can't get through the In 1983, during the venture capital rage, I first two years of poverty, don't even think left a good paying job as a software engineer about starting a business. It's called paying designing graphics systems and started a com­ your dues; and unless you go through it, you'll pany building graphics boards for the Pc. Ven­ never learn to do great things with very little.) ture capital came very easily, and within one month my partner and I had a business. I Tell Us About Abraxas Software.... learned my first lesson: venture capitalists are Right now we sell PCYACC, MACYACC, the worst bosses in the world. Taking money and PCYACC/2 for OS/2. Later this summer from them is like taking money from the devil. we'll have some exciting products that will Second, I learned what Howard Hughes said solve portability and maintainability problems. is true: "Partners are dead weight." In a small Our products sell because of their value and business, you can only have one person in depth. There are over ten man-years in PC­ charge. The advantage small businesses have YACC, and for $395 that's anincredible value over the big companies is that they react for someone serious about language design. quickly. However, if you have to spend all your We publicize our products via press releases time in meetings, you might as well kiss your and advertising. We support our users by help-

66 MICRO CORNUCOPIA, #48, July-August 1989 ing them solve problems with the pro­ the average software entrepreneur gram. We don't teach people how to doesn't even pay for his PC, let alone use PCYACC. In fact, the only reason make any money. we charge $395 is so we don't have to deal with amateurs. At $99, our custom­ learned my first Where do you see the company going ers would drive us crazy. I (literally and otherwise) in the next I once spent an hour with a customer few years? only to find that he had the disk upside lesson: venture Abraxas is committed to developing down in his drive. Believe me, that can high quality software development tools generate strange results if you're debug­ capitalists are the for DOS, OS/2, Mac, Sun, Aix, VMS, ging floppy disk drivers over the tele­ and NeXT. We want all our tools to be phone. worst bosses in the portable to every platform. In the 90s, Our $139 personal version of PC­ the most important thing will be porta­ YACC generates two percent of sales, world. Taking money bility. No longer will firms invest mil­ yet accounts for eighty percent of the lions of dollars on systems that support support. If I were smart I wouldn't even from them is like only one platform. The dinosaurs who sell the product, but I don't want to lock don't see this will simply become ex­ the students and the little guy out. taking money from tinct. In the future, the best innovations Sometime in the future, I'll move will come from the guy in some room the devil. ... Abraxas to a smaller and more livable somewhere in the middle of nowhere. town. The politicians are now trying to Don't believe Microsoft when they say sell Oregon and make it more like Cal­ that gone are the days of opportunity ifornia (in terms of L.A.), so we'll prob- for the little guy; this ably move to Eastern simply isn't true. In Oregon. Note, we are not truth, the big guys are a software publishing terrified of entre­ company; we are a soft­ preneurs. ware development com­ I assume that our pany. customers are smarter than we are; you can't How well is it doing fool them. We give in­ financially? expensive or free up­ In the last question grades. Almost every mentioned that we're a suggestion from a cus­ software development tomer gets imple­ company. I believe that mented. only publishers can make One thing that money on software. To be bothers me about our a publisher, you need to industry is what I call be doing at least five mil­ pet rock software. lion dollars a year. Other­ That's junk software wise, you don't have the that just sits on economy of scale to do people's shelves. A lot mass mailings, cheap of people think they advertising, and low cost can spend three duplication and printing. months on a program, Money comes in and sell it, and rake in the money goes out. I still dough. Well, the joke's only pay myself $500 a on them. Remember, month-after all, I learned

MICRO CORNUCOPIA, #48,July-August, 1989 67 how to live on that. About 75% of our ness: as an entrepreneur you can do ness, they copy big business. A big mis­ revenue goes towards advertising. A something. Give your money away. take. You must start lean and mean and publisher probably spends about 15- Yvon Chouinard of Patagonia gives never leave that path. 20% on advertising. So, we're staying in away ten percent of his company profits I'v~ seen small companies spend business, but nobody is getting rich. If and the rest goes back into the business. their first $100,000 in venture capital on you want to be rich, become a publish­ He donates this money to environmen­ furniture. Two years later, they still er. tal causes. He will not relocate his busi­ don't have a product. If you get caught At the level we advertise, print, and ness to a town that accepts strip malls. up in your ego and fancy car, and all duplicate, we have to pay top dollar. A If we had more people like this, Amer­ the garbage that goes with being an special mention regarding advertising: ica would be a place to live instead of a "entrepreneur," you will fail! the big companies get great breaks that place to work. The first few years, you must work big magazines claim don't exist. I think long and hard for no return. All things that crossing this advertising cost wall in life are this way. Like mountain is the biggest obstacle to becoming a big climbing and martial arts, the paths are company. long but the rewards are great. However, at this point I want to The second reason is lack of patience keep Abraxas small, because small com­ 1ere's this and commitment. There is no quick way panies are fun and you get to work to get rich. If that's what you want, be­ with the customer. In a big company copying tendency come an investment banker and steal le­ you spend all your time dealing with fi­ gaIly. You must be committed, burn nancial and managerial problems. we have as your bridges, quit your comfortable job. Make your business the most important Why is it financially successful? Americans. You are thing (second only to the people) in We're not trying to rip anyone off. your life. We sell quality products that we use rewarded in school Many people are afraid to do things ourselves. Every product I'll ever sell alone so they bring a friend. We usually will be something that I need to solve a for behaving the spend less time picking a partner than software engineering problem. picking a lover; but remember, partners Let me clarify something. Success same .... So, when must spend more time together. When cannot be measured financially. Money the relationship fails, the business fails. is simply the blood of a business. If the most people start a Also, most people are afraid to go patient is low on blood, he dies. Too alone. Misery loves company, and most much money is not good, either. The business, they copy people do not like to suffer alone. politicians would take your blood if Also, never announce vaporware, they could; they will take your money. big business. A big and don't ship a product with bugs. It Furthermore, if you're rolling in cash, only takes one mistake, one message some company like Microsoft will come mistake. You must that you are a flaky company, and that's and take your business away before you it. No ifs, buts, or anything. It's the old know what happened. start lean and mean story, "If you don't have time to do it There are probably a hundred times right the first time, where are you going as many companies out there who and never leave that to get time the second time?" I see this would rather copy products than inno­ over and over. If you ever make this vate, and they have full-time people just path. mistake, go back to square one and re­ looking for fat little niches. Finally, the name your company, because the public purpose of this business is to stay in the will never forgive you. 811m,=:" If you run out of revenue, you're Finaily, pet rock software-I've seen out. Playing the game is fun if you like gobs of stupid software. The public isn't to travel, meet people, and have full stupid. If you can't spend the time to control of your life. There's a book called Growing a Busi­ develop an excellent product, then don't ness; please read it. This book describes bother. If you develop a high quality, But there's more to success .... many things entrepreneurs can do to useful piece of software that solves real The real reason for starting the busi­ make this a better world. Currently I'm problems, really works, and doesn't cre­ ness is vacation time. Two weeks a year involved in supporting National Public ate more problems, you can't fail. is ridiculous. From the very beginning, I Radio, boycotting EXXON, and saving have taken at least two months of vaca­ our environment. You use remote programmers. Why? tion a year. I take very inexpensive' Tell us about them. trips, but I go all over the world. It sounds like your company is When I started my business, I knew I I try to go mountain climbing every surviving because you've avoided the didn't want to build a home for orphan weekend, I ride my bicycle to work, and traps. programmers. I have known so many I do martial arts in the evening. Another There's this copying tendency we "programmers" who spend their day thing I like most about my business: have as Americans. You are rewarded reading the UNIX Net or playing com­ buying new toys. I just bought an Apple in school for behaving the same. To be puter games, I just didn't want to be a SE/30-it's a beautiful machine. My popular, you must dress and act accept­ baby-sitter. Remote programmers, by next machine will be a NeXT. ably. their very nature, must be disciplined or One new exciti!lg thing about bus i- - So, when most people start a busi- they don't eat.

68 MICRO CORNUCOPIA, #48, July-August 1989

------I prefer to hire first generation immi­ grants. They are the hardest workers. They understand that, in terms of CITIZEN MATE/12 286 SYSTEM starting their own business, America is without limits. 80286 With 12.5 MHz Clock Speed Since I'm on this subject, I want to has on the Mother Board: mention that most PCYACC sales come ONE Meg RAM with 1 Wait State from northern Europe. Here we have Video Controller Supports EEGA, EGA one of the most technical products CGA, MGA, Hercules and available for the PC, and only discip­ Plantronics CQlor Plus lined North European developers buy Controller Provides Support for it. This tells me that, in the near future, Two Hard Drives and Two Floppy Europe will blow us away. Drives, 5.25 and 3.5 Capability I work with a programmer in New Mouse, Parallel and Two Serial Ports Mexico who has a wonderful lifestyle in an enchanting village. He's an in­ credible producer. When he isn't pro­ 1.2 Meg Floppy Installed gramming for profit, he's teaching his 32k Hard Drive Cache Installed five-year-old son theoretical physics. He 101 Enhanced Keyboard has developed an asteroid game that MS-DOS 3.3 With GWBASIC teaches Lorentz transformations, Eu­ Small Footprint clidean geometry, general relativity, and Standard 1MB Expandable to 4MB astrophysics, all on a Macintosh. He Novelle Compatible also has developed technology that al­ Nation Wide Service lows the Mac to be an inhouse bird sanctuary by playing songs and dis­ ********************************$1495.00 playing real birds.

Any more suggestions for other XT CLONE SYSTEMS en trepreneurs? PLEASE CALL FOR CURRENT PRICE Work hard. Be original and ask your­ self every day, how badly do I want HARD DRIVES FOR XT AND AT this? Don't abandon the people you ST-225 KIT FOR XT (20 MEG) $ 269.00 love. And in the end you're doing it all ST-238 KIT FOR XT (RLL 30 MEG) $ 299.00 for only one person, yourself. $ Play hard and work hard. Don't quit ST-251 FOR AT (40 MEG) 359.00 playing, because if you do you'll lose your sense of value, and then you have MONITORS nothing. Give away your best ideas. Color Monitor RGB (CGA) $ 255.00 Being selfish with your products and Color Monitor RGB (EGA) $ 375.00 talent will only hurt you in the end. Monochrome TTL (Green) $ 85.00 Every three years, take everything Monochrome TTL (Amber) $ 95.00 you've learned and throw it away. EGA Color Video Card $ 169.00 Today, DOS is hot. Eight years ago it was CP/M. In two years, OS/2 will be hot. Learn the NeXT. Its hardware CITIZEN PRINTERS theme will be the basis of the 90s. Be­ MODEL 120D 120 CPS 9 $ 155.00 come a registered developer for all the MODEL 180D 180 CPS 9 $ 175.00 hardware people, such as IBM, Apple, MODEL MSP-15E 160 CPS 15 $ 359.00 HP, SUN, NeXT, and DEC. This way MODEL MSP-40 240 CPS 9 $ 339.00 you'll be in the same league as the big MODEL MSP-45 240 CPS 15 $ 399.00 guys in terms of information and prices MODEL MSP-50 300 CPS 9 $ 299.00 on new technology. MODEL MSP-55 300 CPS 15 $ 429.00 How about keeping a successful startup going? CASCADE ELECTRONICS, INC. My experience with our customers is ROUTE 1 BOX 8 that when they first come out with a RANDOLPH, MN 55065 great product, it sells well. They pay for 507-645-7997 their ad vertising, and everything is great. Then about six months after intro­ Please ADD Shipping on all Orders duction, they start spending all their COD Add $3.00 Credit Cards ADD 5% time doing support. They never get MN Add 6% Sales Tax Subject to change back to upgrading the product and the revenue drops. Now they're trapped. Reader Service Number 15

MICRO CORNUCOPIA, #48, July-August, 1989 69 They have no time to develop new pro­ puter, and five. million dollars." It's Have you ever noticed? That's what ducts. They get squeezed and die. really not hard. lawyers, doctors, and accountants take. I've seen this happen to many com­ Back to reality. There are ways to Companies only offer royalties for panies in the industry. It is simply bad market without spending money. one reason. They can't afford to front planning. First, most products have a Simply assume you have none. Solu­ the cash. If they really believed in the life of only a couple years. So it makes tions will manifest themselves because product, they would never offer royal­ sense that you should develop new pro­ hunger really puts the old brain in gear. ties, because that's their profits. If the ducts all the time. Also, if you have a I suspect it's best to publish your product does sell well, they'll do every­ small customer base, you need to sell own software. To a point, it really de­ thing possible to void the royalty con­ upgrades to maintain your cash flow. pends on your resources and the pro­ tract and to keep the money. You need, at the least, two people: one duct target. It would be ridiculous, for to market and one to implement. instance, for a small company to bring Summarize your experience. Marketing is a full-time job. I spent out a better word processor. License it I believe most people want to be in one year and $150K of my own money to the big company that needs one for business for the form and not substance. ,- marketing PCYACC. I mean, that's all I their product mix. When I see people start ~ business, did. Press releases and more press re­ In general, it's better for small com­ they're forever haggling over business leases. Surveys, talking to customers, panies to go after new niches. The cards, stationery, going public, titles, of­ solving problems. So you can see what people I know who do the best have fices, furniture, autos, travel, expense happens when you have one person their own niche sewed up solid. accounts, and clothes. Note that I who tries to do it all. haven't mentioned product. To succeed, you must be able to But you don't have to market your Most people, I've found, are simply develop, market, and support concur­ own software. interested in the "image" of business. rently. Otherwise you will fail. I have There are three ways to get paid To be successful, you must be product­ no solutions. This is a hard problem. I when someone else markets your pro­ oriented. Every moment must be spent got around it by hiring programmers to duct: stock, royalty, or cash. Stock is a on product improvement and sales. work on new ideas while I was spend­ joke 99% of the time. It's worthless. Every dollar must be spent to improve ing my time announcing PCYACC. Royalty is. good only if your product is sales. Every minute during the day, I This reminds me of what Mitch published by a sincere publisher who ask myself Townsend's question (he res­ Kapor once said: "All you need to start will market your product and nothing cued AVIS in the sixties): "If you're not a software company is a garage, a com- else that season. Cash is always the best. doing it for fun or profit, then what the hell are you doing it for?': As for incorporating your business, it doesn't help your profits so don't worry about it. Worry about making your bus­ iness real. Create a good product.

If you were starting over.... I absolutely would not do royalty work unless the publisher committed to A leader in quality electronics for the marketing my software. Also, the pub­ technically sophisticated customer. lisher would have to guarantee to spend When you need kit or assembled at least three times my guaranteed roy­ electronic products for work, home or alties on advertising. hobby, you can be sure Heathkit products I had to learn for myself never to are designed to perform reliably and effectively ... year after year. take anyone else's money. If you do, the See what we have to offer. To get your business is not really yours, even when FREE Heathkit Catalog, fill out and mail you do all the work. I learned my lesson the coupon below or call toll-free today! quickly and even got some cash out of the deal. 1-800-44-HEATH Life is full of lessons. You can learn (1-800-444-3284) from them or repeat them. (If you're r;------, smart, you'll even learn from other vrS I Please send me a FREE copy people's lessons.) Good Luck. I ' ~I • of the Heathkit Catalog. I Send To: Heath Company, Dept. 027-834 I I Benton Harbor, Michigan 49022 I Name I ••• I I I~~ ~ I I City I

I State Zip I L _ ~b~ry~e~EI~n~o~t~ _ ::'8~

Reader Service Number 156

70 MICRO CORNUCOPIA, #48, July-August 1989

------.------Around the ·Bend Continued from page 4

Great idea. Except.... She would be limited to ments on your main machine, it's a guaranteed that word processor and that database package. way to shut down your operation.) If they could find the monitor, there'd be no limi­ Unfortunately, no one's willing to use the ma­ tations. She'd be able to use any word processor, chine with the new Gem. For instance, to get into any database package, any spreadsheet, any game, Ventura the old way, you entered: and anything else that the rest of us use. As far as the computer world was concerned, she wouldn't VP be handicapped at all. They're sti11looking. Now you enter: (Take a look at Debee Norling's article, "Writing Software For The Blind," for one solution to this Gem problem.) and then you have to make three mouse selec­ But Graphics May Be Handicapped tions among zillions of unreadable little boxes. We had fun putting together the last issue. We Wonderful. Exiting out of Ventura (and Gem) is used to get graphics on paper. Sandy would redraw even more fun because once you're out, the everything with pen and ink. It took hours. Two screen doesn't work. (Why should I want to use years ago we were just getting into Ventura and we the screen except to select a little box?) could see that the computer would be the way to do Maybe it's time to concentrate on the Arts & graphics. Letters Editor. It runs under windows. (Unfor­ One year ago Sandy was taking the papered il­ tunately Carol has discovered Editor and she's lustrations from authors and entering them in Auto­ hogging the machine.) Cad or Publisher's Paintbrush. Occasionally, she'd "Hey Dave, you ought to try this Arts and scan something and then edit it. (Getting AutoCad Letters package, it does some really incredible to speak something that Ventura could reproduce things ... and it's fun." properly took hours and hours and hours.) What can I say? Now we're starting to see illustrations on disk rather than paper. In the last issue Gary sent PCX Under Windows files for his "Last Page." Okay. PCX has never been However, Windows isn't the cleanest of pack­ a problem so we just sucked them into Ventura. No ages either. Though Arts & Letters works well luck. We tried loading them into Publisher's Paint­ under its runtime windows, and our scanner brush, no luck. We tried using Reflection to convert software Eyestar Plus works fairly well under its them to TIFF or something and then convert them runtime windows, we have real problems with back to PCX. They converted, sort of, but the TIFF one after installing the other. file wouldn't convert back. (Reflection bailed back We install Arts & Letters and Eyestar Plus to the system and the system announced it couldn't won't run. We reinstall Eyestar Plus and usually find COMMAND.COM.) neither runs. They're in separate directories, but Gary started investigating and, no doubt, you'll that doesn't seem to make a difference. I need to be hearing more about this whole thing from him. reformat the drive anyway. So afterwards I'll get A PCX file is not necessarily a PCX file even though out CRC.COM, do the reinstalls, and see what it was generated by the same version of the same gets tromped on. (On second thought, I'll put program from the same manufacturer. The only them on different systems.) package that would display Gary's new PCX format was Sam Azer's. Speaking Of Hard Drives No wonder Sam's article on the PCX format was I'm reformatting the drive because I formatted so popular. (I understand it was required reading at it last with Spinrite (the old nondestructive for­ several graphics houses.) mat on an XT trick). I did the same thing on another drive (using Disk Technician) and soon it Meanwhile had trouble booting. After it began showing er­ I've mentioned that we're trying out Gem Art­ rors, I ran the exhaustive monthly Disk Techni­ line. Powerful package. Gem ArtHne runs under cian test. The test found half a dozen soft errors, Gem (Does this sound like deja vu all over again?) none of them even close to track O. I replaced the so it says it's completely compatible with Ventura. drive. Unfortunately, it's not completely compatible with So I'll be doing a low level, destructive refor­ any Ventura prior to 2.0, unless you install the mat the old-fashioned way. (DEBUG, FDISK, newest GEM. FORMAT.) Boy, just when you think you've We installed the newest GEM on one of our found something new, you find out it doesn't desktop machines so we could properly display and work. (Both packages work fine on ATs, how­ print ArtHne illustrations. (Never do your experi- ever.)

MICRO CORNUCOPIA, #48, July-AugUst, 1989 71 Around the Bend

SuperCalc 5 Sandy has spent hours trying all the permutations. For­ Occasionally we do real work at Micro C. For spreadsheets tunately there's tech support. Unfortunately, tech support and the like, Sandy's.been using SuperCalc 4. Great package, doesn't know much. absolutely dependable. Then she purchased the upgrade to 5. "Gee, did you select the PostScript printer in the setup She expected truly marvelous things like laser printer output, menu ... ?" a selection of fonts, more graphics .... "Yes. And I'm doing it again." Unfortunately, it appears they didn't test their fancy new "It should work now." printing routines before shipping the product. "Yes, it should." Outputting to a dot matrix printer is frustrating. For in­ While she was talking, I trapped the output to see what the stance, if you're outputting regular text, it outputs properly if program was sending to the printer. What I found was raw you select "carriage return, no linefeed." text, no PostScript header, no PostScript line information, no If you're outputting condensed text to the same printer, PostScript end of page command. She told the guy there was you must select "carriage return and linefeed." Otherwise it no PostScript header. prints everything on a single line. "Are you sure your printer is connected to the computer?" Okay, that's no worse than an adventure game. Except, Dumb, dumb, dumb, dumb .... Sand y needed regular text followed by condensed text. So she Sandy finally discovered how to get the program to speak either got double-spaced regular text or all the condensed text PostScript (there's an additional, carefully hidden menu, not on a single line. So she tried outputting on our laser printer. documented by man or manual). But the program still didn't However, outputting to either a Laserjet or PostScript printer run dependably until she selected the default printer port turned out to be an even bigger adventure. rather than specifying LPTl. Seems that the program sends a Sometimes she'd get the first page (never any following reset to the printer (after each page) if you specify a port from pages). But usually, she wouldn't even get the first page. Even their menu. Now the program works though it still occasion­ after she'd successfully output the first page, she couldn't out­ ally paints random jagged lines across the screen. put that same page again. Despite these initial frustrations, Sandy really likes the pro­ Often, just selecting the print option would hang the sys­ gram. (She's liked ail the previous incarnations of SuperCcilc.) tem. (We've tried it on a 186,286, and 386 system.) Plus, the graphics generated by this version (jaggies aside) are pretty incredible.

Cheap Logic Analyzer Larry had spent a week, on and off, trying to debug our disk copier. It's a custom copier designed around the Z80- based Little Board. The copier has worked well. In fact, out­ side of needing a new set of drives occasionally, it's been flaw­ less. Flawless, that is, until a few weeks ago. After Larry had C++1 spent his week, he decided it was time to take a vacation. On (A Videotape Presentation) the way out the door he reminded me that someone really had to fix the copier. Considering C++ for your next project? Confused after Larry had checked supply voltages, they were fine. He had trying to read a C++ book? Or just curious about all the hOOPla? This VHS-format videotape, featuring also substituted another supply just to make sure. No change. authcr!epc:l.l~cr WHli::.m M. Miller, givt::s i1 comprehensive He had disconnected lhe uri ves to see if one might be drag­ and understandable overview of the major features of ging down the system. Nope. He even mentioned replacing C++ and Object-Oriented Programming. the processor. As he left, he wished me luck. I got out the scope and • On-line access to lecturer (via BIX) started looking for the obvious: • Moneyback guaranteef System clock? Check. Address lines wiggling? Check. Send $19.95 (+$4.00 S&H) for 1-week rental or $59.95 Data lines wiggling? Check. for purchase (postpaid) to: Control lines wiggling? Check. Usually when the address and data lines are moving, you Software Development Technologies, Inc. can assume the kernel is running. That means the clock, pro­ Dept. 102 cessor, ROM, and ROM select logic are all working. That P. O. Box 366 means I could write some diagnostic code, burn it into ROM, Sudbury, MA 01776 and let the Z80 find the problem. However, as I dug around for the materials to assemble Or call (508) 443-5779, 8:00 a.m. to 6:00 p.m. Eastern time. for Visa/Mastercard orders. Z80 code and burn a ROM, I realized that creating even a simple diagnostic ROM would be a two-week project. Not an Inquire about our lull C++ training cours,. available lor on-site or tlideotape delivery. attractive prospect. Well, I did have the source for the current ROM. If only I Reader Service Number 150 knew how far it was getting into the code, I might have a clue

72 MICRO CORNUCOPIA, #48, July-August 1989

~------~-.. ---- about what was hanging up the system. I needed a logic ana­ Clock Qual ...... Two (logic high or low) lyzer. Clock Period ...... 100 ns minimum Fortunately, at that very moment John Worman walked in Displays ...... ASCII/Hex/Octal or Timing the door; and even more fortunately, he'd just finished build­ Delay Range ...... 2 to 50,000 clocks ing a Heathkit logic analyzer. Three hours later I was hooking Trigger Word ...... Selectable H,L, Don't care the new, untested analyzer into myoId, cranky copier. The Heathkit logic analyzer is not exactly competition for Logic Analyzer Model IC-1001 ...... Price $279.95, kit Tektronix's super collider. Instead of 500 MHz, the Heathkit Heath Company maxes out at 10 MHz. Instead of 128 channels, it supports 16. I Benton Harbor, MI 49022 mean, it's your basic minimum machine, and it's really the (616) 982-3411 (Good Luck) minimum for even an 8-bit processor. By the way, when Heath says it's a kit-it's a kit. You even For instance, how do you look at address and data at the assemble the three-ring binder (with two nuts and two screws) same time? The Z80 has 16 address lines and 8 data lines. before you insert the pages. Don't worry, however, they're That's not counting the control signals such as CAS, MUX, famous for their clear manuals and their knowledgable sup­ read, and write. port. Fortunately this processor was running ROM code, and for­ tunately the initialization routine lay in the first 256 bytes. I The Toshiba TIOOO hooked up 8 channels to the ROM's lowest 8 address lines. I I've been dragging around a Kaypro 2000 for a couple of hooked up the other 8 to the data bus. years and it's really spoiled me. Now I feel naked if I don't I hooked one of the analyzer's qualifier leads to the power have a computer with me. (The king has no computer.) line, and made it active high. Then I hooked the other qualifier After all, there's no way to know when an idea's going to to the ROM's write enable line and turned on the copier. Blam, jump out at me or I'm going to dig up some juicy gossip. Plus, I had the low order addresses and data from the first 2048 we all know that paper's for cave dwellers. Unfortunately, the ROM accesses. 2000 hasn't been very dependable, or very lightweight, or very At startup the processor begins by loading the instruction at easy to haul around, or easy to fix. The 2000 is a kludge. address 0000. However, I had the 2000 and I kept futzing with it (inter- 00 C3 01 29 02 00

Well, a C3 is a jump, so the processor knew it should load 68000 SINGLE BOARD COMPUTER the following two bytes to see where to jump to. It loads the low order byte first (29) followed by the high order byte (00). (The first three bytes in my printed listing were C3, 29, 00 so things were fine so far.) I looked at the next ROM access:

2D E3

Oops. The processor was supposed to jump to address 0029 but went to 002D instead. I quickly dug through the schematic • 512i1024K • 4 RS-232 SERIAL PORTS to see if there was something between the processor and the DRAM ROM (something that might misread the processor's address • FLOPPY DISK CONTROLLER • REAL TIME CLOCK selection). Nope. NEW LOWER PRICESI So it must be the processor. Right? However, it couldn't be BASIC KIT (8M HZ) - BOARD, MICROPROCESSOR. HUMBUG MONITOR I BASIC the Z80, Larry had mentioned replacing it. But I stuck in a new IN ROM, 4K SRAM. 2 SERIAL PORTS $200 processor and surprise, surprise, everything worked. PACKAGE DEAL - COMPLETE KIT WITH 10MHZ MICROPROCESSOR. SK*DOS Then, just for argument's sake, I grabbed new data. Things OPERATING SYSTEM. 512K DRAM $525 were hunky dory. SYSTEM BOARD (12MHZ) - ASSEMBLEDITESTED, 1MEG RAM. 6 PC/XT PERIPHERAL PORTS, SK*DOS $799 00 C3 COMPLETE INFORMATION AVAILABLE UPON REQUEST 01 29 02 00 PERIPHERAL TECHNOLOGY 29 F3 1710 CUMBERLAND POINT DR., #8 MARIETTA, GA 30067 404/984-0742 Some details about the Heathkit Logic Analyzer. COD/MASTER CARONISA/CHECK SK*DOS IS A TRADEMARK OF STAR-K SOFTWARE SYSTEMS CORP. Data Width ...... 16 bits Data Depth ...... 2046 words Clock Input ...... Rising or falling edge Reader Service Number 119

MICRO CORNUCOPIA, #48, July-August, 1989 73 Around the Bend mittent main board, flaky drive, dead battery ... ) until I saw board. That keyboard had an absolutely wonderful touch­ the little Toshiba T1000. better than any portable, laptop, or desktop. The T1000 isn't a killer computer (4.77 MHz 8088, 512K, unlit LCD screen, single 720K drive), but it has some very re­ The Search deeming features. It's light (just over 6 lbs. versus 11 for the Thanks for all the cards, letters, calls, and messages on the 2000), and it runs 5 hours on a charge (versus 3). It has built-in BBS regarding my search (Yoga, rolfing, psychic readings ... ). I serial and parallel ports, built-in CGA interface, MS-DOS 2.11 haven't had a chance to get back to all of you, but I thank you and DOS utilities in ROM, and an LED that glows red 10 for your help and support. (Also see Letters, this issue.) minutes before the batteries expire. It's silent, the screen is Some of you wondered how you could locate a national or more readable than the Kaypro's, and it's small enough to fit regional new age support group. You shouldn't have to look in a briefcase. beyond your own community. People who are doing this are For me, it's perfect. Weight and size are most important (so like folks running CP 1M-they're there, they're just not adver7 I can go even farther up in the mountains to write my edi­ tising. torials). Operating time away from power is also significant Usually you can find a bookstore that specializes in new (some portables won't run 2 hours), and any machine I own age material. Stop in when you have some time to browse and must have at least one drive. chat. Pay special attention to their message board. Or, your I spent one frustrating vacation tapping away on one of local college may offer evening classes on Yoga, Eastern Re­ Radio Shack's imitation laptops. No drive, limited memory. ligions, or meditation; give the instructor a call. Boy, not having a drive made me nervous and really limited Also check with alternative health professionals such as the time I could be away from a real computer. rolfers, reiki healers, or even massage therapists and Na­ Toshiba has fancier· machines with backlit screens (very turopaths. Any of these should be able to put you in touch nice), two floppies (handy), faster processors, more memory with local support groups. (you can add memory to the 1000), expansion slots, hard I'd avoid the local paper, especially the little ads that read: drives, etc. These features are wonderful if you need them, but "Psychic Reader Tells All. Special Introductory Prices." they all add weight and none of these souped up systems runs Also be cautious-if something or someone doesn't feel 5 hours between charges. So the basic 1000 is optimum for me. right to you, then step back a bit. Stay away from anyone who The only thing I miss about the Kaypro laptop is the key- has all the answers (especially one who has the only answers).

Staying Balanced Most people seem to plug along in the middle, never really comprehending the scientific world (left brain) and never con­ necting with the psychic or spiritual world (right brain). The rest of us seem to go either left or right and hang out there. We usually reserve our serious talk for folks who've been properly initiated (who already understand us). PROFESSIONAL However, I'm finding a surprising number of people who LANGUAGE DEVELOPMENT have been very connected with the scientific (my) side but TOOLKIT have begun to investigate the spiritual-and I'm finding some Includes"Drop In" Language Engines for SQL, dBASE, POSTSCRIPT, spiritual types who are now soaking up the physical side. (I'm HYPERTALK, SMALLTALK-SO, C+ +, talking about C classes and hardware design labs.) The two C, PASCAL, and PROLOG. sides nrc not mutually t!xdusive. In fact, if you put them to­ Complete grammars, Lexical Analyzers, and Symbol Table gether, you get an interesting balance. Management for ANSI C, K&R C, ISO Pascal, dBASE ""Plus and IV, SQL, C++, Smalitalk-aO, APPLE HyperTalk, C&M Prolog, YACC, LEX, and POSTSCRIPT Books are Included. OS/2 and MAC versions are available. Now for some light (and not so light) reading. Example application sources are provided to be used as skeletons for new programs. Examples include a desktop calculator, an The book that got me started in this search is The Magic Of Infix to Postfix Translator, a DBASE and Sal Syntax analyzer, Conflict. I know, it doesn't sound very interesting, but the sub­ an implementation of the PIC[turej language, and a C++ to C translator. title snagged me: Turning A Ufe Of Work Into A Work Of Art. - Lexical Analyzer Generator _ Manual "Compiler Construction Author Thomas Crum thinks of life as a playground, espe­ ABRAXAS PCLEX is included with PC'S" included cially when you're doing what you should be doing. It's really - Quick Syntax analysis option _ All examples include FULL - Optiona Abstract SOURCE about feeling good about yourself. I found this a most readable Syntax Tree _ 30 day money back guarantee - Advanced Error recovery _ No charge for shipping and fascinating book. (Keep it at your bench.) Support Provided anywhere in the world Professional Version $395-Personal Version $139. The Magic Of Conflict By Thomas F. Crum ABRAXAS'" Touchstone Press 252 pages $9.95 paperback SOFTWARE, INC. 7033 SW Macadam Ave. Portland, OR 97219 USA ISBN 0-671-66836-6 TEL (503) 244-5253· FAX (503) 244·8375 AppleLink 02205 . Mel ABRAXAS Another paperback, The Tao of Physics, provides an over­ view of the connection between Eastern philosophy and West­ Reader Service Number 157 ern science. This is an interesting book and a good one to begin

74 MICRO CORNUCOPIA, #48,Iuly-August 1989 Around the Bend with if you're not ready to feel good about yourself. Unfor­ Seth and Lazaris are two of the most famous spirit authors. tunately, I found Fritjof Capra's writing a bit cumbersome. Pre­ You can breeze right through Lazaris' books while Seth takes pare yourself to work at this one. (He's probably never written work. But Seth will challenge and stretch your ideas about life, an editorial.) the universe, and everything. I started with the volume called Seth Speaks. The Tao Of Physics By Fritjof Capra Both Seth and Lazaris have becom'e so popular that even Bantam the mall bookstores carry them. (And if you're thinking of 346 pages $4.95 paperback writing science fiction, Seth would make a wonderful jump ISBN 0-553-26379-X start.)

Of course, I have to include three other authors: Carl Sagan, The Lazaris Books Carlos Castaneda (the adventures of Don Juan), and Richard Concept Synergy, Publisher Bach (Jonathan Livingston Seagull is his classic). These authors 279 S. Beverly Dr., Suite 604 aren't particularly metaphysical, just interesting thinkers and Beverly Hills, CA 90212 excellent writers. The Seth Books And For A Definite Change Of Pace (Jane Roberts, Channeler) The books I've mentioned so far have been authored in a Bantam Books very normal way. Someone comes up with an idea, take~ key­ board in hand, and writes. In my search, I've also stumbled And that's "Around The Bend" onto a whole different style of book-untouched by human mind. These are channeled books, the words dictated by spirits. Whether you're comfortable with the idea or not, these books make interesting reading (of course you can pick your spirit David Thompson Editor & Soothsayer just as you'd pick any other author).

AT LAST! YOU CAN STEP BACK AND TAKE A LOOK AT YOUR CODE YOU WANT THE SOURCE~! FLOW CHART AND ANALVZE WELL NOW ,YOU CAN HAVE IT! The IIAS'rSK.PUL YOUR ASSEMBLY LANGUAGE DISASSEllBLER. (1ID86) vi'i:lCr-;ate HASH co.patible SOURCE CODE source code fro. program files (EXE or COH). And the files are labeled and co.aented so • Flow Charts they become USEABLE. HD86 is an interactive • Tree Diagrams disassellbler with an easy to use,. word • Stack Sizing processor like interface (this is crucial for • Register Analysis the REAL prograas you want to disasseable). • CPU Timing Analysis With its built-in help screens you • Procedural X-Reference won .... t have to constantly refer to the .anual either (although ·80~7to8038~87 t current line there are valuable diSCUS-~ • Context-Sensitive Help editor_warning sions on the ins and outs • MenulBatchlCommand r save screen t: display_warning of disasseabling which line Operation restore_screen you won.... t want to lIiss). OJ ~ editor_warning -no. c-. _ ••rel- • MASM 5.1 Compatible insert blank line adjuslJine - HD86 is a professionally join_line supported product and yet costs QUANTUM SOFTWARE editor_warning noaore than "shareware". And of course, it.... s adjusUine 19855 Stewns Oea< B\(j, Slife 154 delete_ediUine not copy protected. VERSIOB 2 BOW AYATLABIXI Q..per1i'D, CA 95014 ~ editor line out (400) 244-6826- Free Detro ediUine_oUt - IID86 Y2 is OBLY $61.50 ($1.50 sO.) + bX C.C. Software, 1907 Alvarado Ave., Walnut Creek, CA 94596, (415) 939·8153 VISA· Me 30 - Day Money Back Guarantee

Reader Service Number 139 Reader Service Number 31 MICRO CORNUCOPIA, #48, July-August, 1989 75 CP IMisceliany

WhitherSTM was double-stepping when it should John Konopacki Not too long ago, a friend gave me have been single-stepping. A call to Analytical Detectors Co. an old CP1M machine called the Pied Micro C got a new monitor ROM on the P.O. Box 1024 Piper, manufactured by a company way and some suggested tests to per­ Stafford, TX 77477 called STM Electronics Corp. This com­ form. pany was either from Mountain View At this point, the Kaypro II was ap­ More CP/M Suppliers or Menlo Park (both in California), and parently fully operational, but it could After running Samuel Vincent's list appears to have gone out of business. not read the last 40 tracks on drive B. of CP 1M vendors in Issues #45 and #46, Another friend suggested I write to Normally, on warm boot, both drives we received several tips on other com­ see if you can suggest where I may find were read by the monitor ROM and set panies catering to CP IMers: some information on it. I have all the to the appropriate drive configuration. manuals but am trying to find the ROM Drive B should have been set for DSDD Derby, W. S. BIOS listings and schematics. I'm also disks on a DSDD drive. However, the P.O. Box 2041 looking for information on some of its ROM assumed it had DSDD disks in a Livermore, CA 94550 optional accessories, such as the RS-232 quad drive. This was the reason that it General utilities board. double-stepped when formatting. When SASE for information When companies go out of business, the machine was forced to look at drive is the information passed on to some B by asking for its directory, it then rec­ Elliam Associates other organization or is it lost? Is there a ognized the drive as DSDD and the sys­ P.O. Box 2664 user group around for this product? tem worked fine. Atascadero, CA 93423 The initial cause for the problem was (805) 466-8440 Thomas B. Lerman thought to be the monitor ROM and it All manner of public domain and 8273 Wightman Ave. was replaced with a newer version (3.3). commercial software. Fair Oaks, CA 95628 However, then the system would not Most CP 1M disk formats supported boot at all. The old ROM was reinstalled Catalog - $1 Editor's note: Information on products and a new cause was sought. from dead companies just dissipates into the U49, an 8-bit buffer (74LS241) that Quinsept, Inc. electronic ether, quite literally. Your best re­ fed low order addressing to the monitor P.O. Box 216 sources will be the closets and gara~es of ROM, was checkpd; found to be good, Lexingtun, l'vlA 02173 other Pied Piper users. Any closet Pied and replaced anyway. The problem was (800) 637-ROOT or (617) 641-2930 Pipers out there who can help Thomas? solved. Genealogy software Evidently, the LS241 had weakened Also for MS-DOS, Apple, Commodore Kaypro II Fix over time and the monitor ROM was Mac, and TRSDOS. I use an old Kaypro 11-83 as a Z80 getting the wrong addressing informa­ Information available and Z8601 development system. I in­ tion. The LS241 still appeared to be stalled double-sided drives and the Pro working, but not well enough to prop­ Plu*Perfect Systems 8 monitor ROM in 1984; the monitor erly address the ROM. The monitor Current Address: version was 2.2. simply bypassed part of its own code 410 23rd St. After a longer than average pro­ and went merrily on its way. Santa Monica, CA 90402 gramming effort, the B drive started So, if this problem ever comes up (213) 393-6105 generating bad-sector errors. Formatting again, or if your system ever has prob­ ZCPR, system tools and disk exercising programs confirmed lems booting, check U49 carefully. Try that all tracks beyond number 40 had swapping it with U62 (another LS241). Micro C Staff bad sectors. After opening the case, my At $1 each (or less), you might want to eagle-eyed son noted that the B drive replace both. • • •

76 MICRO CORNUCOPIA, #48, July-August 1989

------Compression Routines Putting The Squeeze On Data

By Michael S. Hunt any kind of variable structure can present data 2313 N. 20th Data compression doesn't have to be dull. In type problems. Turbo Pascal 5.0, and perhaps Boise, 10 83702 fact, it might be just the thing for your next party. 4.0, provide for variable typecasting. This tech­ (208) 233-7539 "Step this way Mom, step this way Dad, and I'll nique allows us to view and operate on a data show you how to get rid of repeating characters." type as if it were some other type. (Who knows, they might get the hint.) Because of the variable typecasting, there is no way to determine the size of the buffers dy­ namically. The untyped parameters src and his month I'm talking about data com­ dest must be passed by reference, so they are pression. Before I get started, I should pointers to the buffers. Since the type of Tstate that I have seen neither SEA's nor buffers is unknown, the function SizeOfO can­ PKWare's source code. The source code listed not be used. The variable typecasting allows a here is entirely of my own design. I am solely type to be declared that defines how we will responsible for its content, which is not copy­ view the typecast variable. (Ouch, that one righted in any way. tied my tongueD I release the following programs to the pub­ The RleDComp unit declares the type bytes. lic domain. You are encouraged to use them, It is an array of 65535 bytes. This is the largest change them, and include them in programs buffer that the compression routines can you sell for profit (or loss). handle. The input buffer now appears to be an Editor's note: I'm sure you can also use them array [1..srcSize] of byte. You assume the out­ for party favors. put buffer to be an array [1 .. srcSize+ 1] of byte. In Modula-2, this can be avoided by declar­ Data Compression ing the buffers as array of byte in the parame­ One of the simplest forms of data compres­ ter list and using the HIGH function to deter­ sion is to replace spaces with tabs. Another mine the size of the array passed. form of compression, run-length encoding (RLE), replaces any repeating character with Encoding three bytes: a flag, the character, and a count. The compression flag is passed to the com­ Since the compressed sequence requires three pression routine. Since the flag character can bytes, there is no need to compress any change depending on the type of file, I also sequence less than four bytes. make it the first character in the output buffer. The compression flag must be a byte value The srcSize parameter specifies the size of that does not occur in the data you're com­ the input buffer or the amount of data in the pressing. For most text, a byte value of 255 buffer. I assume the output buffer will be large works welL Some COM and EXE files, how­ enough to hold the compressed data. Because ever, contain 255, and I found that 236 works of the addition of the compression flag to the for these. beginning of the output buffer, the worst case To check this, I wrote a small utility to size for the output buffer is srcSize + 1. count the number of occurrences of each byte DestSize returns the size of the output data value. It's included with the Modula-2 version in the dest buffer so you can use that value as on the Micro C Issue #48 disk. the scrSize in the decompression. You could alternately store the destSize as the second Variable Typecasting byte in the outpu t buffer. The unit contains compression and decom­ The encoding sequence first outputs the pression routines for both files and memory compression code. We then consider three cri­ buffers. (See Figure 1.) To avoid repeating my­ teria to determine if the repeat counter can be self (let me say that again), I will refer to both bumped. First, we must make sure we are not the file and memory buffers as buffers. A at the end of the buffer. Second, the current generic routine to compress or decompress byte must equal the current byte plus 1; and

MICRO CORNUCOPIA, #48, July-August, 1989 77 third, the repeat counter must not be at its maximum.

Short-Circuit Your Boolean If you look closely at the if statement in RleCompBuff, you may notice a potentially illegal array reference. If sPos was set to the last element in the array, the bytes(src)[sPos+l] reference would generate an out-of-range error. You can instruct the Turbo Pascal com­ piler, and others, to generate code that will stop evaluation or short-circuit the expression once the outcome is known.

The file-based routines can handle the largest files that Turbo Pascal can accommodate.

Since the if statement ANDs three expressions, only one has to fail to ren­ der the entire expression false. The (sPos < srcSize) subexpression will al­ ways evaluate false when there is a danger of out-of-range error. Because I relied on the short-circuit, this code must be compiled with the Turbo com­ piler flag {$B-} (default). If any of the above three conditions fail, we are ready to output data. If the repeat count is greater than three, we output the compression flag, followed by the repetitive byte and the repeat counter. If the repeat count is less than or equal to three, no compression is nec­ essary and we output the raw bytes. Two variables, sPos and dPos, con­ tain the current position in the src and dest buffers. When sPos equals srcSize, the encoding terminates. dPos main­ tains the count returned in destSize.

Decoding The decoding sequence is very simple. The first byte of the input buffer contains the compression flag. After the compression flag is identified, a byte is read from the input buffer. If it is not the compression flag, it is written to the output buffer. If it is the compression flag then another byte, the repeated byte gets read, and the pro­ gram grabs the count. It executes a loop that writes out count number of the re-

78 MICRO CORNUCOPIA, #48, July-August 1989 petitive byte to the output buffer. The cycle repeats until the program has processed the entire input file.

File Vs. Buffer The file-based routines can handle the largest files that Turbo Pascal can accommodate. The buffer-based routines are limited to 65535 bytes. If you wanted to compress a VGA screen, you would have to compress one-fourth of it at a time. Depending on the bit plane mapping, video memory can be a prime candidate for RLE because typical screens contain large identical areas. You must remember to reset or rewrite the files used by the file compression routines with a record size of 1. Example:

reset (srcFile, 1); rewrite (destFile, 1); RleCompFile(srcFi1e,destFile,255);

The file routines are slow because they aren't buffered. The buffer routines can be called repetitively to compress file fragments that are reassembled on disk. An example of this will be on the Issue #48 disk.

Next Time I recently started working for Micron Technology, Inc. One of my new toys at work is a Digital VAX cluster running the VMS operating system. In the next few issues, I will explore some of the system routines available to the VMS programmer. The first one is a sorting routine that maintains multiple sorts in memory. You can define the number and type of keys for each sort. After all the data has been passed for a particular sort, it re­ trieves the data one record at a time in sorted order. Next time, I will present my PC-based sort routines that model this concept. Good logic to you.

References Held, Gilbert, Data Compression (New York:John Wiley & Sons,1987) ISBN 0 471 91280 8 • • •

MICRO CORNUCOPIA, #48, July-August, 1989 79 The Really Early Days Of Computing Or, How I Delayed VisiCalc

The Slide Rule Hi-Res Graphics This is the beginning of the "Bits From A lot of that changed when I went to Our skills in graphics were sharpened, Your Past." In future issues we'll be run­ college. I'll never forget that first day in too. In those days, the worth of an en­ ning excerpts from many of the letters we the college bookstore, where I was out­ gineer depended just as much on his abil­ received from all you wonderful folks. But to fi tted for a career in engineering. I ity to draw a straight line or to plot a kick it off, here's a "bit" I just couldn't take watched, bug-eyed, as the clerk stacked graph as on his "book-Iarnin." apart. Jack even describes my experiences up my standard-issue equipment: a set of We solved many problems in those with the early calculators-right down to drafting instruments, a drafting board, T­ days with graphs and nomograms that the rat-a-tat-tat. square, triangles and french curves, we now do by computer. One of my and-that most wonderful of all calculat­ favorite courses was Descriptive ing instruments-the slide rule. Geometry. There we learned to do all or some of you young folks, this For me, the slide rule was magic. No kinds of magical things with a pencil and may seem hard to believe, but it's more log tables, no more trig tables. The T-square. We solved real-life geometry Ftrue: K & E slide rule had all that inscribed in problems like estimating the volumes of We haven't always had PCs! There 10" of porcelained bamboo. To multiply, highway cuts and fills, or the distance by was a time when we had no computers divide, take square roots (or any other which a power cable would miss a at all to play with. Computing had to be root or power, for that matter), you had hillside. done by hand! only to manipulate the slider and hairline One day, our prof gave us the four "cursor" on that magic instrument. The sets of coordinates defining two skewed Days Of Logarithms trig functions were there, too. straight lines. The problem was to find We had three tools in high school: a My first technical class in college the miss distance between them. We did table of logarithms, a set of trig tables, covered slide rules-those silent calcula­ this by generating projections of the lines and a pencil. Adding and subtracting we tors that never left our sides, housed as onto different planes until one of them did by hand, the old-fashioned way. For they were in scabbards hanging from our appeared end-on, as a point. multiplication and division, it was easier belts. While I was working diligently on the to add and subtract the logarithms, then Unfortunately, the slide rule could not problem, Francis, who was smarter and take the antilog. add or subtract. For that we still had to faster than the rest of us, announced that I spent a good portion of my high do things by hand, although in graduate the distance was zero; the lines inter­ school algebra class learning how to read school I got a neat little pocket adding sected. dml interpoiate a table of logarithms. The machine that helped immensely. "That's impossible," said the prof. "I trig books had tables of the trig functions, As a sidelight, I entered a sports car picked those points at random. Do you giving both their value and its logarithm. rally as a navigator (the "sports car" was realize what the odds are that I would We used the latter most, because trig a custom '41 Chevy). We won, thanks to pick a pair of lines that intersect, at ran­ functions tend to multiply things. The ta­ the invincible computing power of my dom? The distance may be small, but it bles were typically given to the nearest slide rule and adding machine. can't be zero. Go back and do it again." tenth of a degree, enough for anybody. As the years progressed, so did my Now Francis was smart, but he wasn't Solving a relatively simple trig prob­ proficiency with the slide rule. My grades a politician. He said, "I don't care what lem was not a simple matter ... it took depended on it, and I studied it earnestly. the odds are. I did it right the first time, lots of time and patience, and it was easy Before a quiz, I would carefully adjust it, and the lines intersect!" to make errors. Calculating the points in like a soldier cleans his rifle before a As the conversation got more and a single 3-D drawing would have been battle. more heated, it was clear that Francis overwhelming. Those three strips of bamboo had to was in deep trouble. He was winning the We had another approach to problems be spaced just right to slide freely but still argument but losing the war, and the like that: graphics. A drafting class was stay where I put them. I actually lubri­ profs face was getting redder and red­ required for any technical career. In that cated them with talcum powder for max­ der. class we learned how to handle T-squares imum speed without overheating(!). I As the two elevated the argument to a and triangles, and how to keep our pen­ could always tell the guys who were seri­ shouting match, they were too engrossed cils needle-sharp without breaking them ous about their grades-they had talcum to notice that, all over the classroom, the (you use sandpaper). powder stains on their shirts. rest of us were carefully erasing the lines

80 MICRO CORNUCOPIA, #48,July-August 1989 By Jack W. Crenshaw, Ph.D. 1220 E. Idlewild Ave. Tampa, FL 33604

Primitive Computing Device.

that we, too, had by this time found to chines that could do square roots, the intersect. One of the nice features of solv­ noise level rose alarmingly as more and ing things graphically was that you could more wheels got into the act. always move the lines a bit when it first Most of us didn't have access to the seemed prudent. My square root machines, and a measure of your proficiency was how quickly you Into The Space Age! technical class in could find a square root on a non-square­ After college, I went to work for root Friden. There was a neat algorithm NASA. I was going to help put men on college covered for it that I've never forgotten (no, it's not the moon (which I did). My first day, I Newton's method). I also learned the received the two tools of my trade: an slide rules-those famous "Friden March," a calculation 18", government-issue slide rule, and a that caused the carriage to chunk along book of 5-place trig tables. silent calculators in a neat, "rah, rah, rah-rah-rah" rhythm. See, NASA figured that the three-digit The big advantage of the Friden, other accuracy of the standard 10" slide rule that never left our than its tendency to get the right answer, just wouldn't cut it for space travel. was that it was accurate to as many as Generally, to get one more digit of ac­ sides, housed as twelve digits, unheard of until then. But curacy, you increased length 10 times. It most of our calculations were done to just happened that the 10" rule could al­ they were in only five digits or so, because that's as most get four digits (it could, over part of many as we had in the trig tables. Later I its range). Increasing the length to 18" scabbards hanging managed to get a book of six-place tables. was just enough to get that precious It was a big book. extra digit. from our belts. When you think about the space race Even more exciting, NASA had real and the high-tech things that go on there, desktop calculators! There were several it helps to remember that, at least such machines around. Ours were the through projects Mercury and Gemini, it Fridens. About the size of an AT, they punching (that's the right word-no elec­ was mostly done with Fridens. weighed much more. They worked much tronics or power-assist here) one key in like the adding machines used for busi­ each column, and then punching the Graphs nesses, only these would multiply and "go" key. As in college, a lot of our output in divide, as well. To the accompaniment of considerable those days were graphs. Again a large The keyboard had twelve columns of noise, the carriage slewed, the wheels part of our skill was our ability to plot ten keys each, and a carriage like a type­ spun, and in a matter of Decaseconds, microscopic dots at the right places on a writer. On the carriage spun numbered your answer appeared. Division was piece of log-log paper, and then draw a wheels. You typed a number in by quite a sight to behold. On those few ma- smooth curve through them.

MICRO CORNUCOPIA, #48, July-August 1989 81 Back in college, we plotted graphs where each number referred to a column be just the ticket for those people who with from three to seven points, but number. In effect, you wrote a program. It don't know how to program in FOR­ NASA needed much more accuracy. A was no different from defining the TRAN. It will open up the use of com­ lot of our time went into calculating the formula for Lotus or Excel. After defining puters to lots more people." data for plotting the many points. That's all the calculations, you turned things I thought about it for thirty seconds, where I learned about spreadsheets. over to the computers, who filled in the and said, "John, that's the dumbest idea These were the original spreadsheets, numbers. I've ever heard." of course-real sheets of 14" x 17" paper, The foreperson assigned different There was a moment of silence as ruled into rows and columns. We organ­ parts of the job to different women, de­ John absorbed what I had just said. The ized the "input" data into one or more pending on the load. For a big job, she sparkle in his eyes dimmed a bit. Finally, columns, then we worked down the list, would keep several parts running in par­ he whispered, ''Why?'' calculating each new column as we went. allel. Most likely the first multitasking, Now, in my defense you have to un­ For simple problems with not too multiprocessing computer system. derstand: in those days we were taught many entries, we used the good 01' 18" It all went quite smoothly. The com­ that computer time was precious-$600 slide rule. For more complex problems, puters rarely made mistakes. They also per hour, in a time when $600 would we used the Friden. had independent verification, so any mis­ buy more than a ticket to a rock concert. For long problems, we would turn the takes were always caught. They would It was important, we were told, to keep thing over to Donna, our secretary. even plot the results up for me, although the CPU busy in productive work at all Donna supported some seven engineers, I rarely used that service since I found times. It was better to spend engineer's and had the patience of Job. She would that I could plot more accurately. time than computer time. sit there all day, day after day, crunching So I explained, "John, now that we out those numbers, which we would Progress Is Wonderful have electronic computers, we have to then plot up and analyze. Donna prided Well, things didn't stay that way for learn to do things their way. Anybody herself on using 12-digit accuracy for long. We eventually did get real comput­ who plans to be an engineer in the 60s is everything, even if the input data was ers-the 701, followed by the 704, 709, going to have to learn to speak to com­ only good to three digits. If there were 7094, etc. By this time I had a different puters in their language. any errors, they certainly weren't going job, had learned how to program in FOR­ "You and I have learned to program to come from her. TRAN and other peculiar languages, and so we can do that. What you're trying to One day I got a really big problem­ was building a bit of a reputation as a do is to let the computer make up for the too big for Donna. I asked one of the old computer expert. I had written some deficiencies of the engineer. You're forc­ hands, ''What do you do with problems slick simulation programs and we were ing the computer to do extra work, just that are too big for Donna?" He said, flying imaginary spacecraft all around a because the engineer is too lazy or too very matter of factly, "Oh, you take them simulated moon. dumb to learn the computer's language. to the Computer Room." The number of computations we per­ You're never going to sell an idea that You should have seen my eyes light formed in a day would have taken those uses a computer so inefficiently!" up. I'd read all about the "Giant lady computers their whole lifetimes, As I spoke, I could see John slowly Brains"-had even learned to program multiprocessing or not. It was an exciting fall apart. His jaw fell slack, his shoulders one in college, though I never saw it (the time. I still had my slide rule (the 10" slumped, and he seemed to age by years, school didn't actually have one). one-NASA took back the 18" one and right before my eyes. That sparkle of ex­ I couldn't wait to see how the folks in the 6-place tables). I even had a 6" rule citement in his eyes dimmed and went the Computer Room dealt with my prob­ for my shirt pocket, and a 1-1/2" one as out. Finally he turned and left, a beaten lem. Eagerly I got directions from my a tie clasp (strictly for emergencies). But and broken man. colleague, prepared my data, and rushed the slide rule got used less and less as I n:ev~r saw John again. He sent me an over to the building he described. Fol­ better ways came along. example of the output of his program. (I lowing his directions, I walked down the recall that it could do automatiC' er~phing h~ll until I au~ved at a ~et of double A Real Spreadsheet of its results, which was quite an innova­ doors with a large sign proclaiming, sure One day a colleague, whom I'll call tion at the time.) I promptly filed it under enough, "Computer Room." Holding my John, came to see me. He said, "Jack, I've "dumb ideas." I heard through the breath, I eased open the door. come up with a neat computer program grapevine that he kept trying for a while, It was a huge room. There must have that I'd like you to take a look at." halfheartedly, to interest someone in it. been 300 desks, all arranged neatly in "Okay, John," said I. ''What does it As I had predicted, he was never able to rows. At each desk sat a woman, and on do?" do so, and he faded into obscurity, along each desk was a Friden. The women were "Remember the good old days when with his program. the computer! I kid you not. I found out we had to do computing by hand? Re­ And that's why we had to wait 15 later that their official job description was member the way we used to make up more years for VisiCalc, Lotus 1-2-3, and "GS-2, Computer." those spreadsheets, and turn them over Excel. Once I had gotten over the shock, I to the computer ladies?" he asked. approached the "head computer." She ''Well, I've developed a computer explained to me how things worked. program that works the same way. All • • • First, you filled out the spreadsheet with . you have to do is to define the formulas all the input data. Then at the top of each for each column of the spreadsheet and remaining column, you wrote some give the data. The computer does the cal­ operation, such as: culations just like the lady computers used to, and gives you a printout that (3) = (1) * (2) looks just like a spreadsheet. I think it'll

82 MICRO CORNUCOPIA, #48, July-August 1989 July 7 & 8 Port Alberni, Canada If SOG's your attempt to get away Other activities In the area are scuba If you're a vendor, swapper, or from It all, then the BC SOG Is your spot, dMng, hiking, museums, the new Harbour hacker, bring your wares, the meeting Vancouver Island's Port Albeml Is about. Quay, and much, much. morel and display area will be open from Thurs­ as far from anywhere as you're going to The community sports twelve motels, day-Saturday evenings. Eight foot tables get by car, plane, or boat, (195 highway six bed and breakfasts, and lots of camp­ are only S10.oo each. miles northwest of Victoria, British Colum­ sites and trailer spaces. With the registra­ bia.) tion kits the BC organizers will tell you This lumbering and fishing community more about accomodatlons. ~ of 18.500 lies at the end of a fjord-like Talks are scheduled on Friday and Registration: ...... S10 (per family) saltwater Inlet. Famous for Its salmon fish­ Saturday at North Island CoDege. The Be SOG T-shirt: ...... S10 (specify size) Ing. Its sheltered Islands and Inlets, this Is a facility wUI open Thursday evening, the Salmon Barbeque: ...... S10 popular area for kayaklng. canoe camp­ 6th, for early arrivals. They'll also hav6 a ...... (S5.OO 12 and under) Ing, boating. space for the traditional all-nlght teeml­ (All prices In Canadian dollars.) Port Albeml has an excellent sport cal forums-the Jolt SIG. sockeye salmon season. You have an op­ Special events Indude a planned ~ portunity to book a spot-results are not m1nl-maze competition put on by the David Stem guaranteed. but you can pretty well bet Seattle Robotics Sodety and a fresh sal­ 4403 8th Ave. on getting a fish. mon BBQ scheduled for Friday evening. Port Albeml, BC Canada For family excursions the M.V. Lady There Is a 50 person maximum limit on V9Y4S6 barbeque, If you are planning to attend Rose, a Scottish Coaster, steams down AI­ (604) 723-5917 or (604)724-2019 get your reservations now. beml Inlet and Into Barkley Sound to (Randy Young) Bamfleld or through the Broken Groups Is­ Sponsors DavId Stem & Randy Young lands to Ucluelet and returns In late after­ ask that you pre-register by June 15. noon. A tour can be set up for 11 or more at $39 each. I

Goodbye BASIC, C, COBOL-hello PASCAL! Now, to make RIGHT-COMPLETE SATISFACTION GUARANTEED OR this most advanced language available to more micro us­ YOUR MONEY BACK! • ers, we've cut our price-to an amazing 529.95! This In addition, if you want to copy the diskette or looseleaf astonishing price includes the complete JRT Pascal Sf.r manual-so long as it's not for resale-it's O.k. with us. tem on diskette and the comprehensive new user manual. Pass it on to your friends! This is a Limited-Time-Offer. Not a subset, it's a complete Pascal. Check the features. SO ACT TODAY-DON'T DELAY ENJOYING PASCAl:S ADVANTAGES-AT $29.95, THERE'S NO REASON TO Separate compilation of external procedures • WAIT! Auta-loading • 14 digit FLOATING POINT arithmetic • True dynarrJc storage • Verbal r··································· To: JRT SYSTEMS error messages • Fast one-step compiler: P.O. Box 187 ria no link needed • Graphing procedures • Statistics Enola. PA 17025 procedures • Activity analyzer prints program phone 717n32-1093 use histogram • Operating system interface O.K. You've sold me. Send me JRT Pascal by return mail. THIS IS THE SAME SYSTEM WE SOLD FOR 5295! I understand that if I'm not cOrTlllete~ satisfied, I can return it within 30 days for a full refund. So how can we make this offer?-why the unbelievable I need 0 51 disk or 0 3112" disk. 0 Send me the deal? Very simp~, we think all software is overpriced. We /4" JRT Pascal program formatter too, for on~ $14.95. want to build volume with the booming IBM market, and Name ______our overhead is IaN, so we're paSSing the savings on to Mdress ______you. City State __ Zip __ AND AT NO RISK! o Check/M.O. 0 COD 0 Company P.O. [add $20) When you receive JRT Pascal, look it over, check it out. PA residents add sales tax. Add $10 for shipping outside If you're not complete~ satisfied, return the system within US/Canada. US funds on a US bank only. Needs only 30 days and your money will be refunded in full! THAT'S 192K and 1 floppy drive. '------...... Reader Service Number 154 MICRO CORNUCOPIA, #48, July-August 1989 83 July 27-29, 1989 Gunnison, Colorado

Rocky Mountain SOG kicks off on Thursday the 27th with a traditional SOGgy favorite: white-water rafting. Friday and Saturday will be filled with workshops and presentations, followed by a banquet Sat­ urday night. (Scott's arranged an alI-night room for the Jolt SlG.) Gunnison, population 6,500, lies nestled In the Rockies along the Gunnison River. Raft trips In Gunnison offer both a full and a half-day excursion, with plenty of excitement. Besides white-water rafting, you'll find­ horseback riding, hiking and great fishing are recreational opportunities to explore. Gunnison County has some of the most beautfful wilderness In the country. Rocky Mountain SOG wDl be held during the same weekend as nearby Crested Butte's Aerial Weekend, which features parachuting, hang-gliding, and hot-air balloon rides and races. This will be a family vacation as well as an edu­ cational experience.

~ Conference registration: $25 in advance, ...... $30 at the door RM SOG Tee-Shirt ...... $10 (speclfys/ze) 1/2 day raft trip ...... $35 r;;::-dw; iu:f trip...... $50 Saturday night Banquet...... $15 Thursday night Barbeque ...... $10 Cafeteria Lunches (Fri/Sat) $10 ($5 each) Registration Infoj Please register as soon as possible. If you preregister, please do so before July 1. Make checks payable to "Rocky Mountain SOG." Indude names, addresses, and phone numbers of everyone you're paying for, and list what each Is ordering. Contact; Rocky Mountain SOG 302 N. 12th Street ., When you register, they'll send you a matlon. Both Continental and United Air­ Gunnison, CO 81230 packet. In that packet you'll find informa­ lines service Gunnison's airport. (303) 641-6438 I tion on activitfes ranging from tours of the The Keynote speaker for the Saturday Block Canyon to ghost town excursions. Night Banquet will be Walter Bright, author You'll aiso receive hotel and airport infor- of Zortech's C++. September 7&8 York, Pennsylvania

Nestled In York, Pennsylvania, this Saturday Morning- Another train rlde-Sat­ Contact: SOG will bring the best of the West to the urday's trip Is open to the general public John Ribar East. so you'll need to make reservations earty. The CDS Group In York you'll find antiques, Penn­ There'll be space to display your 3161 Honey Run Dr. Dutch cooking, crafts, and more. Historic treasures to because to bring along arr{­ York, PA 17404 Gettysburg Is only 30 minutes away. thing you'd like to sell. York Is 25 minutes from the Harrisburg They'd like verbal reservations as soon 017) 792-5108 (6-12pm Eastem) airport, and about 60 miles from Bel­ as possible so they can reserve the train, (117) 854-3861 (Weekdays, 8-9am East­ tlmorejWashlngton Intematlonal. rooms, etc. Please get your money In by em) Tentative Schedule: August 1. Also, speakers and exhibitors You can also talk to Carol Park at this Wednesday Night (4pm-9pm) Twlllghter (tables, $35), please call right away. Free number: Compuserve 73577,1652. Railroad excursion. steam train ride and admission for speakers (call early so they dinner trip, $25. A special trip just for SOG can schedule you.) attendees and families. Thursday- Meetings, Speakers. Registrants will receive lodging and Thursday Supper- Volleyball, frisbee, BBQ transportation Information by return mall. (Penn-Dutch style) outdoors, $15 per per­ Make checks payable to The CDS Group. son. PrIces: Thursday EvenIng- Rooms available all SOGEast registration ...... $25 night for talking, JoltslG,etc. SOGEast T-shIrt ...... $10 (specIfy size) Frlday- Speakers. Wednesday TraIn a DInner ...... $25 Frlday- The York County Fair beglns­ Thursday BBQ PicnIc ...... $15 largest livestock and agricultural show on the East coast. Lots of food, free show entertainment.

October 13, 14, 15 1989 Dallas, Texas (Info Mart)

The Dallas computer club has over ~ 4,000 members in some 15 user groups. Stuart Yarus Dallas weather should be marvelous this The Computer Council of Dallas 1950 time of year. So plan to come and enjoy Stemmons Fwy., Box 277 the south em sun and hospitality. If you'd like to speak, you should contact Stuart DaDas, TX 75207 Immediately. (214867-8012 (evenings)

See 9'"ou.f2l[[Soonl November???

Terry Sherb called just before deadline to say he's having trouble finding a facility In which to hold SOG. So he's tem­ porarily postponing the Cal SOG until possibly November. We'll carry more details In the next Issue.

------moo Dm~ Dmm Faith In Numbers:' Chaos In Chaos

rounds X =.999999999949 up to .99999999995. By Gary Entsminger This issue, Gary may appear to be a bit chaotic; The second does not. 1912 Haussler Dr. but that's because this is only an approximation of By comparing the two sets, lOU can see the Davis, CA 95616 a column. Fortunately he rounds it off with refer­ error accumulate. By the 20t iteration, the ences. values are very far apart, and by the 25th itera­ tion, they will be at opposite ends of the range. Similar behavior occurs regardless of where haos theory attempts to show the prob­ we round. A Turbo C double precision real, lems that can occur in the modeling of for example, exhibits virtually identical be­ th Cdynamic systems which include a non­ havior by the 30 iteration or so. (More on the linear factor. The simplest of these, the logistic o to 1 range and compiler precision later.) equation- To see this "chaotic" behavior, play with the Strange Attractor program I wrote for last (1) Nextx = RX(l-X) issue (it's on Micro C issue disk #47). In short, chaos theory looks at mathemati­ has been studied extensively, and is known to cal models (or representations) of physical sys'­ exhibit unpredictable behavior when iterated tems and determines that these representations (or "fed back" into a feedback loop). In a feed­ are unpredictable. back loop, the value of X in one generation de­ Let me emphasize "representations" and termines the value of X in the next. For more explain why. information about feedback loops, see "The Last Page, Strange Attractors, Order In Representations & Models Chaos," Micro C #47. When we model a dynamic system, we use The take-home message of the theory is: an equation, or equations, to describe how the these models behave unpredictably because system changes from state to state. In the lo­ they're extremely sensitive to initial condi­ gistic equation, for example, we say that the tions. Nearby values of X in one state (or Nextx (or the next state of X) is determined (or generation) may lead to values (of Nextx) described) by the current X, times a rate of which are far apart in the next state. change constant (R), times some other factor For example, in the logistic equation, a (1-X, in this case). slight change in value of X far from lhe ueci­ Many different kinds of scientists and en­ mal point, say- gineers use nonlinear equations like this one to model dynamic systems. 0.999999999949 Consider a simple biological system where we want to describe how a population (the versus the rounded off value of number of wolves, for example) changes from season to season. Equations like (1) above 0.99999999995 "model" these changes. X represents some value between 0 and 1 (where 1 represents the would be enough to produce far apart (Le., un­ largest possible number of wolves), and Nextx predictable) N extx values in succeeding represents number of wolves in the next generations (or states). generation. It doesn't matter where you round the deci­ What exactly is the largest possible number mal; eventually, the round off error will work of wolves? Well, if we were counting wolves, its way left. In general, the farther from the it would be the most we could count (a finite decimal point you round, the longer it takes number). for the error to show up. So a Nextx = 0.5 says, in effect, we have I created two sets of numbers by iterating half the possible number of wolves. And 0.55,. equation (1) using Turbo C floats (11 or 12 sig­ says we have slightly more than half the nificant digits). (See Figure 1.) The first set possible number of wolves. And 0.555 says we

86 MICRO CORNUCOPIA, #48, July-August 1989 terns, depending on memory and other Figure 1 ...;.. Round-off Error Accumulation computer resources. But in every sys­ tem, every real number has a known x(O.99999999995) x(O.999999999949) range of significance. x(4.0000447398E-ll) x(2.0000445744E-ll) In Turbo Pascal, real numbers use 6 x(O.00000000016000178959) x(8.0001782974E-11) x(O.00000000064000715825) x(O.00000000032000713l87) bytes (48 bits) of memorj and range 39 x(O.0000000025600286313) x(O.0000000012800285271) from 2.9 x 10- to 1.7 x 10 8 with 11 or x(O.000000010240114499) x(O.0000000051201141017) 12 significant digits-equivalent to a x(O.000000040960457577) x(O.000000020480456302) Turbo C float. x(0.00000016384l8236) x(O.00000008192182353l) x(O.00000065536718702) x(O.00000032768726728) If you're using a math coprocessor, 4932 x(0.00000262146703) x(O.0000013107486396) you can imrrove-from 3.4 x 10- to x(O.OOOOl0485840632) x(O.0000052429876861) 1.1 x 10493 with 19 or 20 significant X(O.0000419429227l6) x(O.000020971840789) x(O.00016776465403) x(O.000083885603883) digits-equivalent to a Turbo C long x(O~0006709460362) x(O.0003355142683S) double. x(O.0026819834704) x(O.0013416067941) In Turbo Prolo~ reals range from 1.7 x(O.Ol0699l6174) x(O.0053592275413) 308 x 10- to 1.7 x 10 08, with 15 or 16 sig­ x(O.042338758714) x(O.021322024886) x (0.1621847529) x(O.083469584563) nificant digits- equivalent to a Turbo C x(O.5435234353) x(O.30600965206) double. x(O.99242284232) x(O.84947097963) An HP llc scientific calculator gives x(O.030078977454) x(O.51148013759) about 5 significant digits. What does all this talk about signifi­ cance mean? Well, for starters, each of these compilers (and the calculator) will quickly produce very different values for Nextx when used to iterate equations like (1). have slightly more than .... Specifically, Now consider how a computer repre­ we're not counting wolves, we're repre­ sents real numbers. In normalized scien­ Chaos In Chaos senting wolves with an "infinite" num­ tific notation, a real number is repre­ Consider what happens when a com­ ber of real numbers, not integers, and sented by a sign (+ or -) and a fraction puter (or calculator) encounters an ir­ there's the rub. multiplied by lON_ rational number or a rational number that has more digits than it can repre­ Real Problems Realx = +- F * lON sent accurately. A real number (like a columnist) can It rounds off the number. What else be rational or not. A rational number is In binary (or computer terms) this can it do? One irrational number head­ a number which meets either of the fol­ becomes- ing off toward infinity would distract a lowing requirements: computer for an infinite length of time. • is reducible to an integer; Realx = +- F * 2N Editor's note: However, with a math co­ • expressible as a terminating deci­ processor, an infinite length of time doesn't mal fraction; Using 48 bits we might represent a take nearly as long. • expressible by a non-terminating real as- In many calculations, of course, fraction of which one or more rounding is no big deal. Engineers and figures repeat themselves peri­ sign of real number 1 bit statisticians thrive on limits and ap­ odically, without end. normalized mantissa 32 bits proximations. But in chaos theory, Any integer, fractions (like 53/8), or sign of exponent 1 bit rounding is in fact a very big deal, since decimals like 3.923076923076 ... qualify exponent 14 bits the theory's principal claim is that as rational numbers. total 48 bits values (numbers) very close together in The number pi (3.1416 ... ) and the one state can lead to results very far square root of 2 (1.144213 ... ), for ex- (This is how Turbo Pascal does it.) apart in future states. amples, do not. The representation varies among sys- If we use the logistic equation and

MICRO CORNUCOPIA, #48, July-August 1989 87 examine each Nextx calculation care­ of the model (at values nearing R = 4, in fully, we find that usually within the the logistic equation), chaos is greatest. first three or four calculations, the com­ Cheney & Kincaid, in their book, puter rounds X off, and feeds the Numerical Mathematics And Computing, rounded X back into the equation. have shown that round off errors are The rounded X (Nextx) is again extremely great in subtractions where rounded within three or four iterations the values (being subtracted) are very (at most). Each successive round off close together. They suggest program­ goes back into the equation. Eventually, ming around subtraction in these cases, through round off error alone, two very if possible, to reduce (but of course not close X values will lead to very far apart eliminate) loss of significance. Nextx values. Look again at the logistic equation. The claim made by chaos theorists When the value of X approaches I, we that iteration of nonlinear equations, or subtract values that are closer and models like (1), will lead to unpre­ closer together. We would then expect dictable Nextx values in succeeding greater round off error to occur, which generations is certainly true; but not it does. necessarily true, because the system is I suggest that one explanation for the Organize, Query, unpredictable. It's necessarily true be­ strangeness in chaos belongs to the & Make Connections cause the real number representation of error inherent in any system which uses Between Files of Information the system is unpredictable (creating the real numbers to represent countable conditions as it calculates the conditions values. it attempts to demonstrate). In other words, representations, Attempts to untease the problem being only approximations, are limited MICRO EINSTEIN (separate "real number errors" from in what they can say about the nature of The Expert System Shell what's "really happening" in the sys­ approximations. te:m) seem doomed (I think), since no And that's Tidbits. system is capable of maintaining real .. Create expert systems number accuracy to an unlimited signif­ References easily In minutes icance. And even if it could, it would Cheney, Ward and Kincaid, David, .. With pulldown menus and surely encounter at least one irrational Numerical Mathematics and Computing, number during the process, which it Brooks/Cole Publishing, 1985. windows would have to round off. Guillen, Michael, Bridges to Infinity, .. Automatic rule generator Chaos theory demonstrates a flaw the Human Side of Mathematics, Jeremy P. .. Context-sensitive help (or error) in nonlinear models by using Tarcher, Inc., 1983. .. Free example expert the error to demonstrate it. In other Hogben, Lancelot, Mathematics for the words, violating the requirement for in­ Million, Norton & Co., 1937, 1940, 1943, systems dependence, or in simpler terms, beg­ 1951, 1983 . .. Interactive full-screen ging the question. text editor Summa • • • .. DOS access from shell Interestingly enough, mathematical .. Turbo fast execution demonstrations and representations of (NOW 5 times faster!) chaos have been principally a computer (or calculator) created phenomenon. Try multiplying a few 16 digit reals by hand For Diagnosing ... and you'll see why. But even hand­ Monitoring .. . derived calculations will eventually suc­ cumb to an irrational number. Indexing ... Also, interestingly enough, when Organizing .. . modelers iterate the logistic equation Classifying .. . using R values in the mid-range of the equation (say 2 to 3, where the range of & Discovering links R is 0 to 4), the results are much more between files of information. consistent, in fact often at equilibria. Chaotic behavior is most pronounced near the equation's maximum. Only $100! (Plus $5 S/H) Values of X in chaotic states then Reader Service Number 72 oscillate, farther and farther apart, over and under some possible state of equi­ f·------e-----. librium. We can't tell if the system is or isn't at equilibrium since we can't get l C~ ____I____'l~ 'round the real number problem. In particular, at the maximum range A C QUI RED· I N TEL L I G ENe E P.o. BOX 2091 • DAVIS. CA 95617 • 19161753·4704

88 MICRO CORNUCOPIA, #48, July-August 1989 Techna-Kit

TK-USMD-C ADVANCED DC MOTOR Control standard 6-lead CONTROLLER stepper motors with Control 2-DC motors with a computer or other logic computer or other logic source. source. For motors rated 6-24 VDC For motors rated 1.7-12.0 Control forward/reverse/run/cw VDC. /ccw/stop. Optical Isolation Up to 6 Amp starting surge, 4 amp Control forward/reverse/step continous. Irate/stop. Will also run most 4-lead stepper Industry standard 22 pin motors. edge card connector. $29.95 $29.95

AUTOMATION CENTER • Use your computer to provide automation. 8 separate driver ports per Imagine sitting in your easy card. chair while HAL is adjusting 1 user defined sense your airconditioning or watering switch. That means he can turn on/off your lawn. And of course he is 48 different AC or DC devices. 6-24 VDC also watching the kids baking a 4 amps/driver (max current) He can measure temperature, cake or preparing the evening resistance and anything that dinner. $29.95 can be turned into an analog signal with his NO converter. All of this is done with our Hal 2000 and your PC. Hal has With your software there is 48 I/O lines and 16 Bits of not much he cannot do. NO conversion which monitors TK-USMD and senses the real world. . A stand alone driver for HAL 2000 PC CARD $79.95 6 lead steppers. Unpopulated board with: For motors rated 1.7-12 VDC Sample Software and manual User optional, on board clock. I/O connections, hardwired I/O MODULE CARDS $19.95 AC to 220 volts $19.95 DC to 24 volts Each card is a set of 8 which can be separated into single units

(See HAL Demonstrating Himself At Our Techna-Kit Display)

ROBOTICS ROBOTIC MOTORS United Products Corp. is the sponsor of the Seattle United Products Corporation Robotics Society. If you are interested in Robotics, you Stocks all kinds of them may want to call us for more details.

M-F 9-6 SAT 9-5 dM\ l'.. itB~ LlP()~l'cte C()PLl()Psti() .. ~ DISTRIBUTORS OF ELECTRONICS SINCE 1968 PHONE: (206) 682-5025 1123 VALLEY STREET· SEATTLE, WA 98109-4425 FAX: (206) 682-5593

Reader Service Number 101

MICRO CORNUCOPIA, #48, July-August 1989 89 Of Mice And Bugs

NEC HD Laptop Tips I have a little info on the NEC HD Figure 1-NEC Battery Pack (9.6v). laptop (20 Meg hard drive). Figure 1 shows how to build your own spare battery pack for about $35. (NEC gets $100 for theirs.) Figure 2 covers the pin­ out for an externalS 1/4" drive (360K). NEC's documentation on the pinout was incomplete, and their tech support people were unable to help. (They want you to buy their expensive external drive.) I'm running a Canon drive on Notes: Use 1.8 ah ni-cads with solder tabs (factory = 2.2 ah) mine, but almost any drive should Thermal switch normally closed; open @ 70·C. Good work. The 5 1/4" drive must have its substitute is ECG 8063 (thermal fuse). Place thermal switch inside battery pack. own power supply. red = charge path white = +9.6 volts black = ground I had a lot of trouble with the NEC at first. Their built-in software conflicted with many of my utilities (dBASE III, WordStar, MASM 5.1, and others). I got them.) Cute, considering that BACKUP garbage in large dBASE and WordStar Figure 2-NEC HD Drive Pinout. reported no errors and, naturally, I re­ files and sometimes the machine would formatted the hard drive before I found just lock up. 14 out that the disks were no good. CRCs confirmed that something was EXT FDC/FOE BACKUP and RECOVER in DOS 3.3 wrong, and a manual check of the data ( "...... ( ) work perfectly. ~. e e e e e e 0 0 0 e 0 0 ~ confirmed it. Many long distance calls I am pleased with the NEC now that BACK OF COMPUTER to NEC (with the usual 15 minute delay 28 15 the bugs have been appeased. For a to get a technician) finally resulted in a time I was ready to trash it. Weight­ solution. wise it's a little heavy, keyboard is It turns out that you have to kill all 1 PC/EXT good, screen very readable, runs about 2 Ready their built-in software (actually, you an hOllr ;:lnd a quarter on a battery 3 Dl:ivi= ::.t=lt:!(,!L 2: can't get rid of all of it). If you run 4 Motor enable 2 pack, 2400 baud modem (extra), power KILL640R and right after it run 5 n.c. supply too bulky (I built my own). I KILLPOP, most of the problems will 6 Index travel a lot and always take it along; I'm 7-10 n.c disappear. 11 Direction becoming very dependent on it. There is a better solution: use DOS 12 Step pulse Lynn Smith 3.3. No problems, runs perfectly 13 Write data 3051 Shirley Dr. If 14 Write enable without a glitch. you do this, the ma­ 15 Track 0 Newbury Park, CA 91320 chine will come up running in low 16 Write protect speed (4.77 MHz). Run a program from 17 Read data Power Hungry Mouse Solution the NEC BBS (312-860-2602), called 18 Side select Regarding Rod Morimoto's technical 19 n.c. LV9SPEED.COM, to switch to high 20 Ground tip, "Logitech/Zenith Compatibility," in speed (9.54 MHz). Save your NEC DOS 21 (NEC didn't know) Micro C issue #41: I too had the problem (3.2) in case you need to change start-up 22-28 Ground with interfacing a Genius Mouse GM-6 settings (screen attributes, etc.). NOTE: Order of pins is reverse Plus with a Zenith 181-92 laptop com­ One other note: NEC's BACKUP util­ of what you might expect. Pins puter. The problem is that the open cir­ ity is garbage, totally useless. The ma­ are not numbered. Ground pins 1 cuit output voltage of the laptop's RS- chine ate up part of a FAT a while back, and 21 in the external drive 232 port is less than 4 volts, but the through 3.9K. This is how the and my backup disks (two sets) were NEC knows the external drive is mouse requires more than 5 volts at unusable. (RECOVER didn't recognize there. about 10 milliamps.

90 MICRO CORNUCOPIA, #48, July-August 1989 Micro Ads A Micro Ad is the inexpensive way to reach over 22,000 technical folks like yourself. To place a Micro Ad, Just print out your message (make it short and sweet) and mail it to Micro C. We'll typeset your ad (no charge) and run it in the next available issue. You can also send camera ready copy. Rates: $99 for 1 time, $267 for three times, $474 for 6 times (a best buy at only $79 per insertion). Full payment must accompany ad, Each ad space is 2 ~ inches by 1 ~ inches.

C SCIENTIFIC LIBRARY F LAS H LATEST AWARD BIOS PC/XT 286 386 11111111111111111111111111111111111111111111111111111111111111111111111111111111 '111£ DISK ACCELERATOR Support for: * * C programming library for computations In re­ • EASY to Install ~ Enhanced Keyboards search and mathematical analysis. Each rou­ • Cache up to 32 MEGS of EXTENDED tine Is designed and documented for use by and or EXPANDED ~ EGA & VGA Graphics technical specialists and programmers. • Buffers up to 26 DEVICE driven drives ~ 3,5 inch Floppies • Comes with 2 FREE utilities!!!!! Comprehensive Over 500 functions ~ More ... Superb Documentation Matrix Math ORDER NOW $69.95 Authorized AWARD Distributor Microsoft or Thrbo C Statistics More (800) 25-FLASH (800) 423-3400 11111111111111111111111111111111111111111111111111111111111111111111111111111111 SOFfWARE MASTERS 6352 North Guilford Ave. KOMPUTERWERK, INC Eigenware Technologies Indianapolis, In 46220 / (317) 253-8088 13090 La Vista Drive, Saratoga, CA 95070 $5.00Shp/hnd in USA & CANADA,$15.00 overseas. 851 Parkvlew Blvd (408) 867-1184 ~.K Pittsburgh, PA 15215 Reader Service Number 137 Reader Service Number 106 Reader Service Number 126 STOCKS OPTIONS FUTURES Why you want BAlCOM! Tum Your PC Into A BATCOM is a batch file compiler that MARKET QUOTATION MONITOR by Epoch Data compiles your ".bat" files to ".exe" files to Modem operated 100 page book covers satellite and radio data make them faster, more professional, and power controller more capable. BATCOM extends DOS with reception of financial news and quotes for your PC. for your PC. $19 (includes demo diskette). Free Informative new commands so you can read keyboard catalog of: Makes any PC with input, perform arithmetic; use subroutines, * Data receive IS and k~s external modem and much more. In addItion, BATCOM * Quote processing and display software remote-accessable! protects your source code, and you can dis­ * DescrambUng software utDities Software Included. tribute your compiled programs without roy­ alties. For IBM PC. $49.915. 303-223-2120 $5 Demo Diskette Order direct from: Epoch Data / - '" Wenham Software Company DATArx P.O. Box 1093 t • 1 15 Burley St. 111 E. Drake Rd. Suite 7041 Cardiff, CA 92007 '\. _ / Wenham, Ma. 01984 Fort Collins. CO 80525 (619) 543-9423 rnm ~ (1508)-774-7036 FREE catalog. Reader Service Number 133 Reader Service Number 135 Reader Service Number 124

.~~.~~~.t.~!9.g.~~.m.m.!~.~ The $25 Network ScreenLib™ MyFUN is a TSR database loaded bebe yair programmilg edila'. Complete C Source Code-No Royalties! MyFLJN reads YOUR procedlJ'e aid "mclal infamalal diecty fran Try the 1st truly low cost LAN !he saeen, stlrilg it il an indexed datbase fa instant recall Yw simpy Simple Screen Definition * Windows press "A" to add the entire desaipial b fle dalabase. • Connect 2 or 3 PCs, XTs, ATs Pop-up Menus * Context-Sensitive Help No more saaps of paper b lose, no mere terse "ilvalid data type. • Uses serial ports and 5 wire cable Lots of low-level functions messages. • Runs at 115 K baud Introductory Price: $69.95 MyFLJN reqlires MSlPC-OOS 2.xx er 3.xx aid an IBM-PC, XT, AT er - Runs in background, totally transparent Plus $5.00 shipping ($10.00 ouhide US) dose canpaible machine. - share any device, any file CA reaidents ple .. ae .. dd a ..lea t ..x Nermally $69 but fer a linikld lime at fle introWctcry price of $49tP&P. - Needs only 14K of ram Business Computer Services Fer a broc:hJre er to order lIyFllN contact- Skeptical? We make believers! 1800 S. Robertson Blvd., Suite 206 Opal fire Soflware Inc., ,,~ InformaUon Modes Los Angeles, CA 90035 329 Norfl State Slree~ mDml P.O. Drawer F OREM, UTAH 84057 Phone-1.a00-336-6644 VISA/MC orders: (213) 836-5026 I 0I , Denton, TX 76202 Demo disk .. v ..i1 ..ble-$lO.OO No surcharge for VisalMClAmex. 817·387·3339 Reader Service Number 155 Reader Service Number .... Reader Service Number 149

16 Megabytes EMS and/or DTK 386 - 20 CROSS ASSEMBLERS PseudoCode releases the PseudoSam professional series Extended Memory MOTHERBOARD of Cross assemblers. All popular processors. Macros, -Works on 8 or 16 bit bus * 20 Mhz - swltchable to 8 Mhz, scores 24 Conditional Assembly, and Include Files. Virtually -16 bit transfer on AT bus XT and AT on Norton SI Testl, two 32 bit memory unlimited size. For IBM-Pe's MS-DOS 2.0 or greater with -Single board design manual $50.00. Simulators and disassemblers also slots, eight slots total, standard full size available. (MI res. 4% tax). S&H USA $5, Canada $10, -Includes RAM disk and Compatible motherboard, manufactured by DTK. Foreign $15. Visa/Me. extensive diagnostics KORElnc. -Quantity/OEM discounts $799 $1099 w/1 Mb Memory 6910 Pattorson S.E. Caledonia, MI49316 616-887-1444. • Order Hotline ~:S~~~:cd;ured, m~ A??i~~\ ~MlcroSplv=rE... 1-800-234-8086 Sold and Serviced by ~u~~u U Tech Calis 30 Day satisfaction guaranteed ... CXJMPC.JTERSr- -_. or purchase price refunded. 855 NW Wall St., Bend, OR 97701 (503) 388·1194 .8(»1 North 6th SL Lake City, UN 55041 (612)345-'555 Reader SeIVice Number 03 Reader SeIVice Number 02 Reader Service Number 136

MICRO CORNUCOPIA, #48, July-August, 1989 91 Rod's unimplemented suggestion is doable, but unduly complex. My solu­ Figure 3-Zenith Laptop/Genius Mouse Interface. tion was to stick a standard $5 RS-232 0 junction box between the computer and the mouse as shown in Figure 3. I got the two 2-cell AAA battery holders (59¢ each) from a Radio Shack and glued them to the top of the junc­ 1 1 tion box. I wired the batteries in series 2 2 ~ + '1'1 - 6 VOLTS (for 6 volts) and threaded the plus and ::::> 3 3 d minus leads into the junction box. (Dis­ 0.. 3: ::::::IE 4 4 connect the mouse when not in use to 0 g 0 7 7 (/) conserve battery energy.) ,." E 20 20 This simple circuit has been success­ fully operating for some time. However, the mouse will only work in Microsoft mode, at the 6 volt level. JUNCTION BOX On another subject, does anyone know how to interface a 3.5" 1.44 MB floppy disk and/or a hard disk to this model Zenith? Figure 4-Short Program to Locate Attributes On Video Adapter

Sidney Epstein PROGRAM FindAtr; ( Toggles an attribute repeatedly until a keystroke. Configured here to find the reverse video attribute 140 Cadman Plaza West, Apt. 17G on a CGA card. } Brooklyn, NY 11201 CONST Video Attribute Control Normal = $07; { . normal video attribute Reverse = $70: ( reverse video attribute I would appreciate help with a prob­ VidBase = $b800; { base address for CGA text memory lem. Since I have cataracts and retinitis pigmentosa, I see a great deal of glare VAR ( use ABSOLUTE to force this array to overlay video memory Screen: ARRAY [0 .. 3999J OF Byte ABSOLUTE VidBase:O; when large areas of the screen are dis­ played as reverse video (in mono­ chrome systems) or bright colors. PROCEDURE SetAttribute (Attrib: Byte); Although many programs have an VAR installation which allows color selection I: Integer; or the use of underline instead of reverse video, many others do not. Does BEGIN set all characters to one attribute } FOR I := 0 TO 1999 DO anyone know: Screen [2*I + lJ := Attrib; (1) how reverse video can be END; {SetAttribute} changed or defeated on monochrome CRTs? BEGIN {MAIN} (2) how colors can be changed to WHILE NOT Keypressed DO dark background and light characters? BEGIN An example of software that gives SetAttribute (Reverse); { turn attribute on and beep Write (AG); me the problem is Eight-in-One, which Delay (1000); has a large part of the screen in bright SetAttribute (Normal); { turn attribute off and beep reverse video. I would hope that when Write (AG); Delay (1000); the application software controls the END; {WHILE} colors, there is a way to override and END. reset colors by using a special EGA card ••• or monitor. Maybe the problem is easier in the CGA display. In monochrome displays, Editor's note: I dug out a few video before they get combined with character maybe certain driver cards could accept boards at Micro C, did a little digital data to form the final dot stream. It turns a change to reverse video showing it as vivisection, and came up with a few very out to be easy (sorta). underlined text, like WordStar allows.in general tips on attributes. (Don't let anyone The video controller reads one charac­ its installation procedure. At present I tell you differently; R&D really stands for ter/attribute pair at a time and stuffs 'em have an AT compatible with a Quad "Ruin and Devastate.") into buffers. We just have to figure out EGA + board and Hercules compatible The one byte attribute associated with which chip buffers the attribute byte. Often, monochrome graphics board. Thanks each character controls reverse video, under­ octal flip-flops like the '273 and '374 per­ for any ideas. line, blink, intensity, and foreground and form this function. background color. Be aware that available So here's the drill. Run a little program Carl H. Schmitt attributes vary a bit from Hercules to CGA (like the one in Figure 4) that toggles the 3201 Coquelim Terrace to VGA, etc. Our mission (should we decide attribute you want to control. Make it beep Chevy Chase, MD 20815 to accept it) is to intercept the attributes every time the attribute changes. Now start

92 MICRO CORNUCOPIA, #48, July-August 1989

--~-~------digging around on the video board with a with information on how to use CBFB VOICE MASTER KEY ® logic probe or volt meter. Look for a pin (or materials and the additional services we pins) that goes high and low with the same provide. VOICE RECOGNITION frequency as the beep. (A board extender to For more information on computer­ SYSTEM bring the video card up out of the bowels of ized books, hardware, software, FOR PC/COMPATIBLES & your computer will make life immeasurably graphics, etc., contact Computerized TANDY 1000 SERIES easier. Available for $20 or so from Jameco Books for the Blind. and others.) A FULL FEATURED VOICE 1/0 SYSTEM Once you've found the appropriate pin George Kerscher, Director GIVE A NEW 01 MENSION TO PERSONAL COMPUT­ (be sure it's an input to the chip, not an Computerized Books for the Blind ING ...The amazing Voice Master Key System adds output), just pull the chip, bend out the pin 33 Corbin Hall voice recognition to just· about any program or so it doesn't contact the socket, tie it high or University of Montana application. Voice command up to 256 keyboard macros low (through a lK resistor), and plug the Missoula, MT 59812 from within CAD, desktop publishing, word process­ ing, spread sheet, or game programs. Fully TSR and chip back in. I used this method to defeat a (406) 243-5481 occupies less than 64K. Instant response time and high single attribute (reverse video). But you recognition accuracy. Voice recognition tool-box utili­ should be able to gain more complete con­ Editor's note: An application form, more ties are included. A genuine productivity enhancerl trol. general information, and a list of computer SPEECH RECORDING SOFTWARE ... Digitally record Find all 8 bits of the attribute (probably related titles resides on the Micro C BBS your own speech, sound, or music to put into your own 8 inputs on the same chip) and tie them under the name CBFB.ARC. The impressive software programs. Software provides sampling rate variations, graphics-based editing, and data compres­ high through a DIP switch to 5 volts. Now list of titles even includes an offering from sion utilities. Create software sound files you can add you can set any attribute by simply chang­ Peter Norton. (l wonder if that one comes to macros for voice recognition verification response. A ing the DIP switch setting. Careful though, on a pink disk?) complete, superior speech and sound development tool. the attribute will apply to the entire screen. SOFTWARE CONVERSION CODES. . .The Voice (l find a blinking, reverse video display to Access To Micro C Listings Master Key System operates a growing list of third be most restful, but that may not be appro­ For those of you whose pocketbooks party talking software titles using synthesized phone­ priate for all users.) object to long distance calls to the tics (text-to-speech) or digitized PCM, ADPCM, and CVSDM encoded sound files. Voice Master Key System middle of nowhere (Bend), we have an does It alii Larry Fogg alternative (actually, several). The fol­ Micro C Staff lowing BBSs have joined the Micro C BBS in offering our issue listings for Books For The Blind download. Computerized Books for the Blind (CBFB) is a nonprofit organization Generation 5 BBS devoted to providing written informa­ (301) 495-6680 tion in computer-accessible format to Located in Washington, D.C., and acces­ disabled persons. CBFB accepts requests sible through PC Pursuit. Subscription from registered members and attempts board, but free downloads of Micro C to provide the written material in com­ files. See bulletin #7. 24 hr. EVERYTHING INCLUDED. . .Voice Master Key puter format compatible with the in­ System consists of a plug-in card, durable lightweight dividual member's equipment Tee-PC microphone headset, software, and manual. Card fits aly available slot. External ports consist of mic inputs CBFB would like to welcome all in­ (714) 355-0373 and volume controlled output sockets. High quality dividuals regardless of their disability. Fontana, CA board accessable from 2 throughout, easy and fun to use. Although this program is oriented p.m. to midnight weekdays and all day toward the visually impaired, we recog­ on weekends. Free board with a Ham ONLY $149.95 COMPLETE nize that other disabled individuals can slant. ONLY $89.95 FOR TANDY 1000 SUTL MODELS­ also benefit from this service. SOFTWARE PACKAGE ONLY. To become a registered member, a The Computer Nookery Requires Tandy Brand Electret microphone. disabled individual or an institution (201) 423-4258 ORDER HOTLINE: (503) 342-1271 serving the disabled must apply directly Free board (donation requested) in Monday-Friday, BAM to 5PM Pacific Time to CBFB. The registration forms request Hawthorne NJ. PC Pursuitable. 300- Visa/MasterCard, company checks, money orders, that the individual applicant provide as­ 2400 baud or 9600 if you have US CODs (with prior approval) accepted. Personal checks surance of their disability to CBFB by Robotics modem. 24 hr. subject to 3 week shipping delay. Specify computer having their doctor, counselor, or em­ type and disk format (3W' or 51/4') when ordering. Add $5 shipping charge for delivery in USA and ployer complete and sign the verifica­ Canada. Foreign inquiries contact Covox for C & F tion section. Additionally, CBFB re­ quotes. 3ODAYMONEY BACK GUARANTEE IF NOT quires that the applicant sign a state­ • • • COMPLETELY SATISFIED. ONE YEAR WARRANTY ment prohibiting them from distributing ON HARDWARE. the computerized materials in any form to others. CALLOR WRITE FOR FREE PRODUCT CATALOG There is an initial registration fee of Reader Service Number 143 $25 which should accompany the appli­ cation. If prospective members cannot . afford the fee, a letter requesting a COVOX INC. 675-D Conger St. waiver should accompany their applica­ @ Eugene, Oregon 97402 U.S.A. TEL: 503-342-1271- FAX 503-342-1283 tion. Each member will receive a packet

MICRO CORNUCOPIA, #48, July-August, 1989 93 Micro Cornucopia Back Issues Is There A Gap In Your Info? Fill in your Back Issues of Micro C today!

ISSUE #1 (8/81) ISSUE #16 (2/84) ISSUE #27 (12/85) ISSUE #39 (1/88) ISSUE #45 (1/89) Power Supply Xerox 820 Column Restarts SOLD OUT PC Graphics Computer Aided DeSign 112 PFM.PRN BBI Double Density Drawing The Mandelbrot And CAD In A Consulting Business 16 pages BBII S"/8" Interface Fix ISSUE #28 (2/86) Julia Sets Choosing PCB Layout Systems Kaypro ZCPR Patch Rescuing Lost Text From Desktop Graphics Building Circuits With Your ISSUE #2 (10/81) Adding Joystick To Color Memory Designing A PC Work­ Computer Parallel Print Driver Graphics Introduction To Modula-2 station Board Secrets of Optimization Drive Motor Control Recovering Text From Memory Inside The PC Around the TMS-3401 0 Finding Bargains in the Surplus 16 pages S2 pages 104 pages 96 pages Market MASMS.1 ISSUE #3 (12/81) ISSUE #17 (4/84) ISSUE #29 (4/86) ISSUE #40 (3/88) 96 pages 4MHz Mods Voice Synthesizer Speeding Up Your XT. The Great C Issue Configuring Modem 7 Kaypro Morse Code Interface Prototyping In C 11 C Compilers Issue #46 (3189) Reverse Video Cursor 68000-Based System Review C Interpreters Reviewed Writing A Simple Parser In C Software Tools FORTHwords Begins Inside CP/M 86 Benchmarking The PCs C++, An Object Oriented C The Art of Disassembly 16 pages 56 pages 104 pages Source Level Debugger For Handling Interrupts With Any C Turbo C Hacking Sprint: Creating Display ISSUE #4 (2/82) ISSUE #18 (6184) ISSUE #30 (6186) 96 pages Drivers Keyboard Translation Kaypro EPROM Programmer PROLOG On The PC Greatest C Compilers More 4 MHz" Mods 1/0 Byte: A Primer Expert Systems ISSUE #41 (5/88) Turning A PC into An Embedded Modems, Lync, and S10s Kaypro Joystick Logic Programming Artnicialintelllgence Control System Undoing CPIM ERASE Serial To Parallel Interface Building Your Own LogiC 3-D Graphics Practical Fractals 20 pages Business COBOL Analyzer Neural Networks 96 pages 60 pages 256K RAM For Your 83 Kaypro Logic Of Programming ISSUE #5 (4/82) PC-DOS For Non-Clones Languages Issue #47 Two Text Editors ISSUE #19 (8/84) 104 pages Applying Information Theory Robotics Double Density Review Adding Winchester To BBII 96 pages The LIMBO Project 20 pages 6 MHz On The BBI ISSUE #31 (8/86) Starting A Robotics Company Bulletin Boards RAM Resident PC Speedup ISSUE # 42 (6188) How To Write and Use A System ISSUE #6 (6/82) Track Buffering On Slicer Practical Programming In Maintaining pes Profiler BBI EPROM Programmer 4 MHz For The 820-1 Modula-2 Keeping Your Hard Drives Problem Solving and Creativity Customize Your Chars 64 pages Unblinking The PC's Blinkin' Running Turn Your XT Into A Controller Double Density Update Cursor Troubleshooting PCs Writing Code For Two Operating 24 pages ISSUE #20 (10/84) Game Theory In PROLOG XT Theory of Operation Systems HSC 68000 Co-Processor and C Simulating A Bus 96 pages ISSUE #7 (8182) DynaDisk For The BBII 104 pages Ray Tracing 6 Reviews Of C Serial Printer On BBI Sans S 10 96 pages ••• Adding 6K Of RAM Cheap & Dirty Talker For Kaypro ISSUE #32 (10/86) On Your Own Begins Extended 8" Single Density Public Domain 32000: ISSUE #43 (9/87) 24 pages 72 pages Hardware And Software Building Databases Writing A Printer Driver for Build a C Database ISSUE #8 (10/82) ISSUE #21 (12/84) MS-DOS Selecting a dBase III SOLD OUT Analog To Digital Interface Recover A Directory By Compatible Compiler Installing Turbo Pascal Reading & Writing Disk Working with Paradox ISSUE #9 (12/82) Low Intensity BBI Video Sectors Designing Custom PC Cards BBII EPROM Program Turbo Pascal, The Early Days 96 pages Accessing dBase III Plus Relocating Your CP/M 80 pages 'Records from Turbo Pascal Serial Print Driver ISSUE #33 (12/86) 96 pages Big Board I Fixes ISSUE #22 (2/85) ISSUE #34 (2/87) 32 pages Xerox 820-11 To A Kaypro-8 ISSUE #35 (4/87) ISSUE#44 (11188) Sound Generator For the SOLD OUT Object-Oriented Programming ISSUE #10 (2/83) STD Bus A Taste of Smalltalk ISSUE #11 (4/83) Reviews Of 256K ISSUE #36 (6187) Actor SOLD OUT RAM Expansion Mouse Control Thinking Objectively 88 pages Build A Midi Interface Building MicroCad ISSUE #12 16/8.1\ Fer You!" PC Pcr:phcru~ Techiio:ogy·· Bringing Up 'BB II' ISSUE #23 (4/85) Designing A Database, Part 2 PT68K-2 Double Sided Drives for BBI Automatic Disk Relogging Interrupts On The PC Hercules Graphics Printer Packet Radio Interrupt Drive Serial Printer Digital To Analog Conversion, Dump S MHz for Kaypro Low Cost EPROM Eraser A Designer's View 96 pages 40 pages Smart Video Controller 96 pages Review: MicroSphere RAM Disk ISSUE #13 (8/83) 86 pages ISSUE #37 (9/87) CPIM Disk Directory Desktop Publishing On A PC More 256K for BBI ISSUE #24 (6185) Build Your Own Hi-Res Graphics Mini Front Panel C'ing Into Turbo Pascal Scanner For $6, Part 1 To Order: Cheap Fast Modem 8" Drives On The Kaypro Designing A Database, Part 3 BBI Printer Interface 68000 Versus 80x86 Controlling AC Power Phone: Kaypro Reverse Video Mod Soldering: The First Steps From Your PC 1-800-888-8087 44 pages 88 pages Expanded Memory On The Mail: PO Box 223 PCIXT/AT Bend,Oregon 97709 ISSUE #14 (10183) ISSUE #25 (8/85) Uninterruptable Power BBlllnstaliation Why I Wrote A Debugger Supply For RAM Disks The Perfect Terminal The 32-Bit Super Chips 96 pages United States, BBI Video Size Programming The 32032 Issues #1-34 $3.00 each ppd. Video Jitter Fix Modula II ISSUE #38 (11/87) Kaypro Color Graphics Review RS-232C: The Interface Parallel Processing Issues #35-current $3.95 each ppd. 48 pages 104 pages Laser Printers, Typesetters And Page Definition Canada, & Mexico ISSUE #15 (12183) ISSUE #26 (10/85) Languages Screen Dump Listing Inside ZCPR3 Build A Graphics Scanner All issues $5.00 each ppd. Fixing Serial Ports Two Megabytes On DSI-32 For $6, Part 2 Playing Adventure SOGIV Writing A Resident Program Foreign (air mail) Upgrading Kaypro II To 4 The Future Of Computing Extractor In C Upgrading Kaypro 4 To 8 Graphics In Turbo Pascal 96 pages All Issues $7.00 each ppd. 48 pages 104 pages A DVERTISE~? Imm~D~X Issue 48

Reader .....•....•.... Page 11 Halted Specialties .. Inside Front ** Opal Fire Software ...... 91 Service ...... Number 156 Heath Company ...... 70 03 PC Tech ...... Back Covcr 137 Abraxas ...... 74 149 Information Modes ...... 91 119 Peripheral ...... 73 72 Acquired Intelligence ...... 88 22 Integrand ...... 62 04 Austin Codeworks ...... 25 139 Quantum Software ...... 75 154 JRT Systems ...... 83 147 Berry Computer ...... 23 129 Research Group ...... 15 155 Business Computer Systems .. 91 126 Komputerwerk ...... 91 142 RJSwantek, Inc...... 43 136 Korc, Inc...... 91 Capital Software ...... 11 127 SemWare ...... 63 15 Cascade Electronics ...... 69 144 Lasergo ...... 30 150 Software Development . . . . . 72 31 CC Software ...... 75 153 Lattice ...... 5 106 Software Masters ...... 91 07 CompuView ...... 7 40 Star-KSoftwareSystems .... 44 143 Covox, Inc...... 93 151 Maxx Data Systems ...... 31 152 Stony Brook Software ...... 1 42 McTek Systems ...... 37 133 DATArx ...... 91 Micro Cornucopia ...... 57 101 United Products ...... 89 37 Unltd ..... 55 10 EmeraldMicroware ...... 41 02 MicroSphere .. Inside Back Cover 62 V Communications ...... 19 137 Eigenware ...... 91 135 Epoch Data ...... 91 National Braille Press ...... 46 124 Wenham Software ...... 91 93 Erac Company ...... 53 110 NuMega Technologies ...... 2

Genus Microprogramming . . . 33

>t>t Contact Advertiser Directly. When you write for information, please tell these folks you read about their products in Micro Cornucopia.

Now Available From Micro C

Computer Interfacing with Pascal & C by Bruce Eckel • Interfacing 16-bit Devices to the AT Bus • Use your PC parallel port for digital input and output • Capturing Video Images • Build an Adapter Card for your PC • Control a stepper motor • A Modem Operated Switch Design and build electronic circuits • Industrial Computers & Programmable Logic Controllers "With wit and superb technical figures, Bruce Introduction to Post Script captures the essence of • making electrons out of bits Order From: and vice versa." The Further Exploits of LIMBO Micro Cornucopia • Jeff Dunteman, Dr. Dobbs PO Box 223 Bend, OR 97709 1-800-888-8087 Only $30 ppd. Includes Book & Disk

MICRO CORNUCOPIA, #48, July-August, 1989 95 By Gary Entsminger 1912 Haussler Dr. Davis, CA 95616

A PCX Toolkit For Publishers & Programmers

the parts you don't want). You define a Howard (at Genus) also impressed me. If you think desktop publishing has box, and pcxCut scissors off everything At one point, while working on a solved the graphics file compatibility issues, outside the box. Cuts are identified by "page," I tried unsuccessfully to trans­ you should have been around here last issue the .PCC file extension (a .PCX file in late a "grabbed" text jmage into a .PCX (but, we hope, not this issue). disguise). You can do anything to a image which I could show on my .PCC file you can to a .PCX. portable CGA AT-Rabbit. pcxLoc lets you identify specific pixel Chris insisted that the toolbox like it when someone writes a pro­ coordinates (100,200, for example). worked perfectly with CGA. (After all, gram I can use right now. Genus Mi­ Some input devices need this displaying an image using the CGA is Icroprogramming, down in Houston, "enumerated" information. child's play compared to displaying im­ sent me a set of PCX tools I can use pcxLib lets you create and manipulate ages in the 11 extended VGA modes, up right now and with every issue. Thanks libraries of images. through 800x600x256, that the Toolbox guys. pcxGrab is a screen grabber with a supports.) For you joining late, Mark Zach­ clever twist-it grabs text and graphics "Sorry, Chris," I said, "but I'm get­ mann, founder and president of ZSoft, screens. In graphics mode, pcxGrab ting garbage." invented the compressed graphics file saves the image as a .PCX. In text mode, We duplicated our efforts; my CGA format, .PCX, in 1983. Now, most im­ it saves the image as an .SCR, and you produced garbage, his "emulation" portant desktop publishing programs take a second step. worked great. (Ventura, PageMaker, Word Perfect 5, You run the utility, pcxTrans, to "Emulation ?" etc.) and most good graphics programs translate the text to a .PCX image file. "I'm using multi-sync, and read and import some form of the .PCX You can then import this file into Ven­ hmmmm," he added, "that's the prob­ format. "Some form," since .PCX isn't tura, Word Perfect, etc., and manipulate lem. Your 'real' CGA adapter doesn't yet all that standard. Inventor Zach­ it as you would any .PCX image. load the IBM extended character set. My mann has changed it during revisions of CGA, EGA, VGA emulator does." his program, PC Paintbrush. (See the The Programmer's Toolkit "But wait a minute," I said. "I can PCX article in this issue.) Anyone can do everything I've men­ run a whole bunch of nifty graphics Two utilities in the Genus toolbox tioned so far by using the .EXE versions programs with my CGA, and no prob­ help clear up the nonstandard mess. of the utilities. But programmers can do lems (well, only a few). What about a lot more. Borland's BGI? It works great." The Publisher's Toolkit The utilities come in two forms: ex­ "The BGI creates its own extended pcxHdr displays the .PCX header in­ ecutable files, and object libraries. So C, character set," he responded. "So do formation-tlle original display' resolu­ Pascal, BASIC, Assembly Language, many other packages. We don't. tion of an image, its width, depth, Fortran, and Clipper programmers can "We decided to use the character set palette, version number, encoding call any toolbox function from their that's there (in EGA, VGA, and emula­ mode, and more. If an image isn't own programs. Functions are available tor ROM); the 'real' CGA doesn't have making sense, the pcxHdr display for saving, creating, and manipulating it. You have to create your own or load might tell you why. images, displays, libraries, etc. it (with DOS)." pcxFix goes a step farther; it fixes im­ Each package includes all the librar­ So I ran GRAFT ABL (Load Graphics ages in the latest .PCX format it knows. ies, along with several programming ex­ Table), included on the DOS disk, and Specifically, pcxFix makes the latest ver­ amples to get you going. It took me at 10 and behold, a perfect image. sion (whichever one that is) of PC Paint­ most a couple of minutes to write a C Case closed. If you're in the publish­ brush the standard. The toolkit utilities program which displayed an image. ing or programming biz, consider this expect to see the latest format, so they And no royalties, as long as you do package. recognize "the fix standard." something new with the toolbox (i.e., pcxShow displays an image or a don't just repackage and sell it). PCX Toolkit group of images. The manual is well-written, clear, Genus Microprogramming pcxPrint prints an image (but only and includes many useful discussions 11315 Meadow Lake supports two devices: HP LaserJets and about adapters, images, and the pro­ Houston, TX 77077 compatibles, and IBM or Epson dot­ gramming details of the PCX format. (800) 227-0918 matrix and compatibles). The help (and detailed information) I $199 (ASM source extra) pcxCut lets you cut an image (or trim received from programmer Chris • • •

96 MICRO CORNUCOPIA, #48, July-August 1989 Quality &Price You Can't Pass Up! ~" COMPLETE 80386-20DX 1~~.l;V SYSTEM with Rotary Voice Coil Hard Drive , This machine features an R03R6 CPl1 running at a20 Mhz on a full size DTKmotherboard. Forextra quality and reliability we've included a 45 Mb Miniscribe 305.1 Hard Dri\'e with a 25 ms access time. 1.2Mb & 1.44Mb Toshiba or TEAC floppy drives. 2 RMb 32 bit memory slots. 1Mb of fully optimized ROns RAM (Runs an incredible Norton Display Color Graphics SI test of 241). 2 serial ports. 1 parallel port. 101 on a monochrome monitor! key keyboard. Graphics Combo video card with All Microsphere XT, AT ~\ amber or green monochrome monitor. DTK Bios. & 386 systems NOW include ~ socket for an 803R7-20 math coprocessor. 200 the GRAPHICS COMBO watt power supply. clock/calendar. and housed multimode video card. in a sophisticated tower case. Full 1year warranty. Ask for FREE assembly and testing .. The Graphics Combo combines the video functions and software (TowerCose) compatibility of the IBM Mono­ NoW! $Z39S~ chrome Display Adapter (MGA). $2295 (Std. Case) the Hercules Graphics Card. and Other configurations: .... $Call the IBM Color/Graphics Adapter DTK R MB RAM Crd ...... 99 (CGA) all on a single card. In ad­ (32 BIT. ~K) dition the CGA graphics are auto­ DISK DRIVES (Continued) matically converted to display on AT 40 MB MiniScribe a standard TIt monochrome 3650 (61 ms) ••••...••.••••. 339 AT 40 MB MiniScribe monitor in 16 shades of gray. 3053 (25ms) ...... •... 489 AT 71 MB MiniScribe SPECIAL OFFER! 6085 (28ms) ...•..•..•.•... 631 AT (MFM) HD & FD Order a Complete Controller card DTK ••••••.. 110 MicroSphere Computer PCXT&AT Clock •••.•.•••..••..••..••.. 19 WD .•.•••••• 127 System and receive 7 FREE Game ••••.•..•.•...••••.•••. 14 MOTHERBOARDS AT RLL HD & FD disks of our best public Parallel (LPT 1,2 or 3) ••••..•.. 18 XTlTurbo 4.77/10 ••••••••••••• 75 Controller ...... ••.. 189 domain games. Serial Port Card - 1 installed AT 6/10 Award/Phoenix! Switchable Com 1, 2, 3 or 4 .... 18 DTK Bios •••••.•••••.••••• 229 MONITORS/ CARDS Kit for 2nd Serial Port .••••••.•. 18 AT 6/12 Award/Phoenix! EGA/CGA XT SYSTEM Multi I/O DTK Bios •.••••••••••••.•• 279 (Autoswitch .31 dot) ••.••••• 385 Includes: 640K RAM, serial/parallel/ Serial/Par/Game ...•.•••.••• 32 Baby AT 6/12 AMI/DTK ••.•••• 249 CGA/EGA/VGA game ports, clock/calendar, 101 key 2nd Serial Kit •••••••..•.•••• 20 AT 8/16 DTK Bios •••••••••••• 395 MultiSync (.31 dot) •••••.••• 495 keyboard, turbo switchable. slide cabi­ Multi Drive Controller .••..•.•.. 39 80386 8/20 DTK Bios •••.•.•••• 799 CGA Color ••••••••••••••••• 249 net, power supply, Graphics Combo Supports 1.44, 720K, 1.2, 360K drives XT / AT Memory •••••••••.• $CALL Amber/Green 12" TTL ••••••••• 89 video card with amber or green mon­ Graphics Combo •••••.•••••••• 79 itor. Full 1 year warranty. Ask for PC/XT SOFIWARE VGA Analog FREE assembly and testing. Floppy Controller •.•••.•••.••. 19 MS DOS 3.21 w/GW Basic ...... 49 (Mitsubishi .28 dot) •••••..•• 549 4.77/10 Mhz with 2 Multi-function-1 ser/par/ DR DOS 3.3 w/GEM .••.••••... 49 Color/Graphics/Par Card ••••••• 49 360K floppies •••••••••••••• 725 clk/game/2 floppy ••.....••.• 47 MS DOS 3.3 w/GW Basic ..•••.. 95 1 FD and 1 Miniscribe HD: Mono/Graphics/Par Card ••••••• 49 640K RAM (0K) .•.•..•••••.••. 25 CGA/EGA Card •••••••••••••• 175 4.77/10 Mhz with 20 Mb HD •••• 949 150 Watt Power Supply ....•.... 50 DISK DRIVES VGA Analog/Digital Card •..••• 249 4.77/10 Mhz with 30 Mb HD •••• 975 Slide case lock, LED ...•..•.... 38 Teac/Toshiba 360K ••..•...... 69 2 MB EMS Memory Board TeaclToshiba 1.2 MB ....••..... 85 AT SYSTEM flK Installed •.•••.••...•.... 49 KEYBOARDS Includes: 640K RAM, 1.2 Mb FD, TeaclToshiba 3W' 720K •...... 79 Casper Enhanced 101 •••.•••... 54 1.44Mb FD, 40 Mb Miniscribe 3650 AT TeaclToshiba 3W' 1.44 MB kit •.•• 90 Keytronic KB101 .••••.•••••..• 67 HD, serial/parallel/game ports, clock/ XT 20 MB Miniscribe Focus 101 Tactile, 200 Watt Power Supply ••••••.•• 75 8425 (65ms) ....•...••..... 279 calendar, 101 key keyboard, turbo AT/386 Case, Lock, LED. " •••.• 72 Switchable, Control Caps LOCk, 8425 w/controller .....••.... 319 switch able, slide cabinet, power sup­ Tower AT/386 Case, Lock, Dust Cover •••..••••.•...... 89 ply, Graphics Combo video card with LED & 200 Watt ps •..••••••• 239 XT 30 MB Miniscribe (#1 find by MicroC Staff) amber or green monitor. Full 1 year 2 MB EMS Memory Board 8438 (65ms) ...••.•...... 299 * All keyboards, XT/AT switchable * warranty. Ask for FREE assembly and flK Installed ••••••.•••.•••.. 99 8438 w/controller .....•...•. 349 testing. Prices are subject to change without notice. 6/10 Mhz •.••••••.•••..••.. 1359 Shipping CHARGES will be added. 6/12 Mhz ••••.••••.•••••.•. 1395 BUILDING YOUR OWN CWNE V2.1 Color options for any kit (includes ··"'FREE BOOKLET*·*· video card and monitor) -gO-day warranty / ~O·day money hack CGA Color ••••..••...•••... 175 fMl~[f1~f?l:!~~~§~ER (suhject to restrictions) CGA/EGA Color ..••••..••... 380 VGA (analog) with Mitsubishl monitor .••.••.... 650 1-800-234-8086 Tech Calls: (503) 388-1194 CGA/EGA/EGA 480 (Multisync) ••....•...... 450 855 N.W. WALL • BEND, OREGON 97701 Hours: Monday-Friday 9:00-5:30

Reader Service Number 02 ,VERY HIGH PERFORMANCE Processers, Memory, and Display Adapters The X24 High performance processor • 12 or 16 MHz 80286 with NO WAIT STATES! • Small size ("XT" height and length) passive bus design • 1 to 4 Mbyte 0 wait state dynamic memory • Fully "AT" compatible Award BIOS • Runs DOS versions 2.2 and later, Xenix and OS/2

Th e X24 combines the best of motherboard and backplane designs in a 100% AT compatible system. Incor­ porating a t 6 MHz 80286, the )<'.24 processor is designed to operate with the PC Tech Advanced System Mother­ board, which contains the peripheral interfaces (hard disk, floppy disk, two serial ports and a parallel port). The X24 processor can also be used wHh other totally passive bus backplanes. Most critical components including the microprocessor and up to -9 megabytes of fast memory are contained on a single PC size plug-in card. This allows the processor and main system memory to be selViced or upgraded without disturbing other peripherals such as serial ports and dis k drives PC Tech X24 and ASMB The PC Tech Advanced System Motherboard • Built in "IDE" interface for AT interface type hard drives • Fully AT compatible floppy disk support for 3.5",5.25" drives, capacities of 360k, 1.2m and 1.44m • Two serial ports and one parallel port • 8 total expansion slots PC/XT/AT compatible (4 slots have 32 bit bus) The PC Tech Advanced System Motherboard is designed to complement PC Tech's X24 and )(32 high performance processor cards. It wntains the mass storage interfaces necessary for a complete sys­ tem, plus the basic I/O required in most systems. Extra care has been given to FCC compliance by design.

34010 Monochrome Graphics Adapter II • Up to 384k bytes display memory • Up to 2 Megabytes program memory • Software is RAM based, allowing complete operating software replacement and timing re-programming from the host bus • 34010 program loader included. Assembler, debugger, and C compiler available. • Full hardware and software CGA, MDA and Hercules em ul a­ tion PC Tech Mono-II • Single bit shared memory bit-map With optional resolulion up to 2048 x 1536 (736 x 1008 standard) ~ • . Very high resolution COLOR version a\l~ ilable • Custom 34010 software development available The TMS34010 is a true general purpose graphics processor. PC Tech makes the total processing power of the 34010 available to both programmers and end users. Our 34010 Monochrome Graphics Adapter is designed to allow programming from the PCro/AT host bus. You can completely replace our 34010 software with yours to directly harness the incredible image processing power of the TMS 34010 for your application. We malke a complete set of development tools available, including an assembler, C compiler, program loader, 34010 debugger, and PC interface tracer/debugger. Our stand· ard product include~ support for extended CGA, MDA and Hercules emufation as well as a host addressable graphics bit- map. We also support and recommend the DGIS graphics interface standard (from Graphic Software Systems) for applications development as an alternative to native 34010 software development. Ready to run drivers are available for most major applications software packages as well.

Custom Designs Available PC Tech will license most products for non-exclusive manufacture. We will also cus­ tomize any of our designs to better meet your needs on our in-house CAD systems. All of our standard products are available in private label versions. About PC Tech PC Tech has been designing, manufacturing and marketing high performance PC re­ lated products for over three years. Our standard product line includes processor, memory, and video products, All products are designed, manufactured and sup­ ported in our Lake City, Minnesota facilities. Designed, Sold and Serviced By:

High resolution fractal produced on the PC Tech COLOR 34010 907 N. 6th St., Lake City, MN 55041 (612) 345·4555 • (612) 345·5514 (FAX) Reader Service Number 3 pc, XT, AT, DGIS, Hercules, and Award BIOS are trademar1