tIL 1977 VOLUM ■m ' JR.* 1 i m Old Fashion MLOD in the Our 6800 computer system repre- sents the best value available today, with no sacrifice in performance. I would like to explain why this is true. The most basic reason is that the 6800 is a simpler, more elegant machine. The 6800 architecture is memory oriented rather than bus oriented as are the older 8008, 8080 and Z-80 type processors. This is an important difference. It results in a computer that is far easier to program on the more basic machine language and assembly language levels. It also results in a far simpler bus structure. The 6800 uses the SS-50 bus which has only half the connections needed in the old S-100 (IMSAI/MITS) bus system. If you don't think this makes a difference, take a look at the mother boards used in both systems— com- pare them. The SS-50 system has wide, low impedance 0.1 lines with good heavy, easily replaced Molex connectors. The S-100 bus, on the other hand, has a very fine hair-like lines that must be small enough to pass between pins on a 100 contact edge connector. I'll give you one guess which is the most reliable and noise free. As for cost— well any of you who have purchased extra con- nectorsforyour S-100 machines know what kind of money this can run into. The 6800 is supplied with a_M mother board connectors. No extras, or options like memory, or con- nectors for the mother board are needed in our 6800 system. The 6800 is not beautiful, but "Oh Boy" is it functional. That plain black box is strong and it has an annodized finish. This is the hardest, toughest finish you can put on alu- minum. Most others use paint, or other less expensive finishes. The 6800 does not have a pretty front panel with lights and multicolor swit- ches. This is because the lights and switches are not only expensive, and unnecessary, but also a great big pain to use. We don't crank up the 6800; we use an electric starter— a monitor ROM called Mikbug. He automatical- ly does all the loading for you with- out any time wasting switch flopping. So in the 6800 system you don't buy something expensive (the console) that you will probably want to stop using as soon as you can get your hands on a PROM board and a good monitor. r- — — Tradition That's another thing. Mikbug® is a standard Motorola part. It is used in many systems and supported by the Motorola software library in addition to our own extensive collection of programs. It is not an orphan like many monitor systems that are uni- que to the manufacturer using them and which can only run software pro- vided by that manufacturer. Check the program articles in Byte, Interface and Kilobaud. You will find that al- most all 6800 programs are written for systems using a Mikbug® monitor. Guess how useful these are if you have some off-brand monitor in your computer. The 6800 will never win any beauty prizes. It is like the Model "T" and the DC-3 not pretty, but beautiful in function. It is simple, easy to use and maintain and does its job in the most reliable and economical way possible. What more could you want? Mikbug ® is a registered trademark of Motorola Inc. ©DO® Computer System with serial interface and 4,096 words of memory $395.00 □ Enclosed is $395 for my SwTPC Computer Kit □ Send Data D or BAC # D or MC Ex Date. NAME ADDRESS _~..~>f1 COMPUTER Huifii 6800 bystsm CITY STATE ZIP Southwest Technical Products Corp., Box 32040, San Antonio, Texas 78284 Meet the most powerful /xC system available for dedicated work. Yet it's only $595: Here's the muscle you've been telling us you wanted: a powerful Cromemco microcomputer in a style and price range ideal for your dedicated com- puter jobs — ideal for industrial, business, instru- mentation and similar applications. It's the new Cromemco Z-2 Computer System. In the Z-2 you get all of the following for only $595: • The industry's fastest /*P board (4 MHz or 250- nanosecond cycle time). • The power and convenience of the well-known Z-80 /xP. • A power supply you won't believe ( + 8V @ 30A, + 18V and -18V @ 15A. That's not only ample power for a full set of cards but ample additional power for other peripherals such as floppy disk drives). • A full-length shielded motherboard with 21 card slots to let you plug in almost any conceivable combination of memory, I/O or your own cus- tom circuits. • Power-on-jump circuitry to begin automatic pro- gram execution when power is turned on. • The S-100 bus that's widely supported by a host of pe- ripherals manufacturers. • All-metal chassis and dust case. Shown with optional bench cabinet • Standard rack-mount style construction that's usable with a variety of cabinets and is upward compatible with larger systems. Bench cabinet optional. • Card retainer to secure cards in sockets under all conditions. • 110- or 220-volt operation. DEDICATED APPLICATIONS The new Z-2 is specifically designed as a powerful but economical dedicated computer for systems work. Notice that the front panel is entirely free of controls or switches of any kind. That makes the Z-2 virtually tamper-proof. No accidental program changes or surprise memory erasures. (For your custom work, Cromemco will supply blank panels.) 4 MHz SPEED Cromemco's microcomputers are the fastest and most powerful available. The 4 MHz speed of the Z-2 means you get about twice the speed of nearly any other microcomputer. (continued on next page) Full-width motherboard has slots for 21 cards. \\ i »ii i i ! ill ! ; r. HI ! in 1 ' [ / Z-2 is supplied for rack mounting. Attractive bench cabinet shown is also available. J8S :.~~ ""\~-;'-r~~^ Heavy-duty retainer bar insures that cards won't jostle out of sockets. That 4 MHz speed cuts running time in half — cuts your waiting time in half. Lets you do more sophisti- cated work that might not otherwise be practical with a microcomputer. Z-80 GIVES MORE COMPUTER POWER The Z-2 uses the powerful Z-80 microprocessor with its 158-instruction set, 19 internal registers, 10 address- ing modes, and 16 bit arithmetic operations. The Z-80 is widely regarded as the standard micro- processor of the future. So you're in the technical fore with the Z-2. But you can also plug in other micro- processor boards if you wish. BROAD SOFTWARE SUPPORT Since the Z-2 uses the Z-80, your present 8080 soft- ware can be used with the Z-2. In addition, Cromemco also offers software support including a monitor, assem- bler, and a BASIC interpreter. STANDARD S-100 BUS The Z-2 uses the S-100 bus that has become standard in the microcomputer field. Dozens of manufacturers support it with compatible peripherals. Of course, all Cromemco peripherals such as our 7-channel A/D and D/A converter, our well-known BYTESAVER with its built-in PROM programmer, our color graphics interface, etc., will also plug into the bus. LOW NOISE Cromemco engineers have been careful to design the Z-2 for reliable operation at its fast 4 MHz speed. Noise on the motherboard, for example, has been care- fully minimized by a unique ground-plane design (we call it our 'Blitz Bus™'). With this bus you won't get erratic operation due to ground current noise. RACK OR CABINET MOUNTING The basic Z-2 is supplied in a black-anodlzed metal case for mounting in a standard 19-inch relay rack. A high-quality stylized bench cabinet in an attractive blue color is also available. KIT OR ASSEMBLED You can get the Z-2 either kit or assembled. The kit includes the Z-2 for rack mounting, the Cromemco 4 MHz microprocessor card, full-length 21 -card-slot motherboard, power supply, one card socket and card- guide set, and front panel. The assembled Z-2 includes the above as well as all 21 sockets and card guides and a cooling fan. LOW, LOW PRICE All who've seen the Z-2 have been surprised and impressed with its low price. You'll be impressed, too, with its technical excellence and quality. So see it right away at your computer store — or order now directly from the factory. The sooner you put this advanced computer to work for you, the sooner you'll be solving problems and saving time/money. Z-2 Computer System kit (Model Z-2K) $595. Z-2 Computer System assembled (Model Z-2W) $995. rjl Cromemco incorporated Specialists in computers and peripherals 2432 CHARLESTON R.D., MOUNTAIN VIEW, CA 94043 • (415) 964-7400 1 k BUI APRIL 1977 In the Queue Volume 2 Number 4 Foreground PUBLISHERS Virginia Peschke Manfred Peschke 8 KIM GOES TO THE MOON EDITOR Software— Butterfield Carl T Helmers Jr 40 A SOFTWARE CONTROLLED 1200 BPS AUDIO TAPE INTERFACE PRODUCTION MANAGER Judith Havey Peripherals— Helmers CIRCULATION MANAGER 60 DESIGNING THE "TINY ASSEMBLER" -Defining the Problem Manfred Peschke Software— Em merichs ASSISTANT PUBLISHER Debra Boudrieau 100 NAVIGATION WITH MINI-O, Part 3 CO-OP EDITOR Software— Salter Scott Morrow PRODUCTION EDITOR Background Karen Gregory CIRCULATION Kimberly Barbour 12 A GUIDE TO BAUDOT MACHINES: Part 1 Ginnie F Boudrieau Hardware-McNatt Cheryl Hurd Deborah R Luhrs 18 HAVING A "PRIVATE AFFAIR" WITH YOUR COIV'ii'U i L" Carol Nyland Humor— Ciarcia ADVERTISING 34 A REVIEW OF TOM PITTMAN'S TINY BASIC Eli/.abeth Alpaugh Virginia Peschke Software— Rosner ART 50 ARTIFICIAL INTELLIGENCE: WHAT IS IT? Noreen Bardsley Software— Rosenbaum Mary Jane Frohlich Ellen Shamonsky 70 ESTABLISHING THE CHU DYNASTY DRAFTING Fanaticisms— Gray Lynn Malo 78 EARLY INDICATIONS OF TECHNOLOGY IN l"; initialize values; X:=05; Y:=01; set decimal mode; clear carry; > add each digit; > set up next digit; counter:=counter - 1 ; if counter positive go to RECAL; else check if altitude is positive; if altitude positive go to UP; else altitude:=00; X:=02 > else turn off engine; set carry; > update fuel; check if fuel left; if fuel left go to TANK; else turn off engine; go toTHRSET; A:=display mode; if mode not 00 go to SHOFL; AX:=location of altitude; ! > go to ST; A;=FUEL; X:=FUEL+1; f display values; A:=velocity sign; if sign negative go to DOWN; A:=/velocity/; I goto FLY; > velocity;=/velocity/; A Nybble on the Apple Notes by Carl Helmers Next month, we'll have an article by Steve Wozniac, designer of the Apple-U computer, describing this beautiful new conception of the small computer. As a taste of the Apple-ll, here is one frame of the "Color Eater," an interesting program which illus- trates the facilities of the Apple-ll. The Apple-ll, which is to be introduced in April at the first West Coast Computer Faire in San Francisco, may be the first product to fully qualify as the "appliance computer." An "appliance computer" is by definition a completed system which is purchased off the retail shelf, taken home, plugged in and used. I first saw the Apple-ll on November 20 1976 when Stephen Wozniak and Stephen Jobs stopped by a motel room in Palo Alto where I was staying at the time. They brought along the prototype Apple-ll to give a demonstration. To serve as an interesting challenge to its capabilities, I suggested that we sit down and implement a "Color Eater" algorithm with Apple-ll 's integer BASIC interpreter with color graphics extensions. I had first seen the Color Eater program demonstrated in an advanced graphics research laboratory late in 1 975 (the idea of the program is not original with me, and I will provide the source upon request). The Color Eater always lives in the matrix in the color TV display at some point. The Color Eater is a very simple animal. It looks at its nearest neighbors in the color matrix, searching in a clockwise direction for its current "digestible" color. If it finds this color, it moves its location to the matrix position of that color, digests it into a new color, and reiterates its search. Occasionally, the Color Eater becomes a very frustrated little animal. It eats itself into a corner and no longer is able to find any digestible colors. When this catastrophe happens, it throws a fit and turns itself into another variety of Color Eater which can eat itself out of the frustration point. The result is a constantly changing random color pattern on the screen, illustrated in one state in this photo made with the Apple-ll computer's output to a standard color television. That evening last November, Steve Jobs, Steve Wozniak and I sat down and proceeded to use the Apple-ll BASIC (which is a 5 K interpreter with 16 bit integer arithmetic) to program the Color Eater game. After perhaps 30 to 45 minutes, we had a working BASIC language version which used the Apple-ll's graphics facilities. Since it was done interpretively, the program ran a bit slow in this version, but it certainly illustrated the concept. Later, Steve Wozniak recoded the program using the 6502 processor's assembly language facility as implemented in the Apple-ll, and reports that the Color Eater now runs like lightning, which is its normal mode of operation these days as a demonstration program for the Apple-ll. If you attend the first West Coast Computer Faire, stop by the Apple Com- puter booth and take a look at this interesting processor; if you don't see it in person, then you'll have to wait until next month's BYTE for a more complete description of the design concepts of the machine as explained by Steve Wozniak." 10 flMKOJMCJMG m E.502 flh BflSJC OSI's new 8K BASIC for the 6502 was written by Micro- soft, the people who wrote ALTAIR® 8K BASIC for the 8080. OSI's 6502 8K BASIC is identical to this powerful and pop- ular 8K BASIC with two very important exceptions: our OSI 6502 8K BASIC has automatic string space handling, and it runs faster. Up to 8 times faster than the 8080 BASIC. And hundreds of times faster than many 6800 BASICS. In fact, the OSI Challenger with OSI 6502 8K BASIC can actually outperform most small- and medium-scale mini- computers, as well as every micro there is! And that includes the Z-80. Perhaps even more amazing than its superlative per- formance is its surprisingly low price: either $50 or free. OSI 6502 8K BASIC is available to OSI System kit build- ers for $50 on your choice of paper tape, audio cassette or floppy disk. And OSI 6502 8K BASIC comes free with the purchase of any 12K or larger OSI Challenger. So you can own a fully-assembled OSI Challenger com- plete with serial interface, 12K of RAM memory and our OSI 6502 8K BASIC for just $807. Incredible! For more information, contact your local OSI dealer. Write OSI direct for our free OSI brochure. Or enclose $1 .00 for the full OSI catalog. Once again, OSI offers more and costs you less. n OHIO SCIENTIFIC INSTRUMENTS Dept. B 11679 Hayden Street, Hiram, Ohio 44234 Photo I: A Teletype Model 15 RO printer. This "receive only" model is shown with cover removed (above) and with the cover in place. A Guide Michael S McNatt 4658 E 57 St Tulsa OK 74135 Are you wondering why you should consider yet another peripheral for your system when you may already have a nice, quiet video display and even a panel of Das Blinkenlights? Consider the following excel- lent quote by Robert H Cushman, one of the editors of EDN magazine, who has written several articles on designing with microprocessors: Never Underestimate the Value of Hard Copy Working at the Teletype is a superior way to learn . . . software and, later, to put the microprocessor to use . . . Bit Numbers 54321 Lower (Letters) Case Upper (Figures) Case Communications Bell System (TWX) Weather (Standard) Stock Market Code 00000 1 0000 1 2 000 10 3 000 11 Blank E Line Feed A Blank 3 Line Feed Blank 3 Line Feed 3 Line Feed t 4 00 100 5 00101 6 00110 7 00111 Space S I U Space ' (Apos) 8 7 Space ' (Apos) 8 7 Space Bell 8 7 8 1000 9 1001 10 10 10 11 10 11 Car Ret D R J Car Ret SWRU 4 Bell Car Ret $ 4 Bell Car Ret / 4 12 1100 13 110 1 14 1110 15 1111 N F C K i ( 7/8 1/4 1/8 1/2 ® 16 10000 17 10001 18 10010 19 10011 T Z L W 5 + ) 2 5 3/4 2 5 + 2 20 10 10 21 10 101 22 10 110 23 10 111 H Y P Q 6 1 # 6 1 I 6 1 24 110 25 110 1 26 110 10 27 110 11 B G Figures 9 ? & Figures 9 5/8 & Figures 9 ® \ Figures 28 1110 29 1110 1 30 11110 31 11111 M X V Letters / Letters / 3/8 Letters /' e Letters Table 1: A lis ting of the various Baudot key code assignments. The weather code column, taken from the Reference Data for Ra- dio Engineers, fifth ■ edi- tion, pages 35 to 38, table 22, includes wind direc- tion and cloud cover symbols. In the communi- cations column, the letters "WRU" stand for "Who are you?" to Baudot Machines: Part 1, Description of Available Devices The hardcopy record provided by the Teletype printer proved unex- pectedly useful. Sample programs and their execution results . . . could be reviewed many days later, often clearing up today's cause of confu- sion . . . Hardcopy records are especially helpful during this learning process because when one attacks some new feature of programming a particular machine, he or she invariably begins by probing and experimenting, making many false tries. At that instant, all inconclusive attempts seem like a complete waste of time. But later, as you advance, copies of your first attempts enable you to go back and explain earlier mysteries. Psychologi- cally this is most comforting, because it wipes away the frustations that invariably build up when neither you nor the computer appear to under- stand each other. EDN tears off the 6 foot or so strip of Teletype paper that results from the typical bout with the computer, folds it accordionstyle, and files it. To make our reference complete we start each session by entering the day's date and the session's objective, and end it with a summary of what was, or wasn't, accomplished. The compact hardcopy printout that you get is a much more useful debugging tool than the transient Photos 1-5 courtesy Donald Clum. Photo 6 courtesy Rob- ert W Cook. 13 displays of console lamps, or the temporary frames of similar video readouts. You can study this hard- copy at leisure, make notes on It, and then file it away for future reference. All these practical virtues of per- forming program development through typewriter-like terminals have been known to computer types for two decades. These old timers are amazed to learn that it is taking the newcom- ers to the computer world so long to catch up. .["How Development Systems Can Beware: Model 15s May be Hazardous to Your Health! If you are considering a Teletype Model 15 or similar surplus page printer, be fore- warned: Not only is the Model 15 obsolete (Teletype Corp no longer manufactures parts), but: • It's a rude, ugly mechanical mon- strosity next to LED readouts, shiny microprocessor cabinetry, and solid- state keyboards. • It's a veritable assault of clanking, grinding, and roaring among the silent flash of panel lights, video displays, and the barely audible hum of power supply transformers. • Foul smelling oil and burning grease pour out of its bowels to drown the clean, woodsy smell of new program- ming books and operating manuals. • It crawls along at a yawning, hair pulling, nail biting 60 to 100 words per minute, while a blazing processor hurries along wasting thousands of cycles between character outputs. But a Model 15 hardcopy page printer will cost between $35 and $100 depending on your resourcefulness, and luck. Table 2: Physical characteristics of the four common teleprinter speeds for Baudot machines. In many cases, the same machine can be run at several different speeds simply by changing gears. Words Per Minute 60 66 75 100 Data Rate 45 bps 50 bps 57 bps 75 bps Characters Per Second 6 6.6 7.5 10 Bit Pulse Width 22 ms 20 ms 18 ms 13.5 ms Stop Pulse Width 31 ms 30 ms 25 ms 19 ms Operations Per Minute 368 400 460 600 Speed Up the juP Design Process," EDN, April 20 1976, pages 63-72.] What Kinds of Baudot Machines are Available? Perhaps the best way to answer the question of what's around is to catalogue each machine briefly, starting with the Tele- type Corp models and following with units by other manufacturers such as Klein- schmidt, Creed, etc. In these descriptions, I've included photographs of many, but hardly all, of the typical machines. Most of these units will be found with nameplates and number plates identifying the model and manufacturer (if you purchase a whole machine). Model 11 The first machine introduced with the name Teletype, in 1921. Used a type wheel and printed on paper tape at 40 words per minute. Teletype Model 12 Introduced in 1922, about 12,000 of these units were sold. Practically all Model 12s had been removed from service by the 1940's, which makes it a real antique. The unit consisted of a Baudot page printer and a keyboard, and sounded like a cement mixer. The electrical noise or hash generated by these machines would require extensive shielding and cables for use with a micropro- cessor. Give it to a museum if you find one. . . Teletype Model 14 This series of Baudot paper tape readers and punches were manufactured beginning in 1925, with about 57,000 Model 14s of all types being sold. The Model 14 series con- sists of: • Model 14TD, or "transmitter distrib- utor" reads the paper tape and trans- mits serial data on a current loop. Speeds of 60, 66, 75 or 100 words per minute can be selected by installing the appropriate set of gears. Easily modified for parallel output. Price range from $20 to $150. • Model 14 RO "Reperforator" or re- ceiver, punches paper tape from serial data received from a current loop. In 1940 a typing reperforator was intro- duced which also prints on the tape, but the printing is several characters behind the punches. Speeds are 60, 66, and 75 words per minute. Price range from $10 to $50. 14 Photo 2: The author's Model 28 KSR Teletype machine. Note the much more compact mechanism (above) of this model compared to a similar view of the previous genera- tion's Model 1 5 in photo I. The Model 28 KSR with cover in place Is shown below. • Model 14 KSR: A Model 14 RO with a keyboard. Enables punching of paper tape off line. I've seen prices range from $15 to $75. Teletype Model 15 This machine comes in two versions: a Model 15 KSR with page printer and key- board and a Model 15 RO with page printer only (see photo 1). About 237,000 Model 15s were produced from 1930 to 1957, with Bell Systems receiving about 100,000 of these, the US government about 60,000, and Western Union, the wire services, news- papers, railroads, airlines and RCA Corp making up the balance. The page printer is usually set up for 60 words per minute, but occasionally 66 and 75 words per minute machines are encountered. The typical used price ranges from $30 to $200. Teletype Model 19 A set of Baudot machines which includes a Model 15 page printer and keyboard, a paper tape perforator, a Model 1 4 TD reader, and a heavy duty loop supply. On some Model 19s, the punch is mechanically linked to the keyboard. Thus, tape must be punched locally and cannot be punched via computer control. The punch magnet re- quires a 100 VDC source capable of sup- plying one amp. The tape reader is usually connected in series with the keyboard so that serial Baudot signals can be generated from either unit. The surplus price ranges from $125 to $250. Teletype Model 20 This model was used by the wire services and was similar to the Model 15 except it used a six level code for an expanded character set. This is a rare machine and I have not seen it advertised. Teletype Model 26 Another rare, light duty machine used by the wire services. 15 Photo 3: The "standard" Teletype so often seen in computer centers and personal computing contexts is the Model 33 ASR shown here with a modem option installed. This light duty machine is the war horse of the minicomputer world. 16 Teletype Model 28 A general number for a series of Baudot machines, which includes ROs, KSRs, ASRs, TDs and reperforators. These are heavy duty machines like the Model 15, but generally operate at 100 words per minute. This is the most prevalent Teletype model used by the MARS people. Since production began in 1952, almost 300,000 Model 28s have been sold. This machine is still being produced so new replacement parts are plentiful. Photo 2 shows a Model 28 KSR. There is an actual advantage of owning a used Model 28 as opposed to the popular Model 33 ASCII machines. This is because the Model 28 is a heavy duty machine made for 24 hours per day operation, year after year. However, the Model 33 is a light duty machine, which means it was designed for limited use: 3 to 4 hours per day, average. It wil.l work for reasonably long periods of time but will require maintenance and adjustment more often than the Model 28 or any of the other heavy duty machines such as the Models 14, 15 and 19. New prices from the Teletype Corp at last report were: Model 28 RO, $1750 to $2000; 28 KSR, $2000 to $2250; 28 ASR, $3300 to $3900; prices vary with options; delivery is from 6 to 1 2 months. None are in stock and each machine is built to order. Used prices range from $200 to $1 500. Teletype Model 29 Another rare machine, essentially a spe- cial Model 28 built for IBM. Teletype Model 31 A rare teleprinter and keyboard combina- tion, designed to print on 0.25 inch (0.64 cm) paper tape. This was a small piece of military aircraft equipment (nomenclature TT-30/AGA-1) which was designed shortly after World War II. It measured 9 by 14 by 12 inches (23 cm by 36 cm by 31 cm) and weighed 23 pounds (10.4 kg). Although assigned the Teletype number 31, there is little indication that there was ever any civilian production. Teletype Model 32 Looks just like the ASCII Model 33 except it has a three row Baudot keyboard. This is a light duty, 100 words per minute Baudot machine still in commercial use. Available as RO, KSR and ASR. Used price Continued on page 154 Photo 4: A view of a Kleinschmidt Model 150 KSR. This variant of the basic Teletype design (note its similarity to the Model 15) contains a cur- rent loop power supply. 17 Having a "Private Affair" with Your Computer Steve Ciarcia POB 582 Glastonbury CT 06033 Then I made a mistake! I told someone that I had a computer! What you are about to read is a true story. The names haven't been changed to protect the innocent because, frankly, there aren't any innocent parties. It was the beginning of a cool autumn in Connecticut. The leaves were falling with increasing rapidity and the children who had played noisily in front of my house all summer had been removed conveniently to schools well out of earshot. There was just a slight rustle in the leaves and now was the time to contemplate the future without the disturbances of the present. Many technical individuals are probably like me — the quiet and solitude stimulate the mind. Through your consciousness race thoughts of all kinds of inventions which haven't even been thought of yet. But you resign yourself to living quietly with a few modest pleasures which complement this attitude. I consider a home computer system to be within my definition of modest. It is just a small 8080 system with 10 K and supported BASIC. I didn't intend it for any particular purpose, just relaxation. I assembled it and placed it in my shop with my other modest pleasures and plinked away on the keyboard occasionally. It was more the challenge of getting the computer up and running than writing exotic programs to keep an inven- tory of the kitchen cupboards, or calculate the surface area of the family car. I put together a CRT and cassette mass storage system and was content just generating peripherals. Then I made a mistake! I told someone that I had a computer! While at lunch one day and after a few martinis, I let it slip to a group of fellow workers I knew a lot about microprocessors. This was not unusual — the conversation often gravitated to such topics because we all worked for a large computer manu- facturer. Working with computers and own- ing one is a completely different situation though. It's just ho-hum when cranking out the answer to a 40 by 40 matrix in 10 ms during working hours, but this same person goes bananas when getting the correct answer to 2 times 2 in BASIC on a home computer. It's absolutely crazy — but then again, I'm an engineer, not a psychiatrist. One member of the group, Ralph, con- tinued to quiz me about what I had said. He knew from past experience that when it came to hardware, I wasn't an idle conver- sationalist. Since he asked and I was in an exceptionally happy and unguarded mood after a good lunch with pleasant company, I told him that I knew about microprocessors because I had one. Well, the cat was out of the bag. "Waiter! Bring my friend here another martini!" he shouted as his interest began to heighten. I'm sure everyone knows or has worked with a character like Ralph. He's a mild mannered suburban family man whose goal is to own the world. It's not an idle fantasy, but rather a calculated approach to life — all of it dollar signs. The day to day moods of people like this are in direct proportion to the Dow Jones daily average. When the Dow is down, don't mention anything con- troversial, lest it be interpreted as a personal affront challenging his integrity. On a good market day, Ralph is the wise philosopher who has a kind expression of optimism for 18 everyone with whom he comes in contact. It is during these latter periods that everyone must be wary. His generosity is over- whelming even though the drinks he orders end up on someone else's check, and his money-making schemes get more and more prolific. It's only the little bald spot on the top of his head which really seems to change. I guess it's a simple case of not getting older — just getting better. If there is a way of turning a profit on that, Ralph will find it. Ralph held back the torrent of questions until the third martini was half consumed. And, preferring not to be too obvious, he just asked leading questions calculated to make me talk. I was brilliantly coy, even though a bit giddy and was quite able to fend off the barrage of questions until he said, "I'm sure that even though you may have a microprocessor — and I'm sure you only mean the microprocessor chip — that it would be virtually impossible for even an experienced engineer like yourself to put together some sort of computer that could conceivably be worth anything." "What do you mean, couldn't build it!" I said, defending myself without realizing what I was about to say. "I have already built it, brother! I have a running 10 K system with a CRT, keyboard, and cassette storage system. I'm running BASIC now and have a few games like blackjack and . . . and Oh, Oh! I did it, and I knew it . . . Ralph's ear twitched just like someone pulled the handle on a one-armed bandit and his eyes began to spin. When they stopped, it was like looking into two dollar signs and Ralph had hit the jackpot. "And ... if you don't believe me, come over tonight and see it!" Why I ever said that I'll never know. I could have kicked myself and had even considered ordering a half dozen martinis hoping to be rushed to the hospital with acute alcohol poisoning just to find a good excuse not to keep our engagement. I was a blabbermouth and should face the music, so I shook off the suicidal tendencies and went back to the office. All afternoon while I was consumed with a dull headache, I couldn't help but notice that Ralph's little bald spot was a brighter pink than normal — a rare occurrence, usually only after a big killing in the market. By that evening, I had regained my composure and decided to make the best of it. Maybe if I just load a silly game written in BASIC and entertain Ralph for a while, I could convince him that this computer is a toy. You know, a toy like Odyssey or Pong. Just as I had finished loading the game, Ralph came downstairs into my shop carry- ing a briefcase stuffed beyond normal capacity, an armload of papers, pamphlets and other notebooks. I didn't bother to ask what all the junk was for, I just greeted him and welcomed him to the inner sanctum. Ralph was very familiar with computer rooms and industrial facilities, but he could not cease to be amazed at the quantity of equipment that I had amassed in my basement. "Well, with all this junk, you must really have a computer," he pronounced as a subdued compliment. "Do you have it work- ing? Can I see the instruction set for the BASIC? How many lines of BASIC can be put in 10 K?" "Hold it, Ralph! One thing at a time. Here's a copy of the instruction set. Why don't you sit down here at the keyboard and play blackjack while I go upstairs and make us some coffee." Going and getting a cock- tail would probably have been a more hostly gesture, but after the luncheon, the thought of another martini was painful, so I resigned myself to coffee. I'm basically a perfectionist and as with the computer, so goes the coffee — or is it the other way? Well, I mixed scoops of Jamaican Blue Mountain with Mocha and a touch of Deep Java and ground the coffee. All the while, I could hear the keyboard keys being pounded madly and a little verbal noise, somewhat like a kid talking to himself while doing a difficult math homework problem. It took about a half hour to prepare this exquisitely brewed concoction as well as bake a special tea biscuit (from an old family recipe, of course) which I always like to serve guests. I couldn't help but notice that Ralph's little bald spot was a brighter pink than normal — a rare occurrence, usually only after a big killing in the market. 19 Out go games, relaxation, pleasure — in come the stock market, aggression, ulcers. I have never been to a horse track, dog track, betting parlor, pool parlor, Las Vegas, church bingo game, or even bought a raffle ticket. When I reached the area of my work bench with the tray of biscuits and coffee, I glanced at the CRT. My blackjack program was no longer on the screen, but rather a simple little program which took daily stock quotes and computed weekly and monthly averages. "I was only gone a half hour," I exclaimed. "Oh? Yeah, I learned BASIC when I was in Australia building an oil refinery one time. It was the same time that I got into the foreign stock markets. There's not much else to do down there, you know." He had a broad smile on his face which was an obvious result of having mastered the com- puter so easily, and he took the coffee and biscuits. He pounded the keyboard, chomped biscuits down in one gulp, slurped noisily, and shuffled papers madly while his head continually bobbed up and down look- ing at the CRT. "I think I can really do something with this system. I want a little time to study the instructions some more, then I'd like to come over and discuss some businesss appli- cations with you." This seemed to be a reasonable request and I agreed, but before he could leave, we had to make a copy of his program on cassette tape. "Gee, I only have this one cassette which has the blackjack on it, but I suppose we can use it. I can always load it by hand. It only took a half an hour." I sighed and inserted my cassette and hit the record button. Out go games, relaxation, pleasure - in come the stock market, aggression, ulcers. Oh well, it's only a cassette tape and a lousy com- puter game. "Wow, Ralph, it's almost 12:30. It's been a long night. Glad you could come over. Study up and maybe we'll get to do it again soon." I nearly choked on the last comment. Actually, I'm really not that bitter and warped. I really like Ralph, and he means well. But to be on the safe side, I'll buy a half-dozen cassettes tomorrow. The saga continues . . . Two nights later, Ralph came over again with the same enthusiasm and more notes and papers. Ralph had a funny look in his eyes and his bald spot was unusually pink, but I didn't pursue it. It was probably coming in from the cool night air to the warm house. The greetings and salutations were hardly over when Ralph had sat down in front of the computer and announced that he was ready to go. I asked if he wanted me to load his stock program which we had put on the cassette from the previous ses- sion, but he protested that was child's play and he was really ready to program now. In fact, he had written a lot of it already and opened one of his notebooks to show me five solid pages of BASIC programming. "And that's just to enter the player statistics' and post positions," he exclaimed, delighted that he had accomplished so much in so little time and indicating as subtly as possible that this was just the beginning. "Statistics? Post position? For what?" I asked. "For jai-alai, of course!" he exclaimed and I immediately knew that the odd look and pink bald spot had nothing to do with the cool night air. "We enter the players' statistics, their post positions, and all their previous performance records, the computer does a little mathematical hocus-pocus and plays the game and predicts the winners." He could hardly hold still as he was describ- ing this mind-boggling scheme to me. "And when we add the betting section to the program, it will tell exactly how much to bet on the trifectas, perfectas, and quinellas. And . . ." "Hold it! You mean you are going to write a game program like my blackjack program?" I asked. A game program was only natural as far as I was concerned. I was a true nongambler and never bet on anything but a sure thing. Even then, it wasn't really a bet because the things I would place a wager on entailed no risk and I'd be an idiot not taking a chance. Such things were betting that my salary this week was the same as last week, or with the gas station attendant that the car needed a quart of oil (I checked it before going to the gas station), or that it would snow in Connecticut this winter. I have never been to a horse track, dog track, betting parlor, pool parlor, Las Vegas, church bingo game, or even bought a raffle ticket. Sometimes I think I lead a protected life. "Hell no! I mean a program to play and bet real money at the jai-alai fronton here in Hartford!" he exclaimed almost jumping off his seat. There was a point at which I wondered whether I should fear for my life and considered calling my dog, but affec- tionate Scottish Terriers don't seem to demand the same respect as Doberman Pincers. "This is only a 10 K system. We don't have enough memory to do a program like that," I rebutted, hoping to clip this crazy proposal in the bud. "Oh, don't worry about that. We'll add some more memory. I figure it will take about 24 K and of course, we'll eventually need some sort of hard copy device . . ." "OK. .OK., go program something while I think about it," I said in a resigned sigh. I 20 The Intelligent Video Interface The MERLIN Kit with manual is $269. MERLIN assembled & tested is $349. Order yours today. MC and BAC accepted If you are still not convinced that MERLIN is the best buy in Video Interfaces/Monitors see one at your local computer store or write for more info. MiniTerm Associates, inc. Box 268, Bedford, MA 01730 (617) 648-1200 I had visions of putting down my life savings at the betting window just as the computer takes a power hit and goes down complete with my money and my sanity. took note of the fact that Ralph used the term "we" when he mentioned system expansion, but I seriously doubted it. The thought of using my computer for betting was crazy. Obviously, if it were a good idea, someone would have already done it. That's the American Way. It sure seemed like a risky idea. I had visions of putting down my life savings at the betting window just as the computer takes a power hit and goes down complete with my money and my sanity. Ralph is a good programmer, but he can't possibly do the entire job himself. Besides, my system is much too small to accomplish what he's attempting. Maybe I should let him plink away at the keyboard until he realizes that he can't do it and then I can have my system back and relax while I play Kingdom or something. "Fantastic," yelled Ralph. "I've got the player entry and post position sections already working! I can't believe how easy it is to program this computer." The little man was amazing. All day he sits in his office, shuffling papers and occasionally discussing business with cus- tomers, but I had never experienced this completely "off-the-wall" emotionalism. "This is terrific! I can see that we'll have this program really going as soon as I get rid of a few bugs," he continued. Bugs? Was that bugs he said? Salvation is what those bugs were. With a program bug, it might never work. I might yet get to use my system again. "Gee, Ralph. That's too bad about the bugs. I guess you won't be able to do it after all." "I'll take care of the program bugs, but you had better check some of the hardware. I've been dumping the program to cassette about every 30 minutes so that I could keep an accurate revision record or in case of a power failure and I noticed that your cas- sette interface drops a bit once in a while. When you've got a lot of money on the line, we can't afford dropping bits," he inter- jected with an authoritative resolve. "I've used up all but 300 bytes of the 10 K and we'll need some more space if you want to do this right. Didn't you say that you wanted to expand the system to put larger game programs in it?" He was correct. I did eventually want to expand the system with more memory, but I would have been happy just playing black- jack by myself right then. I couldn't even do that. The six cassettes I had just bought were conveniently written with various versions of jai-alai. Ralph was correct — my $39 El Cheapo cassette recorder probably did drop a bit or two, but when you're playing blackjack, who cares? Still, I couldn't have someone criticize my hardware. I was a good hardware designer and didn't want anyone to think otherwise; especially someone I worked with. Ralph gathered up his paper work and as he left, he tossed me a jai-alai program to study so I could understand the betting terms and be able to use the program 22 THE PERFECT MICROCOMPUTER VECtCtt ^WKcinc. ■ ■ i It's a two touch affair VECTOR 1 is based on the 8080A Microprocessor and S-100 Bus - EASY TO ASSEMBLE, EASY TO ACCESSORIZE, EASY TO BUY AND VERY EASY TO O KM I .IV) inc. 717 LAKEFIELD ROAD, SUITE F WESTLAKE VIILAGE, CA 91361 • (805) 497-0733 1 didn't want any more cassette storage criticism, but telling Ralph about my depleting bank account would have fallen on deaf ears. Working with Walt is a little nerve-wracking because in computer terms, he is a LIFO, or "last in, first out" interrupt processor. eventually. I didn't say anything except goodnight and come again sometime. Some- time would be soon he assured me and I felt a sudden pain in the center of my forehead. I never used to get headaches. Maybe I needed a vacation .... The next four evenings I diligently worked at improving the system and increas- ing the memory. The leaves were piling up around the front door and I knew I should be raking them or putting antifreeze in the cars, or something. I hadn't picked the ripe tomatoes from the garden before last night's freeze, but now I don't have to worry about them anymore. I saw my wife this evening in the hall on my way down to the workshop. She looked pleasant and gave me a half- hearted smile. It was her subtle way of saying, "I remember you. Wasn't I married to you some time ago?" I just didn'thave the time to explain because Ralph was on his way over and I wanted to show him all the improvements, so I patted the dog and descended the stairs into the workshop. I looked around at all the equipment and some of the unfinished projects on my desk. For a couple of months, I had been develop- ing an analog interface to be attached to the computer to allow joystick inputs to liven up future game programs I was contem- plating. It was all done, just awaiting check- out and debugging, but I needed the com- puter to check it dynamically, and with all the stuff with Ralph lately, I hadn't been able to even get close to it. I still had an older 8008 system with 4 K of memory which I could use, but it was located right next to the 8080 system and with Ralph sitting there, I couldn't even get close to it. I resolved that I would sit at my desk and recheck the wiring again. "OK, are we ready to go?" asked Ralph as he came into view while descending the stairs. "I hope you don't mind — I invited Walt along to help me debug the software. He's a genius when it comes to programming." Ralph was quite correct; Walt was indeed a software genius. Walt is one of those truly helpful people who continually goes out of his way to accommodate everyone. Working with Walt is a little nerve-wracking because in computer terms, he is a LIFO, or "last in, first out" interrupt processor. The poor guy will be diligently working on something important, and if someone asks for his help, he drops everything, solves the other per- son's problem, then returns to his own task. Some interesting situations have evolved when he's interrupted by five different people each asking for his help. I suppose that's the price of genius. I just chuckled to myself while thinking what kind of line Ralph must have laid on him to get him to work on this crazy scheme. "So, did you get a chance to fix the bit problem?" Ralph asked. "Yes," I answered. "It was nothing that a better tape recorder wouldn't cure," I replied, still wondering whether replacing my low bid recorder was really necessary. The replacement was a $149 Sony tape recorder — the best one I could find. I didn't want any more cassette storage criticism, but telling Ralph about my depleting bank account would have fallen on deaf ears. I also added another 8 K of memory and beefed up the power supply. That was only about $300. "Great! We'll really be able to make progress now," he chanted. "We'll give you a cut of the winnings to help cover the hardware costs," he continued. "Hey Walt, sit here at the desk under the light and see if you can find the bug." Ralph loaded the last program version and spread his papers out all over my bench. Papers hung over the top of my oscilloscope, propped against my parts cabinets and thoroughly covered my work area. Walt asked if it was OK to move the analog interface board which was on the desk, so that he could spread out some papers and not have to worry about accidentally leaning on something. "Sure Walt, let me move everything for you," I said as I cleared off the desk. "Can I get anyone a drink or something?" "I'd like a beer if you have one," said Walt. "I'll have a gin and tonic and if you have any of those biscuits left, that would be tremendous," said Ralph. I slowly walked upstairs and stopped on the landing to pat my dog. Scottish Terriers are like people. They can communicate with their eyes and he was giving me that "You don't play with me anymore" look, and dropped a tennis ball by my hand hoping I would have a favorable reaction to his request. I used to work at my bench and occasionally kick a ball around the cellar for him. Now we both knew that we couldn't do that any more and we sat watching the two men intently discussing the program and inspecting the CRT display. I went upstairs to prepare refreshments and invited the dog to follow, hoping to placate him with a fresh baked biscuit. My wife walked into the kitchen and being the understanding soul that she is, asked me if I could possibly light a fire in the fireplace and use the den for whatever it was that I did downstairs. 24 "That's it! That's how I can do it!" I yelled. If I was Polish, I would have danced a polka, but instead I grabbed the tennis ball and threw it down the hall and the dog made a mad dash after it. "I can't use the den, but they can! All I have to do is put a remote terminal in the den." It was an extravagant idea, but I was desperate. I would move my friends to another section of the house, out of my shop and out of my dog's playground. I hadn't worked out the details yet, but that's what I was going to do. I had contemplated moving the computer, but like any hobbyist's, it was spread out all over three shelves with patch cords and was impossible to move. The details of the design flashed through my head and I hurriedly looked for a pad to record my thoughts. Twisted pair shielded wire, asynchronous interface, coaxial cable for the monitor, perf board, line drivers — Hold It! — one thing at a time. The design of the remote terminal was fairly simple, but would take a little time to build. I'd do that later. Right now, it was impor- tant to see if I had enough wire to go from the computer to the den and I made a mad dash down into the shop and started rummaging through my storage bins until I found a 200 foot roll of coax and a big tangled mess of what appeared to be twisted pair shielded wire. Ralph and Walt didn't seem to be bothered by all the commotion behind them until I pulled down half the bookcase while yanking on the tangled mass of wire. I grabbed some tools and dragged the wire outside through the garage. Ralph. and Walt had kicked the books out of the way and returned to programming by the time I was out on the front lawn. It was cold outside, but that was the only place with enough room to spread out the mess. I'm sure the neighbors thought it a bit strange to see a grown man out on the front lawn at nine o'clock in the evening with a flashlight doing what appeared to be playing in the leaves. My dog came out to investigate and with all his jumping around and barking, it really must have looked pretty bad, but I was determined. It took quite a while, but finally I untangled the mess and had two twisted pair and one coax line stretching down the street past the neighbors' home. I decided to put in an extra twisted pair line in case I had other friends and had to go to time-sharing. I placed a ladder up against the side of the house under the den window, and with the wires between my teeth and an electric drill in one hand, attempted to scale the ladder. I swore that the next house I bought would be a ranch instead of a colonial or at least I'd put the den on the first floor, but for right now, I just didn't look down and concen- trated on the "do or die" situation at hand. I started the electric drill, placed it against the house and pushed! I drilled through the storm window, the inside window and half the window sill. It wasn't necessary to tell my wife that someone was outside the window, because I heard her scream. Apparently, she was watching tele- vision in the den and the window I had just drilled through was behind the TV. It hit me all of a sudden what her reaction would be — it was something I had suggested she do if she were ever home alone or needed protec- tion. She had probably rushed off for the bedroom closet to get the shotgun we kept there. Well, if you think firemen come down ladders fast, you should have seen me. It took a while to calm her down, but she said that after having been married to me so long, she should have expected it. As a gesture of peace, I agreed to put off wiring the house until daylight hours and decided instead to design the asynchronous interface. Ralph and Walt had finished for the evening 25 I smiled from ear to ear and thought of the coup I was about to perpetrate. During the next two days, I worked at a feverish pace, stringing wire and soldering components. and were apparently unaware of the preced- ing "fiasco" when Ralph said, "I hope your evening was as productive as ours. Walt figured out the bugs but it will take a few more sessions to incorporate the revisions. That's quite a system you've got there. You must really enjoy it." I didn't get mad, I just looked tired. Even the dog decided he couldn't take anymore and went to lie down in front of the fire. "Well Ralph, it will be nice to see the program work so you can spend all your time at the jai-alai fronton." "I'm looking forward to that too. But we still have a lot of work. Day after tomorrow evening is a good night for me. My wife may not be home, so I might bring the kids. Do you like kids?" he asked. "Kids are fine. It's their paren. . .," I started as he interrupted. "Great. Walt and I will see you then," was his final pronouncement as he stepped out of the door; but on the way to the car, he turned long enough to yell, "Hey, some- one left this big mess on your front lawn, but if you pile enough leaves over it, nobody will know." "Thanks, Ralph." I just closed the door, closed my eyes, and leaned against the wall. I judged that I didn't have much time before they were coming again, so I had better get to work on the communication link to the den. During the next two days, I worked at a feverish pace, stringing wire and soldering components. I stuffed the three wires through the hole in the den window, ran the wires down the side of the house to the first floor level, and then drilled a hole through the outside wall into the garage. I had to go through the back and out the front of a garden tool cabinet in the garage, but my wife wouldn't notice that she couldn't open the door any more until spring — I'd just use my skill saw and make a new opening for her. Stringing the wire through the garage was easy. I just hung it across the ceiling and looped it through the garage door springs for support. It was only when I started chopping a hole through the concrete wall into the basement that I got upset. Some idiot put a layer of sheet metal in the center of the concrete and the drill bits wouldn't even penetrate it; but this turned out to be no match for a cold chisel and a five pound hammer. The hole did turn out to be a bit larger than I intended, but I always wanted to install one of those little doors where a dog lets himself in and out. I quickly attached the twisted pair to the line receiver in the shop. The unit down- stairs consisted of the receiver section of a UART (universal asynchronous receiver/ transmitter) while the box in the den con- tained the transmitter and line driver. A keyboard is plugged in upstairs, and when a key is pressed, the ASCII keyboard data is serialized and sent to the receivers down- stairs where it is reconverted to parallel for the computer. I chalked up the $40 it cost to build this interface to experience for the sake of family harmony. The $175 for another keyboard and another TV monitor was a bit harder to take. Ralph, Walt and whoever else was coming over would be there soon. I decided on a lark to try to type in the blackjack program before they came and busily attached the keyboard. When I was through, I took the tape containing their oldest revision of jai alai and recorded my blackjack back on it . . . just in case. When I was done, 1 loaded their latest program version and ran up to the den to check that all was working correctly. The screen was brightly lit with the BASIC operating system indicating that the video link worked properly. Data entry on the keyboard also proved successful and I felt like a new man. I smiled from ear to ear and thought of the coup I was about to perpetrate. I made myself a Tangueray martini, sat by the fireplace and awaited the arrival of my honored guests. It wasn't long before Ralph and his two kids were at the door with Walt closely behind. I hadn't even closed the door before the dog and the children were off chasing each other through the house. "Are all kids like this?" I asked. "Only happy ones," answered Ralph. "So do you want to come downstairs and see how this works?" he inquired. My opportunity was there, but with all the noise I couldn't think and just said, "Tonight we are going to put you in the den. I put a monitor and a keyboard up there and you guys work upstairs while I work in the shop!" The words were finally out. I had stated my declaration of independence and I had demanded my workshop back. "Sure. That sounds OK with us," stated Ralph as he and Walt spread out their papers all over the den. "It sure is nice up here. How do you keep a den looking so nice? Anyone with kids can't have furniture like this," continued Ralph as he threw his briefcase on the velour covered Louis XVI chair next to the fireplace. I looked at him and stated, "I don't have any children, remember?" Just then, a tennis ball whizzed by with two kids and a dog in hot pursuit. Usually the dog wasn't even allowed on the oriental rug, but who was I 26 The Small Computer Twenty-five years ago a computer as powerful as the new Processor Technology Sol-20 priced out at a cool million. Now for only $995 in kit form or $1495 fully assembled and tested you can have your own small computer with perhaps even more power. It comes in a package about the size of a typewriter. And there's nothing like it on the market today. Not from IBM, Burroughs, DEC, HP or anybody else! It fills a new role If you're an engineer, scientist or businessman, the Sol-20 can help you solve many or all of your design problems, help you quantify research, and handle the books too. For not much more than the price of a good calculator, you can have high level computer power. Use it in the office, lab, plant or home Sol-20 is a smart terminal for distributed processing. Sol-20 is a stand alone computer for data collection, handling and analysis. Sol-20 is a text editor. In fact, Sol-20 is the key element of a full fledged computer system including hardware, software and peripheral gear. It's a computer system with a keyboard, extra memory, I/O interfaces, factory backup, service notes, users group. It's a computer you can take home after hours to play or create sophisticated games, do your personal books and taxes, and a whole host of other tasks. Those of you who are familiar with small computers will recognize what an advance the Sol-20 is . Sol-20 offers all these features as standard: 8080 microprocessor — 1024 character video display circuitry — control PROM memory — 1024 words of static low- power RAM — 1024 words of preprogrammed PROM — built-in cassette interface capable of controlling two recorders at 1200 bits per second — both parallel and serial standardized interface connectors — a complete power supply including ultra quiet fan — a beautiful case with solid walnut sides — software which includes a preprogrammed PROM personality module and a data cassette with BASIC-5 language plus two sophisticated computer video games — the ability to work with all S-100 bus products. Full expansion capability Tailor the Sol-20 system to your applications with our complete line of peripheral products. These include the video monitor, audio cassette and digital tape systems, dual floppy disc system, expansion memories, and interfaces. Write for our new 22 page catalog. Get all the details. Processor Technology, Box B , 6200 Hollis St. , Emeryville, CA 94608. (415) 652-8080. Rfi^R^^iy THE BASIC SOFT ARIZONA Byte Shop of Phoenix-West 12654 N. 28th Drive Phoenix, AZ 80529 (602) 942-7300 Jeff McKeever Byte Shop of Phoenix 813 N. Scottsdale Rd. Tempe, AZ 85281 (602) 894-1129 Alan Hald Desert Data Computer Store P.O. Box 1334 Tucson, AZ 85702 Gary Miller & Bud Ward CALIFORNIA Byte Shop of Lawndale 16508 Hawthorne Blvd. Lawndale, CA 90260 (213) 371-2421 Dick Moule The Computer Store 820 Broadway Santa Monica, CA 90401 (2131 451-0713 Dick Heiser A-VID Electronics 1655 E. 28th St. Long Beach, CA 90806 (2131426-5526 Reynolds Johnson Byte Shop of Pasadena 496 S. Lake Ave. Pasadena, CA91101 12131684-3311 Govinda Singh Byte Shop/Thousand Oaks 2707 Thousand Oaks Blvd. Thousand Oaks, CA 91360 (805) 497-9595 Joe Kappl People's Computer Shop 13452 Ventura Blvd. Sherman Oaks, CA 91423 (213) 789-7514 W. K. Ling Byte Shop of San Diego 8250 Vickers-H San Diego, CA 92111 (714) 565-8008 John Perry Byte Shop of Westminster 14300 Beach Blvd. Westminster, CA 92683 (714) 894-9131 Marty Rezmer by R. W. BBOWN —^IIB****** The "HOW-TO-DO IT" Books for the "DO-IT" Person * * Available NOW! ! ! at most computer stores * * The Computer Mart 625 W. Katella #10 Orange, CA 92667 (714) 633-1222 Allan Tarsky Byte Shop of Santa Barbara 4 West Mission Santa Barbara, CA 93101 (805) 966-2557 Scott Daley Byte Shop of the San Fernando Valley 18424 Ventura Blvd. Tarzana, CA 93156 (213) 343-3919 Tom Mardy Byte Shop of Fresno 4131 E. McKinley Ave. Fresno, CA 93703 Mike Sannes Byte Shop of Mt. View 1063 W. El Camino Mt. View, CA 94040 (415) 969-5464 Boyd Wilson Byte Shops, Inc. 1261 Birchwood Dr. Sunnyvale, CA 94086 (408) 734-9000 Bryan Kerr Byte Shop of Palo Alto 2233 El Camino Real Palo Alto, CA 94306 (415) 327-8080 Bob Moody Byte Shop of San Mateo 1200 W. Hillsdale Blvd. San Mateo, CA 94403 (415) 341-4200 Chet Harris Byte Shop of Hayward 1122 "B" St. Hayward, CA 94541 (415) 537-BYTE Mike Lipschutz Byte Shop of Diablo Valley 2989 North Main St. Walnut Creek, CA 94596 (415) 933-6252 Dan Soldalh Byte Shop of Berkeley 1514 University Ave. Berkeley, CA 94703 (415) 8456366 Pete Hollenbeck Byte Shop of San Rafael 509-B Francisco Blvd. San Rafael, CA 94901 (415) 457-9311 Don Anderson Byte Shop of Santa Clara 3400 El Camino Santa Clara, CA 95051 (408I 249-4221 Todd Anderson Byte Shop of San Jose 155 Blossom Hill Rd. San Jose, CA95123 (408) 226-8383 Larry Grijalva Byte Shop of Campbell 2626 Union Ave. San Jose, CA 95124 (4081 377-4685 Ray Lyn Byte Shop of Sacramento 6041 Greenback Ln. Citrus Heights, CA 95610 1916) 726-2557 Willard Westphal COLORADO Byte Shop/Arapahoe Co. 3464 S. Acoma Englewood, CO 80110 (303) 761-6232 Bernie Schreibman Byte Shop of Boulder 2040 30th St. Boulder, CO 80301 (303) 449-6233 Herman Axelrod FLORIDA Byte Shop of Cocoa Bch. 1325 N. Atlantic Ave. Cocoa Beach, FL 32931 (305I 784-1881 John Dalton Computer Hut 5905 N.W. 151st St. Miami Lakes, FL 33014 (305) 821-2667 Donald R. Williams Byte Shop of Miami 7825 SW 40th St. Miami, FL 33155 (305) 264-BYTE Mel Levinson Microcomputer Systems Inc 144 So. Dale Mabry Hwy. Tampa, FL 33609 (813) 879-4301 Forrest K. Hurst ILLINOIS The Data Domain 1316 Chicago Ave. Evanston, IL 60201 1312) 328-6800 Paul Warnke INDIANA The Home Computer Store 10447 Chris Drive Indianapolis, IN 46229 (317) 894-3319 Jim Baughn The Data Domain 406 S. College Ave. Bloomington, IN 47401 (812) 334-3607 Boyd R. Borrill KENTUCKY The Data Domain 506Vi Euclid Ave. Lexington, KY 40502 (606) 233-3346 Melvyn Cobb MARYLAND Computer Workshop 5709 Frederick Ave. Rockville, MD 20852 (301) 468-0455 John Dorband MINNESOTA Byte Shop of Eagan 1434 Yankee Doodle Rd. Eagan, MN 55121 (612)452-1841 John Campbell MISSOURI Computer Systems Center of St. Louis, Inc. 13461 Olive Blvd. Chesterfield, MO 63017 (314) 576-5020 H. Joseph Turner, Jr. Computer Workshop 6903 Blair Road Kansas City, MO 64152 (816) 741-5055 Terry Smith NEW HAMPSHIRE Computer Mart of NH 170 Main St. Nashua, NH 03060 (603) 883-2386 Ronald J. Cordova Microcomputers, Inc. 539 Amherst St. Nashua, NH 03060 (603) 889-1646 Dexter M. Cox NEW JERSEY Hoboken Computer Works No. 20 Hudson Place Hoboken, NJ 07030 (201) 420-1644 NEW YORK The Computer Mart of New York 314 Fifth Ave. New York, NY 10001 (212) 279-1048 Stan Veit Synchro-Sound Enterprises 193-25 Jamaica Ave. Hollis, NY 11423 (212) 468-7067 Ray Mustafa Computer Mart of Long Islan 2072 Front St. East Meadow, NY 11554 (516) 794-0510 Morris Balamut Byte Shop of Levittown 2721 Hempstead Tpke. Levittown, NY 1 1 756 (516) 731-8116 John Adams OKLAHOMA High Technology 1020 W. Wilshire Blvd. Oklahoma City, OK 73116 (405) 842-2021 Charles Weddington OREGON Byte Shop of Beaverton 3482 SW Cedar Hills Blvd. Beaverton, OR 97005 (503) 644-2686 Rick Terrell Byte Shop of Portland 2033 SW 4th St. Portland, OR 97201 (503) 223-3496 Pat Terrell PENNSYLVANIA Byte Shop of Bryn Mawr 1045 W. Lancaster Ave. Bryn Mawr, PA 19010 (2151 525-7712 Dick Smith Personal Computer Corp. Frazer Mall, Rt. 30 Frazer, PA 19355 (215) 647-8460 Walter White RHODE ISLAND Computer Power Inc. M-24 Airport Mall 1800 Post Rd. Warwick, Rl 02886 1401) 738-4477 SOUTH CAROLINA Byte Shop of Columbia 2018 Green St. Columbia, SC 29205 (803) 771-7824 Nick Johnson TENNESSEE Micro Computer Systems Route 36, McFee Rd. Knoxville.TN 37922 (615) 966-9849 d UTAH Byte Shop/Salt Lake City 261 S. State St. Salt Lake City, UT 841 1 1 Bob Bollinder VIRGINIA Shire Enterprises 615 Mitchell St. Richmond, VA 23222 1804) 321-4560 Sonny Onorati WISCONSIN The Milwaukee Computer Store 6916 W. North Ave. Milwaukee, Wl 53213 (414) 259-9140 Denniss Hafemann CANADA Trintronics 186 Queen St. West Toronto, Ontario Canada, M5V 1Z1 (416) 598-0262 Karen Klein Byte Shop of Vancouver 2151 Burrard St. Vancouver 9, B.C. (604) 736-7221 Marvin McKay The Pacific Compute'; Snorni 4509 - 451 1 Rupert St. Vancouver, B.C. V5R 2J4 (604) 438-DATA Brian Hyndman JAPAN Byte Shop of Tokyo 2-9-9 Sotokanda Chiyodaku, Tokyo Kiyotake Ikeda WARE LIBRARY This LIBRARY is a complete do it yourself kit. Knowledge of programming not required. EASY to read and USE Written in compatible BASIC immediately executable computer with at least 4K, NO other peripherals needed. in ANY This Library is the most comprehensive work of its kind to date. There are other software books on the market but they are dedicated to computer games. The intention of this work is to allow the average individual the capability to easily perform useful and productive tasks with a computer. All of the programs contained within this Library have been thoroughly tested and executed on several systems. Included with each program is a description of the program, a list of potential users, instructions for execution and possible limitations that may arise when running it on various systems. Listed in the limitation section is the amount of memory that is required to store and execute the program. VOLUME I Bookkeeping Games Pictures $24.95 VOLUME II Math & Engineering Plotting & Stat Basic Statement Def $24.95 Each program's source code is listed in full detail. These source code listings are not reduced in size but are shown full size for increased readability. Almost every program is self instructing and prompts the user with all required running data. Immediately following the source code listing for most of the programs is a sample executed run of the program. The entire Library is 1100 pages long, chocked full of program source code, instructions, conversions, memory requirements, examples and much more. ALL are written in compatible BASIC executable in 4K MITS, SPHERE, IMS, SWTPC, PDP, etc. BASIC compilers available for 8080 & 6800 under $1 elsewhere. This Library is destined to become one of the reference bibles for the small computer field, due to its versatility and uniqueness and the ease of operation of the programs it contains. These volumes are deductible as a business expense when purchased by a company. Send your remittance for prompt delivery, while supplies last. Volume discounts are available to qualified dealers. VOLUME III Advanced Business Billing Inventory Payroll . $39.95 VOLUME IV General Purpose $9.95 - • ».« T^K | " '' : JM?§ttl I m ^^m fWr 'M i — ^v l' y " i i / 9 aH kj k. w. mtX-wrJfftfff MM VOLUME V Experimenter $9.95 FUTURE ADDITION TO THE "BASIC SOFTWARE LIBRARY" Volume VI (A Complete Business System - $49.95) General Ledger System - Taxes, Pyrl, W-2's, Inventory, Depr., Financial Statements, etc. AVAILABLE MID SUMMER STOP BY OUR BOOTH (E615) AT THE SAN FRANCISCO COMPUTER FAIRE and say "HI!" Add $1.50 per volume for postage and handling. © SCIENTIFIC RESEARCH 1712-B FARMINGTON COURT CROFTON MD 21114 Phone Orders call (800) 638-9194 Information and Maryland Residents Call (301)721-1 148 Ralph was so enthusiastic he hardly even noticed the dog was chewing on one of his program sheets and the kids were making paper airplanes out of others. Author Garcia will not be able to answer any inquiries about the pro- grams described in this article. So don't write! going to scold first? I just picked up the bottle of Tanqueray from the bar and left the room to go to the shop. As I descended the stairs into the base- ment, I listened to the three-ring circus and wondered if children came with volume controls or on/off switches. The sadistic humor ceased when I sat down at my bench and contemplated my next action. I looked at the 8008 system which didn't have BASIC and couldn't play games and shivered a little from the chill of the cold cellar. It took only a few minutes to realize that there was no way I could work downstairs while the gang was upstairs. I went upstairs and upon entering the den, Ralph said, "I thought you were going to enjoy yourself?" "I thought so too, Ralph. How are you doing?" I asked trying not to show any frustration. "I'd say we're almost ready. We entered the player statistics of ten games played last week and the program picked the winner in 40 percent of the cases. I still want to make some other program revisions, but we can do that some other night," he said. "When we get this program going full blast, we'll have to have better access, though. The program listing the evening's players doesn't come out until one hour before game time, so we'll have to work fast. Do you think we could put it into a motel room near the fronton?" he asked very seriously. "Not without a great deal of difficulty," I said as calmly as I could, considering the question. "Well, you know I wouldn't want to put you out. So I guess what we'll have to do is get the player programs of Friday and Saturday evenings, run over here, pump in the data and determine who to bet on. Since the program takes a while to crunch all the numbers and come up with an answer, we'll have to get some other people from the office to help set up a shuttle between here and the fronton to relay the bets and bring back news of any player changes not covered in the initial schedule. It actually won't be too long before we're at that point." Ralph was so enthusiastic he hardly even noticed the dog was chewing on one of his program sheets and the kids were making paper airplanes out of others. "Wow, did you see that?" I yelled aad. pointed to the CRT screen. "What? What happend?" piped Ralph as he squirmed around to check the CRT. "The CRT momentarily blanked out. I must have a computer problem or the power supply is ready to give out. Hold on, let me 30 check," I yelled back and dashed out of the room, down the stairs and into the base- ment. I stood in front of the computer and momentarily watched the twinkling lights. With a grin that only a Cheshire cat could appreciate, I leaned over to the computer and hit the reset button which would cause the monitor upstairs to blank for about a second. 1 did this twice more for good measure and then pulled the fuse, causing the entire computer to come to a dead stop. I rolled the fuse around in the palm of my hand a few times and gazed at it as I would a gold nugget. When the momentary elation had passed, I pocketed the fuse and went back to the den. I couldn't have looked more depressed when I arrived upstairs. I just frowned in the direction of Ralph and said in a somber lone, "It died!" "What do you mean, 'it died?' " was the frantic reply. "Just that, Ralph. IT DIED! The power supply which I jerry-rigged to add extra memory for you blew up and I don't know what else it took with it. I'm afraid we're out of business for a long time," I added after a deep long audible sigh. "Considering that this is like a child to me, do you think I could be alone, Ralph?" This additional remark was probably a little much, but I was really rolling now. "Sure. Let me know how things are and whether you need any help. I hate to leave you feeling like this, but it probably is a time you want to be alone." Ralph gathered up his entourage and I waved as they exited, still looking quite somber. I closed the front door, clapped my hands together and took off for the basement. I had the fuse out of my pocket by the time I reached the fuse box and inserted it immediately. The computer flashed back to life as I placed the blackjack tape I had made into the cassette recorder and hit the play button. After the program was loaded, I took off upstairs with the dog close to my heels. I threw all my computer magazines which I still wanted to read down on the floor around the keyboard and sal down next to it myself, still elated at my triumph. The dog, who had found a comfortable spot in the middle of all the papers, watched as I entered "RUN" on the keyboard. The program did its thing and displayed a message on the screen. Turning to the dog, I said, "Dog, you show a seven and a jack and the dealer shows a six. Do you want to stand pat or do you want another card?" "Woof!"- Put exceptional versatility and control into your S-100 bus system with the 'blue boards'... and save money in the bargain! : i i % 8 8 8 8 S 8 8 8 % s i XB1 Extender Board Board Only $3.00 With Connector $13.50 ::::::::::::::: MT1 15 slot Mother Board Board Only $45.00 With Connectors $105.00 iimiiiiiiiiimiiiiiiiiiiimiiiimi MB4 4K Static RAM (low power) Kit $129.95 Assembled $179.95 VB1A Video Board Kit $189.95 Assembled $264.95 MB6A 8K Static RAM (low power) Kit $265.00 Assembled S325.00 SB1 Synthesizer Kit Kit $250.00 Assembled $325.00 ■fltfrh^ MB3 2K/4KEPROM(1702A) Kit less PROM's $65.00 2K— $105.00/4K— $145.00 Assembled board available 16K (Available April, 1977) 1/02 Interface Board Kit $55.00 Assembled $79.95 1 ■ MB7 16K Static RAM (low power) " Kit $525.00 | Assembled $599.95 We're the blue boards! Compare the Cybercom blue boards with any others on the market today. You'll find exceptional quality plus prompt delivery and significant cost savings. All Cybercom kits are guaranteed 90 days for parts and labor. Contact your local computer hobbyist store or write for details. f^L Jt)f— jfT^rTTH A divislon of Solid s,ate Music 2102A Walsh Avenue, Santa Clara, CA 95050 Telephone (408) 246-2707 Letters ASOLENOID TYPEWRITER HACK In past issues of your excellent maga- zine I have noted items from your readers expressing interest in converting typewriters for use as printout devices. The accompanying pictures show Ihc results of my efforts along these lines. The keyboard is a slightly modified Teletype unit rescued from a salvage store while the typewriter is a Smith- Corona, Coronet, Super/12 electric portable. The only modification to the typewriter was removal of the carriage- shift-lock-key. The input/output is mod- ified RS232C and operates at about 84 bits per second in ASCII format. The typewriter keyboard actuators are sole- noids, also rescued from the salvage store, one per key with logic decoding circuitry and aGI/AY-5-1 01 3 UART. Lower case was selected as format for letters to obviate a carriage shift for each letter printout. I haven't found the format to be objectionable; the error rate has been acceptable for my hobby use with main maintenance items being ribbon cartridge replacement and con- tact cleaning on the keyboard. As you can see from the picture, the main effort during construction was function not appearance. An avid reader of BYTE magazine. Harold L Baldwin This avid render is bashful, but with luck we'll find him sitting down at a typewriter to write on article on his typewriter buck. PROCESSOR ID NEEDED I recently bought several PC boards with the intent of removing and reusing the chips. One of these boards is labeled ASSY 591700 Gen Purpose Proc- essor-FBA and it appears to be a com- plete 16 bit processor. Before dis- mantling this board, I'd like to find out if it can be used as the basis of a 16 bit mini. The only clue to the manufacturer seems to be the initials or name LEC and the letters M/L-J etched on the front of the board. I'm not familiar with this company, so any information at all on the board of the manufacturer would be much appreciated. Larry Ingram 20 Locust St Cambridge MA 02138 WIDE DISPLAYS IN CHUNKS? I have just finished reading Dr Robert Suding's piece on television readout de- vices in the August 76 issue, page 66, and was interested in his discussion of the bandwidth requirements of monitors versus characters per screen. As part of a project (still in progress) to develop a cheap terminal for use on our campus, I have considered a method of displaying more characters per line that are reasonable on a single monitor by using multiple monitors with a line split between 2 or more monitors. In this scheme, two side by side 6 MHz monitors could be used to present a 64 by 16 format, 3 in a row could display 96 by 16 characters, and a 2 by 2 cluster could go to 64 by 32. The additional electronics and switch- ing logic needed to support such an increase seems to me Almost certain to be far less expensive than going to higher bandwidth monitors whose cost increases very rapidly as large displays are required. (132 by 24 format is not unreasonable to ask for since many printing terminals have such line widths, and once used make a 32 character line extremely restrictive.) I am not aware of any efforts along these lines; is anyone else? Robert E Monroe Associate Director Computing and Data Processing Center Wayne State University Detroit Ml 48202 64 by 16 line displays have been demonstrated in one product which has proven itself in the marketplace already, demonstrating at least that resolution capability with a standard television bandwidth. As far as I'm concerned, however, a far better thing to do is to have a multi-window text editor with separate wide displays for different kinds of information in the text file. For instance, as a documentation machine, consider two side by side dis- plays (64 characters wide or more) with one containing indexing, outline, or Continued on page 115 CASSETTE OR FLOPPY DISK? PERCOM GIVES YOU A CHOICE! the new LI'L FLOPPY! THE CASSETTE I/O THAT WORKS! Compl ALTAI SWTP KANSA Self 30-24 (fas 300-9 (RS- Works ( eve Load/ Provi Run 2 25 Pa ete C R/ IMS 6800 S CIT Clock byt test 600 B 232 c wi th n at Dump si on Cass ge In ASSETTE AI plug and ot Y/BIPHA i ng- 1mm es/sec RELIABL aud Da t ompa t i b ANY ca 120 and Sof twa r for rem ettes S s truct i S TE -in c hers SE St une t Casse E Cas a Ter le! ) sset t 210 e i nc ote c imul t on Ma RMINAL 1/0 ompa t i bl e available anda rd tape spd tte 1/0 sette! ) m i n a 1 1/0 e recorder bytes/ sec ) 1 uded ontrol aneous ly nual $89.95 Kit $119,95 Assembled Instruction Manual only $4.00 (refunded with order) now you can • Compact 3V'x • Uses the com and low cos • Stores 95. 2K • Load 12K byt • ALTAIR/IMSAI Interfaces • Works with e • BASIC ETC an available ( • Price includ enclosure, 2 diskettes $695 Kit afford a floppy!' 6"x9 pact t S\ byt es i and (spe xi s t d ot ex tr es o cabl , dr dis " di es/d n 2 SWT ci fy i ng her a co ne d es , i ver k drive skettes i s k e 1 1 e seconds P 6800 w/o) software software st) 1 sk drive i nterf ace software $810 Assembled Instruction Manual only (refunded with order) Delivery is 60 days AR0 $10 Dealer inquiries invited PEfiSOM Call or write for complete specifications PERCOM DATA COMPANY . 4021 Windsor . Garland, Texas 75042 . (214)276 1968 32 And now minis too! All from a catalog, at discount prices. Digital's Direct Sales Catalog — the first catalog to offer com- puter products by mail with off-the-shelf delivery — was such a success, we've come out with an expanded second edi- tion that includes the PDP-8A, the newest member of the world's most popular mini- computer family. We've also added the LA180 line printer and expanded the sections on microcomputers, logic modules, terminals, cab- inets, connectors, accessories, and supplies from the first edition. Of course, you still get our 5% catalog discount, plus another 4% for cash with your order. You also get a 10-day free trial period, plus our stand- ard 90- warranty. (Since we're selling by mail, you do have to install the equipment yourself.) If you were among the thou- sands who ordered our original catalog, you'll get the new one automatically by mail. If you weren't, why not sign up now? For your free copy, call 800- 225-9480 (Mass. 617-481-7400 ext. 6608). Or write: Components Group, Digital Equipment Corp., MR2-2/M59, One Iron Way, Marlborough, MA 01752. (Catalog sales to U.S. only.) A Review of Tom Pittman's Tiny BASIC Richard Rosner Pocono Rd Brookfield CT 06804 While at the Personal Computing 76 Trade Show at Atlantic City I bought a copy of Tom Pittman's Tiny BASIC Interpreter for my home computer, a 6502 with the MOS Technology TIM program in read only memory. Tom Pittman has several different versions of Tiny BASIC for different sys- tems. I purchased the KIM version even though my computer uses a Teletype and the TIM instead of a keyboard. This allows me to load the interpreter starting at 0200 hexadecimal instead of at 1000 hexadecimal, leaving more memory space for my user programs. Tiny BASIC is a subset of Dartmouth BASIC. It can handle only 16 bit signed integer numbers between -32768 and +32767 and recognizes the following commands: CLEAR REM GOSUB INPUT LET RETURN LIST IF... THEN END PRINT GOTO RUN The only operations understood by Tiny BASIC are addition, subtraction, multiplica- tion, and division (+, — , *, and /). There are two intrinsic functions. One generates a ran- dom number and the other, USR, allows subroutine jumps to machine language pro- grams. More about USR later. Even with these limitations, Tiny BASIC is very powerful. It is easy to learn and use, and programs can be written very quickly. To use Tiny BASIC you first load the paper tape of the interpreter into the program- mable memory. This takes about ten min- utes on a Teletype. Then write the addresses of the 10 routines into the proper locations and jump to the start of the interpreter. In less than an hour I had it up and running. I wrote and debugged a plot routine one Friday night and made several revisions by the time the weekend was over. The Tiny BASIC plot program shown in listing 1 accepts the X and Y origin and the X and Y increments as inputs. Then, using a function placed in a subroutine, the program plots a 50 by 50 point graph. The first input, on line 10, determines the form of the output. A 1 input stops the program after the LIST command at line 20 causes lines 1000 to 1999 to be printed. These lines are the subroutine containing the function to be plotted. A 2 input causes a request lor two more inputs: the X origin and the X increment, T and V in line 200. The printed outputs are the function to be plotted and a table of X and Y values. This table is helpful in choosing the Y origin and Y increment to be used for the graph. A value of 3 as the first input causes a request for four more inputs: the X origin, the X increment, the Y origin, and the Y increment; T, V, U and W in line 300. The outputs are the function to be plotted and the graph. Lines 205 through 290 generate and print 34 tLisr m inputx ai Lisn.i3.i.i 999 33 lFX=lGOrOI33 43 ifx=2go rGP3ij 50 1FX=3G0T0331 1 3 3 END 23a input t.v 935 X = T 213 PfT'X'V'Y" 21 5 PS" " ." " P23 GOSJril031 2 31 Pi/ J 373 IFY<«G0I"'J491 375 IFY = 1G U051 ) 3 83 PS" "IX,"! "I 391 IFK = 53GQr0433 433 PS 413 GOr0518 431 Y=Y-1 443 IFY = lGJr047f) 453 PS 461 G0T0431 471 PS"+" 481 G0r05!(l 493 PS X»"<" 495 G0r05lfl 533 PS x,"«" 51 1 X = x*v 523 lFX Ml 1 -j =x*x*; i 999 rt£r<.MN Ed iAr io-j ro hi-: -'Lor r -M83 -4497 -95 11 - 3 i 4 1 -S71 - 1 -31 839 4119 Listing 2a: The 2 command has been read telling the program to request a value for the X origin and increment. A table of X and Y values for the function of line 1 010 is also output. In this example the X origin is —50 and the X increment is 5*2. For the X values of —50, —40, 40 and 50 the incorrect Y value is given. This is because the value that is computed is outside the range of the Tiny BASIC'S capabilities. After looking at this table the origins of the program can be changed so that values capable of being used are generated. Another use of the table is to determine the values of the Y axis. A small program change in lines 1000 to 1999 allows discontinuous Functions to be generated and plotted as in listing 4. These lines are the ones that contain the function to be plotted. Instead of using a simple expression, conditions are set up to deter- mine the starting Y value of the graph on line 1060, the upper and lower limits be- tween which the graph will oscillate on lines 1020 and 1000, and the risetime and fall- time of the graph on lines 1040 and 1051. By examining lines 1 000 to 1 999 in listing 4 it can be seen that the graph is independent of X but is a function of its own previous value. If you want to use the entire graphing routine as a subroutine you may want to renumber each line. Be sure that there are no statement number conflicts with your routines and that all GOTO, GOSUB, and LIST statements are properly changed. As an alternative you can use statement numbers from 2000 through 32767 and put a "GOTO (first line number of your routine)" at statement number 1 . You will notice that no unnecessary blanks arc included within each statement. This makes it slightly more difficult to read the program but does conserve space. Each blank requires a byte of storage. At an average of 2 blanks per line, this saves 90 bytes. As shown in listing 1, the program requires about 650 bytes of programmable memory storage. The USR instruction allows a Tiny BASIC program access to machine language subroutines and to the rest of the memory space including IO ports. The format for using USR is: D = USR ( P, L, A) where P is the address of the machine language subroutine, Lisa variable passed through the X and Y processor registers, and A is a variable passed through the processor's accumulator. Upon exiting from such a user subroutine and returning to Tiny BASIC, the high order eight bits of D are taken from the Y register and the low order eight bits of D are taken from the accumu- lator. The D, P, L and A values are in decimal. Two subroutines addressable by the USR function are included in Tiny BASIC. These are the PEEK and POKE routines. The PEEK routine reads the byte at location L, converts this byte to its decimal equivalent and sets D to this value. The POKE routine loads the low order eight bits of A into the memory location specified by L. The PEEK routine is located at P = 532 for the KIM version and the POKE routine is located at decimal address P = 536. The addresses for the TIM version are decimal addresses P = 41 1 6 for PEEK and P = 41 20 for POKE. For the 6800 these addresses are P = 276 for PEEK and P = 280 for POKE. With these routines you can read and write into your computer's IO ports. Set L to the port address, decimal, P to the PEEK address and execute D= USR( P, L). Listing 2b: This is a run of the program under the 2 command using the same origin and increment values as in listing 2a. The function to be graphed, however, is still a cubic. Rearranging the order of operations helps avoid overflow errors. With this equation the only value that falls outside the ability of Tiny BASIC appears when X = —50. I AS* ISM Y = X»X/ 1 999 AZ PJ-iN THE E3JAUON TO 'ir ^I.JflEO lb 2^85 -»3 861 - VS 1 I -33 4 1 -S71 -I -31 839 41 $9 I 1979 36 :*JN 3. -2 5. I. -Id'*. 4 1030 HEM THE EQUATION TO BE PLOTTED Is 1010 t = X*X*X/4-3*X"'X+2 *X-J I 103 r*ErU-*N -2 5 -24 -23 -22 -2 1 -21 -t y -I 8 -1 7 -12 -I 1 -ia 13 14 I 7 I 9 23 24 25 The port data is loaded into D. Set L to the decimal port address, P to the POKE ad- dress, A to the value to be transferred and execute D= USR ( P, L, A). This causes the value of A to be written into the port. By using the PB7 pin on a 6530, very accurate pulses from two microseconds to about a quarter of a second in width can be generated directly from Tiny BASIC. If L is set to the base address of the 6530 timer, then the addresses L+12, L+13, L+14 and L+15 determine a factor by which A is multiplied to get the pulse width. These factors are: Address Pulse Width L+12 1 * A L + 13 8* A L+14 64* A L+15 1 024 * A Listing 3: The plot of the cubic equation whose table of values is shown in figure 2a. The graduations on the Y axis are from —100 to +100. A caret is found on the X axis from the values of —25 to —5. This mark indicates that the point on the graph is less than the Y origin, in other words is less than — 100 for this example. If the value of Y is equal to 0, a plus sign, +, will be printed on the X axis. If the value of Y is greater than 0, an exclamation point, I, will be printed on the X axis, and a plus sign will be printed at the value. If the 6502 is using a one megahertz clock, executing the line D = USR (536, L + 13,216) causes a pulse of width 1 728 jus ( 8 * 21 6 ) to be generated at PB7. PB7 must be set up as an input (not output) and the 6530 timer must be dedicated to this function. To return to the TIM monitor the Tiny BASIC program should execute this se- quence of statements: D= USR ( 536, 0,0) D= USR ( 536, 1,96) D = USR ( 0) The first instruction loads 00, the 6502 BRK software interrupt instruction, into location 0000. The second instruction in the above se- quence loads 96, 60 hexadecimal, the 6502 RTS return from subroutine instruction, into location 0001. The last instruction causes Tiny BASIC to jump to the sub- routine at 0000 where the instruction exe- cuted by the 6502 causes the TIM monitor to take over. To return to Tiny BASIC, just have the TIM monitor execute the instruc- tion at 0001 by typing "G" at the console. If the sequence of instructions above was executed from a Tiny BASIC program by preceding each instruction with a line num- ber and commanding RUN, the next instruc- tion in the user's Tiny BASIC program will be executed when returning from the TIM monitor. Saving and reloading programs from pa- per tape or magnetic tape is easy with Tiny BASIC if you have a debugged version of the interpreter. The procedure is to save the program by typing LIST, turning on the paper tape punch, and pressing the RE- TURN key on the Teletype. To reload the program press LINE FEED, load the paper tape into the tape reader and turn the reader on. The LINE FEED command suppresses 37 :RUN 3, 1 j I 1 td'd L=2 5 1313 REM U IS THE LOWER LIMIT 1323 M = 45 1333 REM M IS THE JPRER LIMIT 1343 S=4 1953 REM S IS THE R1SETIME 1351 REM THE FALLTIME IS |/{M-L) 10 63 K=12 1373 REM K IS THE ST4.RTIMG r ML IE I a Eta 1FX = T Z=(K-L)/S 1393 Y=S«Z+L 1133 Z-l*\ 1113 1EY>=M Z=3 1 999 RETURN Listing 4: Plot of a sawtooth function. The function is independent of X but is dependent on the previous value of Y. This type of graph may be plotted by changing lines 1000 through 1999 from those shown in listing 1 to those shown at the top of this listing. These changes allow you to specify the Y value that the graph should start at, the upper and lower limits between which the graph will oscillate, and the rise and fall times of the graph. Using this type of evaluation technique a wide variety of discontinuous or oscillating functions can be generated. 1 1 12 13 14 15 I 6 I 7 I 8 19 22 23 25 26 32 33 34 35 36 37 45 46 47 output from the interpreter to allow more than one line at a time to be read in without interfering line prompts which can cause the input through the tape reader to lose synchronization. If the LINE FEED com- mand does not suppress line prompts then you may have a bug in the interpreter. In the KIM version check hexadecimal locations 06C7 and 06CB for 13 hexadecimal, X off, and OA hexadecimal, LINE FEED, respec- tively. These bytes may be reversed. If they are, switch them and try again. In the TIM version check locations 14C7 and 14CB. In both cases the lower location should contain 13 hexadecimal and the higher location should contain OA hexadecimal. Only tapes shipped before September 1976 should have this problem. To obtain a copy of the Tiny BASIC interpreter for your machine, send a descrip- tion of your system along with a check for $5 to Tom Pittman, itty bitty computers, POB 23189, San Jose CA 95153. In return you will receive the interpreter on a paper tape and a user's manual. The 6502 micro- processor, TIM, KIM, and 6530 are available from MOS Technology Inc, Morristown PA, as is a line of KIM-n products which can be assembled into a complete computer." LET YOUR COMPUTER XPRES ITSELF! Your computer can control lights, burglar alarms, Hi-Fi's, PHASORS; practically anything if properly interfaced. XPRES is a complete interface system. ONE EIGHT BIT PORT OR ONE SERIAL PORT CONTROLS 128 SEPARATE DEVICES. Connect to IMSAI, Altair, or SWTPC; any processor with an eight bit or serial port. Use ISB-01 for serial connection to processor. IMB-01 system mother board, holds five interface boards, complete with connectors. KIT $28.00 IFB-01 interface board, controls two 115 VAC 300 watt cir- cuits. Optically isolated. KIT $38.00 IFB-02 interface board, controls four 3 amp 115 AC/DC circuits with on-board relays. KIT $58.00 IFB-03 prototype board, build your own interface. Board includes XPRES bus decoders. KIT $15.00 IFB-04 interface board, controls 4 small signal AC/DC cir- cuits with reed relays. KIT $36.00 IFB-05 drives 4 IRB-01 remotes (below) with low voltage lines. KIT $29.00 IRB-01 remote 115 VAC 300 watt interface. Build into your own equip. 2" X 2Vi". KIT $17.00 ISB-01 drive XPRES system with a single TTY line, 20 ma., RS232, or TTL. Plugs into IMB-01. KIT $48.00 Wash, residents add 5.4% tax. CRC Engineer P.O. Box 6263 Bellevue, Wa. 98007 (206) 885-7038 38 Peripheral Vision impacts your computer. ■i WITH A FULL-SIZE, LOW-COST IMPACT PRINTER. Until now, the hobbyist and small businessman have had one major problem in assembling a reasonably price microprocessor system with the capabilities found in the more costly computers. It was impossible to find a high-quality, high-output printer for hard copy needs at an affordable price. Peripheral Vision has come up with a solution. We are offering a full-size impact printer designed for microprocessors — and it comes with a mini price. Kit prices start as low as $495 for the printer and interface card. And that won't impact your pocketbook. Peripheral Vision's printer is loaded with capabilities. Take a look: • It's fast — 120 characters per second • 96 characters per line, 12 characters per inch horizontal, 6 lines per inch • Makes up to 4 copies simultaneously • Character set and pitch variable under software control • 5 x 7 character matrix • Ribbon has built-in re-inkers for a life of 10,000,000 characters • Paper can be either a standard 8 1 /2-inch roll, fanfold or cut page • Interfaces to 8-bit parallel ports Just remember, Peripheral Vision is committed to helping you get along with your computer. The new printer we are offering is another example. It is high quality, low in cost and will definitely impact your system. Write or call now to find out how to impact your computer. P.O. Box 6267 Denver, Colorado 80206 (303) 777-4292 A Software Controlled 1200 bps Audio Tape Interface Carl Helmers Editor Often a piece of equipment is designed which will perform perfectly well in the mode of its intended operation, but which can also perform in ways not necessarily intended by the designer. An example of such a situation is the AC-30 audio tape cassette interface subsystem described by Gary Kay in his article in December 1976 BYTE, page 98, and manufactured by Southwest Technical Products Corporation. In a box accompanying that article, I noted the possibility of running Gary's design considerably faster than the nominal 300 bps rate of the "BYTE" or "Kansas City" standard for audio cassette recording. Since making the comment, I have inte- grated the AC-30 into my homebrew Motor- ola 6800 system and have worked out the details of this high speed use of the AC-30. The Kansas City standard uses an AC coupled redundant phase encoded method of recording which takes advantage of the audio recorder's existing electronics. Re- taining the original audio electronics allows continued normal use of the audio medium when you're not using the computer. This type of modulation is often generated from a 4800 Hz clock source and a UART (uni- versal asynchronous receiver-transmitter) or ACIA (asynchronous communications inter- face adapter) integrated circuit interfaced to the computer's bus to do the shifting out of data. Gary assumed an ACIA or UART would be used when he designed the AC-30. The same clock which is divided by 1 6 in the UART shifts the data out to the modulator, and is used by the modulator to generate an output waveform; on receipt of data from tape, the receiver section of the UART or ACIA uses a clock at about 4800 Hz which is derived from the tape data. The logic in the AC-30 which is used to generate and decode the waveform is only dependent upon the 1200 Hz and 2400 Hz frequencies Figure J: Timing of various interface signals. This diagram shows audio and TTL logic level signals for 300 bps and 1200 bps data referenced to the same 4800 Hz clock shown at E. On output, the timing of the clock governs generation of the waveforms, and on input the waveforms of A or C are used to regenerate clock data which averages 4800 Hz but with some jitter. The waveforms of A and B, respectively, show filtered audio and equivalent redundant Manchester I encoded digital data for a 300 BPS FILTERED AUDIO 300 BPS DATA 300 BPS PE 300 BPS ST30 VALUES 300 BPS BITC VALUES 1200 BPS FILTERED AUDIO 1200 BPS DATA 1200 BPS PE 1200 BPS ST30 VALUES BITC VALUES 4800 Hz CLOCK [ULi^Jijuu^Tj^^^Ji^LjmjiJiJiJiJiriniuumjmj r iJiJ¥ia 40 which are derived from the 4800 Hz output clock by frequency division in toggle flip flops. The fact that it is only the 1200 and 2400 Hz frequencies on the tape which count when modulating or demodulating the data is what makes this trick of 1200 bps recording with the AC-30 possible. Figure 1 shows the typical waveforms of the redun- dant phase encoded format at the beginning of a 300 bps character transmission from the UART or ACIA, and for an entire character transmitted by a suitable algorithm in the asynchronous data format at 1200 bps. For 300 bps transmissions, a logical bit in the tape record consists of four complete cycles of 1200 Hz and a logical 1 bit consists of eight complete cycles of 2400 Hz. The switching between the two frequencies is synchronous with the zero crossings so that when the digital square wave signals gener- ated by the logic are filtered in the AC-30, and by the act of recording on magnetic tape, the results coming back into the demodulator are smooth sine wave ap- proximations (see figure 1 A for the 300 bps version). In the 1200 bps version, we eliminate most of the redundancy from the redundant Manchester code by using only one complete cycle of 1200 Hz for a logical bit, and two complete cycles of 2400 Hz for a logical 1 bit. If we were to use a true Manchester I phase encoding method (see Ira Rampil and Jack Bremier's article in March 1977 BYTE, page 38), a 2400 bps rate would be possible by eliminating one more level of redundancy. But the design of the AC-30 prevents generation of the true phase encoded signal and the goal was to use the AC-30 without any hardware modifications in its circuit. With this analysis of the situation, and a mental picture of what is seen in figure 1, I set out to make an interface which would drive the AC-30 at 1200 bps. Since I am a software person at heart, and since I wanted to allow the possibility of eventually dis- pensing with the asynchronous communica- tions format by means of a new program design, I decided to leave out the UART or ACIA chips and make a simple hardware interface for a programmed data format driven by interrupts. The Hardware: A Dedicated Port and Real Time Clock In order to do a software simulation of a data transmission format, some form of timing must be generated, both as the 4800 Hz clock source for output through the AC-30 and to synchronize data with that clock or the tape derived clock on input. Within the context of my own system, and bearing in mind more general uses of the technique as well, I chose to use a separate timing source driving the processor's non- maskable interrupt (NMI) line as the means of synchronizing the software to the time base. On output, the NMI line would have to be driven by a 4800 Hz clock source; on input the NMI line would have to be driven by the derived clock provided by the AC-30. The output clock source is a simple 555 oscillator, IC9 in figure 2. This was set up with a variable resistor and a timing capac- itor such that 4800 Hz was well within the 300 bps signal. The time ordered sequence of data starts with a "start" bit followed by several data bits. The waveforms of C and D show a complete character transmission at 1200 bps both as filtered audio (C) and redundant Manchester I encoded digital data (D). Above B and D are shown verbal descriptions of the data being transferred. Noted below signals B and D are the values of the variables ST30 and BITC during output operations (see listing 1 and procedure 6). M\aaaA/wwwvww\/wv 3 2 10 3 2 1 O 32I0 3 2I032I032I032I032I032I032I032IO 2 I O O O OOOOO firuuumnririJirirunrir^jijirijiru^rir^^ 41 Figure 2: The hardware needed to add this general purpose high speed A C-30 interface. The logic includes address decoding for the addresses in listing I and table I, latched output from location 160 for control and data transmission purposes, drivers and receivers for RS-232 lines, an oscillator time base for output interrupts, as well as interrupt control logic and an open collector driver for the nonmaskable interrupt line. For those who use a commercial 6800 system, the bus pins should be allocated to the equivalent backplane pins of your system, and address decoding should be altered to fit your system. The names used in commercial products are usually similar to the Motorola documentation from which this system was designed. 42 tuning range. The .01 ;uF disk ceramic ca- pacitor C2 which I used as part of the frequency determination network for the oscillator may not have been the best choice for insensitivity to temperature and long term frequency stability, but previous ex- perience with 555 oscillators of this type proved stable over the course of nearly a year of use in a slower tape interface which had been my primary mass storage method until now. After the oscillator is wired, it can be tuned to 4800 Hz by several methods. One method is to borrow a friend's frequency meter, or use an oscilloscope with pre- sumably accurate calibration of its time base. I used a simple interrupt driven pro- gram in the processor to count the number of processor cycles between clock interrupts since I don't trust my oscilloscope's calibra- tion and don't have a frequency counter, but do have a crystal controlled processor clock. Listing 1: An assembly of the AC-30 inter- face routines. The origin of this assembly was chosen arbitrarily as hexadecimal 2000 to simplify relocation. In actual use, the routines were assembled to end up at the top of the previous code limits for the author's IMP 6800 monitor and text editor programs. (IMP, which resides in write protected memory at locations 1000 to JFFF, stands for "Interactive Manipulator Program. ") The addresses of FLA G, MEM and ERRS used here are set by the structure of IMP — as arguments in different versions of this set of routines, any old address would do. The 10 address locations reflect the hardware of figure 1, and Ml LI is a one millisecond delay loop program resident in a random piece of ROM which fills up part of the bootstrap ROM of the system. In the system in which this algorithm was used, the NMI (and other interrupts) vector to jump instructions in programmable memory in the first 12 bytes of address space. locn -u -*y aa ponn POOO Number Type +5 V GND -12V +12V IC1 74154 24 12 IC2 7402 14 7 IC3 7430 14 7 IC4 7400 14 7 IC5 7404 14 7 IC6 7410 14 7 IC7 7401 14 7 IC8 7400 14 7 IC9 555 8,4 1 IC10 DM8833 16 8 IC11 DM8833 16 8 IC12 DS1489 14 7 IC13 DS1488 — 7 1 14 IC14 74100 24 7 ho no soon 8000 anno HO'OO aonn anno 800-13 2000 2000 anno aooo 2000 so no poon pnno aonn ooso 0051 Q05S 0053 2000 0055 5 7 59 2000 0OS« O 1 60 1 61 1 -S3 1 3H 5000 OOO/l 2000 002E 001 5 00 33 2000 2000 2000 2000 7E 2 00 3 7E 2006 7E 20 0-'* 7E 200C 7E 20 OK 7E 201 2 201 a 20 1 P SO 12 96 20 1 4 RA 20 1 6 H7 20 1'* 7 A 20 IC 27 20 1 K 3H 20 1 K 4K 20 LD 1 8000 7 7 20 2 3 7 6 2026 24 202R 4C 2024 97 2027 1 2 SB 9 6 20 2D 2 7 20 21- 4A 2 30 9? 20 2 K 1 20 32 4 6 20.'3/i 9 7 2036 3B 20 37 203 7 20 3 7 20 3 7 20 37 20 37 20 3 7 2007 20 2 3 7 9 6 2039 86 203B DE 20 3D UK 20 3 F B6 204 1 9 7 2043 H6 2045 9 7 204 7 UE S049 A6 204B 97 20 4 7fl 2050 79 2053 39 2054 SO 54 2054 86 20L0 SO 2056 97 2058 20 305A 205A 20 5A B6 2001 20 S0 5C 9 7 205E 96 2059 04 2060 4 7 20 61 9 7 JHb 52000 AC-30 tWl'KKfftOK HUU-naiJftS "BYTE STANUARD" Iftl'fEK* ACE Sue TwAHE ALSL' CALLED "KANSAS GIT*"** "CUTS" rUrii'iAi HUT A RUSE BY ANY UTHfc'K NAMIs, STILL SilKLLS DESIGN BY CARL HEUIERS* EDITOR, BYTfci GENERAL AC-30 IU DESIb.^ED DECEMBER 26 1976 TAPE 2U0A LuCATIuN 020 r I LE="AC-30 lu" >* THIS SET jf HuUTlNES RUivS AT 300 uh 1200 BPS >* AT 300 BPS, IS "BYTE", "KANSAS CITY" UK "CUTS" ruttrtrtl >* AT 1200 BPS, IS 12U0 BPS REDUNDAlW MAivChtS 1 ER 1 >* PHASE ENCuDI L\JL >* THE VARIABLE "RATE" DE T EHMl NES SPEED Uf UATA >* EQUATES >ST3U EQU i50 OUTPUT BIT STATE >UITV EQU Sbl OUTPUT Bll VALUE (0 uh 1) >BI TC EQU i5k! UUTPUT BIT CuU^T >1JATL EQU ibJ LEt- T DATA & TRAILER >DATR EQU 454 RIUriT DATA & START BI T >» IN ARTICLE, "DAT" REh ERS Tu BVTH 0* AriuVE >NXDA EQU i.55 NEXT DATA £2 BYTES) >DELA EQU S»57 DELAY COUNT (2 BYTES) >RATE EQU i59 DATA RATE >* 300 BPS VALUE=16 1200 BPS UALUE=4 >HAL> EQU SbA HALc RATE >AC30 EQU SlfeO AC30 DATA UUTPUT AND INPUT ADDRESS >ACbU EQU & 1 61 UUTPUT Nrtl INTERRUPT ENABLE ADDRESS >ACUr EQU il 63 NMI INTERRUPT DISABLE ADDRESS >MILI EQU S1JH MILICSJ - B MILLISECuND DELAY >* MIL1 IS A TIMING LuuP IN MUNItUH >NMIV EQU i4 NMI ADDRESS VECTUfl >* JMP OP CUDE AT LOCATION 43 ALLUWS toKITABLK, VECTuH >KLAU EQU 42E MUMTUR'S INPUT UK UUTPUT TRAiMSi-ER f-LAb >MEM EQU S15 rtUNITUH'S EVOLVING DATA PulNTER >ERRS EQU 433 MONITOR'S ERRUR COUNT MELD IN VEHUY >* THE KULLUWINb JUMPS SIMPLIFY PATCHINb INTu riUWlTUH >* DURING INITIAL TESTING BY PRUVIDING MXEU ENTRIES 00 00 00 00 00 00 00 00 00 00 1 60 00 50 00 5 3 00 54 •UPEl •READ •WRI T •VRKY ■CLOS -UPE2 JMP JMP JMP JMP JMP JMP UlUP UIHD Ul WR Ul VY UlCL U2UP >* AC-30 NMI >CY30 EQU * > LUAA > URAA > STAA INTERRUPT HANDLER >NKXP DEC 8EQ RTI CLRA 6ITV #it-E AC30 ST30 NEXB > ASR DATL > ROR DATR > BCC CYZN > INCA >0YZN STAA BITV > LDAA BITC > BEQ CYZR > DECA >CYZR STAA BITC > LDAA HATE > STAA ST30 > RTI AC-30 MONITOR ROUTINES WRITE AC-30 300 BPS 1 WR EQU * 00 56 00 5 5 LDAA BNE LDX STX LDAA STAA LDAA STAA LDX LDAA STAA ASL ROL RTS BITC IE BIT COUNT > THEN WAIT Ul WR NX DA DATL := NXDA # 1 1 BITC := 11 CSET BIT C0UNT3J * i FF NXDA CSET TRAILING" BIT PATTERN 3 MEM NXUA+1 NXDA+1 NXDA := = 8 MEM C DEFINE NEXT OUTPUT] SHL(NXDA) [INSERT START BIT3 >* 1200 BPS OPEN >U20P LDAA #4 STAA BRA RATE UUOP >* 300 BP5 UPEN >U1UP LDAA t 1 6 STAA LDAA ASRA STAA HATE RATE 43 Listing 1, continued: 2063 7D 00 2E > TST FLAG IS IT UUTPUT7 2066 86 00 > BNE U1UU 2068 7E 00 00 > JMP Ul I U It- MUT THEN I NPUT OPEi^ 206B >* 206B >* OUTPUT UP EN 206B 86 Eh >U1UU LDAA *£EF TURN 2067 03 206D B7 01 60 > STAA AC 30 UN 2070 86 FF > LDAA #$FK THE 2072 B7 01 60 > STAA AC30 motur; 2075 CE C3 50 > LDX #9999+9999+9y99+999V+V9y9+5 (It : bo^ooo) 2078 DF 57 > srx DELA 207A CE FF FF > LUX * *KKK* 207D DF 53 > STX DATL 207F DF 55 > SIX NXDA 2081 96 59 > LDAA RATE 2083 97 50 > STAA ST30 20 8 5 97 52 > STAA BITC 2087 CE 00 00 > LDX #0104 SET UP INTERRUPTS 208A DF 04 > STX an I V 208C 7F 00 51 > CLR BITV 20 8 K 4F > CLRA 2090 7r 01 61 > CLR ACGU 2093 4D >U1U4 TST A 2094 27 FD > BEQ U1U4 2096 39 > RTS 2097 >* 2097 >* OUTPUT OPEN INTERRUPT 2097 DE 57 >U101 LDX DELA 2088 20 97 2099 09 > DEX 209A 27 00 > BEQ GONE 209C DF 57 > STX DLLA 209E 3B > RTI 20 9 F >GONE EQU * 209B 03 209F CE 20 12 > LDX #CYJO 20A2 DF 04 > STX NMI V 20A4 86 01 > LDAA »\ 20A6 97 51 > STAA BITV 20A8 30 > TSX 20A9 63 02 > CUM 2>X LEAVE OPEN HANGUP 20AB 3B > RTI 20AC >* 20AC >* 300 BPS CLOSE 20AC 7D 00 2E >U1CL TST FLAG 200D 20 AC 20AF 26 00 > BNE U1UC 20 Bl 7E 00 00 > JMP Ul IC 20B4 >* 20 B4 >* OUTPUT CLOSE 20 B4 96 52 >U10C LDAA BITC 20B0 03 20B6 26 FC > BNE U10C WAIT FOR END LAST CHR 20 B8 DE 55 > LDX NXDA 20BA DF 53 > STX DATL 20BC DF 55 > STX NXDA 20BE CE 00 6E > LDX #110 20C1 DF 55 > STX NXDA 20C3 86 OB >U1U2 LDAA #1 1 20C5 97 52 > STAA BITC 20 C 7 96 52 >U103 LDAA BITC '20 C 9 26 FC > BNE U1U3 20CB DE 55 > LDX NXDA 20CU 09 > DEX 20CE DF 55 > STX NXDA 20D0 26 Fl > BNE U102 20D2 7F 01 63 > CLR ACUF TURN UrF NMI 20 D 5 86 DF > LDAA #SDF 20D7 B7 01 60 > STAA AC30 TURN UFF 20 DA 86 FF > LDAA #SFF THE 20DC B7 01 60 > STAA AC30 MOTUR 20DF C6 FA > LDAB #250 20E1 37 > PSHB 20E2 BD 01 38 > JSR MILI 20E5 33 > PULB 20 E6 BD 01 38 > JSR MILI 20E9 39 > RTS 20EA >* 20 EA >* INPUT OPEN 20 EA 86 BF >U1I0 LDAA #JBF 20 69 SO EA 20 EC B7 01 60 > STAA AC 30 20 EF 86 FF > LDAA #SFF 20 Fl B7 01 60 > STAA AC30 20 F4 C6 FA > LDAB #250 20 F6 7F 00 51 > CLR 8ITV 20F9 37 > PSHB 20 FA BD 01 38 > JSR MI LI 20FD 33 > PULB 20 FE BD 01 38 > JSR MILI 2101 CE 00 00 > LDX #U1 I 1 2104 Df 04 > STX NMI V 2106 7F 01 62 > CLR ACGO+1 2109 39 > RTS 210A >* AWAIT START 210A B6 01 60 >U1 I 1 LDAA AC 30 2102 21 QA 210D 84 01 > AN LA #1 210F 26 00 > BNE Ul IA 21 1 1 96 5A > LDAA HALr BIT TIME 21 13 97 50 > STAA ST30 21 15 CE 00 00 > LDX #U1 I 2 21 18 DF 04 > STX NM I V 21 1A 3B >U1 IA RTI 21 10 09 2 1 IB >* 21 IB >* VERIFY START 211B B6 01 60 >U1I2 LDAA AC30 2116 21 IB Masking the Unmaskable Driving the NMI line for interrupts has one potential problem with a 6800 pro- cessor: The hardware of the microprocessor itself has no way to turn off the source of the interrupts. When I am not using the tape interface, I don't want to have any inter- rupts. When I am listening to input data, I don't want interrupts from the output clock. When I am recording the data, I don't want any spurious interrupts from the input clock logic of the AC-30. Thus some switching and masking logic is in order. In figure 2, IC1, IC2 and IC3 are used together to decode several addresses by combining selection of the address with VMA (valid memory address) and the pro- cessor's <&2 signal. Three of these addresses, hexadecimal 0161, 0162 and 1063, are not NOTES UN USE THE A0-30 WITH SUPEHSCuPe. MODEL C-104 fc************************************** * T»iPKFATUI-E SENSITIVITY WHEN USEb IN A CoLL dASc-il.lVj" < e.S T 1 MATcd TEl-iPEHhTURe. Or bS-dO L'EuHEES rAHRENHEIT) THE RECURbb uN TAPE *EHc ur TEN UNREAuABLE- THE SUSPECTED CAUSE ul- THIS PHE^oME.vOW IS CHANGES IN LINEAR DIMENSIONS Or TAPE.. SIimCE ADJUST 1Kb THE TAPE SPEED Tu NUN STANDAHb VAUJES CURED THE PROBLEM. THE ADuUSTMEi*r WHICH WURnEb *hd AtiUUl' 1-2* SLutoER THAN oluRMAL BY THE C-104'S DIAL* wHICH IS (lUWSIbJiMfT WITH A CONTRACTION Ur THr. LI WEAH DIMENSIONS ul- THE TAPE bUE To THE LuWER SYSTEM TEMPERATURE- ShNSITI VI TY fl ME" Ai\ib "VOLUME" CbM'HULS THE PLAYBACK RELIABILITY IS ErrECTIVELY I ;vbEPErtbE.»i T UK THE VULUME Or PLAYBACK uVER A RANGE CoVcrIaG THE. CENTER Or THE VoiJJME SCALE ur iHh. RECORDER (J lU urt ITS ARBITRARY CALlBHATIu.V SCALE). HuWEVEh THERE WAS CONSIDERABLE SENSITIVITY TO THE TONE CUNTRUL SETTING. WITH Trir_ uPTIMAL COwTRoL Br-IivG TOWARD THc. "-'* SibE ur I :\ THE C-104'S RANbE ur -b To +b- UEivERAI. SUMMARY RESULTS AS uA^JAhY 2 7 19V7- ArTER ONE MUNTH Or USE, ThE INTEHrACt. HAS WURKEL RELIABLY AS THE PRINCIPAL MASS STORAGE DEVICE Its. WY SYSTcf. ftt-TER IT WAS ASSEMBLED AT A LuCATIuN WITHIN MY MUNl Tuh PHUuRA:-;. WITH THE EXCEPTlu* or THE TEMPEHATUHE SENSITIVITY WHICH ' w as CURED BY uPENING THE BASEMEwT HEAT REGISTERS* Aivb THE Tuivt SE.vSrrivrTY WHICH WAS COREL bY rlNblwG THE RIGHT rJNUB SETTINO RANGE* No ERRURS I i\i READ UR VERIrY uPERATIuwS HAVE BEEN EwCUUNTEREb. THE 24 BIT CHECa SUM USED 1 1- THE MoNITuH b'HIVrNla THESE PHOGHAMS IS THE PRIMARY VEhlrlCATIuN or THr. HEAD OPERATIONS* WHICH IS AUGMENTED UN VERIrY UPERATIo BY THE BYTE BY BYTE CUMPARISUN Oh TAPE DATA Tu MEMORY DATA. THIS TEXT WAS PREPARED USIiMG THE TEXT EDITOR PKoGHAM BUILT InTu MY MONITOR. THE fIRST ITEM WRITTErt AND DEBUbbED USING OACrt EMMERICHS' ASSEMBLER DESCRIBED (PART 1) ELSEWHERE £« THIS ISSUE Or BYTE- CTH 1/27/7'/ *****+**» ******** 211 E 84 01 > ANDA #1 2120 26 00 > BNE U1IB 2122 7A 00 50 > DEC ST 30 2125 27 00 > BEQ U1I0 2 127 3B > RTI 2128 >* START VERIFIES 2128 96 59 >U1 IQ LDAA RATE 2126 01 212A 97 50 > STAA ST 30 2 12C 86 08 > LDAA #8 212E 97 52 > STAA BITC 2 1 30 CE 00 00 > LDX #U1I3 2133 DF 04 > STX NMI V 44 implemented as actual memory locations at all. Instead, the address selection outputs of IC1 for these addresses are used to control three flip flops which determine the source of the NMI interrupt generated by this circuit. The most important flip flop is formed by IC6a and IC6b. This is the interrupt mask flip flop, which is set (allow- ing interrupts) by a reference to hexadecimal addresses 0161 or 0162. This flip flop is cleared by either a system reset or a refer- ence to location 0163. The system reset aspect is quite important, since it would not be too useful to have the system power up with these interrupts enabled and no inter- rupt handler in memory, and when develop- ing software for the interface it helps to be able to reestablish normal interrupt free operation by pushing reset. The flip flop formed by IC8a and IC8b is set by reference to address 0162 and is used to select the AC-30's tape derived clock as the source of interrupts. The flip flop formed by IC8c and IC8d is set by reference to address 0161, and is used to select the 4800 Hz oscillator as the source of inter- rupts for output use. Both of these interrupt selection flip flops are cleared by a reference to location 0163. In building this circuit for some other processor, you'll probably have a different set of IO addresses. Modification of the address selection logic (and the software of listing 1 ) will probably be required. Output Latch and Input Interface The rest of the circuit in figure 2 consists of the output latch and RS-232 level shifting buffers associated with address 01 60. Writing data to location 0160 sets the value contained in the 8 bit 74100 latch, IC14. The four high order bits of this latch are used to drive the AC-30's motor control lines directly as TTL signal levels. (See table I for a listing of command codes corre- sponding to the wiring of figure 2.) The low order four bits are wired to a DS1488 line driver needed to convert TTL levels to RS-232 levels. The low order bit drives the ' RS-232 output to the AC-30, with the remaining three lines available but unused at present. If at some later date it becomes necessary to program a communications interface to some other RS-232 device, this hardware now lies ready and waiting in my system. The latch is written by combining the processor's RW line (inverted) with the address selection signal to generate a clock pulse. For inputs from the external world, the bus interface gates simply listen to data lines when the address is selected. The low order four bits of an input word are defined by the Listing 7, continued: 2135 3B > RTI 2169 7D 00 51 >U1RD TST BITV HI 36 > * FALSE STAKT 2004 21 69 2136 ce 21 OA > Ul IB LDX #U 1 I 1 216C 27 FB > BEQ U1RD 2121 14 216E 96 53 > LDAA DATL 2139 Dh 04 > SIX nmi y 2170 7F 00 51 > CLR BITV 213B 3B > RTI 2173 DE 15 > LDX MEM 213C > * BIT HEAD STATES 2175 A 7 00 > STAA Q*X 213C 7A 00 50 >\ Jl 13 DEC ST 30 217 7 39 > RTS 21 31 21 30 21 78 7D 00 51 >U1VY TST BITV 21 3* 27 00 > BEQ U 1 1 1 1 200A 21 78 2141 3B > RTI 21 7B 27 FB > BEQ Ul VY 2142 96 59 >l Jl ID LDAA RATE 21 7D 96 53 > LDAA DATL 2140 01 21 7f 7K 00 51 > CLR BITV 2144 9 7 50 > STAA ST30 2182 UE 15 > LUX MEM 2146 7 A 00 52 > DEC BITC 2 184 Al 00 > CMP A 0>X 2149 26 00 > BNE Ul IE 2186 26 00 > BNE U1VE 214B CE 00 00 > LUX #U1 14 2188 39 > RTS 214E DF 04 > STX NM I V 2 189 DE 33 >U1 UE LDX ERRS 2 150 B6 01 60 >l Jl IE LUAA AC 30 2 187 01 214A 05 218B 08' > I NX 2153 46 > RORA 21HC OF 33 > STX ERRS 2154 96 53 > LUAA DATL 218E 39 > RTS 2156 46 > RORA 21 8F 7F 01 63 >Ut IC CLR ACOF 2157 9 7 53 > STAA tf ATI- 20B2 21 8F 2159 3B > RTI 2192 86 7F > LDAA #S7K 21 5A >< K ONE STUP BIT 2194 B7 01 60 > STAA AC30 2 1 5A 7A 00 50 >U1 14 DEC ST 30 2197 86 KF > LDAA #$F¥ 214C 21 5A 2199 B7 01 60 > STAA AC3Q 21 5D 27 00 > BEQ Ul II- 219C 86 FA > LDAA #250 21 5F 3B > RTI 219E 37 > PSHB 2 160 CE 21 OA ►UIIK LDX #U1 I 1 219K BD 01 38 > JSR MILI 2 1 5E 01 21A2 33 > PULB 2163 UK 04 > STX nmi y 21A3 BD 01 38 > JSR MILI 21 65 73 00 51 > COM bitv 21A6 39 > RTS 2168 3B * RTI 21A7 > END *** SYMBOLS: AC 30 160 ACUU 0161 AC UK 163 BITC 0052 BITV OObl ULUS 200C CY30 20 12 CYZM 2029 CYZR 2030 UAT L 0053 DATR 0054 DELA 005 7 ERRS 0033 1-LAb 002E Gui\ E 209 fr HALF 005A MEM 0015 MI LI 0138 NEXB 201t- iMMIV 0004 NXUA 00b5 OPE1 2000 UPE2 200r RATE 0059 READ 200 3 ST3D 0050 U1CL 20AC Ul I 1 210A Ul 12 21 1 B Ul 13 213C Ul 14 21 5A U1IA 21 1A Ul IB 2136 U1IC 2 18K Ul ID 2142 Ul IE 21 50 U1IF 2160 Ul IU 20 EA Ul IQ 21 28 U1U1 209/ U1U2 20C3 U103 20 7 U1U4 2093 U10C 20B4 U1UU 20 6B U10P 205A U1RD 21 69 Ul VE 2189 U1VY 21 ' m UlWh 20 3 7 U20P 20 54 UUUP 205E VHKY 2009 WRIT 2006 Table 7 '.■ Summary of the addresses and commands used in programming the AC-30 interface of figure 1. Hexadecimal Address 160, symbol "AC30" in listing 1: Input from the four RS-232 receivers of IC1 2 is available in the low order bits of data referenced at location 160. The low order bit, bit 0, is assigned to the AC-30 by wiring IC12 pin 13 to the pin identified as "To Computer's RS-232 Input" in the AC-30 wiring diagram. High order bits are grounded to define unused logical zero inputs. Output from the four RS-232 drivers of IC13 is available in the low order bits of data written to location 160. The low order bit, bit 0, is assigned to the AC-30 by wiring I CI 3 pin 11 to the pin identified as "To Computer's RS-232 Output" in the AC-30 wiring diagram. The high order bits are used to control the two motor control flip flops of the AC-30. Forcing the RS-232 output to remain at logical 1 (the negative RS-232 state), the following command codes are used (hexadecimal): EF = Turn on output motor DF = Turn off output motor BF = Turn on read motor 7F = Turn off read motor All codes assume negative going pulses activate commands (see AC-30 documentation for settings of the options). When setting data in the low order bits, the high order data sent to location 160 should be masked by a logical sum (OR) with hexadecimal FO. Hexadecimal Address 161, symbol "ACGO" in listing 1: Any reference to this address turns on the 4800 Hz NMI interrupt source. Hexadecimal Address 162, symbol "ACGO+1" in listing 1: Any reference to this address turns on the NMI interrupt source derived from the tape data via the receiver section of the AC-30. Hexadecimal Address 163, symbol "ACOF" in listing 1: Any reference to this address turns off all NMI sources in this interface, as does a system reset. 45 INITIALIZATION (BITV' = 0) Figure 3: The finite state machine for input. The in- put decoding is performed by a "finite state ma- chine" implemented in software. The state of the input decoder is set by the choice of NMI interrupt vector. This diagram shows the conditions under which transitions are made, but omits any refer- ence to the detailed pro- cessing. See procedures 7.0 to 7.3 and listing I for complete details. This in- put state machine is initialized by the OPEN routine and it is termi- nated when interrupts are turned off by the CLOSE routine. ST30 t four RS-232 compatible input lines which are converted to TTL levels by the DS1489 receiver circuit, ICI2. The low order bit is committed to the AC-30's RS-232 output line by wiring of the cable, leaving the other three low order bits open for later use with an RS-232 terminal as noted above. The high order input bits are presently wired to ground, but if it ever becomes necessary to add a single bit TTL level input port to the computer, these bits can be committed to that use by wiring them to a suitable external connector. With the Hardware Defined, Software Follows Suit The intent of this whole exercise is to provide a set of routines for writing and reading data from the AC-30 within the context of my existing monitor and text editor program, IMP 6800 ("the Interactive Manipulator Program"). This monitor pro- vides a general 10 control structure which accesses detail byte data transfer and control routines for any given 10 unit. When an 10 logical unit is selected by an appropriate command, the control structure references the detail 10 routines by looking up their addresses in a pointer table keyed by the logical unit identification. The control struc- ture of the monitor is not the subject of this article, but its effect is felt in the require- ment of five generic 10 routines which must be written to interface any given unit such as the AC-30: OPEN: initialization of 10 operations is performed by calling an OPEN pro- cedure; the monitor data item FLAG determines whether the unit will be opened for input or output processing. WRITE: when output is required, WRITE is called each time a byte of data is to be transferred from the address in pointer MEM to the peripheral. READ: for input to memory, READ is called each time a byte of data is to be transferred from the peripheral to the address in pointer MEM. VERIFY: to check the accuracy of crucial files, a form of the read opera- tion called VERIFY compares input data to the contents of memory at the address in pointer MEM; an error count, ERRS, is incremented if necessary. CLOSE: when 10 is complete, the CLOSE routine is used to turn off the peripheral after making sure detail transmission operations are done. The choice of these five generic 10 operations for any given 10 unit is a fairly typical practice when implementing the systems software of a computer. It is particularly helpful when implementing new interfaces: The control structure of my monitor is thoroughly debugged already, so when I wrote the new routines and they bombed the first time around (as often happens) I knew for sure where the problem was. Specifying the 10 Operations The details of the 10 operations for the AC-30 are shown in this article in two forms. One form is listing 1, a detailed set of code implemented for the 6800 and assembled using Jack Emmerichs' assembler program. The second form in which the 10 operations are given is in a higher level "pseudo code" form as eight self contained procedures. These procedures are written from the assembly as a form of detailed commentary on the algorithm, and can be used by owners of the other processors as a starting point for coding new versions of the routines. In the notation of the programs in the procedures, square brackets [] are used to enclose extended commentary and opera- tions defined in words. Variable names and labels are the same as those used in listing 1. With a few minor exceptions the procedures 46 1.6.2 DAT 1.6.3 NXDA 1.6.4 ST30 1.6.5 BITC Procedure 1 : OPEN routines. The OPEN routines are used to set up output or input operations, depending upon the state of FLA G, a variable which should be set to for input, nonzero (example: hexadecimal FF as in listing 1) for output. Output OPEN operations consist of turning on the motor, then recording a leader (using the output interrupt of procedure 5), then initializing the interrupt handler for output operations. An input OPEN consists of turning on the input motor, then waiting a half a second before initializing the input interrupt which scans for the asynchronous data format used by this software. On leaving the OPEN routines, the software which uses this 10 discipline can proceed to the details of byte by byte data transfer using WRITE, READ or VERIFY. 1.0 Entry U20P [1200 bps data rate initialization] ; 1.1 RATE := 4 [interrupts per bit] ; 1.2 Go to 1.5; 1.3 Entry U10P [300 bps data rate initialization] ; 1.4 RATE := 16 [interrupts per bit] ; 1.5 HALF :- RATE / 2 [set up half bit period value] ; 1.6 if FLAG = output value then do [an output open procedure] ; 1.6.0 [turn on the AC-30 output motor] ; 1.6.1 DELA := 50000 [set up output write delay count for 10 seconds] ; = S'FFFF' [initialize data output buffer to null data] ; = S'FFFF' [initialize next data as null data] ; = RATE; . . . ■= RATE; 1.6.6 NMIV [nonmaskable interrupt vector] = [address of output open interrupt service routine, procedure 5] 1.6.7 [clear "open done" flag, the accumulator] ; 1.6.8 [turn on output 4800 Hz interrupt source] ; 1 .6.9 Wait until end of leader [after DELA count is exhausted] ; 1.6.10 return; 1.6.11 end; 1.7 else do [an input open procedure] ; \ 1.7.1 [turn on the AC-30 input motor] ; 1.7.2 BITV [data ready flag] := 0; 1.7.3 wait 0.5 seconds; 1.7.4 NMIV [nonmaskable interrupt vector] = [address of input start bit search, U1 11 ] ; 1.7.5 [turn on input -4800 Hz tape derived interrupt source] ; 1.7.6 return; 1.7.7 end; Procedure 2: The WRITE routine. This routine must be preceded by an output OPEN operation which initializes the interrupt service of procedure 6. It can be called over and over again until the data to be written is exhausted. Each WRITE call transfers one byte from the location addressed by variable MEM to the output file. The software which uses WRITE is responsible for incrementing and keeping track of MEM when a block of data is being written. 2.0 Wait until BITC [bit count] is equal to zero; 2.1 DAT [2 byte output field] := NXDA [next output, computed by previous call] ; 2.2 BITC :=11 [1 start, 8 data, 2 stop bits minimum] ; 2.3 NXDA ;= $'FF00' I (@MEM) [move data at MEM into new output string along with null trailing bits] 2.4 IMXDA := [arithmetic left shift of NXDA] ; 2.5 return; Procedure 3: The READ routine. This routine must be preceded by an input OPEN operation to initialize the input interrupt service procedures. It is called over and over again until enough data has been transferred. Each READ call transfers one byte from the tape into the location addressed by variable MEM. The software which uses READ is responsible for incrementing and keeping track of the address in MEM, and for determining how long a block of data is being read. READ coordinates operation with the input interrupt service routines through the variable BITV which is used as a flag. 3.0 Wait until BITV = $'FF' [synchronize with flag set by interrupt service] ; 3.1 ((£?MEM) := DAT [move input byte from buffer to address in pointer MEM] ; 3.2 return; 47 Procedure 4: The VERIFY routine. This routine works exactly like READ with one exception: Instead of dumping the input data into memory at location MEM, it compares the input data to the data in memory and increments the error counter ERRS if there is any difference. As with READ and WRITE, the software which calls VERIFY is responsible for incrementing MEM and keeping track of the data being checked. 4.0 Wait until BITV = $'FF' [synchronize with flag set by interrupt service] ; 4.1 if (@MEM) not equal to DAT then ERRS := ERRS + 1 [count the differences] 4.2 return; Procedure 5: The output OPEN interrupt service routine. This procedure is used to count down a delay value initialized in DEL A when OPEN begins its processing. OPEN ultimately terminates when this interrupt routine finds a zero value in DELA and signals the OPEN routine via the value in BITV. 5.0 DELA [leader interrupt count, 16 bits] :=DELA-1; 5.1 if DELA = then do; 5.1.0 NMIV := [address of output data transfer interrupt service, CY30] ; 5.1.1 BITV := 1; 5.1 .2 [signal end of output leader delay] ; 5.2 return from interrupt; Procedure 6: Output data transfer interrupt service. This routine, which is initialized as the interrupt service routine at the end of the OPEN procedure, does the detail work of transferring data to the AC-30 from the computer. The variable ST30 is used to count down the interrupts within each output bit (see figure 1), and the variable BITC is used to count the number of bits in a character being transmitted. BITC is also used as the flag to signal to WRITE that a character is done, so its counting down is halted at zero by line 6.4. Whenever a bit is completed, the count of interrupts per bit is reinitialized in variable ST30. The variable BITC is reinitialized by WRITE when a new output word has been defined. Data is right shifted out the low order bit of a 2 byte field called DA T in this procedure, identified as DA TL and DA TR in listing I. 6.0 [output data bit] := BITV [latest bit value] ; 6.1 ST30 [output waveform state] := ST30 - 1 ; 6.2 if ST30 is not zero then return from interrupt; 6.3.0 BITV [next bit value] ;= [low order bit of 2 byte output field DAT] ; 6.3.1 DAT := [2 byte arithmetic right shift of DAT] ; 6.4 if BITC greater than zero then BITC :=BITC-1; 6.5 ST30 := RATE [number of interrupts per bit transmitted] ; 6.6 return from interrupt; follow the logic of the various sections of listing 1, but the order of the procedures differs. Listing 1 reflects the order in which the routines were actually written, while the procedures are numbered in an aesthetically nicer arrangement. In interfacing to the monitor, the only difference between 300 bps and 1200 bps is in the definition of the number of interrupts per bit, a value which is defined in the OPEN procedure for each data rate. Thus there are two entry points in the OPEN procedure, corresponding to logical unit 1 (300 bps) and logical unit 2 (1 200 bps) of my monitor. The WRITE, READ, VERIFY and CLOSE routines arc shared between the two logical unit designations, although the names used only reflect unit 1 . Using Interrupts All the IO implemented in this approach uses the interrupt from the AC-30 or the oscillator of IC9 to time operations. Thus there are three interrupt service routines specified, as procedures 5, 6 and 7. The output open interrupt service routine of procedure 5 has the simple task of counting down DELA interrupts as set by the output OPEN procedure, after which it will set up the normal output interrupt service and signal the end of the leader. The normal output interrupt service routine counts down the number of interrupts per bit, and when necessary shifts a new bit out of the output buffer, DAT, to be sent to the AC-30. It also counts bits and signals the WRITE procedure that it is ready for the next character. Figure 1 shows the progres- sion of values of ST30 and BITC during output. The input interrupt structure is much more complicated. There are four states to the finite state machine which handles data input, as shown in figure 3. These states are implemented by the current value of the NMI interrupt pointer, which selects one of the four input routines of procedures 7. The conditions for change of state are noted on the transitions in figure 3, but details of each state should be extracted from the pro- cedures. The input interrupt algorithm first enters a start bit search state of procedure 7.0; when the start bit is found, it is verified in the second state of procedure 7.1 by checking to make sure that it remains low for half of a bit period (marked by counting down the value in variable HALF). When the start bit is verified, the data transfer state is entered and a total of eight bits are shifted into the input buffer DATL. After eight bits are shifted, the algorithm enters the stop bit state of procedure 7.3 for one bit period, where a flag is altered to signal that data is ready. Within 1.5 bit times of the flag change, the READ or VERIFY routine must transfer the data from DATL to its destina- tion in memory or an alternate buffer area. This timing requirement of 1.25 ms for 1 200 bps data or 5 ms for 300 bps data is due to the fact that the first bit of the next character will be shifted into DATL 1.5 bit periods after the stop bit state is executed. The time tolerance can be increased to a full character time (9.2 ms at 1200 bps) if pro- cedure 7.3 is modified to transfer the con- tents of DATL into a buffering byte, for example DATR. Some Comments on the CLOSE Routines. . . The CLOSE routine given in this version 48 of the software is far from perfect. It might even be called a bit "inelegant." Any good programmer will see some rather obvious holes in the system: I really don't need four seconds worth of interrecord gap after data is written at 300 bps. Similarly, for input operations, I should have allowed the motor to remain on for a period of time equal to the null period which would have been generated by the output CLOSE operation for the same block. Given manual manipula- tion of tape position using the mechanical position counter, this CLOSE algorithm is adequate. But if you intend to do tape to tape editing with two cassette drives and motor control, you'll probably want to improve the CLOSE algorithm to allow more reliable electronic positioning via motor control. Does It Work? Yes, but 1200 bps Is Still Too Slow! Since getting the software described here into the state seen in listing 1 and patching it into my monitor program December 26 1976, this software has been my main mass storage 10 method. In a month of intense use, I have yet to drop a bit (although while testing I had to experiment to find the right cassette recorder volume level range on playback). My homebrew system has re- cently grown to 24 K of programmable memory with 12 K bytes of text editor string area, 4 K bytes for Jack Emmerichs' assembler program (see April and May 1977 BYTEs), 4 K bytes for assembler output strings, and 4 K bytes for my monitor and text editor programs. I have found this new 1 200 bps data rate to be an indis- pensable time-saver compared to my older hardware method which ran at about 200 bps. Since the software described here works at 300 bps as well as at 1200 bps, I can now load and write cassettes using the physical format of the Kansas City standard. This of course finally achieves the real purpose of buying the AC-30. With this interface I can load the as- sembler program in 50 seconds, and com- pletely define the text editor string area in about 150 seconds. It has really speeded up the software development operations which are the real joy of a computer applied to personal needs and goals. Of course, having accomplished this is not enough: My next challenge, in design as of this writing, is a 3M drive controller inter- faced to a $500 surplus drive purchased from Boston's American Used Computer Corporation via their back door, The Com- puter Warehouse Store. When this project is done, my system will have some real IO Procedure 7: Input data transfer service routines. These four procedures constitute the four states of the data input "state machine" which acts like the receiver of a typical U ART or ACIA chip. The start bit search state (7.0) finds a start bit which may be verified by the start bit verification state of 7. 1. If the start bit was good, eight data bits are transferred by the input bit read state of procedure 7.2. Finally, one stop bit time is marked by procedure 7.3 and the receipt of data is communicated to READ or VERIFY by changing the state of BITV. Then the start bit search resumes. See figure 3 for a state diagram of this process. 7.0 7.0.0 7.0.0.0 7.0.0.1 7.0.0.2 7.0.1 1 1.0 1.0.0 1.0.1 1.0.2 1.1 1.2 7.1.2.0 7.1.2.1 7.1.2.2 7.1.2.3 7.1.3 7.2 7.2.0 7.2.1 7.2.1. 7.2.1. 7.2.1. 7.2.1. 7.2.1. 7.2.2 7.3 7.3.0 7.3.1 7.3.1.0 7.3.1.1 7.3.1.2 7.3.2 (start bit search interrupt service, U1 1 1 ] : If input data line is zero then do: ST30 := HALF [set up delay for a half bit's worth of interrupts] ; NMIV := [address of start bit verification interrupt service] ; end: return from interrupt: [start bit verification interrupt service, U1 12) : If input data line is not zero then do [false start logic] ; NMIV := [address of input start bit search, U1 11 ] ; return from interrupt; end; ST30 := ST30 - 1 [count down HALF bit times] ; if ST30 := RATE; ST30 := RATE; BITC := 8 [initialize one byte's worth of bits] ; NMIV := [address of input bit read interrupt service, U1 13] ; end; return from interrupt; [Input bit read interrupt service, U1 13] : ST30 := ST30 - 1 [count down RATE states per bit] ; if ST30 = then do [sample bit and shift into data word] ; ST30 := RATE [set up for next bit] ; BITC :=BITC-1 [count down the bits] ; if BITC = then NMIV := [address of stop bit interrupt service, U1 14] DATL = [right rotate of DATL with carry defined by input bit value] ; end; return from interrupt; [Stop bit interrupt service, U1 14] : ST30 := ST30- 1; if ST30 = then do [restart start bit search] ; NMIV = [address of start bit search, U1 11] ; BITV [data ready flag for input] = $'FF' [indicate data ready] ; end; return from interrupt; Procedure 8: CLOSE routines. After all data operations are complete, CLOSE routines are used to turn off the motor and clean up the last details of input or output. See text for some comments about the design of this routine, which could be improved considerably. 8.0 if FLAG = output value then do (an output procedure] ; 8.0.0 Wait until BITC [bit count] is equal to zero; 8.0.1 DAT := NXDAT [transfer last character to output field] ; 8.0.2 [write 1200 null bits by letting output interrupts run] ; 8.0.3 [turn off AC-30 motor control] ; 8.0.4 [turn off output interrupt source] ; 8.0.5 [wait 0.5 seconds for motor to turn off] ; 8.0.6 end; 8.1 else do [an input close procedure] ; 8.1 .0 [turn off input interrupt source] ; 8.1 .1 [turn off AC-30 motor control] ; 8.1 .2 [wait 0.5 seconds] ; 8.1.3 end; 8.2 return; capability in the form of an electronically controlled file system with 2 million bytes on line, 40,000 bps data transfer rate and 43 second maximum access time to any given block of data. But for the next six months or so, I anticipate frequent and reliable use of this 1200 bps modification to the AC-30's purpose in life." 49 Artificial Intelligence: What Is It? Richard L Rosenbaum 61-04 Little Neck Pkwy Little Neck NY 11362 ; I { a) |j| ||! Ml Ml Ml ! ! ! A typical nim boarc I I I I I I I I I I Mill set up. Decimal Binary 15 1111 15 1111 12 1100 c) Unsafe secono mow Decimal Binary 1 0001 4 0100 0000 e) Last move-1 . Mill III I I II I II II I II III I I Mill II II 1 Ml I I 1 I b) A typical first move Decimal Binary 15 1111 3 0011 12 1100 d) Safe second move. Decimal Binary 1 0001 0000 0000 f) Winning move Figure I: One version of the game of nim starts with three piles of 15 counters as shown in figure la. Players take turns removing any number of counters, at least one, from any one pile. The player who takes the last counter loses. In the case illustrated in figure lb the first player took three from the last pile. Figures Ic and d illustrate some techniques used in developing an infallible play of nim. The first step is to represent the number of counters in each pile in binary. Then you must determine the number of Is in each binary column. If the number is odd, as in figure Ic, then you are in an unsafe position. You should make your move so as to leave an even number of Is in each column as shown in figure Id. This is known as a safe position. A point is eventually reached, as in figure le, where there are only two piles left and only one of them has more than one counter. The winning strategy is to take all of the counters from the pile with more than one. This causes the other person to take the last counter, as shown in figure If. Using these methods, an unbeatable game of nim can be developed. If you are a typical computer hobbyist, you have probably spent (or will spend) a fair amount of time playing games — com- puter games, that is. Perhaps you have written computer programs to play space war, backgammon, even chess. What tech- niques arc used in programming computer games, particularly those requiring "intel- ligent" decisions by the machine? Theanswer to this question is in the realm of artificial intelligence. Perhaps you arc trying to program a microprocessor to recognize or interpret signals from a video camera, or would like to automatically translate Morse code to printed characters. Both of these problems concern artificial intelligence, specifically in the field of pattern recognition. What is artificial intelligence? For that matter, what is intelligence? These questions can easily lead us into a philosophical debate, but that is not the purpose of this discussion. My interest is how artificial intelligence, frequently referred to as Al, can help us solve problems such as those just outlined. What these problems have in com- mon is the substitution of a computer (artificial mechanism) for what are ordi- narily human tasks (generally assumed to require intelligence). So for the sake of expediency, let's define artificial intelligence as the mimicking of human behavior and decision making by computer. Today, work in artificial intelligence is divided into a number of areas. Two of them have been mentioned: game playing and pattern recognition. Others include general- ized problem solving, natural language com- prehension and translation, and robotics. These will be examined in order. Game Playing Programs It is probable that once the beginning computer hobbyist learns basic programming fundamentals, the first attempt at a big program will be an entertaining one. How 50 Introducing two NEW software books by SCELBI. Two classics rewritten for immediate use with your 6800 system . HE HUD SCELBI'S "6800" SOFTWARE GOURMET GUIDE & COOK BOOK Q95 ppd. Now you can cook up delectable programs with this mouthwatering gourmet's delight of all new "6800" software. Over 200 pages. Action-packed, information-crammed, practical "how to" facts. Using the original manufacturer's recommended mnemonics and assembly formats, with hexadecimal notations, you get the description of the "6800" instruction set. General purpose routines for multiple precision operation. Programming time delays for real time applications. Random number generators. Completely assembled relocatable floating point arithmetic program, with 23 bit signed mantissa and 7 bit signed exponent. Input/output processing for basic I/O programming. Interrupt processing. Code, numeric conversion routines. Real-time programming. Search and sort routines. And too many more finger-lickin' goodies to mention here. All for only $9.95 ppd. Order today! SCELBI'S "GALAXY" GAME FOR THE "6800" -| 495 ppd. Captain your own crusading starship against the logic of your "6800". Your mission: search-and-destroy a random number of alien ships. But, don't run out of time, out of fuel, out of ammunition or out of the galaxy. Your galaxy consists of 64 quadrants, subdivided into 64 sectors. Plan your mission to destroy all aliens. But, every time you move you lose a stardate and precious fuel. Don't run into a roaming star that could damage your ship! And, don't forget how much fuel your warp factor uses! Suddenly, Condition RED! Alien in sight! How big is he? Fire a phasor or torpedo? He's damaged or destroyed. But, you've used up valuable fuel! Does he fire back? How much fuel was used for protective shields? Be careful. You're running out of time and fuel. You get the idea. You must maneuver logically, strategically, carefully ... to complete your mission. Here's the multidimensional computer game you've asked for. Using the original manufacturer's recommended mnemonics and assembly format, with hexadecimal notations, you've got a total book form program in machine language, for 4K memory, with flow charts, illustrations and more. All this for $14.95 ppd. Order today! $ BOTH BOOKS ARE AVAILABLE NOW! ORDER YOUR COPIES TODAY! 1CIII I COrHI I IIU CONfUITING INC. 1322 Rear Boston Post Road, Milford, CT 06460 • Telephone: 203/874-1573 Prices shown lor North American customers. Master Charge. Postal and Bank Money Orders preferred. Personal checks delay shipping up to 4 weeks. Pricing, specifications and availability subject to change without notice. Figure 2: This is the begin- ning of a game tree for the game of nim as discussed in figure 7. Only a few of the branches are shown for the sake of clarity. Using this version of the game there are 45 different ways to play the game! many of us, once we have BASIC up and running, quickly type in our copy of Star Trek? We all have some interest in computer games. While many games use artificial intel- ligence concepts in their programming, not all of them do. For instance, Star Trek usually consists of a program that keeps track of time, energy levels, scores and other parameters. The only decision to be made is generally, "Which way do I fire?", which only requires use of a simple formula. Of course, there are exceptions where some super program simulates the alien cunning of a Klingon commander. Artificial intelligence techniques are re- quired, however, for the automation of most traditional multiple player games. These range from the simple binary strategy of nim (see figure 1) to the complexities of chess. The case of nim illustrates one extreme of an intelligent program: the perfect player. The game is simple enough to develop a fast technique to determine the best move. Such is not the case in chess. The important point here is that both chess and nim are deter- ministic; ie: if you have enough time, you can go through every possibility that can arise. However, with games as complex as chess, a program would take a tremendous amount of time to check all the possible moves. This is where artificial intelligence techniques come to the rescue. Let us examine how a human player makes decisions in a game such as chess. This technique, saying, "How would I do it?", is invaluable in artificial intelligence work. Obviously, we do not go through every possibility. What we do instead is to make trial moves and evaluate the board situation at that point. If the situation is too dan- gerous, we discard that possibility and check others until we make a decision. So we need an evaluation function. The quality of this function will strongly influence how good a game the computer can play. In 1967, A Samuel wrote a program to play checkers. In it, he used an evaluation formula that took into account such parameters as number of pieces, number of kings, how far the kings were advanced, etc. Samuel, however, did not know how to weight the various items to determine their relative importance. So he made a set of trial values and incorporated into the program a mechanism that changed these values if it was losing, in order to try to find an optimum strategy. In this way, he wrote a program which "learned" to play better checkers! Of course there is more to playing a game than just evaluating positions. We must generate trial moves in some orderly fashion. The most efficient way to do this is to make a tree of possible moves as shown in figure 2 for example. This figure is called a tree because of the way it resembles an upside down tree with branches. As can be seen, trees can rapidly expand as they grow downward. The tree shown in figure 2 has 1.2x10 5 6 branches. With the limited memory space of a typical micropro- cessor, we must find some way to minimize its size. One way is to copy the human player, and not expand any branches that do not look promising, ie: do not have a high evaluation. Other aspects of artificial intel- ligence concern optimization of the evalua- tion, speeding up tree generation, and mini- mizing other memory requirements. Often, (15) (15) (15) 52 Subsystem "B" makes the computer you already have work almost as well as a new Sol-20. Add it now, and for a limited time we'll throw in a new module with 2048 bytes of preprogrammed PROM or ROM and 1024 bytes of RAM memory free! Processor Technology's Subsystem "B" puts together the major system elements you need to get your Altair or IMSAI up and running. You get both RAM and PROM memory, parallel, serial, cassette and video display inter- faces, and software. Software includes a boot- strap loader program so you can load any Processor Technology CUTS ("Byte/Kansas City'") 1200 BAUD cassette tapes. Standardized subroutines in ROM, similar to those in a Sol personality module, are used by many Processor Technology software packages to improve program efficiency. You'll find you rarely need to touch your front panel switches. With our Subsystem "B" you are up and running as soon as you turn on the power. Three subsystems are available, depending on your memory requirements. Each Subsystem "B" includes five S-100 bus compatible modules as listed below. Each is dependent upon our new GPM module (GPM = General Purpose Memory) which provides 1024 bytes of low power static RAM and 2048 bytes of preprogrammed ROM or EPROM as well as space for up to 8192 bytes more of ROM or 2708 type EPROM. The GPM module accepts the new ROM version of our well k.nownALS-8 Editor/Assembler software package. With Subsystem "B" you have guaranteed compatibility with all Processor Technology software and hardware products. Subsystem Model B70 B110 B190 Total memory provided (bytes) 7168 11264 19456 Display I/O VDM-1 VDM-1 VDM-1 Parallel, Serial I/O 3P+S 3P+S 3P+S Tape Cassette I/O CUTS CUTS CUTS Memory 4KRA 8KRA 16KRA Price $594 $730 $964 NOTE: The GPM module with both RAM and PROM is included FREE in all the above subsystems. The GPM kit is S129 if purchased separately. The ALS-8/ROM chip set is S159. SIM-1 & TXT-2/ROM add-on set is $60 and requires both GPM and ALS-8/ROM. I want Subsystem "B" to get my Altair or IMSAI up and running. □ Enclosed is a check for $. California residents add 6% sales tax. No shipping charge. □ Mastercharge # . (include Interbank No. and expiration date) □ Send more information Name I want: □ B70 at S594 □ B-110 at $730 □ B190 at S964 Address. City .State- Zip. IS^ Corporation ^J m 6200 Hollis Street, Box B Emeryville, CA 94608 (415) 652-8080 SENTENCE THIS GAME Figure 3: A syntactic analysis of the sentence, "This game is played by two people on the computer. " This particular parse of the sentence, resolving the sentence into its components, means that two people are engaged in playing a game that somehow involves the use of the computer (the adverb use of the phrase "on the computer" to modify "is played"). VERB PREPOSITIONAL PHRASE (ADVERB USE) PREPOSITIONAL PHRASE (ADVERB USE) IS PLAYED BY TWO PEOPLE ON THE COMPUTER one only stores a small local region of the tree at any one time, using rules to generate additional segments. Pattern Recognition The influence of computer aided pattern recognition is affecting us more each clay. Our checks have funny digits printed on them, grocery items have strange stripes; you also might have run into forms that required you to write characters exactly as indicated. A portion of artificial intelligence concerns itself with these tasks. Pattern recognition is generally a problem of classification. We have either a single item which we wish to describe as having certain characteristics, or we have a group of objects which we wish to break into subgroups. The principal problem is determining if a parti- cular object is in a certain class of objects. Hence, the field extends beyond merely recognizing characters on a piece of paper. Potentially, artificial intelligence techniques could help classify medical problems based upon symptoms, the field of computer aided diagnosis long found in science fiction litera- ture. Unfortunately, much of the work in this field involves higher mathematics which are beyond the scope of this article. However, some elementary principles may help you conduct some investigations, perhaps in computer analysis of video signals. A funda- mental technique is to break your recogni- tion problem into the simplest subproblems possible. For instance, consider the problem of analyzing faces. One would have to generate parameters for subclassifications such as color of eyes, hair, etc. In this way, each face is assigned a set of basic values, a prerequisite of comparisons. any attempt to make Problem Solving Problem solving may appear to cover everything under the sun but within artificial intelligence it refers to a specific set of tasks. In artificial intelligence, a problem is said to exist when we are in an initial state, desire to reach a goal state, and have a limited set of operations that can be used to get there. Game playing is actually a subset of this, in that the initial state is the present position, and the goal state is a win. Another example is theorem proving, in which the initial state is given (remember your geometry?) and the operations are the various axioms. There have been many attempts to develop general methods for these types of problems. In fact, an early one was called GPS, General Problem Solver. The authors of this program, A Newell, H Simon, and J Shaw, developed many of the techniques in this field. The simplest one was a brute force method, similar to our discussion of check- ing every possible move in a chess game. They called this the "British Museum algo- rithm" in reference to the fact that a monkey placed in front of a typewriter will eventually write all the books in the British Museum. So much for that idea! Of all the work done, the most popular idea was embodied in a program called the Fortran Deductive System. This program would take the initial and goal states, and develop a set of differences. It then would methodically apply the various operations in an attempt to reach the goal. The difference it had from the brute force approach was that it knew which operations affected 54 The Digital Group adds character®. mill * 15 ass- ||F fcfijb»g ^ 64, to be exact. The Digital Group's computer systems have a lot of character already. Just one quick look at any of our products in their unique custom cabinets con- firms that. But we believe it never hurts to add a bit more. So, the Digital Group has added character in a big way to give an added dimension to the opera- tion of our video-based com- puter systems. We are pleased to announce our new TV readout with a 64-character line. It will give your system a great deal more capability. Give it more character, if you will. Here are the specifics on the Digital Group TV Readout and Audio Cassette Interface: 1024 Character TV Readout • 64 characters horizontal by 16 lines • 7x9 character matrix (effectively 7x12 due to char- acter shifting) • IK on-board RAM for buffer storage — requires no main memory — completely independent • 128 character ASCII Upper case alpha Lower case alpha with base line extenders (g, h p, y) Numbers and extended math symbols Greek alphabet • Software driven cursor — forward and backward • Compatible with most microprocessors; Interfaces with 1 8-bit parallel output port • Timebase may be driven with an external timebase (may be synchronized to TV camera, TV set, etc.) • Readout timebase available at connector (can be used for graphic driver, etc.) • White characters on black, and/or black on white; software selectable • Plugs into standard dual 22-pin TVC connector on Digital Group Systems Improved Audio Cassette Interface: • Reliable FSK recording technique • Uses standard unmodified audio cassette recorder 111 111 I 1.™ I i Write cassette system uses a digitally synthe- sized frequency shift system, derived from TV system's master crystal oscillator Read cassette system easily aligned using the write system as an align- ment aid. (100 characters/second)- 16K in 3 minutes •Runs -loads at 1100 baud 512 TVC to 1024 TVC Upgrade Kit: As always, when the Digital Group extends the capabilities of our systems, it doesn't mean obsolescence for any products. We are offering an upgrade kit for present Digital Group system owners who wish to go to the longer line length. This kit uses most of the IC's from our TVC-F read- out. No unsoldering is required; all new sockets, capac- itors, resistors, PC ooard and other necessary parts are supplied. Prices: TVC-64— Full 64-character TV Readout & Audio Cassette Interface: Kit — $140 Assembled — $205 TVC-64UPG— Upgrade kit from TVC-F: Kit — $65 If you already own a Digital Group system, our 64-charac- ter line will definitely enhance its operation. If you're just looking, you might want to keep in mind that the Digital Group has a lot of characters. Write or call now for details on our new 64-character TV readout and all our other exciting products. %tt§(o OgJLM Ipsfiqg box 6528 denver, Colorado 80206 (303) 777-7133 Figure 4: Another parse of the sentence of figure 3. This particular parse is evaluated as meaning thai two people are on top of the computer (adjective use of "on the computer") and are engaged in playing a game. Both the parse of figure 3 and this one are valid and demonstrate a major difficulty that is encountered when trying to use computer evalua- tion of English or other natural languages. which differences. By the way, any tech- nique that "intelligently" reduces a problem in complexity so that computation time is reduced is called a heuristic. Natural Language Processing In the early days of modern computers, the early 50s, one of the great optimistic hopes was to have automatic machine trans- lation of text. It was thought that all you would have to do is have enough memory to store a dictionary. Today there are not many knowledgeable people who would make such a boast. The problem with writing a translating system is the immense complexity of natural language. English, for example, is full of potential ambiguities. Does "Time flies!" mean a comment about how time is going by quickly, or does it mean a command that we should start chasing flies with a stopwatch? One . can think of hundreds of such sentences. A related problem is natural language comprehension. Wouldn't it be nice if we could converse with our processors in English instead of BASIC or assembly lan- guage? Unfortunately, the same problems are faced in this task. One way to alleviate the problem is to limit our speaking vocabu- lary. Monitors often do this to an extreme, limiting us to specifics such as examine and deposit. The most successful approach for larger systems involves syntax directed methods. This means that each sentence is broken down until its meaning is under- SENTENCE THIS GAME VERB PREPOSITIONAL PHRASE (ADVERB USE) IS PLAYED PREPOSITION NOUN PHRASE stood. This method has a "hopefully it will work" attitude about it. Figures 3 and 4 illustrate this technique, showing how a single sentence can be broken down into different meanings. These methods are also applied to the design of computer languages, their interpreters, and compilers. Robotics This subject is last for good reason. The design of robots is largely based upon the preceding topics. For vision, if it is capable of it, a robot would use pattern recognition techniques. For performing tasks, problem solving is involved. Robotics is an applica- tion of artificial intelligence to hardware of mechanical systems as a control element. Conclusion Artificial intelligence probably offers something for every programmer . . . cer- tainly if you like to play games. But there are other aspects that are just briefly touched upon here. If we are building a large library of information, perhaps we would like to use an English-like inquiry system. The computer directed medical diagnosis could be ex- tended to auto maintenance, or even com- puter repair. Whenever you want some of your thinking done for you, automate it with artificial intelligence." REFERENCES 1. Gelerntner, H, "Realization of a Geometry Proving Machine," Computers and Thought, McGraw-Hill, NY 1963. 2. Gries, D, Compiler Construction for Digital Computers, Wiley, NY 1971. 3. Hunt, E, Artificial Intelligence, Academic Press, NY 1975. 4. Newall, A, and Simon, H, Human Problem Solving, Prentice-Hall, NJ 1972. 5. Samuel, A, "Some studies in machine learning using the game of checkers," Computers and Thought, McGraw-Hill, NY 1963. ADJECTIVE NOUN PREPOSITIONAL PHRASE (ADJECTIVE USE) TWO PEOPLE 56 ON THE COMPUTER BASIC The handle for the tool. A microcomputer without software is a tool without a handle. PolyMorphic systems BASIC is the handle on the POLY 88; this provides the interface between user and computer. Our BASIC fits the POLY 88 like a finely balanced handle fits a quality tool. PolyMorphic Systems Basic is an extremely efficient way to program. It makes possible the immediate use of the POLY 88 for a wide range of engineering, scientific and general problem solving. In conjunction with either System 7 or System 16 PolyMorphic Systems BASIC is the reliable and ready to go microcomputer tool on the market. No more waiting for the long-promised software system. Among our best BASIC features: graphic plotting function, tape save and dump with named files, time function, and self-explanatory error messages. We believe the best tool — the POLY 88 — must have the best handle: PolyMorphic Systems BASIC. 460 Ward Dr Santa Barbara. CA 93111 (805)967-2351 Polymorphic Systems 1 1 K BASIC Size: 11K bytes. Scientific Functions: Sine, cosine, log, exponential, square root, random number, x to the y power. Formatted Output • Multi-line Function Definition • String Manipulation and String Functions • Real-Time Clock • Point- Plotting on Video Display • Array dimensions limited by memory • Cassette Save and Load of Named Programs* Multiple Statements per Line • Renumber • Memory Load and Store • 8080 Input and Output • If Then Else • Input type — ahead Commands: RUN, LIST, SCR, CLEAR, REN, CONT Statements: LET, IF, THEN, ELSE, FOR, NEXT, GOTO, ON, EXIT, STOP, END, REM, READ, DATA, RESTORE, INPUT, GOSUB, RETURN, PRINT, FILL, OUT. Built in Functions: FREE, ABS, SGN, INT, LEN, CHR$, VAL, STR$, ASC, SIN, COS, RND, LOG, TIME, WAIT, EXP, SORT, CALL, EXAM, INP, PLOT. Systems Available. The POLY 88 is available in either the kit or assembled form. It is suggested that kits be attempted only by persons familiar with digital circuitry. The following is a list of the systems available. System 1: is a kit and consists of the Poly 88 chassis, CPU and video circuit cards only. Requires keyboard and TV monitor for operation. $595. System 2: Consists of System 1 with the addition of the cassette interface circuitry-requires cassette recorder. $690. System 3: System 2 with 8K memory card, BASIC and assembler cassette tapes. $990. System 4: Also a kit, but containing in addition to System 3 a keyboard, cassette deck and TV monitor. $1350. System 7: Consists of an assembled and tested POLY 88 with 8K of memory, keyboard, TV monitor, cassette recorder, 8K BASIC and Assembler cassette tapes. $1750. System 16: Consists of an assembled and tested POLY 88 with 16K of memory, keyboard, TV monitor, cassette recorder, 11K BASIC and Assembler cassette tapes. $1995. Have you written Software for your Altair Computer? The Altair 8800 computer was the first micro produced for the general public and remains number one in sales, with more than 8,000 mainframes in the field. The wide acceptance of the Altair computer and its rapid adaptation to many diversified appli- cations has truly turned the dream of the affordable computer into a reality. Yet the machine itself, remarkable as it is, repre- sents only the beginning. The right Software, tailored to meet a user's specific requirements, is a vital part of any computer system. MITS wants to insure that Altair users everywhere have the best applications software available today and in the future. For this reason, a new MITS subsidiary, the ALTAIR SOFTWARE DISTRIBUTION COMPANY, has been formed. Its purpose: to acquire the highest quality software possible and distribute it nationally through Altair Computer Centers. That's where you come in. The ASDC will pay substantial royalties to the originators of all soft- ware accepted into the ASDC library. If you have written business, industrial or commercial use software for the Altair 8800, ASDC wants to hear from you. It is the aim of the ASDC to stimulate and reward creativity in producing useful software that makes those dreams of "computers for everyone" come true. The ASDC will select only software that measures up to its high standards for system design, coding and documentation. The software will then be further documented and distrib- uted through ^^k ^^ Altair Computer Cen- ters around ^^^^ ^^^^ the country. For more am ^^_ ^_^B information -i' how io B _ _ IB submil software to the ASDC, I I ■ ** MW ask your Local AltairCom^^T ^B W^^mputer Center for an ASDC £y ^^^ ^m Software Submittal Packet ^m or contact the ALTAIR SOFT ^'vVARE DISTRIBUTION COMPANY. ALTAIR SOFTWARE DISTRIBUTION COMPANY 3330 Peachtree Road, Suite 343 Atlanta. Georgia 30326 404-231-2308 see next page for a listing of Altair Computer Centers Ask BYTE MORE ROBOT REACTIONS In leading your January 1977 issue I noticed a letter from Dean Blondefield (page 140/ , asking about books about building your own robot. In the December 1 976 issue of Scien- tific American (in the "Book Review" section) a review may be found of a book entitled Build Your Own Working Robot by David L Heiserman, Tab Books, Blue Ridge Summit PA. From the description in the review this would appear to satisfy at least some of Mr Blondef ield's interest. R S Schlaifer 1500 Rollin South Pasadena CA 91030* ROBOT LITERATURE RESOURCES I would like to pass along to Dean Blondefield of your January 1977 "Ask BYTE" column, page 140, and any other interested BYTE readers, the few "bytes" of information I have con- cerning robots. There have indeed been too few articles and books published about my favorite subject of robots, as the editor claims. A few of the few were: Popular Electronics, December 1958, January 1959, and Popular Electronics, March 1962. The robots described by these articles were very primitive in nature but would be useful to someone starting out because they clearly demonstrate simple cause and effect situations, and provide a mechanical test bed for further experi- ments. A series of manuals on home construction of robots was published by a company called Electric Brain Enter- prises, in Utah, about 1960. The first of these manuals, Robots I, is dedicated largely to the mechanical problems which the home builder may encounter. I never received the additional manuals in the series so I have no idea what they contained in the way of information. The latest work to come across my desk is Build Your Own Working Robot, by David L Heiserman, published by Tab Books, Blue Ridge Summit PA 17214. This book of 234 pages published in April 1976 is by far the best I have ever read on the subject. I can recommend it to anyone with a clear conscience. I firmly believe that in less than 20 years, for about the same price as a middle sized car, you will be able to purchase a machine to do most of your housework. In less than ten years you will be able to purchase, for about $1,500 of today's dollars, a primitive robot lawnmower. To Mr Blondefield, and to anyone else who has ambitions to build the Homo Robolus, I would only give this small bit of advice: Man evolved on this planet one step at a time: Evolve your robot the same way. First model a simple lower order creature, then perhaps a robot mouse or dog. Divide the big project into many small ones, each with its own well defined goal so that you can watch your creation evolve and grow as you add each new ability or function. Man did not reach his present level in one jump or one day - neither will the Homo Robotus. To the staff of BYTE: Thank you for an excellent publication. James F Ward 3121 Chestnut Rd Carrollton TX 75006 Thanks for an excellent letter. The Tab book on robots, Build Your Own Working Robot by David L Heiserman, is good as far as it goes and is an excellent source of ideas. It is just the starting point, however, and antedates (very slightly) the advent of microprocessors as flexible control elements for the practical experimenter. [It is available through our book service, BITS Inc.]" MORE ON ROBOTS . . . FROM THE "UNITED STATES ROBOTICS SOCIETY" We were much interested to see the letter in the January 1977 BYTE I page 140/ , from Mr Blondefield in Hayward, seeking a robotics organization more concerned with individual effort that with institutional and "industrial" robots. As you will realize, we are engaged chiefly in a search, at the moment, for methods, hardware and experience that will clarify the status of robotics. We are persuaded from some years of work in closely related fields that the keys to robotics — to development of machines that have behavioral characteristics like those of animals, making many of the same judgements in the same ways — have already been discovered and that it is only necessary to apply a diversity of ideas in a single working system to create a "robot" of considerable capability. We don't expect overnight success in the search. Probably some decades of activity are ahead of us before robots of true science fiction capability are avail- able, but for the time being we'd be dazzled by an artificial system with the behavioral characteristics and apparent intelligence of an ant — never mind an approach to human behavior. It's a long hard road. When the United States Robotics Society was formed last summer, we had no idea whether or not as many as a dozen people would be interested enough to participate, but we have taken the necessary steps to become a formal nonprofit corporation, set up carefully by lawyers to achieve a Federal tax exemption when we have the resources to pursue it. Here's a point, by the way, on which we take issue with your reply to Mr Continued on page 149 59 ALTAIR COMPUTER CENTERS BEAVERTON, OR 97005 8105 SW Nimbus Ave (5031-644-2314 BERKELEY, CA 94710 1044 University Ave 14151-845-5300 SANTA MONICA, CA 90401 820 Broadway (2131-451-0713 DENVER, CO 80211 2839 W. 44th Ave. (3031-458-5444 ALBUQUERQUE, NM 87110 3120 San Mateo N E (505l-883-8282;883-8 283 TUCSON, AZ 85711 4941 East 29th St I602I-748-7363 LINCOLN, NB 68503 611 N 27th St Suite 9 (402I-474-2800 LITTLE ROCK, AR 72206 2412 Broadway (5011-371-0449 TULSA, OK 74135 5345 East Forty First St 1 10 The Annex (9181-664-4564 HOUSTON, TX 77036 57 50 Bintliff Drive Suite 206 (7131-780-8981 RICHMOND, VA 23230 4503 West Broad St (8041-355-5773 SPRINGFIELD, VA 22150 6605A Backlick Rd (7031-569-1110 CHARLESTON, W. VA 25301 Municipal Parking Building Suite 5 (3041-345-1360 EAGAN, MN 55122 3938 Beau D'Rue Drive (6121-452-2567 ANN ARBOR, Ml 48104 310 East Washington Street (3131-995-7616 WINDSOR LOCKS, CT06096 63 South Main Street (2031-627-0188 PARK RIDGE, IL 60068 517 Talcott Rd (3121-823-2388 ST. LOUIS, MO 63130 8123-25 Page Blvd 13141-427-6116 DAYTON, OHIO 45403 (5131-252-6785 BURLINGTON, MA 01803 120 Cambridge St (617 I-272-8770 ALBANY, NY 12211 269 Osborne Road (5181-459-6140 NEW YORK, NY 10018 55 West 39th St (2121-221-1404 ATLANTA, GA 303O5 3330 Piedmont Road (4041-231-1691 TAMPA, FL 33614 5405 B Southern Comfort Blvd (8131-886-9890 r Asncz 3330 Puachtree Road. Suite 343 Atlanta, Georgia 30326 Designing the Jack Emmerichs 8465 N 51st St Brown Deer Wl 53223 HIERARCHY LEVEL 1 TOTAL SYSTEM I I I LEVEL 2 SUBFUNCTION 10 SUBFUNCTION 20 r 8 LEVEL 3 SUBFUNCTION 21 SUBFUNCTION 22 SUBFUNCTION 23 NETWORK LEVEL 1 TOTAL SYSTEM LEVEL 2 LEVEL 3 LEVEL 4 Figure 1: The top chart shows the structure of a single hierarchy diagram. The functions at each level are broken down into subfunctions at the next lower level. The relationships are shown as a simple tree structure. The bottom chart shows the structure of a network diagram. Here routines may be common to more than one high level function, and the structure of rela- tionships can become much more complex. General subroutines that are common to many functions may be shown as a separate structure. When I first became aware of the small systems industry, I was particularly in- terested in finding out what software had been developed for personal computers, especially software that would run on a minimal system configuration without much optional hardware. One of the most useful software products for such small systems is an assembler to relieve the programmer of the tedious job of programming in machine language. I found no assemblers, however, that would run on a small machine configuration. Most assemblers required at least 8 K bytes of memory (which was beyond my initial budget projections). As two pass assemblers, many of the existing products also required that source programs be entered twice so that all symbols in the source code could be resolved. This may be difficult or cumbersome if a system does not have IO devices that can easily handle high volumes of data. Furthermore, none of the assemblers that I found could be used interactively because of this two pass design. For a minimum system without offline file storage, this can be a major problem. In many cases several IO interfaces were re- quired to handle the input source code, printed listing, and the generated object code (machine language). Finally, most of the assemblers then available provided all the bells and whistles available in much larger programs designed to run on large time- sharing systems. These large assemblers (called cross assemblers) are much more complex than I felt a small system assembler needs to be. I therefore decided to write a small but powerful assembler that would run on what to mc was an affordable machine. This article is a description of the design and construction of such an assembler using structured programming techniques. The first thing to do in any development project (though it is unfortunately often skipped in small projects) is to define the program's specifications. For this project the requirement was to develop a memory t«.sy- dent M6800 assembler which would: • Assemble source code written in a free format subset of the M6800 assembly language as described in the Motorola 60 "Tiny Assembler" publication M6800 Microprocessor Programming Manual. • Operate completely within the first 4 K of memory including all tables, buffers, and other memory requirements. • Completely assemble source programs in one pass to minimize 10 operations. • Require no more than one 10 interface using the Motorola MIKBUG monitor. • Support interactive operation. • Facilitate modification and customi- zation through the use of structured code. • Have sufficient capacity to be able to assemble itself so that no other soft- ware would be required to generate modified versions of the assembler program. After the design criteria were thus set down, and before the program coding was started, it was necessary to define the functions that would be needed to meet the above specifications. Functions were defined from the highest level down to the lowest, and were related to each other through hierarchy and network diagrams (see fig- ure 1). The first series of functions that we shall consider here are those that are com- mon to all assemblers. These functions are discussed in more detail in the article "Jack and the Machine Talk" by Robert Grappel and Jack Hemenway, published in the August 1976 BYTE, page 52. Figure 2 shows how the network diagram worked out for an initial conception of the assembler. At the top level the assembler is shown as a single function, level 1. Below this on level 2, the first major function is usually a table initialization and house- keeping routine (START) that need not be closely examined here. The second major function is to parse and process each line of incoming code with its labels, mnemonic instructions, operands, and comments (PARSE). The final major function is usually a termination and reporting function which again need not be closely examined here (CLEANUP). At the next lower level, level 3, several functions must be defined which will be called from the parsing routine. The first of Defining the Problem these is a function to convert English-like mnemonic instructions into machine lan- guage operation codes (opcodes). This is complicated in the M6800 by having the opcodes for some instructions vary with the accumulator or type of addressing used. This information is developed as each line of input is processed, so the parse and translate functions must work together to develop the correct opcode. The second function re- quired at level 3 is to process assembler directives that control the assembly process from the input stream. These may include such operations as reserving sections of memory, setting up constants, assigning values to symbols, changing the program counter, and whatever else may be defined in the language. The third function required at this level is the maintenance of a table of user defined symbols with their associated values. Entries may be added to the table, or retrieved from it as the parsing routine directs. The final function at this level is an SIMPLE ASSEMBLER STRUCTURE LEVEL ASSEMBLER PROGRAM START Initialization PARSE Mainline Scan Input 1 CLEANUP End of Job Generate Op Codes Handle Assembler Maintain Symbol Perform 10 Directives Table ERROR Generalized Error Routine Figure 2: This is a simple network diagram showing the primary functions required by assembler programs in general. The error routine is common to all other functions. 61 Editor's Note: At the present time (January 1977) Jack Em- merich s' assembler, de- scribed here and in the second part which follows next month, is my princi- pal means of assembling programs for my home- brew 6800 based system. I've very successfully used it to assemble its own patches to fit my system, a text editor which is now part of my old hand assembled monitor, an ex- tensive music text editor program, and two differ- ent versions (so far) of a multiprocessing music in- terpreter program to drive my synthesizer peripher- als. After having suffered systems software with- drawal pains for over a year, it is great to get my "fix" of this intoxicating elixir. . . . CH 10 routine which receives source code from an input device, and writes listings and generated code to output devices. The last level in this structure is shown here as a generalized error handling routine that flags and describes any ambiguities or errors in the source code. This can be described as a general service routine, and may be invoked from any function detecting an error. Several aspects of this project required the addition of new functions or modifica- tions to existing functions within this struc- ture, and will be treated here in some detail. The most severe functional changes were the result of requiring the source program to be processed completely in one pass. The problem of making the assembler a one pass type in general is: What is to be done when the incoming code references a symbol that is not yet in the symbol table but may be defined later on? This is known as a forward reference and is quite likely to occur in almost all programs of nontrivial length. The solution to this problem will require coordination between the assembler program and a loader program. The loader is run as a separate operation that converts the object code developed by the assembler into an executable program in memory. In this case, the assembler will generate one, two or three bytes of object code for each line of source code. It will also generate the address in memory where these bytes are to be loaded. When a forward reference is made, "dummy" code will be generated instead of the normal object code. This dummy code is simply an address or offset with a value of zero. The address of where the final address is to be loaded will be generated and saved in a table. When the reference is later resolved, the correct object code must be generated with an address which will cause it to overlay the original dummy code putting in the correct value. If several references have been made to a symbol by the time its value is resolved, several sets of addresses and patches to the dummy code must be de- veloped. The opcode which is developed and put out with the dummy code will never be changed. The operand will be the dummy value to be patched. The loader required to properly handle this type of generated code will be shown in detail next month. [Such a loader program is effectively a second "assembly" pass; however, by making the output routine include a loader and using extra memory as we've done with Jack's assembler, the entire process can be carried out within memory nearly instantly . . . CH/ Before considering the functions needed to achieve the generation of dummy code and later patches, two specific problems must be considered: What kind of opcodes and addressing formats must be handled, and how are expressions containing a forward reference handled? First, consider the relationship between opcodes and addressing modes. For the M6800, opcodes are one byte in length, and may vary with the accumulator or mode of addressing being used. The operand may be a one or two byte address value which is a di- rect reference to a location in the first 256 positions of memory (zero through 255), an extended reference to any position in memory, an offset from the index register, or an offset relative to the address of the next instruction. It may also be one or two bytes of data immediately following the opcode. As the incoming instruction con- taining the forward reference is being proc- essed, the addressing mode being used is usually well defined and indicates a unique opcode and instruction length. This is not the case, however, when the instruction making a forward reference is not relative, immediate, or indexed. It can then be either direct (one byte) or extended (two bytes). The difference depends entirely upon whether the final resolved address is greater than 255 or not, and at this point the address value is not known. Therefore, 1 established the following convention: When no addressing mode is specified in a forward reference, extended addressing will be assumed since it can refer to any position in memory. Some efficiency may be lost by not allowing the shorter form of addressing here, but most forward references are not to locations in the first 256 locations anyway, so the restriction is not a severe one. / Using an equate (EQU pseudo operation) to define a page zero address ahead of its first use neatly solves the problem when using the assembler . . . CH/ The second problem is the handling of arithmetic expressions containing a forward reference. It will require a solution built upon the logic developed so far, and will require additional coordination between the assembler and the loader. If the loader combines overlaying code with whatever is already in memory instead of using it as a replacement, the dummy code can be used to contain part of the information needed to resolve such an expression. This requires that the loader clears memory before starting the loading process and can correctly combine all single and double byte values. An expres- sion with a forward reference is best illus- trated by an example. To load accumulator A with the address 62 of live less than the sum of Y and Z (both unknown at this point) in table 1, the following code could be used: EXAMPLE! LDAATABLE1+Y+Z-5 The expression (TABLE1+Y+Z-5) is evaluated as far as it can be, and the value of (TABLE I -5) is put out as the dummy code. When Y and Z are resolved (in any order), they arc each put out as a correcting value. The loader then combines all three values (TABLE! -5, Y and Z) to arrive at the final value. If the loader simply adds each correc- tion to what is currently in memory, a certain amount of caution is required when using the minus sign (— ) or symbols with a negative value. A further consideration is that the assembler can only check the range of relative or indexed offsets for each occurrence of dummy or correcting code. When these are combined by the loader, they may exceed allowable offset ranges. It is up to the programmer to see that they do not exceed the limits. Since the require- ments for handling forward references have been examined, and methods of achieving these requirements have been developed, the first new functions required by this assem- bler can now be considered. The first major change is a new functional requirement. A routine is needed to record all pending forward references in a table. The table must contain a pointer to the symbol that was referenced, the address in the source program where the reference occurred and dummy code was generated, and the type of reference that was made (one byte or two, absolute or relative). Each time the routine is invoked, a new entry is added to the table. If the table is full, an error condition is raised. The table size was arbitrarily set at 25, which has proven to be more than sufficient if the source program is properly organized. [In writing a new version of my monitor and text editor program (about 1500 source statements) with jack's assembler this has proved to be the case . . . CH/ The Set Forward Refer- ence routine has the logical structure shown in listing 1. Note that in this structured programming notation there is only one logical entrance and one logical exit from each function. The logical exit (return) may have several physical locations, however, to reduce the amount of code used. [The use of structured pseudocode such as that shown in listing I for program design was discussed in the article "Programming for the Beginner" by Ronald Herman published In the June 1976 BYTE, page 22.] The second major change is another new Set Forward Reference (start at beginning of forward reference table) DO UNTIL (past end of table) IF (current slot is an empty slot) THEN : (store pointer to symbol in symbol table) (store current address) (store type of reference) : (return) ELSE (increment to next slot in table) ENDIF ENDO (signal error since forward reference table is full) (return) Listing I: Set Forward Reference Routine. This routine is called once for each reference to a symbol that is not resolved in the sym- bol table and is not being used as a label. functional requirement. A routine is needed to generate the correcting object code when the value of an item in the new table is resolved. This routine must search the entire forward reference table for pointers to the newly resolved symbol and generate a cor- recting reference for each. The address at which the dummy code was generated is retrieved from the table and used as the location for the correcting reference. If the previous reference was a relative instruction, the difference between the previous address and the resolved address is calculated and a single byte is put out. If the previous reference required a one byte address (in- dexed or immediate one byte), one byte is generated. If it required a two byte address (extended or immediate two byte), two are generated. As each correcting item is com- plete, its position in the forward reference Resolve Forward References (start at beginning of forward reference table) DO UNTIL (end of table) IF (this reference to symbol table = current symb) THEN (save current address) (current address = address from forward reference table) IF (relative addressing) THEN : : (calculate relative offset) : : (write it out) : ELSE : IF (two bytes required) THEN : : : (write out symbol's high byte) : ELSE : : ENDIF : (write out symbol's low byte) : ENDIF : (clear table position for future use) : (restore current address) ELSE ENDIF (increment to next table position) ENDDO (return) Listing 2: Resolve Forward Reference Routine. This routine is executed each time a symbol flagged as unresolved in the symbol table is used as a label. 63 table is cleared for future use. Therefore, a source program may have as many forward references as it needs, but the number of forward references pending at any one time is limited by the size of the table. If any pointers to the symbol table are found at the end of the assembly, the undefined symbols are printed as potential errors. The Resolve Forward Reference routine has the logical structure shown in listing 2. The third major change is a functional modification. A routine has already been defined to maintain the symbol table, but now it will also be required to recognize symbols that are unresolved, and to de- termine when the new functions developed above must be called. The first time an unresolved symbol is used, it will not be found in the symbol table, so it must be entered into the next available slot. If there is no available slot, a symbol table full error condition is raised. Set Forward Reference will then be called and a zero address returned. Additional references to this symbol will now be found in the table. Because each is flagged as unresolved in the symbol table, Set Forward Reference is again called and a zero address is returned. If Maintain Symbol Table (start at beginning of symbol table) DO UNTIL (past end of table) IF (current symbol = incoming symbol) THEN IF (incoming symbol is a label) THEN IF (table address = zero) THEN (load symbol into table) (set symbols to be resolved condition) (return table address) ELSE : (signal error, duplicate symbol definition) : (return) ENDIF ELSE IF (table address = zero) THEN : (call SET FORWARD ADDRESS) : (return zero value) ELSE : (return table address) ENDIF ENDIF ELSE IF (current table slot is an empty space) THEN (load symbol into table) IF (incoming symbol is a label) THEN (return current address) ELSE : (call SET FORWARD REFERENCE) : (return zero value) ENDIF ELSE : (increment to next slot in symbol table) ENDIF ENDIF ENDDO (signal error, symbol table full) (return) Listing 3: Process Symbol Table Routine. This routine is called each time a symbol is used. If the symbol has a resolved value it is returned to the catling module, otherwise a zero value is returned. the symbol is used as a label, the current address is entered into the symbol table and returned as the label's value. Resolve For- ward Reference cannot be called at this time because the current instruction may modify the value of the symbol just resolved by equating it to a user defined value. Resolve Forward Reference must be called after the current line of source code has been com- pletely processed. Now if another label for this symbol is encountered, a duplicate label error condition is raised. To avoid using a separate byte of memory for the unresolved flag for each symbol in the symbol table, a zero address is used to indicate an unresolved symbol. This allows a zero value to be normally returned for such symbols as required by the above logic. The only effect this will have on source code programming is that a label at location zero cannot be resolved. Therefore, a symbol should not be defined at or equaled to zero. Each reference to it would add an entry to the forward reference table and soon Fill it up. Instead, a decimal value of zero should be used. The Maintain Symbol Table routine now has the logical structure shown in listing 3. These functional modifications enable the assembler to completely process a source program in one pass. At this point, the functional requirements for processing with only one 10 interface can be considered. Logically, each program to be assembled has three basic sets of data to be handled: the source code used as input to the assem- bler, the object code developed by the , assembler, and a program listing showing the object code that is generated for each line of source code. Physically, an 10 interface is usually used to read and write data_to or from one external device. The problem of handling three logical sets of data on one physical device has been solved by com- bining the generated object code with the listing. This reduces the data handling re- quirements to one input file (source code), and one output file (the combined listing) which the single interface can easily handle. The generated object code and its associated address that the loader uses are already produced on the left side of the listing as shown in listing 4. Therefore, it is only necessary to provide a way for the loader to directly read the listing to find the data that it needs. How the listing is made available to the loader will vary with different physical configurations, and there are unlimited vari- ations in possible hardware arrangements for small systems. This assembler was initially written to run on an ASR model Teletype 64 Sample Listing LOCN B1 B2 B3 0001 CE 00 20 >CLEAR LDX =TBL 0004 6F 00 >LOOP CLR X 0006 08 > INX 0007 8C 00 30 > CPX =TBL+LENGTH 000A 26 F8 > BNE LOOP with both tape reader and tape punch control characters enabled. A permanent machine readable copy of the listing can be produced on paper tape during the one pass operation. The listing, however, must be modified to enable the loader to find the required data when reading this tape. In the 4 K version of this assembler, items that the loader needs can be surrounded by special nonprinting characters that can be recognized while scanning the listing. This isolates the needed items from source code, headings, comments and other extraneous items. These characters must not appear in any other context within the listing, so control characters (which are not valid as- sembler input) are the most logical choice. To the loader, then, the listing shown in listing 4a would appear as shown in list- ing 4b where the '(' and ')' represent non- printing characters used to signify the start of an address, and the end of any bytes to load respectively. The high level form of the logical structure for a loader which would be able to use such a listing is shown in listing 5. The combined assembly listing is pro- duced by starting each line of source code in the middle of the page. The carriage return at the end of each line returns the current print position to the front of the line. The generated code is then printed in front of the source code. Before prompting for the next line of source code, a line feed is issued to position the paper for the next line. The result is most interesting to watch on the Teletype since one normally expects a line feed at the beginning or end of a line. The loader recognition characters are combined with "punch on" and "punch off" charac- ters to keep all unwanted items off the object tape. There are IO timing considerations worth mentioning that apply regardless of a sys- LOAD IX WITH START OF TBL CLEAR TBL LOCATION INCR TO NXT TABLE POSN END OF TABLE? IF NOT, DO IT AGAIN tern's configuration. If the input is coming from a tape file, input operations must stop to allow the generated code to be put out because the Motorola MIKBUG IO routines cannot support concurrent input and out- put. If stopping the input is not feasible for a given system, additional routines may have to be written to overcome the MIKBUG limitations. For interactive operation, there is rarely a problem as the assembler is usually faster than the user. For a truly minimum system, the source code can be entered by hand from the terminal, and the generated object code can be copied from the combined listing and loaded, again by hand. In this case, no intermediate files are required at all! The functional changes necessary to allow the assembler to operate with only one IO interface are handled as modifications to the existing IO routine to enable it to create the listing as shown above. Specific changes may differ for various system configurations, and will not be shown here. We have now considered functional modifications to ac- commodate our requirements that the as- sembler operate in one pass, and that it use only one IO interface. The final requirement which will modify some of the original functions is that it run in only 4 K of memory. The first thing to do is to look at all the functions available in existing M6800 assem- blers and eliminate alternate ways of accom- plishing things. In a tiny assembler, alter- nates are usually expendable overhead. For example, operands for the A and B accumu- lators may optionally be separated from the mnemonic instructions in 8 K assemblers (for example, LDA A instead of LDAA). This has been changed to require that the 'A' and 'B' be attached to the mnemonic which eliminates an additional scan for the accumulator operand. The choice of entering Loader's View of the Listing LOCN B1 B2 B3 Listing 4a: Combined list- ing as seen by the user. The generated code shown under the headings B1, B2, and B3 are to be loaded starting at the address shown under LOCN. This was generated at BYTE using lack's assembler as modified for Carl Helmers' homebrew system. (0001 CE 00 20) >CLEAR LDX ---TBL 10004 6F 00) >LOOP CLR X (0006 08) > INX (0007 8C 00 30) > CPX =TBL+LENGTH (000A 26 F8) > BNE LOOP LOAD IX WITH START OF TBL CLEAR TBL LOCATION INCR TO NXT TABLE POSN END OF TABLE? IF NOT, DO IT AGAIN Listing 4b: Combined list- ing as seen by the loader. The generated code and associated addresses are separated from the rest of the listing by special char- acters shown here as '(' and ') '. This is a simulation based on part (a) of this listing. Figure 3: The Final Assembler Structure. This is a detailed structure diagram of the assembler as it was actually written. S= O j D ^ < _l ... 1- o S Sim o 5 < » > K CO cc o LL o IX) CC O X CJ J" CO a i- z -) CO O IL tr G O < (J Z to in u CC a. Z D Q < 8te cc z CC z oc X uj uj O UJ §18 <° u it 3zt EC I U Uj < X S O UJ £ O 2 t CC Q uj < u- 3d CD a lis: ± cc > o < K s ES CC - cc UJ CJ UJ > uj m o < 3 u x z UJ I > CO o 2 < CC D UJ D CC < H CO 5S t/> o z o < li- ce O 1- UJ 1- >-> <;» CC - Q m " O 66 data in decimal, hexadecimal, octal or binary form has been reduced to decimal and hexadecimal. Alternate indicators of data type (eg: using a leading '$' or a trailing 'H' to indicate hexadecimal) are restricted to leading indicators to simplify parsing rou- tines. Other such redundancies can be eliminated whenever a significant amount of code is needed to support multiple ways of doing the same thing. The next area where space can be con- served is in table structure optimization. The largest table is the symbol table, so symbol size has been reduced from six characters to four. The first three and the last one character of a label of any size over four are combined as the character string entered into the table. This matches the four charac- ter size of the mnemonic plus accumulator instruction mentioned above, and the four character format of a hexadecimal address. The input routines may therefore be built around a standard four character format. Instead of using a binary search in the operand translation table, a hash index into the opcode table based on the mnemonic's first letter is used. [See Terry Dolhoff's article on hashing techniques on page 18 of January 1977 BYTE./ This keeps the num- ber of table entries searched to an average of 4.5 per opcode, and reduces the length of the stored mnemonic. By combining this access method with routines making use of the M6800's opcode structure, all of the I 1 4 four character mnemonic instruction and assembler directives can be kept in a table keyed by 79 two character strings. The next area where space can be con- served is in the simplification of complex routines at the possible cost of some effi- ciency or function. Because the symbol table in this assembler is smaller than those in full scale assemblers, and because we've got a dedicated personal machine to work with, complex hashing routines can be dropped in favor of a simple sequential search which burns a bit of computation time. Many complex error detection routines have been simplified to catch the most common occur- rences of a problem. All physical 10 opera- tions are accomplished through the Motorola MIKBUG monitor rather than through uniquely written routines. Loader Structure DO UNTIL (end of listing) DO UNTIL (character read is a '(') (read character) IF (character is null) THEN : (stop) ELSE ENDIF ENDDO (read address into index) DO UNTIL (character read is a ')') (read character) IF (character is a blank) THEN : (read a byte from two hex characters) : (add incoming byte to indexed address) IF (carry bit is set) THEN : : (increment byte beyond indexed address) : ELSE : ENDIF : (increment index) ELSE ENDIF : ENDDO ENDDO (stop) Listing 5: Logical structure for a directed loader capable of processing the listing shown in listing 4b. See listing next month for the implementation of a loader based in part on this structure. The final method used to save space is to simply eliminate functions that are of limited use and require significant code to implement. There is no provision for multi- plication or division in the expressions with- in an instruction's operand. Multiple ad- ditions or subtractions are possible, however, and can often be used where multiplication and division are usually found. There are no provisions for naming programs or for select- ing options in generating the combined listing. Some error checking, such as invalid address or byte overflow, has been com- pletely eliminated. The code generated is as compact as possible to fit in small machines, but is not relocatable. If it is desired in another location, it must be reassembled. The result of all this compaction effort is an assembler whose basic executable code fits within 2170 bytes, and will run com- pletely within 4096 bytes of programmable memory with a symbol table capacity of 200 symbols. Modifications have been made to almost all of the existing functions to accomplish the above changes. This com- pletes the functional additions and modifica- tions required for the assembler defined by the project specifications as shown in figure 3." In the next issue of BYTE, we'll continue Jack's article on his "Tiny Assembler" with his discussion of coding the assembler. The second part includes object code and infor- mation on palching and relocating the program. 67 ^-MICROCOMPUTER^ K X 8 ItAM" -'■' San Francisco Bay Area - Where It All Started - Has Its First Home Computing Convention 7,000 to 10,000 People 100 Conference Presentations 200 Commercial & Homebrew Exhibits Two Banquets with Outstanding Speakers Special-Interest Social Centers Publication of Proceedings Being Planned In Northern California's Largest Convention Facility, San Francisco's Civic Auditorium CONFERENCE SECTIONS ON HONE COMPUTING Being Plan Computer Graphics on Home Computers Computer-Driven & Computer-Assisted Music Systems Speech Synthesis Using Home Computers Computers & Amateur Radio Computer Games: Alphanumeric & Graphic Personal Computers for the Physically Handicapped Computers & Systems for Small Businesses Tutorials for Hardware Novices & Software Novices ned Software Design for Personal Computers Microprogrammable Microprocessors for Hobbyists Optical Scanning for Inexpensive Program & Data Input Floppy Disc Systems for Home Computers Hardware & Software Standards for Personal Systems Seminars for Club Leaders, Editors, Organizers, etc. Personal Computers in Education (associated with a University of California short-course) AND MUCH MORE PRESENT-WORLD & FUTURE-WORLD BANQUET SPEAKERS Banquets to be Held in Fascinating Speakers will • Frederik Pohl, Science Fiction Writer; Lecturer to NASA, American Astronautical Society, New York Academy of Sciences, World Future Society, etc. Robots You Can Make for Fun & Profit • John Whitney, Pioneer Computer Film Maker, Computer graphics experimenter under grants from NEA, Guggenheim Foundation, & IBM Digital Pyrotechnics: The Computer in Visual Arts San Francisco's St. Francis Hotel Discuss the Past, Present, & Future • Henry Tropp, Mathematician, and Principal Investigator for History of Computers Project jointly sponsored by the Smithsonian Institution & AFIPS Tlie 1940's: The FIRST Personal Computing Era • Ted Nelson, Author & Fantast, Director of the Xanadu Electronic Literary Network, Lecturer at Swarthmore College Those Unforgettable Next Two Years ©77-1 -12a by Computer Faire gpgil lgj7. 1&TT • ean francii ICO 68 T II III. ^ MICBOCOMPOTEBSilK / 8 KAfP ■ ?S 3 LLLU * . €7 kCu( ouf, or photocopy; then fold, and tape in position. ^t **V t»v», FIND OUT ALL THE DETAILS - GET YOUR FREE COPY OF THE SILICON GULCH GAZETTE • Details of the programs & speakers • Information about the banquets' arrangements • Accommodations information, & registration forms for the St Francis Hotel (Faire Headquarters Hotel), & the other three Computer Faire hotels • Pre-registration details for the Faire (reduced admission for those who pre-register) • Details of the Proceedings expected to be published • Articles about the homebrew exhibits • Weather information, & tourist trivia regarding San Francisco • Listings of the commercial exhibitors • AND, just to make it interesting: - "Hot news" & raging rumors from "Silicon Valley' (the San Francisco Bay Area) - Product announcements, equipment descriptions, hardware & software news, etc. CO-SPONSORS INCLUDE AMATEUR, PROFESSIONAL, & EDUCATIONAL GROUPS • The two largest amateur computer groups: Homebrew Computer Club Southern California Computer Society (SCCS) • Both Bay Area Chapters of the Association for Computing Machinery (ACM) San Francisco Peninsula Chapter Golden Gate Chapter • IEEE Computer Society's Santa Clara Valley Chapter • California Mathematics Council • Stanford University's Electrical Engineering Dept. • University of California's Lawrence Hall of Science • People's Computer Company (PCC) • Community Computer Center Bay Area Microcomputer Users Group (BAMUG) • Professional & Technical Consultants Assn (PATCA) • Amateur Research Center april 15-1T, 1977 - ©77-1 -1 2 by Computer Faire san francisco 69 (_.. 1 s Q) bo Q. - o 'S 3 a s'i ODD □ S iE-s S 5 ? o 6 °a .2 ° ■s-a z s ft c CD CO a a O CD 3 c^ C -* "O w LU tfl 10 Ui Q a < CD CD LD cn tr < rr LU h- D_ O O >- T •- *? >. — t** ~ cj (-> -Q CO CO < —I *S o Sis 1- co a < nr b o LL QJ CD a. a_ < 00 3 c TJ _l JU < CO :> > >- -J a. LU CD cc 0) 2 CO 00 LU CD ?" to o CO CL D o □a ^ ^ # m < Q. (J < H to O E g B S I a LD X o CO o ^> < o H < O < a. Establishing the CHU Dynasty Let It All Hang Out Stephen B Gray Amateur Computer Society 260 Noroton Av Darien CT 06820 Much time is taken up at computer club meetings, and especially at computer con- ventions, with people asking each other what machines they have, how much memory, what peripherals, and so on. Much time could be saved if there were some faster way of communicating this information, and one possibility is the Computer Hobbyist Uni- form, or CHU, for the purposes of adding one more incomprehensible acronym to the vernacular. The basic requirements for the CHU are that it be inexpensive, readily obtainable and lightweight. The one garment that fits all these criteria is the white lab jacket, with long sleeves and a button or two in front, also known as an intern's jacket, available everywhere for $9 to $22, with an average price of $1 3. As for insignia, the most widely available type is military, and Army stripes are well suited to the job. The resulting combination provides a pleasant uniformity that helps make for a more homogenous group, as well as toning down the flashy dressers and improving the appearance of the slobs. Stripes for Memory Since many computerniks seem proudest of how much memory their machine has, it follows that Army noncom stripes are best used to indicate the amount of semicon- ductor storage. As figure 1 shows, the number of stripes indicates how much memory the wearer's computer has. For instance, if his Altair 8800b has at least 2 K bytes and as much as 4 K-1 (ie: 4095) bytes, he wears one stripe on each sleeve; from 4 K bytes to 8 K— I bytes, two stripes; from 8192 bytes to 16,383 bytes, three stripes; and so on. The mathematically minded reader will note that the lower limit (in units of K=1 024 bytes) is 2 raised to a power equal to the total number of stripes and rockers. So three stripes and two rockers indicate that the wearer has at least 2 5 = 32 K bytes of semiconductor memory in his or her computer, and perhaps more. For the memory fanatic with 128 K up to 256 K bytes, there's the first sergeant's insignia, with three stripes, three rockers, and a diamond. Incidentally, no stripes on the upper sleeve indicates up to 2 K— 1 bytes of memory. Service Stripes A diagonal stripe on the lower left Army sleeve indicates three years of service. On the CHU, it indicates how many years the wearer has had his or her computer up and running. Although someone with an Altair 8800 might want each stripe to indi- cate a year, it's better to let the three year period stand. After all, anybody who's had a Scelbi 8H, or Mark-8, or RGS 008A running since they were first available will be en- titled to wear a single three year stripe by Spring of 1977. And if the stripe were to stand for only a year, the CHU sleeve could get terribly cluttered by 1984. There are other sleeve decorations that could be used, but which might only add to the clutter. There's the short horizontal bar for six months overseas, which might be used to indicate that the wearer has operated a hobby computer in a foreign country. The Unit Citation might be used by computer clubs to indicate some sort of group merito- rious action, such as designing a com- puterized course selection system for the 70 local high school, or working out a method for beating the local roulette wheel opera- tion to help supplement club funds, or calculating how much beer should be ordered for an all-night programming session. Maker Patches Now that your staff sergeant's stripes have identified you from a distance as a BMOC (Big Man on Computers), a shoulder patch, worn at the top of the left sleeve, identifies the maker of your computer. These colorful patches, similar to the Army patches that identify a soldier as belonging to the Seventh Division or the Fifth Army, show the computer manufac- turer's name in a distinctive and artistic design. Such patches could be sold by IMSAI, MITS, Southwest, etc, or packed with each computer kit. To make, they cost less than $1 each in large quantities. A slight problem arises if a manufacturer offers more than one computer, such as the MITS Altair 8800b and 680b. There are two solutions for this ambiguity. A different patch could be made up for each, with the model number included; or a rectangular patch, bearing only the model number, could be made for sewing on right under the maker's patch. Another problem comes up if the CHU wearer has, say, both an ETC-1000 and an EBKA 6502 Familiarizor. He or she can easily wear the ETC patch on one shoulder and the EBKA patch on the other. The question arises: Should the memory stripes show total memory, or should each set of stripes show only how much memory is in the computer whose maker's patch is on the same sleeve? It all depends on whether he or she minds having an unequal number of stripes on the two sleeves. Physicists, mathe- maticians and other lovers of symmetry may become emotionally hung up on this issue. If the CHU wearer has more than two computers, he or she has two solutions: either stacking the makers' patches one below the other on the sleeve, or sewing the extra ones on the front of the jacket — but not just above the breast pocket area, because that's where we put the Peripheral Pins and Data Decorations. Peripheral Pins Now that you've been identified from afar as the owner of a Southwest 6800 with S K. bytes of memory, something is needed to show what you've got attached to your computer. A simple solution is to use zapped 14 pin or 16 pin ICs, lettered in white, inserted into a narrow strip of P pattern A 2 K to 4 K-1 bytes (Private, first class) 4 K to 8 K-1 bytes (Corporal) 8 K to 16 K-1 bytes (Sergeant) 16 K to 32 K-1 bytes (Staff sergeant) 32 K to 64 K-1 bytes (Sergeant, first class) 64 K to 128 K-1 bytes (Master sergeant) 128 K to 256 K-1 (First sergeant) Meritorious Unit Award Service Stripes (Three years each) Overseas Service Bars (Six months each) Figure 1 : Representative military stripes adapted with semantic redefinition to help CHU computer addicts. 71 Artwork credit: Lest there be confusion, this drawing was executed by Sandra Gray, no relation to author Stephen B Gray. ©nil BYTE _ Vectorboard, and somehow pinned on the right side of your jacket front, opposite the left breast pocket. The lettering might read TELETYPE ASR33 or SOUTHWEST CT-1024 or even CROMEMCO TVDAZZLER Actually, a colorful dot pattern could be used for the Dazzler, without any lettering. Or different shapes of thin plastic could be used to more readily identify various peripherals, such as one in the shape of a television screen, for video output, lettered with something like SONY CVM-115 Or a bit of black plastic, shaped like a Philips cassette, to show you use cassette storage, perhaps lettered with the name of the cassette deck you're using. For floppy disk, a circular piece of plastic, lettered with the maker's name. For a printer, perhaps just a rectangle with the maker's name lettered on it. And so on. A pin could also be used to identify the maker of your computer, in addition to the shoulder patch, for faster face-to-face identification at club meetings. Name Tags Name tags are often used in the Army. The CHU version is a dead MPU IC, without pins, with your name lettered on it, worn above the Peripheral Pins over where the right breast pocket would be if lab jackets had one. (Dan Meyer, head of Southwest Technical, wore a 6800 MPU IC on his shirt at Personal Computing 76 in Atlantic City last fall, with DAN and SWTPC lettered on it, partly inspiring this article.) Data Decorations The area above the left breast pocket is reserved for Data Decorations, which are for meritorious action above and beyond the call of duty. There's the black-and-blue ribbon for those who successfully fought the "Battle of the 66 Wires" on the original Altair 8800, and the very rare blue, grey and brown ribbon worn by that gallant handful of pioneers who captured Hill 680, only to lose it when it was retaken. There are also software decorations, although this area is somewhat amorphous, since what is a difficult feat for one-hobbyist might be a snap for another, just as in hardware achievements. It's up to each hobbyist to decide if he or she is enough of a hero to merit this or that Data Decoration. There might be a software ribbon for the person who wrote his or her own assembler, or Tiny BASIC, etc. If a ribbon refers to a numbered piece of equipment, the resistor color code can be used for the ribbon colors, such as blue, grey and brown for the 680. Cryptic types can simply wear a 680 ohm resistor, attached to Vectorboard. Scratch Built and Homebrew There are some situations not covered so far. What about the hobbyist who prefers to build his or her computer from scratch? What does he or she use for a maker's patch? If there's enough demand for them, they could be supplied by the integrated circuit manufacturers, such as Intel, Motorola, Zilog, etc. Or again, by a computer store chain. For the real hard-core scratch builder, who scorns microprocessors as the easy way out and designs his or her own processor from TTL or ECL integrated circuits, a "homebrew" patch could be designed, perhaps on the style of a mountaineer's stTfl, or witch's cauldron. Far Out For the hobbyist who is really into computers, and especially vice versa, the 72 SOFTWARE HARDWARE Disk Operating System *Device management and executive scheduling *Directoried file manage- ment system *Sequential and indexed random file structure *Full support of all languages, utilities, and peripherals. ANSI FORTRAN compiler *Double precision real and complex arithmetic *Non zero based arrays *reentrant subroutines *Random file I/O *ISA process control, real time, and multi- tasking extensions *Chaining, swapping, and over- lays *Commercial subroutine package. MACRO ASSEMBLER Relocatable code generation *Macros *Dynamic instruction definitions Conditional assembly. EDITOR I Character or line oriented *String operations for search, search and replace *Store and exe- cute command strings *Multiple files open concurrently. Micro NOVA® 16 bit processor *Real time clock *Hardware multiply and divide *Power fail auto restart *8K bytes RAM *9 slot chassis with front panel and power supply, (optional 18 slot chassis) lOsfl ■ ASYNCHRONOUS SERIAL INTERFACE Strap selectable data, parity, and stop bits *Modem control signals *Data rate strappable from 50 to 19,200 baud *EIA-RS232C or 20ma interface. DEBUG ROM Examine, deposit, control of memory and inter- nal CPU registers and status *Breakpoints for monitoring running programs *Auto program load. ■ DISK 2 diskette drives per controller *315K bytes per diskette *31.5K bytes per second transfer rate. ■ EXPANSION Memory expansion in 8K and 16K byte increments up to 64K bytes *General purpose interfaces for custom applications *9 slot I/O expansion chassis. DISK SYSTEM *CPU with 40K bytes RAM *Dual diskette *Asynchronous serial interface *CRT terminal *Debug ROM *DOS *FORTRAN IV *Macro Assembler *Editor *Utilities and support programs *Complete documentation set. $8400 ■ r l> Other systems available from $2700 All hardware is fully assembled and tested. Support is available from service centers around the country. Prices and specifications subject to change without notice. 4' m • *■%■ i'^..- -*•■ If you are serious about computing, call or write today. BPI Inc., 2205 East Broadway, Suite 6, Tucson, Arizona 85719 (602) 326-6975 fi ■-..- ■ ultimate CHU add-on is a 100 pin printed circuit board edge, protruding from the back of the jacket, just above the shoulder blades. For the lunatic fringe, there's the com- puterized CHU, or COMCHU, with a SC/MP or other small board in one of the side pockets, controlling the flashing of LEDs and other devices inside insignia or pins or whatever, producing a Christmas tree effect. CAUTION: The COMCHU, if worn in pub- lic, is a sure ticket to a rubber room. Other Insignia Many other types of insignia could be borrowed from the military, but again, they would only clutter up the CHU. There's the fourragere, a braided cord worn around the left shoulder seam as a unit decoration. There's the Combat Infantry Badge, worn above the ribbons over the left breast pock- et. And there're branch of service pins, worn on the lapel to indicate Infantry, Corps of Engineers, Ordnance, etc. With a little imagination, these could all be used, but the effect would be more gaudy than anything else. This applies especially to medals, which are expensive to make; it's much neater to wear the equivalent ribbons. Same for officer's insignia, such as bars, oak leaves, eagles and stars. They look good, but not when mixed with enlisted persons' stripes. For those who insist, such insignia might be used to indicate rank or seniority in a computer club. Other Jackets The hawks among us may prefer a mili- tary jacket, to go along with the military insignia, rather than a lab jacket. The catch is that a Gl jacket is apt to cost more, and isn't as easily and widely available. And it looks rather odd if worn with civilian trousers. If you want to go whole hog and wear uniform trousers and jacket, along with stripes and decorations, you might get in trouble with the MPs. However, if a full uniform is your thing, then you might go all the way. Get a web belt, a holster, and start toting a Replica Models copy of a .45 automatic, with a light pen cleverly built into the barrel. The ammo pouches could be used to hold program cassettes for trading with other software thieves. Headgear Since interns and lab technicians seldom if ever wear hats, almost any type of headgear would look odd with a CHU. However, continuing in the military vein, there is one item that might appeal to the same lunatic fringe type who has a COMCHU, and espe- cially to those who prefer a Gl jacket and trousers. A copy of an Army plastic helmet liner could be made of the same material used in PC boards, printed wiring could be applied, and the whole thing turned into something like the battery powered Intersil Intercept Jr, with keyboard on top, display in front, and batteries in the rear. The curved surfaces might be too much of a challenge to a PC board designer, so perhaps some of the curves might have to flattened. This would make the CHO (Computer Helmet, Official) look even more futuristic and science fictionish. The full uniform CHU/CHO combination would be enough to stop a digital clock, as well as get you in trouble if worn outdoors. Belt Buckles and Tie Pins The CHU is meant only for wearing to computer club meetings or to computer conventions, as it's a little too odd to wear in public. However, there are several ways of letting people know you're a computernik, without the CHU. And they can be worn with the CHU, too. If there's enough demand for them, belt buckle equivalents of the maker's shoulder patches could be offered by MITS, Poly- morphic, OSI, etc. These can be either the flat laminated plastic multicolored type, or cast metal bas relief. Or the belt buckle could be a miniature replica of the front panel of your Astral 2000 or PCM-12, or a replica of a SC/MP or KIM-1 in its entirety, either as a laminated photoreduction, or in cast metal. The Cromemco TV Dazzler would be a natural for a multicolored mini-photo laminated belt buckle. Tie pins offer a variety of possibilities. Perhaps a miniature Continental Specialties LP- 1 Logic Probe, or an 8080 processor, or a DB-25 connector. Or, once again, a mini- ature of a front panel or a PC board. The CHU Counter Although maker's patches are perhaps best supplied by the computer manu- facturers, all the rest of the CHU insignia could easily be made up by one of the computer store chains, or by one of the manufacturers of military insignia. Com- puter stores could have a CHU counter, or CHU shelf, displaying the various stripes, decorations and pins. The best display would be a CHU in maximum configuration, with jacket, full set of stripes, chestful of pins, and a bouquet of decorations." 74 PRIME RADIX PRESENTS THE WE DO IT WITH MIRRORS! (and some very sophisticated state-of-the-art memory design) You've probably imagined that someday you'd like to own a computer system with a full complement of memory: 65,536 BYTES Your dream can be a reality with the Prime Radix Corporation's 64Ktm memory system at a very cost-effective price. And because it is a standalone memory system, you've got the advantage of greater flexibility not ordinarily available from add-in memory. Some of the features are: • The 64Ktm is fully buffered, presenting one TTL load to the memory bus. • The 64Ktm is digital group bus and ALTAIRtm bus compatible. When ordering, you must specify the bus architecture. A plugcard and cable will be furnished for the particular bus architecture you specify. • The minimum complement of memory is 40K BYTES, with starting address locations at OK, 8K, 16K, or 24K. PRIME RADIX • The 64Ktm comes assembled and tested with its own power supply, attractively housed in an aluminum cabinet, ready to plug into your system. • Psuedo-static operation: on board refresh clock-generator provides processor independent refresh with no wait states. The 300NS worst case access time enhances high speed operation. • Power/fail detection circuitry and battery backup will provide non-volatile memory (batteries are optional at extra cost). LIST PRICE IS AS FOLLOWS: 40K 48K 56K 64K $1490.00 S1580.00 $1670.00 $1750.00 We are offering a special introductory ten percent discount off list price on all orders received on or before March 31, 1977. Delivery will be made in the same sequence as orders are received. Please allow 3 to 6 weeks for delivery. Mastercharge and BankAmericard are accepted. P O Box 1 1245 • Denver Colorado 8021 1 • (303) 433-5630 or 573-5942 r PRIME RADIX COMPUTER SYNTHESIS Print Name □ DIGITAL GROUP BUS □ ALTAIRtm BUS □ 64K @ $1750.00 □ 56K @ $1670.00 D 48K @ $1580.00 □ 40K @ $1490.00 Address City State Zip D Check or MO. enclosed D Charge BAC □ Charge MC (Please No C.O.D.'s or P.O.'s) Make checks or money orders payable to: PRIME RADIX. INC. P.O. Box 11245 Denver. Colorado 80211 (303) 433-5630 or 573-5942 Credit Card Number 4 Numbers Above Name (MC)Good Thru Signature J 75 Deal yourself in Special group rates for .clubs and organizations traveling from-the^Westy Coast and Mid-America contac 7 Seas Travel 17220S. Norwalk Blvd Cerritos CA 90701 Dawn Corrigan 213-924-8383 Atlantic City, N.J. August 27th- 28th What it's all about! Software Development Micro Computers Hardware Development Disc Memories Computer Comparisons Interfacing Program Implementation AMSAT Computerized Music Video Terminals Kit Construction Printers Computer Games Digital Tapes • Seminars and Technical talks by leading electronic equipment manufacturers • Major Exhibits from all over the country • Demonstrations in many areas including Home and Personal Computing • Door Prizes, Free Literature and Free Mementos • All this plus Sun and Surf - Fun and Excitement - Relaxation and Leisure Personal m * Computing Write for FREE TRIP-KIT to PERSONAL COMPUTING 77. Rt 1, Box 242, Mays Landing, New Jersey 08330 77 Consumer Trade Fair EXHIBITION BOOTHS STILL AVAILABLE - CALL (609) 663-1188 mm 76 A New Journal for Computer Music Lovers . . . John Snell, a computer person with a specialization in music, has just decided to start a new journal of information for the computer music person. This journal is called, quite naturally, the Computer Music Journal and is published by John through the facilities of PCC. The address for the journal is 1010 Doyle St, Box E, Menlo Park CA 94025. According to John's letter, which accompanied some descriptive copy, the first issue was expected early in 1977. The following is John's description, quoted from his letter: 777e first issue of Computer Music Journal includes an excellent comprehen- sive introductory article on computer music in general, written by Andy Moorer at the Stanford Al laboratory computer music project. Also included is an article by Dexter Morrill on high quality trumpet algorithms. I will print several of my own articles in this issue. One is about Reviews the design of a digital oscillator control- led by a small computer. It can output up to 256 low distortion sine waves with independent control of amplitude, fre- quency, and phase. I will also print an article on high speed multiplication. I have designed a TTL (74LSXX) circuit which will compute a 16 to 32 bit product every 75 ns. I may also include a computer music reading list if there is room. I will also probably print an article by Steve Saunders on multiplication/ess FM synthesis of natural timbre. The price of a subscription to the Computer Music Journal is $14 per annum. We've already signed up for one and expect con- siderable interest on the part of BYTE readers in general." 77 Early Indications of Technology in Roman Military Arts or Plexitus E E Barnes Star Route Parkesburg PA 19365 Sometimes an individual is about to bring about an invention which could change the world, but is never noticed. We often say that this man was born before his time. Omnius Plexitus, legate of the XIII legion, was such a man. Stationed with his legion in the rough country which later became Bulgaria, he improvised in order to survive. Genius struck like lightning one day as he watched his artillery crews practicing. One of the pieces of semi-portable Roman siege equipment was called the onager or ass, because of its kick; this was a sort of huge crossbow which fired a heavy bolt or arrow perhaps six feet long. During this particular practice session, the cable release mechanism became stuck and a legionnaire climbed atop the device to free it. Free it he did, but only after he was astride the bolt to obtain leverage. Arrow and man sailed out as one across the treetops. History does not record the fate of this early pioneer, but this is the first historical incident of a man going aloft on an unpowered, heavier than air con- trivance. This observation was not forgotten by Plexitus. Plexitus was faced with supply problems in the hilly terrain in which his men were operating. They were widely spread out over the backs of ridges and across gorges. Sup- plying these detachments became rather serious because the number of men which had to be dedicated to carrying food seri- ously reduced those carrying spears. Plexitus solved this problem by attaching food to the lightened onager bolts and having these fired at the isolated detachments of his legion. This was moderately successful since his casualties were light and the process spurred other developments. Unfortunately the fact that he had fired upon his own men was used later during his court-martial in Rome. This Idea Has a Lot of Impact Plexitus reasoned that such a bolt should be able to carry a man, but the major difficulty he faced seemed to be predicting the point of impact of the missile (and man). After devoting much study to the problem, he was able to define 28 variables which directly influenced the flight of the missile. There was basically no limitation upon payload size; he merely built a bigger crossbow. 1 He had an onager scaled up and one was built concurrent with his attempts at aiming. The first man known to fly was an aide to Plexitus, Dominic Idiotus. Idiotus (from whence comes the common technical term) was apparently offered a transfer if he would agree to attempt a flight in the Plexitus machine. In July of 248 BC he mounted the bolt and was propelled 280 yards into a local During the supply operation early in the develop- ment of the Plexitus machine, some of the troops received their pay in the same way as they did their food, attached to the onager bolts. A few scholars trace the roots of the word "payload" to this event. 78 swamp, from which he returned dirty but smiling. Exit Idiotus. During the fall of 248, the machine was refined and experimentation continued. Plexitus found that most of the variables affecting his machine were products appear- ing in powers of one or more. (This in itself is a major accomplishment considering the state of instrumentation with which he had to contend. For example, humidity was found to change the tension of the bow string. The only means the Romans had for measuring humidity was by counting the number of crows made by a cock in the early morning. Plexitus apparently ran through a lot of chickens in his calibration attempts. One of his men complained in a letter of all the chicken the men were forced to consume. 2 ) Anyone who has ever attempted to multiply in Roman numbers will appreciate the difficulty of raising a number to a power greater than one and then finding the product of 28 of them. The Roman Abacus He finally resolved this difficulty by moving over half his legion to a huge space which was cleared for this purpose and using men as markers in what became a kind of huge abacus. Men moved about in position upon orders from their squad leaders. Primi- tive, but it worked. Unfortunately, the calculation took over eight days because of its complexity and some errors resulted from men in the morn- ing not remembering the positions which they had held the night before. Plexitus proceeded undaunted and merely repeated the calculation and then took an average of the different answers which he obtained. 3 His work was interrupted several times by the hillsmen who took unfair advantage of his scientific preoccupation by attacking. It was during this first retreat that the first Plexitus computer was lost to the numerous but unappreciative locals. Thus Plexitus was the first to use the abacus in the West. Unfortunately, it lacked portability, requiring over 7000 men and 34 acres in its operation. However, this is not the disadvantage that moderns might think since the ancients had plenty of time and space. A pre-Christian timeshare facility could have developed where Romans could have taken their problems to the machine, "Some believe that later Roman soothsayers who attempted to predict the future by looking at the intestines of freshly slain chickens were attempt- ing to reproduce the actions of Plexitus' com- puter, but were working from garbled, word-of- mouth reports. In standing all day, the legionnaires apparently took to shifting from one foot to the other, and when not actively moving about, to digging with the toes of their sandals in the sand. This was quite useful the next morning in determining the position the men had held the night before. This is the first mention of permanent memory in the literature. The holes in the calculating field suffered from one operational disadvantage. When it rained, the holes filled with water and the men had a distaste for standing in water, so he would begin the day with the complement of the number which the field had held at closing time the night before. Plexitus outlawed the scuffling with the toes once he found the reason for his rather curious answers. Even good things had their problems. Some say that the water was not the reason for Plexitus outlawing this practice, rather it was traced to a comment made by a centurion who had a villa near Actium. This individual observed that this looked like an efficient way of plowing a field and would he do some calculations on his land near Actium next spring. 79 much like the Greeks did at Delphi. There are even some who suggest that Pompeii was attempting to use one of the Plexitus facil- ities during the later Roman civil wars; even this group is splintered with one faction saying that he never got it working. The other faction suggests that in fact he did, since he lost the battle and the war to Caesar. During this time the XIII legion was forced to fight for its life, since the experi- ments had weakened the men; an individual does not use the same skills standing motion- less in a field all day as he does carrying a shield and sword. About the time Plexitus had lost half of the province under his command, he was finally able to complete a second super crossbow. This machine he used to launch several groups of men in sharp, tight counter attacks behind the lines of the enemy. These were quite successful and he won this battle. The retreat of the enemy resulted from the complete surprise of this airborne tactic; whether these Bulgarians were concerned over being flanked by legionnaires or were fearful of being flattened during their descent is not known. It is difficult to obtain information concerning the injuries which his men sustained during this airborne operation since about this time a series of rebellions broke out amid the tradition bound ranks of his command. These were unsuccessful, but they weakened still more his battle strength. Plexitus Was an Exponent of Calculating With Logs Lack of manpower caused by attrition as well as commitments required to hold the battle lines forced Plexitus to improvise again. He moved from the biological com- puter concept (an example of a kind of reverse evolution, but Plexitus had distrac- tions) to the physical by evolving a slide rule using two large logs with a flattened face apiece. This is an early example of miniatur- ization since only 40 or so men were required to operate it This freed up many individuals for fighting and yet allowed the calculations to continue on predicting impact points. Plexitus proceeded with his work despite distractions from outside his camp (since the Bulgarians were active again) as well as those from within. Some say that Plexitus could have gone much further except for the actions of the men who operated his slide rule. These operators would, upon the first indication of an attack by enemy, pick up one of the logs making up the calculating device and rush to the scene of combat and throw it into the enemy lines. Some account for this as being the direct result of esprit de corps while others blame it on a reactionary attitude of those who did the calculations. Although normally the second log could be saved by quick action on the part of Plexitus, much time was lost. There are rumors among some scholars of this period who trace the battering ram to these acts, but this cannot be supported; we only know that Roman numerals were not normally carved in them, at least not one to a million. 4 The Last Days of Plexitus Plexitus, because of overwhelming odds, had now lost nearly all of the province which he had been sent to manage and was now with his back against the sea. He then launched his most extensive airborne opera- tion against the Bulgarians, firing over half a thousand men across the enemy lines, fully armed. The effectiveness of this attack cannot be determined since those who had been air launched, after regrouping, rebelled and joined the Bulgarians. At this point, the Legions XV and XVII arrived from across the Adriatic and Plexitus was recalled in disgrace to Rome. His legion was in shambles and the remaining men were assigned to other units. For the rest of the days of the empire, no legion ever again used that number of Plexitus' command, a shadow which extends even to the present day. Some say that he attempted to flee, but was apprehended only after there had been a malfunction in his machine. 5,6 Later, he fled Rome and joined the Carthaginians and became involved in arming a portion of their navy. Someone has sug- gested that Plexitus was the most patriotic Roman of all since the numerically inferior Roman fleet was able to overwhelm that of the Carthaginians which had been under Plexitus' direct control, a fleet equipped with a number of advanced weapons. But no one can say. The last mention of him is ambiguous. Some say that he was attempting man-powered flight as opposed to his earlier attempts, since the reference is quite definite in its description of his being covered with feathers. Critics say that he had just been tarred." Unfortunately Plexitus never stumbled onto scientific notation. Multiplying two 5 or 6 digit numbers together must have resulted in an impressive pile of sawdust. Others say that this was not the case; his legionnaires wanted him to attempt to flee — via his machine — and he was stopped by the legate of the XV who demanded his surrender. His contributions were largely forgotten at Yris trial. The only other reference ever made to his innovation was about three years after his trial when someone suggested that the Plexitus flying machine should be used as a punishment for cases not serious enough to warrant crucifixion. 80 rr JM Z8& A- S^o^ >«S^ ^ Why Aren't There Any Altairs on Arcturus II? As in all prophecy, only the correct predictions are remembered, and even those aren't outstandingly accurate . . . compare the actual nature of the first moon flights with the predictions. Henry Melton 7307 E Riverside Dr Lot #13 Austin TX 78741 I have been writing science fiction for some time now, and I've been reading it forever, so it doesn't strike me as being very odd that I'm now into computers. If you mention your computer to a friend, you're likely to get a HAL joke back. It's an automatic association: Computers and science fiction just seem to go together. It's logical too. For as long as I can remember, the science fiction stories I read had ideas. Spaceflight, nuclear power, robots and a hundred other marvels were accepted fea- tures of those adventures. A good science fiction yarn would drag me off to some strange time and place where there would be far too much going on for me to ponder over the particular space drive involved, or to puzzle about the program that might be running beneath the robot's polished skull. But when I got back to Earth, how things had changed. So many marvels seemed so possible in what had been such a drab mundane world. Well, the moonflights and the nuclear power plants and the Viking Lander robots happened. Everyone speaks of today as being a science fiction world. And, in a sense, the wonders of today were spelled out years ago in the books and magazines of science fiction. Science fiction writers are treated as modern day prophets and people expect them to have a handle on the future. In another sense, however, a closer look at some of these predictions shows a less flattering picture. Only the correct predic- tions are remembered, and even those weren't outstandingly accurate. Nobody pre- dicted such a complicated first moon flight, with command modules and orbiting stages, descent and ascent staged landers. Few stories gave the first moonship an onboard computer. None included television cameras. But no one worries loo much about that. After all, one person sitting at a typewriter can't really compete with a team of engi- neers in working out the best way to put a man on the moon. A science fiction writer isn't a true prophet; all he or she can do is choose a possible future to write about. Just as the human race, by its actions, chooses a possible future in which to live. If a writer- knows humans well enough, he/she can second guess the race and look like a pretty fair prophet. Such is the way of the game. Looking back at the hundred million words of science fiction I have read to date, I think I have gotten a good return. Future shock holds no terror for science fiction readers. No new technological marvel can sneak up and go boo. The science fiction reader has seen it all before. Or, rather, almost all of it. There does seem to be a big black gap in this flood of prophecy. The science fiction reader who is familiar with the common picture of a computer as portrayed in science fiction is due for a big shock when he/she runs up against the powerful KttVe critter called a microprocessor. It's here, now, with a potential to open up society to private initiative in a manner almost unprec- edented, and nobody wrote a story predict- ing it. 94 a qVQ^ l % That is frightening in itself. What is wrong with science fiction that something so tech- nological as a revolution in computers could go unheralded? Are science fiction writers losing their touch? Is technology developing too fast for them to keep up? An overview of modern science fiction, however, indicates that this gap seems to be a strange, localized thing. In other areas of human knowledge, science fiction is still riding high on the far edge of the barely possible. Interstellar ramjets, galactic core explosions, Kerr black holes, gene grafting, just about any conjecture of physics, cos- mology, biology or whatever, is likely to be found in a modern science fiction story. Particularly in physics, some stories have come out in the science fiction magazines before the original research on which they were based has even made it to the profes- sional journals. Science fiction can still make its claim to be the literature of ideas. But, Alfred Bestcr's excellent novel, The Computer Connection, has a room sized malevolent computer trying to take over the world. Roger Zelazny's "Home Is The Hangman," which has just won the Hugo award for the best science fiction novella of 1975, has the main character hunting down a possibly murderous robot, before the robot can find his creators. Isaac Asimov's "The Bicentennial Man" follows a robot, Future shock holds no terror for science fiction readers. 95 If a writer knows humans well enough, he/she can second guess the human race and look like a pretty fair prophet. Such is the way of the game. Yet, this gap in the literature is a small one . . . sci- ence fiction can still make its claim to be the literature of ideas when it talks about the social implications of black holes, the people dynamics of a runaway relativistic acceleration in an interstellar ramjet, or what to do about a murderous robot. originally designed to be a butler, in his life- long quest to become a human being. Now, these are good stories, some of the best of the past couple of years. But the computers and robots in them are no more sophisticated than those in science fiction stories of twenty years ago. Science fiction has had its stereotypes. The two computer types constantly used are either the huge device, something that would have been a good university computer back in the sixties, except for its disconcerting tendency to chuckle evilly when no one is looking, and the robot. The robot, more- over, usually has some kind of magical (ie: Asimov's positronic) brain that is really nothing more than technological handwaving on the author's part to let him have a human brain sized computer inside a human looking robot body. The real shame is that these stereotypes haven't changed in the twenty years that they have been used. A reader of BYTE can sit down with one of today's science fiction books and rest his/her reading arm on top of a logic machine considerably more sophis- ticated than anything he/she is likely to en- counter in the pages of the book. It is a shame, if for no other reason than some otherwise good stories are going to be un- palatable to a lot of personal computer owners. This mental gap in science fiction writing really shows up in some places. Can you imagine what Spock would have done if there had been a microprocessor in his tricorder as there should have been? The more one thinks about it, the clearer it becomes that science fiction writers are really behind schedule when it comes to computers; actually behind the times, when they should be well ahead. It is a blank spot in science fiction, and it has been there for years. It might have stayed blank for many more years if it hadn't been for the inven- tion of the microprocessor. The only people who can notice that blank spot are those who know better. In other words, only you and I and the people we talk to. But there are signs that the writers are waking up. I think the pocket calculators The personal computer is here now, with a potential to open up society to pri- vate initiative in a manner almost unprecedented in history, and nobody wrote a story predicting it. Are science fiction writers losing their crystal balls? caught us all off guard. Poof! There it was, a gadget with major sociological implications in everybody's pocket, and nobody had really predicted it. I can remember only one old story that used pocket calculators, and even then, they were finely machined, motorized slide rules. The story was good, though. It explored what a world would be like if everybody had forgotten that math could be done in one's head. If the story had come out only five years ago, it would have been hailed as a prime example of the predictive value of science fiction. But no modern story had even considered the con- cept. That was a shock for the writers; and signs that this stagnation is breaking up are starting to appear in print. But why was that mental block there at all, and why has it persisted for so long? Was it just a fluke? I don't think so. I'll tell you why. A quick look at all of the computer stories that have come out since computers and science fiction writers discovered each other back in the forties will show one dominant theme: artificial intelligence. A writer of fiction stories has to be concerned with people. Even a gadget story is only a story inasmuch as it affects people. For a writer to write anything worth read- ing, he/she has to consider the characters above all else. When the intelligent com- puter first appeared on the science fiction scene, everybody took the concept to heart. The intelligent computer made a beauti- ful character, from the storyteller's point of view. The full range of personalities, from purely logical to insanely demonical, were all available for use, and all essentially believ- able. Bel ievabil ity is a prime quality in science fiction. It has to be there if the story is going to be any good. And anyone can believe a computer with a bad case of misprogramming. And so the computer became part of the stable of characters available for a science fiction writer, right up there with human beings, mythological creatures, and aliens from the planet [The symbolic name of your favorite mythical planet is a parameter to be supplied by the user of a science fiction writing program.] A com- puter was a character. The concept became so fixed that writers forgot that real com- puters exist because they are beautiful tools. And while science fiction writers told their tales of pensive robots and planet killing Berserker machines from some war lost long ago and light centuries away, the macro- computers begat minicomputers, and minis begat micros. Out of the same labs came the 96 pocket calculators, which jumped out on the market and gave us all a little taste of future shock. The shock has done some good. Some of the belter writers are already into the swing of things. Take two examples: You must read The Mote In God's Eye by Larry Niven and Jerry Pournellc, and Imperial Earth by Arthur C Clarke. In both of these novels everyone has a pocket computer. These gadgets are pocket sized with large memories and very easy to program. They can store text, graphics, and sound, occasionally tying into larger computers by radio, thus serving as diary, library, calculator, and who knows what else. This pocket computer is such a logical development that you can bet that other writers will pick up on the idea. Here is a beautiful tool in science fiction, and not a hint of an evil chuckle out of it. Here is another example: Shockwave Rider, by John Brunner, extrapolates a world where any computer can be reached and programmed from any telephone. (This is an extrapolation?) In this future world, the programming genius with the right pass- word is like the one eyed man in the country of the blind. What can be forbidden to the man who can change his identity, profession, and financial status, with just a couple of hours tapping touchtones on his phone? Shades of stories we've read about in Computerworldl In this story, Brunner introduced the concept of a tapeworm to the science fiction readership. A tapeworm is a software life form. It lives in memory space, eating processor time. And they exist. I've seen them. So have you if you've watched a program blow up, using a video display as a window into your memory space. I've watched about five naturally occuring species in a friend's 8080. If you are doubtful that they are alive, go back and reread the definition of life and think again. Exciting things are starting to happen as science fiction takes another look at com- puters and what they can do. But only you can determine how fast these stories can come out. You can't wake up a writer if you haven't met him/her. So put on your BYTE tee-shirt and go to the next science fiction convention and meet the people. Talk about your machines. The computer as a beautiful character will never go away; you can be sure of that. But the beautiful tool is here, and all it takes is for science fiction writers to realize it. Then, finally, you might see an Altair on Arcturus II." When the intelligent com- puter concept first ap- peared on the science fiction scene, everybody took the concept to heart. Aha, here's another type of character! Definition: A tapeworm is a software life form. It lives in memory space, eating processor time. The etymological roots of its name lie in the theory of generalized computability, ie: the theory of Turing machines. 6800 OWNERS UNITE! FREE YOURSELVES FROM THE BONDAGE OF SLOW CASSETTE I/O. LOUDLY PROCLAIM YOUR SUPERIORITY OVER YOUR 8080 NEIGHBORS AND THE Z-80 SUBCULTURE. JOIN THE BFD-68 REVOLUTION. Our Basic Floppy Disc System (BFD-68) must, in all mod- esty, be called superb. It comes completely assembled with a disc controller that is plug compatible with the SWTPC 6800. The cabinet and power supply are capable of handling 3 Shugart Mini-Floppy Drives. One drive is included in the basic system price of $795 and other drives may be added easily at any time for $390. Or, you may save money by ordering a dual or triple drive sys- tem initially. The price for the BFD-68-2 is $1169 and for the BFD-68-3 triple drive system $1539. Remembering that we are prone to understatement, we must say that while the BFD-68 hardware is superb, the software is even better. Our Disc Operating System pro- vides the following advantages over most other systems. • ANY NUMBER OF FILES MAY BE OPEN (IN USE) AT ONETIME • THE NUMBER OF FILES AND SIZE OF FILES IS LIM- ITED ONLY BY THE SIZE OF THE DISC • MERGING FILES REQUIRE NO EXTRA DISC SPACE • NO WAITING FOR THE DISC TO RE-PACK • LONGER DISC LIFE- MORE EVEN DISC WEAR SKEPTICAL? SEE IT, THEN BELIEVE IT. Our products are on display at the following dealers A-VID ELECTRONICS 1655 East 28th Street Long Beach, CA 90806 MICROCOMPUTER SYSTEMS, INC. 144 S. Dale Mabry Avenue Tampa, FL 33609 DATA DOMAIN 1 11 S. College Avenue Bloomington, IN 47401 THE COMPUTER WORKSHOP, INC. 5709 Fredrick Avenue Rockville, MD 20852 COMPUTER WAREHOUSE STORE 584 Commonwealth Avenue Boston, MA 02215 COMPUTER MART OF NEW YORK, INC. 314 Fifth Avenue New York, NY 10001 BYTE SHOP OF COLUMBIA 2018 Green Street Columbia, South Carolina 29205 THE MILWAUKEE COMPUTER STORE 6916 W. North Avenue Milwaukee. Wl 53213 COMPUTER RESOURCES Chausee de Charleroi, 80 1060 Brussels — Belgium COMPUTER WORKSHOP 174 ! field Road London SW10 9AG -England COME SEE US AT THE COMPUTER FAIR IN SAN FRANCISCO APRIL 16 & 17 IN BOOTH 519. BRING YOUR BANKAMERICARD OR MASTERCHARGE CARD. SMOKE SIGNAL BROADCASTING P.O. Box 2017, Hollywood, CA 90028 97 NOW!! Z- 80 Power for the S-lOO bus 'without getting rid of your CPU card $159.95 assembled I o i O J.'*r>*;«'«!>3AA3««S»33» • £ \ i8C-80: Ls U 1 l\.\Jiy /L/tJ a leader in low cost, low power ram boards has just announced it's Zj oU mmm OU piggy back card. This plug - in board enables you to use your existing IMSAl, ALTAIR CPU card and upgrade your system to a Z — 80. The card design is such that all you do is pull out your 8080 and 8212 chips, plug in the Board to the 8080 socket itself and the ribbon cable to the 8212. A system monitor, on paper tape, is included with the board as well as a 280 Manual and Theory of Operation Manual. Dutronics will also supply all additional software at no cost, when it becomes available The price is $159.95 (assembled) only. OFF THE SHELF. BYTE OF PHILADELPHIA 1345 W. Lancaster Ave. Bryn Mawr, Penn. 19010 (215) 525-7712 BYTE OF PALO ALTO 2227 El. Camino Palo Alio, Ca. 94306 (415)327-8080 HOBOKEN COMPUTER WORKS 20 Hudson Place Hoboken, NJ. 07030 (201 420-1644 BYTE OF WESTMINSTER 14300 Beach Blvd. Westminster. Ca. 92683 (714)894-9131 BYTE OF SANTA CLARA 3400 El ('.amino Real Santa Clara, Ca. 95051 (408)249-4221 for more information call or write to: R.H.S. MARKETING 2233 El Camino Real Palo Alto, California 94306 (415)321-6639 DEALER INQUIRES INVITED B of A & MASTERCHARGE ACCEPTED 16384 BYTES for $485.00 assembled (with sockets) : tested - burned-in - guaranteed A new high in S100 bus memory cost effectiveness. Fully assembled (with sockets J, tested, burned— in and guaranteed. 4Kxl dynamic memory chips (the same ones used by the ton in IBM compat- ible memory systems J combined with self contained control logic, yield a memory system with: • Low power consumption, total board 5 watts. • Transparent refresh, which means the memory looks static to the outside ivorld. • No waiting. In fact, xrdy is not even con- nected to the memory. • Full DMA capability • Reliable, low level clock and control signals. Dynabyte LJyTlCLuy L6 brings to the S—100 Bus a state of the art, industrial quality memory system. 16K on a single board for $485.00, Guaranteed for 1 year. BYTE OF PASADENA 196 So. Lake Ave. Pasadena. Ca. 91109 (213)681—3311 BYTE OF SANTA CLARA 3400 El Camino Real Santa Clara. Ca. 95051 (408)249-4221 BYTE OF WALNUT CREEK 29H9 N. Main. St. Walnut Creek. Ca. 94596 (415)933-6252 BYTE OF SAN MATEO 1200 W. Hillsdale Bled. San Mateo, Ca. 94403 (415) 341-4200 BYTE OF PALO ALTO 2227 111 Camino Palo Alto, Ca. 94306 (415) 327-8080 for more information call or write to: R.H.S. MARKETING 2233 El Camino Real Palo Alto, California 94306 (415)321-6639 DEALER INQUIRES INVITED BofA & MASTERCHARGE ACCEPTED Navigation with Mini-O Part 3, Software Richard J Salter Avionics Engineering Ctr Ohio University Athens OH 45701 The previous two articles on Omega Navigation and the Mini-0 design by Ralph W Burhans [February 1977 BYTE, page 62; March 1977 BYTE, page 70/ have presented the basics of the Omega system and the hardware required for a minimal Omega receiver interface to microprocessor systems. In this part we will present the software details for phase-tracking loop filters and methods for output of the data as filtered lines of position (LOPs) for selected station pairs. This type of data output would be directly usable in the simpler forms of marine navigation receivers with a digital to analog converter driving a low cost Rustrak type of chart recorder. The original concept of the Mini-0 Omega receiver by Ralph W Burhans has been augmented by the contributions of a number of individuals from the Ohio Uni- versity Avionics Engineering Center, Omega project team. These include Dr Robert W Li I ley who first suggested the concept of the Memory Aided Phase Locked Loop (see reference!) and also originated the basic idea of the software based Omega sensor processor in the early stages. KentChamber- I in perfected the Memory Aided Phase Locked Loop in practice in 1974 with an all-TTL hardware version described in ref- erence 2. The design has subsequently be'en converted to CMOS logic and implemented in a number of prototype receivers in our lab. These CMOS digital hardware sensors have been prepared by Ohio University under the sponsorship of the NASA Langley Research Center program in air transporta- tion for eventual use by the general aviation community. The basic goals of this NASA sponsored program have been to provide the general aviation pilot with some alternative naviga- tion aids for use on a world wide basis from the Omega VLF signals. The feasibility of low cost Omega data sensor methods for airborne use has been demonstrated in a number of Ohio University test flights. The program is now continuing with the develop- ment of navigation software to provide the pilot or navigator with more direct data readout in the form of course deviation and indications of distance to go. An outgrowth of the program's airborne Omega receiver research is the Mini-0 system. The Mini-0 interface, operating at a 40 Hz sampling rate, is a spin-off of an earlier investigation using a 100 Hz sample rate and a more expensive temperature compensated crystal oscillator clock oper- ating at 2.611200 MHz (10200X 2§ Hz). (See reference 3). In this investigation, both ground and in-flight measurements of actual Omega phase data were collected. The data base was then used as the input for a software (FORTRAN language) simulation of the Omega sensor processor functions. This simulation analysis, performed on actual off-the-air Omega data, proved the feasibility of software methods of manipu- lating Omega data at a low interrupt rate. Digital Phase Locked Loops A very simple form of digital phase locked loop has been presented in part 2 of this series where a pair of exclusive OR gates provide a phase detector for comparing the filtered 40 Hz signal obtained from a down counter, with the phase of the signals ob- tained from the type D flip flop used as a mixer (see figure 7 of part 2). This is what we call an increment-decrement type of binary phase locked loop where the 40 Hz output is being continuously generated from 21 5 Hz 4- 29 and 21 4 Hz -f 29 depending on where the incoming noisy edges are with respect to the divide by 29 counter output. This provides a very effective low pass filter for the 40 Hz signal with a lock up time of a few cycles which is comparable to the 14 Hz bandwidth of the analog RF front end filtering. For the interested reader, a thorough treatment of digital phase locked 100 loops is available in reference 4. The Memory Aided Phase Locked Loop is a more complex digital filtering system. In the hardware version, the output of atempera- ture compensated crystal oscillator operating at the Omega reference frequency of 26 X 10.2 kHz is divided in a 6 bit binary divider chain, and the outputs of all six stages are compared with the six most significant bits of an up down counter which represents the current Omega Phase estimate. This com- parison yields a pulse at the point in time of coincidence of the two 6 bit numbers. The locked pulse is in turn fed back to the phase detector which compares the time of arrival of the locked pulse to the time of arrival of the next incoming Omega zero crossing. This phase detector is similar to the one pre- viously discussed, and it outputs an incre- ment or decrement signal to the loop counter. The memory aiding feature allows a single loop (in software here) to track the signal phase in all eight Omega time slots by periodically (ie: every ten seconds) loading the phase estimate from a particular time slot back into the loop counter when it is again time to begin tracking that particular time slot's signal. In this time-multiplexed fashion a single loop and eight words of memory can do the work of eight separate phase locked loops. Using the memory aided phase locked loop, a quite narrow bandwidth digital filter for the phase information produced by the Omega front end can be achieved. Ten bits of up down counter filtering before the 6 bit comparators provides a bandwidth of about 1/1 0th of an Omega cycle. This only allows the tracking loop to move about 30° from the previous phase value during a single time slot (using a tracking window of 625 ms per time slot). Selected pairs of the 6 bit numbers ob- tained from the memory aided phase locked loop after each time slot can be subtracted, thereby generating Omega lines of position values. The subtraction as performed in hardware uses parallel arithmetic adders as two's complement subtractors and appropri- ate latches to store the data for the selected stations. REFERENCES 1. Lilley, R W, "Binary Processing and Display Concepts for Low-Cost Omega Receivers," Jour- nal ION, Volume 22, Number 3, Fall 1975. 2. Chamberlin, K, "Binary Phase Locked Loops for Omega Receivers," Proceedings of the Second Omega Symposium ION, Washington DC, November 1974. 3. Lilley, R W, and R J Salter, "Simulation Analy- sis of a Microcomputer-Based Low-Cost Omega Navigation System," Proceedings of the National Aerospace Symposium of the ION, Warminster PA, April 1976. 4. Reddy, C P, and S C Gupta, "A Class of All Digital Phase Locked Loops: Modeling and Analysis," IEEE Transactions on Industrial Electronics and Control Instrumentation, November 1973. Photo I: Authors Richard Salter (left) and Ralph Burhans (right) shown with the Mini-0 receiver equipment driven by a KIM-1 processor seen at the right. 101 llfTJ . 40 H z INTERRUPT iR7j 4049 (CMOS) AI5 1 «>« "VI AI4 AI3 AI2 MINI-0 All RECEIVER GENERATES PHASE AIO | 4002 I J 4049 V7 UNUSED , Y ADDRESS { LINES L I A9 SAMPLES AS FLAGS A7 I ADDRESS A6 A5 A4 A3 A2 Al 1 AO TRISTATE ENABLE 17 07 16 06 15 05 14 04 13 03 12 02 II 01 10 00 4508 D7 D7 TIME SLOT 1 FLAGS ( D6 "A" INITIALIZE D6 f D5 D5 D4 D4 D3 D3 6 -BIT J PHASE D2 D2 Dl Dl DO DO NOTE: ALL MISC INTEGRATED TRISTATE CMOS | LATCH (PART OF l; FIG. 7 IN PART 2 OF THIS SERIES) 07 LOOP ENABLE TIMING DIAGRAM FOR FLAGS D6 "A" INITIALIZE LOOP ENABLE 1 ms 1 D5 MSB PHASE J 1 I 1 1 II 1 1 i r D4 ■ A STATIO N r* A 1 \ A D3 ■ i 1 1 1.25s \- D2 ■ Dl " DO LSB PHASE - Figure I : Using memory mapped 10 ports. In small systems, where little memory address space is committed to programmable memory resources, it is possible to use the high order address lines to partially decode 10 ports. This technique is applied here to show how the KIM or JOLT computers address the Mini-0 receiver's eight bits of input data. There Is one hitch with this form of 10 address decoding: Since the low order address bits AO to All are not used, all addresses from hexadecimal 8000 to 8FFF are equivalent in this particular case. In the logic of figure 3, a similar ambiguity of addressing finds hexadecimal 9000 to 9FFF treated identically as the output analog value latch. With the phase locked concept thus de- scribed as a primer for the software tracking system to be presented, the remainder of this article concentrates upon the specifics of the microprocessor interrupt 10 and the Omega sensor processor software originally used with a JOLT Microprocessor System. The JOLT system is a product of Micro- computer Associates and is based on the MOS Technology 6502 CPU chip. The basic JOLT system, incorporating the 6502 CPU, 6530-004 Teletype Monitor ROM, and ASR-33 and RS232 Teletype interface hard- ware (also a PIA which is not used in this application), is available on a single 4-1/2 X 7 inch printed circuit board for $150 in kit form. Photo 1 shows a KIM- 1 processor by MOS Technology; the programs shown in listings 1 and 2 will work with any 6502 processor based system by using appropriate monitor service routine calls in place of JOLT's TIM monitor calls. Memory Mapped IO In the name of system simplicity and low cost, the data input and output decoding technique known as memory mapped 10 is sometimes used. As mentioned previously, the JOLT system includes a peripheral interface adapter chip (PIA) which can be used for IO. However, in a small dedicated system with only one or two interrupts to service, the generality and sophistication provided by a PIA can become an expensive luxury — especially when one realizes the simplicity inherent in a memory mapped input latch. The memory mapped input circuitry is illustrated in figure 1. As used with the microcomputer interface described by Ralph 102 Burhans last month (see figure 7 in part 2 of this series), the memory mapped input hard- ware consists of a NOR gate, inverter and a tristate latch. The NOR gate and inverter are used to decode the four most significant address bits, and the decoder output enables the Omega data onto the data bus by enabling the tristate latch when the Omega data port is addressed by interrupt service routine software. Wh en t he microcomputer receives the 40 Hz i~RQ from the Mini-0 interface, the service routine needs only to say "load accumulator with data from memory location 8XXX" to accept the new Omega phase data. Note tha t sin ce the IRQ is a level sensitive input the IRQ signal must be conditioned into a short pulse so that it is not serviced more than once. It is necessary .to add the circuitry in figure 2 to figure 7 of part 2 to obtain this I RQ pulse. Since only the four most significant address bits are decoded in the memory mapped input port, any attempt to address the 4 K locations encompassed by 8XXX FROM 09 OUTPUT OF 4040 (FIGURE 7, PART 2 OF THIS SERIES) l ! (40 Hz) 220pF 20^is MICROPROCESSOR (EG:6502) ft! TO CLOCK INPUT OF 4508 LATCH- (FIGURE 7, PART 2 OF THIS SERIES AND FIGURE I OF THIS ARTICLE ) Figure 2: Since the I RQ signal of the microprocessor is a level sensitive one, it is necessary to shorten the pulse out of the Omega receiver shown in last month 5 article. A method appropriate for noncritical applications is use of an RC time delay. This RC delay developed by a 200 pF capacitor and 47 k resistor provides a pulse width of approximately 20 ys on the IRQ line. In applications where critical timing is involved, this method is not recommended. will result in enabling the Omega input latch. In effect, 4 K bytes of potential memory space have been delegated to this one input port; however, since the 16 bit address bus permits addressing up to 64 K bytes, this apparent liberal use of memory space is of WRITE -O- -\ ■te: 7 All AIO A9 AS A7 A6 A5 A4 A3 A2 Al AO UNUSED ADDRESS BITS D7 D5 D2 DO ENABLE 17 16 IS 14 13 12 II 10 07 06 05 02 DIGITAL TO ANALOG CONVERSION BY RESISTOR NETWORK D7 D4 D3 D2 IR -wv- 2R -VW- 4R 8R I6R 32R -\W- i 7i ^l rh ANALOG OUTPUT VOLTAGE Figure 3: An output interface mapped to memory locations 9000 to 9FFF (hexadecimal). This is a simple 8 bit output port which drives a 6 bit digital to analog conversion using a weighted network of resistors. When the Mini-0 programs of listing I and 2 store data at memory locations in the address range decoded by this port, it will be latched and appear as an equivalent voltage at the output jack. This interface is one simple way to drive a strip chart recorder monitoring the results of the Omega signal processing. 103 > MNTERRUPTj / O IS STATION CYCLE PREVIOUSLY .PRINTED I THIS r.Yr.l P I Q Z O TMSLCTR YES o 1 -1 ,' NO 1 Q SMAPLL Return from v . interrupt \ Figure 4: The design of an interrupt driven Omega data processing program. This is the flowchart of the program found in list- ing I , which implements the software memory aided phase locked loop al- gorithm. The circled num- bers are referenced in list- ing 1 by notations to the left of the address column. no consequence in a small system. Further- more if memory space becomes a valuable commodity, a thrifty alternative is to simply decode more address bits. The additional hardware required is a NOR gate, NAND gate and inverters. The memory mapped output technique is very similar to the input scheme just de- scribed, and it is illustrated in figure 3. Again, the four most significant bits of the address bus are decoded and used to clock a latch which latches up the data on the data bus. The only differences from the input circuitry are the NANDing of the decoder output with the microprocessor "write" signal, and the data bus latch does not need to be a tristate device. The outputs of the latch are converted from digital to analog using a resistor network. This analog output can be used to drive a chart recorder or meter indicator. Interrupt Service Routine When the Omega data samples are entered into the microcomputer from the Mini-0 interface (one sample every 25 ms), they are contaminated with noise and require fil- tering in order to extract a good estimate of 104 Station = A Table I: SMAPLL filtered Omega Phase Data. This is a sample of the Teletype printout of the program in listing I . Each line of the table is the result of one 10 second frame of Omega phase data com- pared to the internal clock. The phase differences are printed as two hexadecimal digits for each time slot, corresponding to a 6 bit number. Note that the data in the columns lettered A,B,E,F and H is quite random due to the low strength of the signals. However, the data in time slots C,D and G can be seen to be quite systematic: It increases in value as a phase difference between the internal clock and the incoming signal. By taking pairs of these well-defined station measurements and forming dif- ferences such as C-D, G-C or G-D, the result is a relatively constant value of the line of position phase difference estimate for that station pair. For example, forming the dif- ferences between station pairs G and C yields a fairly constant difference 12 average over these 24 measurements. (The mean square deviation is 3.) These observations were made at 1 0.2 kHz at 14:20 EDT July 19 1976. 27 21 2 TT 29 13 20 ^ IT ID 27 2 1 2C 23 10 20 33 13 29 2 1 31 2D OF 2D 33 IF 2A 22 34 20 OF 30 33 ID 27 22 3 6 2 3 10 33 o .'1 ID 26 25 37 23 12 33 00 10 24 26 3 9 31 1 1 37 00 1A 25 25 3 A 33 1 1 37 04 10 25 24 33 3 3 OF 33 9 ID 25 2 4 3 3 3 5 00 35 13 26 IF 4 37 39 37 1 1 2 26 21 07 37 03 38 13 2 23 23 09 3 A OA 3 6 15 2 2A 20 05 39 OD 3 A 14 IE 2C 22 7 3C 13 39 1 7 IE 28 24 09 3C 13 33 19 10 29 23 0D 3D 14 37 13 19 2A 21 0D 3 F 15 35 16 1A 23 23 OF 01 14 35 18 19 26 23 OF 01 1 1 34 13 13 29 23 12 02 1 1 33 10 18 23 21 1/1 03 1 7 3 20 1 6 28 21 14 05 15 2D 22 14 2D IF 14 04 14 2D 21 14 the true phase. This is the function of the software version of a memory aided phase locked loop: This closed loop digital filter accepts the noisy phase measurements and provides averaging so that its output is a better estimate of the true phase. The data format presented by the Mini-0 interface is also shown in figure 1. Of the eight bits in each data byte, two are control flags and six are phase data. The most significant bit, D7, is a control signal flag which goes high to indicate when the 625 ms Omega measurement time slot window is present and data should be tracked by the software filter. The D6 flag is also controlled by the Mini-0 timing hardware, and it is forced high by the Mini-0 when the A time slot occurs. Bits D5 through DO are the phase data to be tracked. When an interrupt is received by the microprocessor, the interrupt service routine must load the new data byte, test the control bits, and perform loop filtering to the phase data bits (assuming the control bits indicated good data). Note that the microprocessor could be busily performing any main routine when it is interrupted: In our example the main program will be a simple idling loop, but it could conceivably be a more general program of use in the vehicle being navigated. A flowchart for the interrupt service routine appears in figure 4. From this chart it can be seen that the routine must also output a filtered data word at the end of each time slot. The data output takes the form of printed numbers on the Teletype, and the memory mapped output latch with its digital to analog con- version provides a means for obtaining an analog voltage to drive a chart recorder. Tracking Loop Software If the D7 control bit indicates that the data is within a 625 ms time slot window, the routine must then perform loop filtering on the data via the software version of the memory aided phase locked loop. This routine is illustrated in flowchart form in figure 5. The incoming phase data is compared to the stored reference phase word. If the incoming phase is ahead of the reference phase, the difference will be positive and the loop counter must be incremented. Likewise, if the incoming phase is behind the reference phase the difference will be negative and the loop counter must be decremented. The only exception to this procedure is when the phase is near the "edge of a lane" (ie: the data points are close to or 63) in which case the opposite increment or decrement must be effected. The loop counter, which is incremented or decremented by the phase detector out- 105 6.1 (14j Hex Address 0000 0003 0005 0007 0009 000A OOOC 000 E 0010 0010 0011 0013 0015 0017 0019 001 A 001 B 001 D 001 D 001 F 0020 0022 0024 0026 0027 0029 002 A 002C 002 E 0030 0032 0033 0035 0037 0039 003 A 003 C 003 D 003 E 0040 0042 0044 0046 0049 004B 004D 004 F 0051 0052 0054 0057 0059 005C 005 E 0060 0062 0065 0068 006 B 006 D 006 E 006 E Hex Code AD 00 80 10 44 A2 80 86 EO OA 10 04 AO 01 84 E1 4A 29 3F 85 D6 A6 E1 B5 D7 4A 4A 85 D7 A5 D6 18 E5 D7 10 19 A5 D7 18 E5 D6 A8 A9 F6 85 3A A9 D6 85 37 98 C9 20 10 03 XX D7 40 XX D7 40 A8 A9 D6 85 3A A9 F6 85 37 4C 32 00 A5 EO 10 20 AO 00 84 EO 78 A5 DB 8D 00 90 A5 D7 20 B1 72 A5 E1 C9 08 10 06 20 8A 72 4C 6B 00 20 77 73 E6 E1 40 4C 6E 00 Label START Op LDA BPL LDX STX ASL BPL LDY STY Operands IPHASE PMEAS #$80 OLDENB Commentary Load data byte from phase measurement input; If high order bit zero then go print measurement; OLDENB := '10000000' [set old enable flag] ; If this is reference time slot then set the time slot counter to 1 ; SMAPLL #1 TMSLCTR * Begin software memory aided phase locked loop algorithm details SMAPLL LSR AND #S3F STA PHASE PHASE := [bits to 5 of input (low order)] LDX TMSLCTR LDA.X OLDPHREF (TMSLCTR) LSR LSR STAA PHIREF PHIREF := OLDPHREF (TMSLCTR)/4; * This adjusts for 4 increments or decrements in loop below INCTST IDSW1 IDSW2 CKGT32P PMEAS SPCESI INCIT DONE LDA CLC SBC BPL LDA CLC SBC TAY LDA STA LDA STA TYA CMP BPL DEC or RTI INC or RTI TAY LDA STA LDA STA JMP LDA BPL LDY STY SEI LDA STA LDA JSR LDA CMP BPL JSR JMP JSR INC RTI PHASE PHIREF CKGT32P PHIREF PHASE alNC.X IDSW2 #DEC,X IDSW1 ?=32 IDSW2 INC DEC #DEC,X IDSW2 #INC,X IDSW1 INCTST OLDENB DONE #0 OLDENB OLDPHREF (4) ANLGPORT PHIREF WROB TMSLCTR #8 SPCESI CRLF INCIT SPACE TMSLCTR * main routine is an endless loop interrupted on occasion MAIN JMP MAIN DIFF (in accumulator) := PHASE - PHIREF; If DIFF > then go check range, positive; DIFF (in accumulator) := PHIREF - PHASE; Patch INC.X opcode into increment or decrement switch location; Patch DEC.X opcode into increment or decrement switch location; Begin sequence to test and increment; If I DIFF [ > 32 then go to IDSW2; Decrement or increment OLDPHREF (TMSLCTR); Increment or decrement OLDPHREF (TMSLCTR); Patch DEC,X opcode into increment or decrement switch location; Patch INC.X opcode into decrement or increment switch location; Go to test and increment sequence; If previous enable flag was then skip printing; OLDENB := [reset to prevent double printout] ; [mask off interrupts] ; [analog port output := selected OLDPHREF] ; Print current reference phase using JOLT's TIM hexadecimal routine; If TMSLCTR < 8 then type space and increment TMSLCTR; Print carriage return, line feed with TIM; Print space using TIM routine; TMSLCTR := TMSLCTR + 1 [onward to next station] ; Wait for next interrupt from Mini-0 hardware; Symbols: (other than labels) 00D6 00D7 00D7 00 D8 PHASE temporary storage of 6 bit phase value OLDPHREF origin for indexed references to old reference phase PHI REF current 6 bit reference phase derived from table reference 0ODF 00E0 00E1 8000 9000 OLDPHREF data values, indexed by TMSLCTR values 1 to 8 OLDENB flag (values hexadecimal 80 or 00) TMSLCTR current station index, 1 to 8 for stations A through H IPHASE input phase and flag data port from Mini-0 peripheral ANLGPORT output analog data port for meter or chart recorder Note: Location 0053 is the low order address of a phase reference value which will be displayed on the analog output channel when printing is done. 106 Listing 1: The Mini-0 processing program. This routine implements a software memory aided phase locked loop. The bulk of the code is an interrupt response routine, starting at address 0000. Before entering the program, the IRQ interrupt vector of the JOLT or KIM-1 system must be set to point to location and IRQ must be enabled. The entry point is an endless loop at location 006E. put, performs the loop filtering. The length of this counter determines how much inte- gration is provided by the SMAPLL routine, and it also sets the tracking speed of the loop. The proper choice of loop counter length is the result of an important engineer- ing design tradeoff: If the loop counter is made too long, the noise cancelling charac- teristic will be enhanced but the tracking speed will be too slow to adequately track the signal. On the other hand, if the loop counter is made too short the loop tracking speed will be increased at the expense of desirable noise filtering. The six most significant bits of the loop counter make up the filtered reference phase which is used to measure the next incoming phase word. It is also stored at the end of each time slot so that it can be used to preset the loop at the beginning of the particular time slot ten seconds later; hence, the term "memory aided" phase locked loop. During the 625 ms gap following each time slot, this reference or "locked" phase can be sent to both the Teletype printer and analog chart recorder for recording single station phase or for measuring clock offset. A typical output is shown in table 1. These reference phase words (eight total, one per time slot) can be subtracted to form the phase differences which define lines of posi- tion (LOPs) on an Omega map. Of course, this too can be output to a recording device. Software and Output Options The SMAPLL interrupt service routine listing for a 6502 system is given as listing 1. Omega and other VLF signals are of interest to time frequency scientists and lab experi- menters because of the frequency stability of the transmitted signal. When these signals are referenced against a receiving system's C SMAPLL J © PHIREF: • OLDPHREF (TMSLCTR) '4 1 DIFF: ■ PHASE - PHIREF DIFF: ■ PHIREF- PHASE / IDSWI : ■ DECREMENT IDSW2:- INCREMENT \ IDSWI:- INCREMENT IDSW2:" DECREMENT w NO(<) ^^lDIFFr\ YESO-) >32 ? A \ / -;*;- • \ IDSWI •— A— / s / N IDSW2 I INCREMENT PHASE I DECREMENT PHASE DECREMENT PHASE I I INCREMENT PHASE f END \ ^ SMAPLL ) Figure 5: The detail design of the software implementation of a memory aided phase locked loop. The circled numbers here refer to listing I. The dot- ted line boxes surrounding the two increment or decrement switches are an elaborate representation of the concept of a program which patches itself by changing operation codes. local clock as in the Mini-0 interface, the SMAPLL phase reference outputs can be used to determine the receiver's clock error. Similarly, any lab standard oscillator can be calibrated and adjusted to cesium atomic clock accuracy by this technique (since the Omega signals are locked to a cesium ref- erence at each transmitter). Table 2 illus- trates this method of clock offset determina- 107 Station tion and the program of listing 1 was used to obtain this output. Another common use of Omega signals is that of position fixing. In order to obtain a position fix, the phase differences of two station pairs (two LOPs) are plotted as an intersecting grid on a map and their inter- section defines the receiver's position. This technique is suitable for use by small boat 2 o 3 19 25 23 2 9 3 9 OA IF 1A 29 IE 2 ^ 3A OA IF 31 ID 2B ID 30 3F 03 21 04 23 2E 13 33 05 03 21 09 29 2F 13 3/4 OA 07 IF 0D 2B 33 13 3/4 06 IE 1 1 32 35 13 35 12 3 20 16 36 33 1 1 3/4 1/4 05 23 19 39 39 3 37 15 1 23 IB 33 3C 13 3D 13 3D IF IF 39 3D 16 3D IE 3F 23 25 3 A 1 18 3F IE 3F 22 23 ;3F 03 IB 1 21 02 21 2D 0/4 5 1 3 0/4 p 5 3 ID 2D 09 07 20 1 24 2 IE 32 0B OA 23 3D 5 01 IE 37 03 OD 2 2 3D C L 1 3 3 1C 30 3D OF ^ 3 A \t 3 3 13 39 F 1 1 2 7 30 31 3 3 13 3D 10 15 2 7 n c 35 3 13 33 1/4 16 .<, n 3 6 3 13 3F 1 3 10 V. 2F 39 ■"> ~ 1C 03 10 IB V P p 33 ? rJ IE 3F 1 E ID 35 r* 3 F 3 4 IE 03 1 F IF n ■ J. i 29 2 33 ID 05 2 1 23 3D Q ■; > 00 3 2 IE 0A 26 2. a 3B 2D 0/4 3/4 20 OF 29 23 00 3 2 9 3/1 IF OF 2D 2B 2 3 2 3 3/4 10 U P '7 2 D 01 37 03 3/1 13 u 2B 2B 3F 3 3 3 3 5 17 1/4 P n 3 3 2 3 A Q,i 3 3 1/-; 12 2 3/4 2 37 E q [~ 17 12 2F 33 3 3 7 OD 3/1 13 10 31 3 A 2 3A 1 1 3/4 12 12 3 3 •7 V 05 3 5 12 3 3 1A 13 32 3F 03 3:3 1 1 3/1 19 13 36 3/4 3 3/; 1 3 O 13 1/4 37 5 03 3 6 1/4 3 2 13 12 3 A 03 03 3/4 1 7 30 19 12 3D 03 10 — 13 O T7 10 OF 3F OF 12 2D 10 P ' ! 21 13 3/4 OF 12 2D 1 A 2F 21 10 03 1 5 15 2 3 IF 3 2 24 0B 15 15 2 9 10 30 23 0u OF 10 16 27 ID 2 ~ V operators or backpackers. In order to plot a line of position, the segment of the program in listing 2 must be substituted into listing 1 beginning at location 0052. The LOP output obtained with this program and plotted on a Rustrak chart recorder appears in figure 8. In order to compare the operation of the software version of a memory aided phase locked loop and a conventional hardware loop system, the routines were run in a JOLT microcomputer side by side with an all hardware Omega sensor and processor. The lines of position outputs of both systems were plotted on a dual trace Rustrak chart recorder in our lab. This chart appears in figure 6 with the software system output on the bottom. As can be seen from this chart, the software system tracks the Omega signal in very similar manner to the hardware system. Future Software Line of position outputs and phase versus clock information can serve the boat opera- tor and time frequency experimenter respec- tively, but airborne navigators need position data in a more suitable form (such as cross-track error, miles-to-go, etc). Develop- ment of the necessary navigation software to enable the accomplishment of these tasks with an inexpensive, commerically available Clock Offset = One Omega Cycle time Time to Change One Cycle 1/1 0200 seconds 290 seconds 09.80 X 10 -5 2.90X10^ = 3.38 X 10~ 7 Table 2: Local clock offset determination. By measuring the amount of time needed for phase to change one complete cycle, relative to the local clock, it is possible to measure the difference between your local clock reference and the Cesium atomic clocks used to calibrate the Omega system at its world wide network of stations. The calculation is shown here, along with data taken from 10.2 kHz stations at 10:30 EDT July 20 7976. This is one way to achieve the ultimate in personal measurement of time using your computer and an Omega receiver. 108 Hex Address Hex Code Label Op Operand 0052 E0 04 PATCH CPX #4 0054 F0 18 BE.Q DIFCALC 0056 EA NOP 0057 ENDPTCH 006E A5 DA DIFCALC LDA OLDPHREF (3) 0070 4A LSR 0071 4A LSR 0072 85 D3 STA TPHAZ 0074 A5 D7 LDA PHIREF 0076 18 CLC 0077 E5 D3 SBC TPHAZ 0079 30 08 BMI NEGAT 007 B OA OUTDIFF ASL 007C OA ASL 007D 8D 00 90 STA ANLGPORT 0080 4C 57 00 JMP ENDPTC 0083 69 40 NEGAT ADC =$40 0085 4C 7B 00 JMP OUTDIFF 0088 4C 88 00 MAIN JMP MAIN Commentary Is old TMSLCTR = 4 [selected station D index] ? If so then go to Dl FCALC (calculate difference] ; Fill space; Return to previous code; TPHAZ := OLDPHREF(3)/4 [get C phase] DIFF := PHIREF -TPHAZ; If negative then go to NEGAT; Shift left to correspond to DAC output bits; [analog output port := difference phase] ; Jump back in line; [convert to positive difference] ; Go to OUTDIFF [and display value] ; Additional symbols (other than labels): 00D3 TPHAZ temporary byte used in phase difference calculation Listing 2: An alternate version of the software memory aided phase lock loop for use in plotting a phase difference value versus time. This patch to listing I was used in preparing the chart of figure 6. It calculates the phase difference, between stations selected by the choice of addresses D8 to DF at address 006 F, and the choice of a station index I to 8 at location 0053. (The ranges in each case correspond to station selections A through H.) The setup shown here picks the C-D station pair. In preparing figure 6, the constants were set up for the G-C station pair. With this patch, the main entry point is now at location 0088. microprocessor is a continuing effort at Ohio University. The microcomputer has made a low cost Omega Navigation System a very real possibility and BYTE readers are advised to stand by for navigation software as it is perfected." Figure 6: Comparison of the Mini-0 software mem- ory aided phase locked loop (listing I) with a com- parable hardware version in older (more expensive) equipment. The two sets of equipment were run simultaneously beginning at 3 PM EDT on July 16 1976 with the 2 channel chart recorder running at one inch per hour. Timing calibration is shown at the bottom of the chart. 100 O"- u- O £ o z - -- — — - — - ---- _ I " fee: — - - - - 1 L - ----- — = - =±_ : — — == ~—r ^M §n El : - __ --_ — Mfs r? 1£: , ■i-Ji.^ %^ WE Pi gfc - ^§M afeafcy ■XJ&J. m= ■ — - c o- L. _ - c EEEf- n — c 3 — ^__ — l-„P ) O O ) -X*Q« p„£ : O J 3 O 100 O Z O Z -- iir -~ :_ - - -_-_-_ I ~ EE E - _ ~ •— zee :-_— \ EC - G LOP 6- bit : - -p- JOLT software Sl\ rtAPL L E EE : - EEE= = = EEEEE §5§5 zj v .7. : -&Z ~Jt:--.\ p£E-i SSf =Lv-. ' tjii &£? ~h ?ss$ ■^9.% ===d ™£— — = -'• - : - - : : c s — —* 0-1 : — , — i — - J O O 3 ) O O ■) D J O O O < 0300 0400 I 0500 I 0600 109 Microprocessor Update: 8008 V DD ° 1 18 m— — o INTERRUPT 'd 7 ••— •> 2 17 •— o READY D 6 o—~ D 5 o*— • 3 4 INTEL 8008 16 15 •— *Z DATA i BUS \ D A <*•—•> 5 6 14 13 M SYNC — So] D 2 ~« ■" 7 12 ►oSi ) STATE D| o* ► 8 II — >s 2 J [p <~— - 9 10 °v cc Robert Baker 15 Windsor Dr Atco NJ 08004 Figure 1: The pinouts of the Intel 8008 processor. For the newcomer to the microcomputer world, the 8008 was one of the first 8 bit microprocessors to be developed. Figure 1 shows the pin assignment of the 18 pin dual-in-line package while figure 2 shows a block diagram of the central processor unit (CPU). Typical prices for the 8008 CPU are currently under $20. The 8008 is a single chip, MOS, 8 bit CPU that communicates over an 8 bit data and Figure 2: Internal organization of the 8008 processor. D0-D7 BI-DIRECTIONAL DATA BUS DATA BUS BUFFER ( 8 BIT) INTERNAL DATA BUS ( 8 BIT) INTERNAL DATA BUS POWER SUPPLIES