No.44 November-December 1988 $3.95 T H E M 0 T EC H N C A L J 0 U R N A L

Object-Oriented Programming

Objects are the latest buzz word. For a long there was only , now there's a whole troup of players including Actor, Objective C and C++. So we start out this issue with a four-piece trilogy on objects: complete with theory, examples, and projects. (Space is no object.)

A Taste of Smalltalk page 8

An intense look at messages, objects, classes, late binding, and all the other fancy terms that have grown up around this fascinating field. Actor, an Object-Oriented Language Thinking Objectively Building MicroCad A Special Project The Peripheral Technology-PT68K-2 page 42

An inexpensive, build-it-yourself, 68000 system. A great way to learn both hardware and software from the ground up. Plus: Hercules Graphics Printer Dump 38 Sharing At SOG 46 And Much, tv-1 uch,

1 0

0 74470 19388 3 #1 PROGRAMMABLE EDITOR NEW VERSION 3.0 • Best Multi-Level Undo • Regular Expressions • Pop-Up ASCII Table • Pull-Down Menus • Support • Column Blocks Until now, if you wanted the best Undo, the best compiler sup­ port, regular expressions and column blocks you chose ™. If you wanted unlimited keystroke macros, the best FREE EVALUATION * configurability, "off the cuff" command language macros and blazing speed, you chose VEDIT PLUS.® Call 1 ·800-45-VEDIT Now the Choice is Easy The all new VEDIT PLUS 3.0 gives you the best Undo of any editor, the best compiler support, unequaled windows, true • Fully Network Compatible regular expressions and extensive new features. We're lead­ • Call for and OS/2 versions ing the way with easy to use pull down menus, context sensitive • 30 Day Money-back guarantee help, a pop-up ASCII table, new printing options and much more. Incredibly, VEDIT PLUS 3.0 is now twice as fast as be­ fore and, at only 60K in size, it loads fast! Features of VEDIT PLUS 3.0 • Simultaneously edit up to 37 files of unlimited size. Completely Configurable • Variable sized windows; multiple windows per file. Change a few keys or redefine the entire keyboard, VEDIT • Execute DOS commands and other programs. PLUS adjusts to your editing style in minutes. You can even • Flexible "cut and paste" with 36 "scratch-pad" buffers. create new editing functions using simple keystroke macros or • Block operations by line, character or column. fine tune existing ones. VEDIT PLUS is so configurable that it • Search with pattern matching or regular expressions. • Configuration-determine your own keyboard layout, create easily emulates other editors and word processors (WordStar your own editing functions, support any screen size. and Word Perfect emulation included). Quickly access editing • Select window colors, support 43 line EGA, 50 line VGA. functions with a single key or through the pull-down menus. EASY TO USE Try before You Buy • Modern pull-down menu system. Pop-up ASCII table. • Context sensitive on-line help is user changeable. We challenge you to experience the dazzling performance and • Multi-level Undo (100 to 1000 levels). Undo keystroke by exceptional features that make VEDIT PLUS the best choice. keystroke or line by line. Our evaluation disk includes the complete editor.* Learn • On-line integer calculator (also algebraic expressions). VEDIT PLUS using our extensive "training" macro that gives • Keystroke macros speed editing, menu function "hot keys." instructions in one window while you experiment in another. FOR See for yourself why no other macro language comes close. • Automatic lndent/Undent for "C," PL/I, PASCAL. Call for your free evaluation copy today. See why VEDIT PLUS • Match/check nested parentheses, e.g. "I" and" I" for "C." has been the #1 choice of programmers, writers and engineers • Flexible macro runs popular and automatically since 1980. moves cursor to each error in your program. Easily changed to support new compilers and assemblers. Supports the IBM PC, XT, AT and PS/2 including DESQview, FOR WRITERS , PC-MOS/386, Concurrent DOS and most • Word wrap, paragraph formatting and justification. networks. Also available for MS-DOS, CP/M-86 and FlexOS. • Convert to/from Wordstar and mainframe files. (Yes! We support windows on CRT terminals.) $185. • Flexible printing; fully adjustable margins and Tab stops. MACRO VEDIT and CompuView are registered trademarks of CompuView Products, Inc. BRIEF is a • If-then-else, looping, testing, string compare, branching, trademark of UnderWare, Inc. PC-MOS/386 is a trademark of The Software Link, Inc. CP/M-86 user prompts, keyboard input, 24 bit algebraic expressions. and FlexOS are trademarks of . MS-DOS, OS/2 and XENIX are trademarks of • Flexible windowing-forms entry, select size, color, etc. Microsoft. DESQview is a trademark of Quarterdeck Office Systems. • Simplifies complex text processing, formatting, conversions. •Also available for Tl Professional, Tandy 2000, DEC Rainbow, WYSE 700, Amdek 1280 • Extensive 400 page manual with hundreds of examples. and Others. *Free evaluation disk is fully functional and can even edit small files. Reader Service Number 7

1955 Pauline Blvd., Ann Arbor, Ml 48103 (313)996-1299 • Telex701821 • Fax(313)996-1308 CompuView CASES& KEYBOARDS POWER SUPPLY 5339 Professional XT-AT 150 Watt Power Supply (XT) ...... 50.00 w I 12 function key ...... 69.00 200 Watt Power Supply (AT) ...... 80.00 5060 Keyboard AT Style ...... 49.00 XT Slide Case ...... 34.00 KB 101 Keytronic ...... 6 7 .00 XT Slide with Lock & LED ...... 38.00 Focus 101 Key, Tactile, Switchable, STD AT or 80386 control caps lock, Dust cover . . . . . 89.00 w /Lock & LED...... 65.00 -Chosen #1 hy Micro C Staff- Tower AT or 80386 w /Lock, LED 101 Key Click Style ...... 59.00 and Power Supply ...... 239.00 -All keyboards switchable to XT or AT- MONITORS HARD DRIVES EGA/CGA (Auto Switch, .31 dot) .... 395.00 & CONTROLLERS VGA/EGA/CGA Multi Sync c.31) ... 495.00 AT 40 MB Miniscribe 3650 (61 msJ ... 375.00 CGA Color ...... 249.00 AT 40 MB Miniscribe 3053 (ZS ms) ...489.00 Amber 12" TTL ...... 89.00 AT 71 MB Miniscribe 6085 c2s ms> ... 695.00 Green 12"' TTL...... 89.00 AT (MFM) Hard Drive & VGA Analog (Mitsubishi .28 dot) ..... 495.00 - Tower Case Pictured - floppy controller (WD) ...... 130.00 VIDEO CARDS KIT OPTIONS AT RLL HD & FD controller ...... 189.00 Color /Graphics/Parallel ...... 52.00 MS DOS 3.21 w/GW Basic ...... 49.00 XT20 MB Miniscribe 8425 (65 msl .... 2 79.00 Mono/Graphics/Parallel...... 49.00 MS DOS 3.31 w /GW Basic ...... 95.00 with controller ...... 340.00 *5339 Keyboard Sub ...... 24.00 XT30 MB Miniscribe 8438 (65 ms> .... 299.00 EGA, CGA, VGA (640x480) ...... 129.00 *Color Options: VGA Analog, STB Extra ...... 239.00 (Includes video card & monitor) with controller ...... 355.00 CGA Color ...... 200.00 EXPANSION CARDS CGA/EGA Color ...... 380.00 SOFTWARE Clock Card ...... 22.00 CGA/EGANGA Color ...... 450.00 MS DOS 3.21 w/GW Basic ...... 49.00 Dual Controller ...... 25.00 ASSEMBLY AND TESTING Flight Simulator 3.0...... 39.95 Game Port ...... 19.00 XT Systems...... 60.00 AT/80386 Systems ...... 80.00 ACCESSORIES XT Multi-Function, 1 ser/par/clk/ Generic Analog Joystick...... 25.00 game/2 floppy ...... 61.00 XT KIT WI 2 Floppy Drives. Gravis Analog Joystick ...... 49.95 Parallel (Supports LPT 1, 2 or3) ...... 18.00 Includes: 6401< RAM, Serial, parallel and game V20-8mhz ...... 14.00 Dual Serial Port Card - 1 installed ports, clock/calendar, AT-Style keyboard, cabinet, 1200 Baud Internal ...... 79.00 switchable Com 1, 2, 3, or 4 ..... ; 22.00 power supply, mono graphics card and amber or green monitor. Keyboard switchable turbo. 2400 Baud Internal ...... 119.00 Kit for 2nd Port ...... 20.00 EPROM ( 4 gang) ...... 175.00 XT 640K RAM (0K installed)...... 35.00 8 mhz with lock, LED, Reset & Turboswitch ...... 825.00 Memory Chips ...... (call for prices) XT 2 MB EMS (0K installed) ... 99.00 MICE XT I AT Multi l/O lOmhz with lock, LED, Reset & Turboswitch...... 895.00 Logitech 2 Button (serial)...... 59.00 Serial/Par /Game ...... 41.00 Logitech 3 Button (serial or bus)... . 89.00 Kit for Second Serial...... , . .. 30.00 XT KIT W /20MB Hard Drive. Logitech HiRez (bus) ...... 109.00 AT 2 MB Intel EMS (0K installed) ... 139.00 With mouse purchase only - DTK 4 MB 32 bit memory card lncludes: 6401< RAM, Serial, parallel and game ports, clock/calendar, AT-Style keyboard, cabinet, First Publisher ...... 50.00 w/o RAM ...... 139.00 power supply, mono graphics card and amber or Generic CAD 3.0 ...... 50.00 XT I AT Multi Drive Controller - green monitor. Keyboard switchable turbo. Paintshow ...... 15.00 Supports 1.44, 720K, 1.2, 360K 8 mhz with lock, LED, Reset drives on XT or AT ...... 54.00 & Turboswitch ...... 1095.00* Prices are subject to change without notice. lOmhz with lock, LED, Reset Shipping CHARGES will be~ MOTHERBOARDS & Turboswitch ...... 1165.00* XT/Turbo 4.77 /8 mhz ...... 89.00 *(For 30MB Miniscribe add $15.00) XT/Turbo 4.77 /lOmhz ...... 99.00 BUILDING YOUR AT 6/10 mhz Choice of Award, OWN CLONE V2.1 80386KIT- ****FREE BOOKLET**** Phoenix or DTK Bios ...... 2 79.00 Includes: lMB RAM, 1360K floppy drive, 1-1.2 *90-day warranty /30-day money back AT 6/12 mhz Choice of Award, MB FD, 1 40MB HD, DTK bios, switchable (subject to restrictions) Phoenix or DTK Bios ...... 340.00 keyboard, monochrome monitor, monographics. Serial/parallel ports, case, power supply, game Baby AT 6/12 mhz AMI Bios ...... 299.00 port, cloclc/calendar. Main board made in U.S.A. Free Instructions with Each System 80286 6116 mhz DTK Bios ...... $Call 8/16 mhz ...... 2795.00 80386 8/16 mhz/DTK Bios ...... 1195.00 8120 mhz ...... 2995.00 80386 8120 mhz/DTK Bios ...... 1395.00 For XT I AT memory ...... $Call 80286 - AT KIT efilMicro!idv;reNC FLOPPY DISK DRIVES Includes: 6401< RAM, 1.2 MB FD, 1 360K floppy -3jCOMPUTERSr· ·-· drive and 40 MB Miniscribe 3650 HD, 6/lOmhz, Toshiba 360K ...... 89.00 1221 serial, parallel and game ports, clock/ calendar, P.O. Box Toshiba 1.2 MB ...... 110.00 AT-style keyboard, cabinet, power supply, mono­ Bend, Oregon 97709 Toshiba 3llz" Drive Kit 720K ...... 110.00 graphics card, amber or green monitor, keyboard (503) 388-1194 ES Toshiba 3llz" Drive 1.44mb ...... 145.00 switchable turbo. Hours: Monday-Friday 4-0 MB HD (MFM) ...... 1525.00 9:00-5:30 60 MB HD (RLL) ...... 1595.00

Reader Service Number 2 MICROCORNUCOPIA, #44, Nov-Dec, 1988 1 All the speed and power of a RUN CODEVIEW hardware-assisted debugger IN~~LYSK! at a software price -1~~~--..

Code View is a great integrated debugger, but it uses over 200K of . Hardware-level break points MagicCV uses advanced features of the 80386 to load Code View and symbols in REAL~ TIME break points on memory locations, memory ranges, execution, I/0 ports, hardware and software interrupts. More . This allows MagicCV to run powerful break points than ANY software-only debugger on the CodeView 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 Code View, 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 lMB 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 TS Rs 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 Code View. MagicCV uses real-time break points. When a break point is reached, your between 4K & 8K of conventional memory as a debugger will be activated. bridge between the DOS environment and Code View. Solve tough systems problems too Soft-ICE is ideal for debugging TSRs, interrupt 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 operating systems, and debugging within DOS & BIOS. Soft-ICE to use MagicCV too. Just MCV instead of is also great for firmware development because Soft-ICE's break CV; everything else is automatic. points work in ROM. 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 $86! with Soft-ICE . Soft-ICE uses 80386 CALL TODAY Using Soft-ICE with Code­ protected mode features, such as paging, I/0 (603) 888 - 2386 View gives you the features privilege level, and break point registers, to necessary for professional or FAX (603) 888 - 2465 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 "Sott-\CE is a product any MS-DOS work in concert with Code­ developer serious enough to own a 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.

2 MICRO CORNUCOPIA, #44, Nov-Dec 1988 T H E M I CR 0 TECHNICAL J 0 U R N A L M_ICRO CORNUCOPIA

NOVEMBER/DECEMBER 1988 - ISSUE NO. 44 FEATURES COLUMNS

Jan Steinman and Barbara Yates C'ing Clearly 8 A Taste of Smalltalk Scott was going to take a first pass at ' s C Smalltalk is the grandaddy of the ebugger. There's no C debugger. So, Scott's updating his object oriented languages and this is C list and talking about SOC. a very in-depth look at this very innovative language. 54 86 World Zack Urlocker Laine's disk again showed up at the last possible moment, 18 Actor, An Object-Oriented Language complete with camel prints. But our boy is OK, asleep on Actor is the new language on this block. It gives you a a Turkish bus bound for somewhere. Smalltalk style environment but it runs under windows so even windows become simple objects. Zack shows you how to build a project manager. 62 Shareware

Doug Gaffin and Arthur Gaffin 26 Thinking Objectively 65 Culture Comer OK you science fiction freaks, here's your article. (The rest of you aren't going to believe it.) Doug and Arthur figured it was too much trouble to turn a computer into an expert 66 On Your Own so they just taught it how to learn all by itself using objects. (Surprise.) 76 Units and Measures Bruce Eckel 32 Building MicroCAD Bruce takes on C++ with a vengence. Here he uses objects 90 Tech Tips to build a tiny CAD program. Another great Eckel project.

Larry Fogg 38 Hercules Graphics Printer Dump CP/M CORNER Larry thought this cinchy little project, dumping graphics from screen to printer, would take an afternoon. He was right. (If you don't count the two weeks he spent making it 80 CP/M Notes work.)

Jack W. Crenshaw, Ph.. 84 42 The Peripheral Technology, PT68K-2 Looking for yet another PC? How about one with the heart of a 68000 and the soul of a hacker? This inexpensive kit is a great excuse to warm up the soldering iron and fire up the assembler. 86 Tidbits Barbara M. Hall 46 Sharing at SOG When I saw this in Oregon 96 Last Page Computer News I knew I had to reprint it. Barbara really catches Cover illustration by Rob Sanford the flavor of SOC.

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 3 By David J. Thompson

THE MICRO TECHNICAL JOURNAL MICRO CORNUCOPIA

Editor and Publisher David J. Thompson Associate Editors AROUND Gary Entsminger Cary Gatton THE BEND Technical Department Larry Fogg

Director of Advertising & Distribution Sunday 5 a.m., Newburg Jackie Ringsage I awoke with a start - the tent around me and the Accounting earth beneath me were shaking. The roar of a giant pis­ Sandy Thompson ton engine was overwhelming and getting louder. Just as I was certain I would be hacked to shreds, the noise Order Department dropped in pitch and receded rapidly. The tent and I Tammy Westfall were left shaking. Wide awake, I unzipped the door and tentatively Graphic Design peeked through. It was a cool, grey pre-dawn with Carol Steffy clouds draped heavily over the tops of the wooded hills. I could see the spray plane disappearing through a MICRO CORNUCOPIA (ISSN 0747-587X) is divide in the trees, wings almost brushing branches, its published bi-monthly for $18 per year by Micro Cornucopia, Inc. 155 NW Hawthorne, Bend, OR unmuffled 450 horses still echoing. 97701. Second-class postage paid at Bend, OR and Finally: it's quiet. additional mailing offices. POSTMASTER: Send There are a few quiet coughs from other tents, I'm address changes to MICRO CORNUCOPIA, PO Box 223, Bend, OR 97709. not the only one awake. Ah, the life of a flying vagabond. SUBSCRIPTION RA TES: This is it, antique airplanes driven by (mostly) an­ 1 yr. (6 issues) $18.00 tique pilots. We' re sleeping under our wings as we 2 yr. (12 issues) $34.00 barnstorm Oregon, stopping at everything from infor­ 3 yr. (18 issues) $48.00 1 yr. Canada & Mexico $26.00 mal grass strips to county airparks. (The county air­ 1 yr. Other foreign (surface) $36.00 parks feature such luxuries as paved runways and 1 yr. Foreign (airmail) $50.00 chemical johns.) Yesterday, the first day of the week-long flyaround, I Make all orders payable in U.S. funds on a U.S. bank, please. was part of a formation flying at 1,000 feet, watching cars, watching people, carefully watching the three CHANGE OF ADDRESS: Please send your old label and new address.

MICRO CORNUCOPIA P.O. Box 223 Bend, Oregon 97709

CUSTOMER SERVICE: For orders and subscription problems call (503) 382-8048, 9 a.m. to 5 p.m., Pacific time, Monday-Friday.

TECHNICAL HELP: call (503) 382-8048, 9 a.m. to noon Pacific time, Monday-Friday.

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

Copyright 1988 by Micro Cornucopia, Inc. All rights reserved Stinson & tent at Newburg, tour's first overnight stop. ISSN 0747-587X Continued on page 69

4 MICRO CORNUCOPIA, #44, Nov-Dec 1988 New Thrsion 2.2 Comp_atible with DOS 4.0 Uses less memor:y, _ runs f~ter,. and adds You commumcatwns support deliver it fore It's coming. An era of more powerful PCs. Easier blisher, or designing a building in AutoCAD. to use PCs. With graphics and character-based DFSQview even allows them to transfer text, programs working side by side. Talking to each numbers, and fields of infonnation between other. Multitasking. Wmdowing. Menuing. programs. Mousing. Letting your customers get their work l9911~ Fulfill the 386 promise. done easier and faster. For 80836 PC users, DFSQview Sell it all now. becomes a 386 control program when DFSQview™ is the operating envi­ used in conjunction with Quarterdeck's ronment that gives D03 the capabil­ Expanded Memory Manager (QEMM)-386--giving faster ities of 03/2~M And it lets your virtual customers, with their trusty 8008, 8006, multitasking as well as 80286, or 80386 PCs, leap to the windowing support. And when you use DFSQview on productivity of the next generation. an IBM PS /2™ Model 50 or 60 with For not much money. And without QEMM-50/ 60 and the IBM Memory throwing out their favorite software. Expansion Option, DFSQview gives Add DFSQview to your multitasking beyond 640K customers' PCs and it quickly finds their programs and lists them on Experts are voting for menus. So they can just point to the DESQview. And over a program, using keyboard or mouse, million users, too. to start it up. DFSQview knows where If all of this sounds like promises that program lives. And what command Multitasking beyond 640K. you've been hearing for future systems, then loads it. When your customers want to use you can why so many VARs and For those who For programmers, DESQview' s API, with its strengths in inter­ several programs together, they don't have system integrators have chosen DFSQview. have trouble I w task communications and multi­ to leave their current program. Just open I • And why PC Magazine gave I i I i I tasking, brings a quick and easy I I 'I L....I' remembering D03 the next program. View programs in I DFSQview its Editor's Choice way to adapt to the future. With I . ' r-1 commands, it adds I ! I the API' s mailboxes and shared windows or full screen. Open more ! --•' Award for ''The Best Alternative to menus to IX13. It programs, programmers are programs than they have memory for. 1~!~!ffitm1~- 03/2," why readers of Info World even lets them sort able to design programs running EDITOR'S on IX)5 with capabilities like And multitask them. In 640K Or if they CHOICE twice voted DFSQview ''Product of files and mark thoseof OS/2 own a special EMS 4.0 or EEMS memory NO't ». 1987 the Year" why, by popular vote specific files to be board, or a 386 PC, DFSQview lets them ~Eg 1986 at Comdex Fall for two years AND 1987 • D'CC().,; copied, backed-up, or deleted- all without break through the D03 640K barrier and PRODUCT ma row, ~vJ.ewwas having to leave the program they're in. multitask. For instance, they can start 1-2-3 o F T H E voted ''Best PC Environment'' Best of all, DFSQview accomplishes all calculating and tell Paradox to mailing Y E A R in PC Tech Journal's Systems this with a substantial speed advantage over labels while they' re writing a report in Word Builder Contest. any alternative environment. Perfect, or laying out a newsletter in Ventura DFSQview lets you sell it all now.

DF.SQVIEW SYSTEM REQUIREMEN1S: IBM and 100% compatibles (with 8086, 8088, 80286, or 80386 processors) with monochrome or color display; IBM Personal System/2• Memory: 640K recommended; for DF.SQview itself 0-145K • Expanded Memory (Optional): expanded memory boards compatible with the Intel AboveBoan:i; enhanced expanded memory boards compatible with the AST RAMpage; EMS 4.0 expanded memory boards• Disk: two diskette drives or one diskette drive and a hard disk•Graphics Card (Optional): Hercules, IBM Color /Graphics (CGA). IBM Enhanced Graphics (EGA), IBM Personal System/2 Advanced Graphics (VGA)• Mouse (Optional): Mouse Systems, Microsoft and compatibles• Modem for Auto-Dialer (Optional): Hayes or compatible• : PC-IX)S 2.0-4.0; MS-IX)S 2.0-4.0• Software: Most PC-IX)S and MS-IX)S application __ Trademarks are property of their respective holders: programs; programs specific to Microsoft Wmdows IBM, 05/2, PS/2, 1-2-3, Paradox, Word Perfect, Ventura Publisher, AutoCAD, Intel, Above Board, 1.03-2.1, GEM 1.1-3.0, IBM Top View 1.1 •Media: AST, RAMpage, Advantage, Hercules, Mouse DF.SQview 2.0 is available on either 5-1I4" or 3-1 /2" 150 Pico Blvd., Santa Monica, CA 90405 Systems, Hayes, Microsoft, Wmdows, TopView. floppy diskette. (213) 392-9851 Fax: (213) 399-3802 Reader Service Number 109 MICROCORNUCOPIA, #44, Nov-Dec, 1988 5 Letters

SOGThanks leyball game. We all played but the One last suggestion: since over half Although this is rather late for a majority of the staff didn't. An SRO hall of the topics had standing room only thank you letter, I want you to know was waiting for the missing speaker even before the lecture began, maybe that as a computer nerd, idiot, tag-a­ from Intel. Missing was the extra rank having three speakers at the same time long, or whatever appropriate noun of vendor tables in the large hall. Sorely might help. I understand that there real­ would apply, I really enjoyed SOG VII. absent were the two plus hours Allyn ly aren't any larger facilities available, First there was the beautiful drive up Franklin needs and deserves for his so dividing the listeners up a bit more from Southern California, including drive discussion. might give some more room. (Of course Burney Falls, Mt. Shasta, and Crater Another area of shortfall was the the down side is that the speakers love Lake. Then, the happy surprise of dis­ dearth of simple, beginner-oriented to see a packed room.) covering the beauties of Bend. And topics. If it were my first ever SOG, I Thanks to all of the staffers and crew finally, gaining an appreciation for the might think twice about returning, since that put on the SOG. You all did just wonderful job your crew did in organiz­ the topics were of such an expert level. fantastic. I'll be back for the next one. ing that remarkable get-together. One last "missing" was the absent The Central Oregon Community Col­ moderator for the software forum. It Al (Spike the Ball) Szymanski lege provided a beautiful setting for the really needed a non-speaker to keep the 8991 Edcliff Ct. SE sessions (even to including an exhibit to show and the flow going. Aumsville, OR 97325-9549 grace the art gallery). I was over­ On the plus side, the Bar-B-Q and the whelmed by Debee's demonstration - lunches were pulled off exceptionally Editor's note: Comments noted. The staff surely her story should be published. well, another tip of the hat to the COCC was a bit reticent about playing volleyball Such an inspiration her accomplish­ staffers. The Micro C forum was also ex­ after seeing you on the opposite side of the ments are! ceptional. I think that it should become net. We're going to be taking Karate-ball This is the second letter that I've ever a standard topic. I overheard one com­ lessons this winter, so look out next year. attempted on Pat's computer. It's a halt­ ment about the forum however, and We already get complaints because there ing, timid effort but I'll keep trying. that was, "Why aren't the gals up there, are two talks at a time, three would be about Many thanks for an experience I will too?" as popular as poison oak at a nudist camp. not forget. Speaking of "the gals," thank you You're right about Debee and Christy Laura, for all that you did to bring (and Debee's seeing eye dog). Every SOG Claire Lewis about the SOG. I hope to see you next has its surprise and they were the surprise 8335 Camino Sur year! Another thank you to Debee and this year. A delightful surprise. See the Cucamonga, CA 91730 "Duchess" (I hope I got that right) for editorial for more on these two. showing us that a handicap is really in Allyn Franklin is a problem. I'm not Editor's note: You're very welcome, the eye of the beholder. The rest of the sure whether it's the subject (drive repair) Claire. Hope to see you here next year. speakers were up to standard SOG ex­ or the person. Probably both. I remember cellence, and a hearty thank you to each giving Allyn the last afternoon spot last Big Al Speaks and every one. year, that way he could go an extra hour if I think that I'll remember SOG VII as I'd like to offer up a couple of topics necessary. I think he finished up the follow­ the "missing" SOG. There were so for the next SOG to consider. Bruce ing day. Everyone was still there. We may many things missing this time that I feel Eckel should do an RS232C lecture. have to give him the final spot in the show it's appropriate. Someone should do a bit on Viruses and so he can just wrap around to the next year. The sense of excitement that I've felt Vaccines, perhaps the fellow who wrote As for getting the gals into the Micro C (and heard others speak of) was miss­ Vaccine. A talk by a SYSOP on dealing forum, good idea. In fact, they insisted we ing. It seemed to be a very nondescript with Trojan Horse routines and other (La.rry, Gary, Bruce and I) couldn't have gathering. Missing was the under­ nasty uploaded bombs. Some talks on speaker T-Shirts because four of us were standing of what SOG meant: I over­ systems other than the MS-DOS group. sharing the stage. If they were participating heard a number of attendees ask and How about another talk by someone too, I think we'd see a major rule change wonder what it stood for. (Semi Official from an outfit that makes computers (they wouldn't miss a chance to get T­ Get-Together.) that make a real difference in people's Shirts) Absent was the staff vs. readers - lives, such as ZYGO from last year. Continued on page 78

6 MICRO CORNUCOPIA, #44, Nov-Dec 1988 8280 Clairemont Mesa Blvd., Suite 117 San Diego, California 92111 ERAC CO. (619) 569-1864 AT BABY AT XT/TURBO NiCds Motherboard 6 & 10 Meg Motherboard 6 & 10 Meg Motherboard AA Cells .6aH ...... $1.00 Zero Wait State Zero Wait State 5 & 8 MHz Switchable 12V Pack AA Cells .6aH ...... 6.50 8 Expansion Slots 8 Expansion Slots 8088 - V20 Optional Sub-C Cells 1.5aH ...... 1.50 640K RAM On-Board 80286 Processor Optional Co-processor 12V Pack Sub·C ...... 10.00 Math Co-processor Option Math Co-Processor Option 8 Expansion Slots Double D Cell 2.5V 4aH unused ... 8.00 Phoenix Bios 640K RAM On-Board ERSO or Bison Bios 200 Watt Power Supply Phoenix Bios 640K RAM Hercules Compat. Video Bd. 200 Watt Power Supply 150 Watt Power Supply GEL CELLS Parallel Port Hercules Compat. Video Bd. Hercules Compat. Video Bd. 12V 1.9ah ...... $6.50 2 Serial Ports Active Parallel Board Parallel Board 12V 2.5ah ...... 8.50 Game Port 2 Serial Ports Active 2 Serial Ports Active D Cell 2.5ah ...... 2.00 Clock/Calendar Game Port Game Port 12V 24ah ...... 35.00 Hard Disk & Floppy Controller Clock/Calendar Clock/Calendar 20M Hard Drive Hard Disk & Floppy Controller Hard Disk and 1.2M 5% " Floppy Drive 20M Hard Drive Floppy Controller ROBOTICS 360K 5% " Floppy Drive 1.2M 5% " Floppy Drive 20M 5% "Hard Drive 12V DC Gear Motor 1"x3", 30RPM .$7.50 5061 Keyboard 360K 5% " Floppy Drive 2 ea. 360K 5% " Floppy Drive 5V DC Gear Motor with Tach 1"x2" . 7.50 Case with Turbo & Reset, 5061 Keyboard AT Style Keyboard Joystick, 4 switches, 1" knob ...... 5.00 Hard Drive Light and Mini AT Case with Turbo & Standard Slide Case Z80 Controller with 8-Bit A/D ..... 15.00 Keyboard Disable Switch Reset, Hard Drive Light and Amber Graphics Monitor Brushless 12VDC 3" Fan ...... 7.50 Amber Graphics Monitor Keyboard Disable Switch Capacitor, .47farad 1OV1 "x1 %" ... 4.00 Amber Graphics Monitor * * Solar Cells .5V .5A, .8"x1 .6" ...... 2.50 $1581 $999 High Voltage Power Supply EGA ADD $449 EGA ADD $429 _ $1531 Input: 15·30V DC 40M HD ADD $150 EGA ADD $449 40M HD ADD $150 6 & 12 MHz ADD $73 40M HD ADD $150 5 & 10 MHz ADD $21 Output: 100V 400V 16KV ...... 6.50 ELGAR UNINTERRUPTIBLE POWER SUPPLIES 200 Watt MODEL SPR201 $129-400 Watt MODEL SPR401 $149 THESE SUPPLIES MAY HAVE SOME MINOR COSMETIC DAMAGE, BUT ARE ELECTRICALLY SOUND. SQUAREWAVE OUTPUT. RUN ON INTERNAL OR EXTERNAL 24VDC BATTERY WHEN LINE GOES DOWN. TYPICAL TRANSFER TIME = 12MS. Battery Supplied-Not Guaranteed NEW 24V INTERNAL BATTERY $ 7 5

KAYPRO EQUIPMENT CPU & SUPPORT CHIPS SWITCHERS 9" Green Monitor ...... $50.00 MC68000·8 CPU ...... $8.00 5V/9.5A, 12V/3.8A, -12V/.8A ...... $39.00 Keyboard ...... 75.00 Z80CPU ...... 75 5V/3A, 12V/2A, -12V/.4A ...... 19.50 PR0-8 Mod. to your board ...... 149.00 Z80A CPU ...... 1.50 5V/6A, 12V/2A, ·12V/1A ...... 29.00 Host Interface Board ...... 15.00 l80 CTC ...... 1.50 5V/6A, 24V/11/4A, 12V/.6A, Kayproll ...... 250.00 Z80A PIO ...... 2.00 -12V/.6A ...... 29.00 KAYPRO IC'S Z80A SIO ...... 5.00 5V/10A ...... 19.00 81·189Video Pal ...... $15.00 8088 ...... 6.50 5V/20A ...... 24.00 81-194 RAM Pal ...... 15.00 8089·3 ...... 6.50 5V/30A ...... 39.00 81-Series Character Gen. ROMs .. 10.00 D8284A ...... 2.50 5V/75A, 12V/8A, 24V/5A ...... 55.00 81-Series Monitor ROMs ...... 10.00 SIP DRAM 256-12 ...... 7.00 5V 1OOA ...... 100.00 4164-10 ...... 2.50 5V 120A ...... 110.00 4164·12 ...... 2.10 POWER SUPPLIES 1793 ...... 6.00 TEST EQUIPMENT 0·8VDC 1OOA Metered ...... $249.00 1797 ...... 7.00 OSCILLOSCOPES Volt & Current Regulated 6845 ...... 5.00 TEK 7403N/7A18N/7850A 60 MHz .$650 5V/1A. ·5V/.2A, 12V/1A, VC3524 Switching Regulators ..... 5.00 ANALYZERS ·12V/.2A, ·24V/.05A ...... 9.90 1458 Dual Op-AMP ...... 70 TEK 491 10MHz · 40 GHz ..... $4500.00 LM2877P 4W Stereo Amp Dual ..... 2.50 Nicolet 500A 1 Hz 0-100 KHz ..... 1800 MB81464·15 ...... 2.75 Biomation 805 Waveform Rcrdr .. 259.00 HOURS: Mon. - Fri. 9 · 6 - Sat. 10 - 4 2716 ...... 3.00 Biomation 8100 2-Channel MINIMUM ORDER - $15.00 2732 ...... 3.25 Waveform Recorder ...... 795.00 TERMS: VISA. MasterCard. Certified 2764 ...... 3.50 HP1600A Logic Analyzer ...... 600.00 Checks, Money Order, NO COD. Visa 27C128· 1 ...... 9.00 HP1600A/1607A Logic Anlyzr ... 1000.00 and MasterCard add3%. Personal 74HCOO ...... 38 checks must clear BEFORE we ship. 74LS125 ...... 30 DBASE BOOK OF BUSINESS Include shipping charges. California 74LS373 ...... 50 APPLICATIONS by Michael J. Clifford residents add 6 1h % Sales Tax. For 74LS174 ...... 30 more information please call. Reg. $19.95 NOW ONLY $3.00

Reader Service Number 93 MICRO CORNUCOPIA, #44,Nov-Dec 1988 7 One of the things that surprised me as I read through this and the other object­ oriented articles in this issue, was the similarities among languages. The ideas of objects, classes, and messages are definitely key. It's where things are bound (fancy term A Taste Of Smalltalk: for when space is allocated) that seems to change from interpreter (Smalltalk) to com­ Object-Oriented Programming From The piler (C++). Check out all these pieces, I think you'll really get a sense of these unique Bottom Up languages.

n the early 70s, the Xerox Palo Alto Research Center in California began Ideveloping a new programming lan- guage - Smalltalk. Several versions later, in 1981, they released Smalltalk- 80. In August '81, BYTE devoted an en­ tire issue to Smalltalk-80, introducing the micro computer world to object­ oriented programming. There are now several versfons of Smalltalk; we list them (and other sour­ ces) at the end of this article.

What's In A Smalltalk? When you buy a Smalltalk, you get:

8 MICRO CORNUCOPIA, #44, Nov-Dec 1988 By Jan Steinman and Barbara Yates Tektronix, Inc. P.O. Box 500, Mail Sta. 50-470 Beaverton, OR 97077

(1) A virtual image file which con­ • 1. expressions in parentheses, tains the source code for a group of core • 2. unary messages, classes. • 3. binary messages, (2) A starter set of programming In Smalltalk, • 4. keyword messages, tools. • 5. equal precedence messages are (3) An interpreter. there's no program sent left-to-right, You can also add on packages of ad­ • 6. variable assignment happens ditional classes. Classes are the voices of per se. At least in last. The symbols ":=" or "<-" Smalltalk. (left-arrow) are assignment Smalltalk is both a programming lan­ the beginning, think operators on different systems. guage and a programming environ­ ment, consisting of, at least: an editor, a in terms of So in the Smalltalk statement - debugger, and an interface to a file ­ tem. Ask any Smalltalk programmer modifying the stream := ReadStrearn on: what's special about Smalltalk, and he'll (Array with: 'Joe' ,'Blow') first. invariably mention how much fun it is. behavior of existing the parenthetical expression must be Fundamental Talk classes, rather than manipulated first. Basically, we program in Smalltalk Within it is a binary message. So the by sending "messages" to "objects," creating new data concatenation selector "," is sent to the which are "instances" of "classes." String 'Joe' along with the String argu­ Some classes represent fundamental structures and ment 'Blow', resulting in the new String objects such as integers, characters, and 'JoeBlow'. reals (or floating point numbers). The operations. This new String is then sent as an ar­ names of classes are always capitalized. gument of the keyword message with: So the corresponding classes for these to the class Array, which responds with types are Integer, Character, and a new Array object containing the Float. Messages String 'JoeBlow'. Other classes represent more abstract Messages are represented symboli­ The unary selector "first" is then objects. For example, Process and cally by selectors. Different types of sent to the newly created Array, return­ Stream. There's also a rich set of classes message selectors correspond to the ing the first (and only) object in the of Collections: for instance, Array, number of objects involved in the mes­ Array, which is the String, 'Joe Blow'. String, and Dictionary. sage. This String is then sent as an argu­ Your Smalltalk system is effectively A unary message has one object, the ment to the on: message to the class its classes - from Cursor, to Input­ object receiving the message. A binary ReadStream. ReadStream responds with Sensor, to Compiler, to View. You send message has two objects - the receiver a new ReadStream object, which is as­ messages to instances of classes, and and one argument. signed to the variable "stream". things happen. Keyword messages are sent to the There's some confusion (isn't there receiver with one or more arguments. Creating Classes & Behaviors always?) about classes because there's Each part of a keyword selector ends When we create a class, we no standard class library. The same with a colon. For example, when an ob­ (programmers) decide what kinds of class may go by a different name in a ject can't reply to a message, it sends it­ data are needed to describe the instan­ different implementation. And self the message - ces of that class. The private data of in­ Smalltalk implementations may contain stances is stored in instance variables. fewer than one hundred or as many as doesNotUnderstand: All instances of a class can share several hundred classes. data, as well. Shared data is stored in Later we'll go a little deeper into Precedence class variables. classes and clear up some of the Smalltalk uses precedence rules to The programmer decides the be­ mystery. resolve ambiguities - havior of a class, and chooses the selec-

MICRO CORNUCOPIA, #44, Nov-Dec 1988 9 tor names of messages to send to the Figure 1 - Smalltalk Run-time Error Notifier. class (or to instances of the class) in order to start the behavior. Methods are the procedures (or func­ tions) of Smalltalk which execute when a message is delivered. In Smalltalk-SO, methods are grouped into categories ac­ cording to their function. again undo Programs & Objects copy In traditional, structured languages, cut paste you write programs by defining data Message not understood: next structures and the operations you want -•H•I- print it string( Object)>> does NotUnderstand: to perform on that data. inspect it UndefinedObject> >Dolt In Smalltalk, there's no program per accept Compiler»evaluate:i ;oceed ylng:iffail: se. At least in the beginning, think in cancel Workspacecontroller P • dercontroller)»dolt terms of modifying the behavior of ex­ file out Pop Up Menu>> startu~ correct ~s :action Receiver: isting classes, rather than creating new data structures and operations. An object is a private, persistent state that behaves in a particular manner through a publicly accessible interface. The arrangement of the state of one object is unknown to other objects. In modem, when you're trying to reach a Smalltalk objects. other words, you program by focusing fellow human being, the modem will let They may be created hundreds or on the way an object behaves (or you know that it doesn't understand by thousands of times each second. When manipulates data). hanging up! they' re no longer needed, they become In Smalltalk, when an object can't garbage. Fortunately, a garbage collec­ Messages Determine Behavior reply to a message, it hangs up, sending tor knows when garbage is garbage and The behavior of an object is deter­ itself the doesNotUnderstand: message, reclaims the memory. mined by the messages an object can which we can intercept for error In a world of routine object creation reply to. You can simulate message recovery. and destruction, garbage collection is passing in many languages, but For example, sending the message sorely needed. Smalltalk is the only popular language "next" to the string 'Hello, world' So you (the programmer) create ob­ where message passing is the only brings up a notifier window. (See jects deliberately. And the Smalltalk sys­ means of communication among ob­ Figure 1.) tem creates objects behind your back, as jects. it answers messages. It's important to note that a message Inheritance While the usual activity of Smalltalk selector exists apart from an object. So How does an object know about programming is defining and refining the particular object a message is sent to messages like printString and doesNot­ the behavior of a class of objects, the is very likely indeterminable at the time Understand:? Through inheritance, a usual activity of executing Smalltalk the method is written. key element of any object-oriented lan­ code is creating objects and sending Editor's note: For instance, in C++, guage. them messages. It's not unusual for a memory for an object has to be allocated at The Smalltalk interpreter directly large Smalltalk application to generate compile time, whereas the size of a smalltalk supports hierarchical inheritance. hundreds of thousands of objects. object changes while the program is run­ Like everything else in Smalltalk, For example, you might do a "print ning. classes are objects. You create a new it" on the statement "newString := This polymorphism is the biggest class by sending a class creation mes­ 'Hello,', 'world!"'. (See Figure 2.) reason there are no Smalltalk compilers sage to some other class. Your class be­ This sends the String 'Hello,' the con­ in common use, and why those which comes a subclass of that other class, in­ catenation message "," with the String do exist (in research labs) place restric­ heriting all its behavior. argument 'world!'. It replies (in the best tions on message passing. It's also cited At the root of the class hierarchy is of Smalltalk worlds) with the brand by backers of late-binding languages the class Object, which understands the new String object 'Hello, world!', which (like Smalltalk) as the key that turns a messages common to all objects, such as is stored in the temporary variable new­ language truly object-oriented. In this printString and doesNotUnderstand:. String. sense, neither C++ nor Ada are truly Then, the workspace window closes, object-oriented. And Where Do Objects Come From? and the new String object is collected as A Smalltalk message, like print­ Most real-world objects have fairly garbage. String, can be sent to any object (regard­ long lifetimes. With the exception of less of class), and the object will radioactive Polonium-214 (which has a The One-Line Database respond by identifying itself with a half-life of 164 microseconds), or choco­ Let's create some more useful ob­ String of some sort. late ice cream (which in our house, has jects. (See Figure 3.) Modems talk to each other this way. a full life about as long), real objects Execute And if you unintentionally reach a tend to stick around. Not so with

10 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Figure 2 - Create a New Object by Sending a New Message

"I'm very impressed with the com­ piler, editor, and debugger. I've tried quite a few different compilers for the inspect i PC and have given up on all of the accept others in favor of yours . .. I've gotten cancel 1----• before file out ...______a-ft_e_r ______. to the point where I download C code from a DEC I.AX/VMS system just to be able to compile it with the picky flag set at 9. It finds lots of things VMS totally ignores ... " JS, Oak Ridge, TN Figure 3 - The One-line Database in Action.

again Smalltalk undo at: #PhoneNumbers Fred put: Dictionary new. Joe Phone Numbers at: #Joe put: '503/555-1234 ' .. print it. Phone Numbers inspect 1 accept at: #Fred cancel put: '503/555-0987'. file out

Phone Numbers inspect.

Joe inspect ----references copy key Our Guarantee: Try the Eco-C88 compiler for $99.95. Use it for 30 days and if you are not remove completely satisfied, simply return it for a full refund. We are confident that once you've Enter expression to copy tried Eco-C88, you'll never use anything else. then accept or CR cut Call or write today! #Jill pas~e ),, do It print i

cancel

Reader Service Number 9

MICRO CORNUCOPIA, #44, Nov-Dec 1988 11 Smalltalk dow on its private state. This is so use­ at: #PhoneNumbers ful during debugging that the standard put: Dictionary new. Smalltalk debugger includes an Inspec­ Late-binding of tor for the object whose method is being by highlighting the text and choosing debugged. "do it" from the menu. message passing Executing ''PhoneNumbers inspect'' This is Smalltalk for - create a new will pop up an Inspector that allows global variable named PhoneNumbers lets all users of an you to add, remove, and modify entries and place a newly created Dictionary in your database. So - object in it. object benefit from Now you can begin adding objects to (Smalltalk at: #PhoneNumbers put: your new Dictionary. modifications. Dictionary new) inspect. To retrieve an object from the Phone­ Numbers Dictionary, "print it" using creates a simple database manager, the following statement : complete with ! Not bad a new Association object that stores the for a line of code! PhoneNumbers at: #Joe. first Symbol argument together with the second String argument. These key­ An Environment Of Reusable Parts What's Going On Here? value pairs are very useful for symboli­ The key to Smalltalk productivity is We're creating objects by sending cally representing data. that components are reusable. messages to other objects. The names Although we' re using a Symbol as The Class Inspector is a good ex­ #Joe and #Fred are actually objects of the key and a String as the value in this ample. Programming often requires ex­ class Symbol (similar to String), whose example, any object can become as­ amining or modifying an object's instances are unique in the system. sociated with any other object. private state and this is the task of In­ Once you've created #Joe, any men­ All objects are equipped to answer spector. (Without modification it's also tion of #Joe, is a reference to the exist­ common messages (in addition to print­ a debugger.) ing Symbol, #Joe. String and doesNotUnderstand:). One "So," you might counter, "my When you send the message at:put: particularly valuable one is "inspect," Speedo QuickWindows Mark III Library to the new Dictionary object Phone­ which forces an object to open a win- from Ne' erdowell Software lets me do Numbers with two arguments, it creates that in C."

INDUSTRIAL STRENGTH OOPS. You have three options in today's world; lead, between DOS, OS/2 and Presentation follow or get out of the way. You've already Manager operating environments; integrated taken a leadership position in hardware with color graphics; a rich class library; and access the latest 286 or 386 system. Now you can use to 16 MB of protected mode memory, even that triple-digit architecture to blast ahead of under DOS. the pack with the most powerful new Object The new Smalltalk/V286, which is even Oriented Programming (OOPS) software on the easier to learn and use than Smalltalk/Y, retails market: Smalltalk/V286. for just $199.95. Or you can buy Smalltalk/V, Smalltalk/Y, the original OOPS tool for still the world's best selling OOPS, for only the PC, gave scientists, engineers, program­ $99.95. And both come with our 60 day money­ mers and educators a brand new way to solve back guarantee. problems. And soon they were developing Check out the new Smalltalk/V286 at exciting new applications in everything from your dealer. If he doesn't have it, order toll free, economics to medicine to space. 1-800-922-8255. Or write to: Digitalk, Inc., Now Smalltalk/V286 gives you true 9841 Airport Blvd., Los Angeles, CA 90045. work station performance with industrial And let us put strength capabilities like: push-button youaheadofthe debugging; multi-processing; portability power curve. SmaD&.~ .. 11./V286

Reader Service Number 111 12 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Perhaps, but does it let you easily was sent. a ratio between two Numbers. Fractions modify and extend the library so that Class Character contains methods for may seem quaintly archaic. They are, already existing applications can use the converting a character to or from ASCll, until you have to deal with non-integer changes? Probably not, unless your C is or for determining if it's an al­ quantities that don't lend themselves to late-binding. Late-binding of message phanumeric, vowel, or whatever. (This floating point. passing lets all users of an object benefit class has been successfully modified to For example, using Fractions, you from modifications support Oriental character sets, with can add one penny to the sum of the To get an idea of how powerful this more than 256 characters.) National Debt. Attempting to do the is, I'll briefly describe the abilities of the Class Association, mentioned earlier, same using floating point math would major classes in Smalltalk. might seem out of place as a subclass of result in no change, which is convenient Magnitude. But associations connect or to politicians, but hardly accurate. In Magnitude's Classes associate a symbolic name with an ob­ particular, Fraction provides a good su­ Numeric classes are all subclasses of ject. And such symbolic names need perclass for creating a fixed-point class. Magnitude. Magnitude does very little, order. So two Associations need to The Number subclass Integer is it's really an abstraction for all classes of know how to compare themselves. another abstract class, which serves as a objects that know how to compare Think of Associations as entries in superclass for LargePositiveinteger, themselves with each other. Abstract su­ the index of a book, where keywords LargeNegativeinteger, and Small­ perclasses, like Magnitude, are common serve as references to page numbers. Integer. in Smalltalk. For most purposes, it's safe to treat Below Magnitude in the hierarchy Numbers all these the same (with the under­ are the classes that deal with quantities, Class Number is an abstract super­ standing that larger integers take more like Date, Time, Character, and Num­ class for objects which know about memory and execution time). ber. Date and Time contain methods for arithmetic. You would never create an Most modern systems allow Small­ printing and comparing dates and instance of Number (since it's an Integers between -230 and 230-1, al­ times, as well as special methods for ob­ abstract class), but through inheritance, though some older versions of Smalltalk taining partial information, such as day Number provides the arithmetic ability limit Smalllntegers to the range of -214 of the week. you would associate with a number. to 214-1 The class methods "Date today" and Number has subclasses that do most "Time now" return a new object repre­ of the work. Float provides floating­ Numeric Conversions senting the date (or time) a message point capability, and Fraction represents One of the nicer things about Smalltalk is the way conversions be­ Array subclasses include ByteArray OrderedCollection has an extremely tween the numeric classes are handled. and String, whose elements are eight-bit useful subclass called SortedCollection, With the help of the large integer clas­ quantities. ByteArrays are useful for in­ which maintains a collating sequence in ses, Smalltalk supports infinite terfacing to hardware or accessing bi­ its component objects, even through ad­ precision, and conversions always at­ nary data files. ditions and removals. Any comparison tempt to maintain the greatest possible Strings are Arrays of Characters and algorithm can be supplied to the Sorted­ accuracy. contain all the methods needed for Collection. Or you can use default algo­ For this reason, executing the simple manipulating text, including comparing, rithm "greater-than-or-equal-to." Gen­ expression "1 /3" returns the Fraction substring testing, searching and replac­ erally, the type of objects you store in a 1/3, which is usually not what you ing, converting, abbreviation, encoding, SortedCollection will know how to com­ want. Also, if you don't need infinite and displaying. pare themselves to each other, so there's precision, you'll get better performance Although there are many methods in little need to provide special com­ by converting intermediate results to String, strings are by their nature ubiq­ parison algorithms. Float. uitous, and the power of Smalltalk is Since SortedCollections are main­ Smalltalk is popular in numerical quickly and easily put to use by the tained in sorted order, they're hard on and business computing, despite its beginner by adding useful behavior to performance. But you can easily change (only partially deserved) reputation for Strings. their behavior to sort only when asked being slow. for their entire contents.

Collection's Classes Sets The next major group of classes are The last major group of Collections is Collection and its subclasses. All Collec­ the Set hierarchy. Unlike most other tion subclasses represent objects made Collections, Sets (and subclasses) are ac­ up of groups of other objects. Their be­ Ordered cessed by a hash probe, rather than by havior includes methods for detecting index, and occupation of the Set by its the inclusion or count of a particular ob­ Collections absolve component objects is sparse. ject, adding, removing, converting Col­ This is the classical space-speed lections, and enumerating. the programmer of tradeoff - adding objects can be much Enumeration is very handy. Instead faster when lots of space is available. of writing clumsy, hard-to-maintain do­ all responsibility for Because access is by hash, objects can't while or for loops, you simply say "ex­ be duplicated and their order in the Set ecute this block of code for each object bounds checking. isn't maintained. But access is much in the Collection." It doesn't matter faster than if a search had to be per­ which Collection, or what's in it. By increasing the formed, as in other Collections. Enumeration methods include do:, A Dictionary (e.g., a database which simply executes the Block for size of an array management system) is a Set of Associa­ each object in the Collection; collect:, tions. which does the same, but saves the (etc.) it can accept You can store any type of object: in­ result of each execution in a new Collec­ cluding multiple-field objects or even tion of the same class as the original; in­ more objects. other Dictionaries. Dictionary is one of ject:into:, which can accumulate a run­ the most useful Collections, and is a ning value obtained from executing the good one for beginners to subclass. Block; and select: and reject:, which The system uses Dictionaries to as­ return a Collection of the same class as Is There Order? sociate message names with the code of the original that contains only those ob­ The Collection subclass Ordered­ a method, to store global variables, and jects for which the Block returned true Collection significantly alters the way a to manage system resources. Figure 4 or false, respectively. C, Pascal, or programmer must shows a few of the features of Collec­ We won't cover all the Collection think. OrderedCollections absolve the tions at work. subclasses, but instead stick to the high programmer of all responsibility for We begin by declaring three tem­ points. bounds checking, by increasing the size porary variables, point, increment, and of an array (etc.) so it can accept more collection, and assigning to them a new Traditional Arrays objects. This is a difficult thing for Point object, the Smallinteger 20, and a If you're more comfortable with the hybrid object-oriented languages, like new Array object containing four traditional languages, one class in this C++, Modula-2, or Ada, to accomplish, Strings. group will be familiar: Array. Arrays since they typically don't have garbage Next, we ask the Array to convert it­ have a fixed size, and their component collection. self to a SortedCollection, using the objects are accessed by an Integer (as in Added behavior includes methods default collating sequence. The resulting other languages) beginning with the for adding, removing, and accessing ob­ SortedCollection is sent the enumeration index 1. It would be easy to implement jects at the beginning or end of the Col­ message do:, with the Block of code an Array subclass VariableOriginArray, lection, or before or after a particular within the square brackets as an argu­ which would allow arbitrary Integers item in the Collection. We have all had ment. for the starting and ending index, or the experience of writing and rewriting The Block is repeated for each object WrappingArray, which would map il­ functions to do these sorts of things in C in "collection," and each time it's legal indices to legal array positions. or Pascal! repeated, the Block variable "wordu

14 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Figure 4 -A Few Features of Collections at Work. UNINTERRUPTABl.E POWER SOURCE

fee fie foe furn

MICRO SOLUTIONS protects your equipment and your data from power outages and brownouts. Our power systems provide the fastest switching speed in the in­ dustry (2 ms± 1).

EMl/RFI filtering and surge/spike protec­ tion all in one affordable unit. 1 year war­ ranty on all units. Available in a size to suit your needs. takes on the value of the next object in Boolean is an abstract superclass, 200 watts $290.00 350 watts $360.00 "collection." So, each object in with foe subclasses True and False. 550 watts $410.00 "collection" is displayed on the screen These objects understand boolean logic. 800 watts $710.00 at the location "point," and "point" is They are the objects that conditional 1000 watts $810.00 incremented by "increment." branching and looping messages are Includes shipping to your door in the con­ sent to. tinental U.S.. As specialists in overseas Miscellaneous Classes UndefinedObject has a single in­ systems, we can supply 220 volt units. Before we move up to the classes stance, known as nil. nil is used to ini­ Call or write for details. that do windows and graphics, we need tialize objects. If you get an error to mention a few housekeeping classes. notifier that mentions UndefinedObject, SOFTWARE SPECIAL Stream and its subclasses are invaluable chances are you forgot to initialize a for sequential access to a Collection. variable. And so a message was sent to nil. Streams ACT! While all Collections understand Blocks enumeration behavior, sometimes it's BlockContext (or Context on some See what qualifies as GREAT SOFTWARE! useful to be able to interrupt, skip for­ systems) is simply a way of moving ACT! does for people what 1 2 3 does for ward or backward, or terminate the code around the system. Conditional numbers. ACT! helps you manage your contacts with the important people in enumeration of a Collection. branching and looping, enumeration, your life. Streams maintain a position in their error recovery, and many other func­ Collection and are useful for modeling tions are created from Blocks. For ex­ sequential things like files or terminals. ample, SortedCollections contains a Call today for more information - or send Stream, itself, is an abstract class and Block of code that compares two com­ a $10 (refundable) deposit to receive a only provides instance creation. It tests ponent objects in the SortedCollection to copy of the ACT! video demo tape. Your deposit will be refunded - whether you to see if you're at the end of the Collec­ determine their order. purchase ACT! or not - when the video is tion, does basic enumeration, and Blocks are very useful, but they can returned in good condition. provides accessing methods for its sub­ also waste a lot of memory and execu­ classes. tion time. Blocks can take arguments, ReadStrearn gives you access to a which change their state (e.g., during Collection. The "next" message, for in­ enumeration). The number of argu­ liiiiiiil RON ANGERT'S stance, returns the next object in the ments specified when the block is l!!!!JM IC R 0 Collection, and the "next:" message created and number sent during execu­ takes an Integer argument and returns tion must be the same. -SOLUTIONS the specified number of sequential ob­ WE SHIP WORLDWIDE jects in the Collection. Graphics WriteStream adds write access using A whole group of classes represent C.O.D. the selectors nextPut: and nextPutAll:. graphic objects. Point, mentioned ear­ ReadWriteStream and FileStream un­ lier, represents a position in an area. Dealers Supported Drawer B Riner, VA 24149 derstand both reading and writing mes­ Rectangle contains two Points marking 1-800-323-4829 (703) 382-6624 sages, one on a Collection, and the other opposite corners. Form contains a bit­ Call 24 hours - 7 days a week on a file. map, making up the graphic image. Reader Service Number 24 MICRO CORNUCOPIA, #44, Nov-Dec 1988 15 BitBlt manipulates Forms, and is Smalltalk is also attacked for being on the Mac II, the Mac SE, and the Mac how graphics get displayed. Don't use wordy, but usually by those who think Plus; it will be available in the Fall - BitBlt as a model for your own classes you need to write a lot of code. Code costs $199.95. There are applications kits - it's better used as an example of how reusability, combined with available for color, communications, Smalltalk code can be non-object­ copy I cut/paste editing, means that an and other goodies - they cost $49.95 oriented! experienced Smalltalk programmer each. For more info - generally spends less time typing than a User Interface Classes C programmer. Digitalk, Inc. The most important user interface "Make it work, then make it fast," is 9841 Airport Boulevard class is ParagraphEditor on Smalltalk-SO something we all need to repeat to our­ Los Angeles, CA 90045 systems and TextEditor on Smalltalk/V selves from time to time. Smalltalk 1-S00-922-S255 systems. It handles text editing and makes it work like no other, and when 1-213-645-10S2 entry for the whole system. it comes time to make it fast, there is SelectioninListCon troller (Lis tSelec­ help. All popular versions of Smalltalk ParcPlace Systems sells Smalltalk-SO tor on Smalltalk/V) provides a simple include some means for access to as­ for a number of platforms manufac­ way to choose an item out of a list. Un­ sembly code, and Tektronix and tured by Sun, Apollo, Hewlett-Packard like pop-up or pull-down menus, these Digitalk Smalltalk include full access to and others, plus Apple II, lists are scrollable. You'll see these all system calls. Plus, and SE workstations. See publica­ throughout the system as "subviews," If you decide to buy a Smalltalk im­ tions section for their address to write or windows within other windows. plementation and work for someone for specific information. Prices are over The Inspector class (mentioned ear­ with deep pockets, consider getting a $1,000. lier) is one of the most versatile per­ Smalltalk-SO variant. ParcPlace Tektronix was one of four companies formers in the user interface group. It Smalltalk-SO is available on many plat­ that contributed to the development of allows you to examine and modify the forms, but at a kilobuck a pop, it's Smalltalk-SO in the late 70s and early private state of an object. It combines a probably not a personal purchase. SOs. Apple, Digital Equipment Corpora­ SelectioninListView, to allow selecting a If your employer has "really deep" tion, Hewlett-Packard and Tektronix variable from a list of all variables of the pockets, buy a Tektronix bitmap were test sites for early versions of the object, with a ParagraphEditor, used to workstation. Smalltalk' s included. And system Xerox was developing - they view or modify the selected variable's the Tektronix hard ware and port each were expected to develop a full contents. Its subclass Dictionary­ have been designed for Smalltalk, so it's implementation of a written specifica­ Impector allows selection of the in­ better integrated. tion of the interpreter. spected object by key. If you're running on a PC clone or a Tektronix has been developing its FileList lets you examine files and Mac II, then Smalltalk-V is your best own implementation of the system since directories, and typically includes a list bet. It's inexpensive, well-supported, then, extending it from a version that of files or directories and a window for and the Mac II and 802S6 versions are Xerox PARC released in 19S3. They editing a selected file. very fast. The environment, while dif­ have a very extensive class library, col­ The important aspect of having the fering considerably from Smalltalk-SO, lection of tools, and reusable com­ source code to all the classes that make shares a large group of Smalltalk-SO ponents. Tektronix Smalltalk is only up the environment is that you can cus­ classes. The version that runs on vanilla available on Tektronix workstations. tomize it, even the user interface, to suit SOSS PCs is cheap, but lacks the speed A Little Smalltalk is a version of yourself. and object space necessary for large ap­ Smalltalk that runs under UNIX on line­ Don't like the way a menu is set up plications. oriented (conventional) terminals. The or want more items on it? Change it! interpreter is written in C. It's available Want to change the way the window Vendors for distribution cost on 9-track tape in panes look? Do it! Want to make the in­ Digitalk, Inc., has sold more copies "tar" . This Smalltalk doesn't terface to the file system work different­ of its version of Smalltalk, called support graphics (no windows, no ly? Go ahead! Smalltalk/V, than any other Smalltalk mouse), but it's an inexpensive way to on the market. It runs on a number of learn object-oriented programming. For Decision Points For Potential Users platforms, and has been pared down more info- Primarily, Smalltalk is a language especially for PCs. The version we and environment for rapid program bought came with 99 classes. It has very Smalltalk Distribution development. In other words, it's ideal clearly written, nicely formatted Department of Computer Science for hackers. Some studies show that documentation - some people would Oregon State University Smalltalk programmers are about five pay for the manual alone what we paid Corvallis, OR 97331 times more productive than Pascal or C for the package, since you can't buy the programmers, and up to 25 times more manual without the software. productive than folks working in as­ Smalltalk/V requires an IBM-PC, Periodicals sembly. PC/XT, PC/ AT, or compatible and PC­ BYTE magazine, August 19Sl issue. On the flip side, Smalltalk applica­ DOS or MS-DOS - costs $99.95. Entire issue devoted to Smalltalk-SO. A tions aren't easy to separate from the Smalltalk/V2S6 operates with the DOS collection of articles that provide an in­ environment, and this makes delivering operating system on AT class com­ teresting and authoritative introduction applications difficult. The Smalltalk en­ puters and requires a minimum of 1-1.5 to Smalltalk. vironment is large, and has a (partially MB of memory - costs $199.95. HOOPLA! (Hooray for Object-Oriented deserved) reputation for being slow. Digitalk's Macintosh Smalltalk/V runs Programming Languages!) is published

16 MICRO CORNUCOPIA, #44, Nov-Dec 1988 quarterly by Object-Oriented Program­ published by ParcPlace Systems (PPS), Books ming for Smalltalk Application Xerox Corporation. It focuses on new Budd, Timothy. A Little Smalltalk. Developers Association (OOPSTAD). PPS products and services and applica­ Reading, MA: Addison-Wesley, 1987. Annual individual membership in the tions written in this vendor's Smalltalk- Goldberg, Adele and Robson, David. U.S. is $25. 80. Smalltalk-BO: The Language and Its Im­ plementation. Reading, MA: Addison­ HOOPLA! ParcPlace Systems Wesley, 1983. P.O. Box 1565 2400 Geng Road Goldberg, Adele. Smalltalk-BO: The In- Everett, WA 98206-1565, USA Palo Alto, CA 94303 teractive Programming Environment. electronic bulletin board, 300/1200 1-415-859-1000 (in CA) Reading, MA: Addison-Wesley, 1984. baud: 1-206-252-9048 1-800-822-7880 Pinson, Lewis J. and Wiener, Richard S. An Introduction to Object-Oriented Journal of Object-Oriented Program­ theActiveView is a quarterly newslet­ Programming and Smalltalk. Reading, ming (JOOP) is published bimonthly. ter available free of charge to Tektronix MA: Addison-Wesley, 1988. U.S. annual individual subscription is Smalltalk customers. It focuses on fea­ $49. tures of Tektronix' implementation of Smalltalk-80, programming tips column • • • JOOP applicable to Smalltalks from all ven­ P.O. Box 968 dors, updates on documentation and Fort Washington, PA 19034 training classes offered by Tektronix. 1-800-345-8112 Send a postcard with your name, com­ pany name, address and phone number SCOOP is a newsletter published by to: Digitalk, Inc., for their Smalltalk/V cus­ tomers who've sent in their signed war­ Software Productivity Technologies ranty card. It contains new product and Tektronix, Inc. upgrade information, bug fixes, P.O. Box 500, M.S. 50-470 programming tips, and other news. Beaverton, OR 97077 The Smalltalk-BO Newsletter is ATTN: theActiveView-mc

A two-billion-power Mandelbrot/Julia microscope. Fast! Aim-and-frame, quick draft, animate, recolor, retouch, multiple palettes, save and retrieve, cloud chamber, help and more. Includes seven ready-made pictures for immediate gratification.

MANDELBROT EXPLORER 2.6 $30

Peter Garrison 1613 Altivo Way Los Angeles, CA 90026 (213) 665 1397

16-color VGA/EGA to 800x600 Specify VGA or EGA, 1.2Mb Overseas orders please add $4

Reader Service Number 112 MICRO CORNUCOPIA, #44, Nov-Dec 1988 17 Actor, An Object-Oriented Language Taming Microsoft Windozvs

Editor's note: a standalone version of ject which is a network of nodes. Each I'll try (real hard) to avoid the puns this Zack's application that runs under Microsoft node is an activity: either a task or a time and simply set the stage. Actor is an Windows, including complete source code, is milestone. Tasks are activities which con­ object-oriented language written to run available for downloading from the Micro sume time and resources. Milestones are under windows. Cornucopia RBBS, on the issue #44 disk, or used to mark the completion of tasks. When I first heard about Actor, I as­ directly from the author. For example, developing software is a sumed it was a simple windows creator. I task that will take time and money. Or was wrong, very wrong. So I leave it to you What Is OOP? you might have a milestone to indicate to decide if Actor means curtains for the Unlike traditional languages where that the specs are written for a product more classical performers. data is separate from the operations you and that it's time to begin programming perform on it, object-oriented languages and writing the user manual. The mile­ connect data and functionality into stone itself doesn't take any time or have lthough object-oriented program­ modules known as objects. any cost; it just marks the completion of a ming has existed for years on ex­ Each object has a set of attributes phase in the project. Apensive dedicated computers, it's (data) and operations. Objects can be Since our application will run under only recently reached PC users. "things" found in traditional languages Microsoft Windows, you also need to In this article I'll introduce you to ob­ such as arrays, strings, numbers, charac­ create a project window object that can ject-oriented programming via a useful ters, files, etc. Actor includes a rich set of draw a diagram of the network, handle (real world) example - a critical path predefined objects such as stacks, queues, menu commands, and so on. project manager. This example sets, dictionaries, windows, dialog boxes, If possible, you want to preserve the demonstrates several of the virtues of etc. functional divisions in the logical model. OOP (object-oriented programming), For example, the project object shouldn't such as encapsulation and inheritance, Object-oriented Design be concerned with details of how the and programming in the Microsoft Win­ When designing an application in a total cost of a task is calculated; let the dows environment using my favorite lan­ procedural language such as C or Pascal, task worry about it! The only thing the guage - Actor. you'd probably begin by designing the project needs to know is how to update The application was easier to develop data structures and then determining the the total if the cost of a task changes. (and understand) using an object­ functions you need. In object-oriented Good object-oriented design en­ oriented approach. I spent about two and languages the data and functionality are courages the creation of abstract data ob­ a half man-weeks conceptualizing and combined in objects, so you don't con­ jects that clearly define public protocol programming, or about two-thirds of the sider programs in terms of routines that and hide implementation details. Al­ time I would have spent using C, even manipulate passive data. Instead, you though this approach isn't required by though I have more experience with C. think of a collection of active objects that Actor, I strongly encourage it since it can In particular, I was able to reuse more operate on themselves. minimize maintenance headaches. code than I would have in C, and build­ So you need to determine which ob­ The object-oriented design approach ing the user interface was easier. jects will make up the system, and the requires more work up front, but The project manager is similar to com­ easiest way to do this is to develop a generally pays off in the long run by mercially available products such as logical model of the system you're trying providing better encapsulation than the SuperProject or MacProject, but on a to create. traditional procedural approach. smaller scale. It allows you to define a In cases where there is no clear logical Figure 1 lists some of the objects I'll project as a group of related tasks and model, you can determine the objects use for the project manager. then compute the critical path of the based on the user interface. For example, project, its total cost, and so on. the objects you'd use for a spreadsheet Messages & Methods The critical path is the sequence of ac­ would include the spreadsheet window An object is capable of responding to tivities that must be completed in a and the cells. messages that are sent to it by other ob­ scheduled time to meet a project dead­ jects, by itself, or by the system. For ex­ line. Some activities done in parallel may The Project Manager ample, you can print an object by send­ not be on the critical path, and thus have An approach you can take in the ing it a print message. The code in Figure additional "slack time." project manager is to set up a project ob- 2 illustrates some message sends.

18 MICRO CORNUCOPIA, #44, Nov-Dec 1988 By Zack Urlocker The Whitewater Group 906 University Place Evanston, Illinois 60201 312-491-2370

Message sends are similar to function Figure 1 - Objects in the Project Manager Application. calls in procedural languages, with some important differences - Network a generic network of nodes with a start and end Node a generic node capable of connecting itself (1) The first parameter is the receiver of the message; the other parameters are Project a network that knows the critical path method Activity a node with an earlyStart and lateFinish arguments. Milestone an activity that uses no time or resources (2) The message makes no assump­ Task an activity that has time, resources and cost tions about the "type" of the receiver or PERTTask a Task where the time is estimated by PERT the arguments; they're simply objects. Resource used by a task; has a name and cost This provides a great deal of flexibility since you can have different objects ProjWindow a window that can display a network diagram GanttWindow a window that can display a Gantt chart respond to the same message in their own way. This is known as polymor­ /***/ phism (or literally, "many behaviors"). For example, you might have a calc­ Cost message that can be sent to either a Figure 2 - Examples of Message Sends. project or a task and, using calcCost' s al­ gorithm, will calculate the cost of the print(A); /*all objects know how to print*/ project or task draw(rect, hDC); /*draw a rect in the display*/ The implementation of a message for cost := calcCost(P); /*whatever Pis, get its cost*/ reSize(aWindow, wp, lp); /*the system tells us to resize*/ a class of object is called a method, and it corresponds to a function definition in a /***/ procedural language. Figure 3 shows a sample method definition for calcCost for the Task class. Actor source code looks a lot like Pas­ Figure 3 - A Sample Method Definition. cal or C. Most programmers find this makes it easy to learn. The method /* This method defines the calcCost message for the Task definition begins with the Def keyword class. Self refers to the task that receives the message. followed by the name of the method, the Time, resources and cost are instance variables defined for the Tasks. receiver (always referred to as self), any The cost is the fixedCost plus the variable cost of each arguments, and after a vertical bar, any resource used by the task. If the cost changes, send a message to the network to update its cost. */ local variables. Def calcCost(self I oldCost) The do message is defined for all col­ { lection classes and lets us loop through oldCost := cost; /* store our old cost as a temp */ cost := fixedCost; /* starting value for the cost */ the resources array referring to each ele­ ment of the array in tum. If, later, you do(resources, /* loop through the resources */ decide that the resources should be {using(res) /* res is the loop variable */ cost .- cost + getFixedCost(res) handled as a lookup table or a set, calc­ + getTime(self) * getVariableCost(res); Cost will still work correctly since all of }); if cost <> oldCost then these collections understand a do mes­ updateCost(network, cost - oldCost); sage. endif; Actor is an interactive environment. "cost; I* return the new cost */ You write methods with an editor called a browser, compile them, and test them, /***/ as easy as one-two-three.

Classes Of Objects Every object belongs to a class. A class

MICRO CORNUCOPIA, #44, Nov-Dec 1988 19 is like a data type in procedural lan­ guages, but much more powerful. Clas­ Figure 4 - The Connect Method. ses define the data that make up objects and the messages that objects under­ Public protocol : stand. connect(Nl, N2); /* e.g. Nl -> N2 */ For example, a stack class (actually called OrderedCollection) includes in­ Private implementation: stance variables firstElement and last­ /*Connect self->aNode by updating self's outputs and Element and responds to messages such aNode's inputs. Also, aNode should know it's network as push and pop. and the position should be set. */ Def connect(self, aNode) Instance variables are attributes of an { addinputs(aNode, self); object and are like fields in a record addOutputs(self, aNode); structure in C or Pascal. You can create setNetwork(aNode, network); setPosn(aNode, self); new classes and define methods using the browser. /*To connect node nl->n2, nl's outputs must contain n2. */ Rather than access the private instance Def addOutputs(self, aNode) variables of a class directly using the dot { add(outputs, aNode); notation (e.g., stack.firstElement) you can } encapsulate the data by using messages /*To connect nl->n2, n2's inputs must contain nl. */ only. That way you reduce the depend­ Def addinputs(self, aNode) encies on the implementation. { add(inputs, aNode); } For example, if you need to get the time required for an activity x, you /***/ should send a getTime(x) message rather than refer directly to the instance variable x.time. there's nothing inherently network or automatically. You can fix the code on It doesn't matter if x is a Milestone, a node-like in the system already, these the fly and resume execution. Task, a PERTTask or even a Project, as classes descend directly from class Ob­ Any time you want to examine an ob­ long as it knows how to respond to a get­ ject. ject, you can call up an inspector and see Time message. This can make the critical Rather than keep track of the connec­ the values of the instance variables. You path recalculation algorithm easier to tions in the network, the nodes them­ can also inspect the instance variables of write since you eliminate special cases for selves maintain a set of input nodes and an object from within another inspector Milestones; you just define its getTime output nodes as instance variables inputs and trace through an entire network easi­ method to return zero. This results in sig­ and outputs. The network, then, just ly. nificant savings in code. maintains the start and end nodes. The Actor also has a code profiler that you network is actually implemented as a can use to determine which methods will Inheritance doubly-linked list, but this is "private" give you the most optimization. You can What really makes classes powerful is information and is encapsulated with then selectively use early binding tech­ the use of inheritance. You can create connect and disconnect methods. niques to speed up critical code by descendant classes that build on the You can implement the connect eliminating the message send overhead. functionality already found in the sys­ method (see Figure 4) as addOutputs and With the proper use of early binding in tem. addinputs messages since both the nodes critical areas, you can improve perfor­ For example, the OrderedCollection must know about the connection that is mance by 25 to 30%. class mentioned earlier descends from made. These two steps could easily have the Array class. Similarly, you can create been done in the connect method, but by The Project Manager Classes descendants of classes like Window and having each node manage its own in­ Once you're sure the generic Network Dialog to build the user interface to this stance variables, you can deal with net­ and Node classes are working properly, application without having to know the works made up of other networks. you can define the Project, Activity, and more than 400 Microsoft Windows func­ The setPosn method is another ex­ other classes listed in Figure 2. tion calls. Descendant classes automati­ ample of private protocol. I use this The Project class will descend directly cally include much of the generic win­ method to update the onscreen position from the Network class and include ad­ dowing behavior that users expect in a of the node and I wrote the disconnect ditional functionality related to the ap­ Windows application. method in a similar fashion. plication. For example, you need to be Inheritance lets us reuse code when able to recalculate the critical path of the something is "a little different" from an Interactive Tools project. object that already exists. For example, I Once you've defined the network and The Activity class is a formal class defined the classes Network and Node to node classes, you can create a network that will group behavior common be­ provide generic network connection and examine it to make sure it's as you tween its descendants Milestone and capabilities. You can create a new net­ expect. Actor encourages an interactive Task. You won't ever create Activities work, connect some nodes to it, discon­ programming style and has a rich set of themselves (except for testing), instead nect nodes and so on. tools to make it easy to test and debug they'll always be either a Milestone or a This may not be very exciting, but it code one piece at a time. Task. lets us factor out part of the application, If any runtime errors show up, a Alternatively, you could have had test it, and then forget about it. Since source code debugger will pop up Task descend from Milestone, but you'd

20 MICRO CORNUCOPIA, #44, Nov-Dec 1988 ICTIONARY

A Dictionary is a collection of data pairs, much like an English language dictionary is a collection of term/defi­ nition pairs. The "term" entry is the key and the "definition" entry is the value of the pair, or association.

A Dictionary functions like a single-key database. This is how you create an object of class Dictionary with room for two key/value pairs:

Workerl .- new(Dictionary, 2);

Next fill the dictionary with strings as keys like "Name" and "Age" and the corresponding values, the string "Sam Jones" and the integer 22. You are free to mix data types.

Workerl["Name"] "Sam Jones"; Workerl["Age"] 22;

Like a database, an Actor dictionary grows when you add to it more entries than you originally specified. Below, the dictionary grows from 2 to 4 as you add two more entries, or pairs:

Workerl["Department"] #Engineering; Workerl ["Reviews"] . - #(85 73 98 94 100);

Mixing data types allows great flexibility. You can even incorporate the above dictionary, Workerl, as a value in an entry of another dictionary, as in Employees below:

Employees . - new (Dictionary, 10) ; Employees ["Sam"] .- Workerl;

Access the data in a dictionary by specifying the appropriate keys. The following statement returns the array #(85 73 98 100):

AWorkersReview Employees ["Sam"] ["Reviews"];

You can also retrieve data from dictionaries by enumerating over the dictionary and extracting particular entries. Here is how to create a separate "database" of employees working in the Engineering department:

Engineers .- extract(Employees, {using(employee) employee["Department"] #Engineering});

Another feature allows you to create a new database incorporating only a subset of the original's data. You do it . by enumerating over a dictionary and collecting particular data about every entry:

MailingList collect(Employees, {using(employee) employee["Address"] });

Dictionary objects are available in Actor as ready-made units of functionality. They can be modified or special­ ized for any application. However, as programmers, you are never involved in a dictionary's physical implemen­ tation or memory management.

Technical Specifications

•Runs with Microsoft Windows l .x, 2.0 and 386. •AI support: frames, symbols, dictionaries, lists, •Pure, single-inheritance object-oriented language, symbolic programming, functional arguments. incrementally compiled. Parsing and lexical analysis YACC compatible. •Dynamic linking to C, Pascal, Assembler, or Fortran • String manipulation: substring, concat, append, libraries. Pass data in C structures. insert, remove, search. •Pascal and C-like syntax. • 643-page manual includes tutorial and reference. •Programming tools: Browser, Inspector, Debugger, •No license fees. Generates stand-alone applications. File Editor. •Fastest interactive OOL available. •Full access to MS-Windows systems calls, multi­ tasking, and DDE. Prices •Fast device-independent graphics: lines, shapes, icons, cursors, bitmaps, metafiles, Turtle graphics, Actor $495 • Academic $99 • Academic site license sample control language using YACC. $99 •Manuals for site license $35 • New! Language • 150 classes, 1500 functions, fully extensible. Extension I $99 •Shipping $5 US, $25 lnt'l • Window styles: tiled, overlapping, popup, child, edit, Tech Support: Level 1 (20 phone calls) $100 • Level 2 dialogs. Controls: list boxes, scroll bars, buttons, (Developer's package) $250 check boxes. Training Courses: 201 Intro. to Actor and OOP (2 • Data structures: stacks, arrays, queues, lists, days) $395 • 202 Actor Developer's Workshop (3 days) dictionaries, sets, sorting, hashing, intervals. $795 • 203 Both 201 and 202 (1 week) $995

Reader Service Number 116 MICRO CORNUCOPIA, #44, Nov-Dec 1988 21 then inherit inappropriate behavior (cer­ tainly not good!). Figure 5 - The Class Diagram. Similarly, you could define a class called PERTiask that descends from Task that uses the Project Evaluation and Object Review Technique (PERT) for estimating time. The only methods you'd have to write would be those related to calculat­ ing time; everything else would be in­ Windows Network Resource herited. Object By using inheritance you reduce the amount of code you need to write and the amount of testing. Once a method is Window Project written for the Activity class, you know it will work for any descendant classes. Figure 5 shows a class tree of the classes Proj­ Milestone Task Window in the application. Note that all classes descend from the Object class. PERTTask The Recak Algorithm The user can set automatic recalcula­ tion to recalculate the critical path any time a change is made; or alternatively he or she can turn off automatic recal­ culation, make several changes, and then Figure 6 -The Critical Path Recalculation Algorithm. recalculate the entire network. The critical path recalc algorithm must Network class methods: make two passes: a forward pass, recalcl, /* Recalculate the entire network. Invalidate all nodes used to compute the earlyStart times of so that a full recalc will be forced. Then do both the activities; a backward pass, recalc2, com­ forward and backwards recalc passes. The forward pass must be completed before doing the backwards pass. */ putes the lateFinish time and the slack. Def recalc(self) When an activity's time changes, it sends { invalidate(start, new(Set,10)); /*clear all nodes*/ a recalcl message forward to all of its cost := 0; /* recalc cost */ recalcl(start, true, true); /*force entire recalc */ outputs, who send it to their outputs, recalc2(self); /*backwards pass*/ and so on. Like today's popular spreadsheets, the /* Do the backwards pass only starting from the end node. project manager uses a minimal recalc al­ The end node is always critical. */ gorithm so that only parts of the project Def recalc2(self) { recalc2(end); that actually change are recalculated. end.critical := true; The recalcl message is only passed on if the earlyStart or time changes, other­ Activity class methods: wise the outputs don't need to be recal­ culated. /* Recalculate the network from this node onwards. Figure 6 shows the critical path recal­ This requires forcing a forward recalcl and a backwards recalc2 from the end of the net. */ culation algorithm. Def recalc(self) { recalcl(self,true,nil); /*force forward recalcl */ Windows Objects recalc2(network); /*do backwards recalc2 */ Of course, it'd be nice to have pulldown menus and graphic displays of /*Recalculate an activity's earlyStart. If the user has set an earlyStart, use it instead of recalculating. the results. Since Actor is a Microsoft Send a message to the node's outputs to recalculate only Windows development environment, if a forced recalc is required, or if earlyStart changes. these are easy. formula: ES= max(ES(i) + time(i)) for all inputs i Microsoft Windows is already some­ what object-oriented. When the user arguments: timeChanged: force a recalcl if the time has changed clicks on the mouse or presses a key, MS­ costRequired: force a calcCost(self) if true Windows will send a message to the ap­ *I propriate window. Because of the object­ Def recalcl(self, timeChanged, costRequired loldEarlyStart) { if (costRequired) oriented approach, programming calcCost(self); Microsoft Windows is much easier in endif; Actor than in a procedural language like oldEarlyStart := earlyStart; /* temporary */ C. Actor has predefined classes for win­ dows, dialog boxes, scroll bars, etc. if (userEarlyStart) /* user over ride */ You'll define a new window class, earlyStart := userEarlyStart; called ProjWindow, which inherits the continued on page 24

22 MICRO CORNUCOPIA, #44, Nov-Dec 1988 It's Our Ob· ective To Keep You riented Get the latest insights and developments in Smalltalk, C+ + ,

Coupling an Expert Designing Active Objects: Objective C, Eiffel, LISP, System Shell with Reusable An Access Oriented an Object- Oriented Classes Framework for Database System Object- Oriented and Simula. Languages Innovative and applicable-tracks and evaluates the latest advances in this methodology. Featuring: Incisive peer-reviewed articles on: • problem solving techniques • reusable OOP components • latest languages • applications in artificial intelligence • software maintenance • program testing Info-packed articles written by the best known researchers and premier software developers. Here's a sampling: "Using Objects to Package User Interface Functionality'' (7 "Designing Reusable Classes" Order toll free days a week) 1-800-345-8112 ...... "Active Objects, An Access Oriented Framework for Object-Oriented Languages'' D 1 year (6 issues) $49 "Encapsulation, Reusability and Extensibility in D 2 years (12 issues) $89 Object-Oriented Programming Languages'' Outside the U.S. add $24/yr air service. Check enclosed D Bill Me D Get unbiased product reviews and up-to-the­ JOOP Charge my: VISA D Mastercard D minute product news. And personal interviews with the world's top programmers. Card# ______Exp. Date ______Written for software developers, programmers, engineers and computer scientists. Get original re­ Signature ______search that's definitive, authoritative and applica­ Your Name ______ble. Get objective coverage that's enlightening, re­ Company ______liable and functional. Subscribe today! Address ______THE JOURNAL OF City ______OBJECT-ORIENTED State ______Zip ______PROGRAMMING Mail to: JOOP, 310 Madison Avenue, Suite 503, New York, NY 10017, or send for a sample copy. 1 88 '-················································--···-----·- MICRO CORNUCOPIA, #44, Nov-Dec 1988 23 "default" behavior needed in Windows project to select particular activities, edit applications. Note that ProjWindow and them, recalculate the critical path and so Project are unrelated in the class tree. on. ProjWindow does not descend from Project since it's not project-like. Rather, a Conclusion ProjWindow simply contains a project Object-oriented programming en­ object as an instance variable. courages the creation of abstract data ob­ By having two distinct classes, you jects with a well-defined public protocol clearly separate the user interface issues and a private implementation. The result from the recalculating of the critical path is a program that's easier to develop and handled by the project and its activities. maintain. This makes it easy to have different types The project manager is a good of windows display projects in different demonstration of object-oriented prin­ ways. ciples put into action. And with its ProjWindow can display a network graphics, fast recalculation, file load and diagram of the activities while a Gantt­ save capabilities, it's downright useful. Window will display a time line graph known as a Gantt chart. In both cases, the windows will send messages to the • • • Finally - Affordable Intelligence.

Continued from page 22

TINY EINSTEIN else earlyStart := O; /* find largest ES */ The Expert System Shell do(inputs, {using(input) earlyStart := max(earlyStart, • Create your own expert getEarlyStart(input) + getTime(input)); systems in minutes. } ) ; endif; • With pulldown menus /* Recalculate outputs if earlyStart changed OR if time and windows changed. Don't force it to beyond the next level. */

• Context-sensitive if timeChanged or (earlyStart <> oldEarlyStart) do (outputs, • Free example expert systems {using(output) recalcl(output, nil, costRequired); } ) ; • Tutorial endif; • Interactive full-screen /*Recalculate an activity's lateFinish then its slack and determine if its critical. If the user has set a lateFinish, use it instead of • DOS access from shell recalculating. LateFinish recalc goes backwards from a node to its inputs. Always propogate recalc2 since a • Turbo Fast execution change to the time of a node will not change lateFinish, but it can change slack and critical, which are only • Cluster, Trace, Explain known on the backwards pass. • For Diagnosing . formula: LF = min(LF(i) - time(i)) for all outputs i *I Simulating ... Def recalc2(self) Predicting .. { if userLateFinish Planning .. . lateFinish := userLateFinish; /* user override */ Classifying .. . else lateFinish := MAXINT; /* find smallest LF */ Training ... do(outputs, and Monitoring systems. {using(output) lateFinish := min(lateFinish, getLateFinish(output) - getTime(output)); }); Only $49.95! (Plus $5 S/H) endif; Reader Service Number 72 calcSlack(self); calcCritical(self); Designed & implemented by Gary Entsminger & Larry Fogg /* Continue sending the recalc2 message. */

do (inputs, {using(input) recalc2(input); });

ACQUIRED INTELLIGENCE /***/ P 0 BOX 2091 • OAVIS, CA 95617 • 19161 753-4704

24 MICRO CORNUCOPIA, #44, Nov-Dec 1988 KOALA COMPUTER, INC.

213-316-5866 9 to 6 PST M - Sat

30-Day Money Back Guarantee Software sales are final except replacement of defective media. Merchandise must be undamaged for full refund.

!! VGA!! ATI VIP card and VGA Professional Color Monitor - $648 Analog 13" anti-reflective, non-interlaced, flicker free, .31 dot pitch monitor with an ATI improved VIP video card. 800x560 drivers for ACAD, Windows, GEM, and Ventura Publisher included. VGA, EGA, CGA, MDA, HGA selectable. Up to 256 colors on screen at one time with VIP card. 37 lb.

11 1h"x 147/a" Greenbar Paper with Carbon Paper - 45 lb. $15 2 part 1500 sets, 4 part 700 sets. Two holes punched for binders. Case approximately 45 pounds. Send self-addressed stamped envelope for free sample.

SUPERIOR XT* STYLE KEYBOARD for the TYPIST - $25 Replacement XT* style keyboard with LED in Num Lock and Cap Lock keys. Manufactured by CHERRY. Complete with coil cord and plug ready to slip into your case. Our service department uses these when possible instead of repairing the old one as most people appreciate the nice feel of these made In USA CHERRY keyboards. 2 lb.

MONOCHROME DISPLAY ADAPTER with PARALLEL PORT - $35 Japanese mfg. board. This is the MDA that can be plugged in with a CGA (Color Graphics Adapter) at the same time. 2 lb.

384K EXPANSION WITH 10 and RAM - $139 Parallel, serial, game, clock calendar, and 384K of memory installed and tested. $139 3 lb.

NO SCREWDRIVER REQUIRED PARALLEL PRINTER CABLE - $10 - $16 - $20 Not the cheap ones but the 0825 with the knurled fastener. 6 foot $10 one lb., 10 foot $16 two lb., 15 foot $20 3 lb.

The COMPLETE DBase* SYSTEM for the SMALL BUSINESS - $4 DBase* command code and operational instructions are contained in this excellent 335 page 8%"x 11" book DBase APPLICATIONS in BUSINESS 2 lb.

SURGE SUPPRESSOR 6 OUTLET POWER STRIP with EMl/RFI FILTEA - $15 Full 3 line protection in normal and common modes. Noise filter helps protect against noise interference. "Push to reset" circuit breaker protects against overloads. 6 foot 14/3 SJT power cord. On/Off switch. Continuous surge protection for your valuable electronic equipment. UL listed. 3 lb.

TERMS - Cashiers check, immediate shipment-All others must clear. No COD. Prices FOB Torrance, CA. Call us and give your ZIP code and we will quote freight charges. California residents add 6112% sales tax. Add $2 handling to orders under $25.

KOALA COMPUTERS INC. 4306 Torrance Boulevard, Torrance, California 90503 (Offices only) CALL 213-316-5866 9 to 6 PST M-SAT

*XT trademark IBM, DOS - Microsoft, DBase - Ashton Tate Reader Service Number 88 MICRO CORNUCOPIA, #44, Nov-Dec 1988 25 Thinking Objectively A Biological Approach To Designing Neural Networks

good understanding of the idea of object. How can tissue remember (recognize) Computers are dumb. Right? They only For the past three years, we've been objects if it hasn't stored data? do what you tell them. Right? Even expert building systems that use conventional Good question. When remembered systems boil down to a list of rules, and and electronic technology to explore (in stimuli appear at the input of neural tis­ that's about as fancy as computers can get. depth) the idea of the object. The results sue, the tissue responds, that is, it deter­ Right? are encouraging. mines whether it knows (has ex­ Wrong. (You knew I'd say that.) We believe that a better under­ perienced) the stimulus. If Doug and Arthur are correct, we'll standing of what the object is will In other words, if the tissue has ex­ just teach computers how to learn and then remove a longstanding roadblock in the perienced a stimulus or group of stimuli turn them loose. In no time at all, they'll be transition from fixed design methods before, it can experience it again. See the experts. All by themselves. Mankind can (e.g., expert systems) to the development Figure 1. go back to manual labor. of truly automatic learning technologies. In this article we'll present some of Animal Leaming the fundamental concepts involved with There are many animals, some very ur minds have the (as vet) object recognition and some general ap­ complex, that appear to learn little (or machine-unsimulatable ability to proaches to implementation. nothing) in their short lifetimes. The Omake sense out of noise. We can highly stereotyped responses of many in­ distinguish individual (and often subtle) Who Teaches? sects fall into this category. How do these meaning out of a cacophony of sounds. Many traditional neural networks can animals acquire their useful behaviors? Imagine a symphony. You not only learn to recognize stimuli - but these When we realize that life, in general, hear the orchestra (as a whole), but also networks must be told what they're is a learning system, we realize that the distinguish many of the individual in­ learning. We do this by telling the net­ design of these insects (their genetic struments. You can even hear people work to learn when the desired stimuli makeup) was learned through repeated whispering in the audience or the siren are present. In other words, we teach the testing and gradual improvement. The of an emergency vehicle outside. network. result is similar to a well-tested expert You differentiate among sounds al­ We decide what the network will system that's been given the necessary though they occur simultaneously, have learn by placing chosen stimuli (objects) complexity to be successful. overlapping frequencies, and are input in nonconflicting scenes, and directing But many animals (like people) seem through only two analog channels - the network to respond when it recog­ to learn throughout their lifetimes. They your ears. In your mind, different sounds nizes a particular set of stimuli. Is this absorb knowledge of an extremely com­ represent different "objects." how animals learn? plex real world and automatically adjust The ability to recognize objects is es­ We don't think so. Although you to deal with it. It's known that we have sential for high-level intelligence and might argue that animals learn about over 10,000,000,000,000 neural synapses must precede, to some degree, any high­ danger from their parents or from their and only about 100,000 genes, or level association of meaning. genes, it seems more likely that the developmental instructions, to encode If a squirrel, for example, repeatedly world, itself, contains the clues needed these connections. sees a cat and learns that the cat is by animals to group information. So far, It's obvious that these are far too few dangerous, it first recognizes the cat as a neural nets have not tried to automatical­ genes to supply enough information for separate object in the real world. Then it ly extract this information. the design of such high-level order. The associates the object, cat, with danger. genes, nevertheless, provide the neces­ The recognition step is essential. Seen It Before; See It Again sary framework to get learning under Without it the squirrel would have no Most of us make the erroneous as­ way, although most of the complexity of quick way of associating danger - sumption that neural tissue "takes in" life is acquired (learned) thereafter danger would be entwined with an in­ data, puts it somewhere, remembers through experience. finite number of real world stimuli. The where to retrieve it, and reproduces the As the designers of artificial intel­ learning of objects is fundamental to in­ data intact. Conventional computers ligence systems, we might consider a telligent organisms. And it's of equal im­ operate this way, but neural tissue similar approach. A fixed design would portance in the design of intelligent doesn't. It neither stores input data nor work in many simpler cases, but we'd machines. Despite this, we don't have a needs to! have trouble deliberately designing-in the

26 MICRO CORNUCOPIA, #44, Nov-Dec 1988 By Doug Gaffin & Arthur Gaffin Dept' of Zoology N euro Dynamics Oregon State U. 1514 Canna Court Corvallis, OR 97331 Mt. View, CA 94043

complexity of a high-level intelligent sys­ cal sense - they don't provide im­ (3) The more proximate the observa­ tem. A modified form of mammalian in­ mediate absolute associations. These ob­ tion, the more important the relationship. telligence may actually be the best ap­ servations are simple and very impor­ (4) The more frequent the observation, proach. If we design and build the tant. They give intelligent animals the the more important the relationship. framework, the rest of the system can be ability to gradually develop a correct and (5) Most events in nature are con­ self-learned. complex model (not a copy) of nature. tinuous. For example: If an object is The forces of weak association are - detected at one moment, it is likely to The Forces Of Weak Association (1) If a stimulus is similar to another remain present for an extended period. Within real world experiences, there stimulus, not necessarily occurring at the are relationships between events that same time, then the associated events in The All-Important Object provide hooks for learning. We call these nature are likely to be related. Let's look at the concept of an object relationships "the forces of weak associa­ (2) If two or more stimuli are in more detail. Suppose we show Rob, tion." repeatedly encountered proximate with our robot, a coffee cup that's resting on a The term weak is used because these each other, in terms of time and/or table. We want Rob to learn to recognize relationships are useful only in a statisti- space, the events are likely to be related. coffee cups. To make this task more in­ teresting, assume that the cup casts a shadow. If Rob is to learn what a coffee cup Figure 1-Simple Leaming looks like, he must learn where the cup ends and the table begins. And he must LEARNING: recognize that the shadow isn't part of the table. NO How do we recognize shadows, cups, CJ) ~ :c>----~o J ) RESPONSE and tables? By learning their intrinsic qualities during many experiences of cup, table, shadow. • We see the cup in different locations • and circumstances on the table. We ob­ LEARNING:• serve the stimuli that relate to the cup, say the handle, to be more frequently RESPONSE with the rest of the cup. And we observe FOR CUBE stimuli that more frequently relate to the table, cup or no cup. The shadow is real­ ly no different; we observe it most fre­ quently with the cup. Therefore, the shadow eventually becomes part of the cup object. RECOGNITION: With this in mind, let's define an ob­ RESPONSE ject - FOR CUBE An object occurs when certain pat­ terns of stimuli repeat themselves, in a manner that's similar, in terms of time and/ or space, with a frequency of repeti­ tion that is, on the average, relatively RECOGNITION: high. NO Or, more simply - ~ p------...0 J ) RESPONSE An object occurs when two or more 0 stimuli are observed repeatedly together. The real world is ordered (we order it!)

MICRO CORNUCOPIA, #44, Nov-Dec 1988 27 through a multitude of associations. Ob­ combinations of stimuli. We also The events that are learned by this jects represent the embodiment of this program it to respond uniquely to each piece of tissue are objects. The organism order - forming the basis of fundamen­ of these learned patterns of stimuli. takes the world for what it is and extracts tal associations. This is a high frequency filter - information from it to build its model. emerging responses correspond only An infant in its first days of visual ex­ Objects Yield Hierarchies of Knowledge with frequently occurring events at the periences can't physically alter its visible Suppose we have a piece of neural tis­ input. Infrequent events aren't remem­ world, except for the direction and sue and we program it (give it the bered and, therefore, aren't passed to the quality of view. The initial flow of data is ability) to learn and recognize frequent output as responses. largely one-way, from the real world to the infant. The most frequent of these patterns of Figure 2 - Hierarchies stimuli will be learned first and these will consist of small relationships that repeat themselves frequently - long edges, comers, basic shading patterns, types of blobs, etc. The next level of learning will be in terms of these low-level features. Since the input stimuli of the next level are the responses from the first level, the next level sees its real world through the fil­ ters of the first level. HIGH-LEVEL RESPONSE A third level may be added in the same manner, and so on. With many levels, very general and complex objects can be learned and recognized. See Figure 2.

Tricks Of Tissue How can we design a simple, fast, and self-adjusting mechanism that automatically learns to sort out the most frequent stimuli? Let's look at a piece of tissue at one level in the hierarchy. How DBASE TM for Norton Guides™ can it remember to recognize only stimuli INTRO PRICE that are frequently observed and there­ $69.00 fore important? DBASE ON LINE is a "pop-up" DBASE language reference system Studies suggest that neural tissue which includes over 2 million bytes of complete reference with clear employs temporary memory in the concise descriptions, and detailed examples to every command function synapses (points of connection between and feature for: neurons). These synapses are eventually CLIPPER™ (Summer '87) QUICKSILVERTM(Diamond Release) converted to permanent memory if dBASE III Plus™ dBXLTM(Diamond Release) repeatedly reinforced. Some studies also dBASEIV™ FoxBASE+TM suggest that neural growth may be af­ fected by the level of activity the neuron. Also, the growth of some neurons DBASE ON LINE is powered by the Norton Guides "reference engine": seems to be affected by the activity of ad­ Memory requirements: maximum 65k. Can run in resident or pass-through memory mode. jacent neural processes. It's therefore pos­ Can be "popped-up" any time, inside any program. sible that neurons may be selectively Automatically looks up a keyword read from the screen. Full or half-screen display. seeking other neurons with high levels of All available Norton language guides will run under the Norton "reference engine". firing activity with which to form con­ Also included is a compiler and linker, allowing the creation of your own reference guides. Additional Features: nections (synapses). Tables - keyboard return codes, line drawing characters, color codes, error codes, Uninvolved neural processes can be ASCII chart and much more. The Clipper and Quicksilver guides also include commands and switches for the compile/link allowed to forget by remaining uncon­ cycle, a table of reserved words and complete reference to the extend system. nected, being routed around (overwrit­ ten) and, in certain cases, atrophying. ORDER: DBASE ON LINE and get the above language guides, a reference engine, a reference guide compiler/linker and manual. Biological systems have developed other 30 Day Money Back Guarantee • Satisfaction Guaranteed tricks as well to selectively filter only the To order, call or write: most frequent of stimuli. SofSolutions 440 Quentin Dr.• San Antonio, TX 78201 • (512) 735-0746 Trick 1: Crowding Trademarks: Norton Guides/Peter Norton Computing, dBASE/Ashton Tate, Clipper/Nantucket, dBXL Qu1cks1lver/Wordtech Systems. FoxBASE+/Fox Software By simply "crowding" the tissue, we can create a competition for synapses. Less frequent stimuli will be reinforced

Reader Service Number 108 28 MICRO CORNUCOPIA, #44, Nov-Dec 1988 less often and tend to become over­ synapses. It also causes active ideas in Now that we understand why we powered. See Figure 3. that tissue to choose addresses (synapses) need these inhibitory synapses, we can Crowding gives neural tissue a that are as unique as possible for use as select whichever techniques work. It's simple, automatic mechanism to reduce memory. Animal tissue, therefore, has important to note that we don't need to the complexity of real world data - it implemented a clever, fault-tolerant ad­ use the massively parallel approach once reduces the data to the most important dressing scheme that works even if some we understand what problem these tis­ (frequent) events and responds only to of the tissue is damaged. sue features are solving. these. The next level can repeat the process using the output of the previous level, thereby automatically creating or­ Figure 3 - Crowding derly hierarchies.

Trick 2: Inhibitory Synapses Studies have shown that the connec­ ----C> tions (synapses) between neurons are in­ ------iC> hibitory as well as stimulating by nature. When neural activity of inhibitory ----C> neurons reaches one of the places where two neurons touch, the pre-synaptic ----C> neuron inhibits activity in the post­ ----C> synaptic neuron. Since one neuron may contact as many as 10,000 other neurons, we can see that many neurons may be silenced CROWDING is useful for learning and recognizing only the more important patterns of stimuli. (or at least partly silenced). This Note that the pathwidth set of possible values of the input stimulus is greater than that of the response, phenomenon can implement crowding thereby forcing a net reduction of the incoming data. even when there are more than enough

A Powerful Procedural, Database, and Declarative Language.

SPEED - \Vhere Prolog must backtrack, Trilogy can A TRUE COMPILER - Trilogy is an interactive often solve the problem logically. Trilogy takes advan­ compiler which produces native code for the 8086/8087. tage of logic constraints (they constrain the search to LOGICAL PURITY - Trilogy was designed from possible solutions) which either eliminate backtracking scratch as a simple language with a completely logical or reduce millions of backtracks to a very few. foundation. Trilogy's speed results from its design, not SYNTAX - Trilogy uses an intuitive, Pascal-like, pro­ from added commands. (Prolog's assert, cut, var, and gram structure. retract, are not logical parts of that language. They INTEGRATION - Trilogy is complete. It's the only were added to improve performance.) language you need for writing Pascal-style routines, DATABASE SUPPORT - Trilogy supports: varia­ database handlers, and Prolog-style programs. ble size records, records with arbitrary values (lists, re­ MODULARITY - Trilogy is modular language, very cursive trees); plus record insertion, deletion, and modif­ similar to Modula-2. ication. (Anywhere in the file.) Files are relations and ENVIRONMENT - A complete programming envi­ can be queried from within the language. ronment, you get editor, library, linker, loader, error PRICE- Only $99.95 postpaid, U.S. funds. Plus $5.00 handling, automatic make, and contextual help. Plus, shipping & handling. Or $12.00 shipping & handling you get modules for: math, string handling, file manipu­ outside North America. Check, money order or lation, windows ... VISA accepted.

Order COMPLETE 741 Blueridge Ave. From: LOGIC North Vancouver BC Canada V7R 2J5 SYSTEMS (604) 986-3234

Reader Service Number 71 MICRO CORNUCOPIA, #44, Nov-Dec 1988 29 Trick 3: Winners Tire not readdress previously learned points. If you look at Necker's cube for 30 The neuron is ingeniously designed to seconds (see Figure 4), it appears to flip Figure 4- Necker's Cube provide an operational solution to this back-and-forth between two opposing in­ problem. A neuron consists of the follow­ terpretations (ideas). We can speculate ing computational components: that the winning idea eventually fatigues • input processes - dendrite(s) and, therefore, allows the second one to • decision mechanism - soma win. output processes - axon(s) Eventually that one fatigues, and the • inter-neuron connections - synapses first idea wins again, and so on. Since the first idea is still partially fatigued from The neuron provides a very rich set of the first time, it will fatigue more quickly computational ingredients: this time. The flip rate eventually settles • COMPLEX INPUT system - in­ at about two times per second which is puts through the dendrites which directly related to our neural fatigue provide a wide pathwidth of data. rates. NECKER'S CUBE is an optical illusion that • SUMMATION of the inputs as Fatigue is neural tissue's form of a do illustrates your neural tissue in action. When received by the central neuron loop - it provides a foolproof way of looked at for 30 seconds, the image will appear body, the soma. trying many alternative ideas before to flip back and forth between two different • DIGIT AL DECISION system, in repeating the original one. It implements recognitions. the soma, which acts somewhat a tissue-level checkoff list that automati­ like an analog to digital converter cally moves from one idea to another. - it acts as a democratic element Given a multi-level hierarchy with which fires only if enough inputs Figure 5 - Two out of Three feedback at different levels, we can see (votes) are present. Rule that a search through combinations of • DIGIT AL OUTPUT system which ideas can be very complex and would fires and sends out an action never exactly repeat itself. It's likely that potential through the axon. the subconscious mind uses some of • COMMUNICATION system in these mechanisms - it would help ex­ @ which the axon contacts many plain why it takes a long time for some DENDRITES other dendrite processes of other answers to pop into our mind. neurons. Fatigue adds a self-adjusting quality ®-- • MEMORY that is contained in the to the system and causes it to perform connection strengths of the synap­ better in a complex world. It also keeps ©--- ses (the inter-neuron contacts). the system from getting stuck in infinite • LEARNING which is the process feedback loops. by which the connection strengths Since slowly changing stimuli tend to The neuron acts as a digital reduction and the locations of the synapses fatigue the associated paths, rapidly device. A simplified model could be a device are formed. changing stimuli will have a competitive that fires an action potential through the axon • RECOGNITION when the system advantage - therefore fatigue created a whenever at least 2 out of the 3 possible is excited by inputs and fires a bias towards changing stimuli. We can dendrites are active. digital output. call this "tissue-level curiosity," the tissue The neuron can receive many com­ actually gets bored with old information binations of possible stimulus inputs and responds better to dynamic situa­ which represent a fairly large white Figure 6 - Conflicting Images. tions. space. The output (axon), however, is bi­ nary (digital) - fire or no-fire. Trick 4: The Axon Note that the neuron is functioning as The real world provides an abun­ a data REDUCTION device. By making dance of data, in fact so much data that 0 decisions, the data is simplified and the same exact set of stimuli or scene is reduced by the action of the neuron. This never observed (experienced) more than process keeps the white-space of the data once. We know that similar scenes are at any point in the neural tissue within observed repeatedly, but the data in operation bounds. See Figure 5. these similar scenes usually does not have many pixels of information that are the Trick 5: Feedback same. How, then, are these scenes Some optical illusions show that the similar? same picture (stimuli) can provide alter­ Let's consider a stimulus as a number nate interpretations. See Figure 6. which represents a point in a special The drawing above should at first look like Some important points are listed highly multi-dimensioned space called, a DUCK. The drawing can also look like a below: for lack of a better term, white space. RABBIT. Note that after the high-level idea of • Some illusions display alternate This white space needs to be vast enough rabbit is thought of, all of the low-level features interpretations where only one to represent a rich repertoire of stimuli, are immediately converted to those of a rabbit. can be visualized at a time - in but not so vast that incoming stimuli can- other words, they compete.

30 MICRO CORNUCOPIA, #44, Nov-Dec 1988 • Many of the supporting low-level features are interpreted in concert Figure 7 - Conflicting Images suggest Feedback with the overall interpretation. • When the overall interpretation changes, these low-level features change also. CROV«>ING SPACIALL Y DEFINED: CROWDING ON What is the usefulness of this HIGHER LEVEL: mechanism? PRE-FEEDBACK: WITH HIGH-LEVEL • By the context of the overall inter­ FEEDBACK: pretation, lower-level features can be more easily recognized, espe­ cially if the stimuli is difficult to interpret. • If lower-level features were al­ lowed to resolve totally on their own, they would seldom con­ clude a useful high-level recogni­ tion. • Fatigue, ordinarily a very useful mechanism, would make matters CONFLICTING IMAGES suggest FEEDBACK: The set of black difficult - the low-level recogni­ dots shows two different images of circular patterns-but both can­ tions would flip back-and-forth not be seen at the same time. The model shown above suggests one with little contribution to deter­ • • • possible configuration of recognizers (neural tissue) that promotes mining a valid high-level recogni­ • • • • similar conflicting recognitions. Small combinations of dots form sub­ tion. See Figure 7. • • • sections (arcs) of the circles, but, due to high-level feedback, the arcs The subject of feedback extends far are interpreted according to the context of the high-level idea (one beyond the purposes discussed here - circle or the other. it's likely to be involved in nearly all neural processes in one form or another. The mechanism discussed here is fairly simple and easy to implement. In fact, we have implemented it in . The complete source code (and user­ friendly .EXE) is available on the Micro C RBBS and from the authors. dBASE Ill+ 20 TIMES FASTER!! Summary "What a difference! No more watiting for output while I could Electronic technology is moving for­ have been processing other data. ward at an extremely rapid rate, provid­ It's great!" V. Kovacs ing unprecedented computational power Penn Services for the money. We now have more tools than ever for building neural network dBASE III + Enhancment utility "I'm using it in every new system. I based systems. As expected, the level of write. Super for creating test data public and private interest in neural in­ from large files. It's fast, easy to use, and follows d.BASE syntax.• telligence is increasing dramatically. FAST: With our new understanding of Up to 20 times faster than dBASE. W. H. Whitney McGraw Hill, Inc. automatic learning, we are now ready to In one case, report generation on a 60,000 remove major roadblocks to our record file was reduced from 18 hours to 2 hours! progress. By designing-in the ability to COPY DELETE FLEXIBLE: I Commands I APPEND RECALL learn complex objects within complex Call from a program file or DOS prompt. REPLACE COUNT hierarchies, we delegate most of the Run on a stand alone PC or a network. MANY MORE learning to the system - thereby making EASY: dBASE-like syntax - No need to learn our job much easier. LTRIM[] UPPER(] another language. Functions I TRIM(] SUBSTR[] COMPATIBLE: • • • Recognizes and creates dBASE III+ files. . . Transfer DBF data to DAT files for use with other languages (Basic, Pascal, etc.)

Introductory Offer IJ;ll FOR ADDITIONAL INFORMATION CALL: (215) 536-5858 $99.00 (lll C:ompu\eriaect Processing Un• 'mi\ed Offer ends 12/31/88 Country Square Shopping Center Quakertown, Pa. 18951

Reader Service Number 105 MICRO CORNUCOPIA, #44, Nov-Dec 1988 31 Building MicroCad: Design With C++

I'll go into this more later. But C++ actually saves me here, since Okay, objectively, C++ might be inter­ Each of these user-defined (or all the low-level stuff is encapsulated - esting, but what can you do with it that you derived) data types is a class, the key fea­ you can fix my flubs without changing can't do just as easily with C? Bruce's ture which makes C++ more than just "a the structure of the program. MicroCad is a good example. It lets you better C." create and manipulate graphics (objects). I'd like to illustrate these features by 00 & C++ (This is the fourth in this issues trilogy of building a miniature CAD program Before getting into the core of the object-oriented articles.) (MicroCad) which lets you draw, code, I want to say a few things about manipulate, and delete shapes. object-oriented programming in general, We'll create a generic base type called and C++ in particular. efore I introduce my tiny graphics CADSHAPE, and from it derive CIRCLE, A pure way to think about object­ program, MicroCad, I'd like to SQUARE and LINE. oriented programming (or 00) is that it Bdescribe object-oriented program- Each derived type will know how to consists of simply "sending messages to ming. Three key features make a lan­ do some things, such as draw and delete objects." This is the Smalltalk view: you guage object-oriented - itself. So you can create a list of tell an object what to do, and it knows or (1) abstract data typing, data encap­ CADSHAPEs and then step through the figures out how. sulation, or data hiding. list telling each type (or shape) to draw In C ++, the objects are structures and (2) type derivation or inheritance. itself. the messages are member functions. (3) commonality, polymorphism or, You declare each C ++ class (user­ (in C ++) virtual functions. Zortech C++ defined type) in its own header file (with The first feature says you can create Before I go into the details of Micro­ an extension of ".hpp"). A class declara­ your own data types, with internal data Cad, I want to briefly mention the C++ tion consists of data elements and decla­ and external operations. For example, system I'm using for this example. rations of so-called member functions you can create a complex number (a Zortech currently markets my C++ of which can be invoked on instances (ob­ type) which contains a real and an imagi­ choice. It's a $99 native-code compiler jects) of the class. nary part. written by Walter Bright (who created Small functions may be declared in­ The C++ compiler will know how to C). line in the header file (more about that deal with this new type's real and imagi­ I became involved with this project later). nary parts (which are effectively hidden), back in the beta-test stage, wrote the in­ Unless all the member functions are just as it knows how to handle the hid­ troductory C ++ chapters in the manual, declared in-line, a class usually has a file den exponent, mantissa, and sign parts of and now am a technical support consult­ of code (with an extension of ".cpp") a floating-point number. ant. (In other words, I'm taking money where all the member functions are Your new complex type looks virtual­ from them so my opinions are tainted.) defined. This file is compiled into an ob­ ly no different to the compiler than a The Zortech C ++ package includes a ject module (not to be confused with "ob­ built-in type like double. C compiler, an integrated editing en­ jects," which are instances of a class - The second feature, inheritance, says vironment, a librarian, a nice make ugh, what a syntactic mess). you can derive a new data type from an facility, along with mouse, graphics and C++ programming at the top level old one (called ''base"), instead of build­ standard C libraries. consists of simply including all the ing new types from scratch every time. You invoke the compiler with "ZTC header files for the classes you want to The new data type is an old one with filename," and it figures out from the file use, declaring instances of those classes some additions and/ or modifications. extension whether to use C++, C, or the (objects) just like you would declare in­ The parts of the old data type that work, assembler. tegers or floating-point numbers, calling you leave alone. Just change what you MicroCad requires Zortech C++ be­ member functions for the objects, and need to. cause I'm using their mouse and linking in the object modules. I've il­ Feature three says you can control a graphics libraries. Those of you who are lustrated this in Figure 1. The main() derived data type through its base. This graphics and mouse pros, bear with me routine simply manipulates objects. is very powerful, but takes some getting - I've never messed with these things used to, since there's no equivalent in before, so I may do things which seem A Classy Lingo conventional programming languages. appallingly stupid. The main feature which makes C++

32 MICRO CORNUCOPIA, #44, Nov-Dec 1988 By Bruce Eckel Eisys Consulting 1009 N. 36th Street Seattle, WA 98103

Figure 1 -Main MicroCad Code Copyright 1988 Bruce Eckel Permission required to distribute source

II file: microcad.cpp II store via "new" and add it I* The main driver program for the CAD system. II to the list: This includes all the other types I've defined, list.insert(new circle(x,y}}; declares some instances, and makes them dance break; around. *I case SQUARE: #include list.insert(new square(x,y}}; #include break; #include case LINE: #include list.insert(new line(x,y)); II flash graphics declarations: break; #include case MOVE: II (All items starting with "fg" are from mouse.cross cursor(); II the flash graphics library) mouse.wait_left_Pressed(&x,&y); #include II you can declare a variable at #include "msmenu.hpp" II Figure 2 II the point of use: #include "circle.hpp" II Figure 5 cadshape * mv; list.nearest(x,y); #include "square.hpp" II Figure 7 II (I think nearest() needs work). #include "line .hpp" 11 Figure 9 II object pointers use arrows #include "shapelst.hpp" II Figure 11 II for de-referencing members: mv->erase(); II pick it up II associate unique integers with the following: mouse.wait left released(&x,&y}; enum { CIRCLE, SQUARE, LINE, MOVE, DELETE, }; mouse.translate-coords(&x,&y); mv->move(x,y); 71 put it down struct menu s my menu[} = { mouse.default cursor(); " circle"-;- CIRCLE, break; - " square", SQUARE, case DELETE: " line", LINE, mouse.cross cursor(); ,, move 0 , MOVE, mouse.wait_left_Pressed(&x,&y); " delete", DELETE, mouse.translate coords(&x,&y);

" exit", li:X!T T cadshape *rm =-list.nearest(x,y); HO f -1 I* end marker *I :rm->erase O; } ; list.remove(rm); II free the memory created w/ new: delete rm; main() { mouse.default cursor(); unsigned x, y; break; - int quit= 0; II flag case EXIT: int result; quit++; shapelist list; break; if (fg init all () == FG NULL) { default: fputs ("Unable to open-graphics device. \n", break; stderr); exit (l); } fg_term(); II back to text mode II create an msmenu and attach our menu: msmenu mouse(my_menu); l***I while (!quit) { II look for right button press: if (msm getstatus(&x,&y) & 2) { II get a menu selection: result= mouse.get selection(x,y); II change from mouse to fg coords: mouse.translate_coords(&x,&y}; switch(result) { case CIRCLE: II create an object on the free

MICRO CORNUCOPIA, #44, Nov-Dec 1988 33 Figure 2-Square Shape Declaration Copyright 1988 Bruce Eckel Permission required to distribute source

II file: square.hpp #ifndef SQUARE_HPP #define SQUARE HPP #include #include "cadshape.hpp"

class square : public cadshape fg box t small_box; pul:>li"c: - void draw(); square(unsigned x, unsigned y) () { x center = x; y center = y; draw(); -

void erase(); ~square() { erase(); } ; #endif SQUARE_HPP l***I

Figure 3 - cadshape Declaration Copyright 1988 Bruce Eckel Permission required to distribute source

II file: cadshape.hpp I* A polymorphic base class for all. shapes. Almost all functions are virtual, so they can be redefined in derived classes. Then we can make a list of shapes and draw() each shape in the list without knowing exactly what it is. *I #ifndef CADSHAPE HPP #define CADSHAPE-HPP class cadshape {- protected: unsigned x_center, y_center; public: II virtual functions must have SOME II definition in the base class, even II if it's just empty: virtual Ncadshape() {} virtual void draw{} {} virtual void erase() {} void move(unsigned new_x, unsigned new_y ) { x_center = new_x; y center = new_y; draw(); JI call proper virtual function

unsigned long range( unsigned xr, unsigned yr } { II a measure of distance between a II selected point and this object's center unsigned long xx = xr > x_center ? xr - x center : x center - xr; II (teinary if-th;n-else} unsigned long yy = yr > y_center ? yr - y_center : y_center - yr; xx*= xx; yy "'"" yy; II delta x squared+ delta y squared: return xx + yy;

}; #endif CADSHAPE_HPP I***/

34 MICRO CORNUCOPIA, #44, Nov-Dec 1988 more than just "a better C" is the class. are defined using the virtual keyword. Defining a class means making a new Any function can be defined in a base data type which the compiler treats as if class and redefined in an inherited class. it were a built-in type (enforcing the An object of an inherited class can be proper syntax rules). treated as an object of the base class - if Each class contains hidden informa­ you use a pointer to an inherited class tion (usually data, but may include func­ object for calling a function in the base tions, which are only available to mem­ class, everything works fine, except you ber functions of the class), and public in­ can only call the base class function this formation (usually member functions, way. but may include data). A virtual function, on the other hand, This separation between public and allows you to call the proper function for private elements is called "data hiding" an inherited class via a pointer of the and is controlled by the "public" base class type. keyword. The public member functions The MicroCad program has a virtual define the interface to the class. function called draw in the cadshape Figure 2 is a small declaration for one base class. Cadshape is inherited into of the shapes manipulated by the CAD circle, square and line, each of which has system. In it you can see some private a different way of drawing itself. data (a structure from the Zortech flash What we want to do is manipulate a graphics package) and some public list of shapes and thus not have to worry member functions. about how to draw them, erase them, etc. Classes may be inherited from other Virtual functions allow this - they call classes simply by mentioning the name the correct draw() function at run-time of the base class. In Figure 2, "class regardless of whether the shape is a square : public cadshape" means square circle, square, line or some new type of is inherited from cadshape, so it shape you've just added. automatically contains all of cadshape' s data structure and member functions. Virtual Function Operation The "public" keyword means that the Normal C++ member function calls end user will have access to all of are resolved by the compiler, which cadshape's public parts (otherwise only knows the specific member function at square could use them). compile time and simply makes a call to ,..------,I Please send me: In the ".cpp" code files, you'll see the absolute address of that function. In D Modula-2 Compiler Pack (DOS)$ 99.00 member function names with the class this case, the size of the object is simply D Modula-2 Toolkit (DOS) $ 169.00 D Modula-2 Development $ 249.00 name followed by the "::" scope-resolu­ the size of the structure to hold all the System (DOS, includes tion operator. This tells the compiler that data elements you've defined. Compiler and Toolkit) it isn't an ordinary function; it's a mem­ If, however, you declare any member D Modula OS/2 $ 349.00 ber function for the class. function(s) to be virtual, an extra pointer D Modula-2 VAX/VMS version $2,500.00 Generally, each class contains a con­ is secretly added to the structure by the Shipping & Handling (per item) $ 6.50 CA residents add applicable structor (a function with the same name compiler (to see this, try taking the sizeof sales tax $ __ as the class) and a destructor (the class an object with and without virtual func­ Total $ __ name with a tilde). The constructor is tions). The pointer is the address of a D Check/money order included automatically called by the compiler to table of function pointers - all the ad­ D Visa D MasterCard perform initialization when an object is dresses of the virtual functions. Card Number Exp. Date declared, and the destructor is automati­ When we use virtual functions, the cally called to clean things up when the address of the virtual function table is Cardholder Name object goes out of scope. bound to the object AT RUN TIME. Calls Authorized Signature to member functions are resolved by de­ Ship to: Virtually Anything ... referencing the virtual function table, also Name There are two reasons to use in­ at run time (although proper function Address heritance. The most obvious is that you call syntax is still enforced by the com­ don't want to reinvent the wheel - you piler). This way, you can manipulate City State just want to use most of the features in a pointers to a polymorphic base class; the Zip Phone Offer valid in U.S. Only Dealer inquiries welcome. class that someone else has already writ­ correct member functions are always Educational prices available. CL988 ten and tested. This is the reusable code called. Send to: concept. To use virtual functions, you must The second reason for inheritance is to pass pointers rather than the objects ~ LOGITECH implement polymorphism, which is why themselves. You cannot say that an object Logitech, Inc. I've used it here. Figure 3 shows a decla­ of a derived class is actually a base class Attn: Coupon Redemption Program 6505 Kaiser Drive, Fremont, CA 94555 ...J ration for the cadshape class, a base class object, but you can say that a derived L for all the shapes used in the MicroCad class pointer is a base class pointer. ------program. This is because a derived object is Notice that almost all the functions usually larger than the base class it was

MICRO CO~l\J"UCOPIA, #44, Nov-Dec 1988 35 derived from (you usually add data ele­ ments when a class is inherited). You Figure 4 - The shapelist Class cannot simply treat it as a base class ob­ Copyright 1988 Bruce Eckel ject since the wrong size would be Permission required to distribute source passed around. Pointers to objects are all the same size, so they can be passed around anonymously. II file: shapelst.hpp The of fetching member ele­ I* Two classes to manaqe a list of cadshapes. A shapelist contains a list of (what else) ments given a structure (struc­ shapelist_elements, which simply hold ture.data_element) and given a structure a cadshape and a link to the next element. The usual linked list stuff: pointer (structure_pointer->data_ele­ you can insert, step through, etc. */ ment) extends to member functions (ob­ #ifnde£ SHAPELST HPP ject.function() and object_pointer->func­ #define SHAPELST-HPP #include "cadshape.hpp" tion()). It sometimes helps if you remem­ ber that an object is just a structure. II tell the compiler the class exists: In Figure 1, you can see examples of class shapelist; the use of virtual functions in the MOVE class shapelist element { and DELETE cases. cadshape * shp; shapelist element * next; public: - Inline II allow shapelist access to the I've used a fair amount of inline code II private elements of this class: friend shapelist; in the examples; this helps reduce the shapelist_element(cadshape * s, space required to print the program in shapelist element * hd) { the magazine. Inline code is placed in the shp = s7 next = hd; compiler's symbol table, however (except when a function contains flow control - } ; in this case the compiler secretly makes it class shapelist { a non-inline function). shapelist element * head, * current; If the compiler runs out of memory, public: - shapelist{) { current = head = try changing inline functions to ordinary new shapelist element( (e.g., static) functions. (cadshape-*) O, (shapelist_element *) 0); Inline code has its advantages, allow­ } II end of list marked by null pointers void insert(cadshape * s) { ing you to (1) access private members of shapelist element * p = a class, and (2) perform a repetitive new shapelist eiement(s, head}; group of statements with a more mean­ head "" p; - ingful function name, both without the void reset() { current= head; } overhead of a function call. cadshape *next(); void remove(cadshape * s); But you should be aware that an in­ II hunt th.rough the list and find the line function is distinctly different from a II nearest element to x,y: normal function definition. No code is cadshape * nearest(unsigned x, unsigned y); } ; generated when the in-line function is defined; the code is inserted directly #endif SHAPELST_HPP whenever you call the function. I***/ Parameters aren't pushed and there's no assembly-language "call," which saves time. But the code is duplicated every place the inline function is called. space on the "free store." This is called manages a linked list of cadshapes. This That means your program can take up a "dynamic memory allocation," and is ac­ linked list is yet another class called lot more space if you write big inlines complished in plain C via library func­ shapelist, which manipulates cadshape and call them a lot. tions (malloc(), free() and variations on holder objects called shapelist_elements those names). (see Figure 4). There are shapelist mem­ Dynamic Memory Allocation In C++, dynamic memory allocation ber functions to insert a new shape, Ordinarily, the size of an object and was too important to be left to a library remove a shape, step through the list, the number of objects needed are known function, so it was incorporated into the and hunt for the shape nearest a pair of at compile time. Sometimes, however, core of the language via the keywords coordinates. you don't know how big something is "new" and "delete" (to free the space al­ (i.e., a matrix) or how many of something located with "new"). The "new" Left As An Exercise ... you need (i.e., shapes in a cad system) keyword is used in Figure 1 in cases I've created the framework for the until run time. CIRCLE, SQUARE and LINE. The program. Here are some features you When the compiler knows how big or "delete" keyword is used in case might want to add: how many, it can automatically place ob­ DELETE. • Create an object to hold coor­ jects on the stack. If size or number can't dinates. This (instead of the x,y be known until run time, you have to Linked Lists pair I use) can be passed between figure it out in the program and allocate The MicroCad program (Figure 1) just member functions to convert from

36 MICRO CORNUCOPIA, #44, Nov-Dec 1988 mouse to flash graphics coor­ dinates and back. • Stretchable objects, with dashed CITIZEN MATE/12 286 SYSTEM lines to indicate size. • Dashed outlines when an object is 80286 With 12.5 MHz Clock Speed being moved. has on the Mother Board: • Create a super-shape which holds ONE Meg RAM with 1 Wait State any number of other shapes al­ Video Controller Supports EEGA, EGA lowing the user to create new CGA, MGA, Hercules and composite shapes. Storage and Plantronics Color Plus retrieval of these shape libraries. Controller Provides Support for • A method to translate a shape outline into some independent Two Hard Drives and Two Floppy graphics representation, which Drives, 5.25 and 3.5 Capability can be sent through filters to Mouse, Parallel and Two Serial Ports generate output for PostScript, Epson, etc. 1.2 Meg Floppy Installed • The mouse menu should be 32k Hard Drive Cache Installed created as a simple graphics block 101 Enhanced Keyboard and painted onto the screen (in­ MS-DOS 3.3 With GWBASIC stead of drawing it character by Small Footprint character, as I've done here). This Standard lMB Expandable to 4MB would be much faster. Novelle Compatible Building MicroCad Nation Wide Service The Micro C RBBS contains the com­ plete MicroCad program (all the code ********************************$1669.00 shown here, several other listings, and a XT CLONE SYSTEMS makefile). Once you have Zortech C ++ installed, simply un-archive the code in PLEASE CALL FOR CURRENT PRICE its own directory and type "make." HARD DRIVES FOR XT AND AT Next Time ST-225 KIT FOR XT (20 MEG) $ 259.00 In the next issue I'll be looking at real ST-238 KIT FOR XT (RLL 30 MEG) $ 279.00 CAD systems for designing and laying ST-251 FOR AT (40 MEG) $ 359.00 out printed circuit boards. Editor's Note: Bruce often refers to ar­ MONITORS ticles in previous issues. You can get a book Color Monitor RGB (CGA) $ 255.00 of all his hardware articles, Computer Inter­ Color Monitor RGB (EGA) $ 355.00 facing with Pascal & C, plus a disk includ­ Monochrome TTL (Green) $ 95.00 ing the source code and numerous other ex­ amples, by sending a check for $30 (plus Monochrome TTL (Amber) $ 105.00 8.1 % Washington State sales tax) to: Eisys, EGA Color Video Card $ 129.00 1009 N. 36th Street, Seattle, WA 98103. Bruce is also putting together a library of public domain C++ source code. The disks CITIZEN PRINTERS are available directly from Bruce at the above MODEL 120D 120 CPS 9" $ 179.00 address. MODEL 180D 180 CPS 9" $ 199.00 MODEL MSP-15E 160 CPS 15" $ 359.00 • • • MODEL MSP-40 240 CPS 9" $ 319.00 MODEL MSP-45 240 CPS 15" $ 439.00 MODEL MSP-50 300 CPS 9" $ 419.00 MODEL MSP-55 300 CPS 15" $ 499.00

CASCADE ELECTRONICS, INC. ROUTE 1 BOX 8 RANDOLPH, MN 55065 507-645-7997

Please ADD Shipping on all Orders COD Add $3.00 Credit Cards ADD 5% MN Add 6% Sales Tax Subject to change

Reader Service Number 15 MICRO CORNUCOPIA, #44, Nov-Dec 1988 37 Hercules Graphics Printer Dump

Printer Setup pins in the print head. It makes sense to There sure isn't much privacy at Micro Want to print characters? No problem. use just eight pins since the printer can C. Where else could someone assign a You throw text to the printer like meat to only accept a byte at a time. Each pin programming project and have it an­ a dog. The printer chews away for a prints a 1 /72" dot, so 8 pins means ... nounced to the world. (Of course it is in C. while and out come the characters on 8/72". "Hello World") paper. (The dog's output is slightly dif­ ferent, although it does resemble some of Grabbing A Screen the printer output I've generated.) The next job involves reading video h, SOG. I had high hopes for this Graphics output doesn't present much memory. I'm not going to rehash the one. You see, after spending a more of a challenge. confusion of video addressing on the Ayear with more article ideas than I First off, we need to initialize the Herc card. Take a look at "A Hercules could shake a stick at, I'd come up with printer. pm_setup (see Figure 1) sends Primer" in Micro C issue #39 for the a blank. Nothing. At least nothing I out an ESC '@'. This sets the printer to details of how get_line works. Notice the could beat into a useful piece. But cer­ most of its power-on defaults. The car­ unary one's compliment operator(-). We tainly SOG would change that. What riage return sets up the print head for the need to invert the image since "on" better place to harvest a few topics for first line of output. Otherwise printing video pixels show up light, but "on" the coming year? could easily start in the middle of a line. printer elements are dark. Unfortunately, while vastly stimulat­ The last line of pm_setup sets line Printing the screen sideways on paper ing and amusing, SOG left me feeling feeds to 8/72". These printers have nine has two advantages: The image fits, and brain-dead. Still no ideas. No problem though- Unca Dave came to the rescue. Figure 1 - Hercules Graphics Screen Dump Functions Necessity Is The Mother ... Lately, Dave's been dragging his be­ void prn out (unsigned char X) { - hind in a little lower than usual. It's those _ox = O; /* specify first parallel printer */ late night, early morning bouts with The _AL = X; Program. (Has something to do with _AH= 0; I* service 0 - byte out */ geni.nterrupt (Ox17); /* printer interrupt */ airplanes. I suppose that's why it crashes I* prn_out */ so much.) So I was more than happy to help out when he said he needed a way void prn_setup () to dump a Hercules graphics screen to { printer. Now, I'm normally a staunch ad­ prn out (27); prn out (109); prn_out (0);/*standard mode, Pan*/ prn-out (27); pm-out ('@'); /*reset printer*/ vocate of the quick and dirty school of prn-out (13); - /* carriage return */ programming. But, for Dave, I decided to prn-out (27); pm out ('A'); prn_out ($); /*set 8/72 LF */ compromise my morals this time and just /*-pm_setup */ - be quick. I had three printers to play with: void get li.ne (int li.ne_num, unsigned char buffer (348]} Gemini-lOX, Citizen 120-D, and { - int col; Panasonic KX P1595. Parallel printers of the clone world live in something ap­ for (col=O; co1<348; col++) buffer [col] = -peekb (OxbOOO, Ox2000 * (col % 4) + proaching harmony. Escape sequences 90 * (col I 4) + line_num); /*get video byte*/ used for programming show an amazing I* get_line */ amount of compatibility. Armed with that knowledge, I developed the code on void setup gr li.ne {int width) my trusty 10-X, fully expecting it to run { -- with all three printers. prn_out (27); prn_out (75); I* set 60 dpi */ It almost worked out that way. prn out (width% 256); I* these 2 lines set# graphics ... *I prn:out (width I 256); /* ... chars to be sent*/ /* setup_gr_line */

38 MICRO CORNUCOPIA, #44, Nov-Dec 1988 By Larry Fogg Micro C Staff

the coding is simpler. So get_line reads which means it'll take two parameters to eight columns of the screen to create program more than 256 characters. That eight lines on the printer. The terminol­ explains the modulo and integer division ogy gets a little strange here since video Parallel printers of in setup_gr_line. Think of these two rows are printer columns. Think of turn­ parameters as a two-digit, base 256 num­ ing your monitor over on its right side. the clone world live in ber. Now it's easy to see that we should start Once we're done programming and printing with the bottom row of the first something approach­ we start sending the actual graphics data, column on the screen. each of the 8-bit characters fires the eight Editor's note: But don't leave your ing harmony. Interest­ pins in a combination determined by the monitor on its side, that would make the character's binary value. Each set bit fires printed image come out upside down. ingly, escape a pin, with the most significant bit con­ trolling the top pin. For example, Printing Graphics sequences used for 111 lOOOOb activates the top four pins. It's time to fire off the line of graphics. Once print_line has printed the con­ setup_gr_line programs the printer to ac­ programming are tents of buffer (going backwards, remem­ cept a number of graphic characters ber we want to start printing with the equal to the parameter, width. We can surprisingly similar. bottom of each video column), it ends only give the printer a byte at a time, with a line feed. Up until now, the printer was just filling its buffer, not printing. The linefeed triggers the actual Continued from previous page printing. void print blank (int width) I added the print_blank function in { - order to center the printer output. It inti; simply prints some number of blank setup_¢:.-Hne (width): characters with no linefeed. The next for (i:;:(); iut (O); /*print bl.anks and hold print head position*/ /* pdnt--blank */ where the blanks end, and blanks and graphics print as a single line. voi(i pl;'intline (unsigned char buffer {348]) One line done, it remains to do the { - rest. Since each '1ine" actually contains int i; eight video columns and the Herc has print_blank (60) : 720 columns, that means we have a total setup gr line (348); of 720/8, or 90 lines to print. for (i=3"i7; i>=O; i--) /* print line in buffer, backwards */ prn out (buffer {i}); dump_screen does 'em. prn c;;;;'t (10); I* line feed */ } /*_.print_Une *I So We're Done, Right? Pretty straightforward stuff. I put it all void dump screen () together and it worked. Sort of. Once in a { - while a line feed missed the boat. The inti; char line_buf [348}; /*holds a column of video bytes */ following line printed off the right mar­ gin. Nasty business. prn setup (); /*ready the printer*/ £or-(i,,,,.O; i<90; i++) /* print each of the 90 video columns */ After much cursing and wailing, I { reached the conclusion that one of the ~et_line (i, line_buf); graphics characters was not printing. So print_line (line_buf); } the line feed at the end of that graphics /* dump_screen */ line was seen as the last graphics charac­ ter. No more line feed, and two graphics lines would fill the buffer before we

MICRO CORNUCOPIA, #44, Nov-Dec 1988 39 printed a line. port over the phone so it's always fun to the right mode (standard, or Epson com­ I printed a line of each character and, be on the other end. After three days of patible), and has no effect on the other lo and behold, it was AZ (lah). What busy signals I finally got a real live two printers. gives? The printer doesn't care what byte Panasonic technoperson. I described my it receives. No one's doing any filtering. problem and he asked if I'd set the mode Other Modes Or are they? DIP switches correctly. I chose the low resolution mode for Time to look at prn_out. It just sends a two reasons. First, it's commonly avail­ byte to the printer. In its first, semi-suc­ able. Most all of the mainstream printers cessful incarnation, it looked like this - support it. And you want your programs to run on as many systems as possible. #define PRN_OUT(X) putc(X,stdprn) I sent my newly Second, for a simple screen dump, we've already matched the resolution of putc just didn't like AZ. I don't know debugged program the Hercules screen. There's no need to what happened. C is a stream oriented get into the higher resolution printer language and AZ can be used to sub­ home with Dave. It modes. One of these modes deserves stitute for garbled characters in a trans­ mention, though. mission. But it shouldn't have reduced the ran perfectly on his The Panasonic and the Citizen sup­ total number of graphics characters sent. port a 72 dots per inch (dpi) mode, Whatever the reason, putc would not Citizen. I hauled it which gives you a one to one aspect ratio reliably send AZ to the printer. Using the on the printer. That doesn't mean the printer interrupt and Turbo C's handy back to try on Cary's print out will more closely resemble the register variables for pm_out solved the screen. (The standard density, 60 dpi problem. Panasonic - and mode is a wee bit squashed. 72 dpi By the way, if it hadn't been for the would be flatter still.) It does mean that fractal I used testing the screen dump watched it auger into you can send a square to the printer with code, I probably never would have found 100 dots per side, and it'll be a true this bug. With something as wild as a the antistatic rug in square on paper. plot of the Mandelbrot set, you're almost guaranteed to print each of the 256 pos­ flames. We're Done sible graphics characters. And some of These should be fairly useful and you thought fractals were useless. portable (between printers) functions. As Shame! Great. I waited three days for some usual, I haven't prettied up the code at clown to tell me nothing. Of course I all. If you want to protect your program We're Really Done, Right? checked the DIP settings. But I was nice from brain damaged users who won't Wrong. I sent my newly debugged anyway. And, just to humor him, I tum on the printer, you'll just have to do program home with Dave. It ran perfect­ rechecked the DIP switches. You guessed it yourself. ly on his Citizen. I hauled it back to try it, he was right. Never, ever, doubt the Let's see, what else would be fun? Six­ on Cary's Panasonic - and watched it word of your tech support person. They teen color EGA dumps? Four color auger into the antistatic rug in flames. always tell the truth and they're never printers aren't uncommon. If we grouped It wouldn't let me control the size of wrong. four slightly overlapping dots together to the linefeeds. And, while line feeding too Editor's cautionary note: check for the red represent each EGA pixel ... Wouldn't be far creates an interesting zebra-like S on the cape before assuming anything. You that hard to do. Maybe I'll look into it. Or screen dump, it wasn't quite what I had can do it from your phone booth. perhaps I'll just go on vacation. Yeah, in mind. Editor's note: does make fractals The Panasonic reads its DIPs on that's the ticket. look better. Finally, in desperation, I called power up, but you can reprogram the Panasonic's technical help line. mode at any time. Hence the first line of I do a fair amount of technical sup- pm_setup. It bumps the Panasonic into • • •

40 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Great tor the Experimenter! RS-232 ~:::t~- BREAKOUT BOX * Dual Conversion Superhet 450 MHz Pioneer Laser Disc Player * Crystal Controlled Receiver Module (Plug-In I) ed from service These units were remov •ooVAC from Twenty-Char. Alpha-Numeric LED They run on • for upgra des. Wh.le they * Display (ASCII Encoded, ANSI Char Set) RCA CDP 1802 Based . supplied 120Vki~C adsoa~=r~ay ~ave minor ld be wor ng, : Peizoelectric "Beeper" Unit s h o U t II them on an problems ~ we mus se V1brat1ng "As- ls" basis. • "Silent" Alert $ 9. 9 5 eac • 1-2 mW He-Ne Laser Tube Untested - "As-ls" $1 7hgo5r two for • • Laser Power Supply • 2 Front Surface Mi~rors • Two 112 .. Voice coil Actuated Oscillating Mirrors • One Beam Splitter • Two Optical Lenses • One Optical Detector * Mini Gear Reduction M~tor * All Controlling Electronics . • Assorted Switches, Fan, Solenoid THESE UNIATSCAORME ~J~:1c°a°~{~6'~~R REQUIRE (NOT AVAILABLE FROM HSC). THEY CANNOT BE MANUALLY CONTROLLED\ $ 9 9 •0 0

Mitsumi UVEX-AW51 p COMPUTER CHASSIS with POWER SUPPLY UHF I VHF These attractive system chassis were manufactured by Televideo for the TS806/20 ~-C'-- ~ Computer System. They are brand new and VARACTOR HALF HEIGHT EXTERNAL include the following features: DRIVE ENCLOSURE * Heavy Duty Plastic Case TUNER * Attractive Low Profile C * 17'' x 17" x 8" O.D. * 3 1/2" x 2" x 1/2" • 19" x 15" x 3" 0 D ase * Hinged Drive Mounting Assembly tor : Fits nicely direcily.under PC 2 Floppy Drives and 1 Internal Hard Drive * Pinout on Case Standard IBM Colors * +5+12 -12 Power Supply *Bezel fits One 5 .. and * I EC Receptacle, Power Switch 114 One 3 1/2" Drive Qill.'( • Fan $69 00 NEW! IN ORIGINAL BOX! • ~~~ $17.95 $29.95

ENGINEERING! • TEST! • DEVELOPMENT! AT/XT 3-SLOT . OELTEC TEAC FD-558 AC LINE CONDITIONER MOTHERBOARD 400 WATT DISK DRIVE · nt " Ideal tor you PC or An~ E qu1pme EXTENDER * 5 l /4" * Fused Extender Card " Eliminates AC Line Noise and * One 16 Bit Slot Regulates to a Constant 120VAC * IBM COMPATIBLE *Two 8 Bit Slots " Reliable Ferroresonant Transformer * 360K * Test Points for All Bus Points " Attractive Case with Power Cord, * 90-DAY WARRANTY * Power Connector Outlets, and Switch/Circuit Breaker * Cables Included * Not an Expansion Chassis! $149.00 $89.95 $89.95 300W, 2500W' 5000W also available HSC of Santa Clara WE SHIP C.O.D.! 3500 Ryder Street

HSC of Sacramento HSC of Santa Rosa Santa Clara, CA 95051 5549 St. 6819 Redwood Drive Sacramento, CA 94928 Cotati, CA 95841 (916) 338-2545 (707) 792-2277 Call g~;;,::r~ia 800-4-HA L RSC Since '63! Now! ~=~j~~n~fs 408-732-1573 TERMS: "'4nimJm order $10. Calilomia Residenls add 7% sales tax. Prepaid Olders senl lreight C.O.D. or cal tor cllarges. Shippino will be added to credit card and C.O.D. ordeni. S2 Handling charge on orders less lhan $25. Prepaid orders over $100 use """'"II order or cermecl cllec:k. Please no not send cash. Sorm ~ ...... lirrited to stod< on hand. Prices subjed to cllange. Reader Service !\umber 11 MICRO COR.t'\JUCOPIA, #44, Nov-Dec 1988 41 The Peripheral Technology PT68K-2 A Hacker's 68000 System

The Ideal Hobby Computer of such things as keyboards, enclosures, Usually I look a bit askance at articles I wanted performance. That means a and power supplies represent incredible that are this effusive. I have yet to meet a modern, fast 16 or 32-bit CPU. Lots of bargains of price/performance. That's prince who doesn't have a few (remaining) programmers prefer the 68000 architec­ one thing that's kept me away from the warts. However, Jack's enthusiasm for this ture. Its instruction set is simple and ra­ other 68000 systems. Even though their board reminds me of my early feelings tional, a logical successor to the ZSO. mainboard may be cheap, the price for toward the Big Board. And, as you'll see, I wanted lots of fast RAM, serial and the whole system (power supply, ter­ he's very aware of the warts. parallel ports, floppy and hard drives, minal, etc.) is pretty steep. clocks, memory mapped video ... The PT68K-2 is designed around the And, naturally, the hardware should PC, right down to the cable connectors. 've got a new toy, and I love it! It's be hackable, which means an expansion Plus it's got a PC bus, which accepts any the PT68K-2 from Peripheral Technol­ bus. (Too bad I couldn't use the IBM bus PC-compatible I/O boards. Iogy, and it's the computer I've been with all the incredibly cheap I/0.) The standard OS is SK*DOS, from searching for for years. It's cheap, It must be cheap and, perhaps, build­ Peter Stark of Star-K Software Systems. powerful, fast, and fun to use. It's the able in modules. For a one-man and relatively new OS, perfect hobbyist's system. Perhaps more What about the software? Nothing SK*DOS is surprisingly mature, and important, it's here, and it's real. fancy here ... the operating system (OS) quite bulletproof. For the skim-readers among you, the and tools should be simple enough for That's because it's a clone of Flex, a PT68K-2 is a new personal computer, tar­ one human to understand and customize popular 6809 OS, and Peter has been geted to the hobbyist, and built around in one lifetime. The software, too, must working with Flex for many years. To a Motorola's 68000. The essential details be cheap. Flex user, SK*DOS will seem like an old are given in the Figure 1. Above all, the hardware and software friend. To the rest of us ... As you can see, it's a serious com­ should be rational. There's no point invit­ Peter also supplies HUMBUG, the puter, with the performance of a hot AT ing frustration by having to deal with ir­ ROM monitor, and utility software. clone. But statistics alone don't explain rational designs. (That leaves out most of It's my understanding that the PT68K- why I'm so excited. The reason requires a the more popular computers!) 2 is the result of a collaboration between little history. Now, since this is a hobby computer, Peter and Frederic, and I think this better put a debug monitor in ROM. And shows in the integration of the package. A Little History there should be some consideration for I'm a computer professional. For more reliability and testing built in. Putting It Together years than I care to think about, I've been The PT68K-2 motherboard holds lMB getting paid to work with computers. The PT68K-2 of RAM, so no RAM board is needed (or Sometimes it's fun, sometimes it's not. There are a number of reasonably accepted . . . the bus is only good for When I'm at work, I write software the priced 68000-based computers. The Mus­ I/0). Also on the motherboard are the way my bosses want me to, in the lan­ tang-OS and -020 from Data-, the 4K static RAM, four (count 'em) serial guages they want me to, to solve the QT series from Frank Hogg Labs, and the ports, two parallel ports (one of which is problems they want solved. Marion Systems MS68K come to mind. Centronics compatible), and a floppy I don't have much to say about the Closer to home, Micro C has supported disk controller. operating systems or the tools, so I'm efforts to build a 68K-based public The minimum kit is $200. You don't forced to be a closet hobbyist. When I'm domain system and has run several ar­ get much of a computer for this - no at home, I take a busman's holiday. That ticles on Joe Bartel's Tiny Giant from dynamic RAM, and no floppy controller. way I can use the computer and software Hawthorne Technology. But it's a computer. of my choice to do the things I want to However, my list of needs describes Add a terminal and power supply, do. the PT68K-2. Frederic Brown of and you're running with HUMBUG in In that sense, I probably have a lot in Peripheral Technology must have been ROM and 4K of static RAM. The ROM common with the hot rodder or the radio reading my mind when he designed this even includes a BASIC interpreter. It's amateur. Many of you are also hard core board. got to be one of the cheapest 68K systems hobbyists, or you wouldn't be reading Like it or not, the PC phenomenon around! Micro C. has given us cheap hardware. The prices Add another $200 for 512K of

42 MICRO CORNUCOPIA, #44, Nov-Dec 1988 By Jack W. Crenshaw, Ph.D. 1220 E. Idlewild Ave. Tampa, FL 33604

dynamic RAM and a flop­ testing to a much lower py controller, or get a com­ level. (Peter's most plete kit including 10 MHz elaborate piece of test CPU for $575. The same equipment is an LED, motherboard, assembled borrowed temporarily and tested with lMB of 10 from the front panel.) MHz, zero-wait-state RAM, I won't detail the and SK*DOS goes for $849. whole process here, but But the PT68K doesn't I'll give you the general end with the motherboard. idea. Since the LED is The PC bus gives you easy used for testing, it goes expandability. Instead of in first. Then it's used to hooking up a terminal, you test the processor sup­ can plug in a PC-com­ port circuits such as the patible video card ($50 system clock. The idea is from Peripheral Technol­ to get the CPU running ogy), a monitor, and a PC as soon as possible so it keyboard. can take over the test­ Finally, if you want a ing. really serious system, add a I figured that you'd standard Winchester con- A PT68K-2 Motherboard. have to have some pret­ troller card and hard disk. ty elaborate software in I opted for the full-house system, It's been that way on everything I've ROM to handle the tests. Not always. which cost me a total of $1,422, including tried. It's so boring ... nothing to work Peter uses a trick that requires no enclosure, power supply, AT-style on! It's bulletproof. software at all! He just straps the data keyboard, CRT, and two floppies. (Prices For the record, I also ordered an AT lines to ground so the processor sees a have since gone up.) I pirated a 20MB clone from a very reputable company at constant 0000. hard disk from my Kaypro. the same time (around Christmas) as the After the CPU executes 0000, it incre­ To anyone who has ever assembled a PT68K-2. The PT68K-2 arrived within ten ments the (to, of course, PC clone, putting the PT68K-L. together is days, and was running in two more. I.t fetch the 0000 from the next address). old hat. Even if you've never assembled took me three months to get the AT Thus, all the address lines get toggled. another system, putting the PT68K together and running, plus additional By checking the address lines with the together is a piece of cake. Everything time and phone calls to get it set up. LED, you can verify that the CPU is just bolts into place and the cables snap working. (The address lines become together. In an hour you have a system. Design For Testability square waves which you can use to test Though I bought mine assembled and the rest of the circuit.) Firing It Up tested rather than in kit form, I really ap­ Once the CPU is running, you install I fired it up with just the CRT control­ preciate diagnostics. and check the memory decode logic. The ler and CRT to verify that I had a My old Altair taught me that a multi­ ROM and static RAM go in next, and at prompt. meter isn't enough! You can equip a this point you have a computer. Next I added the keyboard so I could laboratory with all the test equipment The whole process is incredibly slick, run HUMBUG. Everything looked fine, needed to debug a wayward computer. and I'm kinda sorry I ordered my system so I hooked up the floppy drives (just ran It's apparent that Frederic and Peter assembled. I really missed a lot of fun. a cable from the motherboard to the remember those days, too. One of the Incidentally, there's a neat little aside drives) and booted SK*DOS. Simple. beauties of their design is the progressive to this story. The literature on the PT68K- Adding the hard drive was just as way you put the kit together. 2 describes a real-time clock, but I found easy. I just typed HDFORMAT, followed The whole idea of the static RAM and neither clock chip nor battery. the menu prompts, and bingo, it ran per­ a ROM debugger is that you don't need After the system was up and running, fectly. much to start testing. But they've taken I came across a command in SK*DOS

MICRO CORNUCOPIA, #44, Nov-Dec 1988 43 called "TIME." I figured, what the heck. I almost fell out of my chair when the PT68K-2 calmly reported the correct date and time. Not only was there a clock, but it already knew the time. It turns out that Frederic uses a single­ chip clock with a built-in battery. The clock has the same pinout as the 6116 static RAM chips (and the clock chip con­ tains RAM, too). You just pull one of the 6116s and replace it with the clock. The software spots the clock and you've got time. Even better, when the clock chip is in place, the 2K of RAM on that chip is bat­ tery-backed-up so HUMBUG uses that RAM to store system configuration info.

My Hardware Problem Now for my one hardware problem. My copy of MicroEMACS would oc­ casionally go to lunch, and at first I as­ sumed it was a software problem. However, it turned out that they'd PT68K-2 put a 12.5 MHz clock crystal in my 10 MHz. I'll go in and change the 12.5 to 10 Two Versions Of C MHz system. Fortunately, they put two MHz when I get around to it, but for For $10 Peripheral Technology will crystals on the motherboard so a single now I'm doing fine at 8. send you a sampling of the SK*OOS jumper change slowed me down to 8 User's Group library including: a Small C The Software compiler, three (!) editors, an nroff clone, A computer without software is about and many other goodies. as useful as a car without wheels. What Also, Sidney Thompson, president of about the software? the User's Group, and Bud Pass are just SK*OOS reminds me of CP /M. It's finishing a full K & R version of C. (I modular, consisting of a BIOS, command have a beta test copy.) Sidney also sent processor, and file system. There is essen­ me the copy of MicroEMACS, developed tially no part or feature that can't be con­ using the new C. figured, modified, or replaced (anyone Finally, I'm starting to see software for ZCPR68?). It's also small, about 20K. from other sources. I know of at least two A hackable size. more editors, two disassemblers, and a Despite its size, it supports custom host of other goodies. device drivers, pipes, I/0 redirection, BAT files, a RAMdisk, and TSRs. Every­ Let's Be Real thing except multitasking. (Peter is work­ I wouldn't be completely honest with ing on that.) you if I didn't tell you that there are You get 40 utilities including: as­ some things I don't like. sembler, file manager, the ubiquitous For those of you who have experience EDLIN, and a BASIC interpreter. with Flex, SK*DOS will seem like old SK*OOS also provides more assembly home week. For the rest of us it's strange. HARDWARE language help than we ever got from Instead of drives A: and B:, they are 0 A wide selection of single­ DRI. There are no less than 60 DOS calls, and 1. The command processor doesn't organized as "A-line" software inter­ understand the familiar "*" and "?" board computers and sys­ tems, from $275. rupts. These include calls to input and characters in wild cards. Instead you just output text strings or decimal and hex give the first letters of the filename. Un­ COMBINATIONS numbers. fortunately, this means typing: Package deals of fast and That's on top of the 17 ROM calls. powerful computer plus DOS And you get an INCLUDE file of system .C ~nd more, from $350. equates to make assembly easier. Although I didn't know 68K which not only gives you all the .C files, mnemonics when I started, I had no but also all the .COM files, and any other trouble recoding some of my CP /M files whose extension begins with 'C'. I~~~~TWARE SYSTEMS CORP. library routines. I found, hov1ever, that The SK*OOS tools also give me more BOX 209 • MT. KISCO, NY 10549 many of my prized subroutines weren't help than I care for (a carryover from 914/241-0287 needed with SK*OOS, their functions Flex, I think.) When you copy a file over Reader Service Number 40 were available as system calls. an existing file, SK*DOS stops you with a

44 MICRO CORNUCOPIA, #44, Nov-Dec 1988 "File exists ... Delete?" message. When you delete a file, it asks you, not once but Figure 1-PT68K-2 Vital Statistics twice, if you're sure you know what you're doing. Mfr. Peripheral 'l'echnology, Inc. More important, the tools are not as 1480 Terrell Mill Rd., Suite 870 Marietta, GA 30067 mature as the OS. Peter's trying to (404) 984-0742 provide as many tools as possible - and User's Group SK*DOS users Group they work, but many are pretty short on Sidney Thompson features. 181 Greenbriar Ct. HUMBUG is no competition for DDT Conyers, GA 30208 (404) 922-3097 {Eves,Voice) and I don't like its command syntax. (914) 241-3307 {RSBS,PCBoard) Neither the Cs nor the assembler support separate linking. But that's because CPU Motorola MC68000 Clock 8 MHz standard there's no linker. (I've promised to write 10, 12.5, or 16 MHz optional one as soon as I finish this article, so I RAM 512-1024K dynamic, 0 wait state 4K static, battery backup can't blame that one on anyone else!) ROM 32-128K EPROM Peter has developed a truly elegant Serial Four RS-232 ports system of I/O control, suitable for Parallel Two 8-bit ports (one Centronics-compatible) Time Real-time clock/calendar, battery backup device-independent control of a wide Expansion 6 IBM PC/XT-compatible I/O slots variety of devices, but none of the stand­ Floppies Built-in floppy controller, four drive ard I/0 drivers use the system. capability Hard Disk Uses PC-compatible Winchester controller While SK*DOS fully supports the PC­ Console Serial terminal OR PC-compatible keyboard, type CRT and keyboard, it only does so mono or color monitor Power Plug-compatible with PC power supplies by treating them in TTY fashion. The OS SK*DOS (free with kit) or OS-9 standard SK*OOS driver can't read all Software Debugger in ROM. Assembler, editor, file mqt. those neat cursor, keypad or function tools, disk formatter, supplied. Other S/W keys. This isn't a problem because the Available User's Group provides Small C, editors, modem User's Group has a driver which sup­ program and many other utilities. Software from vendors includes K & R C, RBASIC & other ports all these. compilers, & other editors, Disk I/O on the hard disk is quite disassemblers. satisfactory, but floppy writes are inter­ Price Partial Kit {without dynamic RAM, floppy minable. That's because the file I/O is controller, DUA.RT, or clock) $200 unbuffered, and SK*OOS does a verify Full Kit SK*DOS, 10 MHz, 512K RAM 2 serial $575 after every 256-byte sector. You can tum Assembled SK*DOS, 10 MHz, lMeq RAM 4 serial $849 off the verify flag, but you take a chance SK*DOS, 12 MHz, lMeq RAM 4 serial $899 that a disk error will corrupt the direc­ tory. /***/ SK*OOS also has a flat file structure, which means that when you do a DIR on the hard disk, you get lots of files. Now that's a problem, particularly because of the lack of wild cards. Fortunately, a ready working on a new version, which software are solid. The software tools are combination of four disk partitions and a will have faster disk writes, a hierarchical not as powerful and/or friendly as, say, copy of a UNIX-like DIR program from file structure, and typeahead. Turbo Pascal, but they are adequate. Cer­ the User's Group have made life at least Right now, SK* DOS is like CP /M tainly adequate for creating more and bearable. before the public domain guys got hold better tools. Finally, although the PT68K-2 of it. It's badly in need of a cadre of users If the public domain underground hardware is designed to be fully inter­ to write software for it. There are already ever gets hold of this computer, there's rupt-driven, SK*OOS uses polled I/O. a few, including the very active user's no telling where it will end. No typeahead. Well, that's okay ... I've group. lived without typeahead for five years If you are not the adventurous sort, with my Kaypro, but I was hoping ... you don't have to get SK*OOS with the • • • However, I like SK*OOS. The PT68K-2. OS9 is also available. For the problems are teething pains rather than record, I have heard more than one per­ something fundamental. I remember son say that OS9 is the best OS ever writ­ how slow the disk I/O was on my ten for micros, bar none. Some say it's Kaypro before I installed Micro C's the best OS, period. But it's $500, the ROM. BASIC compiler is another $500. To me, The main thing is, the OS is basically that kind of money runs counter to the sound and quite bulletproof - a perfect­ whole spirit of the system. ly capable base upon which to build. None of the problems I've mentioned are Finally things that can't be fixed. The system is fast, powerful, modular, And help is on the way. Peter is al- and cheap. The hardware and the

MICRO CORNUCOPIA, #44, Nov-Dec 1988 45 Sharing At SOG

same problems. Micro C, as the magazine sibilities, this year's group also shared. This is the kind of SOG piece that I is fondly referred to, is all about sharing. People whose names are synonymous can't write. It's not a disinterested look (I SOC begins with an optional white with the computer industry, like George don't think it's possible to attend SOG and water raft trip on the Deschutes river. Morrow and Jim Warren, come back and remain disinterested), but Barbara definitely This is the perfect ice breaker. It's very touch roots at SOC. has her own perspective. This is also a difficult to be stodgy as a dribble of cold reprint. It first ran in Oregon Computer water slides down your back, especially The Sessions News. Many thanks to its editor for per­ when aimed by an overzealous bailer. Two days of intensive sessions began mission to run this piece. This year our sixsome was given the Friday morning at 8 a.m. Software option of taking a series of rapids programmers were immersed in com­ pilers, tools, operating systems and pproximately 400 "computer debugging techniques. Software de­ techies" and myself gathered in signers listened and questioned as the ABend, Oregon, to attend SOG, the logic of the new modular language Tril­ Semi-Official Get-together that each ogy was introduced. A designer ex- year celebrates the publication of Micro Cornucopia. Micro Cornucopia is a bi-monthly com­ puter magazine for the dedicated com­ puter enthusiast. It's interesting to read,

Heading for lunch.

without the raft. Five of us accepted and were dropped off on the river bank. As we walked back to the appropriate water entry point, we had time to contemplate If that's a 334, then this must be a ... our folly. It was a very long walk, too long to gracefully retrace our steps. (Be­ plained the processes and problems en­ sides, those red-blooded males weren't countered in developing the Tele operat­ Don and Marilyn Thompson check going to let a skinny female be the first ing systems. stock at Microsphere's SOG table. and only taker of this exquisite dare.) The PC and drive diagnostics provided raft trip sets the tempo, and the informal solutions to hardware problems. Haw­ but also very technical. It informally mood continues. thorne Technology presented its 68000- showcases new languages and operating We discarded suits and ties in favor of based single board computer and operat­ environments, hardware design such as grungies. Many wear SOC T-shirts from ing system. Hardware designers ex­ graphics processors and coprocessors, former get-togethers. amined the pitfalls of obtaining FCC ap­ and mathematical solutions. Leading Much as early designers of hardware proval for their boards and computer edge work and experiences are shared and software pulled up a chair, leaned systems. We were all treated to some with others who may be battling the back and explored problems and pos- magnificent color 3-dimensional fractals

46 MICRO CORNUCOPIA, #44, Nov-Dec 1988

. l. By Barbara M. Hall ProLogic, Inc. 9900 S.W. Wilshire, Ste. 120 Portland, OR 97225

. . . and the mathematical process that Relaxed Sharing The next year Micro Cornucopia's produced them. This relaxed group feeling of sharing editor Dave Thompson moved to Bend, Industry leaders PC Tech, Microsoft, was an important part of the two-day Oregon, and so did the Semi-Official Get­ Logitech, Intel, Zortech, and new com­ seminar. Lunch was not really break together. This second annual celebration panies who could become familiar names time, but an opportunity to keep the dis­ was attended by 125 Micro C enthusiasts provided this year's speakers. SOGers cussion going or greet old friends from a who squeezed into Dave's usually had to choose between two lec­ previous year. I heard "remember when home/magazine space. SOG was grow­ tures scheduled in the same slot. we talked about ... " as SOGers updated ing rapidly and even the Fish Hatchery Talks such as "Neural Control and colleagues on their current progress. building in Shevlin Park proved almost too small for the 250 who attended SOG III. Since those early days, SOC has found a home at Central Oregon Community College. The attendees number from 400 to 450, which is just about the right size for the College facilities.

Clark Calkins describes his source code generator.

Parallel Programming with Transputers," The discussions really take on the air "Ray Tracing on the 34010 ," and of intensity as small groups gather after "Numeric Applications" vied for atten­ the structured day sessions end to talk tion. Even with such esoteric titles, long into the night over coffee or beer. speakers often found themselves face to They explore solutions, kick ideas about, face with an audience which seemed to and renew creative energies. It's not all Jim Warren know as much as they did and was not talk . . . members of one small group always of the same opinion. There were emerged at 4 a.m. with computers they The Semi-Official Get-together lively debates and some of the talks each had built! provides an opportunity for innovators developed into full-blown forums. to touch base with others who are in the In contrast to the technical and often History same league, to work and to play specifically focused nature of many of the The Semi-Official Get-together is together. It's a network for people from speakers' topics, the organizing commit­ Oregon grown and bred. Seven years ago all over. The glitz of the formal computer tee thoughtfully included a couple of 60 people, some from as far away as magazines and commerciality that has business know-how topics. Even techni­ Australia and Holland, gathered together invaded the big computer shows have cal designers need to know the pitfalls of in Portland for a single day of talk. There not touched this homespun world. SOG publishing their books or energizing their was no formal agenda; they shared ideas, is truly a unique sharing experience. employees. potluck and good will. From these modest beginnings SOG was born. • • •

MICRO CORNUCOPIA, #44, Nov-Dec 1988 4 7 By David Thompson Staff

Bits From Your Past

After reading through the following You thought you could hide behind your questions, I'm sure you'll be as inter­ mailbox. You thought you could just sit l

48 MICRO CORNUCOPIA, #44, Nov-Dec 1988 TM EDITING SYSTEM Solidity, Speed, and Power.

ED is an object-oriented open architecture system for editing programs and manuscripts and manipulating data files. Flexibility, extensibility, and programmability are realized by providing access to the objects which ED itself manipulates. All aspects ofED's appearance and operation can be controlled by the programmer. ED, a restricted or enhanced form of ED, or any of ED's objects, can be embedded in the programmer's applications with no royal­ ties. Objects such as dynamic arrays, windows, data entry windows, macros, menus, browsers, popup directories, and regular expressions are manipulated through normal C function calls. Functions for creating manuscripts are part of ED's design. Stream blocks, word-wrap, tabs, intelligent paragraph formatting, block justification, and pagination behave correctly and execute instantly. Finally, ED can be used to create sophisticated sorts and filters. Macros, search and replace, column blocks, and block sorts allow records to be sorted and selectively removed, and fields to be added, rearranged, and removed.

ED • NUMBER OF BUFFERS LIMITED • MACROS • MENU DRIVEN • VIEW • FILES • KEYBOARD CONFIGURATION • ONLY BY AVAILABLE RAM • NUMBER OF AUTO-EXECUTE • TIME-DELAY • NESTED • PRINT BUFFER WITH PAGE NUMBERS, AD­ WINDOWS LIMITED ONLY BY SCREEN SIZE RECURSIVE • SIZE LIMITED BY AVAJLABLE JUSTABLE SPACING AND MARGINS• INTER­ • POPUP DIRECTORY FACILITY • MEMORY • MORE FUNCTIONS • ACTIVE TUTORIAL• ALL DOCUMENTATION COPY• RENAME• DELETE• BROWSE• FILE VIEW/MANIPULATE BUFFERS THROUGH ON-LINE • WRITTEN IN C AND ASSEMBLER• STATUS • EDIT • EXECUTE • SORT • MENU OR KEYSTROKE • INTELLIGENT EXTERNAL UTILITIES • INTELLIGENT SEARCH AND REPLACE · FOR­ DIAGRAM/BOX DRAW • ADJUSTABLE CHANGE DIRECTORY COMMAND • POPUP WARD/BACKWARD • CASE SENSITIVE/IN­ SCROLL VALUE • TRANSPOSE DIRECTORY FACILITY • STRING TRANS­ SESITIVE • FULLY PARENTHESIZED LINES/CHARACTERS/WORDS • MOVE-TO­ LATOR • HARDWARE REQUIRE· REGULAR EXPRESSIONS • INCREMEN­ POSITION STACK •VISUAL TAB CREATION M ENTS • DOS • PC/AT, PS/2, 386 • CGA, TAUGLOBAL REPLACE ACROSS ALL BUF­ •COLUMNAR/ENTIRE-LINE TABS• TIME AND MDA, EGA, HERCULES, WYSE 700/AMDEK FERS • BLOCK COMMANDS • DATE STAMP • RESTORE TYPED-OVER 1280 • RUNS IN ALL VIDEO MODES, NO COLUMN/LINE/STREAM BLOCKS • SAVE • CHARACTERS • CHANGE DIRECTORY • FLAGS, NO DRIVERS • 256K • FOR UTERA· CUT • DELETE • BLANK • SEARCH-FOR • BRACKET/BRACE/PARENTHESIS MATCHING TURE, A COMPLETE UST OF FUNCTIONS, FORMAT • JUSTIFY LEFT/RIGHT/CENTER • • ENTER GRAPHICS CHARACTERS • EX­ AND A DEMO DISK, CALL 201-450-4545. UPPER/LOWER CASE• REMOVE• OVERLAY CUTE DOS COMMANDS • POPUP ASCII VERSION 1.0 • REACTIVATE • TAB • DRAG • SORTS TABLE • USER DEFINED MENUSIPOPUP PRICE: $265.00

~ THE AMERICAN VISA® MasterCard 1 COSMOTRON 80 HOLMES ST • PO BOX 128 • BELLEVILLE, NJ 07109 "~

Reader Service Number 107 MICRO CORNUCOPIA, #44, Nov-Dec 1988 49 Feeling SOGgy C'ING CLEARLY

By Scott Robert Ladd put out an excellent compiler, which they've P.O. Box 61425 Scott was planning a C debugger reviezu this just upgraded. Denver, CO 80206 issue. However, Borland's debugger isn't out yet so Version 6.5 of WATCOM C has a number of (303) 322-7294 he's been reduced to SOGging it and futzing with improvements and additions, mostly to keep compilers. Here are his latest recommendations on up with their competitors. the compiler front. For instance, every C compiler released these days includes a graphics library. WAT­ COM C 6.5 is no exception. The new graphics quish, squash, squish, squash . . . sorry functions are similar in form and operation to about the noise, but my clothes are still Microsoft's. However, the WA TCOM library a bit SOGgy. Rule #4316: Don't wear does support the Hercules monochrome card. S blue jeans on a raft ride if you don't Microsoft supports monochrome graphics, but have a dry pair on the bus! only if you use a special TSR. I enjoyed SOG VII immensely! There were WATCOM has added a "compile-and-link" great people to talk to, interesting programs to control program, which is standard with most attend, and plenty of white water to go around. other compilers. Interrupt Service Routines One of the most interesting experiences in my (ISRs) can now be created by using the qualifier life was riding down a river in a rubber boat INTERRUPT in a function definition. A new with a bunch of hackers; we'd yack a bit, then memory model (Tiny) has been added which paddle through some rapids, and then pick up allows the creation of .COM programs. the conversation almost in mid-sentence! A dozen or so miscellaneous functions, Wonderful! based on requests from WA TCOM C users, This column is being written in very early now disable/ enable interrupts, parse file August, just a few weeks after returning from names, and rotate integers. (Editor's note: Be SOG VII, which means you'll be reading it in great for reversing all the numbers on a mailing early October. I came home to find my fish in label.) really murky water (yuck) and plenty of boxes I haven't had a chance to run it through the on my front porch. (My neighbors like to benchmark suite yet, but W ATCOM claims to speculate on what I do for a living. I get several have improved both compile speed and code package deliveries a week. I don't "go to generation, and they've included more inline work." And they hear me typing and cussing functions. Overall, WATCOM C continues to be in the wee hours.) a good value, and a competitor in technical quality to Microsoft. Where Are The Debuggers? I was going to be talking about C debuggers C-Ware Desmet C Version 3.1 and debugging technology this time around. Just when many people thought that Desmet However, the centerpiece of my discussion was C was in its twilight years, they come out with to be a comparison of Microsoft's CodeView a new version. Desmet 3.1 has a larger library and Borland's new debugger. Unfortunately, and at least some compatibility with the emerg­ the new Turbo C has been delayed! Since lots ing (lordy, how long has that thing been of people are interested in the Borland debug­ emerging?!?) ANSI standard. For instance, it ger, I'll wait until next issue. now has function prototypes. Meanwhile, let's dig out the old jackknife I can't really hold it against a C compiler and open a few boxes ... developer who doesn't support the entire ANSI standard yet, since there's always the chance WATCOM C Version 6.5 that the standard could change again before it's I really like the people at WATCOM; they're finalized. friendly, helpful, and fun to talk to. They also As with WA TCOM C, I haven't had a

50 MICRO CORNUCOPIA, #44, Nov-Dec 1988 chance yet to benchmark Desmet C 3.1, problem on my system by using the There are actually two toolboxes in but it's on my list. MS-DOS SUBST command, as in: the package: volumes I and II. Volume I contains 12 utilities; volume II has 11 Zortech C++ SUBST C: E:\ more. There are several general utilities, I've felt kind of bare talking about like CAT (which copies files from stand­ this package without having seen it. Some header files don't get copied, ard input to standard output). Well, it's finally here! The first true C++ and one of the debugging libraries ends However, it's the advanced utilities that compiler for PCs arrived a week or so up in the wrong directory. There were really make the package worthwhile. before I left for SOG. also a few typos and formatting glitches CLint (Volume II) does a syntactic The manual is light-years ahead of in the manual. check of a C source file. Lint utilities the old Datalight Optimum-C manual Zortech is already working on the come from the UNIX world and (the compiler was written by the same problems. According to Joe Mclsaacs at provide better syntax checking than fellow who wrote Datalight). Zortech Zortech, rather than making users wait compilers normally do. For example, has put some effort into the manual, for the next release, they are printing up the following code fragment is in error: and it shows. For instance, there are ex­ corrected manuals and new diskettes amples on how to use every library int il, i2; function. printf("%d %s %c",il,i2); They even include a C++ tutorial. While it'll give you a start, it won't Most C compilers will not notice that teach you the fine points of object­ there are two bugs in the above code. oriented programming. C++ is much First, the third parameter should be a I recommend the book An Introduc­ string; second, there should be a fourth tion to Object-Oriented Programming and more than just "C (char). CLint catches these errors. C++, by Richard S. Weiner and Lewis J. CPrint (Volume I) is a C "beautifier," Pinson (Addison-Wesley, 1988). I with classes"; it is meaning that it takes an existing C recommend it over Bjarne Stroustrup' s source file and rewrites it in a regular The C++ Programming Language, which a wide-ranging format. This can be very handy in an originally defined the language. It's environment where several program­ good to read both, but the Weiner & enhancement of mers are writing code using different Pinson book is more clearly written, ways of lining up brackets and state­ and has better descriptions of the the standard C ments. CPrint can convert all of the files theories behind object-oriented to one format, making maintenance programming. programming easier. C++ is much more than just "C with CXref (Volume II) generates a com­ classes"; it is a wide-ranging enhance­ language. prehensive cross-reference report of the ment of the standard C programming contents of a C source file. It's much language. C is a poor language for more sophisticated than the cross­ multi-programmer projects involving reference generators that come with multiple code modules. C++ rectifies and sending them free-of-charge to all compilers. CXref will even report math­ this not only through classes and ob­ registered owners. ematical operators and C keywords. If jects, but also by giving the module Now if everyone else would be that you're working with a large source file, writer control over external access to his responsive ... a utility like this is very useful. or her functions and data types. This is PMon (Volume I) is a TSR which known as "abstraction," and it's a com­ Object-Oriented Microsoft C? monitors a program's execution. There mon component of other recently­ Microsoft was represented at SOG by are other profilers on the market (both developed languages like Modula-2. Greg Lobdell, Product Manager of in the public domain and commercial­ The Zortech package includes every­ Microsoft's Languages Group. He con­ ly.) PMon produces a list of system calls thing. There's an editor, linker, firmed the rumor that Microsoft is look­ and a timing table. The timing table tells librarian, object module disassembler, ing into adding object-oriented facilities the user how much time was spent ex­ and make, along with a reasonably to C and BASIC (object-oriented ecuting each function or line of source. good sized library (with, of course, BASIC?). They're currently examining This is an invaluable tool for optimiza­ graphics functions). The only item miss­ both C++ and Objective-C. tion. ing is a debugger. Hopefully, they'll pick C++; it would You can run PMon to see which Although Zortech C++ is compatible help define a standard. I would hate to functions or statements are using the with Microsoft's CodeView, you can see C end up a muddle mess, with each most time. Then you can optimize them, only look at global variables and source vendor coming out with a different set or rewrite them in assembler, to im­ code; local variables cannot be accessed of object-oriented extensions. prove your programs' performance. The by name. This isn't Zortech's fault - CritPath utility in Volume II can Microsoft hasn't released the formats of MMC AD Programmer's Toolbox provide further reports by analyzing the the special object records used for track­ This isn't a group of C-language PMon data. ing local variables. functions to be linked with your I really like this package. The I've found several minor bugs. The programs; it's a complete set of utility documentation is well-written and the installation program will only install on programs which can make the life of a programs work as described. Each tool- a hard disk if it is drive C. I solved this C programmer easier.

~ICROCORNUCOPIA, #44,Nov-Dec, 1988 51 box sells for $79.95, or you can get both also be aware of JPI. I understand its learning C, this is a good choice because for $130. programmers departed from Borland with of its integrated environment and the C package they were writing when Bor­ debugger. Microsoft will be enhancing Choosing AC Compiler land decided to purchase Wizard C.) QuickC in the near future ... During my talk at SOG, a number of What's your budget? Are you just Borland Turbo C: It's inexpensive people asked about choosing going to dabble in C programming, or (under a hundred dollars), compiles benchmarks. This seems to be a hot do you intend to produce professional quickly, and has a nice integrated com­ topic! Everyone seems to want to know programs? Do your applications use piler I editor. There will be a debugger which compiler is best. Out on the floating point calculations? Do you need coming real soon now. electronic mail circuit, at SOG, and in fast programs or small ones? Mark William's Let's C: If you're user's groups, programmers who want In the C roundup, I made some doing UNIX programming, and want to work with C want to know what general suggestions. Below I'll list the the best in UNIX compatibility, this is they should buy. eight compilers I think are worth con­ your choice. And, it's under $80 ... Choosing a compiler isn't easy; by sidering, along with my reasoning. Manx Aztec C86: For ROM-based ap­ the time of the next C compiler round­ Zortech C++: For under a hundred plications, Manx gets my vote. Also, up (scheduled for the March/ April 1989 dollars, you're not only getting one of Manx supports C compilers for every­ issue), there will be at least 15 C com­ the best optimizing C compilers around, thing from CP /M machines to the pilers on the market. At least a half­ but you can also move on to object­ Macintosh, making portability easier if dozen of these will make it into the oriented C++ when you're ready. you're working with several different "good to excellent" category, with the Zortech' s support is very good and the micros. rest scrambling to catch up. compiler produces small, fast programs. MIX Power C: What can you say Whenever I get asked the fateful Microsoft C: If you've got the bucks against a working C compiler for 20 question, "Which compiler should I (around 270 of them from a mail-order bucks? It's a bit unstable to use for buy?," I offer guidelines rather than a house), this is a good all-around choice. professional development, but it's great specific recommendation. The big C compiler produces fast for the hobbyist. They've ironed out First, Microsoft and Borland aren't programs (albeit a bit large), and has most of the bugs, and if nothing else, the only compiler writers in the world. every tool imaginable. The package also you get a good C programming manual True, they put out good products; but includes QuickC. The documentation is with a reasonable compiler thrown in. there are also very good compilers from very good. WATCOM C: This is a powerful W ATCOM, Zortech, Mark William's, Microsoft QuickC: If you need package on par with Microsoft's C. It MIX, and Manx. (Editor's note: You might Microsoft compatibility, or are just optimizes well and has a slew of

CALL FOR FREE CATALOG ~.--~-~~~--~-----~~~~~~~~~~~, SCIENTIFIC GRAPHICS ~ TEXT TO SPEECH BOARD! ::> PC/XT COMPATIBLE. MAKE YOUR COMPUTER TALK! O A VERY POWERFUL AND AMAZING SPEECH CARD. USES THE NEW GENERAL Presentation Quality Graphics ~ INSTRUMENTS SP0256-AL2 SPEECH CHIP AND THE CTS256A-AL2 TEXT TO SPEECH z CONVERTER. For Printers and Plotters 2 ~~~H:~:~fRDUS!~D O~~Q~~~Js OAN z~~ ::> SERIAL PORT. BOARD MAY ALSO BE USED IN A > STAND ALONE ENVIRONMENT WITH ALMOST Screen Graphs 0.. ANY COMPUTER THAT HAS A RS232 SERIAL 0 PORT. FEATURES ON BOARD AUDIO AMP OR for (.) MAY BE USED WITH EXTERNAL AMPS. W DEMONSTRATION SOFTWARE AND A LIBRARY Fast Previews W BUILDING PROGRAM ARE INCLUDED ON A 5'1• ff: ~~g~ :Nc6~l~~~~~i~~·A~~L.!i~6'1~~~~~~~~ s599s ~ c~' ASSEMBLED ~--·· ~ NEW! ~~,c~ & TESTED < NEW! IC TESTER! $149.00 ~ii-.------~~ c SIMILAR TO BELOW EPROM PROGRAMMER. PLUGS IN TO YOUR PC OR XT. TESTS w ALMOST ALL 14, 16, AND 20 PIN 74XX SERIES. INCLUDES STANDARD POWER, "S"' AND Curve-Smoothing I- "'LS"' DEVICES. ALSO TESTS CD4000 SERIES CMOS. SOFTWARE INCLUDED CAN EVEN DETERMINE PART NUMBERS OF MOST UNMARKED AND HOUSE NUMBERED DEVICES Interpolations i WITH SIMPLE MOD. THIS UNIT CAN ALSO TEST 6.4K AND 256K DRAMS! WITH MANUAL '.:j AND SOFTWARE: $149. PERFECT FOR SCHOOLS. c~ii-.------~ 0 ...... , a> PC/XT EPROM ASK ABOUT ,..... It Legends Placed Anywhere . " " a: OUR NEW ::> PROGRAMMER PAL 0 PROGRAMMER! LL. $169 Built-In Editor Auto/Manual Scaling Log/Lin/ScmiLog 0 ~ *LATEST DESIGN* PROGRAMS UP TO 4 DEVICES AT ONE TIME* FEATURES EASY An !11dcspensih!c Tool For Tech11ica! Professionals ffi ~NOT~~Ci~i~~ ~~l~~~:~~i~~R!~~t~l~~:s ~~~E~~;E~R ~is~ 0 ~ax1 u~~~t: t- BURNING. * THIS PLUG-IN BOARD ATTACHES TO AN EXTERNAL MINI CHASSIS W CONTAINING 4 TEXTOOL Z.1.F. SOCKETS. * NO PERSONALITY MODULES J: REQUIRED* AUTOMATIC VPP SELECTION: 12.SV, 21V, OR 25V. * EPROM DATA CAN I- ALSO BE LOADED FROM OR SAVED TO A DISKETTE.* PROGRAMMING SOFTWARE ~ ~~~~~.R:s~~~:M2J~~021l~~ 2;:~,.~~~~i~if:o~11~a:; 1 ?~25~'.f~~~t.· m~\:i~~ System Requirements: IBM-PC XT. AT or Compatible running DOS 2.0 or higher. 1-~S~O~FT~W~A~R~E~·~~~~~~~---~~~~------j Printer Graph' require Ep,on EX. FX. JX. RX. HS: Star Gemini. Radix. SD. SG. SR: (.) JUST RECEIVED. SAME AS ABOVE PROGRAMMER, BUT PROGRAMS 8 UNITS AT ONE IBM Graphic': or cornpatibilit) "ith one of the ab<"e Plotter graph' require HP-GL ~ TIME - $299. Ill compatibility. ::> (/) Digital Research Computers (/) w ....J P.O. Box 956. Dept. M, Valley Forge. PA 19482 < P.O. BOX 381450 • DUNCANVILLE, TX 75138 • (214) 225-2309 For Technical Information: (215) 269-0198 en 1--T-ER_M_S_:-A-dd_$_3-.00-p-os-ta-g-e.-W-e-p-ay--,-ba..,..la-n-ce-. -=o-rd,.-er_s_u-nd-:-e-r 7$1'""5-a-:-dd-:-7=:5:::-¢-:-h-an-:d:;;-lln-g-.N;-;-o--; ::::j C.O.D. We accept Visa and MasterCard. Texas Res. add 6-1/4% Tax. Foreign orders < (except Canada) add 20% P & H. Orders over $50 add 85¢ for insurance. Reader Service Number 60 Reader Service Number 32 52 MICRO CORNUCOPIA, #44, Nov-Dec 1988 utilities. The library is good, and the Should there be more coding examples? Microsoft Corp. floating-point performance is amazing. More or less industry news? Is there a 16011 Northeast 36th Way If you're doing a math-intensive project product you'd like to hear about? P.O. Box 9097017 on a PC without a math coprocessor, I'll C you later! Redmond, WA 98073-9717 WATCOM is an especially good choice. (206) 882-8080 Major Products Discussed (800) 426-9400 Book Of The Month The Society of Mind, by Marvin WATCOM C v6.5 Minsky ($9.95, Simon & Schuster, 1986). WA TCOM Products Inc. Aztec C Marvin Minsky is one of the founders of 415 Phillip Street Manx Software Systems the Artificial Intelligence Laboratory at Waterloo, Ontario One Industrial Way the Massachusetts Institute of Technol­ Canada, N2L 3X2 Eatontown, NJ 07724 ogy, and one of the best minds to ever (519) 886-3700 (800) 221-0440 think about thinking. C Ware Desmet CBS v3.1 This book consists of a series of one­ C Ware Corporation Jensen & Partners International (JPI) page essays, each building on the pre­ P.O. Box 428 1101 San Antonio Rd., Suite 301 vious ones, which attempt to lead the Paso Robles, CA 93447 Mountain View, CA 94043 reader into a better understanding of (805) 239-4620 (415) 967-3200 how we think. And why we think. It's the most fascinating book I've read in Zortech C++ vl.O years. Anyone who is interested in AI, Zortech Inc. • • • or who just wants to understand people 366 Massachusetts A venue a bit better, should read this book. Arlington, MA 02174 (617) 646-6703 Drop Me A Line ...... either on the Micro C RBBS, or at the P.O. Box listed at the beginning of Programmer's Toolkit, Volumes I and II the article, or by phone. If you use MMC AD Systems FidoNET, you can send NetMail to Box 360845 "Scott Ladd" on node 1:104/47. Milpitas, CA 95035 I want to hear what interests you. (408) 263-0781

PROMPT DELIVERY!!! SAME DAY SHIPPING (USUALLY) Explore Neural Net ICS QUANTITY ONE PRICES SHOWN for AUG. 23, 1988 Technology .... $87.95

DYNAMIC RAM Connections: The Traveling Salesman is derived from SIMM 1048Kx9 85 ns $550.00 the classic Hopfield-Tank neural net model for solving 1Mbit 1048Kx1 100 ns 38.50 the combinatorially explosive traveling salesman prob­ 41256 256Kx1 60 ns 14.50 lem. A previously undiscovered model parameter is 41256 * 256Kx1 80 ns 13.75 41256 256Kx1 100 ns 13.75 identified. A new speedup based on markers for city­ position pairs is introduced. Recent research on bio­ 51258 * 256Kx1 100 ns 12.95 41256 256Kx1 120 ns 12.75 logical systems contributes a new method for better 41256 256Kx1 150 ns 11.75 convergence of the solution. 41264 + 64Kx4 120 ns 18.95 EPROM Connections is written in PL/D, an innovative sys­ 27C1000 128Kx8 200 ns $37.50 tems language reviewed in July Computer Language. 27C512 64Kx8 200 ns 13.95 You get a copy of PL/D and PL/D user manual with 27256 32Kx8 250 ns 7.25 Connections so you have all you need to experiment 27128 16Kx8 250 ns 6.60 with the program. Self-compiling source of PL/D is STATIC RAM also available for $75.00 additional. 43256L-10 32Kx8 100 ns $18.95 6264P-12 8Kx8 120 ns 13.50 DOS 2.0, or above; 256K PC, AT, compatible, or PS/2. 5.25 or 3.25 inch diskette. Add $5.00 shipping ($12.50 SAT DELIVERY MasterCard/VISA or UPS CASH COD outside North America) and sales tax in California. 1NcLuDED oN Factory New, Prime Parts .JJP~ F~~ci::iv~~D::s MICROPRO.CESSORS UNLIMITED, INC. Co1puter ,... ! 3440 Kenneth Drive · 24,000 S. Peoria Ave., (918) 267 4961 lt ~ ~rt1 ~·11 mAsm Th.: Std Air S&i 3 lb BEGGS, OK. 74421 • ,i Systus ' ,.;.H I cm 1 Palo Al to, CA 94303 Fr. P·1 $10.25/1 lb No minimum order. Please note that prices are subject to ~ !A ,_! change. Shipping & insurance extra, & up to $1 for packing materials. Orders received by 9 PM CST can usually be delivered the next morning, via Federal Express Standard (415) 494-7081 Air@ $6.00, or guaranteed next day Priority One@ $10.25!

Reader Service Number 37 Reader Service Number 90 MICRO CORNUCOPIA, #44,Nov-Dec, 1988 53 Yet Another Travelog ... 86 (From Out Of The East ... Somewhere) WORLD

Script printers. I need to write a column for If you wondered what Laine goes through to Micro C ... Oh God! Not another one! By Laine Stump write a column while camping, caving, busing, con­ % Redhouse Press sulting, eating, and sleeping - (hey, it's a hard In Search Of A Topic Merkez PK 142 life), then read on. If you'd rather skip to the code What can I write about? I've now been suc­ 34432 Sirkeci for this issue, just skip to the end. The very end. cessful in publishing just about every piece of Istanbul, Turkey (And if Laine calls and tells me the column is on the code I've ever written. At least the interesting bus, I'll believe him. Next time.) pieces. And some of the boring pieces. And even some that I stole from somewhere else (SShhhh!). What am I going to write about???? o you think it looks easy to write a With ,Ceasar nudging my back, competing magazine column, do you? You just sit for window space to flap his tongue in the down in front of the screen and the breeze (much like his namesake, and like most Sideas flow swiftly out your fingertips politicians of today as well), I tried to bring and onto a disk which you exchange for large up a mental picture of everything I hadn't al­ stacks of money. Piece of cake. Anybody could ready written about. Blank. I'll have to try do it. Good way to earn a few extra bucks. again tomorrow. Doesn't take much time at all ... We arrived in the base camp deep in the "That sounds like fun, Laine, but I'm sorry luscious green forests of the Western Black to say that I'm already planning to go caving in Sea Coast the next morning and, after setting Kastarnonu province next week. If you can't up my tent and meeting a few of the other find enough people to go floating, you're wel­ campers (members of the Bosphorus Univer­ come to come along with us." sity Cave Explorers Society), I tried to think of I was on the phone with my friend Oral. things to write about. Still no luck. Maybe Trying once again to get up the necessary five after lunch. for a boat trip, I was running into snags. "If While we were four-wheeling down the you like, we can take the boat along. There's high mountain roads, swimming in rock one river that might be big enough, and it's an studded canyons (not enough water to boat), awesome canyon. We could take off from the and (of course) photographing the many cave camp for a day or two and try floating it. varieties of unique looking mushrooms in a The camp's going to be quite large, so we'll newly discovered cave, I was constantly (welt have no trouble finding people." sometimes) trying to think of topics to write Four days later I was trucking into the sun­ about before my upcoming deadline. rise in a Nissan crew cab with Sarni (Oral's Welt I hate to let this out, but it's pretty brother-in-law and the owner of the Nissan) damn difficult to come up with article ideas and Ceasar (Sarni's mother's golden retriever). I for a computer magazine while frying bread was leaving a lot of work behind in the city over a gasoline backpacking stove in the mid­ but, hey, it's Kurban Bayrarn (a Muslim dle of a beautiful green meadow over 50 miles Holiday)! The whole country is on vacation. from the nearest paved highway. Maybe I Why not me too? should see if there are any openings at Outside While Ceasar wiped his wet nose against the Magazine. back of my neck for the twentieth time, I quiet­ I asked some of the others for ideas. ly filed away a list of "Things To Do After "How about 'Caving as Recreational Vacation." Let's see, I need to put Turkish on Therapy for Computer Scientists?'" that Wyse monitor for Onur. I need to unsolder "I know. You can write about a computer the character generator chip from my Zenith. I controlled camp dinner menu creation system. need to go to Ankara and show my Toshiba to Of course it would ignore all requests to put that guy who's interested in buying it. I need to sujuk (a disgusting spiced sausage) on the contact Infinite about Turkish fonts for Post- menu."

54 MICRO CORNUCOPIA, #44, Nov-Dec 1988 "Show how to write a program to something will come." new 30 meg drives work right." take all the measurements we make and "Yeah, maybe. But I've got to go to "We're converting these programs generate an accurate map of the cave Ankara and sell my old computer from Turbo Pascal 3.0 to 4.0 and we automatically." tomorrow. Maybe I'll think of some­ can't figure out what to do with this in­ "Wait a minute! Let's get back to this thing while I'm there ... " line assembly code that does an indirect idea of sausage elimination." Off on the night bus to Ankara. My call to ConOutPtr." No luck there. We had the sujuk, and seatmate was a student in dentistry at "I just imported these printers from we had to eat dinner. But I didn't have Hacitepe University in Ankara. We France for next to nothing, but they the necessary equipment to do the talked about how rich the dentists get in don't have a Turkish character ROM. Do development work (my new machine the U.S. and how Turkish dentists aren't you suppose ... " doesn't run on batteries). Besides, you compensated nearly enough for their ef­ In two days I managed to: put the don't need a computer program to forts. No MC article ideas there, but at Turkish character set on a Wyse high eliminate sujuk from the menu. least he told me about a new Mexican resolution monochrome card and a no So I gave up for awhile. Hung my restaurant just opened by a friend of his name Japanese printer; teach a tech­ sleeping bag out to dry in the morning. in Ankara (the first Mexican restaurant nician (who doesn't speak English) how Dug the Landrover out of a clay bank in in Turkey!). to install and format Miniscribe 8438

the afternoon. Dashed across the moun­ We parted in the morning with an drives with OMTI 3527 RLL SCSI bus tain tops clinging perilously to the roll exchange of phone numbers and a controllers (fast, reliable, and cute); send bar on the back of the Nissan. Sat promise to get together and eat Mexican a FAX to PC Tech asking what hap­ around the campfire scrounging "taste food ("It would be very useful for you pened to the 20 5380 SCSI chips we tests" from the evening meal as it was to go there. None of us know what asked for; inquire once again into the being cooked. Refused to wash my hair Mexican food is supposed to taste like. disposition of my reimbursement for until just two days before the end of They just put something on the plate bus and airplane tickets from last camp. and if it's hot we figure it must be right. January; and even get a down payment They really need an expert's opinion.") for the sale of my Toshiba T1100. Still no Still In Search Of A Topic Still no ideas for an article. I hoped I'd article ideas. Back in Istanbul I was in true form. come up with something while working Oh, I didn't quit thinking about it. I "What's up, Laine?" in Ankara. asked everyone I met. "Oh, I've got this stupid magazine It was the normal scene in Ankara. Ergun said, "Why don't you forecast article to write and I can't think of any­ "Laine, did you ever find the IC I what's going to happen in the industry thing." need for my power supply?" in the next few years?" "If you sit down for a few hours "We need some help making those "Are you kidding? Only Jerry Pour-

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 55 nelle and John Dvorak are godlike Now where was I? Let's see ... Com­ pillow. "What have you done?!?" I enough to do that." puter controlled Dorita production in asked the steward. "I said that my com­ "How about forecasting what you developing nations ... With such an ex­ puter had to ahuays be on the pillow! would like to happen in the next few citing topic to think about, sleep arrived It's very delicate!" years?" in my frontal lobes (or wherever it is "It's okay. I just moved it half an "If I did that, everyone would think I that sleep arrives) without much hour ago, at the last stop." was just complaining (again)." provocation. If damage was done, it was already "I guess you could always write I was awakened by the steward three done. I was too tired to explain to him about your caving trip. Judging from hours later as the bus motored through that the little black bag I was so con­ that silly thing you wrote last year, the first glimmer of dawn, just pulling cerned about cost more than his wages you'd probably get away with it." into Izmit at the east edge of the Sea of for an entire year, and that it didn't Back to the main menu. Marmara. "Would you like some tea?" matter if it was off the pillow for five he asked as he, not unpolitely, shoved hours or five minutes, it only took one In Search Of A Topic, 3D the glass under my nose. good bump in the road to clobber the Another night bus back to Istanbul. It was the aroma that awoke me. My winchester drive. I tossed my things "I'm really going to do it this time. most pleasant awakening in months. into the service bus and headed home I'll come up with a humdinger, all time Not counting last Saturday morning for a shower. showstopper of an article. This one's waking up in the dewy 6 a.m. mist next Hmmm. Maybe I could write about going to knock their socks off. Yeah. to a dormant campfire, doing my best to the bad things that can happen when That's it. Their socks. And their not wake anyone else as I started the you're working overseas. The miscon­ monogrammed slippers, too. They'll be fire for morning tea. Yeah. Morning tea. ceptions. The disorganization. The wiping Jolt Cola off the floor with their What if I wrote about the pos­ equipment ruined by ignorance. The bandanas after this article knocks them sibilities of tea packaging machines that frustrating delays and feelings of falling out of their seats. Yeah. Jolt Cola. That's automatically tested radiation levels of off the edge of the earth as soon as you the ticket. Jolt Cola ... " tea (a big question down here just south take off from JFK International. The potholes on the Istanbul high­ of Chernobyl) and automatically put the The people who don't trust com­ way rocked me off into dreamland, as I bad tea into a special hopper for puters and insist on entering all the feebly attempted to squeeze an article delivery to the Nuclear Energy Com­ numbers in the spreadsheet in alpha idea out of my last two months. mission. Or maybe the effects of high mode and adding them up by hand. I awoke with a start, brought to my tea consumption on the writing energy The executives who don't take you senses by the putrid smell of burning of witless young computer journalists seriously because you wear T-shirts and rubber, and realized that the bus was blue jeans to the office in a country stopped. As the moustached man in the Nah. Nothing has substance yet. If where even farmers sometimes wear next seat snored on in oblivion, the that OS/2 kit would just show up ... ties and suit coats in the field. Because steward turned on the PA system And the other Meg of RAM. But then you carry a Caribou Mountaineering "Respected passengers: One of our tires one of the guys at the caving camp backpack instead of a briefcase, and be­ has blown out." It was 2 a.m. works for Lotus in Boston, and he told cause you are under 45. No, that would Off the bus to check out the situa­ me that even 2 megs isn't enough to do be too negative. I complain about nega­ tion. There was a crowd of about 15 anything useful with OS/2 ... So, like I tive people too much to be one. At least men gathered around one of the rear said, if that other 3 megs of RAM would to publicly be one. wheels, trying desperately to survey the show up ... situation with only the aid of a small Jeez, I can't even get a manual for In Search Of A Topic, Part IV cigarette lighter. I climbed back into the Turbo Pascal 4.0! What am I doing talk­ At home I hit the button on my bus and returned, much to the amuse­ ing about an OS/2 Developer's Kit. I answering machine and got the mes­ ment of the crowd, with my Tekna Lite should be trying for the easy stuff first. sage from Lois and Elaine, calling from 2 waterproof flashlight. Sometimes it's not easy being a Van in Southeastern Turkey. "We're "Is he a tourist?" freewheeling computer "samaritan." still planning on meeting you in Trab­ "No, I'm not a tourist." Maybe I should try writing again about zon at 4 p.m. on the 10th. Onok and his "Hey, you know Turkish! Does that getting jobs overseas. That might friend are coming, too. We decided that thing run on NiCads, or what?" prompt me to go do some work myself we should meet at the Tourism Infor­ An hour and a half later, the tire so I would have enough money to buy mation Office instead of the City Hall, replaced and the brake drum cooled this stuff with cash instead of trying to though." with several bottles of water, I sat back beg it under the auspices of doing Great. I've got three days to unpack, in my seat. My seatmate was just magazine reviews. pack, and get on the bus for an 18 hour waking. The bus arrived in Istanbul during ride out to Trabzon. The boat is at "What happened? Did the brakes the morning rush hour so it wasn't al­ Sarni' s mother's house and it needs lock?" lowed to drive downtown and drop me repairing. I need to seal the seams of "Yeah. Just after the tire blew out off at the bus company's office near my my tent, wash all my clothes and duf­ over an hour ago." house. Instead, we pulled off at an over­ fles, take inventory, call Tarsus and "Oh." pass to transfer to a smaller shuttle bus have them send up the boat adhesive He was immediately back in his for our final trip into the city. from Jack's refrigerator. And I still have snoring stupor. Obviously he didn't As the cargo hold was opened, I to think of a topic for the Micro C have to come up with a column for a noticed that my computer was no column. The seagulls screaming from computer magazine. longer sitting on top of its six inch foam the top of the mosque across the street

56 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Performance and versatility for your CP/M or MS-DDS computer -QP/M------Kaypro ------IBM PC----- aP1M by MICROCode Consulting KayPLus ROM Set by MICROCode Consulting Fed up with the message "BOOS error: R/O"? With QP/M, you'll Want more performance and flexibility from your Kaypro? With CPIM, Northstar, Macintosh, Apple II, never lose another file because you changed a diskette. QP/M the KayPLUS ROM set you can have the advantages of a Kaypro MS-DDS, and PS/2 - Don't let offers full CP/M 2.2 compatibility with outstanding performance 4 or 10, even on your Kaypro 2. and more commands WITHOUT eating up precious program • Install up to four floppies and two hard drives incompatible diskette formats get space. Get such features as automatic disk relogging, simple • Boots from floppy or hard disk you down, read them all with your PC. drive/user selection using either a colon or semi-colon, 31 user • Supports 96 TPI and 3112'' disk drives • Can use any ST506 type hard drive · 5 to 64 Meg areas, drive search path, multiple program command line, archive UniForm-PC by MicroSolutions bit maintanence, and transparent time/date stamping; all in the • 32 character type-ahead keyboard buffer How often have you wished you could use your CP/M diskettes same space as CP/M 2.2. Installs from a convenient customization • Automatic screen blanking (not avail. on 83 series) on your PC? Now you can access your CP/M disks and programs menu, no software assembly required. Bootable disks available • 12 disk formats built-in, unlimited configurable on your MS-DOS computer just as you would a standard MS-DOS with CBIOS for Kaypro, Xerox (8" or 51/4'', -1 or -2), & BBi. • Full automatic disk relogging with QP/M • Internal real-time clock support diskette. Once the UniForm driver is installed, you can use QP/M Operating System, bootable - specify system .... $ 64.95 • No software assembly required standard DOS commands and programs right on your original QP/M without CBIOS (installs on any Z80 system). . . $ 49.95 Includes manual, format, configuration, diagnostics, sysgen, diskette without modifying or copying your files. UniForm-PC diskette customization utility, AND hard disk utilities. Available allows you to read, write, format, and copy diskettes from over --Networks----- for '83 and '84 series Kaypros. 275 CP/M and MS-DOS computers on your PC, XT, or AT. With UniForm-PC and the Compaticard, you can use 51/4'' high aP1M Network File System by MICROCode Consulting KayPLUS ROM Set, specify model ...... $ 69.95 density, 96TPI, dual format 3112'' (720k/1.44 meg.- PS/2), and QP/M Network File System is an efficient local area network KayPLUS ROM Set with QP/M ..... $125.00 allowing up to seven CP/M computers to share peripherals and even 8" drives. data resources. UniForm-PC by MicroSolutions ...... $ 64.95 • Transparent operation at speeds up to 11,000 by1es/second Parts and accessories for the Kaypro Uniform for Kaypro and other machines . . . $ 64.95 in syncronous mode Kaypro 2X Real-time Clock parts kit ...... $ 29.00 •Speeds of up to 1,920 by1es/second in asyncronous mode Kaypro 2X Hard disk interface parts kit ...... $ 16.00 CompatiCard by MicroSolutions • Local/remote disk drive and printer support Kaypro 10 or '84 series Hard Disk host board ..... $ 49.00 Meet the CompatiCard, THE universal disk drive controller card. • Remote peripheral support for modems and real-time clocks Kaypro four drive floppy decoder board . . . $ 35.00 This half card will let you run up to 16 disk drives (4 per Compati­ • All stations need not be on the network even though connected Complete parts and repair services available Card) on your PC or XT, including standard 360K, 96 TPI, high • Local drive access protection and control density {1.2 meg, dual speed), 8" single or double sided (SD or • Simple menu oriented configuration utility DD), and dual format 3112'' drives (720k/1.44 - PS/2). The combi· • Extended DOS calls are provided for addition of custom net- --Xerox S2D---- PLus2 ROM and X120 Double Density Board by nations are almost unlimited. Comes with its own MS-DOS driver work utilities. MICROCode Consulting and Emerald Microware and format program for high density and 3112'' diskettes. Use it Works with interrupt driven Z80 systems such as Xerox 820, About had it with single density diskettes on your Xerox 820-1? with UniForm-PC for maximum versitility. 8" adaptor and addi­ Kaypro (KayPLUS & Advent ROMs), Eagle, and other computers Get unsurpassed versatility with our X120 Board and PLUS2 tional cabling available. running QP/M, or CP/M 2.2 ROM package. CompatiCard Board ...... $169.95 QP/M Network File System ...... $ 39.95 • Run up to four floppy disk drives at once CompatiCard with UniFORM-PC .. * * Special * * .. $225.00 • Mix 8" and 51/4'' at the same time CompatiCard with UniFORM-PC & high density or --Hard Disks---- • Software compatible with Kaypro and Xerox 820 3112'' drive. . * * * Special * * * . .. $350.00 Need more speed and storage on your system? • Built in drivers for most serial and parallel printers Improve the productivity of your Z80 computer with a hard disk. • Get mini-monitor functions and auto-boot capability MatchPoint-PC by MicroSolutions • 19 built in disk formats, including Xerox and Kaypro The MatchPoint-PC board for the PC/XT/AT works with your HOS Host Board • Includes custom disk format definition program standard controller card to let you read and write to NorthStar This daughter board provides a convenient interface for connect­ • Banked ROM BIOS for more space in your TPA hard sector and Apple II diskettes on your PC. INCLUDES a copy ing a Western Digital WD1002-05 hard disk controller to your • Composite video adaptor on X120 board of the UniForm-PC program, as well as utilities to format disks, computer. • Runs 48 TPI diskettes on 96 TPI drives copy, delete, and view files on Apple DOS, PRODOS, and Apple • Plugs into the Z80 socket, no other wiring required • Supports real time clock from Z80-CTC CP/M diskettes. • 40 pin interface for a WD1002-05 (or HOO) controller board • Works on the Xerox 820-1 and Big Board I MatchPoint-PC Board . • Switch selectable 1/0 port addressing ...... $169.95 • Both ROM and X120 board are required for operation • Comes as bare board or assembled & tested MatchMaker by MicroSolutions • Kaypro '84 host board also available PLUS2 ROM Set and X120 Board A&T ..... $114.95 PLUS2 ROM Set and X120 Bare Board . . .. $ 49.95 Now you can copy your Macintosh diskettes right on your PC/XT/ Winchester Connection by MICROCode Consulting PLUS2 ROM Set only...... $ 39.95 AT with the MatchMaker. Just plug your external Macintosh drive The most simple and comprehensive hard disk software package 120 Bare Board only ...... $ 15.00 into the Match Maker board and experience EASY access to your available for CP/M. * * * Special * * * 2 boards for $25, 5 for $50 3112'' Mac diskettes. Includes programs to read, write, initialize, • Designed for use with the WD1002-05 controller board Other kits, parts, and packages available and delete files on your single or double sided Mac diskettes. • Works with one or two hard disks - 5 to 64 meg MatchMaker Board ...... $139.95 • Menu installed, no software to assemble MatchMaker w/External Mac Drive ..... $325.00 • Complete hardware tests and error handling Parts and accessories for the Xerox 820 • Automatic swap, for warm boots from hard drive Xerox 820-2 CPU Board · new...... $ 75.00 • Software drivers install above or below CP/M Xerox 820-2 Floppy Controller board · new ...... $ 65.00 Frustrated because your PC • Allows custom partition sizes and mixed drive types Xerox 820-2 CPU board w/ Floppy Controller ...... $125.00 can't speak CP/M? • Independent block and directory sizes on each partition Xerox 820-1 CPU board - new...... $ 75.00 UniDOS by Micro Solutions • Includes manual, format, test, park, and swap utilities Xerox 820 complete high profile keyboard ...... $ 65.00 Run CP/M programs on your PC? Of course. UniDOS is a Xerox 820 bare high profile keyboard - new...... $ 25.00 Winchester Connection Software only...... $ 39.95 memory resident program that can use the NEC V20 CPU chip Xerox 820 51/4'' drive cable...... $ 9.00 HOS Board with Winchester Connection Software ..... $ 79.95 to actually RUN your favorite 8080 programs. Use UniDOS with Xerox internal video cable w/brightness control .... $ 9.00 HOS Bare Board with software . $ 59.95 UniForm-PC, and automatically switch to CP/M mode as you Xerox 820 power supply . . ... $ 35.00 HOS Board, WD1002-05, and software . . $245.00 log on your CP/M diskette. Switch to emulation mode to run Z80 Power connector, specify board or cable ...... $ 2.50 Call or write for other pricing options code programs or for systems without a V20. UniDOS directly Xerox parallel printer interface cable ...... $ 35.00 WD1002-05 HARD DISK CONTROLLER BOARD by Western converts video and keyboard emulation for Kaypro, Xerox 820, Dual Half Height 51/4'' Disk Drives · DSDD, Digital Morrow, Osborne, VT100, and eight other displays. All standard in cabinet with standard Xerox cable . . . $265.00 • Standard ST506 drive interface CP/M system calls are supported. Note: The NEC V20 CPU is Complete parts and repair services available • Same size as standard 51/4'' drive a fast, low power, CMOS replacement for the 8088 CPU chip • 40 pin interface to host computer that includes a full 8080 instruction set as well as the standard • WD2797 floppy disk controller interface on board 8088 set. Systems using an 8086 may substitute a V30 chip. • Can control up to three hard drives {EMERALD/ UniDOS by MicroSolutions ...... $ 64.95 • Direct replacement for Kaypro 1O controller UniDOS w/UniForm and V20-8 chip ...... $135.00 WD1002-05 Controller Board ...... $185.00 (MICRO/A/ARE} Other Western Digital boards available UniDOS ZBO Coprocessor Board by MicroSolutions P.O. Box 1726, Beaverton, OR 97075 This 8 Mhz. ZBOH half-card will run your Z80 and 8080 code Prices subject to change without notice. VISA and Mastercard programs at LIGHTNING speed on your PC or AT. Functions accepted. Include $5.00 shipping and handling, $7.50 for COD, VISA 1 just like the Uni DOS program, except NO V20 or emulation mode UPS-Blue or RED Label additional according to weight. Please . (503) 641-0347 :· 11·•1 is required to run your programs. Now includes UniForm-PC! include your phone number with all correspondence. 30 day money back guarantee on all products. UniDOS Z80 Coprocessor Card. . . $169.95 Reader Service Number 10 MICRO CORNUCOPIA, #44, Nov-Dec, 1988 57 called into my mind an image of a dead "Hey Cary, I just can't make it. If Reading And Writing Tracks albatross tied around my neck. you don't see anything by Wednesday, Awhile back I was going to write a It was 8:20 a.m. Just over six hours that means I couldn't come up with disk copy program that didn't bother since the tire blew up on Bolu pass. I anything." rereading the disk after making the first grabbed a towel and headed for the "Oh, that's fine. We'll just put copy. But like usual, I got so bogged shower but was stopped by the another article in place of yours." down thinking of the ultimate user in­ telephone ringing. "Hi, Laine. This is She almost sounded pleased! terface that I never finished it. I did Ayfer. What are you doing this after- Then I talked to Larry. write the procedures to read, format, noon?'' "Yeah, I tried to get out of writing a and write the disks, though. (See Figure "Oh, just resting," I lied. column once too, but Dave convinced 1.) After my shower I went to Redhouse me otherwise. You're lucky to be so far The functions needed to access the Press to discover everyone else out on away. It's a bit tougher to be convinced disk at this low level are fairly easy to vacation. Fatih was there, though, and I from such a long distance." use, thanks to the biosdisk() function in asked him if he had any ideas of what I Yea! My conscience is free! I don't bios.h of the Turbo C library. could write about. have to write a column now. I can go readtrack() and writetrack() just put the "How about the things we've been down and get a bus ticket for Saturday. biosdisk() function into a retry loop. doing to get the transfer between our Just leave tomorrow. Just like that. This is necessary because many BIOSes machines and the typesetter working "Sorry, but all our buses to Trabzon don't wait for the disk to become ready, properly?" are full until Tuesday." Okay, I can live so they often return a "Not Ready" "I don't think so. The readers would with that. Maybe I'll write that column error on the first call. I've found that never understand why it took so much after all. But it has to have substance. I three retries usually ensure reliable time to do something seemingly so can take a look through my source disks error reporting. easy. They don't care about the trials and see if there's anything worthy. Let's formattrack() is a bit more compli­ and tribulations of having an alphabet see ... cated, but not much. First, it must build with extra characters not in the ASCII a table of sector header information or ANSI standards. It just doesn't apply Return Of In Search Of A Topic with each entry being four bytes: track, to them." A program to set the serial port to head, sector, sectorsize. Second, a verify Arriving home at 9:30 p.m., I saw the 38400 baud? No, I got that out of BYTE. operation is performed on each track huge pile of clothes on the bedroom A rewritten boot sector that handles any after formatting before giving it a pass­ floor and decided to give up for the mo­ format of boot disk? That would have ing mark. Note that all the constants for ment. Maybe if I rested for half an hour been useful back when I wrote it, in the SECSIZE, NUMSECS, etc., are for stand­ I'd think of something. The bed seemed DOS 2.11 days, but it's pretty worthless ard 360K diskettes. If you want the abnormally comfortable (not surprising, now, what with DOS 3.3 and all that. program to be general, you should since I'd spent two of the last three Besides, it's long. make these constants into parameters nights on the bus). How about a program to lengthen which are passed as arguments to the My next moment of awareness was the timeout on INT 17h printer status to functions. Hey, these are just examples. at 2:45 a.m. I stumbled to the bathroom avoid "printer not ready" errors on What do you expect? and pried my contacts out of my eyes, slow printers? Nah. It doesn't really Since an entire disk would be much cursing at my stupidity in once again show anything new. Okay, then how larger than the maximum limit of 64K falling asleep without removing them. I about the low level procedures for that for a single data item (in anything but resolved to come up with a real mind disk copy program I was going to write HUGE memory model), I decided to bending topic first thing in the morning for Tony and never finished? Well, represent a disk as an array of and crawled back to bed. maybe ... What if I also threw in the NUMTRACKS pointers to one track The next morning borrowed SW APDISK program that can make the worth of information. This data struc­ Murad's car and drove up to Sami's B drive appear to be A or vice versa? ture was defined in three steps to make mom's house to pick up the boat. Then Well, maybe ... I guess it's better than it easier to understand. out to the bus station to get the boat nothing. First I made a typedef called glue newly arrived on the overnight bus Alright then. I'm ready. Where's my TRACKBUFFER, which is an array large from Tarsus. Things were starting to coffee cup? I need some drugs in my enough to hold one track worth of data. pull together. "I should be able to leave system if I'm going to do this. Let's get Then I made the typedef BUFPTR, tomorrow," I said, without much con­ the player hooked up and some which is a pointer to one track of data. fidence. good Indian tabla music going; do this Finally I declared the variable "data," Oh yeah. I forgot. I've got to do my up right ... which is an array of BUFPTR (i.e., an taxes. I got a three month extension array of pointers to a full track of data). since I've been working overseas, but Disks It would be possible to declare the same my three months will come due while Okay, so the topic is: Low level disk data structure with a single variable I'm somewhere in the middle of a rapid functions on PC compatibles. Has this definition, but then probably nobody on the Coruh River in Northeastern been covered before? Probably. As short of Kernighan or Ritchie would un­ Turkey. I added that to my list and real­ usual, I won't bother telling you about derstand it. This way it's pretty obvious. ized that maybe, for the first time ever, I the details you can learn from The Pink would have to call Cary and tell her Shirt Book. I'll just give you some code Reading And Writing Disks that I just couldn't write a column. fragments that you can use in your own Most of you can now easily see what I waited until 2:30 a.m. (that's 4:30 programs. you need to copy an entire disk. I see no p.m. in Oregon) and called Micro C. reason for publishing Yet Another for()

58 MICRO CORNUCOPIA, #44, Nov-Dec 1988 McTek LCD Portable (Including Hard Disk Only 19 lbs.)

--~ilil/T286

The McTek Rabbit-286 LCD Portable as a CRT. You can also plug in a combines the fastest, most reliable digital or analog color monitor or AT motherboard available with a digital or composite monochrome most visible full-size LCD port- monitor. Included also is an exter­ able screen on the market. nal 51A" floppy port for reading Running at a switchable 8 and converting to 31/z'' disks (5 1'4" or 10 MHz ¢wait state, it external drive w/case: $179 when includes a 20MB hard purchased with LCD Portable). disk, 720KB 31/z'' floppy The McTek Rabbit-286 LCD Port­ drive, parallel & serial able comes fully assembled with ports, Award 3.03 bios, escently backlit, 80-column by 25-line, high resolution our one-year parts & labor guaran­ 640k & tuibo indicator LCD. The screen 640x400 super twisted LCD with adjustable intensity and tee, and sells for an amazing, is a fantastically readable, electrolumin- screen-angle. The screen size is 9. 5"x6'~ It's as readable complete price $17r n n ' of only ..7..7 •

386-20MHzW/IMB $2WJ!)! 3 MB On-Board AT! XT Turbos & Supers Our McTek 286A is the most integrated AT-compatible to date. It utilizes 640k 4. 77 /8MHz and 4. 77 /10 switchable XT turboboards: two 360k the highly regarded Chips & Technology chip set, and includes memory floppy-disk drives with controller: one parallel, one serial and one game upgradable on board to 3 megabytes. No more worries about speed port: AT-style keyboard: clock, FCC-approved slide-case: eight slots: compatibility with expanded memory cards! The 8/10 MHz. f)-wait state Hercules-compatible graphics card: amber monitor w/base: fully McTek 286A runs at 11. 5 Norton SI, and an effective 13. 2MHz on the assembled and tested: one-year parts and labor warranty. Landmark test. Serial, parallel & game ports are all standard on board. With Award 3. 01 bios, 640k, 200W power supply, Samsung amber monitor XT Turbo Superturbo with Hercules-compatible controller. locking case, AT-style keyboard. 4.77/SMHz 4.77/lOMHz $779 1. 2MB drive, 20MB Seagate. Assembled & fully tested. with a full one-year Complete Complete warranty. Get in on the most advanced AT-compatible $131 n n If on the market, at the lowest price ever offered! ..7..7 •• McTek Systems, Inc.• 1411 San Pablo Avenue• Berkeley, CA 94702 • 415-525-5129

DISK DRIVES PRINTERS MONITORS PC/XT PC/AT MISC.

Fujitsu 360k ...... $69 Citizen CD 120.. ...$159 Samsung amber $79 640k TurboMothrbrd $85 McTek286-20MHz ...... $559 Kingtech CRT Portable Kits· Fujitsu 1.2MB...... $89 Citizen CD 180... .. $189 Samsung EGA color . .. $359 10MHz TurboMothrbrd $89 Baby McTek 2868-AT XT/AT (power supply, case keyboard. monitor) Tuac~ .. P5 HPLASAR Serial2 .. . $1699 Samsung RGB color .. $259 Multi 1/0 w/disk contrir. $59 8/10 0-waiL. $269 $380/$410 Teac 1.2MB ...... $95 Epson LX-800 . .. . $219 NEC Multisync $559 640k RAM card . $39 McTek 286A 0-wait 3MB Eprom burner 4-socket$139 Toshiba 3V2' 720K ...... $99 Toshiba 321 XL ...... $559 Sony Multiscan ..... $619 2MB Expansion card . $89 4 ports on board... . $379 LCD Portable. $799 Teac3%"1.4MB.... $129 NEC P2000 $369 HGC-compat monocard.$49 RS232 2-port card ... $35 Multi 1/0 card... $55 AC power center .. $25 Floppy controller ...... $22 Call for prices of other brands Color graphic card. $49 4-serial port card .. . $79 Locking slide case.. $59 AC power strips $15 20MB Hard Disk Kit .... $279 EGA Paradise 480 . $149 Game 1/0 card . $15 200W power supply . $65 Diskette file box .. $9 30MB Hard Disk Kit .. $309 VGA Paradise $279 384k Multifunction card $69 Enhanced keyboard.. $59 MODEMS WD HD/floppy Printer or serial cable.. .$8 ST-225...... $215 Genoa Su.er VGA ...... $299 FCC-app. slide XTcase $29 controller $129 Archive Tape Backup ST-238... .$239 Everex int 300/1200 $79 150W power supply .. $49 W,1,f.11M 40MB...... $299 ST-138 30MB ...... $399 Everex 2400 external .... $195 Ill XT keyboard $42 3MB EMS (CJK) $99 ST-251 40MB ...... $369 Everex 2400 internal .. $179 Logimouse C7 $69 Clock Card $19 386-20 MHz Desk Top . Call ST-125 20MB 3\12' ...... $279 DESKTOP 286-20 MHz Desk Top . Call

Reader Service Number 42

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 59 Loop in the magazine. I'm sending in the readdisk and writedisk functions to Figure 1 - Example C code for reading and writing tracks Micro C though, and they will put them on the bulletin board or something. #incl~ Have fun with them. #define DISKREAD 2 #define DISKWRITE 3 SWAPDISK #define DISKVERIFY 4 And what about that SWAPDISK #define DISKFORMAT s #define NOMSECS 9 program I talked about? Well, it's pretty #define NUMBYTES 512 simple, too. No sense in wasting paper #define SECSIZE 2 /* 0=128, 1=256, 2=512, 3=1024 *I on a listing. Just look for it on the bul­ #define NUMTRACKS 40 letin board or on the Issue #44 disk. #define NOMHEADS 2 I should tell you why I thought it typedef char TRAC:KBU!'FER{NOMSECS*NUMBYTES]; necessary to write SW APDISK, though. typedef TRACKBUFFER *BUFPTR; Redhouse Press is using a program BUl'PTR data[Nmr.rRACKS}(NOMHKADSJ; /*array of pointers to TRAC:KBUl'FER*/ (PTS) sold by Compugraphic which can int readtrack(int drive, int track, int head, BUFPTR data) transfer word processing files to a dis­ { kette readable by a Compugraphic int ct, success = O; typesetter. PTS is pretty cheesy, but it for (ct= O; {ct++< 3} i& (!success); ) works. success=(biosdisk(DISKREAD,drive,head,track,1,NUMSECS,data)==O); One of its problems is that the return (success); "Compugraphic Diskette" (i.e., the one } that is in "Compugraphic format") can int writetraclt(int drive, int track, int head, BUFPTR data) only be drive A or drive B. All of the { Redhouse machines have 3.5 inch flop­ int ct, success = O; pies in A and B. Compugraphic for (ct= O; (ct++< 3) && (!success}; ) machines use 5 inch disk drives, so I success=(biosdisk(DISKWRITE,drive,head,traclt,1,NUMSECS,data)==O); wanted to put a 5 inch in as C. PTS, in return (success); the spirit of true "User Hostile" software, will not allow that. int formattrack(int drive, int traclt, int head) I first tried using the ASSIGN { program that comes with MS-DOS. Un­ int *tptr; /* tptr MUST HAVE sizeof(int) = 2*eizeof (ehar) */ fortunately, ASSIGN works at the DOS int et; /* as well as low order byte being at lower address */ int success = 0; level, while Compugraphic' s PTS static char formatinfo[NUMSECS] [4) = { {0,0,1,SECSIZE}, program accesses the disk with ROM {0, o, 2, SECSIZE} I {0, 0, 3, SECSIZE} I BIOS INT 13h calls (the same as our {0,0,4,SECSIZE}, {0,0,5,SECSIZE}, {0,0,6,SECSIZE}, {0,0,7,SECSIZE}, readtrack and writetrack procedures). {0,0,8,SECSIZE}, {0,0,9,SECSIZE} }; What I needed was something to reroute disk calls at the ROM BIOS tptr = (int *) formatinfo; level. for (ct = O; ct++ < NUMSECS; { It was really pretty easy. I just wrote *tptr =track I (head<< 8); a TSR (in assembly language) which tptr += 2; captures all INT 13h calls and changes } the drive number according to a routing for (ct= O; (et++< 3} && (!success}; ) table. This has been working nearly { daily for over six months now. success= (biosdisk(DISKFOitMAT,drive,head,track, I should say that, although in this 0,NUMSECS,formatinfo)==O); success = success && (biosdisk(DISKVERIFY,drive,head,track, case SWAPDISK is better than ASSIGN, l,NOMSECS,0)==0); there are still many uses for ASSIGN. ASSIGN works great for programs that return (success); access the disk only at the DOS level. It is especially nice since it lets you send *** requests to a winchester drive, which SW APDISK cannot do. (SW APDISK only works with floppy disks.)

What A Bunch Of Bull! Can you believe this? I go through all that mental torture for over two credible is if they actually print it ... at the Bend Trailways station waiting for weeks just to end up with a couple of Editor's note: Sorry Laine. If Larry can't the next bus to Istanbul. See ya. silly little programming examples. The get away with travelogs, neither can you. only thing that would be even more in- Be forewarned that at this very moment I'm • • •

60 MICRO CORNUCOPIA, #44, Nov-Dec 1988 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 NEW! Turbo Programmer (database application generator; source for library only; specify Turbo C or Microsoft) $370 PforC or PforCe++ (COM, database, windows, file, user interface, DOS & CRT) ...... $345 CQL Query System (SQL retrievals plus windows) ...... $325 GraphiC 4.1 (high-resolution, DISSPLA-style scientific plots in color & hardcopy) . . . . . $325 Barcode Generator (specify Code 39 (alphanumeric), Interleaved 2 of 5 (numeric), or UPC) $300 Vmem/C (virtual memory manager; least-recently used pager; dynamic expansion of swap file) $250 PC Curses (Aspen, Software, System V compatible, extensive documentation) . . $250 G.reen.leaf Data W!ndows (windows, menus, data entry,_interactive form design) . . $220 Vitamin C (MacWmdows) ...... $200 Greenleaf Communications Library (in term pt mode, modem control, XON-XOFF) $175 1l1rboTEX (TRIP certified; HP, PS, dot drivers; CM fonts; LaTEX) ...... $170 Essential resident C (TSRify C programs, DOS shared libraries) ...... $165 Greenleaf Functions (296 useful C functions, all DOS services) ...... $160 Essential C Utility Library ( 400 useful C functions) ...... $160 Essential Communications Library (C functions for RS-232-based communication systems) . . . $160 WKS Library Version 2.0 (C program interface to Lotus 1-2-3, dBase, Su percale 4, Quatro, & Clipper) $155 OS/88 (U **X-like operating system, many tools, cross-development from MS-DOS) ...... $150 ME Version 2.0 (programmer's editor with C-like macro language by Magma Software; Version 1.31 still $75) $140 Turbo G Graphics Library (all popular adapters, hidden line removal) . $135 CBTree (B+tree ISAM driver, multiple variable-length keys) . . . . $115 Minix Operating System (U **X-like operating system, includes manual) $105 PC/IP (CMU/MIT TCP/IP implementation for PCs) ...... $100 B-1tee Library & ISAM Driver (file system utilities by Softfocus) . . . $100 The Profiler (program execution profile tool) ...... $100 Entelekon C Function Library (screen, graphics, keyboard, string, printer, etc.) $100 Entelekon Power Windows (menus, overlays, messages, alarms, file handling, etc.) $100 TurboGeometry (library of routines for computational geometry) ...... $90 QC88 C compiler (ASM output, small model, no longs, floats or bit fields, 80+ function library) $90 Wendin Operating System Constmction Kit or PCNX, PCVMS 0/S Shells . . . $80 C Windows Toolkit (pop-up, pull-down, spreadsheet, CGA/EGA/Hercules) $80 JATE Async Terminal Emulator (includes file transfer and menu subsystem) $80 MultiDOS Plus (DOS-based multitasking, intertask messaging, semaphores) . . $80 WKS Library Version 1.03 (C program interface to Lotus 1-2-3 program & files) $80 NEW! TE Editor Developer's Kit (full screen editor, undo command, multiple windows) $75 Professional C Windows (lean & mean window and keyboard handler) . $70 Ip (tlexible printer driver; most popular printers supported) $65 Quincy (interactive C interpreter) ...... $60 EZ.ASM ( macros bridging C and MASM) $60 PTree (parse tree management) ...... $60 NEW! MicroFinn Toolkit (28 Unixesque utilities for MS-DOS) . . . $50 NEW! XT BIOS Kit (roll your own BIOS with this complete set of basic input/output functions for XTs) $50 HELP! (pop-up help system builder) ...... $50 Multi-User BBS (chat, mail, menus, sysop displays; uses Galacticomm modem card) $50 Make (macros, all languages, built-in rules) ...... $50 Vector-to-Raster Conversion (stroke letters & Tektronix 4010 codes to bitmaps) $50 Coder's Prolog (inference engine for use with C programs) $45 Virtual Memory System (least recently used swapping) $40 C-Notes (pop-up help for C programmers ... add your own notes) $40 Biggerstaff's System Tools (multi-tasking window manager kit) . $40 PC-XI NU (Comer's XINU operating system for PC) . . . . . $35 CLIPS (rule-based expert system generator, Version 4.1) $35 Tiny Curses (Berkeley curses package) ...... $35 TELE Kernel or TELE Windows (Ken Berry's multi-tasking kernel & window package) $30 NEW! SP (spelling checker with dictionary and ma111tenance tools) ...... $30 Clisp (Lisp interpreter with extensive internals documentation) ...... $30 Translate Rules to C (YACC-like function generator for rule-based systems) $30 6-Pack of Editors (si..x public domain editors for use, study & hacking) $30 Crunch Pack (14 file compression & expansion programs) . $30 NEW! Pascal Compiler & Interpreter (P-codes, standard Pascal) . $25 ICON (string and list processing language, Version 7) . . . $25 FLEX (fast lexical analyzer generator; new, improved LEX) $25 LEX (lexical analyzer generator; an oldie but a goodie) . . $25 Bison & PREP (YACC workalike parser generator & attribute grammar preprocessor) . $25 AutoTrace (program tracer and memory trasher catcher) ...... $25 NEW! Data Hanrlling Utilities in C (data entry, validation & display; specify Turbo C or Microsoft) $25 Arrays for C (macro package to ease handling of arrays) ...... $25 C Compiler Torture Test (checks a C compiler against K & R) ...... $20 Benchmark Package (C compiler, PC hardware, and Unix system) ...... $20 TN3270 (remote login to IBM VM/CMS as a 3270 terminal on a 3274 controller) $20 A68 (68000 cross-assembler) ...... $20 List-Pac (C functions for lists, stacks, and queues) . . $20 XLT Macro Processor (general purpose text translator) $20 C/reativity (Eliza-based notetaker) ...... $15 Data WordCruncher (text retrieval & document analysis program) ...... $275 DNA Sequences (GenBank 52.0 including fast similarity search program) $150 Protein Sequences (5,415 sequences, 1,302,966 residuals, with similarity search program) . . $60 Dictionary Words (234,932 words in alphabetical order, no definitions) ...... $60 U.S. Cities (names & longitude/latitude of 32,000 U.S. cities and 6,000 state boundary pomts) $35 The World Digitized (100,000 longitude/latitude of world country boundaries) $30 KST Fonts (13,200 characters in 139 mi..xed fonts: specify TEX or bitmap format) $30 USNO Floppy Almanac (high-precision moon, sun, planet & star positions) $20 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 acw!info@uunet. u u. net BBS: (512} 258-8831 Austin, Texas 78750-34 09 USA FAX: (512} 258-1342 Free surface shipping on prepaid orders For delivery in Texas add 7% MasterCard/VISA Reader Service Number 4 MICRO CORNUCOPIA, #44,Nov-Dec, 1988 61 Help For The Listless

line feeds) to create overprinting lines. Anthony Barcellos (Here's a TYPE program that's become a LIST, Provided that your printer wouldn't take of­ P.O. Box 2249 DUMP, filter, and more. After the review of LIST, fense at the file (a big proviso!), the printout Davis, CA 95617-2249 Tony tells you where to get an index of Mier~ C. would contain bold characters and underlining (916) 756-4866 - things not usually available from ASCII files. Unfortunately, this came at the price of a much he MS-DOS TYPE command has one larger file size (so many lines occurred in dupli­ gear: forward. Since TYPE won't scroll cate) and limited printer compatibility. backward, the quest for lost text has in­ With LIST I was able to create a filtered Tspired several deluxe DOS utilities. ­ copy that was nearly a third smaller and print­ non Buerg' s LIST program is justly the most able on nearly any printer. I merely followed famous of them. Buerg's concise directions in LIST.DOC, the 16- Computer users speak of LIST as though page user's guide to LIST: "excellent" or "wonderful" were part of its While displaying the troublesome file, invoke name. It's on everyone's short list of indispen­ junk filtering with Alt-] (a mnemonic command!). sable tools. But LIST raises the simple act of Press Alt-M to mark the top of the file, press End to screening a file to a high art that most of its jump to the bottom of the file, press Alt-B to mark users don't appreciate. I thought it was high the bottom, and then hit Alt-D to dump the data to time to do more than praise LIST in passing. disk. LIST asks you what filename to use and either Let's list, as it were, some of its virtues. creates the file or appends the dumped data to the end of the previously existing file by that name. How Do I List Thee? You don't have to dump the entire file, by First of all, LIST will list a file (of course). the way. Simply use Alt-M and Alt-B to mark You can scroll right and left in a wide file, as the top and bottom of any portion you want. well as the usual up and down. A toggle can You can hop through a file, picking bits and turn off the high bit on the extended ASCII set pieces. If you always use the same filename for if you are viewing a WordStar document file. the disk dump, LIST will accumulate your data Tabs can be expanded. Hexadecimal codes for in one place with its append feature. the ASCII characters can be displayed. LIST can This is a wonderfully sophisticated piece of even manage a binary file (like .COM). work, and Buerg can take just pride in the slick Buerg describes the text-processing features tool he has created. (My appreciation is mag­ of LIST as "filtering." One of his most impres­ nified by my experience in trying to clean the sive filtering feats is the elimination of ex­ file with the naked carriage returns by my own traneous garbage like control codes (often klutzy programming efforts. LIST did away found in the session-capture files of com­ with all the drudgery once I realized its munications programs). capabilities.) But Buerg goes one better by giving LIST the power to clean up messy files. That is, not only Read Your Friendly Manual can you read a file without the interference of LIST's power-user features are no secret. "noise" characters and happy faces, you can Buerg dutifully sets out the program's many write to disk a copy that matches the tidy ver­ functions in the manual. His collection of sion you've seen on screen. "exotic" applications includes file sharing Shareware authors are getting better or­ under DOS 3.x, shelling to DOS, and screen ganized and more sophisticated these days, but saving. in the past I found LIST indispensable for read­ Screen saving? No, Buerg isn't talking about ing the quirky documents that appeared on dis­ the monitor-blanking utilities that turn off your tribution disks. screen to save the phosphors. He means LIST' s I recall a particularly egregious case in peculiar practice of remembering the screen which the author used bare carriage returns (no display at the moment it was invoked.

62 MICRO CORNUCOPIA, #44, Nov-Dec 1988 If you exit LIST with the Alt-X com­ anymore, then backing off a bit. See Extended Indexing mand (rather than with Esc or FlO), Figure 1. In discussing the Letus A-B-C index LIST restores the screen to its exact ap­ While most people think of LIST as of articles from computer magazines pearance before LIST was used! Amus­ shareware, Vernon Buerg goes his own (July I August 1988), I alluded to the ab­ ingly, this option leaves no sign of way, preferring to describe the sug­ sence of Micro Cornucopia from the list LIST's activity; even the DOS prompt is gested $15 contribution as a "gift" of indexed magazines. I'm happy to restored to its original state. rather than as a registration fee. It's a report that help is available from a dif­ gift worth giving. ferent source. Listing To Port Thomas Brundage of The Logical One advanced application isn't tuck­ Vernon D. Buerg Connexion has prepared a com­ ed away with the exotic stuff. Rather, 456 Lakeshire Drive puterized index for Micro C. Mr. the nifty /S option is heralded right on Daly City, CA 94015 Brundage' s index is fairly freeform, con­ page 1. LIST uses it with redirection (415) 994-2944 (24-hr BBS) taining the requisite information on and piping. If invoked with the /S op­ issue, author, article description, and tion, LIST can grab text that has been redirected or piped to a file or the screen. Buerg's simple example of LIST's piping ability is: dir a: I list /s The DBMS for TOUGH Programmers

Instead of going to the screen, as You are an experienced application developer. A specialist. You have usual, the output of the directory com­ worked hard to get here. And you are looking for a DBMS that will maximize mand is channeled to LIST. There you your expertise. You know that all the popular DBMSs are designed for the find yourself able to scroll up and down masses - anyone can use them. You know that there are no miracles: a through the directory listing of drive A. DBMS easy enough for anyone to use cannot also be the right one for you. That's one good way to improve a DOS Meet The Andsor Collection: the only DBMS that does not waste your command! talents. Many find it difficult. Because it was designed for experts. It uses an Following Buerg's guidelines, unusual concept. A combination of built-in operations and procedural lan­ created a batch file that uses Phil Katz's guage. An environment where the application logic and data are integrated PKXARC in conjunction with LIST to into one unified structure. It baffles novices, but is incredibly powerful in the read text buried in an archive file. For hands of experts. If you can tame this power, a rich reward awaits you: fully the Sacramento PC software library, I customized applications with one tenth the effort. You deserve it. Because created a disk called Volume 0, which you have worked hard for this expertise. contains descriptions of the programs available in the library. o An interactive environment where you can build and modify an To save space I had to condense the application even while it is running. D Programs one tenth their size in other systems. text files into an archive. To help the o Windows, screens, help, menus, with practically no code at all. people who try to use Volume 0 (many o A new way of relating files, can simplify applications by creating of them inexperienced computer users), relations that are impossible in other systems. I arranged to spare them the intricacies D Variable code that changes at run time, lets you perform more than one operation in the same program section. of archives by means of LIST's /S fea­ ture. If you are an average programmer, use the popular DBMSs: they have sold My solution is a batch file called millions, and you need this comfort. But if you think you are a tough READ.BAT. A command like "read programmer, accept this challenge. Write or call for our brochure and 079" goes hunting in the LIBRARY.ARC FREE demo disk. It contains two executable, real-life applications, also file for the text of LIBRARY.079. The /C showing design and programming details. There are comments and help, but option of PKXARC extracts the file to no reference manual. Study the applications. Then, if you can understand the console (screen) instead of to a disk more than half, congratulate yourself: you are ready to step up to the one file. The screen output is intercepted by DBMS that rewards expertise. piping it to LIST with the /S feature enabled. g/,e c ~l

MICRO COR"\UCOPIA #44, Nov-Dec, 1988 63 At the same time, shareware is wit­ Figure 1 - Text of Read.bat nessing a legal wrangle that seems to be breaking new ground. It's reported that off Software Enhancement Associates is els if x%1 == x goto help suing Phil Katz of PKWare for allegedly echo Preparing to display Volume %1 information. incorporating features from SEA's ARC echo Use the PgDn, PgUp, and cursor keys to scroll in PKWare' s PKARC and PKXARC. echo through the information. echo Press "?" for assistance. This can hardly be argued on "look echo Press Esc or FlO when you're through. and feel" grounds (even if that argu­ pkxarc/c library li.brary.%1 I list/s ment had any merit to speak of) since goto end both SEA' s and PKWare' s programs just :help echo The proper way to use the READ command is operate from the DOS prompt. What echo "READ ###", where ### is a three-digit number can you do - complain that the com­ echo from 001 through 099. mand line uses the same letters for dif­ :end ferent options? Instead it seems that SEA believes that PKWare is using proprietary por­ page number. He uses keywords to tag Thomas Brundage tions of ARC' s code in PKARC and each item and make it easy to search for The Logical Connexion PKXARC. Is this a credible claim? As a information with the DOS FIND filter. 2523 Phipps Circle, NE disinterested observer I would have to Since the index is an ASCII file, you can Salem, OR 97305 say that it isn't. Others have already use any number of tools on it. noted that PKWare would severely The Micro C index is available for Growing And Other Pains degrade the performance of its utilities $10 in either MS-DOS or CP /M format Perhaps the shareware industry is were Katz to borrow code from the and goes all the way back to issue No. maturing. The heavy-duty computer sluggish ARC program. 1. It fits on a single disk. Brundage will publications like PC Magazine and PC When I ran some simple benchmarks update your disk for you provided you World now feel constrained to include comparing ARC and PKARC send him the original diskette, together programs like PC-Write and ProComm (January /February 1988), ARC was left with sufficient return postage. A short when they review software for word in the dust. It wasn't even a contest. I document file on the disk provides fur­ processing and communications. PC think SEA should spend more time ther details and limitations. World ran a long piece on shareware in tweaking its computer code and less its August 1988 issue. time fussing with the civil code. • • •

THE SLY40-XT ANNOUNCING THE DISKLESS WORK STATION

• The SLY40-XT is a 4-1/4" by 9-114" Card • A PC/XT Compatible Network Node Featuring the Full Functionality PC/XT • Enclosure Dimensions are just 10" by Mother Board 10" by 3-1/2" • NEC's 8MHZ V40 • No Cooling Fans are Required, so the • One Megabyte of Zero Wait State Unit is Perfectly Quiet RAM • Adds Security to • 64 ROM Space the Company's PC and XT Are Trademarks of International Business Machines • Ideal for Tough Computer System Master Card Slicer Computers Inc. Industrial Visa 3450 Snelling Ave. So. • Dealer & Distributor Applications Check SLICERtM Minneapolis, MN 55406 Inquiries are Money Order 612/724-2710 C.O.D. FAX 612/724-0878 Welcome

Reader Service Number 19 64 MICRO CORNUCOPIA, #44, Nov-Dec 1988 White Water Rafting: SOG Style 1!!11\l:l!!ll"l!"l\li!l.\"! A Very Special Trip !!:1~11·1'llllillll:l· .. l:lil!I

There's been a rumor floating around that computer technical journals have sold out to advertisers. Let me say allegorically, right here and now and for well into the future, it's not true. For instance, this is the special SOG white water raft trip we set up just for adver­ tisers. Note the whip, note the buckets of water, note the eyes. Are they having fun yet?

MICRO CORNUCOPIA, #44, Nov-Dec 1988 65 The Future Of "On Your Own" ON A Change In The Guard YOUR OWN

panies normally grow and prosper as long as By Gary L. Scott Okay ... I talk to you, I plead with you. It does the growth of the owner stays ahead of the Decision Technology no good. You think you can just go off and start growth of the company. When the company P.O. Box 5040 Aloha, OR 97006 your own business. Be a big shot. grows faster than the owner, chaos is almost a (503) 642-4196 You're no doubt the same person who leaps out certainty. of planes without checking to see if the pool's been filled and jumps off high dives without a parachute. Growth Boy, will Gary straighten you out. It is a time-warn cliche that a business never stands still, it is either growing or it is

have taken over responsibilities for this column from Dave and the gang at Micro C. Figure 1 - Company Owner Growth. This should give Dave extra time to write Ithose 1000 ... oong editorials he is so famous for. As with every changing of the guard, I plan to make some changes to the format of this column. My plan is to divide the column into COMPANY two parts, a description of an existing business, and the discussion of a topic that will be help­ ,- r=: OWNER ful to the readers starting or running a busi­ 5 ness. Taking over the column was easy. Keeping ~i ! the ideas flowing is not so easy. I would like I nothing better than to write about Micro C readers, your successes and your not-so-succes­ ses. If you have a business that you have TIME started and would like it featured in this column, please contact me at the above address or via Micro C. I would also welcome letters with questions or suggestions regarding the column. shrinking. There are two forms of growth and I am particularly interested in talking to any each has its own problems. The two types are of you who are selling high tech consulting ser­ slow growth and rapid growth. Any vices, even if you only do it part time. I would businessman worth his salt will tell you what like to do a column on consulting so I need to he wants and fears the most is fast growth. talk to as many of you as I can. Also, Micro C's At first glance it may seem that fast growth next theme issues will deal with robotics, is what you should strive for. But is it? CAD/CAM, and real-time/process control. If Everyone knows who Apple Computer and you are currently working in any of these Compaq are, but how many people remember areas, give me a call between 6 and 10 p.m., Osborne computer, Victor PC, Digital Re­ Pacific Time. search, The Pet Rock, or any of the other many examples of businesses that took off like a Death Of A Company rocket only to crash? In my experience, the thing that kills more Remember when Digital Research was on young companies than anything else is lack of the top of the heap and Microsoft was a strug­ education, and I don't mean advanced degrees. gling company? What differentiates these com­ If we look at Figure 1, there are two lines panies is that Apple, Compaq and Microsoft plotted on the graph. The first is growth of the were able to make the mid-course corrections owner and the second is growth of sales. Com- necessary to continue their growth.

66 MICRO CORNUCOPIA, #44, Nov-Dec 1988 How can you keep this from hap­ A good book on the financial aspects $500, it's the best package that I've seen pening to your enterprise? Specialized of starting and growing a business is for developing financial scenarios. education is often the answer. There are Entrepreneurial Finance, by Robert a number of alternatives for dealing Ronstadt. This book has a heavy tie-in Small Business Administration with growth and that's what this with the software package, Ronstadt's The SBA has a program that uses column is about. Financials (discussed later in this retired executives to consult with busi­ column), but is also a very good stan­ nesses. The few times that I have been Books dalone tool. Entrepreneurial Finance has exposed to this program have led me to Probably the best of the non-techni­ the best discussion I've seen of the the opinion that most of these folks cal books on starting and growing a financial problems facing a new busi­ come from "large" businesses and do business is Growing a Business, by Paul ness. Ronstadt does a very good job of not have much relevant information to Hawkins. This was a companion book explaining this very necessary and im­ impart to the small businessman. for a PBS series on starting a business. If portant part of new business planning. Even though my exposure to this you can find video tapes of the series, I have sent a list of books for posting program has been less than terrific, this get them, they are well worth watching. to the Micro C bulletin board. If you are is still a resource to be considered. If your background steers you interested in reading more on starting a There are many very capable in­ toward more technical tomes, the best business, get a copy of this bibliography dividuals out there who are volunteer­ two books are by Michael Porter, Com­ and a library card. (You could start a ing their time through the SBA petitive Advantage and Competitive small business for less than all these program. Strategy. Porter does a very good job of books will cost.) describing the inner-workings of the Information needed to order the Small Business Development Centers business machine, but these are definite­ workbooks is as follows: The SBDC network is usually at­ ly not books for a beginner. They are tached to the state college system. In hard reading even for a business school Venture Feasibility Workbook Oregon they fall under the community graduate. by Robert Ronstadt colleges; in other states they might be If you are considering starting your Lord Publishing attached to four-year institutions. own business but haven't made the (508) 651-9955; $19.95 SBDCs are normally staffed by instruc­ move yet, check out three workbooks: tors and/ or people with specialized Venture Feasibility Workbook, by Robert Your Business Plan & business experience. Ronstadt, Your Business Plan and Your Your Marketing Plan The big advantage to the SBDC net­ .Vfarketing Plan, by the Oregon SBDC by the Oregon SBDC Network work (like the SBA) is that you can nor­ .\Jetwork. Portland Community College mally find someone to talk with without Both the Venture Feasibility Workbook Small Business Development Center shelling out money. Yes, they try to sign and Your Business Plan are designed to (503) 273-2828; $10 each you up for their classes and try to sell help you develop a solid business plan. you their publications, but everything is Your Marketing Plan was written to aug­ reasonably priced. A few hours spent ment and expand the marketing section Software with a SBDC counselor can save you of Your Business Plan. There are a number of programs on many days of frustration and, more im­ If you have written business plans in the market that claim to help you write portant, a lot of money. the past, you will probably want to pur­ your business plan or run your busi­ As a side note, Dave & Micro C are chase a copy of Venture Feasibility ness. After looking at a number of them, graduates of the Central Oregon Com­ Workbook first. It takes a unique ap­ my feeling is that most of them are not munity College SBDC. If you want an proach to the traditional business plan. worth the money. There is one notable (un)biased opinion, call Dave. However, whichever workbook you exception. Editor's note: The SBDC in Bend is begin with, keep in mind one thing. If If you are planning on starting a great. When Micro C was in its rapid you cannot answer the questions in business in a big way, you might want growth phase (5 years ago), I was totally these books, you are not ready to start to consider purchasing a copy of overwhelmed. It turned out that the college your company. Ronstadt's Financials. Though it costs was just setting up the SBDC here when I

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 67 called them (I was one of their first cases). tunity to help others. I've donated many which had invested in an Oregon hard drive Fortunately, I called soon enough. Many of hours talking to local folks who dreamed of manufacturing startup. They came over the small businesses they have contact with starting their own publications or market­ (from Medford, if I remember correctly) to are already in their death throes. The only ing their own computer products. In the ask me if they should pony up another thing left for those is last rites. case of one publication, the person had no $2,000,000 or lose the $5,000,000 they'd al­ The SBDC's classes on starting small idea where to get articles, what printing ready invested. They proudly showed me a businesses are excellent. Most of the folks cost, or where to find subscribers. (We're sample of the 10 meg drive designed by have come out of those sessions realizing ALL looking for subscribers.) One computer their Bay Area guru. their dreams would be a waste of time and product was a very expensive, very limited, I asked them if they could sell the drive money. Others have come out with an even very unfinished, schematic capture program for $200 a copy and make a profit, figuring stronger belief that they'll make it because which would (eventually) run on a no­ warranty, customer support, etc. From the they have a better feeling for what they'll be longer manufactured (or supported) com­ shock on their faces, I knew the answer. I facing and what they'll need to cope. puter. recommended they save their $2,000,000. The SBDC will also give you an oppor- Three years ago I met with a group Later, I heard they'd put up the money, but the company folded shortly thereafter. The Seagate 225 had killed them.

Background It seems like almost every time a TM The Practical Union new column is started there is the C _ talk of C and Smalltalk obligatory discussion of the writer's background. To that end I have in­ cluded the following thumbnail sketch. Add a new dimension to your C compiler. I have worked in the high tech in­ From C: From Smalltalk: dustry as a software engineer for over • Ease of application delivery - • Data abstraction - data fifteen years. During most of that time I portability hiding I encapsulation have consulted on the side as a way to • Performance - speed and efficiency of C • Full object inheritance pay for my expensive high tech toys. • Familiarity of C - use all your existing • Polymorphism - message sending My clients have ranged from no-tech to C code with dynamic binding super-tech. I've spent the last two years complet­ Boost Your Productivity! C_talk's practical approach to object-oriented program­ ing my Masters in Management at a ming in C allows you to realize substantial productivity gains using these tools: local college. During that time I spent a • C_talk's Browser - a powerful • An automatic Make utility - for year working as a sales manager for a Smalltalk-like browser for building building applications small computer VAR, and am currently software objects • A Preprocessor - for converting employed as a business manager for a objects into C source code. small no-tech consulting company. • A set of Foundation Classes - to use as basic building blocks. My time is currently split between consulting on PC-based projects and in­

~- ncwaitoo !'Add .mObj<'d to tk<' ro;::civcr 5'Ct- U 1~1' obj«i'" ;already Ill lh.e ..ct '/ dependent management consulting for l'th<-ndonoth1ng '/ the Center for Entrepreneurial Ventures

I int ~ t>ool id 'p,'=pty: (CEV) in Portland, Oregon. The CEV is 11 (sdf·>SlZ<') @sc>lf apand.:t I' e>:p~nd •f full 'I [email protected]_n...... ob1m.,/'15ncwQbjed~U11o:e1Yer'/ a small publicly-funded training .t~l=OJ I' no-th.:-nfuidfirst•mpty~lot 'I s1499s

11 fo,'\,~~ ''.': -~t~il<'; •-) program for individuals who are either currently running a high growth busi­ ness or are looking for nonfinancial help Why C_talk? Order today! in starting a new company. C_talk has been proven successful in Call or write: delivering several large-scale systems in CNS, Inc. demanding realtime environments. It's Software Products Dept. • • • concise, easy to learn and use. It is 7090 Shady Oak Rd. programming in C (not a new language), Eden Prairie, MN 55344 while adhering to the Smalltalk paradigm. Tel: (612) 944-0170 C_talk is the practical, and affordable, Fax: (612) 944-0923 union. Add for shipping $5 US, $25 Intl C_talk is designed to operate with MSDOS on IBM or (30-day money-back guarantee) compatible computers. At least 512K of memory, a hard disk and mouse are recommended.

. .. providing and advancing object-oriented methodology.

C_talk is a trademark of CNS CNS is a registered trademark of CNS, Inc.

Reader Service Number 118 68 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Around the Bend Continued from page 4 2 planes ahead of me. Hoping the one behind me hadn't gotten lost. (He had.) We buzzed three airports, all prearranged. No E=M one noticed. I spotted a hawk, maybe 20 feet above me. He wheeled sharply left and disappeared. So much for yesterday, now I have to deal with a damp, Genius Begins With A Great Idea ... surprisingly noisy dawn. My air mattress is sagging. I wouldn't have noticed if that Aztec C86 4.1 Aztec ROM Systems duster pilot had stayed in bed. But he didn't. So I notice. And New PC/MS-DOS 6502/65C02 • 8080/ZSO now I, a hard-core night person, am writing in a tent, before CP/M-86 • ROM 8086/80x86 • 680x0 sunrise, in a strange and lumpy place. Boy, my fingers get stiff in this cold air. Wait a moment Superior performance, a powerful An IBM or Macintosh is not only a less new array of features and utilities, expensive way to develop ROM code, it's while I tuck them into the sleeping bag ... and pricing that is unmatched make better. Targets include the There, that's better. The door of my mountain tent is open, the new Aztec C86 the first choice 6502/65C02, 8080/Z80, 8086/80x86, of serious software developers. and 680x0. it gives me just enough light to see the Kaypro 2000 screen. Aztec C has an excellent reputation for Really lets in the cold, though. producing compact high performance Very still outside, the air hasn't awakened yet. Aztec C86-p ...... $199 code. Our systems for under $1,000 • optimized C with near, far, h~e. outperform systems priced at over My fellow travelers? I don't know. There are all types; ex­ small, and large memory - lnhne $10,000. cept for a couple they're pretty much retired. Most have lots assembler - lnline 8087/80287 - ANSI support - Fast Float (32 bit) - Initial Host Plus Target .. $ 750 of time for piddling with airplanes, a few have money. Some optimization options • Manx Aztec of the craft are owned by as many as 13 people, and I can im­ 8086/80x86 macro assembler Additional Targets ...... $ 500 •Aztec overlay linker (large/small ROM Support Package .... $ 500 agine 13 people standing in a circle drawing straws to see model) • source level debugger • who gets the plane for this tour. object librarian • 3.x file sharing & Most are pretty simple: 65-horse Continental or Franklin locking • comprehensive libraries of Vax, Sun, PDP-11 ROM UNIX, DOS, Screen, Graphics, and (whatever was around 40 or 50 years ago). Tiny wood or special run time routines. HOSTS metal prop. A wooden or tubular frame covered with cotton Call for information on Vax, PDP-11, Sun and other host environments. and varnish (lots of varnish). No radio. Few instruments. Con­ Aztec C86-d ...... $299 ventional landing gear with tiny tail wheels. Some don't even • includes all of Aztec C86-p • Unix have compasses. (We each received a map showing the week's utilities make, diff,grep • editor • Cross Development 6+ memory models • Profiler. Most Aztec C systems are available as route. Now I understand why it's a highway map.) cross development systems. Hosts Shucks, the crop duster is back. Landing on the taxi way, Aztec C86-c ...... $499 include: PC/MS-DOS, Macintosh, CP/M, he sidles up to his giant chemical vat and refills. A chemical • includes all of Aztec C86-d • Vax, PDP-11, Sun, and others. Call for Source for library routines • ROM information and pricing. smell slowly envelopes my tent. With a second roar, he's off Support • CP/M-86 support • One again. Coughing has almost completely drowned out the snor­ year of updates. ing. CP/M • 8080/Z80 ROM C compiler, 8080/Z80 assembler, The snoring's coming from the Jack tent. I had expected Third Party Software linker, librarian, UNIX libraries, and better from pilots, but there was a smoking and drinking A large array of support software specialized utilities. (never go anywhere without their Jack) crowd. Smoking is is available for Aztec C86. Essential deadly, especially above 10,000 feet. They can't breath. Graphics • C Essentials • C Utility Aztec c 11-c CP/M & ROM .... $349 Library • Greenleaf Com. • Greenleaf CP/M ...... My hands are getting really cold, think I'll just shut down. General • Halo • Panel • PC-lint • Aztec C ll·d $199 PforCe • Pre-C • Windows for C • Sunday 4:44 p.m., Roseburg Windows for Data • C terp • db Vista • Phact • Plink86Plus • C­ How To Become A User I'd assumed we were flying low because of the clouds and tree. because we were tiptoeing through the Portland Control Zone. To become an Aztec C user call 800- 221-0440. From NJ or international But the weather has cleared a bit, Portland is well behind us, C' Prime locations call 201-542-2121. Telex: and we're still hugging the deck. Close enough to read high­ PC/MS-DOS• Macintosh 4995812 or FAX: 201-542-8386. way signs, close enough to race, nose to nose, with unsuspect­ C.O.D., VISA, Master Card, American Apple II • TRS-80 • CP/M Express, wire (domestic and ing cars, close enough to watch kids play squareball on small These C development systems are international), and terms are available. town streets. unbeatable for the price. They are One and two day delivery available for all earlier versions of Aztec C that domestic and most intP.rnational I'm on edge, traveling through narrow valleys. Rounded originally sold for as much as $500. destinations. hills which look insignificant from 10,000 feet now rise far Each system includes C compiler, Aztec Systems bought directly from above me. assembler, linker, librarian, UNIX Manx have a 30 day satisfaction routines, and more.. Special guarantee. Most systems are UP9radable After the rude wake-up, this morning was eventful. Low discounts are available for use as by paying the difference in pnce plus scud hid the hills as we crawled out of tents and bags, so we course material. $1 O. Site licenses, OEM, educational, aborted our planned hop to Florence. C' Prime ...... $75 and multiple cop,t discounts are available. Florence is on the Oregon coast, which means ducking through twisty little valleys to reach the ocean. (Then you face -..."""#" =':,, ""= ~ tl To order or for informali<*n eaJI today. the coastal fogs.) Instead we headed south, following, as long as we could, -•Manx r Software= l"n Systems11-800-221 In NJ or international Ctl1t ·0440(a1) 542-2121 the broad Willamette valley. A few minutes after takeoff I One Industrial Way TELEX 4.995912 Eatontown, NJ 07724 Reader Service Number 17

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 69 THE NEW 65/9028 VT ANSI VIDEO TERMINAL BOARD! Around the Bend Continued from page 69 * FROM LINGER ENTERPRISES * A second generation, low cost, high performance, mini noticed my generator wasn't working. After kicking myself for sized, single board for making your own RS232 Video Terminal. This highly versatile board can be used as a not paying more attention during run-up, I shut off running stand alone video terminal, or without a keyboard, as a lights, strobe, radio, everything that used electricity (the spark video console. VT100, VT52 Compatible. plugs have their own power) and grabbed the map. The largest FEATURES: MICRO SIZE! * Uses the new CRT9128 Video Con- nearby airport was Salem; I waited until it showed up off my troller driven by a 6502A CPU right wing and turned on the radio. * On-Screen Non-Volatile Configuration * 10 Terminal Modes: ANSI, H19, "Salem Tower, Stinson 8077K, five miles east, with an electri­ ADM-5, WYSE 50, TVl-920, KT-7, HAZ-1500, ADDS 60, QUME-101, and cal problem. Is there a mechanic on the field?" Datapoint 8200 "77K wait one. * Supports IBM PC/XT, and Parallel ASCII Keyboards "77K, Roger on the mechanic. Active runway is 31, you're * Supports standard 15.75 kHz (Horiz.) cleared to land." * Composite or Split Video (50/60 Hz) * 25 X 80 Format with Non-Scrolling The mechanic found a tripped circuit breaker and I was on User Row my way again. (Hey, I help people with their computer * Jump or Smooth Scroll * RS-232 at 16 Baud Rates from 50 to 19,200 * On Board Printer Port * Wide and Thin Line Graphics * Normal and Reverse Screen Attributes w/100 Page Manual * Cumulative Character Attributes: De-lnten, ADD $40 FOR A&T Reverse, Underline and Blank 10 Programmable Function Keys and OPTIONAL EPROM FOR * PC/XT STYLE SERIAL Answerback message KEYBOARD: $15 * 5 X 8 Character Matrix or 7 X 9 for IBM Monitors SOURCE DISKETTE: * Mini Size: 6.5 X 5 inches PC/XT FORMAT * Low Power: 5VDC@ .7A, ± 12VDC 511. IN. $15 @20mA. Digital Research Computers P.O. BOX 381450 • DUNCANVILLE, TX 75138 • (214) 225-2309 Call or write for a free catalog on Z-80 or 6809 Single Board Computers, SS-50 Boards, and other S-100 products.

TERMS: Add $3.00 postage. We pay balance. Orders under $15 add 75~ handllng. No C.O.D. We accept Visa and MasterCard. Texas Res. add 6-1/4% Tax. Foreign orders (except Canada) add 20% P & H. Orders over $50 add 85~ for Insurance. Reader Service Number 32 Flying in Formation with another Stinson.

dp_MAX problems all the time, and I didn't suspect a silly circuit breaker? Cost me $10, too! Ah well, it's vacation.) The Cottage Grove Experimental Aircraft Association was holding its summer barbeque, so (by pure coincidence) we (22 dBass III Too Is in planes) dropped in for lunch. Made very quick work of their hamburgers. Turbo Pascal 4.0 It was in Cottage Grove we learned that Florence had been waiting for us. They'd had 150 people at the airport, complete with the Florence High School Band. (A real band, no one's ever Complete Suppod for- dBase Ill files. met me with a band before.) We gathered in the Cottage Grove DBF. NDX. DBT file & r-ecor-d Access. airport office to sha :e the news and kick ourselves for not send­ Fully Compatible dBase Ill B• free ISAM. ing out scouts (planes with radios) to see if the coast was clear Libr-anJ of 100+ functions in TP4 Unit. (or clear enough). Allol•JS 250• files & indexes open at once. The trip's been so exciting, we'd have risked life and limb to LRU file caching, rnund rnbin file managet·. hear that band. Gives you some idea. As I enter this, I'm sitting next to the Stinson on hot gravel­ covered blacktop. We're in Roseburg, our overnight stop, and I'd dBASE III + dp_MAX better get off this computer and set up the tent. The red sun isn't Turbo Pascal 4. O going to be red forever, and nights here can be thunderstormy.

Max SoffoJat·e Consult ants, Inc. Monday 8 p.m., Grants Pass 4101 Greenmount Avenue First day of work I've missed in a long time. Feels good to be Baltimor-e, MD 21218 away. Almost forgot about the magazine, Micro ... ??? (301)-323-5996 It's a lazy afternoon, clear, sunny, warm, north wind. I'm sit­ ting on my bedroll, leaning against the shady side of the Stinson. $149 Gusts are strong enough to shake the old bird occasionally. Someone said 20 knots. Tried to catch a nap inside the plane, but

Reader Service Number 103 70 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Around the Bend Continued from page 70 the sun heats things up too much when the doors are closed. When they're open, anything loose takes flight lessons. Local flying aficionados put on a picnic for us at a physician's house. It's obvious that planes make wonderful food-fellows. At least here. We're talking roast ham and turkey, FULL COMPILER - not a preprocessor uncountable salads and vegies, beer, wine, pop, and desserts. • Complete software-development system (Let me tell you about the desserts.) Stuffed ourselves for two • Selectable AT&T C++, ANSI C, K&R C solid (stolid) hours. • Based on proven Oregon Software technology Tonight's feast was a real improvement over last night when • Generates extremely fast, compact code our fare resembled untanned leather. The locals called it pizza. • Comprehensive error checking Am carrying about 60 pounds for a couple who are traveling • Backed by responsive support engineers • Strongly typed language in an ancient two-place Interstate. (I guess the name comes from the type of road they follow.) They can't haul anything more DATA ABSTRACTION FACILITY {classes) than themselves. (Themselves being significant.) I Boy, do sixty additional pounds fill up the back seat. I • Operator overloading wonder what's happening to my weight and balance, but the • Information hiding/sharing • Constructors/destructors old bird doesn't seem to notice. I burned about 6 gallons during the half-hour 50-mile flight from Roseburg to here (Grants Pass). ~ YES I I I want top perform~nce Grants Pass is drier than anything we've seen so far and it's ~..______.• . at an affordable price very hilly, much like Northern California. More afternoon To order, or for more information, call 1·800-874-8501 winds, glad we arrived early. 6915 SW MACADAM, SUITE 200, PORTLAND, OR 97219

Tuesday Evening, Montague, Calif. It's blowing like a banshee here, wind sock as straight as OREGON ii SOFlWARE starched slacks. Gusting to 30, really shaking the plane despite Iii Iii the ropes. A local said there's a chance of an afternoon Professional Products for Software Development thunderstorm if the wind dies down.

Haven't seen a windier place than this. People bend down Reader Service Number 85 and hunch their shoulders, even when they're inside. Air was quite rough coming in so it was a real relief to get the Stinson on the ground. For a lark, I landed on the hay field they said was their alternate runway. (Guess that makes them a real airport, having an alternate hay field.) It was rougher and shorter than it appeared from the air. HANDSoON PO The members of the group who watched me come in figured I'd just missed the runway. They might have been right. This morning, we took off from Grants Pass and flew about REPAlffTRAINING 60 miles into the mountains to a small untended airstrip near the logging community of Prospect. The strip was an NAG 9ffers the highest quality advanced tr~ining available for PC technjpi~os. The course ~!lQ its uphill/ downhill swath in the woods with some very sturdy docy"'ntation foe~ O!l ~h~JBM personal cqmputer looking firs at each end. Hnn~iJrom. PC to e§l~1 periph~~~I devices+and The town, an easy half-mile walk from the strip, sported a com.9'tibtes sucn ~s Compaq and AT &T. Networ!< single small diner. As we nonchalantly wandered in the front l'J)?illi'nance training !§ (llSo available. door, the waitress grabbed her apron, both menus, and an­ ~ ~j~gnose more quickly and accurately, nounced that their grill was only so by so. However, she came complete repairs faster, and reduce costs. up with 20 lumberjack-sized breakfasts in less than an hour. • Discover better diagnostics, parts sources, and new trouble-shooting tools and test units. One plane, a Piper, had magneto trouble at Prospect, right • Toll-free te<;lmical Q~lp and parts-locatqUtne, mag quit. (This is serious. If both right and left quit, the engine free techniC(ltand vendorupdate service. quits.) So he let his passenger ride in another plane while he • Used by G!~, ITT..RoekweH1.~erox, So~al flew to Medford. I followed him in the Stinson in case of further Edison, reglon9IBell companies, theU:S. Dept trouble. of Commerce, ang many otners. Ah, well, back to the present. Our five-day PC Maintenance Course is offereqin Having a laptop along has been great, it needs a lit screen so California, New York, Washington, Atlanta; Chicago, St. Louis, Dallas, Seattle, and other major cities. Call I can write in the tent at night without fussing with a candle - without obligation to geta course outline ~oo Q@test(lr burned my fingers twice. But the computer's better than paper the class locations most convenient to you. and I can recharge the little beastie while I'm flying. Looking around, I'm surprised. The Montague airport is National ... . gamey as airports go, tin hangars, white peeling buildings, ...... iAM Santa Ana, GA 92704 CorpAdva==nc .. ·. IVU·•.• ...... ·..nt ... ·..· . 2130.·····.. J.• ·•.•.. ·.. •.·(714}•. •.saut .. ··•...... •• ···.. ··•··.··.. · ....·.·.· ...· .. ··· .. •...·h·.· ..754.-7110··· •..... · •.·•. .•. ·.·.H···.·.· .. ·.·.. ·.. a...... · •. •...... · •.· .. ••.r .. ·•.. ·•. ·.b··.·.·.·.· ... ·.o······.····.··.··r····.·· grass so dead it crackles underfoot. Really feels like a ghost .. town. illComputer Hardware Training SgeeiaU~t~ But the people who work here, and the flying buffs who

Reader Service Number 59 MICRO CORNUCOPIA, #44, Nov-Dec, 1988 71 Around the Bend Continued from page 71

hang out here, go out of their way to be friendly. Plus there's a John Jones shower, a real, hot, wet, free, work-up-a-warm-lather, shower. If you have a copy of Micro C Issue #1, you know that John Haven't gotten in line yet but will definitely dig out the soap Jones wrote a short piece on his disk formatter for the Big and before the evening's over. (First shower in four days.) Board (complete with listing). He showed up again in #2 and, Don't know where I'll pitch the tent. Most of the ground is well, has been very regular since. gravelly and covered with stickerburrs. But I don't want to After seven years, he's called it quits. spend the night folded up inside the plane, and I don't want Thanks John. I've appreciated your help a lot. A whole lot. to get blown away. Shucks, was hoping to throw the sleeping bag under the wing, just once. Looking Ahead We've been joined by a home-built, sort of a flying wing You were all great when we asked for database informa- thing with its tail out front and tiny 2-cycle motor in the back. tion. So we' re asking for more ideas. (Maybe they just put the prop on backwards.) Goes 85, stalls Here are the (tentative) themes for the next year: at 50, sounds like a sewing machine. The huge wing appears Computer Aided Design - Jan/Feb very hard to control in turbulence. Bruce Eckel, Sam Azer, and a whole group of assistants are We're trapped if the weather gets nasty, but that's the way working on comparative reviews of CAD packages, but I'd it is with this kind of flying. I guess I shouldn't worry about it, like someone to come up with a complete tale of joy and woe I'm on vacation. as he did a complete project using CAD for everything from It's fun sitting here, writing for the joy of it. Writing to get schematic capture to film for the PC board. (A blow-by-blow down the feelings. To get down the thoughts I don't want to account similar to my ongoing saga with desktop publishing.) lose. It's still fresh, this touring around. It's an adventure. Tools - Mar I Apr Oops, last person's out of the shower, guess I'll fold up this Okay, so you don't qualify as a robot. You know what tools computer and grab my washcloth. are. We're talking libraries, debuggers, logic simulators, Tomorrow I'll break out of the pack, climb to 10,000 feet, program generators ... You know, tools. and make the 2-hour dash to back to the office to see if every­ If you write tools, or if you use or test them extensively or thing's OK. know what tool creators should be working on, then shout. As you probably noticed last issue, Carol will soon tell me that Robotics - May /June last issue's editorial is too short. (This isn't anticipatory journalism, My first flash when someone says robot is Heath's early this is weird.) do-it-yourself rug rat. Several engineers in my group at Tektronix used one of these wire-controlled kludges to clear the area of people from the manuals group. (It worked.) Robots are, however, much more than novelties. Twenty years ago we knew that humanoid robots would soon be doing the manual labor for society. Well, I haven't seen a humanoid in Bend lately (they've probably all moved to the East Coast), but that doesn't mean we don't have robotics. If you're working on or with a computer that can see, speak, drill, shape, weld, move ... get in touch. (Either you, or the computer.) I'm looking for theory and practice. (The Marines are looking for a few good humanoids). Handicapped Systems - July I Aug Of course, most systems are handicapped. But I'm referring to ways to make computers more available to the sensory im­ paired and to those who have trouble moving limbs. READ I WRITE I I've been thinking about this lately, and I know that as voice synthesis gets better and cheaper, it'll become standard I FORMAT /DUPLICATE in all systems, just as graphics have replaced character dis­ plays. That means I could have my X-16 read back my Disks from over 300 other micros editorials. (Faster and less addicting than sleeping tablets.) 1/0 Systems - Sept/Oct These are controllers, monitors, alarm systems, atmospheric previous versions I ailabe from . testers, and so on. The possible topics here include: a look at Upgrades av C II for Authorization controller processors (I/0 features instead of MIPs), AtoD, for on\y $25.00 a DtoA, converting temperature, pressure, humidity, stress, position, to voltage or current. Polling remote sensors ... To Order Contact: Plus there's the software end of this. How about the ~[g[Ng[Qk==)@~TM problems of developing and testing programs? Building em­ bedded systems? The PC is a good development system, how about using it as a hardware platform, too? 2210 SIXTH ST. BERKELEY, CA. 94710 UNIX - Nov /Dec (415) 644-9366 I'm looking for some UNIX pieces to run before the Reader Service Number 39 Nov /Dec 1989 issue but I'd like a real blow-out UNIX issue

72 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Around the Bend Continued from page 72

for Christmas. With the popularity of 386 systems and the equal, not just a poor little blind girl. problems OS-2 is having, UNIX might just take off. (We'll "But again, Debee is one of a handful of blind people in the shell-shock 'em.) U.S. who are really trying to contribute." Debee's demonstrations of her system were a real hit at So: SOG. We've got her scheduled for a formal presentation of If you're heavily into any of these areas, have other sugges­ computing for the visually impaired at SOG VIII. By the way, tions for articles, or whatever, call Larry, Cary, or me at 503- we're scheduling SOG VIII for July 13-16. Mark your calen­ 382-8048, or write (P.O. Box 223, Bend, Oregon 97709), or leave dars. a message for the SYSOP on the Micro C RBBS (503-382-7643, If you want to get in touch with Debee or Christy, they're 300,1200,2400). available at:

SOG VII Deborah Norling & Christy Quinn We had quite a group of women at SOG VII. Two of the Grassroots Computing stars were Deborah Norling and Christy Quinn of Grassroots PO Box 460 Computing. Grassroots Computing puts together hardware Berkeley, CA 94701 and software systems for the handicapped. Though Debee is (415) 644-1855 blind, she was an active participant in everything from white Compuserv ID: 72236,2655 water rafting and barbeque to doing two impromptu presenta­ tions. During two 11 p.m. sessions, she demonstrated how she Missing Author writes software and reads publications using only her laptop A couple of months ago, we received a really interesting and a voice synthesizer. description of the language Tenne-C. It's a substandard lan­ guage, replete with expletives. For instance, the loop and con­ ditional constructs include:

Hauloff and Do Fer, til loop Who!, longasyerattit Yehbut, nowait

68000 SINGLE BOARD COMPUTER

Debee Norling and Christy Quinn at SOG. • 512/1024K DRAM • 4 RS-232 SERIAL PORTS After SOG I called Grassroots and talked to Christy. After • FLOPPY DISK CONTROLLER • REAL TIME CLOCK meeting Debee, I was really excited about the role computers could play in the lives of the country's handicapped. Christy, a BASIC KIT( 8 MHZ) - BOARD, MICROPROCESSOR, HUMBUG MONITOR/ professional counselor, painted another picture. BASIC IN ROM, 4K SAAM, 2 SERIAL PORTS $200 "Eighty-five percent of the blind are unemployed - on PERIPHERAL TECHNOLOGY PROVIDES ACCESSORIES TO BUILD welfare. They get discounts on everything, special privileges, COMPLETE SYSTEMS! and they're used to having people do everything for them. They're the receivers. Getting something for nothing. We set PACKAGE DEAL - COMPLETE KIT WITH 10 MHZ MICROPROCESSOR, SK*DOS OPERATING SYSTEM, 512K DRAM $575 these people up with computers and they wind up in the closet (I think she means the computers). Every once in a SYSTEM BOARD( 12MHZ) - ASSEMBLED/TESTED, 1MEG RAM, 6 PC/XT while, we make a good mistake and someone takes it and runs PERIPHERAL PORTS, SK*DOS $899 with it, just like Debee did. COMPLETE INFORMATION AVAILABLE UPON REQUES "There's a cerebral palsy guy who's really blossomed; he lives on it, wrote his first letter to his folks after getting his sys­ PERIPHERAL TECHNOLOGY tem. For two years another fellow just formatted disks, then he 1480 TERRELL MILL ROAD SUITE 870 blossomed. MARIETTA, GA 30067 404/984-0742 "SOG was really exciting for Debee. After a couple days she COD/MASTER CARDNISA/CHECK decided she really fit in. Had lunch with Walter Bright (author SK*DOS IS A TRADEMARK OF STAR·K SOFTWARE SYSTEMS CORP. of Zortech's C++); they had a great discussion and she came away feeling very good about herself. She felt professional, an Reader Service Number 103

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 73 Around the Bend Continued from page 73

$325? Would you order it for $99?" It's great Culture Corner material and it's signed by "That's a no-brainer. Of course I'd jump on it for $99." Andrew B. Peed of AT&T Bell Laboratories. We haven't found Which makes my point. People always weigh price against Andrew, yet. Another clue: A note at the end states it the perceived value. (Forget about real value, these folks don't originated at the Micro Message Service RBBS 919-779-6674. have the product yet.) If the perceived value wins they buy it. (However, the SYSOP didn't know how he got it.) If not, they don't. The higher the ratio of perceived value to I'd love to find the original author and get permission to price, the larger the audience. Hauloff and Do this'n. So: everyone he talked to told him the price was too high. He just didn't realize it. Disk Technician Finally. There's a lot to be said for just getting copies out I mentioned Disk Technician in my last hard drive article there. It gets your product into people's hands so they can use and then forgot to tell you where to find it. It's available from: it, get to know it, tell their friends about it, purchase upgrades. (There's a down side to early volume. If there are problems Prime Solutions with the software or the manual, then lots of copies could 1940 Garnet Ave. mean lots of irritated owners and lots of bad publicity.) San Diego, CA 92109 At Micro C we don't make a cent off newsstands (let me tell (619) 274 5000

Dave Thompson, Larry Fogg and Gary Entsminger hold an Jim Skinner arrives at SOG fly-in. impromptu SOG meeting. you about newsstands), but we're there. Those copies are our version of inexpensive software packages. They give us ex­ posure, credibility, new subscribers, and new advertisers. Pricing Your Product They're our way of reaching the marketplace. Earlier today I was on the phone with a prospective adver.­ tiser. At the beginning of the conversation, I mentioned that he Speeding Up AT Floats would not do well in Micro C until he reduced his price. (Over Sandy uses Autocad to do our schematics. It's a good pack­ $300 for a library with source.) age, but larger drawings (like the XT schematic) get pretty While we were discussing his ad, he mentioned he was get­ slow. (Five minute redraw on an 8 MHz 80186 with an 8 MHz ting an impressive number of bingo inquiries (circle the num­ 8087.) ber ... ) from his ad in Computer Language. So we put together a 12 MHz 80286 AT clone with an 8 "They're interested but they're not purchasing," I guessed. MHz 80287 math chip and a super fast hard drive. Boy, did He agreed. that puppy scream (four minute redraw). He said he had called some of the prospects to see why Now hold on a minute. What's happening? This system they weren't ordering. Only one person mentioned the price. costs twice as much as the other one. It's got to be faster than Everyone else said: this! "We're already in the project cycle." About a week later Scott Baker called to tell me about his "Don't have a use for it yet." little adaptor board. "It isn't quite what I was looking for." "If you have an 8 MHz 80287, this'll make it run 8 MHz." He also said the people who were using it had said the real Big deal, I've got a 12 MHz AT. Sure the 287's running value of the package was far more than the price. And he slower than the 286, but it's no doubt already running faster added that they've got a 700 page manual which costs them than the 8 MHz that_it's rated. (Intel has had trouble making $50 a copy. fast 287s, so ATs have traditionally run their coprocessors sig­ "Put yourself in their shoes," I countered. "From what you nificantly slower.) see in the flyer or the ad, would you order the library for "I'll send you some benchmark programs. Run them, you'll

74 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Around the Bend Continued from page 74 be surprised." Final Comments He did. I was. An important part of SOG is the feedback we get from at­ My $250 80287 was loafing along at 6.2 MHz. At this rate it tendees. But attendees aren't necessarily representative of the might as well have been a really cheap 6 MHz 80287. No rest of you. So, it would be great if you'd take a minute and wonder Sandy's plots were slow. Okay, I popped out the lag­ fill out the survey card we've bound into this issue. There's a gardly 80287, plugged in Scott's tiny adaptor board (it stack of three cards (probably near page 64). The bottom one is generates a 24 MHz clock which the 80287 divides by three), the survey. and plugged in the math chip. Wow! Only 3 1 /2 minutes. In conjunction with the survey, I'm also interested in your Oh well. At least that 287 is finally pulling its weight. I'm life story. (With respect to computers, anyway.) Check out the wondering how fast the 287s run in 6, 8, and 10 MHz clones. short article in this issue on "Bits From Your Past." Those spendy chips are probably taking lunch breaks in the Also, be sure to see the SOG article by Barbara Hall. She middle of transcendentals. wrote the piece for Oregon Computer News. It was so much bet­ You'll find the benchmark programs in the issue #44 ARC ter than anything we could do, we asked her if we could file on the RBBS so you can see how your system is doing. reprint it. She said "yes." You can get the 80287 speed up board for $29.95 from: Finally, don't read Laine' s column right after this one. I don't want to change our cover from "The Micro Technical Sierra Circuit Design Journal" to "The Travelog For International Computer 18185 West Union Rd. Freaks." Portland, OR 97229 (503) 645-0734 David Thompson Flighty Editor

• • •

Jim Warren YOU WANT THE SOURCE?! WELL NOW YOU CAN HAVE IT! The llASTKK.FUL DISASSKllBLXI. (llD86) will create MA.SM coapatible Exciting New IBM source code from program files (EXE or COM). IBM is one of a very few computer companies that isn't And the files are labeled and coaaented so knee deep in back orders. In fact, IBM's been so successful at they become USEABLE. MD86 is an interactive disassembler with an easy to use,. word keeping up with demand, it's reportedly been able to shut processor like interface (this is crucial for down five assembly lines and lay off 900 employees. the REAL prograas you want to disasseable). However, that success may not last long. IBM has an­ With its built-in help screens you nounced the model 35. It has a fancy new 80286 processor. It's won't have to constantly refer to AT compatible. And, I'm guessing that it'll have AT-com­ the aanual either (although t patible card slots. (IBM is strongly denying that it's backing there are valuable discus-~· · sions on the ins and outs down on the micro channel.) of disassembling which - Maybe they've created this dramatic new product because you won't want to miss). '> Fl their PS-2 systems aren't very PC compatible. Maybe it's be­ .,..... c...... ,.,..,. cause micro channel cards are expensive. Maybe it's because MD86 is a professionally the micro channel performance issues are moot since IBM's supported product and yet costs no more than "shareware". And of course, it's machines aren't particularly fast. But, it's probably because no not copy protected. YKllSIOll 2 WOil AVAILABLK! one's writing software that runs exclusively on the PS-2. (I'm sure they were hoping.) llD86 Y2 is ORLY $67.50 ($1.50 sQ) + tax I took a lot of flack from some IBM employees for not being properly impressed with the PS-2 series. Now, I suppose C.C. Software, 1907 Alvarado Ave., Walnut they're ex-IBM employees. I'm sure they'll let me know. Creek, CA 94596, (415) 939·8153

Reader Service Numberl 19 MICRO CORNUCOPIA, #44, Nov-Dec, 1988 75 The Fun Has Just Begun UNITS & MODULES

Michael S. Hunt rithms, their design and usage. The module or With John Jones leaving the fold, I had a chance unit concept provides an excellent vehicle for 845 E. Wyeth Pocatello, ID 83201 to expand the Pascal Column. (Not that John didn't their presentation. (208) 233-7539 stretch things a bit with his looks at Modula and his $6 scanner.) Fortunately, at SOG, Mike volunteered Directions to do an algorithm column and this is it. (By the Most of my computer experience is from way, I understand the Army is famous for this kind academia, not the real world. Academics spend of volunteering.) a great deal of time studying and improving al­ Mike has a B.S. in Mathematics/Computer gorithms. But an algorithm is nothing more Science and he's currently a graduate student in than a mind game if you don't have a real mathematics and a teaching assistant at Idaho State problem. University. A good algorithm will often take advantage of peculiarities in the problem in order to find a solution. his column started at SOG. Dave was Though no two problems are alike, many looking for a topic for a new column, problems have similar characteristics. Often and he mentioned it at the Micro C you can manipulate a problem into a different Tforum. I suggested an algorithms form so that you can use familiar tools to solve column. I didn't realize it then, but I had the problem. Radical and unorthodox thinking walked into a trap. Dave said in an hypnotic can provide you with a view of the problem voice, "Would you be interested in writing the you might not have normally seen. With prac­ column?" I don't remember much after that. tice, it gets easier to see similarities between the After my head cleared, I found myself sitting in current problem and previous ones. the dark staring at the computer screen. Some­ Each issue I'll throw out a programming where over my shoulder there lurked a dead­ problem. In the following issue I'll present at line. least one solution. The solution will be an algo­ So, what can I say about algorithms? An al­ rithm that I hope will be more elegant than gorithm is a finite sequence of instructions, brute force. each (hopefully) clear in meaning, that can be Left to run amuck and out of control, I'm executed with a finite amount of effort in a planning to cover the following: finite amount of time. Algorithms run naturally through the code we write. Almost every article The Black Art of Sorting in Micro C has an algorithm. Even On Your Stacks & Queues Own and Around The Bend give us an ap­ Linked Lists proach or methodology for solving a problem. Strings & Character Manipulation Tree Structures Units & Modules Arrays & Matrices And what do units and modules have to do Graphs & Networks with algorithms? Units and modules are Search Strategies abstract machines. The internal workings of the Set Operations machines or units can be hidden from the user. Design & Analysis of Algorithms The user is only concerned with what each Operations Research function or procedure does, not how it's done. Numerical Analysis A unit or module attempts to be a collection Mathematical Modeling of functions, procedures, and data types that do something. A well-designed unit should con­ I'll try not to rehash previous Micro C ar­ tain a well-designed algorithm. That way we ticles but, where appropriate, I'll include create libraries of reusable abstract tools. references to other books and magazines. This column will deal primarily with algo- All the code that I write will be available as

76 MICRO CORNUCOPIA, #44, Nov-Dec 1988 a Turbo Pascal 4.0 unit and a Mo prev then write that great virtual storage system. in the parameter list and recursion to begin (* if *) Instead I will try reducing the amount throw you off track. Procedure passing temp := n; of data to be stored. n := prev; is the second feature that attracted me prev := temp; A good example of redundant data is to Modula-2. The first was the power it Prevwhat; a spelling dictionary. Many words have gave me over large programs (5000+ end; (* if *) the same prefixes and I or the same lines). end; (* what *) roots. Mapping all the redundant se­ The ability to pass procedures is an beqin {* who *) quences would create a tangled maze of extremely powerful tool. When used if not eoln(input) then paths. So, I'll tackle the problem with carefully you can write data handling begin (* if *) linked lists and trees. read(n); routines that are not data-type specific. What; The problem is: given a list of words, The logic of a particular algorithm can Who(n,What); how do we store them on disk (or in be contained in a procedure or unit, but write(' ',n:l); memory) so we can use them as a dic­ all the routines that are specific to a end C* if *); tionary? end{* who*); data type are passed in the parameter That also leads to other questions list. procedure Whereinput; like: How do we check words in a text This works particularly well for the var endWho : integer; file? How do we add words to or delete swap and comparison routines in a sort procedure EndWhat; words from the dictionary ... ? algorithm. You can build a very flexible begin Think about it. I'll take a look at this sort package by creating a set of swap end; (* endwhat *) problem and tell you what "WhatAmI" and comparison routines for each data does in the next exciting episode of begin ( * whereinput *) type you use. Then code several sort al­ endWho := MAXINT; "Units & Modules." gorithms and design them to import the Who(endWho,EndWhat); swap and comparison routines through writeln; end; (* whereinput *) the parameter list. Finally you use some • • • selection criteria in an IF or CASE state­ begin ment to call the correct sort package. Whereinput; Contrary to popular myth, Quicksort end. {* program *) *** is not the best sort for all data sets. So,

MICRO CORNUCOPIA, #44,Nov-Dec, 1988 77 Letters Continued from page 6

RAM Speed Debate balanced view of issues such as these in Giving a lot of copies to user groups I read with interest Gary the future." backfired. DBASIC became known as Entsminger' s comments in the Tidbits In the first place, Isaacson can­ the free BASIC. I'm still getting letters column (Micro C issue #42) regarding not be wrong. He's from Indiana. In­ asking for free copies. I was charging RAM chip speeds. Gary must have an diana people invented the television $40 for single copies but giving 10-copy uncanny way of choosing chips that fall (Philo T. Farnsworth), the hand-held sets free to user groups (to get the on the very good end of the spectrum. calculator (Bowmar Brain MX-10), and software out). Unfortunately, single Dave must also be quite good at it judg­ the home video game (Magnavox Odys­ users were claiming to be user groups. ing from his editorial comments. sey). Eric's A86 assembler is so fantastic The other free BASIC, the one that I'm not as lucky. My experience is that it makes higher level languages ob­ comes with the ST, was awful. But most that with 1 wait state systems you need solete - just as Jack Purdum's Eco-C88 ST types don't program very often, so 150 nsec at 8 MHz, 120 nsec at 10 MHz, compiler is so outstanding that nobody that's the one they use. Free BASIC and 100 nsec at 12 MHz. It appears that would ever think of using assembly. competing with another "free" BASIC is the number of wait states is at least as In the second place, how many a very tough way to make a living. critical as the system speed. people read Micro C because it gives When the ST first came out, a lot of For instance, I have four banks of 120 them a balanced view? Peter Norton techies were buying it - just the right nsec 256K chips (NECs, mind you) that describes C as an "industrial strength" market for DBASIC. While I was busy run at 10 MHz, 1 wait state but not at 8 language - not safe for households turning DBASIC into a commercial MHz, 0 wait states (theoretically, they with children. I like to think of Micro C product, those sales stopped and a new should). I've also had a couple of banks as the "industrial strength" magazine. buyer came along: the drooling rock­ of 120 nsec, 64K chips that wouldn't For a balanced view there's always shooter. Rock-shooters don't write even boot at 8 MHz, 0 wait states but Mother Earth News. Micro C readers programs. would come up (albeit crash after a prefer the touched and sullied output of DBASIC had a command line inter­ short run due to parity errors) at 12 unbalanced.minds. face, just like MS-DOS and the older MHz, 1 wait state. I sure would have liked to take an CP /M and Apple II machines. ST folk, Incidentally, those who are thinking afternoon off and drive up to SOG. like the Macintosh folk, are dedicated of building a fast AT clone might be How many miles north of South Bend mouse I icon freaks and refuse to use a better off buying a cheap XT clone are you? Incidentally, it's a 90 mile command line interface. board with 256K of slow 150 nsec RAM, round trip to buy Micro C on the The biggest problem is that the ST, in and adding an Intel Inboard 386/PC. newsstand, so I've been meaning to the U.S., is a toy computer. DBASIC It comes with 1 Meg of 32-bit send for a subscription. But I forgot to was intended to be a useful BASIC. memory and costs less than what you include the check before I sealed the en­ That's why it had double-precision would pay for the 80386 and the velope. Maybe next month. floating point and transcendentals. memory chips by themselves. It runs There were lots of reasons why applications an average of three times Steven Thomas DBASIC failed; all of them were my faster than an AT, even with its 8-bit 6010 Southeast Willow Rd. fault; I did not correctly identify a I/0 setup. Tricks like hard disk caching Warren, IN 46792 market before blindly charging ahead. and remapping ROM and EGA BIOS A market is a group of folks who are into 32-bit memory help. It's almost as Editor's note: We've sent a couple of able and willing to buy a product or fast as a real 386 board, but costs a lot bicycle delivery kids to the south part of service. For instance, I can't stand the less money. Bend to give you a genuine Micro C en­ typical ST magazines. And yet, the velope· for your check. None have succeeded. magazines which support a computer Hector Santos I suspect you're either confused (do you live tell you a lot about those who own it. 2616 Berkeley Ave. in Peoria maybe?) or your town was mis­ Early in December I filed for dissolu­ Los Angeles, CA 90026 named. tion of DTACK Grounded Inc. and packed my bags. I left New Mexico at Editor's note: Gary was optimistic, but DBASIC Post Mortem the end of the year and am now in his optimism isn't always unrewarded. I I thought you might like to know Silicon Valley. DTACK did not go was conservative because I like to know my what happened to the great DBASIC ex­ bankrupt; all the bills were paid. But it machine will work. I suspect something in periment. In two words: it flopped. was obvious that the company could your system's RAS, CAS, buffering or DBASIC worked very well. Even the not survive, even with just one RAM select logic is a bit slow. That would reviewer who least liked it rated it employee. I still get about one check a make the system more demanding. (I above all the other for speed week for DBASIC. I send the checks haven't heard anything bad about the and for being bug-free. So it was an ar­ back. I don't have a business license or Japanese RAM parts.) tistic success but a marketing disaster. I manuals - most of them are in Santa sold 70 copies at $40 each during its Fe's municipal land fill. C Vs. ASM Imbalance first four months on the market, and I wish to hastily object to Tim there was no evidence of growth at the Hal W. Hardenbergh Berens' parting request (Micro C, issue end of those four months. What hap­ 1111 W El Camino Real Ste 109-406 #42, p. 6): "Please print a more pened? A lot of things. Sunnyvale, CA 94087

78 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Editor's note: Hal, I'm curious about the well. worse. I offer as evidence Borland's rock-shooter. (Don't send one, we have This isn't meant to be a review, only recent "TurboMan" series in the front of enough extra stuff around the office.) some comments on what is actually a BYTE. The ads in Micro C are not what I fairly good program (especially good call the flashy 5th A venue type, but Beware Vaccine for bulletin board SYSOPs, I imagine). rather tend towards a subdued black on While at the West Coast Computer white. Faire, I picked up a copy of Vaccine to Clark A. Calkins Keep up the good work. protect my system from viruses. C.C. Software The program examines the files on 1907 Alvarado Ave. Nathan Engle your hard disk - all executables and Walnut Creek, CA 94596 6465 Piping Rock Lane #30 important data files. It keeps a catalog Indianapolis, IN 46254 of the files along with CRC information. Editor's note: Tadas Osmolskis held a Then, before it allows a program to SYSOP session at SOC. The primary topic Editor's note: Thanks for the kind words, load, it verifies that the program hasn't was viruses and Trojans, and I understand Nathan. And, just to show how responsive been changed. no one from the group had yet seen such a we are to reader input, check out page 13 When I installed Vaccine on my AT, beasty. (We haven't.) for our first ever, inside, four color ad! I ran into a few interesting problems. It There appears to be some paranoia seems that Vaccine uses the DOS COPY among the general population, however. We Info? and FORMAT programs to make a just had a customer return a group of Micro Two years ago a friend bought a master disk which you can use to C disks because he found some remnants of used Data General One laptop (an early authorize new programs. Well, when I erased files and some sector errors. He was IBM PC compatible). Some software inserted 360K disks into the HD drive, absolutely certain we were trying to infect came with it, including an EMACS type FORMAT and COPY failed but the Vac­ his system, especially when he noticed that of editor called Epsilon. It's similar to cine installation program continued to files had been changed. (Hey, we've come a Perfect Writer, but loads a file into RAM run without taking notice of the errors. long way from the early days of public without using a swap file. The result was that all programs on domain, but this is crazy.) As for the sector The help file is somewhat incom­ all disk drives were locked out. (I mean errors, we've always been ready to replace plete, and there is no information about all programs.) The system was dead. I or refund. the origin of Epsilon: I don't even know had a prompt but I couldn't run any­ if it's a public domain or commercial thing. The step of copying the master A Pat On The Back program. authorization file to the hard disk from I've been reading your magazine off Have any Micro C devotees heard of the temporary floppy failed. The result and on for a couple of years and have Epsilon? Can anyone tell me more was that no program was authorized to finally been moved by David about it? run. Thompson's eloquent plea in Micro C I was in a panic. I thought, "The ul­ #43. If I had known before that sub­ Deborah Rose timate virus got me." Actually, the cure scribing would encourage irrespon­ 4444 Yale Station was to reboot from floppy and erase the sibility, funny articles and all that lot, I New Haven, CT 06520 Vaccine TSR from the hard drive's would have signed up a long time ago. AUTOEXEC.BAT. When I went back I'm not really an anarchist, but that's and reread the manual, all it said was just because I'm not organized enough. • • • the floppies had to be "compatible" I'd like to compliment all of your with the drive type. What they meant editors and contributors. Micro C is one was a high density disk had to be used of the few magazines that I ever read with HD drives. from cover to cover, every word, in­ Correcting this step, I reinstalled and cluding the ads. In particular, Bruce this time it went smoothly. All COM Eckel's "Delving Into The Black Arts" (I and EXE files were checked and built the board in slightly more than an authorized in addition to the master hour, but the time passed quickly.), data tables. As a further safeguard these David Thompson's "Keeping Your files were set to read-only, making it Hard Drives Running," and all of Larry that much harder for a virus to change Fogg's PC support chip articles were things. When loading a file there was a absolutely first rate. Of course, every­ slight delay while " ... program checks thing else is too, but these articles stick OK ... " flashed on the screen but, other in my memory, probably because I than that, everything worked just fine. read each of them several times (refresh The main problem is that I do a lot cycles). of program development, and before I In reference to the new format - can run a newer version of a program, I looks good. The content doesn't seem to must "authorize" it. This is a pain. have suffered for the change. As for the After a few hours I de-installed Vaccine. advertisements and Ron Schroeder's For me, maybe the system worked too comments in #43, things could be a lot

MICRO CORNUCOPIA, #44, Nov-Dec 1988 79 Kaypro Clock Fix CPM NOTES

I'm writing in response to Dr. Yates' letter in But my clock has performed flawlessly from Micro C issue #41. I assume, Dr. Yates, that your day one. Not one error through numerous Kaypro 10 motherboard is similar to my Kaypro power up/downs. If your board already in­ 1 motherboard. Even if not, what follows may cludes these changes, or if the addition of be of use. (Kaypro seems to have gone out of these components doesn't solve your problem, their way to make their model designations you might also try pulling pin 3 (WR) high thoroughly confusing.) through a lOK Ohm resistor. I bought a Kaypro 1 in December of last year If you're interested in the rest of what I've from a liquidator. The production tag indicates doped out, I hope my drawings are sufficient­ that the machine was produced in November ly clear. I haven't had time to really study all 1986, and I suspect that Kaypro made a final run to clear out its parts inventory. What's im­ portant is that this is probably the final version of their universal board. It incorporates certain changes (upgrades?) which don't appear on the Micro C schematic and are not documented in I·m self-educated in any articles. As you probably know, the Kaypro 1 is real­ electronics and a pro ly a 4-84 without the parts for the clock, modem, and SASI. So I decided to install the might argue the missing parts and document any differences be­ tween my board and the Micro C schematic. wisdom of some of Enclosed are my efforts to date. (See Figure 1.) I believe I've covered most, if not all, of the dif­ my choices.But my ferences. I only wish someone could check my work since circuit tracing is very tedious. clock has performed I'm assuming that you have access to a Micro C schematic. If not, pin 23 (PWR ON) of the flawlessly from day clock chip was originally tied high directly. On my board, pin 23 ties high through an uniden­ one. tified resistor (R53). An unmarked capacitor (C87) goes from pin 23 to ground. This capacitor is obviously an electrolytic. Based on a reading of the MM58167 A data of what I've drawn, but on the surface it ap­ sheets, past experience, and superstition, I set­ pears that Kaypro may have had an 8 MHz tled on a lOOK resistor and a 1.0 µF dipped tan­ upgrade in mind for this board. If so, I'll talum. Also, I'm using a small button type definitely try for it after I've addressed the bus lithium cell. loading problem of the 84s. For CR6 I'm using a 1N270 germanium diode in order to minimize voltage drop. (Never Van S. Vangor heard of a "1001.") And I substituted a 6.8 µF Bethlehem Tool dipped tantalum capacitor for C54. The 346C Retreat Rd. schematic says it should be 0.1 µF. But I like the Island Falls, ME 04747 idea of a moderate-sized tantalum to achieve some degree of orderly voltage decay while still Floundering Forth providing good bypass qualities. Besides, my Back in 1984 I got a copy of FIG Forth for board calls for an electrolytic at that location. the Kaypro II (from Micro Cornucopia) that I'm self-educated in electronics and a pro had the extensions added by Bob Bumala and might argue the wisdom of some of my choices. Kevin Appert. Recently I've been trying once

80 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Figure 1 - Updates to MicroC Schematic for Universal Board (Final Version).

NOTES: U76 NOT ON SCHEMATIC

N.S = NOT SUPPLIED GND U76 - 16 PIN N.C. = NO CONNECTION i 16 "SPARE" 1-7, 9-15 X = NO LONGER CONNECTED IN THE NEW CIRCUIT Vee (EMPTY) N.C. I

I I

R10 & Rl .3 NOT ON PCB I Vee

R1.3 I U36 100K U7 I R5.3 MM 58167A N.S R10 N.S CLOCK I ~ 00K ? rl ~.20:\ 2 3 I GND--i rT----<>------~PWRON C87 - N.S I ~ ~1~ LM.324 ELECTROLYTIC GND NS. I 20K 1 uF ?

______j __ I

U22 IS 74LS08, NCT A .3.9-< RESISTOR PA-<

U74 NOT ON SCHE"1ATIC

gyN.C.

I U2 U10 GND LS14 81-189 VIDEO 9 ~ PAL 30 U13 LJ20 u1 s I U10 U74 PA2 I LSl 57 PNC LS LS ' 6116 : 81-189 373 245 VDEO GNO PAL tL_h_ DIR LJ 7,9,12 11 U43 PIN 21 ,.__-___,.______12_,DA0EN GND K1J 280 29 5,6,8,10 11,13,14,15 A11------<,,___

GND y11------

LSI 4 "FORMERLY UNUSED" 16 23 '1 CLKl------+----_J U75 Vee U16 Q2 I 21 ~ LS74 6845 I CLK

016 6845

U53 NOT ON SCHEMA TIC

~-----1-6, 9-13 1------N.C. U53 - 14 PIN "8 MHz" (EMPTY) 14 Vee

Vee GND

U70 NOT ON SCHEMATIC 10 16 111 A'. 83 Vee AJ 82 GND~GNC •1 ' J70 LS157 ~~11 A SELECTED A3 16 Y2 YJ A2 Vee Vee

GND U45 U46 1 MHz U73

~31 WD CLK FORMERLY U44 "UNUSED" 1793

Vee 4 MHz

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 81 more to get a handle on the language by working through the code in Steve Burnap' s book on Forth. All was going • SEE HOW PROGRAMS WORK well until I tried to use the PAD and • EASILY MODIFY PROGRAMS TYPE words in the development of the records database. Trouble. SOURCER™ creates detailed commented source code and listings from memory and executable files. Built in data analyzer and simulator resolves data across In plain FIG Forth, the statement multiple segments and provides detailed comments on interrupts and subfunctions, "PAD 20 EXPECT Sgt. Pepper 110 ports and much more. Determines necessary assembler directives for reassem­ " causes PAD to accept characters bly. Complete support for 8088 through 80286, V20/V30, 8087, and 80287 instruction until the . When "PAD 20 TYPE" sets. We welcome comparisons with any other product, because no product comes is used to display the string, only the close to the ease of use and output clarity of SOU RC ER. characters up to are displayed. On my list of programs that I simply won't do without! However, in the KForth derived -Robert Hummel, Senior Technical Editor, PC Magazine from the extensions, the "PAD 20

SAMPLE resetprn.lst ResetPRNvl.01 SourcerL1sting 19-Apr-88 4:05 pm Pagel TYPE" only displays OUTPUT PAGE 60,1J2 "EFORTH ." Further ex- Fully RESETPRN amination of memory in the area automatic Created: 15-Apr-88 !I Version: 1.01 reveals the same string no matter what Program J is written to PAD by means of the EX­ header - 0008 data_le equ ; (0040:0008·J78h) ;------seg_a ----- PECT word. The string actually extends seg_a segroont para pub1 ic Assembler assurre cs:seg_a, ds:seg_a, ss:stack_seg_b from "HERE 63 +" to "HERE 99 +," directives resetprn proc far and consistently overwrites that part of 658E:OOOO start: 658£:0000 EB 23 Jill> short 1oc 1 658E:0002 52 65 7J 65 74 50 db 'ResetPRN-vl.Ol ', ODh PAD. The string is a group of five num­ 658E:0008 52 4E 20 76 Jl 1E 658E:OOOE JO Jl OD bers followed by the word EFORTH Determines 658E:00ll 0040 data 2 dw 40h 658E:OO!J OD DA 52 65 7J 65 data) db ODh, OAh, 'Reset Printer? S' and a series of dashes. data areas 658E:0019 74 20 50 72 69 6E and type 658E:OO!F 746572JF2024 So I did some sleuthing. 658£:0015 loc_l: 658E:0025 OE push cs After loading SCN 2 (which has 658E:0026 !F pop ds Detailed 658E:0027 .BA OO!J dx,offset data_J ; (658E:OO!J-0Dh) 658E:002A 84 09 mov ah,9 some screen clearing words, a new comments 658E:002C CD21 int 2lh ; DOS Services ah-funct1on09h ; display char string at ds:dx LOAD, etc.), PAD works okay. But 658E:002E B4 01 ah,! 658E:OOJO CD 21 int 2lh ; DOS Services ah•functionOlh TYPE caused the screen to clear and the ; get keybd char a 1, with echo 658E:OOJ2 JC 79 c~ al,79h 'y' cursor to home! 658E:0034 75 16 jne locJ ; Ju~ if not equal 658£:0036 8ElEOOll ds,data1 ; (658E:00ll•4Dh) Loading the editor (SCN 61-97) 658E:003A 88 16 0008 mov dx,ds:data_le ; (0040:0008·J78h) Simulator 658E:003E 83 C2 02 add dx,2 658£:0041 80 08 mov al ,8 caused TYPE to display characters after follows 658£:0043 EE out dx,al ; port J7Ah, printer-2 control ; al-8, initialize printer the in the string (even if they segment 658E:0044 B9 8000 cx,8000h 658£:0047 locloop_2: were garbage), up to the number re­ changes 658E:0047 E2 FE loop locloop_1 ; Loop if ex > O 658E:0049 80 oc mov al,OCh quested. SCNs 12-17 showed no change. 658E:0048 EE out dx,al ; port J7Ah, printer-2control ; al ·OCh, init&strobeoff 658E:004C loc_J: After SCN 18, the ERR/OOPS 658E:004C 84 4C mov ah,4Ch 'L' 658E:004E CD 11 int Zlh ; DOS Services ah·function4Ch words, characters after the were Easy to terminate with al-return code resetprn endp represented by an underline. However, read seg_a ends format after the Magic Incantation (SCN 7) and ;------stack_seg_b ---- stack_seg_b segment para stack the P ATCHes to QUIT, FORGET, and 659J:OOOO OOCO[FF) db 192dup(OFFh) stack_seg_b ends ERROR, the command "PAD 20 TYPE" end start returned the aberrant string. In one at­ tempt, the string didn't appear until I (Source code output and inline cross reference can also be selected) saved the new Forth after BYE. I'm not familiar enough with Forth BIOS SOURCE • CHANGE AND ADD FEATURES to know why the PAD memory and • CLARIFY INTERFACES TYPE word are corrupted by the addi­ for PS/2, AT, XT, PC, and Clones tions (which, otherwise, I find most use­ ful). I hope your resident Forth guru The BIOS Pre-Processor™ with SOURCER provides the first means to obtain accurate legal source listings for any BIOS! Identifies entry points with full expla­ might shed some light on this problem. nations. Resolves PS/2's multiple jumps for improved clarity. Provides highly descriptive labels such as "video_mode" and much more. Fully automatic. Walter J. Rottenkolber P.O. Box 936 SOURCER $99. 95 BIOS Pre-Processor* $49. 95 SO URGER w/BIOS Pre-Processor $139. 95 Visalia, CA 93279 USA Shipping & Handling $3: Outside USA $15: CA Residents add local sales tax 6. 6.5 or 7%: ·requires SOURCER All our products come with a 30 day money back satisfaction guarantee. Not copy Editor's note: Sorry, our resident Forth protected. To order or receive additional information just call! guru wandered off years ago to live in a 1-800-662-VCOM Wisconsin chicken coop. (No, I don't under­ (1-800-662-8266) stand Forthers either.) But, there must be someone out there (cooped up, no doubt) V COMMUNICATIONS who can send us an answer Forthwith. 303 t Tisch Way, Suite 905, Dept. M3, San Jose, CA 95 t 28 (408) 296-4224 PS 2. AT. XT. and PC are trademarks o1 IBM Corp • • • Reader Service Number 62 82 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Want to write for Micro C?

Short Guide For Micro C Authors: 1. Read Micro C: 7. Short and Sweet: You'd be surprised how many people think we'd Avoid long, twisted, windy, gargantuan sentences love to print their reviews of Apple II games, or their that run on and on, tied together by commas, ands, handy cheat sheet for WordStar 4.0. Fortunately, and buts, with lots of ideas - similar to, but not we're a technical journal so we're looking for people limited to, sentences such as this. (In other words, who are poking about along the front lines. (If you're keep it simple.) doing something that hasn't been done before, or Keep your paragraphs simple too. A paragraph something very technical and very intense, holler.) should contain a single, simple idea. We like short 2. Communicate: paragraphs, like this one. Articles that show up as a surprise generally don't 8. Use subheads: get run (and if they do run, it's with significant Subheads are very, very handy. They notify the revision). When David or Gary works with you, he reader of major shifts in subject, they're great for later can help you tailor the piece for Micro C or can point reference, and they aid skimming. you to another, more appropriate publication. A Subheads also help you organize your writing. For majority of these 'unsurprising' articles get printed. instance, if you need to repeat the same subhead, or 3. Be active: you can't come up with a single subhead that sum­ The verb "to be" is overused and underpublished. marizes the material which follows, then you need to Anytime you see "is" or "are" or "isn't" or "aren't," look at your organization. you're seeing passive verbs. Example: The parser is I like to have a subhead every 15 to 30 lines (on the able to scan characters as they are input. Replace screen). That's not hard and fast: sometimes it's 5 with: The parser scans keyboard characters. lines, other times it's 40, but it averages out about 4. Keep it meaty: every 20 lines. People read Micro C for information. 9. Details: 5. Keep it light: Check your facts. When you're not absolutely sure (I know, I said "Keep it meaty.") You're writing from about something, go to the source. We publish a lot experience so let readers in on the frustration and the of science fiction, at least a lot more than we'd like. fun. We call ourselves "The Micro Technical Jour­ Double check source listings. Does the copy you're nal," but just between you and me we're really just including really compile? Or did you do some last technical people talking to our peers about exciting minute cleaning up without testing? Did you include discoveries. addresses of companies, phone numbers, prices, 6. Use the first and second person. number of (if it's a book), etc? All those little First person is "I," such as the first line of #5 above. details are important to the reader. Are they correct? Second person is "you." "You" can be implied. 10. Finally, don't panic. "Keep it meaty!" implies the second person because You're not writing a book. (Usually 9K to 20K bytes I'm really saying, "You keep it meaty!" (And don't of text is fine.) And, it doesn't have to be perfect ... forget it!) (Editors like to feel useful.)

Formats: 2. Use a single space between sentences. Articles should be submitted on disk or via Micro C's bul­ 3. Leave a blank line between paragraphs. letin board (503) 382-7643, 300/1200/2400, 24 hrs.). We can 4. Don't indent paragraphs. read most disk formats except Apple, Rainbow, NorthStar, 5. Don't right-justify your article. and Eagle CP /M, but please mark the format on the disk. 6. Don't use hyphens except when they're part of a word or Your article will be easier to edit if you follow these phrase. If you let your add hyphens guidelines: automatically, we have to remove them individually. 1. Use standard ASCII format. 7. Use spaces, not tabs, even in listings.

MICRO CORNUCOPIA, #44,Nov-Dec, 1988 83 Perfect Filer Utility KAYPRO Extracting Data The Easy Way COLUMN

An empty field is indicated by a null as at By Joseph I. Mortensen If nothing else, the Perfect software series was ODOCH in the example. OFFH marks the end of 4214 Chelsea Ct. controversial. Those who liked it swore by it. a record unless the record fills an entire sector, Midland, MI 48640 Everyone else avoided it like the plague. For all its in which case it ends with null. Any unused idiosyncrasies, at least it was free with the Kaypro portion of a sector is filled with OFFH. See and people like Joe were soon writing patches and Figure 2. utilities to cover some shortcomings. Here's one. Having discovered how Perfect Filer stores data, I could proceed to write a program to convert each record and its several fields to the xtracting data from Perfect Filer (the comma-delimited format used for data files by database which came with early WordStar, MBASIC, dBASEII and many other Kaypros) is a painful, tedious process programs. After conversion, the sample Perfect Ewhich nobody should have to do even Filer record in Figure 2 would look like this once. (See my article in the July, 1988, issue of (broken into more than one line to fit magazine PROFILES.) It was an attempt to get Perfect margins): "Marguerite","","Bremer", "Mrs.", Filer to generate a comma-delimited file for use "Marg","","","636 Helicon, #285","","Minor Func­ with WordStar 4.0's MergePrint feature that tion","CA","92506","","619","5558341 ","x","","","","" finally forced me to act. ,''1'',''1'',''84''. When I examined my Perfect Filer database Every field is enclosed with double quotes, using SuperZap, I found the information in fields are separated by commas, empty fields Figure 1. are represented by"", and the record ends with

Figure 1 - Perfect Filerr Sector 0 Hex Dump

Address 00 01 02 03 04 05 06 07 -08 09 OA OB OC OD OZ OF

000000 7F 00 02 OD 58 00 00 00 00 00 00 00 00 00 00 00 000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

/*** I

Sector zero serves as a file header. It's filled a carriage return. The finished data file consists with OOH except for the first few bytes. Bytes 00 of all the records from the Perfect Filer and 01 show the number of sectors in the file in DATABASE. the usual low byte, high byte order. This ex­ ample has 007FH, so the file has 127 sectors of An Easier Way 128 bytes each. Bytes 04 and 05 contain the I finally found an easy way to extract data number of sectors in use (including sector 0), in from Perfect Filer. It's a utility program called this case 0058H or 88. PF2ASCil.COM. (You can find it on the Micro Sectors 1 and onward store the data. In un­ C RBBS or the Issue #44 disk for $6 from Micro used (erased) sectors byte 00 is OFFH. In active C.) It gets the names of input and output files records byte 00 indicates how many sectors the either from the command line or from prompts record uses. Since Perfect Filer allows up to after the program is running. It opens the Per­ 1024 bytes (8 x 128 bytes/ sector) per record, fect Filer DATABASE and creates the output byte 00 can range from 01 to 08. file. It then reads sector 0 to determine how The following example has 01 at byte 00. many sectors the input file contains. Next it ad­ Each field in a record ends with a null (OOH). vances to the first data sector (at offset 80H)

84 MICRO CORNUCOPIA, #44, Nov-Dec 1988 and reads byte 00. If byte 00 is not OFFH (marking an erased record), the program then writes OS ·09·. o~· OB oc ·oo ...· o~ OF the first double quotation mark to ~.~~-~-~~----:-: ...... _:______..,..----~-~:...,;.-.------·--~-:.:...-:------~-:----- enclose the first field, reads and writes 000000 01 4D 61 72 67 75 6$ 72 69 i4 65 00 oo 42 72 65 I.. Marguerite .. Bre I 000010 76 65 72 00 4P 72 73 2E 00 4D 61 72 67 00 00 00 lmer.)Crs .. •rg ... I each printable ASCII character until it 000020 36 33 36 20 48 65 6C 69 Ei3 6F 6E 2C 20 23 32 JS 1636 Helicon, 4281 comes to a null (the end of field 000030 35 .oo3100 155Stl341.x .••. FF l'F Fi' FF n IT n .IT IT r:rr IT IT r:rr FF I· ..... ·•··· ..... '. I (indicated by a null byte) is en­ countered, the (",") are inserted in the output. If the program finds the end of record marker (OFFH), it puts in the closing quote ("), adds a carriage return, and then moves to the next sector and starts the process all over. When all the Figure 3 _.;. PF2ASCU.COM Main WHILE Loop sectors have been read and processed, PF2ASCII reports the job finished and

WBII.g sec:NumR : IF Charcc>unt > 0 THEN WJUTELN (£2 >; INC (NumR.ecs) END; Generate List/Report option). With the Cb;arCount : 1: 128; I If¢haraciter is NULL then check next charac:- latter the output must be formatted for te:r. Tllen back up file pointer one byte to each database. The number of fields you make sure no characters are skipped. If cha.ncter is Ol to 08 (indicating start of can extract is limited to 19 even though new record) or OFFH (indicating end of record), a Perfect Filer record may have up to 70 add final c:0rama and CR. and go to next sector. fields. PF2ASCII isn't limited. If it's a printable character, put "," to separate fields. Increment character count. The input file is always named 1f·N'OLL is last character in file; add final DAT ABASE and is on the Perfect Filer doUble quote and CR, bump record counter, and data disk. If you do not enter input and end processing. *) 1F NOT EOF{f1) THEN ReadByte(fl,Ch); output names on the command line SetPos (fl, Nextl?os.(f1) -lL) ; then PF2ASCII prompts you for them. CASE Ch OF Ole .• 10C,EOR : WRITELN(f.2,, "'); CharCount .:= 128; The output works with WordStar INC (NumRecs); I 4.0's merge print which saves you the NULL, r I •• ',.., : WRITE(f2, r "' '"); INC(Cbareount); I misery of preparing data files. Because ELSE END; (* CASE *) ELSE IF EOF(fl) TUN the output is in ASCII form, data can be WRI'l&LN(f2,' '"); CharCount := 128; INC (NumRecs.) END exported to MS-DOS programs which INQ; I (* IF NOT *) accept the comma-delimited format. (* If character is printable, write it to out.put file and incr~t cnaracter.count. *) RI'l'l:(f2,Ch); INC.(CharCount); I Why Modula-2? (* If chaJ;acter is 01 to 08 (indicating a new record) write ado\lble quote to file for first field.*) Although I used Turbo Modula-2 to 01C; ; lOC ; IF CbarCount = 0 THEN WRITE ( £2 t ' '" ) ; END; write PF2ASCII, such a short program INC(Charcount); I could as easily have been coded in ,.,,, It' Character i$ anything else, ignore it, and b\ltlf) character count. *) BASIC, C, or Pascal. I happened to have El'..$EINC:(CbarCount) END (*CASE*) Modula-2 on hand and wanted more E!1t> (,. IF NOT EOF *) experience programming with it. END (* WHILE .Cha:rCount *) E!m; . (* WHILE SecNum *) /***/ • • •

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 85 Perfect Filer Utility KAYPRO Extracting Data The Easy Way COLUMN

An empty field is indicated by a null as at By Joseph I. Mortensen If nothing else, the Perfect software series was ODOCH in the example. OFFH marks the end of 4214 Chelsea Ct. controversial. Those who liked it swore by it. a record unless the record fills an entire sector, Midland, MI 48640 Everyone else avoided it like the plague. For all its in which case it ends with null. Any unused idiosyncrasies, at least it was free with the Kaypro portion of a sector is filled with OFFH. See and people like Joe were soon writing patches and Figure 2. utilities to cover some shortcomings. Here's one. Having discovered how Perfect Filer stores data, I could proceed to write a program to convert each record and its several fields to the xtracting data from Perfect Filer (the comma-delimited format used for data files by database which came with early WordStar, MBASIC, dBASEII and many other Kaypros) is a painful, tedious process programs. After conversion, the sample Perfect Ewhich nobody should have to do even Filer record in Figure 2 would look like this once. (See my article in the July, 1988, issue of (broken into more than one line to fit magazine PROFILES.) It was an attempt to get Perfect margins): "Marguerite","","Bremer", "Mrs.", Filer to generate a comma-delimited file for use "Marg","","","636 Helicon, #285"/"',"Minor Func­ with WordStar 4.0's MergePrint feature that tion","CA","92506","","619","5558341 ","x","","","","" finally forced me to act. ,''1'',''1'',''84''. When I examined my Perfect Filer database Every field is enclosed with double quotes, using SuperZap, I found the information in fields are separated by commas, empty fields Figure 1. are represented by "",and the record ends with

Figure 1 - Perfect Filer, Sector 0 Hex Dump

Address 00 01 02 03 04 05 06 07 08 09 OA OB OC OD OK OF

000000 7F 00 02 OD 58 00 00 00 00 00 00 00 00 00 00 00 000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

/*** I

Sector zero serves as a file header. It's filled a carriage return. The finished data file consists with OOH except for the first few bytes. Bytes 00 of all the records from the Perfect Filer and 01 show the number of sectors in the file in DATABASE. the usual low byte, high byte order. This ex­ ample has 007FH, so the file has 127 sectors of An Easier Way 128 bytes each. Bytes 04 and 05 contain the I finally found an easy way to extract data number of sectors in use (including sector 0), in from Perfect Filer. It's a utility program called this case 0058H or 88. PF2ASCil.COM. (You can find it on the Micro Sectors 1 and onward store the data. In un­ C RBBS or the Issue #44 disk for $6 from Micro used (erased) sectors byte 00 is OFFH. In active C.) It gets the names of input and output files records byte 00 indicates how many sectors the either from the command line or from prompts record uses. Since Perfect Filer allows up to after the program is running. It opens the Per­ 1024 bytes (8 x 128 bytes/sector) per record, fect Filer DAT ABASE and creates the output byte 00 can range from 01 to 08. file. It then reads sector 0 to determine how The following example has 01 at byte 00. many sectors the input file contains. Next it ad­ Each field in a record ends with a null (OOH). vances to the first data sector (at offset 80H)

84 MICRO CORNUCOPIA, #44, Nov-Dec 1988 and reads byte 00. If byte 00 is not OFFH (marking an erased record), the program then writes 08 09 OA oa oc OD OE OF the first double quotation mark to enclose the first field, reads and writes 01 4D 61 72 67 75 65 72 69 74 65 00 00 42 72 65 I .:Marguerite .. Bre I 76 65 72 oo 40. 72 73 2E 00 4D 61 72 67 oo oo oo I mer ,Mra .. Marg ... I each printable ASCII character until it 36 33 36 20 48 6S 6C 69 63 6F 6E 2C 20 23 32 38 1636 JJ•Ucon, 12$ J comes to a null (the end of field 35 oo 00 40 69 6E 61' 72 20 46 75 6& 63 74 69 6!' 15, .~or !'Vncti<:>I 6!f 00 43 41 00 39 32 35 30 36 00 00 36 31 39 00 lnA!A.92506; .619. i marker). It then inserts quote, comma, 32\34 31 38 33 34 31 00 78 00 00 00 00 00 31 00 15558341. x ••••• l. I quote (",") to separate the fields and 00 FF IT IT IT IT IT !':tr IT IT l'I' ff 1L 84 ...• ...... • . , I reads the next byte. If an empty field Fil' FF IT IT IT IT. IT !':tr IT l'F l'I' ff I . ; • . , ...... , . • , I (indicated by a null byte) is en­ countered, the (",") are inserted in the output. If the program finds the end of record marker (OFFH), it puts in the closing quote ("), adds a carriage return, and then moves to the next sector and starts the process all over. When all the Figtire 3 - PF2ASCII.COM Main WHILE Loop sectors have been read and processed, PF2ASCII reports the job finished and

WHILE SeCNum 0 THBN WRITELN(f2); INC(NumRecs) ENI>; CharCount : = 128.; I Generate List/Report option). With the (t If chi:lraciter is NULL then clutlok next charac- latter the output must be formatted for ter. Then backup file pointer one byte to each database. The number of fields you make sure no characters a:re skipped. If character·is 01 to 08 (indicating start 0£ can extract is limited to 19 even though new record) or OFl!'H (indicatinq end of :record), a Perfect Filer record may have up to 70 add final· comma·. and CR and go to next sector. If it's a printable character, put ", •• to fields. PF2ASCII isn't limited. separate fields, Increment character count. The input file is always named I.f. NULL is last character in file, add final DATABASE and is on the Perfect Filer double CJ:llOteand CR, bump record counter, and end processing. *> data disk. If you do not enter input and IF NOT EOF(fl) THEN ReadByte(fl,Cb); output names on the command line 8etl'os(f1,NextPos(fl)-1L); then PF2ASCII prompts you for them. CASE Ch 01!' ()lC .. lOC,EOR: WRITELN(f2,'"'); CharCount := 128; The output works with WordStar INC (NumRecs) ; I 4.0's merge print which saves you the m;JLL, ' ' •. , ..,, : WRI:TE(f2,' ", '"); INC(CharCount); I ELSE END; (* CASE *) misery of preparing data files. Because ELSE II' EOF(fl) TUN the output is in ASCII form, data can be WRI'XELN.(f2, '"'); CharCount := 128; INC (NumRecs) END exported to MS-DOS programs which END.; I {* IF NOT *) (* If character is printable, write it to output file accept the comma-delimited format. and increment character count. *) 1$I'l'E(f2,Ch); INC (CharCount); I Why Modula-2? (* If character is 01 to 08 (indicating a newrecord) write a double quote to file for first field. *) Although I used Turbo Modula-2 to OlC: . lOC : IF Charcount = 0 THEN WRITE (£2, "" ) i ENI>; write PF2ASCII, such a short program INC(Charcount); I (* If character is anything elae, ignore it, and bump could as easily have been coded in character count. *) BASIC, C, or Pascal. I happened to have ELSE INC{CJl;arcount) END (* CASE *) Modula-2 on hand and wanted more ('lo IV J!JQT JtOF *) (*

MICRO CORNUCOPIA, #44,Nov-Dec, 1988 85 moo omm omm SOG VII, Instant Replay, Tiny Einstein, & Statgraphics TIDBITS

and dimensional bizarrity to even the most By Gary Entsminger SOG VII highlights, a demo producer, and uninitiated. Mike's talk certainly stimulated 1912 Haussler Dr. statistics. Gary pretends he's the Micro C reviewer. some pretty strange conversations around Davis, CA 95616 (I don't dare say too much lest I become a statistic greater Bend. myself.) Paul Voda, author of the new programming language, Trilogy, was another sure fire hit. His discussion of programming languages in ell, it happened again. July came, general and his (and others) attempts at creat­ and along with it 300 or so of you ing a logical programming language showed made the annual pilgrimage to Bend us the logical limitations of all our favorite lan­ W for our seventh annual semi-official guages. micro-technical get-together. Thanks to those of you who made it another fun and energized event. This year's SOG was perhaps our most relaxed ever (it looks like the Intel and Motorola fanatics are going to get along after all), with four days of blue sky and sunny weather. We were especially pleased to have 11 new and stimulating speakers, as well as a dozen old favorites. Special thanks to -

Louis Baker Scott Ladd Andy Bakkers Paul Lamar Joe Bartel Greg Lobdell Ken Berry Tom Ochs Earl Brabandt Mike Sequiera Bill Davidson Reese Shepard Dan Doerr Willy Steiger Paul Voda explaining his new logical Tom Domagala Paul Voda language. Bruce Eckel Michael Vore Chuck Forsberg Jim Warren Trilogy, in my opinion, still has a ways to Allyn Franklin Bill Weinman go before it's ideal, but even in its current state Earl Hinrichs deserves serious attention from programmers needing a more logical environment for Although I don't have room here to discuss development. I'll be talking more about Trilogy all the talks, I'd like to at least mention three of in future issues of Micro C. my favorites - And Tom Ochs, creator of the equation sol­ Mike Sequiera' s Chaos 101 was a particular­ ver, "Solve It," and president of Structured ly illuminating introduction to chaos theory. Scientific Software, really opened our· eyes to Mike, a mathematics instructor at Central the very subtle problems involved in develop­ Oregon Community College (in Bend) took a ing numerical applications. standing room only crowd of programmers and Tom, a contributor to Micro C and another engineers into the depths where order and mathematician, led us deep into the world of complexity give way to utter chaos. round-off errors, approximations, and "real" Mike used movie cameras, videos, gadgets, attempts to deal with chaotic behavior in solv­ slides, equations, photographs, and stimulating ing engineering problems. Things, it seems, are conversation to open up the world of fractals not always as they seem. (A seemly comment.)

86 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Special Christmas Dreams... r ~ The Dream-286 The Dream-386 40 MB AT Compatible Quality 80386 based motherboard 6-10 MHz 0 wait state motherboard 1Megabyte80 ns on board RAM 640 K of on board RAM 2 Parallel ports and 2 serial ports 1 5.25 " TEAC 1.2M floppy drive 640 x 480 on board EGA/VGA card 40 Mb Seagate ST-251 hard drive 1.2 Megabyte 5.25" floppy drive t Hard/floppy disk controller card Western Digital WA-2 hard/floppy ~ 12" amber Samsung monitor (tilt/swivel) controller card Hercules compatible monographics card Professional enhanced (101 key) keyboard AT style keyboard Case (UL and FCC approved; reset switch, AT case (UL and FCC approved) power and turbo LEDs, keyboard lock ~ \.. Complete! $1495 Complete! $2295

" ' ~ "¥ t The Dream-88 "'8tW:iw 30 MB XT Compatible '~,· -- J XT 10 MHz Turbo motherboard 256 K of on board RAM 1 5.25 "360K Fujitsu floppy drive Networks 30 Mb Seagate ST-238 Hard drive IBM PS/2 Systems Floppy controller card (controls 2) Apple Macintosh SE Hard disk controller card 12" amber Samsung monitor (tilt/ swivel) Hercules compatible mono graphics card Hard Drives AT style keyboard XT slide case (UL and FCC approved) Seagate 20 MB w/controller .. $ 269 Complete! Seagate 30 MB w/controller .. $ 299 .. / Communications Seagate 40 MB w/controller .. $ 345 ...... ------~~ Micropolis 71MB Hard Disk .. $ 600 Tape Backup Units 1200 Baud internal ...... $ 75 Seagate 80 MB ST-4096 ...... $ 650 2400 Baud internal ...... $145 Everex internal cassette ..... $ 595 1200 Baud external (w/ cable) $ 99 Floppy Drives Everex internal cartridge ... $ 689 2400 Baud external (w/ cable) $235 Fujitsu 360K 5.25" ...... $ 79 Both are 60 MByte units PC FAX (card & software) ... $389 Fujitsu 1.2 MB 5.25" ...... $ 99 Accessories Complete PC voice mail card .$349 Sony 720K 3.50" ...... $115 Software Sony 1.44 MB 3.50" ...... $145 PC Mouse w/ paint ...... $119 Floppy drives come with mounts C-7 Logitech mouse ...... $ 89 Borland Turbo C ...... $ 79 Logitech hirez bus mouse ..... $125 Borland Turbo Pascal ...... $ 69 Citizen Printers Kraft IBM/Apple Joystick .... $ 25 Borland Turbo Basic ...... $ 69 Disk holder (100) w/keylock . $ 15 Borland Quattro ...... $189 180-D (180 cps 9 pin) ...... $189 ...... $149 MSP-40 (260 cps 9 pin) ...... $ 339 DreamTech Microsoft Windows v2.03 .... $ 69 MSP-45 (wide carriage) ...... $ 545 Microsoft DOS 3.21 ...... $ 69 5175 Moorpark Avenue Tribute 124 (200 cps 24 pin) .... $ 545 Microsoft DOS 3.30 ...... $ 99 San Jose, CA 95129 Tribute 224 (wide carriage) ... $ 689 Microsoft DOS 4.0 ...... $135 Open Monday - Saturday Premiere 35 (daisy wheel) .... $ 499 Norton Utilities (Advanced) . $ 89 10AMto7PM Alps Allegro (24 pin) ...... $ 389 Norton Commander ...... $ 45 Phone: (408) 996 - 2373

~-~ All systems carry a full 1 year warranty (original system configuration only). Prices are subject to change without notice. ~ All orders are shipped UPS FOB San Jose unless otherwise specified at time of order. California residents add 7% ~ sales tax. All registered trademarks are recognized. Dream-88, Dream-286, and Dream-386 are trademarks of DreamTech Computers. Reader Service Number 16 MICRO CORNUCOPIA, #44, Nov-Dec 1988 87 If you're working on a numerical ap­ grab screens and then edit them, insert­ Statgraphics is written in APL and plication, I suggest you get in touch ing prompts for users, timed sequences, will perform just about any statistical with Tom: if he hasn't solved your etc. This allows you to create some very function you can think of - problem, he's probably at least en­ effective demos and tutorials. • ANOVA countered and mulled over it. The simulation utilities are (effective­ • nested ANOVA ly) keystroke recorders. To use them, • multiple regression you run your program and use it. In­ • non-linear regression stant Replay records your keystrokes in • principal component analysis a macro, which you then play back as a • Kolmogorov-Smirnov tests demo or tutorial. As with the screen • Kruskal-Wallis analysis by ranks capture utility, you can edit the • Friedman two-way analysis by keystroke macro, insert prompts, and ranks change the timing of sequences. • time series analysis This is an excellent, easy-to-use, • etc. reasonably-priced ($149.95) program as well as many math functions - with many possibilities. For more infor­ • numerical differentiation mation about Instant Replay contact - • fast Fourier transforms solutions of simultaneous equa­ Nostradamus tions 3191 South Valley St. (Suite 252) • prime number generation Salt Lake City, UT 84109 • integer factorization (801) 487-9662 • etc. Statgraphics is fast (we can compute For a demonstration/tutorial of Tiny ANOVAs for 1,000 or so datapoints in a Einstein created with Instant Replay few seconds on our Rabbit AT), menu­ Bruce Eckel discussing latest C++ contact- driven, and includes excellent graphics utilities to allow you to produce Instant Replay & Tiny Einstein Acquired Intelligence manuscript quality lines and pix. As many of you know, I've been P.O. Box 2091 Editor's note: A Rabbit AT is a hare marketing an expert development sys­ Davis, CA 95617 faster than other ATs, except when doing tem since early May. (916) 753-4704 turtle graphics. One of the first problems I en­ You can plot histograms, barcharts, countered, and am still wrestling with, pies, scatterplots, and multiple x-y-z is how to circulate information about plots. You can scale graphs, include Tiny to prospective buyers. The usual confidence limits, change the color and method (at least judging from the news size of text, and even decide on which releases and propaganda we receive at side of the axes you want your (major Micro C) is to mail a page or two of and minor) ticks! hype. In addition to having access to Although this is reasonably cost ef­ numerous statistical and graphical func­ fective, it lacks the excitement of the tions, you can also export and import program itself. You've probably noticed dBASE, DIF, LOTUS, and TEXT files. In that we (Micro C) never (in contrast to fact, although Statgraphics includes a most other micro computer publica­ reasonably good database manager, we tions) publish news releases. In fact, I choose to maintain our data with rarely get even a twinge of excitement Paradox and Tiny Einstein and then ex­ from a news release. port it to Statgraphics when we need to Enter Instant Replay, a relatively analyze something statistically. new programming idea from So far, this is the best statistical pack­ Nostradamus in Salt Lake City, that age we've found, and I highly recom­ looks like it'll save me a bunch of time Relaxing at SOG. mend it for serious statistical use. At and has already begun to solve my ex­ $895 it isn't cheap, but includes excel­ citement problem. For some time now, Alison (my wife) lent support (the tech folks take your Instant Replay is a demo producer and I have been looking for a good number and call you back) and seems that's out-of-sight. You can use it three statistics package. She's a graduate stu­ fair-priced considering the quality and ways- dent at UC Davis, raised on breadth of the program. (1) to produce a prototype of a non­ mainframes, and tough to convince that For more info- existent program; a PC can manipulate the reams of data (2) to capture screens from either an she accumulates each year. STSC, Inc. existing program or to create screens for Although it's still not clear that 2115 East Jefferson St. a potential program; we've found the perfect replacement for Rockville, MD 20852 (3) to simulate the actual execution of the mainframe, we do think we've an existing program. found an excellent alternative The screen capture utilities let you Statgraphics from STSC. • • •

88 MICRO CORNUCOPIA, #44, Nov-Dec 1988 Micro Cornucopia Schematics XT SCHEMATIC

5-.30 pF 14.31818 MHz GND AD4 20 +SY -= GND ADS 26 R1 R2 S0 AD6 27 RN1 510 510 S1 AD7 28 4.7K -= -= S2 AD8 11 5 READY NP NPI 32 10 13 ROY INT AD9 F/C 30 14 AD10 NC EFI 10 RESET 29 15 RES 11 ASYNC NC 18 1 CU<88 CSYNC 8 4.77 MHz 17 At last you can plumb the mysteries of your computer with this single sheet schematic of the IBM XT'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 t~is 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 paral­ lel 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'll include a list of these checkpoint numbers and some other pertinent trouble shooting In­ formation with the schematic.

IBM PC-XT Schematic .••••••••••••.••••••••••••••••••••••• $15.00 CP /M KAVPRO 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" by 36'' 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 ~stems 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, 1/0, and disk controller (information that's not even available in Kaypro's own dealer ser­ vice manual!).

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

Kaypro 10 (without modem) . $20.00

Kaypro 2, 4, and 1O (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 Mon-Friday 9 am-5 pm PST

Mall Orders: P .o. Box 223, Bend, Oregon 9n09

MICRO CORNUCOPIA, #44, Nov-Dec 1988 89 Techtips

TECHTIPS

Revised 386 Fractal Code So far, FR386 has run on 16 and 20 MHz The way I coded the transform function for Compaqs (with both Herc and EGA/VGA FR386 (see Micro C, issue #43, pg. 22) is ineffi­ graphics), and on 16 and 20 MHz PS/2 80s .cient, slightly incorrect, and opaque. I've writ­ (standard VGA and IBM's super-duper Hi-res ten two new versions of the function; one is in VGA). I did note one problem. If a computer 16-bit 80x86 code (see Figure 1), and the other has a Herc board but you haven't run the is in 386 code (see Figure 2). The 386 version il­ program to enable graphics, the is_herc() func­ lustrates use of the "bsr" instruction. tion returns a nonzero value and FR386 starts transform() has very little effect on the speed writing to the screen in character mode. of the fractal program, but I don't want the old version of the function to stand as an example Harlan Stockman of bad coding. I'm reminded of a familiar col­ 5308 Noreen Dr. NE lege experience - turning in an exam and Albuquerque, NM 87111 realizing a split second later exactly what I did wrong. How embarrassing! EGA Screen Save/Restore If you want to save or restore a high resolu-

Figure 1 - 80x86 transform Function

c:seg public transform_ transform_: pop d.i ;return address pop ex ;iter pop bx ;switchpt sub sp,4 ;required by Desmet for short return cmp cx,bx ja do_lOQp jmp di ;short return do_loop:mov ax,bx ;init color (ex) with switchpt sub cx,bx ;ex now iter-switchpt loopit: inc ax shr cx,l jnz loopit jmp di ;short return, color in ax

Figure 2 - 80386 transform Function

cseq public transf386_ transf386 : db 67h,8bh,44h,24h,02h ;mov ax,word. ptr [esp+2} ;iter - db 67h, Sbh, 4.ch, 24h, 04h ;mov ex, word ptr [esp+4] ;switchpt cmp ax,cx ja do_bsr ret do_bsr: sub ax,cx db Ofh,Obdh,OcOh ;bsr ax,ax add ax,cx inc ax ret (continued on page 9'2.)

90 MICRO COR.'\JUCOPIA, #44, Nov-Dec 1988 5.25" HARD DISK CONTROLLER CARD 20 MEG HARD DRIVES FOR ANY MODERN 5.25" HARD DRIVE SEAGATE Model ST-225 (Full 6 Mo. Warranty)less face plate $219.95 $89.95 W/CABLE

Western Digital Controller For Model ST-225 Drive

$69.95 w/cable Yes!' These are for IBM compatible machines.

SHUGART # 465

QUAD DENSITY. 720 K, 96 TPI 1/2 HEIGHT BLACK FACE PLATE (NEW BUT HAVE COSMETIC BLEMISHES) SOLD AS IS $49.95

STEPPER MOTORS TOSHIBA 5 1/4" FLOPPY DRIVES Copal #SP-57 . -~ ti DSDD. 360 K 1/4 Shaft. 7.5 deg./step, 36 Y/ 1/2 HEIGHT Ohm. 12VDC $6.95 ~ BLACK FACE PLATE 3/16' Shaft. 35 oz." torque, 2. lA., 5VDC (90 DAY WARRANTY) $89.95 WITH BRASS GEAR, 20 TEETH, l /2" DIAMETER $9.95

LASERS TOSHIBA 3.5" DISK DRIVES IBM compatible 720K Byte Double sided Mounting kit Power & Data cable adapter l MW Laser TubeS 119.95 {;;7Jj Model " FDD 421 OGOK Power Supply (12VDC)$99.95 FULL 90 DAY WARRANTY $119.95 (These lasers are brand new and guaranteed to have a 5.25' DISK DRIVE CABINETS cosmetic defect or not meet (with power supply) manufactures full specifications. All are tested For l full height or 2 half height in our lab to insure your 1tCAB-25V5 satisfaction.) $99.95 each

those persons qual1f1ed to handle such porent1ols should do so 300 BAUD SMART MODEM (DIRECT CONNECT) LOW COST SERIAL MODEM 7 x l 0 x l l /2 $19.95 TECH NA-KIT

D-C Motor Controller

•Contro 1 2 D-C "10rors with a compute- or

CABLES-CONNECTORS-SEX CHANGERS •Will also run most 4-leaa stepper motors "XT" STANDARD PARALLEL ('0 DB 25,PO cr,36MJ #10-004 $12.95 $29.95 AC POWER CORD (6 CO·'~PUTER STANDARD MOLDED '

COMPUTER POWER SUPERVISOR CA cOW cos1 INSURANCE POL1cv $29.95 PROVIDES SURGE/SPIKE PROTECTION FOR YOUR COMPUTER!

COMPUTER AUTOMATE •5 OUT~ETS, EACH WITH A LIGHTED SWITCH •Use your computer to provide autornat1on //) •I MA',TFR •'."J~,,'."JfFSWITrH

•RATED '5AMP 125\fAC 1875WATTS • l user defined sense switch ~/ DIM.12.5' x 2.5" x 14" Regular price $69.95 Your price $49.95 •6·24 VDC •4 Amps/driver (MOX current)

$29.95

PHONE: (206) 682-5025 ~ m1ii~~ pPCl~UCi~ CCJPPOPaiim1 I V1S4· I DISTRIBUTORS OF ELECTRONICS SINCE 1968 FAX: (206) 682-5593 1123 VALLEY STREET• SEATTLE, WA 98109-4425 M-F 9-6 SAT 9-5

Reader Service Number 101 MICROCORNUCOPIA, #44,Nov-Dec, 1988 91 tion EGA screen quickly (Mandelbrot 200, 16 color EGA screen, the "28000" sets, for example), there is a relatively parameter of all fwrite and fread func­ simple way to do it. The computer can tions should be changed to "16000." only "see" one bit plane at a time. So, to This produces a 64K screen file. For a save or restore a screen, you need to 320 X 200, 16 color screen, use "8000." modify the EGA's latching registers to This results in a 32K file. access each of the bit planes. These functions should compile The video controller can then map under both QuickC and Turbo C. Use the four planes, one at a time, into the either the large or compact memory PC's 64K video window. Thus you can models because of the use of far create a screen save/restore with a pointers. simple fwrite or fread to or from screen These routines were adapted from a memory. good book on graphics, High Perfor­ I set the latching register's for each mance Interactive Graphics: Modeling, plane with two outp statements, and be­ Rendering and Animating For IBM PCs cause the resulting routines are short and Compatibles, by Lee Adams. All the they're really fast. On an 8 MHz XT programs in the book are written in clone, the save_screen function takes BASIC, yet I've found it an invaluable five seconds for an entire screen. source of information on reflections, get_screen takes a mere four seconds to shading, and other similar topics. do the restore. See Figure 3 for both functions. Steven Byrnes For the high-res EGA mode (640 X 10510 Emnora 350 with 16 colors), the file produced is Houston, TX 77043 Integrand's new Chassis/System is not another 115,200 bytes. save_screen and IBM mechanical and electrical clone. An entirely fresh packaging design approach has get_screen can also be adapted to work • • • been taken using modular construction. At with other EGA modes. To save a 640 X present, over 40 optional stock modules allow you to customize our standard chassis to nearly any requirement. Integrand offers high quality, Figure 3 - Quick EGA Scrttn Save/Restore advanced design hardware along with applications and technical support all at prices void save_screen (char fil.ename {13]} competitive with imports. Why settle for less? char far *scrnptr; !'ILE *f;

scrnptr = (char far *) OxaOOOOOOO; /* set up ptr to EGA mem */ Rack & Desk f = fopen (filename, "wb"}; /*open file for binary write*/ outp (Ox3ce, 4); outp (Ox3cf, O}; I* set to read plane 0 *I PC/AT Chassis fwrite (scrnptr, 28000, l, f); I* save plane 0 */ outp (Ox3ce, 4); outp (Ox3cf, 1); I* set to read plane l *I £write (scrnptr, 28000, 1, f); I* save pl.ane 1 *I Rack & Desk Models outp (Ox3ce, 4); outp (0x3cf, 2}; /* set to read plane 2 *I Accepts PC, XT, AT Motherboards and fwrite (scrnptr, 28000, 1, f); I* save plane 2 *I Passive Backplanes outp (Ox3ce, 4); outp (Ox3cf, 3}; I* set to read plane 3 */ fwrite (scrnptr, 28000, 1, f); l* save plane 3 Doesn't Look Like IBM *I outp (Ox3ce, 4); outp (Ox3cf, O}; I* reset to read plane 0 *I Rugged, Modular Construction fcl.ose (f); save_screen */ Excellent Air Flow & Cooling I* Optional Card Cage Fan Designed to meet FCC void 9et_screen (char filename [13}) { 204 Watt Supply, UL Recognized char far *scrnptr; /45W & 85W also available FILE *f; Reasonably Priced scrnptr '"' (char far *) OxaOOOOOOO; /* set up ptr to EGA, mein */ f = fopen (filename, "rb"}; /*open file for binary read*/ if (f==NOLL) return; /* if error openinq file, return */ -~ ;;=w=~,,,,,--;. r=;. - - ;;;;:::::;;...... -· _::~······ . !!~!~~~··- . .--. --- ~~~...... ···· . outp (0x3¢4, 2); outp (Ox3cS, 1}; I* set to write plane 0 */ fread {scrnptr, 29000, l, f); I* 9et plane 0 */ outp (0x3¢4, 2); outp (Ox3cS, 2}; I* set to write plane 1 */ fread Cscrnptr, 28000, l, f); I* 9et plane l */ Call or write for descriptive brochure and prices: outp (0x3c4, 2); outp (0x3cS, 4); I* set to write plane 2 */ fread {scrnptr, 29000, 1, f); 8620 Roosevelt Ave. • Visalia, CA 93291 /*.. qet. plane 2 */ outp (0x3c4, 2); outp (0x3c5, 8}; /* set to write plane 3 */ 209/651-1203 fread (scrnptr, 28000, l, f); I* qet plane 3 */ TELEX 5106012830 (INTEGRAND UD) outp (0x3c4, 2); outp (0x3c5, Oxf}; /*restore latch register*/ EZLINK 62926572 fclose (f); We accept BankAmericard/VISA and MasterCard /* get_screen */

IBM, PC, XT, AT trademarks of International Business Machines. Drives and computer lx>ards not included. /***/

Reader Service Number 22 92 MICRO CORNUCOPIA, #44, Nov-Dec 1988 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 114 inches by 1 314 inches.

OPT-TECH SORT/MERGE Want to Throw Out your U.P.S. Log Book? Now You Can! Extremely fast Sort/Merge/Select utility. RAM DISK Run as an MS-DOS command or CALL Here's what EASY-SHIP can do for you: as a subroutine. Supports most lan­ S-100 Automatic U.P.S. Shipping to all of U.S & Canada. guages and filetypes including 2 Meg, Port 1/0 Fast, Easy Multiple-Shipments with All Options. and dBase. Unlimited filesizes, multiple U.P.S. Approved Shipping Labels & C.O.D. tags. keys and much more! MS-DOS $149. New, Warranteed Access to your ASCII Customer Data File. U.P.S. Approved Reports and Manifest Summary. XENIX $249. $775 Approved Nati

16 Megabytes EMS and/or snOOp -World's Best Disassembler. Extended Memory Turns any program to assembler source, Get Inside Your Program Today! •Works on 8 or 16 bit bus comments each line of code. 8086 to 80386 processors and coprocessors. DOS Analyze and improve your Inside' Turt>o C program ... function by function! Inside' Turt>o Pascal $ • 16 bit transfer on AT bus XT and AT calls, ports, EMS functions, topview calls Inside follows your program Inside' IJuock C 7500 •Single board design through execution counts, ::::: ?:'roso~Pascal - minimum, maximum .. and total Inside' M~rosott Fortran Each •Includes RAM disk and Compatible and gets - all supported and unsupported elapsed times with microsecond Inside' LattlCe c ccxJ.es. Batch or interactive. Built in ccxJ.e­ ~=~~l~~=nted Inside' Log-Modtia-2 extensive diagnostics detail now! VlsaJMastercard Accepted •Quantity/OEM discounts sensitive help. Best way to: Le.am Assem­ bler, modify software when sdurce is una­ (800)537-5043 Designed, vailable, find and disarm viruses, or just Paradigm Systems Manufactured, snOOp. $49.95 TriDOS P.O. Box 152 Milford, MA 01757 Sold and Serviced by 4004 SW Barbur• Portland, OR 97201 907 North 6th St. Lake City, MN 55041 (612)345-4555 VISNMC, AMEX, COD 800-237-9111 Reader Service Number 54 Reader Service Number 117 Reader Service Number 113

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 93 Micro Cornucopia Back Issues Is There A Gap In Your Info?

Fill in ~our Back Issues of Micro C today!

ISSUE #1 (8181) Cheap Fast Modem ISSUE #23 (4/85) ISSUE #33 (12/86) ISSUE #39 (1/88) Power Supply Nevada COBOL Review Automatic Disk Relogging SOLD OUT PC Graphics RAM Protection BBi Printer Interface Interrupt Drive Serial Printer Drawing The Mandelbrot And Video Wiggle Kaypro Reverse Video Mod Low Cost EPROM Eraser ISSUE #34 (2/87) Julia Sets 1/2 PFM.PRN 44 pages Smart Video Controller SOLD OUT Desktop Graphics 16 pages Review: MicroSphere RAM Disk Designing A PC Work­ ISSUE #14 (10/83) Future Tense Begins ISSUE #35 (4/87) station Board ISSUE #2 (10/81) BBi! Installation 86 pages SOLD OUT Around the TMS-3401 O Parallel Print Driver The Perfect Terminal 96 pages Drive Motor Control Interface To Electronic ISSUE #24 (6/85) ISSUE #36 (6/87) Shugart Jumpers Typewriter C'ing Into Turbo Pascal Mouse Control ISSUE #40 (3/88) Program Storage Above PFM BBi Video Size 8" Drives On The Kaypro Build A Midi Interface The Great C Issue 1/2 PFM.PRN Video Jitter Fix 48 Lines On A BBi For Your PC 11 C Compilers 16 pages Slicer Column Begins 68000 Versus 80x86 Designing A Database, Part 2 Writing A Simple Parser In C Kaypro Color Graphics Review Soldering: The First Steps Interrupts On The PC C++, An Object Oriented C ISSUE #3 (12/81) 48 pages 88 pages Hacker's View of MS-DOS Source Level Debugger For 4 MHz Mods Vs 3.X Turbo C Configuring Modem 7 ISSUE #15 (12183) ISSUE #25 (8/85) Digital To Analog Conversion, 96 pages Safer Formatter Screen Dump Listing Why I Wrote A Debugger A Designer's View Reverse Video Cursor Fixing Serial Ports The 32-Bit Super Chips 96 pages ISSUE #41 (5/88) FORTHwords Begins Playing Adventure Programming The 32032 Artificial Intelligence 16 pages SBASIC Column Begins Modula II ISSUE #37 (9/87) 3-D Graphics Upgrading Kaypro II To 4 RS-232C: The Interface Desktop Publishing On A PC Neural Networks ISSUE #4 (2182) Upgrading Kaypro 4 To 8 104 pages Build Your Own Hi-Res Graphics Logic Of Programming Keyboard Translation 48 pages Scanner For $6, Part 1 Languages More 4 MHz Mods ISSUE #26 (10/85) Designing A Database, Part 3 Applying Information Theory Modems, Lyne, and S10s ISSUE #16 (2/84) Inside ZCPR3 Controlling AC Power 96 pages Undoing CP/M ERASE Xerox 820 Column Restarts Two Megabytes On DSl-32 From Your PC Keyboard Encoder BBi Double Density SOGIV Expanded Memory On The ISSUE # 42 (6/88) 20 pages BBi! 5"/8" Interface Fix The Future Of Computing PC/XT/AT Maintaining PCs Kaypro ZCPR Patch Graphics In Turbo Pascal Uninterruptable Power Keeping Your Hard Drives ISSUE #5 (4182) Adding Joystick To Color 104 pages Supply For RAM Disks Running Word Processing Graphics 96 pages Troubleshooting PCs Two Great Spells Recovering Text From Memory ISSUE #27 (12185) XT Theory of Operation Two Text Editors 52 pages SOLD OUT ISSUE #38 (11 /87) Simulating A Bus Double Density Review Parallel Processing Ray Tracing Scribble, A Formatter ISSUE #17 (4/84) ISSUE #28 (2/86) Laser Printers, Typesetters 96 pages 20 pages Voice Synthesizer Pascal Runoff Winners And Page Definition 820 RAM Disk Rescuing Lost Text From Languages ISSUE #43 (9/87) ISSUE #6 (6/82) Kaypro Morse Code Interface Memory Magic In The Real World Building Databases BBi EPROM Programmer 68000-Based System Review Introduction To Modula-2 Build A Graphics Scanner Build a C Database Customize Your Chars Inside CP/M 86 First Look At Amiga For $6, Part 2 Selecting a dBase Ill Double Density Update 56 pages Inside The PC Writing A Resident Program Compatible Compiler Terminal In FORTH 104 pages Extractor In C Working with Paradox 24 pages ISSUE #18 (6/84) 96 pages Designing Custom PC Cards Kaypro EPROM Programmer ISSUE #29 (4/86) Accessing dBase Ill Plus ISSUE #7 (8182) 110 Byte: A Primer Speeding Up Your XT Records from Turbo Pascal 6 Reviews Of C Kaypro Joystick Importing Systems 96 pages Adding SK Of RAM Serial To Parallel Interface From Taiwan Viewing 50 Hz Business COBOL Prototyping In C On Your Own Begins 60 pages C Interpreters Reviewed ••• 24 pages Benchmarking The PCs ISSUE #19 (8/84) 104 pages ISSUE #8 (10/82) Adding Winchester To BBi! SOLD OUT 6 MHz On The BBi ISSUE #30 (6/86) Bulletin Boards PROLOG On The PC ISSUE #9 (12/82) Track Buffering On Slicer Expert Systems BBi! EPROM Program 4 MHz For The 820-1 Logic Programming Relocating Your CP/M 64 pages Building Your Own Logic Serial Print Driver Analyzer To Order: Big Board I Fixes ISSUE #20 (10/84) 256K RAM For Your 83 Kaypro Bringing Up WordStar HSC 68000 Co-Processor PC-DOS For Non-Clones Phone: 1-800-888-8087 Cheap RAM Disk DynaDisk For The BBi! 104 pages 32 pages Serial Printer On BBi Sans S10 Mail: PO Box 223 Cheap & Dirty Talker For Kaypro ISSUE #31 (8/86) Bend, Oregon 97709 ISSUE #10 (2/83) Extended 8" Single Density RAM Resident PC Speedup SOLD OUT 72 pages Practical Programming In Modula-2 ISSUE #11 (4/83) ISSUE #21 (12184) Unblinking The PC's Blinkin' United States, SOLD OUT Analog To Digital Interface Cursor Installing Turbo Pascal Game Theory In PROLOG Issues #1-34 $3.00 each ppd. ISSUE #12 (6/83) Low Intensity BBi Video and C Issues #35-current $3.95 each ppd. 256K for BBi Turbo Pascal, The Early Days 104 pages Bringing Up BBi! 80 pages dBase II ISSUE #32 (10/86) Look at WordStar Public Domain 32000: Canada, & Mexico Double Sided Drives for BBi ISSUE #22 (2/85) Hardware And Software All issues $5.00 each ppd. Packet Radio Xerox 820-11 To A Kaypro-8 Writing A Printer Driver for 5 MHz for Kaypro Sound Generator For the MS-DOS 40 pages STD Bus Recover A Directory By Reviews Of 256K Reading & Writing Disk Foreign (air mail) ISSUE #13 (8/83) RAM Expansion Sectors All Issues CP/M Disk Directory In the Public Domain Begins 96 pages $7.00 each ppd. More 256K for BBi 88 pages Mini Front Panel ADVERTISERS INDEX Issue 44

Reader ...... Page 112 Garrison, Peter .. . 17 85 Oregon Software ...... 71 Service ...... Number 11 Halted Specialties . 41 03 PCTech ...... Cover 72 Acquired Intelligence . 24 119 Peripheral ...... 73 107 American Cosmotron . 49 22 Integrand . 92 Andsor Research . . . 63 109 Quarterdeck .5 04 Austin Codeworks 61 JOOP ...... 23 60 Scientific Software Solutions . . 52 15 Cascade Electronics 37 88 Koala Computers . 25 108 Sofsolutions ...... 28 119 CC Software . . . . 75 19 SlicerControl/Computer . . 64 118 CNS ...... 68 12 Logitech Inc ... ..34,35 40 Star-K Software Systems . . . 44 71 Complete Logic Systems . . . . 29 105 Computerized Processing Unltd. 31 17 Manx Software Systems . 69 101 United Products .. 91 07 CompuView .. Inside Front Cover 103 Max Software . . . 70 42 McTek Systems ...... 59 62 V Communications 82 90 Dair Computers 53 Micro Cornucopia ...... 89,94 32 Digital Research 52 37 Unltd 53 116 Whitewater Group 21 111 Digitalk . 12,13 24 microSOLUTIONS 15 16 Dreamtech 86 02 Microsphere ...... 01 39 Xenosoft ...... 72

09 Ecosoft ...... 11 59 National Advancement . 71 70 Zortech, Inc. . . Inside Back Cover 10 Emerald Microware . 57 Corp 93 Erac Company ...... 7 110 NuMega ...... 2

Contact Advertiser Directly.

Coming in Issue #45 - CAD

• Electronic Circuit CAD Systems

• State of the Art Object Oriented Graphics (CAD)

• Plus: Secrets of Compiler Optimization

• And: Interrupt Service Routines In C

MICRO CORNUCOPIA, #44, Nov-Dec, 1988 95 By Gary Entsminger 1912 Haussler Dr. Davis, CA 95616 Reasonable Dreams THE LAST PAGE

measure that we can assign to a physi­ .18976454329657345292467 Gary's off on another tangent. This one's cal system or a computation that lies as simple or as complex as you want to midway between the measure of simple other than something like: write make it. order and complete chaos." .18976454329657345292467. Which ex­ A diamond, he goes on to say, has plicitly specifies the number within the neatly arranged atoms, and is therefore algorithm. In other words, the number n his new book, The Dreams of ordered. A rose consists of randomness isn't "computable" from other numbers. Reason, physicist Heinz Pagels calls and order in the arrangement of its Turing and others have used this the computer, "the instrument of parts, so it's complex. The movement of non-computability as a possible defini­ Icomplexity." Computers allow gas molecules is chaotic. tion of randomness. "For computable physicists, chemists, biologists, numbers, even if they're infinitely long, economists, social scientists, and others Randomness it's possible to write a relatively short to explore (and sometimes solve) com­ Since we're looking for a quantitative program that will calculate them. For plex problems they couldn't tackle measure of complexity, perhaps the the non-computable (random) numbers, before. simplest first approach we can take is to the only algorithm that will do the job "Computers, because of their examine numbers, in general. already contains all the information in capacity to manage enormous amounts What is it about a number, for ex­ the number explicitly - the algorithm of information, are showing us new ample, that makes it "random" or "not is at least as long as the number." aspects of social reality ... The power of random." The number - From this, we might then take a next the computer (for research) lies in its logical step and compute a number's capacity to computationally model and .010101010101 complexity from the length of its algo­ simulate complex systems." rithm. We've already begun to explore for example, seems ordered. And at several of these major avenues of com­ least it seems we can predict the next Challenging You plexity in Micro C ("Fractals, etc.," in is­ digit (O or 1), depending on the pre­ Over the next few issues, I'd like sues #39 and #43; "Chaos, Butterflies & vious digit. your help in exploring and quantifying The BGI," issue #42), and I'm pleased A number like - complexity. For reasons I'll save until with Pagels' attempt to define this new next time, I'm not convinced that algo­ science of complexity. .18976454329657345292467 rithmic length is complexity's key quan­ Complexity, as you might expect, is tifier. an illusive concept, and like anything however, seems disordered. What do you think? You might begin new suffers (and benefits) from its What we'd like to do is quantify the by sending me your definition of ran­ "newness." distinction between these (and other) domness. If you can, quantify it (via an numbers. One approach we can take is algorithm or program). What Is Complexity? to examine their "computability." In Meantime, check out Pagels' fascinat­ In our ordinary language, other words, what kind of algorithm ing book, The Dreams Of Reason (from "complexity" refers to a state or condi­ would generate the particular number? Simon & Schuster) - and send me your tion consisting of many interacting com­ Consider another example - quantifiable dreams, reasonable or ponents. The interaction of the com­ otherwise. ponents is complicated; in other words, . 7142857142 ... we probably can't easily distinguish all the interactions at once. Although this number looks compli­ • • • Although this kind of general cated (or random), it's actually easy to description is accurate, it's hardly generate. It's simply 5 divided by 7. Or "scientific," and in fact isn't very useful. as an algorithm: divide 5 by 7 and write So Pagels suggests a more quantitative, the result. less qualitative definition - Offhand, I know of no algorithm "Complexity is a quantitative generate the earlier number -

96 MICRO CORNUCOPIA, #44, Nov-Dec 1988 INTRODUCTORY PRICE $99.95

''This is a revolutionary product which refiects the fact that Walter Bright is one of the world's best programmers.'' Andy Redfern, Personal Computer World

''I find it amazing that Walter continues to find ways to improve his already excellent product.'' Scott Robert Ladd, Micro Cornucopia Cisgreatl C'**is better!! Performance benchmarks Benchmark Zortech C Zortech C++ Turbo C 1.5 Quick( 1.0 Sieve 20.49 20.54 23.62 22.72 Rsieve 20.49 20.54 23.62 22.03 Integer 1.32 1.38 6.31 6.49 Float 0. 1 7 0.22 52.29 51.03 *Float 32.73 37.7 4 52.39 51.63 Pointer 17.91 17.96 17.13 16.87 Rpointer 17.79 17.91 17.14 16.64 Loop 3.90 3.90 3.90 3.90 Optimize 0.49 0.60 8.46 8.79 Benchmarks were run on an 80286 based IBM compatible at 6Mhz with no 8087. *The float benchmark was re-run without optimization.

Zortech C++ is the first native-code C++ compiler for MS-DOS compatible machines. This means you don't need to spend a lot of money on a C compiler. In fact, Zortech C++ YES! comes with a C++ compiler, a C compiler, a linker, a librarian, a fully integrated editing Rush me: environment, context sensitive help and the fastest graphics library you've ever seen! D Zortech C + + ...... 99.95* ...... With Zortech C++, you can mix and match code in C++, C and assembler and link D Library Source ...... them all together with a single command! i $49.95 * Zortech C++ comes with a complete C++ and C library, including i .fl" D Intro to OOP and C + + compatibility with the ANSI C drah. Unique to Zortech C++ is support fl' $27.95 * ZORTECH for mice, last screen writes, re-entrant floating point and speaker i D The C + + Programming Language support. ""' $29.95 Now you can move your Microsoft and Turbo C code over to _,~ VISA/MC/COD CHECK ACCEPTED !/;;~~e ~;~ -;,,:~:~:~:C1et/:~:rri;::::~~i~re:rr,£unctions! , Name ...... Microsoft's Codeview debugger! , Address...... ' :;';s;:t~"fo~t~~~~~~!Oriented Programming , ...... Phone...... ' Sure, Cisgreat-butC++ is better! , VISA or MC#:...... Exp. date...... '

NOW AVAILABLE... , To: ZORTECH INC. 366 Massachusetts Ave., Arlington, MA 02174. Tel: 617-646-6703. Fax: 617-643-7969. ' ~~;;~.:;::~:.c~:: '"'m ...1 ~,' CA~~.~~,~N~~~ER HO~.~I ~!. ~:!~e:.~~~:,~~1 VERY HIGH RESOLUTION The PC Tech COLOR and MONOCHROME video processor boards employ the TMS 34010 high performance graphics co-processor to insure the best possible video performance at reasonable prices.

Color 34010 Video Processor: • Featured on the cover of Micro Cornucopia. • From 800 x 512 through

1024 x 800 resolution (depending l1 1t>~--- tp,,(i' t •,-(h '" J' lt n1~11; on monitor and configuration).

lhnifoull"lif • 8 Bits per pixel for 256 S.:t11)) lht''< lt!'.tlvl" fJH,. 1hr simultaneous colors Jn,.f'lUI!" )_;_\!~ !iJt ~::'!:;!r ''tiJ .. • Hardware support for CGA/M DA ll t , 'lh' ~ ~..,·LJ·,.,., .. ii emulation. ;. CT:): M1•·;,.t r.111 • 1•t if • PC, XT, and AT compatible

The PC Tech Color 34010 video processor is a superior 34010 native code and DGIS development tool. We support up to 4 megabytes of program (non-display) 34010 RAM as well as up to 768K bytes of display RAM. Compare our architecture and prices to any other intelligent graphics board. Then choose the PC Tech Color 34010 Video Processor for your development engine and your production requirements as well. Color 3401 O Video Processor ...... s1,350.00 Price includes 512K display RAM, 1024K program RAM, and utility software. Monitor not included. Also available: DGIS, 34010 C compiler, assembler, 34010 fractal software, additional display and program memory, and various monitor options.

PC Tech Monochrome. 34010 Video Processor and Monitor • 736 x 1024 resolution (other options available) • 2 bits per pixel for 4 hardware gray shades • Hardware support for CGA/MDA/Hercules emulation .:_:~!·:.~~-f ·-~~;,,t;(t~ o --L~ • PC, XT, and AT compatible ,,,.,.,~. -- \~~0 ,..··-·._; ..... • Full page 66 line text editing with many popular editors ::;'.~~ '· ~·:~~\·;,; ,;~,,.,. • Excellent windows 2.0 application development system The graphics and bit manipulation capabilities of the TMS 34010 make the PC Tech Monochrome 34010 Video Processor 66 line full page text and graphics display faster than many 25 line systems. The video processor is available separately or with the high resolution white phosphor monitor shown above. Monochrome 34010 V.ideo Sub-System ...... S1,495.00 Price includes Monochrome Video Processor and monitor pictured above. Also available: DGIS, Tl 34010 C compiler, Tl assembler. Monochrome 34010 Video Processor also available separately. Designed, Sold and Serviced By:

904 N. 6th St. Lake City, MN 55041 (612) 345.4555 (612) 345-5514 (FAX) Reader Service Number 3 PC, XT, AT, OG/S, Hercules, and Windows 2.0 are trademarks or registered trademarks of their respective companies.