U S /Canada Edition $2 50 International Edition $2 95 NO. 58 MARCH 1983 United Kingdom Edition £2.00

Advancing Computer Knowledge

Printer Feature THE LEADING EDGE IN PRINTERS ONE GREAT LINE. ONE GREAT WARRANTY Finally, there's one full family of printers that covers every business or word processing application- all fromC. Itoh. a company known for packing more product into less price: and all distributed exclusively by Leading Edge, a company known for searching out and providing that very thing. Which means that one call to one source can get you any printer, any time you need it. for any purpose. All backed by a full years' warranty from Leading Edge. ITrythat on any other line of printers.l

THE PRO'S. The Prowrirers: business printers—and more. The "more" is a dot-matrix process with more dots. It gives you denser, correspondence quality copy (as opposed to business quality copy, which looks like a bad job of spray-painting). Prow riter: 120 cps. 80 columns dot matrix compressable to 136.10" carriage. Parallel or serial interface. Prowriter 2: Same as Prowriter, except 15" carriage allows full 136 columns in normal print mode. Parallel or serial interface.

PROMOTER 2

THE STAR. The Starwriter F-10. In short lor more precisely, in a sleek 6" high. 30-pound unit), it gives you more of just about everything—except bulk and noise—than any other printer in its price range. It's a 40 cps letter-quality daisy-wheel with a bunch of built-in functions to simplify and speed up word processing. It plugs into almost any micro on the market, serial or parallel.

Distributed Exclusively by Leading Edge Products, Inc.. 225 Turnpike Street. Canton. Massachusetts 1)2021. Cull: toll-free lSOO-Mi-G&Ti: or in Massachusetts call collect KH7IH2K-X150. lelex y51-(>24. Circle No 70 , •*< ’Yvp VisiCalc® MAGICALC™

MAGICALC™—VisiCalc® COMPARISON • 40-column standard video display 70-cdumn upper- and lower-case video • MAGICALC does everything VisiCalc does fy • MAGICALC does a lot more than VisiCalc lumn board video display does natic support of add-on memory boards (up to 512K) VisiCalc does • inaiwjual column widths • Protected fields and cells than VisiCalc does • Invisible column MAGICALC loads VisiCalc files • Automatic page formatting (worksheets are MAGICALC cost a whole lot less automatically placed on • Fully compatible with Vu DIF files MAGICALC FEATURES • Command compatible • Command compatible MAGICALC has: WINDOW • Full compatibility with Apple lie • File loading by nui t $ 1 4 9 9 5

55 47 sotsuma ovenue • north holywood, cofifomia 91601 •

VisiCalc is registereda trademark of VisiCorp. MAGICALCa trademark is of Artsci, Inc. Clrcl« No. t 2MHZ 6809 SYSTEMS GIMIX offers youvariety a to choose from! 38 MB WINCHESTER SYSTEM...... $17,498.99 HARDWARE FEATURES: ★ 2MHz 6809 CPU ★ DMA Double Density Floppy Disk Controller ★ 512KB Static RAM ★ Dual 8” DSDD Floppy Disk System ★ 8 RS232C Serial Ports ★ Dual Winchester Subsystem with ★ 2 P a ra lle l P o rts Two19 MB 51/4” W inchester Drives SOFTWARE FEATURES: ★ OS-9 LEVEL TWO Multi-User ★ OS-9 Text Editor Operating System ★ OS-9 Assembler ★ OS-9 Debugger 19 MB WINCHESTER SYSTEM...... $8998.09 HARDWARE FEATURES: ★ 128K Static Ram ★ 4 RS232C Serial Ports ★ 2MHz 6809 CPU ★ 1 MB 51/4” Floppy Disk Drive ★ 19 MB 51/4” Winchester DMA Subsystem ★ DMA Double Density Floppy Disk Controller SOFTWARE FEATURES: ★ OS-9 LEVEL TWO Multi-User ★ OS-9 Debugger Operating System ★ OS-9 Assembler ★ OS-9 Text Editor 128KB MULTI-USER SYSTEM...... $6997.39 HARDWARE FEATURES: ★ 2MHz 6809 CPU ★ 2 RS232C Serial Ports ★ DMA Double Density Floppy Disk Controller ★ Dual 8” DSDD Floppy Disk System ★ 128KB Static Ram SOFTWARE FEATURES: Your choice of either UniFLEX or OS-9 LEVEL TWO. Both are Unix-like Multi-User/Multi-Tasking Operating Systems. 56KB FLEX/OS-9 “ SWITCHING” SYSTEM ...... $ 4 1 4 8 . 4 9 HARDWARE FEATURES: ★ 2MHz 6809 CPU ★ DMA Double Density Floppy Disk Controller ★ 56K Static Ram ★ 2 Built-in 5'V*'' 40tr DSDD Disk Drives ★ 2 RS232C Serial Ports (80 Track DSDD Drive Option . . add $400.00) SOFTWARE FEATURES: ★ GMXBUG monitor — FLEX Disk Operating System ★ OS-9 LEVEL ONE Multi-tasking operating system for up to 56K of memory WINCHESTER SUBSYSTEMS Winchester packages are available for upgrading current GIMIX 6809 systems equipped with DMA controllers, at least one floppy disk drive, and running FLEX, OS-9 LEVEL ONE or OS-9 LEVEL TWO. The packages include one or two 19MB (unformat­ ted) Winchester drives, DMA Hard Disk Interface, and the appropriate software drivers. The Interface can handle two 5 Vi” Winchester Drives, providing Automatic Data Error Detection and Correction: up to 22 bit burst error detection and 11 bit burst error correction. Dual drives can be used together to provide over 30 MBytes of on line storage - or use one for back-up of the other. (More convenient and reliable than tape backup systems. #90 includes one 19MB Drive, Interface, and S o ftw a re ...... $4288.90 #91 includes tw o 19MB Drives, Interface, and S o ftw a re ...... $6688.91 Contact GIMIX for systems customized to your needs or for more information. 50 HZ Export Versions Available

GIMIX Inc. reserves the right to change pricing and product specifications at any time without further notice 1337 WEST 37th PLACE CHICAGO, ILLINOIS 60609 inc. GIMIX'® and GHOST® are registered trademarks of GIMIX Inc (312) 927-5510 FLEX and UniFLEX are trademarks ol Technical Systems Consultants Inc. E im ix 0S-9 is a trademark ol Microware Inc. TWX 910-221-4055 1982 GIMIX Inc. Circle No. 2 About the Cover / \ /AICRO March Highlights

Printer Feature tor 1 to include a diskette ID on printed directories in "Disk ID for Printed Adding a printer to your computer Directories" (p.36). system — or enhancing the capabilities If you’re looking for a printer, read Childhood Dreams is one of a series of of one you already own — will offer you through our Information Sheet (p. 105) original oil paintings by Frank Wyman versatility, convenience, and power. before you go shopping. It describes the for children's books. The computer in­ Many of the programs presented here 10 to 20 most popular printers for the dustry is touching all of us — even expand the graphics, formatting, or computers we cover; major character­ children. MICRO'S new section, "The control capabilities of a variety of Learning Center," caters to beginning istics are compared. computerists — including children. printers. The graphic of a modern "castle” was You can make automatic pagination New! The Learning Center generated by one of the programs and user-selectable margins a part of appearing in the Learning Center the printer-driver routine; read John Now computerists just beginning to ["Digi-Draft” by Tim Kilby, page 57). Vokey's "PRINT Control for Apple tap the keyboard can enjoy MICRO, as Photo and painting by: Printers" (p.2,4). Mr. Vokey presents a well as sophisticated programmers. Frank Wyman short machine-language subroutine The Learning Centei provides fun, Wyman Art Studio that provides formatted output to most easy-to-key-in programs, with accom­ Lowell, MA 01852 output devices. Larry Hollibaugh's panying tutorial text, that teach you 617-459-7819 MX-Driver assembly-language program programming techniques and concepts. ("Centronics Printer Driver for Your Among the articles appearing in The Microcomputer" p.31) will expand the Learning Centei this month are use of your Centronics-compatible "MICRO Calc for Commodore and printer. Apple" by Loren Wright (p.47). This In "A PRINT-USING Routine for miniature spread-sheet program lets the Apple” (p.39J, Celestino Monclova you perform a variety of calculations. ilMCRO is published monthly by: presents a machine-language routine Minor changes are provided for all M I C R O INK, Chelmsford, M A 01824 that, when called from BASIC, merges Commodore machines; Phil Daley of­ Second Class postage paid at: Chelmsford, M A 01824 and additional two string variables (a mask and a data) fers an equivalent program for the mailing offices with the following options: fixed Apple. U S P S Publication Number: 483470 decimal points and commas, fixed "Digi-Draft” by Tim Kilby (p.57), a ISSN: 0271-9002 dollar sign and text, asterisk or dollar drawing program, allows you to con­ sign, and floating dollar sign. struct images on an Atari GRAPHICS 7 Send subscriptions, change of address, US P S Form 3579, requests for back issues and all If you are using an Apple printer in­ screen. Learn commands to change col­ other fulfillment questions to terface card, you can send only 7-bit ors, load and save, draw points, lines, M I C R O INK ASCII code. To find out how to add pro­ circles, and rectangles. 34 Chelmsford Street P.O. Box 6502 gram control to the eighth bit, read Another entertaining program Chelmsford, M A 01824 Mark Boyd's "A Full Byte for Your displays messages in large letters across or call Apple Printer" (p.42). your screen. "BANNER: A Display Pro­ 617/256-5515 Telex: 955329 T L X SR V C We also offer a brief tutorial by Fred gram for the TRS-80C" by Bryan Chris­ 800-227-1617 Wallace, "Plotting with the VIC" tiansen (p.65) also includes powerful (p. 19), that describes the graphics mode machine-language loading techniques Subscription Rates Per Year available on a VIC-20 equipped with that provide efficient handling of U.S. $24.00 the VIC-1515 graphic printer. Mr. machine-language subroutines. 2yr. / $42.00 Wallace includes a BASIC subroutine Foreign surface mail $27.00 that permits plotting of either a Air mail: As Always... Europe $42.00 mathematical function or a user­ Mexico, Central America, generated array on a grid with labeled Middle East, North Africa, axes. Don't miss our usual machine- Central Africa $48.00 South America, South Africa, Robert Paul explains how to utilize specific coverage in Apple Slices, CoCo Far East, Australasia, the open area of OS-65D directory sec­ Bits, From Here To Atari, and Pet Vet. N e w Zealand $72.00

Copyright©. 1982 by MI C R O INK All Rights Reserved

2 MICRO No. 58 - March 1983 4-

+

d is c S avers

COLOR CODED: Multi-color DiscSavers;' are designed DURABLE: Rigid vinyl construction protects against for easy recognition of individual disks with your own constant handling to ensure long wear and tear. color-keyed filing system. Ideal for office or home use. PORTABLE: DiscSavers are the only portable vinyl

RockRoy mark of quality. •' ' - - . • •/ •• s corrfmori handling hazards Contact ypur Dealer or fHstribittor. ’ . ' ' ^ *?'.••• -i.■ c/'n-. ■ v- - p — 1 ■ ■ *" *1 7721 E. Gray Road ' I — 14 ~ IM - Scottsdale, Arizdna 8526.0 ■ ^ * MMM^ ^ ^ ||M|^ g ,(602).998-1577 your valuable1 software. ' • Computer Prod ads bivfsjbrt ' * "Tpll-FrTO 800-528-2361 ~

DiscSavers is a trademark of RocRRoy Inc. * CirclefJo‘3; NO. 58 MARCH 1983

MICRO 34 Chelmsford Street, P.O. Box 6502 Chelmsford, MA 01824 617-256-5515 Advancing Computer Knowledge

Editorial Marjorie Morse, Managing Editor PRINTER FEATURE Phil Daley, Technical Editor Loren Wright, Technical Editor h q Hi-Res Plotting with the VIC ...... Fred Wallace Emmalyn H. Bentley, Assistant Editor ' ** Combine VIC-1515/1525 printer with the VIC-20 for high-resolution graphics Maureen Dube, Editorial Assistant John Hedderman, Jr. Programmer OA Print Control for APPLE Printers ...... JohnR. VokeyandH, Cem Kaner Advertising A short subroutine for automatic pagination and user-selectable margins Bob Mackintosh, Sales Manager Dawn Blute, Administrative Assistant Centronics Printer Driver for Your 31 Microcomputer ...... Larry R. Hollibaugh Magazine Distribution An MX-Driver assembly-language program Kathle Maloof, Sales Manager Linda Hensdill, Assistant Carol A. Stark, Subscriptions Disk ID for Printed OSI Directories Robert a . Paul 36 Put unused disk space to good use Graphics Helen Betz, Art Director APPLE PRINT-USING Routine ...... Celestino R. Monclova Paula Kramer, Production Manager 39 A machine-language routine for formatted output Accounting Mark J. Boyd Donna M. Tripp, Comptroller AO A Full Byte for Your APPLE Printer ...... Kay Collins, Bookkeeper Greater control using the eighth bit

Contributing Editors Cornells Bongers THE LEARNING CENTER Dave Malmberg A"7 MICRO Calc for Commodore and APPLE ...... Loren Wright John Steiner Jim Strasma ^ ' A miniature electronic spreadsheet Paul Swanson Richard Vile c y Digi-Draft for Atari 400/800...... Tim Kilby * A sophisticated drawing program President/Editor In Chief Robert M. Tripp g-i The Computer Revolution Reaches Publisher the Community ...... Emmalyn H. Bentley John Grow A look at a new microcomputing learning center

0 C BANNER: A Display Program for DEPARTMENTS the Color Computer ...... Bryan Christiansen 2 March Highlights Display a variety of messages in large type on your screen 7 Editorial 8 CoCo Bits YQ Glossary of Computer Terms 10 From Here to ATARI 12 Short Subjects ARTICLES 14 Apple Slices 90 PET Vet 7 0 68000 BCD and Privileged Instructions Joe Hootman 92 Interface Clinic ■ Our 68000 series continues 94 Reviews in Brief 7 7 Adam p. King 97 Software Catalog A Versatile Hi-Res Graphics Routine for the APPLE * * Design multicolored shapes 100 Hardware Catalog 101 Language Information Sheet o p APPLE Disk Track Copy for 103 Data Sheet Non-Matching Numbers...... Roland e. Guiibauit 105 Printer Information Sheet Increase your disk library’s efficiency 111 6809 Bibliography 112 Next Month in MICRO o c It’s All Relative, Part 4 112 Advertiser’s Index ° Using Commodore’s Relative Records Jim strasma Read and write relative disk files

No. 58 - March 1983 MICRO 5 ASHTONTATE INTEGRAL DATA SYSTEMS dBASE II...... $529.00 IDS MICROPRISM 480 PRINTER ...... $599.00 BOTTOM LINE STRATEGIST...... 279.00 IDS PRISM-132 PRINTER...... 1199.00 C. ITOH IDS PRISM-80 PRINTER ...... 879.00 PROWRITER PARALLEL...... 489.00 INTERACTIVE STRUCTURES F-10 55...... 1799.00 PKASSO...... $145.00 F-10 PARALLEL/SERIAL...... CALL INNOVATIVE SOFTWARE, INC. CRAPPLER INTERFACE...... 140.50 TIM III...... $369.00 PROWRITER II...... 789.00 GRAPHMAGIC...... 69.00 CALIFORNIA COMPUTER SYSTEMS MATHEMAGIC...... 79.00 ASYNCHRONOUS INTERFACE...... $129.00 INFORMATION UNLIMITED SYSTEMS SYNCHRONOUS INTERFACE...... 149.00 EASYFILER...... $349.00 CALENDAR CLOCK...... 105.00 EASYSPELLER...... 159.00 RS232 INTERFACE...... 124.00 EASYWRITERII...... 279.00 PROGRAMMABLE TIMER FOR APPLE .. . 99.00 MAXELL COMSHARE TARGET MARKETING FD-1 or FH-1-32 (8 'SINGLE SIDED) ...... $41.50 PLANNER CALC...... $79.00 FD-2 (8" DOUBLE SIDED) ...... 48.95 TARGET FINANCIAL MODELING...... 249.00 MD-1 orMH-1 (5W SINGLE SIDED)...... 31.25 CONTINENTAL SOFTWARE MD-2 OrMH-2 (5%" DOUBLE SIDED)...... 47.10 HOME ACCOUNTANT FOR APPLE...... $69.00 MICROPRO HOME ACCOUNTANT FOR IBM...... 129.00 CALCSTAR...... $99.00 DICTRONICS, INC. DATASTAR...... 194.00 RANDOM HOUSE ELECT. THESAURUS $129.00 MAILMERGE...... 139.00 PROOF READER...... 50.00 WORDSTAR...... 279.00 EAGLE WORDSTAR/MAILMERGE...... 369.00 MONEY DECISIONS...... $119.00 MICROSOFT FORCED 128K RAM FOR IBM P C ...... $599.00 MATH*...... $99.00 BASIC COMPILER FOR APPLE I I ...... 315.00 FOX & GELLER 128K RAMCARD ...... 599.00 dUTIL...... $68.00 192KRAMCARD ...... 699.00 OUICKCODE FOR dBASE I I ...... 249.00 256K RAMCARD...... 799.00 OUICKSCREEN...... 129.00 64K RAMCARD...... 399.00 MICROSOFT Z80 PREMIUM PACK ...... 619.75 MICROSOFT Z80 SOFTCARD ...... 279.00 MULTIPLAN...... 229.00 CALL TOLL-FREE TASC APPLESOFT COMPILER...... 149.00 NORTH AMERICAN BUSINESS SYSTEMS * * THE ANSWER...... $249.00 1 800 523*9511 PEACHTREE ACCOUNTS PAYABLE...... $375.00 IN PENNSYLVANIA ACCOUNTS RECEIVABLE...... 375.00 GENERAL LEDGER...... 375.00 1*215*868*8219 INVENTORY...... 375.00 PAYROLL...... 187.50 T/MAKER COMPANY SALES INVOICING...... 375.00 T/MAKER I I I ...... $249.00 PERFECT SOFTWARE VIDEX PERFECT CALC...... $139.00 ENHANCER II...... 119.00 PERFECT FILER...... 279.00 VIDEX KEYBOARD ENHANCER...... 105.00 PERFECT SPELLER...... 139.00 VIDEX VIDEOTERM FOR APPLE I I ...... 299.00 PERFECT WRITER...... 239.00 VISICORP OUADRAM DESKTOP PLAN APPLE II...... $184.00 128K MEMORY EXPANSION ...... $380.00 DESKTOP PLAN IB M ...... 228.00 192K MEMORY EXPANSION ...... 475.00 VISICALC...... 184.00 64K MEMORY EXPANSION...... 280.00 VISICALC ADVANCED VERSION...... 339.00 64K MEMORY UPGRADE...... 129.00 VISICALC BUSINESS FORECASTING...... 89.00 MICROFAZERS ALL MODELS...... CALL VISIFILE APPLE II/IB M ...... CALL OUADBOARD 64K ...... 499.00 VISILINK...... 184.00 OUADBOARD128K ...... 649.00 VISIPLOT FOR APPLE...... 159.00 OUADBOARD 192K ...... 749.00 VISITREND/VISIPLOT...... 228.00 OUADBOARD 256K...... 829.00 IBM IS A TRADEMARK OF INTERNATIONAL BUSINESS MACHINE, APPLE IS A REGISTERED TRADEMARK OF APPLE COMPUTERS, CONTROLLER FOR ELITE I...... $99.00 INC., CROSSTALK IS A TRADEMARK OF MICROSTUFF. INFOSTAR RANA ELITE 1...... 379.00 IS A TRADEMARK OF MICROPRO. PRICES, SPECIFICATIONS RANA ELITE I I ...... 559.00 AND AVAILIBILITY SUBJECT TO CHANCE WITHOUT NOTICE. NOT ALL PROGRAMS AVAILABLE IN ALL FORMATS. PLEASE RANA ELITE I I I ...... 729.00 CALL FOR ADDITIONAL PRODUCT INFORMATION. SMITH-CORONA MICROHOUSE SMITH-CORONA TP-1...... $599.00 P.O. Box 499 /1444 Linden street Department 302 Bethlehem, p a 18016 SUPERCALC BY SORCIM...... $209.00 Dealers inquiries welcome! SPELLGUARD...... 189.00 Designer

GRAPHICS SYSTEM H

All Penguin applications products are now on unprotected disks for vour convenience-. /AlCft0 Editorial

"The more things change, the more they...uh...change!"

Everyone knows that the way that old taking MICRO'S approach to com­ French proverb is supposed to end is, puters and programming and applying "...the more they stay the same." it to these relatively new systems. Attache-style cases for carrying and pro­ But the fact is that1 s never been true Think about that for a second. The tecting your complete computer set-up! at MICRO magazine. Change is change. possibilities are truly intriguing. The Accommodates equipment in a fully oper­ ational configuration. Never a need to It's accepted because it’s necessary. " Visicalc-type" program in this remove equipment from case. Simply The microcomputer industry itself is premier edition of "The Learning remove lid, connect power, and operate. far too dynamic to tolerate anything Center" is a good example. AP101 Apple II with Single Drive $109 static for very long. Another alteration you might notice AP102 Apple II with Two Disk And, of course, MICRO has been in this issue is the new page of Reader Drives 119 AP103 Apple II, 9 Inch Monitor & around for a while; almost as long as Service Cards we've bound into it. The two Drives 129 the industry itself (MICRO is now in top two are self-explanatory. The card AP104 Apple III, Two Drives & its sixth publishing year), which means on the bottom is designed to be used Silentype Printer 139 it’s seen its share of changes. with the individual advertisements AP10S 13" Monitor with Accessories 99 In that regard, however, our March you'll find in this issue. There's a AP106 AMDEK Color Monitor 119 1983 issue is a benchmark; you'd have number on or near each ad. If you want RS201 TRS-80 Model I, Expansion to go back a long, long way before you to receive more information about a Unit & Drives 109 RS204 TRS-80 Model III 129 found an issue of MICRO that contained product you see advertised in this AT301 ATARI Computers with so many changes |and the promise of issue, just circle the right number, fill Peripherals 109 even more to come). in your mailing information, and drop P402 Centronics 730/737 & Start with this month's cover. the card in the mail. Radio Shack Printer 89 P403 Epson MX70/80 or Maybe you noticed the image inside Throughout this issue and in issues Microline 82A 89 the screen is a painting, not a to come, you'll find MICRO using P404 Epson MX100 Printer 99 photograph. A small change, but an im­ more color than in the past. We believe P405 IDS 560 or Prism 132 Printer 109 portant one. The work is by Frank that color adds an important dimension P406 Starwriter/Printmaster Wyman, an exciting artist who's agreed to the magazine. For example, in a wir­ F-10 Printer 119 to lend his talents to MICRO on a ing diagram color can clarify and P407 Okidata Microline deliver the information far more effi­ 83A or 84 Printer 99 regular basis. P408 Prowrlter 2 Printer 99 The cover art serves to introduce a ciently than the written word. It is our P409 Prowriter (Apple Dot Matrix) brand new section in MICRO, "The hope to use color extensively.in future Printer 89 Learning Center,” but don't be mislead issues of MICRO — for diagrams, col­ IB501 IBM Personal Computer 129 by the youngsters it depicts. This new ored screen shots of running programs, IB502 IBM Monitor 99 HP601 HP41 with Accessories 99 section is definitely not "kid's stuff.” and even for its pure cosmetic effect in CM703 Commodore Model 64 It’s MICRO material presented just a feature articles. with Drives 119 little bit differently — more clearly So, what we have here in the March CM704 Commodore Model 64 with Dataset 109 spelled out, with some information 1983 issue of MICRO magazine is the NS010 North Star Advantage 139 gaps filled in. beginning of a new look, a new section, CC80 Matching Attache Case (5") 85 The new section is more tutorial and a new service. A fair amount of in­ CC90 Matching Attache Case (3") 75 and, generally speaking, plans are to novation, I’d say, for a single issue. CC91 Matching Accessory Case 95 CC92 5.25" Diskette Case 49 keep its focus on programming infor­ April, of course, is another story.... mation for the Atari 400/800, Commo­ Oh yes, one more thing. I'd like to compuT* case companv dore 64 and VIC-20, TRS-80C, and introduce myself — MICRO'S new Apple. But you may find similar infor­ publisher. 5650 Indian Mound Court Columbus, Ohio 43213 mation on other systems like the (614) 868-9464 TI-99/4A and Timex/Sinclair from time to time. CALL TOLL FREE We see this section as a way of 800-848-7548 breaking new editorial ground; we’re John Grow Circle No. 6

No. 58 - March 1983 MICRO 7 /MCftO CoCo Bits

cuitry, or if my sample happens to be the recorder and reload your damaged By John Steiner adjusted differently. Despite these file. Disconnect the motor remote plug minor problems, my impressions of the and position the tape to the beginning computer have been favorable so far. of the file. Press PLAY and listen as the While on the subject of CoCo file is being read. There will be a slight In my January column (MICRO 56:92) I "clones," there are other computers gap between data blocks. When you mentioned the TDP 100, a Color Com­ available or in the works. In England, first note the silence in the gap, quickly puter built by Radio Shack for distribu­ the Dragon is similar to CoCo, reinsert the earphone plug. When the tion through other dealers. This although it is not completely compati­ next block starts, the computer will ac­ month's column was written using my ble with either hardware or software. A cept it as a continuation of the previous new TDP 100 with disk Scripsit. The Japanese company is making a com­ file. At this point you can use a text System 100 computer is presently patible computer that probably will be editor, or possibly your file program available in stock configuration as a available by the time you read this. itself, to edit out the undesired infor­ 16K computer with either standard or There are rumors of still another com­ mation from the first file block. This Extended BASIC. In addition, it is patible machine, but I have no informa­ method also erases any data contained available from some locations as a tion on that. There should be no short­ in the first block. 32/64K model. Retail prices are com­ age of software for CoCo. You can restore program files saved parable to Radio Shack prices. My I received a letter from Maury Mead in ASCII format that have an I/O error machine is equipped with the 64K asking about the Supercharger board in the center of the file. CLOAD the file RAM mode modification provided by available from Spectral Associates. and count the number of blocks until Computerware, Inc. As I become more This board accesses map type 1, the all the I/O message appears. Next, use adept at using the 64K capacity, I will RAM mode, without modifying the CLOAD to bring in the file again, pass the information along. computer. He would like to know if the counting the incoming blocks. When Technically, the computer is board will work with Frank Hogg's you reach the block number just before software-compatible with the TRS-80 FLEX. If you have any information on the damaged block, pull out the ear­ Color Computer. The circuit board, this, please let me know. phone plug. Using the technique de­ however, is altogether different in Ken Christiansen of Fargo, North scribed earlier, skip over the damaged layout; the familiar components are Dakota, provides the following infor­ block. When that block is finished, there but in different locations. This mation regarding tape ASCII files. If quickly plug in the earphone cable. The may cause problems with hardware you have an I/O error in a tape ASCII program will continue loading. You accessories built for insertion into file, or if you have accidentally re­ will have to reconstruct only the data the computer. corded over the header, there is a way in the damaged block. Though I On the "E " board model TRS-80, to recover at least some of the data. haven't done much experimenting memory jumpers are labeled 16K and You can experiment by loading a pro­ with the technique, I was able to merge 32K. On the 100 model, they are marked gram and resaving it using the ,A op­ two programs together. 16K and 64K. Does this indicate a tion. CSAVE "filename",A saves the I have some more memory loca­ possible marketing change? Making a program in ASCII format rather than tions and functions for you this month. 64K machine available would cost lit­ tokenizing the keywords. As the tape is The start address of a BASIC program is tle, yet provide an extra sale point. being written, you will notice that it located in memory locations 25 and 26. The TDP 100 comes with a white contains blocks of data. Watch the The end address is stored in locations case, built slightly higher than the record indicator; you will see the 27 and 28. An interface with a TRS-80. It has long cooling slots in the spindles actually stop turning between machine-language routine could be back of the cabinet into which a loose the blocks. That is the key to recover­ done easily with this information. You wire end or coin might easily slide. ing the data. can CSAVEM the BASIC program, When my warranty expires, I will prob­ If you accidentally record over a file along with a machine-language driver. ably glue some nylon netting to the header, trying to load the information The driver could auto-execute and do a underside of the cabinet to forestall only results in an I/O error message. JMP to $AE75, the start address of the any accidents. Put in a tape that contains a valid file RUN routine. This procedure creates I have noticed that the colors (its filename is unimportant) and begin an auto-executing BASIC program. displayed on the screen are slightly dif­ the loading process, watching the ferent from my other machine. Ad­ record indicator and tape spindles. justing the hue control on the TV does When the recorder stops, immediately You may contact John at 508 Fourth Ave., not restore the colors to those with pull out the earphone connector cable. N.W., Riverside, ND 58078. which I am familiar. I don't know if The computer will not hear the rest of there is a difference in the color cir­ the incoming data. Now you can stop JMCftO

8 MICRO No. 58 - March 1983 NEW FROM D & N MICRO PRODUCTS, INC. Z80A CPU with 4MHz clock and CP/M 2.2 aluminum with vinyl woodgrain decorative operating system. 64K of low power static finish. 8 slot backplane for expansion. 48 RAM. Calendar real time clock. Centronics pin buss is compatible with most OSI type parallel printer interface. Serial inter­ boards. Uses all standard IBM format CP/M face for terminal communications, dip software. switch baud rates of 150 to 9600.4" cool ing fan with air intake on back of computer and Model 80-1200 $2995 discharge through ventilation in the bot­ 2 8 " single sided drives, 1.2 meg of tom. No holes on computer top or side for storage entry of foreign object. Two 8" single or Model 80-2400 $3495 double sided floppy disk drives. IBM single 2 8" double sided drives, 2.4 meg of density 3740 format for 243K of storage on storage each drive. Using double density with 1K Option 001 $ 95 sectors 608K of storage is available on a Serial printer port, dip switch baud rate single sided drive of 1.2 meg on a double settings MICRO-8O COMPUTER sided drive. Satin finish extruded Software available in IBM single density 8" format. Microsoft Digital Research Micropro Basic-80 $289 PL/1-80 $459 Wordstar $299 Basic Compiler $329 Mac $ 85 Mail-Merge $109 Fortran-80 $410 Sid $ 78 Spellstar $175 Cobol-80 $574 Z-Sid $ 95 SuperSortl $195 Macro-80 $175 C Basic-2 $110 Pascal Edit-80 $105 Tex $ 90 Pascal/MT + $429 MuSimp/Mu Math $224 DeSpool $ 50 Pascal Z $349 Mu Lisp-80 $174 Ashton-Tate Pascal M $355 dBase II $595 Convert almost any static memory OSI machine to CP/M® with the D & N-80 CPU Board.

Z80A CPU with 4MHz clock. 2716 EPROM plete with 10 ft. cable. Optional Real Time with monitor and bootstrap loader. RS-232 Calendar Clock may be set or read using serial interface for terminal communica­ ‘CALL’ function in high level languages. tions or use as a serial printer interface in a Power requirements are only 5 volts at 1.4 VIDEO system. Disk controller is an Intel amps. Available with WORDSTAR for serial 8272 chip to provide single or double densi­ terminal systems. ty disk format. 243K single density or 608K INCLUDES CPM 2.2 double density of disk storage on a single sided 8 ' drive. A double sided drive pro­ D & N-80 serial $695 vides 1.2 meg of storage. DMA used with D & N-80 serial w/Wordstar $870 disk controller to unload CPU during block D & N-80 video $695 transfers from the disk drives. Optional OptionOOl $ 80 Centronics type parallel printer port com­ parallel printer and real time D & N-80 CPU BOARD calendar clock OTHER OSI COMPATIBLE HARDWARE I0-CA10X Serial Printer Port $125 C1P-EXP Expansion Interface $ 65 Compatible with OS-65U and OS-65D soft­ Expansion for C1P 600 or 610 board to the Disk Drives and Cables ware OSI 48 pin buss. Requires one slot in 8 "ShugartSA801 single sided $395 IO-CA9 Parallel Printer Port $175 backplane. Use with BP-580 backplane 8 "ShugartSA851 double sided $585 Centronics standard parallel printer inter­ BIO-ieOOBarelOcard $ 50 FLC-6 6ft. cable from D & N or OSI $ 69 face with 10 ft. flat cable Supports 8K of memory, 2 16 bit parallel controller to 8" disk drive BP-580 8 Slot Backplane $ 47 ports may be used as printer interfaces. 5 51/4" MPIB51 with cable, power $450 Assembled 8 slot backplane for OSI 48 pin RS-232 serial ports, with manual and Molex supply and cabinet buss connectors FLC-51/48ft.cableforconnection $ 75 24MEMCM9 $380 24MEM-CM9F $530 DSK-SW Disk Switch $ 29 to 5 1/4 drive and D & N or OSI 16MEM-CM9 $300 16MEM-CM9F $450 Extends life of drive and media. Shuts off controller, with data separator and 8MEM-CM9 $210 8MEM-CM9F $360 minifloppy spindle motor when system is disk switch BMEMCM9F $ 50 FL470 $180 not accessing the drive. Complete KIT and Okldata Mlcrollne Printers 24K memory/floppy controller card sup­ manual ML 82A Dot Matrix Printer $534 ports up to 24K of 2114 memory chips and 120 CPS, 80/120 columns, 9.5" paper width, an OSI type floppy disk controller. D & N Micro Products, Inc. friction or pin feed Available fully assembled and tested with 3684 N. W ells St. ML83ASameas82Aexcept $895 8, 16, or 24K of memory, with floppy con­ 16" paper width, 132/232 columns with Fort Wayne, Ind. 46808 troller (F). Controller supports 2 drives. tractor feed Needs separated clock and data inputs. (219) 485-6414 M L 84 Same as 82A except 200 CPS, $1152 Available Bare (BMEM-CM9F) or controller 16" paper width, 132/232 columns, 2K buf­ only (FL-470). Ideal way to upgrade TERMS $2.50 shipping, Foreign orders add 15%. fer, dot addressable graphics, with tractor cassette based system Indiana residents add 4% sales tax. feed Circle No. 7

No. 58 * March 1983 MICRO 9 /AICRO From Here To Atari

IR mode 3 is the only mode that I have pleted screen instantly appears. Just By Paul S. Swanson not found any reason to implement and follow these simple steps: can't recall seeing any programs that use it. If you want to implement IR 1. POKE 66,1 to disable the deferred mode 3 you need a complete custom vertical blank interrupt routine. character set. It is fairly simple to alter 2. POKE 54272,0 to blank out the The recently announced Atari 1200 a mode 0 display list to use IR mode 3. screen, or set up a display list and a computer should be available soon at a The Atari 1200 has only two joy­ screen somewhere in memory that is suggested retail price of $899.00. The stick ports, using the locations of not used by the OS screen and POKE significant differences between it and PORTA (PORTB doesn't exist). The the display list pointers into 54274 (lo) the 400 and 800 computers include 64K new arrangement of the keyboard and 54275 (hi). POKE color and other memory, more function keys, and makes more sense. The BREAK key is information directly into the hardware changes in the operating system. no longer on the keyboard next to registers — not the shadow registers. The operating system of the Atari BACK S, which should eliminate unin­ 3. Use the standard BASIC statements 1200 supports four more graphics tentional BREAKS while you are trying (or the shadow registers in machine modes. These modes are instruction to run your programs. language) to set up the next screen. Do register modes 4, 5, C, and E. IR modes The new function keys, as well as not use hardware registers directly. 4 and 5 are character graphics modes, most of the keys on the keyboard, are 4. POKE 66,0 and your new screen will which allow characters to be formed programmable. There are three 64-byte immediately appear on the television. using bit pairs as color register maps in memory that define the code Normally, you do not need to set references. IR mode 4 uses one scan for the key alone, SHIFT plus the key, the address for the Jump on Vertical line per character row and mode 5 uses and CTRL plus the key. Blank (JVB) instruction because the two. Most of the reference materials I Like the Atari 400, the Atari 1200 shadowing restarts the display list from have claim that these are four-color has only one cartridge slot. Some third- the pointers in the shadow registers. If modes, and it is true that you can have party cartridges will not work on the you disable the deferred VBI routine, only four colors in each character on 1200 because there is a slight difference you must supply the address or ANTIC the screen, but they are actually five- in the physical dimensions of the slot, will get lost in memory and not give color modes. The colors normally origi­ but the Atari cartridges will work fine. you the interim display you set up. nate from registers 4 (background], 0, Except for situations where the soft­ If there are many computations and 1, and 2, but if you PRINT the character ware calls for game controllers in ports screen commands required to complete in inverse video the color that would 3 and 4 and for cartridges in the right the final screen, you will probably want have been from register 2 will be taken slot, the 1200 should be fully upwards to supply the display list and screen so instead from register 3. compatible as far as software. If you that there is an interim screen showing IR modes C and E are both map obeyed the restrictions outlined in the during the computations. Remember modes. Mode C is a two-color mode operating system manual instead of that DMA (Direct Memory Access) can using 160 dots per line; each mode line looking for ways to "cheat'' in the steal up to 30% of your processing is a single scan line. Mode E is like OS operating system listing, your software time. If you make the interim screen mode 7 (which is IR mode D) except it should work on the 1200. simple, you limit the DMA substan­ has twice the vertical resolution, using tially. One or two lines of IR mode 6 or one scan line per mode line instead of Restoring Registers 7 (OS modes 1 and 2) instead of a full two. These new modes can be declared The vertical blank interrupt routine graphics or text screen will not steal with GRAPHICS statements from is in two parts. The first part updates many cycles from your computations. BASIC as modes 12 through 15. system clocks and the second part There are other ways to shut off the There are only 14 modes available shadows the hardware registers. The vertical blanking. You can write directly in the Atari hardware (GTIA modes are second part, referred to as the deferred to the hardware register NMIEN at actually all versions of mode 8). The vertical blank interrupt routine, is easily 54286 (write a zero), but that stops the Atari 1200 operating system supports disabled — just POKE 66,1. entire routine and the clocks will also all but the IR mode 3, a special Some interesting effects can be pro­ stop. If you do this, write a 64 to 54286 character mode that supports lower­ duced by playing with this feature. For to reenable the routine. Using location case descenders. It has ten scan lines example, instead of watching a screen 66 (called CRITIC) does not stop the per character, allowing you to use all fill up as the program draws it, you can system clock. eight in the character set because the blank it out or put some other message What happens in the above pro­ other two are automatically blanked. on it, then POKE 66,0 and your com­ cedure is that shadowing is temporarily

10 MICRO No. 58 - March 1983 suspended. This means that you can Compatibility Note N ext Month modify the normally shadowed hard­ The Commodore 64 has several In the interest of supporting the new ware registers in any way you want to features that are similar to those found operating system modes of the 1200 get any interim effect you need, then on the Atari. One external feature is the without abandoning the 400 and 8 0 0 ,1 restore all of them to the values you set pair of control ports. The 64 has two will review setting up character sets for up for the next screen by a POKE 66,0. jacks that are pin-compatibile with the IR modes 4 and 5. The information will All of the hardware registers are up­ Atari controller jacks, so any device set be compatible with the Atari 400 and dated during a vertical blank period, so up for the Commodore 64 control ports 800. If you want to implement it on the the next television frame contains your will probably work without alteration 1200, you can either do it the same way new screen. You do need your own dis­ on the Atari controller jacks. Commo­ or take advantage of the OS support, play list and screen area because your dore's PORTA and PORTB are not the which will simplify your program in a GRAPHICS, PLOT, DRAWTO, and same as the Atari PORTA and PORTB, few places. PRINT statements will still change the so you will have to reshuffle the soft­ memory area that the operating system ware a little. I recently had my Atari "thinks" the screen occupies. SET- computer "talking” to a Commodore COLOR, as well as SOUND and a few 64 through these controller ports and If you have any topics that you other statements, write to shadow the differences were mainly the method would like discussed in this column, registers, so they simply set up the of setting up the ports for mixed input write me at 97 Jackson Street, Cam­ shadow registers for the new screen and output and the memory location of bridge, MA 02140. without affecting the current screen. the ports themselves. JMCRO RAM For ATARI 48K RAM BOARD FOR THE 400 with Lifetime Warranty • Highest quality available • Reduces power consumption • Reduces heat 48K Board <4001 $ 15 0

32K Board (4 0 0 /8 0 0 ) $ 90 16K Board $ 6 0 FREE SHIPPING ANYWHERE IN U.S.A. In t e c “THE ULTIMATE TERMINAL PACKAGE” FOR STANDARD APPLE DOS! F^e r i p h e r a l s Send ANY size or type of file: TEXT (even Random!), BINARY, APPLESOFT and INTEGER with complete error checking. C o r p • Extremely enhanced terminal emulation system supporting 906 E. Highland Ave. baud rates up to 9600 baud! • Up to 26 macro libraries - each containing complete operational parameters, along San Bernardino, CA 92404 with the usual telephone numbers and macro strings! VISA (714) 881-1533 AFFORDABLY PRICED AT $129.95 sautniuesteRn data svstem s “ ATARI, 400, 800 are Trademarks of ATARI, Inc. RO. Box 582-M • Santee, California 92071 • 619/562-3221

Circle No. 9 Circle No. 8

No. 58 - March 1983 MICRO 11 $2 Lower-Case Fix for the /AlCftO Axiom 801P by Louis F. Sander Short Subjects Raising Numbers to a Power with Pascal by Robert D. Walker

$2 Lower-Case Fix 8 9 14 18 for the Axiom 801P Louis F. Sander, 153 Mayer Dr., Pittsburgh, PA 15237

The Axiom 80 IP was one of the few printers with built-in PET graphics and became a popular companion to the original PET computer. Today, since little else in its price range can produce such excellent listings and graphics, the 80IP is still widely used. But using it with late-model PETs creates a prob­ lem: with any but original ROMs, the H H L printer reverses upper- and lower-case NOTES: 1. HEAVY UNES ARE ORIGINAL PRINTER WIRING. 2. EXCLUSIVE-OR GATE CIRCUIT 16 FROM RADIO characters when it is in lower-case SHACK ENGINEERS NOTEBOOK, 1980 EDITION. PAGE 52. 3. IN TEXT MOOE. WHENEVER BIT 6 16 HIGH, mode. Refer to figure 1 as you read my THE CIRCUIT INVERTS BIT 7, EXCHANGING CODE6 64,0.127104 1M10-2»10 description of the $2.00 add-on circuit Figure 1 that corrects this problem. With SI in the NORM position, the printer's function is unmodified. But listed here. Then flip to TEXT, run the know your $2.00 was well spent, and when SI is flipped to TEXT, the blocks program again, and compare the two that your little printer has a new lease of characters with decimal codes printouts. (Be advised that CHR$ on life. 64-127 and 192-255 will be swapped 96-127 and CHR$ 224-255 are not (e.g., a CHR$(64) will print as a generated from the keyboard, so their Raising Numbers to a CHR$(192], a CHR$(192] as a swapping will have little practical ef­ Power with Pascal CHR$(64), etc.). With the printer in fect.) In use, you will usually keep SI Robert D. Walker, 2850 Delk Rd., Apt. graphics mode this creates a nightmare, in the NORM position, where the 2B, Marietta, GA 30067. but in lower-case mode, the upper- and printer will work in standard fashion. lower-case alphabets are put where When you want to print upper- and they belong. As an unwanted side ef­ lower-case text, switch to TEXT and My first introduction to Pascal was on fect, six keyboard-generated characters send a CHR$(14) to the printer to put it the Apple computer about two years will now print incorrectly, but they are in lower-case mode. When you see your ago. Prior to this I had done most of my rarely used in actual text. (They are the capital letters right again at last, you'll programming in BASIC. After becoming square brackets, at sign, backslash, up familiar with Pascal, however, I have and left arrows.) rarely used any other language. Among Construction of the add-on circuit other things, Pascal makes it easy to is simple and noncritical. All five con­ logically structure programs and keep nections to the printer can be made track of variables. One shortcoming, 50 REM •** AXIOM PRINTER TEST . . . where the 36-pin printer cable connec­ 60 REM however, had me wondering whether tor mounts to the green circuit board. 70 REM PRINTS ALL PRINTING CHARACTERS this language was suitable for scientific You can break wire XX by gently 80 REM IN GRAPHICS & LOWER-CASE MODES purposes — there was no direct way to desoldering pin 9 from the board, and 90 REM evaluate a number raised a power. But holding it out of the way with a drop of 100 OPEN4,4:CMD4:PRINTCHR$(8)CHR$(12) after remembering some simple laws of 110 G$ = CHR$(15)+" ” :L$ = CHR$(14)+ ” epoxy. To keep things small, I glued 120 PRINT"CHR$ G L CHR$ G L" logarithms, I found the answer. the 7400 chip to the side of the toggle 130 FOR I = 32T0127 Pascal contains the function switch and soldered wires directly to 140 IFI"< 100THENPRINT" 'EXP(Z)', which raises the base (ap­ the pins, mounting the switch in a hole 150 PRINTI;G$CHR$(I)L$CHR$(I)" "I + 128 proximately 2.718) of the natural G$CHR$(I + 128)L$CHR$(I + 128) in the side of the printer. 160 J = J + 1 :lFJ = 16THENPRINT:J = 0 system of logarithms to the Z power. Once the circuit is in place, turn SI 170 NEXT Using the following logic, you can to NORM and run the short program 180 PRINT#4:CLOSE4 develop a formula that uses the EXP(Z)

12 MICRO No. 58 - March 1983 Short Subjects (continued) function to evaluate Y raised to the X “■•

UNIVERSAL CENTRONICS ZYTREX Using laws of logarithms yields PARALLEL PRINTER INTERFACE FOR THE VIC-20® ZT14411 x Iny = z Now you can use your VIC-20® with an EPSON MX-80 printer, or an OKI- CMOS BAUD RATE DATA printer, or a TANDY printer, or ] Substituting for z in the initial equa­ | just about anybody's printer. And you GENERATOR tion yields don’t have to give up the use of your J user port (MODEM), or change to ' REPLACES MOTOROLA MC14411 special printer commands, or load any y* rz ex,ny = EXP(X*LN(Y)) special software driver programs to do J it. • PIN/FUNCTION COMPATIBLE This formula can be used in a Pascal • Outputs standard ASCII codes to j the printer. • IMPROVED FREQ OUTPUT function to directly evaluate Y raised to • Plugs in the VIC-20® printer serial j DRIVE (4 LSTjTL LOADS) the X power (see listing). i/o port. Although this solution is indirect • Understands all standard VIC-20® • FULLY STATIC OPERATION print commands. and takes significantly more processing • No modification to your VIC-20®. • TTL-COMPA/TIBLE INPUTS time than a similar machine-language • No special programs required. • WIDE OPERATING VOLTAGE subroutine, I find that for my purposes • Includes all necessary cables to hook up a standard printer using Pascal supports scientific programs centronics parallel input. admirably. • MADE IN THE U.S.A. FREE EVALUATION SAMPLES The ‘'CARD/?" is a product of CARDCO. Inc. { THIS FUNCTION RAISES Y TO THE X POWER } FOR VOLUME USERS ! Note: Apple Pascal users must USE(S) } $79.95 { the TRANSCEND library unit in } TO O RDER $6.20 EACH AT 1000 PCS. { their main program. } P. O B O X 18765 WICHITA, KS 67218 (316) 684-4660 ZYTREX CORPORATION Personal checks accepted 224 NORTH WOLFE ROAD FUNCTION EXP2(X,Y: REAL): REAL; (A llo w 3 w eeks) or , SUNNYVALE, CA 94086 BEGIN C O D (Add $2.00) EXP2: = EXP(X*LN(Y)) Handling charges $2 00 VIC-20' is a registered trademark of Commodore (408) 733-3973 END JMCftO Circle No. 10 Circle No. 11

IS THERE LIFE AFTER BASIC ? YES I WITH. TM COLORFORTH

MOVE LIP FROM BASIC! Forth is a new, high level language available now for the TRS-80® Color Com­ puter. COLORFORTH, a version of fig FORTH, has an execution time as much as lO to 20 times faster than Basic, and can be programmed faster than Basic. COLORFORTH is highly modular which make testing and debugging much simpler. COLORFORTH has been specially customized for the color computer and requires only 16K. It does not require Extended Basic. When you purchase COLORFORTH, you receive both cassette and RS/DISK versions, the standard fig EDITOR and an extensive instruction manual. Both versions and 75 page m a n u a l...... $49.95

Add $2.00 shipping Texas residents add 5 percent DEALER AND AUTHOR INQUIRIES INVITED

ARMADILLO INTI SOFTWARE P. O. Box 7661 Austin, Texas 78712 Phone (512) 459-7325

Circle No. 12

No. 58 - March 1983 MICRO 13 AMCftO Apple Slices

the set. When LINK-CREATE in­ then checks in line 1010 to see if NA is By Tim Osborn itializes the file it sets all the data fields equal to zero. If there is more free space to nulls (fields 1 through 7), and the the user is prompted to enter their NXT pointer points to the n + 1 record, various data fields by a GOSUB 6000. where n is the current record number. Line 1020 reads the available record by This month I present a file structure Thus, LINK-CREATE builds a chain of setting R = NA and a GOSUB 5000. known as linked-lists. This structure available records. The first record is Line 1020 also saves the new record chains records together into logical pointed to by NA in the header record number for future use by NR = NA. groups so that the records in a group (or (NA is initialized to 1). LINK-CREATE Line 1030 resets NA to be equal to NXT set) can be accessed in a predetermined prompts the user for the file size of the new record. The record previous­ sequence. Items within the set may be desired and places that many data ly pointed to by the new record sequenced by some key field, such as records in the file. The last record in becomes the next available. If NXT is name, or by the order in which the the chain contains a zero in the NXT equal to zero then the new record was items are entered into the set. The file field. Zero signifies an end of chain; the last available record and NA is set may contain many sets of records linked thus zero is also placed in FIC since the to zero. Line 1040 checks to see if FIC together, or it may be composed of just used record chain is empty when the = 0, which means this new record is one set. The records are chained to­ file has just been initialized. the first and only record in the used gether by including a pointer to the next LINK-PROG initializes the I/O ar­ record chain. Therefore, FIC is set to and/or previous record in the set. The rays in line 10. I use element 0 as the the new record's number (NR) and the pointer, simply a record number, is car­ file input area (OLD is used as the sub­ next pointer of the new record is set to ried as a field in each record of the set. script), element 1 is the keyboard or zero (NXT (NEW) = 0). Many design options are available user input area (NW for "new" is used The file is searched by starting at when you work with linked-lists. For as the subscript), element 2 is the file FIC (line 1050) and checking each suc­ example, records can belong to more output area (WR for write is used as the cessive record to see if the new record's than one set, and there may be multiple subscript). key is less than the key of the record to record types within each set. This Lines 100-145 ask for the desired which it is being compared (line 1060). month's programs (LINK-CREATE and function (A(DD), C(HANGE), If the new record's key is more than LINK-PROG) use a simple file structure D(ELETE), I(INQUIRE), (Q(UIT) ) and the key of the record to which it is be­ containing two sets. I chose to include then branches to it. Take a look at how ing compared, then line 1070 checks to the second set simply to manage the these subroutines work: see if the current record is at the end of free space in the file. By chaining the data chain (NXT(OLD) = 0). If so, together unused records, you can then the current record is rewritten, eliminate the necessity of performing Line Description making its NXT pointer equal to the what is commonly called garbage col­ 5000 Reads the data records into record number of the new record (NXT lection (a reorganization of the file). the old elements. (OLDI = NR). The NXT pointer of the When the file is initialized (by 6000 Gets user inputs from the new record is set to zero as this record LINK-CREATE) it contains two record keyboard and places them in is now at the end of the data chain. A types: the header record (there is only the NW elements. For the GOTO 1500 then rewrites the header one) placed at record zero, and the data add function (A$ = "A ” ) it record and creates the new record. records. The header record contains prompts the user for all data On the other hand, if the current two fields: FIC (first-in-data-chain) and fields. For other functions it record is not at the end of the data NA (next-available-record). The data asks for only the first and last chain, then it is saved as the last record records contain the following fields: name. compared to in setting LR = R in 1075. 7000 Writes the data records from The program prepares to access the the WR elements. next record in the chain by setting R = 1. FIRSTS — First name 8000 Moves data fields from NXT(OLD) and performing a GOTO 2. LASTS — Last name elements F (from) to ele­ 1055 in line 1080. 3. STR$ — Street address ments T (to). If the new record's key is less than 4. CITY$ — City address 9500 Displays data fields from the the key of the record being compared, 5. ST$ — State address old elements. then the proper position for the record 6. ZIPS — ZIP code has been found, and the program falls 7. TEL$ — Telephone number through to line 1061. Line 1061 sets the 8. NXT — Next record in chain ADD (lines 1000 - 1520) next pointer of the new record to the The add function first reads the current record number. Line 1062 NXT is the pointer to the next record in header record by a GOSUB 4000. It checks to see if the current record is

14 MICRO No. 58 - March 1983 equal to FIC, in which case FIC is reset When the record is found, line 3045 then the next record is obtained by a to the new record number and the saves the deleted record number in DR GOSUB 9015 (line 2850). The header record and new record are writ­ then saves the data in line 3045. Line BROWSE cycle is continued by looping ten by a GOTO 1500. If the current 3060 makes sure the deleted record is back to line 2810. record number is not equal to FIC then the first in the chain (FIC = R). FIC is it is necessary to update the previous set equal to the next pointer of the QUIT (line 150) record to point to the new record, deleted record. If the deleted record is Quit makes sure the file is properly which inserts the new record some­ not first in the chain, lines 3070 closed so any data in the buffer is writ­ where into the middle of the chain. through 3080 update the previous ten to the file before processing ends. Then the header and new record are record's NXT pointer to point at the written (line 1064). record at which the deleted record Program Hints originally pointed. Lines 3100 - 3120 LINK-PROG is an example of how CHANGE (lines 2000 - 2320) make the next pointer of the deleted to deal with linked-lists. It provides The change function reads the record equal to the next available you with all the basic processing com­ header record (line 2004). Line 2005 record (NXT(WR) = NA), and the next ponents of linked-lists, but is not de­ checks to see if FIC = 0. If FIC is not available equal to the deleted record signed as an end in itself. It is simply an equal to zero the user is asked if the number (NA = DR). This pushes the example of an application of linked- name is to be changed. If the user deleted record onto the top of the lists. responds "Y " (yes), the program pro­ available record stack. Note that as the linked-list gets ceeds to delete the record (GOSUB longer the processing begins to slow 3030 in line 2030). Since the delete INQUIRE (lines 2500 - 2860) down. To access the last record in the routine saves the deleted data in the By reading the header record and chain all subsequent records must be NW elements, line 2031 moves this looking for an FIC value of zero, line read first. So linked-lists are best used data back to the OLD elements. Lines 2505 checks to see if the file is empty. where the lists are relatively short. An 2032 through 2038 accept the new first There are two types of inquiries — example of this is the catalog sectors and last names from the user. Control BROWSE and DIRECT. BROWSE that Apple DOS use to store file is then passed to line 2070. allows the user to start anywhere in the description entries. Also, linked-lists If the user does not want to change file and call records up in sequence; the are most powerful when they are built the name then the change function con­ user is also given the option of chang­ on top of each other in a hierarchy, so tinues at line 2050 where a GOSUB ing or deleting any record from the that there are subchains and sub­ 6000 gets the first and last name, and a BROWSE option. DIRECT requires the subchains. This structure makes it GOSUB 9000 searches for the desired user to know the full key; unless it possible to build large and complicated record. finds a match on the exact key, it will data-bases. Line 2070 checks to see that the display a 'not found' message. record was found; if not (RC>0) then a Line 2509 asks the user which type 'not found' message is displayed. Lines of Inquiry is to be performed. If the user 2080 through 2297 prompt the user to replies "D ” for DIRECT, lines 2600 LINK-CREATE change any of the data fields in the through 2630 ask the user for the key, e) HOME record. Line 2300 checks for a name find the record, and display the data. i INPUT "ENTER NUMBER OF RECORDS ";SZ change |CN$ = "Y ” ). If there was, the When the user is done viewing the 5 CD$ = CHR$ (4) 10 0NERR GOTO 20 data is moved from OLD to NW and the record, any key can be depressed to 15 PRINT CD$"DELETE LINK-FILE" record is added through a GOTO 1020. return to the main menu. 20 PRINT CD$"0PEN LINK-FILE,L80" 22 PRINT CD$"WRITE LINK-FILE,R0" If the name was not changed then the If the user selects the BROWSE op­ : PRINT 0: PRINT 1 record is rewritten (line 2310) and con­ tion, processing continues at line 2750, 25 FOR J = 1 TO SZ trol returns to the main menu. which asks the user to enter a part or 36 PRINT CD$"WRITE LINK-FILE,R";J 40 PRINT A$: PRINT A$: PRINT A$: whole of the last name. This tells the PRINT A$: PRINT A$: PRINT A DELETE (lines 3000 - 3130) program where to begin the BROWSE. $: PRINT A$ The delete function first reads the Line 2820 displays the record. Line 45 IF J = SZ THEN PRINT 0: GOTO 50 47 PRINT J + 1 header record (line 3010), then makes 2830 asks the user to change, delete, 50 NEXT sure FIC = 0. Line 3030 GOSUBs to look at the next record in the chain, or 60 PRINT CD$"CL0SE LINK-FILE” 6000 to get the key of the record to return to the main menu (quit). To con­ delete. Line 3040 GOSUBs to 9000 to tinue, lines 2836 through 2850 preprare search for the record. If the record is to get the next record, first making sure found (RC = 0) then processing that the end of the chain has not been (LINK-PROG Listing on next page) continues. reached (NXT(OLD) = 0). If it hasn't,

No. 58 - March 1983 MICRO 15 LINK-PROG 2110 IF CH? = "N" GOTO 2140 2820 GOSUB 9500: REM DISPLAY REC. 5999 REM 10 DIM FIRST?(2): DIM LAST?(2): DIM 2120 IF CH? < > "Y" GOTO 2100 2830 HTAB 1: VTAB 23: INVERSE : PRINT 6000 HTAB 4: VTAB 4: INPUT "INPU SRT?(2): DIM CITY?(2): DIM S 2130 HTAB 4: VTAB 5: CALL - 868 "ENTER N(EXT) C(HANGE) D(ELE T FIRST NAME ";FIRST?(NW) T?(2): DIM ZIP?(2): DIM TEL? : INPUT "ENTER STREET ";SRT? TE) Q(UIT)";: GET B?: NORMAL 6010 HTAB 4: VTAB 5: INPUT "INPU (2): DIM NXT(2) (OLD) 2831 HTAB 1: VTAB 23: CALL - 868 T LAST NAME ";LAST?(NU) 20 CD? = CHR? (4):NW = 1:WR = 2 2135 IF SRT?(OLD) = "" GOTO 2130 2832 IF B? = "C" THEN F = OLD:T = 6015 IF A? < > "A" GOTO 6060: REM 30 PRINT CD?"0PEN LINK-FILE, L80" 2137 GOSUB 9500: REM REDISPLAY REC. NW: GOSUB 8000: GOTO 2100 ONLY NEED FIRST AND LAST NAME 100 HOME : HTAB 4: VTAB 2: PRINT 2140 HTAB 4: VTAB 5: CALL - 868 2833 IF B? = "D" THEN F = 0LD:T = 6020 HTAB 4: VTAB 6: INPUT "INPU "A(DD) C(HANGE) D(ELETE) Q(BIT)"; : PRINT "DO YOU WISH TO CHAN NW: GOSUB 8000: GOTO 3045 T STREET n;SRT?(NW) 110 HTAB 4: VTAB 3: PRINT "I(NQU GE THE CITY? GET CH? 2834 IF B? = "Q" GOTO 100 6030 HTAB 4: VTAB 7: INPUT "INPU IRE) ";: GET A? 2150 IF CH? = "N" GOTO 2180 2835 IF B? < > "N" GOTO 2830 T CITY ";CITY?(NW) 120 IF A? = 1"A" THEN GOTO 1000 2160 IF CH? < > "Y" GOTO 2140 2836 R = NXT(OLD): REM PREPARE TO ,C" 6035 HTAB 4: VTAB 8: INPUT "INPU 130 IF A? = 1 THEN GOTO 2000 2170 HTAB 4: VTAB 5: CALL - 868 GET NEXT RECORD T STATE ";ST$(NW) 140 'D" IF A? = 1 THEN GOTO 3000 : INPUT "ENTER CITY ";CITY 2840 IF R = 0 THEN HOME : HTAB 6040 HTAB 4: VTAB 9: INPUT "INPU 1JM 145 IF A? = 1 THEN GOTO 2500 ?(OLD) 5: VTAB 4: PRINT "THE END OF T ZIP ";ZIP?(NW) ,Q„ 150 IF A? = 1 THEN PRINT CD? 2175 IF CITY?(OLD) = "" GOTO 2170 FILE HAS BEEN REACHED";: FOR 6050 HTAB 4: VTAB 10: INPUT "INP PRINT CD?;1'CLOSE LINK-FILE1 2177 GOSUB 9500: REM REDISPLAY REC. K = 1 TO 2000: NEXT K: GOTO 100 UT TELEPHONE ";TEL$(NW) 160 GOTO 100 2180 HTAB 4: VTAB 5: PRINT "DO Y 2850 GOSUB 9015: REM CONTINUE BROWSE 6060 RETURN 1000 REM *** ADD RECORDS *** OU WISH TO CHANGE THE STATE? 2860 GOTO 2810 6070 REM 1005 GOSUB 4000: REM GET HEADER : GET CH? 3000 REM 6999 REM RECORD 2190 IF CH? = "N" GOTO 2220 3001 REM *** DELETE RECORD **** 7000 REM *** WRITE DATA REC *** 1010 IF NA = 0 THEN INVERSE : HOME 2200 IF CH? < > "Y" GOTO 2180 3002 REM 7001 REM : PRINT : VTAB 10: PRINT "FI 2210 HTAB 4: VTAB 5: CALL - 868 3010 GOSUB 4000: REM GET HEADER 7005 PRINT CD? LE FULL1': NORMAL : FOR K = 1 : INPUT "ENTER STATE ";ST?( 3020 IF FIC = 0 THEN HOME : VTAB 7010 PRINT CD?"WRITE LINK-FILE,ft” ; TO 2000: NEXT K: GOTO 100 OLD) 5: HTAB 4: PRINT "THERE ARE 7020 PRINT FIRST?(WR) 1015 HOME : GOSUB 6000: REM GET 2215 IF ST?(OLD) = "" GOTO 2210 NO RECORDS TO DELETE": FOR K 7030 PRINT LAST?(WR) INPUTS 2217 GOSUB 9500: REM REDISPLAY R = 1 TO 2000: NEXT K: GOTO 100 7040 PRINT SRT?(WR) 1020 NK = NA:R = NA: GOSUB 5000: REM ECORD 3030 HOME : GOSUB 6000: REM GET 7050 PRINT CITY?(WR) GET NEW RECORD 2220 HTAB 4: VTAB 5: CALL - 868 FIRST + LAST NAME 7060 PRINT ST?(WR) 1030 NA = NXT(OLD) : PRINT "DO YOU WISH TO CHAN 3040 GOSUB 9000: REM FIND REC. 7070 PRINT ZIP?(WR) 1040 IF FIC = 0 THEN NXT(NW) = 0 GE THE ZIP?'';: GET CH? 3041 IF RC = 0 GOTO 3045 7080 PRINT TEL?(WR) :FIC = NK: GOTO 1500 2230 IF CH? = "N" GOTO 2260 3042 GOSUB 9075: REM DISPLAY NO 7090 PRINT NXT(WR) 1050 R = FIC: REM GET FIRST DATA 2240 IF CH? < > "Y" GOTO 2220 T FOUND MESSAGE 7100 PRINT CD? RECORD 2250 HTAB 4: VTAB 5: CALL - 868 3043 IF A? = "C" THEN POP : REM 7110 RETURN 1055 GOSUB 5000: REM GET DATA RECORD : INPUT "ENTER ZIP ";ZIP? IF CHANGE 7120 REM 1060 IF NOT (LAST?(NW) + FIRST* (OLD) 3044 GOTO 100 7200 RETURN (NW) < LASTS (OLD) + FIRST?(0 2255 IF ZIP?(OLD) = GOTO 2250 3045 DR = R: REM SAVE NO OF DELE 8000 REM ****** MOVE DATA ***** LD)) GOTO 1070 2257 GOSUB 9500: REM REDISPLAY REC. TED RECORD 8010 FIRST?(T) = FIRST?(F) 1061 NXT(NW) = R 2260 HTAB 4: VTAB 5: PRINT "DO Y 3050 F = OLD:T = NW: GOSUB 8000: REM 8020 LAST?(T) = LAST?(F) 1062 IF R = FIC THEN FIC = NK: GOTO 1500 OU WISH TO CHANGE THE TEL. t SAVE DELETED RECORDS DATA 8030 SRT?(T) = SRT?(F) 1064 R = LR: GOSUB 5000:NXT(OLD) = ?"; : GET CH? 3060 IF R = FIC THEN FIC = NXT(0 8040 CITY?(T) = CITY?(F) NR:T = WR:F = OLD: GOSUB 800 2270 IF CH? = "N" GOTO 2300 LD): GOTO 3100 8050 ST?(T) = ST?(F) 0: GOSUB 7000: GOTO 1500 2280 IF CH? < > "Y" GOTO 2260 3070 R = LR: GOSUB 5000: REM GET 8060 ZIP?(T) = ZIP?(F) 1070 IF NXT(OLD) = 0 THEN NXT(OL 2290 HTAB 4: VTAB 5: CALL - 868 PREV RECORD 8070 TEL?(T) = TEL?(F) D) = NK:F = OLD:T = WR: GOSUB : INPUT "ENTER TEL. # ";TEL? 3080 NXT(OLD) = NXT(NW):F = OLD:T 8080 NXT(T) = NXT(F) 8000: GOSUB 7000:NXT(NW) = 0 (OLD) = WR: GOSUB 8000: GOSUB 700 8090 RETURN : GOTO 1500 2295 IF TEL?(OLD) = "" GOTO 2290 0: REM UPDATE PREV RECORD 8100 REM 1075 LR = R: REM SAVE PREV. REC. NO. 2297 GOSUB 9500: REM REDISPLAY REC. 3100 NXT(WR) = NA:NA = DR 9000 REM 1080 R = NXT(OLD): GOTO 1055: REM 2300 IF CN? = "Y" THEN CN? = : 3110 R = DR: GOSUB 7000: REM UPD 9001 REM **** FIND RECORD ***** GET NEXT DATA RECORD F = OLD:T = NW: GOSUB 8000: GOTO ATE DELETED RECORD 9002 REM 1500 GOSUB 4500: REM WRITE 1ST REC. 1020: REM RE-ADD RECORD FOR 3120 GOSUB 4500: REM UPDATE HEADER 9010 R = FIC: REM START AT BEGINN 1510 R = NR:F = NW:T = WR: GOSUB NAME CHANGE 3125 IF A? = "C" THEN RETURN ING OF FILE 8000: GOSUB 7000 2310 F = OLD:T = WR: GOSUB 8000: GOSUB 3130 GOTO 100 9015 RC = 0: REM RESET RETURN CODE 1520 GOTO 100 7000: REM REWRITE RECORD 3140 REM 9020 GOSUB 5000 2000 REM 2320 GOTO 100 3997 REM 9030 IF FIRST?(NW) + LAST?(NW) = 2001 REM *** CHANGE RECORD **** 2500 REM 3998 REM ***** READ HEADER **** FIRST?(OLD) + LAST?(OLD) THEN 2002 REM 2501 REM ***** INQUIRY ***** 3999 REM RETURN : REM RECORD FOUND 2004 GOSUB 4000: REM GET HEADER 2502 REM 4000 PRINT CD? 9035 IF LAST?(NW) + FIRST?(NW) < 2005 IF FIC = 0 THEN HOME : VTAB 2505 GOSUB 4000: IF FIC = 0 THEN 4001 PRINT CD?"READ LINK-FILE,R0" LAST?(OLD) + FIRST?(OLD) THEN 5: HTAB 4: PRINT "THERE ARE HOME : HTAB 4: VTAB 5: PRINT 4010 INPUT FIC: INPUT NA RC = 2: RETURN NO RECORDS TO CHANGE FOR "THERE ARE NO RECORDS TO INQ 4020 PRINT CD? 9040 LR = R:R = NXT(OLD): REM REM K = 1 TO 2000: NEXT K: GOTO 100 UIRE UPON": FOR K = 1 TO 200 4030 RETURN ADVANCE TO NEXT RECORD 2010HOME : HTAB 4: VTAB 4: PRINT 0: NEXT K: GOTO 100 4040 R£M ********************** 9050 IF R = 0 THEN RC = 1: RETURN "DO YOU WISH TO CHANGE THE NAME ?" 2509 HOME : HTAB 5: VTAB 4: PRINT 4500 REM 9060 GOTO 9020: REM GET NEXT REC 015 HTAB 4: VTAB 5: PRINT "ENTE "WHICH TYPE OF INQUIRY? " 4510 REM ***** WRITE HEADER *** ORD R Y(ES) OR N(O) GET CN? 2510 HTAB 5: VTAB 5: PRINT "D(IR 4515 REM 9075 HOME : HTAB 4: VTAB 4: PRINT 2017 IF CN? = "N" GOTO 2050 ECT) OR B(ROWSE) GET B? 4517 PRINT CD? "RECORD NOT FOUND": FOR K = 2020 IF CN? < > "Y" GOTO 2015 2520 IF B? = "B" GOTO 2750 4520 PRINT CD?"WRITE LINK-FILE,R0" 1 TO 2000: NEXT K: RETURN 2030 GOSUB 3030: REM DELETE REC. 2550 IF B? < > "D" GOTO 2510 4530 PRINT FIC: PRINT NA 9500 REM 2031 F = NW:T = OLD: GOSUB 8000: REM 2600 HOME : GOSUB 6000: REM GET 4540 PRINT CD? 9501 REM *** DISPLAY RECORD *** RESTORE DELETED RECORDS DATA KEY 4550 RETURN 9502 REM 2032 HOME : HTAB 4: VTAB 5: INPUT 2610 GOSUB 9000: REM FIND RECORD 4560 REM ********************** 9505 : HOME "ENTER NEW FIRST NAME ";FIRS 2612 IF RC > 0 THEN GOSUB 9075: 4999 REM 9510 HTAB 5: VTAB 7: PRINT "FIRS T?(OLD) GOTO 100: REM IF NOT FOUND 5000 REM *** READ DATA REC **** T NAME = ;FIRST$(OLD) 2034 IF FIRST?(OLD) * "" GOTO 2032 DISPLAY MESG. AND RETURN 5001 REM 9520 HTAB 5: VTAB 8: PRINT T,LAST 2036 HTAB 4: VTAB 6: INPUT "ENTE 2620 HOME : GOSUB 9500: REM DIS 5005 PRINT CD? NAME = »j;LAST$(OLD) R NEW LAST NAME LAST* (OLD) PLAY RECORD 5010 PRINT CD$"READ LINK-FILE,R";R 9530 HTAB 5: VTAB 9: PRINT "STRE 2038 IF LAST?(OLD) = »" GOTO 2036 2630 HTAB 5: VTAB 23: INVERSE : PRINT 5020 INPUT FIRST$(OLD) ET = " j;SRT?(OLD) 2040 GOTO 2070: REM GET OTHER I "HIT RETURN TO CONTINUE GET 5030 INPUT LAST?(OLD) 9540 HTAB 5: VTAB 10: PRINT "CIT NPUTS B?: NORMAL : GOTO 100 5040 INPUT SRT$(OLD) Y = 1’;CITY?(OLD) 2050 HOME : GOSUB 6000: REM GET 2750 HOME : HTAB 1: VTAB 4: PRINT 5050 INPUT CITY$(OLD) 9550 HTAB 5: VTAB 11: PRINT "STA INPUTS "ENTER A PORTION OF (OR WHOL 5060 INPUT ST?(OLD) TE = ff;ST?(OLD) 2060 GOSUB 9000: REM FIND RECORD E) LAST NAME": HTAB 1: VTAB 5070 INPUT ZIP$(OLD) 9560 HTAB 5: VTAB 12: PRINT "ZIP 2070 IF RC > 0 THEN GOSUB 9075: 5: INPUT "FOR START OF BROWS 5080 INPUT TEL?(OLD) CODE = 1T;ZIP$(OLD) GOTO 100: REM (RC=1 OR 2) = E ";LAST?(NW):FIRST?(NW) = "" 5090 INPUT NXT(OLD) 9570 HTAB 5: VTAB 13: PRINT "TEL NOT FOUND 2800 GOSUB 9000: REM FIND REC. 5100 PRINT CD? EPHONE NO. = 1';TEL$(OLD) 2080 GOSUB 9500: REM DISPLAY REC. 2810 IF RC = 1 THEN GOSUB 9075: 5110 RETURN 9580 RETURN 2100 HTAB 4: VTAB 5: PRINT "DO Y GOTO 100: REM DISPLAY NOT 5120 REM ********************** OU WISH TO CHANGE THE STREET FOUND MESG. AND RETURN TO MA 5997 REM ? ";: GET CH? IN MENU 5998 REM ***** GET INPUTS ***** JMCftC

16 MICRO No. 58 ■ March 1983 SAVE 2 0 % ! ! ! ! AlCftO □ Yes! Enter my subscription to MICRO, and Subscribe send me the next 12 issues for just $24.00. I save $6.00 off the newsstand price!

N am e. I OWN A: A d d re ss. JMCR0 □ Commodore 64 □ VIC-20 Use This Postage C ity . □ Apple □ PET □ Atari 400 □ Atari 800 Paid Card to Order State _ -Z ip . □ O th e r:______the Next 12 Issues I’m paying by □ Check □ MO □ VISA □ MasterCard of MICRO and SAVE For Faster Service Call: 1-800-345-8112 C a rd # ______Exp.Date ______$6.00 Off (In PA: 1-800-662-2444

Newsstand Price! S ig n a tu re . VISA or MasterCard Only

A Feast Of JMCftO Books NEW for VIC-20 Users! NEW for OSI Users! Best Sellers for Computing Mastering Your VIC-20 MICRO on the OSI APPLE Users! With 8 BASIC Projects MICRO on the APPLE Ideas... A book that makes learning to Includes Machine-language program your VIC-20 fun! Con­ enhancements and BASIC Aids, Programming aids, utilities, tains 8 projects and programs. hardware modifications for games, enhancements. Together Games, utilities — even a VIC-20 enhanced/reversed video, pro­ Volumes 1, 2, and 3 contain over version of “ VisiCalc." All 8 pro­ grams for control code and 100 programs on diskette. Fully Order These g rams on cassette to help you upper/lower case entry. A valuable documented and explained. learn faster. programming tool. □ 3-Volume Gift-Boxed @ $59.95 Books From □ Mastering the VIC-20 @ $23.95 □ M icro on the OSI @ $19.95 □ Vol.1 □ Vol.2D Vol.3 $24.95 ea.

Please rush the MICRO Books I’ve checked above to: I'm paying by: □ Check □ MO □ VISA □ MC Name ______Total Enclosed: $ ______JMCftO Address (Add $2.00 s/h per book. M A res. add 5 % tax) C ity____ . State _ -Zip Visa/MC # ______(Allow 6-8 weeks for delivery) Exp. Date:______

JMCftO I /MCftO Reader Service Card The numbers below correspond to the numbers imprinted on the advertisements Reader in this issue of MICRO. This card valid for 90 days only. Mail information to: Service... Name_ A dd re ss. For More C ity . . S ta te , -Zip Information 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 On The 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Advertisers 41 42 43 44 45 46 47 48 49 50 In This Issue! 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70

March 1983 NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES

BUSINESS REPLY CARD FIRST CLASS PERMIT NO. 60, CHELMSFORD, MA

POSTAGE WILL BE PAID BY ADDRESSEE

Use This Postage /AlCftO Paid Card to Order 34 Chelmsford Street the Next 12 Issues P.O. Box 6502 of MICRO and SAVE Chelmsford, MA 01824 $6.00 Off Newsstand Price!

NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES

BUSINESS REPLY CARD FIRST CLASS PERMIT NO. 60, CHELMSFORD, MA

POSTAGE WILL BE PAID BY ADDRESSEE Order These /AlCftO Books From 34 Chelmsford Street P.O. Box 6502 Chelmsford, MA 01824

NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES

BUSINESS REPLY CARD FIRST CLASS PERMIT NO. 60, CHELMSFORD, MA

POSTAGE WILL BE PAID BY ADDRESSEE /AlCftO 34 Chelmsford Street P.O. Box 6502 Chelmsford, MA 01824 COMPUTER PRODUCTS DESIGNING • MANUFACTURING ELECTRONICS, INC. ELECTRONIC ENGINEERING COPYRIGHT © 1981 - PATENTS PENDING 566 Irelan, Buellton, CA 93427 (805)688-2047 8:00 TO 5:00 CALIFORNIA TIME SUPER FAN II TM FOR YOUR APPLE II * COMPUTER

One Year Warranty $74.95 With Zener Ray™ Protection $109.00

MASTERCARD - VISA

“COOL IT ”

ALSO FITS ON APPLE’S* NEW MONITOR STAND RED PILOT LIGHT ON/OFF SYSTEM SWITCH CLIPS ON — NO HOLES OR SCREWS • REPLACEABLE SWITCH AVAILABLE IN 120V or 240V AND 50/60 HZ • DURABLE MOTOR REDUCES HEAT CAUSED BY EXTRA PLUG-IN CARDS SOLD WORLD WIDE • UNIQUE 1 YEAR WARRANTY » TAN OR BLACK COLOR • QUIETEST FAN ON THE MARKET • INCREASED RELIABILITY — SAVES DOWN TIME AND REPAIR CHARGES » LOW NOISE DUE TO DRAWING EFFECT OF AIR THROUGH YOUR COMPUTER AND SPECIAL FAN AND MOTOR DESIGN • TWO EXTRA 120V OUTLETS FOR MONITOR AND ACCESSORIES TURN ON WHEN YOU TURN ON YOUR FAN (NOT AVAILABLE ON 240V MODEL) SUPER FAN II™ WITH ZENER RAY OPTION $109.00 ZENER RAY™ TRANSIENT VOLTAGE SUPPRESSOR OUR BUILT IN ADVANCED DESIGN UNIT GIVES DRAMATIC COST SAVINGS — STOPS ANNOYING DOWN TIME INSURANCE FROM, VOLTAGE SPIKES-GLITCHES DANGEROUS VOLTAGE SPIKES CAN JEOPARDIZE YOUR COMPUTER SYSTEMS PROTECT COMPUTER - DISK DRIVE - PRINTER AND MONITOR NO CUTTING WIRES • WONT VOID WARRANTY, JUST PLUG IN SUPERFAN II WITH ZENER RAY

OTHER PRODUCTS BY ^ electronics . in c . SUPER RAM II™ 16K RAM CARD FOR YOUR APPLE II. 2 YEAR WARRANTY $125 GUARDIAN ANGEL™AN UNINTERRUPTABLE POWER SOURCE $595 12 VOLT TRANSVERTER 12 VOLT - RUNS YOUR APPLE II COMPUTER AND AND 5V4' DRIVE FROM YOUR CIGARETTE LIGHTER $149 • Registered trademarks of Apple Computer Inc. DEALER INQUIRIES INVITED Circle No. 13

No. 58 - March 1983 MICRO 17 C irc le No. 14 "'•••CMIPU SENSE'!.' VIC-20® VIC-20® Personal Computer $169.95 CS1 QUICK BROWN FOX $60.50 VIC-1515 Printer 334.95 The Word Processor of this decade! VIC-1530 Datasette 67.50 VIC-1541 Disk Drive 375.00 COMMODORE SOFTWARE VIC-1010 Expansion Module 139.95 VIC-1211A VIC-20 Super Expander $57 99 VIC-1311 Joystick 9.95 Everything Commodore could pack into one cartridge - 3K RAM memory expansion, VIC-1312 Game Paddles 19.95 high resolution graphics plotting, color, paint and sound commands Graphic, text, VIC -1600 Telephone Modem 99.95 multicolor and music modes 1024x1024 dot screen plotting All commands may be VIC-1210 VIC 3K Memory Expander Cartridge 34.95 typed as new BASIC commands or accessed by hitting one of the VICs special Plugs directly into the VIC’s expansion port. Expands to 8K RAM total. function keys. Includes tutorial instruction book. Excellent for all programming levels. VIC-1110 VIC 8K Memory Expander Cartridge 52.50 VIC-1212 Programmer's Aid Cartridge $45.99 8K RAM expansion cartridge plugs directly into the VIC. More than 20 new BASIC commands help new and experienced programmers renumber, trace and edit BASIC programs Trace any program line-by-line as it CM101 VIC 16K Memory Expander Cartridge 99.95 executes, pause to edit. Special KEY command lets programmers redefine function CM 102 24K Memory Expander Cartridge 119.95 keys as BASIC commands, subroutines or new commands VIC-1011A RS232C Terminal Interface 39.95 VIC-1213 VICMON Machine Language Monitor $48.99 Provides interlace between the VIC-20 and RS232 telecommunications modems. Helps machine code programmers write fast, efficient 6502 assembly language Connects to VICs user port. programs. Includes one line assembler/disassembler PETSPEED - Basic Compiler for Commodore 130.00 Compile any Pet Basic program. The only optimizing compiler. Programs compiled with Petspeed run up to 40 times faster. Petspeed code is unlistable and compiled programs cannot be tampered with. No security device required for compiled pro­ NEW GAMES FOR YOUR VIC-20® grams. Available NOW for the Commodore 64. CC58 Astroblitz - This game is challenging, even to a Star Gemini 10 Printer Call for price VIC-MASTER! Navigate your ship carefully to avoid being hit by enemy fire. Star Gemini 15 Printer Call for price CC60 Terraguard - Speed and careful skill will enable you to SMD Monitor Call for price once again destroy the aliens. Too slow? You're destroyed by their beam CC98 Serpentine - This game will test your patience & skill. Object - to survive long enough to lay eggs and raise your young. CARDBOARD 6 $87.95 CC500 Intruder-Scrambler - In your bomber, invade the An expansion interface for the VIC-20 Allows expansion to 40K or accepts up to six defending scramble system, dodging rockets, to blow up enemy posts, etc games. May be daisy chained for more versatility CC101 Choplifter - Rescue the American hostages & return CARDBOARD 3 $39.95 them safely to the U.S. You wiil encounter tanks, jets and killer satellites Economy expansion interface for the VIC-20. CC102 Black Hole - Your mission is, simply, to survive! Your CARD “?” CARD/PRINT $79 95 ship must not be hit by space objects or sucked into the Black Hole! Universal Centronics Parallel Printer Interface for the VIC-20 or CBM-64 Use an Epson MX-80 or OKIDATA or TANDY or just about any other. CC104 Apple Panic - Speed is required! Destroy the apple monsters by digging holes in the brick floors for them to fall into CABDETTE $39.95 Use any standard cassette player/recorder with your VIC-20 or CBM-64. CC65 Video Mania - Introducing your enemies: EVIL EYE, LIGHT PEN $29.95 WALWOKER, KILLERBOX Your only defense - throw your alien zapper! A light pen with six good programs to use with your VIC-20 or CBM-64. CS1 Flags of Nations - A game that challenges players to identify flags or /arious widely-known nations of the world. CS2 Flags of Nations - Second Edition - a field of 34 flags of lesser known nations of the world HOME & BUSINESS PROGRAMS For VIC-20 & C-64 CS3 Cities and States - A game that draws a map of CW-107A Home Calculation Program Pack $48.95 a state or states and asks players to name key cities in those states CPV-31 Data Files - your storage is unlimited 14.95 CS4 Cities of the World - Deals with important cities of nations throughout the world CPV-96 Household Finance Package - to keep records of all 30.95 your household expenses CS5 Mountains and Rivers - Draws large geographical area maps. You identify major mountain ranges, rivers 4 bodies of water CPV-208 Bar-Chari - display your numerical data 8.95 CH Turtle Graphics - learn program m ing 34.95 CH VIC Forth - is a powerful language for BASIC programming 49.95 NEW GAMES FOR YOUR C-64 - is a 6502 machine language monitor with CH HES MON 34.95 - Pre-determine how many hits a mini-assembler Tank Arcade (Also for VIC-20) $13.95 it will take to wipe out your opponent Then, on with the battle! Battlefield changes - time-saving word processing tool CH HES Writer 34.95 Roadracer - Choose the type of track & a time or lap race. Use 1 3.95 CH Encoder - keep your personal records away from prying eyes 34.95 steady co ntro l at speeds of 50 to 200 m iles per hour. Hit the wall & lose valuable time CT-21 Statistics Sadistics - statistical analysis 14.95 Shootout at the OK Galaxy (Also for VIC-20) - 30 alien 19.95 CT-121 Total Time Manager 2.0 - creates personal or 15.95 warships have entered your war zone. Shields up? Energy level OK? Defend yourself business schedules Galaxy - Have you ever wanted to conquer the universe? Send 19.95 CT-124 Totl Label- a mailing list and label program 13.95 your galactic fleets out to explore, solar system by solar system. From 1 to 20 players. CT-125 Totl Text BASIC 15.95 Bomber Attack - Ground to air warfare. You're in command 14.95 CT-126 Research Assistant - keep track of reference data 17.50 of a supersonic bomber over enemy terrain. Drop all 25 bombs on key locations CT-140 Totl Text Enhanced 29.95 - Your computer controls a huge force of 19.95 Japanese ships trying to conquer Midway Island Your only advantage is surprise. C M -152 Grafix Designer - design graphic characters 12.95 Dnieper River Line - A fictionalized engagement between Russian 25.00 CQ-5 Minimon - allows you to program, load, save, or execute 13.95 & German forces in 1943. Soviet forces, controlled by the computer, seek to overrun machine language programs your line and capture sufficient objectives to attain victory. Four levels of difficulty. CT-3 Order Tracker 15.95 Tanktlcs - Armored combat on the Eastern front of WWII. You 24.50 CT-4 Business Inventory - to maintain record of inventory 15.95 start outnumbered 2 to 1 but you choose your tank types before the battle. CS Home Inventory - lists your home belongings 17.95 Guns Of Fort Defiance - You are the commander of a 19th artillery 20.00 CS Check Minder - (V-20 & 64) 14.95 piece in a besieged fort. Choose type of ammo. Set the cannon’s elevation, deflection. keep your checkbook the right way Computer Baseball Strategy - you. the manager of the 15.95 CS General Ledger* a complete general ledger 19.95 home team, test you skill against a wily and unpredictable opponent, your computer CHC-504 HES Writer - word processor 39.95 - Like an intriguing puzzle! Decipher secrets 20.00 CHC-503 Turtle Graphics II - utilizes the full graphics ol your 64 49.95 while exploring a mythical, magical city 4 countryside. Avoid the lurking monsters1 CHC-502 HESMON - machine language monitor w/mini-assembler 34.95 North Atlantic Convoy Raider - it’s the Bismarck convoy 19.95 raid of 1941! The computer controls the British ships. Will you change history? CHP-102 29.95 6502 Professional Development System - Compete against others and the computer to 19.95 CFC Data Files - a management program 27.95 stake valuable mining claims throughout the solar system in the year 2050 CPV-327 HESCOM - transfers data and programs bidirection- 40.95 - In 2500 AD, earth is threatened by attacking 19.95 ally between VICs at three times the speed of a disk drive aliens with an infinite 0 of attack strategies with which to tease the defending player CPV-328 HESCOUNT - monitors program execution 19-95 Nukewar - Nuclear confrontation between two hypothetical 19.95 CHV HESPLOT- Hi-res graphics subroutines 12.95 countries. Defend your country with espionage, bombers, missiles, submarines, etc CPV-367 • Conversions - figures, volume, length, weight, area. 7.95 Computer - New Second Edition! The object is to 20.00 and velocity to all possible configurations become the wealthiest person in this '‘business'1 game - hotel acquisitions & mergers CC The Mail - your complete mail program Cassette 24.95 - Vast scale space strategy game of 1 9.95 Disk 29.95 galactic colonizing and conquest. Strange life forms & alien technologies - exciting! CPV-220 Client Tickler 16.95 - Microcomputer Dungeon Adventure game. Time 25.00 fantasy and role-playing. 50 levels of ever-more com plex mazes to explore 4 survive! CPV-221 Club Lister 13.95 CPV-224 Depredator 9.95 MORE - MORE - MORE CPV-236 Investment Analyst - keep track of investments 12.95 and investment opportunities CPV-251 Present Value 10.95 Prices subject to change. CPV-269 Super Broker 12.95 TO ORDER: WRITE CPV-270 Syndicator - calculates whether to buy or sell 13.95 P.O. Box 18765 FOR CPV-274 - maintains investments profile 14.95 Ticker Tape Wichita, KS 67218 FREE CPV-276 Un-Word Processor - screen editor 16.95 (316) 684-4660 CATALOG CPV-286 Phone Directory - never lose a phone number again 9.95 CS-111 Checkbook - home “utility” program 14.95 Personal checks accepted (Allow 3 weeks) CPV-294 Calendar My Appointments - print a calendar 14.95 or C.O.D. (Add $2) Handling charges $2.00 for every month in any year. VIC-20® is a registered trademark of Commodore CPV-296 The Budgeter - place your personal finances in order 12.95

18 MICRO No. 58 - March 1983 Hi-Res Plotting with the VIC by Fred Wallace

A discussion of the graphics are explained thoroughly in the manual When the printer receives the code mode available on a VIC-20 that accompanies the unit, and the pro­ for a particular character, it first looks equipped with the VIC 1515 gram presented here uses most of them. the code up in the built-in ROM to see graphic printer is presented, The newer VIC-1525 printer uses what dots are required to form that along with a BASIC subroutine standard-width paper, but is pro­ character. The ROM supplies informa­ that permits plotting of either a grammed similarly. tion for a 5 x 7 matrix of dots (see the mathematical function or a user­ The VIC-1515 has three major upper-case “k ” in figure 1) and then generated array on a grid with operating modes. When first powered the printer logic leaves the sixth col­ labelled axes. up, or after receiving a CHR$(15), it is umn blank before proceeding to the in the standard-character mode, which next character. By sending one 8-bit Hi-Res Plotting permits printing of all alphanumeric code, you can print anywhere from 0 to and keyboard-graphics characters avail­ 35 dots. requires: able on the screen. This mode is used In contrast, the graphics mode VIC-20 (5K or more) for program listings and normal data allows you to bypass the printer's char­ VIC-1515 or printout. Access to the alternate set of acter ROMs and send information to VIC-1525 printer keyboard graphics [i.e., those on the the head directly (see figure 2). Once in left front of the keycaps) is with a this mode, each 8-bit code received by Mathematical relationships are best special secondary address in the OPEN the printer is no longer interpreted as a analyzed in the form of a graph. Even command. character — it is either processed as a an inexpensive computer like the Double-width characters are ob­ control code if bit 7 is zero (that is, if VIC-20 can be used to produce such a tained with a CHR$(14J. This expands the binary value is less than 128), or it graph if the computer is used with a each character horizontally, reducing is sent directly to the head if bit 7 is one pin-programmable dot-matrix printer. the number of characters per line from (binary value between 128 and 255). In For those who own the VIC-20, 80 to 40 in the process. These may be the latter case, bits 0 through 6 deter­ Commodore has provided a very cap­ used in either the standard or alternate mine directly whether or not the head able printer, the VIC-1515, which has printer character sets. will place a dot on dot-lines 1 through 7 features that make plotting easy. The graphics mode is entered by of this particular print-line. For exam­ Although most people probably will transmitting a CHR$(8). In this mode ple, in order to place a single dot in dot- purchase the 1515 for program listings you gain control of each individual line 4, the binary value required is 128 and data printout only, it comes with “dot" in the print-line. To understand + 8, or CHR$(136). Dot-lines 3 and 4 some very powerful graphics and for­ how this is done, first look at how the would be darkened by sending 128 + 4 matting commands. The commands character modes work. + 8, or CHR$(140). Since you must

Figure 1: 5x7 dot matrix for Figure 2: Pin-programmable graphics mode. printer character ‘A’. DOT-LINE _ 1 O o o BINARY WEIGHT = 1

2 O o o = 2 o •• • o o 3 O • o ' = 4 • o o o • o ONE 4 •• o = 8 • o o o • o PRINTLINE '5 . O o o = 16 • • • • • o 6 o o o = 3 2 • o o o • o 7 o o o ... = 64 • o o o • o

• o o o • o EE Mill OUTPUT BYTE

No. 58 - March 1983 MICRO 19 issue one such byte for each vertical The Program print the characters that form the ver­ column of dots (remember, there are tical axis, and then put the printer in six of these in each normal-mode char­ Lines 1000 to 1020 perform initial graphics mode, ready to plot. acter), it is obvious that you can place a setup. B$ is the VIC-printer equivalent Line 1030 begins the outer func­ dot anywhere you want it, within the of a TAB function and advances the tional loop. YR is the Y-increment per area reached by the printhead on each printhead to the twentieth character print-line (7 dot-lines), and RV is the pass. For example, to duplicate the position. The tab is used for locating row-value of the uppermost dot-line in upper-case "A ” in figure 1 you would the vertical axis. C$ sets the printer to each print-line. Line 1040 initializes have to send CHR$ codes of 254, 137, standard-character mode. D l$ and D2$ the output array to "graphic spaces" 137, 137, 254, 128.

The printer also automatically Listing 1 990 REM takes care of buffer overflow in the 999 REM -— — — r—■ PLOTTING SUBROUTINE------graphics mode. It may take as many as 1000 B$*CHRf (I S> +CHRI (30>+CHRX 4B>1 Ci**CHR$< 15> 481 bytes of data to print one line in 1010 D1$-CHR$(17I)+CHR$(6):D2»=CHR*C123)+CHR* <0 >:SP-120 this mode (i.e., the CHR$(8) to get into 1020 0PEN1,4:PRINT#1:PRINTI1 1030 VR=V11?!FORRN=0TO49'RV«V5+ C 50-RN)#VR graphics, followed by 80 x 6 = 480 1040 FORCN-0TO300:f)J{-SP! NEXTCN data bytes), but the printer's internal 1050 IFRN~10tINT(RN/10K>5THENPRlNT#l,C#;B*;Dl*j:OOTD1090 buffer is only 90 bytes long. Therefore 1060 CN=RV-3*VI • IFRBS (CNX05*YITHENCN“0 it will print partial lines, 90 bytes at a 1070 PRINT#1 ;FDRN=1T0(19-LEN>!PRINT#1>" *j :NEXTN time, until it completes the whole line. 1080 PRINT#1,E*;B*JD2*;:CE«0 1090 FORCN=0TO299 This action is taken without any special 1100 RS=RV-FNY(XS+CNHtXI >! IFRS<0THEN1130 programming requirement. To avoid 1110 DR=INT(RS/’V I): IFDRJ6THEN1130 having space left between successive 1120 RH ■ 120+ 2 tDR '• CE“CN lines, the linefeed length is two-thirds 1130 NEXTCN of that used in the character mode. 1150 CE“CE+1:fl^(CE)«13 1160 FORCN=0TOCE!PRINT#1 < CHR$(RK(CN) > J!NEXTCN 1170 NEXTRN:PRINT#1,C*;B*;CHR$<173)J ‘ 1180 FORCN=0TO50!IFCN-10«INT(CN/10)O5THENPRINTII;:GOTO1200 Plotting with Dots 1190 PRINTtljCHR$(123)> 1200 NEXTCN:PRINT#1 Although the most common use for 1210 FORNNe5TO45STEP10:FI!=STR> :PRINT#1JMIDfCFfj2<2>; the graphics mode is to create custom­ 1220 XV=XS+£NN+0.5)JXI*6! IFRBS(XVX0.5#XITHENXV=0 ized characters (like the little monsters 1230 E*=STR* :L=LEN: IFL>10THENL*=10 you chase all over the screen in games), 1240 FORNa0TOINT<5-L/’2) :PRINT#1; '■L=LEN(TO : IFL>40THENL=40 a dot almost anywhere on a piece of 1270 FORN=lTOINT(23-L/2):PRINT#1<" ";:NEXTN paper. In the graphics mode, approx­ 1280 PRINT#1,T»;CHR*(13):PRINT#1:PRINT#1:CL0SE1 imately 98 print-lines will fit on an 1290 RETURN 11-inch-long sheet of paper — that is 98 x 7 or 686 dot-lines. You have seen that the 80-column width means 80 x Listing 2 6 = 480 possible horizontal points, so 99 R E M --- R SAMPLE CURVE-GENERATING PR00RRM on an 8 x 11 page you have available a 100 SIM RKC300) grid of 686 (vertical) by 480 (horizontal) 110 XS«-0.3:VS"-0.249:VI«.002'X>.1 dot positions — high enough resolution 120 DEF FNV(X)°SIN(X)/(X+1) 130 T*-"* - SIN(X>/CX+1>" for some very fine work. 140 G0SUB1000SEND The subroutine in listing 1 is designed to use the grid concept to create a graph of any two-dimensional Listing 3 relationship for which a VIC-BASIC DEF FN can be written. You need only 99 REM — — R SAMPLE POINT-PLOTTINO PR00RRM ---- to reserve an integer array (A%), define 100 DIM fKO00)“50THEN IN—6: GOTO 125 value and step-value (increment) for X 123 IN-6 and Y (variables XS, XI, YS, and YI, 125 VRCCN+1)-VBCCN)+IN:NEXTCN respectively). If a title is placed in array 130 T*-"TRIANGULAR MRVE" T$, it is printed under the completed 140 OOSUB1000:END graph. The routine uses only about 1600 bytes so plenty of room remains, even on a 3.5K machine, for data-entry or tape-read routines to automate the process. For example, calling the sub­ routine from the program in listing 2 produced the plot shown in graph 1. 1100 RS-RV-VRCCN)!IFRS<0THEN1130

20 MICRO No. 58 • March 1983 PRINTERS

(128J. Line 1050 determines if it's time to place a label on the vertical axis. If it is, then lines 1060 to 1080 calculate its value, strain out "zero-residuals'1 such as 1.729358E-26, and right-justify the resulting string into position. Enough room is reserved so that any legal string resulting from the STR$( ) function can be printed, even those with exponents. Lines 1090 to 1130 form the inner functional loop. For each column num­ ber (CN) you find the value of the FN Y and determine if that value lies within this print-line. If it does, make an entry in A%. Variable CE keeps track of where the last entry was made so you can truncate trailing spaces. Lines 1150 and 1160 append a carriage return and finish the line by sending A% to the printer. When all 50 lines (that is, 350 dots vertically) have been printed, then lines 1170-1200 output the horizontal axis, complete with tic marks. Printing the labelling for this axis is somewhat more challenging than the vertical, however, since you want to cen tei the number string at a given position rather than right-justify it. Lines 1210 to 1250 accomplish this, first by tabbing to the start of the allowable space for each label, then spacing over to the correct beginning point before actually output­ ting the string. This algorithm is less able to deal with lengthy labels because of restricted space, so you may want to do some intelligent rounding here. Finally, lines 1260 to 1280 center them directly in line 1100, but don't station for another micro or mainframe the caller-supplied title in double­ expect too dramatic an improvement. — one that can buffer an entire graphic width characters under the graph. Interpreted BASIC is not outstanding and plot offline. when it has to run FOR-NEXT loops (Authoi’s note: A few of the early- 15000 times. production 1515 printers do not handle Upgrading the Routine You may want to try the program in buffer overflow properly in graphics The first complaint you will have listing 3. This routine eliminates the mode. If your unit locks up occasion­ about the above example is that it is FN definition and instead loads array ally while running these routines, con­ painfully slow (figure 3 takes over 20 VA directly. Don't forget to make the tact your dealer or Commodore Cus­ minutes). Much of this is due to the accompanying change in line 1100 tomer Support.) sheer number of bytes sent to the before running. This program, which printer — each line requires as many as just barely fits in an unexpanded VIC, 330. Extra time is consumed with serial not only runs faster but also shows how References bus handshaking. point-plotting (as opposed to function- 1. VIC-20 Piogiammei’s Refeience Astute BASIC programmers also plotting) can be implemented. Guide, Commodore Business Ma­ will notice that the function FN Y is chines, Inc. and Howard W. Sams called from the innermost loop and is and Company, Inc., 1982. consequently called 50 x 300 (15000) 2. VIC-1515 Usei’s Manual, Commo­ times! Worse yet, only 300 of these Conclusion dore Business Machines, Inc., April calls produce unique values. This was A VIC-20/VIC-1515 combination 1981. done to save memory, as the storing of can produce high-resolution dot-plots 300 floating-point numbers would use comparable to dot-addressable printers over 1500 bytes — almost as much as available at much higher cost. With the Contact the author at P.O. Box 3322, the routine itself! If you have an ex­ addition of the VIC RS-232 option and a Windsor, Ontario, Canada N8N 2M4. panded VIC, you can change the code to few lines of code, the package could precalculate the values and then use become an intelligent graphic-output AlCftO

No. 58 - March 1983 MICRO 21 { I ' f

Fantastic action game for Atari*

The elite corps known as the Nightraiders are trying to bring freedom to a conquered earth. Since they are few in number, compared to the enemy, they must operate under the cloak of darkness. As the group's leader, your mission is to fly over enemy NX strongholds . . . identify targets o opportunity and destroy them thoroughly. While the invaders cannot mount an air attack after the sun has set they do have weapons of awesome pow er. . . weapons which relentlesly track your flightpath and anticipate your m ovem ents. Success does not come easy. You m ust be able to m aneuver like the crack of a whip . . . accelerate and decelerate in and out of hyperdrive . . . while carefully lining up the targets for your twin ion bombs. And always keep an eye on the special radar screen which spots enemy actiot for you. Becom e a N ightraider and meet the most fascinating S' challenge of your space career! $29.95/AtarP 400/800 with Disk Drive and |oystkk At your computer store, or from: l a 1 / ^ L J if'Cl 11 3 f^”I! I % ® J 1 a

8943 Fullbright Ave.. Chatsworth. CA 91311

V IS A M A S T E P. C A. P D'i c : s h; p p i n g n a n c:; n c c r s - g t) residents add 6' -: S3 f-~". i I V t lO - ’Atari's a registered rrac- C irc le No. 16

SOFTWARE VIC-20 SPECIALS VIC-20

FROM TRONIX A 100% machine code game with colorful DUST COVERS - $7.95 graphics, music, sound and a funny looking For Vic-20 or Vic-64 turtle to entertain your entire family! ' Waterproof NEW By Thomas Kim and Jimmy Huey ONLY J 15.95 * Brown Color ' Commodore Logo Protect your investment!

Another fast action game written entirely in machine language from Tronix. Insects invade your Vic! STAR COMMAND ' Intergalactic Combat! * Space Conflict Cassette ...... $29.95 * All Machine Language Cassette ...... $16.95

INTERESTING SOFTWARE * ™ 21101 S. Harvard Blvd., Torrance, CA 90501 (213) 328-9422 Visa/MC/Check/Money Order Add $2 00 Postage & Handling CA residents add appropriate sales tax Dealer Inquirers Invited Write for free Catalog

'Vic-20 is a trademark at Commodore Business Machines.

C irc le No. 17 D.R.S. Can Do It! Nothing else even comes close to D.R.S.—our Disk Recovery System—not Bags of Tricks,“not Dark," not Disk F ixer—nothing!

Put your dam­ INo other pro­ I Z f . No other pro­ And all of this is aged disk in one drive, gram can read disks gram types, grades totally automatic. a blank disk in the that were recorded and fixes all possible D.R.S., a step ahead other. D.R.S. will do off-center, but D.R.S. files, but D.R.S. does. of the state-of-the-art what all those other does. in Apple disk recovery guys will do...and systems. far more! -No other pro­ No other pro­ gram makes recov­ gram can read disks ered files accessible No other pro­ with errors caused by for conventional gram actually reads hub damage, but editing, but D.R.S. information from D.R.S. does. does. damaged sectors, but D.R.S. does. Available at your dealer or call us at / (612)929-7104 ' SOF/SYSi NC.) We accept VISA/MasterCard 4306 upion A»e. so. • Mpis.,55410 m n

No. 58 - March 1983 MICRO 23 Print Control for APPLE Printers by John R. Vokey and H. Cem Kaner

Automatic pagination and user- pages. After relettering these lines by PKASO board, doesn't allow resetting selectable margins should be hand and three-hole punching the pages, of the left margin. One board we've part of the printer-driver routine, you’ll note the next problem. Some of used doesn't allow control of even the but are rarely included. This the line numbers have been replaced by right margin except via a few DIP short machine-language holes. This won’t be noticeable, switch settings. This is most in­ subroutine provides formatted though, because the paper or cardboard furiating at times: where do you put output to most output devices. strip in the binder that presses the left marginal notes on program listings if edge of your output flat will hide the there are no margins on the page? If you Print Control rest of your line numbers anyway. have a Grappler or other board that can requires: Automatic pagination and user- do all the output formatting for you, selectable margin settings are easily read no further. Your interface does Apple II and printer programmed tasks for a computer or an everything that our program does ex­ ‘'intelligent" peripheral or peripheral cept for titling each page. However, if If the area where you work on your board, but are rarely included. While you use Apple's standard parallel out­ Apple looks anything like ours, you some programs, such as Apple Writer, put board or one of the majority of have a mess in need of a clean-up solu­ do an excellent job of formatting a page, other interfaces around, and would tion. Somewhere there's a heap of pro­ others do not. Applesoft’s LIST com­ prefer to spend a few minutes of typing gram listings and, perhaps, a marginal­ mand, for example, has no provision to $200 to replace the board, here's a ly tidier file drawer of folders holding for margin adjustment, except via text program to format your output. other listings and printouts. The prob­ window settings for the TV screen, lem will be worse if, in a brilliant which are ignored by the printer. As to Using the Program economy move, you buy a thermal the printers, most rightfully expect The program is reached by a CALL printer or some other printer that uses that the computer or the interface command. If you load it at location 768 rolled paper rather than fanfold. We board will tell them when to carriage ($300), setPRNT = 768. Before issuing made this mistake when equipping one return and what the margin settings the CALL, initialize your output device of the five Apples that our two labs use. should be, so there is no solution at (e.g., PR#1 for a printer connected to The rolled paper curls back into little this level either. Formatting your pro­ slot 1). Some printers and interfaces re­ scrolls, which are easily mutilated and gram listings will have to be done by quire a few other initialization com­ defy attempts at neat filing. either>the interface or by use of a patch mands, such as CTRL-I80N to allow There's an obvious and cheap to BASIC. Some interface boards, such 80-column output. A few also require means of bringing this problem under as the Grappler, do give the user con­ that at least one carriage return be control. Three-hole punch the print­ trol over the right and left margins of printed before the printer is considered outs and bind them in paper or card­ output and over the length of printed "active" by DOS. Your printer and board binders. With some gentle per­ pages and the number of blank lines left board manuals will give you initializa­ suasion [stacking about 50 pounds of between them. Most don’t. For exam­ tion details. Do the call at the point books on top of the printouts for a few ple, Grappler’s closest competitor, the where you normally start printing data days usually works) even the rolled paper can be made to lay almost flat inside the binders. Unfortunately, Table 1: FormatParameters there are a few difficulties in doing this Parameter Label Legal Range Default POKE Address and Notes for BASIC listings and printouts from Left Margin LM 0< =LM < =255 10 966. Blank lines forever if programs that do not allow formatting RM < =LM of output. Right Margin RM LM = PL The top halves of some lines appear on Page Length - 1 PL-1 ST

24 MICRO No. 58 - March 1983 instead of more printer commands. The and sets the right margin to 80 columns someone else, and want to give that general form of the PRNT call is and the page length to 50 lines. person a listing which is easier to read Once you issue a CALL PRNT com­ (or looks more professional) than an CALL PRNT,LM,RM,PN,ST,PL-1 mand, the parameters (except for page unformatted BASIC listing. number, which is updated after each A final parameter, which is not where the parameter names (LM, etc.) page) stays constant until you turn the specified in the parameter list, is the are as defined in table 1. For example, printer off with a PR#0 command. As heading to be printed at the top of each with a 132-column printer you might long as the printer (modem, whatever) page. As long as your page length is not CALL PRNT,15,117,5,10,65. Output is active, you need never call the PRNT set to 0, the page number will be would be indented by 15 blank spaces routine again. In fact, you should not printed. The program in listing 2 will |LM). The right margin would be 117 call it again without first shutting it off output this as "PAGE ";PN, where characters from the left edge |not by a PR#N command where N refers to PN is this page's number. The string margin) of the page. The page number any legal output slot. As explained "PAGE " is replaced easily, however. printed for the first page of output below, the system will hang if PRNT is In subroutine TITLEOUT, the location would be 5. Ten linefeeds would be in­ re-CALLed when it is active. If you of the title string is passed to STROUT, serted between each page of output, want to change the formatting para­ Applesoft's string output subroutine. and each page (counting the step-over meters while printing, just POKE new Currently, that string is stored in loca­ linefeeds) would be 66 lines long. parameter values into the appropriate tions $3C9 through $3CE (labelled The example above contains a lot of locations, as specified in table 1. For TITLE in the program). If you have a parameters to bother with each time example, POKE 966,15 resets the left different title in mind, simply define it you call the routine. Often your para­ margin to 15. in your program and point to it within meters won't change from one call to Changing output parameter values TITLEOUT. Only the pointer at $3A7 the next, or you might be happy with on the fly can be used to produce for­ (low byte, decimal 935) and $3A9 certain default values (such as those in matted BASIC listings, with indenta­ (937), which currently point to TITLE, table 1). You can omit specifying a new tion and spacing used to highlight pro­ need be changed. value for any parameter either by leav­ gram structure (as typically done for You can change the title and the ing out the number but typing in the Pascal listings). For example, if you pointer in a number of ways. The one comma separating it from the next have a long FOR...NEXT loop, or many we find easiest works like this: at the parameter, or by terminating the list of them nested inside others, the pro­ very start of the program (line 1) insert early with a carriage return or colon. gram structure is seen more easily if a REM containing the title you want The values assigned to these para­ the lines inside the loops are indented a printed. For example, if you w ant1 'MY meters are the ones used the last time few spaces. A very simple example of LISTING PAGE ";PN printed at the you called the routine or, if none have formatting program output is given in top of each page (where PN is the page been specified, by the default values listing 1. Looking at that program, it's number), your program's first line loaded into the appropriate locations clear that this can be a tedious busi­ would be when the program was brought into ness. You need to append a whole new memory from the disk. For example, program to your program to control the 1 REM MY LISTING PAGE CALL PRNT with no parameters leaves listing. However, tedious is preferable all parameters as they were before. to impossible. This feature comes in CALL PRNT,,80,,50 defaults the left most handy when you have a final draft Remember to put a space after 1 'PAGE” margin, the step and the page number, of a program that you've written for in the REM. You won't see it in the pro-

Listing 1: Print Control

1 REM DOUBLESPACE BETWEEN LINES COURTESY OF APPLESOFT LIST PAGE 1 2 REM ELIMINABLE IF YOUR PRINTER REVERSE LINEFEEDS 10 FOR I 1 TO 10 20 REM NESTED AT FIRST LEVEL 1 REM DOUBLESPACE BETWEEN LINES COURTESY OF APPLESOFT LIST 30 REM SO INDENT TO SHOW IT 2 REM ELIMINABLE IF YOUR PRINTER REVERSE LINEFEEDS 40 FOR J 1 TO 10 10 FOR I 1 TO 10 50 REM NESTED ANOTHER LEVEL 60 REM INDENTATION MAKES THIS CLEARER 70 NEXT J 20 REM NESTED AT FIRST LEVEL 80 REM BACK TO THE FIRST LEVEL 30 REM SO INDENT TO SHOW IT 90 NEXT I 40 FOR J 1 TO 10 99 REM BACK TO OUTERMOST LEVEL 110 REM NOW FORMAT THE LISTING OF THE PROGRAM 120 D$ CHR$ (4): PRINT D$; "P R 1 " : PRINT CHR* (9); "SIN": 50 REM NESTED ANOTHER LEVEL REM MAKE PRINTER MARGIN 1 WIDER THAN MARGIN MARGIN 60 REM INDENTATION MAKES THIS CLEARER 130 PRNT 768: CALL PRNT: REM DEFAULTS OK 140 LIST - 10 150 POKE 966,15: LIST 20,40: REM INDENT 70 NEXT J 160 POKE 966,20: LIST 50,60: REM MORE INDENT 80 REM BACK TO THE FIRST LEVEL 170 POKE 966,15: LIST 70,80: REM DOWN A LEVEL 180 POKE 966,10: LIST 90,99: REM END OF ACTUAL PROGRAM 90 NEXT I ]RUN 99 REM BACK TO OUTERMOST LEVEL

No. 58 - March 1983 MICRO 25 "■"■COiDPU SEru9Ei:.< gram, but it will be printed if you were ANDed with #$60, the result include it. would be $00. This is true for all con­

QUICK BROWN FOX $60.95 REM specifies what the new title trol characters and no others. Thus, if The #1 word processor! should be, but you haven't told the for­ you store the character in the ac­ GENERAL LEDGER $19.95 (VIC-20) matting program where to find it. The cumulator, AND it with #$60, and test CHECK MINDER title itself starts in memory six bytes the zero flag, you have a control vic-20 $19.95 c-64 $24.95 after the start of program text, as character when Z = 1. The only prob­ HOME INVENTORY $19.95 pointed to by Applesoft's pointer TXT- lem is that the AND wipes out the ac­ (VIC-20) TAB at $67,$68. For example, if TXT- cumulator in the process. You need to CENTIPOD $27.95 Like Centiped, only better! TAB holds $801 (the usual case), the M keep the character to determine if it's FROGEE $27.95 of MY LISTING PAGE starts at loca­ the code for a carriage return, in which The exciting arcade game of Frogger. MOTOR MOUSE $29.95 tion $807. POKE 8 into location 937 case tabbing to the left margin and a What a cheese'ee game! ($3A9) and POKE 7 into location 935 check on page length must be done. C R IBB AG E |$3A7) and your title, instead of the The BIT command performs an AND vic -20 $14.95 c-64 $17.95 This is the game of Cribbage. default title, will be printed at the top between the accumulator and the con­ STAR TREK of each page. tents of a memory location, setting the vic -20 $12.95 c-64 $17.95 Excellent adventure game! We should stress that the program is right flags but leaving the accumulator MASTER MIND handy for more than just producing alone. So if you can find a memory vic-20 $12.95 c-64 $19.95 listings. Often we print long tables of location holding #$60 you're in Makes you think. ROACH MOTEL $9.95 data that run for more than a page. business. Since #$60 is the machine Kill the bugs! Using this routine we can indent the code for RTS, BIT RTS1 does exactly VAHTZEE 1.1 $12.95 first column of data automatically and this job. From there you branch around VAHTZEE 2.1 $14.95 leave blank- lines between pages. Fur­ the line updating the position of the ther, we can automatically print the print head if you do have a control

TO ORDER headings for each column of output at character. P. 0. BOX 18765 WICHITA, KS 67218 the top of each page by making that our To intercept the data, your routine (316) 684-4660 "title.” For example, must count each character printed to Personal checks accepted tell when the right margin is reached. (Allow 3 weeks) or C O D. (Add $2.00) 1 REM PARAMETER LABEL LEGAL At that point, it breaks the line, car­ Handling charges $2.00 VIC-20® is a registered trademark of Commodore RANGE DEFAULT POKE ADDRESS riage returns, and tabs (inserts blanks & NOTES PAGE in the printout) to the left margin. The Circle No. 18 routine also needs to detect carriage 5SSSSSSSSSSSSSSS3SSSSSSSSSS would be used to print the column returns sent from BASIC in order to tab . 1 "‘ ■•'Ca/DPu SENSED headers at the top of each page of out­ over for the next line after these, and to put for table 1. check if a new page should be started. CARDBOARD 3 An Economy Expansion Interface To accomplish this, at some point you (Motherboard) Notes on the Piogiam Itself have to pass every character being sent For the VIC-20® Personal Two things in the program are likely to the printer through your routine, C o m p u te r to puzzle anyone attempting to under­ counting non-control characters, car­ The “CARDBOARD/3" is an expansion inter- i face designed to allow the user to access more 1 stand the code. The first is a BIT RTS1 riage returns, etc. To do this, you must than one of the plug:in-type memory or utility 1 command used at line 76. The second find out where the subroutine control­ cartridges now available. It will accept up to 3 , is our technique for intercepting data ling output to the printer, modem, TV RAM or ROM cartridges at once. For example: • 16k RAM + 16k RAM + 3k RAM sent to the printer. (or whatever device is active), is • 16k RAM + 8k RAM + Super Expander The BIT RTS1 command is a trick located in memory. After finding it, • 16k RAM + 8k RAM + Vic-Mon • 16k RAM + 3k RAM + Programmer's Aid that we ran across in the old Apple II you can either direct it to pass control • High quality T R W. gold plated connectors Reference Manual (the red one — now to your program after it's done printing • This board is fused • 90 day free replacement warranty covering out of print]. Control characters are not the character, which is rather tricky if everything except the fuse printed on the screen or on the printer, that routine is in ROM and is thus un- $39.95 so if the program counts these as modifiable, or you can find out as well CARDBOARD 6 having been printed it will force a car­ what routine calls this output routine, An Expansion Interface for VIC-20® riage return before the true right margin modify that one instead, and then pass • Allows memory expansion up to 40K • Accepts up to six games is reached. ASCII control codes are in characters to the device handler after • Includes a system reset button the range $00 through $1F (high bit you've looked at them. • All slots are switch selectable • Daisy chain several units for even more clear] or $80 through $9F (high bit set). The second approach, that of grab­ versatility To detect the codes in a straightforward bing the characters before they're $87.95 way would require three or more printed, is rrmeh simpler, due to careful TO ORDER: compare-and-branch instructions, thinking about output flexibility on the P. O. BOX 18765 which would make our routine too long part of Apple's programmers. While WICHITA, KS 67218 (316) 684-4660 E 3 to fit on page 3 of memory. Note, most device handlers are stored in Personal checks accepted however, that the ASCII codes are ROM or EPROM chips, all output is (Allow 3 weeks) or HI distinguished by having the second and directed to these handlers through a C.O.D. (Add $2} pointer in RAM called CSW, at loca­ Handling charge $2.00 third highest bits clear, whether the VIC-20'* is a registered trademark of Commodore high bit is set or not. Therefore, if they tions $36 and $37. On an Apple that

Circle No. 19

26 MICRO No. 58 - March 1983 uses only cassette tape for mass characters to the device when it's and you've just created a lovely model storage, CSW always holds the address through with them. DOS is very pro­ of a bureaucracy at work. Nothing ever of the current output device handler tective about the contents of CSW. It's gets printed this way. Instead, you have and all PRINTing is done by checking easy enough to change CSW, but if you to find out where DOS has hidden the CSW and sending character codes to do just about anything after that (turn­ true device-handier address and, before the address it contains. All you need to ing your head often seems adequate), allowing DOS to overwrite that with do, then, is to read CSW, store the ad­ you'll discover that DOS changed it HOOK's address, you have to save it in dress it holds somewhere in your pro­ back. There is no way to grab the out­ HOOK. This is what the CONDOS sec­ gram, and then point CSW at your put before DOS gets it without com­ tion of the program does. routine. Send the data to the true out­ pletely rewriting the operating system. Every time you CALL PRNT, CON­ put device on line 75 of the program, at Instead, what you have to do is to fool DOS is executed. The first thing it does JSR DOCHAR, where the address after DOS into thinking that your routine is is to find DOS itself. This changes from JSR is modified after each CALL to the correct device-handling routine and machine to machine, depending on the point to the correct routine. (Life is let it pass the data to you. Then, as amount of memory available, but CSW more complex if you use disks. I before, your routine can send it to the [almost) always points to the right Many DOS commands are issued real device. place in DOS. Now it has to find that using PRINT commands. Thus, when a The first part is easy. If you change internal DOS equivalent to CSW. Un­ program is running, you can't say sim­ CSW to point to your output checking fortunately, that's not always held in ply "PR#1''. You have to say PRINT routine (called HOOK) at $34D, then the same place, even relative to the ad­ CHR$(4); "PR#1". The printed CTRL- when DOS takes back control of CSW dress you've found, especially (we D (CHR$(4J ) is there to get DOS's at­ (using a subroutine called DOSCON, understand) with some customized ver­ tention. This is true also for commands for DOS CONnect), it stores $34D in sions of DOS being used privately. to open and close files, etc. To find the place it reserves to hold the “true" What does seem to stay constant, these CTRL-Ds, DOS has to grab each CSW value, and outputs all characters though, is a pair of locations $26 (38) character as it goes by and check if it is to HOOK thereafter. So far so good, but bytes past the start of the DOS in­ a CTRL-D. How does it do that? It where does HOOK send them? If it uses tercept routine, which holds the ad­ points CSW at itself, stores the true the CSW contents as a guide, it sends dress of the address of the device­ output device-handier address in a safe them back to DOS, which sends them handling routine. If you read the ad­ place inside the DOS code, and passes to HOOK, which sends them to DOS; dress held there, you can find the right

EVER WONDER HOW YOUR APPLE II WORKS? QUICKTRACE will show you! And it can show you WHY when it doesn’t!

This relocatable program traces and displays the actual machine operations, while it is running and without Interfering with those operations. Look at these FEATURES:

Single-Step mode displays the last instruction, QUICKTRACE allows changes to the stack, QUICKTRACE is relocatable to any free part of next instruction, registers, flags, stack contents, registers, stopping conditions, to beaddresses memory. Its output can be sent to any slot to or and six user-definable memory locations. displayed, and output destinations for all thisthe screen. Trace mode gives a running the displaySingle- ot Information. All this can be done in Single-Step QUICKTRACE is complete// compatible with Step information and can be made to stopmode upon while running. programs using Applesoft and Integer BASICs, encountering any ot nine user-definable Two optional display formats can show a sequencegraphics, and DOS. (Time dependent DOS conditions. of operations at once. Usually, the informetionoperations can be bypassed.) It will display the Background mode permits tracing with no displayis given in four lines et the bottom screen. ot the graphics on the screen while QUICKTRACE is until it is desired. Debugged routines QUICKTRACErun at near is completely transparent to the alive. norma/ speed until one of the stopping cond­program being traced. It will not interfereQUICKTRACE with is a beautiful way to show the itions is met, which causes the program to return the stack, program, or I/O. incredibly comp/ex sequence of operations that to Single-Step. a computer goes through in executing a program

P r ic e : $ 5 0 QUICKTRACE requires 3548 (SEOO) bytes (14pages) ot memory and some knowledge of machine language programming. QUICKTRACE was written by John Rogers, It will run on any Apple II or Apple II Plus computer and can be loaded from disk or tape. It is supplied on disk with DOS 3.3. QUICKTRACE is a trademark o f Anthro-D igital, Inc. QUICKTRACE DEBUGGER

Last address Disassembly Last Instruction H A A .DA #$AA

Top sew n bytes of stack Processor codes User defined location A Contents Stack ST=7C Ai 32 D5 43 D4 Cl NV-BDIZC 0000=4C

X reg. Y reg. Stack pointer Processor status Content of referenced address Contents X=9S Y=25 SP=F2 PS=10110001 [] =DD Disassembly Reference address Anthro-Digital, Inc. Next Instruction FF6B- 85 STA $33 [$0033] P.O. Box 1385 Pittsfield, MA 01202 413^48-8278

Circle No. 20

No. 58 - March 1983 MICRO 27 CSW replacement (finally). Having itself in erroneous pagination of output Some interface boards do not con­ found it, store its contents in HOOK from DOS Tool Kit's Editor/Assembler, nect themselves; i.e., do not result in (see lines 58 and 61 of the listing), and in some BASIC programs that issue the JSR DOSCON, which stores their HOOK now sends data to the routine "PRINT" commands to insert line­ address in DOS until after the first that actually prints it (or at least to the feeds, and in erroneous pagination by PRINT command after PR#N has been next intercept routine, which will pass our program. For our program the solu­ executed. Others do connect them­ the data on eventually). tion is simple: only one truly blank line selves by issuing their own "PRINT", CONDOS is how you find out is ever printed per page, so the line with or without printer-specific default where to send the data. It's also the count is off by only one. Instead of initialization commands. If you issue a basis for our caution against CALLing specifying your page length less 1 for CALL PRNT right after a PR#1 and your PRNT a second time. If DOS is point­ PL, specify the exact page length (e.g., system hangs, then your printer, ing to HOOK already, the next CALL to 66 instead of 65) and all will work well. modem, or whatever is not yet ''con- PRNT gets CONDOS working again and it will dump HOOK’s address into HOOK as the place to send data to be printed. So HOOK will JSR HOOK will Listing 2: Print Control Demo JSR HOOK will.... Don't CALL PRNT twice without issuing a PR#N (N 1 TTL 'V0KEY AND KANER, 1982' holding a slot number) between. PR#N 2 3 * * resets the DOS CSW pointer, so the 4 * PRINT CONTROL * next CALL to PRNT will find a real I/O 5 handler address in this place, as it 6 * A SUBROUTINE TO CONTROL OUTPUT TO A * 7 * PRINTER OR VIDEO SCREEN IN APPLESOFT * should. Note that PR#N shuts HOOK OQ off by rewriting DOS’s CSW address. If 9 * BY * accidentally you issue two CALL 10 * JOHN R. V0KEY * 11 * & * PRNTs in a row, RESET will get you 12 * H. CEM KANER * out of this infinite loop. 13 * MCMASTER UNIVERSITY * 14 * * For more information on the work­ 15 ings of DOS, see Worth and Lechner's 16 * Beneath Apple DOS. Also, note that if 17 * CHARACTERS AND STANDARD ADDRESSES 18 * you do not use disks, this runaround 19 0RG $300 * CHANGE ONLY THIS TO RELOCATE through DOS is unnecessary in your 20 COMMA EQU $2C * COMMA CHARACTER, HIGH BIT OFF 21 CR EQU $8D * CARRIAGE RETURN CHARACTER program (and won’t work). Rewrite 22 CSWL EPZ $36 * APPLESOFT OUTPUT HOOK CONDOS simply to point HOOK at 23 LINNUM EPZ $50 * VE USE THIS AS A TEMP LOCATION the address in CSW and to point CSW 24 CHRGOT EPZ $B7 * FETCH CHARACTER AT TEXT POINTER 25 DOSCON EQU $3EA * DOS CONNECT ROUTINE at HOOK. With the extra room gained 26 STR0UT EQU $DB3A . * PRINT A STRING in the routine, you can insert a test in 27 CHKC0M EQU SDEBE * CHECK FOR COMMA AT TXTPTR the initializing routine (where CON­ 28 GETBYT EQU $E6F8 * GET BYTE OF DATA. STORE IN X 29 LINPRT EQU $ED24 * PRINT A,X DOS is) to leave HOOK's print address 30 PRBL2 EQU $F94A * PRINT 'X' SPACES alone if CSW is pointing to HOOK 31 CR0UT EQU $FD8E * PRINT A CARRIAGE RETURN * (ADR OF C0UT1).THIS IS A DUMMY already. We'd love to build that test in 32 DOCHAR EQU $FDF0 33 * ADDRESS. ACTUAL OUTPUT ADR IS STORED 2 BYTES PAST for the DOS version as well, but PRNT 34 * 'HOOK1 AT RUN-TIME, OVERWRITING DOCHAR ADDRESS. is one of a number of programs that we 35 ft 0300 A9 04 36 PRNTCTRL LDA 4 * 5 PARAMS (0 TO 4). COUNT THEM swap in and out of memory as needed, 0302 85 50 37 STA LINNUM * IN LINNUM AS GETBYT USES ALL REGS all running from $300 up. To fit PRNT 0304 20 B7 00 38 GETVAL JSR CHRGOT * RECOVER LAST CHR IN LIST. into $300 to $3CF, we had to leave out 0307 F0 10 39 BEQ NEXTPAR * DO NEXT PARAMETER 0309 20 BE DE 40 JSR CHKC0M * MUST BE COMMA IF NOT EOL this error test. 030C C9 2C 4l CMP COMMA * NEXT CHR ALSO COMMA? 030E F0 09 42 BEQ NEXTPAR * YES, SKIP TO NEXT PARAMETER. Printer Idiosynchracies and 0310 20 F8 E6 43 JSR GETBYT * NO, STORE NEW VALUE IN X. 0313 A4 50 44 LDY LINNUM * CURRENT PARAMETER NUMBER Other Notes 0315 8A 45 TXA * CURRENT PARAMETER VALUE TO A Some printers and/or cards won't 0316 99 C2 03 46 STA PAGELEN,Y * SAVE IT. linefeed in response to a simple 0319 C6 50 47 NEXTPAR DEC LINNUM * CYCLE TILL 5 DONE 03 IB 10 E7 48 BPL GETVAL “PRINT’' command. If nothing has 031D 49 * been printed on a line, then PRINT: 031D A0 26 50 CONDOS LDY $26 * WHAT IS OUTPUT DEVICE ADDRESS? * CSWL SHOULD HOLD IT, BUT DOESN'T PRINT causes nothing, rather than two 031F B1 36 51 LDA (CSWL),Y 0321 85 50 52 STA LINNUM * POINTS TO DOS INSTEAD. $26 BYTES carriage returns on the printer. The 0323 C8 53 I NY * LATER FIND ADDRESS OF ADDRESS OF Apple Parallel I/O card connected to a 0324 B1 36 54 LDA (CSWL),Y * DEVICE, I.E. 'TRUE' CSWL VALUE. 0326 85 51 55 STA LINNUM1 * SAVE THIS IN LINNUM, TO GET Centronics 737 gives us this problem. 0328 A0 00 56 LDY 0 * THE ADDRESS ITSELF. We don't know whether this is a defect 032A B1 50 57 LDA (LINNUM),Y * AT LAST. in the card, in Apple's firmware, or in 032C 8D 4F 03 58 STA H00K2 * AND SAVE IT HERE. NOTE THE 032F C8 59 INY * SELF-MODIFYING CODE. WE HAVE the 737. (Disconnecting the printer 0330 B1 50 60 LDA (LINNUM), Y * A JSR AT H00K1 SO THIS IS from the card for testing is an incon­ 0332 8D 50 03 61 STA H00K3 * JSR TO TRUE OUTPUT ROUTINE. venience for reasons not germaine to 0335 A9 4D 62 LDA HOOK * FINALLY POINT DOS' CSWL ADDRESS 0337 85 36 63 STA CSWL * AT THE OUTPUT INTERCEPT, WHICH this article.) The problem exhibits

28 MICRO No. 58 - March 1983 PRINTERS H Q i

Listing 2 (Continued) nected.” Its address is still in CSW, where you expect to find DOS's address 0339 A9 03 64 LDA /HOOK * STARTS AT HOOK BELOW, SO VE CAN instead. In this case, RESET unhangs 033B 85 37 65 STA CSVL1 * FORMAT OUTPUT BEFORE SENDING IT. the system. Simply put a PRINT com­ 033D 20 EA 03 66 JSR DOSCON * FEED INTERCEPT ADDRESS TO DOS. 0340 67 * mand, or PRINT " ", after your PR#1, 0340 AD C3 03 68 INIT LDA STEP * GET STEP OVER before CALLing our routine. 0343 8D C8 03 69 STA LINC0UNT * SO PAGES WILL ALWAYS START HERE. Our routine assumes that Apple­ 0346 20 8E FD 70 JSR CROUT « CLEAR AND TAB 0349 48 71 PHA * DUMMY CHARACTER soft, not Integer BASIC, is the currently 034A 4C A2 03 72 JMP TITLEOUT « PRINT PAGE AND GOODBYE. active BASIC in the system. It uses 034D 73 * 034D 48 74 HOOK PHA « SAVE CHARACTER TO GO Applesoft internal routines, so it 034E 20 F0 FD 75 JSR DOCHAR « PRINT IT. REM DOCHAR IS DUMMY will not work when Integer BASIC is 0351 2C 69 03 76 BIT RTS1 « THIS TESTS IF CTRL CHAR IN ‘A1 active. To use it to print out Monitor 0354 F0 03 77 BEQ PRINT1 « IF SO, DON'T INCREMENT CURP0S 0356 EE C7 03 78 INC CURP0S * NOT CTRL CHR. PRINT MOVES CURSOR disassembly listings, type FP if you're 0359 C9 8D 79 PRINT1 CMP CR * GOT A CARRIAGE RETURN? in Integer BASIC, then CALL -151 035B F0 1C 80 BEQ PAGETEST « YES, ADJUST AND TAB. and you can use the routine from 035D AD C7 03 81 MARGINTE LDA CURP0S « NOT CR. CHECK RIGHT MARGIN 0360 CD C5 03 82 CMP RIGHT * PAST RIGHT MARGIN? the Monitor. 0363 90 03 83 BCC 0UT1 * NO, EXIT. You can use our routine to format 0365 20 8E FD 84 0UT2 JSR CROUT * DO CARRIAGE RETURN, THEN EXIT the output of many otherwise print- 0368 68 85 0UT1 PLA « RECOVER OUTPUT CHARACTER 0369 60 86 f}TSl RTS * RETURN TO CALLER. inflexible utility programs, including 036A 87 « some assemblers. In most cases it has 036A 8A 88 TAB TXA « SAVE X 036B 48 89 PHA * ON THE STACK to be reassembled to reside at an ad­ 036C AE C6 03 90 LDX LEFT « GET LEFT MARGIN INDENTATION dress that doesn't conflict with the 036F F0 03 91 BEQ D0NETAB * IF 0, NO NEED TO TAB. utility's memory use. All addresses are 0371 20 4a F9 92 JSR PRBL2 * PRINT 'X1 BLANKS 0374 68 93 D0NETAB PLA * RECOVER X defined relative to the origin in this 0375 AA 94 TAX program, so reassembly with the origin 0376 4C 68 03 95 JMP 0UT1 * AND EXIT. changed will take care of this com­ 0379 96 * 0379 A9 00 97 PAGETEST LDA 0 * COME HERE AFTER CARR.RETURN pletely. Other programs, unfortunately, 037B 8D C7 03 98 STA CURP0S * CLEAR CURSOR POSITION will not allow use of this formatter no 037E AD C2 03 99 LDA PAGELEN * RECOVER PAGE LENGTH 0381 FO E7 100 BEQ TAB « INFINITE PAGE LENGTH matter where located. For example, if 0383 EE C8 03 101 INC LINCOUNT « ADVANCE LINE COUNT you want to three-hole punch the out­ 0386 CD C8 03 102 CMP LINC0UNT * PAGELEN > LINECOUNT? put from Apple's DOS Tool Kit Assem­ 0389 B0 DF 103 BCS TAB * IF YES, DO TAB AND DONE. 038B 104 « bler without punching out the ad­ 038B A9 00 105 STEPOVER LDA 0 * SKIP LINES TO GET TO NEXT PAGE dresses printed at the left margin, buy a 038D 8D C8 03 106 STA LINCOUNT * CLEAR LINE COUNTER Grappler or similar interface board for 0390 AD C3 03 107 LDA STEP * GET STEPOVER 0393 F0 0D 108 BEQ TITLEOUT * NO STEPOVER, NO HEADING your printer. Our best efforts to date 0395 48 109 PHA * SAVE STEP have not succeeded in convincing this * 0396 20 8E FD 110 STEPLOOP JSR CROUT CARRIAGE RETURN program to talk to ours. Similarly, the 0399 CE C3 03 111 DEC STEP « DO 'STEP1 TIMES 039C DO F8 112 BNE STEPLOOP DOS Tool Kit Assembler won't allow 039E 68 113 PLA « RECOVER STEPOVER output to printers connected to the 039F 8D C3 03 114 STA STEP * AND RESTORE IT. 03A2 115 « game I/O, which is what we drive our 03A2 98 116 TITLEOUT TYA * SAVE THE REGISTERS Teletypes through. Nor will it allow us 03A3 48 117 PHA « ON THE STACK. ’A' ALREADY to vector output to printers connected 03A4 8A 118 TXA * THERE, SO NO NEED TO RESAVE IT 03A5 48 119 PHA to a communications card through a 03A6 A9 C9 120 LDA TITLE * GET LBYTE OF TITLE linefeed insertion program, which we 03A8 A0 03 121 LDY /TITLE « GOT HIGH BYTE use to drive DECWriter printers (which 03AA 20 3A DB 122 JSR STR0UT * PRINT THE TITLE 03 AD AE C4 03 123 LDX PAGENUM * GET PAGE NUMBER don't linefeed after carriage returns 03B0 EE C4 03 124 INC PAGENUM * AND ADVANCE IT FOR NEXT TIME unless they're told to). Suggestions for 03 B3 A9 00 125 LDA 0 * HIGH BYTE OF PAGE(S0 MAX255 03B5 20 24 ED 126 JSR LINPRT * PRINT IT fixing the Apple Assembler code to 03 B8 20 8E FD 127 JSR CROUT * CARRIAGE RETURN allow us to print to these and other 03BB 68 128 PLA * RECOVER REGISTERS devices would be most welcome. 03BC AA 129 TAX « RESTORE X 03BD 68 130 PLA 03BE A8 131 TAY « RESTORED Y 03BF 4C 65 03 132 JMP 0UT2 « EXIT WITH CARRIAGE RETURN John R. Vokey is an assistant professor of 03C2 133 * psychology at the University of Lethbridge 03C2 134 * PARAMETER LOCATIONS AND DEFAULTS in Alberta, Canada. H. Cem Kaner is at 41 * 66 LINES PER PAGE 03C2 135 PAGELEN DFS 1,65 McMaster University in Hamilton, 03C3 0A 136 STEP DFS 1,10 * 10 LINES BETWEEN PAGES Ontario, Canada. Together they have 0304 01 137 PAGENUM DFS 1,1 « START AT PAGE 1 BYTE, O o 46 138 RIGHT DFS 1,70 * RIGHT MARGIN 70 published articles on the Apple n in Nibble, and Compute! This is their first 03C6 0A 139 LEFT DFS 1,10 * LEFT MARGIN 10 publication in MICRO. You can contact 03C7 00 140 CURP0S DFS 1,0 « RT EDGE OF SCREEN OR PRINTER the authors at the Department of 03C8 00 141 LINCOUNT DFS 1,0 * NO LINES YET PRINTED 03C9 142 •MSB OFF USUAL FOR APPLESOFT STRINGS Psychology, University of Lethbridge, 03C9 50 41 47 143 TITLE ASC ’PAGE ' Lethbridge, Alberta, Canada T1K 3M4. 03CC 45 20 20

o o 00 144 HEX 00 « TERMINATE BYTE FOR TITLE JMCftO 03D0 145 END END

No. 58 - March 1983 MICRO 29 VIDEO TERMINAL BOARD 8 2 - 0 1 8

This is a complete stand alone Video Terminal board. All that is needed besides this board is a parallel ASCII keyboard, standard NTSC monitor, and a power supply. It displays 80 columns by 25 lines of UPPER and lower case characters. Data is transfer­ red by RS232 at rates of 110 baud to 9600 baud — switch selectable. The UART is controlled (parity etc.) by a 5 pos. dip switch.

Complete source listing is included in the documen­ tation. Both the character generator and the CRT pro­ gram are in 2716 EPROMS to allow easy modification to your needs.

This board uses a 6502 Microprocessor and a 6545-1 CRT controller. The 6502 runs during the horz. and vert, blanking (45% of the time). The serial input port is interrupt driven. A 1500 character silo is used to store data until the 6502 can display it. Features • 6502 Microprocessor 2K EPROM 2716 Size 6.2" x 7.2" • 6545-1 CRT controller RS232 I/O for direct Output for speaker (bell) • 2716 EPROM char. gen. connection to computer Power +5 700Ma. • 2716 EPROM program or modem. +12 50Ma. • 4K RAM (6116) 80 columns x 25 line display -12 50Ma.

OUT IN + 5 + 12 -12 GND. RS232 I/O

This board is available assembled and tested, or bare board with the two EPROMS and crystal. Assembled and tested #82-018A $199.95 Bare board with EPROMS and crystal #82-018B $ 89.95 Both versions come with complete documentation.

w j L John B e ll E ngineering, Inc.

ALL PRODUCTS ARE A VAILABLE FROM JOHN BELL ENGINEERING, INC. *1014 CENTER ST., SAN CARLOS, CA 94070 ADD SALES TAX IN CALIFORNIA • ADD 5% SHIPPING & HANDLING 3% FOR ORDERS OVER $100 (415) 592-8411 10% 0UTSIDE USA- SEND $1.00 FOR CATALOG ADD $1.50 FOR C.O.D. WILL CALL HOURS: 9am ■ 4pm #249

Circle No. 21 MICRO No. 58 - March 1983 Centronics Printer Driver for Your Microcomputer by Larry R. Hollibaugh

Get the most out of your With minor changes these routines can or equivalent connector, connect one Centronics-compatible printer be used with printers other than Epson. line of each pair to each signal pin. with the MX-Driver assembly- The MX-80 comes standard with a Connect the other line of each pair to language program described Centronics-compatible parallel inter­ the associated return pin. (If using rib­ here. face. Details on this interface are pro­ bon cable, alternate signal and ground vided in Appendix K of the original lines.) At AIM’s Application Connec­ MX-80 user's manual, or Appendix 0 of tor, hook up the signal lines as shown MX-Driver the Graftrax-Plus manual. The inter­ in table 1 using a Vector-type R-644 or face consists of eight data lines, three equivalent connector, and tie all the requires: handshaking lines, and several special return lines to GND. 6502 microcomputer with one printer, status, and control signals. The STROBE line (pin 1) indicates parallel port and a Centronics- Connecting the MX-80 to the to the printer that data is available, and compatible printer Rockwell AIM 65 computer through its the ACKNLG line (pin 10) signals when parallel interface is straightforward and the printer is ready to accept more data. simple. Table 1 shows the connections The 6522 VIA can be configured to han­ The Epson MX-80 printer is touted in to drive the MX-80 through Port B of dle this handshaking automatically. advertisements as the best-selling AIM's User 6522 VIA (Versatile Inter­ The software to handle the interface printer in the world. It is certainly an face Adaptor). Only the eight data lines consists of two parts: a routine to affordable dream-come-true for many and two of the handshake lines are re­ initialize the port as outputs with pro­ computer hobbyists. The MX-80 has quired for basic communication. (Use per handshaking, and a routine to been improved twice since its intro­ of the other lines is left up to the transmit characters. These functions duction, making it an even greater reader's imagination.) A cable con­ are provided by the routines CTESJIT value. These improvements come in sisting of ten twisted pairs should be and CTOUT in listing 1. the form of new ROM sets that plug in­ used between the computer and the The AIM firmware provides the to the logic board inside the printer. printer. (Ribbon cable may be used if ability to direct output to any of several The Graftrax-80 option provides bit­ the cable is kept short.) At the printer output devices. The subroutine map graphics at up to 120 dots-per-inch end, using an Amphenol-type 57-30360 WHEREO ($£871) allows selection by horizontally, by 72 dots-per-inch ver­ tically. This option adds many fea­ tures, including line spacing to n/216 Table 1: Connections between the AIM 65’s Application Connector and the MX-80’s Centronics Connector. of an inch, form length to 255 lines (original ROMs allow maximum form length of only 66 lines), slashed zeros, AIM 65 Centronics and an italics character set. Graftrax- Appl. Signal Signal Return Signal Plus is the latest enhancement to both Conn. Name Pin Pin Name the MX-80 and the MX-100. Graftrax- 19 CB2 1 19 STROBE Plus has most of the features of 9 PB0 2 20 DATA 1 Graftrax-80 as well as underline, 10 PB1 3 21 DATA 2 superscript, subscript, adjustable right 11 PB2 4 22 DATA 3 DATA 4 margin, and more. 12 PB3 5 23 Here I explain how you connect 13 PB4 6 24 DATA 5 your MX-80 printer to the Rockwell 16 PB5 7 25 DATA 6 DATA 7 AIM 65. Included are the driver 17 PB6 8 26 routines that provide access to the 15 PB7 9 27 DATA 8 many features of your printer through 18 CB1 10 28 ACKNLG the user device function of the AIM 65. 1 GND

No. 58 - March 1983 MICRO 31 issuing the OUT = prompt. Answering Listing 1: Basic Centronics Interface and sophisticated printer driver for Epson this prompt with U (for User device) MX-80 and MX-100 printers with Graftrax-Plus. Assembled to reside at the top of transfers control to the program RAM on a 4K AIM 65. pointed to by UOUT (at address $10A). LINE# LOC CODE LINE This is a vector or hook that allows ac­ 0001 EPSON MX80/MX100 PRINTER DRIVER FOR THE AIM-65 cess to a user-defined output device. 0002 BY LARRY R. HOLLIBAUGH AIM’s output subroutine OUTALL 0003 SUPPORTS TWO FORMS OF PRINTER COMMUNICATION: 0004 1. BASIC CENTRONICS PARALLEL INTERFACE ($E9BC) now also transfers control 0005 2. SOPHISTICATED PRINTER DRIVER PROVIDING 0006 0000 INITIALIZATION OPTIONS, MARGINS, LINE through this hook. 0007 0000 FEED SUPRESSION, AND SKIP-OVER-PERF The 6502's carry flag is clear for an initialization request from WHEREO, 0008 0000 AIM SUBROUTINES AND MONITOR RAM and set for character output from 0009 0000 OUTPUT -*E97A JACCUM TO D/P 0010 0000 REDOUT =*E973 ;READ KBD WITH ECHO OUTALL. If you put the address of 0011 0000 RDRUB =*E95F ?READ KBD WITH DELETE ALLOWED 0012 0000 CRLOW =*EA13 JCR LF TO D/P CTOT in listing 1 in the UOUT vector, 0013 0000 ADDIN =*EAAE ;GET FOUR DIGIT NUMBER 0014 0000 PACK =*EA84 5PACK ASCII CHAR INTO HEX BYTE 0015 0000 ADDR =*A41C ;7 ADDIN’ RESULT you will have a basic Centronics- 0016 0000 CURP02 -*A415 iDISPLAY CURSOR compatible parallel interface as the 0017 0000 DIBUFF —SA438 ?DISPLAY BUFFER User Output Device. At CTOT, the 0018 0000 ; AIM USER « 0019 0000 UDRB =*A000 ;DATA REGISTER B carry flag is first tested to see if AIM 0020 0000 UDDRB -*A002 JDATA DIRECTION REGISTER B 0021 0000 UPCR **A00C JPERIPHERAL CONTROL REGISTER wants to initialize the port or output a 0022 0000 UIFR =SA00D ;INTERUPT FLAG REGISTER 0023 0000 UIER =*A00E JINTERUPT ENABLE REGISTER character. Initialization identifies 0024 0000 ; EQUATES itself; sets up the output port with full 0025 0000 CR =*D handshaking, and sends a couple of 0026 0000 LF =*A 0027 0 0 0 0 VTAB -SB 0028 0000 FFEED =*C nulls to the printer to start the hand­ 0029 0000 ESC =*1B shaking sequence. If the printer is off­ line at this point, nothing more hap­ 0030 0000 *=*E00 pens until it is put on-line. Output goes 0031 0E00 ; PROGRAM V< to CTOUTI (the character from OUT­ 0032 0E00 LINCNT *=*+1 ;LINE COUNT 0033 0E01 MRGFLG *=*+1 »MARGIN FLAG <0=SET MARGIN) ALL is already on the stack). This rou­ 0034 0E02 LINMAX *=*+! JMAXIMUM LINES ON PAGE 0035 0E03 MARGIN *=*+1 5 MARGIN WIDTH (IN BCD) tine waits if the printer is busy, off­ 0036 0E04 TEMP *=*+1 iTEMPORARY STORAGE line, or in an error condition, and sends 0037 0E04 ACCESS TO BASIC CENTRONICS PARALLEL INTERFACE the character when ready. 0038 0E04 THROUGH THE AIM USER OUTPUT VECTOR Listing 1 provides an alternate way 0039 0E05 B0 5A CTOT BCS CTOUTI ;BRANCH ON CHARACTER OUTPUT to print text. When you put the address 0040 0E07 A0 00 LDY #CNTMS( 0041 0E09 20 92 0F JSR PMSG ;IDENTIFY SELF of MXOT in AIM's UOUT vector you 0042 0E0C EE 01 0E INC MRGFLG JDO NEXT FFEED THRU MXOUT get the MX-Driver, a sophisticated 0043 0E0F J CTINIT : INITIALIZEi n i t : PARALLEL PORT 0044 0E0F A9 FF CTINIT LDA #*FF printer driver with skip-over-perf, a 0045 0E11 8D 02 A0 STA UDDRB SALL BITS OUTPUT 0046 0E14 A9 18 LDA #*18 choice of six or eight lines per inch, the 0047 0EL6 8D 0E A0 STAUIER *,DISABLE INTERUPTS (JUST IN CASE) 0048 0E19 AD 0C A0 LDAUPCR ability to define a left margin, and an 0049 0E1C 29 0F AND #*F ;SET CB1 TO NEGATIVE EDGE DETECT 0050 0E1E 09 A0 ORA #*A0 5 SET CB2 TO AUTO PULSE MODE easy way to select the various printer 0051 0E20 8D 0C A0 STAUPCR options. The initialization calls from 0052 0E23 A9 00 LDA #0 ;SEND A NULL TO GET THINGS STARTED 0053 0E25 8D 00 A0 STA UDRB WHEREO now go to MXINIT and out­ 0054 0E29 4C 60 0E JMP CTOUT ;SEND ANOTHER, TO BE SURE

put calls from OUTALL go to MXOUT. 0055 0E2B ; ENTRY TO USE THE MX-DRIVER THROUGH THE MXINIT first calls the CTTNIT 0*56 0E2B ; AIM USER OUTPUT VECTOR subroutine discussed earlier, then re­ 0E2B MXOT BCS MXOUT ;BRANCH ON CHARACTER OUTPUT quests lines per inch with the LPI 0058 0E2D ; MXINIT : INITIALIZE THE PRINTER FOR OUTPUT 0059 0E2D 2k? k»F 0E MXINIT JSR CTINIT ;INITIALIZE CENTRONICS PORT prompt. The four legal answers to this 0060 0E30 A0 0D GETLPI LDY #LPIMSG-LITS 0061 0E32 20 92 0F JSR PMSG 5 REQUEST LINES PER INCH prompt are 6, 8, SPACE, and RETURN. 0062 0E35 20 77 E9 JSR REDOUT ;GET REPLY 0063 0E38 C9 38 CMP #'B' ;8 LINES PER INCH? Anything else makes the printer beep 0064 0E3A F0 U BEQ SETPRM 0065 0E3C C9 36 CMP #'6' ;6 LINES PER INCH? 0066 0E3E F0 0D BEQ SETPRM and the LPI= prompt is reissued. 0067 0E40 C9 20 CMP # ’ ’ ;SPACE MEANS USE OLD PARAMETERS 0E42 F0 17 BEQ OLDPRM Answering 6 selects six lines per inch, 0069 0E44 C9 0D CMP #CR 5 RETURN ALSO 0070 0E46 F0 13 BEQ OLDPRM 66 lines per page, and 62 lines of print 0071 0E48 20 5E 0E JSR BELL ;MUST BE ERROR per page (at which time a form feed is 0072 0E4B D0 E3 BNE GETLPI ;ASK AGAIN 0073 0E4D 48 SETPRM PHA ;SAVE LPI generated). Answering 8 selects eight 0074 0E4E 20 D5 0E JSR GETMRG ;GET MARGIN WIDTH 0075 0E51 20 FF 0E JSR GETOPT 5 GET OPTIONS lines per inch, 88 lines per page, and 0076 0E54 68 PLA 0077 0E55 20 2C 0F JSR SETMX 5RESET PRINTER AND SET LPI 0078 0E58 20 4F 0F JSR SNDOPT ;SEND REQUESTED OPTIONS 82 lines of print per page. SPACE or 0079 0E5B 4C 13 EA OLDPRM JMP CRLOW RETURN here ends the initialization sequence. This provides an easy way to 0E5E J BELL : RING BELL ON PRINTER continue printing from where the last 0081 0E5E BELL LDA #7 jASCII BELL CHAR printing left off. 0082 0E60 \ CTOUT : SEND CHARACTER TO CENTRONICS PORT 0083 0E60 48 CTOUT PHA The next prompt, MARGIN =, 0084 0E61 AD 0D A0 CTOUTI LDA UIFR ;GET VIA STATUS 0085 0E64 29 10 AND #*10 ;IS PRINTER READY? allows you to specify a left margin 0086 0E66 F0 F9 BEQ CTOUTI ;n o , WAIT 0087 0E68 68 PLA width in decimal. Default is no margin. 0E69 8D 00 A0 STA UDRB ;YES, s e n d c h a r a c t e r 0E6C 60 RTS The last prompt is OPTS =. Here is 0090 0E6D MXOUT SEND CHAR, WITH MARGINS AND SKIP-OVER-PERF where the real power of the MX-Driver

32 MICRO No. 58 - March 1983 PRINTERS

Listing 1 (continued) comes into play. You can select any of the escape sequences and control codes LINE #LOG CODE LINE recognized by the printer, and change 0091 0E6D 68 MXOUT PLA 0092 0E6E C9 FF CMP #*FF SIGNORE AIM’S NULL CODES 0093 0E70 F0 56 BEQ MXDUN the number of lines of print per page. 0094 0E72 48 MXOUT1 PHA To select an escape sequence, enter the 0095 0E73 29 7F AND #*7F SSTRIP MSB 0096 0E75 C9 0A CMP #LF 5 IGNORE LINE FEEDS ASCH character that follows the escape. 0097 0E77 F0 4E BEQ MXRET 0098 0E79 C9 0C CMP #FFEED J FORM FEED? (Refer to the printer manual for the pro­ 0099 0E7B D0 0C BNE MX0UT2 JNOPE 0100 0E7D AD 00 0E LDA LINCNT JALREADY AT TOP OF FORM? per codes.) For example, the combina­ 0101 0E80 D0 22 BNE MX0UT3 ;NOPE 0102 0E82 AD 01 0E LDA MRGFLG ?FIRST CHAR IN LINE? tion of emphasized and double-strike 0103 0E85 D0 ID BNE MX0UT3 ;n o , DO IT 0104 0E87 F0 45 BEQ SMF ?YES, SUPRESS EXTRAS print modes produces a high quality 0105 0E89 AD 01 0E MX0UT2 LDA MRGFLG 5TIME TO DO MARGIN? print. On the Epson ESC,E enables em­ 0106 0E8C D0 16 BNE MX0UT3 SNOT YET 0107 0E8E EE 01 0E INC MRGFLG 5 YES, CLEAR FLAG 0108 0E91 AD 03 0E LDAMARGIN phasized and ESC,G enables double 0109 0E94 F8 MRGLUP SED 0110 0E95 38 SEC strike, so typing EG (followed by 0111 0E96 E9 01 SBC #1 SDECREMENT IN DECIMAL SPACE or RETURN) sets these modes. 0112 0E98 D8 CLD 0113 0E99 30 09 BMI MX0UT3 S DONE IF PAST ZERO 0114 0E9B 48 PHA Absolute hex numbers can also be sent 0115 0E9C A9 20 LDA # ’ ’ by typing a dollar sign ($) followed by 0116 SE9E 20 60 0E JSR CTOUT ?PRINT A SPACE 0117 0EA1 68 PLA 0118 0EA2 10 Ftf BPLMRGLUP SAND LOOP two hex digits. In this way, control 0119 0EA4 68 MXOUT3 PLA codes and complex escape sequences 0120 0EA5 48 PHA 0121 0EA6 20 60 0E JSR CTOUT 5SO, PRINT IT can be sent. With Graftrax-Plus, you 0122 0EA9 29 7F AND #*7F 5 STRIP MSB 0123 0EAB C9 0C CMP#FFEED iFORM FEED? can print at 66 characters per eight-inch 0124 0EAD F0 IA BEQNEWPAG i YES, RESET TOP OF PAGE 0125 0EAF C9 00 CMP #CR S RETURN? line by enabling double-width and 0126 0EB1 F0 04 BEQNEWLIN S YES 0127 0EB3 C9 *B CMP #VTAB 5VERTICAL TAB? compressed characters at the same 0128 0EB5 D0 10 BNEMXRET SNO, WE’RE DONE 0129 0EB7 EE 00 0E NEWLIN INC LINCNT t COUNT LINE time. To do this, type W$01$0F. W 0130 0EBA AD 00 0E LDA LINCNT 0131 0EBD CD 02 0E CMPLINMAX «SKIP OVER PERF YET? sends ESC, W (double-width mode con­ 0132 0EC0 90 0C BCC SMF SNOT YET 0133 0EC2 A9 0C LDA #FFEED {YES, DO FORM FEED 0134 0EC4 20 72 0E JSR MXOUT1 trol), $01 turns the mode on, and $0F is 0135 0EC7 68 MXRETPLA 0136 0EC8 60 MXDUN RTS CTRL-0 (enable compressed). Change 0137 0EC9 A9 00 NEWPAG LDA #0 SZERO LINE COUNT the lines of print per page by preceding 0138 0ECB 8D 00 0E STALINCNT 0139 0ECE A9 00 SMF LDA #0 S SET MARGIN FLAG two hex digits with a single quote mark 0140 0ED0 8D 01 0E STA MRGFLG 0141 0ED3 68 PLA ('). This number is not sent to the 0142 0ED4 60 RTS printer but is used by the MX-Driver for 0143 0ED5 ; GETMRG : GET MARGIN WIDTH forms control. To set the MX-80 to 0144 0ED5 AD 1C A4 GETMRG LDA ADDR S SAVE ADDR eight dots per line feed, 99 lines per 0145 0ED8 48 PHA 0146 0ED9 AD IDA4 LDAADDR+1 0147 0EDC 48 PHA page, with 93 lines of print per page, 0148 0EDD 20 13 EA GTMRG1 JSRCRLOW 0149 0EE0 A0 13 LDY #MRGMSG—LITS enter A$08C$63'5D for Graftrax-80, or 0150 0EE2 20 92 0F JSR PMSG 5REQUEST MARGIN 0151 0EE5 20 AE EA JSR ADDIN 5GET IT A$08'5D for Graftrax-Plus. (With 0152 0EE8 9006 BCC MRGOK 0153 0EEA 20 5E 0E JSR BELL SSIGNAL ERROR Graftrax-Plus, the form length has 0154 0EED 4C DD 0E JMP GTMRG1 SAND ASK AGAIN already been set to 11 inches.) Be 0155 0EF0 AD 1C A4 MRGOK LDA ADDR SUSE ONLY LAST 2 NUMBERS ENTERED 0156 0EF3 8D030E STA MARGIN careful when answering this prompt, as 0157 0EF6 68 PLA SRESTORE ADDR 0158 0EF7 8D ID A4 STA ADDR+1 it does no error checking. Use the 0159 0EFA 68 PLA 0160 0EFB 8D 1C A4 STA ADDR 0161 0EFE 60 RTS DELETE key to edit, and type SPACE 0162 0EFF S GETOPT : GET OPTIONAL PRINTER MODES or RETURN when correct. 0163 0EFF A0 IB GETOPT LDY #OPTMSG—LITS Now the MX-Driver sends a form 0164 0F01 20920F JSRPMSG * REQUEST OPTIONS 0165 0F04 AD 15A4 LDACURP02 feed and resets the printer. It sets up for 0166 0F07 8D040E STATEMP S SAVE STARTING BUFFER POS 0167 0F0A A0 00 LDY #0 eight lines per inch if selected and 0168 0F0C 20 5F E9 OPT 1 JSR RDRUB SINPUT CHARACTERS 0169 0F0F C9 20 CMP #' ' SUNTIL SPACE sends the requested options. 0170 0F11 F007 BEQ OPTIN 0171 0F13 C9 0D CMP#CR SOR RETURN As characters are sent out by 0172 0F15 F003 BEQOPTIN 0173 0F17 C8 I NY SNEXT CHARACTER OUTALL, they go to MXOUT. This 0174 0F18 10 F2 BPL OPTl routine ignores the nulls ($FF) and line 0175 0F1A 98 OPT IN TYA 0176 0F1B 18 CLC feeds sent out by AIM's CRLF routine 0177 0F1C 6D 04 0E ADC TEMP SCALC TRUE BUFFER INDEX 0178 0F1F C9 3C CMP #60 SPAST END OF DIBUFF^ when in TTY mode. Be sure the MX-80 0179 0F21 90 02 BCC OPTOK 0180 0F23 A9 3B LDA #59 »STOP HERE is set up to do a line feed automatically 0181 0F25 A8 OPTQK TAY 0182 0F26 A9 00 LDA #0 with carriage return by setting switch 0183 0F28 99 38 A4 STA DIBUFF,Y JMARK END 0184 0F2B 60 RTS 2-3 ON. (See the original MX-80 user's 0105 0F2C S SETMX RESET MX80 AND SET LINES PER INCH manual, Appendix C, or the Graftrax- 0186 0F2C 48 SETMX PHA $SAVE REQUESTED LPI 0187 0F2D A9 0C LDA •FFEED Plus manual, Appendix E.) This way the 0188 0F2F 20 72 0E JSR MXOUT1 iGO TO TOP OF FORM 0189 0F32 A2 00 LDX #RESET—INITS printer operates properly whether AIM 0190 0F34 20 3E 0F JSR MXILUP NOW RESET PRINTER 0191 0F37 68 PLA is in KB or TTY mode, since the mode 0192 0F38 C9 38 CMP # ’8 ’ J8 LPI REQUESTED? 0193 0F3A D0 8C BNE MXDUN ;NO affects whether or not OUTALL sends 0194 0F3C A2 09 LDX #LPI8-INITS i SET 8 LPI, 82 LPP line feeds. 0195 0F3E MXILUP : SEND INIT PARMS TO PRINTER VIA X MXOUT will not send two suc­ 0196 0F3E BD C0 0F MXILUP LDA 1NITS.X JNEXT PWtt 0197 0F41 30 06 BMI SETLPP SQUIT ON MINUS 0198 0F43 20 60 0E JSR CTOUT ;BEND TO PRINTER cessive form feeds. This saves you from 0199 0F46 E8 INX 0200 0F47 D0 F5 BNE MXILUP ;BRANCH ALWAYS shoving out a whole blank page if the 0201 0F49 29 7F SETLPP AND #*7F 5STRIP MSB 0202 0F4B 8D 02 0E STA L1NHAX ;MAX LINES OF PRINT PER PAGE last job on the printer left the paper at 0203 0F4E 60 RTS

No. 58 • March 1983 MICRO 33 the top of a form. Margins are now in­ Listing 2 (continued) serted if indicated by the last character LINE# LOG CODE LINE having been a carriage return, vertical 0F4F ; SNDOPT : SEND REQUESTEDRI OPTIONS TO PRINTER tab, or form feed, and the character to be 0205 0F4F AC 04 0E SNDOPT LDYTEMP 5 INDEX INTO DISPLAY BUFFER 0206 0F52 B9 38 A4 NXTOPT LDA DIBUFF,Y »GET NEXT OPTION printed is sent via the CTOUT 0207 0F55 F0 3A BEQ OPTRET ;ZERO MARKS END 0208 0F57 C9 24 CMP # ’* ’ ;HEX NUMBER? subroutine. Finally, MXOUT checks for 0209 0F59 F0 04 BEQHEXNUM J YES 0210 0F5B C9 27 CMP #*27 • SINGLE QUOTE FOR CHG LINMAX"1 form feed, carriage return, and vertical 0211 0F5D D0 25 BNEESCSEQ 0212 0F5F 8D 04 0E HEXNUM STA TEMP jSAVE BYTE USE MARKER tab characters for special handling. Form 0213 0F62 A2 02 LDX #2 5 2 CHARACTERS TO PACK 0214 0F64 C8 PKBYT I NY feed zeros out the line count and flags ■ 0215 0F65 B9 38 A4 LDA DIBUFF,Y ;NEXT CHARACTER 0216 0F68 F0 27 BEQ OPTRET iZERO MARKS END for a margin. Carriage return or vertical 0217 0F6A 20 84 EA JSR PACK iPACK IT IN 0218 0F6D B0 15 BCS ESCSEQ JNOT HEX tab advances the line count, generates a 0219 0F6F CA DEX ;COUNT IT 0220 0F70 D0 F2 BNEPKBYT ;a n d l o o p form feed if the maximum number of 0221 0F72 AE 04 0E LDX TEMP 0222 0F75 E0 24 CPX # ’* ’ ;t o p r i n t e r ? lines have been printed, and flags for a 0223 0F77 F0 05 BEQ SNDBYT 0224 0F79 8D 02 0E STALINMAX j n e w m a x l i n e s PER PAGE margin. 0225 0F7C D0 10 BNE ESC1 JBRANCH ALWAYS 0226 0F7E 20 60 0E SNDBYT JSRCTOUT j SEND TO PRINTER Now you have two ways to send 0227 0F81 4C 8E 0F JMP ESC1 characters to your printer. If the pro­ 0228 0F84 48 ESCSEQ PHA * SEND AS ESCAPE SEQUENCE 0229 0F85 A9 IB LDA #ESC gram sending the characters to the Ac­ 0230 0F87 20 60 0E JSR CTOUT 5 SEND ESCAPE FIRST 0231 0F8A 68 PLA tive Output Device is doing all of its 0232 0F8B 20 60 0E JSR CTOUT ;AND NOW CHARACTER 0233 0F8E C8 ESC 1 INY 0234 0F8F 10 Cl BPLNXTOPT ; l o o p own formatting and control, or sending 0235 0F91 60 OPTRETRTS graphics or other non-ASCII, you can 0236 0F92 ; PMSG : DISPLAY 1MESSAGE FROM LITERAL TABLE VIA Y use the bare-bones Centronics inter­ 0237 0F92 B9 9E 0F PMSG LDALITS,Y 5 GET A CHAR face. Every character sent out this way 0238 0F95 F0 06 BEQ PDUN ;QUIT ON ZERO 0239 0F97 20 7A E9 JSR OUTPUT ;SEND IT 0240 0F9A C8 INY goes direcly to the printer. 0241 0F9B D0 F5 BNE PMSG S NEXT CHAR To print ASCII text that knows 0F9D 60 PDUN RTS nothing of the special requirements and 0243 0F9E 5 LITERAL TABLE capabilities of the printer, you can use 0244 0F9E LITS =* 0245 0F9E CNTMSG .BYT ’ CENTRONICS the MX-Driver to handle the basic for­ 0246 0FA0 0247 0FAB LPIMSG .BYT ” LPI=’,0 matting. Unfortunately, this involves 0248 0FAD 0249 0FB1 20 4D MRGMSG .BYT ’ MARGIN',0 modifying the UOUT vector every time 02 f/0 0FB3 00 0V*Jl 0FB9 20 4F OPTMSG .BYT ’ OPTS=’,0 0FB8

Pe r r y Pe r ipIie r aI s R e p aI r s K IMs!! (SYMs ANd AIMs Too) • We will Diagnose, Repair, and Completely Test your Single Board Computer • We Socket all replaced Integrated Circuits • You receive a 30-day Parts and Labor Warranty • Your repaired S.B.C. returned via U.P.S. — C.O.D., Cash Don’t delay! Send us your S.B.C. for repair today Ship To: (Preferably via U.P.S.) Perry Peri'pIieraLs 6 Brookhaven Drive Rocky Point, NY 11778 KIM-1 Replacement ModuUs • Exact replacement for MOS/Commodore KIM-1 S.B.C. • Original KIM-1 firmware — 1K and 4K RAM versions Replacement KIM-1 KeyboARds • Identical to those on early KIMS — SST switch in top right corner • Easily installed in later model KIMs

Perry Peripherals is an authorized HDE factory service center. Perry Peripherals carries a full line of the acclaimed HDE expansion components for you KIM, SYM, and AIM, including RAM boards, Disk Systems, and Software like HDE Disk BASIC V1.1. Yes, we also have diskettes. For more information write to: P.O Box 924, Miller Place, NY 11764, or Phone (516) 744-6462.

Circle No. 22

34 MICRO No. 58 ■ March 1983 "■■■'COflPU SENSEi: . '1 Listing 1 (continued) LINE # LOC CODE LINE C A R D B O A R D 6 0253 0FBC TABLE OF INITIALIZATION PARMS FOR GRAFTRAX-PLUS $87.95 0254 0FC0 IN ITS 0255 0FC0 IB RESET .BYT ESC,’0’ iRESET PRINTER An expansion interface for the VIC-20. 0256 0FC1 40 Allows expansion to 40 K or accepts up 0257 0FC2 IB .BYT ESC,’O ’ * RESET SOP (WE DO OUR OWN) 0258 0FC3 4F to six games. May be daisy chained for 0259 0FC4 IB ■BYT ESC, ’ C’ , 0 ,11JFORM LENGTH 11 INCHES 0260 0FC5 43 more versatility. 0 2 6 1 0FC6 00 0 2 6 2 0FC7 0B 0263 0FCB BE ■BYT 62+128 i62 ACTIVE LINES PER PAGE C A R D B O A R D 3 0264 0FC9 IB .BYT ESC,7 0’ ;6 LINES PER INCH $39.95 0265 0FCA 30 0266 0FCB D2 ■BYT 02+128 582 ACTIVE LINES PER PAGE Economy expansion interface for the VIC-20 0267 0FCC .END CARD “?” CARD/PRINT $79.95 Listing 2: Alternate printer Initialization table for Epson MX-80 with Graftrax-I Universal Centronics Parallel Printer Replaces table at the end of listing 1. Interface for the VIC-20 or CBM-64. Use an Epson MX-80 or OKIDATA or 0253 0FBC TABLE OF INITIALIZATION PARMS FOR 6RAFTRAX-80 TANDY or just about any other. 0254 0FC0 INITS 0255 0FC0 IB RESET ■ BYT ESC, ’ = ’ 5 CLEAR M.S.B. FUNCTION 0256 0FC1 3D CARDETTE 0257 0FC2 IB ■BYT ESC,’5’ ;ENABLE STANDARD CHAR SET 0258 0FC3 35 $39.95 0259 0FC4 IB .BYT ESC,’F’ iCANCEL EMPHASIZED MODE 0260 0FC5 46 Use any standard cassette player/re­ 0261 0FC6 IB -BYT ESC.’H’ ;CANCEL DOUBLE STRIKE MODE corder with your VIC-20 or CBM-64 0262 0FC7 48 0263 0FC8 12 • BYT * 12 iCANCEL COMPRESSED CHAR MODE 0264 0FC9 IB ■BYT ESC,’2 ’ ;6 LINES PER INCH L IG H T PEN 0265 0FCA 32 0266 0FCB IB ■BYT ESC,’C’,66 i66 LINES PER PAGE $29.95 0267 0FCC 43 0268 0FCD 42 A light pen with six good programs to ;62 ACTIVE LINES PER PAGE 0269 0FCE BE •BYT 62+128 use with your VIC-20 or CBM-64 0270 0FCF IB .BYT ESC,’0’ ;8 LINES PER INCH 0271 0FD0 30 0272 0FD1 IB .BYT ESC,’C ’,88 ;88 LINES PER PAGE 0273 0FD2 43 0274 0FD3 58 Prices subject to change. 0275 0FD4 D2 .BYT 82+128 ;82 ACTIVE LINES PER PA6E TO ORDER; P.O. BOX 18765 WICHITA, KS 67218 (316) 684-4660 Personal Checks Accepted (Allow 3 Weeks) you want a different interface. If you printer is reset to power-on defaults, or C O D (Add $2) Handling Charges $2.00 have a disk or a modem, etc., there is skip-over-perf is disabled (since the Circle No. 23 even more switching and potential for MX-Driver handles it), and form length mistakes. In the April 1982 issue of is set to 11 inches. MICRO [47:06] there is an article by Listing 2 shows the alternate table C64 FORTH Joel Swank entitled "AIM User Device for Graftrax-80. Graftrax-80 has a bug Arbiter'1 describing selection of multi­ in the "reset printer" escape sequence for the ple input and output devices. The UDA (ESC,@) that causes the top of form to Commodore 64 gives a DEVICE = prompt in reponse to creep. If you don't know whether or not answering the IN = or OUT = prompt your MX-80 has this bug, turn it off and with U. Joel's article explains how to back on. If the paper moves, it's got the Fig.-Forth implementation including: access the two interfaces presented bug! At RESET in listing 2 the printer is • Full feature screen editor and here, and any others you may have on reset by turning off the various modes assembler your system, by putting a single letter it could be in — M.S.B., italics, empha­ • Forth 79 Standard Commands code and a two-byte address for each sized, double strike, and compressed with extensions device handler in an output device character modes—and setting up the de­ • High resolution 320x200 pixel, table. I call the Centronics interface C fault of six lines per inch, 66 lines per 16 color graphics and the MX-Driver P. page. For those without an assembler, • Sprite graphics for control of As presented in listing 1, the MX- the only references to the initilization 32 sprites Driver works on MX-80's and table are in the SETMX subroutine. The • Three voice tone and music MX-100's with Graftrax-Plus. For offsets into the table need to be adjusted synthesizer anything else, you need to change the when the table is changed. By changing • Detailed manual with ex­ table of initialization parameters at the this table, the MX-Driver can be used amples and BASIC-FORTH end of the program. This table contains with many printers other than Epson. conversions two strings, labeled RESET and LPI8. • Trace feature for Debugging Each string ends with a byte that has Larry R. Hollibaugh has been a computer the most significant bit set. The other hobbyist for the last five years, learning by $99.95 — Disk Version seven bits of this byte are used as the building up the AIM 65 into a dedicated (Specify CBM 1540 or CBM 1541 Disk) controller development system complete $99.95 — Cassette Version default lines of print per page by the with video, disk, and printer. He is MX-Driver. The other characters at (CBM & Commodore 64 are employed as a field service technician Trademarks of Commodore) RESET are sent to the printer to reset it repairing coin-operated amusement to the desired defaults (for six lines per devices. You may contact him at 1206 S.E. PERFORMANCE MICRO PRODUCTS inch), and those at LPI8 are sent (if re­ Harney St., Portland, OR 97202. 770 Dedham Street Canton, MA 02021 quested) to set up the eight lines-per- (617) 828-1209 inch option. At RESET in listing 1 the JMCRO

Circle No. 24

No. 58 - March 1983 MICRO 35 Disk ID for Printed OSI Directories by Robert A. Paul

Utilize the open area of OS65D3 will reduce the wear and tear on the stored ID word at the end of the buffer directory sector #1 to allow disk, and will slightly speed up the filled by the first call. inclusion of diskette ID on printing process. However, the main The ID information must be put on printed directories. insight here is that you now have a the directory track as follows: location where disk data such as ID name or number can be stored, and you OK EXIT have automatic access to it when doing 01 TRACK When you use large numbers of disks, a printed directory listing without A*CA 2E79 = 12,1 it soon becomes obvious that you need making "calls" to other tracks or sec­ hard copies of the directory for each tors. The following lines will need to A*EM disk on file. Furthermore, you need to be included in any program to access EM V2.0 correlate the printed sheets directly with and print this information: the specific disk to which each refers. :@2F6F DISK !"C A 2E79 = 12,1 " While examining several of the D$ = " ” 2F6F 23 20 utilities for my OSI Superboard-MF, I FOR J = 12143 TO 12152 2F70 23 4F 0 noticed that OSI has taken utilities that D$ = D$ + CHR$(PEEK(J)) 2F71 23 53 S NEXT J were probably written for 8” disks and 2F72 23 36 6 only slightly modified them for 2F73 23 35 5 2F74 23 44 D 514 "-disk systems. For instance, the PRINT #DV,"- DIRECTORY -";D$ directory-oriented utilities contained 2F75 23 20 2F76 23 (LF) # on my 5 lA " disks all include two calls 2F77 23 31 1 to track 12, sectors 1 and 2. For 5 lA" 2F78 23 37 7 FOR I = PN TO PN + 2 4 0 STEP8 disks this is not necessary: 2F79 23 (RET) :EX If you are using a BEXEO that sup­ Track Numbers Utility Name ports up to 14-character directory A .S A 12,1 = 2E79/1 0 - 12 OS65D names, the same idea should work, but 13 track Or/w you will have to make that second call You may want to change the protec­ 14 BEXEO to track 12,2 after picking out the tion of the track 0 read/write code in track 13 by placing a 13 @ 2E80 before Total number of tracks used: 15 out of a Sample Directory going on to the changes shown for 2F6F maximum of 40. Total number of en­ and on. The next time you run a direc­ tries used by OSI: 2 of 32 available. OS-65D Ver-3.0 6-2-82 tory it will be included with OS65D3. - Directory - OS65D #17 To modify some of the utilities in­ This leaves 25 additional entries re­ volving access of the directory track in­ quired in the directory even if all the File Name Track Range formation change line 10030 to show rest of the programs on the disk are OS65D3 0 - 13 240 instead of 248 in the DELETE, only one track long. Therefore, a total BEXEO 14 - 14 ZERO, and RENAME utilities. Also, of 27 entries are needed. If the contents CHANGE 15 - 15 line 11040 in DIRSRT needs to reflect of the directory buffer are examined CREATE 16- 16 this same change, while line 10030 in after a call to track 12,1 has been made, DELETE 17 - 17 CREATE should contain 246 instead of you can see that there are spaces for 32 DIR 21 - 21 254. These changes will prevent any in­ 8-character zones including two char­ DIRSRT 22 - 22 terference with the location of your acters per name, which set the first and FILIST 23 - 23 new ID. Finally, you should eliminate last track of the program. If you stay RENAME 24 - 24 line 10130 in DIR and DIRSRT, or with the original 6-character program TRACE 25 - 25 modify the 64 in that line to a 32. names, only one call to track 12,1 will ALCO 3 4 -3 5 give you more than enough spaces for LG15 3 6 -3 8 You may contact the author at 4406 Bridle all the programs that you can access by SORT 39 - 39 Rd., Bartlesville, OK 74003. track name. Deleting the second call from the directory-oriented utilities 18 entries free of 32 JMCRO

36 MICRO No. 58 - March 1983 C ircle No. 25 Circle No. 26 OSI Disk Users CSE means OSI Software and Hardware Double your disk storage capacity Introducing 5 new disk programs W ithout adding disk drives Now you can more than double your usable floppy disk From DMP Systems: storage capacity—for a fraction of the cost of additional Superdefender ...... $14.95 disk drives. Modular Systems’DiskDoubler™ is a double­ U niverse...... $14.95 density adapter that doubles the storage capacity of Edit-all...... $19.95 each disk track. The DiskDoubler plugs directly into an De-bug ...... $12.95 OSI disk interface board. No changes to hardware or software are required. From Dwo Quong Fok Lok Sow: WP-6502 Word processor. Available in three The DiskDoubler increases total disk space under OS- versions. 65U to 550K; under OS-65D to 473K for 8-inch floppies, 5” d is k ...... $200.00 to 163K for mini-floppies. With the DiskDoubler, each 8” d is k ...... $234.95 drive does the work of two. You can have more and C assette...... $39.95 larger programs, related files, and disk utilities on the same disk—for easier operation without constant Training M anual...... $20.00 disk changes. CSE’s Rom Source Code Listing 100 Pages! . .$15.95

Your OSI system is an investment in computing power. NEW! NEW! NEW! Get the full value from the disk hardware and software ANCHOR SIGNALMAN MODEMS ...... $89.50 that you already own. Ju st write to us, and we’ll send you the full story on the DiskDoubler, along with the rest Please write for more info on new disk programs or of our growing family of products for OSI disk systems. send $2.00 for catalog. Please include $2.00 shipping ($3.00 for modems). ™DiskDoubler is a trademark of Modular Systems.

Post Office Box 16 C Oradell, N J 07649.0016 Telephone 201 262.0093

Box 50 • 291 Huntington Ave. Boston 02115 617-423-9501

UPGRADE YOUR AIM-65* INSTANTLY 'A trademark of Rockwell Inc.

INTRODUCTORY PRICE To A 6809 Development System $239. With The Plus $6 U.P.S. “ M A C H -9” And Handling From Includes:

M M S Inc. *6809 CPU Plug-in Assembly *Super-set of AIM Monitor ’Two-Pass Symbolic Assembler ’Complete Monitor Source Listings ’Enhanced Cut & Paste Editor *200 Page Manual 'Full I/O Control

“ MACH-9” is assembled and tested with local BUS, 5 locking low force ROM sockets and 2K Static RAM

MMS In c . 1110 E. Pennsylvania St. T u c s o n , AZ 85714 (602) 746-0418 VISA'

Circle No. 27

No. 58 - March 1983 MICRO 37 Attention OSI Users!

A Brand New Book...The Last Word in

OSI Information! e # J b A © , Improvements for your Ohio Scientific ” y i Computer including Machine Language 0 ( J r d S / j enhancements and BASIC Aids. TRACE BASIC programs, DEBUG machine language programs and improve your OS65-D operating system. Hardware modifications for enhanced/reversed video, programs for control code and upper/lower programs with PRINT AT, case entry, and a What’s Where in the OSI DELETE, AUTO-NUMBER and C1/C2 are just some of the useful informa­ FUNCTION INPUT. No OSI owner tion presented. Improve your own BASIC can afford to be without this book. 25 Programs — 176 Pages — Only $19.95 USE COUPON TO ORDER TODAY DIRECTLY FROM MICRO

Mail To: MICRO, 34 Chelmsford St., P.O. Box 6502, Chelmsford, MA 01824

Yes! Send me MICRO on the OSI @ $19.95 (plus$2s/h) □ Check Enclosed

Name______□ VISA Address. □ MasterCard

C ity____ . State. ■ Zip Or Call Toll Free: 1-800-345-8112 Card# Expires. (fn PA 1-800-662-2444) I I MA residents add 5% sales tax. Allow 6-8 weeks for delivery. J

38 MICRO No. 58 - March 1983 APPLE PRINT-USING Routine by Celestino R. Monclova

A machine-language routine to The second mask, "TOTAL TO use of the presently unused input buffer simulate PRINT-USING from DATE $$,$$$,$$$.0000", demon­ page. If you want to defer printing after Applesoft BASIC, strates dollar sign or any character fill. the CALL instruction to do INPUT, or The fill characters still suppress the un­ save the newly edited string for reuse, needed commas, and the zeros after the then you must save it from its volatile PRINT-USING decimal point are not limited to two. In position in the input buffer by assign­ requires: fact, you don't even need a decimal ing it to another variable: Y$ = point, as shown in the third and fourth MID$(X$,1). Listing 3 is a short pro­ Apple II with Applesoft masks, "TOTALS " and gram demonstration. The BASIC listing "TOTALS $$$$$$$$$$$$". Nor do dependsyou upon the PRINT-USING rou­ When called from BASIC, this need zeros after a decimal point (mask tine to align the numbers into columns machine-language routine has the cap­ five, “ *'). as previously demonstrated, and can be ability of merging two string variables The last mask, "TOTALS...... ,..., considered an extended application for (a mask string and a data string] with ....00", shows flexibility by using the machine-language routine. the following options: decimal point fill. Lines 600 and 625 set up X$ and The BASIC interface to this routine read in the English words from the 1. Fixed decimal points and commas is the technique that assigns X$ = " '' data strings at lines 1000 and 1002. 2. Fixed dollar sign and text at the beginning of your BASIC pro­ Line 745 sets up the conversion mask 3. Asterisk or dollar sign fill gram. Later, when you are ready to edit that is interpreted by X and Y in the fol­ 4. Floating dollar sign your data, you must first assign your lowing manner: mask X$ = "totals , , .0 0 ". The Options 1, 2, and 3 are controlled by mask must be reassigned each time you X$="000000.00" the way you set up your mask string edit. This is because the mask is modi­ X = 0 1 and may be used in any combination fied and not your data string. Y = 0 12 0 12 with option 4, which is handled by Next your data string is defined as appending your' 'float'' character to the any string variable available to BASIC. Thus, the X,Y FOR NEXT loops inter­ data string — all in BASIC. If you have a numeric variable, then pret the data string from the A$ and B$ On the mainframe computer, the use the instruction "Y $ = STR$ (XJ'' arrays. By extending the mask and floating dollar sign and asterisk are where X is the variable you wish to including a C$ string, conversion can handled by setting hardware flags. By edit. No check is made on the numeric be easily expanded to many times the eliminating the need for flags in this quality of this data string, so an in­ national debt. machine-language code, I feel I have struction like 1 *Y$ ="$” + STR$(X)” The machine-language routine improved upon the mainframe version will give you the floating dollar sign. starting at location $6D00 is totally by allowing any and all ASCII charac­ After X$ has been assigned as the relocatable to any other unused page in ters to float and/or fill. first variable at the beginning of your memory. Lines 2 through 12 locate the Included with the assembly listing BASIC program and the machine- mask X$, move its length to $1A, and is a short program that displays a set language routine has been loaded, the start adding to locations $8 and $9. array of number-strings and the result actual usage could be: Line 5 also stores the length in location when they are combined with various $1C, if there is no decimal point found. user masks, which are keyed into this 100 X$ = ‘‘***,***.00” : CALL 27904Y$ Moving X$ to page $200 resolves routine. The first mask, "TOTAL : PRINT X$ several problems. The first problem is AMOUNT IS $ , , .00” , dem­ how to keep track of all the necessary onstrates the prime use of this routine The lack of space, comma, or colon pointers. Locating the beginning of the and options 1 and 2 above. The data between the CALL and your data name mask at $200 eliminates that pointer. strings show that the unused commas is important. The second problem, as some of the ex­ will be suppressed. The mask is not This routine, which converts amples demonstrate, is how to keep the limited to numeric characters only. numeric strings into English, makes data string, when it overlaps the mask (continued on pg. 41)

No. 58 - March 1983 MICRO 39 Circle No. 29 ANIMATION Listing 1 6000 1 ORG $6D00 6000 2 OBJ $800 GRAPHICS 6000 A002 3 LDY #2 6002 841B 4 STY $1B 6004 B169 5 LDA ($69),Y *FIND X$ ILLUSTRATOR'S 6006 891C 6 STA $1C *SAVE LENGTH 6008 851A 7 STA $1A 6O0A C8 8 INY LIBRARY 6D0B B169 9 LDA ($69),Y 6O0D 8508 10 STA $8 *AND ADDRESS (H) 6D0F C8 11 INY 6010 B169 12 LDA ($69),Y 6012 8509 13 STA $9 *AND ADDRESS (L) 6014 A000 14 LDY #0 6016 15 *FIND X$ ".’’WHILE MOVING TO $200 6D16 Bl«8 16 PERIOD LDA ($8),Y 6D18 C92E 17 CMP #$2E 601A D M 2 18 BNE HOVE 6D1C 84lC 19 STY $1C 6D1E 990002 20 HOVE STA $200, Y 6021 C8 21 INY 6D22 C41A 22 CPY $1A 6024 90F0 23 BCC PERIOD 6D26 24 »H0VED WITH PERIOD AND POINTER AT $1A 6026 25 ‘GET DATA AND FIND 6D26 20E3DF 26 JSR $DFE3 *FIND DATA ADDRESS 6029 A000 27 LDY #0 6D2B B183 28 LDA ($83),Y 6D2D 8587 29 STA $87 6D2F C8 30 INY 6030 B183 31 LDA ($83),Y 6032 8585 32 STA $85 6034 C8 33 INY 6D35 B183 34 LDA ($83),Y Introducing A.G.I.L 6D37 8586 35 STA $86 Graphics software developed for the professional 6D39 A000 36 LDY #0 6D3B B18537 ALIGN LDA($85),Y is now available for your Apple Computer. A.G.I.L 6D3D C92E 38 CHP #$2E for your Apple allows you to create and animate 6D3F F007 39 BEQ FOUND Hi-Res images with sound and color using a 6D4l C8 40 INY joystick or a tablet with total Applesoft compatibility. 6D42 C487 41 CPY $87 6044 30F5 42 BHI ALIGN MENU DRIVEN, ERROR-PROOF AND FLEXIBLE. 6D46 A487 43 LDY $87 6D48 8419 44 FOUND STY $19 PAINT PROGRAM—Draw on 2 Hi-Res pages with 6D4A A51C 45 LDA $1C over 100 colors and textured brushes. Add text 6D4C 38 46 SEC with the built-in graphics word processor system. 6D4D E519 47 SBC $19 Save, load and copy to disk. Support graphics 6D4F 851A 48 STA $1A printers, video digitizers, joystick and graphics tablets. 6051 49 ‘OFFSET FROH 200 FOR USER DATA 6D51 A487 50 LDY $87 6D53 88 51 COMMA DEY ANIMATION EDITOR—Create a Hi-Res animated 6054 B11A 52 LDA ($1A),Y sequence with color and sound. Use the unique 6056 C92C 53 CHP #$2C ANIMATED SLIDE SHOW module to automatically 6D58 D002 54 BNE MOVZE replay multiple sequences in any order. 6D5A C61A 55 DEC $1A 6D5C B18556 HOVZE LDA ($85),Y SHAPE/FONT MAKER EDITOR—Create multi-colored 6D5E 911A 57 STA ($1A),Y shapes easily. Disassemble and edit ANY shapetable. 6060 98 58 TYA 6061 O0F0 59 BNE COMMA Use with A.G.I.L PAINT to "cut" shapes out of 6D63 60 »CLEAR REMAINING COMMAS either Hi-Res screen. 6063 A41A 61 LDY $1A 6065 A900 62 LDA M Special Introductory Prices: 6067 851A 63 STA $1A 6069 B11A 64 SKIP LDa ($1A),Y PAINT PROGRAM $139 6D6B C92C 65 CHP #$2C *"," ANIMATION EDITOR $89 6060 F006 66 BEQ CLEAR SHAPE/FONT MAKER EDITOR $59 6D6F C940 67 CHP #$40 6071 100B 68 BPL END 6073 3006 69 BHI END01 6075 88 70 CLEAR DEY (703)471-0740 6D76 B11A 71 LDA($1A),Y Applesoft and Apple Satisfaction Quaranteed 6078 C8 72 INY are trademarks ot VISA & Master Card WdcOfM 6079 9llA 73 STA ($1A),Y Apple Computer, inc. Ontof't Inquiries Invited 6D7B 8874 END01 DEY 6D7C D0EB 75 BNE SKIP 6D7E A003 76 END LDY #3 6080 A900 77 LDA IN) 6082 9169 78 STA ($69),Y 6084 C8 79 INY 6D85 A902 80 LDA »2 6D87 9169 81 STA ($69),Y A.G.I.L. is a product of 6089 60 82 RTS Animation Graphics, Inc. 11317 Sunset Hills Road, Reston, Virginia 22090

40 MICRO No. 58 - March 1983 (continued fiom pg. 39) through 36 locate the data string and on one end or the other, from destroy­ save its length at $87 and its address ing adjacent strings in variable memory at $85,$86. A h a ro esto f (more pointers?). The third problem in­ Subroutine ALIGN at line 38 volves scanning the mask string to find searches forward on the data string for savings from the decimal point. Moving and iso­ its decimal point. Finding none at line lating it does not cost much processing 44, it defaults to the right end. time, and the space is available anyway. Now that you have located the data Starting at line 16, the subroutine decimal point at FOUND, compute in­ called PERIOD moves X$ to $200 and, to $1A the left starting position of the AppleyC& Thee at the same time, records the last data string over the mask string. How­ period at location $1C. Lines 27 ever, if you start moving the data string at the $1B left end, you will miss out Electronics on a lot of other goodies. Location $1A-$1B (set up at line 3) is the pointer SOFTWARE APPLE-ATARI- TRS80 ■ IBM Listing 2 to the left-end position of where the data string should start. Loading the Y A full line of software for business, games register with the length at $87 gives end education u p t o 3 5 % o f f ! 10 X$ = REM FIRST VARIABLE MUSE KJS 50 PRINT CHR$ (4)"BL0AD PRINT U you the first data character at the right VISKIOKP STONEWARE SING" end. There is plenty of room in mem­ ONLINE SYNERGISTIC 100 FOR X = 1 TO 10; READ Y$(X): ory if this position should overlap the NEXT EDO-WARE HAYDEN 150 INPUT Y$: REM GET DEMO MASK mask string. HOWARD AND MANY MORE 200 FOR X = 1 TO 10:X$ = Y$: CALL Subroutine COMMA starts the 27904Y$(X) 250 PRINT X$" "Y$(X): NEXT move by first checking the receiving HARDWARE 300 GOTO 150 position of the mask for a comma. AMDEK-HAYES - MICROSOFT 350 DATA 12345678,123456.8,1234 Finding none, it jumps to MOVZE and 5.78,1234.678,123.5678,12.45 F R A N K L IN C O M P U TE R 678,.01234567 moves the rightmost data bytes to the 400 DATA .00012345,$12345.78,$12 mask. If it finds a comma in the mask SYSTEM 3.5678 area before finishing the data string, A C E 1 0 0 0 • $1,795.00 this loop decrements the memory pointer at $1A to skip it and stores the DISKS Maxt-ll Dox of 10 5 V . SSDD $35.00 Listing 3 data with MOVZE anyway at the next mask location. Verbatim Box of 10.5 SS-DD $29.00 Clean-up involves checking the re­ maining length of the mask for com­ MONITORS 600 X$ = DIM A$(20) 610 PRINT CHR$ (4)"BL0AD PRINT mas — namely, from whatever length LE MONITORS List Our Price USING" is left in $1A to zero. If it is a comma, T" Git-en 518000 $159.00 625 FOR X = 0 TO 19: READ A$(X): then CLEAR uses as the fill character 12" Green 5199.00 $169.00 NEXT : FOR X = 0 TO 9: READ ZENITH B$(X): NEXT whatever character is in the mask that 12" Green 5179 00 $129.00 700 INPUT Z$ preceeded the comma. 730 X$ = "$,$?$,$$0.00": CALL 279 Plus a full l*r> ol AMDEK Monitors 04Z$: PRINT X$: PRINT Line 67 checks for any characters in 745 X$ = "000000.00": CALL 27904Z the mask. This ensures that commas in PRINTERS $: IF VAL (Z$) < 1 THEN PRINT A$(0)" : GOTO 790 the mask are not cleared (i.e., a mask of PAPER TIGER List Our Price 750 FOR X = 0 TO 1:S = 0:Z = 0: FOR X$ = ‘ ‘TOTALS, , .0 0 "). This 460G $1,094.00 $950.00 Y=0TO2:IFZ>9 THEN 780 keeps the comma after the word 560G SI 3 1 THEN 775 dress of the new X$ to $200. The length 765 IF Z < >1 THEN PRINT B$(Z '■AX iOOFT $945.00 $795.00 )" GOTO 780 remains the same and you return to the 770 Z = 10 + VAL ( MID$ (X$,X * BASIC program. CALL FOR THIS MOffTHSSPECIAL! 3 + 3,1)) 775 PRINT A$(Z)" IF Y = 0 THEN 18008352246EXE 211 PRINT B$(0)" 780 NEXT : IF S > 0 AND X = 0 THEN 702-4594114 PRINT B$(l)" "; 785 NEXT 5130 East Charleston Blvd. 790 PRINT "AND " RIGHT$ (X$,2)"/ Suite 5Mi Mr. Monclova is a systems programmer Las Vegas, ftevada 89122 100" 795 PRINT : GOTO 700 for a large, diversified computer user in Phone orders welcome. Mail orders may send 1000 DATA ZERO,ONE,TWO,THREE,F0U Manhattan. You may contact Mr. charge card number (include expiration date), R, FIVE,SIX, SEVEN,EIGHT,NINE, Monclova at 229-03 129 Ave., Laurelton, cashiers check, money order or personal check TEN, ELEVEN, TWELVE, THIRTEEN, F (allow ten business days for personal or com NY 11413. pany checks to clear). Add $3.00 for shipping, OURTEEN, FIFTEEN, SIXTEEN, SEVE handling and insurance. Nevada residents add NTEEN, EIGHTEEN, NINETEEN, HUND AICRO' 5.75X sales tax Please include phone number RED, THOUSAND,TVENTY, THIRTY, F All equipment is in factory cartons with manu­ OURTY, FIFTY, SIXTY, SEVENTY, El facturers warranty Equipment subject to price GHTY, NINETY change and availability. Call or write for price list

Circle No. 30

No. 58 - March 1983 MICRO 41 A Full Byte for Your APPLE Printer by Mark J. Boyd

Many modem printers use an put. The wire can be easily routed from socket and the header. Pin 14 is the 8-bit code, but most Apple the interface card to the game I/O third pin up on the left-hand side of the printer interface cards can send socket without interferring with other socket when viewed from the front of only 7-bit ASCII code. This peripheral cards. the Apple. This method leaves the article shows an easy way to The annunciator outputs are eon- game I/O connector free for other use. add program control of the trolled by accessing certain locations in A simpler way, and the one I used, is to eighth bit to allow full use of memory. There is no actual memory at solder a small-diameter insulated solid your printer. those locations, but trying to read or wire to the interface connection (the write it sets what Apple calls "soft non-grounded side of the jumper on the switches" (TTL flip-flops). For AN1, Epson; the left-hand side when viewed which I used, the locations are -16293 component side up). The other end of Full Byte (to set it high) and -16294 (to set it this wire can be plugged directly into requires: low). When sending a control sequence the game I/O socket. You can avoid to set the printer for a spacing of N, soldering by using a jumper wire with A pple II, a printer, 1/72-inch increments per line, use the insulated miniature alligator clips. Clip and a one-wire modification following code: one end to the non-grounded side of the jumper after you cut it, and clip the ? CHR$ (27) “A";: POKE -16293,0: other end to a short piece of bare wire (a This article is for the many Apple users ? CHR$ (N);: POKE -16294,0:? CHR$ V4 w resistor lead will work) inserted who have a printer connected to their (27) '-2” into the game I/O socket. Be very sure computer by an interface that sends the alligator clips cannot come into only 7-bit ASCII codes. Specifically, I The first POKE sets bit 8 high. This contact with any other circuits. If you discuss the Epson MX-80 and the Epson causes the interface to actually send use either of these latter two methods, Apple interface, but other interfaces CHR$ (N+128), as required by the you will have to remove or bend out the can be modified in a similar manner, printer. The second POKE sets bit 8 corresponding pin on any game I/O and other printers can make use of the low again so the second ESC sequence plugs you use. full 8-bit code. For the MX-80, use of is sent properly. After deciding on the method to use bit 8 means block graphics and full con­ The best way to make the connec­ and attaching the wire to the interface trol of line spacing. tion is by soldering a 16-pin DIP header card, you should check this connection To gain control of bit 8, which is to a 16-pin DIP socket. The wire to the before making the connection to the normally held low by the interface interface then can be soldered to the game I/O socket. Replace the interface card, you must find a TTL output that AN1 connection (pin 14) between the card in your Apple and connect the can be controlled from your programs. The Apple II has four such outputs, called annunciator outputs, located at Listing 1: Modifications to Taylor’s Routine the game I/O connector. Two of these 942B: 20 A4 94 ; JSR to new setup location outputs, ANO and AN1, are set low on 955D: 20 9D 94 ; JSR to offset routine power-up or reset. This is just what you 958E; 20 9D 94 ; JSR to offset routine need, since bit 8 should be low for nor­ 949D: 18 69 20 mal use of the printer. 94A0: 20 02 C1 60 A2 C1 A9 09 ; New routine, adds 32 to You must connect the annunciator 94A8: 9D B8 06 A9 FF 9D B8 04 ; Graphic character value output to bit 8 on the printer interface. 94 BO: 9D 38 06 A9 00 9D B8 05 ; Turn on interface, etc. On the Epson interface card this bit is 94B8: 20 EA 03 A9 OF 20 02 C1 ; (as in Taylor’s routine) normally held low by a jumper to 94C0: 8D 5B CO 60 ; I NIT printer for compressed ground. All you need to do is discon­ Print and set bit 8 high nect it from ground and connect it with a piece of wire to the annunicator out­

42 MICRO No. 58 - March 1983 printer. When you power up your sys­ routine, followed by the new setup rou­ tem, leave the other end of the new tine; and redirect the graphics output Listing 2: EXEC File Maker wire unconnected. Turn on the printer, characters through the offset routine. I enable the interface, and try printing couldn't find enough room to add a some text. It should print as graphics printer/computer reset routine without 10 D$ = CHR$ (4) characters. Now ground the wire by reassembling Mr. Taylor's program, so 20 PRINT D$“ OPEN SP" holding the stripped end against the you’ll have to reset both the computer 30 PRINT D$"WRITE SP” power supply. Text should print nor­ and the printer after running it. 40 PRINT "HIMEM: 37760” mally. If this connection is made prop­ After checking your entries again 50 PRINT "BLOAD SPRINT” 60 PRINT "RUN SCREEN PRINT erly, you cannot harm the Apple by (you can't be too thorough when check­ 70 PRINT D$“ CLOSE SP” plugging it into any of the game I/O ing machine-language entries), BSAVE 80 END sockets. If it is not connected properly the routine (A$ 9400, L$ 196). The pro­ (say you connected to the ground side gram can print either screen (see instead of the bit-8 side of the cut Taylor's article), so get a screen or two jumper) you might damage the chip into memory and check it out. Turn that drives the annunciator outputs. your printer off and set the paper to top Once you are convinced that every­ of form before running. The program first program, SP CREATE, should be thing is OK at the interface end, turns on the interface (in slot 1), so all loaded and run to create an EXEC File, turn off the Apple and make the con­ you need to do is set the paper correctly, SP. SP sets HIMEM, BLOADs SPRINT nection to AN1. Now turn on your turn on the printer, and run it. A screen (my name for the screen printing system and print some text. Everything fills a normal-sized page and takes routine), and RUNs SCREEN PRINT. should work normally. If not, shut it about five minutes to print. SCREEN PRINT ;takes care of screen down and check your connections be­ Before you entered Taylor's pro­ selection, displays the chosen screen, fore proceeding. gram, you were told to set HIMEM to allows you to print a title above the Next POKE - 16293,0 to switch bit 37760. In the future, before you screen, and resets the printer and com­ 8 high. Print a line of text to verify that BLOAD it you must always set puter when it is finished. the printer is printing graphics charac­ HIMEM. If you plan to call this routine ters. Finally, POKE - 16294,0 to set bit from a BASIC program you should set 8 low again. Everything should be back HIMEM and BLOAD it first, then load .to normal and you now have a full 8-bit the calling program. The calling pro­ interface for your printer! gram should reset the printer (turn off Mark Boyd teaches at a small four-year compressed print, reduce the line liberal arts college. His interest in Now use the interface to print the computers began when he was an HGR screen on the MX-80 (other width back to normal) and set bit 8 low undergraduate taking a FORTRAN systems with TRS-80-compatible after calling the routine. programming course. You may contact Dr. graphics also will work, but probably For stand-alone use, I am including Boyd at St. Mary oi the Plains College, Dodge City, KS 67801. you will have to change the offset value a couple of BASIC programs that allow you to "EXEC SP" and follow the in­ for graphics character set and the JMCftO printer initialization). Charles Taylor's structions given on the screen. The article, "Apple Graphics for Okidata Microline 80," (MICRO 48:48) in­ spired me to get control of bit 8 on my Listing 3: Screen Print Listing interface. His assembly-language pro­ gram needs only minor modification 4 REM SETUP CTRL-D,CTRL-I, AND TURN OFF INTERFACE BOARDS 3 D» - CHR» (4)IP* - CHR* <9)1 PRINT D*''PR#0" for use with program control of bit 8 (he 10 TEXT 20 HOME i REM CLEAR SCREEN used a switch) and the MX-80. 30 PRINT TAB( 4)|''SCREEN PRINT PROGRAM - PLEASE TURN” Enter Mr. Taylor’s assembly-lan­ 31 PRINT TAB( 12)|"0FF THE PRINTER" 40 PRINT "LINE UP THE TOP OF THE FORM (PERFORATIONS) WITH THE PRINT HEAD. guage program in hexadecimal, using NOW TURN THE PRINTER ON AND MAKE SURE THE READY LIGHT IS ON. the Apple monitor memory-load func­ 43 FOR I • 1 TO 50001 NEXT I REM WAIT FOR USER TO READ PROMPT 43 PRINT PEEK ( - 16297)| PEEK <- 16302)1 REM SETUP FOR HSR tion (page 44 in the Apple II Reference 49 HOME 30 INPUT "WHICH SCREEN DO YOU WANT? (1/2)"|A» Manual.) You can check your entries 32 IF A* ''2" THEN 54 most easily with the L command. Since 33 PRINT PE E k - 16300)1 GOTO 55l REM SELECT SCREEN 1 54 PRINT P E E K ( - 16299)1 REM SELECT SCREEN 2 the entries must be correct and entry is 35 PRINT P E E K ( - 16304)1 FOR I ■ 1 TO 20001 NEXT I TEXT I REM DISPLAY S C R E E N tedious, check things as you go along. 56 HOME l INPUT IS THIS THE SCREEN YOU WANT? (Y/N)"|E» 57 IF E* < > "Y THEN 49 It's terrible to finish entering a few 60 INPUT "DO YOU WANT A TITLE PRINTED? (Y/N)"j B» hundred hexadecimal pairs of numbers 70 IF B* < > "Y” THEN 90 50 INPUT "PLEASE ENTER THE TITLE.">C» only to discover you entered an extra 90 HOME byte early on. 100 IF B» < > “Y" THEN 130 110 PRINT D»"PR#l"i PRINT P^'BON"I REM TURN ON THE PRINTER INTERFACE AND After you have entered and carefully SET FOR SO COL 120 PRINT TAB( (SO - LEN ) / 2>|C»i REM PRINT CENTERED TITLE checked Mr. Taylor's program, make 130 IF A* < > "1“ THEN 150 the entries shown in listing 1: relocate 140 CALL 37S001 REM PRINT SCREEN 1 150 IF At < > "2" THEN 170 the start of the printer setup routine to 160 CALL 379041 REM PRINT SCREEN 2 170 POKE - 16294,01 PRINT CHR» (127)1 PRINT P»"I"l PRINT D»“PR#0,,| REM make room for the offset routine; re­ RESTORE NORMAL SETTINGS place the setup routine with the offset ISO END

No. 58 - March 1983 MICRO 43 SSSST ----

3. 120 individually address are inch; giving ^xcjepjtional shies and Specif) characters LICATIONS PACKAGES— display fonts can be Good news fojr microsystem and lented with ah extensive line Df MPI computer users! MPI led AP-PAK appli- printers with excellence in price a dirjg bp^cUilizjedj fohts mance. The two ]'N' yersiops jof arjd picpjrfe jjraphifcs- 1150 feature;a factory installed j‘S< uch as logos may be front panel keypad, with efined and editfed for printing directly Print.Mate1'11 50 model AI puter. j j j ; j on m odel A;2. iPrsntMate™ 15 0 m E FEATURES— Only Print- I ' and;B2 are factory equipped with a 2I< 50 offers so many ways to get your 16I< buffer, respectively. Print.Mate1'11 acjoss: grapHicsj; display fdnts; ; models have an exceptional set of out loadable character sets: high print j standing graphics and font capabilities spebdj advanced logic seeking; 1:5 inch w ide optional expansion, and other advanced carriage; a variety of forms and: paper capa- I features that differentiate the PrintiMdtei™ , bilitiesjand; W ^ndly :'‘SjOftSwiitchT' ' ' ’ inter- 150 from its com petitive ;rivalsjas; the i attioniThe PrintMate7'1 150 isthe responsive superior performer. A bold claim? The performer that perfectly mates with your strong and widespread acceptance of the may be added to the PrintMate mictosystem or personal computer. With excellent PrintMate™ 150 is based on ; EXPA “ ------prices beginning at $ 9 9 5 :, it is evident that outstanding user features: 150 m odels A 2 the :PrihtMateT!" ! 50 is the superior performe HIGH SYSTEM THRUPUT- 150 charac­ installed I6K bu in function and price. ters per second advanced iogic seeking i model AI and the Stahdarc impact; printing with an accelerated print head Bl are optionally e; The Printer People slew rate and turnaround makes Print.Mate"'1 to 16K. The PrintM 150 a high speed performer. buffer allows application extensions! fdr high WIDE CARRIAGE VERSATILITY—The Print- speed interleaved pririting and spobling Mate™ 15 0 s wide carriage (pan accommo­ greatly improving the host computer's per date print lines from 136 to 2 3 1 characters formance in applications that are b ou nd. in length and can easily handle forms from DOWNLINE LOADABLE FONTS—The Micro Peripherals, Inc. 3 to 15 inches w id e and as long as 3 1 powerful microprocessor based command 4426 South Century Drive inches. set of the PrintMate™ 150 allows a custom LARGE SELECTION OF PRINT CAPABILITIES character set to be developed in the host Salt Lake City, UT 84107 —The 7x9 dot matrix allows user selection computer and downloaded to any Print -1 Phone 1-800-821-8848

Circle No. 31 The

Atari 800 Texas Instrument LEARNING CENTER

Features:

• BANNER: A Display Program for the Color Computer by Bryan Christiansen This “ticket-tape” program, written by a 15-year- old high school freshman, displays any message of your choice on a scrolling screen.

• DIGI-DRAFT by Tim Kilby “ DIGI-DRAFT” is a graphics program that allows images to be drawn on the screen with convenient commands

• The Computer Revolution Reaches Out to the Community by Emmalyn H. Bentley MICRO Calc for the VIC-20 A look at the new Microcomputing Learning by Loren Wright Center in Nashua, N.H. — who is enrolling, what A computer worksheet program that allows you courses are offered, and how the Center is to define a series of calculations and preform contributing to the community as a whole. them at the touch of a key.

No. 58 - March 1983 MICRO 45 PUT THE FULL POWER OF YOUR VIC-20 AT YOUR COMMAND! Order your copy of MICRO’S newest book... MASTERING YOUR VIC-20 Ik. with eight BASIC projects

fr'-'Jpfr'’ IK You’ll Receive:

M I C R O C d IC ...a miniature spread­ sheet program that makes complex, repetitive calculations a

+ M A S T E R . . . a guessing game that teaches programming with random numbers and flags.

V IC ClOCk...to teach you ON..GOSUB function and character graphics.

B R E A K - U P .- .a popular game that also teaches how animation is achieved with PEEKS and POKES to screen memory.

Use this coupon or the postage paid card in this issue to order PIUS... music programming, string manipulation, sorting demonstrations, and more. Each Program Worth the Price of the Book! Order your copy Qt MASTERING YOUR V I C - f & your machine at the end of this article. When you MICRO Calc for have finished typing, check carefully against the listing, correct any errors, and SAVE the program to a cassette (if you don’t have a cassette you'll Commodore and have to retype this program for every session you want to use it!). Rewind the cassette, VERIFY it, APPLE make sure ST = 0, and you are ready to try it out. Using MICRO Calc by Loren Wright If you don't already have MICRO Calc in memory, LOAD it from the tape. Type RUN and press RETURN. After a brief delay, the screen will Minor changes provided for Commodore-64 fill with ten yellow lines and a yellow diamond and all PET models. Equivalent program for will appear in the upper left-hand comer. The Apple computers is presented on page 53. diamond, called the "cursor,” indicates where characters you type will appear on the screen.

What is MICRO Calc? A Simple Example The "electronic spread-sheet” is one of the most For this first example we want to add two popular types of business programs available. The numbers and print the result. Our two numbers first program of this kind, "VisiCalc” (now sold are labeled A and B and the sum defined as C. by VisiCorp), has been credited with Apple's big Type the left-hand portion of each of the following impact on the business market. A spread-sheet lines, pressing RETURN after each. The rest of the program lets you perform mathematical line is printed here only to help you understand computations on the video display. You enter what is going on. formulas and data directly into the displayvia the keyboard. Commercial spread-sheet packages offer A = 5 ;assign5toA a large array of cells into which you can program B = 7 ;assign 7 to B labels or values. The values can be defined in very C = A + B ;assign sum to C complex ways, including values calculated in C? ;request value of C other cells. The applications range from accounting to inventory to printing bar graphs. Now press ‘@ ’. The cursor disappears for a second, Once your sheet is defined for a particular the answer '12' (the sum of 5 + 7) is printed after application, you can save it and use it again and the ‘CV and the cursor reappears after the '5' on again for that application. the first line. To change the value ofA to equal 2, MICRO Calc is a miniaturized version of one press the INST/DEL key, type '2', and then of these spread-sheet programs. Instead of cells, The new answer (9) appears after the 'C?'. The you have ten lines on the screen with which to formula may be changed. For example, to make it work. MICRO Calc is a short program that allows 'C = A-B', use the CRSR down key (unshifted) to you to perform even very elaborate calculations at move the cursor to the end of the third line. the touch of a key. In addition, MICRO Calc can Remove the 1+B' by pressing INST/DEL twice, be used to learn how BASIC functions work. The then type the new portion of the formula -B'. ' format is similar to how BASIC programs When you press ‘@ ', the new answer, ' - 5', themselves are written. appears on the fourth line. As presented, MICRO Calc runs in an Now let's try a more practical example — unexpanded VIC. The minor changes described calculating bowling averages. Use shifted allow the program to take advantage of more CLR/HOME to clear the screen, and type the memory in the VIC, to use a disk drive, or to run following, pressing RETURN after each line. on the PET or Commodore 64. For the Apple, use the equivalent program by Phil Daley on page A=165 ;first score in A B = 148 ;second score in B Entering the Program C = 173 ;third score in C Type the program in exactly as it is shown in S = A + B + C ;sum of three scores listing 1. Do not include any spaces unless they S? ;display sum appear within quotes. If your machine is not a V = S I 3 ;calculate average score VIC, be sure to make the changes described for V? ;display average score

No. 58 - March 1983 MICRO Press ' and, after a brief delay, the sum of the below by pressing either RETURN or CRSR down. three scores, '486', will appear after the S? on the From the last line, the cursor will move to the top fifth line and the average of the scores, '162', after line. Similarly, CRSR up will move the cursor to the V? on the seventh. Of course this procedure is the end of the line above, and from the top line to not restricted to bowling scores. Any three the bottom line. The only way to change an numbers you want to average could be used. existing line is to delete from the right end and To show how similar "programming" MICRO retype. Calc is to writing BASIC, here is a BASIC program that does the same thing as the averages sheet MICRO Calc Summary above. Command Characters @ Calculate 10 INPUT“ FIRSTSCORE” ;A INST/DEL Delete previous character 20 INPUT'SECOND SCORE” ;B CRSR dn Move to end of next line 30 INPUT'THIRD SCORE” ;C CRSR up Move to end of last line 40 S = A + B + C RETURN Move to end of next line 50 PRINTS •*- LOAD or SAVE screen 60 V = S I 3 CLR/HOME Clear screen lines 70 PRINT V 80 GOTO 10 CharactersAllowed A ...Z 0...9 /• +-=•{)>< t The Rules MICRO Calc, as you can see, is easy to use. Optional Characters (program lines must be added) However, it has some rules that must be followed ! for remark to avoid disastrous results. : to separate multiple statements on a line space 1. Each line must begin with a letter, followed either by a '?' or a 1 = '. 2. Nothing should be typed after a '?'. That is Avoiding Errors where the program fills in its result. To alleviate the chance for problems, MICRO 3. After a ' = ', you must type either a number or a Calc disallows characters that could cause trouble. BASIC expression that evaluates to a number. Any However, if you are not careful it is easy to make a BASIC function that yields a numerical result, fatal error. The program will stop and an error such as TAN, SQR, RND, LOG, or ABS, may be message, such as ?SYNTAX ERROR or ?DIVISION used. BASIC string functions, such as LEFT$, BY ZERO ERROR, will be printed. Should one of MID$, ASC, or VAL, and integer variables may not these occur, clear the screen, type RUN, and press be used. RETURN. You will have lost everything that was Consult your "VIC User's Guide” to learn on the screen, but you shouldn't have to reload the about BASIC's built-in functions. Then use program from cassette. MICRO Calc to help you understand how they If you use parentheses to assign a variable, for work. example ‘C = (A + B )/(A -B ), be sure there are as MICRO Calc allows you to use 26 storage many right parens as left parens. Also, remember locations called "variables.” Each variable is that, unlike in algebra, multiplication here must be uniquely identified by a letter of the alphabet. In explicitly indicated with an asterisk. Use ' 10*B' our first example, when we typed 'A = 5', we and '5*(A + B)', not '10B' and *5(A + B). If you use a assigned the value of 5 to the variable A, we typed variable that has not been assigned in a previous 'B = 6' to assign the value 6 to B, and typed line, its value is assumed to be zero. Therefore, 'C = A + B' to assign the sum of A and B to C. Until division by an unassigned variable will result in a it is changed, 5 is substituted for A whenever it is ?DIVISION BY ZERO ERROR. used in an expression. Likewise, B and C retain their values until they are changed. Saving the Screen As in a BASIC program, MICRO Calc looks at To save a format for re-use, type in just the the lines on the screen from the top down. assignments (A =, B =, ...) and the formulas Therefore, a 'C?' on a line before C is defined will (C =A + B), and then save to tape without running give the wrong answer. Also, if you assign a the program. For example, clear the MICRO Calc variable a new value, the new value will be used in screen using shift CLR/HOME, and type in the all subsequent calculations. second example (bowling average] without any values for A, B, and C. Don't press '@ '! The Editing program would crash, but this is the most MICRO Calc has limited editing capabilities. convenient form for saving the screen. When you You can move the cursor to the end of the line are satisfied you have typed the screen correctly,

48 MICRO No. 58 - March 1983 save the screen to tape. On the VIC-20, press the hold shift and press CRSR up/dn twice). ' ' key and then press 'S' for SAVE. Type in ‘AVERAGE', position the tape, and press RETURN. P = A/D Calculate Monthly Rate Your screen is now stored on tape under the name P = INT(P*100 + ‘.5)/100 Round to Nearest Cent you entered. P? Display Payment

Loading the Screen Before you try it out, SAVE the screen as described Clear the MICRO Calc screen using shift above. When it is SAVEd the program will return CLR/HOME, and press the ' *- ' key. This time with the cursor at the end of what you typed on the press 'L' for LOAD, position the tape, enter first line. Enter values for A, M, and I, press'@' 'AVERAGE', and press RETURN. If all goes well, in and the result will appear on the eighth line. Now a few seconds the screen will return with the lines you can make a change, as you did in the example you saved before. above,- hit '<§>' and instantly see the change in the monthly payment. More Examples Once you have the hang of MICRO Calc, you According to the Pythagorean Theorem, "The can use it to perform a wide variety of repetitive hypoteneuse of a right triangle is equal to the calculations. Be sure to save the more elaborate square root of the sum of the squares of the other screens to tape, and you will develop a library of two sides." You can use MICRO Calc to solve right useful screens. triangles quickly. Enter the following lines, pressing RETURN after each line. Improving MICRO Calc MICRO Calc was intentionally kept simple so A = 3 ; Assign one side equal to 3 that it would be easy to type in and easy to use. B = 4 ; Assign another side equal The next section describes how you can make to 4 changes in a few lines to improve the power of H = SQR(A t 2 + B t 2) ; The equation MICRO Calc. H? ; The answer

You can calculate monthly payments of installment Flashing cursor: loans using the following formula: With the MICRO Calc program in memory type the following program lines:

1 - 1— D= (1 + i)m 4500 POKE 204,0 4510 GETT$:IFT$ = " ’’THEN 4510 i 4520 POKE 204,1: RETURN i is the interest rate per month andm is the number of months. The principal (the amount you For the PET use 167 instead of 204 in lines 4500 are borrowing) is divided by D to get the monthly and 4520. Normally, when the GET function is payment. Below is the screen you enter to perform used, the cursor is turned off. POKEing a 0 into these calculations with MICRO Calc. this location turns the flashing cursor on, and POKEing a 1 turns it off. Incidentally, you can A= Principal change the cursor character from the diamond to M = Number of Months of the Loan anything you want. Just change the diamond near I = Interest Rate (Annual the end of line 20 to the desired character. If you Percentage) want to save this, or any other enhanced version, I = 1/1200 Monthly Interest Rate (decimal) be sure you don't record over the original version D = (1 - (1 + I) t - M)/l Calculate Divisor of the program.

Cursor Control Characters in Listings Expression Function Key(s) Commodore computers allow cursor [CLRJ Clear screen shift CLR/HOME controls to be programmed as characters [HOME] Home cursor CLR/HOME within a string. However, in listings these [CD] Cursor down CRSR up/dn appear as reverse field characters (for instance, [CU] Cursor up shift CRSR up/dn 'clear screen' is represented by a reversed heart [CR] Cursor right CRSR left/right character). To make these listings easier to [CL] Cursor left shift CRSR left/ type in and easier to understand, we have right substituted bracketed abbreviations of the [RVS] Reverse field OFF/RVS functions of these characters. When more than [OFF] Reverse off shift OFF/RVS one appears in a row, the number of repeats [SPC] Space Space bar precedes the abbreviation (i.e., [2 CU] means [y e l j Yellow CTRL 8

No. 58 ■ March 1983 MICRO 49 Twenty working lines: Saving files on disk: If you have particularly lengthy screens, you Enter the following lines to substitute disk may need more than the ten lines provided. storage for cassette storage: Upgrading to twenty lines is easily accomplished by using the lines in between the original ten. 5020 IFT$ = “ L’THENSA = 9:F$ = “ ,S,R” : Several program lines must be changed to GOT05045 accomplish this: 5030 IFT$ = “ S” THENSA= 10:F$ = “ ,S,W” : GOT05045 30 NL = 20:DIMS$(NL),S(NL) 5045 PRINTDRIVE NUMBER ([RVS]0[OFF] OR 230 PRINTRB$CR$;:G0T0110 [RVS]1[OFF])” 270 S$(LL) = S$:LL = LL-1:IFLL = 0THENLL=NL: 5046 GOSUB4500:IFT$< “ 0” ORT$> “ 1 "THEN5046 PRINTRB$“ [CH][20 CD]” ;:G0T0110 5050 INPUT“ [2 CD]NAME";NA$:NA$ = T$ + 280 PRINTRB$CR$“ [2 CU]” ;:G0T0110 + NA$ + F$ 7020 PRINTCR$S$X$:NEXT:RETURN 5060 OPEN 1,8,SA,NA$:IFSA = 10THENGOSUB5090: 8520 PRINT“ [YEL]” S$“ [RVS]” LEFT$(BL$,20 - LEN GOT05080 (S$)):NEXT:PRINT"[CH][CD]” ;:RETURN The major changes are selecting the drive number, Note that the most significant change is changing the primary and secondary addresses, and accomplished by merely replacing the value of NL adding the prefix and suffix to the file name. The in line 30. NL is used in lines 220, 270, 3000, actual reading and writing process is exactly the 5090, 5110, 7000, and 8500. With twenty lines, same as for cassette. the calculations will take longer. Suggestions for other changes: With just a little work, MICRO Calc can be Comments and Multiple Statements: made to handle strings as well as numbers. First, For some applications, you may want to type all string names within the program must be several assignments on one line or include a changed to two characters. Second, a separate comment for documentation. Change the series of subroutines with an appropriate calling following lines to add these features: routine, similar to 6500-6810, must be added to extract the proper values for printing. Third, the 2020 IFT$ > ‘‘,” ANDT$ < “ ;”THEN2070 quote and dollar characters must be accepted by 2050 IFT$ = “ [SPC]” ORT$ = " !“ ORT$ = " t ” the editor. Finally, the print routine at7000 must THEN2070 be made to recognize and print strings. Probably 3015 IFLEFT$(S$(JJ),1) = “ !” THEN3090 other minor problems would have to be solved 4000 II = 0:KK = II as well. The editor can be improved considerably 4010 II = II + 1 :KK = KK + 1:1 FI I > LEN(A$) by allowing insert, delete, and cursor movements THENGOSUB4100:RETURN within a line. With larger screens, it may be 4020 XX = ASC(M I D$(A$, 11,1)): IFXX = 58 desirable to divide some of the lines into THENGOSUB4100:GOT04010 smaller cells. 4030 I FXX = 33THENGOSUB4100:RETURN 4040 POKE511 + KK,XX:GOT04010 4100 POKE511 +KK,0:KK = 0:SYS828:RETURN How the Program Works If you examine listing 1, you will notice that all floating point variable names have two The program will now allow you to type colons, characters. That is because the single-character exclamation points, and spaces. Everything names A-Z are reserved for the program user. The appearing after a colon on a line will be ignored in key to operation of the program is the machine- evaluations. It is even possible to have a whole language program contained in the DATA line as a comment. Also, assignment statements statements 9828-9868. Listing 2 is an assembly (but not value requests) may be put together on listing (for the VIC) of this routine. The heart of one line, separated by colons. While these features the routine is two JSRs to the BASIC ROM make MICRO Calc more powerful, they also make routines LET and TKENIZE. The rest is involved editing an existing screen more difficult. To make with manipulating the character pointer. Using changes, you must still delete all characters back this little bit of machine language saves countless to the change. This means that comments must be lines of BASIC programming. retyped each time a change is made earlier in the The routine is POKEd into memory as soon as line. See the section marked "Suggestions for the screen is cleared and the screen color set to other changes:" for some tips on improving black (line 10). The next two lines define MICRO Calc's editing. constants and dimension the two arrays used to

50 MICRO No. 58 - March 19 hold the contents and values for each line of the MICRO Calc Variable Usage MICRO Calc screen. Using constants instead of literal values does more than save space in the Constants program. It also speeds execution (BASIC doesn't NL number of screen lines have to figure out what 10 means every time, CR$ carriage return when it can look it up under NL) and makes DL$ delete character changes easy. Line 100 starts the mainline of the RB$ reverse blank program. The line pointer is set to the first line BL$ twenty spaces and the screen is printed using subroutine 8500. DI$ diamond cursor Line 110 is where the loop returns to whenever Variables the cursor is moved to a new line. The string array A...Z reserved for program user element containing the contents of the current n loop counter line is moved into a temporary location. Then the II loop counter line is printed, followed by the cursor (DI$). LL screen line pointer Subroutine 2000 GETs characters from the XX temporary, used in value passing keyboard, accepts or rejects them, and returns on BB letter of variable converted to index 1...26 an acceptable character. Some characters, checked SS current element of value array in 2010, are control or editing characters. These S$ working copy of screen line are dealt with in line 130-180 in the main T$ last character from GET (4500) program. Other acceptable characters are printed, A$ working string for tape and disk with a return to the main program where they are X$ used in formatting screen lines added to the temporary line string in 190. In line S$() array of screen line contents 200, the length of the string is checked. If the last S() array of screen line values character fills the line, the temporary string is stored in that line's array element, and the cursor screen lines, handling value requests (A?) one way automatically advances to the next line. and handling assignments (A =) another. Only Lines 210-230 handle advancing to the next subroutine 5000 is left. The LOAD/SAVE routine line, lines 240-260 handle a delete, and lines is invoked whenever the ' ' key is pressed. First 270-280 handle moving up one line. Line 130 a choice is offered between LOAD and SAVE. handles the or 'calculate' directive. First the Then the file name is entered. Subroutine 5090 is cursor is removed by printing RB$. Then the line used for SAVEing and subroutine 5110 for contents are stored in the proper array element. LOADing. When a screen is saved, each element Next the evaluation (3000) and printing (7000) in the line array S$( ) is added to the string A$, routines are called. Finally the cursor is returned along with a carriage return. If the array element to the end of the first screen line. is empty it is filled with a dummy character. The The evaluation subroutine (3000-3030) sets all carriage returns are used to separate the items, so the single-letter variables equal to zero (subroutine they can be read back with the INPUT# statement 9000). Again, using A instead of zero saves a little in line 5110. The dummy characters are discarded execution time. If the last character is a '?', then and replaced with empty or "null" strings. subroutine 6500 is used to assign the proper Before returning to the main program, the variable value to the value array element for that machine-language routine must be POKEd back screen line. Ideally, the ON...GOSUB structure into the cassette buffer (8000). It is destroyed on should have all 26 routines listed on one line. any LOAD or SAVE operation. Finally, subroutine However, because the VIC allows only 88 8510 is called to reprint the screen. Note that a characters on a program line, we have to split it call to 8500, as in line 100, prints an empty up. This is accomplished by converting the codes screen, while starting at 8510 does not clear the for the letters A-Z to numbers 1 to 26. If the arrays. resulting number is 13 or less, then line 6510 is used. Numbers 14 to 26 are converted to 1 to 13, Running MICRO Calc on Other and line 6530 is used. If the last character is not a Commodore Computers '?', then the statement is assumed to be an MICRO Calc will run with relatively few assignment (A = , Z = , etc.). Subroutine 4000 changes on any Commodore machine. Provided POKEs the characters of the line one-by-one into here are substitute program lines for the the BASIC input buffer and sticks a zero at the Commodore 64 (listing 3), 4.0 PET (listing 4), 2.0 end. The machine-language routine described PET (listing 5), and 1.0 PET (listing 6). The only above is called with SYS828, and a return is made differences are in line 10 and lines 9828-9868. to line 3030. Type the lines appropriate to your machine, Subroutine 3000 continues through the array of followed by the rest of listing 1. The program will

No. 58 - March 1983 MICRO now run as it is. However, you may want to take better advantage of your 40-column screen by 6580 XX=C: RETURN changing the lines in listing 7. 6590 XX=D: RETURN 6600 XX=E: RETURN 6610 XX=F: RETURN 6620 XX=G:RETURN 6630 XX=H: RETURN Listing 1: MICRO Calc BASIC Listing (for VIC) 6640 XX=I:RETURN 6650 XX=J: RETURN 6660 XX=K: RETURN 10 PRINT"[CLR]":P0KE36879,8 :GOSUB8000 6670 XX=L: RETURN 211 CR$=CHR$(13):DL$=CHR$(20):RB$="[RVS] 6680 XX=K: RETURN [CL] " : BL$-" [20 SPACES] 11 :DI$="tfOFF] [CL] " 6690 XX=N: RETURN 30 NL=10:DIMS$(NL) ,S(NL) 6700 XX=0: RETURN 100 LL=1:GOSUB8500 6710 XX=P: RETURN 110 S$=S$(LL): IFRIGHT$(S$,1) = "?"THEN 6720 XX=Q: RETURN PRINT"[RVS]"BI4CR?"[CD]"; 6730 XX=R: RETURN 120 GOSUB2000 6740 XX=S: RETURN 130 IFT$="6 "THENFRINTRB$ :S$(LL)=S$: 6750 XX=T: RETURN GOSUB3000:GOSUB7000:PRINT"[CH][CD]";: 6760 XX=U: RETURN LL=1:GOTO 110 6770 XX=V: RETURN 140 IFT$="[CLR]"THEN100 6780 XX=W: RETURN 150 IFT$=CR?ORT$="[CDV'THEN210 6790 XX=X: RETURN 160 IFT$=,r[CU]"THEN270 6800 XX=Y: RETURN 170 IFT$=DL*THEN240 6810 XX=Z:RETURN 180 IFT$=" "THENS$(LL)=S$: 7000 PRINT"[CH]";:F0RII=1T0NL: GOSUB5000:LL=1:GOTO110 S$=S$(II):SS=S(II) 190 S$=S$+T$ 7010 X$="":IFRIGHT?(S$,1)="?"THENX? =STR$(SS) 200 IFLEN(SJ) < 19THEN120 +" [RVS] "+LEFT$(BL$, 16-LEN (STR? (SS))) 210 S?(LL)=S$ 7020 PRINTCR$S$X$:NEXT:RETURN 220 LL=LL+1: IFLL=NL+1THENLL=1: 8000 RESTORE: FORI I =0TO42: READAA: PRINTRB?"[CH][CD]";:GOTO110 P0KE828+II, AA: NEXT: RETURN 230 PRINTRB$CR$CR$; :GOTO110 8500 FORII=1TONL:S$(II) = "":S(II)=0:NEXT 240 IFS$=,M,THEN120 8510 PRINT"[CLR] [CD]"; :F0RII=1T0NL:S?=S?(II) 250 PRINTRB?"[2 CL]"DI$; 8520 PRINT" [YEL] "S$" [RVS] "LEFT$(BL$,20-LEN(S$)) 260 SJ=LEFT?(S?,LEN(S$)-1):GOTO120 "[CD]":NEXT:PRINT"[CH][CD]";:RETURN 270 S$ (LL) =S$: LL=LL-1:IFLL=0THENLL=NL: 9000 A=0: B=A: C=A :D=A: E=A: F=A: PRINTRBJ" [CH] [19 CD] "; :GOTO110 G=A:H=A:I=A:J=A: K=A: L=A: K=A 280 PRINTRBJCR?" [3 CU] "; :GOTO110 9010 N=A:0=A:P=A:Q=A:R=A:S=A:T=A: 2000 GOSUB4500 U=A: V=A: W=A:X=A: Y=A: Z=A: RETURN 2010 IFT$-"6"0RT$=CR$0RT$="[CD]"OR 9828 DATA165,122,141,112,3,165,123,141, T?="[CU]"0RT$=""0RT$=DL$0RT$= 113,3,169,0,133,122,169,2,133,123,32,121 " [CLR] "THENRETURN 9848 DATA197,169,0,133,122,169,2,133,123, 2020 IFT? >", "ANDT? < "; "THEN2070 32,165,201,173,112,3,133,122,173,113,3 2030 IFTJ > "; "ANDT? < " [ "THEN2070 9868 DATA133,123,96 2040 IFT$ > "ANDT? < ”, "THEN2070 2050 IFT?="t"THEN2070 2060 GOTO2000 2070 PRINTTJDIJ;: RETURN 3000 GOSUB9000: FORJJ=lTONL: IFRIGHT? (S$ (JJ),1) ="?"THENGOSUB6500:GOTO3030 Listing 2: MICRO Calc Assembly Listing (for VIC). 3010 IFLEN(S$(JJ))<3THEN3030 For Information only. Don’t try to type this In. 3020 A$=S$(JJ) :GOSUB4000 3030 NEXT:RETURN 0010 LET • DE $C9A5 ;C64-$A9A5,, 4.0-$B930 4000 F0RII=1T0LEN(A$) :XX=ASC(MID$(A?,II,1)): 0011 ; 2.0-$C8AD P0KE511+II,XX:NEXT 0015 TKNIZE -DE $C579 ;C64-$A579- , 4.0-$B4FB 4010 P0KE511+II,0: SYS828: RETURN 0016 ; 2.0-$C495 4500 GETT$:IFT$=""THEN4500 0020 INBUFF .DE $200 4510 RETURN 0030 CHRPTR .DE $7A ;C64-$7A, - 2 4 4-$77 5000 PRINT"[CLR] [RVS]L[0FF]0AD OR 0035 TEMP .DE $0370 [RVS]S[OFF]AVE" 0040 ; 5010 GOSUB4500 0050 .BA $33C 5020 IFT$="L"THENSA=0:GOTO5050 0060 .OS 5030 IFT$="S"THENSA=1:GOTO5050 0070 ; 5040 GOTO5010 0330- A5 7A 0080 LDA •CHRPTR ;SAVE POINTER 5050 INPUT" [2 CD]NAME";NAJ 033E- 8 D 70 03 0090 STA TEMP 5060 0PEN1,1,SA,NA$:IFSATKEN 0341- A5 7B 0100 LDA •CHRPTR1 GOSUB5090:GOTO5080 03^3- 8 D 71 03 0110 STA TEMPI 5070 GOSUB5110 0346- A9 00 0120 LDA ML,INBUFF ;POINT TO INPUT BUFFER 5080 CL0SE1: GOSUB8000: GOSUB8510: RETURN 0348- 85 7A 0130 STA *CHRPTR 5090 A$=“":F0RII=1T0NL:S$=S$(II):IFS?=""THENS$="?" 034A- A9 02 0140 LD4 §HrINBUFF 5100 A$=A$+S?+CR$:NEXT:PRINT#1,A$:RETURN 0340- 85 7B 0150 STA *CHRPTR1 5110 FORI I=1T0NL: INPUT# 1, % : I FA$=1" ? "THENA$=" " k 034E- 20 79 C5 0160 JSR TKNIZE ;T0KENIZE - STATEMENT 5120 5$ (II) =A$: NEXT: RETURN 0351- A9 00 0170 LDA ML,INBUFF ;POINT TO INPUT BUFFER 6500 BB=ASC(LEFT?(SJ(JJ),2))-64: 0353- 85 7A 0180 STA ♦CHRPTR IFBB> 13THENBB=BB-13:GOTO6530 0355- A9 02 0190 LDA MH,INBUFF 6510 ONBBGOSUB6560,6570,6580,6590,6600,6610, 0357- 85 7B 0200 STA •CHRPTR1 6620,6630,6640,6650,6660,6670,6680 0359- 20 A5 C9 0210 JSR LET ;VARIABLE - ASSIGNMENT 6520 GOTO6540 035C- AD 70 03 0220 LDA TEMP ;RESTORE POINTER 6530 ONBBGOSUB6690,6700,6710,6720,6730,6740, 035F- 85 7A 0230 STA ♦CHRPTR 6750,6760,6770,6780,6790,6800,6810 0361- AD 71 03 0240 LDA TEMPI 6540 S(JJ)=XX 0364- 85 7B 0250 STA *CHRPTR1 6550 RETURN 0366- 60 0260 RTS 6560 XX=A:RETURN 0270 .EN 6570 XX=B:RETURN

52 MICRO No. 58 - March 1983 Listing 3: Revisions for Commodore 64 Apple MICRO Calc Summary

10 PRINT“ [CLR]” :POKE53281,0:GOSUB8000 Command Characters @ Calculate 9828 DATA165,122,141,112,3,165,123,141,113,3, Delete previous character 169,0,133,122,169,2,133,123,32,121 RETURN Move to end of next line 9848 DATA165,169,0,133,122,169,2,133,123,32,165, -*■ Move to end of last line 169,173,112,3,133,122,173,113,3 ESC LOAD or SAVE screen 9868 DATA133,123,96 & Clear screen lines

Characters Allowed Listing 4: Revisions for PET BASIC 4.0 A...Z 0...9 / . + - = .()<>? t 10 PR I NT‘ '[CLR]’' :GOSU B8000

9828 DATA165,119,141,112,3,165,120,141,113,3 169,0,133,119,169,2,133,120,32,251 1 REM * MICROCALC 9848 DATA180,169,0,133,119,169,2,133,120,32,48 2 REM * BY P. DALEY 3 REM * COPYRIGHT (C) 1982 185,173,112,3,133,119,173,113,3 4 REM * BY MICRO INK 9868 DATA133,120,96 5 NL=23 IIt HOME 20 CC = 95 30 FOR II = 1 TO 38:BL? = BL? + " NEXT :BL$ = BL? + 40 GOSUB 430 50 GOTO 75 60 VTAB LL: PRINT S$(LL); Listing 5: Revisions for PET BASIC 2.0 61 IF MID$ (S$(LL) ,2,1) = THE PRINT SS$(LL); 62 INVERSE 10 PRINT"[CLR]” :GOSUB8000 65 PRINT CHR$ (CC); RIGHT$ (BL$, 38 - LEN (S$(LL)) - LEN (BB$(LL))): NORMAL 70 RETURN 9828 DATA165,119,141,112,3,165,120,141,113,3 75 YY = 0 80 LL = 1 169,0,133,119,169,2,133,120,32,149 90 GOSUB 60 9848 DATA196,169,0,133,119,169,2,133,120,32 100 AA = PEEK ( - 16384): IF AA <127 THEN 100 105 IF FLAG = 1 THEN FLAG = 0: FOR II = 1 TO NL:SS$(II) = : NEXT 173,200,173,112,3,133,119,173,113,3 110 POKE - 16368,0 9868 DATA133,120,96 120 AA = AA - 128 130 IF AA = 64 THEN F U G = 1: GOSUB 950: GOTO 250 131 IF AA = 38 THEN GOSUB 530:LL = 1: GOSUB 60: GOTO 100 135 IF AA = 44 OR AA = 58 OR AA = 59 OR AA = 93 THEN 240 140 IF AA > 39 AND AA < 95 THEN 210 Listing 6: Revisions for PET BASIC 1.0 150 CC = 32: GOSUB 60 160 IF AA = 13 THEN LL = LL + 2: IF LL > NL THEN LL = 1 170 IF AA = 8 AND YY > 1 THEN S$ (LL) = LEFT$ (S*(LL), LEN 10 PRINT'‘[CLR]'’:GOSUB8000 ( S$(LL)) - 1):YY = YY - 1: GOTO 180 175 IF AA = 8 AND YY = 1 THEN S$ (LL) = " ": YY = YY - 1 180 IF AA = 21 THEN LL=LL-2:IFLL<1 THEN LL = NL190 IF 9828 DATA165,201,141,112,3,165,202,141,113,3 AA = 27 THEN GOTO 1000 200 GOTO 230 169,10,133,201,169,0,133,202,32,141 210 YY = YY + 1: IF YY > 38 THEN CC = 32: GOSUB 60:LL = LL + 2:Y 9848 DATA196,169,10,133,201,169,0,133,202,32 Y = 0: GOTO 230 220 S$(LL) = S$(LL) + CHR$ (AA) 157,200,173,112,3,133,201,173,113,3 230 YY = LEN (S$(LL)):CC = 95: GOSUB 60 9868 DATA133,202,96 240 GOTO 100 250 XY = LL 255 FOR II = 1 TO NL STEP 2 260 IF LEN (S$(II)) < 2 THEN 410 270 IF MID$ (S$(II),2,1) < > THEN 350 Listing 7: Revisions for 40 Columns 280 FOR JJ = 1 TO LEN(St(II)) 290 POKE 511 + JJ, ASC ( MID$(St (II),JJ,1)) 300 NEXT JJ 20 CR$ = CHR$(13):DL$ = CHR$(20):RB$ = “ [RVS] 310 POKE 511 + JJ,13 [CL]” :BL$ = “ [38 SPACES]” :DI$ = “ 320 CALL 768 350 IF MID$ (S$(II) ,2,1) < > "?" THEN 410 [OFF] [CL]’’ 360 GOSUB 640 200 IFLEN(S$) 37THEN120 390 SSt(II) = STR$ (XX) 400 LL = II:CC = 32: GOSUB 60 7010 X$ = “ ” :IFRIGHT$(S$,1) = “ ?” THENX$ = STR$ 410 NEXT II (SS) + “ [RVS]’’ + LEFT$(BL$,34 - LEN 411 LL = XY:CC = 32: GOSUB 60 412 LL = 1:CC = 95: GOSUB 60 (STR$(SS))) 420 GOTO 100 8520 PRINT“ [YEL]” S$"[RVS]” LEFT$(BL$,38 - LEN 430 FOR I - 1 TO 29:S$ = S$ + NEXT 440 SS$ = "» *" (S$)):NEXT:PRINT“ [CH][CD]” ;:RETURN 450 VTAB 5: PRINT S$: FOR I = 1 TO 10 . (continued)

No. 58 - March 1983 MICRO 53 Circle No. 33

(continued) 460 PRINT SS$: NEXT 470 PRINT S$: VTAB 8: HTAB 5: PRINT "MICRO CALC FOR APPLE" m a x e ll 480 VTAB 10: HTAB 5: PRINT "BY P. DALEY" 490 VTAB 12: HTAB 5: PRINT "COPYRIGHT (C) 1982" 500 DIM S$(25),SS$(25) 510 GOSUB 570 the top of the line 520 FOR I = 1 TO 500: NEXT 530 INVERSE : VTAB 1 535 HOME 540 FOR 1 = 1 TO NL STEP 2: PRINT BL$: IF I < > NL THEN PRINT 542 S»(I) = "" 545 NEXT 550 NORMAL 560 RETURN 570 FOR I = 768 TO 802 571 READ A: POKE I,A: NEXT 572 DATA 165,184,72,165,185,72, 169,0,133,184 573 DATA 169,2,133,185,32,89,213,169,0,133 574 DATA 184,169,2,133,185,32,7 0,218,104,133 575 DATA 185,104,133,184,96 630 RETURN 640 BB = ASC ( LEFT? (S$(II),1))- 64 650 ON BB GOTO 670,680,690,700,710,720,730,740,750,760,770,780 at the lowest price! ,790,800,810,820,830,840,850,860,870,880,890,900,910,9 20 660 RETURN 670 XX = A: RETURN Call our Modem Hotline- (anytime) - 619-268 4468 680 XX = B: RETURN tor exclusive monthly specials. Our tree catalog 690 XX = C: RETURN contains more than 600 fantastic values 700 XX = D: RETURN 710 XX = E: RETURN 720 XX = F: RETURN ABC Data Products 730 XX = G: RETURN i formerly ABM ) 740 XX = H: RETURN 750 XX = I: RETURN 8868 CLAIREMONT MESA BLVD. 760 XX = J: RETURN SAN DIEGO, CALIFORNIA 92123 770 XX = K: RETURN 780 XX = L: RETURN ORDERSONLY ITTTELEX INFORMATION 790 XX = M: RETURN 800-854-1555 4992217 619-268-3537 800 XX = N: RETURN 810 XX = 0: RETURN 820 XX = P: RETURN 830 XX = Q: RETURN 840 XX = R: RETURN 850 XX = S: RETURN 860 XX = T: RETURN Ver. 2 For your APPLE 11/11+ 870 XX = U: RETURN 880 XX = V: RETURN The complete professional software system, that meets 890 XX = V: RETURN ALL provisions of the FORTH—79 Standard (adopted Oct. 900 XX = X: RETURN 1980). Compare the many advanced features of FORTH- 910 XX = Y: RETURN 920 XX = Z: RETURN 79 with the FORTH you are now using, or plan to buy! 950 A=0:B=A:C=A:D=A:E=A:F=A:G=A: H=A:I=A:J=A:K=A:L=A:M=A:N=A: 0=A FEATURES OURS OTHERS : P=A: Q=A: R=A: S=A: T=A: U=A: V=A:W=A:X=A:Y=A:Z=A: RETURN 1000 HOME :D* = CHR$ (4) 79-Standard system gives source p o rta b ility . YES ------1001 0NERR GOTO 1000 Professionally written tutorial & user manual 200 PG. ------1010 VTAB 10: INVERSE : PRINT "S"; Screen editor with user-definable controls. YES 1020 NORMAL : PRINT "AVE OR Macro-assembler with local labels. YES 1030 INVERSE : PRINT "L"; YES Virtual memory. 1040 NORMAL : PRINT "0AD?" YES Both 13 & 16-sector format. 1050 PRINT : PRINT " < RETURN> FOR CATALOG." Multiple disk drives. YES 1060 GET A$: PRINT : IF ASC (A$) = 13 THEN PRINT D$"CATAL0G" Double-number Standard & String extensions. YES : GET A$: GOTO 1000 YES Upper/lower case keyboard input. 1070 IF AJ = "S" THEN GOSUB 1100 YES LO-Res graphics. 1080 IF A? = "L" THEN GOSUB 1200 YES 80 column display capability 1085 HOME : POKE 216,0 YES Z-80 CP/M Ver. 2.x & Northstar also available 1090 CC = 32: FOR LL = 1 TO NL STEP 2 : GOSUB 60: NEXT :CC = 95: $99.95 Affordable! GOTO 80 Low cost enhancement option: 1100 PRINT : PRINT "FILENAME?": INPUT A$ Hi-Res turtle-graphics. YES 1110 PRINT D$"0PEN"A$ Floating-point mathematics. YES 1120 PRINT D*"WRITE"A$ Powerful package with own manual, 1130 FOR II = 1 TO 25 50 functions in all, 1140 PRINT S$(II) AM9511 compatible. 1150 NEXT FORTH-79 V.2 (requires 48K & 1 disk drive) $ 99.95 1160 PRINT DJ"CL0SE": RETURN ENHANCEMENT PACKAGE FOR V.2 1200 PRINT : PRINT "FILENAME?": INPUT A$ Floating point & Hi-Res turtle-graphics $ 49 .95 1210 PRINT D$"0PEN"A$ COMBINATION PACKAGE $139.95 1220 PRINT D$"READ "A? (CA res. add 6% tax: COD accepted) 1230 FOR II = 1 TO 25 1240 INPUT S»(II) MicroMotion 1250 NEXT 12077 Wilshire Blvd. #.506 1260 PRINT D$"CL0SE": RETURN L.A.,CA 90025 (213)821^340 Specify APPLE. CP/M or Northstar Dealer inquiries invited. ______

Circle No. 32 54 MICRO No. 58 - March 1983 The Executive Secretary

Document editor • Mall list merge for business letters Powerful printing program • Pre-printed forms manager Flexible database • Electronic wwii • Alphabetical indexer for books and theses

INTEGRATED means that THE EDITOR: Auto-con- THE DATABASE: Our users PRE-PRINTED FORMS all of the above is included figures to 40 or 80 columns tell us that the Electronic MANAGER: Use a s e ­ in the $250 suggested retail on the Apple lie, supports a Card File is worth the price quence of special embed­ price, a combination that wide variety of 80 column of the entire package. It's ded commands to define the would cost hundreds of dol­ boards, or runs in 40 column not really, but with its ease row and column positions of lars more—IF you could find mode on older Apples. A of use, its multiple alphabet­ the blanks on pre-printed a set of programs that would coupon for a free Revision 7 ic and numeric sorts, its re­ forms. Our template helps work together in the first LCA is included for older port options that include to­ you. Then use mail-list place. Apples. tals and subtotals, it is supe­ merging to combine infor­ rior to many databases cost­ mation from your database INTEGRATED means that ing well over $100.00. with your pre-printed forms. every part of the package follows the same rules. There's no need to learn one set of keypresses for the editor and a separate set of rules for the database

ELECTRONIC MAIL: With a Hayes Micromodem you MAIL LIST MERGE: You can transfer your docu­ a r t s can write documents in the ments to another compu­ editor that call for informa­ ter—or to your local typeset­ tion from the Electronic ter for printing. THE PRINTER: For more Card File and merge the in­ demanding output needs, formation to produce cus­ SPELLING CHECKER:Eas­ you can embed format com­ tomized forms and form let­ ier to use than any other RELIABLE means that ear­ mands in your document lier versions of this software ters. Conditional printing al­ spelling checker. Ours while you edit and let our re­ lows you to skip words, comes with 10,000 words have been in the field for formatting printer program years on the Apple. blocks of text, or entire let­ and a capacity for 15,000 handle all of your layout ters based on criteria that more. Or you can start your concerns. More than 40 em­ you define in each card in own list from scratch. Docu­ bedded commands allow the card file. And you can ments are scanned, and you you to control every aspect also draw information from are shown misspellings in other popular databases, context. Correct them on------rromfrom Visicalc, visicaic, anaand Tromfrom your the-fly, or add words to the own custom programs. dictionary as you scan. A $75.00 option.

RELIABLE means that thou­ sands of users have logged s S u b i k more than 1,000,000 hours of layout,lavout including includina pagina­ of use on the Apple version. tion, binding margins, flex­ ible page headers, volume- RELIABLE means that we length documents, outline ALPHABETICAL INDEXER: back you up after the sale indentation, and far more. This unique tool allows you with a hotline number You can employ electronic to specify page numbers for printed right on the program shorthand so that commonly each occurrence of a term disk. If your dealer doesn't used phrases are represent­ and to produce a properly ORDER BY PHONE know the answer, we do ed by three or fewer key­ formatted alphabetical in­ strokes. And if your printer dex of those terms. Two Available at your local is capable of it, you can do levels of indexing are sup­ dealer or call us at justification by incremental ported, so that entries like spacing, boldface, and more beans, navy' and beans, [612) 929-7104 green' are handled properly We accept VISA/MasterCard with two levels of indenta­ tion. Ask for The Executive Secretary SOF/SYS inc at your local dealer.

4306 Upton Ave. South, Minpeapolis, MN 55410

Circle No. 34 No. 58 - March 1983 MICRO 55 Lyco Computer Marketing & Consultants TO ORDER TOLL FREE 800-233-8760 CALL US In PA 1-717-398-4079

S P E C IA L 810 DISK DRIVE ...... $ 4 1 9 .1 NEC8023PRINTER... $449.| r U n C H A o t percomat-88disk...$ 3 9 5 .

DESIGNER TEE-SHIRT FREE with PURCHASE of ATARI 80048K RAM ... $489.00 A Warner Communications Company

ATARI HARDWARE NEW RELEASES PRINTERS PROWRfTER i ...... *479.00 PROWRITER I I ...... * CALL 410 CASSETTE RECORDER__$ 75.00 ATARI 1200 OKIDATA 82A ...... *419.00 825 PRINTER...... $585.00 OKI DATA 83A ...... *639.00 830 PHONE MODEM ...... $149.00 COMPUTER OKIDATA 8 4 ...... *1029.00 850 INTERFACE...... $164.00 OKIDATA TRACTOR...... *63.00 NEC 8 0 23A ...... *449.00 THIRD PARTY SOFTWARE PACKAGES SMITH CORONA...... *589.00 STARWRITER...... *1475.00 CX482 EDUCATOR ...... $119.00 EASTERN FRONT 1941 ...... $25.50 CX483 PROGRAMMER ...... $54 00 OUTLAW/HOWITZER...... $15.50 CX488 COMMUNICATOR ...... $219 00 WIZARD of W AR...... *31.00 BUSINESS SOFTWARE CX419 BOOKKEEPER ...... $189 00 GORF...... *31.00 FROGGER...... *26.00 KX7104 ENTERTAINER...... M gioo ATARI WORD PROCESSING .... *109.00 CHOP LIFTER...... *27.75 LETTER PERFECT (ROM)...... *149.00 SOFTWARE APPLE PANIC...... $23.75 LETTER PERFECT (disc)...... *129.00 PREPPIE...... $19.95 TEXT W IZZARD...... * 89.00 CXL401 2 MISSILE COMMAND ...$28.75 STAR WARRIOR...... *28.00 DATA PERFECT...... * 75.00 CXL401 3 ASTEROID...... $28.75 CRUSH,CRUMBLE,ACHOMP...... *23.00 VISICALC...... $169.00 CXL4020 CENTIPEDE...... $32.75 SHOOTING GALLERY...... *19.95 DATASAM/6 5 .^ ...... $125.00 CXL4022 PACMAN ...... $32.75 VIDEO MATH FLASH...... *12.00 CXL4011 STAR RAIDER...... $34.75 MY FIRST ALPHABET...... *25.50 CXL4004 BASKETBALL...... $26.75 BAHA BUGGIES ...... *24.95 JOYSTICKS CXL4006 SUPER BREAKOUT ....$ 28.7 5 TEillPLE of ASPHAI...... *27.95 CXL4008 SPACE INVADER ...... $28.75 UPPER REACHES ATARI CX-40...... $18.00 CX8130 CAVERNS OF MARS ...... $31.75 of ASPHAI ...... *15.00 LESTICK...... $34.00 CX4108 HANGMAN...... $12.75 TRACK ATTACK...... $23.00 WICO COMMAND CONTROL...... $23.75 CX4102 KINGDOM ...... $12.75 STAR BLAZER...... $25.00 WICO RED BALL...... *26.75 CX411 2 STATES A LABYRINTH...... $23.00 WICO TRACK BALL...... *54.75 CAPITALS...... $12.75 SEA FO X...... $23.00 nCI^TAND^^^^^^...... $ 6.75 CX4114 EUROPEAN POOL 1.5...... $26.95 COUNTRIES ...... $12.75 SPEEDWAY BLAST (ROM)...... $29.95 CX4109 GRAPHIT ...... $16.75 Book of ATARI CX4121 ENERGY CZAR...... $12.75 INHOME Software CX4123 SCRAM...... $19.75 400 KEY BOARD...... $99.75 CX4101 PROGRAMMING I ...... $19.75 PROTECTOR...... $24.95 (346 pages) .. $19.95 CX41 06 PROGRAMMING II...... $22.75 NAUTILUS ...... $24.95 CX4117 PROGRAMMING III...... $22.75 SLIME...... $24.95 GLAXIAN...... *32.75 SUBMARINE DEFENDER...... *32.75 COMMANDER (ROM)...... $36.95 JUGGLES...... *23.75 JUMBO JET PERCOM SPEED READING...... *55.75 PILOT (ROM)...... $36.95 SINGLE DRIVE (SD)...... $ 399.00 CXL4007 MUSIC COMPOSER .... $33.75 SOCCER (ROM)...... $36.95 SINGLE DRIVE (DO)...... $549.00 CXL4002 ATARI BASIC...... $45.75 KICKBACK (football ROM) ...... $36.95 DUAL DRIVE (00)...... $869.00 CX81 26 MICROSOFT DUAL HEAD (0 0 )...... $669.00 BASIC...... $65.75 CXL4003 ASSEMBLER TO ORDER EDITOR...... $45.75 POLICY CX81 26 MACRO CALL TOLL FREE ASSEMBLER...... $69.75 1800-233-8760 CXL4018 PILOT HOME ...... $65.75 I In-Stock items shipped within 24 hours of order. Personal |ln PA 1-717-398-4079 CX405 PILOT EDUCATOR...... $99.75 I checks require (our weeks clearance before shipping. No or send order to CX415 HOME FILING I deposit forCOD orders. PA residents add sales tax. All products MANAGER...... $41.75 I subject to availability and price change. Advertised prices Lyco Computer CX414 BOOKKEEPER...... $119.75 I show 4% discount offered for cash. Add 4% for Mastercard and P.O. Box 5088 I Visa. [Jersey Shore, PA 177401

Circle No. 3 Digi-Draft for SAVE SCREEN: Saves files. Press S to save your picture as a data file. If you are using a disk drive, Atari 400/800 enter a complete filename. LOAD SCREEN: Loads files. Press L to load a previously saved data file. If you don't like DIGI-DRAFT's sound, simply by Timothy Kilby eliminate lines 135, 420, and 1550. When you are saving or loading files to and from a disk, you must use complete filenames such as D1:FILENAME.EXT. Cassette users may wish to change nine lines to those in the cassette revision (listing 2): otherwise type "C :" whenever you're This drawing program allows you to construct asked to enter a filename. Typing the remark images on an Atari GRAPHICS 7 screen. statements is not necessary. Type all underlined Convenient commands change colors, load and spaces and characters in inverse by pressing the save, use alternate character sets, and draw points, Atari logo key. Lines 8030 and 9050-9070 must be lines, circles, and rectangles. typed exactly as printed or the program will crash. DIGI-DRAFT is joystick operated (port #1) and You can save memory by changing frequently used menu driven. Regular drawing is done in the constants like 0 and 1 to variables (but this will default mode. You will have to press a key to make reading the code more difficult). select one of the options. You won't see an option in the menu to change all the playfield color registers; just press SELECT to initiate this option. DIGI-DRAFT’s Design The rest of the menu selections are DIAGONAL LINE: Draws a diagonal line from the last plotted point. RECTANGLE: Automatically draws a rectangle. DIGI-DRAFT's design begins with a simple Position cursor at one corner and press FIRE. GRAPHICS 7 drawing program, then uses Position cursor at opposite comer and press R. advanced program design for unique results. The CIRCLE: Draws arcs and circles, either filled or cursor has been replaced with a cursor-like player. not. Circles near the screen's edge will continue to You have seen players in the form of spaceships, plot even if off screen. aliens, or six-shooting cowboys. DIGI-DRAFT's BROKEN LINES: Draws hidden or dotted lines player is an X character that marks the pen's instead of solid lines. position. This player is independent of all other FILL: Draws a line from the last plotted point, graphics; it is able to dance around the screen then fills all areas to the right with solid color. Fill without erasing lines. Points will be plotted and lines cross screen unless stopped by a drawn line lines will be drawn based on the player's position or plotted point. on the screen. TEXT: Controls text. Enter a text string, then Another special feature is a text-plotting position cursor. Text string will be plotted below routine that will draw text characters in the and to the right of the cursor. Text will wrap graphics window. It permits you to use all 256 around the edges of the screen. You may use all characters, including inverse video and control 256 characters including inverse and control characters. If a custom character set is loaded — a characters. nice way to add architectural, electronic, game- LINECOLOR: Chooses color for lines; press 1, 2, piece, or other special symbols — those characters or 3. Color 4 is the background color, so it acts as can be used in the graphics window. Furthermore, an eraser. Set specific hues with the SELECT you can load new character sets at any time so option. that characters from several different sets could be CLEAR: Erases the entire screen. used within one design. The routine plots points N EW FO N T: Controls character style. Load a new rather than prints characters, so any of four colors character set from tape or disk. Characters from could be used. Special effects such as 3-D that set will appear only in the graphics window. shadowed text and color-on-color are easily Change character sets at any time. implemented. Atari characters are the default

No. 58 - March 1983 MICRO 57 ;store text color in COLPF1 Figure 1: Sample Screen from DIGI-DRAFT STY $D017 PLA TAY PLA TAX + ft ft ft ~ PLA RTI The DLI routine, along with the machine-language -Bfl d player movement and input/output routines, is located in program memory, thereby freeing page y D r e a m six for screen dumps or other machine-language R^RECTANGLE D=OIAGOH.______T=TEMT C=CIRCLE B=BROKEN LINE routines. F=FZLL N=NCN rONT L=LO*D 5CREEM J-* ?«*?,* 4= L m p C 0 ^ , Q f l ..S=>fty.G...S.G.HEG*!.. Your drawings can be saved by DIGI-DRAFT and reloaded at a later time. The screen-saving subroutine stores all graphics data and the colors characters; if you want custom characters you will from the color shadow registers into a data file. have to create them yourself with a character The routine saves data for the graphics window editor program. There are several excellent directly from screen memory, instead of retrieving character set editors available commercially that pixel data from the screen — a rather slow will assist you in creating character data files. procedure. The screen-loading subroutine does just Whenever a custom character set is loaded, the the opposite. The loading subroutine, beginning at character base shadow register at $2F4 is set to line 4000, could be used with other programs to point to the new character set. The new characters load your picture data files to a GRAPHICS 7 would be used anywhere on the screen, including screen. Thus your screen designs could be the text window, if it were not for a display list incorporated in a variety of program applications. interrupt (DLI) routine added to DIGI-DRAFT. The Just imagine an electronics program with DLI routine is a short machine-language routine schematic drawings selected by menu, or an that makes the computer display only Atari adventure game with code books or detailed maps. characters in the text window and adds extra color as a bonus. Listing 1: DIGI-DRAFT Program Listing Just before ANTIC instructs the CTIA (or 0 REM DIGI-DRAFT (C) 1902 TIM KILBY 5 OVERSCAN-O.81REH OVERSCAN DETERMINES PERFECT CIRCLES. CHANGE TO VALUE FROM Q. GTIA) chip to display the text window at the SO TO 2.00 FOR OVAL SHAPE. 10 GOTO 7010 20 REH READ JOYSTICK bottom of the screen, once every sixtieth of a 30 A-STICK<0>lB-8TRIC<0):i-PHB+Y-i:iF A-ll AND X>44 THEN X=X-1!P0KE PL, X :RETURN 40 IF A-7 AND X<203 THEN X«X+1!P0KE PL.XtRETURN second, the DLI routine is called up to switch to SO IF A-13 AND Y<94 THEN 0-USR1S THEN D-USR44 AND Y<94 THEN X-X-1SP0KE PL,XJD-USR(XD,I>!Y-Y+11 RETURN 80 IF A-3 AND X<203 AND Y<94 THEN X-X+1JP0KE PL,Xi 0-USR44 AND Y>19 THEN X-X-ltPOKE PL,XSO-USR(XU,I>!Y-Y-1:RETURN the screen begins plotting anew, all the shadow 100 IF A«4 AND X<203 AND Y>15 THEN X-X+15POKE PL.XS0-U8R8»:C0SUB ZOlQiCOSUB MENU 140 CDTO 130 appropriate registers. Thus, the computer 170 REN LINE COLOR CHANCE 180 IF KEY-49 THEN C-i:C08U8 230 continually switches between given values for the 190 IF KEY-50 THEN C-2SG0SU8 230 200 IF KEY»31 THEN C-3SG0SU8 230 210 IF KEY-32 THEN C-OSCOSUB 230 text window and your colors and characters in the 220 RETURN 230 FOR 1*0 TO 20 SPOKE 704,0:POKE 704,14!NEXT I!POKE 704,86tftETURH graphics window. Line 9050 of listing 1 contains 240 REH READ KEYBOARD 290 GET 04.KEYSIF KEY-78 THEN ? C»!COSUB SOIOIGOSUB MENU 260 COSUB 180JIF KEY-40 THEN COSUB S10 the numerical data that create this routine. In 270 IF KEY-40 THEN 9000 280 IF KEY-47 THEN ? CCCDSUB 910 assembly language it looks like this: 290 IF KEY-B4 THEN ? CtSGOSUB 12HSPOKE 702.44SPOKE 694,0 300 IF KEY-70 TNEN GOSUB 810 310 IF KEY-82 THEN C08UB 710 320 IF KEY-74 THEN ? C«I COSUB 4010:COSUB MENU 330 IF KEY-44 THEN ? C«!COSUB 1910 PHA 340 IF KEY-63 THEN ? CtiGOSUB 3O1O!COSU0 MENU 330 RETURN TXA 340 REN HENU 370 POKE 792,1!P0KE 82,0 380 ? C«ra <-CLEAR R-RECTANGLE D-DIAGONAL LINE £. T-TEXT C-CIRCLE B’&ROK PHA EN LINE" 390 ? "H F-FILL N«NEM FONT L-LOAD SCREEN U 1,2,3f4=LINEC0L0R S=SAVE SC TYA reenm;:poke 82,2:return 400 REN DRAM 410 Xl«X-44tYl«Y-19JPL0T XI,Y1!X2»X1JY2»Y1 PHA 420 SOUNO 0•XI♦(79-X1)*78)*2*Tl+<39-Yl)«(Yl>3S)*2+20,10.4 430 RETURN ;use Atari character set 300 REH ■PIACONAL LDA #$E0 310 PONE 93279,0 1X1-X-44JYl-Y-13 SCOLOR CJORAHTO X1.Y1JRETURN 7«0 REH RECTANGLE LDX #$2C ;light yellow background (or color of 710 COLOR C:X1-X-44!Y1»Y-13:0RAHT0 X2.Y150RAHTQ Xl.YIJDRAHTO X1,Y2!ORAMTQ X2.Y2S PLOT X1,Y1SX2-X1SY2SY1:RETURN your choice) BOO REH FILL B10 Xl*X-44}Yl*Y-l9tPOSITION X1.Y12P0KE 745.CSXI0 10,*4,0,0.-S:"!RETURN 900 REH CIRCLES LDY #$06 ;dark text color 911 F-0J? "Do you want your elrcl* FILLEO (Y/N)'?*’;{GET M.KEYJIF KEY=fl9 THEN F-l 930 ? C$5D$}"Position cursor at on* point on EOGE of circle or arc and eras* FI STA $D40A ;wait for WSYNC RE." 940 C08UB JOYtIF 8»1 THEN 940 930 PONE 33279,OJFOR 0-1 TO 30 'NEXT 0U1-X-44JY1-Y-1S STA $D409 ;store Atari character pointer in 940 ? C«:D«i"Naw position ths cursor at tha CENTER of your cirel* or are and pr« ss FIRE." CHBASE 970 COSUB JOY!IF 8-1 YHEN 970 980 PONE 33279,8SCl-X-44JC2-Y-13«R-INT(SQR(A6S(C1-X1)''2+A6SAZ)*0.5>!? C$1 STX $D018 ;store background color in COLPF2 990 ? " - Chan?* color by praising - 1 . 2 . 3 .or 4 " 7 i? " ...... (continued)

58 MICRO No. 58 - March 1983 Listing 1 (continued) 1000 FOR N=»270 TO 42?2X2-C1+R*C0S(N>JY2-C2+RiOYERSCAN*SIN!IF PEEK(K>ORET THE N GOSUB lOSO MICRObits 102 0 IF X2<1 OR X2>159 OR Y2<1 OR Y2>79 THEN NEXT N 1030 COLOR C2 PLOT X2,Y2 2 IF F-l THEN ORAHTO C1,C2 AIM 65 Real Time Clock 1040 NEXT N!GOTO 1000 1030 GET *4,K£YSIF KEY>48 AND KEY<33 THEN GOSUB 190 10 60 IF KEY-32 THEN C-12POP 2G09UB HENU2RETURN Provides tour, minute, second, day of week, day, month, 1070 RETURN 1200 REM TEXT year. Twelve- or 24-bour format. Pin-compatible with AIM 1210 POKE 752,0:? "Enter TEXT string you wish printed."JINPUT B*SIF B*»'"' THEN G osub henusreturn expansion connector (also SYM, KIM). Four switch- 1220 POKE 752,12? C*2Ds;”Nou position cursor at beginning location and pr*s s FIRE button.” selectable interrupts, Nicadbattery backup. Industrial quali­ 1230 GOSUB JQYSIF B-l THEN 1230 ty board 4.5 x 6. All ICs socketed. Single 5V supply. 1250 Xl=:Yl-127 THEN F-RET Twenty-two-page manual. All software included. Bare board 1270 IF Xl>152 THEN X1-0JY1-Y1+8 1200 IF Y1>72 THEN Y1=0 $29.00. Complete A&.T $93.00, includes batteries. Add 1290 B-ASC(e*(A,A>)2GOSUB 13902R-PEEK(756)*256+B«8JFOR 1=0 TO 7 2 COLOR C2D-A6S127 THEN 0=0-1282PL0T X1.Y1+I 1310 IF D>63 THEN D=0-64SPL0T X1+1.Y1+I Data Design Group 1320 IF 0>31 THEM 0=D-32SPL0T X1+2.Y1+I 1330 IF D> 15 THEN 0-D-162PL0T X1+3.Y1+I P.O. Box 3318 1340 IF 0>7 THEN D=O-0:PLQT X1+4.Y1+I 1350 IF D'3 THEN O-O-42PLOT X1+5.Y1+I La Jolla, CA 92038 1360 IF 0>1 THEN O*0-22PLOT X1*6„Y1+I 1370 IF 0>0 THEN PLOT X1+7,Y1+I (619) 265-6940 1380 NEXT 12 XI*X1+8 2NEXT A2 GOSUB MENU2B*=CHR*<253>{RETURN 1390 IF B>127 THEM 0-6-129 MOO IF B>31 AND B<96 THEN B-B-32 2RETURN 1410 IF 002 THEN B-B+64 1420 RETURN Lessons In Algebra 1500 REM BROKEN LINES 1510 ? " BROKEN LINES HOOE"S? 5? " - Prt** SPACE BAR to exit 1520 COLOR CJIF AOll ANO A<>7 AND Y1/4-INT (Y1/4 > THEN COLOR • An easy and fun way to learn the basic elements of high 1530 IF AO U AND A<>13 ANO Xl/5-lNT THEN COLOR 0 1540 GOSUB JOY 2 IF B-0 THEN GOSUB 410 school algebra. Apple computer diskette $29.95. 30-day 1550 SOUHD 0,0, 0,0 1560 IF PEEK(K> ORET THEN 1590 moneyrback guarantee if not satisfied. 1570 GOTO 1520 George Earl 1580 GET *4,KEY2IF KEY-32 THEN GOSUB MEHU2RETURN 1590 IF KEY>4B ANO KEY<53 THEN GOSUB 190 1302 So. General McMullen Dr. 1600 GOTO 1520 2000 REM COLOR CHANCE San Antonio, TX 78237 20 10 ? "Use joystick to change four colors. Press FIRE also to chan?* Intenslt 2020 ? 2? '• - Press any key to exit -■*{ 2030 A=STICK<0>SB=STRIG(0>2IF PEEKRET THEN CO-CO-256 2050 POKE 709.C1SIF A=7 ANO BOO THEN C1-C1+16HF C1>RET THEN Cl-Cl-236 Target-an AIM 65 Newsletter 2060 POKE 710 ,C2 2IF A-13 ANO BOO THEN C2-C2+16SIF C2>RET THEN C2-C2-236 2070 POKE 712.C42IF A-ll AND 900 THEN C4-C4+162IF C4>RET THEN C4-C4-256 2090 IF 0=0 ANO A-14 THEN CO-CO+2SIF C0>RET THEN C0»CI-236 Need information for your AIM 65 computer? News, 2090 IF 0-0 AND A®7 THEN C1=C1+2:IF C1>RET THEN Cl-Cl-256 software, and hardware are examples of items covered in the 2100 IF 0=0 ANO A-13 THEN C2-C2+2HF C2>RET THEN C2-C2-256 2110 IF 0-0 AND A-ll THEN C4-C4+2JIF C4>RET THEM C4-C4-256 newsletter. Yearly subscription rates are $7.00 in the US ‘ 20 GOTO 2030 3000 REM SAVE SCREEN and Canada, $12.00 elsewhere. Back issues are available 3010 POKE 752,01? "Enter filenane fop dr awing,"2INPUT F*2POKE 752,12? CfSIF F*-“ " THEM RETURN beginning with 1979 at the same per year rate. 3020 TRAP 30902POKE PL,0JCLQSE *1S0PEN *1,8,0,F* 3030 FOR 1-708 TO 7122PUT •1,PEEK(I){NEXT I Target 3040 POKE 952,PEEK(99)'.POKE 853,PEEK<89>SPOKE 856,1202POK£ 857,12SPOKE 890,11 3050 J=USR(ADR(CIO*)) c/o Donald Clem 3060 POKE 54286,1922? C*J0*2" Screen has been saved esS"5? " "[F ♦ •.Bf.FOR O-l TO 50C‘.MEXT D R R # 2 30 78 POKE PL,X J TRAP 130{RETURN 3080 POKE 54286,1922? C*SO*2"Sopr3! Check connections - try againSB*2FOR 0«1 T Spencerville, OH 45887 “ 400 2NEXT D2GOTO 3070 4000 REM LOAD SCREEN ‘010 POKE 752,0 2? “Enter the drawing's filenane.“2 INPUT Ft SPOKE 752,It? C*SIF F* "" THEN RETURN 4020 POKE PL,0 J TRAP 40802CLOSE *120PEH *1,4,0,Ft The State of the Art In 4030 FOR 1=708 TO 7122GET *l,CSPOKE I,C2NEXT I 4040 POKE 852 ,PEEK(99> ’.POKE 953 , PEEK (89 ) iPOKE 836,128:POKE 837.12JP0KE 830,7 Astro-Software 4050 J=USR(ADR(CIO»)) 4060 POKE 54286,1922C-1 4070 POKE PL,X2 TRAP 130 2 CO-PEEK(708) 2C1-PEEK<709>SC2-PEEK<710)SC4-PEEK1712>2RETU Wide range of astrological and astronomical software of the RN 4000 POKE 54206,192:? C* SO*;"Sorry1 Problem withthat file. Try again.":B highest quality. From powerful (and income-producing) *2F0R D=1 TO 30 0 2 NEXT OJGOTO 4070 5000 REM LOAD CHARACTER SET astrological charting service packages and printing 5010 POKE 752,0:? "Enter filenan* for your character set.(Press RETURN for ATARI char acter s .) “2 interpretation packages, to super-accurate computer 5020 TRAP 5 0 702INPUT F*5POKE 732,18IF F*»”" THEN 7 StJPOKC 736.2*4JT*0{RETURN 5030 CLOSE I1SOPEN *1,4,0, F*SP0KE 052.O2POKE 053.CS2POKE 856.I2P0KE 857.42P0KE 8 ephemerises. For all Commodore computers, Apple n Plus, 50,7 5040 J=USR(AOR(CIO*)> and TRS-80. SOSO POKE 756,CS2POKE 54286,1922? C*;D*;"Load complete...... "{FOR 0*1 TO 251 Matrix Software 2 NEXT Dt T=1 5060 TRAP 130 2RETURN 315 Marion Avenue 5070 POKE 54206, 1922? Cs;0*i"Problems with that file. Try again,"IFOR O-l TO 300.NEXT D1GOTO 5060 Big Rapids, MI 49307 7010 GRAPHICS 172POKE 708,2142POSITION 5,72? 16}"OIGI-ORAFT"JPOSITION 4,112? *6} "BY TIN KILBY" B000 REH INITIALIZATION JUCRO' 8010 OIM F*<15),C»<1),8»<19>,D»<1),HL*<71),CI0*(6> 8020 FOR O-l TO &2READ A2CI0*-CHR*(A)SNEXT O 0030 DATA 104,162,16,76,86,228 0 040 C0 = 150!C1=70 2C2a22l2C4»14JC-12 RET-255 2 T—0JK-7642JOY-302PL-53240JHENU-370SOE •.TRAP 130 8 0 50 B*=CHR*(253) 2C*-CHR*<125> 20*-CHR»<29>2N-AOR!XU-N+295XD-N+50 It Pays to Write for MICRO SO POKE 512,N-INT(N/256)*2562POKE 513,INT(N/256) 9070 FOR 1=0 TO 702REAO A2P0KE N+I,ASNEXT I Get paid for your ideas: write for MICRO! Thousands of people 30 OPEN •4,4, 0 , "K 2" 9090 I-PEEK<1Q6>-16:P0KE 106,I!CS-I+12 read MICRO every month. MICRO is sold in computer stores 9000 GRAPHICS 72POKE 708,COSPOKE 709.C12POKE 710.C22POKE 712,C4SI-PEEK<560)+236* and on newsstands worldwide. Send for a copy of our Writer’s PEEK(561)SPOKE 1+93,141 9010 POKE 54296,192SX=1232Y®352A»PEEK(106)-2SPOKE 54279,A2PM8-256*AJP0KE 359,46! Guide now. Our author payment rate is competitive with the POKE 53277 ,3 tPOKE PL.X 9020 IF PEEK < PM8)<>0 THEN FOR I-PHB TO PHB+l2e:POKE I.0SNEXT 1 leading magazines in the industry. 9030 RESTORE 90802PDKE 704,882FOR I-PHB+Y TO PMB+2+YJREAD A2POKE I.A2HEXT I 9040 GOSUB MENU2POKE 756,CS»(T-l)+224«(T-0)SGOTO 131 We welcome articles on any aspect of 6502/6809/68000 9050 DATA 72,133,72,152,72,169,224,162,44,160,6,14],10,212,14-1,9,212,142,24,290, 140,23,209,104,168,104,170,104,64 hardware and software for the Apple, Atari, CBM/PET, TRS-80 9060 DATA 104,104,133,179,104,133,177,160,1,177,177,136,145,177,200,20*,192,5,21 8,245,96 Color Computer, VIC, OSI, 6809, or 68000. 9070 OATA 104,104,133,178,104,133,177,161,4,177,177,200,145,177,136,136,192,255, 3,245,96 9080 OATA 20,8,20 1983 Features: April — Communications Listing 2: Cassette Revision to DIGI-DRAFT May — Wave of New Computers 3010 ? "Are 3ou sure? (Y/N) "JtGET *4,KEYSIF KEYO09 THEN RETURN June — Operating Systems 3015 ? C*SO*2"Insert a blank cassette, pre*s RECORD and PLAY. then pres* RETURN. "2 F* = "C 2” July — Hardware 4010 ? "Are you sure? (Y/N) " { 2 GET 14, KEY ! IF KEYOS9 THEN RETURN 4015 ? C*SO**,"Insert screen data tape, press PLAY, then pres* RETURN."2F*»"CSH August — Word Processing 5010 ? “Press A for ATARI characters or H to load n*« character set. “}SGE T *4,KEY September — Education 5012 IF KEY-65 THEN ? B*SP0KE 756,2245POKE 752,15T-0{RETURN 5014 IF KEY078 THEN RETURN October — Programming Techniques 5016 ? Ct D* ; "Insert character data tape, press PLAY . than press RETURN,"SSI !F**"C2" November — Games 5020 IF PEEK (K) 012 THEN 5020 4 U G D O * December — New Microprocessors

No. 58 - March 1983 MICRO 59 SOFTWARE

When you reach the st „ sophisticated software to help you applications, explore the programming power and flexibility available to you with systems software from OSS. -

C/65—Another Powerful First from OSS C/65 is the first commereially-available C compiler for both the Atari and Apple machines which actually produces assembly language output. C/65 supports a very usable subset of the extremely powerful and popular C language. Just as C is used by the most sophisticated programmers from the professional and academic communities, so shall C/65 prove to be a powerful and much-needed tool for 6502 software developers. C/65 supports ENTegers and CHARacters, arrays thereof and pointers thereto. Naturally, it also features full recursion, easy assembler interface, ^INCLUDE, and a non-macro version of #DEFINE. AUTOmatic, global and EXTERNal variables are also available. When used with our MAC/65 assembler, C/65 is a powerful and flexible tool...$80.00

A Strong Software Family And More... Other major systems software products from OSS include: OS/A + , the first and finest operating system for BOTH Atari and Apple computers, is NOW included FREE as a part of every OSS systems softwj the only logical upgrade to Atari BASIC with extra package. OS/A+ features a keyboard-driven, easy-to-use command process* B A S I C A + features for games and business programs....$80.00 several simple resident commands, and logical and readable requests for even t the finest and fastest complete 6502 macro most sophisticated utility commands. Versions of OS/A+ for some high M A C / 6 5 assembler/editor package you can buy....$60.00 capacity drives are available at extra cost.

for structured programming, an easy-to-use inter­ NOTE: Unless otherwise noted, all OSS products require 48K and at le< T I N Y C preter, a learning tool....$99.95 one disk drive. ASK YOUR DEALER, or call or write for our brochure. a powerful, self-relocatable debugger. FREE with B U G / 6 5 MAC/65....$34.95 ATARI, APPLE II, and TINY C are trademarks of Atari, Inc., Apple Computer, Inc., a Tiny C Associates, respectively. MAC/65, C/65, BASIC A + , BUG/65, and OS/A + i trademarks of Optimized Systems Software, Inc.

*OSS Optimized Systems Software, Inc. 10379 Lansdale Avenue • Cupertino • California • 95014 • (408) 446-309 Circle No. 2f

60 MICRO No. 58 - March 19 Center's Task Force, the long-range goal is to have a central resource center that provides the community with access to many types of The Computer computers, hardware, software, and information to enhance the learning process, as well as the Revolution Reaches competency to pass on this knowledge to the public in an informative and educated fashion. the Community The Center will go "wherever there is a need — the limit is only what the community wants," explains Mr. Carduner. Plans include adding more by Emmalyn H. Bentley specific courses of study as the demand increases — advanced LOGO for teachers, supplemental extensions to the VisiCalc family, and Pascal. But the core of introductory programs will continue to be a very integral part of the learning system. Many questions confronting the public today Because the center is community-oriented, the concern the computer revolution's role in our general public is encouraged to particpate in this daily lives. How is this revolution affecting inspiring educational venture. Businesses can send business, education, communication, recreation, employees to specially custom-designed training and even the drudgery of routine tasks we all must programs. (One Nashua school sent four perform? Can the field of computer science be secretaries to the center to learn word processing.) assimilated easily into our day-to-day existence if Teachers are encouraged to actively participate in we are not conversant with high technology? What such workshops as Computer Applications in the practical steps can we take to prevent a "future- Classroom, Introduction to LOGO, and Computer shock” impact on our sensibilities? Literacy for Teachers. To help the schools prepare Some of these questions are being resolved at for a future in which computer courses may be the newly created Microcomputer Learning Center required, teachers are invited to bring their classes in Nashua, NH. The project is a combined effort of to the Learning Center for a working introduction the Arts and Science Center, Nashua and The to computers designed to fit any age group. Computer Mart of New Hampshire, Inc., and has Individuals are offered one-day sessions to help education at the heart of its intent. It is a merging balance checking accounts and budgets, perform of two entirely different kinds of organizations [a diet analysis, or even learn a new computer game. non-profit institution and a profit-making Intensive courses can help the novice grasp the business | to create a unique blend of expertise and elements of computer savvy or provide added job resources. The result is an exciting learning center skills. complete with knowledgeable educators, hardware and software, and an extensive library of computer “The Children Know the Most” literature. Presently the Learning Center has ten Apple II Plus computers with disk drives and video The Center is attracting a cross-section of monitors, and three printers. A resource center has society — young and old, with little or no been established to provide the latest in knowledge of computing. According to Gerry applications software, books, and journals. Hands- Paquin, M.Ed., Marketing Director and Education on instruction is offered in such courses as Consultant for The Computer Mart of NH and Computer Literacy, VisiCalc, Word Processing, task force member of the Learning Center, of all and BASIC, to name only a few. In-depth the people enrolling in the classes "the children workshops cover LOGO and PILOT, computer know the most!" They are being exposed to graphics, specific languages, software evaluation of computers at school and at home, or have had computer-assisted instruction, and administrative some prior experience on the few terminals the management and computing for remediation. NH Children's Museum (at the Arts and Science Although the Center uses only Apple computers, Center) provided before the Learning Center this is not a factor when decisions are made about opened. The adults are the ie a l novices; they are what courses to take. The Learning Center teaches curious to know "How can it (the computer) help applications and word processing that are organize my information, whether it be at home or transferable and generalized; it offers across-the- at work? How can it simplify certain things that I board learning. K n ow ledge is what it is all about. do repetitively?" There is a drive for learning, a According to Stuart Carduner, NH Children's gusto for "I've got to find out about this because Museum director and member of the Learning it's new and it's happening and I want to be in on

No. 58 - March 1983 MICRO 61 Circle No. 36

it." Mr. Paquin claims "The hardest part about computers is to get people to sit down and try it ACORN and to deal with their preconceptions about what it is." Eight or nine of ten class members have ATTACHED never used a computer before. They don't know PROCESSOR what a computer can do and, in most cases, are FOR THE truly amazed. "Wow! A computer can do that?" is a familiar refrain. APPLE II™ The task force members at the Learning Center $1495 are actively seeking people from a variety of HARDWARE backgrounds — the businessman/ educator, • 68000 Microcomputer with 12 I student, and homemaker. Recently they offered a • 131,072 Bytes of RAM J • 32,768 Bytesof j course to the Nashua Women's Club. Mr. Paquin • Two! tells of one instance where a computer course, taught in a nursing home, was an incredible success. Courses for children are provided as an extension to what they have learned at school, filling a need to give the youngsters a place to further their computer education. One of the most ssemc popular courses that "fills like crazy" is Advanced DfSment System BASIC for Young People. Mary Gasiorowski (task Se'Wg€hure or send $10 for 100 page force member) talks about a mailing-list program I (refunded with order for ACORN) she taught, in which one youngster wrote an ACORN SYSTEMS INC. imaginative title page that moved an envelope 4455 TORRANCE BLVD., #108 • TORRANCE, CA 90503 across the page to a mailbox! Telephone (213) 371-6307

'Apple, Apple II and Applesoft are the trademarks of Apple Computer Co. The Future is Now

One final comment about the revolutionary growth of computers in the community. Three or four years ago the computer world was an entity of ADVANCED s its own and appeared to consist of two groups: the ■■ i jjrir. i|;::r in his lonely comer preparing incomprehensible u i N k if % .. programs for inexplicable applications; and the H mi' ■■ ^a«i computer hobbyists who gathered on Saturday Zoom HiRes Graphic Printing for Apple Computers mornings in computer shops to talk, talk, talk! (Mr. Paquin believes one of the positive things to Print front or back view of either or both screens come out of this is the willingness of customers Print upright, upside down, rotated left or right Selectable printing densities for many printers and shop owners to exchange information and Easily place zoom viewport using on-screen crosshairs ideas — a phenomenon that does not occur in any Large range of scale factors, independently selected other phase of business.) These preconceived Load files to either screen in just 5 keystrokes stereotypes no longer exist. The staid programmer Type upper/lower case English or Greek text on screen has emerged from his dark recess with a sense of Attach screen dump to your own programs, complete details altruistic values that he now shares with others; Real Apple II DOS 3.3 format — Unprotected backup there is a comraderie,a feeling of "we're doing with COPYA this because it's fun." Apple, for example is a Supports over 70 dot matrix and letter quality printers "potential movement" with its festivals and Supports serial, parallel, graphic, and buffer I/O cards clubs, and this enthusiasm is spreading. It is an Also works with the Basis and Franklin Computers exciting age when the most ordinary of us have an Only $34.95 postpaid or see your dealer Versions without text annotation available for inclination to become computer-literate, to get on Apple II Pascal $34.95 with the business of living in this inescapably Apple III SOS 1.1 $44.95 technical world in a more meaningful fashion. The

2281 Cobble Stone Court Microcomputer Learning Center in Nashua is Dayton, O hio 45431 helping to make this happen. By bringing the Dealer Inquiriesnes micro to the general public, people are able to get Invited! in touch with one another in the computer environment in a very human kind of way. O l ID y y JMCftO Circle No. 37

62 MICRO No. 58 - March 1983 BUSICALC BUSICALC A Honey of an Electronic Spreadsheet Why electronic spreadsheet programs? Electronic spreadsheet programs allow the user to create a gridsheet, spreadsheet, worksheet, or any other table of information, using the memory of the computer as pencil and paper. The computer display or terminal acts as a window through which the user views the information as it is entered. Textual information (such as headings), numerical values, and formulas can easily be entered into the spreadsheet.

For Commodore 64 For Commodore VIC 20 For Commodore PET/CBM 40 columns For Commodore CBM 80 column/SuperPet

BGSICALC Your Computer Drone for Repetitive Calculations The outstanding advantage of using a computer is that it acts not only as a pencil and paper but as a perfect eraser and an automatic calculator. The user can quickly and easily make any number of alterations to the data within the table. The BUSICALC will evaluate any formula using the data that has been entered. Further, it retains the formulas and displays the resulting value. With BUSICALC controlling the entry of data, provid­ ing a comprehensive memory, and performing arithmetic, the preparation of a spreadsheet is faster and more accurate than if it were prepared by hand.

BGSICALC With the Sting Removed from the Prices

BUSICALC 20 ...... only $49.00 for the VIC 20 BUSICALC 64 ...... only $69.00 for the CBM 64 BUSICALC 40 ...... only $79.00 for the original 40 column PET/CBM BUSICALC 80 only $89.00 for the original 80 column CBMs and SuperPets

BGSICALC AVAILABLE NOW FROM YOUR LOCAL DEALER (800) 227-9998 FOR THE NAME OF YOCJR NEAREST DEALER California, Canada, Alaska and Hawaii please call (415) 965-1735

Skyles Electric Works 231G South Whisman Road | Mountain View, CA 94041

Europe please contact Supersoft, Winchester House, Canning Road, Harrow Wealdstone, Middlesex, England HA3 7SJ, Tel. 01 861 1166

Circle No. 38 w e v e B E /E A J B U S Y ! HAVef/Y MEAXh FRbMUt M A Wft/Li v magy w#a t

We have been upgrading our board level products — w e 'v e b b e a / If you are expanding your existing AIM, SYM or KIM computer, or building a system from the ground up, check out these updated boards — t > 0 W 6 ? DRAM PLUS now 16/32/64/80/128 K bytes plus up to 8K static RAM or EPROM Programmer, VIA’s... VIDEO PLUS/MICRO Plus has been refined... FLEXI PLUS has gone to 64K dynamic RAM, DMA for the Floppy and IEEE 488, 2 MHz... A c e r I

□ c n m m m I

m m m M We have developed a complete Typesetting System which expands the capabilities of an We have been expanding the EditWriter to accept data from the phone capabilities of the FOCUS™ System — lines, produce plain paper proofing copy, use and have added a lot of software: improved word processing techniques, TypePlus — a complete word processing plus run a variety of printing/publishing system oriented packages. SpellingPlus — interactive spelling checker Dynacalc™ — the latest in VisaCalc™ type We have given "SERVICE CALL" a new meaning. Spread Sheets Using our Master/Slave programs, Accounts Receivable/Accounts Payable and a system can be examined, tested and other business packages often fixed via the telephone!!! Blown Mailing List with Form Letters and more... data disks, strange malfunctions, and other ‘quirks’ can be cured immediately — over the telephone. Software updates can also be sent directly to your system. Seub He Moze 1 h f o r m AT/o n YES — we have been very busy. In addition to our development work in both hardware and Name_ software, we have been providing board level products to a variety of OEMs and end users.* Company We don’t have time right now to tell you about all of the things we can provide, but, write or Address _ give us a call and we’ll make time!!! C ity____ .S tate. .Zip Call us at 617/256-3649 or call our FOCUS System at 617/250-1460 (300 BAUD) f t / INTEREST IS;.

*Significant OEM Discounts Start At Only Five (5) Units. FOCUS, DRAM PLUS, VIDEO PLUS, MICRO Plus, FLEXI PLUS, and TypePlus Trademark TCI THE COMPUTERIST Dynacalc TM Computer Systems Center 34 Chelmsford St., Chelmsford, MA 01824 VisaCalc TM VisaCorp 617-256-3649

Circle No. 39

64 MICRO No. 58 - March 196 program to the end of it. BASIC has two memory locations that hold the address of the end of a BASIC program in memory. That address is used for saving BASIC programs to tape. Also, when you edit anything in BASIC, the address is used to BANNER: A Display find out how much memory has to be moved. Since BASIC does not use the address for listing or Program for the running a program, you do not have to worry about your machine-language program interferring with your BASIC program. While it is reading-a Color Computer program, BASIC looks for three zeros to determine the end of program. All you have to do is find out by Bryan Christiansen the address of the end of your BASIC program and add the length of your machine-language program to it. Then change the end-of-program memory location to the number you calculated. Finally, store your machine-language program in memory and you have combined the two programs. The machine-language program moves up and down in memory with your BASIC If you have ever wanted to see your name in program so you do not have to worry about lights, I Have just the program for you. The changing your BASIC program. Also, since there is routine is written for the TRS-80 Color Computer no need to reserve memory for machine-language and displays large-size messages on the CRT routines, you are using the memory in your screen. In addition, I have included some powerful computer economically. Accidentally clearing machine-language loading techniques that provide string space will not destroy the machine-language efficient and safe handling of machine-language routines. subroutines. There are some limitations to the technique: My program lets you input any message with the machine-language routine has to be position- capital letters and punctuation. You can vary the independent, and since the routine moves every height, width, and speed of the display. The time you change your BASIC program, you may program prints the large letters and the have trouble finding your machine-language background on the video monitor with any program. BASIC can find it easily just by PEEKing character the computer can generate in the the address those two memory locations hold. alphanumeric mode. The message scrolls from left Since your machine-language program does not to right, just like on Wall Street! change its length, BASIC only has to subtract to The program is smooth and versatile because find the beginning of your machine-language machine-language subroutines do a lot of the program. You do it like this: enter work. One routine fills the screen with any character; another routine does the printing and PRINT PEEK (27)*256 4- PEEK(28) scrolling. Here is a brief explanation of how my program Copy down the address the computer gives, add works. First, all the character definitions are in the length of your machine-language subroutine to the form of string arrays. From those strings in the number you have on paper, then POKE the BASIC, the program makes a table in memory, new number back into those memory locations. which the machine-language subroutine reads. Since the number will be different for different There is also an array that contains the programs, I have put a # sign where you are to information required to construct each letter. The insert the number you calculated. Enter BASIC program points to the memory location of strings to be printed, and the machine-language POKE 27,INT(#/256) : POKE 28, # - INT(#/256)*256 subroutine takes care of the rest. The BASIC program also controls the speed, the size, and the Take the first number you wrote down and add colors of the letters. one to it. You can start POKEing in your machine- This article includes information on how you language program at that memory location. Now can combine the BASIC code with the machine- save your BASIC program. The next time you language routines. You can use this method with CLOAD, it will load in your BASIC program and your own programs. First, the theory is to take a your machine-language program at the same time. BASIC program and tack a machine-language To find the beginning of your machine-language

No. 58 - March 1983 MICRO 65 program simply add a line like this to your BASIC program starts scrolling immediately and takes program (put the length of your machine-language less memory. program where I have a # sign): Here is a simple outline of the program

A = PEEK (27)*256 + PEEK (28) - # 10-30 SET UP 40-100 M.L. LOADER To combine the machine language with the 110-1270 STRING PATTERNS BASIC in my program start by entering this line: 1280-1290 MORE SET UP 1300-1420 CHARACTER SET LOADER 30 EN = PEEK (27)*256 + PEEK (28)-972 1430-1570 M AIN LOOP 1580-1670 MENU Then enter 1680-2020 ROUTINES FOR CHANGING PARAMETERS PRINT PEEK (27)*256 + PEEK (28) Write down the number and add 972 (routine You can change the starting message by length) to the number. Put that number where I changing line 30. To change the startup have a § sign and enter parameters change line 1280. All the REM statements are between the ten intervals so you dc POKE 27,INT(#/256) : POKE 28, # - INT(#/256)*256 not have to type them. I suggest you save the Run the program. When it starts scrolling, program to tape before running it because a press the BREAK key and delete lines 34 to 90. mistake might destroy the program. When you Finally, enter have finished and you want to be sure all the letters are right, enter nothing for a message. The 1290 GOTO 1430 program will print the entire ASCII character set. Now the program is finished. You can save a Bryan Christiansen is a 15-year-old freshman in high copy and when you load it in the next time it will school. You may contact him at 314 N. 25th Ave., load in the machine language also. Since the Fargo, N D 58102. program gets rid of the wait at the beginning, the Machine Language Listing

* LNLNTH EQU $1F Screen line length * * COLOR EQU $80 Background color RIM + POWER * SCRSTR EQU $400 Scrn mem start address * SCREND EQU SCRSTR+S200 S c m men end+$200 * ORG $3C35 * from STRING EQU *-$2 Addr for para/n passing COMPUTECH * * Initialize C35 86 80 START1 LDA 0COLOR Get backgroung color * C37 C6 IF LDB #LNLNTH ' Get screen line Get screen add C heck the C39 8E 0400 L00P1 LDX 0SCRSTR All prices * Clear left hand edge * p o s t p a i d outstanding * C3C A7 80 STA ,X+ Clear one loc. on left ed * (Continental d o c u m e n ta ­ * CJE 3A ABX Line increment X * U.S.- tion supplied * C3F 8C 0600 CMPX #SCREND Done? * CA2 2D F5 BLT L00P1 No, continue otherwise with AIM65! * Move screen back 1 address 52 credit) * CAA 8E 0400 LDX #SCRSTR Get screen add * CAl A6 01 L00P2 LDA 1,X Load char and C49 A7 80 STA ,x+ Move it back one CAB 8C 0600 CMPX #SCREND > Done? Top quality power supply designed to Rockwell's specs for fully * CAZ 2D F7 BLT L00P2 No, continue populated AIM65 — includes overvoltage protection, transient sup­ * Print right hand edge pression, metal case and power cable: * C50 8E 04lF LDX #SCRSTR+$1F Get upper right corner PSSBC-A (5V 2A Reg; 24V ,5A Avg, 2.5A Peak, Unreg) .... >64.95 * C53 FE 3C33 LDU STRING Get addr of string to be Same but an extra AMP at 5 volts to drive your extra boards: printed PSSBC-3 (5V 3A Reg; 24V ,5A Avg, 2.5A Peak, Unreg) .... ’74.95 C56 A6 C0 LOOP 3 LDA ,U+ Load char and * The professional's choice in microcomputers: C58 A7 80 STA ,x+ Print it * AIM65/1K RAM ...... ’429.95 BASIC (2 ROMS) ...... *59.95 * C5A 3A ABX Increment X to next line * AIM 65/4K RAM ...... ’464.95 ASSEMBLER (1 ROM) ...... ’32.95 * C5B 8C 0600 CMPX #SCREND Done? FORTH (2 ROMS) ...... ’59.95. C5E 2D F6 BLT . L00P3 No, continue * * End * SAVE EVEN MORE ON COMBINATIONS * C60 39 RTS AIM 65/1K + PSSBC-A ... ’479.95 AIM65/4K + PSSBC-3 ...’524.95 * * Clear entire screen (CLS) * We gladly quote on all A IM 65/40 and RM65 items as well. * C6l 86 80 START2 LDA #C0L0R Get background color * C6J 8E 0400 LDX #SCRSTR Get screen add ORDERS: (714) 369-1084 C66 A7 80 LOOP4 STA ,X+ Clear one location * * C68 8C 0600 CMPX #SCREND Done? P.O. Box 20054 • Riverside, CA 92516 o n C6B 2D F9 BLT L00P4 No, continue California residents add sales tax * * * « END 3C6D RTS * * 39

Circle No. 40

66 MICRO No. 58 - March 19: BASIC Listing BASIC Listing (continued) BASIC Listing (continued) 670 A$(56)="gg g" 1440 IF STUFF?=""THENSTUFF?="!"+CHR?(34)+"#?*&' ()*+, 680 A$(57)="g g e« /0123456789:; < = > ?gABCDEFGHIJKLMNOPQRSTUVWXYZ" 685 REM---- LETTER COMBINATIONS- 1 REM- 1450 FOR A=1 TO LEN (STUFF?) 690 B$(l)="l 1111111" 2 REM- -BRYAN CHRISTIANEN— 1460 UORK$=MID$(STUFF®,A,1) 700 B$(2)="l 2 " 3 REM- -314 N. 25 AVE.---- 1470 B=ASC(WORK$)-31 710 B$(3) = "l 3 13 ” 4 REM- -FARGO, ND 58102-- 1480 IF B < 10RB > 59THENB=1 720 B$(4)="l 4 4 5 4 5 4 4 " -COPY VRITE 11 /11/82-5 REM- -COPYVRITE 11/11/82-5 1490 FOR C-l TO LEN(B$(B)) STEP 2 730 B$(5) = "l 6 7 7 5 7 7 8 " 10 CI^0:PRINT82+32*7>"banner by bryan Christiansen" 1500 D=VAL(MID$(B$(B) ,C,2)) 740 B*(6)="l 9 101112131415'' :POKE1024+8+32*7,32:POKE1024 1510 D=EN+44+16*D 750 B$(7)="1 1617187 192017" +11+32*7,32:POKE1024+17+32*7,32 1520 POKE EN,INT(D/256) :POKE EN+l,D-INT(D/256)*256 760 B$(8)="l 2122" 20 CLEAR256:STUFF$="BANNER BY BRYAH CHRISTIANSEN! ! 1530 FOR E=1 TO UIDTH: X= USR0 (0): NEXT E 770 B$(9) = "l 232425" PRESS THE SPACE BAR TO ENTER PROGRAM! ! " 1540 FOR F=1 TO SPEED: IFINKEY$=" "THEN 780 B$(10)="l 252423" 30 EN=154U PLAY"V3101T255AA": GOTO1580ELSE NEXTF 790 B$(ll)="l 2627235 232726" 34 REM---- MACHINE LANGUAGE---- 1550 NEXT C 800 B$(12)="l 2626265 262626" 35 REM- -SCROLLER- 1560 NEXT A 40 FORA=0TO44: READB: POKE EN+2+A, B: NEXTA 810 B$(13)="l 2829" 1570 GOTO 1450 820 B$(14) = "l 26262626262626" 50 DATA134,128,198,31,142,4,0,167,128,58, 1575 REM---- MENUE------140,6,32,37,248 830 B$(15)="l 2828" 1580 CLSl:PRINTg0," MENUE":PRINT:PRINT 840 B$(16) = "l 30163126322221" 60 DATA142,4,0,166,136,1,167,128,140,6, 1590 PRINT" #1 -CHANGE COLOR OR HEIGHT" ; 0,45,246 850 B$(17) ="1 12252525252512" 1600 PRINT" *2 -CHANGE WIDTH" 860 B$(18) = "l 335 30" 70 DATA142,4,31,254,60,50,166,192,167, 1610 PRINT" #3 -CHANGE SPEED" 128,58,140,6,0,45,246,57 870 B$(19)="l 3334357 7 7 9 " 1620 PRINT" #4 -CHANGE MESSAGE" 880 B$(20) = "l 24257 7 7 7 36" 74 REM---- CLEAR SCREEN WITH--- 1630 PRINT" #5 -RUN MESSAGE 75 REM- -CHR$- 890 B$(21) = "l 31374 38395 31" 16-40 PRINT: PRINT: PRINT" INPUT A NUMBER 80 FORA=0TO12:READB:POKE Eti+47+A,B:NEXT 900 B$(22)="l 407 7 7 7 7 15" AND PRESS < enter >" 90 DATA134,128,142,4,0,167,128,140,6,0,37,249,57 910 B$(23) = "l 127 7 7 7 7 8 " 1650 PRINT:INPUT"WHICH NUMBER???";D 920 B$(24) = "l 21213411413 " 100 POKE EN+34,INT(EN/256) :POKE EN+35,EN- 1660 IF D< 1 OR D> 5 THEN1580 INT(EN/256) *256 :DEFUSR0=EN+2: DEFUSRl=EN+47 930 B$(25) ="1 367 7 7 7 7 36" 1670 ON D GOTO1680,1910,1950,1990,1430 105 REM---- LETER PARTS------940 B$(26) ="1 6 7 7 7 7 7 12" 1675 REM---- COLOR AND HEIGHT-- 950 B$(27)="l 4242" 110 DIMA$(57),BJ(59) 1680 CLS:PRINT" COLOR AND HEIGHT" 120 A$(l)=" 960 B$(28) = "l 4344" 1690 PRINT:PRINT" IF YOU KNOW THE NUMBERS YOU 1381 A$(2) = e e m g" 970 B$(29) = "1 264 2425" WANT PRESS < N > < ENTER> ELSE PRESS 980 B$(30) = "l 4 4 4 4 4 4 4 " 140 A?(3) = ee ” < Y > < ENTER> FOR HELP." 150 A*(4)= e e " 990 B?(31)="l 25244 26" 1700 INPUT"DO YOU NEED HELP?";D? 160 A?(5) = ' eeeeeee n 1000 B$(32) = "l 22212119454546" 1710 IF D$ < > "Y"THEN1820 170 A$(6) = ee e ” 1010 B$(33) = "l 12257 47473548" 1720 1=0: CLS: FORH=0TO255 1020 B$(34) = "l 494 3839384 49" 180 A$(7) = e e g" 1730 P0KE1514,H 190 A$ (8) = e ee " 1030 B$(35)="l 5 7 77 7736" 1740 PRINTg491,"------"H; 1040 B$(36)="l 12252525252524" 200 A$(9)= «« «" 1750 PRINTg511," " 210 A$(10 ="« e e " 1050 B$(37) = "l 5 252525252512" 1760 I=I+1:IFI>6THEN1800 220 A$(ll ="g gg " 1060 B$(38) = "l 5 7 7 7 7 2525" 1770 NEXTH 230 A$(12 =" m e t ” 1070 B$(39)="l 5 454545452121" 1780 PRINTg451, "PRESS ANYTHING TO CONTINUE"; 240 AJ(13 =" gg g" 1080 B$(40) = "l 12252525257 50" 1790 IF INKEY$=”"THEN1790ELSE1680 250 A$(14 =" g e g" 1090 B$(4l) = "l 5 26262626265 " 1800 PRINTg451,"PRESS ANYTHING TO CONTINUE"; 260 A$(15 ="g gg " 1100 B$(42)="l 255 25" 1810 I=0:IF INKEY$= ""THEN1810:ELSE1770 270 A$(16 =" g " 1110 B$(43) = "l 16303030303051" 1820 CLS: PRINT" COLOR AND HEIGHT" 280 A$(17 =" g % %" 1120 B$(44j = "l 5 3131264 2425" 1830 PRINT:PRINT" INPUT A NUMBER FOR THE" 290 A? (18 ="ggg g" 1130 B$(45)="l5303030303030" 1831 PRINT" LETTERS AND INPUT A NUMBER FOR" 300 A$(19 ="g g«g" 1140 B$(46) = "l 5 3 5231523 5" 1832 PRINT"THE NUMBERS. THE NUMBERS MUST" 310 A$(20 ="g g e " 1150 B$(47)="l 5 3 322631535 " 1833 PRINT'BE BETWEEN 0 AND 255- INPUT THE" 320 A$(21 ="g 1160 B$(48) = "l 5 25252525255 " 1834 PRINT "NUMBERS LIKE THIS" 3381 A$(22 =” e " 1170 B$(49) = "l 5 454545454546" 1835 PRINT" < LETTERS,BACKGROUND> < ENTER> 340 A$(23 =» «gg " 1180 B*(50) = "l 12252525355455" 1840 PRINT: INPUT "NUMBERS?" ;KOLOR, BACK 350 A$(24 =" g g " 1190 B$(51)="l 5 454545111^9 " 1850 IF KOLOR < 0 OR BACK<0 OR KOLOR>255 OR 360 A$(25 1200 B$(52)="l 467 7 7 7 7 28" BACK > 255 THEN PRINTg352, " NUMBERS 370 A$(26 1210 B$(53)-"l 2121215 212121" MUST BE BETWEEN 0 AND 255" : 380 A$(27 1 g g g " 1220 B$(54) = "l 51303030303051" FORA=0TO1000:NEXT:GOTO1820 390 A$(28 %%" 1230 B$(55) = "l 3 52283028523 " 1860 CLS :PRINT" COLOR AND HEIGHT" :PRINT 400 A$(29 - ggg" 1240 B$(56)="l 5 53373237535 " : PRINT" DO YOU WANT SINGLE OR g„ 410 A$(30 1250 B$(57) = "1 25244 264 2425" DOUBLE HEIGHT? INPUT A < 1 > ORA < 2 > . " 420 A$(31 1260 B$(58) = "l 3 32262926323 " 1870 PRINT :INPUT"NUMBER?"; HEIGHT 430 A$(32 1270 B$(59) = "l 2534357 575625" 1880 IF HEIGHT< 1 OR HEIGHT> 2 THEN PRINTg320, 440 A$(33 =" g gn 1280 KOLOR=201: BACK= 169: SPEED=20: " NUMBER MUST BE BE 1 OR 2”: FOR A> 450 A? (34 =”g gg" WIDTH=1:HEIGHT=1:E=4:F=5 0TO1000: NEXT: GOTO 1860 460 A$(35 1 gg" 1290 GOSUB1300: GOTO1430 1890 IF HEIGHT=1THENE=4:F=5:ELSEE=1:F=1 470 A$(36 gg « g " 1295 REM---- LOAD LETTER SET--- 1900 GOSUB1300: GOTO1580 480 A*(37 1300 CLS0:PRINTg4,"vait for a count of 57"; 1905 REM---- WIDTH------490 A$(38 =" g g " 1301 POKE1024+8,3 2 : POKE1024+12,32 :POKE1024+l4,32 1910 CLS:PRINT" WIDTH" 500 A$(39 ="g g " 1302 POKE1024+20,32: POKE1024+23,32: POKE1024+24,32 1920 PRINT:PRINT” INPUT A NUMBER FOR THE 510 A$(40 = "«««g g" 1303 POKE1024+25,55:PRINT«32:C=EN+60 WIDTH. SUCH AS ."; 520 A$(4l ="g g " 1310 FOR A=1 TO 57 1930 PRINT: INPUT"NUMBER? "; WIDTH 530 A$(42 ="gg gg" 1320 PRINT A; 1940 GOTO1580 540 A$(43 =”gg gg " 1330 FORD=lTOE: POKEC, BACX: C==C+1: NEXTD 1945 REM---- SPEED------— 550 A$(44 -"g g ggg" 1340 FOR B=1 TO 7 1950 CLS:PRINT" SPEED" 560 A$(45 ="g g » 1350 C$=MID$(A$(A),B,1) 1960 PRINT:PRINT" INPUT NEW SPEED. THE 570 A$(46 =" gg » 1360 IF C$="g" THEN CHR=KOLOR ELSE CHR=BACK HIGHER THE NUMBER THE SLOWER 580 A$(47 ="g g g g" 1370 FORG=lTOHEIGHT THE SPEED." 590 A$(48 =" ggg g" 1380 POKEC,CHR:C=C+1 1970 PRINT: INPUT"NUMBER? "; SPEED 600 A$(49 =" gggg" 1390 NEXTG 1980 GOTO1580 610 A$(50 =" ggg » 1400 NEXT B 1985 REM---- CHANGE MESSAGE---- 620 A?(51 ="88888g " 1410 FORD=1TOF: POKEC, BACK: C=C+1: NEXTD 1990 CLS: PRINT” CHANGE MESSAGE" 630 A$(52 =" gg " 1420 NEXT ArRETURN 2000 PRINT:PRINT" INPUT YOUR NEW MES 640 A$(53 =" gg" 1425 REM---- MAIN LOOP------SAGE. SUCH AS < MESSAGE X ENTER >." 650 A$(54 ="g « " 1430 POKE EN+3,PEEK(EN+60) -.POKE EN+48,PEEK(EN+60) 2010 PRINT:LINE INPUT"YOUR MESSAGE---- ";STUFF$ 660 A? (55 =" gggg g" :X=USR1(0) 2020 GOTO1580

No. 58 - March 1983 MICRO 67 c o m m o d o r e c o m m o d o r e

E3GLE TeleVideo 0 0 3 2 ...... $ 10 39 .00 403 2 ...... $74 9.0 0 V I C s o 8 0 9 6 U pgrade K i t ...... $36 9.0 0 S uper P e t ...... $ 1 4 9 9 .0 0 2031 ...... $ 46 9.0 0 $149 0250 Dbl.Sided Disk Drive ... $1699.00 D9060 5 Meg. Hard Disk. . . $2399.00 & \ TERMINALS D 9 0 6 0 7.5 Meg. Hard Disk ... $2699.00 ifS ttttttttttn u \ 9 10 ...... $57 9.0 0 8 0 5 0 ...... $ 1 2 9 9 .0 0 9 12C ...... $69 9.0 0 4 0 4 0 ...... $96 9.0 0 920C ...... $74 9.0 0 8300 (Letter Quality) ...... $1 5 49.00 9 25C ...... $74 9.0 0 8 0 2 3 ...... $ 6 9 9 .0 0 VIC 20 O ust C o v e r ...... $ 9 9 9 64K Ram 9 5 0 ...... $95 0.0 0 4 0 2 2 ...... $ 39 9 .0 0 VIC 1530 Datassette ...... $ 69 .00 780 KB Disk Slorage WYSEWY100 $749 00 NewZ-Ram.AddsCP/Ma64K. . $549.00 VIC 1541 (64K Disk Drive) $33900 $ 3 3 9 0 0 Word Processing, Ultracalc C P/M ' COMPUTERS The M a n ag er ...... $ 2 0 9 .0 0 VIC 1525 Graphic Printer 800A $ 1 2 9 9 0 0 VIC 1210 3K Mem. Exp . $32 00 C-Basic Software M a g is ...... ' ...... CALL 802 $264900 Word Pro 5 Ptus ...... $31 9.0 0 VIC 1110 8 K Mem. Exp $ 5 3 0 0 Smith Corona TP 1 802H $469500 W ord Pro 4 P lu s ...... $ 29 9.0 0 VIC 1111 16K Mem. Exp, . . . $94 00 Letter Quality Printer 806 $4999.00 W ord Pro 3 P lu s ...... $ T 99.00 VIC 1011 RS232C Term. Interface $43.00 $2995.00 8*i e $ 8 9 9 9 0 0 The Administrator ...... $ 37 9 .0 0 VIC 1112 IEEE-488lnterface . . $86.00 303 CALL Info Pro Plus ...... $21 9.0 0 VIC 1211 Super Expander . $ 53 00 EAGLE 1 6 0 0 ...... CALL 1602-1603 C/*'.L P o w e r...... $ 79 .00 VIC M o the r B o a rd ...... $ 99.00 TIMEX SINCLAIR SEC 1 0 0 0 PC-1500 COMPUTERS POCKET 8 0 0 1 A $71 9.0 0 $85. 0031 $71900 COMPUTER 8012 $54900 $ 1 6 9 PRINTERS 0C23 $469 00 16K Memory Module ...... $ 44.95 7710/7730 $239900 V u-Calc ...... $ 1 7 9 5 3510/3530 $159900 Check Book Manager ___ $ 1 3 9 5 CE 1 50 Printer. Plotter and V I C 6 4 MONITORS The O rg a n iz e r...... $ 14.95 Cassette Interface Unit. . $172.00 JB-1260 $11900 The Budgeter $ 13.95 CE 1 52 Cassette Recorder .. $62.00 $429. JB-1201 S 149 00 Slock Option ...... $14.95 CE 155 8K Ram PROFESSIONAL SOFTWARE JC-1212 S29900 Loan & Mortgage Amortizer $ 12.95 Expansion M o d u le ...... $ 94.00 Word Processing for VIC 6 4 ____$ 79.95 JC- ‘ 203 $ 6 2 9 0 0 Mindware Printer...... $10 9.0 0 CE 1 25 Printer/MicroCassette ... $129.00

MONITORS PRINTERS MODEMS SMITH CORONA AMOEK HAYES TP 1 $599.00 100 8 & W $ 7 4 95 S m a rt...... $229.00 300G $ 16 9 .0 0 C. ITOH (TEC) Smart 1200(1200 Baud) 3549.00 300A $1 7 9 0 0 Starwriter(F10-40CP$) $1399.00 C hronograph...... $199.00 Color $ 3 3 9 0 0 Prmtmaster(F10-55CPS) $1749.00 Micromodem 100 $309.00 Micromodem M $279.00 C olor 1 $ 6 9 9 0 0 Prowriter 80 Col (Parallel) . $499.00 NEC Micromodem M (wilh Terms) . $299.00 C olor 1 A $ 7 9 9 0 0 Prowriter 80 Col.(Serial) ...... $ 62 9 .0 0 3550 PRINTER... $2099 C olor II $ 3 9 9 00 Prowriter 2 (1 32 Col.) ...... $ 7 9 9 00 PERCOM DRIVES C olor V CALL NOVATION OKIOATA 5V," 160K D isk D m -e ...... $ 2 4 9 .0 0 C a t...... $144.00 8 2 A ...... $ 42 9 .0 0 320K Disk D rive ...... $ 2 9 9 00 BMC D -C at...... $159.00 8 3 A ...... $ 6 5 9 .0 0 AMOEK 12" G reen ...... $ 79 .99 212 Auto C at ...... $589.00 84 (Parallel) ...... $ 1 0 4 9 .0 0 13 Color 1401 (Mid Res.) $369.00 Apple Cat II ...... $279.00 310A Amber M onitor ...... $1 79.00 84 (Serial) ...... $ 1 1 4 9 .0 0 9191 U 1 3 " ...... $ 3 2 9 .0 0 212 Apple Cat I I ...... $609.00 3 1 0 G ...... $1 79.00 IDS J-Cat...... $119.00 A m disk (3 ’/4" D r iv e )...... $ 7 2 9 00 DXY Plotter ...... $75 9 .0 0 TAXAN M ic ro P ris m ...... $ 6 4 9 .0 0 Cat 103...... $199.00 1 32 (Fully Configured) ...... $1 5 99.00 Cat 103/212...... $439.00 C olor I I ...... $69 9 .0 0 RGB 1 $32900 80 (Fully Configured) ...... $ 1 3 9 9 .0 0 SOFTWARE Cal! for other configurations. ANCHOR I U.S. E asyw riter I I ...... $ 24 9 .0 0 ZENITH STAR Mark I (RS-232)...... $79.00 I.U.S. E a s y s p e lle r ...... $ 12 9 0 0 Peach Package (GL/AP/AR). $419.00 2VM 121 $ 99.00 G em ini 1 0 ...... $37 9.0 0 Mark fl (A tari)...... $79.00 G em ini 1 5 ...... $ 48 9 .0 0 Mark III (TI-99)...... $109.00 PROFESSIONAL SHARP Mark IV (CBM /PET)...... $1 25.00 OAISY WRITER SOFTWARE Sharp 13" Color TV $275.00 Mark V (OSBORNE)...... $95.00 Letter Quality...... 1049.00 IBM/PC Word Processing ...... $ 3 1 9 00 PANASONIC Mark VI (IBM -PC )...... $179.00 DIABLO MICRO PRO TR-120MIPiH.ghRes Green) . $159.00 Mark VII (Auto Answer Call)... $119.00 CT-160 Dual Mode Color $299 00 6 2 0 ...... $99 9.0 0 TRS -80 Color Com puter ...... $99.00 Word Star/Mail Merge . $ 39 9 .0 0 6 30 ...... $ 1 7 6 9 .0 0 9 Volt Power Supply ...... $9.00 computer mail order east 800-233-8950 IN PA. CALL (7 1 7 )3 2 7 -9 5 7 5 , 4 7 7 E.THIRD ST., WILLIAMSPORT, PA. 1 7701 in stock items shipped same day you call. No risk, no deposit on C.O.D orders. Pre-paid orders receive free shipping within the Continental United States with no waiting period for certified checks or money orders. Add 3% (minimum $3.00) shipping and handling on ail C.O.D. and Credit Card orders. N V. and PA. residents add sales tax. Ail items subiect to availability and price change, n o t e : We stock manufacturer s and third party software for most all computers on the market. Call today for our new catalogue. Circle No. 4 A HOME COMPUTERS FRANKLIN

OI8K DRIVES ATARI" POR ATARI

AT 8 8 -S 1 $39 9 0 0 AT 8 8 -A t $28 9 0 0

RFD 4 0 -S i $539.00 RFD40-A1 $32 9 00 R F D 4 0 S 2 $869 00 8 0 0 ACE 1000 R F D 4 4 S 1 $65 9 00 ACE 10 with Controller Card R FD 44-S 2 $999 00 400 4 8 K ...... $ 4 9 9 ACE Writer Word Processor 1BK...... $199 Call for Price and CALL... RANA DISK DRIVES Call for price and availability on the 3SK ...... $274* Availability of the NEW FOR SYSTEM PRICE! new Rana Disk Drives for The Apple 48K ...... S35S * 64K ATARI 1200 A ce 1 0 0 0 ...... CALL and Franklin Computer Systems. •Non-Atari Ram Axlon 32K Ram $ 8 9 0 0 410 Recorder ...... $74 .00 Axlon 48K Ram $ 1 3 9 0 0 810 Disk Drive ...... $429.00 Axlon 128K Ram $ 3 9 9 0 0 SYSCOM II P B H l 8 22 P rin te r...... $ 26 9 00 Intec 48K Board ...... $ 159.00 8 25 P r in te r ...... $58 9.0 0 Intec 32K Board $74 00 48K Color,Computer 8 30 M o d e m ...... $159.00 O ne Year E xte n de d W arranty $ 7 0 0 0 100% Apple Compatible 8 20 P r in te r ...... $25 9.0 0 CX481 Entertainer Package $ 69 00 Apple Soft Basic 8 50 In te rfa c e ...... $ 16 9 00 CX482 Educator Package $ 1 3 0 0 0 $763.00 CX40 Joy Sticks (pair) ...... ‘ $ 18.00 CX483 Programmer Package $5400 MICRO-SCI C X 853 A tari 1 6 K R a m ...... $ 77 95 CX484 Communicator Package $344 00

VIBICORP DISK DRIVES POR ■■ SOFTWARE for Apple, IBM & Franklin ATARI APX APPLE & PRANKLIN V isid ex...... $18 9.0 0 P a c -M a n ...... $ 33.00 'ext Formatter $ 18 50 A 2 ...... $ 29 9 .0 0 V is ib le ...... $ 18 9.0 0 C e n tip e d e ...... $ 33.00 F jrr'Oy Budgeter $ 10 50 A 4 0 ...... $ 34 9.0 0 V is ip lo t...... $15 9.0 0 C averns of M a r s ...... $ 32.00 Eastern Front $ 2 4 0 0 A 7 0 ...... $ 45 9 .0 0 V is ite rm ...... $ 89.00 A s te ro id s ...... $ 29.00 Family Cash $10 50 C2 Controller . $ 79 .00 V is itre n d /P lo l...... $22 9.0 0 M issile C o m m a n d ...... $ 29.00 J u keb ox ...... $ 13 .50 C47 Controller ...... $ 89.00 V isiS che d ule ...... $ 22 9.0 0 S tar R a id ers...... $ 35.00 Downhill ...... $ 18 .50 D e sktop P la n ...... $18 9.0 0 FLOPPY DISKS G a la x ia n ...... $ 3 3 0 0 O u tla w ...... $ 18 .50 Viscalc

educational D IS C O U N T S : Additional discounts are available from both Computer Mail Order locations to qualified Educational institutions. APO & FPO: Add minimum $5.00 shipping on all orders. CP/M is a registered trademark of Digital Research. Inc CRT — Abbreviation for Cathode-Ray Tube. The television tube used to display pictures or characters. Also the computer terminal made A Beginner’s from a CRT.

Cursor — A position indicator displaying on the Computer video screen the position of a character to be cor­ rected, or a position in which data is' to be entered. Different terminals have different Glossary restrictions for cursor movements. Disk — A circular metal plate with magnetic material on both sides, continuously rotated for A Beginner’s High-tech Glossary reading or writing. Disks come in 8"- and 5 lA ” To help you befriend your computer and become sizes and are inserted into the computer to hold literate in its vocabulary, here is a list of information. commonly used words. Learn the meanings of these words and you will feel more comfortable DOS — Disk Operating System. Operating system advancing your computer knowledge. integrating disk-file facilities such as symbolic files, automatic space allocation, and sometimes ASCII — American Standard Code for Information dynamic memory allocation. Interchange. A standard 8-bit information code used with most computers and data terminals. EPROM — An electrically programmable ROM Many systems use only seven of the eight bits, suited for high performance systems that need providing a total of 128 possible characters fast turn-around for system program develop­ including upper- and lower-case alphabet, punc­ ment and for small volumes of identical pro­ tuation, numbers, spacing, and machine or con­ grams in production systems. trol commands. Input/Output^ — Commonly called I/O. 1. A general Assembly language — A machine-oriented language term for equipment used to communicate with a for programming. computer. 2. Data involved in such communica­ tion. 3. The media carrying the data for BASIC — Beginner's All-purpose Symbolic Instruc­ input/output. tion Code. One of the easiest computer program­ ming languages to learn and master. Interface — A common boundary between auto­ matic data-processing systems or parts of a single Bit — 1. A binary digit — either a 0 or 1. 2. A unit of system, or between two systems or devices. information capacity of a storage device. 3. A single pulse in a group of pulses. K (Kilo) — A symbol equivalent to the numeral 1024; e.g., 8K equals 8192. Bug — Any mechanical, electrical, or electronic defect that interferes with the operation of the Loop — 1. The repeated execution of a series of computer, or a defect in the coding of a program. instructions for a fixed number of times. 2. A coding technique for repeating instructions that Byte — A generic term to indicate a measurable are usually modified. portion of consecutive binary digits. A set of eight bits. A byte is universally used to represent Machine language. — 1. A set of symbols, character, or a character. Microcomputer instructions require signs, and the rules for combining them that con­ one, two, or three bytes. A word may be one byte veys instructions or information to a computer. long, or less, or more. One byte has two nibbles. 2. Information or data expressed in code that can be used directly without further processing. Chip — An integrated circuit[s) on a wafer slice, usually made of silicon. M atrix — A rectangular array of numbers subject to mathematical operation. A table is a matrix. CPU — Central Processing Unit. The central processor of the computer system, which con­ The glossary will be continued next month. tains the main storage, arithmetic unit, and special register groups. JMCftO

70 MICRO No. 58 - March 1983 SJB DISTRIBUTORS. THE MOST COMPETITIVE KMIAM'I'liUl □commodore SOFTWARE FOR CBM 6 4 Word Processing (WordPro 3 + ) ...... $69 Word-Pac (tape)...... 60

I The Assistant Series W riter’s Assistant (easy and flexible)...... 99 File Assistant (database with m e rg e )...... 99 Spreadsheet A ssistant...... 99 Personal Finance Assistant (great reports) ...... 45 Coco (computer tutoring game) ...... 44 Coco II (build your own games easily)...... 45 PRINTERS--LETTER QUALITY Home Accounting P a c k a g e ...... 39 General Ledger A/R, A /P (with check w riting)...... 17 5 e a | CBM 8300, 40 c p s ...... $1450 CBM EasyFinance...... 50 Diablo 620, 25 cps ...... 995 Data M a n a g e r...... 70 C om R iter 17 c p s ...... 899 Stock (investment analysis)...... 80 Transtar 130, 16 cps (auto load, wp features!) ...... 769 Pet Emulator (em ulates 4.0 basic)...... 30 Sprite*Magic (use joystick to design sprites)...... 19 NEC 7700 s e rie s ...... 2350 Assembler Package (cassette or disk, compiled, NEC 3500 s e rie s ...... 1600 includes editor, loader, disassembler) ...... 39 Motormania (arcade tape)...... 27 PRINTERS'*DOT MATRIX Renaissance...... 27 Colorsketch (draw on screen w/joystick, paint, CBM 4022, 80 cps/graphics ...... 395 save to tape or disk)...... 16 Spacebelt...... 20 CBM 8023, 150 c p s /g ra p h ic s ...... 589 M atc h m aker...... 16 Epson FX Printer ...... 529 RetrobaH...... 34 O kidata 82A, 1 20 cps (serial and p a ra lle l)...... 429 INTERFACES AND ACCESSORIES NEC 8023A (parallel) ...... 469 | 8 0 Column E x p an d er...... 159 IDS M icro p rism ...... 539 VIC 1 6 0 0 M o d em ...... 95 Star G e m in i...... 429 VIC 1650 (auto answer, auto dial) ...... 150 Star G em ini (1 5 c o lu m n s )...... 529 VIC 1525 Graphic P rin ter...... 3 29 Epson MX 80 R ib b o n s ...... 6 VIC 1530 Datasette Recorder ...... 65 VIC 1541 Disk D riv e ...... 329 COMMODORE BUSINESS SERIES VIC Switch (connect 8 6 4 ’s or Vies to printer.dd)...... 149 IEEE Interface...... 85 PET-IEEE cab le...... 33 SuperPet (5 languages, 2 p ro ce ssors)...... 1409 IEEE-IEEE cable (2m )...... 39 CBM 8032 C om puter, 80 C o lu m n ...... 1029 Parallel Interface (Epson, Okidata, IDS, NEC) ...... 80 CBM M em ory Expansion, 64K ...... 359 RS-232 Printer Interface (Okidata, Diablo, etc.)...... 60 PET 4032, 40 C o lu m n ...... 879 Apple L o a d e r...... 90 CBM 8050. 1 mg. Dual D riv e ...... 1 259 Programmers Reference Guide ...... 18 CBM 8250, 2 mg.. Dual D riv e ...... 1500 Verbatim Diskettes (10 per box)...... 26 Victree...... 75 CBM D9060, 5 mg. Hard D is k ...... 2240 CBM D9090, 7.5 mg. Hard Disk ...... 2600 VIC PRODUCTS AND ACCESSORIES CBM 4040. 340K Dual Drive ...... 919 8K RAM Memory Expansion C artrid ge...... 44 16K R A M ...... 85 CBM 2031, 170K Single Drive ...... 489 24K R A M ...... 129 DC Hayes Sm art M od e m ...... 220 VIC IEEE Interface...... 75 VIC 3 Slot E x p an d er...... 39 BUSINESS SOFTWARE VIC 6 Slot E xpander...... 70 R S232 Printer Interface...... 65 Cassette In te rface...... 27 W o r d P r o 4 * o r 5 + ...... 3 0 9 Intro to Basic I or I I ...... 22 A d m in is t r a t o r ...... 4 8 9 Home Finance Package (6 tapes)...... 47 V is iC a lc ( e x p a n d e d ) ...... 1 9 9 G o r f...... 30 T h e M a n a g e r ( d a t a b a s e ) ...... 1 9 9 Omega Race...... 30 BPI A/R, G/L, Job Cost, Inventory, Payroll ...... 3 2 5 le a . Video V e rm in ...... 29 TO ORDER CALL TOLL FREE Heswriter (wp cartridge)...... 29 Turtle Graphics (cartridges)...... 33 800-527-4893 800-442-1048 (Within Texas) Arcade Joystick - Heavy duty w/2 firing buttons! Great for the VIC or 6 4 ...... 25 SJB DISTRIBUTORS, INC. / i t \ MasterCard, Visa, Money Order, Bank Check 10520 Plano Road, Suite 206 COD (add S5) accepted. Dallas, Texas 75238 \ Add 3°o surcharge for credit cards. (214)343-1328 — -J I ‘ In stock items shipped within 48 hours, F.O.B, Dallas, TX All products shipped with m anufacturer's warranty.

Prices are subject to changewithout notice.

Circle No. 42

No. 58 - March 1983 MICRO 71 Circle No. 43

WE (SORT OF) LIED: Motorola has been promoting its advanced microprocessor 2) 68000 source code for the PROM monitor. 35 sectors. chip as a vehicle for large, complex systems exclusively. Now, the 68000 does work well as the heart of big, complex 3) 68000 source code for a very high speed interactive 3-D graphics demo. 115 sectors. systems. But their promotional literature implies that one c a n only build big, complex systems with the 68000, and that 4) 68000 source code for the HALGOL threaded interpreter. is dead wrong (in our opinion). Nevertheless, the public Works with the 68000 floating point package. 56 sectors. (that's you!) perception of the 68000 follows Motorola’s line: Big s y s te m s . Complex sy s te m s . 5) 6502 source code for the utilities to link into the BASIC floating point routines and utility and debug code to link into Our boards are not complex and not necessarily big (starting the 68000 PROM monitor. 113 sectors. at 4K ). Our newsletter is subtitled "The Journal of Simple 68000 Systems.” But since the public has become condi­ The above routines almost fill a standard Apple DOS 3.3 flop­ tioned to the 68000 as a vehicle for FORTRAN, UNIX, LISP, py. W e provide a second disk (very nearly filled) with various PASCAL and SMALLTALK people naturally expect all these utility and demonstration programs. with our $595 (starting price) simple attached processor. Wrong! SWIFTUS MAXIMUS: Our last advertisement implied that we sold 8MHz boards to We wrote our last ad to understate the software we have hackers and 12.5MHz boards to businesses. That was sort of available because we wanted to get rid of all those guys who true because when that ad was written the 12.5MHz 68000 want to run (multi-user, multi-tasking) UNIX on their Apple II was a very expensive part (list $332 ea). Motorola has now and two floppy disks. Running UNIX using two 143K floppies dropped the price to $111 and we have adjusted our prices ac­ is, well, absurd. The utilities alone require more than 5 cordingly. So now even hackers can afford a 12.5MHz 68000 megabytes of hard disk. board. With, we remind you, absolutely zero wait states.

HERE’S THE TRUTH: ‘Swiftus maximus’? Do you know of any other W e do have some very useful 68000 utility programs. One of microprocessor based product that can do a 32 bit add in 0.48 these will provide, In conjunction with a suitable BASIC com­ microseconds? piler such as PETSPEED (Pet/CBM) or TASC (Apple II), a five to twelve times speedup of your BASIC program. If you have AN EDUCATIONAL BOARD? read a serious compiler review, you will have learned that If you want to learn how to program the 68000 at the compilers cannot speed up floating point operations assembly language level there is no better way than to have (especially transcendentals). Our board, and the utility soft­ one disk full of demonstration programs and another disk full ware we provide, does speed up those operations. of machine readable (and user-modifiable) 68000 source co d e. Add this line in front of an Applesoft program: Those other ‘educational boards’ have 4MHz clock signals 5 PRINT CHR$(4);“BLOADUTIL4,A$8600”:CALL38383 (even the one promoted as having a 6MHz CPU, honest!) so we'll call them slow learners. They do not come with any That's all it takes to link our board into Applesoft (assuming significant amount of demo or utility software. And they com­ you have Applesoft loaded into a 16K RAM card). Now run municate with the host computer via RS 232, 9600 baud max. your program as is for faster number-crunching or compile it That’s 1K byte/sec. Our board communicates over a parallel to add the benefit of faster “interpretation”. Operation with port with hardware AND software handshake, at 71K the Pet/CBM is similar. bytes/sec! We’ll call those other boards handicapped learners. 68000 SOURCE CODE: For Apple II users only, we provide a nearly full disk of un­ Our board is definitely not for everyone. But some people find protected 68000 source code. To use it you will have to have it very, very useful. Which group do you fit into? DOS toolkit ($75) and ASSEM68K ($95), both available from third parties. Here's what you get: DIGITAL ACOUSTICS

1) 68000 source code for our Microsoft compatible floating 1415 E. McFadden, Ste. F point package, including LOG, EXP, SQR, SIN, COS, TAN, Santa Ana, CA 92705 ATN along with the basic four functions. The code is set up to work either linked into BASIC or with our developmental (714) 835-4884 HALGOL language. 85 sectors.

Apple, Applesoft and Apple II are trademarks of Apple Computer Company. Pet is a trademark of Commodore Business Machines.

72 MICRO No. 58 - March 1983 6 8 0 0 0 B C D and Privileged Instructions byJoeHootman

The information presented this privilege instructions used while in the command that causes the reset pin of month was compiled with the user mode; trace-mode operation; odd 68000 to go low. Any device connected assistance of Motorola, Inc. addresses associated with long word or to the reset pin is also reset. This com­ word data; and illegal or unimple­ mand allows the 68000 to reinitialize mented instructions. External sources the peripheral components using soft­ BCD Instructions consist of hardware interrupts, bus er­ ware in the supervisor mode. This month I have included a table of rors, or reset request. Return from Exception |RTE) is the BCD instructions |see table 1). These Exception processing is used when statement that is used to resume pro­ instructions are similar to BCD opera­ there may be a problem with either the cessing after an exception has occurred. tions in most microprocessors except software or hardware. The processor is Generally this statement is used at the that there are only three instructions designed so that when it is in the super­ end of some service routine to return implemented in the 68000. The basic visor state it can inform the user of control to the user. instruction operates on packed BCD possible software or hardware prob­ The STOP instruction is used to data, stored in memory, in the byte lems, and take the proper steps to cor­ stop the 68000 from fetching and ex­ mode. The traditional method used to rect these potential problems. ecuting instructions. Execution does implement complex operations on BCD Most of the privileged instructions not continue until an external inter­ data is to convert the BCD to binary, are used to manipulate the user stack rupt, trace, or reset exception occurs. perform the operations on the binary pointer and the system status register. The STOP instruction can be used to data, and then reconvert to BCD. There are, however, some special in­ stop the processor and wait for an structions that can be executed in the interrupt. The immediate data follow­ Privileged Instructions supervisor state. ing the instruction is used to set the The privileged instructions in table 2 Reset External Devices (RESET) is a status register. are used by the processor when exe­ cuting programs in the supervisor state. The supervisor state of the 68000 is considered to be a protected state; i.e., Table 1: BCD Instructions the user operating in the user mode does not have easy access to the super­ Mnemonic Data Size/CCR Name Comments visor state. When in the supervisor ABCD 8 Add Decimal The source and destination and the X bit are state the 68000 can make use of the full CCR with Extend added together using BCD arithmetic and the instruction set. However, when the X N Z V C result stored in the destination. The X bit is *U • U • normally set as the result of a previous BCD processor is in the user state, privileged calculation. instructions cannot be executed. If the Opword Fo user attempts to execute any one of the privileged instructions, the processor IS 14 13 12 II 10 9 S 7 6 5 4 3 2 1 0 will go into exception processing. Register 0 R/M Registei When entering exception processing, Rx Ry the S bit in the status register is set to 1 R/M = 0 specifies a data register. and the trace bit is set to 0. R/M - 1 specifies an address registei for the Exception processing can be entered predecrement addiessin (memory to memory |. two ways — by internal sources or by Rx field specifies destination register. external sources. Internal sources con­ Ry field specifies the source register. sist of the following: instructions such as TRAP, TRAPV, CHK, division by 0; (continued)

No. 58 - March 1983 MICRO 73 Table 1 (continued) Mnemonic Data Size/CCR Name Comments

SBCD 8 Subtract The source is subtracted, using BCD arithmetic, CCR Decimal from the destination (with the extend bit) X N Z V C with and the result is stored in the . u . u * Extend destination. Opword Format 15 14 13 12 11 10 9876543210 1 --- Register R/M Registei Rx Ry

R/M = 0 specifies a data register. R/M = 1 Specifies an address register for the predecrement addressing mode (memory to memory). Rx — specifies the destination register. Ry — specifies the source register.

NBCD Negate The addressed data along with the extension CCR Decimal bit is subtracted from zero, using BCD XNZVC with arithmetic, and the result is stored FOR SOFTWARE DEVELOPERS . u . u . Extend in the destination. AND HOBBYISTS! Opword Format 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 • extend memory of 16K RAM 0 1 0 0 1 0 0 0 0 0 Effective Address and 32K RAM computers Mode | Register • create 16K cartridges easily The effective address field specifies the with an EPROM programmer destination. The following effective addressing modes cannot be used: 2, 10, 11, 12, 13, 14." • combine ATARI® BASIC ROMs with your own subroutines U — the bit is not defined. on ROM/EPROM

• eliminate need for disk drive Table 2: Privilege Instructions and extra RAM for lengthy Mnemonic Data Size/CCR Name Comments p r o g r a m s MOVE 32 MOVE The contents of the user stack pointer is USP CCR User SP transferred to or from the specified CONFIGURATIONS: XNZVC address register. #1 Any combination of 4 Opword Format 2532 EPROMs/2332 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 R O M s 0 1 0 0 1 ,1 1 0 0 1 1 0 dr Register #2 Two ATARI ROMs dr field specifies the direction of transfer: and two 2532’s (or 0 — specifies the address register to USP. 2 3 3 2 ’s ) 1 -r specifies the USP to the address register. The register field specifies the address register . SPECIFY WITH ORDER that is used in the transfer.

Also order: MOVE 16 Move to The contents of the source operand is moved to 2532 4K EPROMs $7.50 each to SR CCR the Status the status register. XNZVC Register with cartridge order only * * • *' *' Opword Format 15 14 13121110 9 8 7 6 5 4 3 2 1 0

CHAMELEON COMPUTING® Q 1 0 0 0 1 1 0 1 1 Effective Address Mode | Register Dept, of Physics & Astronomy B o x 1 1 9 - M The effective address specifies the destination register. The following effective addresses cannot Dickinson College be used: 2, 10, 11, 12, 13, 14.* Carlisle, PA 17013 EOR1 16 Exclusive The immediate data is exclusive ORed with the (717) 245-1717 to SR CCR OR contents of the Status Register fSR) and the XNZVC Immediate results stored in the Status Register. * * * • * to Status Please add: Register Opword Format $1.50 shipping/handling 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 PA residents add 6% sales tax O 0 0 O 1 0 1 0 0 1 1 1 1 1 0 0 CHECK, MC, VISA Word Data Quantity discounts available (continued/ Circle No. 44

74 MICRO No. 58 - March 1980 Table 2 (continued) '/F ull Screen Editing Mnemonic Data Size/CCR Name Comments '/Copy-Move sentences, paragraphs '/Insert-Delete letters, sentences '/Form letters-User defined data ANDI 16 AND A lto the immediate data with the contents of '/Shorthand-words, phrases to SR CCR Immediate the Status Register (SR] and place the results '/ Centering-Justification-Tabs XNZVC to Status in the SR. '/Headers-Footers-set page size '/Automatic Page Numbering Register '/Double columns-set margin, line size Opword Format '/P rinter graphics-send hex codes '/S et up to support most printers 15 14 13 1211 10 9 8 7 6 5 4 3 1 1 0 '/D isk file concatenation '/Program update support provided 0 0 0 0 0 0 1 0 0 1 1 1 1 1 0 o THE NEXT LOGICAL Word Data STEP IN THE ORI 16 Inclusive The contents of the Status Register (SR) and the EVOLUTION of to SR CCR OR immediate data are inclusively ORed and the XNZVC Immediate results stored in the SR. * • * • • to Status WORD PROCESSING Register Opword Format COPY-WRITER 15 14 13 1111 10 9 8 7 6 5 4 3 2 1 0

0 0 0 0 0: o 0 0 1 1 1 1 1 0 0 Copy-Writer is a full featured professional quality 0 word processor. It offers all the capabilities required Word Data for high performance and efficiency. In addition, advanced features such as double columns, multiple disk files, printer hex control, etc. Copy-Writer is written in FORTH, a unique language that runs ANDI 16 AND The Status Register and the immediate data axe nearly as fast as machine code but actually occupies to SR less memory. This allows more room in memory for CCR Immediate logically ANDed and the results left in the lines of text. More than otherwise possible. XNZVC to the Status Register.' Copy-Writer updates will be distributed on request Status to all registered users for just the update cost. Even Register when a more powerful version is Introduced! Opword Format AVAILABLE FOR 40XX/8032/C64 15 14 13 1111 10 9 8 7 6 5 4 3 1 1 0 only $145.00 0 0 0 0 0 0 ,1 0 0 1 1 1 1 1 0 0 SEE YOUR DEALER OR: iP.O. Box 102 Word Data [MICROTECH] Langhorne, Pa. 19047 S 215-757-0284 DEALER INQUIRIES INVITED RESET ------Reset This instruction causes the reset pin of the CCR External 68000 to reset the external devices that are XNZVC Devices connected to the reset pin.

Opword Format Commodore 15 14 13 12 11 10: 9 8 7 6 5 4 3 2 1 0 Gets Smart 0 1 0 0 1 1 1 0 0 1 1 l \ 0 0 0 0 "Having a modem and a good terminal software package like this can really open STOP Load The immediate data is placed in the SR and up a new world of applications for your CCR Status the PC is advanced to the next instruction but Commodore system." — RobertW. Baker XNZVC Register processing stops at this point. Execution - MICROCOMPUTING Depends on and Stop of instructions resumes when a trace, Immediate interrupt, or reset condition occurs. ✓ record to disk/transmit from disk Data v7 output to Commodore/ASCII printer Opword Format v7 XON/XOFF control capability 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ✓ translates files ASCII/BASIC/W-PRO ✓ system status line-clock with alarm 0 I 0 0 1 1 1 0 0 1 1 1 0 0 1 0 ✓ user table allows encoded data Immediate Data v' user access to routines-telemetry

The most sophisticated terminal package RTE ----- Return The SR and PC are pulled from the system stack available. Gives you all the features need­ CCR from and processing continues at the PC pulled from ed now and for the future. Available - XNZVC Exception the stack in either user or supervisor state, Commodore 40XX, 8032 with 4040,8050. pulled from depending on the S bit in the Status Register (SR) P E D IS K II stack pulled from the stack: Available from cgrs MICROTECH, Opword Format P.O. Box 102, Langhorne, PA 19047 15 14 13 12 11 10 9 8 7 6 5 4 3 1 I 0 215-757-0284

0 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 $1 29.00 DEALER INQUIRIES INVITED

with Intelligent Terminal JMCftO" Communications Package COMPACK

Circle No. 45

No. 58 - March 1983 MICRO 75 Learn to program the ATARI , in 6502 Machine Language & BASK •

Three new ATARI books for the novice computer user msfl serious programmer and beginner, are language, the use of an a s l now distributed by IJG , for use with the ATARI 400 and 800 microcomputer BA! system s ATARI BASIC, Lei s is an action bo<

K UTILITIES i t ’s for ATARI400/800/1200.

cartridge. May be used to up or Vervan down load single boot files. All utility programs output can be dumped to printer. require no software Cassette or Disk $24.95 modifications and are DISDIIP For disk sector a must for all serious ATARJ BASIC information copying. May specify programmers. single sector, range of sectors, or all. CASDUP 1.0 & 2.0 To copy most Copies may be made without read BOOT tapes and cassette data files. varify. Disk $24.95 1.0 is a file copier. 2.0 is a sector IJG products are available at copier. Cassette only $24.95 computer stores, B. Dalton CASDIS To transfer most BOOT Booksellers and independent tapes and cassette data files to disk. dealers around the world. If IJG Disk only $24.95 products are not available from your FULMAR BASIC Utility Package. local dealer, order direct. Include VMAP-variable cross-reference, $4.00 for shipping and handling per IT’S CMAP-constant cross-reference item. Foreign residents add $11.00 (includes indirect address plus purchase price per item. U.S. references), LMAP-line number funds only please. cross-reference, FMAP-aU of the above. Will list "unlistable" IJG, Inc. 1953 W. 11th Street programs. Also works with Upland, California 91786 Editor/Assembler cartridge to allow Phone: 714/946-5805 editing of string packed machine language subroutines. All outputs JUST may be dumped to printer. Cassette or Disk $39.95 KffisfromE? DISASM To disassemble machine ITS JUST GREAT! language programs. Works with or without Editor/Assembler ATARI TM Warner Communications. Inc. GREAT!

76 MICRO No. 58 - March 1983 A Versatile Hi-Res Graphics Routine for the APPLE by Adam P. King

You can design and use those of the non-shoot-'em-up genre, it and input the program in listing 2 multicolored high-resolution is important the drawing of shapes does (Graphics Sub). This is the actual shapes on the AppJe. Software not destroy previously existing back­ routine. is provided for shape collisions, ground design. 3. Re-enter BASIC (3D0G) and type animation, and excluslve-OR Applesoft BASIC's graphics routine "BSAVE GRAPHICS SUB,A$800, drawing. proved limited on three counts: speed, L$300” . collisions, and multicolored shapes. Enter and save the programs in Speed — The Applesoft routines listings 3 and 4. The first, Shape Graphics Sub often produce a flicker effect when a Definer, allows you to construct requires: shape is moved. This is especially shapes. The second, Shape Table De­ Apple II with 48K and apparent when solid shapes (i.e., not finer, takes these individual shapes and Applesoft. stick figures) are used. The routine composes a shape table for use with the presented here is considerably faster graphics routine. and is designed to handle solid shapes. One of the deciding factors for my pur­ Speed does not come cheaply, however. chasing an Apple II rather than another This routine is relatively inefficient in Defining a Shape micro was the Apple's graphics capabil­ terms of memory storage so I suggest Before using Shape Definer it is a ities. The prospect of using the Apple to you use a 48K Apple. Unlike the Apple­ good idea to draw the shape on graph produce arcade-style games was par­ soft routines, this routine excludes a paper. Any graph paper will do; how­ ticularly inviting. Applesoft BASIC Rotation and Scale function, thereby ever, you should note that hi-res comes equipped with its own graphics gaining additional speed. “squares'' on the Apple are slightly routines. However, when using these Collisions — Applesoft routines do taller than they are wide by an approx­ routines to make my own games many not detect shape collisions. They are imate ratio of 1.13:1. Graph paper with inadequacies became apparent. The extremely difficult to implement this distortion produces more accurate programs presented in this article use a within a program using only Applesoft results. Numbered graph paper is ideal completely independent graphics rou­ commands. because it allows you to identify the tine to remedy these shortcomings. Multicolored shapes — In the cur­ odd and even columns (I will explain When designing the routine, I kept rent form of Applesoft graphics, defin­ later). When designing your shapes on the following criteria in mind as essen­ ing a single shape containing more than paper, fill in squares that will appear as tial for arcade-style graphics: one color is impossible. Multicolored colored dots and leave blank squares to Speed — The routine has to be fast to shapes are achieved only by super­ appear black when the shape is drawn. achieve smooth graphics movement. imposing one colored shape on another The following six rules provide a guide Multiple shapes — Many shapes must — a slow and tedious procedure. for defining a shape. be able to co-exist. Using different The routine presented here 1. Each shape has a Plot Code number. numbers to represent different shapes remedies the above problems and This number is either 1 or 0, depen­ is ideal. meets the rest of the criteria. In addi­ ding on whether your shape's left­ Collisions — For almost any graphics tion, this routine provides an easy-to- most column is drawn on even (0) or game it is necessary to know when one implement form of animation. odd columns (1). shape comes in contact with another 2. Each horizontal row of your shape shape or object on the screen. Entering the Graphics Routine has a Color Code that is either 0 or 1. Multicolored shapes — The appeal of Entering the graphics routine is a If the Color Code is 0 the row may multicolored shapes over solid colored three-part procedure. contain the colors violet, green, shapes is substantial. The flavor of 1, Enter the BASIC program in listing 1 black, or white. If the Color Code is most arcade games would be lost with­ (Make Tables) and run it. This sets 1 the row may contain the colors out a diversity of colors. up two tables, which are used by the blue, orange, black, or white. Constant background — For many graphics routine. 3. The following table decides the color arcade-style games, and especially 2. Enter machine language (call - 151) of an individual dot.

No. 58 - March 1983 MICRO 77 Colot Even Odd Listing 1: Make Tables Listing 2: Graphics Sub Code Columns Columns 5 = - 1 0 violet green 10 FOR L = 2J04 TO 2559:X = X + 1 1 blue orange 20 IF X = 7 THEN Y = Y + 1:X = 0 0800- AD FD 08 LDA $08FD 30 POKE L,Y 0803- 8D F9 08 STA 508F9 40 NEXT L:X = - 1 4. Any two horizontal dots placed side- 0806- 20 88 08 JSR 50888 50 FOR L = 2560 TO 2815:X = X + 1 0809- AE FE 08 LDX J08FE by-side on sequential columns ap­ 60 Y = X: IF INT (X / 2) = X / 2 080C- BD 00 09 LDA $0900,X pear white, overiding rule 3. THEN Y = Y + 1 080F- 8D 81 08 STA $0881 70 IF X = 13 THEN X = - 1 0812- 18 CLC 5. Black appears wherever there is no 80 POKE L,Y: NEXT L 0813- 65 26 ADC $26 dot, except in the specific case of 90 END 0815- 85 26 STA $26 rule 6. 0817- BD 00 0A LDA $0A00,X 081A- 8D 34 08 STA $0834 6. Two horizontal dots separated by a When you run Shape Definer, you are 081D- AD FF 08 LDA $08FF black space appear to form a solid asked specific questions about the 0820- 0A ASL 0821- 0A ASL line the color of the two dots. This shape. First you are asked for the 0822- 0A ASL rule does not apply if either or both shape's width (the maximum width of 0823- 0A ASL of the dots are white. the shape]. In the case of the man, the 0824- 8D 2E 08 STA $082E 0827- 8D 36 08 STA $0836 An example shape, shown in figure width is 7. Next you are asked for the 082A- 8D 3D 08 STA $083D 1, helps clarify these rules and serves length of the shape (the number of 082D- AD 00 0C LDA $0C00 as a trial run of the Shape Definer horizontal rows that contain the 0830- 8D FC 08 STA $08FC 0833- A2 05 LDX #$05 program. This "m an" is drawn with shape). The man's length is 15. Next 0835- BD 00 0C LDA $0000,X his first column placed on an even you must enter the shape’s Plot Code. 0838- 8D 4B 08 STA $084B 083B- E8 INX column in accordance with rule 1. He The man's Plot Code is 0. After answer­ 083C- BD 00 0C LDA $0C00,X has a green face, orange neck, violet ing these questions, the information for 083F- 8D 4C 08 STA $084C arms, white body, orange legs, and each row is requested beginning with 0842- A0 00 LDY #$00 0844- 8C FA 08 STY $08FA white feet. To understand how the col­ the top row and working down. For 0847- AE FC 08 LDX $08FC ors were derived, compare each dot by each row you enter the Color Code and 084a - AD 5B 0E LDA $0E5B Color Code and column parity with the 084D- C9 80 CMP #$80 then the row itself. The row is entered 084F- F0 36 BEQ $0887 six rules. as a string of 0's and l's. A 0 represents 0851- 8D FB 08 STA $08FB After your shape has been designed an empty square on the graph paper and 0854- 31 26 AND ($26),Y 0856- 29 7F AND #$7F on graph paper it must be translated in­ 1 represents a solid square. Figure 2 0858- F0 03 BEQ $085D to data that the graphics routine can shows the beginning of a run of Shape 085A- 8D FA 08 STA $08FA use. Shape Definer does most of the Definer using shape "m an." After 085D- AD FB 08 LDA $08FB 0860- 51 26 EOR ($26),Y work for you, allowing you to input the entering the whole shape you are asked 0862- 91 26 STA ($26),Y shape in a form that resembles figure 1. if the shape is to be animated. All yes or 0864- EE 4B 08 INC $084B no questions should be answered with a 0867- D0 03 BNE $086C 0869- EE 4C 08 INC $084C " Y " or "N ". Enter "N " for the man. 086C- CA DEX (How to animate shapes will be dis­ 086D- F0 05 BEQ $0874 Shape Plot Code:0 086F- E6 26 INC $26 cussed later.) 0871- 4C 4A 08 JMP $084A When you finish the shape you 0874- EE F9 08 INC $08F9 0877- AD F9 08 LDA $08F9 are entering, it is relisted and you are 087A- 20 88 08 JSR $0888 asked if the shape is correct. An "N " 087D- A5 26 LDA $26 087F- 18 CLC answer allows you to make changes. In 0880- 69 12 ADC #$12 C this case you are asked which line is to 0882- 85 26 STA $26 0 be changed and you are allowed to 0884- 4C 47 08 JMP $0847 0887- 60 RTS L change it. When you indicate that the 0888- 48 PHA 0 shape is correct, the program takes 0889- 29 C0 AND #$C0 088B- 85 26 STA $26 R over. It prints different "PHASES" 08BD- 4A LSR followed by "WAIT FOR CONVER­ 088E- 4A LSR SION' '. These listings deal with anima­ 088F- 05 26 ORA $26 C 0891- 85 26 STA $26 0 tion. After seven phases you are in­ 0893- 68 PLA structed how to save the shape. Be 0894- 85 27 STA $27 D i e h k i i careful here,- a mistake could cost you 0896- 0A ASL E i [ ] [ ] [ ] i 0897- 0A ASL the time of re-entering the shape. To 0898- 0A ASL [ : : : [ ] ! make another shape simply run the 0899- 26 27 ROL $27 C3MC3I 089B- 0A ASL program again and save the shape under 089C- 26 27 ROL $27 e o e o e o e a different name. 089E- 0A ASL v d v d v d v Shape Definer can be used to imple­ 089F- 66 26 ROR $26 08A1- A5 27 LDA $27 e d e d e d e ment a simple, fast, and effective form 08A3- 29 IF AND #$1F n n n n of animation. When your shape is pro­ 08A5- 09 20 ORA #$20 cessed there are actually seven separate 08A7- 85 27 STA $27 08A9- 60 RTS versions of the shape saved. These ver­ sions, or phases as I call them, corres­ Figure 1: Shape “man” on graph paper. pond to seven relative positions on the

78 MICRO No. 58 - March 1985 Listing 3: Shape Definer Listing 4: Shape Definer Table horizontal axis that repeat themselves. 10 DIM L?(50),CC?(50) 10 LOKEM: 16384 20 HOME : INVERSE : PRINT "SHAPE When a shape is not animated, six 20 HOME : INVERSE : PRINT "SHAPE DEFINER": NORMAL phases are simply identical copies of TABLE DEFINER": NORMAL 30 PRINT "INPUT WIDTH OF SHAPE"; PRINT "INPUT NUMBER OF SHAPES the first phase. If you choose to : INPUT W1:W2 = INT ((Wl - 30 TO ENTER";: INPUT NO: IF NO 2) / 7) + 2 animate a shape you can edit and = 0 THEN 30 40 AC = Wl 35 IF NO > 16 THEN 30 change any or all of the seven phases. 50 PRINT "INPUT LENGTH OF SHAPE" 40 AD = 3327:A1 = 3071 When editing phases after the first one, INPUT LE: PRINT "INPUT SH 50 N1 = N1 + 1: HOME : INVERSE : PRINT APE PLOT CODE”;: INPUT CC it is important to add all leading zeros "SHAPE NUMBER ";N1 - 1: NORMAL 60 POKE 8192,W2: POKE 8193,LE: POKE 60 PRINT : PRINT "COPY OVER THE that the program appends to strings. 8194,CC:AD = 8194 FOLLOWING TWO LINES": PRINT 70 HOME : PRINT "BEGIN SHAPE DEF (This will be obvious when you come "CHANGING 'XXXXX' TO NAME OF INITION": PRINT SHAPE" to it.) Making small changes in each 80 FOR LO = 1 TO LE 70 PRINT " BLOAD XXXXX" phase produces animation in a fashion 90 IF LO + 2 > 23 THEN VTAB (24 80 PRINT " GOTO 100" ):TA = 2J: GOTO 110 similar to cartoon animation. 90 VTAB (4): END 100 VTAB (LO + 2) :TA = LO + 2 100 W2 = PEEK (8192) :LE = PEEK Repeating form every seven phases is 110 PRINT LO;"."; (8193):CC = PEEK (8194) 120 HTAB (4): PRINT "COLOR CODE" ideal for cyclical motions such as mov­ 110 FOR LO = 1 TO LE *W2 * 7 + 10 ;: INPUT CC$(LO) ing arms and legs, blinking lights on a 120 AD * AD + 1 130 IF CC$(LO) < > "0" AND CC$( 130 POKE AD, PEEK (8194 + LO) space ship, or spinning propellers on an LO) < > "1" THEN 90 140 NEXT LO 140 VTAB (TA): HTAB (18): PRINT airplane. The animation is effective 150 A1 = A1 + 1: POKE A1,W2 "ROW”;: INPUT L$(LO) 160 FOR LO = 1 TO 7:VA = LO only when the shape is moving hori­ 150 IF LEN (L$(LO)) < > AC THEN 170 IF CC = 0 THEN 200 zontally — vertical movement does not 140 180 VA = VA + 4 160 IF AG = 1 THEN 210 change the phases. It is important to 190 IF VA > 7 THEN VA = VA - 7 170 NEXT LO 200 TE = AD - (LE * W2 » 7 + 9) + note that the length and width of an 180 HOME : PRINT "WILL THE SHAPE (W2 » LE » (VA - 1) + VA - 1) BE ANIMATED";: INPUT A$ animated shape must be entered initial­ 210 HB = INT (TE / 256) 190 IF A$ = "N" THEN SK = 1 ly as the length and width of the largest 220 LB = TE - 256 » HB 200 FOR PH = 1 TO 7 230 A1 = A1 + 1: POKE A1,LB phase defined. 210 HOME : INVERSE : PRINT "PHAS 240 A1 = A1 + 1: POKE Al.HB E #";PH: NORMAL :AG = 0 250 NEXT LO:Al = A1 + 1: POKE A1,LE 220 FOR LO = 1 TO LE: IF SK = 1 AND 260 IF N1 < (NO) THEN 50 PH > 1 THEN 240 270 HOME : PRINT "COPY OVER THE Using Shape Table Definer 230 IF LO = 20 THEN VTAB (23): PRINT FOLLOWING LINE": PRINT "CHAN "HIT ANY KEY TO CONTINUE LIS After you save all the individual GING 'XXXXX' TO FILE NAME" TING": GET A$: VTAB (21) 280 PRINT : PRINT " BSAVE XXXXX, shapes on disk they must be grouped 240 PRINT LO;".";: HTAB (4): PRINT A?C00,L";256 + AD - 3326 together into a shape table that allows CC$(LO);" ";L$(LO) 290 VTAB (3): END 250 NEXT LO you to reference different shapes by 260 IF PH > 1 AND SK = 1 THEN 320 number, much like the Applesoft 270 PRINT : PRINT "IS PHASE ";PH ; " CORRECT";: INPUT A$ shape-table system. When Shape Table 280 IF A$ = "Y" THEN 320 Definer is run, you first enter the 290 AG = 1: PRINT "LINE TO CHANGE number of shapes that comprise the ( 0 TO EXIT )";: INPUT LO 300 IF LO = 0 THEN 220 table (16 maximum). Then you are in­ Listing S: Move It 310 HOME :TA = 2: PRINT LO;". "; structed how to load the shapes in, one CC?(LO);" ";L$(LO): GOTO 110 320 INVERSE : PRINT "WAIT FOR CO 20 POKE 16384,0: POKE 16385,0: POKE at a time. The number of the shape be­ NVERSION": NORMAL 104.64 ing loaded appears at the top of the 330 FOR LO = 1 TO LE 30 POKE 106,64: POKE 108,64: POKE screen. Remember to note which num­ 340 FOR LI = 0 TO W2 - 1 110,64: POKE 126,64: POKE 17 350 VI = 0 6.64 ber goes with which shape. When all 360 AD = AD + 1 40 CLEAR the shapes are loaded you are instructed 370 B$ = MID* (L$(LO),L1 * 7 + 1,7) 50 END how to save the table. This table is 380 FOR L2 = 1 TO 8 390 C$ = MID$ (B$,L2,1) BLOADED when you use the routine. 400 VA = VAL (C$) 410 VA = VA * 2 t (L2 - 1) 420 VI = VI + VA Using the Graphics Routine 430 NEXT L2 440 IF CC$(LO) = "1" THEN VI = V The graphics routine is called easily 1 + 128 Listing 6: Test Demo from Applesoft BASIC, Integer BASIC, 450 IF VI - 128 THEN VI = 0 or assembly language. The three 460 POKE AD,VI 470 NEXT Ll:L$(LO) = "00” + LS(LO) 5 HGR :X = 130:Y = 60:OX = 130:0 languages have the following in com­ 480 IF PH = 4 THEN L$(LO) = MID$ Y = 30: POKE 2303,0 mon: the X and Y coordinates for the (L$(LO),9, LEN (L$(LO)) - 8) 10 HCOLOR= 1: FOR L = 0 TO 279 STEP shape represent the coordinate of the :L$(LO) = "0" + L$(LO) 30: HPLOT 0,0 TO L.191: NEXT 490 NEXT LO L: HCOLOR= 3: FOR L = 0 TO 2 upper left-hand point of the rectangular 500 AC = AC + 2: IF AC = Wl + 8 THEN 79 STEP 30: HPLOT 279,0 TO L limits of your shape. This might be a AC = Wl + 1 ,191: NEXT L 510 AD = AD + 1: POKE AD,128 20 GOTO 40 black dot, as is the case with shape 520 NEXT PH 30 POKE 2301,OY: POKE 2302,OX: CALL “man." All other points are drawn 530 HOME : PRINT "SHAPE DEFINITI 2048 relative to this one. The upper limit of ON COMPLETED" 40 POKE 2301,Y: POKE 2302,X: CALL 540 PRINT : PRINT "COPY OVER THE 2048: OX = X:OY = Y the X coordinate is 255 and 191 for the FOLLOWING LINE": PRINT "CHA 50 X = X + INT (( RND (2) » 3) - Y. Because the Apple actually has 280 NGING 'XXXXX' TO THE SHAPE N 1) » 4:Y = Y + INT (( RND ( AME" 2) * 3) - 1) * 4: IF X < 0 OR horizontal positions, there is a space on 550 PRINT : PRINT " BSAVI XXXXX, X > 250 OR Y < 0 OR Y > 160 THEN 5 the right side of the screen, 24 wide by A$2000,L";LE * W2 * 7 + 10 60 GOTO 30 192 long, on which you cannot plot. 560 VTAB (5): END This space is ideal (using Applesoft

No. 58 - March 1983 MICRO 79 the graphics routine is its collision in­ SHAPE DEFINER dicator. If a shape is drawn and a colli­ sion with any other non-black dot is INPUT WIDTH OF SHAPE77 detected, a value greater than 0 is INPUT LENGTH OF SHAPE?15 stored in location 2298. If INPUT SHAPE PLOT C0DE70 P = PEEK(2298] and P takes on a value greater than 0, then a collision has oc­ BEGIN SHAPE DEFINITION curred. This value should be PEEKed only after drawing a shape, not erasing 1 . COLOR C0DE70 R0W70011100 a shape. 2 . COLOR C0DE70 R0W70101010 The graphics routine presented here 3 . COLOR C0DE70 R0W70101010 is completely compatible with Apple­ A. COLOR C0DE70 R0W70011100 soft and Applesoft graphics. However, there is one problem — the graphics 5 . COLOR C0DE71 ROW70001000 routine resides in memory beginning at 6 . COLOR CODE? ETC. hexadecimal location $800. As one ac­ Figure 2: Sample run of Shape Definer. quainted with Murphy's Law might ex­ pect, this is exactly where Applesoft graphics) for the game's name, scoring, a Y coordinate, which causes any part stores its variables and source code for extra men, etc. of the shape to be drawn off the screen. BASIC programs. Happily, this colli­ Applesoft: To draw a shape on the Try to avoid these situations. Calling sion of data can be circumvented. Run screen, the shape's X coordinate should 2048 draws your shape, exclusive-OR the program in listing 5 (Move It) and be POKEd into location 2302, the Y style. This type of drawing is much like pointers will be set to locate Applesoft coordinate into location 2301, and the the Applesoft X-Draw command. Call­ programs and variables above the hi-res shape number into location 2303. If ing 2048 twice in succession with the screen area. This insures that the you POKE a shape number that does same X and Y coordinate draws the graphics routine, hi-res screen, and not have a shape defined for it, a ran­ shape first in full color and then erased Applesoft never meet. In Applesoft, dom mess will be drawn on the screen. to black, leaving any original back­ Move It must always be run before Similar problems arise when you POKE ground intact. An important feature of loading a program, writing a program,

What’s Where in the Apple A Complete Guide to the Apple Computer

This Revised Edition of the famous Apple Atlas provides Apple For owners of the original edition, computerists with a framework for MICRO is offering a companion book, understanding both the overall THE GUIDE to What’s Where in the structure of the Apple system and Apple, for only $9.95 (plus $2.00 s/h). programming techniques that exploit that knowledge. THE GUIDE contains all new material W hat’s Where in the Apple contains that explains and demonstrates how to the most complete memory map use the Atlas and Gazetteer published ever published as well as detailed in the original volume of W hat’s information needed for actual Where in the Apple? programming. All for only $24.95 For Fast Service (plus $5.00 s/h) Call our toll free number: 1-800-354-8112 MICRO makes it easy to order. (In PA 1-800-662-2444) Send check (payable to MICRO) to: MICRO P.O. Box 6502, Chelmsford, MA 01824

VISA and MasterCard accepted. MA residents add 5% sales tax.

80 MICRO No. 58 - March 1983 loading a machine-language program, Applesoft except the Move It program Advanced Technique or just using Applesoft. If you have is not necessary. Instead, simply set To use the graphics routine op­ written a program that uses the LOMEM to 16384 before BLOADing timally you could define all shapes that graphics routine, to run it you must do the graphics routine and shape table. In should register collisions with each the following (in order): Integer there is no inherent command other, using only dots of the same col­ to set the high-resolution mode. The umn parity, then define a background 1. RUN Move It following Integer line acts like the using only dots of the opposite column 2. LOAD BASIC program HGR command when executed from parity. This way shapes can run over 3. BLOAD Graphics Sub within a program. the background smoothly, detecting 4. BLOAD shape table being used only collisions with other shapes. You 5. RUN BASIC program FOR L = 8192 TO 16383 : POKE L,0 : should not attempt this method unless This procedure could be automated NEXT L : L = PEEK(- 16300)+ PEEK you have a thorough understanding of with the use of an EXEC file. ( - 16297)+ PEEK(- 16301) + PEEK the Apple graphics system. Remember, to retain the color integrity (-1 6 3 0 4 ) With the graphics routine and sup­ of the shape, shapes with Plot Code 0 porting software presented in this arti­ can have only even numbers for their X Substitutiong -16302 for -16301 sets cle, you should be able to make graphics coordinate, and shapes with Plot Code full-screen graphics. games on the Apple easily. If you take 1 can have only odd numbers for their X Assembly Language: From assem­ the time to enter and understand the coordinate. Thus,, when moving a bler, the X coordinate is stored in loca­ routine, you will find you have a shape around the screen, it must be tion $8FE, the Y coordinate in location powerful graphics tool at your com­ moved in increments of two along the $8FD, and the shape number in loca­ mand. Even the novice programmer horizontal axis. The program in listing tion $8FF. If a collision is detected, a should be capable of creating pro- 6 (Test) demonstrates the graphics number greater than 0 is stored in loca­ fessional-quality graphics. routine with shape 0, assuming that tion $8FA. To exclusive-OR the shape the Plot Code is 0. Test moves the with the hi-res screen, jump to the Adam King is a sixteen-year-old student shape randomly over a background subroutine at location $800. Begin all who taught himself assembly language. He without erasing it. programs after location $4000 to insure may be contacted at Hut Hill Road, Bridgewater, CT 06752. Integer BASIC: The Integer routine that your assembly-language program follows the same POKEs and rules as does not interfere with the graphics. JMCftO

Circle No. 48

THE TACKLER " - DUAL • MODE PARALLEL Super Pix INTERFACE FOR THE APPLE® 2 BOARDS IN ONE FOR NO MORE Hires screendump software for the Epson, OKI, C. Itoh and Nec 8023. Use with Tymac PPC-100. COMPATIBILITY PROBLEMS! Special $19.95 (Specify Printer) An intelligent board to provide easy control of your printer's full potential. Plus a standard parallel board at the flip of a switch - your assurance of Mr. Lister - Customer Contact Profiler & Mailer compatibility with essentially all software for the APPLE®. Hires printing A Super Mail List Plus more — up to 1000 Entries on single 3.3 Disk (only 1 Drive required) — 2 with simple keyboard commands that replace hard to use software second access time to any name — full sort capabilities — Dual Index Modes — supports new 9 routines. No disks to load. Special features include inverse, doubled, and digit Zip. Easy to follow manual — Not Copy Protected — 4 user defined tables with 26 sort rotated graphics and many text control features, available through easy selections per table — Beta tested for 6 months — user defined label generation. keyboard or software commands. Uses Industry standard graphics Introductory Price $135. {99.00 Dealer 4: Dist. Inquiries Invited. commands. This is the first truly universal intelligent parallel interface! Change printers - no need to buy another board. Just plug in one of our APPLE UNK ROM’S and you're all set. ROM'S available lor Epson, C. Itoh, NEC, and A communications system for the Apple® (Requires Hayes Micro Modem). Transmitand receive any Okidata - others available soon. Specify printer when ordering. Call for type of file between APPLES*, Automatic multi-file transfer, real time clock indicating file transfer Price. time. Complete error check. Plus conversation mode. Only one package needed for full transfers. THE UPGRADEABLE PPC-I00 Compatable with all DOS file types, (requires Hayes Micro Modem) J59.00 PARALLEL PRINTER CARD THE APPLE CARD/ATARI CARD A Universal Centronics type parallel printer board complete with cable Two sided 100% plastic reference card Loaded with information of interest to all Apple and Atari and connector. This unique board allows you to turn on and off the high owners. S3.98 bit so that you can access additional features in many printers. Easily upgradeable to a fully intelligent printer board with graphics and text NIBBLES AWAY II dumps. Use with EPSON, C. ITOH, ANADEX, STAR-WRITER, NEC, OKI AGAIN! Ahead of all others. and others with standard Centronics configuration. $139.00 • AUTO-LOAD PARAMETERS. . . Free's the user from having to Manually Key in Param values used with the more popular software packages available for the Apple II. IF YOU WANT GRAPHICS AND FORMATTING THEN CHOOSE THE PERFORMER . EXPANDED USER MANUAL. . . incorporates new Tutorials for all levels of lor Epson, OKI, NEC 8023, C. ITOH 8510 provides resident HIRES screen expertice; Beginners Flowchart fo r‘where do I begin' to ‘Advanced Disk Analysis' is included. dump and print formatting in firmware. Plugs into Apple slot and easy . TRACK/SECTOR EDITOR . . . An all new Track/Sector Editor, including the access to all printer fonts through menu with PR# command. Use with following features: Read, Write, Insert Delete Search, and impressive Print capabilities! standard printer cards to add intelligence. $49.00 specify printer. • DISK DIAGNOSTICS . . Checks such things as: Drive Speed, Diskette Media THE MIRROR FIRMWARE FOR NOVATION APPLE CAT II® Reliability, and Erasing Diskettes. The Data Communication Handler ROM Emulates syntax of an other popular Apple Modem product • . . Best back up Program in Softalk Poll (Rated 8.25 out of 10). with improvements. Plugs directly on Apple CAT II Board. Supports Videx and Smarterm 80 column HIGHEST RATED. cards, touch tone and rotary dial, remote terminal, voice toggle, easy printer access and much more. • CONTINUALUPDATES. . . Available from Computer Applications and new listings List $39.00 Introductory Price $29.00 on the source. ______>69.95 MINI ROM BOARDS DOUBLE DOS Plus Dealer and Distributor Inquiries Invited. Place your 2K program on our Mini Rom A piggy-back board that plugs into the disk- /MICRO-WARE DIST. INC Board. Room for one 2716 EPROM. Use in any controller card so that you can switch select P.O. BOX 113 POMPTON PLAINS, N.J. 07444 slot but zero. Only $34.95 between 00S 3.2 and DOS 3.3 DOUBLE DOS Plus requires APPLE DOS ROMS. $39.00 201-838-9027

No. 58 - March 1983 MICRO 81 APPLE Disk Track Copy for Non-Matching Volume Numbers by Roland E. Guilbault

Change the volume number of your disks for library reference. Unfortunately, the procedure described here does not change the volume number of the disk with respect to the "CATALOG" command. All routines that use RWTS derive the volume number from zero-page storage $2F, where RWTS places it. The volume number comes from the Address Block at the I decided to take advantage of the beginning of each sector, which is not easily modified. |You may be able to volume numbers on the disks and am modify it with a nibble editor.) It is possible, however, to have DOS look at the writing a program to catalog a disk into value stored in the VTOC with only a slight modification to DOS, so that a a data base file. Up until now I have CATALOG will produce the volume number you desire, instead of the actual been using the default disk numbers. initialized volume number. Once two or more disks are entered in­ DOS stores the volume number in additional places during initialization. to the data base, it is impossible to tell which disk contains what programs. Track 1 Sector 1 Byte F6 Track 2 Sector 4 Byte BF The volume number on the disk will be Track 2 Sector 2 Byte C l Track 2 Sector 4 Byte F9 used to provide this information. To (two’s complement! change my disks over I have to in­ If you want a disk to produce the desired volume number, change Track 1 itialize a new disk to the appropriate Sector C Bytes BC and BD to C l 33. This changes the code from LDA$37F6 to volume number, then copy the entire LDA $33C1. This modification also requires changing Track 2 Sector 2 Byte AF disk. To facilitate this process I am to AD, or some other ASCII you like; now the CATALOG looks like DISK using the Call—A.P.P.L.E. disk 6B VOLUME-OOO instead of DISK VOLUME@000. Incidentally, the above loca­ utilities, which include a track copier. tion is also where you change the name of the volume. This speeds up the copying process, but If you don't have a DISK ZAP type of program, the MICRO utility disk now the copied disks do not work! includes an elementary Sector Change program to modify the bytes on a disk. To copy a disk using a track copier, For $10.00 plus $2.00 shipping and handling, you receive:Applesoft Variable the volume numbers must match. If Dump by Francois, Straightforward Garbage Collection by Bongers, COM­ the volumes do not match, the DOS PRESS by Bauers, and Sector Change by Daley. The source is not included. will not boot correctly. Send orders to: Apple Utility Disk, MICRO, P.O. Box 6502, Chelmsford, Embedded within the DOS is the Massachusetts 01824. value of the expected volume number. If the expected value does not match 48K system. This location is in the change the name of the startup pro­ the actual disk volume number, the RWTS parameter list and is the volume gram, make the changes at that loca load is ignored. At the end of the boot number expected. After you modify tion on the disk. Now write sector(l,9 the loader transfers to an expected code location ‘'EB” write the sector back back out to disk. entry and the system errors off. I out to the disk. The third location that should bi discovered two places within DOS that The next location to be modified is modified is in sector] 17,01 in thi should be modified, plus one location in sectorj 1,9]. If this location is not VTOC table. Load the sector inti in the VTOC. A disk ZAP routine is modified your HELLO program will not memory and change relative locatioj needed to do these modifications. load correctly, producing a volume "6" to the new volume number. Nov Three different sectors must be mismatch error. No program will be write this sector back out to the disk. modified. The first location is in track loaded into memory and the cursor will In summary, the locations tha 0, sector 1. Sector(0,l] must be loaded come back ready to accept input. Load must be changed to the new volum and then the relative hex location EB sector( 1,9) into memory and then set number are as follows: changed to the desired volume number. relative location "6 6 " (hex) to the new 1. sector(0,l) displacement EB (hex] Note: all values in this article are for volume number. This location, equiva­ 2. sector) 1,9) displacement 66 (hex) DOS 3.3. {Editor’s note: "0 0 ” may also lent to location ‘‘AA66" in the 48K 3. sectorj 17,0) displacement 6 be used as a wildcard volume #, since it system, is in the DOS key word data. matches any “found volume.”) Note that the name of your HELLO pro­ Contact Roland Guilbault at P.O. Box Sector(0,l) is equivalent to location gram starts at relative location "7 5 " 427, Atkinson, NH 03811. "B7EB” when the DOS is loaded into a (hex) in this sector. If you want to JMCftO

82 MICRO No. 58 - March 198: „\WARE associates, ltd. o r CJJ r j W h a t’s e a tin g

LU rj CJJ O-cord Questionnaire Analysis Software your Apple?

• Microcomputer based Avoid the expense of controct services - do everything in*house on your own Apple 11+ microcomputer.

• Easy d a ta entry Avoid time consuming keypunching. Uses respondent-morked cards entered with on Optical Mark Reader (keyboord entry olso possible). Find out with Apple-Cillin II™ • Comprehensive data anolysis Sort on any vorioble(s), tally all responses, conduct cross fobs, correlations, lineor regression, frequency distributions, ond mare. If you use your Apple for your business or • Complete editing capabilities Weight items, derive composites, odd or delete items, and mare. profession, you probably rely on it to save you • Easy-to-use Programs are user friendly, menu driven, and interactive. No special time and money. You can’t afford to guess computer expertise is required. whether it is working properly or not. Now you

Call or send for mare information today. don’t have to guess. Now you can find out with Apple-Cillin II.

SCIENTIFIC SOFTWARE ASSOCIATES, LTD. Apple-Cillin II is the comprehensive diagnostic BOX 508 • KlftlSftJ, KJI. 5MJDI system developed by XPS to check the TELEPHONE: (715) fll,5-2QE,E, performance of your Apple II computer system. Apple-Cillin II contains 21 menu driven utilities Apple 11+ is o registered trademark of Apple Computer, Inc. including tests for RAM memory, ROM

C ircle No. 49 memory, Language Cards, Memory Cards, DISK system, Drive Speed, Keyboard, Printer, CPU, Peripherals, Tape Ports, Monitors and more. These tests will thoroughly test the 32K CMOS STATIC RAM BOARD for SYM/AIM operation of your Apple, and either identify a Models MB-132/32K, $299 specific problem area or give your system a /16K $241,/8K $197 I Features: clean bill of health. You can even log the test [•200ns Low Power CMOS, STATIC HAM results to your printer for a permanent record. I • Extends your expansion connector

I • Plug compatible with 2716 EPROMS Apple-Cillin II works with any 48K Apple system

I * First 8K are jumper selectable equipped with one or more disk drives.

I* Entire board may be bank-switched

I * G-10 Glass epoxy, Full solder mask, Gold fingers To order Apple-Cillin II - and to receive

I* Full 1-year limited warranty information about our other products - Call XPS Toll-Free: 1-800-233-7512. In Pennsylania: I/O EXPANSION BOARD for the SYM/AIM 1-717-243-5373. and other microcomputers that use 6522 VIAsfor I/O l/OX-122 $60 and do not provide full address decoding on board. l/OX-222 $72 This board has physical space for four additional 6522 Apple-Cillin II: $49.95. PA residents add 6% VIAs. and provides additional decoding for a total of 16 devices. Connectors for at! I/O lines, and further State Sales Tax. expansion are included. Ail 6522 functions are available, w ith no interference w ith previous functions of the original VIA Two versions of this board are available The l/O X -1 22 mounts above, and directly plugs into, an on-board 6522 socket, and relocates the original VIA to the expansion board. Where there are space limitations, the l/OX-222 XPS, Inc. uses a dip header and an 8" cable for remote installation. 323 York Road Carlisle, Pennsylvania 1/013 REAL-TIME CLOCK/CALENDAR $60W rite for Info. P.O. Box 1019 • Whittier. CA 90609 • (213) 941-1383 800-233-7512 XPS 717-243-5373

Apple II is a registered trademark of Apple Computer Inc.

C ircle No. 50 Circle No. 51

No. 58 - March 1983 MICRO 83 Circle No. 52

BOX 120 ALLAMUCHY, N.J. 07820 201-362-6574 HUDSON DIGITAL ELECTRONICS INC THE TASK* MASTERS

HDE supports the *TIM, AIM, SYM and KIM (TASK) with a growing line of computer programs and peripheral components. All HDE component boards are state-of-the-art 41/2” x 6V2", with on board regulation of all required voltages, fully compatible with the KIM-4 bus.

OMNIDISK 65/8 and 65/5 HDE DISK BASIC Single and dual drive 8” and 51/4” disk systems. A full range disk BASIC for KIM based systems. Complete, ready to plug in, bootstrap and run. Includes PRINT USING, IF . .. THEN . .. ELSE. Include HDE’s proprietary operating system, Sequential and random file access and much FODS (File Oriented Disk System). more. $175.00

HDE ADVANCED INTERACTIVE DM816-M8A DISASSEMBLER (AID) An 8K static RAM board tested for a minimum of Two pass disassembler assigns labels and con­ 100 hours and warranted for a full 6 months. structs source files for any object program. Saves multiple files to disk. TIM, AIM, SYM, KIM versions. $95.00

HDE ASSEMBLER DM816'UB1 Advanced, two pass assembler with standard A prototyping card with on-board 5V regulator mnemonics. KIM, TIM, SYM and KIM cassette and address selection. You add the application. versions. $75.00 ($80.00 cassette)

HDE TEXT OUTPUT PROCESSING SYSTEM (TOPS) DM816-P8 A comprehensive text processor with over 30 A 4/8K EPROM card for 2708 or 2716 circuits. commands to format and output letters, docu­ On board regulation of all required voltages. ments, manuscripts. KIM, TIM and KIM cassette Supplied without EPROMS. versions. $135.00 ($142.50 cassette) HDE DYNAMIC DEBUGGING TOOL (DDT) Built in assembler/disassembler with program DM816-CC15 controlled single step and dynamic breakpoint A 15 position motherboard mounted in a 19” entry/deletion. TIM, AIM, SYM, KIM AND KIM RETMA standard card cage, with power supply. cassette versions. $65.00 ($68.50 cassette) KIM, AIM and SYM versions. HDE COMPREHENSIVE MEMORY TEST (CMT) DISK PROGRAM LIBRARY Eight separate diagnostic routines for both Offers exchange of user contributed routines static and dynamic memory. TIM, AIM, SYM, and programs for HDE Disk Systems. Contact KIM and KIM cassette versions. $65.00 ($68.50 Progressive Computer Software, Inc. for details. cassette) AVAILABLE DIRECT ORFROM THESE FINE DEALERS:

Progressive Computer Software Johnson computers Falk-Baker Associates Perry Peripherals 405 Corbin Road Box 5 2 3 382 Franklin Avenue P.O. Box 924 York, PA 17403 Medina, Ohio 44256 Nutley, NJ 07110 Miller Place, NY 11764 (717) 845-4954 (216) 725-4560 (201) 661-2430 (516) 744-6462 Lux Associates Laboratory Microcomputer Consultants 20 Sunland Drive P.O. Box 84 Chico, CA 95926 East Amherst, NY 14051 (916) 343-5033 (716) 689-7344 It’s All Relative, Part 4 Using Commodore’s Relative Records

by Jim Strasma

This fourth in our series of the current session began. However, used record number is assigned to it, articles tells how to actually nothing is lost from the relative file — and the record is written to disk. read and write Commodore all changes, with the possible excep­ Here is the subroutine used to write relative disk files. tion bf the one that caused the un­ out the data: timely exit, are preserved. 4960 REM WRITE RECORD FROM D1$ In last month's article we had reached Adding a Record 4970 RECORD#1 ,(RR) the point of actually using relative Now, as promised, let's tackle our 4980 IF DS THEN 1690 files. Read on to learn safe ways to store primary goal: writing and reading 4990 D$ = K$ + C$ and read relative file data. relative file data. Assuming this is our 5000 FOR I = 1 TO N F - 1 :D$ = D$ + first use of a newly formatted data file, QT$ + D1$(I) + C$:NEXT Re-opening a Relative File we need to add some information to the 5010 D$ = D$ + QT$ + D1$(NF) First, the relative file is opened for file. In our example mail list, each 5020 PRINT#1,D$; both reading and writing access: record is entered in two parts. After 5030 IF DS THEN 1690 making sure there is room for another 5040 RETURN 1170 DOPEN#1 ,(F$),D(DD):IF DS THEN record, the key field described last issue 1690 is entered. Unlike many packages, Ben­ First note that the record command nett's mail list requires each record to parks the disk head at the correct spot The file name is in variable F$, and the have a unique key. When a key is in the file for this entry, as described in data drive number is in DD. Those entered, the file is binary-searched for a part 2. If there is a disk error here or with BASIC 2 will need to substitute, match. If one is found, the new key is elsewhere in the subroutine, a panic as described in part 2 of this series rejected. This protects against re­ exit is made back to the menu module, (MICRO 56:53). entering the same name. via line 1690. As mentioned before, Notice that this is (in BASIC 4) ex­ If the key is accepted, the user BASIC 2 users will need to call a disk actly the same statement we use to enters the remaining data. All entry is error checking subroutine from lines open a sequential file for read access. via a machine-language editor that 4980 and 5030, and use an alternate The file header in the diskette directory filters out troublesome characters. If form of the RECORD command in line tells DOS which type is meant. Also you enter relative file data without 4970. notice the DOS error handler at the end such an editor, do not include quota­ In line 4990 we begin to build a of the line. When an IF-THEN state­ tion marks in the data. They would in­ string of information to write to the ment is evaluated as true or false, it terfere with the technique used to disk. The first piece is the key field, in does so with simple math. Truths are allow commas, colons, and semi­ K$, followed by a carriage return worth - 1 and falsehoods are worth 0. colons (also troublesome) in the data. character, in variable C$. Every other If the result of the expression following PET owners may defang quote marks field in turn is concatenated onto the IF is non-zero, the part of the line by adding 64 to their ASCII value, end of the data string (D$). Each data following THEN is executed. Other­ making CHR$(34 + 64). But since this field is preceeded by a quote character wise, the program falls through to the doesn't work on the CBM 64, it is often (in QT$), and each field but the last is next line instead. Thus, IF DS THEN... better to just convert quotes into followed by a carriage return. The has the same effect as IF DS 0 apostrophes. quote character allows all other THEN... and saves three spaces. Since After a record is entered, the user is characters to be read back later using an this statement is needed after nearly asked “Any corrections needed Y/N?” . INPUT# statement. Otherwise, we every disk command, the savings are If so, the user is asked to specify a line would need the much slower GET# considerable. If there were an error, the to change, and that line of data is re­ statement. routine at 1690 closes files, tidies up, entered in an editing subroutine. Once You'll find a similar advantage and exits to the menu module. Any cur­ the data is accepted, the primary and when using carriage returns. Since each rent changes in the key file are lost, alternate key arrays are updated to in­ field is shorter than 80 characters, the reverting to the contents it had when clude the new record, a currently un­ INPUT# statement can read them, pro­

No. 58 - March 1983 MICRO 85 vided that each ends with a carriage you've made enough that you don't records may safely be shorter than the return. This also allows longer fields, want to redo them. allotted space. without lengthening the overall record. One other check is made on newly When carriage returns separate fields, Changing a Record entered postal code data. If the postal there is no need to know the location of Now let’s assume we have several code is not valid in either the U.S. or each field within the record. Just be entries in a mail list, and we want to Canada, the program accepts it, but dis­ sure fields are written and read in the read one. This is done with Bennett's plays a warning. (Bennett's original ver­ same order. This allows the record to change command (even if we have no sion made the user re-enter such data.) appear larger on the screen than on changes to make). It begins by asking Finally we are ready to read a disk. In Bennett's program, if every for the record's key field. Enter as relative record: field were filled, the record couldn't much as you remember; the nearest hold the resulting information. This is match will then be found. If it is not an 4890 REM READ RECORD INTO D1$ rarely a problem, because a full field exact match, you will be warned 1' * * * 4900 RECORD#1 ,(RR) normally alternates with a barely-used Not Found * * *' ’, but even so, it will be 4910 IF DS THEN 1690 one, balancing out overall. The cost of retrieved from disk for your viewing. 4920 INPUT#1 ,K$ the technique is the space wasted by You may then browse alphabetically 4930 IF DS THEN 1690 the carriage returns. through the file, pressing the [UP- 4940 FOR I = 1 TO NF:INPUT#1 ,D1$(I): No carriage return is added to the ARROW] key to see the next record, IF DS = 0 THEN NEXT:RETURN last field because the disk already and the [BACK-ARROW] key to see the 4950 GOTO 1690 knows when the last character is prior record. Here are two subroutines reached. The IEEE-488 EOI (end or that help: Through 4930, the program is like identify] line flashes. This changes the the key field reader we used last ST status variable to 64, and any cur­ 6220 REM. CALC NEXT RECORD month. The rest of the work is done in rent INPUT# finishes, just as though a 6230 IF K 9 < NV THEN K9 = K9 + 1 line 4940. Unless an error occurs, it carriage return had been added. The ad­ 6240 RR = K%(K9) completes the record read and returns ded logic in lines 5000 and 5010 that 6250 RETURN to the main program. The reason for handle this do slow the program a bit. If 6260 REM CALC PRIOR RECORD writing it this way is to save time. speed is crucial, add a carriage return at 6270 IF K 9 > 1 THEN K9 = K9 - 1 When a FOR-NEXT loop is entirely the end, and skip the special handling. 6280 RR = K%(K9) contained on one BASIC line, the We only PRINT# the data to disk 6290 RETURN BASIC interpreter doesn't waste time after the entire record has been con­ looking for line numbers. In a long pro­ catenated into the single variable, D$. The key position of the current record gram, the savings are considerable. Each record must be written with a is in K9. Going up, if it is less than the Line 4950 will be executed only if there single PRINT# statement. Otherwise last active record (NV), then K9 is in­ is a disk error. each succeeding PRINT# will go to the creased and RR is assigned the alpha­ Occasionally the program may halt next record sequentially — almost betically next record number to read. at line 4940 with a ?STRING TOO never what we have in mind. Even Going down, if it is greater than 1, the LONG ERROR. This means over 79 preceeding each successive PRINT# to first record, (K9) is decreased, and RR is characters were read without a carriage the same record with a RECORD# assigned the prior record. return. A retry with the same record statement wouldn't help. In that in­ To be sure the record will fit the always succeeds. Unfortunately, if it stance, each new PRINT# to the record space allotted, each new or altered happens, the program will halt. Move would overwrite earlier PRINT#s. This record has its length checked: the cursor to a blank line and type: could be avoided only by using the byte extension to the RECORD# statement 5410 REM RECORD LENGTH CHECK GOTO 1190 for each PRINT#, specifying where 5420 ER = 0 within the record to begin the current 5430 WK = LEN(K$) + 1 to return to the update menu without write, described in part 2. If you use the 5440 FOR M = 1 TO N F:WK = WK + losing data. extension, be sure each successive LEN(D1$(M)) + 2:NEXT PRINT# begins after all earlier 5450 WK = WK — 1 Other Features PRINT#s within the record. Otherwise, 5460 IF W K > RL THEN ER = 1 Before leaving the update module, those following the new PRINT# will 5470 RETURN consider its other useful features. First, be overwritten. (Each PRINT# always if some data fields are left entirely writes to the end of the record, regard­ Variable ER serves as an error flag. It blank when entered, the program fills less of where within the record it starts equal to zero, but if the record is them with default contents, as selected begins the write.) too long, it is changed to one. After the by the start-up module. This speeds After the disk write subroutine, our subroutine, the main program checks data entry when many records share new information is on disk in record the value of ER to see if the record is too similar information. This typically in­ #RR. However, the mail list could long. If so, the user must redo the last cludes the town and state name, the zip forget that the record is on disk if the field altered, to make it shorter. code, and the leading part of the phone program halted before re-writing the If we wrote an overlong record to number. Here's an example: key file. It is a good idea to update keys disk, the disk copy would be truncated about once an hour when adding to a at the assigned length, losing re­ 2270 IF I = 4 AND L $= " ” file. Safeguard changes whenever maining data. On the other hand, THEN L$ = D3$

No. 58 - March 1983 86 MICRO If field number four is empty, this fills E2$ has previously been set to won't have to retype information. This it with default #3, as defined in the whatever key you want to have trigger is a crucial feature of serious file- start-up module. the label dump, and the check of PZ$ handling programs. Using the same Second, if the user botches a record makes sure you do have a printer before technique, this information can also be and wants to abort the change mode, using it. fed into word processing programs, this is done by pressing [SHIFT + Fourth, hitting [RETURN] alone allowing the user to write customized RETURN] when asked to "Select Field usually returns the user to the prior letters to large lists. for Updating [1 to 8)” . The line that menu, thus giving an easy out if you Here is the subroutine that dumps does this is: wander into the wrong section of the the entire file in sequential order: program. 2680 IF FS = 0 OR W9$ = SR$ In addition to the delete command 3470 FOR 11 = 1 TO NV THEN 2780 mentioned last time, there is also a way 3480 : RR = K % (I I) to change a record's key field. This 3490 : IF G$ = “R" THEN RR = AL%(II) This line skips the update when the works by deleting the record, but 3500 : PRINT "DUMPING RECORD” last character W9$ equals SR$, preset saving the information, and then im­ II" OF”NV to [SHIFTED-RETURN]. It also skips mediately re-entering it under the new 3510 : GOSUB 4900:REM READ when nothing needs updating, as in­ key name. Like the delete command, it RECORD dicated by the flag variable FS still makes sure the user is serious about the 3520: PRINT#5,K$ being equal to zero. change before going ahead with it. 3530 : FOR JJ = 1 TO NF Third, the mail list allows the user Perhaps the most crucial commands 3540 : : PRINT#5,QT$D1$(JJ) to make a quick easy copy of either the of all in the long run create and retrieve 3550 : NEXT entire current record, or just the mail a sequential copy of the entire relative 3560 NEXT label portion of it, by pressing a nor­ file. This accomplishes at least two 3570 IF DS THEN 1690 mally unused key, selected in the set­ goals. It allows the user to restructure 3580 FOR II = 1 TO 9 up module. Here's the line that calls for the mail list, with differing field 3590 : PRINT#5,EF$ a mail label: lengths, and record lengths, without 3600 NEXT losing data. Beyond this, if the user 3610 DCLOSE#5 2960 IF G$ = E2$ AND P Z $< > "N ” ever upgrades to a commercial mail list 3620 IF DS THEN 1690 THEN GOSUB 6490:REM PRINT program, most are able to add data from Note line 3490. Actually, the file can be MAIL LABEL a sequential file. Therefore you usually dumped in two orders — alphabetical

-TM CP/M ON THE SS50 BUS PET/CBM SOFTWARE SELECT! META LAB 2809 SOFTBOARD SYSTEM 8 0 3 2 OR 4 0 3 2 CP/M SOFTWARE ON SS50 BUS DISPLAY DISPLAY FEATURES FROM THE KEYBOARD OR PROGRAM — RUN CP/M ON YOUR SS50 COMPUTER NOW RUN WORD PRO 3 OR WORD PRO 4 — INCLUDES CP/M 2.2 WITH EDITOR, ASSEMBLER, DEBUGGER, UTILITIES FROM THE SAME MACHINE — FULL SOFTWARE SUPPORT AND USER DOCUMENTATION Available for either 4000 or 8000 Series — COMPLETE CP/M REFERENCE MANUALS — STANDARD CP/M DISK ALSO: — Z80A MICRO OPERATING AS A For 2001 / 3 0 0 0 Series Computers CO-PROCESSOR TO YOUR 6809 Operate these Models in a Full 8032 Like — ALL I/O THRU SS50 SYSTEM DEVICES Display For Word Pro 4* — EASY TO INSTALL — ONE YEAR WARRANTY and all other 80 Column Software All installation instructions included. OTHER PRODUCTS ON SS30 BOARDS EXECOM CORP. • ADC 1200 12 BIT ADC, 16 CHANNELS, 25 uSec • DAC 1220 12 BIT DAC, 2 CHANNELS, 10 uSec 1901 Polaris Ave. • GPIB 4880 IEEE 488 CONTROLLER Racine, Wl 53404 Ph. 414-632-1004

PET/CBM a trademark of Commodore Business Machines (303)449-171 1 ‘ trademark of Professional Software, Inc. 6825 COUNTY LINE ROAD 1 LONGMONT. C080501

Circle No. 64 Circle No. 53

No. 58 - March 1983 MICRO 87 by key, or by increasing record number, regular backups, suspect any diskette multiple users, you may also want to using the alternate key. Dumping a file in use during a power outage, and keep add a special one-character field to the in alphabetical order allows you to keep the drive doors open when not access­ record itself. This would be a busy rarely-changing lists in very neat order. ing the disk (i.e., no files open). Better signal to other users. If it has one value, This is sometimes useful when using yet, buy a backup power supply for it would mean it is not in use, and the print module, as we will see next about $450. Be sure it protects the disk anyone may use it. If it has another time. However, if you use the record drive in addition to the computer. value, someone is looking at that numbers for anything, such as envelope record. In that case, no one else should numbers in a church, you won't want be allowed to change it. Otherwise, them changed, and should always there could be two versions of one dump in record number order. record active at once. Multiple Users In Bennett's mail list, the relative Single Drives Loss of Power file remains open until the user is done To accommodate the needs of those Even if power goes off to the com­ with the module. Usually this is no with only a single small disk drive, puter, current relative file data is usually problem. However, leaving it open full­ "Update" begins by noting whether preserved, with the key file reverting to time does create a problem for those two drives are to be used: its prior contents. On the 8050 and wanting to connect two or more com­ later drives, a surge protector within puters to the same disk drive and have 1070 IF P D O D D then 1110 the disk system preserves the integrity everyone use the same file. To do this of diskette data during loss of power. safely, the file would be opened just PD is the drive to use for programs, and On the 4040 and 2040 however, a before information from it is needed DD is the drive to use for data. If these power loss often causes faulty data to and closed again immediately after the are the same, "Mail List" assumes the be written momentarily. Depending on data is read or written. This ensures user has a 2031/1541 disk drive. In that where the read/write head is at the data in the DOS buffers gets written to case, the user is prompted to remove time, this could be disastrous. If your disk, so all users are working with the the program diskette, insert a data area is prone to such outages, make same information. If you will have diskette, and then press a key. Those with D90 series CBM hard disk drives may want to change this line to always GOTO line 1110. (Those drives are big Circle No. 55 enough to hold both programs and data, and there is no diskette to remove.)

VIC-20 USERS: G>t Serious with A PRQMEJJEEN BASIC 4 for Everyone As a final note I offer an alternative • A cartridge development system for those with VICs, 64s, and older • Program from Commodore PETs. Richvale Telecommunications VIC-20 keyboard into built-in 4K (10610 Bayview, Richmond Hill, On­ ROM emulator tario, Canada L4C 3N8) and Skyles • Jumper to target ROM socket Electric Works (231 E. South Whisman Road, Mountain View, CA 94041) sell • Test programs in circuit plug-in BASIC 4 equivalents. RTC sup­ • Built-in EPROM programmer plies them on plug-in cartridges, called and power supply "V-Link" for the VIC and "C64-Link" • Burns & runs EPROMS for the for the 64. A Skyles ROM for PET is Commodore VIC-20, too called "Disk-O-Pro" and a Skyles pro­ • Comprehensive manuals duct for VIC is called "VicTree.” I • Fits EXPANSION PORT can't imagine using my CBM 64 without my C64-Link; it certainly • Includes Hexkit 1.(7, a powerful 100% machine code editor/de­ eases the work in adapting large pro­ bugger utility program that makes coding for 8-bit Micros a snap. grams, such as Bennett's mail list, Programs 2716, 2732, 2732A, 27C16, 27C32, adaptable to 2532 & 2764 originally written for PET BASIC 4. First reports on the Skyles products are PnQMQ JEEN cartridge com plete only $199 also favorable. GLOUCESTER CQIYIPJTEfl.rac. Distributed in U.S. by Arbutus Total Soft, Inc., 4202 Meridian, Suite 214, Bellingham, WA 98226. Phone 800-426-1253, in Washington 206-733-0404 Contributing editor Jim Strasma is Distributed in Canada by IBC/Dlstributlon Canada, 4047 Cambie St., assistant professor of computer science at Vancouver, BC V5Z 2x9. Phone 604-879-7812 Lincoln College. You may reach him at 1280 Richland Ave., Lincoln, IL 62656.

Send for Free Brochure JMCftO

88 MICRO No. 58 - March 1983 Circle No. 56 FOR COMPLETE GRAPHICS:

UersaUJriterEDUCATION ARTIST GAME PROGRAMMER

HOBBIEST ENGINEERING CHILDREN

Teachers, artists, engineers, VersaWriter contains programmers & hobbiests complete software for find VersaWriter an drawing with color, easy to use tool for brushes & dots. Add creating micro text or fill in over computer graphics. 100 colors. No programming Create your own experience is required shapes and place Pictures can be made anywhere on the by simply tracing. Even screen. Use children can explore the Area/Distance, exciting world of Move Picture, computer graphics. The Electronic Drawing VersaWriter is as limitless \ & Skeleton programs plus much as your imagination. more. Complete hardware/software system for Apple ll/ll+/lle - $299.00

Versa Computing Products are available VersaWriter is also available with at your local computer products store. software designed for Atari & IBM PC. Distributed by: Computeriand Corp. Micron Distributing Educational Media Hayward, Calif. Toronto, Canada Washington, Penn. V E ttA Softsel Computer Products Program Spektrum ESD Laboratories V CCcompucinG, inc. Inglewood, Calif. Bromma, Sweden Tokyo, Japan TZ7 Pete & Pam Computers Micro Products Sales Group Blue Ridge Computers Lancashire, England Lynn, Mass. Capetown, South Africa

3541 Old Conejo Road, Suite 104 • Newbury Park, CA 91320 • (805)498-1956

No. 58 - March 1983 MICRO 89 /AlCftO PET Vet

starting at the right end. If the right- instead. ANDing with 15 is exactly By Loren Wright hand bit is on you add in 2 to the 0 what you want to do to preserve the power, or 1. This continues 2, 4, 8, 16, border color and reverse-mode status. 32, 64, until you reach 128 (or 2 to the Combining this with the color ANDs and ORs, PEEKs and POKEs 7th power) at the left end. If there is a 1 (calculated above) involves the OR VIC and Commodore 64 owners in the binary number, then add in that operation. may be a little puzzled about all the power of two. The bits are numbered The OR operation also is used most mysterious programming required to according to the power of two they often in BASIC IF...THEN statements, control video and sound on their represent. such as 'IF X$ < "A " OR X$ > "Z " machines. Most of this is accomplished The 16 possible screen colors for the THEN PRINT "NOT A LETTER": with four BASIC functions, and VIC all can be represented in four bits. RETURN'. If either (or both) of the ex­ understanding how they work will Color 0 is represented by 0000, while pressions separated by the OR is make things a lot easier. color 15 is represented by 1111. To fit evaluated as ‘true,’ then the overall ex­ PEEK and POKE are fairly easy, into bits 7 to 4 of the VIC register, you pression is also true. Only if both are since their names actually describe must multiply the color by 16, which is false, is the result false. PET BASIC's what they do. PEEK means you are the same as sticking four 0's at the OR also operates on the bit level. If looking at a particular memory loca­ right end of the binary number. For either of the corresponding bits in the tion and returning with the number color 2 (or red) you would use 16*2, or two numbers is 1, then the result will found. PEEK(7680) returns the number 32. Now you know what number to have a 1 in that position. found in memory locaton 7680. POKE stick in. However, if you just POKE works the other way around; you take a 36879,32, you will get a red screen 0 0 0 0 1 0 1 1 number and stick it into a specified with a black border and all the OR 00100000 memory location. POKE 7680,0 puts characters reversed. You can preserve an character (the one represented the original border color and reverse 0 0 1 0 1 0 1 1 by 0) in the upper left comer of an mode status with the AND function. unexpanded VIC screen. The numbers AND is a Boolean function usually This example has successfully com­ involved may be BASIC expressions, as used in a BASIC IF...THEN statement bined the screen color (red = 2) with the long as the addresses are kept between (i.e., IF X = 5 AND Y>0 THEN GOSUB existing border color |cyan = 3) and 0 and 65535 and the numbers are kept 500). If both conditions on either side reverse-mode condition (off = 1). To between 0 and 255. Don't go POKEing of the AND are satisfied then the whole make sure that this works on a general numbers into memory at random; expression is true; otherwise the ex­ example, I will run through it step by many combinations will cause your pression is false. PET BASIC, unlike step. computer to crash. most other BASICs, allows the AND All the control registers of the VIC, function to work on the bit level. Like PEEK(36879) = xxxxxxxx the VIC II, and the SID are treated by the BASIC expressions above, a bit is (may be any number 0 to 255) the computer as normal memory loca­ considered true if it is 1 and false if it is tions. You can program a great number 0. The two numbers compared by the xxxxxxxx AND 15 = 0000xxxx of the chips' functions using PEEKs and AND function are compared bit by bit POKEs with these memory locations. If at each bit position. If both bits at a yyyy * 1 6 = yyyyOOOO you look carefully at the VIC Chip por­ given position are 1, then the resulting (yyyy-any color number 0 to 15) tion of this month's VIC Data Sheet number will have a 1 there; otherwise (page 103], you will see that controlling that bit position will get a 0. Consider OOOOxxxx OR yyyyOOOO = yyyyxxxx the chip is not as simple as POKEing a the following example: number into an address. For instance, POKE 36879, yyyyxxxx $900F (36879) actually controls three 1 0 1 0 1 0 1 1 different things: the screen color, AND 00001111 If Y is a color number 0 to 15, then reverse mode, and the border color. one BASIC expression will change the How do you change the screen color 0 0 0 0 1 0 1 1 screen color without disturbing the without affecting reverse mode or the border color or the reverse mode: POKE border color? One way is to know what The equivalent BASIC statement is 36879, PEEK(36879) AND 15 OR those are supposed to be and POKE the '171 AND 15'. In PET BASIC, this (16*YJ. appropriate number. But you do need a equals 11, the result of this bit-level Frequently you want to change just way to figure out what the border color AND operation. In other BASICs, it one bit in a register. For instance, bit 7 and reverse mode statuses are. would equal 1 or -1, indicating that of VIC register 36874 acts as an on/off Each memory location is actually a both 171 and 15 were non-zero and switch for the VICs voice 1. To turn byte consisting of eight bits. Each one therefore 'true.1 Notice that by ANDing this bit on without affecting the of these bits can be either on (1) or off with 15, you have preserved bits 3-0 frequency: POKE 36874, PEEK(36874] (0). Together they make up a binary exactly the way they were in the first OR 128. To turn the bit off: POKE number, which converts to decimal by number. If you wanted to preserve bits 36874, PEEK(36874) AND 127. adding in increasing powers of two, 7-4, you would use 240, or '111 10000', JMCftO

90 MICRO No. 58 - March 1983 How to chart your company’s fortune without spending one

It’s a fact. A single chart or graph can tell you instantly what it You can also save and modify your graphics through takes hours to interpret from printouts or other raw data. Strobe’s menu-driven programs. A broad selection of Now, with the Strobe 100 Graphics Plotter and Software software— including data base management-compatible package, you can create superb hardcopy graphics directly programs— is now available. from your computer. And you can do it for a fraction of the cost When the Strobe Graphics System is interfaced to your of most other systems. computer, an 8-1/2 x 11 inch sheet of paper can speak any­ The Strobe System transforms complex data into one*^ language— visually. Visit your local dealer and learn dynamic, colorful visuals with a how to start charting your for­ few simple commands from your tunes today. Because a perspective computer. Charts and transparen­ on the present can also be your cies that once took hours to pro­ window on the future. duce are plotted within minutes. Information can be presented as bar charts, pie charts, curves or isometrics in a variety of colors. And with a resolution of 500 points per inch, the Strobe 100 Strobe Inc. matches or surpasses the quality 897-5A Independence Avenue of plotters costing thousands of Mountain View, CA 94043 dollars more. Telephone 415/969-5130 The Strobe Graphics System Seeing is believing Circle No. 57 (Sm>

CP/M SPECIALS

Microsoft Premium System ____ In The Sea O f / Inflation. Includes: softcard, ramoard, videx Novation Smart Cat AMDEK Videoterm, softswitch, user guide. 12 0 0 Baud full duplex 12" Amber Monitor List: 210.00 List: 695.00 List: 595.00

P.O. Box 2025 ARK: 164.95 ARK: 525.00 ARK: 495.00 Corona, CA 91720

s m a m

IF YOU DONT SEE WHAT YOU NEED, GIVE We accept VISA/MASTERCARD, Personal checks US A CALL AND WE’LL TRY TO 1 (allow 10 days to clear) or COD (2.00 charge). Please include 396 for shipping (2.00 min.) or 596 for blue ■ label (3.00 min.). Calif, residents add 696 sales ta x All I items are new and carry manufacturers warranty. Prices and availability are subject to change without i notice.

Circle No ® ABILITY

Y o u P i c k The D isk System , M egaFlex C ontrols It!

WITH SOFTDRIVERS FOR ~ BRIDGE THE APPLE A FLEXIBLE FUTURE! FORMAT BARRIER! MEGAFLEX—a universal The MEGAFLEX diskette floppy disk controller and does what Apple’s modern alternative to the cannot—read and write Apple drive system offering diskettes from other increased storage, im­ computers! Software- proved reliability and . . . controlled industry-stan­ FLEXIBILITY. dard IBM 3740 or System Enjoy megabytes of 34 type formats allow the online storage with your MEGAFLEX library of refor­ choice of micro, mini, or matting software to read maxi drives—or even 6Mb and write Altos, Radio with the Amlyn cartridge Shack, Osborne, and IBM pack! Ideal for high- PC diskettes. (Call for the capacity storage now, latest software details.) winchester-disk backup MORE STORAGE, MORE later. UNIVERSAL FEATURES, LOWEST COST The MEGAFLEX secret is to autoboot soft- MEGAFLEX with 8" maxi or high density 5.25" drivers that match the needs of your drive system. minis gives you 1.2 Megabyte of formatted data per All hardware functions are software-controlled. diskette for 8 times the file and data size! MEGAFLEX can match new drive capabilities with­ MEGAFLEX offers flexible software choices: out hardware changes. Drive-dependent ROMs • data rate (250/500 Kbits per second), have been eliminated. • single and double density recording, and APPLE III? OF COURSE!! • single/double sided drive operation (max MEGAFLEX is compatible with BASIC, CP/M, 4 drives). Pascal, VISICALC, SOS and DOS-emulation on the MEGAFLEX has the lowest chip count of any Apple III, Apple II, Franklin Ace and Basis. All lan­ controller today! This means less power, a cooler guage features and operating system commands Apple and better reliability. (LOAD, BRUN, etc.) are standard. If you can oper­ Lowest price, highest performance, that’s ate Apple drives you can op- MEGAFLEX! erate MEGAFLEX! Your 11722 SORRENTO VALLEY ROAD Apple software will run with­ SAN DIEGO, CA (619) 452-0101 out modification too. ME&OTTEKA Division of SVA ™X 910-335-2047 APPLE TWO SDG TRADEMARKS CP/M-Oigital Research

Circle No. 59 Product Name: Foxygraf (tape version) Product Name: The Arithmetic Classroom: Decimals Equip, req'd: TRS-80C, 16K Equip, req'd: Apple II Plus or Apple II (with Price: $29.95 cassette Applesoft], DOS 3.3 $34.95 disk Price: $49.95 Manufacturer: Computerware Manufacturer: Sterling Software 4403 Manchester Ave. Sterling Swift Publishing Co. Encinitas, Ca 92024 7901 South IH-35 Description: Foxygraf is a graphics development program Austin, TX 78704 for the TRS-80C. Its major function is a screen drawing Authors: Patricia M. Mullinix, David N. program that allows simple selection of page and screen. McClintock, and Fawzy T. Ibrahim of Graphic screens can be easily interfaced with machine- Courses By Computers, Inc. language routines. Files may be stored on tape. Description: Decimals is one of a series of eight programs covering addition, subtraction, multiplication, division, Pluses: Written in relocatable machine code, Foxygraf is fractions, and decimals. This objective-based tutorial has compatible with the RS disk system! In addition, memory plenty of practice exercises but is not just a drill program. moves and jump to machine-language subroutines are At the end of each lesson is a mastery test. allowed. A HELP command displays all available options. The program teaches much about the 6847 Video Display Pluses: The tutorial approach allows each type of problem Generator (VDG). to be explained first. Good feedback is provided; correct answers prompt encouraging messages, incorrect answers Minuses: None noted. prompt hints. The program also covers converting words ("two tenths") to numeral format. Documentation: A 56-page manual provides complete documentation of the program including major entry and Minuses: Program covers converting mixed fractions to patch points. A discussion of the VDG is included. decimals, but only fractions with powers of ten denominators. Skill level required:Beginners will have no trouble using the screen drawer, but a knowledge of assembly program­ Documentation: Well-written manual has clear instruc­ ming is required to get the most from the software. tions, practice (paper) exercises with answer key, and achievement record forms. Disk programs are easy to use. Reviewer: John Steiner Skill level required:An understanding of fractions. No pro­ gramming required.

Reviewer: Mary Gasiorowski

Product Name: Turtle Graphics Equip, req'd: Any VIC Price: $40.00 Manufacturer: Human Engineered Software 71 Park Lane Product Name: Software Development System Brisbane, CA 94005 SDS80C Description: An easy-to-leam graphics language along the Equip, req'd: TRS-80 Color Computer with printer lines of LOGO. Price: $89.95 Manufacturer: The Micro Works Pluses: The easily installed cartridge offers few commands P.O. Box 1110 and uses letters instead of whole words. Turtle Graphics is Del Mar, CA 92014 a painless way to leam to write short programs. The Description: This product is a complete Editor, manual covers the commands well. Assembler, and Debug Monitor in a program pack for the Color Computer. ABUG, the debug monitor, is a short Minuses: VIC's high-resolution drawing capability is version of CBUG, their excellent stand-alone monitor. It totally ignored, which limits resolution to 22 by 24 dots. has memory examine/change, display/change registers, two ways of entering a user program, plus cassette Skill level required:Even pre-schoolers should be able to utilities. The powerful line-oriented screen editor has been leam this language. optimized specifically for editing assembly-language source code. Editor features include twelve cursor move Reviewer: Jim Strasma options, string search, line insert/delete, plus block

94 MICRO No. 58 - March 1983 Circle No. 60 YOUR OWN , . PeuonaL Suritchex

w SUPPLY move/copy. The full-feature assembler section has condi­ For Lab or tional assembly, evaluation of complex expressions, and Original Equipment optional direct-object tape generation. The assembler pro­ FE A T U R E S : Efficient 30kHz switching frequency • Four Models satisfy most applica­ vides a variety of printer options and allows single-step tions • Years o t trouble free service »Each side AC line fuse protected •Tele-Tate LED "Pwr- O n" Panel Indicator • Three separate voltage outputs • Metal enclosure provides physical and screen assembly. EMI protection • For experimental use or permanent power source* Soft start feature pro­ tects critical circuits• Parallel operation acceptable for higher current needs*Push-in termin­ als, accept wire or test lead • Light weight, easy to use • AC line cord permanently attached Pluses: A maximum of software development is given in a • Most reliable power source for a variety of uses and applications*48 hour burn-m assures M TBF o f 3 /i years, reasonably priced at S I.9 0 /w a tt * F u ll one year guarantee*2-tone ano- minimum of time. The assembler is the equal of most pro­ daed case • Custom volt/current outputs on special order • Input surge protection « Auto- fessional assemblers, allowing the experienced program­ ' jgggt. cirwittjjrattrtton + rwtQfatioi^j^ ATIONS: ‘ii.,i 'V'W.A' , •- > .i =i h »l . mer to use all "tricks of the trade" in developing 6809 Regulation +0 1% Max *or 10% input ch«inqe • Load Regulation +0 2°* Max on #1 Out software. put • Ripple Noise: Typ. 1% PP M a x .* Over Voltage Protection • Reverse Polarity Protection • Compact, only IW x 4 " x 2% " • Fast load transient response • 5 v o lt adj. ±10% • DC Out­ put: 42 Watts continuous • 70% Efficiency* New Push-On type terminations. Minuses: A few minor facets would be disturbing to an ex­ SCHOOLS- LABS: QUANTITY PRICING ON REQUEST perienced programmer; i.e., a program made up of uncon­ Leoni n c 1545 Osgood St. Unit 11 S. No. Andover, MA 018 4 5 nected modules must be handled as separate modules and Nam* (Flaws print! _ then installed as separate blocks of object code. Address ______ORDER INFORMATION City------Order First Unit — $99.50 Second or More — $79.60 Qty. Model Output #1 Output #2 Output #3 Total OFFER EXPIRES April 30. 1983 Documentation: The 40-page booklet is clear and PS-1 5V-6A + 12V-0.5A — 12V-0.5A PS-2 5V-6A + 15V-0.4A -15V-0.4A S ub-T otal ______thorough. In addition, the booklet gives a concise discus­ PS-3 5V-6A +12V-0.5A -5V-1A Mass. res. add 5% T a x______PS-4 5V-3A +24V0.6A —24V-0.6A Shipping & Handling 4.50 sion of 6809 programming techniques, including a good, Information on other switcher models NC TOTAL primer on position-independent code. Charge to: □ MasterCard □ Visa □ American Express □ Check/Money Order Card # ...... Exp. Date...... Skill level required: Signature . Novice assembly-language progammer. Call Toll Free - 1-800-373-1455; Within Massachusetts - 6T7/682-6936.

Reviewer: Ralph Tenny C irc le No. 61

Product Name Alphabet Squares UV EPROM ERASER Equip, req'd: Apple II with Applesoft, 48K RAM, Erases over 15 EPflOMS -15 mJnutBS erase time Element We 7700 tour? and DOS 3.3 intensity: 12Ws 'Acm2 at 1" Price: $29.95 Erases aH UV EPflOMS (2716. 2732. 2516, 2532, etc.) $49.95 Manufacturer: Versa Computing, Inc. * HOBBY MODEL 3541 Old Conego Rd., Suite 104 INDUSTRIAL MODEL Newbury Park, CA 91320 QUV-T8/2N Description: Young children can practice initial consonant $68.95 and vowel sounds using keys, paddles, or joystick to move WITH TIMER AND a happy-face cursor to one of the three hi-res pictures of SAFETY SWITCH letters. The correct one chosen is then redisplayed full­ QUV-T8 / 2T $97.50 screen. This continues until all letters have been correctly matched. INTELLIGENT PROGRAMMER Pluses: Kids like it and it reinforces letter sounds. Attrac­ STAND ALONE tive graphics use color intermixing for varied shades and textures. Not copy protected; modifiable BASIC code. R S -2 3 2 * RELIABLE * EASY COPY iNo exlem.n equipment needed) Minuses: More could be done to maintain enduring in­ * USER FRIENDLY PROGRAMS: 2508, 2516, 2532, 2716, 27C16, 27C32 terest. Music is marginal. Paddles usable but awkward; ' COMPATIBLE: 8748, 8749H, 8748H 2732A; 2758, IBM PC, TRS-80, APPLE, CPM keyboard OK; joystick is best. Not protected against OPTIONAL MODULES: 2564, 2764, 8755A, 8741 FLEX, TEKTRONICS, MOS RESET or CTRL-C. * STANO ALONE. CRT, OH COMPUTER CONTROL * UPLOAD/DOWNLOAD IN MOTOROLA OR INTEL HEX FORMAT * MICROPROCESSOR BASED * 4 K INTERNAL RAM ( M C S - 4 8 ) * 90 DAY PARTS 4 LABOR WARRANTY ON ALL PR00UCTS PROGRAMMING Documentation: Durable, plastic-covered storage folder is PRICE INCLUDES SOON TO BE RELEASED: PERSONALITY M ODULE attractive and adequate. PR0MPR0-8 128K Version S689. MONEY BACK GUARANTEE $ 4 8 9 .0 0 Skill level required:Ability to recognize letters by sight. LOGICAL DEVICES INC. 781 W. OAKLAND PARK BLVD. • FT. LAUDERDALE. FL 33311 Reviewer: Jon R. Voskuil Phone Orders (305) 974-0967 • TWX: 510-95S9496 ------AlCftO ^ SEE US AT COMDEX SPRING • BOOTH #3019

No. 58 - March 1983 MICRO 95 Circle No. 62

M i i l X * A Versatile Programming Utility for the

I PRINT USING >

| SOUND j s o ;r

Now, from the programming experts atS.D.S., elements in 90 seconds), and a number of an easy-to-use way of putting the POWER other often-needed routines as well (30 and SPEED of machine language routines in routines in all). YOUR OWN APPLESOFT PROGRAMS! Additional library disks titled “Ampersoft Pro­ ROUTINE MACHINE does all the work foryou — gram Library" are already available. no knowledge of machine language pro­ gramming, whatsoever, is required. Simply Some of the other routines in The Routine choose the routine you need from an ever­ Machine (plus others not listed) are: growing library, and Routine Machine will effortlessly put them in your program, and all done transparently! No need to be aware SWAP: Swaps two string or numeric values. of or bother with BLOAD's, HIMEM:, etc. TEXT OUTPUT: Prints with no "word break" on screen. Best of all, with just this starter package, you'll STRING OUTPUT: Input any string, regardless of have the routines to put High Resolution commas, etc. graphics and sound in your programs im­ mediately! Also included is a versatile print ERR: Stack fix for Applesoft ONERR handling. using module to banish the "decimal point GOTO, GOSUB: Allows computed state­ demons" forever! To round out the package, ments. Example: GOTO X * 5or GOSUB we've also included powerful search and X *5 . sort routines (for single dimension arrays; Search; 1000 elements in 1 second Sort: 1000 BLOAD: Load any binary file 5 times faster than normal. Hi-Res pictures load in under 2 seconds. OUR GUARANTEE RESET HANDLER: Treats RESET with ONERR; or IF YOU DON'T SAVE MORE THAN THE PUR­ will RUN or reboot disk. CHASE PRICE OF 'ROUTINE MACHINE' IN HI-RES ASCII: Character set for mixing text YOUR OWN PROGRAMMING TIME IN THE Hi-Res graphics. FIRST 30 DAYS YOU OWN IT, SIMPLY RE­ TURN IT FOR A COMPLETE REFUND, NO TURTLE GRAPHICS: Versatile Hi-Res graphics QUESTIONS ASKED! routines for easy drawing of Hi-Res figures. soutnujesteRn data svstems TM P.O. BOX 582 . SANTEE, CALIFORNIA 92071 • TELEPHONE: 714/562-0670

MICRO No. 58 - March 1983 /AlCftO Software Catalog

Name: Stock Momentum Name: Data Fax The program diagnoses the Name: Super Image Studies System: Apple II, Apple II student's strengths and weak­ Saver/Printer System: Apple II Plus, Apple HI, nesses, prepares a study plan, (SISP) Memory: 48K IBM PC and guides him/her through a System: PET/CBM 2001, Language: BASIC, assembly Memory: 64K comprehensive set of study 3000, 4000, 8000 language Language: Pascal exercises. Memory: 16K RAM Hardware: Two disk drives, Hardware: One disk drive Price: $69.95 minimum printer, 2K Description: This free-form Includes 470-page textbook, Language: BASIC original, EPROM relational filing system is "How to Prepare for the Upgrade, or 4.0 Description: The user can modeled after the standard SAT," 50-page user's Hardware: Any Commodore chart any stock, commodity, folder-page "manual" system manual, two double-sided graphics printer or index in a variety of modes: (i.e., manilla folders, etc.). It is diskettes. w/programmable differentials (momentum), simple to use to keep track of Available: line spacing moving averages, exponential unstructured information. (optional) averages, percentage changes, Harcourt Brace Jovanovich, Price: $249.00 - Apple Inc. Description: If you like or need or multiple overlays. It permits 80-column to draw pictures, charts, all parameters and time frames 1250 Sixth Avenue $199.00 - Apple 40-column San Diego, CA 92101 schematics, diagrams, etc., on up to one year of daily data ad­ $299.00 - IMB PC the PET/CBM screen using justable to user's requests. and leading bookstores and Includes 250-page manual. computer stores PET's graphics, but can't stand typing in the program, then Price: $525.00 Available: SISP SISP Includes 2K EPROM, system Link Systems is for you! lets you draw simple or complex full­ master, data, two 1640 19th Street communications disks, and Santa Monica, CA 90404 screen pictures, save, print, modify, and recall them with manual. |213) 453-1851 Name: Gusher™ ease. The program comes fully Author: Kenneth Troy, System: Apple II, Apple HI, documented and steps the user Harrison Folan IBM PC through the complete process. Available: Name: The Menu Maker Memory: 64K - Apple II and Price: $9.95 cassette Troy-Folan Productions Inc. System: Apple II Plus IBM PC $14.95 on 4040/2031 disk 29 Miller Road Memory: 48K 128K - Apple m Wayne, NJ 07470 Language: Applesoft Language: Pascal Author: Louis F. Roehrs Hardware: One disk drive Hardware: Two disk drives Available: minimum and printer and TELE-TREX Software Name: C64 File and interface Filewriter/ Description: The Menu Maker Systems will help you create and edit (132-columnJ 4 Waring Lane Filereader Description: This specially System: Commodore 64 disk program menus. It allows Littleton, CO 80121 up to 30 items per menu and designed accounting package (303) 770-8144 Language: BASIC for oil- and gas-well operators Hardware: Datasette up to 15 sub-menus plus full editing: add, delete, change, automates joint interest billing recorder, printer and revenue distribution. It optional and rearrange display order. Name: The Dimensional The Menu Makei generates a calculates revenue distribution Description: C64 FILE is a from production runs for each Analysis of the BASIC program you can modify. Great Pyramid multi-purpose database revenue owner, joint interest Price: $19.95 management system that will statements for all working- System: Apple II Includes disk and user notes. allow the user to construct, interest owners, and A.F.E. Memory: 48K Language: Applesoft sort, maintain, and print out a Author: Larry Houbre, fr. reports. The package also gen­ relatively wide range of data Available: erates well pay-out reports and Hardware: One disk drive Description: Programs include fvpes. Filewriter/Filereader L.R.H. Enterprises tracks the balances of revenue tiiio s the user to produce data 358 Ashley Blvd., lw and working-interest owners. modem and ancient measure­ ments of the three chambers, files on casa^n.-. -e? from the New Bedford, MA 02746 Invoices from and payments to information typed m tlliu _ - . '*171 997-7346 vendors are also tracked. Addi­ principle triangles, and coffer. any data files stored on tional reports provided include Volume magnitudes are em­ cassette tape. 1099 reports, list of expense phasized. The programs are a categories, list of vendors and mixture of theory and history, Price: $9.95 - C64 File Name: HBJ Computer $6.95 plus $2.00 shipping - vendors' invoices. The pack­ based on 25 years of research. SAT® Filewriter/Filereader age also prints checks. Programs on Archimedes' Cat­ System: Apple n, Apple II Includes software cassette tle Problem and Rhind Mathe­ Plus Price: $995.00 matical Papyrus are included. and documentation. Also Memory: 48K Includes complete includes data tape for Price: $25.00 Language: BASIC documentation. C64 File. Includes diskette. Description: Now your Apple Available: Author: Kinetic Designs can help you cram for the High Technology Software Available: Russell Grokett Scholastic Aptitude Test Products, Inc. Louis K. Bell Available: (SAT). Computei SAT is a P.O. Box 14665 P.O. Box 7 RAK Electronics computer package that leads 2201 N.E. 63rd St. Augusta, GA 30903 P.O. Box 1585 students step-by-step through Oklahoma City, OK 73113 Orange Park, FL 32073 the test preparation process. [404) 478-2105 (continued)

No. 58 - March 1983 MICRO 97 Circle No. 63

“It’s like old times again in the mutual funds game. Figures for the top equity funds o f1982 are just short of Software Catalog (continued) unbelievable. Sales of fund shares are soaring. ” “Heard on the Street” Wall Street Journal, 1/6/83 Name: SpeedSTAT proposals, analyzing and track­ (Volume 1: ing job costs. The program is GET A FULL DAY’S JUMP ON THE MARKET. Frequencies and remarkably easy to use and is FINALLY, A TOOL TO HELP YOU MAKE Crosstabs) designed to provide numerous MORE INFORMED DECISIONS ABOUT System: Apple II or Apple valuable reports and financial MUTUAL FUND INVESTMENTS. II Plus information for any size FUND MASTER TC IS HERE! Memory: 48K contractor. Language: Applesoft or 6502 Price: $237.00 ‘ Don’t wait for next day’s newspaper! Assembler Includes program diskettes ‘ Automatic data retrieval through Dow Jones News Retrieval Hardware: Two disk drives and instruction manual. Service (TM) provides ability to enter data on day of market Description: An extremely closing. No additional program necessary. Author: Jeff Park easy-to-learn, easy-to-use ‘Gain the ability to follow and chart the performance of up to statistics package designed for Available: 100 mutual funds and several market timing indicators. Funds Software Solutions and indicators are charted against an exponentially smoothed non-programmers that has a capacity of over 10,000 data 9124 Hwy. 17 moving average. Scotts Valley, CA 95066 ‘Automatic ranking of funds according to momentum and rel­points and over 30 different statistics measures. Speed­ (408) 438-2433 ative strength. or from any dealer ‘ Analysis useful for long term investments and switch trading. STAT is a state-of-the-art, ‘Manual entry for system without modem. general purpose business and SYSTEM CONFIGURATION: Apple II+(TM), with 48k; marketing analysis tool. Name: Bulk Mailer Apple III (TM ); Franklin Ace (TM ); 1-2 disk drives. Price: $250.00 System: Apple II Optional: Hayes Micromodem II (TM ); Printer. Includes diskettes, user- Memory: 48K Special introductory offer: written manual, cloth- Language: Applesoft $150.00 until April 10, 1983. covered slipcase. Hardware: Single or dual disk $175.00 after April 10, 1983. Author: Shaffer & Shaffer or Corvus hard disk Available: Order today: Time Trend Software Description: A professional SoftCorp International P.O. Box 128 quality mailing-list program 229 Huber Village Blvd. that features duplication N. Billerica, MA 01862 Westerville, OH 43081 elimination, fastest possible Visa and Mastercard accepted; include card number, expiration date and signature. 800-543-1350 (toll free) Mass. residents add 5% tax. sorts, unlimited coding capa­ Add $2.50 domestic shipping charges. Add $5.00 overseas shipping. bility, multiple label and default options, and instant ac­ Further information available on request. Name: Data Manager cess to any record. Diskette System: VIC-20, COM-64 version (up to 2400 records) Memory: 8K expander can later adapt to hard disk HIGH RESOLUTION GRAPHICS Language: BASIC version (up to 32,000 records). Hardware: Disk drive and LIGHT PEN FOR APPLE II ™ COMPUTERS printer Price: $125.00 - diskette The LPS II is the only true High Reso­ Possible Applications: Description: Data Manager is a $250.00 - Corvus hard disk lution Light Pen System with full soft­ • Computer Aided Design Includes complete ware support for the Apple II Com­ • Computer Aided Drafting complete data management puter. High Resolution pictures, dia­ • Logic Design/Simulation system with up to 1200 entries documentation grams and other graphics can be • Animation and Gamene Playing Playing on a disk. You may define your Author: Joe Marinello easily drawn directly on the screen • G raphic Arts own data then add, change, or Available: o f the Apple II. The pictures shown • Menu Selection delete any record from your here were created with the LPS II and • Process Control Satori Software easy-to-use Applesoft programs • Business Graphics disk. You may also search, 5507 Woodlawn N. w hich are included on the DOS 3.3 • Circuit Analysis m print out a hard copy of any or Seattle, WA 98103 diskette. PENTRAK,®the Light Pen • Interactive Educationc a t i 1 o n ^ ^ " all fields, and run totals. driver, lets you easily create • Text Editing your own Applesoft LPS II Features Include: Price: $59.95 - VIC-20 programs for Light • True Hi-Res $79.95 — COM-64 Name: MicRo Math Pen graphics. PEN- Resolution Includes documentation Blaster PAINTER^is a color • PENTRAK M a­ and binder. System: TRS-80 Model HI, sketching system chine language w hich allows the Software Available: VIC-20 user to create an • PENPAINTER MicroSpec, Ltd. Memory: 16K - TRS-80 infinite variety of Software System 2905 Ports O'Call Ct. 8K - VIC-20 with area fill/refill patterns to be used Plano, TX 75075 Language: BASIC for filling-in the • Four Com plete Description: M icRo M ath sketched areas. Hi-Res Drawing (214) 867-1333 Area refilling allows Systems Blaster offers a combination of various combina­ • Menu Selection arcade game excitement and tions of patterns to Programs basic mathematic drill in addi­ be tried and changed. • Hi-Res Text Name: Job Costing/ tion, subtraction, multiplica­ Hi-Res Text generation is G enerator Tracking a standard feature of the , • Installation/Opera­ tion, and division with levels PENTRAK driver, a llo w in g tion/Programming System: Apple II, Apple II of difficulty from grades one simultaneous use of multiple Manual • Many Complete Plus, or Apple III through eight. user-defined character sets. The Application & Sample Programs with emulator com plete user's m anual includes in­ • Operates in All Screen Modes Price: $15.95 (Applesoft in Includes instruction manual. structions for installation and check­ Installs Easily into I/O Slot 7 ROM) out as well as basic and advanced Installation/ Checkout/Diagnostics Available: Applesoft light pen programming. 90-Day Limited Warranty Memory: 48K Language: Applesoft M-R Information Systems, LPS II and PENTRAK a re trademarks of Gibson Laboratories, Irvme, CA Inc. Apple II and Applesoft are trademarks o< Apple Computer, Inc. Hardware: Two disk drives, 132-column P.O. Box 73 printer Wayne, NJ 07470 GIBSON LABORATORIES Description: Contractors can 23192-D VERDUGO DR. • LAGUNA HILLS. C A 92653 • (714) 770-3088 save time estimating, writing MICRO

Circle No. 64

98 MICRO No. 58 - March 1983 FOR YOUR APPLE II Industry standard products at super saver discount prices

SOFTWARE WORD PROCESSING SPECIAL A R T S C I L ist SGC WITH WORDSTAR AND SUPERCALC! M a g ic a lc ...... $149.00 $ 9 9 .0 0 SPECIAL AND NEW Do professional word processing on your APPLE. Magic Window II ...... 149.00 99.00 All necessary hardware and software included. DBase (Apple) ...... 695.00 475.00 Complete 80 column video display, enhanced FRANKLIN ACE 1000 COMPUTER character set, 16K memory board, Z-Card with BRODERBUND CP/M- software, Wordstar and word processing Payroll ...... $395.00 $295.00 Hardware and Software compatible software and SuperCALC. C h o p lifte r ...... 34.95 25.00 with Apple II ...... $950 (List: $1,228)... Special at $795 Arcade M achine ...... 44.95 29.95 Serpentine ...... 34.95 25.00 FRANKLIN ACE 1000 COMPUTER plus DISK DRIVE, CONTROLLER, Z-80 CARDS List SGC Home A c co u n ta n t...... 74.95 55.00 and M AGICALC...... $1,250 Microsoft Softcard Z-80 ... $399.00 $289.00 Home Accountant Plus ____ 150.00 109.00 ALS S yn e rg ize r...... 749.00 595.00 U-Z-80 Processor Board .. 125.00 DATAMOST EXPAND-A-RAM® PLUS MAGICALC® Microsoft+Premium Syst. . 595.00 Snackattack ...... $ 29.95 $ 22 50 Everything that Visicalc™- can do and much more T h ie f ...... 29.95 22.50 -plus additional memory. Fully compatible with O-COLUMN CARDS Swashbuckler ...... 34.95 24.95 8 Visicalc. Includes DOS, CP/M, Pascal Disk Smarterm 80-Col Display .. $345.00 $225.00 Zork I, II, o r I I I ...... 39.95 27.95 Emulator. No preboot or Apple modification Smarterm Expanded S ta rc ro s s ...... 39.95 27.95 required. Character S e t ...... 40.00 Format II ...... 250.00 175.00 64K EXPAND-A-RAM plus Combination Smarterm System Saver & Fan ...... 59.95 49.00 & Exp. Char. Set ...... 260.00 M ultiplan ...... 275.00 199.00 MAGICALC...... $375 Videx Videoterm ...... 275.00 128K EXPAND-A-RAM plus Videx Enhanacer I I ...... 149.00 125.00 ON LIN E M AGICALC...... $449 Videx VisiCalc Preboot ____ 49.95 45.00 M ystery H o u s e ...... $ 24.95 $ 19.95 Cranston M annor ...... 34.95 24.95 MODEMS FOR YOUR APPLE II Frogger ...... 34.95 24.95 APPLEsurance II® Hayes Smartmodem 300 .. $229.00 Screen W riter II ...... 129.95 99.95 Diagnostic Disk Controller and System Hayes Smartmodem 1200 . 699.00 550.00 Memory Management II ... 49.95 39.95 Assurance Package. Standard disk M icrom odem II ...... 279.00 controller plus automatic check Hayes 100 Baud ...... Call PEACHTREE of system hardware ...... $99 Apple Cat II ...... 389.00 299.00 GL, A R .A P , D Cat M o d e m ...... 199.00 175.00 Inventory, Payroll .... ea.$400.00 ea. $295.00 M icro B uffer II ...... 299.00 249.00 5 1/4” DISK DRIVE MONITORS Use with either standard Apple II disk Amdek 300G Green ...... $159.00 SENSIBLE SOFTWARE drive or APPLEsurance I I ...... $249 C o lo r-T a x a m RGB Super Disk Copy III ...... $ 29.95 $ 22.95 with Interface ...... 395.00 DOS Plus ...... 24.95 17.95 GRAPHITTI CARD PARALLEL INTERFACE Centronics Compat. PRT-1 . $ 69.00 SERIUS SOFTWARE Prints HIRES page 1 or 2 from onboard firmware. B a n d its ...... $ 34.95 $ 26.95 Features: True 1:1 aspect ratio, prints emphasized E p o c h ...... 34.95 26.95 JOYSTICK Replaces two mode, reverse mode, rotates 90 degrees... plus Fly W a rs ...... 29.95 22.95 Apple Paddle Controllers . $ 59.00 $ 39.00 more. Compare all this with the Grappler. We think G o rg o n ...... 39.95 29.95 you'll agree that this is the best graphics card on Sneakers ...... 29.95 22.95 FUNCTION STR IP ...... $ 79.00 $ 65.00 the m arket. Specify fo r use w ith EPSON, NEC- Joy P o r t ...... 74.95 59.95 8023, C-ITOH Prowriter, or Okidata. MEMORY EXPANSION W iz a rd ry ...... 49.95 34.95 (List: $125) ...... $89 Prometheus 16K RAM Module N ight of D ia m o n d s ...... 34.95 26.95 com plete ...... $169.00 $ 65.00 Star M a z e ...... 34.95 26.95 PARALLEL PRINTERS 51/4” FLOPPY DISKS PFS ...... 125.00 89.95 Box of 10 with hub rings PFS R e p o rt...... 95.00 69.95 NEC 8023 or C-ITOH 8510 PFS Graph ...... 125.00 89.95 W ith other p u rch a se ...... $ 1 9 .9 5 (Virtually identical) Specifications: • 100 CPS dot Without other purchase ... 23.00 Data Capture 4.0 ...... 64.95 49.95 matrix printer • 80 column p rin t-136 characters Merlin/Assembly Lines____ 119.95 89.95 per line • Tractor/friction feed • 7 different print fonts included • 2K printer buffer • Proportional All equipment shipped factory fresh. Manufacturers' warranties M e rlin ...... 64.95 49.95 included. California customers add 6 1/2% tax. Include payment by ASCII Express Pro ...... 129.95 99.95 spacing • Bit image graphics and graphic symbols. personal check, money order, or cashier’s check with order and SGC will pay shipping charge. Call for amount of shipping charge Transend I I ...... 149.00 119.00 NEC 8023 or C-ITOH $475 when paying by credit card. Transend I ...... 89.00 65.00 NEC 8023 or C-ITOH 8510 with DB M aster ...... /... 229.00 165.00 Parallel Interface and Cable ...... $550 All items are normally in stock DB U tility P a c k ...... 99.00 79.00 EPSON 100 with Parallel Interface and Cable ...... $775 415)490-3420 STRATIGIC SIMULATION All Software ...... $ 59.95 $ 39.95 BROTHER Daisywheel Printer...... $895 ... And we’ll be here to help after you All S o ftw a re ...... 39.95 27.95 receive yo ur order. Feel free to call the SGC Technical Staff for assistance. SYNERGISTIC SOFTWARE VERSAcard FROM PROMETHEUS Wilderness & Dungeon ... $ 32.50 $ 24.95 Four cards on one! With true simultaneous opera­ GPLE ...... 64.95 49.95 tion. Includes: (1) Serial Input/Output Interface, TG Joystick ...... 59.95 45.00 Parallel Output Interface, (3) Precision Clock/ Select-A-Port ...... 59.95 45.00 alendar, and (4) BSR Control. All on one card. Fully compatible with CP/M- and Apple Pascal'. W ordstar ...... 325.00 A S p e lls ta r...... 175.00 (List: $249) ...... $169 SNH The matt order specialists S uperC alc...... 175.00 VisiCalc ...... 179.00 342 Quartz Circle, Livermore, CA 94550

No. 58 - March 1983 MICRO 99 /A lC ftO Hardware Catalog

Name: Color Chart restored. No special program­ Additional options under Cards, uses both floppy and System: Commodore ming, rewiring, or soldering is development include a hard disk drives. The Rover CBM/PET required. mechanical arm, a voice syn­ System weighs less than 18 Rockwell AIM Price: $220.00 thesizer, and digital radio com­ lbs. The battery will allow up Description:Coior Chart is a Includes 4K Rememory munication between RB5Xs. to six hours of operation with color-video RAM board that Board with battery. Price: $1195.00 the Multifunction Expansion operates in eight different Available: Special Option Package, Unit (option 001). modes — alphanumeric 32 x Devices and Services Co. $295.00 Price: $1850.00 Computer 16 with built-in character 10911 Dennis Road Available: $2500.00 System generator to high resolution Suite 405 RB Robot Corporation Includes Rover 1 Portable 128 x 192 pixels. Color Chart Dallas, TX 75229 14618 W. 6th Ave. Computer, Rover Display generates an independent Suite 201 Unit, Multifunction RS170 output. Business graphs Golden, CO 80401 Expansion Unit (option and game graphics can be dis­ Name: DISCOVER (303) 279-5525 001) and attache carrying played in color. Description: DISCOVER is a case. Price: $139.95 stylish and sturdy diskette box Name: ZVX4 Megabytei Available: Includes color chart board expertly crafted of naturally Exclusive Dealer Distributer and instructions. finished solid wood with brass System: Apple II Plus Hardware: Apple II Plus M.P. Computer Services Available: simulated aluminum that pro­ Corp. vides convenient and safe with 48K-56K, CGRS Micro tech one 5 Vn" drive 2396 Encinal Station P.O. Box 102 storage for as many as forty- Sunnyvale, CA 94087 five 5 Yt" diskettes in three Language: Apple DOS 3.3, Langhorne, PA 19047 Pascal, CP/M (408) 735-0871 (215) 757-0284 equally spaced sections. The Dealer inquiries invited low profile top design keeps (Microsoft and the lid out of the way when PCPI) Description: ZVX4 Megabyter Name: Rabble OZI Name: Mannesmann open and conveniently ready Expansion Board to close with one hand. is an 8” disk controller for Ap­ Tally Microprinter ple II that provides up to 2.2 System: Ohio C1P M T160 Price: $59.95 Redwood; megabytes with two double­ Superboard 11 Memory: 2000 characters $67.95 Oak; $69.95 Walnut sided/double-density disk Memory: 32K RAM plus up Language: USASCII plus six plus $3.00 s/h drives. It uses IBM industry - to 32K ROM European Available: standard 3740 format to create Description: The Rabble Ex­ languages Leland Young Company standard 8" diskettes that are pansion Board system for the Description: This 80-column P.O. Box 4127 usable on other computer C1P contains 32K CMOS RAM serial matrix printer has 160 Bay Pines, FL 33504 systems. and sockets for 32K ROM. A characters per second friction simple modification to the Price: $445.00 feed, optional tractor feed, dot C1P will permit 40K RAM addressable graphics, optional Includes controller, manual, Name: RB5X startup software. (using C1P 2114's). Features correspondence quality print System: All are: Ohio compatible floppy with right-margin justifica­ Memory: 8K Available: disk controller with motor Sorrento Valley Associates, tion, text centering, and pro­ Hardware: Mobile Intelligent control and data separator, Inc. portional spacing. The printer Robot real-time interrupt facilities, 11722 Sorrento Valley Road features 8-bit parallel and Language: Tiny BASIC two programmable sound gen­ San Diego, CA 92121 RS232 interface. Description: RB5X is an ex­ erators and amplifier provide (619) 452-0101 Price: $845.00 and up perimental intelligent robot six simutaneous sounds to be Available: that learns from its own ex­ output at once, and user in/ Mannesmann Tally perience, progressing from Name: Rover 1 Portable out expansion is provided for |for OEM quantities) simple random responses to an Computer with a peripheral and versatile Industrial distributors, ability to generalize about System: Dual 8 Bit interface adaptor (PIA and computer dealers, and features of its environment. Microprocessors VIA). A prototype area is computer stores Equipped with its own micro­ (6502 Family) available for approximately processor, memory, programs, Memory: 128K RAM, 4K 20 ICs. and tactile sensors, the KB is PROM, built-in Price: $430.00 Name: Rememory Board intended as a tool for experi­ tape drive $90.00 bare board and System: AIM 65 menters. It can be "trained” , Language: 6502 Assembly, manual Memory: 4K studied, and adapted in a varie­ BASIC and others Includes fully socketed, fully Description: The Rememoiy ty of ways according to the im­ shortly populated (except ROM) Board for the AIM 65 provides agination of its owner. With Description: The Rover 1 Por­ board tested and set up for 4K of low power CMOS RAM the standard RS-232 interface, table Computer, a part of the 5 !4 " drives (8” if requested with battery backup. Simply the robot’s memory can be Rover Computer System, is N/C). Ninety-page manual remove the AIM 65 RAM chips studied, and its programs suited for business applica­ with circuits. and plug the Rememory Board altered via a personal com­ tions, home, office, or schools. Available: into the RAM sockets. Pro­ puter. A Special Option Standard full/travel keyboard Rabble OZI Computers grams and data are protected if Package with 16K add-on with ten function keys, 110V P.O. Box 781 the computer is turned off or memory, Polaroid Rangefinder or 220V, RS-232, serial and Shepparton VIC 3630 loses power, and are ready to sonar sensor, and pulsating parallel ports, real-time clock, Australia run when the power is light option is also available. video output, accepts CP/M AlCftO

1 00 MICRO No. 58 - March 1983 r Language Packages Editor’s Note: This list provides a sample of the most popular

FORTH At Extended Atari 10K plus $100 o fig-FORTH At 400/800 FORTH Quality Software 24K, 810 drive $79.95 disk/manual 6809 FORTH Kenyon Microsystems TSC FLEX 9.0 DOS $100 Ap II FORTH Kuntze $90 At 400/800 valFORTH Int'l. valFORTH 24K plus 10-12K working space $45 plus $40 Gen.U til. & Vid. Ed. TRS-80C Colot-FORTH Hoyt Steams $123 (RAM & JVICRO"

Electronics ROM), $58.95 Packages Language (RAM) TRS-80C Color-FORTH Hoyt Stearns $58.95 (RAM|, $123 (ROM & RAM) Ap n/n FORTH 72, MicroMotion 1 drive $89.95,

Version 2 $139.95 hi-res #1 Sheet Information &. floating point Ap n MicroSPEED I, n Applied Analytics 48K RAM, 1 drive $495/$645 (structured, totally recursive, com­ piled language) AP n/u FORTH 1.7 Information Unlimited APDOS, 48K RAM, 1 drive $140 Software a p n/n OGI fig-FORTH On-Going Ideas 48K, Disk II $40 diskette or $60 with OGI Pascal Ap n, 6809, 6502 fig-FORTH source 3 FORTH Interest $10 listings Group Ap n/n polyFORTH FORTH, Inc. 48K, Z80 card Level 3 ($600), Level 4 full system source ($3200) FORTRAN Ap n/n Pius Apple FORTRAN Apple 48K with 16K RAM card/Ap Pascal Lang. Sys/2 drives $500 Ap n/n Pius FORTRAN-8O Microsoft 48K/16K RAM card optional/1 drive - 2 preferred/ $195 program W,M. Softcard includes CP/M alone plus $400 for softcard Ap FORTRAN Compu/Think PILOT $69.95 Ap Nevada FORTRAN CP/M $199.95 OSI FORTRAN 3.4 OSI CP/M, 8 disk drives $400 Ap FORTRAN-7 7 SofTech Microsystems, 48K RAM/64K for Prog. Develop., UCSD p-System $375 for 8 disk o Inc. plus $375 for UCSD p-System ap n/n Nevada FORTRAN Ellis Computing Softcard, CP/M, 1 drive $29.95

LISP Ap LISP Owl Computers Ap APP-L-ISP Datasoft, Inc. DOS 3.2, 1 disk drive $124.95 Ap n/n p-LISP GNOSIS APDOS, 48K RAM, Applesoft in RAM or Lang. Card $149.95 disk (tutorial & manual incl ! 6502/Ap muLISP/ Microsoft APDOS, 32K, 1 drive, CP/M muSTAR-80 At 400/800 INTERLISP Datasoft, Inc. 48K RAM, 1 drive $124.95 LOGO Ap n/n Pius LOGO Krell Corp. disk drive (l]/lang. card $99 no frills combination/ $89 frills only/$149.95 combination TRS-80C TRS-80 Color Radio Shack 1 disk drive, 32K $99 disk LOGO Ap n/n Pius Terrapin LOGO Terrapin, Inc. 1 disk drive/lang. caid, 16K memory board $149.95 Ap n/n plus Apple LOGO Apple 1 disk drive/lang. card, 64K RAM $175 VIC-20 Turtle Graphics HES $39.95 Micro-Dymanic Ap n Micro-Dynamic Addison-Wesley 2 disk drives, lang. or RAM card & Pascal $245 Publishing Co.

Modula-2 Ap n Modula 2 (systems Volition Systems Apple Pascal 1.1 $495 implementation]

o 68000 Multi-FORTH Creative Solutions 64K (Motorola MEX68KDM] $1500-5000 MUMPS 6809, 68000, Apple MSM-09 Micronetics Design Corp. &4K min. $695 This Language Package information sheet is continued from the February issue. /MCftO Inforr nation Sheet #1 Language Packages

Pascal At Atari Pascal Atari disk drive $49.95 6809/Ap Dynasoft Pascal 1.2 Dynasoft Systems 6809-16K/cassette. Ap-disk/cassette $45 cass (6809], Limited $55 disk/ O $50 cass (Ap), $90 {1.3} GIMIX systems with FLEX CB/M Tiny Pascal Abacus $40 cass/$.35 disk 6809/6502/68000 UCSD Pascal SofTech 64K for Prog. Development/UCSD p-System $375 Ap U/n Plus Pascal-Level I On-Going Ideas Disk II/DOS 3.2 or 3.3/48K/Applesoft ROM $35 diskette (Level IJ/$69 (Level 11} generates 6502 machine code Ap Pascal Merrimack Systems CB/M Pascal Commodore Business $250 Machines 6809 P-6800 Pascal Lucidata GIMIX under TSC FLEX $90 (2.1 MiniFLEX}, $100 (2.2 FLEX 2), $100 (FLEX 9) TRS-80C Color Pascal Computerware ASCII Text Editor/32K min. $49.95 (tape), $59.95 (disk} 6809 UCSD Pascal 3 Taligrass Technologies $495 Corporation Ap Pascal Compiler Micro ware OS9 Ap Pascal Compiler Omega Software OS9/M DOS/FLEX/XDOS/DOS69 $425 Ap JRT Pascal JRT Systems, Inc. CP/M $29.95 with manual 68000 Pascal Hemenway Assoc., Inc. Ap Tiny Pascal Plus Abacus 32K ROM or 48K RAM $55 cass/S59 disk with DOS PET KMMM Pascal AB Computers 16K or 32K, disk drive $85 disk Ap Apple Pascal Apple recom. 2 drives $495 OSI C4PF/CP-C4 Pascal 1.3 OSI C4PF - 5 V* disks, CP-C4 - 8 disks $460 Ap Pascal/M 2.2 Sorcim CP/M, Z-80 card, 64K, 2 drives CBM Tiny Pascal Abacus $49.95 Ap II Pascal I On-Going Ideas 48K ROM Applesoft, 8K min. runtime $35 Ap H Pascal II On-Going Ideas 48K, Disk II $60 Ap n Program Develop­ On-Going Ideas 48K ROM Applesoft, Disk 11 $60 ment I (OGI Pascal Level I) PILOT o Ap II PILOT On-Line Z-80 card $150 Ap APPILOT Muse $49.95 PET PETPILOT Commodore $24.95 Ap Nevada PILOT M S149.95 COM Vanilla PILOT Tamarack 16K RAM $29.95 Ap APPILOT n Muse 48K, DOS 3.2 $99.95 (EDU-DISK) Ap Apple PILOT Apple recom. 2 drives $150 Ap n /II Nevada PILOT Ellis Computing Softcard, CP/M. 1 drive $29.95 At Atari PILOT Atari $179.95

Small C 6809 Small C Compiler Wordsworth FLEX 9 or DOS 69D, 48K $52.90 (FLEX 9),$47.50 (if you have RLOADI, $47.50 (DOS69D TRS-80C Small C Compiler Duggers Growing Systems $59.95 plus assembler pkg

VIGIL VIC/PET VIGIL (interactive Abacus 3K or 8K expander $35 games language) XASM

6502 with CP/M XASM 6500 Succinct Systems 32K rain, plus CP/M |Systems implemen­ tation Language) XPLO Ap n, KIM, SYM, AIM XPLO 6502 Program Exchange $150 (Ap) includes APEX DOS/S45 (others). $15 user's manual o

iSMCAO Information Sheet #1 VIC-20

o VIC-20 VIC-20 Memory Map 6502-based home computer manufactured by Commodore Address Function Connects to any TV through RF modulator. $00-$FF Page zero: operating system storage, pointers, floating Full-size keyboard Includes graphic characters point accumulators, flags, etc. and programmable function keys. $100-$1 FF Microprocessor system stack $100-$10A Floating-to-string work area Graphics: $200-$2FF Operating system buffers, tables, vectors, I/O flags, 16 colors keyboard handling Multi-color characters $300-$3FF Vectors, tape I/O Programmable characters $400-$FFF Expansion RAM Limited hlgh-resolution $1000-$1DFF User BASIC RAM (in unexpanded version) Sound: $1 E00-$1 FFF Screen RAM (In unexpanded version) 3 Music voices $2000-$3FFF 8K RAM/ROM expansion Noise voice $4000-$5FFF 8K RAM/ROM expansion NH I/O: $6000-$7FFF 8K RAM/ROM expansion Commodore cassette $8000-$8FFF Character generator ROM n Expansion cartridge $9000-$900F VIC Chip (6560) i Parallel $9110-$911F VIA (6522) IS) Commodore serial $9400-$95FF Color RAM (location with RAM at $400) o RS-232 (partially Implemented) $9600-$97FF Color RAM (location without RAM at $400) $9800-$9BFF I/O Block 2 $9C00-$9FFF I/O Block 3 $A000-$BFFF Expansion ROM $C000-$DFFF BASIC ROM $E000-$FFFF Kernal ROM--machine independent routines and vectors

Table of Musical Notes Expansion/Cartridge Connector

, Approx. Note Value Pin Function Pin Function C 135 1 GND A GND c# 143 2 CDP B CA0 D 147 3 CD1 C CA1 o D# 4 CD2 D CA2 151 E 159 5 CD3 E CA3 F. 163 6 CD4 F CA4 F# 167 7 CD5 H CA5 G 175 8 CD6 J CA6 G# 179 9 CD7 K CA7 A 183 10 BLK1 L CA8 A# 187 11 BLK2 M CA9 B 191 12 BLK3 N CA10 C 195 13 BLK5 P CA11 C# 199 14 RAMI R CA12 D 201 15 RAM2 S CA13 D# 203 16 RAM3 T 1/02 E 207 17 VR/W U 1/03 S02 F 209 18 CRM V NMI F# 212 19 IRQ w RESET G 215 20 NC X NC G# 217 21 + 5V Y A 219 22 GND z GND A# 221 B 223 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 C 225 C# 227 D 228 D# 229 ABCDEFHJKLMNPRSTUVWXYZ E 231 F 232 F# 233 G 235 G# 236 A 237 Cassette A# 238 Pin Function B 239 1 GND 1 2 3 4 5 6 C 240 2 + 5 V C# 241 3 CASSETTE MOTOR Poke value Into 36874, 36875, 36876, or 36877. 4 CASSETTE HEAD Control volume with POKE 36878,0 to 15. “■—■— m— w ~T 5 CASSETTE WRITE o 6 CASSETTE SWITCH A B C D E F

/AlCftO Data Sheet #14 VIC-20 User I/O Pin Function Pin Function Game I/O Port 1 GND A GND Pin Function 2 + 5 V B CB1 1 JOYO 3 RESET C PBO 2 JOY1 4 JOYO D PB1 3 JOY2 o 5 JOY1 E PB2 4 JOY3 6 JOY2 F PB3 5 POT Y 7 LIGHT PEN H PB4 6 LIGHT PEN 8 CASSETTE SWITCH J PB5 7 + 5V 9 SERIAL ATN IN K PB6 8 GND 10 + 9V L PB7 9 POT X 11 + 9V M CB2 12 GND NGND

3 4 5 6 7 9 10 11 12 ■__■

ABCDEFHJKLMN

Color Codes Audio/Video B U C K 0 Pin Function WHITE 1 1 + 5 V, REGULATED RED 2 2 GND CYAN 3 3 AUDIO PURPLE 4 4 VIDEO LOW GREEN 5 5 VIDEO HIGH BLUE 6 YELLOW 7 ORANGE 8 Serial I/O LT. ORANGE 9 Pin Function PINK 10 1 SERIAL Srt<5 IN LT. CYAN 11 2 GND LT. PURPLE 12 3 SERIAL ATN IN/OUT LT. GftEEN t3 4 SERIAL CLK IN/OUT LT. BLUE 14 5 SERIAL DATA IN/OUT LT. YELLOW 15 6 RESET O 6560 Video Interface Chip (VIC) Address

$9000 36864 7 Interlace mode (1on, Ooff) 6-0 Screen origin-horizontal $9001 36865 Screen origin-vertical $9002 36866 7 Screen address-bit 9 6-0 Number of video columns $9003 36867 7 Part of raster value 6-1 Number of video rows (0-23) 0 Character size (8 x 8 0, 8 x 16 1) $9004 36868 Raster value $9005 36869 7 Must be 1 6-4 Screen address-bits 10-12 3-0 Character memory (value 0-3: ROM, 12-15: RAM) $9006 36870 Light pen-horizonai $9007 36871 Light pen-vertical $9008 36872 Paddle X $9009 36873 Paddle Y $900A 36874 Bass voice 7 Switch 6-0 Frequency $900B 36875 Alto voice 7 Switch 6-0 Frequency $900C 36876 Soprano voice 7 Switch 6-0 Frequency $900D 36877 Noise voice 7 Switch 6-0 Frequency $900E 36878 7-4 Auxilliary color O 3-0 Volume $900F 36879 7-4 Screen color 3 Reverse mode (normal 1, reversed 0) 2-0 Border color

AMCftO Data Sheet #14 Printers AlCftO Information Sheet #2 : k / i / „

*

GEMINI- FOR PRINTER VALUE THAT’S OUT OF THIS WORLD

Over thirty years of down-to-earth experi- feature is a 2.3K buffer. An additional 4 K ence as a precision parts manufacturer has is optional. That's twice the memory of lead- enabled Star to produce the Gemini series ing, comparable printers. And Gemini is of dot matrix printers—a stellar combina- compatible with most software packages tion of printer quality, flexibility, and reliabil- that support the leading printers, ity. And for a list price of nearly 25% less Gemini reliability is more than just a than the best selling competitor. promise. It’s as concrete as a 180 day war- The Gemini 10 has a 10" carriage and ranty (90-days for ribbon and print head), a the Gemini 15 a 151/2" carriage. Plus, the mean time between failure rate of 5 million Gemini 15 has the added capability of a bot- lines, a print head life of over 100 million tom paper feed. In both models, Gemini characters, and a 100% duty cycle that quality means a print speed of 100 cps, high- allows the Gemini to print continuously, resolution bit image and block graphics, Plus, prompt, nationwide service is readily and extra fast forms feed. available. Gemini’s flexibility is embodied in So if you’re looking for an incredibly its diverse specialized printing 1 1 a high-quality, low-cost printer capabilities such as super/ that’s out of this world, look sub script, underlining, back- to the manufacturer with its spacing, double strike mode I I I feet on the ground—Star and and emphasized print mode. An- 1 1 ■ I ■: the Gemini 10, Gemini 15 dot other extraordinary standard mnronics»inc matrix printers. MAKING A NAME FOR OURSELVES 1120 Empire Central Place, Suite 216, Dallas, TX 75247 ______C ircle No - ■

BATTERY 6 MINUTES V»AC LINE BATTERY. ■ * H ■ ■ 2 MINUTES

G u a r d i a n * \ n g e i :TM

‘^ //^ electronics. INC.

SIGN

yPSlD lAN PROTECTS M O NITOR — MICRG ? LECTRONIC SAFETY

OR DATA SAVE YOUR DATA FROM POWER 0

• No voiding warranty — no cutting wires » Automatic audl • UL listed • FCC approved • Transient voltage suppressor g • Green/red LED power status indicator • Green — normal A 'w te tj Sfovf blinking™ ..... standby power • Fast blinking red — approximately 2 minul naming battery power • Solid state t by any UPS power unit in its class. . II SEE YOUR RH ELECTRONICS ELECTRONICS, INC. PRODUCTS DEALER l| FOR YOUR APPLE II': SUPER FAN ir '“ ...... $ 74.95 COPYRIGHT © 1981 • PATENTS PENDING SUPER FAN H"VZENER RAY'“ ...... *109.00 SUPER RAM It'"...... S I25.00 566 IRELAN, BUELLTON, CA 93427 RH 12 VOLT TRANSVERTER...... $149 00 (805) 688-2047 FOR MICRO COMPUTERS: GUARDIAN ANGEL"1...... *595.00 Circle No. 67 /A lC ftO Interface Clinic by Ralph Tenny you turn on any modem computer like one |READ is active high), or to receive the Color Computer, it already knows data when R/W* is at logic zero. Q is a Some of the fun I have working on the how to read the keyboard, display in­ timing signal that tells the memory Color Computer is making use of the formation on the screen, and read pro­ when the data is valid, and causes the superb architecture of the basic grams from the cassette recorder and memory to record data presented dur­ machine. It is my intent to use this col­ (perhaps) the disk. It also knows ing a Write cycle. umn to help you leam the art of com­ BASIC, and is able to help you leam For now I will bypass how a pro­ puter interfacing so that you-can realize how to operate it. In other words, the gram is placed in memory. What you maximum personal use and satisfac­ modem home computer already ^has a need to visualize is an interface to the tion from youi machine. I will deal lot of program information furnished as real world! After all, if the computer with programming as necessary, but part of the package. This column will can't communicate with the world out­ there will be special emphasis on the help you leam to use the existing hard­ side its case, it can't do useful work — Radio Shack Color Computer. This ware-and software for new purposes and not even communicate with its oper­ machine is one of the most cost- to add more hardware and software to ator! So, besides the memory, which effective designs available for its perform new tasks. holds instructions and data, the jjP original purpose of game playing, and it Before I begin discussing interfaces, must have some sort of external circuit also has great potential for other ap­ you need to be aware of some calling to perform the interface function. Some plications. In many cases, the theory conventions used in hardware and logic early jjPs had status and flag lines that behind my discussions will apply to discussions. First, most logic lines will were connected to package pins on the any microcomputer, but specific de­ be assigned names that enable you to >*P. A status line could be set to +5 tails will apply to the Color Computer. discuss them. Where possible, the sig­ volts (logic one) or 0 volts (logic zero) Since I will be talking about com­ nature will remind you of the line's by external signals. The flag lines could puter interfacing, let me define what function. If a logic line has one logic be set to logic one or logic zero by the that means. A computer interface is an level (high or low) that causes fiP, and external circuits would "read" electrical circuit that transfers informa­ something to happen, that is the active that level and cause some action to tion or electrical energy between the level. For example, memory-enable happen. For example, a flag line could computer and the outside world. This lines usually enable (turn on) the be used to turn on a light or relay, transfer can occur in either direction — memory for read or write when the line signalling that the (iP had (for example) from the computer to the outside is at logic 0; the line is defined as active finished running a program. Most world, or to the computer from the out­ low. A dual-function line may have a modem j^Ps (including the 6809) have side world. I will also use the terms name signifying the function of both Programmable Interface Adapters (PIA) "transducer” and "sensor." A trans­ levels. There are at least two common that decode the address lines and read ducer is a device or material that trans­ ways to signify the active level: the forms input energy of one form to out­ active-low state may have a line over put energy of another form; a sensor the signature (overbar), or the active- Figure 1: The pinout for the 6809E low signature may be designated by an microprocessor used in the Radio Shack transforms a physical stimulus into an Color Computer. See text for a discus­ electrical signal. asterisk (MEMENA*). sion of pin functions. Figure 1 shows the pinout of the Fundamentals 6809 n P used in CoCo; you can see 16 Vss 1 40 HALT* (Editor’s note: For CoCo users who address lines (A0-A15) and 8 data lines NMI* 2 39 TSC are beginners with machine language, I |D0-D7). If the |iP sets the address IRQ* 3 38 LIC lines to read one of 65536 (2*«16) FIRQ* 4 37 RESET* recommend Rodney Zak’s Program­ BS 5 36 AVMA ming the 6809 published by Sybex, or a unique memory locations, the memory BA 6 35 Q similar elementary programming book responds by making available one byte Vcc 7 34 E to get started.) (eight bits) of data on the data lines. AO 9 33 BUSY R/W* Let me review some microprocessor The nP continuously performs sequen­ A1 9 32 A2 10 31 DO ( HP) fundamentals before I discuss in­ tial operations, following instructions A3 11 30 D1 terfacing the Color Computer. The in the program. Each byte of an instruc­ A4 12 29 D2 "brain” in your computer is a m P that tion is located at a unique address in A5 13 26 D3 14 D4 performs nearly one million operations the memory of the computer. A6 27 A7 15 26 D5 (machine cycles) each second. Any Besides the address bus (16 lines) A8 16 25 D6 operating computer is reading and ex­ and the data bus (8 lines] already men­ A9 17 24 D7 ecuting a list of instructions called a tioned, the /iP has some control lines, A10 18 23 A15 two of which are called R/W* A11 19 22 A14 program; making that list is called pro­ A12 20 21 A13 gramming, regardless of the language. (Read/not Write,- Write is active low) A12 20 21 A13 Without a program, the computer is and Q. R/W* signals the memory to A12 20 21 A13 helpless and stupid. However, when furnish data when this line is at logic

108 MICRO No. 58 - M arch 1983 or write data on the data bus, trans­ will be faster [work better) than others. that interfaces with the had 16 ad­ lating the jiP's blinding speed into fixed The manufacturer furnishes data on dress lines. However, this would re­ voltage levels. PLAs are said to be timing variations, and the worst case quire large (and expensive) IC packages memory mapped — they occupy part of data is that performance extreme that to make room for so many pins. Since the 65536 memory address locations. will be most likely to cause a circuit that isn't feasible, devices called Since each address must be unique, design to operate improperly. decoders are used. For now, I will ex­ memory address space set aside for Figure 2 represents a snapshot of the plain the function and leave the details PIAs and other devices must not be precise time interval that data is being until later. One popular decoder has used by memory. sent to the latch in figure 3. How long three address input lines and eight The /iP performs its operations so do you have to capture that data? The mutually exclusive active-low outputs. rapidly that any bit of data will be data first becomes valid .251 + .028 + In effect, if the three most significant available for less than one micro­ .223 (.502) /i&ec after E goes low. That address lines (A13-A15) are decoded, second. Figure 2 shows the bus activity means .that the manufacturer guaran­ the eight outputs will divide the 64K for one machine cycle. Assume that six tees that a 6809E will take no longer memory address space into eight 8K of the eight data lines are connected to than .502 pSec to deliver data to the blocks, with only one block enabled at a latch or data register as shown in data bus. Two numbers in figure 2 are a time. If you refer to figure 3, the figure 3; if the latch is active |reads the followed by '(H); this designates hold signature DECODE*, working in con­ data) when Q drops back to a logic 0 time, or how long the data is available junction with R/W* and Q, produces level, then the data is captured by the after another signal changes. If you sub­ the latch enable signal STROBE*- latch. You should realize also that this tract .502 from 1.12, then add .03 pSec (shown in proper time rlationship in latch, like any memory location, must hold time, you will derive how long the figure 2J. be addressed by the only when the data is available,- the answer is .618 As a result of the unique combina­ data is intended for storage in the latch. fjSec! During the very next machine tion of signals, the circuit of figure 3 Several numbers appear in figure 2 cycle, the data on the data bus will be will capture six of the eight bits of the and represent time in microseconds different and intended for another data appearing on the data bus when (/iSec), measured from left to right. For destination. If you think about it, there STROBE* comes true. U2 will hold example, the time for one cycle of are only two things that distinguish the this data on its output pins until power signal E is 1.12 piSec, and Q goes high machine cycle of figure 2 from any fails or new data is written into the .251 ^Sec after E goes low, staying high other machine cycle. First, this is a latch. In other words, the latch output for .502 jiSec. In general, I will present WRITE cycle, since R/W* is low (W can be considered as a "permanent" this type of timing diagram using worst active), so it is sending data out from copy of the data that was available for case times. Later, I will discuss how to the jjP. Second, each data destination only .6 nSec! derive worst case data. For now, just must be unique to avoid memory errors If you have a question, or want to realize that all integrated circuits have and conflicts. suggest a topic for discussion in this performance variations; i.e., for any The process of defining a unique column, please write to me at P.O. Box number of one kind of IC, some parts destination vifould be easy if every part 545, Richardson, TX 75080.

NOTE: ALL TlftS IN MICROSECONDS Figure 2 (left): A basic timing diagram for the 6809E microprocessor, show­ ing the timing relationships during a WRITE cycle. The bottom wave form shows the timing response of the CMOS NOR gate U1 shown in figure 3. 1. 12 Figure 3 (below): One possible schematic diagram to Implement a data latch on the 6809E bus. U1 generates the proper strobe to cause U2 to capture the data shown in figure 2. .251- -.502

Q NOTES: DECODE* U t: 'A CD4025 U2: CD40174 R/W* R/W*‘ CLK . 02 8 022(H) DATA 0 ------D1 Q1 AD Oft «A ts Q 5 V DATA 1 ------D2 Q2 -.223- h*-.033(H) U2 2 4 V DATA 2 ------D3 Q3 DATA > M T A V A L I D TVlTflUHIH 7J nil

DATA 4 ------05 Q5 — . 2 2 5 — CMOS STROBE DATA 5 ------D6 Q6

No. 58 - March 1983 MICRO 109 That Open the Door to uture

Kids of all ages are thrilling to our knowledge series of books that are virtual presenl "open sesames" to basic scores of cartoons one understanding and use of all the illustrations which amuse as the\ most popular personal micro make important points easy tc computers: KIDS & THE APPLE, KIDS understand & THE ATARI, KIDS AND THE VIC and There are even special section; KIDS AND THE T.l. (Texas at the beginning of each Instruments). chapterfor parents and teacher: These fun-to-read books will which aid in creating lessor prepare your children to take plans and in helping the kid: their place in the com puter over any rough spots generation by solving the But the reason kids of all ages reallv mysteries of their com puter in love these books is that they're ways they'll find interesting written to be truly easy tc and fun! Thousands of copies understand—without confusing are already being used by technical language that make: families (kids and adults), computers seem more complicatec schools and computer clubs than they really are. And the result; throughout the U.S. of their learning can be seen on­ These marvelous books, screen almost immediately authored by Ed Carlson, lead $19.95 each at Book and Com­ puter stores everywhere, or from: The computer world is roaring towarc the reader gently, yet quickly, us. Make sure your children are into the fascinating world of prepared for the challenge. With oui computers. Each is a large books at their side, they'll enjov 81/2" x 11", spiral-bound book learning about computers, Anc which can be opened flat 8943 Fullbright Avenue, you'll know you've helped open the easily. 33 chapters, each one Chatsworth, CA 91311 (213) 709-1202 door to their successful future

Circle No. 68 Dr. William R. Dial 438 Roslyn Avenue /AlCftO Akron, OH 44320 6809 Bibliography

113. The Rainbow 2, No. 4 (October, 1982) Battista, Frederick F., "Show the Score," pg. 272-281. Put numbers on your 6809-based Color Computer screen while in the graphics mode. Davis, Gary, "Here are Three Assemblers Compared," pg. 30-37. Includes Cer-Comp, The Micro Works, and Computerware Gilliland, E.O., "Color Computer Pointers," pg. 288-290. assembler for 6809 systems. Combining programs on the Color Computer. Roslund, Charles J., “Charlie's Machine,” pg. 38-45. Blyn, Steve, "Music Marvel," pg. 308-316. A mini-monitor for machine-language use with 6809 A program listing to play music on the Color Computer. systems. Ramella, Richard, "Fun House Adventure,” pg. 488-494. Albrecht, Bob and Firedrake, George, “RND Command is One A game for the 6809-based Color Computer. Secret to Good Games,” pg. 46-48. Tips for the TRS-80 Color Computer game programmer. 115. Creative Computing 8, No. 11 (November, 1982) Goebel, Kathy, "Line.Printer VII: Not So Dumb!/’ pg. 50-56. Norman, Scott L., “Alternative Languages for the Color Com­ A logo for the Color Computer output. puter,” pg. 124-138. Ebbert, Jim, ‘'Minicalc Will Handle all Your Projections,” pg. Assembly language for the Color Computer can add speed to 60-62. your programs. A mini-spreadsheet for the Color Computer. Wilkins, Dennis, "An Editor-Assembler for the Color Com­ Sherwood, Francis J., "How Much Will It Cost to Buy on puter," pg. 142-147. Tim e,” pg. 70-73. An inexpensive way to obtain some editing features for 6809 A loan amortization program for the 6809-based Color machine-language programs. Computer. Ahl, David H., "Build a Paddle Control for Your TRS-80 Color Reid, Chris, "Uammalu Provide Lovely Graphics Patterns for Computer," pg. 242-244. 80C," pg. 74. A hardware article to provide paddles at a modest cost. A graphics program for the TRS-80 Color Computer. Fraysse, John, "Go Sailing with the Sailor,” pg. 76-84. 116. Color Computer News, No. 13 (October, 1982) A game for the 6809-based Color Computer. Steiner, John, "Morse Code Instruction: Part 1,” pg. 19-26. Bruck, Bill, “Maintain a Mail List with this Program,” pg. 86-90. Programmed CW instruction for the TRS-80 Color Computer. A complete mailing list program for the 32K Color Computer. Kilpatrick, Roger, “Color Data File," pg. 27-35. Lewandowski, Dennis, "Assembly Language Makes Good A program for storing data on the Color Computer. Graphics Easy," pg. 92-94. Ashley, Peter, "Film Development,” pg. 36-42. A tutorial for the Color Computer. A 6809-based Color Computer program to handle the various Nolan, Bill, “Make Monsters from Silicon — And Use Them factors involved in photo developing. Here,” pg. 106-109. Giovanoni, Richard, “Logchart,” pg. 43-44. Use the Color Computer to generate demons for your fantasy A Color Computer program to draw a sheet of 2 x 3-cycle log program. paper on the screen and adapt it to plot an aircraft log. Garrett, Ron, “An Accounts Receivable Program Can Help Greb, Jack, “Disk 'DIR’/Ectory,” pg. 46-49. You,” pg. 118-126. A Color Computer program to assist in reading long directory Use the Color Computer to set up a disk-based accounts files. receivable program to maintain balances on accounts of Phelps, Andrew, "Comment Corner," pg. 51-54. money owed you. Notes on the Color Computer error messages. Hogg, Frank, "64K Komer," pg. 55-56. 114. 80 Micro No. 34 (November, 1982J Notes on the operating systems for the 6809-based Color Shorter, Andrew, ' ‘Annual Salary as an Indicator of the Value of Computer. Your Savings,” pg. 18. Hass, E.J., "Neatprmt,” pg. 62-64. A program for the TRS-80 Color Computer. A Color Computer program to assist in printing out listings. Commander, Jack, “ CCFORTH,” pg. 45-46. Brown, Jim, "Memory Test,” pg. 68-70. FORTH for the TRS-80 Color Computer. A utility for the 6809-based Color Computer. Norman, Scott L., “ Colorterm,” pg. 63-64. White, Richard A., "Grades: A Computerized Gradebook," pg. A cassette program that converts a 16K or 32K Color Com­ 73-78. puter into an intelligent terminal. A grade-book program for the teacher using a Color Computer. Barden, William Jr., “The Color Computer on Parade — Part II,” pg. 80-87. 117. Personal Computer World 5, No. 11 (November, 1982) A tutorial on graphics and the GET and PUT commands. Staff, "In Store," pg. 184-191. Freeman, Jimmy L., “More Color Conversions,” pg. 164-170. A tabulation of the specifications and main features of 113 Converting TRS-80 Model I programs to Color Computer different microcomputer systems, including 6809's. listings. Fowler, John D. Jr., "Astrodynamics for Beginners,” pg. 118. Byte 7, No. 11 (November, 1982) 205-210. Barden, William Jr., "Inexpensive Transducers for the Use your Color Computer to explore the basic laws of TRS-80.” gravitation. Part 2 on monitoring real-world quantities covers switch- Heusinkveld, John, "Color Assembler," pg. 213-221. sensing techniques for the TRS-80 Color Computer. You can speed up your programs with this assembler for the Color Computer 6809 machine language. JMCftO

No. 58 - March 1983 MICRO 111 Advertiser’s Index National Advertising ABC Data Products ...... 54 Acorn Software Systems...... 62 Representatives Alternative Energy Products...... 83 Animation Graphics...... 40 West Coast: Anthro-Digital Software ...... 27 AppleTree Electronics...... 41 The R.W. W alker Co., Inc. Ark Com puting...... 92 Gordon Carnie Armidillo Software...... 13 2716 Ocean Park Boulevard, Suite 1010, Artsci.lnc...... IFC Santa Monica, California 90405 (213) 450-9001 Chameleon Computing...... 74 serving: Washington, Oregon, Idaho, Montana, Wyoming, Colorado, New Mexico, Arizona, Utah, Nevada, California, Alaska, and Hawaii Compu Sense...... 13,18,26,35 (also British Columbia and Alberta, Canada CompuTech...... 66 The Computerist, Inc...... 64 Mid-West Territory: Computer Case Co...... 7 Thomas Knoor & Associates Computer Mail O rder...... 68-69 Thomas H. Knoor, Jr. Computer Science Engineering...... 37 333 N. Michigan Avenue, Suite 707 D&N Micro Products...... 9 Chicago, Illinois 60601 (312) 726-2633 Datamost, Inc ...... 22, 110 serving: Ohio, Oklahoma, Arkansas, Texas, North Dakota, South Digital Acoustics...... 12 Dakota, Nebraska, Kansas, Missouri, Indiana, Illinois, Iowa,Execom, Inc...... 87 Michigan, Wisconsin, and Minnesota. Gibson Laboratories...... 98 Gimix, Inc...... 1 Middle Atlantic and Southeastern States: Gloucester Computer Bus Co...... 88 Dick Busch Inc. Hudson Digital Electronics...... 84 Richard V. Busch IJG Company, In c...... 76 6 D ouglass Dr., R.D. #4, Intec Peripherals Corp...... 11 Princeton, NJ 08540 (201) 329-2424 Interesting Software ...... 23 Dick Busch, Inc. John Bell Engineering...... 30 Eleanor M. Angone L C om ...... 95 74 Brookline, Leading Edge ...... BC E. A tla n tic Beach, NY 11561 (516) 432-1955 Logical Devices...... 95 serving: New York, Pennsylvania, New Jersey, Delaware, Maryland, LycoComputing...... 56 West Virginia, Virginia, D.C., North Carolina, South Carolina, Loui-Meta-Lab...... 87 sianna, Tennessee, Mississippi, Alabama, Georgia, and Florida Microhouse...... ,4 Micro Motion...... 54 Micro Peripherals, Inc...... , 44 Microtech ...... 75 Micro-Ware Distributing...... 81 Modular Mining Systems ...... 37 Modular Systems...... 37 Next Month in MICRO Optimized Systems ...... 60 Penguin Software ...... 6 Performance Micro Products ...... 35 April Communications Feature: Computers are Perry Peripherals . . , ...... 34 reshaping trends in the communications field. RH Electronics...... 17,107 Rock R o y ...... , .3 Find out what's happening by reading the April Scientific Software. . . .: ...... 83 issue of MICRO. You'll also discover informa­ s g c ...... 99 tion on system-specific communications and SJB Distributors ...... 71 bulletin boards. Skyles Electric Works...... 63 Smartware...... 62 Sof/Sys, In c.. . v ...... 23,55 Sorrento Valley Assoc ...... 93 Next Month's Learning Centerfeatures Master Southwestern Data ...... 11.96 for Commodore and Apple — a simple guessing Star Micronics ...... 106 game for one or two players. Strobe, Inc...... 91 Time Trend Software...... ,98 Versa Computing ...... 89 Vista Com puting ...... IBC Plus: Apple LETTERMASK XPS, In c .,...... 83 Interfacing the Atari Joystick to the Zytrex ...... 13 Color Computer MICRO Advertising Mutual Funds on the OSI Mastering Your VIC-20...... 46 Bond Quotations on the Apple MICRO on the OSI ...... 38 What’s Where in the Apple...... 80

MICRO is not responsible for claims made by its advertisers. Any complaint should be submitted directly to the advertiser. Please also send written notification to MICRO.

112 MICRO No. 58 - March 1983 - m

In Italy in the 15th century Leonardo Da Vinci was a multi­ talented genuis. Leonardo's ideas and designs were endless. He was always creating new devices to solve the world's problems. Pictured here are many studies for military arms : ' ■ vs • and armor and battlements. The Vista Solo; incorporates„«the-prqvenreliabj Shugart™ 5V* Drived To.dif&Shuggrt'has ove""1 Today Vista is developing many high technology computer units in operation througJiquMhe world. peripherals for use with IBM™ and Apple Computers. Solo is also available as the Solo Plus,-which* ; Introducing Solo, a new cost effective solution to Apple Disk Solo Controller. The pair gitffe ypu*fpt£l,kco storage offering all the capabilities of the standard Apple Apple hardware and software. sH*•- -Disk 11 at a fraction of the cost. - , 5 * : © $ ■ :• * '-4E •, Shugart DrEve If your needs do not demand the high performance of our • Totally Compatible Ipuet, Quartet; or V-Series Maxidrives, then Solo will provide • Cost Effective v :- you with what you need at the lowest possible cost. • 35 Track, Compatibfe Drive- 7

Full ViSte J^ ,D a y Wjj Solo *Di ive orily) *3 IO jT Solo Plus {W /h - *

Con tact Yo

■- - f p i

fa ta SPcio™ irk of S

5II Is a i