74470 11690 uei oig V itrs ih h PET the with Pictures TV posing Superim / Cneso o te Atari the on Conversion A/D pl Porm o pressor Com Program Apple ETME 1982 SEPTEMBER THE THE 80 Feature 68000 6502/6809 JOURNAL

nentoa dto $295 £1.80 $250Kingdom United Edition Edition International Edition US/Canada

WHY THE MICROSOFT RAM C^M AKES OUR SOfTCARD AN EVEN BETTER DEA. Memory — you never seem to have quite applications like the Peachtree Software account- enough of it. ing systems. VisiCalc™ and other Apple software But if you're one of the thousands of Apple packages can take advantage of RAMCard too. owners using the SoftCard, there's an economical And RAMCard gives you the extra capacity to new way to expand your memory dramatically. develop advanced programs of your own, using the 16K ON A PLUG-IN CARD. SoftCard and CP/M. Even with the RAMCard in Microsoft's new RAMCard simply J k place, you can still access your ROM BASIC plugs into your Apple II,R and adds 16k l l J I a . and mon'tor routines. of dependable, buffered 8 h P M r JOIN THE SOFTCARD read/write storage. w \ f a m iw : Together with the SoftCard, * * * j The RAMCard is just the the RAMCard gives you a 56k , __ latest addition to the SoftCard CP/M” system that's big enough 1 Q§ ‘ * ’ family — a comprehensive sys- to take on ail kinds of chores that §S| « I - j j'zZ— r5r~f tem of hardware and software woUld never fit before (until now, M ; j y.| j , ~~ . S that can make your Apple more the only way to get this much versatile and powerful than you memory was to have an Apple _ _,j; ever imagined. Language Card installed). , % ; ; : / S Your Microsoft dealer has all GREAT SOFTWARE: j i i : ; J '%£> the exciting details. Visit him : "“f - 15 soon’ and discover a great idea YOURS, OURS, OR THEIRS. dcc *j ui if ^ cc. _ msmm* With the RAMCard and “5 7K / ' that keeps getting better. SoftCard, you can tackle large- g e tr*' -JT * : 3 __« Microsoft Consumer Products scale business and scientific D t ' = . 10700 Northup Way computing with our COBOL and l l i j ; ' 1 Bellevue, WA 98004 FORTRAN languages. Or greatly t 206-828-8080 increase the capability of CP/M SoftCard. RAMCard and Microsoft a'e trademarks of Microsoft. Ir,c Ap::ie n is a registered trademark of App'e Inc Z-bC s a registerea trademarn ot Zilog. ire CP;M is a registered trademark of , Digital Research •• ; - • ' V:siCa(c is a registered trademark of Personal - ~ • Suftware Inc Microsoft Consumer Products is a d-vision of Microsoft Inc

TM

/ H I C P p S O f T 2MHZ 6809 SYSTEMS GIMIX offers you avariety 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 Parallel Ports Two19 MB 51A” Winchester Drives SOFTWARE FEATURES: ★ OS-9 LEVEL TWO Multi-User ★ OS-9 Text Editor ★ 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 5 Vi” Floppy Disk Drive ★ 19 MB 51A” 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 Vi” 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 51/i” 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 two 19MB Drives, Interface, and Softw are...... $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 W EST 37th PLACE CHICAGO, ILLINOIS 60609 inc. GIMIX® and GHOST® are registered trademarks ol GIMIX Inc (312)927 5510 FLEX and UniFLEX are trademarks o1 Technical Systems Consultants Inc. G i m i x OS-9 is a trademark ol Inc. TWX 910-221-4055 1982 GIMIX Inc. THE CHIEFTAIN™ 51/>-INCH WINCHESTER HARD DISK COMPUTER SO ADVANCED IN SO MANY WAYS . . AND SO COST-EFFECTIVE . . IT OBSOLETES MOST OTHER SYSTEMS AVAILABLE TODAY AT ANY PRICE.

• HARD DISK SYSTEM CAPACITY • 2-MHZ OPERATION Winchester with tape or floppy back-up . . . The Chieftain series includes 5V4- and 8-inch All Chieftains operate at 2-MHz, regardless they all run under DOS or OS-9 with Winchesters that range from 4- to 60- of disk storage type or operating system no need to modify hardware or software. megabyte capacity, and higher as technology used. Compare this to other hard disk advances. All hard disk Chieftains include systems, no matter how much they cost! • UNBOUNDED FLEXIBILITY 64-k memory with two serial ports and You'll probably never use it, but any Chieftain DOS69D disk operating system. • DMA DATA TRANSFER hard disk system can drive up to 20 other DMA data transfer to-and-from tape and disk Winchesters, and four tape drives, with a • LIGHTNING ACCESS TINE is provided for optimum speed. A special single DMA interface board! Average access time for 5W-inch Winchesters design technique eliminates the necessity is 70-msec, comparable to far more costly of halting the processor to wait for data • SMOKE SIGNAL'S HERITAGE OF hard disk systems, That means data transfer which normally transfers at a slower speed, EXCELLENCE ten-times faster than floppy disk systems. determined by the rotational velocity of This new-generation computer is accompa­ the disk. nied by the same Endurance-Certified The Chieftain quality Dealers and end-users all over the • RUNS UNDER DOS OR OS-9 world have come to expect from Smoke Computer Systems: no matter which Chieftain you select. . . Signal. And support, software selection and 5'A- or 8-inch floppy, or 5 'A- or 8-inch extremely competitive pricing are very much Here are the Chieftain 6809-based a part of that enviable reputation. hard disk that are destined to change data processing . . . 20-Megabyte Tape Streamer Back-Up Option

CHIEFTAIN 95W4 Available with all Chieftain hard 4-megabyte, 5'A-inch Winchester with □ a 360-k floppy disk drive (pictured). disk configurations. This cartridge tape capability CHIEFTAIN 95XW4 provides full 20-megabyte □ 4-megabyte. SW-inch Winchester with disk back-up in less than five a 750-k octo-density floppy disk drive minutes with just one command, or copy com­ CHIEFTAIN 98W15 mand for individual file □ 15-megabyte, 5'A-inch Winchester with transfers. Transfers data a V-megabyte 8-inch floppy disk drive. tape-to-disk or disk-to- tape. Floppy back-up is CHIEFTAIN 9W15T20 also available in a variety 15-megabyte, 5'/i-inch Winchester with □ a 20-megabyte tape streamer, of configurations.

Write or call today for details (including the low prices) on the Chieftain S e rie s.. . and on dealership opportunities

SMOKE SIGNAL BROADCASTING® C om pany A d d re s s _ 31336 VIA COLINAS W ESTLAKE VILLAGE, CA 91362 C ity______TEL (213) 889-9340 Telephone (

2 MICRO - The 6502/6809 Journal No. 52 - September 1982 TM

September Highlights

68000 Feature We welcome Dr. Richard C. Vile, Jr., as an Apple con­ tributing editor. Richard will be working with our in- Once again the microcomputer industry has a new and ex­ house Apple specialist, Phil Daley, to expand our Apple citing product to offer users: the 68000 . coverage. Dozens of companies have already built computers around this chip, or developed compatible software and peri­ Commodore pherals. The big news about the 68000 is that it can be used as a powerful add-on to your 6502. There are two articles of special interest to PET/CBM owners. Peter Hiscocks (p. 11) describes a hardware tech­ Laurence Kepple, in "The 68000 and the Personal nique to simultaneously display on the PET's screen the Computer” (p. 27), discusses the 68000 as a 6502 add-on. computer's output and the image from a closed-circuit TV He offers some insights on the manufacturers and their camera. Although the PET does not have access to the im­ products. If you're interested in adding a 68000 to your age, it can be programmed to display fancy captions or to present system, take a look at this article. point out certain features. The picture could also be used to enhance an otherwise dull computer run. We're providing a very useful and detailed series on the 68000 microprocessor itself, authored by Joe Hootman, a "Auto SAVE for the PET” by Louis Sander (p. 83) is a Professor of Electrical Engineering at the University of BASIC you attach to your programs during North Dakota. The first part (p. 41) contains a brief in­ development. It ensures that you make copies of your pro­ troduction to the 68000 and detailed treatment of the data gram at regular intervals, thereby giving you more protec­ movement commands. Future installments will offer tion from unanticipated disasters. tables on the 68000's instruction set. Loren Wright's "PET Vet” column (p. 78) discusses Tom Whiteside and Joe Jelemensky of , manu­ Eastern House Software's MAE macro assembler and some facturer of the 68000, describe the registers, instruction new Commodore-oriented publications. set, and addressing modes of this microprocessor (p. 32). We would like to welcome Dave Malmberg and Jim Our data sheet this month will serve as a handy refer­ Strasma as contributing editors in the Commodore area. ence to 68000 programmers. Atari

6809 We are happy to have Paul Swanson on board now as a contributing editor and Atari columnist. Paul's column Hal Clark presents an article (p. 57) for 6809-based will begin in November. He will also help us increase our machines to give a Pascal-like structure to your machine- base of Atari authors. language programs. This makes the program easier to read and debug while maintaining the execution speed and Straightforward Garbage Collection memory efficiency of . This program by Comelis Bongers appeared in our August A BASIC program to calculate market projections on issue, page 90 (also one of the utilities on disk). A few industry and company sales, by Len Suckle, is presented readers missed the important note that appeared at the end for the Color Computer (p. 67). It could be translated to of Mr. Bongers' article. Here it is again, in case you missed other BASICs fairly easily and is well documented so you it too: could customize for a specific application. The machine-language program starts at $9000 and has a length of $260 bytes. After assembling the text file and Apple storing it to disk, the program can be installed by : BRUN programname. This command executes an initialization For Apple users, Barton Bauers has written an extremely routine that sets HLMEM to $9000 and installs the & vec­ useful machine-language utility to reduce the length of tor. If you want to BRUN the routine from within an Apple­ Applesoft BASIC programs and increase the speed of soft program, the BRUN command should be inserted at loading and execution (p. 89). It allows you to fully docu­ the first line of the program, and must be followed by a ment your program with remarks and single line state­ CLEAR command. For example: ments for legibility, and then remove the remarks and con­ catenate all non-referenced lines for a streamlined version. 10 PRINT ‘‘BRUN program name” : CLEAR: REM control D behind first quotes. This month's "Apple Slices” column (p. 47) by Tim Osbom, presents a quick random-access technique called The program makes use of some Applesoft routines in 1 'hashing.” If you want to speed up access to your file pro­ ROM. If the RAM version of Applesoft is being used, the grams that do a lot of random accessing, here is the solution. relevant subroutine calls have to be adjusted. jk|£pn~

No. 52 - September 1982 MICRO - The 6502/6809 Journal 3 4 MICRO - The 6502/6809 Journal No. 52 - September 1982 NO. 52 SEPTEMBER 1982

/AlCftOTHE 6502/6809 JOURNAL STAFF President/Editor-in-Chief 68000 FEATURE ROBERT M. TRIPP The 68000 and the Personal Computer ...... Laurence Keppie Publisher 2 7 The 68000 as an add-on to 6502-based systems MARY GRACE SMITH An MC68000 Overview ...... Tom Whiteside and Joe Jelemensky Senior Editor 3 2 LAURENCE KEPPLE ' A description of the 68000’s registers, instruction set, and addressing modes Editorial Staff 68000 Instruction Set ...... Joe Hootman PHIL DALEY — Technical editor 41 Part I in a series on the 68000, including a detailed table of Data Movements JOHN HEDDERMAN — Jr. programmer MARJORIE MORSE — Editor JOAN WITHAM — Editorial assistant HARDWARE LOREN WRIGHT — Technical editor Graphics Department Superimposing TV Pictures on PET Video ...... Peter d. Hiscocks HELEN BETZ — Director 11 Modify the PET to superimpose a television camera picture on the PET video display PAULA M. KRAMER — Production mgr. EMMALYN H. BENTLEY — Typesetter 1 A a /d Conversion Using a 555 Timer IC ...... Mike Dougherty ■ ^ This simple 555 timer yields a high dynamic range inexpensively Sales and Marketing CATHI BLAND — Advertising mgr. CAROL A. STARK — Circulation mgr. p o Delayed Reset and Autoboot for the OSI ...... U g o v .R e LINDA HENSDILL — Dealer Sales Z-'** Add both a time delay to the BREAK key, and an automatic disk system bootup MAUREEN DUBE — Promotion Accounting Department LANGUAGE AIDS DONNA M. TRIPP — Comptroller KAY COLLINS — Bookkeeper C H AMPER-POS for the APPLE ...... Philippe Francois EILEEN ENOS — Bookkeeper ^ ■ A machine-language utility that extends APPLESOFT to include a POSition function

Contributing Editors C 7 6809 Macros for Structured Programming ...... H al Clark DAVE MALMBERG ' Use assembler macros for structured assembly-language programming JIM STRASMA PAUL SWANSON RICHARD VILE APPLICATIONS Advertising Sales Representatives See Page 127 Market Projection Program 67 for the Color Computer ...... Leonard I. Suckle Subscription/Dealer inquiries A sophisticated business program to project industry and company sales (617) 256-5515 Double-Entry Formatting for your Checkbook O 0 On the C1P...... Leo Jankowski DEPARTMENTS A simple checkbook balancing program 3 September Highlights 7 Editorial UTILITIES 8 Letters/Updates q o Auto SAVE for the PET ...... Louis F. Sander 45 MICRO News A routine for automatic cassette backup 87 New Publications 100 Book Reviews o n COM PRESS — An APPLESOFT Optimizer . . Barton M. Bauers Reduce APPLESOFT program memory requirements by up to 30% 103 Reviews in Brief 108 6502 Bibliography 110 6809 Bibliography COLUMNS 111 Software Catalog A7 Apple Slices ...... Tim Osborn 117 Hardware Catalog ^ ’ “ Hashing” ...A quick random-access technique 123 Tech Data Sheet 127 Advertiser’s Index ■70 PET Vet...... Loren Wright 128 Next Month in MICRO * ® The MAE assembler and new Commodore-oriented publications

No. 52 - September 1982 MICRO - The 6502/6809 Journal 5 I'iiT-.e-1* -Sr-. PftQGItftMMlNS Oif Tjft APPLE If. For begmneB.AS5EMR.Y U ^- THE BOOK assembler available for the* Apple while ar the ptovtdes.a dear aruS noorechnicaf introduction same time being the’ easiest to us# rc> machine language programming on the IMPACT, WE’RE SO CONFIDENT OF THIS CLAIM, Apple Drawn mmtfemonrhlycotuiminSofroll* WAT IF YOU CAN AND A SETTER ASSEMBLER Maqcilne. and expanded to provide even mote WITHIN 30 DAYS OF PURCHASE, SIMPLY RETURN mramanan. A5SEMDLY.UNES-, THE BOOK hos THE COMPLETE MERUN PACKAGE FOR A FULL already received amcol qcdajm as the best REFUND* tutorial on machine language programming A fu# featured' macro assembler With optional _ available ■ • / :' • - * v.* * i ’ t assembly to disk, and use of indude'files. Merilns Monethonaslmp Example programs include; pocftifes, sound, dish editor has word processor-like power with-such A-EUG jndudei Its awn rtifru-assembler,s fifes and mdfe;..air presented with the novice options as global search/replace, a powerful labels, and even conditional nose flpgs-1 programmer In mind. The book also includes an line editor, and more. The package also Indudes means MAH, con be (M in a 'dormant'S excellent reference section teflnjeach machine„ SOURCEROR. a utility to generate labeled which will later pacnip’ in the trace mode, jOTty language command, and a sample listing pseudo source code from row. Dinaty flics, and when certain conditions are met Thus routines'.^. illustrating its moy'common uses in caual source a bo SOURCEROft St, a Hilly labeled and wi^iiaftiHy. operQNonoI prpgtoms con be tesifed listing. . -v commented source listing of Applesoft BASIC! - rlg|» ofjao-tftne.‘ \ ■*, SUGGESTED RETAIL PRICE: *19.95 SUGGESTED RETAIL PRICE: S64.95 SUGGE5TH) RETAIL PRICE: (49.95 SPECIAL LIMITED TIME COMDlNATION PRICE: S l 1 9 .9 5 THIS OFFER VADD THROUGH OCTOBER 31, 1^82. • CAUfOWIA. RODENTS ADO 6% WtES-TAX Please ask your local. Apple dealer for more dfefoils, or wrire SDS ta ra sample Kst of MERUN's commands and o complete product guide of aver 20 athet auiaandtng. programs! *MSRUN siheaswfribter af choice of These leading software companies; AKI5O.IMC*0RQDEADUND SOFTWARE. INC. sautnujesteRn- .. cram,I i r m m r hit ■ PROMETHEUS PRODUCTS. data INC . SINUS SOfTWME,IKC svstems . SYNERQSTIC SOFTWARE. P.O. OOX 582 . SANTEE, CALIFORNIA 92071 . TELEPHONE: 714/562-3670

MICRO - The 6502/6809 Journal No. 52 - September 1982 6 About the Cover TM

Editorial

When Worlds Collide Tracy Licklider, Vice President of Soft­ The 68000 microprocessor is one of a ware Arts, noted recently, "VisiCalc is number of new chips that are making it a screen-intensive, highly interactive increasingly difficult for program. Timesharing systems simply manufacturers to justify their existence cannot process VisiCalc's frequent as an enterprise distinct from the world demands for screen refreshes. In a VIA Train Number 1, "T h e Canadian/1 of microcomputing. More than market minicomputer, multiuser environ­ makes its way westward across the con­ share and terminology are at stake. The ment, VisiCalc gets bogged down.” tinental divide. Nearly three days ago it critical issue is: what role does the in­ Thus, one of the most powerful pro­ left Montreal and tomorrow morning it dividual user play as part of a computer grams in history succeeded in part will be in Vancouver, British Columbia. system? In a microcomputer system, because its designers were thinking in the computer and the user are on equal terms of a one-on-one relationship be­ Computers are used by travel agen­ terms, one-on-one partners in a tween the computer and its user. cies to keep transportation schedules, such as this one, readily accessible. A problem-solving endeavor. In a mini­ microcomputer could be installed on computer, multiuser environment, the Interactivity is the key, because in­ board the train and tied into a radio com­ individual user is simply less impor­ teractivity means maximum user in­ munications network with other, larger tant. Many users must compete for the volvement. What minicomputer manu­ computers. The Canadian Pacific Rail­ attention of the CPU. Waiting in line facturers have yet to understand is that road (whose tracks VIA is using) runs has never been popular, and some peo­ the more involvement users have in a long sulfur, coal, and grain trains with ple are asking why, in this era of ever computer system, the more powerful the computer-controlled "robot” loco­ cheaper hardware, there are those who computer system becomes. As Hal Har­ motives midway through the train. say we should go on waiting. For exam­ denbergh puts it: "To a minicomputer Every change in speed or gear made by type, a minicomputer which has seven­ the crew at the head of the train is ple Hal Hardenbergh, in his newsletter duplicated by the robot locomotives. DTACK Grounded, speaks up for the teen applications programs available individual user with some vigor: "Re­ for it is described as 'heavily Photo by Loren Wright, MICRO Editor fusing to give each user his or her own supported.' You tell the owner of a individual, undivided processor chip is PET, Apple, or [TRS] 80 that a par­ prima-facie evidence of utter contempt ticular personal computer has a thou­ for the customer. And utter contempt sand application programs available IMCftO is published monthly by: is all that a minicomputer type has for and they will reply, 'Oh? What’s wrong MICRO INK, Chelmsford, MA 01824 us personal computer types!’1 with it? Isn’t it a popular machine?' ” Second Class postage paid at: Chelmsford, MA 01824 and additional The fantastic support available for a mailing offices "U tter contempt"? Surely Mr. Har­ micro like the Apple is a direct result of USPS Publication Number: 483470 denbergh goes too far. However, con­ user involvement. ISSN: 0271-9002 sider the following observation from Ms. Andrea Lewis in a recent issue of Even those with a minicomputer or­ Send subscriptions, change of address, USPS Computer Design: "Putting a mini­ ientation are beginning to think in Form 3579, requests for back issues and all computer operating system on a toy terms of "one person, one processor.” other fulfillment questions to computer will not result in a cheap Computer Business News recently MICRO INK minicomputer.” By "toy computer,” quoted Motorola Inc.'s Tom Starnes as 34 Chelmsford Street P.O. Box 6502 Ms. Lewis means to indicate "micro­ saying that, though everyone does not Chelmsford, MA 01824 computer.” She goes on, "T o support need distributed processing capabilities or call multiple users in a true timesharing en­ in their applications now, almost 617/256-5515 vironment, reliable memory protection everyone will "run out of gas” in terms Telex: 955329 TLX SRVC 800-227-1617 must be provided to keep one errant of processing capability using a single user from disrupting the other users' system bus. "Which is why applica­ work on the system.” A "true time­ tions are turning more frequently to Subscription Rates Pei Year sharing environment"? Is there distributed processing where a number U.S. $24.00 of different processors each performs 2 yr. / $42.00 something intrinsically valuable about timesharing? Useful when hardware their own isolated programs,” he con­ Foreign surface mail $27.00 was fabulously expensive, timesharing tended. As for timesharing systems, Air mail: Europe $42.00 still requires costly overhead, such as Stames said, "It is not much more ex­ Mexico, Central America, the "reliable memory protection” to pensive to have a [16-bit chip] and Middle East, North Africa, which Ms. Lewis refers. memory for user programs in the work­ Central Africa $48.00 station itself. The benefit is the user South America, South Africa, Far East, Australasia, Other costs of timesharing are more has a high-performance processor all to New Zealand $72.00 subtle. For example, VisiCalc, a pro­ himself." To which we at MICRO say, gram that was conceived especially for "Amen.' i Copyright© 1982 by MICRO INK All Rights Reserved "toy computers,” does not work well in a timesharing environment. As U a i A r e v t c c

No. 52 - September 1982 MICRO - The 6502/6809 Journal 7 TM

Letters/Updates

Atari DOS Bug Atari Bug Demo Dear Editor: TESTING INSTRUCTIONS: A; Type in program. There is a bug in the Atari DOS (or B: SAVE to disk as "D:BUGTEST.BAS". BASIC's disk I/O) that can clobber up C: Type "RUN". to half of RAM page 6, the "safe" ram. Since the operation of this bug isn't ob­ 0100 REM : BUG—DEMO 0110 REM : BY DAVID H. SIMMONS vious, it can cause incredible amounts 0120 DIM I N * (256) of trouble; I spent two days going over a 0130 OPEN #1,4,0,"D:BUGTEST.BAS" USR subroutine to try to find the bug, 0140 REM (OR OTHER ’TEXT R E C O R D ’ FILE) before I discovered that my routine had 0150 ? "IOCB BUFFER ADDRESS: ";PEEK(852)+256*PEEK(853) nothing to do with it. 0160 REM : *

David H. Simmons The second improvement was to P.O. Box 7000-140 place 1/8-inch thick foam rubber be­ Redondo Beach, CA 90277 Fan Improvement tween the part of the fan case and com­ puter that come in contact with each Dear Editor: other. This minimizes vibration.

Othello Update I recently purchased a System Saver Robert Gershowitz fan by Kensington Software. Although 76-51 169 Street Phil Daley, MICRO’S Technical the fan works as advertised, I have Flushing, NY 11366 Editor foi the Apple, offers this update:

In the program Othello ( MICRO on Listing for Othello Line Changes the Apple, Vol. 3), Charles Taylor 16 DIM B 0 M D (9 ,9 ): DIM 2 : QOSUB 181 the minor modifications presented 60 ODI£)R= OC(lURN) :ZZ = 0 here, the computer will play a level 1 62 IF NOT Z OR TURN =■ 1 THEN PRINT PROMPTS (TORN) 133 IF Z AND TORN =■ 2 THEN ZZ = ZZ + l:tCWE$ = 0 0 $ (Z Z ): GOTO 135s REM game of Othello for those who need an SUBR GfflMCVE opponent. This would be especially use­ 135 PASS = 0 : IF M3VE$ = “DONE” THEN PASS - 1:Q » 1 0 0 : RETTURN ful in learning how to play the game. 173 DMA A1,A8,H1,H8,B1,B8,G1,<38 174 DMA A2,A7,H2,H7,C1,C8,F1,F8 Lines 16-135 contain adjustments 175 DMA A3,A6,H3,H6,D1,D8,E1,E8 to the Taylor program corresponding 176 DMA A4,A5,H4,H5,C4,C5,F4,F5 177 DMA D3,D6,E3,E6,C3,C6,F3,F6 lines. Lines 173-183 are new material. 178 DMA D2,D7,E2,E7,B4,B5,G4,G5 There was a minor bug in the program 179 DMA B3,B6,C2,C7,F2,F7,G3,G6 as published. The only way the pro­ 180 DMA B2,B7,G2,G7,P gram knew that the game ended was 181 HOB : PRIWT “DO TOU Wlffl TO PIAY THE COMPUTER?" when all 64 blocks were filled. It is 182 INPUT Z$: IF USFT$ ( Z $ ,l) = "Y“ THEN Z = 1 183 RETURN possible to not have any moves left

8 MICRO - The 6502/6809 Journal No. 52 - September 1982 Take a Bigger of MICRO Special Introductory Offer A task at9m TWNWCiSir OiMK Id ...... ,T!TTi!ffi ___ JL» » ewwwil-tirweogBri^. Subscribe Now and Save 3 3 % (Off Newsstand Price) (First Time Subscribers Only) MICRO brings you information-packed pages every month. Each issue delivered to your door opens doors to computing mastery!

Subscribe to MICRO and learn how to extend , your computing knowledge to get the most out of your computer and expand its capabilities.

Subscribe to MICRO and develop your microcomputing skill. Keep up with the latest technology—Don’t be left behind!

Subscribe to MICRO Today and find, each month at your door, a world of computing power you could only dream of yesterday.

All for Only □ YES! I’m Serious Send me a 1 Year Introductory Subscription MCRO for only $19.95 (Foreign—surface mail—$22.95) 4 THE 6502/6809 JOURNAL $ 19.95 For fast service call toll free 1-800-345-8112 (In PA 1-800-662-2444) 1 YEAR MICRO BOOKS Quan Title Price s/h Total □ PAYMENT ENCLOSED SUBSCRIPTION _____ Micro on the Apple Vol. 1 $24.95 $2.00 ______(Checks payable to MICRO) _____ Micro on the Apple Vol. 2 24.95 2.00 ______□ VISA □ Master Card _____ Micro on the Apple Vol. 3 24.95 2.00 ______What’s Where in the Apple...Plus... _____ the All New Guide to What's Where 24.95 2.00 ______Act.# ______THE GUIDE to WWA 9.95 2.00 ______Expires ------(MA residents add 5% sales tax) Total ______

MICRO Name for the Address SERIOUS J COMPUTERIST City

State/Prov. Zip 83-356 Offer good until 10/31/82 Country L Allow 4-6 weeks for delivery i Get The Most Out Of Your APPLE

With The Most Important Book With Ever Published on the APPLE! MICRO on the What’s Where in the APPLE. APPLE Series Plus...the All New Guide Complete with to What’s Where Diskette No need to type in Revised Edition of the famous Apple Atlas hundreds of lines of code.

• Guides you — with a numerical W hat's Where in the APPLE...PLUS... Atlas and an alphabetical Gazet­ - the all new guide to WHAT'S WHERE teer — to over 2,000 memory loca­ Vol. 1 tions of PEEKs, POKEs, and Vol. 2 Vol. 3. CALLS. Allows you to: Lets you: Just Released! • Gives names and locations of I Round and format I Speed up machine Gives you more: various Monitor, DOS, Integer BASIC, and Applesoft routines — numbers accurately language programm­ ■ Machine language and tells you how they’re used. ■Get lowercase ing using 5 powerful aids • Enables you to move easily letters and punctua­ machine language I I/O enhancements aids between BASIC and Machine tion into Applesoft ■Graphics and Language strings I Add additional games • Guides you through the inner I Ray the hig game editing and I/O workings and hidden mechanisms AN ATLAS TO “Spelunker” features of the Apple. THE APPLE COMPUTER With Full Etplaniloiy T 91I Added I Play the intriguing By William F. Luabbart game “GalactiCube" All Apple users will find this book helpful in understanding their machine, and essential for mastering it! ...and much, much more! Together Volumes 1, 2, and 3 provide The Atlas and THE ALL NEW GUIDE are more than 110 programs on diskette available in one, 256-page Wire-O-Bound for less than $1.00 each. book for only $24.95 Volumes 1 and 2: 13 sector DOS 3.2 format. If you own the original W hat’s Where in the Volume 3: 16 sector DOS 3.3 format. A pple? you will want THE GUIDE to comple­ Micro on the Apple, Volumes 1, 2, and 3 ment your edition. This 128-page Wire-O-Bound (Complete with Diskette) version contains all new material to be used with the memory map and atlas for $9.95. $24.95 each

NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES Use Coupon BUSINESS REPLY CARD On Reverse FIRST CLASS PERMIT NO. 60, CHELMSFORD, MA Side to Order POSTAGE WILL BE PAID BY ADDRESSEE and MICRO Mail TODAY! 34 Chelmsford Street P.O. Box 6502 Chelmsford, MA 01824

83-356 ROCKWELL Microcomputers from Excert, Inc. THE AIM 65/40 THE AIM 65 Single Board or Smorgasbord Take-Out Order

- m m w

'fsfiMftpps If*, /'■ , fSS&W*

turf!,, *000 1 *&W3 a a ^ f;V,urS

A full size terminal style keyboard w/8 special A full size terminal style keyboard w/3 special function keys function keys A smart, 40 character display with its own A 20 character display microprocessor A 40 column printer w/text and graphic output A 20 column printer w/text and graphic output capability Up to 64K of on-board RAM and ROM Up to 4K RAM and 20K ROM on-board On-board interfaces include RS232, dual audio On-board interfaces include 20MA TTY, dual cassette and 2 user I/O R6522 devices audio cassette and 1 user I/O R6522 device Firmware includes interactive monitor and text Firmware includes interactive monitor and text editor w/options of Assembler, BASIC, FORTH editor w/options of Assembler, BASIC, FORTH, and PL/65 PASCAL, & PL/65

And if the above isn’t enough. Try the RM65 — a product line filled with embellishments including:

32K DRAM Board AC IA Board Prototype cards CRT Controller IEEE-488Board Adaptor Buffer Modules Floppy Disk Controller CPU/SBC Board General Purpose I/O Board PROM Programmer 4-16 Slot Card Cages PROM/ROM Board

NEW LOWER PRICES AND A CASH DISCOUNT* TO BOOT!

A65/40-16 (16K RAM)...... $1225. A65-1 (1K RAM)...... $420 A65/40-32 (32K RAM)...... $1295 A65-4 (4K RAM)...... $445 A65/40-A (Assembler) ...... $ 85 A65-4B (4K RAM w/BASIC) ...... $495 A65/40-B (BASIC)...... $ 65 A65-PS (PASCAL)...... $100 A65-F (FORTH) ...... $ 6 5 A65-A (Assembler)...... $ 35 Mail Order to:

Educational Computer Division EXCERT INCORPORATED Higher quantities quoted upon request, COD's accepted, SALES P.O Box 8600 shipping will be added. * Deduct 5% cash discount on SERVICE prepaid orders. Minnesota residents add 5% sales tax. INSTALLATION White Bear Lake, MN 55110 Prices subject to change without notice. CONSULTING (612) 426-4114

No. 52 - September 1982 MICRO - The 6502/6809 Journal 9 Skyles Electric Works Epson-PET/CBM Graphic ROM Pack For PET/CBM Owners Who Want: Complete Program Listing Printouts Complete Screen Graphic Printouts Graphic Printouts From Programs

on your Epson Printer

Order the Skyles Electric Works EPSON-PET GRAPHIC ROM Package. The ROM when installed in an EPSON MX80, MX80FT, or MX100 with Graftrax Plus printer will reproduce most of the PET/CBM graphics characters. Most importantly when using the accompanying high speed machine language program, the Epson-PET Graphic ROM pack gives s complete program listing with all screen controls shown (cursor, home, clear, etc.). This high speed machine language program for program listing, screen image printout (screen dumps) and BASIC program controllec printing (i.e. PRINT ) automatically translates the PET-ASCII characters to the EPSON-GRAPHIC ROM characters. A BASIC sample program and PRINT subroutine, that may be incorporated into any existing BASIC program, completes this "complete solution" package.

EPSON MODEL ROM MODEL

MX70 Not Available MX80 (serial no. to 359999) EPG80 (EPG82, 3 ROM Version) MX80 (serial no. after 360000) EPG81 (EPG83, 3 ROM Version) MX80FT EPG8F MX80 Graftrax Not Available MX80 Graftrax Plus EPG8G+ MX80FT Graftrax Plus EPG8G+ MX100 Not Available MX100 Graftrax Plus EPG10G+

The Epson-PET Graphics ROM Pack has been designed to furnish you with PET/CBM graphics printing in the easiest way possible. This is done by furnishing a high speed machine language program that is "hidden" at the top of your PET/CBM memory.

The machine language program serves 3 major functions.

1: Translates PET-ASCII code to ASCII code for program listing.

2: Translates screen code to ASCII code for screen image printouts.

3: Translates PET-ASCII code strings to ASCII strings for normal program printout. This feature may also be used for making ASCII files for your disk or tape recorder.

INSTALLATION: Installs into your Epson printer

PRICE: Epson-PET Graphics ROM Pack EPG80, EPG81, EPG8F___$75.00 Please specify your Epson printer model type and and serial number when ordering. For all PET/CBM's BASIC 2.0/Revision 3, or BASIC 4.0

AVAILABILITY: Immediately from your LOCAL DEALER o r VISA, MASTERCHARGE ORDERS CALL (800) 227-9998 (except California residents) CALIFORNIA ORDERS PLEASE CALL (415) 965-1735

23IE South Whisman Road Mountain View, CA 94041 Skyles Electric Works (415) 965-1735 MICRO - The 6502/6809 Journal No. 52 - September 1982 Superimposing TV Pictures on PET Video

by Peter D. Hiscocks

The Commodore PET may be full brightness (or greenness, in the The added video amplifier controls the modified to superimpose the case of the new PETs). The PET dis­ power supply rail of the existing picture from a television camera play, of course, only has to deal with amplifier, thereby setting the max­ on the PET video display. The the two extremes of brightness. The imum dark level and creating a con­ resultant combined picture (PET grey scale is dealt with by the video tinuous grey scale in response to the amplifier (figure 4) and the modifica­ video signal. PET characters (white) are video and television Image) may tions to the PET video display (figure 3). visible as long as the video picture is also be fed to a remote monitor not completely white. or video tape recorder. In the existing PET display cir­ cuitry, the video amplifier switches the Modifying the PET video display is cathode of the CRT between 35 volts not for the faint-hearted or the novice I had to superimpose the picture from a (dark level) and ground (white level). electronic tinkerer. There are high television camera on the PET video display as part of an airborne camera control unit (see reference). The same Figure 1: Block Diagram concept could be useful in a variety of situations. For example, the composite video signal — television picture plus PET graphics and alphanumerics — could be fed to an extension monitor or video tape recorder and the PET would become a very sophisticated video titling system. In another situation, the signal from a microscope-mounted television camera could be fed to the PET and the area of cells determined by tracing with a light pen.

Note that the television picture is not available to the PET; it is simply overlaid on the display, and the PET doesn't know of its existence. A block diagram of the system is shown in Figure 2: Sync Circuits figure 1. + 5V A first requirement of the system is that the television camera scan rate be synchronized to that of the PET display. Fortunately, the vertical and horizontal sync signals are available at the PET User Port. These are modified to a suitable form by the sync circuits shown in figure 2, and fed to the televi­ sion camera. The television camera must be able to accept and lock on these signals, but this is a common re­ quirement of cameras that are used in studio situations. I used the Sanyo 1620 X camera.

The next requirement of the system is that the display be able to show a continuous grey scale from full dark to

No. 52 - September 1982 MICRO - The 6502/6809 Journal 11 voltages inside the display, and ; Figure 3: PET Video Amplifier Modifications mistake could fry you and/or you PET. The circuit details that I show ii figure 3 apply to the early PETs ani you'd be wise to confirm the circuitry i you have a newer version.

The circuitry of the added video am plifier should be copied fairly closely especially in the choice of transistor: (the bandwidth requirement for th< amplifier is in the order of 3.5 MHz), made up the circuit on Veroboard anc mounted it inside the case of the PEI display. In my installation, I used < relay to kill the television picture sc the toggle switch could be placed or the front panel, without having to rui signal-carrying leads up to the fron panel. Leads from the added videc amplifier to the existing videc amplifier should be kept as short a; possible and well away from th< display flyback transformer area.

Figure 4: Camera Video Amplifier In figure 3, the addition of the 4.7 Kohm resistor prevents excessiv* power dissipation in the 33-volt zenei TO B FIG 3 diode.

Figure 1 also shows how the com bined picture and graphics image maj 0.47 f i F § 1.2K be sent to some external device such a; an external video display or video tape BRIGHTNESS recorder. The video amplifier of figure i 1K TO A & IN914 FIG 3 buffers the video signal from the televi­ ON5022 sion camera and the HUH Video Buffei r (HUH Electronics, 1429 San Mateo, CA 94402) develops a composite sync 2 IN914 signal from the PET sync signals. Ax A IN914 alternative suitable circuit for the lattei CAMERA _ 560 is given in The PET Revealed, by Nick VIDEO 0°-----f — -SAA(— 2N3725 INPUT V ' Hampshire, page 86. £822 OFF A ON ITi Reference »------u TOC FIG 3 "A Computer-Based Camera Con­ trol System,'' by A. Roberts and P. Hiscocks, Photogrammetric Engineer­ ing and Remote Sensing, Vol. 47, No. 1, Jan. 1981, pp. 53-57. Figure 5; Video Ampllfer

Peter Hiscocks is an instructor at Ryerson Polytechnical Institute, where he teaches courses in Electrical and Theatre technology. He is a columnist for Audio/ COMPOSITE Video Canada, builds computer interfaces ' VIDEO on a freelance basis, and is currently working on a computer-controlled sound system for the reproduction of insect sounds at the Royal Ontario Museum. He may be contacted at Electrical Dept., Ryerson Polytechnical Institute, 50 Gould St., Toronto, Canada M5B 1E8.

Q1 2N4401 OR EQUIVALENT JSMCftO

12 MICRO - The 6502/6809 Journal No. 52 - September 1982 from SubUDGIC... quality software for your Apple II.

A2-FS1 FLIGHT SIMULATOR Combines superior flight simulation with the best animated 3D graphics available. Practice take-offs and landing, other aerial maneuvers, declare war on the enemy. 16K cassette, $25.00. 32K disk, $33.50.

i i f l A2-PB1 PINBALL -T h e ultimate arcade simulation program, an exciting pinball game with the ball and f||pper precision to make increased skill pay off. Includes 10 different play modes and 100 user- adjustable modes. 48K disk, $29.95.

A2-SG1 ESCAPE! - The simple game of captive III ji ! f E f .C K'-.f I 1. pursuit. A gem for game purists ... A classic for your game collection. 48K disk, $29.95.

See them today at your dealer... KfeLOGIC Communications Corp. 713 Edgebrook Drive or for direct orders add $1.50 andspecify UPS or first class mail. Illinois residents add 5% sales tax. VISA and Champaign, IL 61820 MasterCard accepted. Descriptive brochures of most (217) 359-8482 products listed here are available on request Telex: 206995 “Apple" Is the registered trademark of Apple Computer Inc. A/D Conversion Using a 555 Timer 1C

by Mike Dougherty

For applications not requiring resistance to be measured should cover capacitor, C]. For each single pulse, pin high-speed analog to digital this range. Often it is difficult for the 3 remains at a low voltage for a time, conversion, this simple 555 hobbyist to find a resistive sensor with tL, proportional to Ri. Pin 3 remains at Timer circuit yields a high this full range. Secondly, even if such a a high voltage for a time, tH, propor­ dynamic range for very low cost. resistive sensor is found, the Atari tional to R] + R2. Specifically, these Although demonstrated with an hardware can only resolve one part in times are defined: 228. This yields an effective A/D con­ Atari 800, this 555 A/D converter version of LOG2(228J = 7.8 bits. There tH = 0.693 (Rx + R2| (Ci) seconds may be used by any computer are many applications which could use system with one unused bit on finer resolution or greater dynamic tL = 0.693 (Ri) (Ci) seconds an input port. range. Thus, as the resistive sensor R2 varies, This article discusses the use of an the time that the pulse is high also These programs require: inexpensive 555 Timer circuit, the soft­ varies. Atari 800 ware required to digitize the 555 out­ 555 Timer 1C put, and software designed to display By attaching 555 pin 3 to an input and other electronic the 555 Timer waveform on the Atari pin on a parallel port, the length of time 800. Although the Atari 800 is used to that the pulse is high may be measured components demonstrate the 555 Timer circuit, the by computer clock speed. In the astable general principles may be applied to mode, only a single input line is re­ The Atari 800 already contains hard­ any 6502-based computer. quired to digitize R2. ware capable of digitizing a resistive sensor, such as a thermistor or photo­ Hardware The circuit of figure 1 was powered resistor, through a game controller through the joystick #4 controller jack. jack. During each video scan, the The 555 Timer is available from Pin 7 of joystick #4 supplies the + 5 resistance of each paddle is measured Radio Shack in an eight-pin DIP volt source, while pin 8 is the Atari by a custom-designed LSI chip called package for approximately $1 (Radio ground. With the Atari 800 providing POKEY. At the end of a video scan, the Shack part number 276-1723). This ap­ the + 5V power source through the con­ Atari Operating System reads the plication uses the 555 as a free-running troller jack, a random variability up to POKEY registers and places the digi­ astable multivibrator, shown in the cir­ 10% was observed. This error was tized values in the paddle shadow cuit of figure 1. In this mode of opera­ eliminated with the addition of a filter­ registers in memory. These values are tion, the 555 outputs a TTL-compatible ing capacitor, C2, across the + 5V accessed through the PADDLE ( ) pulse stream on pin 3. The waveform of source and ground. function of BASIC. the pulse stream is determined by the external resistors, Ri and R2, and the Software Since the POKEY digitization is done by hardware and the shadow regis­ One simple approach to measuring ters are maintained by the operating the high portion of the pulse is outlined system, this analog to digital conver­ by the "pseudocode” in listing 1. sion method is easy to use. Simply replace the paddle controller with the The first two DOWHILE loops desired resistive sensor and obtain the allow the pseudocode to synchronize digitized result via the proper PAD­ with the free-running 555 pulse stream. DLE! ) function. The actual A/D con­ In the worst case, this synchronization version will be performed auto­ will take 0.693(2Ri + R2) (C!) seconds. matically by the hardware and updated Because of this relationship, R2 was by the operating system every l/60 th chosen as the resistive sensor and Ri of a second. was made as small as possible. Thus the time that a pulse is low is kept constant As straightforward as this approach by Ri and is only long enough for the seems, there are two major disadvan­ first and third DOWHILE loops to recog­ tages. First, the Atari 800 hardware was nize the zero level of the 555 output. designed for the 1MQ potentiometer used in the paddle controller. To fully The time represented by each count utilize the Atari hardware, the variable is determined by the length of the third

14 MICRO - The 6502/6809 Journal No. 52 - September 1982 DOWHILE loop and the specific delay utilized. Typically, the exact length of Listing 1: Pseudocode A/D Conversion the third DOWHILE loop is not impor­ tant since most applications will re­ BEGIN Pulse; quire a series of calibrations to map the initialize COUNT to zero; digitized counts onto the physical DOWHILE line is not equal to zero; quantity being measured. In practice, read 1/O port; the third DOWHILE loop is written to logically "AND" with MASK to isolate 555 line; execute as fast as possible. If this is not END WHILE; fast enough, then the value of capacitor DOWHILE line is equal to zero; Ci is increased. By controlling both the read 1/O port; measuring loop and the capacitor value logically "AND” with MASK to isolate 555 line; of Ci, a wide range of resistive sensors ENDWHILE; may be utilized. DOWHILE line is not equal to zero; increment COUNT by one; As an example, the 6502 assembler delay; subroutine in listing 2 demonstrates a read I/O port; 19-cycle timing loop. With a 1 MHz logically "AND” with mask to isolate 555 line,- clock, this loop will sample the input ENDWHILE; line, bit 0 of PORT, every 19 micro­ END Pulse. seconds. Assume that Ci is 0.1 pF, Ri is fixed at 2KS, and,the resistive sensor covers the range from 2KQ to 700KQ Listing 2: Sample 6502 A/D Conversion Subroutine

(the practical range of the paddle game "1.0 0 ) ; i ; < > i / ) I i i > ; t i I / t i 1 controllers). Then tH will vary from 0110 • 0.2777 ms at 2KQ to 48.6 ms at 700KQ 0120 * LIGTIMG * 2 0130 ? with the digitized count varying from 0110 I SAMPLE 65 02 SUBROUTINE TO COUNT COUNT =15 to COUNT = 2558, a 0150 ! THE NUMBER OF LOOP S THAT BIT0 OF range of 2543 counts. The worst case 0160 * I/O PORT IS HIGH, THE RESULT IS time to synchronize and take the sam­ 0170 J LEFT IN ZERO PAGE MEMORY. THE 0130 ; COUNTING LOOP CONTAINS "DELAY" ple at the maximum resistance is 2tH + 0190 t INSTRUCTIONS TO MAKE THE LOOP tL = 97.5 ms, or approximately l/10th 0 20 0 ? EXECUTION TIME 1? CYCLES. of a second. 0210 ♦ 0220 r t > > » f > > > t > i 1 i t t t > ! > t t » 0230 If a longer delay may be tolerated, 0240 * then Ci may be increased to 1/iF. In this [>301 0250 PORT *D301 PORTB OF ATARI 0 004 0260 COUNT = fD't ZERO PAGE RESULT BUFFER case, tH will vary from 2.77 ms to 486 0270 ♦ ms with the digitized count varying 0 0 00 0280 $060 0 ATARI FREE MEMORY from 146 to 25579, a range of 25433 0290 ) 0 AO 0 A900 0300 PULSE LDA ♦too INIT Y,X AS COUNT counts. Thus the 0.1 /jF capacitor gives 0602AA 0310 TAX THIS IS FASTER a digitized dynam ic range of 0603 AEi 0320 TAY THAN MEMORY LOG2(2543) = 11.3 bits; the 1.0 jiF 0330 capacitor gives a dynamic range of 0340 *, SYNCHRONIZE WITH 555 PULSE STREAM 0 35 0 t LOG2(25433) = 14.6 bits. If time is not 0604 AD01D3 0360 SYNCHI LDA PORT INPUT ALL 8 LINES a critical factor, the 555 approach 0607 2901 0370 AND *toi MASK TO ONLY BIT0 allows high dynamic range for very low 060? D0F9 0380 BNE SYNCHI STILL HIGH, WAIT TILL LOW 0390 cost. 0 6 0 E-: AD01D3 0400 SYNCLO LDA PORT INPUT ALL 8 LINES 0 60ET. 2901 0410 AND **01 MASK TO ONLY BITO 0610 F0F9 0420 BEQ SYNCLO STILL LOW, WAIT TILL HIGH » Atari 800 Considerations 0430 t 0440 ; COUNT * LOOPS PULSE IS HIGH The approach outlined in the 0450 > 0612 E8 0460 CNTLP INX COUNT THIS TIME IN LOOP previous sections may be implemented 0613 D00C 0470 BNE NOCARY NO CARRY TO MSB on the Atari after dealing with two 0615 C8 0480 INY ADD CARRY TO MSB operating system problems. Although 0616 El A 0490 NOP DELAY FOR 4 CYCLES these problems are specific to the Atari, 0617 e:a 0500 NOP 061B AD01D3 0510 LDAPORT INPUT I/O PORT other computer systems may have 061E1: 2901 0520 AND **01 ISOLATE BITO similar difficulties. 061D D0F3 0530 BNECNTLP STILL HIGH -- COUNT ON 061F F0 0A 0540 BEQ RETURN WRAP IT UP 0550 ; The Atari computer system drives 0621 FA 0 56 0 NOCARY NOP DELAY FOR 5 CYCLES the video display through direct 0622 A5FF 0570 LDA*FF memory access (DMA). A sophisticated 0624 ADO 103 0580 LDA PORT INPUT I/O PORT approach utilizing the custom-designed 0 627 2901 0590 AND **01 ISOLATE BITO 062? D0E7 0600 BNE CNTLP STILL HIGH — COUNT ON LSI chips, called ANTIC and CTIA, 0610 t provides the graphics versatility of the 0620 ; RESULT IN Y,X REGI STER PAIR Atari. To optimize the video perfor­ 0630 ; mance, the Atari has a basic clock 062B B6D4 0640 RETURN STX COUNT SAVE IN ZERO PAGE 0 6 2D 8405 0650 STY COUNT+1 speed of 1.79 MHz rather than the more 0 62F 60 0660 RTS common 1 MHz. However, the actual 063 0 0670 .END speed of program execution depends

No. 52 - September 1982 MICRO - The 6502/6809 Journal 15 upon the amount of “ cycle stealing” DMA activity required to run the video Listing 3: Atari USR Function A/D Conversion screen. As the graphics mode uses more memory to define the video screen, more DMA data transfers are required U1UU I,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,, 0105 to refresh the screen. Thus a program 0110 LISTING * 3 will execute slower under GRAPHICS 8 0115 mode than under GRAPHICS 0 mode. 0120 ATARI USR FUNCTION TO COUNT THE In addition, for graphics modes com­ 0125 LOOPS WHICH A 555 PULSE IS HIGH. 0130 THE STEPS PERFORMED ARE I bined with text (e.g. GRAPHICS 8), the 0135 DMA rate will differ between display­ 0140 1) TURN OFF DMA SHADOW REGISTER ing the graphics portion and the text 0145 2) WAIT FOR VBLANK TO TRANSFER portion of the screen. This variable rate 0150 THE SHADOW REG TO HARDWARE 0 155 3) DISABLE THE VBLANK DMA affects the effective speed of the 0160 4) SYNCHRONIZE WITH THE 555 counting loop used to measure the 555 0165 PULSE STREAM WITH 2 LOOPS pulse width. 0170 5) COUNT THE NUMBER OF LOOPS 0175 THE PULSE IS HIGH 0180 6) SAVE THE RESULTS IN THE ZERO Fortunately, there is a simple solu­ 0185 PAGE USR RETURN LOCATIONS, tion to the DMA problem — turn the 0190 RESET VBLANK AND DMA 0195 DMA off. You can disable the DMA by 0200 writing a zero in the DMA shadow 0205 USAGE! C0UNT=USR(1696,LINE) register, SDMCTL, located at $022F in 0Z10 memory. This value is transferred to 0Z15 WHERE LINE IS THE MASK TO 0Z20 ISOLATE THE BIT CONNECTED the DMA controller register by the 02Z5 TO THE 555 PULSE STREAM. operating system during the VBLANK 0230 UPON RETURN, COUNT WILL interrupt routine, every l/6 0 th of a sec­ 0Z35 CONTAIN THE DIGITIZED VALUE. ond. (VBLANK is the interrupt routine 0240' 0245 executed after every complete video 0250 scan. The Atari Operating System uses 0Z55 VBLANK to update the system time, OZZF 0Z60 DMASR = *022F DMA SHADOW REGISTER input the game controller reigsters, D40E 0265 NMIEN = *D40E NMI ENABLE REGISTER D301 0270 PORT = *D301 PORTB - - JOYSTICK *3,*4 transfer shadow registers to and from 0014 0275 RTC = *0014 LSB OF REAL TIME CLOCK hardware, and other housekeeping 00D4 0280 USRRET = *0 0D4 USR RETURN ADDR tasks.) Thus to turn off the DMA, 00D1 0285 LINE = *00D1 STORAGE FOR LINE MASK 0290 simply POKE a zero into memory loca­ 0295 tion $022F and wait for the system 0000 0300 *= *06A0 FREE MEMORY IN PAGE 6 clock to change (low order byte at 0305 $0014). Since VBLANK updates the 06A0 68 0310 ATOD PLA * OF USR ARGUMENTS 06A1 68 0315 PLA HIGH ORDER OF LINE clock, the change in the system clock 06AZ 68 0320 PLA LOW ORDER OF LINE value indicates that VBLANK has ex­ 06A3 85D1 03Z5 STA LINE SAVE 8 BIT LINE MASK ecuted and the DMA shadow register 0330 0335 TURN OFF DMA SHADOW REGISTER has been transferred to the DMA hard­ 0340 ware. To restore the DMA, POKE a $22 06A5 A900 0345 LDA **00 (decimal 34) to the DMA shadow 0 6A7 8D2F02 0350 STA DMASR CLEAR SHADOW REGISTER register at memory location $022F. 06AA AA 0355 TAX INITIALIZE REGS FOR COUNT 06AB A8 0360 TAY 0365 The second problem concerns the 0370 WAIT FOR VBLANK INTERRUPT actual time taken to execute VBLANK. 0375 A typical 555 digitization time was 06AC A514 0380 LDA RTC CURRENT LSB OF RTC 06AE C514 0385 RTCWAT CMP RTC SEE IF RTC HAS CHANGED about a tenth of a second or longer. 06B0 F0FC 0390 BEQ RTCWAT NOT YET, WAIT During this digitization, VBLANK 0395 could interrupt several times. Since 0400 DISABLE VBLANK INTERRUPT 0405 processor time would be spent ex­ 06B2 A920 0410 LDA **Z0 ecuting the VBLANK routine instead of 06B4 8D0ED4 0415 STA NMIEN CLEAR BIT6 OF NMIEN counting, the digitized value would be 0420 too low. In addition, the short low 0425 SYNCHRONIZE TO 555 PULSE STREAM 0430 period of the pulse could occur during 06B7 AD01D3 0435 SYNCHI LDA PORT INPUT ALL 8 LINES VBLANK execution and be missed by 06BA 25D1 0440 AND LINE ISOLATE 555 BIT the counting subroutine. The counting 06BC D0F9 0445 BNE SYNCHI STILL HIGH, WAIT 0450 subroutine would erroneously continue 06BE AD01D3 0455 SYNCLO LDA PORT INPUT ALL 8 LINES until a low pulse was recognized. 06C1 25D1 0460 AND LINE ISOLATE 555 BIT 06C3 F0F9 0465 BEQ SYNCLO STILL LOW, WAIT 0470 The Atari designers anticipated this 0475 DIGITIZE TIME THAT PULSE IS HIGH type of problem also. Although the 0480 VBLANK interrupt is connected to the 0 6C5 E8 0485 CNTLP INX COUNT THIS TIME IN LOOP 06C6 DO 0C 0490 BNE NOCARY NO CARRY TO MSB OF COUNT 6502 non-maskable interrupt line, 06C8 C8 0495 INY CARRY TO MSB OF COUNT NMI, external hardware was provided 06C9 A5FF 0500 LDA *FF DELAY 3 CYCLES to allow an Atari program to disable (Continued) this NMI interrupt before it reaches the

16 MICRO - The 6502/6809 Journal No. 52 - September 1982 Table 1: Atari 800 PORTB Pinouts Listing 3 (Continued) PORTB Bit Joystick Pin# Mask 06CE: AD01D3 0505 LDA PORT INPUT I/O PORT 06CE25D1 0510 AND LINE ISOLATE 555 BIT 0 #3 1 1 06D0 D0F3 0515 BNE CNTLP STILL HIGH — COUNT ON 1 #3 2 2 06D2 F0 09 0520 BEQ RETURN t LOW WRAP IT UP 2 #3 3 4 0 525 t 4 8 06D4 e:a 0530 NOCARY NOP DELAY 4 CYCLES 3 #3 06D5 EA 0 535 NOP 4 #4 1 16 06D6 AD01D3 0540 % LDA PORT INPUT I/O PORT 5 #4 2 32 06D9 25D1 0 545 AND LINE ISOLATE 555 BIT 6 #4 3 64 06D6 D 0 E. 8 0 55 0 BNE CNTLP STILL HIGH — COUNT ON 7 #4 4 128 0 555 0560 SAVE RESULTS, RESTORE HARDWARE 0565 6502 chip. This interrupt line is con­ 0 6DD 86D4 057 0 RETURN STX USRRET USR RESULT BUFFER 06DF 84D5 0 575 STY USRRET+1 trolled by bit 6 of the hardware register 06E1 A960 0580 LDA *$60 SET BIT6 OF NMIEN NMIEN at location $D40E. Clearing bit 06E3 8D0ED4 0585 STA NMIEN TO ENABLE VBLANK AGAIN 6 of NMIEN disables the VBLANK in­ 06E6 A922 0590 LDA *$22 terrupt; setting bit 6 of NMIEN enables 0 6F.8 8D2F02 0 595 STA DMASR ENABLE DMA THRU VBLANK 06EE: 60 0600 RTS BACK TO BASIC the VBLANK interrupt. A word of cau­ 06EC 060; .END tion: this register also controls other in­ terrupts. To disable the VBLANK inter­ rupt, POKE a $20 into NMIEN; to Listing 4: USR Function to Trace Atari Port B enable the VBLANK interrupt, POKE a $60 into NMIEN. 0100 0105 A BASIC callable USR function to 0110 LISTING * 4 0115 sample an input pin of PORTB, 0120 ATARI USR FUNCTION TO SAMPLE joystick #3 and #4, is given in listing 3. 0125 AND STORE THE VALUE OF PORTE:, The USR argument is used to mask the 0130 JOYSTICK *3 AND *4. THE STEPS 0135 PERFORMED ARE! 8-bit I/O port to the single I/O line at­ 0140 tached to the 555 pulse stream of pin 3. 0145 1) INITIALIZE The pinouts for PORTB and associated 0150 2) DISABLE DMA AND VBLANK masks are outlined in table 1. 0155 3) IN 256 BYTE BLOCKS, SAMPLE 0160 AND STORE PORTE: 0165 4) RESTORE VBLANK AND DMA TRACE 0170 0175 0180 USAGE! X=USR(1536,ADR(DATA*>) To test the 555 circuit, a simple 0185 program was written to trace the 0190 WHERE DATA* IS A STRING VARIABLE PORTB input lines and store the results 0195 DIMENSIONED TO BE 1024 BYTES in memory to be later plotted on the 0200 IN SIZE TO HOLD THE ACTUAL. 0205 F'ORTB VALUES. screen. This program, TOACE, takes a D210 trace of 1024 samples and plots the 0215 results in GRAPHICS 8 mode via the 0220 0 22.5 two USR functions in listings 4 and 5. 0 0CB 0230 ADDR = $0 0CB STORAGE FOR DATA ADDR TRACE also uses the USR function of D301 0235 PORT = $D301 ATARI PORTE: listing 3 to allow the pulse stream to be 0014 0240 RTC = $0 014 LSB OF REAL TIME CLOCK digitized. The BASIC program is 022F 0245 DMASR — $022F DMA SHADOW REGISTER D40E 0250 NMIEN = $D40E NMI ENABLE REGISTER presented in listing 6. 0255 t 0260 t TRACE allows any input pin of 0 0 0 0 0265 * = $0600 FREE ATARI RAM 0270 PORTB to be sampled and plotted. The 0275 ! INITIALIZE TRACE specific line is determined by the value 0280 of the bit mask variable, LINEMASK. 0600 68 0285 TRACE PLA * OF USR ARGUMENTS Refer to table 1 for the PORTB pinouts 0601 68 0290 PLA 16 BIT DATA BUFFER ADDR 0602 85CC 0295 STA ADDR+1 MSB OF DATA* and corresponding mask values. 0604 68 0300 PLA 0605 85CB 0305 STA ADDR LSB OF DATA* The loops used to perform the A/D 0607 A0 0 0 0310 LDY *$00 INDIRECT INDEXED POINTER conversion and to trace the waveform 0609 A204 0315 LDX **04 FOUR BLOCKS OF 256 SAMPLES 0320 t* take 19 cycles. However, TRACE does 0325 ! DISABLE DMA AND VBLANK contain one timing error. The trace 0330 > function breaks the 1024 samples into 060B A900 0335 LDA **00 four blocks of 256 single byte samples. 060D 8D2F02 0340 STADMASR TURN OFF SHADOW REGISTER 0610 A514 0345 LDARTC WAIT UNTIL VBLANK INTERRUPT This is because the 6502 indirect indexed 0612 C514 0350 RTCWATCMPRTC NEW RTC VALUE ? handles 256-byte 0614 F0FC 0355 BEQ RTCWAT NOT YET, WAIT blocks quickly and conveniently. The 0616 A920 0360 LDA **20 YES, DISABLE VBLANK 0618 8D0ED4 0365 STANMIEN CLEAR BIT6 OF NMIEN extra clock cycles between each 0370 , 256-byte block were preferred over 0375 ! TAKE TRACE IN 256 BYTE BLOCKS slowing down the basic loop simply to 0380 ' (Continued) sample all trace points at equal time intervals.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 17 The plot of the trace is done by a USR function simply to make TRACE Listing 4 (Continued) more convenient to use. The short marks displayed to the left of each 061E: EA 0 385 CQLLCT NOP LOOP MUST BE 19 CYCLES 256-byte trace segment indicate logic 1 061C EA 0390 NOP TD MATCH A/D CONVERSION and 0. 061D AD01D3 0 395 LDAPORT SAMPLE PORTB 0620 91CB 0100 STA(ADDR),Y SAVE IN DATA$ These techniques form the basis for 0622 C8 0105 INY NEXT MEMORY LOCATION measuring physical quantities through 0623 D0F6 0110 BNE COLLCT FOR 256 BYTES 0625 E6CC 0115 INC ADDR+1 POINT TC) NEXT MEM PAGE: resistive sensors inexpensively. With 0627 CA 012.0 DEX ALL FOUR BLOCKS ? very simple circuits much of the world 0628 D0F1 0125 BNE COLLCT NO, SAMPLE NEXT BLOCK may be sensed by youi computer. 0130 » 0135 J RESTORE ATARI VBLANK AND DMA 0110 ; References 062A A960 0145 LDA *$60 RESET BIT6 OF NMIEN 062C 8D0ED4 0450 STANMIEN ALLOW VBLANK INTERRUPT 1. Lancaster, Don, "TTL Cookbook," 0 62F A922 0455 LDA *$22 SET DMA SHADOW REGISTER 0631 8D2F02 0160 STADMASR LEET VBLANK SET HARDWARE Howard W. Sams & Co., Inc., Indi­ 0631 60 0465 RTS BACK TO BASIC anapolis, Indiana. Copyright 1978. 0635 0470 • END

2. Mims in, Forrest M., "Engineer's Notebook, Appli­ cations," Radio Shack, USA. Copy­ L isting 5: USR Function to Plot Trace Data right 1979. 0100 i t * * t t t t » t t t t t t t t t t . t t t t t > * t 0105 0110 LISTING * 5 Mike Dougherty currently works at 0115 Martin Marietta Aerospace in Denver, 0120 ATARI USR FUNCTION TO PLOT A Colorado. His home-based system 0125 256 BYTE LOGIC GRAPH FROM BIT presently consists of an Atari 800 with 0130 NUMBER "LINE" OF THE DATA, 24K bytes of memory, the Atari 410 0135 recorder, and the Atari 850 Interface 0140 u s a g e : Module for future communication with 0145 X=U SR( 1600 ,data,one,zero,1i ne) 0150 single board computers. Address 0 155 WHERE: correspondence to 7659 West Fremont 0160 data IS THE ADDRESS OF THE 256 Ave., Littleton, CO 80123. 0165 BYTES OF DATA TO BE PLOTTED 0170 one IS THE LEFT HAND ADDRESS OF 0175 THE LOGIC HIGH LINE 0180 zero IS THE LEFT HAND ADDRESS OF 0185 THE LOGIC LOW LINE 0190 line IS THE MASK TO ISOLATE: THE 0195 SPECIFIC BIT OF data TO BE 0200 PLOTTED Jntrrrating l^nfturai? ^ 0205 0210 0215 THE FOLLOWING STEPS ARE PERFORMED! p r*a « nta 0220 0225 1) INITIALIZE 0230 2) FOR EACH BYTE OF DATA! OSI C4P-MF SOFTWARE 0235 ISOLATE BIT "LINE" 02.40 IF BIT = 0 THEN 0245 SET BIT IN ONE LINE 0250 ELSE 0255 SET BIT IN ZERO LINE 0260 ENDIF 0265 ROTATE THE MASK PATTERN RIGHT 0270 IF ALL 8 BITS THEN 0275 RESET THE MASK 0 280 INCREMENT THE GRAPH INDEX 0285 ENDIF 0290 02.95 NOTE*. DUE TO THE WAY THE GRAPHICS 0300 SCREEN IS ADDRESSED, THE La BLES 0305 ONE AND ZERO SEEM BACKWARD. 0310 0315 THE MOST EXTENSIVE 010 A0VENTIJRE/FANTASY 0320 t t t t FOR THE OS I ! YOU MUST TRAVEL THROUGH THE EVIL LANDS OF ISIERON. FIGHTING A«0 0 325 K IL L IN G MONSTERS AN0 MAGIC-USERS EVERY 0330 STEP OF THE UAYt YOUR 00AL IS TO SEEK 0 0CB 0335 DATA OUT CERTAIN TREASURES THAT U IL L ALL0U $0 0CB FOR DATA ADDR STORAGE YOU TO FREE THE LAND FROM THE E V IL CHAIN 0 OCD 0340 ONE $0 OCD FOR LOGIC HIGH ADDR STORAGE OF MAGIC CASTLES! COMPLETE U ITH FULL 00CF 0345 ZERO $0 0CF FOR LOGIC LOW ADDR STORAGE GRAPHICS 01 SPLAY. COLOR ANO SOUNO! 00D1 0350 LINE 10 0D1 BIT MASK INCLUDES A COMPREHENSIVE MANUAL. ALL 06FF 0355 DINDEX = $06FF DATA INDEX THIS FOR ONLY...... » 2 » .9 3 06FE 0360 GINDEX = $06FE GRAPH INDEX 06FD 0365 MASK t06FD TO SET BIT IN GRAPH 0370 SENO TOl SEND 11 FOR OUR 0375 INTERESTING SOFTWARE CATALOG OF THE 21101 S . HARVARD BLVD. FINEST O SI-C 4P 0 0 0 0 0380 *= $0640 FREE ATARI RAM TORRANCE. CA 9 0301 r e SOFTWARE... 0385 0390 INITIALIZE 0395 (Continued)

18 MICRO - The 6502/6809 Journal No. 52 - September 1982 Listing 5 (Continued)

0640 68 0400 PLOT PLA * OF USR ARGUMENTS 0641 68 0405 PLA GET DATA ADDRESS 0642 85CC 0410 STA DATA+1 MSB PROFESSIONAL 0644 68 0415 PLA WORD PROCESSOR 0645 85CB 0420 STADATA LSB 0 647 68 0 425 PLA GET ONE LINE ADDRESS ' Double Columns ' Page by Paragraph Right Justification ^ Line Centering 0648 85CE 0430 STA ONE+1 MSB ' Printer Graphics ' Shorthand 064A 68 0435 PLA ' Variable Line Space ' Margin Control 0 64E: 85CD 0440 STAONE LSB ' Printer Control Code ' Form Letters 064D 68 0445 PLA GET ZERO LINE ADDRESS 064E 85D0 0450 STA ZERO+1 MSB FOR APPLE/PET/CBM 0650 68 0455 PLA COPYWRITER op 0651 85CF 0460 STAZERO LSB 0653 68 0465 PLA GET PORTB LINE MASK only $185.00 0654 68 0470 PLA ONLY 8 BIT VALUE 0655 85D1 0475 STALINE LSB EXCHANGE DATA w IBM 3740 0657 A900 0480 LDA **00 PEDISK II 877 FLOPPY DISK Sys­ 0659 8DFF06 0485 STA DINDEX INIT DATA INDEX tem s can now read and w rite records 065C 8DFE06 0490 STA GINDEX INIT GRAPH INDEX from IBM “Basic Data Exchange” 065F A901 0495 LDA **01 type diskettes. FILEX software from 0661 8DFD06 0500 STAMASK GRAPHICS BIT POSITION WILSERVE does all the work! Con- 0505 ; ‘"verts EBCDIC - ASCII. 0510 ; PLOT EACH BYTE OF THE 256 BYTE EXCHtfUfi® System (877/FILEX) ...... $1295. "0515 ; BLOC! OF DATA PEDISK 877-1 8’ Floppy for PET ...... $ 995. 0520 ; PEDISK 540-1 5’ Floppy for PET...... $ 595. 0664 ACFF06 0525 PLOTLP LDY DINDEX DATA INDEX CONTROLLER BOARD w POOS...... $ 229. 0667 B1CB 0530 LDA (DATA)tY GET BYTE OF DATA PEDISK II is a high performance floppy disk 0669 25D1 0535 AND LINE ISOLATE TO SINGLE BIT system designed-for the Commodore PET/CBM, Rockwell AIM and Synertek SYM. It features high 0 66B DO 0C 0540 BNE NE0 PLOT <> 0 VI.AUE 0545 performance, simple reliable design and IBM for­ t mat. 066D ACFE06 0550 LDYGINDEX GRAPH INDEX 0670 ADFD06 0 555 LDA MASK CURRENT BIT POSITION SOFTWARE FOR PEDISK II 0673 11CD 0560 ORA (ONE),Y SET BIT COPYWRITER Pro Word Processor ...... $185. 0675 91CD 0 565 STA(ONE),Y REPLACE IN GRAPH MAE Macro Assembler Editor by EHS ...... $170. 0677 D00A 0570 FLEXFILE II Data Base Manager ...... $ 80. BNENEXT BRANCH ALWAYS PAPERMATE Word Processor ...... $ 60. ; 0 575 DISK UTILITY P A C K ...... $ 25. 0679 ACFE06 0580 NE0 LDY GINDEX GRAPH INDEX FASTFILE Data Base...... $100. 0 67C ADFD06 0585 LDAMASK CURRENT BIT POSITION FILEX IBM A ccess R o u tin e s ...... $245. 067F 11CF 0590 ORA (Z E R O ) , Y SET BIT MENU L O A D ...... $ 10. 0681 91CF 0595 STA (ZERO),Y REPLACE IN GRAPH fu llF O R T H + ...... $100. 0600 ; 0683 18 0605 NEXT CLC ROTATE MASK THRU CARRY Commodore Communicates! 0684 6EFD06 0610 ROR MASK NEXT BIT IN GRAPH COMPACK $129. 0687 DO 04 0615 BNE SKIP 0689 6EFD06 0620 ROR MASK ROTATE INTO BIT7 Intelligent Teminal Package 0 68C C8 0625 INY PLOT TO NEXT GRAPH BYTE including: ACIA based interface 068D 8CFE06 0630 SKIP STYGINDEX RESTORE GRAPH INDEX DB25 cable 0690 EEFF06 0635 INC DINDEX NEXT BYTE OF DATA STCP software 0693 D0CF 0640 BNEPLOTLP FOR ALL 256 BYTES ' Remote Telemetry XON-XOFF Control 0695 60 0645 RTS RETURN TO BASIC ‘ Transfer to/fr Disk v User Program Cntl 0696 0650 .END ‘ Printer Output v Status Line $139 COLOR CHART AIM/SYM system video display, 64 x 16 Listing 6: BASIC Program TRACE characters, 8 colors, plugs into ROM socket, 4K RAM Multiple modes; semi 1 RF.M ------TRACE------graphics, alpha. 2 REM - PET/CBM color graphic display, 1 28 x 3 REM - L.ow Resolution Loqic Analyser 192 pixels, generate color bar graphs 4 REM - and 555 Tiner A/D Converter on one screen with data on main 5 REM - screen. RS170 video color chart. 6 REM - by Mike Dougherty 6847 based video output. 7 REM - COLOR VIDEO FOR PET/CBM/AIM/SYM 8 R E M ------9 REM ROMSWITCH - 4 ROMS IN 1 1110 DIM BYTE*(2),DATA*<1024) SPACEMAKER $39.95 1115 TRAP 2000 tREM WHEN ALL. USR FUNCTIONS HAVE BEEN POKED Switch 4 ROMs into the same socket. 1120 READ ADDRtREM STARTING ADDRESS OF CODE A slide switch activates one of four. 1130 FOR CDDE==0 TO 1 STEP 0 Electronic controls insure no glitches 1140 READ BYTE*!REM BYTE OF CODE and allow ROM switching under soft­ 1150 IF BYTE*-"**" THEN SOUND OfO.OiOJGOTO 1120iREM GET NEXT ware control. ROMs can be switched USR FUNCTION from the keyboard. 1140 GOSUB 1400!REM CONVERT BYTE*->BYTE fiillFORTH+ for APPLE/PET 1170 POKE ADDR,BYTE!REM PLACE IN MEMORY FULL FIG FORTH implementation plus 1175 ADDR-ADDR+1 conditional assembler, floating point, 1100 NEXT CODE string handling, multi-dimensional arrays, 1400 REM and disk virtual mamory. 1401 REM --- CONVERT BYTE* TO BYTE fullFORTH +■ from IDPC C o ...... $100. 1402 REM Target Compiler ...... $ 50. 1410 BYTE=0 1420 V=”ASC(BYTE*< 1) ) iGOSUB 1500 SEE YOUR DEALER OR: 1430 V“ASC(BYTE*<2))iGOSUB 1500 ^ P.O. Box 102 1440 RETURN M IC R O T E C H Langhorne, Pa. 19047 / 215-757-0284 150 0 REM (Continued) DEALER INQUIRIES INVITED

No. 52 - September 1982 MICRO - The 6502/6809 Journal 19

I Oealers w elcom e! E books ■ ■ and SOFTWARE For ATARI—PET—OSI—APPLE H -6602-VlC-20-«ne»»ir-,Rme* Listing 6 (Continued) ATARI ATARI ATARI ATARI ELCOMP FORTH - Enhanced FIG-FORTH on disk only. ATARI BASIC - Learning by Order No. 7055 839.96 1510 IF V<58 THEN BYTE=BYTE*16+Y-18 Using 1528 IF Y>57 THEN BYTE=BYTE*16+V-55 This new book is an "Action”- How to connect your EPSON- Book. You do more than read it. Printar to the ATARI 400/800. 1530 SOUND 0,BYTE,10,8 Learn the intricacy of ATARI- Construction article with printed BASIC thorugh the short programs circuit board and software. 1510 RETURN which are provided. The (Screenprint and variable charac­ 1600 REM suggestions challenge you to ters per line). change and write program Order-No. 7210 819.95 1601 REM ---SAMPLE THE PORT EVERY 19 routines. Yes, it's exciting - 1602 REM ---CYCLES AND STORE INTO Many of the programs are appropriate for beginners as well OS^S^S^OS^OSI 1603 REM -— THE BYTE ARRAY, DATA*. as experienced com puter users. (Screen Drawings, Special Sounds, Introduction to OSI computers. 1601 REM Keys, Paddles + Joysticks. Diagrams, hardware and software 1605 DATA 1536 Specialized Screen Routines, information not prwiously G raphics and Sound. Peeks and waitable in one compact source. 1610 DATA 68,68>85,CC,68>85,CB Pokes and special s tu ff t. 192 pages. O rd e rN o . 164 S9.95 Order-No. 157 87.95 1615 DATA A0,00,A2,01,A9,00,8D,2F,02 1617 DATA A5,11,C5,11,F0,FC ATARI Learning by Using — The Second Book of OHIO B ook + cassette or disk Order-No. 158 87.95 1625 DATA A 9 ,20,8 D ,OE,D1 This package includes the book No. 164 plus a cassette or disk The T h ird B o ok o f O H IO 1630 DATA EA,EA,AD,01,D3,91,CB (please specify) containing a Order No. 159 87.95 variety of the programs which 1635 DATA C8,DO,F6,E6,CC,CA,DO,F1 are listet in the book. The Fourth Book ol OHIO 1610 DATA A9,60,8D,OE,D1,A9,22 Order No.: 7220 S39.95 Order-No. 160 89.95 G m m (of the ATARI-Computer 1615 DATA 8D,2F,02,60 How to program your own games VIP Package - Above book plus 1695 DATA ** on the ATARI. Complete listings a cassette w ith the programs. in BASIC and Machine Language Order-No. 160A 819.95 1700 REM of exciting games. Tricks end hints. The Fifth Book of OHIO 1701 REM ---PLOT A ROW OF DATA* ON OrderNo. 162 8 7.95 Order-No. 161 87.96 1702 REM — THE SCREEN AS DEFINED GAME PACKAGE for the ATARI Invoice Writing Pro-am fo r OSI- 1703 REM — BY THE ARGUMENTS. Book + cassette or disk C1P M F, C4P. Disk and Cassette, Includes the book No. 162 plus 8K RAM . 1701 REM cassette or disk (please specify) Order-No. 8234 829.80 containing a variety of the pro­ 1705 DATA 1600 grams listed in the book. Mailing List for C1PMF or 1710 DATA 68 > 68 > 85,C C ,68 > 85,CB Order No. 7221 839.06 C4PMF 24K RAM A TM O N A -1 250 addresses Incl. phone number 1715 DATA 68,85,CE,68,85,CD Machine Language Monitor for and parameters on one 5 1/4 disk) 1720 DATA 60,85,DO,68,85,CF th e A T A R I 4 0 0/80 0. Order-No. 8240 829.80 This powerful monitor provides 8K Microsoft BASIC Ref. Man. 1721 DATA 68,68,85,D1 you with the firmware support Order-No. 151 89.95 that you need to get the most 1722 DATA A9,00,8D,FF,06,8D,FE,06 out of your powerful system. Expansion Handbook for 6602 1725 DATA A9,01,8D,FD,06 ATMONA-1 comes on a bootable and 6802 cassette. No cartridges required. Order-No. 162 89.95 1730 DATA AC,FF,06,B1,CB,25,D1 Disassemble, Memory Dump HEX 1735 DATA DO,OC,AC,FE,06,AD,FD,06 + ASCII, (Change Memory Microcomputer Appl. Notes Locations. Blocktransfer, fill Order-No. 153 89.96 1710 DATA 11,CD,91,CD,DO,OA m em ory b lo c k , save and load Compton Sound Generation machine language programs, start 1715 DATA AC,FE,06,AD,FD,06 New revised applications manual mach, Lang. Progr. (Printer for the SN 1717 6ATA 11,CF,91,CF op tio n a l). 76477 Complex Sound Genera­ Comes with Introductionary to r. 1750 DATA 18,6E,FD,06,D0,01 article on how to program the Order-No. 154 86.96 ATARI computer in machine 1752 DATA 6E,FD,06,C8 language. (Available also in ROM) Small Business Programs 1755 DATA 8C,FE,06 Order-No. 7022 819.95 Complete listings for the business user. Inventory, Invoice Writing, 1757 DATA EE,FF,06,DO,CF,60 ATMONA-2 Superstepper Mailing List and much more. A very powerful Tracer to explore Introduction to Business Appli­ 1795 DATA ** the ATARI ROM/RAM area. Stop cations. 1800 REM at previously selected address. OrderNo. 156 81440 O pcode o r operand (cassette). 1801 REM ---SAMPLE A BIT DEFINED BY Order-No. 7049 849.95 Microcomputer Hardware Hand­ b o o k 1845 pages) 1802 REM ---THE ARGUMENT MASK AND EDITOR/ASSEMBLER for Descriptions, pinouts and specifi­ ATARI 800, 32K or 48K RAM cations of the most popular 1803 REM ---MEASURE THE TIME THE Extremely fast and powerful microprocessor and support chips. Editor/Assembler. (BK Source- 1801 REM — PULSE IS HIGH IN 19 CYCLE A MUST for the hardware buff. code in about S seconds) Includes Order-No. 29 ______8 1 4.96 1805 REM ---TIME UNITS. A T M O N A -1 . Order-No. 7098 S49.95 1806 REM Cara and Feeding of the MACRO-Assembler C om m odore P ET 1810 DATA 1696 for ATARI 800, 48K RAM Eight chapters exploring PET Please specify yo u r system: R A M , hardware. Includes repair artd 1812 DATA 68,68,68,85,01 disc o r cassette. interfacing information. Pro­ 1815 DATA A9,00,8D,2F,02,AA,A8 Order-No. 7099 S89.00 gram m ing tricks and schematics. Add 839.00 for cartrioge version Order-No. 160 86.95 1820 DATA A5,11,C5,11,FO,FC Prototype-Ex pension Board for G u nfrg ht - For ATAKI 400/800 1825 DATA A9,20,8D,OE,D1 16K RAM, needs twp joysticks, VIC-20 (S-44-Bus). Order-No. 4844 818.95 1830 DATA AD,01,03,25,01,DO,F9 animation and sound. (8K machine language). Wordprocessor f.VIC-20,8K RAM 1835 DATA AD,01,D3,25,01,FO,F9 Order-No. 7207 819.95 Order No. 4870 819.99 Mailing List for VIC-20,16kRAM 1810 DATA E 8 , DO , OC, C8 , AS , FF , AD , 01, D3 8irth control with the ATARI O rde r N o . 48 83 8 1 4.96 1815 DATA 25,D1,D0,F3,F0,09 (Knaus Q gino) Casa, or disk T ric k s fo r V IC s - T he V IC *t*ry Order No. 7222 829.96 Programs, hints and expansion 1850 DATA EA,EA,AD,01,D3,25,D1,D0,E8 Astrology and Biorhythm for information for VC-20 1855 DATA 86,D1,81,D5,A9,60 A T A R I (eaai. o r disk) Order No. 141 89.96 OrderNo. 7223 829.96 TIC TAC VIC 1860 DATA 8D,0E,D1,A9,22,8D,2F,02,60 O rde r N o . 48 80 8 9 .9 6 EPROM Cartridge KIT for ATARI G A M E P A C K I (3 Gemesl 1895 DATA ** Cartridge (bare board) with in* Order No. 4881 814.96 2000 REM structions (holds two 16K or two Dual Joystick Instruction 32K EPROMs (2716,2532,2732) O rder N o . 4 8 8 6 8 9 .9 6 2001 REM -REPEAT F0REYER! Order No. 7224 819.96 INPUT/OUTPUT Programming 2002 REM - INPUT THE LINE MASK TO Order No. 7043 complete 829.95 with your VIC Order No. 4886 89.96 2003 REM - CONTROL THE LINE SAMPLED; Invoice Writing for small 16K RAM/ROM board for 844- business with ATARI 400/800 2001 REM - SET UP SCREEN FOR TRACE! bus. Any combination of RAM 16K RAM . and ROM on one board. 2005 REM - DO UNTIL "ESCAPE" KEY*. O rder-N o. 70 22 . cess. 8 2 9 .8 5 (SY212B o r 2716) Order-No. 7200. disc. 89.99 Order-NO. 6 1 3 839.96 2006 REM - IF KEY = "A": Mailing-List No. 7213 824.95 Low coat expenison boards for 2007 REM - PERFORM A/D ON LINE Inventory Contr.No.7215 824.95 your AfTLE II. Bare board comes with extensive description and 2008 REM - DEFINED BY LINEMASK! NEW I A T E X T -1 softw are. 2009 REM - TURN OFF KEY! This new wordprocessor in 6522 VIA—I/O Exp. machine language (8K) for all 2010 REM - ELSE IF KEY = "C"! O rder-N o. 6 0 5 83 9 .0 0 ATARI 400/800 computers offers 2716 EPROM-Burner the best price performance ever. 2011 REM - PERFORM A/D ON LINE Order-No. 607 *49,00 23 editor control commands, 8 K E P R O M /R A M Card 2012 REM - DEFINED BY LINEMASK! 17 formatting commends, dyna­ O rder-N o. 6 0 9 8 2 9.00 mic formatting. Vertical and 2013 REM - ELSE IF KEY = "T": horizontal scrolling (up to 255 Software for SINCLAIR ZX-81 char, per line) Include command and TIMEX 1000 2011 REM - TURN OFF KEY! o n disk! Machine Language M onitor 2015 REM - DO A TRACE OF PORT! Order No. 7210 cassette 82 9 .9 5 Order No. 2399 89 .9 6 Order No. 7211 disk 8 3 9 .9 6 Mailing Lift 2016 REM - PLOT BIT DEFINED BY OrderNo. 7212 ca rtrid g e 8 7 9 .0 0 Order No. 2398 8 1 9 .9 6 8 AS IC and 2017 REM - LINEMASK! Leant FORTH for the ATARI machine language with 2018 REM - ENDIF! 400/800 cassette or disk ZX-81 (82) or TIMEX 1000. Order No. 7063 819.96 Order No. 140 (book) 89.95 2019 REM - ENDD05 ELCOMP Publishing, Inc., 53 Bedrock Lane 2020 REM -END REPEAT. Pomona, CA 91766, Phone: (714) 623 8314 2021 REM Peyment: Check, Money Order, VISA, Maatercherge. Eurochecfc. POSTPAID on PREPAID in USA. 86.00 bending fee for C.O.D. 2022 REM (Continued) All orden outside USA: Add 16% dripping. CA add 6.6% sales tax. 2110 GRAPHICS 0 A T A R I is a registered trad em ark o f A T A R I In c. A P PLE is a registered trademark of APPLE Inc. PET+VlC-20 is e trademark o f Commodore.

No. 52 - September 1982 20 MICRO - The 6502/6809 Journal Listing 6 (Continuedj 2120 POSITION 10,10!PRINT "Line M a s k " ! 2130 INPUT LINEMASK 2140 REM 2150 REM Scotch 2210 GRAPHICS 8!POKE 752,1 2220 SETCOLOR 1,6,11 2230 SETCOLOR 2,6,1 MEMOREX 2240 COLOR 1 2250 REM 2260 REM \ferbatim 2410 FOR L00p=0 TO 1 STEP 0 2415 F'RINT " T - trace A - A/D " 2420 IF PEEK(761)=63 THEN PRINT " T - trace A - A/D "; u a /d : "i USR ( 1696, LINE M A S K ) J P O K f: 764,255 maxell, 2421 IF PEEK<761>=28 THEN POKE 761,255:GOTO 20 0 0 2422 IF F'EEK (761 > = 18 THEN PRINT " T - trace A - A/D m ;"a /d : USR (1696, LINE MASK ) 2423 IF PEEK (761) 01 5 THEN 2120 BASF 2121 POKE: 761,255 2130 X=USR<1536,ADR

MACHINE LANGUAGE SPEED WHERE IT COUNTS... IN YOUR PROGRAM!

Some routines on this disk are: Binary file info For the first time, Amper-Magic makes it easy for people who don’t know Delete array machine language to use its power! Now you can attach slick, finished machine Disassemble memory Dump variables language routines to your Applesoft programs in seconds! And interface them by nam e, not by address! Find substring Get 2-byte values You simply give each routine a name of your choice, perform the append pro­ Gosub to variable cedure once at about 15 seconds per routine, and the machine language becomes a Goto to variable permanent part of your BASIC program. (Of course, you can remove it if you want to.) Hex memory dump Up to 255 relocatable machine language routines can be attached to a BASIC Input anything program and then called by name. We supply some 20 routines on this disk. More Move memory can be entered from magazines. And more library disks are in the works. Multiple poke decimal Multiple poke hex These routines and more can be attached and accessed easily. For example, Print w/o word break to allow the typing of commas and colons in a response (not normally allowed in Restore special data Applesoft), you just attach the Input Anything routine and put this line in your program: Speed up Applesoft xxx PRINT “ PLEASE ENTER THE DATE.” ; : & INPUT,DATES Speed restore Store 2-byte values &-MAGIC makes it Easy to be Fast & Flexible! Swap variables PRICE: $75 Anthro - Digital Software P.O. Box 1385 Pittsfield, MA 01202 &*Magic and Amper-Magic are trademarks of Amhro-Digkal, inc. Applesoft is a trademark of Apple Computer, Inc. The People - Computers Connection

No. 52 - September 1982 MICRO - The 6502/6809 Journal 21 NEW FROM D & N MICRO PRODUCTS, INC. Z80A CPU with 4MHz clock and CP/M 2.2 aluminum with vinyl woodgrain decorativf operating system. 64K of low power static finish. 8 slot backplane for expansion. 4i RAM. Calendar real time clock. Centronics pin buss is compatible with most OS type parallel printer interface. Serial inter­ boards. Usesall standard IBM formatCP/N face for terminal communications, dip software. switch baud rates of 150 to 9600.4"cooling fan with air intake on back of computer and Model 80-1200 $299£ discharge through ventilation in the bot­ 2 8" single sided drives, 1.2 meg ol tom. No holes on computer top or side for storage entry of foreign object. Two 8” single or Model 80-2400 $3496 double sided floppy diskdrives. 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 $ 9E sectors 608K of storage is available on a Serial printer port, dip switch baud rate single sided drive or 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 Mlcropro Basic-80 $289 PL/1-80 $459 Wordstar $299 BasicCompiler $329 Mac $ 85 Mail-Merge $109 Fortran-80 $410 Sid $ 78 Spellstar $175 Cobol-80 $574 Z-Sid $ 95 SuperSort I $195 Macro-80 $175 C Basic-2 $110 Pascal Edit-80 $105 Tex $ 90 Pascal/MT + $429 Mu Simp/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 J with monitor and bootstrap loader. RS-232 Calendar Clock may be set or read using m E M F k 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 amps. Available with WORDSTAR for serial £ » • 8272 chip to provide single or double densi­ terminal systems. ty disk format. 243K single density or608K double density of disk storage on a single D & N-80 serial $695 sided 8" drive. A double sided drive pro­ D&N-80 serial w/Wordstar $795 vides 1.2 meg of storage. DMA used with D & N-80 video $695 disk controller to unload CPU during block Option 001 $ 80 transfers from the disk drives. Optional parallel printer and real time Centronics type parallel printer port com­ calendar clock D & N-80 CPU BOARD OTHER OSI COMPATIBLE HARDWARE I0-CA10X Serial PrlnterPort $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 singlesided $395 IO-CA9 Parallel Printer Port $175 backplane. Use with BP-580 backplane 8 "ShugartSA851 double sided $585 Centronics standard parallel printer inter­ BIO-1600 Bare 10 card $ 50 FLC-66ft.cablefromD&NorOSI $ 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/48 ft. cable for connection $ 75 24MEM-CM9 $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 8MEMCM9F $360 minifloppy spindle motor when system is disk switch BMEM-CM9F $ 50 FL470 $180 not accessing the drive. Complete KIT and Okldata Microline Printers 24K memory/floppy contraller card sup­ manual ML82A 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. Wells St. ML83ASameas82Aexcept $895 8, 16, or 24K of memory, with floppy con­ Fort Wayne, Ind. 46808 16" paper width, 132/232 columns with 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

22 MICRO - The 6502/6809 Journal No. 52 - September 1982 Delayed Reset and Autoboot for the OSI

by Ugo V. Re

The following two circuit ditioned to change quickly from a low Construction of Delayed RESET modifications to an OSI to high state. Circuit computer will enhance the capabilities of your system by The 7414 IC is a Hex Schmitt Trig­ The Delayed RESET circuit can be adding a time delay to the ger that will produce a rapidly changing built on a wire-wrap IC socket as action of the BREAK key output signal from a slowly changing follows: |charging capacitor) input signal. The (System RESET) and by output goes negative when the input 1 . Wire pin 2 to pin 3. providing an automatic boot-up exceeds 1.7 volts, and goes positive of a disk system on power-up, or when the input drops below 0.9 volts. 2. Wirepins 5, 9, 11, and 13 to pin 14. after a power failure. Two of the six gates are wired in series to invert the signal so that a low 3. Solder the 220 yL F capacitor be­ (BREAK key depressed) is applied to the tween pin 1 and pin 7 (positive side RESET pin of the 6502 chip. to pin 1). How often, while typing, have you hit the BREAK key when you wanted to hit Figure 1a: Delayed RESET Circuit the RETURN key? I've made this mis­ take many times, and with a disk system it becomes very annoying to re­ enter BASIC without booting-up the disk.

One way to correct the problem is to relocate the BREAK key away from the keyboard. Another method is to add a time-delayed action to the BREAK (RESET) key similar to the method used by the C1P series 2 computer. I chose to add a time delay to RESET as this circuit would provide an additional benefit that then can be expanded to provide an automatic boot-up on power-up.

Description of Delayed RESET Circuit

Figure la is the Delayed RESET Cir­ cuit Diagram. This circuit can be added to any OSI system including the C8P with the RESET key mounted in the computer case.

A resistor placed in series with a capacitor will control the time it takes for a capacitor to fully charge or discharge. Because the capacitor's charge changes slowly it cannot be used to directly control the RESET pin on the 6502. The 6502 requires a rapid change from low to high to RESET the chip. The signal from the capacitor can be used, however, after it has been con­

No. 52 - September 1982 MICRO - The 6502/6809 Journal 23 4. Solder a 4.7K iesistoi to pin 1. used to trigger one half of a 74123 IC input B1 (first half of the 74123, inpu (Monostable Multivibrator). Its output A1 grounded), to trigger the 74123. Thi 5. Solder a 50 Q resistor to pin 14. is then used to trigger the second half of Q1 output goes high for 100-200 mse< the 74123 in order to produce still before returning to a low state. The Q] 6. Wire pin 14 to 5V and pin 7 to another pulse to turn on the TIL117 output is connected to input A2 (sec ground. (Opto-Isolator). ond half of the 74123, input B2 is wirec to 5 volts), therefore, when it goes low 7. Cut the red lead | trace on the 600 The 74123 can be triggered in two it triggers the 74123. The Q2 outpui board] that goes from the BREAK ways. If input A is held low, bringing goes high and turns on the light key, on the 542 board to pin 40, on input B from a low to high state will emitting diode (LED) in TIL117. Thi< the 6502 chip. trigger the 74123. If input B is held causes the photo transistor to switch high, bringing input A from a high to on and short the contacts of the "D ' 8. Solder the loose ends of the 50 Q low state will trigger the 74123. As a key. After 100-200 msec, Q2 outpui and 4.7K resistors together and result of a trigger, the Q output goes returns to the low state and the photc wire to the red lead/trace from the high and the Q output goes low, staying transistor returns to an open circuit, BREAK key. there for a time determined by the with the "D ” key no longer shorted. At resistor and capacitor combination, this time the computer has booted-up 9. Wire pin 4, 7414 IC to the red lead/ before returning to their initial states. BEXEC*. trace going to pin 40, of the 6502 chip. At power-up it takes one to two Construction of Circuit Board seconds for the capacitor (Cl) to charge 10. Store the IC socket so that it doesn't to approximately two volts before the The Delayed RESET and Auto-Boot short out to any other components. output of the 7414 will change from a circuits should be built on a circuit low to high state. This signal is sent to board and mounted at the keyboard. In The combination of a 4.7K resistor and a 220 nF capacitor will give a time delay of about two to three seconds. C6 Additional delay can be obtained by in­ R3 creasing the size of the capacitor. Do not increase the size of the resistors as - = * / = }■ RESISTOR S i DIODES the values shown are the maximum -CZZD-I that can be used for reliable operation. With the circuit installed, the BREAK key must be depressed for two to three seconds before the screen will clear. □ □ □ □ □ With the Delayed RESET installed, Figure 3a: 542 Rev A. Keyboard the computer comes up in RESET at power-up. With a few more com­ ponents we can use the signal from this circuit to provide an automatic boot-up DIODES at power-up.

i i Description of Auto-Boot Circuit R3 H-----h Figure lb is the Auto-Boot Circuit -I h Diagram. This circuit provides an addi­ -I K > RESISTOR tional time delay after RESET goes high RUB -1 h before shorting the contacts of the "D '' OUT H h M h key to boot-up the disk system. Figure 3b: 542 Rev B. Keyboard y

In addition to supplying a signal to the 6502 microprocessor chip, the out­ put of the 7414 IC (Schmitt Trigger) is RESISTORS

□ □ □ □

Figure 3c: 600 Board

Figure 3: Location of C6 and R3 Leads

24 MICRO - The 6502/6809 Journal No. 52 - September 1982 a C8P system it could be placed in the Once the circuit board is completed A15 board via a 16-conductor cable and CPU case near the A15 circuit board. it must be wired to five volts, ground, appear on pins 2 and 9 of the “A” the BREAK key, and the contacts of the keypad socket. See figure 4 for the loca­ You can use point-to-point wiring "D " key. This can be accomplished in tion of socket and wiring points. Power with IC sockets mounted on a per­ one of three ways. is also available on the A15 board. The forated board, or you can make a BREAK key leads, however, will have printed circuit board (see figure 2 for The best method is to wire all leads to be extended to this board and then the layout). Check for the correct directly to the contacts on the key­ routed to the CPU board. orientation of the electrolytic capaci­ board. This method is the same for all tors and integrated circuits before keyboards. With the keyboard face Now whenever you turn on the soldering any components to the board. down, the "D " key contact pads are power, press the BREAK key, or if the fourth group from the right-hand power returns after a power failure, edge and the second group from the bot­ your computer will boot-up and run Figure 4: Location of C6 and R3 Leads tom edge. The topmost pad (the C6 BEXEC*. You can modify BEXEC* so lead) should have a potential of 4-5 that it will run a special program (home

1------1 volts and is wired to TIL 117, pin 5. The control, security, bulletin board, etc.), 1 JOYSTICK 1 bottom pad is wired to TIL 117, pin 4. without any operator intervention. I The BREAK key contacts are also on have my system running continuously ______------1 1 1 1 1 > 1 the right-hand edge of the keyboard. A and have not yet had a problem. + 1------1 0 red and black pair of wires leave the • JOYSTICK 1 keyboard and go to the CPU board. I would recommend that you do not 0 Power can be picked off at any IC — pin run your system continuously without o o o o o 7 or 8 for ground, and pin 14 or 16 for some form of motor control for the five volts. disks. See the article by N.E. Ingersoll c— >~o o o o in MICRO, September 1981, page 15.1 Another method is to wire to a have this circuit installed in my C4P | KEY PAD | resistor, C6 lead, and diode, R3 lead, MF system and highly recommend it to I B’ I located on the keyboard. See figure 3 reduce power consumption and disk I______I for the location of these components. wear.

J11 CABLE TO This last method can only be used if The author may be contacted at 167 KEYBOARD you have an A15 circuit board installed Sprucewood Dr., Levittown, NY 11756. in your system. The C6 and R3 leads A15 BOARD are extended from the keyboard to the JMCftO

Attache style cases for carrying and protecting a complete computer set-up. Constructed of the highest quality luggage material with saddle stitching. Will accommodate equipment in a fully operational configuration along with manuals, working papers and disks. Never a need to remove equipment from case. Simply remove lid, connect power and operate.

• AP101 Apple II with Single Disk D rive...... $109 • AP102 Apple II with Double Disk D rives ...... 119 • AP103 Apple II, 9 inch Monitor & Double Drives .. 129 • AP104 Apple III, two additional Drives & Siientype 139 • AP105 12 inch monitor plus accessories ...... 99 • P401 Paper Tiger 440/445/460 ...... 99 • P402 Centronics 730/737 ...... 89 • P403 Epson MX70 or MX80 ...... 89 • P404 Epson MX100...... 99 • P405 IDS 560 or Prism Printer...... 109 • CC80 Matching Attache Case (5”) ...... 85 • CC90 Matching Attache Case (3 ") ...... 75 • CC91 Matching Accessory C ase...... 95 compmer case companv ...... 5650 INDIAN MOUND CT. COLUMBUS, OHIO 43213 (614) 868-9464 O y ' W t Accept M etier Charge and Vi»a. Include S i.00 handling.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 25 DREAM MACHINE

ARE YOU BORED? Today you can enhance your Pet or Apple II with We designed our 68000 board primarily for the the power of today’s fastest, most powerful serious individual hacker. We have discovered that microprocessor! Revel in the luxury of sixteen each there are fewer of those than we anticipated! Did you 32 bit registers! Perform a 32 bit add using one buy one of the first Pets or Apples about four years instruction, in less than a microsecond! Run ago? Remember how much fun you had? Because graphics over a hundred times faster than Applesoft! there wasn’t much software back then, many of you wrote your own. What’s that? None of the above interests you? Then go away so that we can address those persons These days every program that can be written for who are interested! your Pet or Apple has been written, several times. So, a couple of years ago you started adding hardware Now that there is no one here but us performance accessories. And life became exciting for a few more freaks, let us tell you about DTACK GROUNDED: months. Then, boredom city again! Our product is real and available now. It was You want to know where all the hackers went? Go reviewed in the April PEELINGS II, including a look in a mirror. Your problem is that there are no real photograph on the front cover. It has also been challenges anymore. reviewed in several club newsletters, such as Mini’app’les and the Keystone Apple Core. DO WE HAVE A CURE FOR YOU! In 1981 most people didn’t know about the 68000, When you begin looking into the 68000 you will so we started a newsletter called “DTACK discover there is little software available right now. GROUNDED, the Journal of Simple 68000 Systems.” That’s because the 68000 is less than two years old. We have twelve issues in print, about 180 pages of There was little software for the 6502 when it was information about the 68000 and other high less than two years old, you may recall. performance processors. We now have new challenges and opportunities. About our name: DTACK stands for ‘DaTa Everything has not been done. There have been an ACKnowiedge’. That’s pin 10 on the 68000 and is enormous number of 68000 based systems primarily responsible for the complexity of most announced! Ours is the only performance oriented 68000 system designs. We tied pin 10 firmly to 68000 product which will improve the computer you ground, which means that data is always already own (Pets and Apples for now). acknowledged. So the processor always runs at full speed (not true of a lot of expensive 68000-based You want to have fun? Here is our experience: A systems). simple but elegant 3-D Applesoft graphics demo runs in 53 minutes. We now have the identical package Our approach does have some disadvantages. running in 10.3 seconds using a 68000 (with no Grounding DTACK prevents hooking some cheating). That's a speed improvement of over 300 to peripherals directly to the 68000. However, we intend 1! There is absolutely no way that this can be done that the host computer perform all I/O functions (we without a 68000! can transfer 70,000 bytes/sec in either direction between the host and our 68000 board). The What? You like being bored? But you want to be operating system is the operating system you now bored at 68000 speeds? We have a solution for you: have since our board is designed as an attached tuck yourself into a time capsule for the next four or processor to your personal computer (just the Pet or five years. When you come out, all of the 68000 Apple II for now). software will have been written! We have 4K boards with 8MHz 68000s. From there But if you do not have a time capsule, you are we go up to 220K systems with 12.5 MHz (!) 68000s. going to have a problem very soon now as your The latter package is generally purchased for computer associates start showing up with business purposes, of course. machinery that runs circles around your 6502. Aren’t bragging rights in your local user group worth a few DIGITAL ACOUSTICS hundred dollars? 1415 E. McFadden, Ste. F DEALERS: We regret that all sales are factory Santa Ana, CA 92705 direct. There is no retail discount. We adopted that policy to make it possible to offer a quality 68000 (714) 835-4884 product at a personally affordable price. Apple, Applesoft and Apple II are trademarks of Apple Computer Company. Pet is a trademark of Commodore Business Machines.

26 MICRO - The 6502/6809 Journal No. 52 - September 198 The 68000 and the Personal Computer

by Laurence Kepple

Your 6502 system is still a RAM) to $1123 (for the same board minutes and 40 seconds in Applesoft gateway to the future! This with 92K). (See PEELINGS II, April with the 68000 handling floating point article discusses some of the 1982, for a review of these products.) operations; and 45 seconds with the Company president Hal Hardenbergh, 68000 running a machine-code program hardware and software aspects in his newsletter DTACK Grounded, and the 6502 used exclusively for I/O. of what promises to be an has announced that the company will A graphics version of the 68000 floating exciting market for the 68000 as soon market less expensive boards with point package that uses a 16-bit man­ an add-on to 6502-based dynamic instead of static RAM. tissa produced the fastest time of all: system s. 18.9 seconds. The name “DTACK Grounded” ex­ Very Large Scale Integration (VLSI) tech­ plains the company's hardware ap­ There are other 68000 boards avail­ nology has made it possible for Motor­ proach to getting the 68000 into the able. Motorola itself recently announced ola to turn the CPU architecture of a personal computer market. Pin 10 of an MC68000 Educational Computer minicomputer (Digital Equipment Cor­ the 68000, “DTACK” , stands for DaTa Board. As its name suggests, the pur­ poration's PDP-11) into a micro­ ACKnowledged. The 68000 needs this pose of this board is to make it processor. The 68000 is so compact and pin to function with the asynchronous economical (cost: $495.00) for students so powerful that it threatens to erase data bus for which it was designed by and designers to get familiar with the the distinction between mini and Motorola. By grounding DTACK, the 68000. The board includes 32K of RAM microcomputers. The question now is: 68000 is made compatible with the and 16K of ROM firmware that pro­ do you hold on to the minicomputer synchronous data busses used in vides the user with debug/monitor concept in the microprocessor world? simpler personal computer systems. functions, program entry, assembling, Do you run two or more terminals on disassembling, and I/O functions. To the 68000 as though it were still a Using the 68000 as a co-processor simplify programming in the educa­ PDP-11? Or do you adopt a "one per­ with a 6502-based system can produce tional environment, a primitive assem­ son, one processor" philosophy? The amazing improvements in execution bler/disassembler function allows pro­ Fortune 32:16 starts at about $5000 and speed. For example, a 3-D graphics grams to be entered, displayed, and may be able to support as many as 16 demonstration included with the modified in assembly language. Espe­ terminals. The comparably priced DTACK Grounded board runs in 30 cially in this latter characteristic, Radio Shack Model 16 can support two minutes, 5 seconds in Applesoft; 10 Motorola's board resembles those of terminals. The manufacturers of the The DTACK Grounded 68000 board (with 12K of static RAM) attached to MICRO’S SAGE II, which costs under $4000, Apple II. The large (!) rectangular shape on the far right of the board Is the MC68000. have deliberately designed their 68000 (Photo by Loren Wright) computer as a single-user system.

Whatever approach is adopted, the rate at which companies are announc­ ing new 68000-based systems makes one thing certain: the 68000 micro­ processor has become a chip worth knowing. Fortunately, you do not have to buy an entirely new system to be able to work with the 68000. As is the case with the 6809, add-on boards are becoming available that allow you to use your 6502-based system as a foun­ dation for work with a more advanced processor.

For example, DTACK Grounded (1415 E. McFadden, St. F, Santa Ana, CA 92705) is now shipping peripheral boards for the Apple II and for the PET that allow users to join the 68000 with the 6502 as a co-processor. The cost of these boards ranges from $595 (for an expansion board with 4K of static

No. 52 - September 1982 MICRO - The 6502/6809 Journal 27 ■ 68000 FEATURE

DTACK Grounded. Another company, interested in 68000 peripheral boards DTACK Grounded board. Clearly, i Intellimac (6001 Montrose Rd.( Rock­ aimed at 6502 machines. The signifi­ you start to develop 68000 software oi ville, MD 20852) has announced a cance of such expansion boards goes your Apple any time soon, you will b< 68000 single-board kit, the 68 beyond simply improving the execu­ one of the first. This is not the case fo Magnum, for $745.00. This board of­ tion time of existing unprotected soft­ those 6502 owners who opt for thi fers 128K of dynamic RAM, 16K bytes ware. Bringing the 68000 out of the 6809 on boards such as those offered b] of firmware ROM/EPROM, and 16K relatively exclusive minicomputer en­ Stellation Two and ESD Labs. Thi bytes of user EPROM. The system's vironment into the personal computing 6809 has a substantial base of excellen firmware offers features similar to world should greatly stimulate the software, and two powerful operatinj those of Motorola's ECB. Also like the development of software for the 68000. systems, OS-9 and FLEX. ECB, the Magnum requires the user to Given the power of the 68000, this supply a power source and a CRT would be a significant event. If the terminal. 68000 ever achieves anything like the 6502's level of support, the results However, one crucial event has We assume that other companies could be awesome. already taken place that will influence are going to follow DTACK Grounded's the future of a substantial portion oi lead and design 68000 boards especially Owners of 6502 systems who are 68000 development work: UNIX has for specific personal computer systems. considering entry into the 68000 world won wide acceptance as the best oper­ Micro Technology Unlimited (2806 should be aware that, for some time, ating system for the 68000. One impor­ Hillsborough St., P.O. Box 12106, they will be strangers in a strange land. tant reason for the UNIX-68000 con­ Raleigh, NC 27605) has announced a The production of software for the nection is that UNIX was written foi 68000 expansion board for its 68000 is only beginning. Phase Zero, the 68000’s minicomputer ancestor, 6502-based system, the MTU-130 Ltd. (2509 N. Campbell Ave., Suite the PDP-11. Created at Bell Labs, microcomputer. Called the Data- 130, Tucson, Arizona 85719) has just UNIX has received hundreds of man- mover-256, the board provides a 68000 started to market the first development years of additional development al processor and an additional 256K of software designed specifically for the some of America's leading universities. RAM (price: $999.00). It seems that 6502/68000 environment. Called “The If microcomputer users can gain access MTU is deliberately pursuing a 6502/ Apple II to MC68000 Cross-Assembler," to UNIX through the 68000, they will 68000 envirqnment, in which users get the program, written in 6502 machine have an operating system of tremen­ the best of both worlds: compatibility code, accepts 68000 assembly com­ dous power. UNIX offers a vast numbej with a widely supported 8-bit micro­ mands and produces 68000 object code of utilities and a means of linking them processor, and upgradability to the (cost: $99.00). The program is intended into large constructs via "pipes." This power of the 68000. At MICRO, we are to run on an Apple II equipped with a makes designing large programs sim-

OSI Disk Users INTRODUCING!

Double your disk storage capacity Without adding disk drives Now you can more than double your usable floppy disk storage capacity—for a fraction of the cost of additional disk drives. Modular Systems’DiskDoubler ™ is adouble- density adapter that doubles the storage capacity of For you, the 68XX userl An exciting new monthly each disk track. The DiskDoubler plugs directly into an magazine formatted for the 68XX enthusiast OSI disk interface board. No changes to hardware or specializing in hardware applications. software are required.

The DiskDoubler increases total disk space under OS- REGULAR FEATURES WILL INCLUDE: 65U to 550K; under OS-65D to 473K for 8-inch floppies, • Articles on 6800, 6809, and 68000 to 163K for mini-floppies. With the DiskDoubler, each • Construction Articles drive does the work of two. You can have more and larger programs, related files, and disk utilities on - New Product Announcements the same disk—for easier operation without constant • Product Reviews disk changes. - Classified Ads • * 2 -B its ' Your OSI system is an investment in computing power. • Questions & Answers Get the full value from the disk hardware and software that you already own. Just write to us, and we’ll send you the full story on the DiskDoubler, along with the rest of our growing family of products for OSI disk systems. ADVERTISERS WELCOME! CASH COMPENSATION FOR ARTICLES YEARLY SUBSCRIPTIONS AVAILABLE ™DiskDoubler is a trademark of Modular Systems. 1 Year $24.00 2 Years $45.00 Single Issue $2.95 Post Office Box 16 C CALL NOW FOR YOUR SUBSCRIPTION! Oradell, NJ 07649.0016 Telephone 201 262.0093 P. O. BOX 310 CONYERS, GEORGIA 30207 404-929-0606 MASTER CHARGE, VISA, and AMERICAN EXPRESS ACCEPTED

28 MICRO - The 6502/6809 Journal No. 52 - September 1982 pier, and encourages the fullest use of MS-DOS and CP/M are "Model Ts" the modular approach in solving com­ compared to the "Lear Jet" function­ plex problems. In addition, UNIX is ality of a UNIX-like system. A 68000 MICRObits written in, and of course supports, the version of COHERENT is on the way. Deadline for MICRObits- 20ih of sec­ powerful programming language C. ond month before publication; i.e., September 20ih lor November issue. Not every 68000 operating system Send typewritten copy (40-word limit) But the attempt to make UNIX the will be UNIX-based or UNIX-com­ with $25.00 per insertion (Sub­ standard operating system for the patible. Mindful of the relative lack of scribers: first ad at S10.00 I 68000 is not without difficulties. In the applications software that runs under first place, UNIX itself has yet to be UNIX, some manufacturers will try to 6800/6809 Software standardized. Because substantial de­ use large libraries of applications pro­ Includes compatible single-user, velopment of UNIX was done at dif­ grams to induce buyers to stay with multi-user and network-operating ferent universities, and because UNIX their non-UNIX but processor-indepen­ systems, compilers, accounting and was designed to be easily modifiable, dent operating systems. For example, word processing packages. Free the operating system assumed a some­ Microcobol Products, Inc. (MPSI), catalog. what different form at each site. developer of the BOS/5 and MBOS/5 Software Dynamics Variants include Revision 5, Revision operating systems, plans to release a 2111 W Crescent, Sta. C 6, Revision 7, and a recently announced 68000 version in the fall of 1982. The Anaheim, CA 92H01 System III. Another problem is that, BOS/5 operating system is already while UNIX provides rich resources in available on a wide range of processors Lessons in Algebra terms of software development tools, it (Z80, PDP-11, 8086) and supports a does not offer much application soft­ large base of business applications pro­ An easy and fun way to ’earn the ware — again, a situation that reflects grams. Once the BOS/5 system is basic elements of high school algebra. the university setting in which UNIX ported to the 68000, all of this applica­ Apple computer diskette $29.95 30-day money-back guarantee if not was formed. The absence of an applica­ tions software will run without any satisfied. tion orientation resulted in some UNIX recompilation or relinking. Another George Earl deficiencies, such as the lack of error business-oriented, non-UNIX operating 1302 So. General McMullen Dr. recovery for disk I/O . Finally, the system is OASIS 16, the 16-bit version San Antonio, TX 78237 language in which UNIX is written, C, of an 8-bit operating system that sup­ while very powerful, is not nearly as ports a substantial quantity of business portable as COBOL, for instance. software. Dynamite PET/CBM Accessories! Wnte-protect switches/indicators for Major efforts are now underway to However, UNIX will almost cer­ 2040/4040 disk drives. Real world solve these problems. Microsoft, the tainly be the primary operating system software at low cost 2114 RAM company that made BASIC famous, is used in the development of new appli­ adapter [replaces obsolete 6550sl and attempting to achieve the same feat of cations software for 68000 micro­ 4K memory expansion for ''old" 8K standardization with UNIX. Microsoft's computers. Some powerful micro­ PETs. Hundreds of satisfied version of UNIX, called XENIX, sup­ processor development tools, in addi­ customers. Write (or free catalog1 ports high-level languages that are well tion to those already part of UNIX, are Optimized Data Systems established in the microcomputer being made available for the UNIX en­ Dept. M, Box 595' I’lacer.tia, CA 92670 market: BASIC, COBOL, FORTRAN, vironment. The Boston Systems Office and Pascal. Charles River Data, (469 Moody St., Waltham, MA 02154) developer of the $20,000 Universe 68 recently announced a delivery date in New! The Aerobics Master [the kind of system that Motorola had late June for UNIX-compatible versions Here's a day-by-day diary for in mind when it designed the 68000), of the more than 50 high-speed micro­ exercisers designed by a mnner. has also created UNOS to go along with processor assemblers, symbolic debug­ Tracks progress of a variety ut it. In addition to C, UNOS supports gers, and linkers that they originally excrcise activities. 4(iK, DOS 3.3 and FORTRAN, BASIC, and Pascal. developed for the PDP-11. Given the ROM Applesoft required Warranteed close relationship between the 68000 upon registration. SASE for more Some software developers have and the PDP-11, this minicomputer is information. Introductory price preferred to create independent oper­ an ideal software development system §22.95 - includes shipping ating systems that maintain com­ for 68000 systems running UNIX. Free Lance Ink patibility with UNIX. For example, the BSO's strategy is to support such a 1806 Wickham Mark Williams Company (1430 West development effort on the PDP-11. Royal Oak, MI 4H07 3 Wrightwood, Chicago, Illinois 60614) has produced the COHERENT system, The low-cost availability of a chip VERBATIM Datalife Diskettes which it describes as "a totally in­ with the power of the 68000 is good dependent development'' that nonethe­ news for anyone who believes in the Five and one-quarter inches, SSDD, soft-sectored, reinforced centers. Only less is designed to preserve compati­ potential of microcomputers. Perhaps $27 95'box of ten Plastic case $2 bility with Revision 7 of UNIX. Like the best news of all is that we do not more. Hip-sort box tor 50 5 U ” UNIX, COHERENT was initially de­ have to spend $5,000 or more for access diskettes, with index lahs - only veloped on the PDP-11. In addition to to the 68000. Your 6502 system is still $27 95 [’lease include $2 flipping ’ C, COHERENT supports a BASIC a gateway to the future. In time, the handling. Send for hardware/software interpreter-compiler, XYBASIC. Mark development effort at the minicom­ list. Williams has just announced a version puter level, in addition to the work The Soit Spot, Inc. of COHERENT for the 8088-based IBM done by microcomputer users them­ Dept. C l, P O Box 212 Personal Computer. The firm's presi­ selves, will produce microcomputer Corbett, OR 97019 dent, Robert Swartz, noted that ex­ performance and capacity that we can isting PC operating systems such as hardly imagine today. 4MCRO' (Continued on page 38)

No. 52 - September 1982 MICRO - The 6502/6809 Journal 29 VOLUME 2 now available! NIBBLE EXPRESS

TABLE OF CONTE NIBBLE EXPRESS VOLUME 2 CHAMP ...... NOW AVAILABLE! 5 8 Working Out with CHAMP ...... The 1981 Anthology of the major articles Amper-Reader...... 10 Hex/Dec Codes Without Conversio and programs is underway! It contains 11 Auto Run and Tape Protection ... up-to-date enhancements and corrections 12 MRS ...... to programs which appeared in Volume 2 of 14 Le Mans ...... NIBBLE 17 Inputting Strings With Commas ... 19 Phantom Numeric Pad ...... Even if you have all 8 issues of NIBBLE in 21 Disk Snooping Part 1 ...... 1981, you’ll want The Express to have 22 Apple Paintbox ...... 25 updated program listings in one convenient 28 Mad Mad Cube ...... package! Disk Snooping Part 2 ...... 30 Applsoft Linefinder ...... 200 solidly packed pages with major 34 37 Direct Keyboard Disk Commands programs and articles for your Apple! A Converting Muffin to Demuffin ... 39 Apple STAR System ...... MUST for your Library! 42 48 Disk Snooping part 3 ...... NIBBLE EXPRESS will be an invaluable Intesoft Connection part 1 ...... 52 Trap ’Em ...... reference for your Apple now and for years to 57 Fast Data Format ...... come! 60 Quick and Easy Hi-Res ...... 62 Apple RAT ...... for only $14.95 (plus shipping) you can make Nibble 63 Binary Disk Copy ...... Express a permanent part of your library. 65 Disk Master ...... 67 Trap/Step ...... 76 Biorhythms ...... ORDER YOUR COPY NOW! 82 Intesoft Connection part 2 ...... 88 Teleprocessing ...... 93 Lo-Res Screen Dump ...... NIBBLE 97 Apple Tricks . . . Reset Trap ...... P.O. Box 325 100 Mini-Amper Edit ...... Lincoln, MA 01773 103 How to Enter Assembler Listings . 106 Free Cat for Apple DOS Users ... Yes! I. want NIBBLE EXPRESS Vol. 2 in my library! 108 M.A.P.S...... Here’s my O Cfteek □ Money order 112 Amper Jump & TSort ...... for $14.95 plus $1.75 postage/handling. (Outside 118 Apple A rtis t...... U»S. add $2.75 for pesiage/bandflng). 123 Pascal Lo-Res Graphics ...... 127 Big CAT ...... □ Also send me NIBBLE EXPRESS Vol. 1 at $12.95 131 Amper Store Recall ...... pttis $1.75 postage/handling (outside U.S. add $2.75 132 D.A.R.T...... for j 134 Print Use ...... 142 Intesoft connection III ...... Master Card & Visa Accepted 148 Lazer Blaster ...... 152 Auto Repeat K e y ...... 153 Card #. .Expires. 154 Poor Boy's LE ...... Catsup—Catalog Supervisor ...... Telephone. 155 157 TRAC Budget ...... Name___ _ TRAC Graphics ...... 159 TRAC Plus ...... Street. 162 165 Archives ...... City__ State. Bp. Intesoft connection IV ...... 168 Command Changer • (missing the Your check or money order must accompany your ordsr to qualify. 171 Outside U.S.: Checks must be drawn on a U.S. Bank. 176 DOS Remover ...... ‘Applet Is a registefed trademark at Appis Computer Company.

MICRO - The 6502/6809 Journal Chances are, when you Siemens system with over A special introductory offer bought your first disk drive, it 10,000 lifetime hours. Shielded when you order Apple-Mate was an Apple. Now that you're connecting cable also attached. directly from us. ready for a second, take a look So when you're ready to boost LONG TERM the juice on your Apple, add-on at Quentin. DEPENDABILITY Our Apple*-Mate™ 51A" Disk the Quentin Apple-Mate. MTBF (Mean Time Between Drive is fully software transparent To order: Check, money order, Failures)— 8,500 power-on hours, with Apple's DOS 3.3 operating Visa or Mastercard number. Calif, and the unit has a one-year system in full and half track residents add 6% sales tax. warranty. operation. Allow one week delivery. Add it to your present drive for COUNT ON QUENTIN greater capacity and faster access. FOR QUALITY Just piug it in and go to work. Quentin Research was building And the Apple-Mate has these disk systems for the computer High Performance advantages: industry when Apple was a little ON TRACK HEAD SEEK bud on the big computer tree. We're known for product reliabil­ A precision lead screw positions ity and stand behind every system the head onto the correct track. we sell you. 19355 Business Center Drive Time-consuming retries and Northridge, California 91324 disk-to-disk copying errors are But the best news may be the price— only $335.00 (40 tracks). (213) 701-1006 virtually eliminated. SIEMENS* DISK DRIVE The apple-beige unit is built around the highly reliable MORE JUICE FOR YOUR APPLE

Special Introductory Price: $335.00

® Apple is a registered trademark of Apple Computer, Inc tSiemens is a trademark of Siemens Corporation, ‘ Apple-Mate is a trademark of Quentin Research, Inc., which does not manufacture Apple computers. An MC68000 Overview

by Tom Whiteside and Joe Jelemensky

This article is the first in a two- • separate supervisor stack pointer program control and system control part series by the authors • vectored, multilevel, priority inter­ operations. The complete instruction set is shown in tables 1 and 2. describing the Motorola rupt handling MC68000 microprocessor. This • TRAP vectors to handle a variety of The addressing modes of the part describes the registers, error conditions and operating sys­ M C68000 are of six basic types: register instruction set and addressing tem calls direct, register indirect, absolute, im­ m odes. mediate, relative, and Data types include bit, byte, word, long implied. Add to these basic types the word, and BCD digits. The machine ability to do indexing, post-incre­ The second part will give some has 17 32-bit registers. Sixteen of these menting, and pre-decrementing, and simple programming examples are accessible in user state (8 address you have 14 specific addressing modes to illustrate programming registers and 8 data registers). The re­ (as shown in table 3). maining register is the supervisor stack techniques and special features pointer and is only accessible when the of the MC68000. machine is in supervisor state. Registers

The M C68000 was designed to take The 17 data and address registers advantage of the latest technology in free the programmer from the overhead VLSI semiconductor manufacturing. of a complicated register management The Motorola M C68000 is rapidly be­ Likewise, the recent advances in com­ scheme in the majority of applications. coming the most popular new-genera- puter science have also influenced the Eight of the registers (DO through D7) tion microprocessor used in high per­ design of the CPU and the instruction are data registers and may be used for formance desktop or personal com­ set of the MC68000. The LINK and byte, word, and long word operations. puters. Several manufacturers have an­ UNLK instructions make it easy to The remaining 8 (A0 through A7) are nounced systems using the MC68000, allocate and deallocate space dynamic­ user-accessible address registers. The with costs ranging from $5,000 to ally on the system stack. This is address registers and the supervisor $10,000, depending on the amount of especially useful when setting up local system stack pointer may be used for memory and size and type of disk variables in a procedure. Another in­ word and long word address operations. storage. These systems pack the power struction, CHK, aids the implementa­ All of the 17 registers may be used as of a minicomputer into a personal tion of high-level languages. CHK index registers. All allow post-incre­ computer-size package and price. allows the checking of array bounds menting and pre-decrementing, giving with a single instruction by comparing the programmer the ability to use any The main reason for this favorable the value of a register specified with of them as a user stack pointer. performance/price ratio is the advanced zero and an upper limit. micro-programmed architecture of the The other registers on the M C68000 MC68000. Its 16-bit external data bus The instruction set is quite regular, are a 16-bit status register and a 32-bit and 32-bit internal registers allow high in that most instructions use the same program counter. The registers are throughput. A 23-bit external address addressing modes and can operate on summarized in the programming bus, plus upper and lower data strobe, most data types. All op codes are 16 model in table 4. allows direct addressing of 16 mega­ bits in length. Additional information bytes of memory. The powerful in­ necessary for specific instructions and struction set was designed to allow addressing modes may require one to easier implementation of structured four additional words to contain im­ Data Registers high-level languages, such as Pascal mediate data, displacement offsets, or and C. Operating systems are also sup­ absolute addresses. Each of the eight data registers ported by the basic architecture, with (D0-D7) is 32 bits wide. Data registers features such as: The basic instruction types are: data are further subdivided into word (16 movement operations; integer arith­ bits) and byte (8 bits) lengths for data metic,- logical operations; shift opera­ manipulation. Long word operands, of • supervisor and user states of operation tions; bit manipulation (bit addressable course, occupy the entire register. • privileged supervisor instructions test, set, clear); BCD arithmetic; and Word operands occupy the low order 16

32 MICRO - The 6502/6809 Journal No. 52 - September 1982 bits, and bytes occupy the low order 8 portion of the register is used or changed; byte contains an eight-level interrupt bits. When data registers are used as the remaining portion is left undisturbed. mask and additional processor-related either a source or destination operand status bits. These status bits indicate in an instruction, only the appropriate Address Registers whether or not the MC68000 is in trace state and/or supervisor state. The con­ Each address register and the stack dition code byte contains bits for pointers are also 32 bits wide. The ad­ overflow (V), zero result (Z), negative dress registers may also be used for result (N), carry (C), and extend (X). Table 1: Instruction SET word operands, but, unlike the data The status word has six unimple­ registers, may not be used for byte mented bits reserved for future exten­ Mnemonic Description operands. Word operands are contained sions to the MC68000 family. ABCD Add Decimal with Extend in the low order 16 bits of an address ADD Add register. When an address register is AND Logical And used as a source operand, either the en­ ASL Arithmetic Shift Left ASR Arithmetic Shift Right tire register or the low order 16 bits will Instruction Set Description be used, depending on whether it is a Bcc Branch Conditional long word or word operation. If an ad­ In this section we will discuss the BCHG Bit Test and Change BCLR Bit Test and Clear dress register is specified as a destina­ MC68000 instruction set in moderate BRA Branch Always tion operand, the entire register is af­ detail. There are several variations of BSET Bit Test and Set fected. Long word operations will of some instructions, which make them BSR Branch to Subroutine course write the 32-bit value into the shorter (and/or faster), allow easy BTST Bit Test entire 32-bit register. Word operations manipulation of pointers, and more CHK Check Register Against will cause sign extension on any other flexible immediate addressing. The Bounds operands before the operation takes programmer may explicitly choose CLR Clear Operand CMP Compare place. these variations or allow the Motorola Resident Structured Assembler to DBcc Test Condition, Decrement The system stack pointers (A7 in select the appropriate form of the in­ and Branch DIVS Signed Divide user and supervisor state) are used by struction. These variations include D1VU Unsigned Divide the machine for interrupt, subroutine “quick", "immediate”, and "address" call, and trap processing. The two stack instruction types, designated by "Q ” , EOR Exclusive OR EXG Exchange Registers pointers are both accessed by using A7 “ 1", and "A ” suffixes to the instruc­ EXT Sign Extend in the operand field of an instruction. tion mnemonic. The supervisor stack will be accessed if IMP Jump JSR Jump to Subroutine the MC68000 is in supervisor state and Data Movement Operations the user stack pointer will be used if it LEA Load Effective Address is not in supervisor state. The user may Unlike the MC6800/6809 architec­ LINK Link Stack LSL Logical Shift Left also use the system stack to store tem­ tures, the MC68000 does not have LSR Logical Shift Right porary data by pushing and pulling data specific load and store register opera­ via the MOVE instruction, or by using tions containing explicit register MOVE Move MOVEM Move Multiple Registers the LINK and UNLK instructions reference. Instead, a more powerful MOVEP Move Peripheral Data described later. MOVE instruction is provided to per­ MULS Signed Multiply form data transfers. The source and MULU Unsigned Multiply destination of data transfer operations NBCD Negate Decimal with are specified independently of the in­ Extend Program Counter struction. This allows movement of NEG Negate data between registers, from register to NOP No Operation NO Ones Complement The program counter of the memory, from memory to register, and MC68000 is a full 32 bits in length, from memory to memory. Data MOVE OR Logical OR even though the range of the address instructions allow byte, word, and long PEA Push Effective Address space is only 24 bits (23 bits plus upper word operands. Address MOVE instruc­ and lower data strobe) on the current tions allow only word and long word RESET Reset External Devices operands. This insures that only legal ROL Rotate Left without Extend version. Future versions will have 32 ROR Rotate Right without bits of address space. The program address manipulations can be executed. Extend counter is manipulated -by program ROXL Rotate Left with Extend control-type instructions (branches, ROXR Rotate Right with Extend RTE Return from Exception subroutine calls, etc.). The program RTR Return and Restore counter is also used as the base address The MC68000 also includes several RTS Return from Subroutine in program counter relative address special MOVE instructions. The MOVE Multiple register instruction SBCD Subtract Decimal with calculations. Extend (MOVEM) allows several registers to be Sec Set Conditonal moved to or from memory with one in­ STOP Stop struction. The MOVE Peripheral data SUB Subtract instruction (MOVEP) provides a means SWAP Swap Data Register Halves Status Register to transfer word and long word data to TAS Test and Set Operand or from peripheral data registers, which TRAP Trap are located at alternate addresses in TRAPV Trap on Overflow The status register on the MC68000 TST Test is 16 bits long. It is broken up into an memory space. The EXchanGe regis­ 8-bit system status byte and an 8-bit ters instruction (EXG) allows the swap­ UNLK Unlink condition code byte. The system status ping of contents between any pair of

No. 52 - September 1982 MICRO - The 6502/6809 Journal 33 68000 FEATURE

the accessible registers. Load Effective (sign bit) of the byte is then set before through the loop. Address (LEA) and Push Effective Ad­ the instruction is completed. This is dress (PEA) provide means for manipu­ very useful for manipulation of sema­ Binary Coded Decimal (BCD) arid lating address pointers in position- phores between processes, since the test metic operations are also supported b independent programs by loading the and set operation is uninterruptable. the MC68000. The following multipri effective address of a variable into an cision BCD arithmetic functions ma address register or pushing it onto a Immediate data of byte, word, and be performed: add decimal with exten stack. LINK stack (LINK) and UNLinK long word length may be added to or (ABCD), subtract decimal with exten stack (UNLK) instructions allow the subtracted from the data stored at the (SBCD), and negate decimal with e: user to easily reserve and return tem­ effective address using the add and sub­ tend (NBCD). The BCD arithmeti porary variable space on a stack. The tract immediate instructions (ADDI operations are restricted to byte-lengt MOVE Quick instruction (MOVEQ) and SUBI). operands and can be register-to-registe makes it easy to transfer sign-extended or memory-to-memory operations. 8-bit immediate data to a register with A variation of the add and subtract a very fast one-word instruction. immediate instructions are "quick'' Logical Operations add and subtract (ADDQ and SUBQ). These instructions allow the addition The M C68000 provides a full set c or subtraction of immediate data (in logical operation instructions. Logics the range one to eight) to byte, word, or and (AND), inclusive or (OR), es long word operands. The advantage of elusive or (EOR), and logical comple Integer Arithmetic Operations these instructions are speed and com­ ment (NOT) are available for all sizes c pactness. They are particularly useful integer data operands. In addition, a se The four basic arithmetic functions in loops where loop counts must be of immediate instructions, ANDI, OR] of add, subtract, integer multiply, and altered by some small value other than and EORI provide logical operations 01 integer divide are supported by the one, but less than nine each time all operand sizes. MC68000, along with other useful operations such as compare operand, negate operand, test operand, and clear operand.

The ADD and SUB operations are available for both address and data Table 2: Instruction Variations operations. Data operations allow all sizes of operands. Address operations are restricted to legal address size Instruction operands (long word and word). The Type Variation Description arithmetic CoMPare instruction (CMP) ADD ADD Add can be used on data, address, and ADDA Add Address memory compare operations. The ADDQ Add Quick NEGate (NEG) and CLeaR (CLR) in­ ADDI Add Immediate ADDX Add with Extend struction can be used on all sizes of data operations (byte, word, and long AND AND Logical AND word). The multiply instruction is used ANDI AND Immediate ANDI to CCR AND Immediate to Condition Code to multiply two word operands to form ANDI to SR AND Immediate to Status Register a long word result. MULU is used for unsigned multiplication and MULS for CMPCMP Compare CMPA Compare Address signed multiplication. CMPM Compare Memory CMPI Compare Immediate In division, a long word dividend is EOREOR Exclusive OR divided by a word divisor to produce a EORI Exclusive OR Immediate word quotient with a word remainder. EORI to CCR Exclusive Immediate to Condition Codes Again, instructions are provided for EORI to SR Exclusive OR Immediate to Status Register signed and unsigned operations (DIVS MOVE MOVE Move and DIVU). A set of extended arith­ MOVEA Move Address metic instructions is also available for MOVEQ Move Quick MOVE to CCR Move to Condition Codes programming multiprecision and mixed MOVE to SR Move to Status Register size arithmetic functions. These in­ MOVE from SR Move from Status Register clude ADDX, SUBX, NEGX, and EXT MOVE to USP Move to User Stack Pointer

(sign extend). The test instruction NEG NEG Negate (TST) is used to set the condition codes NEGX Negate with Extend as a result comparing the operand to OR OR Logical OR the value zero. ORI OR Immediate ORI to CCR OR Immediate to Condition Codes Another powerful instruction in this ORI to SR OR Immediate to Status Register

category is the Test And Set instruction SUB SUB Subtract (TAS). TAS sets the N and Z condition SUBA Subtract Address codes based on a compare of the byte SUBI Subtract Immediate operand specified in the instruction SUBQ Subtract Quick with zero. The most significant bit SUBX Subtract with Extend

34 MICRO - The 6502/6809 Journal No. 52 - September 1982 68000 FEATURE ■

Shift and Rotate Operations tion code bits. Zeros are shifted into the tive address of the operand, all operand MSB during right shifts, and into the sizes are allowed. A shift count of one Bidirectional arithmetic and logical LSB during left shift operations. to eight bits may be specified in the in­ shift operations are performed in the struction, or a count of zero to 63 bits MC68000 by executing the ASR, ASL, Rotate operations (ROR and ROL) may be specified in a data register. LSR, and LSL instructions. Rotate oper­ rotate only the bits in the operand and ations may be performed with the ROR, do not include the contents of the ex­ Shifts and rotates on memory oper­ ROL, ROXR, and ROXL instructions. tend (X) bit. The operand is rotated in ands can only be single bit shifts and the direction specified by the instruc­ are restricted to word length operands. Arithmetic shift operations shift the tion, and the last bit rotated will also be operand in the direction specified. The contained in the carry (C) bit. The con­ Bit Manipulation Operations last bit shifted out of the operand will tents of the X bit will never be rotated be contained in the carry (C) bit and the into the operand. Several powerful bit manipulation extend (X) bit of the Condition Code instructions have been implemented in Register (CCR). When the operand is Extended rotate operations are pro­ the MC68000. Individual bits may be shifted right, the value of the sign bit of vided by the rotate with extend instruc­ tested (BTST), tested and set (BSETJ, the operand (Most Significant Bit) will tions (ROXR and ROXL), which in­ tested and cleared (BCLR), or tested be preserved., During left shift opera­ clude the extend (X) bit in the opera­ and toggled (BCHG). The BTST in­ tions, the Least Significant Bit of the tion. During these operations, the struction causes the state of the speci­ operand will be replaced by zero (0). previous contents of the X bit will be fied bit in the operand to be reflected by The overflow (VJ bit will indicate if the shifted into the MSB or LSB, depending the zero (Z) bit in the condition code sign of the operand has changed during on the direction of the rotate operation. register. The BSET and BCLR instruc­ the left shift operation. Multiple precision shifts and rotates tions allow the state of the specified bit can be performed using a combination to be reflected by the Z bit, and in addi­ Logical shift operations shift the of shift and extended rotate operations. tion, set or clear the specified bit after operand either right or left as specified the test. The BCHG instruction causes by the instruction. The last bit shifted All shift and rotate operations may the state of the bit to be reflected in the out of the operand in either direction be performed on memory or registers. Z bit, and also changes the state of the will be contained in the C and X condi­ When a register is specified as the effec­ specified bit in the operand to the op­ posite state after the test.

Bit manipulation operations may be performed on register or memory oper­ ands. If the effective address is speci­ Table 3: Addressing Modes fied as a register, the bit number speci­ fication is modulo 32, allowing all bits contained in the register to specified. Mode Generation Memory operands are restricted to byte Register Direct Addressing length and the bit number specification Data Register Direct EA = Dn is modulo 8. The bit number is Address Register Direct EA = An specified as part of the instruction, or Absolute Data Addressing in a data register specified in the Absolute Short EA = (Next Word) instruction. Absolute Long EA = [Next Two Words)

Program Counter Relative Addressing Relative with Offset EA = (PC) + dI6 Program Control Operations Relative with Index and Offset EA = (PC) + (Xn) + da

Register Indirect Addressing Program execution in the MC68000 Register Indirect EA = (An) is controlled by the Program Counter Postincrement Register Indirect EA = (An), An An + N (PC). The PC is updated in the normal Predecrement Register Indirect A n*— An - N, EA = (An) processing of an instruction to point to Register Indirect with Offset EA = (An) + dlfi Indexed Register Indirect with Offset EA = (An) + (Xn) + d8 the next instruction to be executed. The PC will either point to the next se­ Immediate Data Addressing quential instruction in memory, or to Immediate DATA = Next Wordfs) another instruction sequence else­ Quick Immediate Inherent Data where in memory as a result of a PC Implied Addressing modifying instruction. Implied Register EA = SR, USP, SP, PC The program counter is modified by Notes: the execution of an instruction in one EA = Effective Address of two ways. In the first way, the PC is An = Address Register Dn = Data Register modified by adding a displacement, Xn = Address or Data Register used as specified in the instruction, to the cur­ SR = Status Register rent PC to get the address of the next PC = Program Counter instruction to be executed. The dis­ ( ) = Contents of dft = 8-bit Offset (displacement! placement (word or byte) specified in d16 = 16-bit Offset (displacement) relative branch instructions is a two's N = 1 for Byte, 2 for Words and 4 for Long Words complement integer value, which ■*- = Replaces counts the relative distance in bytes.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 35 The value of the PC is the address of and falls through if it is true. If the con­ System Control Operations the current instruction, plus two. The dition is not true, the contents of a displacement is calculated by the specified register is decremented and Several instructions offer easy im­ assembler when the program is assem­ the result compared to - 1. If the value plementation of system control func­ bled, or by the linker when building a is not - 1 , the branch will be taken. tions. These instructions allow logical load module. By adding displacements Otherwise control will resume with operations on the status and condition to the current PC, the program will be the instruction following the DBcc. All code bits, trap and exception process­ position independent, since all PC conditional branches are relative to the ing, special range checking, special pro­ changes are relative and control is current PC. Table 6 lists the conditions gram flow control operations, and even always resumed at the same location in that can be tested by the conditional a special peripheral reset operation. the program instead of an absolute branch instruction. memory address. This allows programs Many of these can be used only if to execute anywhere in memory in­ Unconditional branch instructions the MC68000 is in the supervisor mode stead of from a specific area. always force the destination address of (S bit in the system byte of the Status the branch to be loaded into the pro­ Register set) to support the operating In the second way, the PC may be gram counter. These branches may be system environment. These privileged modified by instructions that load an relative to the current PC or absolute instructions include those that change effective address value into the PC addresses. The BRAnch unconditional the state of bits in the system byte of when the instruction is executed. In instruction (BRA) will always cause the the status register (ANDI, EORI, ORI, this case, the value of the PC will be PC to be replaced by the value of the and MOVE EA to SR), change the value overwritten by the new address speci­ current PC, plus the relative displace­ of the User Stack Pointer (MOVE USP), fied in the instruction. When these in­ ment specified in the instruction. The ReTum from Exception trap (RTE), structions are executed, control will be JuMP instruction (JMP) causes the PC stop program execution (STOP), and transferred to the memory address to be loaded with the effective address cause the RESET pin to become an out­ specified regardless of where the pro­ specified in the JuMP instruction. put and be asserted (RESET). gram is loaded. There are also two subroutine call Instructions that directly change Program control operations are ac­ instructions. These instructions first the contents of the Condition Code complished with a collection of branch save the value of the current PC (ad­ Register portion of the status register instructions, subroutine branches, and dress of next sequential instruction to (ANDI, EORI, ORI, and MOVE EA to return instructions. Branch instruc­ be executed) on the system stack CCR) and store the status register tions can be conditional or uncondi­ (pointed to by address register A7), and (MOVE SR to EA) may be executed in tional. The conditional branches allow then cause the PC to be loaded with the user mode also. testing various condition bits in the address of the subroutine to be ex­ condition code register individually or ecuted. The Branch to SubRoutine The user program may also execute in Boolean combination. If the condi­ (BSR) instruction causes the relative intructions that might generate a trap. tion specified in the branch instruction offset specified in the instruction to be These are: the range checking instruc­ is met, the branch will be taken. If not, added to the PC. The Jump to Sub- tion (CHK); the specific trap generation the next sequential instruction will be Routine instruction (JSR) loads the PC to one of 16 trap vectors (TRAP); and executed. The conditional branch in­ with the effective address of the sub­ causing a trap on overflow bit set in the struction (Bcc) tests the condition routine specified by the effective ad­ condition code register (TRAPV). specified in the instruction. Then it dress specified by the JSR instruction. either branches or falls through to the next instruction, based on whether the There are two instructions that condition is met or not. The test condi­ return program control to the address tion, decrement and branch instruction stored on the system stack. ReTurn Addressing Modes (DBcc), tests the specified condition from Subroutine (RTS) pulls the new program counter value from the stack The MC68000's 14 addressing Table 4: Programmer’s Model and program execution resumes at that modes can be grouped into three broad for the MC68000 address. The ReTum and Restore in­ classes. These are: 1. Register District, struction (RTR) additionally restores 2. Memory, and 3. Inherent addressing. the condition code register from the DO stack when returning from interrupt D1 Register Direct Addressing Modes D2 processing. D3 Eight 0 4 Data In Register Direct addressing, the ef­ Q5 Registers Bcc and BSR can have displacement fective address is one of the 16 06 values of byte and word lengths. DBcc registers. Register addressing can be D7 always has a word length displacement divided into these two categories: 1. value. The effective address used by the Data Register Direct — Dn; 2. Address AO A1 JMP and JSR instructions is specified by Register Direct — An. The notation for A2 Seven the addressing mode of the instruction. Data Register Direct addressing is A3 Address A4 Registers "D n '1 (e.g., DO refers to data register A5 Another instruction that uses the 0). Likewise, Address Register Direct A6 condition codes is the Set according to addressing notation is "An’’. User Stack Pointer Two Stack condition (See). The See instruction Supervisor Stack Pointer Pointers tests the specified condition (see table 6) Memory Addressing Modes Program and sets the byte specified by the effec­ j Counter tive address to all ones if the condition Status Unlike Register Direct addressing, [System Byte User Byte | Register is true. Otherwise the byte is cleared. Memory addressing modes provide the

36 MICRO - The 6502/6809 Journal No. 52 - September 1982 68000 FEATURE■ address of an operand that is in memory. A list of Memory addressing Table 5: MC68000 Status Register modes for the MC68000 follows. System Byte User Byte Beneath each of the Memory address­ ing modes is an example of its assem­ 'is 13 10 6 ^ 4 0N bler syntax. All indirect references are T S ^ ^ ’2 ’ 1 N Z V C placed in parentheses. Trace Mode - 1. Indirect Addressing Supervisor 'k a. Address Register Indirect State J (An) Interrupt ^ b. Address Register Indirect with Mask ) Postincrement Extend — (An) + Negative — Condition c. Address Register Indirect with Zero — Codes Predecrement Overflow — -(An) Carry — d. Address Register Indirect with Displacement { disp(An) e. Address Register Indirect with Index b. Absolute Long b. Program Counter With Index disp(An + Im. W) where Im is Am inst.L ADDRESS disp(PC + In) where In is An or Dn or Dm disp(An + Im. L] where Im is Am 4. Immediate Addressing or Dm 3. Program Counter Relative Addressing a. Immediate 2. Absolute Addressing a. Program Counter with #xxx a. Absolute Short Displacement b. Quick Immediate disp(PC) #xxx . inst.W ADDRESS Icontinued)

SOUTHEASTERN MICRO SYSTEMS, INC. 1080 IRIS DRIVE CONYERS, GEORGIA 30207 404-922-1620 X SX-9 Single Board System PET/CBM™ ■ Uees 6600 CPU ■ Two RS232 Serial Ports » Two Parallel 8 Bit Porta 2000/3000/4000 Series • One High-Speed Serial Port • System Clock at 1.22 MHZ, Fixed not using a CRT, or display controller chip • System provides lor selectable diagnostics on power up or by com m and $275.00* ■ Provides (or automatic disk boot on p-ower up ■ Provides for board ID for future multi-user configuration or user d e fin e d Select either On The • Expansion capabilities via ribbon cable • Disk controller provides control fcr up to four 5 1/4' drives from 80 x 25 or 40 x 25 Built-in SS/SD up to DS/DD control Display • Real time clock • Memory 64K RAM (62K User Memory) • Ail signals via plug in ribbon connectors From the keyboard or program • Compatible with TSC FLEX 9 and all TSC 6809 single user software. DS/DD requires SEMS-1 Disk Drivers • Board size: 10.25* by 10.5* Displays the full, original character set • Power requirements: r5 VDC at 3 AMPS, r12 VDC at 250 ma, -12 VDC at 100 ma Available from your local dealer or: • Optional Cabinet with Power Supply EXECOM CORP. 1901 Polaris Ave. LIMITED OFFER PRICES Racine, Wl 5 3 4 0 4 8are Board With SEMS-1 ASS E M B LE D & TESTED Ph. 414-632-1004 Monitor & Documentation 80ARD WITH CA8INET ♦ Plus installation charge of $75.00 & POW ER SUPPLY

ONLY 100 Bare Boards SOFTWARE: TSC FLEX 9 Available only for Basic 3.0 & Basic 4.0 Will Be Soldi ORDER NOW! With S£MS Disk Drivers PET & CBM™a First order basis (with Editor & Assembler) trademark of Commodore Business Machines US SHIPPING $10.00, FOREIGN SHIPPING $50.00

No. 52 - September 1982 MICRO - The 6502/6809 Journal 37 MICRObits Table 6: Condition Codes Allowed for the DBcc, See, and Bcc Instructions. (Continued from page 29)

AIM 65 — Real Time Clock CC Carry Clear LS Lower or Same Provides hour, minute, second, day of c s Carry Set LT Less Than EQ Equal MI Minus week, day, month, year. Twelve- or F False * NE Not Equal 24-hour format. Pin compatible with GE Greater or Equal PL Plus AIM expansion connector (also SYM, GT Greater Than T True KIM). Pour switch selectable HI Higher VC Overflow Clear . Nicad battery backup. LE Less or Equal VS Overflow Set Industrial quality board 4.5 x 6. All ICs socketed. Single 5V supply. * The false condition does not apply to Bcc. Twenty-two-page manual. All software included. Bare board $29, Complete A&T $93, includes batteries. Add $4 shipping and handling. CA residents add 6%. Data Design Group The various forms of Address Regis­ Index, except that the program counter 7100 Mimosa Drive ter Indirect addressing provide great is used instead of an address register. Carlsbad, CA 92008 flexibility. In the simplest of these, the (714) 265-6940 effective address is the contents of the For normal immediate addressing, specified address register. In the Post­ the effective address is the word or long The Wrath of Khan increment mode, the effective address word immediately following the op­ is still the specified address register but code, depending on the size of the Can you defeat a Superman? the address register will be incre­ operation. Single bytes are stored as a Command Enterprise in a tactical mented after the operation. The Pre­ word (the upper byte is zeros). In Quick battle against the Reliant. Cl-P decrement mode is the same except the Immediate addressing, a special case of controls Reliant's maneuvers and address register is decremented before weapons via Artificial Intelligence immediate addressing, the immediate logic routines. Features full status the operation. The Pre-decrement and data (a number from 1 to 8) is contained display, sensors, photon torpedoes, Post-increment modes automatically in a 3-bit field in the opcode. Quick Im­ phasers, deflectors, and more. adjust the number of words to decre­ mediate addressing is available for Cassette 8K - $14.95 ppd. ment or increment based on the size of ADD and SUB instructions where con­ Cygnus Software the operation. For the Address Register stants are used frequently. Immediate Suite 432 Indirect with Displacement mode, the addressing limits the destination ad­ Ft. Lauderdale, FL 33311 effective address is formed by summing dressing mode to register direct. the contents of the specified address However, many special immediate in­ register with a sign-extended 16-bit off­ struction variants exist, such as ADDI, Perseus Programming for OSI set. The Address Register Indirect with for using memory addressing for the Boxed Jn — An adventure in which Index effective address is the contents destination address. you must escape to become a member of the specified address register, summed of the CIA. Rookie Mission —- Your with the sign extended 8-bit displace­ Implicit Addressing first mission as an agent and you ment and the specified index register. must find the traitor! Suicide Mission — An exciting graphics game that pits The index register can be any of the ad­ Many instructions make implicit you against an alien who has captured dress or data registers and can be references to the program counter, the your crew, and you must retrieve specified as either a long word or a word supervisor stack pointer, the user stack them against over-whelming odds. [which will be sign extended). The ex­ pointer, or the status register. For ex­ Tough! All programs run in 8K and on ecution speed of the Address Register ample, the RTS (return from sub­ a C1P, C2P, C2-4P, or C8P with a with Index is not affected by the size of routine) implies use of the program cassette-based system. Send $9.95 for the index. counter and the stack pointer. each or $22.95 for all. Perseus Programming In the Absolute Addressing modes, Using the MC68000 9311 Avery Rd. the effective address is specified in the Broadview Heights, OH 44147 word or words following the opcode. In In the second part, we hope to pro­ the case of Absolute Short addressing, vide a better feel for using the MC68000 OSI States and Capitals Drill the word is sign-extended to form the through a series of simple examples, In effective address. addition to showing assembler syntax, Let your kids use the computer and these examples will illustrate instruc­ learn at the same time! You won't The Program Counter addressing tions such as LINK, UNLK, and CHK believe this program is running on your 8K C1P! Graphics, screen clears, modes use the contents of the program which may be unfamiliar. no scrolling, and it even gives you a counter to form an effective address. grade. Get a correct answer and watch These modes are important for writing the flag wave. Cassette - $10.95 plus position-independent code. The Pro­ Joe felemensky and Tom Whiteside are $1.50 for postage. Math drill games gram Counter with Displacement mode engineers in the Motorola MOS also available. sums the contents of the program Microprocessor Design Group. They can Tripod Productions counter with a 16-bit sign-extended be contacted at Motorola, Inc., Mail Drop Rt. 11, Box 71 displacement just like Address Register M2880, 3501 Ed Bluestein Blvd., Austin, Bowling Green, KY 42101 Indirect with Displacement. The Pro­ Texas 78721. gram Counter with Index mode is iden­ (Continued on page 98) tical to Address Register Indirect with JMCftO

38 MICRO - The 6502/6809 Journal No. 52 - September 1982 GET FREE SOFTWARE FOR YOUR COMPUTER! HOW? JUST ORDER ANY OF THE ITEMS BELOW, AND SELECT YOUR FREE SOFTWARE FROM THE BONUS SOFTWARE SECTION, USING THE FOLLOWING RULE: FOR THE FIRST $100.00 WORTH OF MERCHANDISE ORDERED TAKE 1 ITEM; FOR THE NEXT $200.00 WORTH OF MERCHANDISE ORDERED TAKE ANOTHER ITEM; FOR THE NEXT $300.00 TAKE A THIRD ITEM, ETC. ALL AT NO COST.

HARDWARE by APPLE COMPUTER PRINTERS COMPUTER SYSTEMS APPLE II + 48K 1199 PASCAL 150 EPSON; ATARI FLOPPY OR + CNTRLR 545 FLOPPY DRIVE 465 MX80 449 M X 80 F /T 549 ATARI 800(16K ) 629 ATARI 4 0 0 (16K) 335 APPLE III. 128K 2999 PILOT 125 MX100w/Graftrax 729 MX70w/Graftrax 285 810 Disk Drive 449 825 Printer 599 We carry the rest ot the APPLE line at low. low prices' CALL1 APPLE Intfce/Cbl 85 GRAFTRAX 60 16K Ram Memory 89 850 Interlace 159 GRAPPLER Inttc 149 2K Buffer Serial Card 135 M icrosoft Basic 69 830 Modem 149 M X80Ribbon 15 MX100 Ribbon 24 INTEC32KRam Memory 129 Telelink Cartridge 25 OTHER HARDWARE for APPLE C.ITOH; ATARI800(48K) 739 AXL0N 128K Ram Disk 550 O.C. HAYES: F -10 Daisy Wheef (Par) 1495 F-10 Daisy Wheel (Ser) 1495 ATARI 4 0 0 (48K) 435 Micromodem II 285 Smartmodem 225 Pro-Writer (Par/Ser) 599 Pro-Writer (Par) 499 OSBORNE MICROSOFT: F -10Tractor Option 225 Printerinterfaces CALL Osborne 1 1695 PrinterCable 55 Z80Softcard 269 l6KRamcard 139 NEC: XEROX PC-8023A MOUNTAIN COMPUTER: 495 NEC 7710 Daisy 2345 820-1 Systemw/5"Dr. 2450 820-2Systemw/8"Dr. 2950 Expansion Chassis 559 Music System 339 QUME: 0IAB L0: CP/MOp. Sys. 159 W ordstar 419 A/0 + D/ACard 299 CPS M ulti-function 169 SPRINT 9 /4 5 1995 6 3 0 R /0 2099 Super Calc 199 DIABL0630 Printer 2099 Systems-PlusBIZ SOFTWARE, PER MODULE CALL' X / 10 Control Card 169 Super Talker 169 0KI0ATA: CALL FOR MORE PRICES' WE CARRY FULL LINE’ Microline82A 495 M icroline 80 375 NEC CALIFORNIA COMPUTER SYSTEMS: MicrolineTractor 59 O kigraphl 79 Full Line at Low, Low Prices' CALL1 Centronics Par Int 115 A/DConverter 105 Microline83A 799 M icroline 84 (Par) 1099 C0MM000REVIC Async S erial'nt 135 Calendar/Clock 101 I0S: VIC20Computer 259 VIC 151 Sprinter 335 CALL FOR MORE PRICES' WE CARRY FULL LINE1 560 with graphics 1095 Prism-Print Software 49 VIC 1540 Oisk Drive 499 VIC 1211 ASupr-Expndr 59 VI0EX: Prtsm 80 (Basic) 899 Prism 132 (Basic) 1050 VIC 1530 Datasette 69 VIC 1011A RS-232 Port 45 80 Col Bd & Softs wMch 235 Enhancer 11 125 Auto Sheet Feed 125 PrismColor 325 Enhancerl 105 Softsw itch 29 Sprint Mode (200cps) 125 Dot PlotGraphics 85 GENERAL CP/M SOFTWARE MORE OTHER HAR0WARE FOR APPLE: MICROSOFT; SSM A I0-II 195 Keybd Co Num Keypad 129 Basic 80 275 Edit80 139 SSM Serial AS 10 115 SunshineJoystick 39 ADD-ON MEMORY CARDS & DISK DRIVES Basic Compiler 299 MuMath/MuSimp 199 SSM Par AP10 99 Game Paddles 29 FOR APPLE Fortran 80 339 MuLisp/MuStar 159 Novation Apple Cat 319 S hadow /V et 885 MEMORY: Cobol 80 499 M-Sort 128 Versawrrter Tablet 249 SUP'R MOD 29 Microsoft 16KRamcard 139 Saturn 32K Card 199 M acro 80 139 Z-80Softcard/Apple 269 Prac Penph Microbuff Prac Penph Microbuff Legendl28KRamcard 649 Saturn 64K Card 369 (32K) 249 (16K) 210 MICROPRO: Legend 64KRamcard 299 Saturn 128K Card 525 Wordstar 275 Calcstar 199 Prometheus 128K SVA256KAPL-Cache 1045 439 Mailmerge 89 Supersort 165 OTHER SOFTWARE for APPLE: AXLQ N320KRam Disk 1149 16Kof4l16.200NSMem 25 Spellstar 165 Custom Notes 275 APPLE-COMPATIBLE FLOPPIES by MICRO-SCI: Oatastar 239 PERSONAL SOFTWARE/VISIC0RP: With Controller No C ontroller Visicalc 3 3 195 Visiliies 199 ASHT0N-TATE: A35 Exact Replacement 460 A35ExactReplffcement 415 dBASEII 475 dBASE H Guide 29 CALL FOR MORE PRICES' WE CARRY FULL LINE' A40 40-Track 489 A4040-Track 399 MICROSOFT: A70 70-Track 599 A70 70-Track 499 SORCIM: Super CaJc 189 APPLE Fortran (Z80) 129 APPLECobol (Z80) 499 8 FLOPPY 0ISK SYSTEMS: TASC Basic Compiler 139 M BASIC Compiler (Z80) 299 Vista OualSSOD 1299 Vista Dual DSDD 1599 F0X-GELLER: TIME Manager 125 M uM ath 199 SVA AM S8000 Dual SVA AMS8000 Dual Quickscreen 129 dUTIL 69 AIDS 99 M/SORT 149 SSDD 1945 0S0D 2595 Ouickcode (Writes programs ford BASE II) 199 MICR0-PR0: SVAZVX4 Quad Cntrllr 495 SVA Disk 2 + 2 Cntrtlr 359 ISA: Wordstar 225 Mail-Merge 99 CORVUSHARO 0ISKS: Spellguard 219 SP/LAW 99 Spellstar 149 Data-Star 199 6 MB Hard Disk 2249 Apple Interface 175 PEACHTREE: Super-Sort 149 Calc-Star 149 11 MBHardDisk 3945 Other Computer Intfce CALL Gen Ledger 3 9 9/40 Inventory 399/40 PEACHTREE: BIZ Packages, at 199 20 MB Hard Oisk 4769 Mirror Back-Up 675 Acct Rec. 399/40 Magtcalc 269/25 Acct Pay 399/40 Sales Invoicing 399/40 CPA BIZ Packages, atl 195 Payroll 399/40 MORE OTHER SOFTWARE for APPLE: SYSTEMS PLUS DBMasterlorCORVUS 399 MONITORS, PLOTTERS & PERIPHERALS OB Master 179 All Modules 415/EA Data Factory 5 0 239 PFS 85 MONITORS: ASCII Express 55 Dakin5Oeprec Planner 299 Zenith 12 "Green 125 Zenith 13 "Color 359 Sorcim Super Calc 189 Dakm 5 BIZ Bookkeeper 299 Amdek 12 "Green 135 Amdek 13 "C olor 359 S-100 BOARDS Howard Tax Prep 115 Broderbund Payroll 325 BMC 12 "Green 119 BMC 1 2 " Color 349 HAYESS-100M0DEM 325 HAYESSMARTMODEM 219 Howard Real Estate Anal 129 BPiAccounting Pkgs/ea 325 Electrohome RGB Inttce 275 Electrohome RGB 1 3 " Clr 725 HAYESCHR0N0GRAPH 189 CCS64KRAM BOARD 525 Synergistic "Data Reporter" Manages Plots & Edits Oata1 189 PLOTTERS: Watanabe 1-Pen 1150 Watanabe 6-Pen 1400 W0R0-PR0CESS0RS A SPELLERS for APPLE: Strobe Plotter 1-Pen 699 Strobel Apple Intfce 99 WordstarCP/M m EZW riter Prof Sys 21b Houston Inst DMP-3 929 Houston Inst DMP-4 1185 FLOPPY DISKS MagicWandCP/M 299 M U SE SuperText80 150 Elephant 5 25 Elephant 8 OTHER PERIPHERALS: Executive Secretary 199 W ordpower 5U SoftSSSD/bx 25 Soft SSSD/6x Scott Shadow/VET 885 Street Echo II Svnth 189 29 Letter Perfect 1 /5 Hebrew ll 5b 27 3M 8'' SoftSSSD/bx 32 Votrax Type-N’-Talk 325 ComputerSta. 0ithertizer269 3M 5 " Soft SSSO/bx Magic Window 85 Screenw riter li 110 Maxell 5" SoftSSSD/bx 31 Maxell 8" Soft SSSO/bx 35 ALF9-VoiceMusic Bd. 155 Comp. Sta VideoCamera375 Spellguard 219 Spellstar CP/M 149 DYSAN 5" Soft SSSO/bx 37 DYSAN8"SofSSSD/bx 49 Word Handler (Gives 80-Col & Lower-Case with no board1 iyy A LF3-V oiceM usic Bd. 199 Comp Stat Bothabove 599 BONUS SOFTWARE SECTION! Let us acquaint you with MESSAGE-MAKING SOFTWARE Just place the disk in the Records of files can be printed, if desired. Additional modules coming are a STATISTICS APPLE, enter the texi. and colorful, dynamic messages appear o r the screens of TV sets INTERFACE, CHECKBOOK, MAILING LIST 4 DATA-ENTRY. connected to the computer Use the soHware lo broadcast messages on TV screens in REQUIRES 48K. 4 ROM A P P LE S O FT ...... $40. schools, hospitals, factories, store window, exhibit booths, etc The following program is APPLE LITERATURE DATABASE: Allows rapid retrieval (via keywords) of references Irom our latest release total APPLE literature thru 1980, on 5.25 "disk. Each entry in the data base consists of the SUPER MESSAGE. Creates messages m lull-page “chunks" Each message allows article, author-name, periodicai-name. date of issue, & page nos. The database is statements ol mixed typestyles, typesizes and colors, in mixed upper and lower case intended to support large magazine files which would require lengthy manual searching Styles range from regular APPLE characters, up to double-size, double-width characters to recover information. Annual updates will be available with a heavy, bold font. Six colors may be used for each different typestyle. Vertical and REQUIRES 48K & ROM APPLESOFT. . . $60. horizontal centering are available, and word-wrap is automatic. Users can chain pages WORDPOWER Is a simple, powerful, low cost, line-oriented word processor program It together to make multi page messages. Pages can be advanced manually or automatical­ offers a fast machine language FIND & REPLACE. Text can ba listed to screen or printer, ly. Multi page messages can be stored to disc or recalled instantly with or without line-numbers. Lower-case adaptors are supported You can merge files, REOUIRES 48K & ROM APPLESOFT $50 move groups of lines, and easily add, change, or delete lines. WORDPOWER can be used APPLE PLOTS YOUR DATA 4 KEEPS YOUR RECORDS TOO! APPLE DATA GRAPH 2.1: to create and maintain EXEC files, it can also oe used as a rapid, unstructured, inlorma- Plots up to 3 superimposed curves on the Hi-res Screen both X & Y axes dimensioned. tion-storage and retrieval system via its

No. 52 - September 1982 MICRO - The 6502/6809 Journal 39 IMAGE PRINTER SERIES Sensible Software is proud to introduce our new series of high resolution screen dumps. IMAGE PRINTERS provide a simple way to transfer high resolution graphic images onto paper. Each pro­ gram in the series has unique features that give you full control of the printing. Some of the included options are: Full control over the area of the HIRES screen to be printed. You graphically pick the area for the utmost ease and accuracy. One-step printout of the picture with the ability to pause or abort the printing at any time. Menu-driven. All options are invoked with single keystrokes. IMAGE PRINTERS are extremely easy to use. Multiple image sizes, 6 different sizes for letter quality printers, 4 sizes for other printers. • Creation of an inverse (negative) image for reverse printing. The ability to save the compressed and inverse images to disk. One time configuring for your printer and interface card. Why answer all those questions about your printer each time you want to print a picture? • The images may be printed anywhere on the page. IMAGE PRINTERS support most popular interface cards, such as cards from Apple, California Compu­ ter Systems, Epson, and Mountain Computer. (The SSM AIO Serial Card and user-written 'driver' routines may be used with the letter quality printers.) There are three separate versions of IMAGE PRINTERS, each one tailored to take full ad­ vantage of a different printer. IMAGE PRINTER— LETTER QUALITY. For all popular letter quality printers (Diablo, NEC, Qume, etc.) IMAGE PRINTER— EPSON. For the popular Epson MX-70, MX-80 and MX-100. I MAGE PRINTER— N EC P08023A. For the NEC dot-matrix printer. All versions ore available for $40.00 ea. Please specify version desired.

Sensible Software 6619 Perham Drive Dept MO West Bloomfield. Michigan 48033 * (313) 399-0877 Visa and Mastercard W elcome Please add $1 25 postage and handling per diskette

40 MICRO - The 6502/6809 Journal No. 52 - September 198 68000 Instruction Set by Joe Hootman

Table t: Data Movement

Mnemonic Data Size/CCR Name Comments/Address modes and opcode Editor’s note: The author has compiled several detailed tables of 68000 instruc­ MOVEA 16, 32 Mare Moves the contents of the source to the CCR Address destination address register. Sign of word tions. This month's article offers a brief XNZ V c data is extended to 32 bits. introduction to the 68000, along with - -- -- table 1. We will publish more instruc­ Opcode Format tion tables in future issues, including 15 14 13 12 11 10 9876543210 those on addressing modes. Destination Source 0 0 Size Reg 0|0|1| Mode | Reg

All addressing modes can be used for the source Since its introduction, the Motorola Held. • MC68000 has set a trend for 16-bit MOVEM 16, 32 Move Designated registers may be moved to an that may become an CCR Multiple effective address. industry standard. One reason for the XNZ V c Registers 68000's quick success is the design Opcode Format philosophy Motorola used when the 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 68000 was conceived. Motorola wanted 0 1 0 0 1 direc­ 0 0 1 size Effective Addr. to give the 68000 a simple instruction tion Mode Reg. set, and a flexible set of addressing modes. They also wanted it to be com­ Register List Mask patible with 6800 peripheral hardware Direction: 0-register to memory, and to contain many programming fea­ 1-memory to register tures. The implementation of this Size: 0-word field, 1-long word philosophy allows 6800/6809 micro­ Post Increment Address Mode processor users to adapt easily to using 15 14 13 12 11 1C 9 8 7 6 5 4 3 2 1 0 both 68000 hardware and software. The instruction set, while compact, con­ A7 A6 A5 A4 A3 A2 A1 A0 D7 D6 D5 D4 D3 D2 D1 DO tains many special instructions that are Predecrement Addressing Mode unique to the 68000. These instruc­ 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 tions allow two different processing 3 states to exist in the 68000, as well as DO D1 D2 D3 D4 D5 D6 D7 A0 AI A2 A3 A4 A5 A7 movement of data from 6800 peri­ Predecrement Address modes cannot use pherals. Special arithmetic instructions Addressing modes: 1, 2, 4, 11, 12, 13, 14 * are also provided.

Post increment Address modes cannot use 68000 users can turn to several Address modes: 1, 2, 5, 13, 14 * references for help. The Motorola Users Manual1 is essential for every 68000 MOVEP 16, 32 Move Data is moved between data registers and user. An excellent book by L. J. CCR Peripheral memory. The high order byte of data bus is used X N ZV c Data when address is even; if address is odd the Scanlon2 explains the 68000 in detail, transfers are made to the low half of data bus. and provides excellent programming This instruction can be used to transfer data examples. The 68000 Microprocessor from 6800 devices. Handbook by G. Kane3 discusses char­ 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 acteristics and features of the 68000. 0 0 0 0 Data Op-Mode 0 0 1 Address Register Register

Special features of the 68000, which Displacement differentiate it from the 6800 series of microprocessors, are: Opmode: 100-Word from memory to register 101-Long word from memory to register 110-Word from register to memory 1. The data bus of the 68000 is 16 bits 111-Long word from register to memory wide. MOVEQ 32 Move Move 8-bit immediate data to a data register, CCR Quick with sign extension. 2. The 68000 is microprogrammed. XNZV c - • * 0 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 3. The 68000 is expandable. These ex­ 0 1 1 1 Register 0 Data pandable features will be defined by Motorola in the future. (ContinuedI

No. 52 - September 1982 MICRO - The 6502/6809 Journal 41 68000 FEATURE! Mnemonic Data Size/CCR Name Com ments/ Address modes and opcode 4. The 68000 will work with 6800 T MOVE from 16 Move from The contents of the status register is moved to parts, with a special software state­ SR CCR status the destination location. ment, and hardware for completing XNZ V c register the handshaking requirements. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Effective Address 5. The 68000 is capable of addressing a 0 1 0 0 0 0 0 0 1 1 Mode | Register large amount of memory. This instruction cannot use the following Address modes: 2, 10, 11, 12, 13, 14.* 6. The 68000 has a minimum number of instructions with a large number MOVE 8, 16, 32 Move data This instruction moves the contents of the of addressing modes. from source to the destination. XNZ V c source to - • • 0 0 destination 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 7. The 68000 is capable of supporting Destination (EA) Source (EA) multiple users. 0 0 Size Register | Mode Mode 1 Register 8. A supervisory state exists that is pro­ The size specifies the size of the data to be tected from access by the user. This moved. state is used to support the overhead for multiple-user hardware inter­ 01-Byte 10-Long word ll*Word rupts, and certain classes of user­ The effective address of the destination cannot generated errors and traps. use: 10, 11, 12, 13, 14* 9. The hardware architecture and soft­ The effective address of the source can use all the addressing modes except 13, 14. * ware of the 68000 will easily support higher-level languages such as ADA, MOVE to 16 Move The content of the source is moved to the Pascal, Fortran, etc. CCR condition condition code register. X V NZ c “"k 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * * * * These features indicate that the 1 Effective Address 68000 will exist in its present form, or 0 1 0 0 0 1 0 0 1 1 Mode ] Register | in a mildly modified form, for a signifi­ cant length of time. The expandable All addressing modes can be used except 13, 14* features of the 68000 will allow users to learn a machine, and develop soft­ SWAP 16 Swap This instruction exchanges the upper half of a ware and hardware, without fear of CCR register data register with the lower half of the data their work becoming quickly obsolete. X N z V c halves register. • • - 00 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

0 1 0 0 1 0 0 0 0 1 0 0 0 Register MOVE The addressing mode of this instruction is inherent. Table 1 displays the MOVE instruc­ EXG 32 Exchange This instruction exchanges the contents of two tions implemented in the 68000. These CCR registers registers. Hie exchange can take place between XNZV c any of the registers. instructions move data both inside the 15 1 4 1 3 12 11 10 9 8 7 6 5 4 3 2 1 processor from register to register, and from external RAM and external de­ Register Op-mode Register vices. The table indicates which bits 1 1 0 0 Number 1 Number are set in the USR with the completion Opmode: 01000-data registers of the instruction. The user part of the 01001-address registers status register is the lower eight bits of 10001-data and address registers the register; the system part is the up­ (bits 0-2 m ust be address register number} per eight bits. Motorola, in their in­ struction set, has chosen to refer to the LEA 32 Load The effective address is loaded into the user portion of the status register as the CCR effective specified address register. Condition Code Register (CCR). X N ZV c address

Register Effective Address A dash (—) in a bit location in­ 0 1 0 0 1 1 1 Mode | Register dicates that the operation has no effect on the bit. A * indicates that the opera­ This instruction cannot be used with the tion may alter the bit, depending on the following addressing modes: 1, 2, 4, S, 13, 14* data and operation. Note that all the PEA 36 Push The effective address is computed and the move operations except one do not set CCR effective long word is pushed onto the stack. the V or C bits; these bits can only be X N ZV c address set or cleared by an operation on data, 15 14 13 1211 10 9 8 7 6 5 4 3 2 1 0 or specific operations on the CCR. Effective Address 0 1 0 0 0 0 1 Mode | Register 0 1 0 The MOVE to CCR (move to condi­ This instruction cannot use the following tion code) can set or clear every bit in addressing modes: 1, 2, 4, 5, 13, 14 * the CCR. This instruction could be used •The Addressing Modes will be presented in future issues. to check on the state of the first four

42 MICRO - The 6502/6809 Journal No. 52 - September 1982 bits of a word, or to set or clear bits in structions is MOVE M [Move Multiple the incrementing of a register, LEA is the CCR. (The instruction could also Registers). This instruction allows the used with auto-incrementing or auto- be used to unstack the CCR from movement of the selected data registers decrementing addressing. memory.) to consecutive memory locations. It could be used to store the results of PEA (Push Effective Address) MOVE (MOVE data from source to multiple word arithmetic operations. pushes the specified address onto the destination) is a popular instruction For example, if the IEEE floating point stack. This instruction is used as the because it allows movement of data arithmetic standard is implemented, traditional push instruction. between data registers and address the registers would contain the various registers inside the 68000. It also components of the floating point num­ References allows the movement of data between ber. Note that because both data regis­ the 68000 and RAM. ters and address registers can be moved, 1. 16-Bit Microprocessor User's this instruction can be used to stack Manual, Third Edition. Prentice- MOVE and MOVE A (Move Address) the registers. Hall, Inc.; Englewood Cliffs, New are similar, except that MOVE A is the Jersey 07632. instruction reserved for moving data to MOVE P (Move Peripheral Data) is the address registers. That is, the used to move 8-bit data to the data 2. The 68000: Principles and Program­ destination register in the MOVE A in­ registers from memory, or transfer 8-bit ming, L.J. Scanlon, Howard W. structions are the address registers. The data from the data registers to memory. Sams and Co. Inc.; 4300 West 62nd MOVE instruction is generally used to This instruction, in conjunction with St., Indianapolis, Indiana 46268. move data to and from the data regis­ the proper hardware interface, allows ters. Proper coding results in the the transfer of data between the 68000 3. 68000 Microprocessor Handbook, G. MOVE A instruction. and 6800 peripheral parts. Kane, OSBORNE/McGraw-Hill; 630 Bancroft Way, Berkeley, Califor­ If you want to examine the status MOVE Q (Move Quick) allows the nia 94710. register to find out the state of the X, N, immediate movement of 8-bit data to Z, V, and C bits, as well as allowing the any designated data register. The sign checking of the interrupt mask, the of the data is extended to fill the 32 bits Professor Hootman can be contacted at the trace (T), and supervisor status, use the of the data register, thus the operation University of North Dakota, Dept, of MOVE from SR (Move from Status is always a long word operation. Some Electrical Engineering, University Station, Register) instruction. assemblers will use a MOVE Q instruc­ Grand Forks, North Dakota 58202. tion every time 8-bit data are to be One of the most powerful move in- moved. JMCftO

The SWAP (Swap Register Halves) is not the same as the previously discussed MOVE instructions, but it is Attention a data movement instruction. This in­ Z' S c o tc h \ struction will place the upper 16 bits of Software and the designated data register into the lower 16 bits of the designated data MEMOREX Hardware register. The lower 16 bits will be moved to the upper 16 bits of the regis­ \ferbatim. Manufacturers! ter. This instruction could be used to move data in a 32-bit register into a position to be tested by the CCR. maxell Have You Seen Our EXG (Exchange Registers) ex­ changes the contents of two registers Review s in Brief? using the full 32 bits of the two BASF registers. EXG will exchange data registers with data registers, address MICRO'S product review registers with address registers, and ad­ wabash department offers readers dress registers with data registers. This type of instruction, could move an ad­ Diskettes and all your media needs Our REGULAR prices are SPECIAL an easy-to-read and highly dress register to a data register to allow informative review of operations and testing of the state of CALL FREE 1800} 421-3957 current products. If you the address, while not destroying the C.O.D. charge cards accepted. contents of the data register. Excellent dealer program. would like your product(s) reviewed in MICRO, ask LEA (Load Effective Address) loads a for a list of our panel of specified address register with an effec­ tive address. LEA loads all 32 bits of the 1418 West Shaw Avenue qualified reviewers. You address register from memory. For ex­ Fresno. C A 93711 can contact them directly! ample, LEA cannot be used to load the address register from a data register. MOVE A can be used for this. LEA ef­ fectively increments or decrements the contents of a register. To implement

No. 52 - September 1982 MICRO - The 6502/6809 Journal 43 W t z a r d - S O S m ^ 3 H 9 0 2 7 ^ SERIAL OUTPUT BUFFER CARU THE TACKLER™ DUAL • MODE PARALLEL INTERFACE FOR Input a new task while your old task prints out THE APPLE* NO MORE DELAY 2 BOARDS IN ONE FOR NO MORE Apple software including COMPATIBILITY PROBLEMS! FOR SLOW PRINTERS Applesoft BASIC■, Integer An intelligent board to provide easy control of your printer's full potential. Plus a standard parallel W I Z A R D - S O B is a serial BASIC', CP/M. Pascal, etc. board at the flip of a switch - your assurance of compatibility with essentially all software for the printer interface that lets you ■ Fully compatible with most APPLE*. Hires printing with simple keyboard operate your Apple while data Apple II expansion boards. commands that replace hard to use software routines. No disks to load. Special features include from your previous operation ■ Low power consumption inverse, doubled, and rotated graphics and many text control features, available through easy is printing out. It ends waiting for cool reliable operation keyboard or software commands. while your printer prints. The ■ Leads soldered directly into It’s simple to print HIRES graphics from an APPLE computer with The Tackler from TYMAC. This is the first truly universal parallel interface! Plus the ROM W I Z A R D - S O B contains a board for reliable operation for your specific printer. Sophisticated intelligence when you need it, total compability that never lets you down. 16K byte “ character buffer” ■ Many formatting features. Change printers - no need to buy another board. Just plug in one of our that ma y be expanded to ■ Two-year factory replace­ ROM’S and you’re all set ROM’S available for Epson, C. Itoh, NEC, and Okidata - others available soon. 32K bytes of character buffer­ ment warranty You've asked us to make the TACKLER better than the others and we ing. It accepls data at the ■ RS-232 printer interface d M .______$15 9 .0 0 * Apple’s rapid transfer rate, compatible UPGRADEABLE PARALLEL PRINTER CARD stores the data and feeds it Backed by the world's # 1 A Universal Centronics type parallel printer board to your printer at the rate complete with cable and connector. This unique independent manufacturer of board allows you to turn on and off the high bit so the printer can accept. peripheral controllers that you can access additional features in many printers. Easily upgradeable to a fully intelligent ■ Fully compatible with all Available at all fine printer board with graphics and text dumps. Use Apple II and Apple II Plus* Computer Stores S249.00 with EPSON, C. ITOH, ANADEX, STAR-WRITER, NEC, OKI and others with standard Centronics computers Telephone (800) 854-8737 configuration. ______$ 1 3 9 .0 0 ■ Fully compatible with most (714) 850-1666 THE PERFORMER PRINTER FORMATTER BOARD for Epson, OKI, NEC 8023, CITOH 8510 provides resident HIRES screen dump and print formatting in firmware. Plugs into Apple slot and easy access to all inter fonts through menu with PR# command, ^'lUESPEH ll(ii:illl se with standard printer cards to add intelligence. $ 49.00 specify printer. ______Systems THE MIRROR FIRMWARE FOR NOVATION APPLE CAT II* SUBSIDIARY OF WESPERCORP The Data Communication Handler ROM Emulates syntax of an other popular AppleG Modem product with improvements. Plugs directly on Apple CAT II ■ Registered Trademark of Board. Supports Videx and Smarterm 80 column cards, touch tone and rotary Apple Computers, Inc. dial, remote terminal, voice toggle, easy printer access and much more. List $ 3 9.0 0 ______introductory Price $29.00 DOUBLE DOS Plus A piggy-back board that plugs into the disk-controller card so that you can switch select between DOS 3.2 and DOS 3.3. DOUBLE DOS Plus requires APPLE DOS ROMS.______$ 3 9 .0 0

NIBBLES AW AY II AGAIN! Ahead of ail others. AUTO LO AD 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. EXPANDED USER MANUAL . . . incorporates new Tutorials for .all levels of expertice; Beginners Flowchart for ‘where do I begin’ to ‘Advanced Disk Analysis' is included. TRACK/SECTOR EDITOR . . .An all new Track/Sector Editor, including the following features: Read, Write, insert Delete Search, and impressive Print capabilities! DISK DIAGNOSTICS . . . Checks such things as. Drive Speed, Diskette Media Reliability, and Erasing Diskettes. HIGHEST RATED . . . Best back up Program in Softalk Poll (Rated 8.25 out of 10). CONTINUAL UPDATES.. .Available from Computer Applications and new $ 6 9 .9 5 listings on the source. ______M r H. SEEL. S u p e r P I X h ir e s s c r e e n d u m p ------The Software package that will allow your printer to dump page 1 or page 2 of the Apple Hires screen horizontally or vertically. Use with EPSON* MX-80 with or without GRAFTRAX* Roms, MX-70 - OKI* Microline 80, 82, 83, 82A, 83A - C. ITOH* 8510 and NEC 8023A Requires Tymac Parallel Printer Board PPC-100 ... $24.95.______APPLE L IN K -A versitile modem utility that provides the Apple user the ability to transfer disk files and software over the phone. Only one package needed for full transfers. Compatable with all DOS file types. $59.00 ______(requires Hayes Micro Modem) ______THE APPLE CARD -Two sided 100% plastic reference card Loaded with information of interest to all Apple owners. $3.98 >*■■1 .I /MICRO-WARE DIST. INC. ; P-O. BOX 113 POMPTON PLAINS. N.J. 07444 Deaier ancj Distributor Inquires Invited. It P a y s to W rite for MICRO! MICRO Magazine is actively seeking articles to present to our unique audience of sophisticated computerists. We welcome contributions on any aspect of 6502/6809/68000 hardware and software. Send us your latest ready-to-key-in program!

Each issue of MICRO presents articles on a wide range of systems and topics. In addition, each issue includes a special feature. We are planning features on the following topics:

January-Math and Simulations February-Languages March-Printers April-Communications May-Wave of New Computers June-Operating Systems

If you’ve developed material relating to these subjects, w e’d like to see it! Send articles to the attention of the editorial department. We are con­ tinually looking for good articles and/or programs for the:

Atari, Apple, CBM/PET, VIC, 68000, 6809, and TRS-80 Color Computer.

Standard MICRO categories that may be included in any issue are:

I/O • BASIC Aids • Machine-Language Aids • Graphics Games • Applications • Programming Techniques • Utilities Programming Languages • Hardware

We are also interested in topics our readers feel are important. Send in your own feature suggestions!

MICRO is sold in computer stores and on newsstands all over the world! Publishing an article in MICRO means quick distribution of your ideas.

W e’re proud of the fact that MICRO’S circulation is growing by leaps and bounds. And, we pay as well as BYTE! Get a copy of our Writer’s Guide now!

Special Note to all MICRO authors: please begin sending your text as well as your programs in machine-readable format. This will enable us to edit the text with the help of word processing. Continue to include a printed text version as you include a printed program listing.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 45 FOR YOUR APPLE II Industry standard products at super saver discount prices

80 COLUMN SPECIAL AND NEW VIDEO DISPLAYS FOR APPLE II 5 MEGABYTE HARD DISK SMARTERM For Apple II. Supplied with controller. Use with CP/M, Apple DOS, & Apple Pascal ..... $1995 PARALLEL PRINTERS (Not to be confused with SU P R T E R M ) 51/4” DISK DRIVE Software switching from 80 to 40 and 40 to 80 NEC 8023 or C-ITOH 8510 characters. 9 new characters not found on the Use with standard Apple II disk controller. .$295 Apple keyboard. Fully compatible with CP/M* and (Virtually identical) Specifications: • 100 CPS dot Apple PASCAL*. With lowest power consumption matrix printer • 80 column print-136 characters 5V*” FLOPPY DISKS of only 2.5 watts. per line • Tractor/friction feed • 7 different print With hub rings.Boxof 10. (List: $345)...... $225 fonts included • 2K printer buffer • Proportional With other purchase ...... $19.95 spacing • Bit image graphics and graphic symbols. Without purchase ...... $23.00 SMARTERM EXPANDED CHARACTER SET 7" x 11" matrix with true decenders. Add to NEC 8023 or C-ITOH...... $495 16K MEMORY EXPANSION MODULE above...... $40 N E C 8023 or C-ITOH 8510 with The preferred 16K RA M Expansion Module from Parallel Interface and Ca b l e ...... $550 PROMETHEUS. Fully compatible with CP/M" and „ „ Combination SM A R T E R M and E P S O N 100 with Parallel interface Apple Pascal-. With full 1-year parts and labor BestBuy! EXPANDED CHARACTER SET ...... $749 warranty. (List: $169) ...... $75 and Cable Special at ...... $260 VIDEX, VIDEOTERM ...... $249 WORD PROCESSING SPECIAL VIDEX ENHANCER II...... $119 Z-80 CARD FOR YOUR APPLlh WITH WORDSTAR AND SUPERCALC! MICROSOFT SOFTCARD Do professional word processing on your APPLE. -j i M l r CENTRONICS COMPATIBLE With CP/M'and MBASIC. All necessary hardware and software included. Complete 80 column video display, enhanced PARALLEL INTERFACE (List: $399) ...... $289 character set, 16K memory board, Z-Card with From PROMETHEUS. For use with Epson, NEC, BestBuy!!! CP/M* software, Wordstar and word processing C-ITOH, and other printers. Fully compatible with software and SuperCALC. ADVANCED LOGIC SYSTEM CP/M* and Apple Pascal®. (List: $1,128)... .Special at $695 PRT-1, Only ...... $69 Z-CARD WithC-PM Has everything the Softcard has except MBASIC. GRAPHITTI CARD Works with Microsoft's disks too. from Prometheus! ExpandaRAM Prints HIRES page 1 or 2 from onboard firmware. Features: True 1:1 aspect ratio, prints emphasized (List $269)..... Special at $195 The only 128K RA M card that lets you start with 16K, 32K, or 64K of memory now and expand to mode, reverse mode, rotates 90 degrees... plus ALS SYNERGIZER the full 128K later. Fully compatible with Apple more. Compare all this with the Grappler. We think Pascal, CP/M1, and Visacalc. No Apple modifi­ you'll agree that this is the best graphics card on CP/M" operating package with an 80 column cation required. Memory management system in­ the market. Specify for use with EPSON, NEC- video board, CP/M- interface, and 16K memory cluded with all ExpandaRAMs. Disk emulators 8023, C-ITOH Prowriter, orOkidata. expansion for Apple II. Permits use of the full included with 64K and 128K versions. (List: $125) ...... $89 range of CP/M' software on Apple II. Includes SuperCALC. MEM-32 Two rows of 16K RAM S (List: $749) ...... $549 make a 32K RA M Card...... $209 SOFTWARE MEM-64 One row of 64K RAM. WORDSTAR ...... Special at $195 U-Z-80 PROCESSOR BOARD With DO S 3.3 disk emulator...... $299 SPELLSTAR ...... $125 (From Europe) M E M - 1 2 8 Two rows of 64K RA M S installed S U P E R C A L C ...... $175 Software compatible with Softcard and m a k e a 128K Card. D BASE II $525 ALS Software...... $149 With DO S 3.3 disk emulator...... $399 VISICALC...... $149 MEM-RKT 64K RA M Add-On-Kits- D B MA S T E R ...... $189 MICROSOFT + PREMIUM SYSTEM 64K Dynamic RAMS. Each ...... $125 Includes Videx Videoterm, Softswitch, Microsoft VISICALC Expansion Program All equipment shipped factory fresh. Manufacturers' warranties and Softcard, Microsoft and Z-80 Card, and for ME M - 1 2 8 ...... $75 included. Please add53.00 per product for shipping and handling. California: add % tax; BART Counties: / %. Osborn CP/M' Manual...... $595 M E M - P S L Pascal disk emulator for 6 6 12 M E M - 1 2 8 ...... $45 All items are normally in stock

JOYSTICK MODEMS FOR YOUR APPLE II P h o n e f a r Q u i c k • • HAYES Smartmodem ...... $229 Takes the place of two MICROMODEM II...... $279 S h i p m e n t ! Apple Paddle Controllers. From BM P Enterprises. Heavy duty industrial con­ [415)490-3420 struction and cable. Non-self centering. With ... And we ’ll be here to help after you polarity switches for consistent motion control. receive your order. Feel free to call the SGC (List: $59) ...... $39 Technical Staff for assistance.

MONITORS FOR YOUR APPLE VERSAcard FROM PROMETHEUS Four cards on one! With true simultaneous opera­ A M D E K 300G tion. Includes: (1) Serial Input/Output Interface, ( 1 8 M H Z Anti-Glare Screen) ...... $179 (2) Parallel Output Interface, (3) Precision Clock/ NEC 12” HIRES GR EEN ...... $179 Calendar, and (4) BSR Control. All on one card. SUPER SPECIAL! Fully compatible with CP/M- and Apple Pascal*. The m ail o rd e rspecialists SPECIAL 12” GR E E N MO N I T O R ...... $99 (List: $249) ...... $169 342 Quartz Circle, Livermore, CA 94550

46 MICRO - The 6502/6809 Journal No. 52 - September 1982 TM

Apple Slices

Listing 1 simplicity. I implemented this in my By Tim Osborn FIND routine (lines 9000-9060) by in­ crementing the record number (KEY) 0 A5 - " * 1 0 CDS - CHR? ( 4 ) until a free record was found or until I This month's Apple Slices presents a 20 PRIWT CD$"0PB* TE5T-FII2,U 00" searched 20 records. I recognize a free technique to quickly access records on 30 FOR J - 0 ID 500 record by NM$ being equal to NAM$ a random access file. This technique, 40 PRIWT CD?"WRITE TEST-FUJE,R"; J (NAM$ is set to null by the ADD called hashing, key-to-address trans­ 50 FOR I - 1 TO 6 routine before calling FIND), or by 6 0 PRIWT AS formation, or randomizing, converts a 7 0 NEXT NM$ being equal to " 0 ” . NM$ is null if user key into an address (or record 8 0 NEXT the record has never been used (this is number) where the record associated 9 0 PRIWT CDS “CLOSE T E S T -F T IZ " the way the file is initialized when with the key is stored. This key may be listing 1 creates the file) and NM$ is a customer number, part number, in­ equal to " 0 " if it was used at one time voice number, or anything that iden­ but is now available. The reason for a tifies the target record to the user. search the chain until the key of the different code for a once-used record is stored record matches the search that the program must continue to Hashing should be used where quick key. The disadvantage of this tech­ search up to 20 records, or until NM$ is random access is desirable. If the ap­ nique is that the chain must be equal to null (" to make sure the plication calls for a lot of sequential maintained and the overflow space new record is not a duplicate. If NM$ = processing, hashing will not be a good must be managed, which adds com­ “ ” , then I know a record with this design choice for data organization. In plexity. The advantage is that any same key could not have been stored situations where data is accessed by number of overflows can be sup­ further into the file. It would have been key in some undetermined order, ported as long as there is spare room stored here if it had searched this far hashing is at an advantage, because in the overflow area. before. If NM$ = " 0 ” , it is possible that most records can be found within a few this record was used when a record reads. Listing 2 is an example in which 2. Distributed overflow space: Instead with the new record's key was added name and address records are hashed on of using a separate overflow area, and the system had to look further into the name field. I will refer to the listing overflows are interleaved with nor­ the file at that time to find a free space. to help clarify some points and to pre­ mal records by setting aside some sent a practical example. records and designating them as If it finds a duplicate, the RC (return overflow. The advantage here is that code) is set to 3 and returns to the ADD An important consideration in the proximity of an overflow may subroutine. The ADD subroutine will hashing is dealing with collisions or allow it to be accessed without re­ display a message and return to the overflows. An overflow occurs when quiring additional head movement main menu (line 7034). If NM$ = " 0 ” , two or more keys in the key range gen­ of the random access device. For FIND saves the available record num­ erate the same address (home record) Apple owners this means that we ber in KY and sets RC = 2. This tells the within the address range. This can hap­ would attempt to store overflows on ADD subroutine to use KY instead of pen if there are as many variations in the same track as the home record. KEY as the available space. This is the key set as there are addresses to The disadvantage is that chain main­ necessary because the FIND subroutine store the data. For example, in my tenance adds complexity to the continues to increment KEY to search name and address retrieval system system. for a record with a null value in NM$. (listing 2), the file can hold up to a This process can be described as maximum of 500 records (a system 3. Open addressing: This technique follows (upon return to ADD): design constraint) and there are an in­ tries to store the record in the home finite number of names. Therefore, space first; if it is full, it stores the many names may be transformed into record in the next available space. 1. If R C =0, then KEY = the available the same address, creating overflow This method is easy to implement. space where we can store the new situations. As long as a sufficient amount of free record. space exists in the file, the record Some overflow handling techniques can be stored close to the home 2. If RC = 1, then 20 records were include: record. The disadvantage is that, searched and all were used. (ADD when the file begins to fill up, the will display a "FILE TOO FULL” 1. Overflow linked lists: A separate search time increases, as it takes message.) area of the file is set aside for longer to find an unused record. overflows. If an overflow occurs, it is 3. If RC = 2, then a previously used stored in the first available overflow After considering the various tech­ record was available. The value in space and chained off from the home niques available, I chose the open ad­ KY will be used as the available record. On a recall it is necessary to dressing technique because of its design space.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 47 4. If RC = 3, then the new record is a Listing 2 duplicate. |ADD will display a “DUPLICATE RECORD" error message.) 1 GOSUB 10000: RBt INITIALIZE THRIf 10 BIG - 15:FL - 500:CD$ - CHRS ( 4 ): DIM SVS(6) FIND can be forced to search more 14 PRINT CDS “OPEN TRST-FILE, L100" records by raising the value of BIG 15 m w r CDS 16 IF RC - 0 THHJ OTIO IS (which is currently set at 20). If BIG is 17 FOR J - I TO 3000: NEXT J:RC - 0 decremented, it is possible that 18 HOE : PRINT "(Q)UIT (A)DD" previously stored records will not be 20 INPOT “(CMAUGE (D)EUCTE (I)NQUIRE ";AS 30 IP AS - "A" THM OOSUB 7000: GOTO 16 found. I did some extensive testing 40 IP AS - "C" THM OOSUB 7200: GOTO 16 with random key values and found that 50 IP A$ - "D" TOM OOSUB 7500: GOTO 16 the “FILE TOO FULL" message was 60 IP AS - " I " TOM OOSUB 8500: GOTO 16 produced when the file contained ap­ 70 IF A$ - "Q“ TOM PRIOT CDS'CICSE 'TOST-FILE": END 80 GOTO 18 proximately 300 records with BIG set 5998 RBI at 20. The trade-off is between efficiency 5999 RBI ****OOMPOIB ADDRESS**** and space; the further you allow 6000 KEY ■ 0 6002 Ul - UN (KEYS) records to be stored from the home 6005 FOR I - 1 TO IN record, the lower the efficiency. The 6010 MDS - MIDS (KEYS,1,1) more you limit record storage to the 6015 FOR J - 0 TO 35 home record, the larger the amount of 6020 IP - TBU$(J) TOM KEY - KEY + (J * J / 3) :J - 35 6030 NEXT i NECT wasted space. 6050 KEY - KEY * KEY 6060 KEYS - SIRS (KEY) The other major consideration 6070 KEYS - HID$ (KEYS,2,3) when designing a hashing system is the 6080 KEY - VAL (KEYS) 6090 KEY - m r (KEY * .5) key-to-address transformation tech­ 6100 RETURN nique. This technique converts the 6448 RBt user key into a physical location for 6449 RBt ****WRITE RECORD**** 6500 PRIWT CDS; “WRITE TEST-FIUE , R“;KEY storage. All techniques transform the 6510 PRIOT NM$ key into a number within an order of 6520 PRIOT RDS magnitude that is the same as the 6525 PRIOT CTYS number of addresses (records). Then 6527 PRIOT ST$ 6530 PRnrr zps they multiply the intermediate result 6535 PRIOT TELS by a factor that limits the final result to 6540 PRIOT CDS the range of addresses available on the 6550 RETURN 6998 RSt storage device. 6999 RBt ****ADD RB30RDS**** 7000 FUSES - "ADD“:NRMS - "" 7005 GOSUB 8000: RBt (ST INPUTS 7006 SVS(l) - »t$iSV S(2) - HDS:SVS(3) - CWSiSVS(4) - ST$:SVS(5) - ZPS:SV S (6) - TELS 7007 KEYS - IMS In my system I chose a method 7010 GOSUB 6000: RBI 03MPOTE ADDRESS called center-squaring. This method in­ 7020 GOSUB 9000: RBt FIND AVAIL. RET volves taking the key value, converting 7025 FUCS - "* it into a number which can be squared, 7027 IP RC > 0 TOM PRIOT CDS 7030 IP RC - 1 TOM INVERSE : PRINT "FILE TOO FU Ii": NORMAL : RETURN squaring the number, stripping off as 7032 IP RC - 2 TOM KEY - KY many outer digits as necessary, and 7034 IF RC - 3 TOM INVERSE : PRINT "DUPLICATE RECORD": NOFMAL : RETURN multiplying by a factor to limit the ad­ 7035 IMS - SVS(l) :RD$ - SVS(2):CIYS - SVS(3):ST$ - SVS(4):ZPS - SVS(5)iTE dress to the valid range. My COM­ L$ - SV$(6) 7040 G36UB 65001 RBt WRITE RB33RD PUTE ADDRESS subroutine (lines 7050 RETURN 6000-6448) follows this sequence of operations. 7199 RBt ****OtANffi***** 7200 HOME : PRIOT "DO YOU WISH TO CHANGE TOE NAME?” 7210 INPUT “RH>Ur (Y)ES OR (N)O ”;AS 1. Line 6000 sets KEY to 0. KEY will 7220 IF AS - *N“ GOTO 7290 become the address of the home 7230 IP AS < > "Y* GOTO 7210 record — the first record where we 7235 INPUT "OLD NAME - “iNMS: IF NMS - "" GOTO 7235 will attempt to store a new name 7240 KEYS - NM$: GOSUB 6000: RBt COMPUTE ADDRESS 7250 HAMS - IMS: GOSUB 9000: RBt FIND RECORD and address record. 7260 IP RC - 1 TOM : INVERSE i PRINT "RECORD HOT FOUND": NORMAL : PRINT COS: RB1TJRN 2. Line 6002 finds the length of KEY$, 7270 IMS - "0" i GOSUB 6500: RBt 0EU5TE OLD RECORD 7280 INPUT "NW NMC - “:»t$: IF Wt$ - “" GOTO 7280 which holds the name associated 7282 KEYS - IMS with the new name and address 7284 GOSUB 6000: RBt COMPOTE NEW KEY record. 7286 GOTO 7330 7290 INPUT "NAME - ";NM$:KEY$ - Wt$: IF )M$ - "" GCTO 7290 7300 GOSUB 6000 3. Lines 6005-6030 convert KEY$ into 7310 NMS - (MS: GOSUB 9000: RBt FIND RECORD a number through table lookups and 7320 IP RC - I TOM INVERSE : PRIOT "RECORD HOT FOLND": NORMAL : PRINT store the accumulation in KEY. The CDS i RE1UKN (J * f / 3) expression in line 6020 7330 INPUT "CHANGE STREET? , (Y)ES OR (N)0 "jAS 7340 IF AS - *Y* TOM INPUT "STREET - ";RD$: GCTO 7360 helps insure that a number of the 7350 IP AS < > "N" GOTO 7330 proper magnitude is produced. (Continued)

48 MICRO - The 6502/6809 Journal No. 52 - September 19S; 4. Line 6050 squares KEY. Listing 2 (Continued) 5. Line 6060 converts KEY back to a 7340 IF AS - "Y" THBJ INPUT "STREET - ";RD$: GOTO 7360 string (KEYS). 7350 ip a$ < > "N" goto 7330 7360 INPUT "CHANGE CITY?, (Y)ES OR (N)O ";A$ 7370 IP AS - “Y" THBI INPUT “CITY - ";CTY$: GOTO 7382 6. Line 6070 takes out the second, 7380 IP A$ < > "N" anno 7360 third, and fourth digits, and stores 7382 INPUT "CHANGE STATE?. (Y)ES OR (N)O ";AS 7384 IP A$ - "Y" THEN INPUT "STATE - ";S T $: OCTIO 7390 them back in KEY$. 7386 IP A$ < > "N" GOTO 7382 7390 INPUT "CHANGE ZIP?, (Y)ES OR (N)O “;AS 7. Line 6080 converts KEY$ back to a 7400 IP A$ - *Y* THBJ INPUT "ZIP - "?A$: OOTO 7420 numerical value (KEY). 7410 IP A$ < > "N“ OOTO 7390 7420 INPUT "CHANGE TEL. NO?, (Y)ES OR (N)O ";A$ 7430 IP A$ - "Y" THBJ INPUT "TEL. NO. - “;TCU$: GOTO 7450 8. Line 6090 brings KEY within the 7440 IF A$ < > "N“ OOTO 7420 range of records on my file. When 7450 GOSUB 6500 listing 1 creates the file, it creates 7470 RETURN 7498 RB4 500 records, thus the factor of .5. 7499 REM * * * * nRT J7TE**** 7500 HOME 7510 INPUT "NAME - "jKEY$ It is important that a key-to-address 7515 SAMS - KEfS 7520 GOSUB 6000: RBI COMPUTE ADDRESS transformation method spread the 7530 OOSUB 9000: RBI FIND RECORD records throughout the file as evenly as 7540 IP RC - 1 THBJ INVERSE : PRINT “RECORD MOT FTXJND" i NOSMAL : PRINT possible to minimize overflows. The CD$: RETURN address generated should bear no rela­ 7550 K4$ - "0" 7560 OOSUB 6500: RBI WRITE RHDRD tion to the key, so that a key with a 7570 REIUOJ higher value may be stored below a key 7998 RIM with a lower value. This is often 7999 RBI ****GET INPOTS**** 8000 HOME necessary because applications have 8010 INPUT "NAME - ":NM$: IF tW$ - " “ OR NM$ - "0" GOTO 8000: RBt R many records with similar keys. If E5ERVED NAMES there is a relationship between the keys 8020 INPUT "STREET - ";FD$ and the addresses generated, it would 8030 INPUT "CITY - ";CIY$ 8035 INPUT "STATE - “;STS cause one part of the file to become 8040 INPUT "ZIP - ";ZP$ full; overflows will occur in great 8050 INPUT “TEL. NO.- “;TEL$ numbers. 8060 RETURN 8498 REM 8499 REM ****IM3UIRE**** I hope I have provided enough infor­ 8500 HOME : INPUT "NAME =■ " ;NAM$ mation to allow you to develop your 8505 KEY$ - NAM$ own hashing applications. If you don't 8510 GOSUB 6000: REM COMPUTE ADDRESS 8520 GOSUB 9000: RBI FIND RBOORD feel up to programming your own 8530 IF RC » 1 THBJ INVERSE : PRINT “RECORD NOT FOUND": NORMAL : PRINT system, listing 1 and listing 2 can be CD$: RETURN used as a quick-access address book. 8550 PRINT “STREET - “;RD$ Remember to run listing 1 first to in­ 8560 PRIWT "CITY - “;CTY$ 8565 PRINT “STATE - “;STS itialize the file. If you get the "FILE 8570 PRINT “ZIP - “;ZP$ TOO FULL" error message, then you 8580 PRINT “TEL. NO.» “rTELS may wish to bump up BIG, which is in­ 8590 PRINT itialized on line 10. This will slow 8600 PRINT “PRESS RETURN TO CONTINUE" 8610 GET A$ down access but will allow you to store 8620 RETURN more records. 8998 RBI 8999 REM ****FIND RB30RD**** 9000 J =■ 0:RC - 0 Otherwise, you can change listing 1 9010 IP J < > BIG GOTO 9020 to load more than 500 records. If you 9012 IF RC - 0 THEN RC - 1 : RETURN do, remember to change FL (file length 9014 RETURN : REM RC>2 — line 10) from 500 to the number of 9020 IF KEY > PL THEN KEY » 0 9030 PRINT CD$“READ TEST-FIUE,R",-KEY records you wish to load. Also change 9040 INPUT NMS,RD$,dYS,ST$,ZPS,TCLS the range multiplication factor from .5 9042 IP FUCS < > "ADD" THBJ GOTO 9050 to .xxx, where xxx is equal to the 9044 IF (#4$ - "0“ AND RC - 0 THHJ KY = KEY:RC » 2 : OOTO 9060 number of records you wish to load 9045 IF » SV S(l) THEN RC - 3 : RETURN 9050 IF NMS - NAMS THBJ PRINT CDS: RETURN (line 6090). If you plan to load more 9060 KEY - KEY + 1 :J - J + 1: GOTO 9010 than a thousand records, you will need 9998 RB4 to change the center-extraction from 9999 RBI ****BUILD T&HTK**** 10000 DIM TBL$(35) MID$ (KEYS,2,3) to MID$ (KEYS,2,4) 10010 FOR J = 0 TO 35: READ TOL$(J): NECT J or MID$ (KEYS,3,4). 10015 RETURN 10100 DMA “1 ", "2“ , “3“, “4“ , "5 “, "6” , “7“ , “8 “, “9 “, "0 ", "Q“, "W", "E ", "R", "T ", "Y", “U“, "I “, “O", “P ", “A", "S“, "D", “F ", “G", "H", “ J" , “K", "L ", “Z", "X", “C“, “V", “B“, “N", “M" Reference

1. Computer Data-Base Organization, by James Martin, Prentice-Hall, Englewood Cliffs, New Jersey. JMCftO

No. 52 - September 1982 MICRO - The 6502/6809 Journal 49 Three minutes to find that "just right" property.

Search through up to 3600 property listings with Real-Soft programs for Real Estate Agencies.

No need to flip through endless pages of listings to find that "just right" property. Simply have your client specify the price range, number of bed­ rooms, preferred geographical location, accept­ able house styles and up to 12 additional listing features. REAL-SOFT programs will find the right properties quickly and impressively giving you more time to view the selected properties and close the sale!

REAL-SOFT is an integrated set of computer pro­ grams designed specifically for real estate agency use. All routines are fully customizable to meet the requirements of virtually any agencies. Up to 10 different house styles, 12 different listing features and 16 different areas. Very easy to learn — in­ cluded is a complete set of practice data to experi­ ment with. Requires 48K Apple II, 2 disk drives and monitor. Printer is optional.

If printer is used a printout of selected properties can be output in only a few minutes for your client to view and discuss in detail.

Other useful routines in this powerful set of pro­ grams include a Property Availability Report, full Mortgage Amortization Tables (American OR Canadian method), and a Mortgage Compari­ son Analysis Report. Then use still another part of REAL-SOFT to estimate the replace­ ment cost of any listing (using local factors), or to estimate the mortgage amount that your client can qualify for!

Available at your local Apple dealer.

R E A L-S O F T Real estate software 1450 West Georgia Street, Vancouver, B.C. V6G 2T8

Apple II is a trademark of Apple Inc. Telephone (604) 669-2262

50 MICRO - The 6502/6809 Journal No. 52 - September 1982 AMPER-POS for the Apple

by Philippe Francois

This machine-language utility where: System Requirement extends Applesoft to include a A$ is the sub-string variable AMPER-POS is written in assembly POSition function similar to B$ is the string variable language and can be run on a 16K, 32K, P ascal’s. C% is the output integer variable or 48K system with either disk or cassettes. The $300 (768 decimal) ad­ 2. The second entry point finds the AMPER-POS dress has been chosen for ORG because other strings' occurrences and has the $300,$3FF memory range is avail­ requires: the simple format: able for short machine-language pro­ Apple II or Apple II Plus CALL 880 grams (see reference 2). with Applesoft in ROM or language card

Listing 1 To Pascal, there is a POS function that searches within the string variable 0 800 1 PAG 0800 2 TEXT for an occurrence of a character 0800 3 string matching the context of the 0800 4 *** *** 0800 5 . *** POSITION FUNCTION *** "pattern" variable PATTERN. The 0800 6 ; * * * (AMPER-POS) * * * value returned is an integer repre­ 0800 7 *** BY * * * 0800 8 ; * * * PHILIPPE FRANCOIS * * * senting the first character position 0800 9 ****** where the matching string is found. If 0800 10 0800 11 no matching string is found, the POS 0800 12 returns a value of zero that does not 0800 13 7 AMPERPOS IS AN APPLESOFT ROM ROUTINE FOR .FINDING OCCURENCES 0800 14 i OF A SUB-STRING "PATTERN" IN A STRING "TEXT" correspond to one of the allowable 0800 15 character positions in a STRING vari­ 0800 16 : ENTRY POINTS: 0800 17 able [see reference 1). 0800 18 y 1) FOR THE FIR ST OCCURENCE: 4 P (A $,B$,C % ) 0800 19 ; WHERE: 0800 20 ; A$-SUB STRING (PATTERN) PROGRAM POSITION; 0800 21 i B$"STRING (TEXT) VAR PATTERN, TEXT : string; 0800 22 ; Cl-PO SITIO N OF A$ IN B$ 0800 23 BEGIN 0800 24 ; IT RETURNS: PATTERN: = ’pal'; 0800 25 j A) ZERO IN C% IF A$ IS NOT IN B$ 0800 26 I B) TOE FIR ST CHARACTER POSITION WHERE TEXT: = 'So long,pal.." 0800 27 ; TOE MATCHING STRING A$ IS FOUND IN BS WRITELNf'Position of ’,PATTERN,’ 0800 28 0800 29 f 2) CALL 8 00 FOR W E NEXT OCCURENCES OF A$ IN B$ in ',TEXT,' = ’,POS (PATTERN, 0800 30 TEXT)); 0800 31 7 0800 32 t AMPERPOS USEAGE END. 0800 33 • 0800 34 BEGINL EPZ $00 EFFECTIVE STRING BEGINNING 0800 35 BEGINH EPZ BEGINL+$01 This function fails in Applesoft, so 0800 36 M EPZ BEGINH+$01 "PATTERN" LENGTH you need to write a short machine rou­ 0800 37 N EPZ M+$01 "TEXT" LENGTH 0800 38 PTRL EPZ N+$01 PTRL,H IS A POINTER tine, AMPER-POS, which gives the first 0800 39 PTHH EPZ PTRL+$01 TO TOE STRING ADDRESS occurrence of PATTERN in TEXT, but 0800 40 INDICJ EPZ PTRH+S01 STARTING POSITION IN TEXT 0800 41 FLAG EPZ IN DICJ+501 IF PATTERN IS FOUND IN TEXT also gives the other occurrences (if any). 0800 42 TOEN FLAG-1 0800 43 ELSE FLAG-0 0800 44 : APPLESOFT USEAGE The Routine 0800 45 0800 46 XSAV EPZ $46 0800 47 VALTYP EPZ $11 0-NUMBER FF*STRING AMPER-POS was designed to find 0800 48 CHKOPN EQU $DEBB CHECK TOE " ( " the occurrences of a sub-string A$ in a 0800 49 CHKCLS EQU $DEB8 CHECK THE " ) " 0800 50 CHKCOM EQU $DEBE CHECK TOE " , " string B$. There are two entry points: 0800 51 ERROR EQU $DD76 "MISMATCH" ERROR 0800 52 CHRGET EQU $00B1 0800 53 PTRGET EQU $DFE3 READ A VARIABLE AND FIND IT IN 1 . The first entry point finds the first 0800 54 • MEMORY (ON EXIT W E ADDRESS TO occurrence of A$ in B$ and has the 0800 55 ? TOE VALUE OF W E VARIABLE IN A,Y) format: 0800 56 . 0300 57 ORG $300 0300 58 (Continued) & P ( A$,B$,C% )

No. 52 - September 1982 MICRO - The 6502/6809 Journal 51 Entering AMPER-POS Listing 1 (Continued) 0300 60 To enter the program, type in the 0300 61 hex codes or instructions from the 0300 62 0300 63 source listing with an assembler. To 0 3 0 0 64 save the program, type: 0300 65 VERIFY " P ( 0300 66 0300 67 BSAVE AMPER-POS OBJ,A$300, 0300 C9D0 68 CMP #"P'* 0302 F003 69 BEQ *+5 L$BC (for disk) 0304 70 PAG 0304 4C76DD 71 JMP ERROR 0307 20B100 72 JS R CHRGET 300-3BCW (for cassettes) 030A 20BBDE 73 JS R CHKOPN i CHECK THE " ( " 030D 74 030D 75 030D 76 SEARCH "PATTERN" Theory 030D 77 030D 78 030D 20E3DP 79 JS R PTRGET Suppose we want to find the first in­ 0310 E611 80 INC VALTYP 0312 F003 81 BEQ STRG1 VALTYP EQUAL ZERO, IT I S A STRING stance of the pattern string PAT­ 0314 4C76DD 82 JMP ERROR TERN (1)... PATTERN (M) in the target 0317 83 0317 8504 84 STA PTRL string TEXT( 1)..TEXT(N),M = N. 03 1 9 8405 85 STY PTRH (PATTERN(I) denotes the Ith character 031B A000 86 LDY #$00 031D B104 87 LDA (P T R L ), Y of PATTERN.) An obvious approach is 031F 8502 88 STA M to align PATTERN with the leftmost M 0321 C8 89 I MY 0322 B104 90 LDA (P T R L ), Y characters at TEXT and start matching. 0324 8500 91 STA BEGINL When a mismatch occurs, shift PAT­ 0326 C8 92 INY 0327 B104 93 LDA (PTRL),Y TERN right one character and restart 0329 8501 94 STA BEGINH matching from its first position. Con­ 032B 95 032B 96 tinue until either PATTERN matches 032B 97 REWRITE THE SUBSTRING "PATTERN" AT PATTRN ADDRESS or there are no more characters to 032B 98 032B 99 match in TEXT. 032B A0FF 100 LDY #$FF 032D C8 101 LABELl IMY 032E B100 102 LDA (BEGINL),Y The following algorithm that we 0330 99BA03 103 STA PATTRN,Y use in the AMPER-POS program is the 0333 C402 104 CPY M 0335 D0F6 105 BNE LABEL1 formal version of what has just been 0337 106 described (see reference 3 for more 0337 2 0 BEDE 107 JS R CHKCOM 033A 108 details): 033A 109 033A 110 SEARCH "TEXT" 033A 111 INTEGER i,j,m,n; 033 A 112 STRING pattem (l:m ),text(l:n); 0 3 3 * 20E3DP 113 JSR PTRGET 0330 E 6 U 114 TNC VALTYP i; = j: - 1; 033F F003 115 BEQ STRG2 DO WHILE i < = m AND j < = n; 0341 4C76DD 116 JMP ERROR 0344 117 STRG2 t IF pattem(i) = text|j) THEN 0344 8504 118 STA PTRL DO/*keep matching*/ 0346 8405 119 STY PTRH 0343 A000 120 LDY l$00 i: = i + l;/*bum p pattern position*/ 034A B104 121 LDA (PTRL),Y j: = j + l;/+and text position*/ 034C 8503 122 STA N 034E C8 123 INY END 034F B104 124 LDA (PTRL} fY ELSE 0351 8500 125 STA BEGINL 0353 ca 126 INY DO/* backtrack*/ 0354 B104 127 L0A (PTRL), Y j: =j + 2<-i; 0356 8501 128 STA BEGINH 0358 129 i := l ; 0356 20HEDE 130 JSR CHKCOM END 035B 131 035B 132 END 035B 133 SEARCH OUTPUT VARIABLE 035B 134 0351 135 035B 20E3DF 136 JSR PTRGET Program Logic 0358 A611 137 LDX VALTYP 0360 P003 138 BEQ TNT 0362 207600 139 JSR ERROR Here is a synopsis of the program 0365 140 PAG logic: 0365 141 0365 8504 142 STA PTRL 0367 8405 143 STY PTRH Lines 64-143 retrieve the parameters 0369 144 0369 20B8DE 145 JSR CHKCLS from the statement. Applesoft 036C 146 ROM routines are used to reduce the 036C 147 036C 148 RESOLVING length of the program. 036C 149 036C 150 036C 151 Ii-REG. X Lines 152-194 translate the precedent 036C 152 Jt-REQ. Y algorithm. Take the X and Y registers 036C 153 036C A900 154 LDA *900 INDXCJi-0 for the I and J indexes, but because AB­ 036E 8506 155 STA INDICJ SO LUTE^ and INDIRECT, Y address­ 0370 156 0370 157 ing begin with the zero value for X and 0370 158 SECOND ENTRY POINT. CALL (ON ADDRESS+S63) Y, the algorithm has been slightly 0370 159 (Continued, modified.

52 MICRO - The 6502/6809 Journal No. 52 - September 198S Lines 200-216 put the result of the Listing 1 (Continued) search in the output variable (zero if 0370 *200 161 LDX *900 f li«0 ; Jt-INDICJ the search is unsuccessful). 0372 8607 162 STXFLAG 0374 *406 163 LDY INDICJ 0376 164 1 Lines 221-225 prepare the INDICJ 0376 165 BEGINi 0376 166 t variable for the next searching. 0376 E402 167 CPX M r DO WHILE I<«M AND J<-N 0378 P027 168 BEQEND r 037* C403 169 CPY N j See figure 1 for an example, of how 03 7C P023 170 BEQ END i to use AMPER-POS. 0378 B100 171 LDA (BEGINL),Y i 0380 DDBA03 172 CMP PATTRN,X r IP PATTERN(I)"TEXT(J) 0383 D00E 173 BNE LABEL2 r 0385 *507 174 LDA FLAG r IP FLAG-0 THEN 0387 D006 175 BNE LABELS t 0389 A901 176 LDA •901 j DO If you save a name "SMITH” , an 038B 8S07 177 STA FLAG r FLAG3*1 address "31ST AV NY” , and a phone 038D 8406 178 STY INDICJ j INDICJi-J 038P 179 » I END number ”333 444 555”, on a mailing 038P 180 t ELSE sequential file, you can use the se­ 038? 181 » DO quence shown in figure 2. 038P E8 182 LABKL3 I NX t I»-I+l 0390 ce 183 INY > Jt-J+1 0391 184 * END 0391 D083 185 BNE BEGIN r 0393 ca 186 IABEL2 INY t ELSE 0394 8646 187 STXXSAV j DO Figure 2 039638 188 SEC t Ji-J+2-I 0397 98 189 TYA p r i n t ••*************" 0398 E546 190 SBCXSAV t 10 039* A8 191 TAY 20 PRINT " * EXAMPLE 2 * " 039B A200 192 LDX •$00 r I*-l 30 PRINT **************” 039D 8607 193 STX FLAG FL A G 1*0 4 0 PRINT 039P 194 ; END 50 D$ = CHRS ( 4 ) 039? P0D5 195 BEQ BEGIN j 6 0 PRINT D$"OPEN MAIL" 03*1 196 ? END 70 PRINT D$"WRITE MAIL" 03*1 197 00 PRINT "SMITM": 03*1 198 ------03*1 199 END OP ALGORITO 03*1 200 ------PRINT "31ST AV N .Y." 03*1 201 PRINT "333 444 5555" 03*1 202 END* 03*1 A 5 0 7 203 LDA FLAG 90 PRINT D$"CLOSE MAIL" 03*3 0004 204 BNE LABEL4 ; IP FLAG-0 THEN 03*5 A9FP 205 LDA ♦ $FF i INDICJ:-0 03*7 8506 206 STAINDICJ : 03*9 207 03*9 208 IABEL4 03*9 A506 209 LDA INDICJ ; ELSE 03*B 210 PAG 03 *B 18 211 CLC 7 INDICJs*INDICJ+l 03 *C 6901 212 ADC • $01 But because it is better to have only 03 AE 213 03 AE 214 one PRINT statement, we concatenate 03 *E 215 PUT INDICJ IN OUTPUT VARIABLE the three strings, separated with a . 03 AE 216 03 AE 217 The statement 40 becomes: 03 AE A001 218 LDY • $01 03 B0 9104 219 STA (PTRL),Y 03B2 220 40 A$ = “SMITH!31 st AV NYI333 444 03 B2 221 5 5 5 !” 03B2 222 FOR NEXT OCCURENCE : INDICJ:-INDICJ+M 03B2 03B2 i s 224 CLC and statement 80 becomes: 03 B3 A506 225 LDA INDICJ 03B56502 226 ADCM 03 B7 8506 227 STA INDICJ 80 PRINT A$ 03B9 60 228 RTS 03BA 229 03BA 230 PATTRN so that figure 3 will look like: 03 BA 231 o 1 03BA 233 ROOM FOR A "PATTERN" STRING UP TO 15 CHARACTERS U J Bn 03C9 235 DFS 15 03C9 236 03C9 237 STOP: Figure 3

10 PRI{JT •■ ************* n Figure 1 20 PRINT " * EXAMPLE 3 ■•*************" 30 PRINT "************* n 4 PRINT TAB( 14) 4 0 A$ = "SM IT H 131ST AV 5 PRINT TAB( 14) " * EXAMPLE 1 * " 6 PRINT TAB( 14) »*************" N .Y.1333 444 55551" 10 PRINT CHR5 (4 )"BLOAD AMPER-POS.OBJ" POKE 1 0 1 4 , 0 : POKE 1 0 1 5 , 3 : REM FETCH THE AMPERSAND 20 50 D$ = CHR$ (4) 30 A$ = " I " : B$ = " TO I S 11 S 1 A 1T E S T " 60 PRINT D$"OPEN MAIL" 40 S, P(A$,B$,PO%) 70 PRINT D$"WRITE MAIL" 50 GOSUB 1 0 0 8 0 PRINT A$ 6 0 CALL 8 8 0 : GOSUB 1 0 0 9 0 PRINT D$"CLOSE MAIL" 70 I F PO% < > 0 THEN 6 0 8 0 END 9 0 REM PRINTING SUBROUTINE 100 I F PO% = 0 THEN PRINT : PRIN T "NO (OR NO MORE) OCCURENCE OF <“ ; A $ ;" > " : RETUftN 110 PRINT : PRINT "THERE I S AN OCCURENCE OF <“ ; A $ ; “ > IN < " ; B $ :" > AT THE ":P O % ;'"M P O S IT IO N ": RETURN . . , „ „ , And to re-read the three values we use (Continued on next page) the program in figure 4.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 53 References Figure 1 (Continued) 1 . Microcomputer Problem Solving with Pascal, Kenneth L. Bowles, Springer-Verlag, NY. THERE I S AN OCCURENCE OF IN AT THE 5TO POSITION

2. BASIC Programming Reference ■MERE I S AN OCCURENCE OF IN AT THE 8TH POSITION Manual: Applesoft II, Apple Com­ THERE I S AN OCCURENCE OF IN AT TOE 10TH PO SITIO N puter Inc. NO (OR NO MORE) OCCURENCE OF <1> 3. Data Type and Structures, C.C. Gotlieb, Leo R. Gotlieb, Prentice Hall Inc.

4. "A Comparison of Three String- Figure 4 Matching Algorithms," G. de V. Smit, Software Practice and Ex­ perience, Vol. 12, No. 1. 10 D$ = CHR$ ( 4 ) 15 PRINT D$”BUDAD AMPER-POS .OBJ" 16 POKE 1 0 1 4 , 0 : POKE 1 0 1 5 , 3 : REM LOAD & VECTOR 20 PRINT D$"OPEN MAIL" 30 PRINT D$"READ MAIL" 40 INPUT B$ 50 PRINT D$"CIjOSE MAIL” 6 0 A$ = “ 1 “ 70 S. P(A$,B$,P0») 80 NA$ =■ MID$ (B$ , 1, PO% - 1 ):J = PO» + 1 The author may be contacted at 90 CALL 880: AD$ =■ MID$ (B$,J,PO% - J):J = PO% + 1 C.N.R.S./L.I.S.H., 31, Chemin Joseph 100 CALL 880:PN$ = MID$ (B$,J,PO» - J) Aiguier, 13277 Marseille Cedex 9, France.

JM C ftO

RAPHTRIX'" 1.3, EDITRIX NEED HARD COPY OF YOUR APPLE CAN YOU SEE WHAT YOUR HI-RES GRAPHIC? WORD PROCESSOR WITH IS GOING TO PRINT? GRAPHTRIX™ 1.3 fi WITH YOU CAN ^ EDITRIX INSERT YOUR YOUR TEXT WILL GRAPHIC BE DISPLAYED ANYWHERE AS IT IN YOUR IS TO BE TEXT. PRINTED, USE ANY OF UP TO 19 PRINTERS 220 COLUMNS AND Insert Graphics, 10 INTERFACE CARDS Footnotes, Superscripts Data Transforms Inc. 616 Washington, Suite 106 or Different Type Fonts Denver, Colorado 80203 Anywhere In Your Text (303) 832-1501 These Features Plus Many More Features: Graphic Magnification, Are Right At Your Fingertips With Normal/Inverse, Page Centering, EDITRIXT“ High and Low Crop Marks, Title String, From Superscript, Footnotes, Chapters, Fully Data Transforms Inc. 616 Washington, Suite 106 Menu Driven REQUIRES: Apple II with 48K. Applesoft Denver, C olorado 80203 (303) 832-1501 in ROM, One Disk Drive with DOS 3.3. REQUIRES: Apple II with 48K, Applesoft in ROM, DOS 3.3 and the GRAPHTRIX 1.3 Matrix Graphics System. Apple is a Irademarti o( Apple Computet Inc. Apple a a trademark of Apple Computer Inc c Copyright 1982 Data transforms Inc. All Rights Reserved. (c) Copyright 1982 Data Transtoims. inc. All Rights Reserved GRAPHTRIX is the Trademark ol Dola Transforms Inc , a division ol Solarstahcs Inc ( AND GRAPHTRIX are the tiodemarts of Data Transforms Inc.. o division ol Salorstotics Inc.

54 MICRO - The 6502/6809 Journal No. 52 - September 1982 U ersa Com puting

PRESENTS

VersaWriter DRAWING TABLET

COMPLETE HARDWARE / SOFTWARE GRAPHICS SYSTEM - $299 • Hi-Res & Med-Res Draw • Color Fill-In • Split / Full Screen • Paint Brush-5 Sizes • Change Color Hue & Intensity • Save / Load / Erase • Point to Point / Line Draw • Reverse Picture • Text Writer • Air Brush • Scaling • Fix X or Y Axis Requires: Atari ^300, 32K RAM, Basic Language Cartridge, Disk Drive GRAPHICS COMPOSER GLOBE MASTER PADDLE / JOYSTICK COMPLETE HI-RES GRAPHICS SOFTWARE - $39.95 GEOGRAPHY GAME - $29.95 • Draw on Hi-Res Screens 7 or 8 • 8 Hi-Res Color Maps • Save Pictures on Disk or Cassette • U.S.-Europe-World-Asia-Africa-Australia • Create Player / Missile Shapes • Countries-Cities-Capitals-Oceans- Automatically Rivers-Mountains, Etc. • Geometric Figures Program • Several Skill Levels Requires: Atari®800, 32K RAM, Basic Language Cartridge, • Add Text to Screen Disk Requires: Atari®800, 32K RAM, Basic Language Cartridge, Disk or Cassette ATARI ®is a registered trademark of Atari Inc. MIND BOGGLERS THREE STRATEGY GAMES

• Capture CASSETTE $15.95 DISK $19.95 • Mystery Box Requires: Atari®400, 16K RAM, Cassette • Simon Says Atari 800, 24K RAM, Cassette or Disk I Uersa Computing,knc 3541 Old Conejo Road, Suite 104 Newbury Park, CA. 91320 (805)498-1956

No. 52 - September 1982 MICRO - The 6502/6809 Journal * r f .

AiOt^' o te^

\d^ + uX fiYc>CcP 4&*'

' f t * * t *|J®X 6 <*«4'^rfJ'9 4 < V * ’‘ * ^ .**>■

0 ? = ? . ^

c.jd1 . M° OS'4* •jjjf®5 £ < * « $ & $ * ■ xe Axi&‘ \ ,MO .vfAe vot6 - .'CP..'CP \ cjpf> vd^ ( •v -.<© cJP5 *

^ P t r f * ve* f \ jp ' ■^Odfc*

A e ^ V ,e i - <*S<® d a " vql* $.®t- t^v ' .^T^'

'< > ? > < & * * 6809 Macros for Structured Programming

by Hal Clark

This article presents a technique Listing 1 for using assembler macros to ************************************************************************* allow structured assembly- * * * TITLE - MACRO.X09 * language programming. The * AUTHOR! HAL CLARK * examples presented are for the * ON-GOING IDEAS * * RD#1 BOX 810 * 6809, but they can be easily * STARKSBORO, VT 05487 * modified for other processors. * * ************************************************************************* ************************************************************************* Structured Macros * * PROG A MACRO TO DEFINE THE BEGINNING OF A PROGRAM requires: * IT NAMES THE PROGRAM FOR THE LINKER AND * JUMPS TO THE LABEL . 6809-based machine with * macro assembler * EX. PROG TEST * May be adapted to other ************************************************************************* PROG MACR PNAME processors NAME PNAME JM P B E G IN ENDM Structured program development is PAGE defined as top down programming. *************************************************************************

When using this approach, the main PARM - A MACRO TO PUSH PASSED PARAMETERS ONTO THE SYSTEM body of the program is developed first, STACK. THE TYPE IS EXPECTED TO BE BYTE r WORD* REF t then each succeeding level is developed OR REG * until the total program is finished. ************************************************************************* When the program is entered into the BYTE EQU 1 WORD EQU 2 computer, it is usually entered in the REF EQU 3 same, top down, fashion. REGA EQU 1 REGB EQU 2 REGD EQU 3 The newer structured languages, R'EGX EQU A such as ADA, Pascal, and Modula, re­ REGYEQU 5 quire that constants, variables, and pro­ REGU EQU 6 PARMMACRO VALUE»TYPE cedures/functions (] be IF N A R G .E Q .l defined before use, thus giving the IFVALUE.EQ.REGA ZZZPOSSET Z Z Z P 0 5 + 1 following program structure: PSHS A ELSE PROGRAM name IF VALUE.EQ.REGB ZZZPOS SET Z Z Z P 0 S + 1 CONSTant definitions PSHS B VARiable definitions ELSE IF VALUE.EQ.REGD FUNCTION definitions ZZZPOSSET Z Z Z P O S + 2 PROCEDURE definitions PSHS D main program ELSE IF VALUE .EQ.REGX ZZZPOSSET Z 2 Z P 0 S + 2 BASIC and machine language, how­ PSHS X ever, do not require that constants, var­ ELSE IF VALUE.EQ.REGY iables, or subroutines be defined before ZZZPOSSET Z Z Z P O S + 2 use. Neither BASIC nor machine lan­ PSHS Y ELSE guage requires program structuring. A IF VALUE.EQ.REGU lack of program structuring often re­ ZZZPOSSET Z Z Z P O S + 2 sults in an excessive use of memory PSHS U ELSE and an unreasonable amount of time ERROR INVALID ARGUMENT devoted to debugging, and customer ENDIF ENDIF support. ENDIF ENDIF Pascal is a highly strucutred lan­ ENDIF ENDIF (Continued on next page) guage that allows the systematic

No. 52 - September 1982 MICRO - The 6502/6809 Journal 57 development of computer programs. Listing 1 (continued) These programs are easy to debug and modify due to their structure. Unfor­ tunately, not all applications can afford ZZZPOS SET ZZZPOS+1 the overhead in memory usage and ex­ LDB VALUE PSHS B ecution speed that many versions of ELSE IF TYPE.EQ.l Pascal require. The most transportable ZZZPOS SET ZZZPOS+1 versions of Pascal compile the source LDB VALUE code into some form of intermediate PSHS B ELSE code, usually called P-code, which is IF TYPE.EQ.WORD then interpreted each time the program ZZZPOS SET ZZZPOS+2 is run. LDD VALUE PSHS D ELSE The macros presented in this article IF TYPE.EQ.2 ZZZPOS SET ZZZPOS+2 allow structured development of LDD VALUE machine-language programs. Programs PSHS D developed using these macros appear to ELSE IF TYPE,EQ.REF be a combination of Pascal and in-line ZZZPOS SET ZZZPOS+2 assembly language. By using macros, TFR U'D ADDD ♦VALUE the structure of Pascal may be combined PSHS D with the execution speed and memory ELSE efficiency of assembly language. ERROR INVALID ARGUMENT ENDIF ENDIF These macros generate machine ENDIF ENDIF code for the Motorola 6809 CPU. They ENDIF are designed to be used with the Micro­ ENDIF tek 6809 cross-assembler, which is END* PAGE written in FORTRAN and available for ************************************************************************* most computers. The version used in * * CALL - A MACRO TO CALL A SUBROUTINE WHILE PASSING UP TO * the examples is running on a Digital * SIX PARAMETERS* EACH PARAMETER MUST BE ENCLOSED * Equipment Corp. PDP 11/34. * WITH < > AND CONTAIN THE PROPER TYPE. * * EX. CALL TEST»» BYTE> * * * Although these macros generate in­ ************************************************************************* structions for a specific micro­ CALL MACRO DEST»P1»P2»P3»P4 »P5»P6 processor, the ideas behind their design ZZZPOS SET 0 IF NARG.GT.1 may be used to develop similar macros PARM PI for other processors. Even if a macro IF NARG.GT.2 PARM P2 assembler is not available, the ideas IF NARG.GT.3 presented here can be used in machine- PARM P3 language programs to increase reliability IF NARG.GT.4 PARM P 4 and decrease development time. IF NARG.GT . t* PARM PS Implementation IF NARG. GI * 6 p.2) PM f>6 ENDIF In this section we shall discuss the ENDIF ENDIF actual implementation of the macros, ENDIF as well as some other aspects of struc­ FI HD I F tured programming not required by the ENDIF JSRDEST use of the macros. IF ZZZPOS LEAS Z Z Z P O S * s ENDIF Macros, while allowing the program ENDM to have a structure similar to Pascal, do PAGE ************************************************************************* not actually require the same format PAIR. * grams are easier to understand with '■ EX. VAR » * that structure, so all the examples will ************************************************************************ use it. 7 VAR MACRO LBL»SIZE LBL RES SIZE ENDM The Stack Machine * VAR MACRO T1»T2*T3»T4»T5*T6 IF N A R G . G E . l These macros and programs written ZVAR T l using the macros define the 6809-based ENDIF computer as a stack-oriented machine. IF NARG.GE.2 ZVAR T2 The 6809 makes this implementation ENDIF easy because of its two stack registers IF NARG.GE.3 and many addressing modes that allow ZVAR T3 ENDIF stack access.

58 MICRO - The 6502/6809 Journal No. 52 - September 198; Listing 1 (continued) All data in the system, except for IF NARG.GE.4 constants and variables defined in the ZVAR T4 ENDIF main body of a program, aie stored on IF NARG.GE.5 the stack. Each procedure or function ZVAR T5 has the capability of receiving up to six ENDIF IF NARG.EQ.6 passed parameters each time it is used. ZVAR 16 Procedures and functions also have a ENDIF ENDM reserved area on the stack for their own PAGE use while active. When a procedure or ************************************************************************* function is finished, the area on the * * * CON A MACRO TO DEFINE PROGRAM CONSTANTS* UP TO SIX * stack is given up so that the next * CONSTANTS MAY BE DEFINED AT ONCE USING THE STANDARD * subroutine may use it. This keeps the * PAIR DEFINITIONS» * amount of "dedicated-all-the-time, * * * EX. CONS ? » * used-some-of-the-time'' memory to a * * minimum. Use of the stack also avoids +************************************************************************ 7C0NS MACRO LBL»VAL the problems caused by using a com­ LBL EQU VAL mon variable at the wrong time. ENDM * CONS MACRO Tl»T2 T1»T2p ?T3»T4*T5»T£ T3»T4 * T3 Register Usage IF NARG.GE.1 ZCONS T l The Motorola 6809 has five 16-bit ENDIF IF NARG.GE .2 registers, two 8-bit registers, and one ZCONS T2 16-bit that may be used as ENDIF IF NARG.GE.3 two 8-bit accumulators. The registers ZCONS T3 and their function within the defined ENDIF stack machine follow: IF NARG.GE.4 ZCONS T4 ENDIF 16-bit IF NARG.GE.5 ZCONS T5 PC — program counter. Points to the ENDIF next instruction to execute, and is IF NARG.EQ.6 only modified by the jump to sub­ ZCONS 16 ENDIF routine, return from subroutine, and ENDM the various branch instructions. PAGE ************************************************************************* * S — system stack pointer. Must be LCONS - A MACRO TO DEFINE PROCEDURE CONSTANTS* UP TO SIX initialized at the start of a program. CONSTANTS MAY BE DEFINED AT ONCE USING THE STANDARD PAIR DEFINITIONS* THESE CONSTANTS ARE This register should not be changed VALID ONLY FOR THE LIFE OF THE PROCEDURE* by the user program as it contains the necessary information to switch be­ EX. LCONS »p tween subroutines. ************************************************************************* ZLCONS MACRO LBLpVAL LBL SET VAL U — user stack pointer. Data that is ENDM passed to a called subroutine may be * found in this stack, and is referenced LCONS MACRO T1pT 2 pT3*T4»T5pT6 IF NARG.GE.1 by an offset from this register. The ZLCONS T l value stored in U should never be ENDIF IF NARG.GE.2 changed by the user; the macros ZLCONS T2 CALL and RETURN will alter U as ENDIF necessary. IF NARG.GE.3 ZLCONS T3 ENDIF X — a general purpose register IF NARG.GE.4 ZLCONS T4 available to the user program. This END IF register is saved and restored by the IF NARG.GE.S macros. ZLCONS T5 ENDIF IF NARG.EQ.6 Y — a general purpose register ZLCONS T 6 ENDIF available to the user program. This ENDM register is saved and restored by the PAGE macros. ************************************************************************ * PROC - A MACRO TO DEFINE PROCEDURE (SUBROUTINE) ENTRY POINTS * 8-bit COMPLETE WITH UP TO SIX PARAMETERS. NOTE IF DEFINED * WITH X PARAMETERS EACH CALL MUST USE X ALSO. * * DP — direct page register. Unused by NOTE 1. THESE PARAMETERS ARE REFERENCED BY »U * the stack machine. IF THE PROCEDURE NEEDS TEMPS THEY SHOULD BE * ALLOCATED USING THE LVAR MACRO. * * CC — condition code register. This 2. REGS X & Y ARE AUTOMATICALLY SAVED * contains flags pertaining to the ************************************************************************* results of the last instruction. This (-"PAR MAf'RD l.BL . SIZE (continued) register is not saved by the macros.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 59 Accumulator D (A and B) Listing 1 (continued) LBL SET ZZZPOS Accumulators A and B are each 8 ZZZPOS SET ZZZPOS+SIZE bits. Accumulator D is 16 bits, con­ ENDM sisting of the A and B accumulators. * SAVE EQU 1 These registers are considered tem­ porary and will be modified by the F:‘R(JC hACRU NA» FI»F2 1 F3 rFAtF 5 »F6 stack machine whenever a sub­ NA EQU * PROCEDURE NAME Z77FNC SET 0 TELL RETURN NO PARMS TO PASS routine is called. 77ZENV SET 0 ZZZSAV SET 1 IF NARG.GT.1 PASSING PARAMETERS ? Reserved Symbols PSHS U»X»Y YES - SAVE X»YrU RESET S LEAU AtS ZZZENV SET 1 SHOUTHAT THEY MUST BE CLEANED The following symbols are re­ 777P0S SET 4 FROM THE STACK. stricted to reference only, and must not IF NARG.GT.2 be redefined by the user's program: IF NARG.GT.3 [F NARG.GT.4 BYTE used to represent a length of 8 IF NARG.GT.5 bits. IF NARG.GT.6 FPAR f 6 ENDIF WORD used to represent a length of FPAR F5 ENDIF 16 bits (2 bytes]. FPAR F4 ENDIF REF used when passing parameters FPAR F3 ENDIF between subroutines. FPAR F2 ENDIF REGA used to pass the machine FPAR FI ELSE NO PARAMETERS PASSED - SAVE X*Y register A. PSHS X r Y ENDIF ZZZPOS SET -4 REGB used to pass the machine ENDM register B. PAGE ************************************************************************* FPROC - A MACRO TO DEFINE PROCEDURE (SUBROUTINE) ENTRY POINTS REGD used to pass the machine COMPLETE WITH UP TO SIX PARAMETERS. NOTE IF DEFINED registers A and B. WITH X PARAMETERS EACH CALL MUST USE X ALSO.

NOTE - 1. THESE PARAMETERS ARE REFERENCED BY .U REGX used to pass the machine IF THE PROCEDURE NEEDS TEMPS THEY SHOULD BE register X. ALLOCATED USING THE LVAR MACRO. 2. REGS X % Y ARE NOT SAVED REGY used to pass the machine ************************************************************************* register Y. FPROC MACRO NA»F1 >F2*I 4.F5.F6 NA EQU * PROCEDURE NAME 2Z7FNC SET 0 TELL RETURN NO PARMS TO PASS The Macros Z77ENV SET 0 ZZZSAV SET 0 NOT SAVING REGS X.Y The following paragraphs describe IF NARG.GT.1 PASSING PARMS? PSHS U YES - SAVE U the available macros, their uses, calling LEAU OrS NO - DO NOTHING parameters, and an example. ZZZENV SET 1 THAT THEY MUST BE CLEANED Z77.P0S SET 4 FROM THE STACK. IF NARG.GT.2 PROG xxxx IF NARG.GT.3 IF NARG.GT.4 PROG: This macro expects one para­ IF NARG.GT.5 meter that will name the program. The IF NARG.GT«6 FPAR F 6 macro causes a jump to the symbol BE­ ENDIF GIN, which should be placed on the first FPAR F5 line of the main body of the program, ENDIF FPAR F4 ex. PROG TEST ENDIF FPAR F3 ENDIF CALL xxx, ,..., FPAR F2 ENDIF CALL: Performs the jump to sub­ FPAR FI routine xxx after all the optional passed ENDIF ZZZPOS SET 0 parameters are placed on the stack, ENDM PAGE ex. CALL COPY, , ************************************************************************ < TO, WORD > , < LEN, B YTE > FUNC - A MACRO TO DEFINE FUNCTION (SUBROUTINE) ENTRY POINTS COMPLETE UITH UP TO SIX PARAMETERS. NOTE IF DEFINED VAR ,..., WITH X PARAMETERS EACH CALL MUST USE X ALSO. BY DEFINITION A FUNCTION RETURNS A SINGLE VALUE. VAR: Defines variables that will be used NOTE - 1. THESE PARAMETERS ARE REFERENCED BY .U throughout the program, not just with­ IF THE FUNCTION NEEDS TEMPS THEY SHOULD BE in subroutines. ALLOCATED USING THE LVAR MACRO. ex. VAR ,< TEMPI, 2 . REGS X * Y ARE SAVED. WORD> ************************************************************************* FUNC MACRO NA. F I »F2. F3>F4, F5>F6 CONS ,..., NA EQU * FUNCTION NAME

60 MICRO - The 6502/6809 Journal No. 52 - September 1982 CONS: Defines constants that will be Listing 1 (continued) used throughout the program. 7ZZFNC SET 1 TELL RETURN NO PARMS TO PASS ex. CONS ,< FALSE,0>, ZZZENV SET 0 ZZZSAV SET 1 < MAYBE,3 > IF NARG.GT.1 PASSING PARAMETERS ? PSHS Ut X»Y YES - SAVE X»Y»U RESET S LEAU 4 ? S LCONS ,..., ZZZENV SET 1 THAT THEY MUST BE CLEANED LCONS: Defines local constants that ZZZPOS SET 4 FROM THE STACK. I f NARG.GT.2 are used within the current subroutine IF NARG.GT.3 definition only. IF NARG.GT.4 IF NARG.GT.5 ex. LCONS , IF NARG.GT. 6 FPAR FA ENDIF PROC xxx, < PI,TP>,..., FPAR F5 ENDIF PROC: Defines a procedure (sub­ FPAR F4 routine) . PROC must be followed by a ENDIF RETURN before the next PROC or FPAR F3 ENDIF FUNC macro usage, xxx gets assigned FPAR F2 to the entry point of the procedure. The ENDIF FPAR FI parameters P1-P6 get assigned as offsets ELSE NO - SAVE X»Y on the stack to allow referencing of the PSHS X » Y passed parameters at execution, ENDIF ZZZPOS SET -4 ex. PROC COPY, , ENDh < OUT, WORD > , < LEN,BYTE > PAGE ************************************************************************ FUNC xxx, ,..., * * FFUNC - A MACRO TO DEFINE FUNCTION (SUBROUTINE) ENTRY POINTS FUNC: Defines a subroutine that * COMPLETE WITH UP TO SIX PARAMETERS. NOTE IF DEFINED returns a value (function). This macro, * WITH X PARAMETERS EACH CALL MUST USE X ALSO. * BY DEFINITION A FUNCTION RETURNS A VALUE. like PROC, must be followed by the * RETURN macro before the next FUNC * NNOTE 0 T E - 1. THESE PARAMETERS ARE REFERENCED BY .U or PROC macro is used. The name xxx * IF THE FUNCTION NEEDS TEMPS THEY SHOULD BE * ALLOCATED USING THE LVAR MACRO. is assigned to the entry point of this X subroutine and the labels P1-P6 are * 2 . REGS X I Y ARE NOT SAWED * assigned as offsets to the stack for ac­ ********************* *************************************************** - cess to the passed data during execu­ FFUNC MACRO NA»F1f F2 > F3 f F4»F5f F6 tion. The results of the function are NA EQU * FUNCTION NAME 7.7 ZFNC SET 1 TELL RETURN NO PARMS TO PASS returned in machine register D. Z7ZENV SET 0 ex. FUNC SQR, ZZZSAV SET 0 NOT SAVING REGS X.Y IF NARG.GT.1 PASSING PARMS? PSHS U YES - SAVE U LVAR ,..., LEAU 0»S NO - DO NOTHING ZZZENV SET 1 THAT THEY MUST BE CLEANED LVAR: Defines up to six local variables ZZZPOS SET 4 FROM THE STACK. at one time. These variables can only IF NARG.GT.2 IF NARG.GT.3 be referenced within the definition of IF NARG.GT.4 this defining subroutine. Subroutines IF-' NARG.GT.5 IF NARG.GT.A called from within defining sub­ FPAR F6 routines may reference these variables ENDIF only if passed to the subroutine as a call FPAR F5 ENDIF parameter. LVAR, at this time, requires FPAR F4 parameters to be passed to the defining ENDIF subroutine to function properly, FPAR F3 ENDIF ex. LVAR , FPAR F2 ENDIF FPAR FI ENDIF RETURN data ZZZPOS SET 0 ENDM RETURN: Ends the previous FUNC- PAGE tion or PROCedure definition. It ************************************************************************ removes temporary variables as well as * passed parameters from the stack, re­ * LVAR A MACRO TO DEFINE TEMPORARY VARIABLES FOR A PARTICULAR stores the saved registers, and returns * PROCEDURE OR FUNCTION. THE TEMPS ARE ALLOCATED ON THE * SYSTEM STACK AND ARE REFERENCED BY ,U. THESE to the calling program. If the RETURN * VARIABLES ARE DISTROYED UPON EXIT OF THE PROCEDURE. is from a function, it also places the * * EX. returned value in the machine register D. * LVAR . ex. RETURN RESLT (from a function) * * LDD T2.U ex. RETURN [from a procedure) * * ************************************************************************* DPAR MACRO LBL.SIZE The author may be contacted at On-Going ZZZPOS SET ZZZPOS-SIZE Ideas, RD #1, Box 810, Starksboro, LBL SET ZZZPOS Vermont 05487. ENDM (continued)

No. 52 - September 1982 MICRO - The 6502/6809 Journal 61 Listing 1 (continued) 1 M hz - 12 Bit A/D for your Apple II Computer * LVAR MACRO V1'V2'V3'V4'V5'V4 The APPLESC0PE-HR12 analog to digital converter uses IF ZZZENV.EG.0 a high stability buried zenervoitage reference and a flash ZZZENV SET -1 A/D to give 12 bit accuracy with a 14 bit dynamic range. PSHS U • DC to t Mhz Programmable Sample Rate LEAU 0'S • 2046 Sample Butter Memory ZZZPOS SET 0 • Pretrigger Viewing ENDIF • Continuous or Single Sweep IF NARG.GE.X • 4 Channel Software Support DPAR VI (requires additional power supply) IF NARG.GE.2 • External Trigger Input DPAR V2 The standard software provided w ith each APPLESCOPE- IF NARG.GE.3 HR 12 includes all of the functions necessary to turn your DPAR V3 Apple II computer into a high quality digital storage IF NARG.GE.4 oscilloscope. InadditionalloftheSCOPEDRIVERoptions DPAR V4 are being up-graded to handle the higher resolution data. IF NARG.GE.5 DPAR V5 Price per cnannei $698 IF NARG.GE. 6 DPAR V6 The original APPLESCOPE still provides the optimum ENDIF price /pe rform a nce trade oft for those users requiring 8 bit ENDIF converter resolution. ENDIF ENDIF APPLESCOPE INTERFACE ENDIF ENDIF LEAS ZZZPOSfU ENDH PAGE

************************************************************************ RETURN - A MACRO TO DEALLOCATE PASSED PARAMETER STACK SPACE UPON THE COMPLETION OF A FUNCTION OR PROCEDURE.

NOTE- FUNCTION WILL RETURN A VALUE IN REGA OR REGD THIS VALUE IS SPECIFIED IN THE RETURN CALL. * * • OC to 3.5 Mhz sample rate EX. RETURN »W0RD * • 1024 byte buffer memory * • Pretrigger Viewing ******************************* ***************************************** • Programmable Scale Select RETURN MACRO VAL»TYPE • Continuous and Single Sweep Modes IF ZZZFNC•EQ•X FUNCTION RETURN? • Single or Dual Channel Trace IF NARG.EQ.O YES - BUT NO PARMS

62 MICRO - The 6502/6809 Journal No. 52 - September 198 r ^ Listing 1 (continued) A harvest of SET 0 IF ZZZENV . LT . 0 LEAS 0 1 u savings from PULS u IF ZZZSAV PULS X>Y ENDIF ELSE IF ZZZENV,GT.O IF ZZZSAV LEAS -4 »U Apple*]jPTbee PULS c X -< ELSE LEAS 0'U PULS U Electronics ENDIF ELSE IF ZZZSAV SOFTWARE PULSX»Y APPLE. ATARI- TRS80 ■ IBM ENDIF ENDIF A fall line of software for business, games ENDIF and education up to 35% off! RTS ENDM MUSE KJS PAGE V1SICORP STONEWARE ************************************************************************ ON LINE SYNERGISTIC * * * RECORD DEFINITION MACROS * EDG-WARE HAYDEN * * HOWARD AND MANY MORE t************************************************************************ RECORD MACRO ZZZPOS SET 0 HARDWARE ENDM AMDEK. HAYES • MICROSOFT FIELD MACRONAME'SIZE NAME EQUZZZPOS List Our Price ZZZPOS SET ZZZP0S+SIZE ENDM 32K RAM card $293.00 $205.00 RECSIZ MACROSIZE Video Term $345.00 $279.00 SIZE EQUZZZPOS Lazer P rod u cts ------20% off------ENDM PAGE DISKS *********************************************************************** Maxell Box of 10,514", SS-DD $35.00 TABLE GENERATION HACROS Verbatim Box of 10, 5'A" , SS-DD $29.00 EACH TABLE MUST CONSIST OF: TABLE - TABLE HEADER (1) TABDTA - TABLE DATA ENTRIES (N) MONITORS TABSIZ - TABLE LENGTH AND END MARKER (1) LE MONITORS List Our Price *********************************************************************** $189.00 $159.00 TABLE MACR 9” Green ZZZTBL SET 0 \2" Green $199.00 $169.00 ENDM * ZENITH 12" Green $179.00 $129.00 TABDTA MACR VALUE t TYPE IF TYPE.EQ.BYTE Plus a full line of AMDEK Monitors DATAVALUE ZZZTBL SET ZZZTBL+1 PRINTERS ELSE IF TYPE.EQ.WORD PAPER TIGER List Our Price AC0N VALUE ZZZTBL SET ZZZTBL+2 460G $1,094.00 $950.00 ELSE 560G $1,394.00 $1,250.00 ERROR UNSPECIFIED DATA TYPE EPSON ENDIF ENDIF MX 70 $449.00 $395.00 ENDM MX80FT $745.00 $595.00 * MX I00FT $945.00 $795.00 TABSIZ MACRSIZE SIZE EQUZZZTBL CALL FOR THIS MONTHS SPECIAL ! DATA ♦FF ENDM PAGE 1-800-835-2246 EXT. 211 OR ************************************************************************* * * 702-452-5589 STORE A STRING

No. 52 - September 1982 MICRO - The 6502/6809 Journal 63 computer mail order wes hs utr...... $24.00 Hunter...... Ghost Mouskattack $25.00 Climber...... Canyon Jawbreaker...... $27.00 rtco...... $24.00 Protector...... Star Raiders Star Asteroids...... $29.00 Missile Command Missile ars...... $32.00 M of Cevems $35.00 Centipede...... $35.00 PAC-MAN...... nhrMoe ...... $79.00 ...... odem M Anchor oainAut ...... $239.00 ...... to u A Novation A Hayes 830Modem 82S Printer...... $589.00 822 Printer...... $269.00 CX85316K RAM...... $77.95CX85316K 810 Drive Disc 410 Recorder...... $76.00 X0JyStc...... $18.00 tick...... CX40S Joy $169.00 850 Interlace...... 820 Printer...... $259.00 ...... $159.00 t...... a C hoorp...... $199.00 Chronograph...... $169.00 t...... a DC $309.00 100...... Micromodem $279.00 ...... I I Micromodem art...... $239.00Sm T elecommunications 2 ... . . 32K 8 ... . . 48K 6 ... . . 16K HOT ATARI _ ATARI HOT ...... $31.00 ...... $159.00 ...... Modems GAMES GAMES ...... 400 s389 s489 s269 JK $39.00 $449.00 ATARI A

$29.00 8 Euao...... $130.00 Educator...... 482 8 rgamr...... $49.00 Programmer...... 483 One warranty...... $70.00 year extended 48KBoard...... $219.95 Intec $119.95 RAM...... 32K Microtek 8 omnctr...... $344.00 484 Communicator...... $69.00481 Entertainer...... Intec 32K...... $119.95 Intec (128K)...... $429.95 Ramdlsk $74.95 ...... RAM 16K Microtek Kstar Patrol...... $39.00 Kstar $39.00 K-razy Antics...... K-razyKritters...... $39.00 ut...... $39.00 O Krazy Shoot ARCADE ACTIONFROM YOUR ATARI JOYSTICK oo ...... $699.00 I I Color oo I...... $429.00 III...... Color $339.00 ...... I Color 300G...... $169.00 BMC 12" Green...... 12" BMC eih "Gen...... $119.00 "(Green)...... Zenith9 ROMCARTRIDGE GAMES 8 s769 . . 48K . 2 s724 . s649 . 32K . . . 16K . FOR YOUR ATARI MONITORS KBYTE TC TN ®.STICKSTAND B AMDEK i _ aim OTHERS 800 0OO' $009 ...... $85.00

810. read models drive dual and ORY PRICE! Will Atari for written disk! disks read all the of sides both 800/400.single Atari Both the ial, da ds die for drive disk dual a Finally, the ith w patable com peripheral pl I ad vn a sm fea Apple. the some on has found not even tures and II Apple adae sfwae and are softw Hardware, 7073 ...... $2399.007710/7730 ...... B10...... $179.00 JB-1201...... 02...... $549.00 8012...... 5033 ...... $1789.003510/3530 ...... 03 ...... $549.00 ...... 8023 C10 ...... $899.00JC-1202 ...... $349.00JC-1201...... A 8001- 01 ...... $749.00 ...... 8031 64KComputer Personal PEtiQOM l o frbe i !! e ric p t es b for now all C FRANKLIN CALL FOR INTRODUCT­ ...... $749.00 ...... ACE 1000ACE NEC COMPUTERS MONITORS PRINTERS

o p t r al re eas order mail computer Commodore Business Machines CBM 6 4 ...... CALL 4032 ...... $969.00 3096 Upgrade K it...... $369.00 Super Pet...... $1599.00 2031 $529.00 8250 Doubled Sided Disk Drive...... $1699.00 HP»85 s1969 D9060 5 Megabyte Hard Disk...... $2399.00 D9090 7.5 Megabyte Hard Disk...... $2699.00 HP«87...... $1799.00 8050 ...... $1299.00 H P*125...... $1999.00 4040 ...... $969.00 HP*85 16K Memory Module ...... $169.00 Word Pro 5+ ...... *319.00 8300 (Letter Quality)...... $1799.00 5Y4” Dual Master Oise Drive ...... $1799.00 Word Pro 4 + ...... $299.00 8023 ...... $769.00 Hard Disk wI Floppy ...... $4349.00 Word Pro 3+ ...... $199.00 4022 ...... $499.00 Hard D isk...... $3549.00 The Administrator...... $379.00 Pet to IEEE Cable...... $37.00 "Sweet Ups” Plotter...... $1199.00 InfoPro P lus ...... $219.00 IEEE to IEEE Cable...... $46.00 80 Column Printer ...... $649.00 Power ...... $79.00 Tractor Feed for 8300...... $240.00

H E W L E T T mW U K tim 2 1 P A C K A R D Televideo VIC 20 - \ HP 41CV Terminals CALCULATOR s239 910 ...... $579 $239 912C ...... $699 VIC 1530 Commodore Datassette ...... $69.00 I 920C ...... $749 VIC 1540 Disk Drive...... $499.00 I 925C ...... $749 VIC 1515 VIC Graphic Printer...... $339.00 I 960 ...... $939 VIC 1210 3K Memory Expander...... $32.00 I HP 41C...... $189.00 VIC 110 8K Memory Expander...... $53.00 I HP 11C...... $79.00 | 16K VIC Expansion...... $94.00 I HP 12C...... $114.00 802...... $Call I VIC 1011 RS232C Terminal Interface...... $43.00 I NEW 15C...... $119.00 802H ...... $Call I VIC 112 VIC IEEE-488 Interface ...... $86.00 I NEW 16C...... $125.00 816 ...... $Call | VIC 1211 VIC 20 Super Expander ...... $53.00 I HPIL PERIPHERALS IN STOCK! 806 ...... $Calt VIC Mother Board...... $99.00 I CITOH Smith-Corona EPSON TP-I PRINTERS —. PRINTERSI $649 MX 80 w/Graftrax ...... $449 F10-40CPS...... $1439.00 MX 80 FT III...... CALL F10-55CPS...... CALL MX 100...... CALL Prowriter...... $499.00 Letter Quality ADA 1600 Parallel Printer to CBM ...... $119.00 ATC-1 Parallel Printer to A tari ...... $29.00 ADA 1450 Serial Printer to CBM ...... $139.00 I Daisy Wheel AP-80 Apple Parallel Card & Cable ...... $69.00 ATC-2 Serial Printer to A tari ...... $29.00 I IBM-1 Parallel Printer to IBM ...... $32.00 AP-S10 Apple Serial Card & Cable...... $95.00 12 CPS Text Printer

In-stock items shipped same day you call. No risk, no deposit on C.O.D. orders. Pre-paid orders OKIDATA receive free shipping within the CENTRONICS continental United States with no PRINTERS waiting period for certified checks PRINTERS 82A ...... $489.00 or money orders/All prices shown 739-1 ...... $519 83A...... $729.00 are cash prices. Add 3% for 739-3 ...... $619 8 4 ...... $1099.00 Mastercard and Visa. NV and PA 2 Meter RS232-RS232 Cables ...... $29.95 NOTE residents add sales tax. All items - ALSO - All of the above OKIDATA Printers come equiped Diablo 630 Special...... $1799.00 subject to availability and price with both parallel ports & RS232 Serial ports. Talley 8024 L ...... $1629.00 change. IDS Prism...... CALL

8 0 0 - east 477 E. THIRD ST. IN PA Williamsport CALL PA 17701 (717)327 9575 ^ FLEX/UniFLEX \ DISK II SOFTWARE CABLES (long replacements up to 20 feet) THE TOTAL

These NON-shielded cables are replacements, NOT SYSTEM extensions, and are tested seven different ways to insure reliability that can’t be acquired with extensions. These cables are available in one foot increments up to 20 feet long. Price varies with the length you require. The most STAND ALONE SOFTWARE popular length is four (4) feet long at $25.95. Add $1.50 VENDOR PROGRAM INVENTORY i ,[) SINGLE f NTRy I i DGEH per foot for additional length. (Shorter cables available PUHCHASF OROfcH INVtNTORY ( IVT.hi 11 *.ic f ui “ i I CHECK BALANO H also). flCCTS PAYABU. M F 1 (f xtunvw Mf() P Q | COSTING .-4 hSTlMAIING CUSTOMER PROGRAM HUl K MAILINGS CHURCH CON THIEUj TlON PKG 0R0ER FROM: OHDEH ENTRY MAINTENANCE SCHfcOUlfc CHURCH SC HI') Ol Fill. LING Master Manufacturing • Calif, residents add6 'h% sales tax ACCfS HFCFlVABlF DA f A HAST MGR FUND RAISING 14319 E. S w ift Drive • C.O.D. orders add $2.50 PAYROL I DATA BASF i Utili i CUSTOM PROGRAMMING La Mirada, CA 90638 • Sorry, no charge cards GENERAL LEDCFR INQUIRE ABOUT OUR COlOR COMPUTFH SOI T'.VARfc (213) 944-1069 • Dealer A distributor inquiries invited

• AUTO REPEAT" INTRODUCING SOFTWARE for rev 7 & later ...... $19.95 DATA BASE MANAGER ...... 1 1 5 0 °° , • lower case EPROM C H U R C H C O N T R IB U T IO N P K G ...... M 5 0 °° OTHER \ lor rev 7 & later ...... $24.95 S IN G L E E N T R Y L E D G E R ...... *9500 M ASTER MFG. \ • HANGMAN PROOUCTS FOR THE I .

USERS!

READ m m m

The Unofficial OSI Users Journal

THE WORLD WIDE PUBLICATION EXCLUSIVELY DEDICATED TO OSI USERS!

□ Hardware Mods. □ Peeks and Pokes □ Bugs and Fixes □ Software Exchange □ Software Reviews

SEND $15.00 FOR 12 ISSUES TO: PEEK (65) P.O. BOX 347, OWINGS MILLS, MD 21117 (301) 363-3267

Maryland Subscribers Add 5%Tax Inquire for Foreign Rates

66 MICRO - The 6502/6809 Journal No. 52 - September 19£ Market Projection Program for the Color Computer

by Leonard I. Suckle

This sophisticated business either a conscious or subconcious hesi­ The total of all columns of data will program is implemented on an tation in the modification of data to be calculated upon request. Further­ inexpensive Color Computer provide more realistic interpretation of more, a top-down summation value system. It may be modified for the market conditions of the future. may be entered for TAM and NSB, and other computers. the difference between the actual and The intentr of this computer pro­ top-down summations will be dis­ Market Projection gram is to alleviate the tedious calcula­ played. Upon request, the computer tion and recalculation associated with will adjust the TAMs and NSBs, based requires: revisions. With the capability of making on product mix, so they equal the top- TRS-80 Color Computer changes and seeing theii immediate down value. with 16K effect on the rest of the data, more ac­ It does not require Extended curate decisions may be made in in­ Entering and working with two Color BASIC dustry planning functions. years of data at a time allows you to make projections and/or calculate The introduction of low-cost personal compound growth rates. Data from one computers has placed the capability of The market projection computer year may be projected by annual com­ huge computational powers within the program evaluates a market and share pound growth rate (96) to the other year economic reach of nearly everyone. of the market by year and by each of in memory. Select any of the nine para­ Unfortunately, many of the lower- many product categories. The market meters for projection. Calculations will priced systems are being promoted or parameters evaluated for each of the be done either on a product category received as either toys or games. product categories are shown in table 1. basis or for all product categories. If The computer refers to each of these data is entered for both years, the com­ The program described in this arti­ parameters by their item # (1 through puter can calculate the growth rate of cle is an example of how the Radio 9] shown in the table and in figure 1 in any data on an annual compound Shack Color Computer may be used in brackets. percentage. an actual business application. The computer used here is the 16K version without the Extended BASIC ROM. It Table 1: Market Parameters may be purchased for under $500. The 1. Company Market Share (NSB/TAM) in % addition of a line printer and a cassette 2. Total Available Market (TAM) in millions of $ tape recorder add approximately $300 3. Industry Product Mix |TAM of specific product/Total TAM) in % to provide for a complete, versatile 4. Industry Quantity in millions of units system. 5. Industry Average Selling Price (ASP) in $ 6. Company Sales (NSB) in millions of $ The program is written in BASIC 7. Company Product Mix (NSB of specific product/Total NSB) in % and may be used on any compatible 8. Company Quantity in millions of units system. Variations could easily be 9. Company Average Selling Price (ASP) in $ made to customize it to the users' specific needs. These applications should substantiate that the use of low- Data may be saved and loaded by Video Display Characteristics cost personal computers in business year from cassette. Two years of data should not be overlooked. may be stored in memory for entry and Data for each of the two years stored calculation. Within any one of the two in memory is presented in an array of Program Description years, data may be calculated based on pages for each year on the TV display of other data entered. This may be done the Color Computer. These pages are Making projections on industry and on a product category basis, or for all arranged in a 3 x N matrix, where N is company sales, when a multitude of product categories. For example, if the dependent upon the number of product product lines are involved, can be a units and ASP for industry have been categories. long and tedious task. A single change entered, the program will calculate the in value usually results in complete TAM. For expediency of operation, cal­ Three vertical pages can display a recalculation of the other parameters culations are made only when re­ maximum of 29 product categories. for each year of the projection. Knowl­ quested, rather than whenever new This example is shown in figure 1. The edge of the required changes causes data is entered. product categories are numbered and

No. 52 - September 1982 MICRO - The 6502/6809 Journal 67 NEW LOW PRICE DIRECT FROM MANUFACTURER

16K RAM EXPANSION BOARD FOR THE APPLE II* $120.00 The Andromeda 16K RAM Expansion Board Now with One Year W arran ty . allows your Apple to use RAM memory in place of the BASIC Language ROMs giving you up to 64K of programmable memory. Separate /\N3flOMED/\ A pplesoft* or Integer BASIC ROM cards are no longer needed. The 16K RAM Expansion Board M INCORPORATED works with the Microsoft Z-80 card, Visicalc, Greensboro, NC. 27410 DOS 3-3, Pascal, Fortran, Pilot, and other 919 852-1482 P-O. Box 19144 software. A switch on the card selects either Price for Andromeda 16K RAM the RAM language or the mainboard ROMs expansion board now only S120.00. when you reset your Apple. Please add S5 for shipping and The Andromeda 16K RAM Expansion ~ handling. North Carolina residents Board has a proven record for reliability with a add 4% sales tax. thousands of satisfied customers. *DEALER INQUIRIES WELCOME.

68 MICRO - The 6502/6809 Journal No. 52 - September 1982 listed along the left side of the display, and the market parameters and their item numbers are displayed across the top.

The two years stored in memory are defined as the primary and secondary years, and are located on pages 1 through 3, and 4 through 6, respectively. When in the display mode of the pro­ gram, the page being displayed may be changed by direct numerical entry of the desired page, or by indexing left, right, up, and down (see DISPLAY).

Printer Output

Data from either the primary or secondary year may be output to a printer connected to the Color Com­ puter. The Quick Printer II interfaces directly, and provides a 32-character line width. The program prints the data within the year last displayed on the video. All pages of the displayed year will be printed independent of the page shown on the video display.

Operation

The program is loaded from cassette tape into memory using the CLOAD command. Sufficient memory must be allocated to the program (13,700 bytes]. Although the program was writ­ ten with standard ROM, it will also operate with an extended ROM com­ puter, but a comparable amount of memory must be freed to permit opera­ tion. Extended BASIC will not free more memory than that amount created by the PCLEAR 1 command. This is not enough memory for this program, so an additional page of memory must be freed prior to loading. This may be done by entering the following command: ' ‘enter” key must be used when oper­ mediately upon depression of the ap­ POKE 25,6 (enter) ating in this routine. propriate key. DISPLAY Commands available from DIS­ PLAY are shown in table 3. After the program is loaded, entering The display routine outputs the RUN initiates operation. The screen data for the primary or secondary years ENTRY will clear and the program enters MAIN stored in memory to the video display. CONTROL. The program is initiated Operation in this routine is indicated The entry routine permits entry of with all data cleared, primary year = by an inverted-screen "D " in the lower data into the designated column of the 1981, secondary year =1986, and the left of the display. year last displayed on the video. An display page pointer set at 1,(1). inverted-screen "E ” is displayed in the lower left of the video screen to in­ As previously described under MAIN CONTROL Video Display Characteristics, each dicate operation in this routine. The year is displayed in a 3 x N matrix of "enter” key is required for entries in this routine. MAIN CONTROL is the principal pages. Any page may be immediately operating routine from which all other displayed by entering the horizontal routines may be activated. Operation is page number directly, and the vertical Upon entering this routine, the indicated by an inverted-screen (dark page number using the shift key. The display will prompt the user with the request: background) "M" in the lower left of display may also be changed by using the display, preceding the cursor. the arrow of the appropriate direction (up, down, left, right). The “ enter" key ROW(* OR YEAR), ITEM #(*), VALUE Commands available from MAIN is not needed with entries from DIS­ (OR 'YR'„YEARJ CONTROL are shown in table 2. The PLAY, and all actions will occur im­ (Continued on page 71)

No. 52 - September 1982 MICRO - The 6502/6809 Journal 69 M.P. Computer Services Corporation APPLE II PERIPHERAL DEVELOPERS: 2396 Enclnal Station Your complex function prototype requires Sunnyvale, California 94087 the best wirewrap board available. (408) 735-0871

Retail Your Price SPECTRUM SYSTEMS ...... MAKES IT! laiaiaiaiaiaiBiliSiliRIAl P.F.S.II “NEW IMPROVED" $125.00 $ 96.00 P.F.S. REPORT 95.00 74.00 P.F.S. GRAPH "NEW” 125.00 96.00 Fully Extended Wirewrap Protoboard. (Interfaces with P.F.S. and VisiCalc) VISICALC 3.3 Size: 2.8 by 10.7 inch 2 layer PC. 250.00 225.00 VISITERM 100.00 80.00 Capacity: up to 58-16 pin or 12-40 pin VISIDEX 250.00 195.00 or any combination sockets inbetween. VISIPLOT 200.00 158.00 SUPER DISK COPY II 30.00 25.00 PRO EASYWRITER/MAILER COMBO 300.00 225.00 Carefully designed + 5 and GND planes provide for EASYSPELLER 175.00 137.00 the minimum electrical noise, low impedance, hi THE DICTIONARY 99.50 74.00 CREATIVE FINANCING 195.00 143.00 capacitance, and maximum versatility in the layout REAL ESTATE ANALYZER II 195.00 143.00 of IC’s, capacitors, discretes and I/O connectors. THE BOOKKEEPER MASTER 89.95 66.00 THE HOME ACCOUNTANT 74.95 60.00 TYPING TUTOR II 24.95 19.95 Wire-wrap technique documentation included. SUPER DISK COPY III 30.00 26.00 APPLE 21 24.95 21.95 Terms: CRAPS 24.95 21.95 CROSSFIRE 29.95 24.97 • $45.00 + ( 6 % Cat. Res. tax) + 52.00 S&H. SABOTAGE 24.95 21.95 • All payments must be in U.S. funds drawn on a U.S. THREE MILE ISLAND 39.95 33.97 STAR THIEF 29.95 23.97 bank. • Outside U.S. add 10%. Hardw are • Cashier check/money order allow 30 day ABO. EPSON MX 80 PRINTER 599.00 525.00 EPSON MX 100 PRINTER 995.00 799.00 • Personal checks add 2 weeks. OKIDATA 82A PRINTER 510.00 • No credit cards or cash, Please! OKIDATA 83A PRINTER 799.00 PROMETHEUS VERSAcard 199.00 167.00 16K RAM CARD 169.00 105.00 Spectrum Systems AMDEK VIDEO 100 MONITOR 179.00 117.00 AMDEK VIDEO 300 MONITOR 249.00 208.00 P.O.Box 2262 AMDEK COLOR I MONITOR 449.00 384.00 Santa Barbara, Ca. 9312Q Send check or money order. CA residents add 6 % sales tax. Add $2.00 for postage. All items subject to availability. Send $.50 for our catalog or a Apple II is a trademark ol Apple Computers. free catalog with your order.

> Wb an m auttooriifd swieint Apple data lor Appk II & Ml PRINTERS Immediate delivery on al' mofels-wemat carry M enormous inventory of Apple products at all times! • DIABLO (Letter Quality) Retail Your Cost Immediate delivery 630 R102 bi-directnal/tractors 2965 00 2699.00 p u t e r .l6 K -3 2K -48 K -6 4K -P lu s o r Integer in stock! l640Kt09lteyboard, tractors 3072.00 2899.95 630 R0 Receive only 2710.00 2499 95 Urn inventoryof- NEW* IMPROVED APPLE 111 12BK VERSION 1650K136 keyboard/tractors 3220.00 2999.95 Oiikwitt)...... control!*;control)*; OOS 13 ATTENTION: Immediete delivery Sound Oisk Orim WE ALSO CARRY SOFTWARE! • CENTRONICSdot matrix — Piseal-Fortran-Cabal laniuafis Rational Software Dow Jane & Quota reporter Peach Traa Software 700-9 Parallel, heavy duty 1460.00 1199.95 Graphics Tablets Microsoft Viiiwc for Apple ll & III Mcropro 704-9 Serial, heavy duty 1795.00 1599.95 Smerttrm 10 eoiumn card 737 1 Parallel 995.00 799.95 Meromodain II by OC Hayes American 899.95 System Plus 737-3 Serial 1045.00 mm moft. . 704-11 Parallel 1870.00 1695.00 P I Electrostatic 495.00 189.95 a llAnrn Tirrn HEWLETT PACKARD 466 995.00 895.00 2 NEW C3£LUXE CAL CS FROM HP! Texas Instruments 460G graphics 1094.00 969.95 SHm, shlft-pocket styling 1982 Modal with 560 1295.00 1099.00 NEW! HP-11 Your Cost: full typewriter-style keyboard, S60G graphics 1394.00 1195.00 Advanced Proffsmmsble TI-9I/4A U/L cue & more! Retail Yett Ccsi 445 795.00 695.00 Scientific LCD Rexaif.Sl30.00 $114.95 New KEYBOARD “ S950 00 S369.95! 445G 894.00 789.00 Your Cost NEW! HP-12C Your Cost: $ EPSON PRINTERS Retail: Advanced Programmable keyboard MX80 645.00 539.95 Main Showroom & Offices: Financial LCORet^l.-SfSO.O? $129.95 636995 Optional Graftrax Chip 90 95.00 10" color monitor lor 99/4 650 00 HP-125 New Microcomputer Retail Youf Cott 319.95 MX80 FT 745.00 659.95 216 South Oxford Avenue 64K CPU/Term|nal/Keyboard 32K Exp. mem module 399 95 31495 MX80 + GRAFTRAX 80 695.00 579.95 3750 00 3195.00 Extended Banc, < MUST lor 100 00 75 00 Los Angeles, CA 90004 HP-85 Microcomputer printer/monitor 32 K module MX80 FT* GRAFTRAX 80 795.00 689.95 3250.00 2499.00 Speech synthesiser 150 00 129.95 MX100 995.00 789.95 WE HONOR HP-13 Microcompum-built-in monitor 2250.00 1798JO We carry a large inventory ot software. & HP-2631 B Printer, dot dm* (ask for optns) 3950.00 3199.00 WE ALSO HAVE . . . VISA and MASTERCHARGE accessories Your Can • NOVATION Modems Retail Your Cost HP82905A 90 col prwtAr. dot matrix 945.00 755.00 TI-30-2 LCSStu Slide NEW J8.95 TELEX: 67 34 77 HP-2001 A Latter quality prter, daisy wheal 3495.00 TI-35SP LCO SCIENTIFIC 22.50 CAT 199 95 159.95 HP-82901M Dual masted (256KB disk drivel 2500.00 1999.00 0 CAT 199.95 159.95 OROER DESKS open 7 Days a Week! Call us for the lowest pilices on 7 disk driv*s Call us Call us TI-40 LCO Sei/NEW 28.95 -f- Tl-57 Prog. Scientific 39.95 APPLE CAT Direct connect 349 95 314.95 7:00 AM to 7:00 PM Mon thru Sat HP-41CV New! 2.2K bytes of memory 325 00 256.00 TI-58C 480 Step. Prog. Sunday Noon to 5:00 PM Canl Reeder for 41 CV 215.00 171.00 TI-59 960 Step. Proq. SANYO MONITORS High resolution Printer for 41 CV 385.00 294.00 PC 100C Print/Plot 13" Color (new) high quality 550 00 419.95 Order Desks: (213) 739-1130 Outd Ram 95.00 84.95 LCDProgtammet/NEW 12" Green phosphorous 360 00 259.95 TOLL-FREE TOLL-FREE Optical Wand for 41 CV 125.00 99.95 12" Black & whue 340 00 239.95 HP-41C Calculator 250 00 188.95 A ^ at M a Large inventory of periphls, access, etc. 15" Black & white 370 00 259.95 (outside Calif.) (within Calif.) Memory mod. for 41C 26.95 9” Black & white (the best seller) 235 00 169.95 HP-97 Progrmble prmtfr 750.00 579.95 A TAKI Computer R e fill Yi HP-34C Progrmble scientific 150 00 117.95 400 SPECIAL PRICE! 16K 595 00 339.95 AMDEK(leedex)High Quality Monitors 800-421-8045 800-252-2153 ness R/E 150.00 119.95 No language inc., opt'l basic, 54.95 HP 38C Progimblc bus 100 12" B/W. 12 MHz 179.00 139.95 NO ONE UNDERSELLS OLYMPIC SALES We have the complete line of accessories, etc. 800 16K Computer 1080 00 759.95 SPECIAL' 100-G 12" Green, 12 MHi 199.00 174.95 Write & request our new 112 pg catalog- 300-G 12" Green. 18 MHz 249.00 199.95 ATARI 800 48K Computer 1250.00 Color I 13" Color, NTSC comp, input, 449.00 339.95 please include $1.00 to defray postage & XEROX audio amp & speaker handling-includes many more Hems-from Color If 13" Color, B8 G input, 999.00 699.95 Model 820-1 <5’A") 8 “ S3750.00 OHIO SCIENTIFIC TV's to Watches! 64K COMPUTER & WORD PROCESSOR C8PDF-48K Retail:$3495.00Y/C: $3195.00 hi res graphics, speaker A ll goods subject to availability, this ad super­ AC | nuU aO Special discount available to • Dual 8 " Drives *6 4 col x 32 line/color nn Schools A Institutions-lnquirt! • H AZElTINE Video Display Terminals sedes all previous ads. we are not responsible $Z9«j5.(JU Required software add'!. • .7 MIPS -M S P ^ M a n y more stnd features for typographical errors; we will meet or beat • SHUGART Disk Drives any advertised prices if the competition has Fortran & Pascal available • DEC VT100 & VT103 NEW-FAMOUS tjORVUS OISK 0RIVES-5,10,20 Many other OSI products -a t discounted prices the g o o d s on hand. MEGABYTES with fantastic new OMNINET Network Call us for your DISCOUNTS D price TODAY! Minimum shipping and handling $4.95. Call us for the be« prices in the USA! Syttem A ll orders subject to verification and acceptance. NEW! From T l—Series 10 Personal Information Terminal Retail 995 00 your Cost 795.00

70 MICRO - The 6502/6809 Journal No. 52 - September 19 Data Entry Options CALCULATE Operation in this routine is in­ dicated by an inverted-screen "C " in a. Entry or change of specific data The calculate routine which gener­ the lower left of the display. Entry into within the displayed year: Enter the ates data within the displayed year, CALCULATE may be performed from location of the new data (row # projects data from the primary year to either MAIN CONTROL or DISPLAY, shown at left of screen, item § the secondary year using an entered an­ but exit is always to DISPLAY. shown at top of screen), followed by nual compound growth rate, or redis­ the new value of data. For example, tributes either the TAM or NSB of the Upon entry to CALCULATE, the to enter a value of 10 for TAM (item displayed year to equal an entered top- display will prompt the user with the §2J of product category #3, enter: down summation. The annual com­ following request: pound growth rate between items in 3,2,10 (enter) the primary and secondary years may DATA, RATE, PROJCTN, SPREAD? also be calculated. (continued) b. Entry or change of all values of a specific item § within the displayed Table 2: Commands Available from MAIN CONTROL year: Enter an for the row, followed by the item # and a comma. The program will then prompt the Command Routine Action user for the desired data value for each row (product category) by dis­ D DISPLAY Program enters video display routine. playing the name of theproduct cate­ E ENTER Program enters data entry routine. gory, and the present value (PVJ. C CALCULATE Program enters calculate routine, where new Three possible entries of data may be data is determined based on previously made: 1. the new value, 2. entei, entered data. which is accepted as a value of zero, and 3. " / ”, which retains the pres­ S Calculates sums of all columns within the ent value. year that is presently displayed on video. CLR CLEAR Permits clearing data in either primary or Example of entering data for secondary year, as specified. TAM for all product categories: R Displays previously calculated compound *,2, (enter) growth rates on video screen (see CALCULATE). c. Entry or change of all values of data P Data within vertical page last displayed is for a specific product category (row): output to the printer, as described in Enter the row #, followed by an PRINTER OUTPUT. for the item #, followed by a comma. RP Outputs previously calculated compound The program will then prompt the growth rates to the printer (see user to enter data for each of the nine CALCULATE). items for the specific product cate­ gory designated. A value must be LD LOAD Loads yearly data previously stored on entered for each item request. The cassette tape. "enter" key with no preceding value SAVE SAVE Saves primary or secondary year data on is interpreted as a value of zero. cassette tape. HEADER Cassette tape is prepared to receive data for a Example of requesting entry for year not previously stored. See "Tape all items for product category #14: Initialization" under SAVE. 14,*, (enter) d. Change of primary or secondary year: The value of the years for Table 3: Commands Available from DISPLAY primary and secondary display pages is initialized at 1981 and 1986, respectively. Either of these years Command Routine Action may be changed to any other year R Same as command described under MAIN value. The display should be set to CONTROL the year to be changed (pages 1 E ENTER Same as above through 3 for primary year, pages 4 through 6 for secondary year). The C CALCULATE Same as above enter command may then be used, as P Same as above shown in the following example, which changes the year to 1989: S Same as above + Special Sum — calculates sums of columns YR,,1989 (enter) between specific rows (product lines) designated by user. When any of the entry requests are Return to MAIN CONTROL. completed, the program will always Q return to DISPLAY.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 71 The user response must be followed by Appendix A an "enter" key. 1 CLEAR 9 ' MPP 10 ’ L.I.SUCKLE Calculate Options 12 ’ 12/00 IS ’ REVi10/19/81 D Data: Calculates data within the 20 • INITIALIZATION 29 '*****E N TE R NUMBER OF PRODUCT CATEGORIES IN LINE 30 displayed year based on existing data. 30 PC-6 Entry into this subroutine results in the 33 PT-PC+liPM-INT</ll>+l 40 DIM T(PT,ie>,Hl«(9),H2«(9) following request on the display: 43 DIM PL*(PT),SM(1B),RT(PT) 30 DIM TM<4) ROW(*), ITEM #? 60 H I*—"PRODUCT CAT." 80 DATA N 8B/TAM,TAM,MIX-T,UNITS,ASP 100 DATA NBB.MIX-N,UNITS,ASP The location of the desired parameter is 120 DATA X (1), (2), (3), (4), (3) 130 DATA (6 ) , ( 7 ) , , <9) entered using the row # shown on the 160 FOR N -l TO 9 left of the screen and the item # shown 160 READ H1«(N) at the top of the screen. If an entire col­ 200 NEXT N 220 FOR N -l TO 9 umn is to be calculated, an * may be used 240 READ H2«(N) in place of the row #. For example, to 260 NEXT N calculate the value of industry units 270 CLB 273 PB—liP P —1 (item 4] based on TAM and ASP, enter 280 V1-19B1 the following: 290 Y2-19B6 300 YR-Y1 320 SL—32*13 *,4 (enter) 330 ’ MtMENTER THE NAMES OF PRODUCT CATEGORIES IN LINES 340-400 340 DATA WIDGETS,THINGOTS,DIPSIES,DOODLES,WHATCHA, MACALLET9 410 FOR N -l TO PC The calculations for TAM and NSB 420 READ PL«(N) may be based on a variety of constants. 430 NEXT N 440 FX-10 Whenever a request for these calcula­ 430 GOSUB 9000 tions is made, the computer requests 460 FD-FN more information: 470 P L *(P T )-“ TOP-DOWN TOTALS" 460 JF-0 1000 REM MAIN CONTROL CONSTANT (3), (4)&(5), (1)? 1010 PRINT38L 1020 PRINT88L, "«i“ | 1040 INPUT 00« The item # to be held constant is 1033 0*-LEFT«(00«,l) entered using the "enter" key, and the 1060 IF Q*»"D" THEN 2000 1070 IF Q«-“E" THEN 7000 calculation is performed. 1060 IF QO*-MBAVE“ THEN 4000 1090 IF Q0*-"LD" THEN 3000 1093 IF QO*-"CLR“ THEN 11000 D134 Data: Automatically performs a 1100 IF Q«-"C" THEN 6000 series of calculations comparable to 1110 IF 0*-"P" THEN 6000 "D " for items 1, 3, and 4 for all product 1120 IF QO*—"HEADER" THEN lOOOO 1123 IF QO*-"RP“ THEN 2700 categories (rows|. 1130 IF Q«-"R" THEN Ll-1lL2-29lGOSUB 6340 1140 IF 0«-”8" THEN GOSUB 2300 D178 Data: Automatically performs a 1999 BOTO 1020 2000 REM LIST ROUTINE series of calculations comparable to 2020 CLS "D " for items 1, 7, and 8 for all product 2023 IF PG>3 THEN YR-Y2 ELSE YR-Y1 2030 ON PG GOTO 2038,2040,2030, 2032,2034,2036 categories (rows). 2038 8T-I 1 QOTO 2060 2040 ST-2iG0T0 2060 R Rate: Calculates the annual com­ 2030 8T-6 1GOTO 2060 2032 ST-lOiGOTO 2060 pound growth rate between primary 2034 ST-111 GOTO 2060 and secondary year data. Entry into this 2036 ST-13 2060 LB-1+11* subroutine results in the display of the 2070 IF PC,4) 2100 PRINT 9 3 2 ,M 3 THEN 81-S-9 EL 8E S l-S The growth rate for a particular product 2130 PRINT3L," ,,+Hl«<81) category (row) and item may be 2140 PRINT3L+32,“ ”+H2« entered, or all product categories for 2130 K—64 2133 IF L8 >PC THEN 2220 the specific item may be calculated by 2160 FOR P-LS TO LE using for the row #. The algorithm 2170 IF L -4 THEN PRINTSK.P 2173 T-INT(T(P,8)*100+.3)/100 for calculating the compound growth is 2180 PRINT9L+K,T| relatively slow, so an indication of 2190 K-K+32 which row is being calculated is shown 2200 NEXT P 2210 IF PPOPM THEN 2270 to indicate that the computer is oper­ 2220 IF L< >4 THEN 2260 ating. At the completion of the calcula­ 2230 PRINT3K+64,PT1 PRINT3K+6B, T < PT, B) tion, the value(s) are shown on the 2240 PRINT9K+96,"DLTA " 1 IF FS-1 THEN PRINT3K+100, INT <100$(T

72 MICRO - The 6502/6809 Journal No. 52 - September 1$ Appendix A (continued) When the entire column has been cal­ culated, a display page is filled and 2300 PRINTa9,Hl* 2310 PRINTS25, H1 *(1 ) waits for any key input before display­ 2330 PRINT®57, H2* <1) ing the next page. After the last data is 2340 K-64 displayed, any key entry returns the 2345 IF L8>PC THEN 2420 23S0 FOR P-LS TO LE operation to DISPLAY. The latest rate 2360 PRINTdK'P calculation may be reviewed from 2370 PRINT8K+4 , PL*(P) 2380 PRINT8K+25,INT(T(P,ST)<100+.5)/100 either DISPLAY or MAIN DISPLAY by 2390 K-K+32 entering “R” . The rate data may be 2400 NEXT P output to the printer by entering "RP" 2410 IF PPOPM THEN 2900 2420 PRINT8K+36,"SUMMATION" from MAIN CONTROL. 2430 IF FS-1 THEN PRINTdK+57,INT(SM(8T)*100+,5)/100 2440 PRINT3K+64,PT|" TOP-DOWN TOTAL" 24S0 PRINT 9K+100," DELTA" P Projection: Calculates a new value of 2460 GOTO 2900 data in the secondary year based on ex­ 2470 PRINT38L,"sun FIRST R0W.LA8T ROW” | isting data in the primary year and an 2480 INPUT J8,JE 2483 GOSUB 2S05 entered annual compound growth rate 2488 PP-3 in %. Entry into this subroutine results 2490 JF-1 in a displayed prompt: 2493 GOTO 2000 2500 PRINT98L,"CALCULATING SUMS" 2901 JS-1»JE-PC ROW(» OR S), ITEM, RATE? 2S02 JF -0 250S FOR N -l TO 18 2S10 SM(N)-0 2520 NEXT N 2530 FOR N-JS TO JE The specific row #, and annual rate are 2532 SM(3)-8M(3)+T(N,3) entered, followed by the "enter" key. 2535 SM(7)-SM(7) +T (N, 7) The calculated data is stored in the ap­ 2536 8M (12)«8M (12)+T(N#12) 2537 8M(16)-8M(16)+T(N?16) propriate location in the secondary year 2540 FOR J -2 TO 17 STEP 2 data table. Completion of the calcula­ 2550 SM(J)-SM(J)+T(N,J) tion returns the program to DISPLAY. 2560 IF J-8 THEN J-9 2570 NEXT J 2580 NEXT N Sample ENTRY: 2590 FOR J -0 TO 9 STEP 9 2600 IF SM(2+J)< >0 THEN SM<1+J)*100»SM(6+J)/8M(2+J) 2610 IF SM(4+J)<>0 THEN SM<5+J)-SM(2+J)/8M(4+J) 3,2,10 (enter) 2620 IF SM(8+J)<>0 THEN SM(9+J)-9M(6+J)/SM(8+J) 2630 NEXT J 2635 FS-1 Several options for "row #" are1 2640 RETURN 2700 REM RATE PRINT 2710 PRINT#-2,TAB(4)H1«(IR)| » Data for all product categories 2720 PRINT#-2,TAB <11)Y11 under the specified item # will be 2730 PRINT#-2,TAB(18)Y2| calculated. Using an entry, as 2740 PRINT# -2, TAB(25) "RATE" 2750 FOR N -l TO PC shown by example: 2760 PRINT#-2f CHR*(0 )| 2770 PRINT#-2»N|LEFT*(PL*(N),8 )| *,2, (enter) 2773 DR-N: D I- IRIG08UB9500 2774 PRINT#-2,TAB(11)D| 2777 D I- IR+9iG0SUB9500 will result in a display prompt for 2780 PRINT#-2,TAB(18)Dj 2790 PRINT#-2,TAB(25)INT(RT(N) * 10+.5 )/1 0 annual rate inputs in percent for 2800 NEXT N each product category. 2810 QOTO 1000 2900 PRINTd503,"PGMPG| 2901 PRINTSSL,"d"| S Data for all product categories 2902 IF JF-1 AND PP-3 THEN PRINTSSL,"mpeci*l mum R0WS"JS|" TO"|JE under the specified item # will be 2903 PRIlsTTSSL, " d "| 2904 X*-INKEY* calculated with identical growth 2905 IF X*-"" THEN 2902 rates equal to that value entered. An 2906 IF X*-"R" THEN L1-1IL2-PCIG0T06340 example for items 2 and 10% is: 2909 IF X*-"+" THEN 2470 2910 IF X*-"Q" THEN 1000 2911 IF X*-"E" THEN 7000 S,2,10 (enter) 2912 IF X*-”C" THEN 6000 2913 IF X*-"S" THEN GOSUB 2500 2914 IF X*-"P" THEN SOOO The growth rate previously calculated 2915 X-VAL(X*) with the “R " command under CALCU­ 2920 IF X>0 AND X<7 THEN PG-X 2925 Y*-CHR*(ASC(X«)+16) LATE may be used in place of an 2930 Y-VAL(Y«) entered value(s| for rate. This is per­ 2935 IF Y>0 AND Y<-PM THEN PP-Y formed by using "R " for the value of 2940 IF X*-CHR*(9) THEN IF PG<6 THEN PG-PG+1 2945 IF X*-CHR*(8) THEN IF PG>1 THEN PG-PG-1 the rate. An example of projecting an 2950 IF X*-CHR*(94) THEN IF PP>1THEN PP-PP-1 entire column of data is: 2955 IF X*-CHR*(10) THEN IF PP

No. 52 - September 1982 MICRO - The 6502/6809 Journal 73 or 7). Entry into this subroutine yields Appendix A (continued) the prompt: 3090 I -8 !GOSUB 6530 3100 G0T02000 ITEM # (2 OR 6)? 3200 IF VAL(R*)00 THEN 3240 3203 R*-”*“ 3210 IF I-IR THEN 6911 Either 2 or 6 will be accepted, using the 3220 PRINT"CALCULATE RATES FOR ITEM "|IR "enter" key, for spreading TAM or 3230 GOTO 1000 3240 Y3-VALIR*) NSB, respectively. The program checks 3250 R *-"*“ for a valid entry of top-down summa­ 3270 GOSUB 6225 tion, and if one exists, the calculation 3200 Y2-Y3 3290 G0T06911 is performed and the program returns to 4000 REM SAVE DISPLAY. If an invalid summation is 4005 DL-200 4010 PRINT9SL,"BAVE WHICH YEAR" | found (zero), the program requests that 4020 INPUT YS* a top-down entry be made and returns 4022 YS-VAL to MAIN CONTROL (indicated by 4030 IF YSOY1 AND YSOY2 THEN PRINT “DATA NOT AVAILABLE"! I SOTO 1000 4031 GOTO 4070 inverted-screen “ M” ). 4035 IF RI0HT*(YS*,1>-"X“ THEN 4070 4040 PRINT SSL, "REWIND TAPE i< ’ PLAY’ " 4050 FN*-"H"+STR* 4060 9KIPF FN* 4070 PRINT9SL,“ SET TO ’ RECORD’ & ENTER ’ READY’ " 4080 INPUT a * 4090 IF Q*0"READY“ THEN 1000 CLEAR 4100 IF YS-Y1 THEN S F -liE F -9 4110 IF YS-Y2 THEN SF-lOiEF-10 Data for either the primary or 4120 OPEN "0“ , - l , ”F“+STR*(YS) 4125 RP-1 secondary year may be reinitialized to 4160 FOR N-SF TO EF zero by entering CLR from MAIN 4170 FOR K - l TO PT CONTROL. The program will prompt 4175 ON RP SOTO 4100,4105 4180 PRINT#-1,T(K,N)I0OTO419O with: 4105 INPUT#-1,T(K,N) 4190 NEXT K 4200 NEXT N CLEAR WHICH YEAR? 4210 CL08E-1 4212 ON RP GOTO 4214,4220 The year is entered (using "enter” 4214 MOTCRON 4216 FOR T - l TO DL key) and if it corresponds with either 4217 NEXT T the primary or secondary year, all data 4218 MOTOROFF 4220 CLS in memory for that year will be cleared. 4230 PRINT996,"TURN RECORDER OFF” If an invalid year is entered, the display 4240 GOTO 1000 will indicate: 5000 REM LOAD 5005 CLS 5010 PRINT9SL,“LOAD WHICH YEAR,“ YEAR NOT IN DISPLAY 5015 PRINT “ INTO PAGES 1 -3 (1 ) OR 4-6<2) 5020 INPUT YS,YP 5030 IF YP<>1 AND YP<>2 THEN 1000 Exit from the routine is to 5035 IF YP-1 THEN SF-1lEF-9lYl-YB DISPLAY. 5037 IF YP-2 THEN SF-lOiEF-lBiY2-YS 5040 CLSfPRINT9SL, “REWIND TAPE Sc ’ PLAY’ " 5050 OPEN"I", - I , “F“+STR* 5060 RP-2 5070 GOTO 4160 6000 REM CALCULATE 6010 PRINT9SL,"c DATA, RATE, PROJCTN, 8PREAD" I LOAD 6020 INPUT 0 * 6022 FS-0 The load routine retrieves data 6025 IF Q*-“D134“ THEN 3010 6026 IF Q*-"D178" THEN 3060 previously stored on cassette tape and 6030 Q*-LEFT*IQ*,1) loads it into memory. Access to this 6040 IF Q«-"D" THEN OOSUB 6300 6030 IF Q *-"R “ THEN 0OSUB 62OOI0OTO 1000 routine may only be performed from 6060 IF Q*-"P" THEN 6900 MAIN CONTROL. Entering LD results 6070 IF Q*<>"S" THEN 2000 in the response: 6100 REM SPREAD 6105 PRINT98L 6110 PRINT98L,“e ITEM • <2 OR 6 )“ | LOAD WHICH YEAR INTO PAGES 6120 INPUT I 6130 IF 102 AND 106 THEN 1000 1-3(1) OR 4-6(2)? 6135 11—I 6140 IF Pfl>3 THEN I- I+ 9 Pages 1-3 represent the primary 6142 IF T IP T ,I> -0 THEN CLSiPRINT “ ENTER TOP-DOWN “ | H I * ( 11 ) iSOTO 1000 6145 0O8UB 2300 year, and 4-6 the secondary year. For 6150 D-TIPT,I)-BM(I) example, if data for 1984 is to be placed 6160 FOR N -l TO PC into the secondary year memory, the 6165 IF SM < I ) -0 THEN 6100 6170 TIN,I)-TIN,I)+D*T(N,I)/SMI I) following entry would be made: 6100 NEXT N 6105 GOSUB 2300 6190 OOTO 2000 1984,2 (enter) 6200 REM RATE 6205 PRINT9SL 6210 PRINT9SL, “ROW(OR ’ «’ >,ITEM#“ | The user is then prompted to "RE­ 6220 INPUT R * ,I WIND TAPE & PLAY” . After the data 6225 IR -I is loaded, the prompt, "TURN 6230 DY-Y2-Y1 6240 IF R*-"«" THEN Ll-1iL2-PCiGOTO 6270 RECORDER OFF” , is issued and the 6250 R-VAL

74 MICRO - The 6502/6809 Journal No. 52 - September 19 Appendix A (continued^ SAVE 6270 FDR N-Ll TO L2 6273 IF T3 THEN V1-V1+9IV2-V2+9*11-11+9 6680 FOR R-Ll TO L2 Data is stored on a year-by-year 6690 ON EQ GOTO 6695,6710,6715,6725,6728,6705 basis, in a file named "F ", followed by 6695 IF T4 AND Vl<>8 THEN 6750 6790 V2-V1+1 be stored. 6800 EQ-6 6820 GOTO 6670 2. Set the tape recorder to the record 6900 REM PROJECTION 6901 W-0 mode. 6902 Y4-Y2 6905 PRINT©SL,"c projection ROW(* OR S) , ITEM, RATE'*| 6908 INPUT R*,I,RT* 3. Return the program to the MAIN 6909 IF RT*-'^*' THEN 3200 CONTROL routine. 6910 RT-VAL *' * " THEN 6917 6912 CLSSPRINT“ENTER RATE-FOR "|H1* 4. Enter "HEADER". 6913 FOR W-l TO PC 6914 IF RT*-"R“ THEN RT-RT(W)IG0T06916 6913 R*-STR*(W)iPRINT W|PL*

No. 52 - September 1982 MICRO - The 6502/6809 Journal 75 7. When requested w ith "SAVE Appendix A (continued) WHICH YEAR", enter the year, followed immediately with an "X " 6930 IF R*-"8" THEN Ll-liL2-P C i OOTO 6963 6933 R-VAL 8. Enter "READY” when requested to 6973 NEXT N do so. 6980 IF WOO THEN NEXT U 6982 IF Y20Y4 THEN CLBiPRINT849S,Y4IGOT02023 6983 80T0 2000 9. Turn off the recorder when 7000 REM ENTER instructed. 7003 F8-0 7010 PRINT8BL,»« R0W<* OR YR),ITEM # < *),VALUE" 7013 PRINT" <0R ’ YR’ , , YEAR) " | The data has now been stored on 7020 INPUT R « ,I« ,V tape and the program will return to 7021 IF R*-"Q" THEN 1000 7023 IF I* -"* 1' THEN 7300 ELBE I-VAL(I*> MAIN CONTROL. 7023 I I - I 7026 IF P0>3 THEN > 1 + 9 7030 IF R*-"*“ THEN 7090 7040 IF R*<>"YR” THEN 7070 7030 IF PG<4 THEN Y l-V ELBE Y2-V Summary 7060 GOTO 7200 7070 R-VAUR*> 7080 T 7110 FOR L - l TO PC rather than the Extended BASIC ROM. 7120 PRINT L|P L«< L)| Several subroutines were required to 7123 PRINT * PV -“ T < L ,I)|iIN P U T T» 7130 IF T *-"/" THEN 7140 perform the mathematical operations 7133 T of natural log and exponentiation. The 7140 NEXT L program could easily be modified to 7200 GOTO 2000 7300 R-VAL(R«) operate with Extended BASIC by 7310 IF P8>3 THEN I1 -1 0 |I2 -1 B ELSE 11 -1 112-9 replacing the rather lengthy sub­ 7320 CLB 7330 PRINT "E- “ |PL*(R>|YR routines with their simple instruction 7340 FOR I - I l TO 12 7330 PRINT H 1 *< I)| 7360 INPUT T (R ,I> 7370 NEXT I 7380 GOTO 2000 8000 REM PRINT 8010 IF YR-Y1 THEN F -0 ELSE F-9 8020 PRINT*-2,YR|H1*| 8030 PRINT«-2,TAB(22) H l«(l) 8030 FOR N -l TO PC 8060 D1-INT(T(N,l+F)*100+.3>/100 AT LAST... n n i 8063 PRINT#-2,CHR«(0)I 8070 PRINT#-2,N|PL*(N)I' . . . r a L I E l i 8080 PRINT#-2,TAB(24) D1 8090 NEXT N For investors 8091 PRINT#-2 and financial managers 8092 PR IN T#-2,“ SUMMATION” | Stock portfolio analysis 8093 PRINT#-2,TAB(24) INT(SM(1+F)*100+.3>/100 $150.00 8094 PRINT#—2t PT|"TOP-DOWN TOTAL" • in your office - instant valuations 8093 PRINT#-2,” DELTA" •compound growth measurement 9100 FOR D2-1 TO 3 BTEP 4 •pertinent company operating statistics 0UO PRINT#-2 8120 PRINT#-2 Stock financial 8130 PRINT»-2,YR|H1«(D2+1)| statement analysis 8140 PRINT#-2,TAB(11) H1«(D2+2)| S 250.00 B130 PRINT#-2,TAB(IB) H1«(D2+3)| •input your interpretation 8160 PRINT#-2,TAB(23)Hl*(D2+4> of financial data B170 FOR N -l TO PC •analyze up to 10 years of data 8180 FOR K—1 TO 4 8190 I-K+F+D2 •see mean, trend and stability 8200 TM(K)-INT(T(N,I)*100+.3)/100 On-line data retrieval 8210 NEXT K 550.00 8213 PRINT#—2, CHR4( 0 ) | Accounting package 8220 PRINT#-2,N|TM(1)| 5150.00 8230 PRINT#-2f TAB(11) TM(2)| 8240 PRINT#—2, TAB(18) TM (3)| DBM system 8230 PRINT#-2,TAB(24) TM<4) 5200.00 8260 NEXT N for 8" floppy/hard disc 0270 PRINT#-2 under OS65U 8273 PRINT#-2,"SUM"| 8280 FOR K-l TO 4 Full Screen Editor 8290 PRINT#-2,TAB((K-l)*7+3) INT(8M(K+F+D2)*100+.3)/100| W for Polled Keyboard 8300 NEXT K 575.00 8310 PRINT»-2 •tor OS65D & OS65U 8320 PRINT#-2,PT|T(PT,F+D2+1) •machine language based 8323 D3-INT( (T(PTfF+D2+1)-SM(F+D2+1))*100+.3)/100 •type or cursor mode 8330 PRINT#-2," DLT" |D3 8300 NEXT D2 wrife for details 8600 GOTO 2000 9000 REM LOG Genesis Information 9010 FM-1 Systems, Inc. 9020 IF FX-<10 THEN 9060 P.O. Box 3001 • Duluth, MN • 55803 9030 FX-FX/10 Phone 218/724-3944 9040 FM-FM*10 9030 GOTO 9020

76 MICRO - The 6502/6809 Journal No, 52 - September 19 Appendix A (continued) counterpart. There are also other com­ 9060 G08UB 9110 mand substitutions, such as providing 9070 IF FM<10 THEN RETURN 9080 fn- fn+fd formatted output, which would shorten 9090 fm- fm/ io the program. The difficulty with perfor­ 9100 GOTO 9070 ming these changes, of course, is that 9110 FK- 9120 F2-FK1FK the program will no longer run with a 9130 FZ-1/51 computer which only has the Standard 9140 FOR F-49 TO 1 8TEP-2 9130 FZ-1/F+FZ*F2 BASIC ROM. 9160 NEXT F 9170 FN-FZ*FK*2 9180 RETURN 9200 REh EXP The listing for the program is given 9210 Z -l 9220 EX-0 as Appendix A. To customize the pro­ 9230 FOR XE-1 TO 30 gram to specific market areas, the prod­ 9240 EX-EX+ZtX/XE 9245 Z-ZtX/XE uct categories of interest should be 9230 NEXT XE entered on lines 340 through 400. The 9235 EX-EX+1 number of categories should be entered 9260 RETURN 9500 REM ROUND-OFF CALCULATE on line 30 as the value of PC (product 9510 D-INT*100+.5>/100 categories). The program will accept 9520 RETURN 10000 REM HEADER PREPARE any number of categories,- however, the 10010 CL8 amount of memory required for opera­ 10020 PRINTdSL,"YEAR"| tion will increase or decrease according 10030 INPUT YS' 10040 OPEN H0",~l,"H"+STR* to the category quantity. 10050 PR I NT#-1, "HEADER*', YS 10060 CLOSE-1 looeo DL-500 10090 Y1-Y8 10100 GOTO 1000 11000 PRINTdSL, 11 CLEAR WHICH YEAR** 11010 INPUT Y The author may be contacted at Motorola 11020 IF Y-Yl THEN K l-l«K2-9iGOTO 11100 Inc., Semi Conductor Products Sector, 11030 IF Y-Y2 THEN Kl-lOiK2-18iGOTO 11100 5005 East McDowell Rd., Phoenix, 11040 PRINT "YEAR NOT IN DISPLAY"iGOTO 2000 11100 FOR N -l TO PT Arizona 85008. 11110 FOR I- K l TO K2 11120 T

AIM 6809??? UpqRAdc Your AIM 65* t o 6809 CPU Power wrrh "MACH-9"! : HIM + POW ER i STANdARd: *6809 CPU & Plug-in Assembly i COMPUTECH : *Super-set of AIM Monitor *Two-Pass Symbolic Assembler * 'Complete Monitor Documentation & Source Check the J HOBBYIST ANd INDUSTRIAL V ersions outstanding + A vA iU b lE Now: documenta- * tion supplied J HO BB YIST includes hardware as a kit using AIM ROM with AIM65! J sockets $199.00 (add $2 for shipping and handling). if * INDUSTRIAL is preassembled and pretested with local Top quality power supply designed to Rockwell's specs for fully BUS, 5 locking low force ROM sockets and 2K Static RAM -ft populated AIM65 — includes overvoltage protection, transient sup- ^ -fc pression, metal case and power cable: >4" $279.00 (add $2 for shipping and handling). + PSSBC-A (5V 2A Reg; 24V ,5A Avg, 2.5A Peak, Unreg) .... *64.95 j ■J Same but an extra AM P at 5 volts to drive your extra boards: J iMMEdiATE F u t u r e: J PSSBC-3 (5V 3A Reg: 24V ,5A Avg, 2.5A Peak, Unreg) .... ‘74.95 J *STC FORTH System with Virtual Disk X The professional’s choice in microcomputers: J *A Fantastic Pascal System * AIM65/1K R A M ... ‘429.95 BASIC (2 ROMS) ...... *59.95 * * AIM65/4K R A M ... ‘464.95 ASSEMBLER (1 R O M ) ... *32.95 * ‘59.95. M.M.S. Inc. £ FORTH (2 R O M S ) ...... * 1110 E. PENNSylvANIA St. f SAVE EVEN MORE ON COMBINATIONS 1 X AIM65/1K+PSSBC-A ... ‘479.95 AIM65/4K+PSSBC-3 ...‘524.95 J T u cso n , AZ 89714 ^ W e gladly quote on all AIM65/40 and RM65 items as well. ^

(602) 746-0418 * ORDERS: (714) 369-1084 J + V P'0' Box 20054 * Riverside, CA 92516 HPIN ■ K l -fc U H U California residents add 6 % sales tax W H i M ^ AZ residents Include 4% sales tax *A trademark of Rockwell Inc.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 77 PET Vet

up to ten characters long, and the editor gam, particularly if the relocating By Loren Wright allows extensive, convenient file editing. loader is to be used. These variations, learned quickly, were included to in­ MAE coexists with BASIC, an ex­ crease the speed and flexibility of MAE Carl Moser’s MAE and ASM-TED tended monitor, and your assembly pro­ and the relocating loader. gram, if you haven't decided to assem­ MAE and ASM-TED have been around ble it on top of the assembler! To han­ Several utility and sample programs since the early days of the PET. Other dle such problems and to allow greater are included on the disk. The manual is assemblers have come and gone or faded programming flexibility, a relocating thorough, including examples of into obscurity, but few others have loader program is included. The loader macro, conditional, and interactive been able to match the prices, features, acts upon a relocatable object file, assembly. EHS publishes a newsletter and support of these assemblers. which is easily created by the assem­ on an irregular basis to keep users up on bler. An enhanced DOS wedge program improvements, applications, and other Both are written in machine lan­ is included, which allows you to enter information of interest to MAE owners. guage. ASM-TED is primarily intended the assembler, loader, or extended Finally, there is a large and very active to operate in a cassette environment monitor (also included on the disk), users' group dedicated to Carl Moser's with 16K or more. MAE requires a disk with a two-letter abbreviation, such as assemblers and assembly-Language pro­ and 32K. The syntax and operation are 'AW' for 'assembler warm-start.' gramming on the PET. They maintain a nearly identical. Both are available for a large disk library of assembly and other number of other 6502 machines, which The assembler offers a wide variety PET programs. comes in handy when transferring pro­ of pseudo-ops, including codes to han­ grams from one machine to another. dle data, address, and word storage; ATUG Disk Exchange listing generation; assembly from a se­ c/o Brent Anderson MAE is a macro assembler. Macros quence of modules with a control file 200 S. Century allow you to assign a name to a fre­ (not implemented in ASM/TED); as Rantoul, IL 61866 quently used sequence of instructions. well as the macro, conditional assem­ (217) 893-4577 Each time you want to include this se­ bly, and interactive assembly com­ quence later in your program, you in­ mands, and the more usual pseudo-ops. MAE and ASM-TED are available struct the assembler to expand the from Eastern House Software (3239 macro you name. This can save a lot of Unlike the standard three-letter Linda Drive, Winston-Salem, NC time on large programming projects. syntax, MAE uses two-letter codes, 27106). MAE comes on disk for preceded with a period. For instance, $169.95, and ASM-TED on cassette for Another powerful feature of MAE is instead of ORG, MAE uses .BA (begin $49.95. Specify BASIC ROM and disk conditional assembly. One popular ap­ assembly.) format. plication of this capability is to allow one source listing to generate different There are other deviations from nor­ The Transactoi is Back! object files, depending on which ROM mal 6502 assembler syntax. Page zero After a brief absence, The Transactor set you have. labels must be preceded with an aster­ is back. Commodore decided to discon­ isk. To specify the high byte of a label, tinue publishing it after Volume 3. Karl Another feature is interactive assem­ the syntax is: #H, Label. It is also im­ Hildon has left Commodore to con­ bly, where the assembler pauses to get portant to distinguish in the equate tinue as editor of the new Transactor, some input from the user before it con­ portion of the file between label refer­ now under the auspices of Canadian tinues assembling. MAE supports labels ences internal and external to the pro­ Micro Distributors. The new publica­ tion will undergo some changes, in­ Sample MAE Listing cluding a glossier presentation, adver­ tising, and a more reference-oriented format. Most of the same authors will 0010 USRVEC -DE $01 continue to contribute. A subscription 0020 SCREEN .DE $8000 0030 : to Volume 4 is $15 US or Canadian. 0040 .BA $360 j 2ND CASSETTE BUFFER 0050 . OS The Transactor 0060 Canadian Micro Distributors 03*0 — 00 0070 INIT LDA #L-SCREEN 500 Steeles Avenue 0362- 85 01 0080 STA *USRVEC Milton, Ontario L9T 3P7 0364— A 9 80 0090 LDA # H , SCREEN 0366- 85 02 0 1 00 STA #USRVEC+1 Canada — A0 00 0 1 1 0 LDY #0 036A- 0 1 20 LOOP TV A Midnight Software Gazette and 036B— 31 01 0 130 STA ,Y The Paper Merge 0360— 88 0140 DEV BNE LOOP 036E- D0 FA 0 1 50 The Midnight Software Gazette, 0370- 00 0160 BRK 0 1 70 . EN now published by the Central Illinois

No. 52 - September 1982 78 MICRO - The 6502/6809 Journal PET Users' Group on a SASE basis, and Another new Commodore-oriented other dealers. Midnight has concen­ The Paper, now published by Ralph newsletter is being published by Roger trated on reviews and news, so it will Bressler, have merged. The name of the Olanson. Further information was not be useful to see it all in one place. new publication will be determined by available at press time. the results of a reader contest, in which Patch for 2031 the grand prize will be a VIC. Current Strictly Commodore with Upgrade BASIC Paper subscriptions will be fulfilled 47 Coachwood Place, N.W. with issues of the new publication. A Calgary, Alberta T3H 1E1 Willi Kusche (creator of KMMM six-issue subscription is $20 — US, Canada Pascal, reviewed here in the January Canada, and Mexico; $30 — foreign issue) of Bellwamr, NJ reports a prob­ surface,- and $40 — foreign air mail. As lem in the operation of the CBM 2031 with the Midnight Software Gazette, single disk drive with Upgrade ROM The Whole PET Catalog the new publication will be mailed (3.0) PETs. He has provided the follow­ Now Available First Class. Advertising is $25 per ing patches to the $F000 ROM: quarter page. The Midnight Software Gazette has F17F 4C ED FF published a book called The Whole Midnight Software Gazette F182 EA PET Catalog, which will include the (for the moment] contents of all of the first seven issues c/o Jim Oldfield FFED AD 40 E8 of Midnight, plus what would have 635 Maple Street FFF0 29 FB been issue number 8. The material has Mt. Zion, IL 62549 FFF2 8d 40 E8 been updated, edited, and reorganized. FFF5 A9 5F In addition there will be full listings of FFF8 4C 87 FI the contents of both the ATUG and Other Commodore-oriented TPUG libraries. The price for The Publications Whole PET Catalog is $10 from the You can program a substitute above address or it may be obtained EPROM yourself, or he will provide The Code Works has decided to from AB Computers (252 Bethlehem one for $15: discontinue publication of its famous Pike, Colinar, PA 18915, (215) Cursor cassette magazine until the new 822-7727), Professional Computer WILSERV INDUSTRIES Commodore-64 is released. In the mean­ Sales (117 Skyway Avenue, Toronto, P.O. Box 456 time, they will publish a newsletter. Ontario, Canada, (416) 675-7818), and Bellwamr, NJ 08031 JMCRO

• ADVENTURE SERIES SOFTWARE • MAC H IN E-CODE TRACER • NEWSLETTERS OSI BASIC 6800/6809 SOFTWARE • GRADE REPORTER Summary Manual OSI GAMES • STATES & CAPITOLS DRILL The necessity for the serious programmer; HARDWARE PRODUCTS • ACCESSORIES a summary of commands, statements, ALGEBRA LESSONS • EXPANSION BOARDS peeks and pokes, error msgs, system limits, PET SOFTWARE • AIM REAL TIME CLOCK ASCII code (alpha and numeric sequence); • JOYSTICK INTERFACES • 65D V33, 65U-V1.3 Each month MICRObits brings you a wide selection of items for sale. (See Included are algorithms and hints for the page 29 in this issue for this month’s selection.) C1, C4, C8 and C3. To place an ad in MICRObits, send your 40-word typewritten ad along with Things you wanted to know, but had no $25.00 to reach MICRO by the 20th of one to ask. the second month before publication (by September 20th for the November Twenty-one packed pages at less than issue). $1.each! — $19.95. (Indiana residents add 4% sales tax) Send to: MICRO INK MICRObits 34 Chelmsford Street C & J Supply Chelmsford, MA 01824 Box 806, Marion, IN 46952 (617) 256-5515

No. 52 - September 1982 MICRO - The 6502/6809 Journal 79 Double-Entry Formatting for Your Checkbook on the CIP

by Leo Jankowski

A simple checkbook balancing Sample Runs program for the C1P Is presented. The program Is easily *** DOLLAR AMOUNT * * * TOTAL modified for other applications and computer environments. LINE CREDIT DEBIT NET Double Entry requires: J 34.56 34.56 OSI C1P 2 569.20 45.60 3 234.56 5 6 .70 Cassette unit (optional) 4 56.70 3 .4 5 Epson MX-80 (optional) 5 456.12 56.78

TOTALS * 1351.14 - * 197.09 * * 1154.05 A drawback to many checkbook bal­ ancing programs is that they are more difficult to use than the pencil and paper approach! After all, you just need *** DOLLAR AMOUNT %%% TOTAL a credits column, a debits column, their totals, and difference. LINE CREDIT DEBIT NET This program, designed primarily for use with a printer, provides this in­ formation. As is, the program is not 1 2300.34 concerned with check numbers, but if 2 450.10 3 3 4.40 needed, they could be input as another 4 00.01 column of (unformatted!) figures. The 5 34.50 program could be easily adapted for 6 23. 10 7 12.00 other uses that require simple double­ 8 6 .4 0 entry bookkeeping. By changing the headings to, say, GROSS PAY and TAX, a record could be made of pay­ TOTALS * 2791.25 - * 69.60 * * 2721.65 checks and tax-bites due.

The user is given a choice of one en­ try per line or two. Every line used is removed without affecting the pro­ Important Variables numbered. Entries can be positive or gram. Also, lines 3070 to 9998, and line negative, and in any format. Leading 140, could be omitted without affecting C$ clear screen zeros can be omitted. The decimal the guts of the program. CO column point is not mandatory for dollar-only EN$ one entry per line or Changing line 170 to 170 READ CA, amounts. The only drawback is that two the largest amount or total must be less allows you to use the program with than or equal to 9999.99. The C1P DATA statements that have been added FF counter for Form Feed rounds off to seven significant figures to the listing or that are to be read in FL form length or more, which introduces small arith­ from tape. MU$ money string to be metical errors. formatted N line number No entry-error checking routine is Mr. Jankowski has been involved with computers for 12 years. He now owns a NSUM negative, 2nd column provided. Peculiar printouts will follow Superboard and has several projects sum entries like 45.006! An error routine underway, including writing programs to PSUM positive, first column would have made the program unneces­ teach Statistics and to keep stock records sum sarily complicated. The character codes in fanning. He may be contacted at Otaio in line 3080 are for the Epson MX-80. RD1, Timaru, New Zealand. POKE 517,255 printer ON All lines containing REMs can be POKE 517,0 printer OFF

80 MICRO - The 6502/6809 Journal No. 52 - September 1982 Listing 1 10 P0KE515,0 :REM turn off LOAD. 9 0 E N *= "Y M 100 FF=9:CO=22:FL=61sBL*=CHR*<32) 110 C*«CWt*<127) :L*=CHR*<10) :CR*=CHR*<13) 120 FH*= "CRED IT *': SH*= " DEB IT "* TH*=“T0TAL " : XH*® “NET " 1 2 5 : 1 3 0 : 135 REM Go -for Instructions & print headings. 140 GOSUB4000* 80SUB3070 141 s 1 4 5 s 146 REM Turn Printer OFF & ask -for Input. 150 C0=22:P0KE517,0 170 INPUT" Cash amounfjCAsPRlNT ISO CENTS=CASH*100 190 IFCA>OTHENPSUM®PSUM+CENTS»GOSUB7 0 0 :G0TQ150 200 IFCA0THENPRINTCR*: G0T0760 750 IFPE>0ANDCA<0THENC0s 2 2: GOTOSOS 755 C 0=22:IF PE<0ANDCA 810 IFL=3THENL=5: MU*®“ 0 0 "+RIGHT* < MU*, 2) s GOTOS55 820 IFL=2THENL=4: MU*=-00 0 n +RIGHT* < MU*,1 > :G0T0Q55 830 I FCE< 0ANDL=3THENMU*= " 00 " +RI GHT* < MU*, 2 >: G0T0855 840 IFCE<0ANDL=2THENMU*®"000"+RIGHT* (MU*, 1) s GOT0855 845 MU*=RIGHT* 855 L=LEN 874 REM Form—feed ? 8 7 5 FF=FF+-1 s I F F F= F L THEN PRINTCHR* < 12 ) AN HIGH 876 REM Print the -formatted amount. Let Unique Data Systems help you raise your sights on AIM 65 880 PRINTTAB ; applications with our versatile family of AIM support products. 890 PE=CA:RETURN 8 9 5 s •Go for high quality with our ACE-100 Enclosure. It accom­ 8 9 6 : modates the AIM 65 perfectly, without modification, and features 897 REM Last amount Has 0, so now print to tals. easy access two board add-on space, plus a 3" x 5" x 17" and a 900 PRINTBL*sPRINT"TOTALS"; 4" x 5" x 15.5" area for power supplies and other com­ 905 CENTS=PSUM s PRINTTAB<14 > " * " ;s G0SUB805 ponents. $186.00. 910 C0=45:CENTS=NSUM:PRINTTAB< 3 4 ) * " 5sG 0SU B 805 • Get high capability with Unique Data System's add-on boards. 920 C0=67: CENTS»PSUM+NSUM s PRINTTAB < 56 >"= * " ; The UDS-100 Series Memory-l/0 boards add up to 16K bytes of 927 GQSUB805: PR1NTBL* 929 GOSUB2000 RAM memory or up to 48K bytes ROM/PROM/EPROM to your 935 PRINTCHR*(7>: PRINTCHR*<12) Rockwell AIM 65. You also get 20 independently programmable 940 P0KE517,Os G0T09999 parallel I/O lines with an additional user-dedicated 6522 VIA, two 1000 : independent RS-232 channels with 16 switch-selectable baud 1 5 0 0 : rates (50 to 19.2K baud), and a large on-board prototyping area. 1600 REM Print a line. Prices start at $259.00. 2000 FORX = 1T 071s PRINT "-"5 s NEXT s P R IN T B L *: RETURN • If you need to protect against RAM data loss, the UDS-100B of­ 2010 : fers an on-board battery and charger/switchover circuit. $296.00. 2020 s • Heighten your AIM 65's communications range by adding the 3050 REM Print headings. UDS-200 Modem board. It features full compatibility with Bell 3070 POKES17,255 System 103 type modems and can be plugged directly into a 3075 REM Commands to EPSON 80 P rin ter. home telephone jack via a permissive mode DAA. No need for a 3 0 e © PRINTCR**PRINTCHR*<27) 5: PRINTCHR*<69) data jack or acoustic coupler. The UDS-200 also has software- 3090 G0SUB2000 selectable Autoanswer and Autodial capability with dial tone 3 1 0 0 PR IN TTA B<1 7 > " * * * DOLLAR AMOUNT ***"5 detector. The modem interfaces via the AIM 65 expansion bus, 3110 PRINTTAB <65> TH* with the on-board UART and baud rate generator eliminating the 3120 G0SUB2000SPRINTL* need for an RS-232 channel. $278.00. 3 1 3 0 PR IN T" LIN E"TA B <17> FH*TAB <41> SH*TAB < 6 7 ) XH* •The UDS-300 Wire Wrap board accepts all .300/.600/.900 IC 3140 GQSUB2000SPRINTL* sockets from 8 to 64 pins. Its features include an intermeshed 3 1 5 0 P 0 K E 5 1 7 ,O s RETURN power distribution system and dual 44-pin card edge connectors 3 5 0 0 s for bus and I/O signal connections. $45.00. 3 6 0 0 s • Get high performance with the ACE-100-07 compact 4" 5" 3610 REM Instructions. x x 1.7" switching power supply, delivering + 5V @ 6A, + 1 2V @ 1 A, 4000 PRINTC* 4010 PRINT" When prompted en ter" sPRINT and + 24V for the AIM printer. $118.00. 4020 PRINT" your money am ounts.PRINT Installation kits and other related accessories are also avail­ 4030 PRINT" They can be negative'1 able to implement your AIM expansion plans. Custom hard­ 4035 PRINT:PRINT" or p ositive." ware design, programming, and assembled systems are also 4040 PRINTsPRINT:PRINT" Last amount must be 0 .M available. High quality, high capability, high performance, with 4050 PRINT:PRINT: PRINT:PRINT high reliability... all from Unique Data Systems. Call or write 4060 INPUT" Two entries per line";EN * for additional information. 4070 IF LEFT*="NMTHENEN*“ "N" 4080 PRINTC*:RETURN Unique Data Systems Inc. 4 0 9 0 : 9 9 9 8 DATA 0 1600 Miraloma Avenue, Placentia, CA 92670 9 9 9 9 END (714) 630-1430

No. 52 - September 1982 MICRO - The 6502/6809 Journal 81 LOWERS TH E BOOM ARK COMPUTING ON HIGH PRICES

SPECIALS GAMES

Softporn Adventure (no grapniesi $29 9 5 /9 1 9 .9 5 Upper Reacnes ol Apshai $19.95/915.95 16K Ram Board $ 7 9 .9 5 * 0 Mission Asteroids $19 95/914.95 The Keys to Acheron $1995/915.05 • 1 Mystery House 80 Column Board (Wiz-so) $ 1 9 5 .0 0 $24.95/916.95 Datestones o f Ryn $19.95/915.95 * 2 Wizard & Princess $32.95/919.95 Morloc's Tower $19 9 5 /9 1 5 .9 5 •3 Cranston Manor $34 9 5 /9 2 4 .9 5 Ricochet $19.95/915.95 Parallel Printer Interface (w/cabie) $ 5 9 .9 5 * 4 (Jlyesses 4 (he Golden $34.95/924.95 Slarlleet Orion $24.95/19.95 Fleece Invasion Orion $24.95/919.95 (compatible with Pascal, Basic, CP/M) •5 Time Zone $99.95/969.95 The Dragon's Eye $24 95/919.95 Hi-res Cribbage $24.95/919.95 Tues. Morning Ouarterback $29.95/921.95 Z-80 Softcard $ 2 5 9 .9 5 Hi-res Soccer $29.95/919.95 Jabbertalky $29.95/21.95 Hi-res football $39.95/929.95 Sorcerer of Siva $29.95/921.95 Joyport $ 5 9 .9 5 Sabotage $24,95/619.95 Rescue at fiigel $29.95/921.95 Jawbreaker ARK Special $ 2 9 5 .0 0 $29.95/919.95 Crush, Crumble, a n d Chomp $29.95/921.95 Threshold $39.95/924.95 Temple ol Apshai $39.95/929.95 Miasle Oelense $29.95/919.95 Helllire Warrior $39.95/929.95 (includes Wiz-80, Lazer Keyboard Plus, Lazer Crossfire $29.95/919.95 Star W arrior $39.95/929.95 Pegasus $29.95/919.95 Heres golf $ 2 9 .9 5 /9 2 1 .93 Lower Case Plus) Warp Destroyer $29.95/921.95 Race lor Midnight $29.95/921.95 Star Crusier On-Line Systems: General Manager $ 9 9 .9 5 $24.95/919.95 Midnight Music $34.95/924.95 Adventure $29.95/921.95 Star Blazer $31 9 5 /9 2 4 .9 5 Diskettes w/hubring (10) $ 1 9 .9 5 Both Barrels $24,95/919.95 Apple Panic $29.95/919.95 Cyber Strike $39 95/929.95 Space Quark $29.95/919.95 Hi-Res Secrets $ 8 4 .9 5 Phantoms Five $29.95/921.95 Red Alert $29.95/919.95 Space Eggs $29.95/919.95 Track Attack $29.95/919.95 Expediter II Autobann $29 9 5 /9 2 1 .9 5 Genetic Drift $29.95/919.95 $ 5 9 .9 5 Pulsar II $29.95/921.95 Arcade Machine $44.95/929.95 The Dictionary O rbitron $29.95/921.95 Raster Blaster $29 95/921.95 $ 6 9 .9 5 Gamma Goblins $29 9 5 /9 1 9 .9 5 Tnlogy of Games $29.95/921.95 Microsoft 16K Ram Card Gorgon $39 9 5 /9 2 9 .9 5 Space Album $39 95/929.95 $ 9 9 .9 5 Sneakers $29.95/919.95 Fender Bender $24,95/919.95 Time Zone $ 6 9 .9 5 EPOCH $34 95/924.95 3-D Graphics $39.95/929.95 Cops & Robbers $34.95/924.95 Akafabefh $34.95/924.05 Lazer Keyboard Plus Outpost $29 9 5 9 1 9 .9 5 Appleoids $29 95/921.95 $ 6 9 .9 5 Dark Forest $29.95/919.95 Ulitma $39.95/929.95 Lazer Lower Case Plus $ 4 4 .9 5 Beer Run $29 9 5 /9 1 9 .9 5 LA Land M onopoly $29 9 5 /9 2 1 .9 5 6o rg $2995/919.95 Hyperspace Wars $29.95/921.95 Joy Port w/loosball $74 9 5 /9 5 9 .9 5 3-D Skiing $24.95/919.95 Lazer Lower Case Plus II $ 1 9 .9 5 Hadron $34,95/924.95 Torpedo Terror $24.95/919.95 Twerps $29.95/919.95 Computer Bingo $24,95/919.95 Anix 1.0 $ 3 4 .9 5 Computer Foosball $29 9 5 /9 1 9 .9 5 Kaves Karkhan $49.95/934.95 Wizardry Lazer Pascal $ 2 9 .9 5 $49.95/939.95 Dragon Fire $49.95/934.95 Galactic Anack $29.95/921.95 Rings o l Saturn $39 9 5 /9 2 9 .9 5 M inator $34 9 5 /9 2 4 .9 5 Alkem slone $39.95/929.95 Anix-Pac Oylmpic Decathlon $29.95/921.95 Snack Attack $29 9 5 /9 1 9 .9 5 (Anix, Pascal, Sources) Three Mile Island $39 9 5 /9 2 9 .9 5 Casino $39 9 5 /9 2 4 .9 5 $ 9 9 .9 5 ABM $24 9 5 /9 1 9 .9 5 Thiel $29 9 5 /9 1 9 .9 5 Using 6502 Robot Wars $39 9 5 /9 2 9 .9 5 County Fair $29.95/919.95 G lobal War $24 9 5 /9 1 9 .9 5 Swashbuckler $34 9 5 /9 2 4 .9 5 Assembly Language Castle W ollenslein $29 9 5 /9 2 1 .9 5 Firebird $29 9 5 /9 1 9 .9 5 $ 1 4 .9 5 Falcons $29.95/921.95 Russki Duck $34.95/923.95 Datamost Joystick Suicide $29 9 5 /9 2 1 .9 5 Horizon V $34 9 5 /9 2 5 .9 5 $ 3 9 .9 5 G rand Prix $29 9 5 /9 2 1 .9 5 Sargon H $34 9 5 /9 2 5 .9 5 Datamost Expandaport The Besl ol Muse $39 9 5 /9 2 9 .9 5 Reversal S34 9 5 /9 2 5 .9 5 $ 4 9 .9 5 Flight Simulator $33 5 0 /9 2 6 .9 5 Zork Dungeon Campaign $17 5 0 /9 1 4 .9 5 2ork II $39 9 5 /9 2 9 .9 5 Odyssey $29 9 5 /9 2 1 .9 5 Pool ! 5 $34.95/924.95 HARDWARE BUSINESS SOFTWARE Escaoe From Arcturus $24 9 5 /9 1 9 .9 5 ShufNeboard $29.95/921.95 Palace in Thunoerlano $24.95/919.95 Trick Shot $39 95/929.95 12" hi-res green display $285 00/*159.95 Mail Label & Filing System $74 95/949.95 MAD venture $24.95/919.95 Crossword Magic $49 9 5 /9 3 9 .9 5 Roach Motel 12" lo-res colo r display $430.00/9349.95 Payroll $395 00/9295.00 $34,95/926.95 M aster Type (ht-res) $39 9 5 /9 2 9 .9 5 English SAT t \ 12" hi-res RGB colo r display Si 095 0 0 /9 8 9 5 .9 5 General ledger(w/payabies) $495,00/9395.00 $29 9 5 /9 2 1 .9 5 Dogfight $29.95/921.95 Apo.U5 The Mail Room $34 95/924.95 Supertalker SD2000 $199,00/9149.95 CPA i General Ledger $249 95/9169.95 Romplus $155 00/9124.95 CPA II Accounts Receivable $249,95/9169.95 UTILITIESUTILITIES flom wnter $ i 75 0 0 /9 1 3 9 .9 5 CPA III Accounts Payable $249 9 5 /9 1 6 9 .9 5 Mus'C System $395 0 0 /9 2 9 5 .9 5 $249 9 5 /9 1 6 9 .9 5 CPA IV Payroll Hl-Ree Secrets (O. Fudge) 9124.U5/984.95 LISA v2 5 $79.95/959.9! A /D rD /A $350.00/9249.95 CPA v Property Manage $24995/9169.95 Super Shape Drg & Animate $34 95/924.95 LISA Educational Pack $1 19.95/979.9S Expansion Chassis |! ?5v) $750 0 0 /9 4 9 5 .OO Thy Home Accountanj $74.95/954.95 The Creative Toot Box $44 95/934.85 Speed/ASM $39 9 5 /9 2 9 .9 ! CPS Multifunction Card $239 0 0 /9 1 4 9 .9 5 Word Star S3 75.00/9195.00 Applesotl Compiler $175.00/129.95 Expediter II $99 95/959.9! RAM Plus f- (32 RAM Board $189 0 0 /9 1 3 9 .9 5 Supersort $200 00/124.95 Datadex $150 00/999.95 Disk Organizer 11 $29 95/»ai .92 w/t 6K installed) Mail Merger $125 00/*T9.95 Using 6502 Assembly Lang $19 9 5 /9 1 4 .9 5 A pplesoft Plus $24 95/919.9! COPVROM $55 0 0 /9 4 4 .9 5 Oala Star $300 00/9195.00 ANIX (UNIX-like Oper sys j $49.95/939.05 Applesoft Optimizer $24 95/919.9! KeyDoaro Filler ROM $55 0 0 /9 4 4 .9 5 Spellstar $200 0 0 /9 1 2 4 .9 9 Lazer Pascal $39.95/929.95 Disk Recovery $29 95/921.9! 1 j Key Keyoad inew or oidl $125 0 0 /9 9 4 .9 5 Calc star $200 0 0 /9 1 2 4 .9 5 DOSOURCE 3 3 $39.95/924.95 Multi-disk Catalog $24 95/919.9! Bar code reader $195 0 0 /9 1 4 5 .9 5 Visicalc 3 3 $250 0 0 /9 1 7 9 .9 5 Painter Power $39 9 5 /9 2 9 .9 5 Back it up S59 9 5 /9 3 9 .9 ! Soitkey {! 5-key user-detmi SI 50 00/91 19.95 PFS (Personal Ftimg Sysiemi S>25 0 0 /9 8 9 .9 5 The voice $39 9 5 /9 2 9 .9 5 image Printer $29.95/929.0! Asynchronous Senal $179 95/9129.95 PFS Report $95 0 0 /9 6 9 .9 5 E-Z Draw $49 9 5 /9 3 9 .9 5 Pascal Lower Case $24 95/919.92 Daiamosi Joystick $59 9 6 /9 3 9 .9 5 The Correspondeni $59 95/949.95 Pascai Graphics Editor $99 9 5 /9 6 9 .9 5 Dos Plus $24 95/91 9 .9 ! Datamost Expandaoort $69 95/949.95 M ailing Lisi Daianase $49 9 5 /9 3 9 .9 5 ACE $39 95/929.95 The Original Quick Loader $24 95/919.9! Micromodem $379 00/9269.00 Higher Text II $39 9 6 /9 2 9 .9 5 Apple-DOC $49 9 5 /9 3 9 .9 5 Typing Tutor $24 95/919.9! Sm anm odem (RS-232) $279 0 0 /9 1 9 9 .0 0 Di.-fclory Manager v2 $29 95/921.95 Ust Master $39 9 5 /9 2 9 .9 5 Fortran $195 00/9139.9! Lower Case +-|Rv 6 & earherl $64 95/944.95 Real Estate Analysis Pgm 30 % O FF ASCII Express $7 9,9 5 /9 5 9 .9 5 A L.D S $125 00/969.9! Lower C ase + 11 (Rv 7 & Ltr I $24 9 6 /9 1 4 .9 5 PiE WRITER (c a ll fo r d e ta ils) 2-Term (reo's 2-80 Card) $99 9 5 /9 8 9 .9 5 Basic Compiler $395 00/9295.01 Lower Case+IH(Rv 7 & H r ) $49 9 5 /9 3 4 .9 5 Easy Mover 40-column $49 9 5 /9 3 9 .9 5 Z-Term Pro $149 95/999.95 CoDol $750 0 0 /9 4 9 5 .0» Keyboard #Plus $99 9 5 /9 6 9 .9 5 Easy Mailer 40-column $69 96/949.95 Speed Star $134 95/999.95 TASC $1 75 00/91 29 .9 ! Character Sel + p |us $24 9 5 /9 1 9 .9 5 Easy Writer 40-column $99,95/974.95 On-Line $89 9 5 /9 6 9 .9 5 Oala Plot $59.95/944.9! Sup R' Term 80-col board $395 0 0 /9 2 9 5 .0 0 Pro Easy Mailer $175 00/9124.95 0 8 M asier S229 00/91 59.95 DB Utility Pack $99 0 0 /9 6 9 .9 ! Sup R'Switcher(pwr suppl) $295 0 0 /9 1 9 5 .0 0 Pro Easy Writer $ 2 4 9 9 5 /1 7 9 .9 5 A35 35-track disk drive w/o $4 79 0 0 /9 3 7 9 .0 0 Suoer Scribe n $129 95/979.95 controller A35 35-irack disk clove w/ $579 00/5440,00 controller Wa accept: MASTERCARD, VISA (Include card » and expiration date), CASHIER or CERTIFIED CHECKS, MONEY ORDfcnS, or PERSONAL CHECKS (Please allow lO A40 40-track disk drive w/o $449 0 0 /9 3 5 9 .0 0 days to clear). Please add 3V« lor shipping & handling (minimum $2.00) Foreign orders please add 10% lor shipping & handling. controller We accept COD's (Please Include $2.00 COO charge). C alifornia residents add 6% sales tax. A ll equipment Is subject to price change and availability w ithout notlca. AH A40 40-lrack disk drive w/ $549 0 0 /9 4 4 9 .0 0 equipment is new & complete with manufacturer's warranty. controller A70 70-lrack disk drive w/o $599 0 0 /9 4 9 9 .0 0 Apple is a registered trademark ot APPLE COMPUTER INC. controller A70 70-track disk drive w/ $699 0 0 /9 5 9 9 .OO conlroiler YOUR SALVATION IN THE SEA OF INFLATION P.O. BOX 2025 CORONA, CALIFORNIA 91 720 ARK COMPUTING (714) 735-2250

82 MICRO - The 6502/6809 Journal No, 52 - September 198: Auto SAVE for the PET

by Louis F. Sander

This routine makes automatic Key AUTOSAVE into your PET ex­ uses location 2. Possible (but untested) cassette backup copies of your actly as it is listed, then save it on tape alternates in this case are TI% = 6 for PET BASIC programs at regular for further use. It is important that original ROMs and TI% = 15 for all intervals. Properly used, it can lines 63630 to 63648 take up no more others. keep you from losing your than 17 screen lines, so don't use any temper and your creative unnecessary spaces in them. The six If you are starting your main pro­ programming work. characters immediately after 'BACK­ gram from scratch, just load AUTO­ UPS' in line 63638 and 'DATE' in line SAVE before you begin; if the main pro­ 63640, consist of three SHIFTED gram is already on tape, add AUTO­ SPACEs, followed by three CURSOR SAVE with an APPEND program. Or, LEFTs. Shifting the spaces is very im­ just follow these steps: AUTOSAVE portant because it lets you answer an requires: INPUT statement by pressing RETURN. PET with cassette 1 . LOAD and LIST AUTOSAVE. Don't Line 63630 requires a bit of explana­ touch the keyboard after the LIST. tion. You will normally change this line, making TJ$ = the eight-character 2. Mount the main program tape in This short subroutine averts the name of your main program. TK is the TAPE #1, so that the main program anguish, anxiety, and anger that result number of saves to be made at backup is the next one on the tape. from system crashes during BASIC pro­ time, which you might also want to gram development. AUTOSAVE makes change. TI% is a POKE location used 3. Type LOAD, but don’t hitRETURN. timely backup copies of the work in by the subroutine, and TI% = 2 is fine progress. So if you've ever seen your unless your main program calls the 4. Press PLAY, then quickly hit best creative effort swallowed up by a rarely used USR function, which also RETURN. machine whose keyboard is locked out, read on for help.

You use the AUTOSAVE subroutine by putting it at the very end of your pro­ gram, and by putting a GOSUB call at the very beginning. Then each time 6 3 6 2 4 REM * * * AUTOSAVE SUBROUTINE **# you RUN your main program, which 6 3 6 2 6 REM LOUIS F. SANDER you will certainly do as you check the lines you are writing, AUTOSAVE will 6 3 6 2 7 REM 153 MAYER DRIVE be called first. If an hour or half hour 6 3 6 2 8 REM PITTSBURGH, Pfl 15237 point has passed since the last SAVE, 6 3 6 2 9 REM AUTOSAVE will ask you if you'd like 63630 TJ$="AUTOSAVE *:TK=3:TI*=£:TJ=1 8 30 to make some backup copies. If you 60:I=INT(TI/TJ>:REM *** AUTOSAVE *** would, AUTOSAVE will make as many 6 3 6 3 2 IFI+1THENlNPUT“iS3TII'iE'' ; as you wish, using a 16-character pro­ TK$: TI$=TK$+n0 0 “ : POKETI':,TI.''TJ+l: RETURN gram name consisting of the date and 63634 IFPEEKC T I*> = I +1THENRETURN time of the SAVE, plus an eight- 63 6 35 POKETI^,1+1 character identifier chosen earlier by 63 6 36 PRIHT°li>395TIME IS “ L E F T S ' 71$,4 j; you. AUTOSAVE will also give you 63638 INPUT". SAVE BACKUPS illi";TK$:I special guidance in handling and mark­ FLEFT*(TK $,1 X>"Y"THENRETURN ing your backup cassette. 6 3 6 4 0 INPUT"[ffi3DflTE HfflT ;TK$: PRINT"IH2M OUNT BACKUP TAPE, THEN HIT *B'“ Then, if disaster strikes, just load 63642 GETA$:IFA$< >“B“THEN63642 your most recent backup and repeat 63644 TJ$=TK$+LEFT$(TI$,4 >+TJ$:FCRI=1T0 your work since the time of its SAVE. TK: SRVETJ*:PRINT“MSAVED "T J # :NEXT In the worst case, you might lose 30 minutes worth of work. Since each 63 6 4 6 PRINT “D83LABEL TAPE, THEN HIT 'L'" backup's name includes the time it was :PRINT"Ct]“ ,-:GETAt: IFA$< >“L“THEN63646 saved, the most recent one will be easy 6 3 6 4 8 RETURN to find.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 83 5. When the main program has loaded, special tape handling instructions are AUTOSAVE's line 63630 should be designed to have you take the cassette OHIO SCIENTIFIC at the top of your screen. HOME out of the recorder and label it; both THE WIZARD’S CITY - your cursor and add the AUTOSAVE steps inspire good operating practice. search for gold in the dun­ lines to your program by hitting AUTOSAVE has been thoroughly geons beneath the Wizard’s RETURN eleven times. tested on an original ROM PET. Since city or in the surrounding it depends on TI$ for its success, if your forest. A dynamic adventure main program alters TI$ or shuts off the allowing progress in strength Now edit line 63630 so that TJ% = jiffy clock, AUTOSAVE will not work and experience. All OSI — the name of your main program, and properly. cassette $12.95, disk $15.95. add a GOSUB 63630 as the first line of OSI HARDWARE 15% OFF your main program. If for some reason If you'd like a detailed description RETAIL PRICES! you don't expect to RUN your main of the theory behind AUTOSAVE, just GALACTIC EMPIRE — a strat program from the beginning much drop me a line at the address provided. egy game of interstellar con­ while writing code, put some GOSUB quest and negotiation. Com­ 63630's in the program sections you pete to discover, conquer, and will be running. Also finish the main rule an empire with the com­ program with an END statement to puter or 1-2 other players. C4P, keep it from falling through to C8P cassette $12.95, disk AUTOSAVE. $15.95. Louis F. Sander designs and markets AIR TRAFFIC ADVENTURE — Here are some final notes: Entering electronic systems for hospitals and other a real time air traffic simula­ a GOSUB 63636 in immediate mode health care providers. He is the originator tion. C4P, C8P disks $15.95. of COMPUTER KINDERGARTEN™, a will generate an automatic save at any Plus S-FORTH, PACKMAN, computer familiarization course for adults, CRAZY BOMBER, ADVEN­ time. Notice that 63636 is a symme­ and has written computer-related articles trical number, and therefore easy to for several publications. He has worked TURE, TOUCH TYPING, IN­ remember. When AUTOSAVE asks you with electronics since pre-transistor days. TELLIGENT TERMINAL and for the time, it will only accept 4-digit You may contact Mr. Sander at 153 Mayer more. Send for our free numbers from 0000 to 2359. It will ac­ Drive, Pittsburgh, Pennsylvania 15237. catalog including photos and cept anything at all as a date, but it's complete descriptions. really looking for four digits (e.g., 0101 (312) 259-3150 JMCftO for New Year's Day). AUTOSAVE's Aurora Software Associates 37 S. Mitchell Arlington Heights Illinois 60005

SIGNALMAN MARK I DIRECT CONNECT MAE SOFTWARE DEVELOPMENT SYSTEM PET BASIC SCROLL PROGRAM MODEM - $89.50 FOR PET, APPLE, ATARI Scroll thru basic program using Cursor up/down keys. Standard 300-baud, full duplex, 'The Compatible Assembler" Specify computer. $6.00 on cassette, $9.00 on disk. answer/originate. Powered by • Professional system for development of Machine Lan­ long lasting 9-volt battery (not guage Programs. 31 Characters per label. Flip ‘N’ File diskette storage case (50-6U disks)- • Macro Assembler/Text Editor for Disk-based systems. included). Cable and RS-232 $21.95 connector included. • Includes Word Processor for preparation of Manuals, etc. • Standard Mnemonics - Ex.: LDA (LABEL), Y Memory Test for Apple on Disk $9.95, on Tape • Conditional Assembly, Interactive Assembly. EPROMS - HIGH QUALITY, NOT JUNK = $6.95 • Editor has string search/search and replace, auto line Use with PET, APPlf, ATARI, SYM, AIM, etc. 450 ns. $6.50 numbering, move, copy, delete, uc/lc-capabilHy. System Saver for Apple - Fan, Surge Protection, 2 for 2716, $12.50 for 2532. We sell EPROM programmers • Relocating Loader to relocate object modules. for PET and ATARI extra outlets, Apple power cord = $75.00 • Designed with Human Factors Considerations.

5% INCH SOFT $169J95 BMC Green Screen Video Monitor. SECTORED DISKETTES FLASH!! EHS Management has decided to allow $50.00 credit 12 inch CRT, sharp, crisp 40 or 80 column display. to ASM/TED owners who want to upgrade to MAE. Toget this = $90.00 Highest quality. We use them on credit, return ASM/TED manual with order for MAE. our PETs, APPLEs, ATARIs, and other DC Hayes Smart Modem = $235.00, Micro Modem computers. $22.50/10 or $44.50/20 SMARTERM 80 COLUMN CARD FOR APPLE-$ 2 7 9 II = $289.00, Chronograph = $225.00 NEW! C. ITOH STARWRITER F-10 Upper/lower case and 80 columns. Includes 5x7 matrix C. Itoh Prowriter Printer. Better than MX80. We use DAISY WHEEL PRINTER character set, full ASCII keyboard, and true shift key constantly with our Apple and PET. Can be used on Letter quality, flawless copy at 40 char/sec. Bidirectional operation. IBM, Atari, TRS-80, etc. 120 cps, friction and tractor printing, 15-inch carriage, uses standard Diablo ribbons TYMAC PARALLEL PRINTER INTERFACE feeds, hi resolution dot graphics, nice looking, high and print wheels. FOR APPLE- $119.95 quality construction. Parallel - $499.00, with IEEE PARALLEL - $1495, RS232 - $1680, TRACTORS - $210 For use with Centronics, Starwriter, Prowriter, etc. interface for commodore - $599.00, RS232 - $660.00

3239 Linda Dr. T e r Winston-Salem, N.C. 27106 (919)924-2889 (919)748-8446 Send for free catalog!

No. 52 - September 1982 84 MICRO - The 6502/6809 Journal PRS'nl TURN YOUR APPLE PERSONAL COMPUTER INTO A PROFESSIONAL COMPUTER FOR $750. The majority of all professional computer soft­ memory expansion boards, the CP/M Handbook ware programs available today are written for the by Roanay Zaks, and complete manuals. You get CP/M® disk operating system. The SYNERGIZER everything you need for fast, easy installation and lets you access all of this vast body of sophisti­ operation in one package.* Each element is de­ cated software with your Apple II while retaining signed to complement the others, and everything the capability to access your present Apple is designed and produced by the same company. software. The SYNERGIZER. It'll turn your Apple in addition to the CP/M interface and software into a professional computer. And it costs only diskette, the SYNERGIZER gives you $750. Phone or write us, or ask your the required 80 column dis­ dealer for a SYNERGIZER play and 16K RAM brochure. Now. SYNGRGIZER Manufactured by Advanced Logic Systems, 1195 East Arques Avenue,Sunnyvale,CA 94086, (800)538-8177 (In California (408)730-0306)

Apple and Apple II are registered trademarks of Apple Computer, Inc. CP/M is a registered trademark of Digital Research, Inc., The CP/M Handbook is copyrighted by Sybex, Inc And the SYNERGIZER was our idea. * All SYNERGIZER Components are also sold separately. TM Apple Pascal: A Hands-on Approach, by pages, 9!4 x 6 inches, paperback. Arthur Luehrmann and Herbert Peck- ISBN: 0-394-70789-3 $12.95 ham. McGraw-Hill Book Company (New York, NY), 1981, 430 pages, 6 Y i In these new Sherlock Holmes Stories, x 9 inches, wire-o binding, paperback. the great detective uses a computer to ISBN: 0-07-049171-2 $14.95 analyze clues. Holmes instructs Dr. New Publications Watson (and the reader) in a way that A series of sessions (chapters) designed illuminates the mysteries of computer programming. Implementing BASICs, by William to teach you Pascal, in a method simi­ Payne and Patricia Payne. Reston lar to the way you learned English. The Publishing Co., Inc. 111480 Sunset 14 sessions provide 30 to 40 hours of CONTENTS: The Analytical Engine; Murder at the Metropolitan Club; Holmes Hills Rd., Reston, VA 22090) 1982, 210 hands-on activities for the Pascal novice. Gives a Demonstration; The Adventure of pages, 9M x 6 inches, hard cover. the Bathing Machine; A Study in Cigar Ash; ISBN: 0-8359-3045-9 The Adventure of Clergyman Peter; CONTENTS: Preface; Introduction; Get­ Holmes's Method Revealed; The Ciphered ting Started; Typing in Programs — The This book is designed to help you Message; An Advertisement in the Times; A EDITOR; Writing, Running, and Changing Study in Chemistry; The Coroner's Report; achieve better software system designs Programs; Generating Sound; Inventing and more programming techniques. The Adventure of the Gold Chip; Holmes New Words: Procedures,- More Invented Delivers a Lecture; The Final Programme; Words: Functions; Drawing Pictures; Appendix; Postscript; Index. CON TEN TS: Language Commands, State­ Branching Statements: IF and CASE; String ments, and Their Variables; Microcomputer Variables and WHILE Loops; Number Types Data Structures; Variable Table Structure; and Arithmetic; Scalar Data Types and Sets; Common Variables; Lexical Analysis, Text Arrays; Records and Files; Recursion; Where DP Directory, (P.O. Box 562, Bloom­ Atomization, and Syntax Analysis; Program Do You Go From Here? Appendixes; Solu­ field, CT 06002), monthly, 8 Vi x 11 Resolution; Program Text Coordinates; In­ tions to Problems; Index; Compiler Error inches, paperback. terpreted Program Execution; Compiled Messages. ISSN: 0730-6806 $48.00/year BASICS; Verb Failures, User-Defined Verbs, A collection of Table of Contents from and BASIC Line Editor; Timesharing Language Systems; Language System Code Elementary BASIC: Learning to Pro­ DP magazines. Provides data process­ and Its Systems Verbs; How to Write a gram Your Computer in BASIC with ing managers, analysts and researchers Language System,- Conclusions and Sherlock Holmes, by Henry Ledgard with a tool to identify important ar­ References; Appendix; Annotated Glossary and Andrew Singer. Vintage Books (201 ticles. Over fifty magazines listed. of Techical Terms; Index. E. 50th St., NY, NY 10022), 1982, 264 JM C ftO

No. 52 - September 1982 MICRO - The 6502/6809 Journal 87 f W l R

d l

You hover on the fringe, five parsecs from initialization of your mission. Your culture is tired and in need of new vitality. The Chamber can duplicate the essence of life from any species and you’re about to B T/H start your “ collection.'’ What fate awaits you on this unique mission? Is it true that cultures opposed to your sampling have i v e r s i o n s been preparing their defenses and stand thru E rw rn ready to resist your intrusions? 6 South Street M ilford, NH 0 3 0 5 5 The first module is prepared for take off □ One-year subscription (6 modules) — $60.00 — diversions thru Envyrn™ presents □ Sam ple Envyrnment™ Parsec™ only — $20.00 N a m e ______Parsec™, a graphics space adventure unlike any you’ve ever played. Parsec™, A ddress______created with the Envyrn™ graphics editor, C ity/S ta te ______Z ip ______sim ulates deep space in your TRS-80" □ Payment enclosed computer, creating an action-filled field of □ MasterCard □ VISA Exp.Date ______play larger than any other microcomputer game. Parsec™ takes you beyond the Name o f C a rd h o ld e r______screen and into worlds not yet seen by you MC#and lnterbank#/VISA#^ or your computer. Join the adventure — S ig n a tu re ______subscribe to diversions thru Envyrn™ now To order use the card provided in this issue or send in this order blan or send $20 for Parsec™, the first of six 1 own a 48K TRS-80® with Disk □ Model I □ Model modules to be released in 1982. Each TRS-80 is a registered trademark of module includes a magazine and a disk. COMPRESS — An Applesoft Optimizer

by Barton M. Bauers

This machine-language utility Listing 1: COMPRESS will not only reduce Applesoft program memory requirements 9000 1 CiRG ♦90OO by up to 30% or more, but will 9000 2 OBJ * 8 0 0 9000 A90G 3 LDfl #*OG * SET HIMEM 1 fftLUE TO increase execution and load 90G2* 8 5 7 3 4 STft * 7 3 PROTECT COMPRESS speed also. 9004 ft98D 5 LDft #*3 D 9006 8 5 7 4 6 STft * 7 4 9 0 0 8 4C D003 7 JMP *3 D 0 RETURN TO fV S 9006 ft90 0 8 LDft # *0 0 IN IT POINTERS FIND 900D flft 9 TftX REGISTERS USED COMPRESS 90OE R8 10 TftS' BV COMPRESS requires: 90OF 18 1 1 CLC 9010 8 5 0 6 12 STA * 0 6 9012 8 5 0 8 13 STft * 0 8 Apple II or Apple II Plus 9014 8D D095 14 STft *9 5 D 0 48K, Applesoft BASIC 9017 8D E095 15 STft *95EG 901ft S5FB 16 STft *FB 901C: 1=1908 17 LDR # * 0 8 901E 8 5 0 7 18 STft # 07 Note: While the listing for COMPRESS 902 0 1=1980 19 LDft #* 8D 902 2 8 5 0 9 20 STR *G9 is longer than we normally publish, 9 024 R 907 2 1 LDfl # * 0 7 MICRO feels this valuable program 9026 851 F 22 STft *1 F 9028 R901 23 LDfl # * 0 1 should be available to our readers. 902ft 85EF 24 STft *E F However, if you prefer not to key it in, 902C R 900 25 LDfl # *00 902E 8D E195 26 STft *9 5 E 1 MICRO will supply the program on 9031 8D E295 27 STR *9 5 E 2 DOS 3.3 disk for $10.00, plus $2.00 for 9034 8D E395 28 STft *9 5 E 3

9 03 7 A9G3 29 LDft # * 3 PUT DEC-HEX CONUERSION CO o UJ * (T» in shipping and handling. See page 113 9039 30 STA #95E 4 CONSTANTS IN MEMORY for order information. 903C R927 31 LDfl # * 2 7 TO PERMIT A'"S DECIMAL I ZED 903E 8D E595 32 STft *9 5 E 5 TOKENS TO BE CONCERTED 9041 R9€U 33 LDft t t * l TO HEX L IN E NUMBERS Recently announced Applesoft com­ 9043 8D D195 34 STft *9 5 D 1 904 6 fl90ft 35 LDft # *ft pilers are advertised to be up to twenty 904S 8DD295 36 STft *9 5 D 2 times faster than the Applesoft inter­ 904B 0 9 6 4 37 LDft # *6 4 904D SDD395 3S STft *95D'3 preter. Most reviewers have found, 9050 R9ES 39 LDft # *E S however, that in practice these com­ 9052 SDD495 40 ST h *9 5 D 4 9055 1=1910 41 LC'ft # * 1 0 pilers perform at about twice the 9 05 7 8D D595 42 STft *9 5 D 5 operating speed of the interpreter. 905ft A 200 43 LDX # *00 START ROUTINE TO 905C R9FF 44 LD h #*FF BLANK TABLES Recognizing that program compilation 905E 45 PAG involves a significant amount of over­ 905E 9D 003D 46 CLR1 STft * 8DOO,X BLANK PAGE * 8D 9061 E0FF 47 CPX #*FF head, many programmers have avoided 9 06 3 F0G4 4 8 BEQ CLR2 them or reserved them for specific ap­ 9065 E 8 49 I NX 9066 4C5E90 50 JMP CLR1 plications. Since compilers do not 9069 ft 200 51 CLR2 LDX # *00 dramatically increase speed, and since 906B 9D0OSE 52 CLR3 STft *8 E 0 0 -• X BLANK PAGE *SE 906E E0FF 53 CF'X #*FF some programs require that variables 9070 F 0 0 4 54 BEQ CLR4 and arrays be dimensioned while the 9072 E8 55 I NX 9073 4C 6B90 56 JMP CLR3 program is being executed (a feature 9076 ft2 G0 5? CLR4 LDX # *00 most compilers don't support), the 9078 9DG0SF JO CLR5 STft * y F0 u .>x BLANK PAGE *SF 907B E0FF 59 CF’X # *F F Applesoft interpreter is often the better 907D F03E 60 BEQ NOW compromise. 907F E 8 61 I NX 9080 4C789© 62 JMP CLR5 9083 C8 63 INCY INV SUBROUTINE TO INCREMENT COMPRESS is a machine-language 9084 C0OG 64 CF"-,1 # *00 V-REG AND CHECK TO 9086 0 0 0 8 65 BNE GOBh K SEE IF PAGE BOUNDARY program that will optimize most pro­ 908S 8 6 ED 66 i-TX *ED CROSSED 903ft ft6 IF 67 LDX *1 F grams in less than ten seconds. To en­ 90SC F6G0 68 INC * 0 0 , X sure clarity, COMPRESS allows the use 90SE R6 ED 69 LDX *EL> 9090 6 0 70 GOBftK RTS of many REM statements in source pro­ 9091 20DDFB 71 ERROR JSR *FBDD ERROR ROUTINE TO grams. Variables can be dimensioned 9094 R9C5 72 LDft # *C 5 PR IN T ERROR CODE 9096 2OF0FD 73 JSR *F D F 0 • # AND RETURN within programs, and can appear in the 9099 A9D2 74 LDft # *D 2 TO ft--'S ABORTING program before they are dimensioned 9096 20F0FD 75 JSR *F D F 0 COMPRESS (another feature the compilers can’t (Continued)

No. 52 - September 1982 MICRO - The 6502/6809 Journal 89 match). But actual control during ex­ Listing 1 (continued) ecution must pass to those statement numbers after they are dimensioned. So 909E 2OF0FD 76 JSR SFDFO 90A1 A9CF 7? LDA#*CF COMPRESS does not interfere with any 90A3 20F0FD 7S JSR SFDF0 normal interpreter capabilities. 90A6 A9D2 79 LDA # *0 2 90AS 20FOFD SO JSR *FD F 0 90A 6 A9A0 81 LDA # *A 0 90AD 20F0FD 82 JSR SFDFu Although COMPRESS can be 90BG A9A3 S3 LDA # *A 3 thought of as a poor man's compiler; it 9 06 2 2OF0FD 84 JSR *FD F 0 90B5 A5F9 85 LDA *F 9 is not a compiler at all. It merely 90B? 20OAFO 86 JSR *FDDA reduces Applesoft programs to their 96BA 4C D003 8 ? JMP *3 0 0 90BD B 106 88 NOW LDA C * 0 6 > , V PROGRAM STARTS HERE minimum configuration. 96BF 2 0 8 3 9 0 8 9 JSRINCV GET A BVTE - INC V-REG 90C2 C 900 90 CMP #*00 IS IT e? 90C4 F03C 91 BEQ TSTR VES - CHECK FOR END OF PROGRAM COMPRESS occupies 2.3 kilobytes 90C6 C9C4 92 CMP # *C 4 IS IT 'THEN"? of free RAM memory, just below DOS 90C8 F 0 1 3 93 BEQ THEN VES 90CA C9AB 94 NTHG CMP #*AB IS IT ''GOTO'? in a 48K Apple II Plus. It also uses 90CC 95 PAG about 30 bytes of zero-page storage for 90CC F 0 5 5 96 BEQ LOAD YES 93CE C9B0 97 CMP #*B 0 IS IT 'GOSUB'? pointers. Typical programs can be re­ 90D0 F 051 9S BEG LOAD VES duced 15% or more in memory require­ 90D2 C96C 99 CMP #*BC IS IT •'LIST''? 9 004 F04D 10 0 BEQ LOAD VES ments, with up to 30% or more for cer­ 9006 C9SS 10 1 CMP # * 8 5 IS IT -DEL'? tain programs that contain a large 9008 F 0 4 9 10 2 BEQ LOAD VES 90DA 4CBD90 103 JMP NOW GO GET ANOTHER BYTE number of REMs or other redundant 90OO S5FD 104 THEN STA *FD PUT A-REG AS I DE code. But COMPRESS is not simply a 90DF B 106 105 LDA < *0 6 !> V GET ANOTHER BYTE 90E1 20S39O 106 JSR INCV INC V-REG REM remover. The programmer is en­ 90E4 C 9AB 107 CMP #*AB IS IT '■ GOTO•" ? couraged to insert a great deal of nar­ 9GE6 F03B 103 BEQ LOAD VES 90ES 3 8 109 SEC FIN D OUT IF THE TOKEN IS rative in the original source program so 90E9 E 9 3 0 1 1 0 SBC # *3 S A L IN E NUMBER REF. that any modifications required later 90EB 3 0 0 5 1 1 1 BMICLRIT NO, IT ISIN'T 90ED 3 8 1 1 2 SEC can be easily made to the source code 90EE E90A 113 SBC # * 0fl and then recompressed. 90FG 3 0 0 8 114 BMI GOT IT VES IT IS ! 90F2 208893 115 CLRIT JSR DECS1 BACK UP ONE 90F5 A5F0 116 LDA *FD GET A-REG BACK What COMPRESS Does 90F? 4CBD90 117 JMP NOW FALSE ALARM 90FA 2 0 3 8 9 3 118 GOT IT JSR DECV BACK UP ONE 90FD A5FO 119 LOA * F O GET A-REG BACK COMPRESS removes line numbers, 90FF 4C 2391 12 0 JMP LOAD GO FORWARD 9 10 2 6 1 0 6 1 2 1 TSTR LDA < *06 , V GET ANOTHER BVTE redundant statements, etc., and con­ 9 10 4 2 0 8 3 9 0 1 2 2 JSR INCV INC V-REG catenates as many Applesoft state­ 910 ? C90S 123 CMP #*00 IS THIS 0 ALSO? 9 10 9 F00C 124 BEQ PEND VES - 2 IN A ROW ments as can be legally assigned to one 910 6 208390 125 JSR INCV NO.INC V-REG line number. For example, consider 910E 2 0 8 3 9 0 126 NOTND JSR INCV INC V REG AGAIN 9111 2 0 8 3 9 0 1 2 ?JSR INCV AND AGAIN this program: 9114 4CBO90 128 JMPNOW CONTINUE ON 911? B 106 129 PENO LDA < * 0 6 ) >V LOOK AT NEXT BVTE 9 1 1 9 2 0 8 3 9 0 130 JSR INCV INC V-REG 10 LET J = 5 911C: C 9 00 131 CMP # *0 0 IS THIS THE THIRD 0? 20 LET K = 10 91 IE O0EE 132 BNE NOTND NO-THE PROGRAM IS NOT ENDED 9120 4 C 2 2 9 2 133 JMP QEND VES - I T 'S ALL 0 ‘JER 30 END 9123 6 1 0 6 134 LOAD LOA KSO6 ;,V GET NEXT BVTE 9125C900 135 CMP #*00 IS IT 0? 912? F02E 136 BEQ NUMDUN VES THE STATEMENT IS ENDED Although this simple program does 9129 208390 13? JSR INCV INC S'-REG nothing, it is a legal Applesoft program 912C C93A 138 CMP #*3 A IS IT A 'COLON'? 912E F 0 2 ? 139 BEQ NUMDUN VES THE STATEMENT IS ENDED and could be run through COMPRESS. 9130 C92C 140 CMP # *2 C IS IT A COMMA? After running COMPRESS, the pro­ 9 1 3 2 F0OD 141 BEQ COMMA VES 9134 A6EF 142 LDX *EF GET THE STATEMENT BUFFER OFFSET gram would appear as: 9136 3S 143 SEC 913? E 9 30 144 SBC # *3 u DECMALIZE THE TOKEN 9139 145 PAG 10 J = 5 : K = 10 : END 913 9 9D F095 146 STA*95F0,X PUT IT ASIDE 913C E6EF 14? INC *EF ADO 1 913E 4C2391 148 JMP LOAD GO GET ANOTHER BVTE COMPRESS has removed 45% of the 9141 C6 EF 149 COMMA DEC *E F COMMA MEANS L IN E NUMBER ENDED memory requirements of this program! 9143 206391 150 JSR CON'J GO CONUERT STMT # 9146 A901 151 LDA # * 0 1 REINIT 914B 85EF 152 STA *EF The original program would have 914AB106 153 LDA < * 0€ O ,Y GET ANOTHER BYTE 9 1 4 0 C 900 154 CMP #*00 IS IT 0? appeared in memory as: 914E F 0 1 0 155 BEQ COMFIN VES - LINE IS DONE 915 0 C93A 156 CMP # *3 A IS IT COLON? 00 0A 08 0A 00 AA 4A DO 9 15 2 F00C 157 BEQ COMFIN VES - L IN E IS DONE 9 1 5 4 4C 2391 158 JMP LOAD NO - CONTINUE ON 35 00 14 08 14 00 AA 4B 915? C 6 EF 159 NUMOUN DEC *E F ALL OF # IS FOUND DO 31 30 00 1A 08 IE 00 9159 206391 160 JSR CON'J GO CONUERT STMT # 915C A901 161 LOA # * 0 1 R E IN IT 80 00 00 00 915E S5EF 162 STA *E F 9 16 0 4CBO90 163 COMFIN JMP NOW BEGIN SEARCH OF NEXT L IN E 9 1 6 3 34FC 164 CONU STY *FC PUT V-REG ASIDE The compressed program in 9165 A6 EF 165 LDX *E F GET S 95F0 OFFSET memory would appear, as: 916? 8 6 FF 166 STX *F F SA'JE IT 9 1 6 9 A90O 167 LOA #*00 916B 85FE 168 STA *FE 00 10 08 0A 00 4A DO 35 916D 85FA 169 STA *FA 916F A6 FF 170 GO LDX*FF 3A 4B DO 31 30 3A 80 00 9171 BCF095 171 LDV * 9 5 F 0 ,X GET F IR S T DEC D IG IT 00 00 91? 4 C6FF 172 DEC: *FF DECREMENT OFFSET 9176 E6FE 173 INC*FE INCREMENT COUNTER C000 174 CPY IS THE DEC # 0? Note how many tokens are removed 9 17 3 #*00 after the original program is cleaned up.

90 MICRO - The 6502/6809 Journal No. 52 - September 198 Listing 1 (continued) This example illustrates the basic ac­ 91?A F 0 1 9 175 BEQ NEXT VES - GET NEXT tion of the program COMPRESS. 917C A6 FE 176 LDX *FE NO - INC COUNTER 917E BDDG95 177 LDR * 9 5 0 0 , X GET APPROPRIATE DEC/HEX CONSTANT 9181 8 3 173 DEV COUNT DOWN 1 9 192 C0GG 179 CPV #*0G IS V 0? 9184 F00F 180 BEQ NEXT VES - GET NEXT Why COMPRESS Works 9 1 3 6 18 181 CLC NO - CONUERT 9187 7DDG95 132 ADC *9 5 D 0 ,X CONUERSION OF CONSTANT 918R BG03 183 BCS I NCR I F OUERFLOU BRANCH Applesoft programs are models of 918C 4C3191 134 JMP CONTft CONTINUE efficiency. There is no extraneous 918F EEE095 135 I NCR INC ♦ 9 5 E 0 ADD 1 TO HEX MSB 9192 4C8191 136 JMP CClNTft CONTINUE space or character storage in memory. 9 1 9 5 18 187 CLC GET NEXT D IG IT 9196 6DD095 133 RDC ♦95D 0 Each command, character, or number 9199 8DD095 189 STft *95DG STORE RESULT is represented within the computer by a 919C BG28 19G BCS INCS IF OVERFLOW BRANCH token. The token for the command 919E A6 EF 191 CCiNTC LDX *EF GET COUNTER 91R0 BCF095 192 LDV ♦ 9 5 F 0 ,X GET NEXT CONSTANT PRINT is "BA", a hexadecimal number 91R3 C6EF 193 DEC *EF DECREMENT COUNTER equivalent to the decimal value 186. 91A 5 E 6FA 194 INC ♦Fft INCREMENT POINTER 91A7 195 PAG There are 234 different tokens that 91R7 C 008 196 CPV #-*0U IS V 0? Applesoft can recognize, represented by 91R9 F03 4 197 BEQ OUT VES - Q UIT 9 IRE: R6 FA 193 LDX *F ft : NO - GET POINTER hexadecimal numbers $00 through 91RC' BDE095 199 LOR * 9 5 E 0 .• X GET DEC - > HEX CONSTANT $EA. (Following the normal conven­ 9 1 8 0 es 20G CONTB DEV DECREMENT COUNTER 9181 CG0O 201 CPV #*00 IS V 0? tion, we will refer to all hexadecimal 9 18 3 FG17 202 BEG! ftODM VES - E X IT numbers with a prefix of '$' so they can 91B5 IS 203 CLC NO - CONUERT 9186 7D E695 204 RDC *9 5 E G ,X be distinguished from normal decimal 918 r B003 2G*. BCS INC ft BRANCH IF OUERFLOW numbers.) 91 BE: 4CBG91 206 JMP C0N7 B CONTINUE 91BE 18 207 CLC 91BF A9G2 200 LDfl #*02 GET ERROR CODE 91 Cl S5F9 209 ST h *F? HEX > *F F F F Continuing with the example 91C 3 4C9190 210 JMP ERROR GO PR IN T ERROR MSG PRINT ($BAJ, use of the token allows 91C6 EEE095 211 INC *9 5 £ G ADD *1 TO MSB 91C9 4C9E91 212 JMP CONTC CONTINUE storage of the command PRINT in just 9 ICC. 18 ^13 CLC one byte, rather than spread out over 91 CD 60E G 95 214 RDC *9 5 E 0 9 1 DG BG06 2 1 5 BCS I NCB BRANCH IF OUERFLOW five. In effect, a great deal of optimizing 91D2 3DEG95 216 STR ♦9 5 E 0 STORE RESULT has already been done in the design of 91D5 4CDF91 JMP OUT CONTINUE 91D3 R9G1 213 INCB LDR # * 0 1 ERROR #1 the Apple! 91 DR 85F ? 219 STft *F 9 91DC 4C919G 220 JMP ERROR GO PR IN T ERROR MSG 91DF A5FF 221 LDR *FF ftRE WE DONE? Other computers carry blanks into 91E1 C 900 CMP #*G0 the program memory, but the Apple 91E 3 FG05 BEQ WRITE VES - 91E 5 R90U 224 LDA #*00 NO only does this with strings, where each 91E7 4C6F91 JMP GO GO ON blank is significant. The token repre­ 91ER R9G9 2 2 6 WRITE LDR #*G9 SET UP POINTERS + OFFSETS 91 EC 3 5 1 F STft ♦ IF sentation for the words "CUSTOMER 91EE R4FB 228 LDV *FB NAME" would be: 91FG ADDG95 22 9 LDA ♦95D 0 GET LSB OF HEX LINENUM 91F 3 9 1 0 8 23G STA <*08>,V STORE HEX UftLUE 91F5 2G339G 231 JSR INCV INCREMENT V 43 55 53 54 4F 4D 45 52 20 4E 41 4D 45 91F3 RDEG95 LDA ♦9 5 E 0 GET MSB OF HEX LINENUM 91FB 9 1 0 3 2 33 STA <*03:>, V INCREMENT V 91FC> R 509 234 LDA * 0 9 LOOK AT MSB OF ADDRESS In this case, since the programmer 9 1 FF C98E i o j CMP # *3E CHECK IF ROOM LEFT 9201 D00B 2 3 6 BNE OKNOUI VES desires the string typed out exactly as 92G 3 C0FF 237 CPV #*FF CHECK IF ROOM LEFT entered, no changes would be acceptable 92G 5 [>007 233 BNE OKNOUI VES 9 2 0 7 A9G3 239 LDA # *0 3 ERROR CODE within it, and Applesoft makes none. 9 2 0 9 85 F 9 240 STft *F9 920B 4C9190 241 JMP ERROR GO PR IN T ERROR MSG 92GE 2GS39G 2 4 2 OKNOU JSR INCV RESET POINTERS Despite the fact that the Applesoft 9211 84FB 2 4 3 STV *FB programs are already condensed in 9 2 1 3 R9G7 2 44 LDA # *0 7 memory, additional optimizing is pos­ 921 5 2 4 5 PAG 9 2 1 5 3 5 IF 2 4 6 STft *1 F sible. Between each line in memory, 9 2 1 7 R4FC 247 LDV *FC for example, the computer stores the 9 2 1 9 R90G 2 4 3 LDA #*G0 GET ZERO 921B SDDG95 249 STA *95D G STORE IN LSB REGISTER value $00. This null character, called a 9 2 1 E 8D E095 250 STft *9 5 E 0 STORE IN MSB REGISTER delimiter, tells the Applesoft inter­ 9221 60 251 RTS RETURN 9222 84 FC STV *FC END OF TABLECREATE preter that the previous line has ended. 9 2 2 4 R9C5 LDA # *C 5 PR IN T MESSAGE TO SCREEN After $00, two bytes indicate the ad­ 9226 20F0FD 254 JSR *F D F 0 9229 R9CE 255 LDft #*CE dress in memory of the statement 922B 20F0FD 2 5 6 JSR *F D F 0 922E R9C4 LDA # *C 4 following the next statement. These 923G 20F0FD JSR *FDFG bytes ($0A $08 in the example at the 9 23 3 R9RG LDR # *A 0 9 23 5 20FGFD 26 0 JSR *F D F 0 beginning) are stored in low-byte/ 9 2 3 8 R9CF 261 LOA #*CF high-byte format. The actual address in 923R 20F0FD 262 JSR *F D F 0 923D A9C6 263 LDft #*C 6 this example is therefore $080A. 923F 20F0FD 264 JSR *F D F 0 9 24 2 R9RG LDA #*ft0 The line number is stored in two 9 24 4 2GF0FD JSR *F D F 0 9 24 7 A9DG LDft # *D 0 bytes, again with the least significant 9 2 4 9 20FGFD JSR *FDFG 924C A9C1 LDft #*C 1 byte first. Ever wonder why the largest 924E 20F0FO 2 7 0 JSR *F D F 0 line number which can be used in 9251 A9D3 271 LDft # *D 3 Applesoft is 63999? One reason is that 9253 2GF0FD JSR *FDF 0 9256 20FGFD JSR *F D F 0 two bytes can describe a maximum of $FFFF integers — the equivalent of (Continued) decimal 65535.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 91 Each Applesoft statement, then, re­ Listing 1 quires five bytes — a null byte, two ad­ 9259 ft9fl0 2 7 4 LDfl # *ft0 dress bytes, and two line-number bytes. 9 2 5 8 20F0FD 2 7 5 JS R *FD F0 925E ft9A3 2 7 6 LDfl #*A3 As noted in the Applesoft manual, it 9260 20F0FD 2 7 7 JS R *FD F0 is possible to put two or more state­ 9 2 6 3 FtSBl 2 7 S LDfl #*B 1 9 2 6 5 20F0FO 2 7 9 JS R *FD F0 ments together by separating each with 9263 2086FD 280 JSR *FD8B a colon (:)■ If two statements are thus 9 2 6 6 A900 281 PGMWfcT LDA #*00 ; IN ITIA LIZ E UALUES FOR 926D A8 2 8 2 TAV ; POINTERS AND OFFSETS joined, only one byte is used ($3A, the 926E 8 5 0 6 2 8 3 STA * 0 6 1 FOR COMPRESSION token for the colon). Separate lines 927© 85FF 284 STfl *FF : PORTION OF PROGRAM 9 2 7 2 85EB 2 8 5 STA *EB would require four additional bytes. 9274 35EF 286 STA*EF Applesoft imposes only the limitation 9276 3506 287 STfl *D6 92 7 S 85CE 2 8 8 STA *CE that no line can have more than 255 927ft 8508 289 STft * 0 8 927C 8DFE8F 2 9 0 STA *SFFE characters. 927F A93A 291 LDfl # *3 ft 92S1 80FF8F 292 STft *3F F F 928 4 fi908 2 9 3 LDft # *0 3 Applesoft BASIC contains other op­ 928 6 8 5 0 7 2 9 4 STfl * 0 7 92SS 2 9 5 PftG portunities for optimization. For exam­ 9 2 8 3 85EC 2 9 6 STA *EC ple, COMPRESS eliminates the un­ 928fl R 907 2 9 7 LDfl # *0 7 928C85 IF 298 STft *1 F necessary LET, thus saving one byte. 928E A98F 299 LDft •* 8F And COMPRESS will delete any vari­ 9 2 9 6 85CF 300 STft *CF 9 2 9 2 ft903 301 LDA • *0 3 able name after NEXT. This could save 9 2 9 4 85FFI 302 STft *FA many bytes per line. REM statements 929 6 B 106 3 0 3 CMPPB LDft < * 0 6 ) , V J READ BVTE OF fV S PROG 9 2 9 8 203390 304 JSR INCV can also be dropped, unless of course 9296 C900 305 CMP •*00 ; IS IT 0 ? some branching statement jumps to a 9290 F 0 0 3 3 0 6 BEQ TSTS J VES - TEST IT 929F 4C 9E93 3 0 7 JMP PROG i NO - WRITE IT line number that happens to be a REM 92R2 fl 6Ffl 308 TSTS LDX*Fft statement (a bad programming habit). 921=14 E 003 3 0 9 CPX # *0 3 J DID COMPRESS JUST STRRT? 92R 6 DC0C 31© BNE TSTV 1 N O 92ft3 8 4 1 9 311 STV * 1 9 I VES - STORE LOCATION OF Even though Applesoft is a very effi­ 92AA A4EC 3 1 2 LDV *EC J fV S ADDRESS REFERENCE 92AC 8 41 ft 3 1 3 STV M ft 1 IN COMPRESSED STATEMENT cient language, there is ample oppor­ 92RE ft419 314 LDV * 1 9 tunity for further reduction in memory 92B 0 A 200 3 1 5 LDX #*00 J RESET INDICATOR 9 2 6 2 86FA 3 1 6 STX *Ffl use when storing programs. 92B 4 8 4 1 8 3 1 7 TSTVSTV *1 B 9 2 6 6 C61B 3 1 8 DEC * 1 6 92B8 6106 319 LDft < * 0 6 ) , V S GET ANOTHER BVTE 928fi 208390 3 2 0 JS R INCV How COMPRESS Works 92BD C900 321 CMP #*00 J IS IT 0 ALSO? 926F D003 322 BNE GOON 1 NO - GO ON 92C1 4C 9293 3 2 3 JMP RENO 1 VES - CHECK FOR END The first step in compressing a pro­ 92C4 2 0 8 3 9 0 3 2 4 GOON JS R INCV gram is to look for called line numbers. 92C7B106 325 LDA < * 0 6 ).. V J GET ANOTHER BVTE 92C9 2 0 8 3 9 0 32 6 JS R INCV COMPRESS will eliminate lines by ap­ 92CC R 6FF 3 2 7 LDX *F F pending them to earlier lines. But it is 92CE E 000 3 2 8 CPX #*00 I IS THIS NEld LINE? 92D0 F 0 0 3 3 2 9 BEQ STRft J VES GO STORE important to preserve lines that are 9 2 0 2 4C 0792 3 3 0 JMP NSTR ; NO referred to elsewhere in the program 9 2 0 5 8 5 ID 331 STRfl STA *10 ; SftUE LINE NUMBER 92 0 7 84FD 3 3 2 NSTR STV *FD J PUT ASIDE POINTERS with commands such as GOTO, 92D9 R08D 3 3 3 LDV # *3 0 1 TO CHECK CALLED LINE GOSUB, etc., to permit proper transfer 92 0 6 84D7 3 3 4 STV * 0 7 J NUMBER TABLE! 9200 ft2D7 335 LDX #*D7 of control. Therefore, the first action 92DF 8 6 1 F 3 3 6 STX * 1 F COMPRESS takes is the creation of a 92E1 8 0 0 0 3 3 7 LDV #*00 Called Line Number Table. 92E3 C4FB 3 3 8 ANSTR CPV *FB S ARE WE DONE CHECKING? 92E5 F011 3 3 9 BEQ ENDTST i VES 92E 7 0 1 0 6 3 4 0 NOMAT CMP < * 0 6 ) > V ; LOOK FOR LSB OF LINE It 92E9 F 0 3 0 341 BEQ STRB I FOUND IT ! The following Applesoft commands 92E6 2 0 8 3 9 0 34 2 JS R INCV refer control to another line number: 92EE C4FB 3 4 3 CPV * F 6 S ARE UE DONE? 92 F 0 F 0 0 6 3 4 4 BEQ ENDTST S VES 92F2 3 4 5 PftG IF ... GOTO 92 F 2 2 0 8 3 9 0 3 4 6 JSR INCV GOTO 92F5 4CE392 347 JMP ftNSTR J NO - CONTINUE CHECKING 92F8 A609 348 ENDTST LDX * 0 9 GOSUB 92Fft E 407 3 * 9 CPX * 0 7 i CHECK LIM ITS OF CALLED LIST 92FC D0E9 35 0 BNE NOMAT ; LINE tt TABLE 92FE A4FD 351 LDV *FD ON ... GOTO 9308 A207 352 LDX # *0 7 DEL 93 0 2 861F 3 5 3 STX *1 F 93 0 4 6 1 0 6 3 5 4 LDfl < * 0 6 ) , V S GET ANOTHER A/'S BVTE 9 3 0 6 2 0 8 3 9 0 35 5 JS R INCV COMPRESS searches the program 9309 A 6FF 3 5 6 LDX *F F 9308 E000 357 CPX # *0 6 i IS INDICATOR CLEAR? for these commands. Line numbers 930D F003 3 5 3 BEQ STftE J VES that are identified in these statements 930F 4C 9692 3 5 9 JMP CMPPB J NO - GET fi BVTE 93 1 2 851E 3 6 0 STftE STA *1 E J STORE MSB OF LINE tt are stored in a Called Line Number 9314 A904 361 LDft # *0 4 ; CHANGE POINTER 9316 8 5 Fft 362 STft*Fft Table at memory locations $8D00 to 9313 4C 9692 3 6 3 JMP CMPPB ; GO GET NEXT BVTE $8EFF. When compression takes place, 931B 208390 364 STREf JS R INCV 931E S4FE 3 6 5 STV *FE 1 SET UP POINTERS FOR this table is checked so no line number 93 2 0 A4FD 3 6 6 LDV *F 0 ; ADDITIONAL CHECKING OF that appears in the table as a called line 9322 * 2 0 7 3 6 7 LDX # *0 7 J MSB OF LINE NUMBER 9324 861F 3 6 8 STX *1 F number will be eliminated. 9326651C 369 STfl *1C 9328 6106 370 LDfl < *0 6 ),V J GET A BVTE OF A-'S 932fl 2 0 8 3 9 0 371 JS R INCV The table will contain all of the called 9320 A6FF 3 7 2 LDX *F F line numbers in the order in which they appeared in the original program.

92 MICRO - The 6502/6809 Journal No. 52 - September 198 Listing 1 (continued) Consider the following program:

932F E 000 373 CPX •*00 I IS INDICATOR CLEAR? 9331 F 0 0 3 3 7 4 BEQ STftF ; VES - 10 GOTO 50 9333 4C 3393 3 7 5 JMP CNTXX ; nci 50 END 9336 8 5 IE 3 7 6 STftF STft *1E ; PUT MSB AUfiV 9333 S4FD 3 7 7 CNTXX STV *FD J START LOOKING FOR 933ft R2D7 3 7 3 LOX •*D7 ! ft MATCH OF THE MSB A simple concatenation would be: 933C: S61F 3 7 9 STX * 1 F : OF ThE LINE NUMBER 933E A4FE 3 3 0 LDV *F E 934G D1D6 331 CMP <*D6>j V 10 GOTO 50 : END 9342 F01B 3 8 2 BEQ SET 9344 203390 333 JSR INCV 9 3 4 ? 34ED 334 STV *ED Any attempt to run the shortened 934 9 fl0G7 3 35 LDV # *0 7 934B S41F 33c. STV *1 F program would result in an Applesoft 93 4 0 ft4FD 3 3 7 LDV *FD error. Consider a slight modification of 934F 2 0 3 3 9 3 3 3 3 JSR DECV 9 3 5 2 34FD 339 STV *FD this example: 9 3 5 4 rod? 3 9 0 LDV #*D? 9 3 5 6 84 IF 391 STV *1 F 935 8 R4ED 3 9 2 LDV *ED 10 GOTO 50 935H ft5lC 3 9 3 LDft *1C 20 J = 5 935C 4CE392 3 9 4 JMP ftNSTR 50 END 935F- 3 9 5 PRG 935F A4FD 3 96 SET LOV *FD J RETURN WITH A MATCH 9361 A207 39? LDX • *0 7 By appending the program together into 9363 861F 3 98 STX *1 F 9365 * 2 0 5 3 9 9 LOX • *0 5 one statement, it would appear as: 9367 86FA 4 0 0 STX *FA J RESET FLAG 9369 A6FF 401 LOX ♦FF 1 IS THIS A NEW LINE? 936B eooo 4 0 2 CPX #*00 10 GOTO 50 : J = 5 : END 936D 0 0 0 3 4 0 3 BNE GOGCi J NO 9 3 6 F 4C 9692 4 0 4 JMP CMPPB J VES - GET ANOTHER BVTE 93 7 2 A9QJ1 4 0 3 GOGO LOR •*OL J RESET FLAG Again there would be an Applesoft 9374 83FA 406 STfl*Ffi error. Note that the first part of the 9376 2 0 8 8 9 3 4 0 7 JS R OECV 1 BACK UP POINTER 93 7 9 2 0 8 8 9 3 4 0 3 JS R DECV statement (GOTO 50) immediately 937C 2 0 8 8 9 3 4 0 9 JSR DEC'.' transfers control to a later line number. 937F 2 0 8 3 9 3 4 1 0 JS R DECV 93 6 2 2 0 8 8 9 3 411 JSR OECV 93 8 5 4C 0894 4 1 2 JMP CERTR J MATCH MADE - GO WRITE LINE Assume for a moment that a called 9 3 8 3 88 4 1 3 DECV OEV J SUBROUTINE TO DECREMENT 9 3 8 9 COFF 4 1 4 CPV • *FF J V REG AND CHECK IF PAGE line number table has been con­ 9 3 8 6 0 0 0 4 4 1 5 BNE RETNN J BOUNDARV IS CROSSED structed, and the 'GOTO 50' statement 938D A61F 4 1 6 LOX *1 F 938F 0 6 0 0 4 1 7 OEC * 0 0 , X identified. Recognizing that line 50 9391 6 0 4 1 8 RETNN RTS could not be eliminated, COMPRESS 9392 8 1 0 6 4 1 9 REND LOR < * 0 6 > ,i V J GET ANOTHER BVTE 9394 C900 4 2 0 CMP •*00 J IS THIS ONE Q ALSO? would preserve it. After compression 9 3 9 6 0 0 0 3 421 BNE GONG J NO - IT IS NOT THE END the program would look like this: 9 3 9 8 4C 6S95 4 2 2 JMP FEND J VES - PROGRAM ENDED 9 3 9 6 4CC492 4 2 3 GONCi JMP GOON J GO ON 9 3 9 € 80FE 8F 4 2 4 PROG STfl * 8FFE 1 CHECK TO SEE IF WE 10 GOTO 50 : J = 5 93A1 C93A 425 CMP•*3ft I HAUE A COLON 93A3 FOOD 4 2 6 BEQ FLAG 1 VES 50 END 9 3 * 3 AOFFSF 4 2 7 LOR * 8FFF I NO-CHECK THIS ADDRESS 93A8 C93R 4 2 8 CMP #*3A 93AA F02C 4 2 9 8EQ CLRFLG While the execution of this short 93RC RDFE 8F 4 3 0 LDfl * 8FFE program would not create a computer 93AF 4CE093 431 JMP ONWARD 9 3 6 2 ROFF 8F 4 3 2 FLAG LOR * 8FFF I CHECK TO SEE error, the transfer of control to line 50 9 3 8 5 C93R 433 CMP•*3A J IF WE HAUE A COLON takes place before the ‘J = 5 ’ is ex­ 9 3 6 7 0000 4 3 4 BNE SETZ I NO 9 369 8 1 0 6 4 3 3 LOR < * 0 6 ) j V I VES GET ANOTHER BVTE ecuted. So 'J = 5' would never be ex­ 936 6 C9Q0 4 3 6 CMP •*00 I IS IT 0 ? ecuted at all. 936D F 0 0 3 4 3 7 BEQ RNGFIX J VES 936F 4C 9692 4 3 8 JMP CMPPB J NO GO CONTINUE 93C2 Cfl 4 3 9 RNGFIX OEX I BACK UP ONE Another condition that the com­ 93C3 4C 9494 4 4 0 JMP CNTAX 93C6 6106 441 SETZ LDA < *06> *V J GET NEXT BVTE pression program must address is Ter­ 93C8 C9Q0 4 4 2 CMP #*00 J I S IT 0 ? minal Commands. Commands that not 93CA 0 0 0 3 ' 4 4 3 BNE SETZ1 ; NO 93CC 4C 9494 4 4 4 JMP CNTAX J VES only transfer control, but do it ir­ 93CF 4 4 5 PRG revocably (as shown in the example 93CF RDFE8F 4 4 6 SET21 LDft *SFFE I SET FLAG 93 0 2 80FF8F 4 4 ? STft * 8FFF above), are called Unconditional Ter­ 9 3 0 5 4C F893 4 4 3 JMP PROGUT 5 WRITE COMPRESSED CODE minal Commands. Commands that 9 3 0 8 * 9 0 0 4 4 9 CLRFLG LOR #*00 930A 80FF8F 4 5 0 STR * 8FFF may or may not transfer control are 9 3 0 0 RDFE6F 431 LDR * 8FFE called Conditional Terminal Com­ 93E0 C9RB 452 QNWRRO CMP •*ftB I S IT 'GOTO' ? 93E 2 F 0 3 9 4 5 3 6EQ GOTO VES mands. Unconditional Terminal Com­ 93E 4 C9RD 454 CMP#*ftO IS IT 'IF '? mands include: 93E6 F05O 4 5 5 BEQ IF VES 9 3E S C9B1 4 5 6 CMP • *6 1 IS IT 'RETURN'? 93ER F04C 4 5 7 BEQ IF VES GOTO 93EC C982 4 5 3 CMP • *3 2 IS IT 'NEXT'? ON ... GOTO 93EE F 0 5 3 4 5 9 BEQ NXTT VES 93F0 C9AA 4 6 0 CMP •*A A IS IT 'LET'? RETURN 9 3 F 2 F 0 6 6 461 BEQ LET VES REM (see the discussion later 93 F 4 C 962 4 6 2 CMP • *6 2 IS IT 'REM'? 9 3 F 6 F06A 4 6 3 BEQ REM S*ES in the article on REM) 93F S 9D00SF 4 6 4 PROGUT STft * 8 F 0 0 ,X STORE THE BVTE - NOT A TERM CUD 93F6 861C 4 6 5 STX *1C PUT X ASIDE Conditional Terminal Commands 93FD R 6FA 4 6 6 LDX *F ft GET FLAG 93FF E0G6 4 6 7 CPX • *0 6 I S IT 6? include: 9401 F 0 0 5 4 6 3 BEQ EL1M VES 9 4 6 3 R61C 4 6 9 LDX *1C GET X BACK 9 4 0 5 4C 9594 4 7 0 JMP CNTftft CONTINUE IF ... GOTO 9 4 0 8 R2Q1 471 EL IN LOX •*01 SUBROUTINE TO ELIMINATE IF ... THEN GOTO (Continued) IF ... THEN ...

No. 52 - September 1982 MICRO - The 6502/6809 Journal 93 Conditional commands behave in a Listing 1 (continued) special way. For example: 940* 86FR 472 STX SFA • EUERVTHING AFTER "REM1 10 IF A = 2 THEN B = 5 940C A61C 473 LDX *1C 940E 4C1494 474 JMP ELIM3 20 C = 6 9411 208390 475 EL 1M2 JSR INCV 9414 6106 476 EL I M3 LDR <*06>,V • GET ANOTHER BVTE 9416 C90Q 477 CMP t#0O • I S IT 0 ? Executed without compression, the 9418 DOF7 478 BNE EL I M2 • NO - LOOP 'C = 6’ assignment will be executed 941R 4C9394 479 JMP CNTflfl • VES - REM I S DONE 941D 85ED 480 GOTOSTR *ED • PUT BVTE ASIDE regardless of the outcome of statement 941F £000 481 CPX #*00 ■ IS X 0 ? 9421 F00C 482 BEQ THRU • VES 10. If these lines are concatenated, they 9423 CA 483 DEX • NO - BACK UP appear as: 9424 BD008F 4 8 4 LDR *8 F 0 0 ..X ; GET LAST BVTE 942? C9C4 485 CMP #*C4 • WAS IT 'THEN'? 9429 0 0 8 3 486 BNE INCC • NO 10 IF A = 2 THEN B = 5 : C = 6 9426 4C2F94 4 8 7 JMP THRU » VES 942E E8 488 INCC I NX • RESET X AGAIN 942F *901 489 THRU LDR #*01 ; RESET FLAG Applesoft will evaluate the 'IF A = 2’ 9431 esFft 490 STA *FR 9433 RSED 491 LDR *E0 • GET ACC BACK part of the line. If it is false, then no fur­ 943S 4CF893 4 9 2 JMP PROGUT • GO WRITE BVTE ther action will take place on that line; 9438 85ED 493 IF STR *ED • PUT BVTE ASIDE 943ft R901 4 9 4 LDR #*01 ; RESET FLAG control will immediately fall through 943C 4 9 5 PftG to the next line. Conditional Terminal 943C 85FR 4 9 6 STR *Ffl 943E R5ED 4 9 7 LDft «ED • GET BVTE BACK Commands are different from Un­ 9 4 4 0 4C F693 4 9 8 JMP PROGWT » GO URITE BVTE conditional Terminal Commands be­ 9 4 4 3 85ED 4 9 9 NXTT STft *ED • PUT BVTE ASIDE 9 4 4 5 B 106 5 0 0 NXTX LDfl <*06!>>V • GET NEXT FU'S BVTE cause control is transferred immedi­ 9 4 4 ? C93A 501 CMP #*3ft • IS IT COLON? ately only if the condition in the state­ 9 4 4 9 F00ft 5 0 2 BEQ LOflDM ; VES - NO UAR NAME 9 4 4 8 C900 5 0 3 CMP #*00 ; IS IT END OF STMT? ment is false. Nevertheless, COM­ 944D F 0 0 6 5 0 4 BEQ LOflDM I VES - NO UAR NAME PRESS cannot append any subsequent 94 4 F 2 0 8 3 9 6 5 0 5 JSR INCV 9452 4C 4594 5 06 JMP NXTX I GO GET ANOTHER statements to terminal commands of 945 5 R5ED 50 7 LOflDM LDfl *ED • GET BVTE BACK any type, because doing so may subvert 9 4 5 7 4C F893 5 03 JMP PROGUT • GO WRITE BVTE 945ft 8 1 0 6 5 0 9 LET LDft < *0 6 > /V GET NEXT A-'S BVTE the programmer's intent. 945C 208390 51© JSR INCV 945F 4C F893 511 JMP PROGUT I GO URITE IT 9 4 6 2 E 0 0 0 5 1 2 REM CPX #*00 ; IS THIS NEW LINE? It is legal, however, for the program­ 9 4 6 4 F001 5 1 3 BEQ REMR • VES mer to concatenate many statements 946 6 CR 5 1 4 DEX • NCi - BACK UP 9 4 6 7 861C 5 1 5 REMft STX *1C I PUT X ASIDE after a conditional command. This is a 9 4 6 9 R6Fft 5 1 6 LDX *FR 1 LOOK AT FLAG 946B E 005 5 1 7 CPX # *0 5 method of saving space and speeding up 9 4 6 0 D00E 5 1 8 BNE REMC: execution time, but it can only be done 946F R 206 5 1 9 LOX # *0 6 • RESET FLAG 9471 86Fft 5 2 0 STX *Fft by the programmer. COMPRESS can­ 9 4 7 3 R61C 521 LOX *1C GET X BACK not possibly know the initial intent. A 947 5 E 000 5 2 2 CPX #*00 IS IT A HEW LINE? Conditional Terminal Command then, 9477 F 0 0 I 5 23 BEG REMB ; VES 9479 E8 5 24 I NX • NO - ADUANCE 1 is one where control may or may not be 947ft 4C F893 5 2 5 REMB JMP PROGUT ; GO WRITE BVTE 9 4 7D R61C 5 2 6 REMC LOX *1C * GET X BACK passed to the next statement, or to 947F B 106 527 LDfl < * 0 6 > ,V • GET ANOTHER A^S BVTE some numbered statement earlier or 9481 C900 5 28 CMP #*00 • IS IT 0 ? 9483 F006 529 BEQ CNTSB ; VES GO SEE IF END later in the program. 94 8 5 2 0 8 3 9 0 5 3 0 JS R INCV ; ADUANCE POINTER 9488 4C7D94 531 JMP REMC • CONTINUE 948B E 000 5 3 2 CNTSB CPX #*00 ; IS THIS A NEW LINE? COMPRESS takes two actions with 9 4 8 0 D005 5 3 3 BNE CNTAX ; NO respect to conditional commands. 948F 86FA 534 STX *Fft ; RESET FLAG 9491 4C 9692 5 3 5 JMP CMPPB ; GO GET ANOTHER BVTE First, any referenced line number is 949 4 Cfl 5 3 6 CNTftX DEX ; BACK UF' X REG recorded in a Called Line Number 9495 8106 537 CNTAft LDft < * 0 6 )* V GET ANOTHER ft.-'S BVTE 94 9 7 E0EE 5 3 3 CPX #*EE • ARE UE OUT OF ROOM? Table so that the line number will not 9 4 9 9 F00B 5 3 9 BEQ BACKUP ; VES - BACKUP be eliminated. Second, as with any ter­ 949B E8 5 4 0 LNX 949C C900 541 CMP #*00 ; IS BVTE 0 ? minal command, there will be nothing 949E F016 542 BEQ ENOEM ; VES - GO END appended to the Conditional Terminal 94R 0 2 0 8 3 9 0 5 4 3 JS R INCV 94ft3 4C9E93 544 JMP PROG ; CONTINUE Command, unless the programmer ad­ 94A6 54 5 PftG ded something in the initial program. 94ft6 208893 5 4 6 BACKUP JS R OECV • BACK UP V REG 94A9 C41B 5 4 7 CPV * 1 8 COMPRESS always appends the last 94AB D0F9 5 4 3 BNE BACKUP • CONTINUE statement to the line. Unconditional 94AD 34FC 5 4 9 STV *FC • SET V ASIDE 94AF *201 5 5 0 LOX #*01 I RESET FLAG Terminal Commands will be treated in 9 4 B 1 S6Fft 551 STX*FR exactly the same manner. 9 4 8 3 4CD894 552 JMP CERTR 948 6 E0EE 553 ENOEM CPX #*EE • ARE UE OUT OF ROOM? 9 48 8 F0EC: 5 54 BEQ BACKUP • VES REM Statements 948ft * 9 3 * 5 5 5 LDft #*3A • GET COLON 94BC 9D008F 5 56 STR *[email protected] X J URITE COLON 94BF 8DFF3F 5 5 7 STR * 8FFF ; STORE IN FLAG Applesoft treats REM in a special 94C 2 86EE 55o STXSEE ; SET X ASIDE 94 C 4 ES 559 I NX way. When a REM token ($B2) is en­ 94C 5 S 6FF 5 6 0 STX *FF countered in a program, everything 94C7 A6FFI 561 LOX *FA • GET FLAG 94C 9 E 005 5 6 2 CPX # *0 5 after the REM is considered part of the 94CB 0 0 0 4 5 6 3 BNE EN02 • TIME TO END? remark until the $00 delimiter is en­ 94CD A200 5 64 LOX #*00 • RESET FLAG 94CF 86FA 5 65 STX *FR countered. The statement 9401 E001 5 6 6 END2 CPX #*01 • IS FLAG 1? 940 3 F 0 0 3 5 6 ? BEQ CERTR VES GO WRITE LINE 9 4 0 5 4C 9692 5 6 8 JMP CMPPB I NO CONTINUE 10 REM THIS IS A REMARK : J = 10 9 4 0 S ft 6EE 5 69 CEF^TR LOX SEE I GET X BACK 940ft 86FF 5 7 0 STX *FF I GUERWRITE POINTER 940C E000 571 CPX #*00 ; IS X 0 ? would not be evaluated past the first

94 MICRO - The 6502/6809 Journal No. 52 - September 1982 Listing 1 (continued) REM. Everything, including the colon and the second statement, is con­ 94DE D009 57 2 BNE WRTLN NO 94E0 ASF A 5 7 3 LDA *FA GET FLAG sidered part of the remark. Nothing can 94E2 C902 574 CMP #*02 therefore be appended to REM state­ 94E 4 D0O3 5 7 5 BNE WRTLN GO WRITE LINE 94E 6 4C 7195 5 7 6 JMP FINAL . GO END PROGRAM ments; they are considered terminal 94E 9 84FC 5 7 7 WRTLN STV *FC ; SET V ASIDE commands. 94EB A4EF 5 7 8 LDV *EF 94ED A9EC 5 7 9 LDA #*EC 94EF 8 5 1 F 5 3 0 STA *1 F REM statements will be entirely 94F1 A200 581 LDX #*00 94F3 8A 5 8 2 TXA eliminated by COMPRESS to save 94 F 4 91EB 5 3 3 STA <*EB > ,V . WRITE COMP (V S PROG space unless they are on called line 94F 6 2 0 8 3 9 0 5 8 4 JS R INCV 94F9 2 0 8 3 9 0 5 35 JSR INCV numbers. Programmers who want max­ 94FC 2 0 3 3 9 0 5 3 6 JS R INCV imum compression should avoid 94FF A51D 5 3 7 LDA *1D ; GET LINE HO 9501 9 1 EB 5 8 8 STA <*EB>,V . STORE IT branching to REM statements. COM­ 9 5 0 3 2 0 8 3 9 0 5 3 9 JS R INCV ; GET MSB OF LINE PRESS cannot eliminate a REM state­ 9 5 0 6 A51E 5 9 0 LDA *1E ; AND STORE IT ALSO 950© 91EB 591 STA <*EB>,V ment if it is the result of a branch from 950A 2 0 8 3 9 0 5 9 2 JS R INCV another line; however, it will eliminate 950D BD003F 5 9 3 GOMGU LDA * S F 0 0 ,X . START LOADING COMPRESSED 9 5 1 0 91EB 5 94 STA <*EB>,V . LINE AND STORING IT everything after the REM ($B2), reduc­ 9 51 2 5 95 PAG ing the statement to just one token. 9 5 1 2 E4FF 5 9 6 CPX *FF IN LOMEM 951 4 F 0 0 7 5 97 BEQ BAKNClW 9 516 2 0 8 3 9 0 5 9 8 JSR INCV 95 IS* E 8 5 9 9 I NX Executing COMPRESS 9 5 1 A 4CGD95 6 0 0 JMP GONOW CONTINUE 951D A900 6 0 1 , BAKNOUI LDA #*00 WRITE A * 0 0 DELIMITER IN 951F Three steps are required to execute 91EB 6 0 2 STA <*EB.:',V THE PROGRAM TO END LINE 9521 34EF 6 0 3 STV *EF COMPRESS: 952 3 2 0 3 3 9 0 6 04 JSR INCV 9 5 2 6 9 3 6 0 5 TVA 952 7 A01A 6 0 6 LDV # *1 A 1. Type BRUN COMPRESS 9 5 2 9 8 4 IF 6 0 7 STV *1 F 952B A000 6 0S LDV #*00 2. When the cursor reappears, 952D 9 1 1 9 609 STA <'*19 !:■, V BLANK ADDRESS 952F S5FD 6 1 0 STA *FD LOAD your Applesoft program. 9531 2 0 3 3 9 0 611 JS R INCV 9 5 3 4 A5EC 6 1 2 LDA *EC 3. When the cursor appears again, 9536 9 1 1 9 6 1 3 STA < * 19 > , V WRITE ADDRES type CALL 36875. 9 5 3 3 A907 614 LDA # *0 7 953A 8 5 IF 6 1 5 STA *1 F 953C A260 6 1 6 LDX #*00 COMPRESS will respond with: 953E S6FF 6 1 7 STX*FF 9 5 4 0 36EE 6 1 3 STX *EE 9 5 4 2 A4FC 6 1 9 LDV *FC END OF PASS #1 9544 A6FA 6 2 0 LDX *FA 1 CHECK FLAG 9 5 4 6 E001 621 CPX #*01 END 9 5 4 8 F 0 0 7 6 2 2 BEQ LINECG 954A E 002 6 2 3 CPX #*02 954C F 0 2 3 624 BEQ FINAL Your program is now compressed! 954E 4C 9692 6 2 5 JMP CMPPE: ; To see how much memory-saving com­ 9551 A5FD 6 2 6 LINECG LDA *FD : GET A/S ADDRESS 9 5 5 3 8 5 1 9 6 2 7 STA * 1 9 pression took place, try it again, but 9 5 5 5 A5EC 6 2 3 LDA *EC ; MSB OF A/S ADDRES follow these steps: 9557 8 5 1 A 6 2 9 STA *1A 9 5 5 9 A5FD 6 3 0 LDA *FD ■; 955B C900 631 CMP #*00 i Type BRUN COMPRESS 9 5 5 D D002 6 3 2 BNE CNTU ; 955F C6EC 6 3 3 DEC *EC ; When the cursor reappears, LOAD 9561 A90O 6 3 4 CNTIJ LDA # * 0 6 ; 95 6 3 8 5 F h 6 3 5 STA *FA your Applesoft program. 9 5 6 5 4C 9692 6 3 6 JMP CMPPB ; 9 5 6 3 84FC: 637 FEND STV *FC; SET V ASIDE 956A A902 6 3 8 LDA #*02 ; Type CALL -151 956C 85FA 6 3 9 STA*FA 956E 4CD894 6 4 0 JMP CERTA Type AF.BO 9571 A4EF 641 FINAL LDV *EF 95 7 3 A9EC 6 4 2 LDA #*EC S51F 6 4 3 STA *1 F The computer will give you the ad­ 95 7 7 A900 6 4 4 LDA #*00 ; GET # *0 0 957*5 6 4 5 PAG dress of the highest memory location 957 9 91EB 6 46 STA < *E B , V ; WRITE THREE BVTES being used by your current program. 957B 2 0 8 3 9 0 6 4 7 JSR INCV ; OF #*G0 TO END 957E 91 EB 6 4 3 STA C*EB >f V ; A/S PROGRAM The high order byte is last, and the low 9 5 8 0 2 0 8 3 9 0 6 4 9 JS R INCV order byte first. If, for example, the 9583 91EB 650 STA <*EB.>, V 9585- 203390 651 JSR INCV computer responds with: 9 5 8 S 84AF 6 5 2 STV*AF ; SET PROPER UALUES 9 53A 8 4 6 9 6 5 3 STV * 6 9 ; TO ZERO PAGE A/S OOAF - AA 958C 846B 654 STY * 6B; POINTERS WHICH 958E 846D 655 STV * 6D; COMPRESSED PROGRAM 00B 0- 1B 9590 A5EC 6 56 LDA *EC ; WILL NEED WHEN 95 9 2 85B 0 6 57 STA *B 0 s RUNNING 9594 356A 6 5 3 STA * 6A then the top of your Applesoft program 95 9 6 856C 6 5 9 STA * 6C 95 9 8 356E 6 6 0 STA * 6E resides at location $1BAA, and oc­ 959A A9C5 661 LDA #*C5 cupies the space between $0800 (where 959C 20F0FD 662 JSR*FDFG ;• WRITE '-.EHD> OH SCREEN 959F A9CE 6 6 3 LDA #*CE all Applesoft programs start) and $1BAA. 95A1 20FGFD 6 64 JSR*FDFO 95A4 A9C4 6 6 5 LDA #*C-4 95A6 20F0FD 666 JSR *FD F0 Now, type CTRL-C to get back into 95 A 9 20DDFB 6 67 JSR *FBDD Applesoft. Again type CALL 36875 to 95AC 4CD0O3 6 6 3 JMP *3D 0 i RETURN COMPUTER TO USER invoke COMPRESS. After COMPRESS BSAUE ATOT.PRO G,AS80O,L*6O0 is finished, enter the monitor again 6 6 9 DCM "BSAUE ATOT. PROG, A*8©0, L*60Ci” with a CALL -1 5 1 , type AF.BO again, 6 70 END and record the new memory extents.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 95 By converting these addresses to decimal you can see how effective Listing 2: HEXDEC COMPRESS is! (More about that later.) le REM HEX CONVERSION ROUTINE 360 LET A*. = UAL 5 THEN GOTO 140 510 GOTO 520 valuable space depending on the func­ 130 UUTO 220 515 REM ACCUMULATE THE ANSWER. 135 REM PRINT THE ERROR MESSAGE 52G LET ANS = ANS + CMPVR •# A\,- tion you wish to perform. A PR#6 will AND BRANCH TO THE RETURN LO 530 NEXT I erase COMPRESS. GP. 5 4 0 PR IN T 140 PR IN T 5 50 PR IN T 150 P R IN T 5 6 0 P R IN T 160 PRINT 565 REM PR IN T THE ANSWER 170 P R IN T "IN P U T STRING TOO LONG 570 PRINT “THE ANSWER IN DECIMAL The Three Steps of COMPRESS FOR T H IS PROGRAM. VOU ARE L FOR YOUR INPUT STRING IS IM1TED TO FIUE DIGITS." - "iA N S 180 P R IN T 5 80 GOTO 7 00 Step 1: Set HIMEM 190 PR IN T 590 HOME 2 00 P R IN T "VOU ATTEMPTED TO ENTE 6 0 0 PR IN T R “ S K 610 PR IN T Program steps 3 to 7 tell the com­ 210 GOTO 720 620 PR IN T puter that COMPRESS is in the com­ 2 15 REM IN IT IA L IZ E . 625 REM IND IC A TE THAT ONE OF TH 220 ANS = 0 E CHARACTERS READ IN WAS NOT puter, located just below DOS between 2 3 0 FOR I = 1 TO K A UA LID HEX D IG IT - I . E . BE 240 LET G* = K + 1 - I TWEEN A AND F . locations $9000 and $95FF. Also, the 250 LET A* = MID# CHXf, G*-., 1 ’> 630 PRINT "VOUR INPUT INCLUDED T space $8D00 and $8EFF is reserved for 255 REM SET UP THE PROPER MULTI HE CHARACTER “ JA f P L IE R FOR EACH D IG IT OF THE 640 PR IN T the Called Line Number Table, and HEX NUMBER 65 0 P R IN T "T H IS OCCURRED IN FOSI $8F00 to $8FFF for the Compressed 260 LET MPVR = 16 t < I - 1 > T IO N NUMBER " J I 265 REM IF THE HEX UAL UE IS HUM 66 0 PR IN T Statement Buffer. HIMEM is an Apple II E R IC , IT IS OK TO BRANCH AND 670 PRINT " > 0 THEN GOTO OINT.V* tion $73 and $74 on the zero-page of 36,0 6S0 PR IN T memory. These two bytes will be set to 275 REM IF THE UALUE FALLS BETW 690 PRINT "THIS IS NOT A HEXADEC EEN A ftND F THE DECIMAL HUME IMAL D IG IT . F'LEASECHECK VOU $00 and $8D, respectively, following the ER MUST BE CALCULATED FROM R INPUT AND TRV A G A IN .*' format we have been using all along of HE TABLE. 7 00 PR IN T 230 IF A# = 1"ft11 THEN GOTO 3 30 710 PR IN T placing the least significant byte first. 290 IF A# = 1 ' THEN GOT 0 4 00 715 REM CREATE RETURN LuOP. 300 IF A * = ”C’' THEN GOTO 420 720 INPUT "DO VOU WANT Tu ENTER 310 IF f i t - '*D' ’ 7 HEN GOTO 4 4 0 ANOTHER UALUE? - ">UV# After HIMEM is set, control is 320 IF ft* = 1"E 1• t m p n GOTO 730 IF UYS = "V “ THEN GOTO 20 returned to the user and the Applesoft 330 IF A# = ■■p.’ THEN GOT O 4S0 740 END 340 IF ft* = " 0 " THEN GOT O 500 cursor |]) reappears. The 'JMP $3D0' 350 GOTO 590 accomplishes this. At that location, Applesoft is reinvoked.

Step 2: TABLECREATE ROR #xx appears on the screen. COM­ than 255 repetitions of the same callec Lines 8 to 62 initialize the memory PRESS recognizes three error messages: line number will create an error condi pointers for COMPRESS. While this tion. COMPRESS is limited to th< may not be necessary immediately, all ERROR #01 or ERROR #02: A line number of 16-bit (two-byte) addresse: of the initialization routines are con­ number that exceeds $FFFF has been that it can fit between $8D00 an< tained here. detected. This can occur during the $8EFF, minus 1. conversion routine if a partial line Lines 63 to 70 are subroutine INCY, number is followed by an illegal code in Line 88, which appears severa which is used throughout the program a branching statement, or a line num­ times throughout the program, loads to increment the Y register by 1. If the ber is specified that exceeds decimal single byte of the uncompressed Apple value of the Y register is forced to $00 65535. Note: line numbers greater than soft program. The command 'LD; (that is, it passes $FF), then the high- 63999 will generate an Applesoft error. ($06),Y' instructs the computer to loai order byte of the sixteen bit address Tokens $30 through $39 are the only into the accumulator the contents of being incremented (which is stored in legal numbers that can be used with a memory location whose 16-bit (twc $1F and loaded into the X register) is program line to represent a line byte) address is stored starting at I o c j itself incremented with the command number. The program (uncompressed] tion $06, least significant byte firsi INC $00,X. should be RUN to locate the source of The address at $06 and $07 (initiall the Applesoft error. $00 $08, or $0800) is offset or indexe Lines 71 to 87 are an exit from the by the contents of the Y register, intiall program and contain the ERROR sub­ ERROR #03: More than 255 Called Line $0, and incremented by subroutin routine. Notice that line 87 returns Numbers appear in the program. Note INCY described above. When Y = $A.' control to the user with a JMP to $3D0. that these do not have to be different for example, the address read into tb Piioi to that, however, the message ER­ numbers to generate an error. More accumulator will be $08A3.

96 MICRO - The 6502/6809 Journal No. 52 - September 198: Lines 90 to 141 evaluate the byte d. The field is thus narrowed down to Lines 221 through 251 write the read-in, and if indeed it is a called line the tokens that were originally in the called line number to the storage area number, begin the conversion routine. range of $30 to $39, and that will, now that it has been converted to hex. after subtracting $30, create a Since the line numbers in the program Applesoft stores everything as decimal digit between 0 and 9. The that precede each statement are already tokens except for addresses and actual actual conversion of these decimal hex, the numbers can now be directly line numbers, which are stored in hex. digits to hex can then begin. matched. This takes place after the en­ Even called line numbers appear as tire program is scanned. tokens, occupying the range $30 to $39. Lines 142 through 220 convert these Applesoft interprets tokens $30 to $39 decimalized tokens to their hex­ Lines 252 through 280 print the as the decimals 0 through 9 with one adecimal equivalents. Each digit in a message END OF PART #1. byte (token) per digit. The statement decimal number has a corresponding 'GOTO 456' would appear as '$AB $34 hex value. The units digit, for example, Step 3: APPEND $35 $36'. Since the actual line numbers has a value of $1 for each decimal 1. in the program appear as hexadecimal Decimal 9 therefore equals $9. The Lines 281 through 302 initialize numbers and the called line numbers tens digit has a hex value of $A for each pointers and registers for the Append do not, COMPRESS must go through a decimal 1. Decimal 40, therefore, has process. Certain values carried over conversion routine. The steps required the same value as $A + $A + $A + $A. from step 2, Tablecreate, are not are: The hundreds digit has the value of $64 changed, but many working registers for each decimal 1: the thousands $3E8, must be reinitialized for Append. a. Subtract $30 from the token. and the ten-thousands $2710. Lines 303 to 330 read and evaluate b. If the value of the result is less than Since the computer can add hex­ each byte of the Applesoft program and zero, then the initial token was less adecimal numbers quite easily, a regis­ take certain action if $00 appears. One than $30, and the result could not ter is incremented by the hex equiva­ occurrence of $00 indicates a line have been a called line number. lent of each decimal digit as many delimiter. If two appear, the computer times as there is value in the decimal must test to see what the next (third) c. If the value is higher than $0A (hex number. For example, the line number byte may be. There may be two $00 for 10), then the token was greater 30000 would be converted by incre­ bytes because the low-order byte of the than $39, and was not part of the line menting the ten thousands equivalent address of the next statement in number. three times: $2710 + $2710 + $2710. memory happens to be $00. It is also

VOICE I/O THAT WORKS! Remember when... for the APPLE II and Commodore computers Grandma used envelopes for pay­ Voice I/O has come a long way from the ing her bills, and it worked? barely intelligible computer speech of on­ ly a few years ago. It is now possible to enter data or commands to your com puter just by talking to it and the computer can Now... talk back with clear, pleasant, human sounding voice. Grandma’s system has been con­ The COGNIVOX models Vl0-1002 (for Commodore) and Vl0-1003 (for the Apple verted for your standard VIC®. Now II +) are at the forefront of a new genera­ tion of Voice I/O peripherals that are easy it looks like a checkbook and works to use, offer excellent performance and are affordably priced. like a payroll deduction. It reserves

SOME SPECIFICATIONS your funds for what’s due, and tells COGNIVOX can be trained to recognize up to 32 words or phrases chosen by the you what’s left to spend. user. To train COGNIVOX to recognize a new wcrd, you simply repeat the word three times under the prompting of the Includes 4 Routines system. COGNIVOX will also speak with a voca­ bulary of 32 words or phrases chosen by on cassette tape... the user. This vocabulary is independent of the recognition vocabulary, so a dialog For voice output, COGNIVOX digitizes It is easy to write your own talking and • C h e cks with the computer is possible. Memory re­ and stores the voice ot the user, using a listening programs too. A single state­ quirements for voice response are approx­ data compression algorithm. This method ment in BASIC is all that you need to say • D e p o s it im ately 700 bytes per word. offers four major advantages: First there or recognize a word- Full instructions on For applications requiring more than 32 are no restrictions to the words COGNI­ how to do it are given in the manual. • R e co n cile words, you can have two or more vocabu­ VOX can say. If a human can say it, COG­ COGNIVOX model Vl0-1002 will work laries and switch back and forth between NIVOX will say it too. Second, it is very with all Commodore computers with at • Maintenance them. Vocabularies can also be stored on easy to program your favorite words. Just least 16k of RAM. Model Vl0-1003 re­ disk. say them in the microphone. Third, you quires a 48k APPLE II + w ith 1 disk drive Check or money order accepted have a choice of voices: male, female, child, and DOS 3.3. foreign. Fourth and foremost, COGNIVOX for $17.95 plus $1.50 postage and sounds very, very good. Nothing in the ORDER YOUR COGNIVOX NOW market today can even come close to the Call us at (80S) 685-1854 between 9am handling. quality of COGNIVOX speech output. You and 4pm PST and charge your COGNIVOX can verify this yourself by calling us and to your credit card or order COD. Or send asking to hear a COGNIVOX demo over us a check in the mail, specifying your the phone. Hearing is believing. computer. Price for either model of COG­ HOW IT WORKS NIVOX is $295 plus $4 shipping in the U.S. COGNIVOX uses a unique single-chip A COMPLETE SYSTEM (foreign add 10% we ship AIR WAIL). RAM/RBC SYSTEMS signal processor and an exclusive non-li- COGNIVOX comes assembled and test­ near pattern matching algorithm to do ed and it includes microphone, software, P.O. Box 351 speech recognition. This gives reliable op­ power supply, built in speaker/amplifier VOICETEK eration at low cost. In fact, the perfor­ and extensive user manual. All you need Dept , P.O. Box 308 Goleta, CA 93116 mance of COGNIVOX in speech recogni­ to get COGNIVOX up and running is to Malden, MA 02148 tion is equal or better to units costing plug it in and load one of the programs Also available for the AIM-65. many times as much. supplied. Call or write for details. ® Trademark of Commodore

No. 52 - September 1982 MICRO - The 6502/6809 Journal 97 possible that the computer has en­ bers are stored in the order they occur decimal. Then the user will be able to countered the end of the program. This in the program. see how much memory usage has been condition is detected in Applesoft by eliminated through the use of the occurrence of three $00 bytes. Checking a 16-bit address with an COMPRESS. 8-bit processor like the 6502 involves Lines 331 through 404 search the some complexity. The low-order bytes To use HEXDEC, enter the values Called Line Number Table residing at of the Called Line Number Table are located at $AF.B0 (reverse them first of $8D00 to $8EFF and preserve the line checked against the low-order byte of course) and get the decimal equivalent. number if it appears. All elements must the line number being read. If there is a Subtract the equivalent of $800 be checked since the called line num- match, which is quite likely, the high- (decimal 2048) to find out how many order bytes are checked. If they match bytes of storage your program takes. also, the line number must be saved. Do the same after a compression run MICRObits and then calculate the difference. (Continued, from page 38) Lines 405 through 547 look for ter­ Strictly Commodore minal commands, REM statements, HEXDEC itself occupies 1906 bytes The bi-monthly softwarc-onentcd etc., and act to terminate a line if any of storage before compression, and 964 publication entirely devoted to are found. after ($0F72 - $800 = decimal 1906: VIC-20, PET, CBM, and SuperPET $0BC4 - $800 = decimal 964). This owners. Each issue contains four to Lines 548 through 554 back up if amounts to a 49.5% memory reduction! six full-length entertaining programs, more than 239 bytes have been written detailed product reviews, and a natural end-of-line has not been While admittedly this is an extreme programming tips, plus latest Commodore news Subscription S i5; located. In such cases the computer example, which was exaggerated solely sample $2. must search backwards until the pre­ to show what COMPRESS can do, the Strictly Commodore vious end of statement is encountered. basic idea is not far-fetched. The pro­ 47 Coach wood Place N.W. grammer now has the liberty to write Calgary, Alta. Lines 579 to 638 write the com­ many REM statements and put one Canada T3H 1E1 pressed statement to the normal RAM statement per line for later editing if storage location for Applesoft programs necessary. ($800 upward). Note that after com­ PET Joystick Interface pression the program is written directly A wordy original Applesoft program Connects directly to all rET/CBM over the original uncompressed pro­ now does not exact an execution penalty. computers Allows PET to .iccept gram. Since COMPRESS can only COMPRESS can optimize the code prior either Apple joysticks/paddles or shorten a program and can never to execution. All debugging should of At.m lovsticks No assemhly required. lengthen it, there is never danger that a course be done before compression. Ready to plug into the user port. program will be written over part of the Leaving the original program intact Sofiw.ne provided Immediate unread original program. allows the user to make later changes delivery Onlv S49 95. Michigan as necessary, and then recompress the residents add 4% sales tax. Lines 639 through 669 terminate code. Systems Corp. 1 Edmund Place the COMPRESS program and write the Ann Arbor, MI 481(M final pointers into the normal Apple­ One final note of caution: the name soft zero-page locations, as well as under which the COMPRESSed pro­ print 'END' on the screen. gram is saved to disk must be differeni OSI Super Defender than the original program or tlw Super Defender is an all-machine-code Line 670 returns control to the user original will be lost. One suggestion ir game msc like the arcades The with a JMP to $3D0. this regard is to add ".CO M P" to thf mountains roll hv as your scanner old program name when SAVEing th« stum1, wh.it’s coming at you. Protect Final Notes compressed version. For example vour humanoids from being snatched PAYROLL could be the origina' b\ the lauding ciatts. $14 95 for tape COMPRESS works with most lengthy version, and PAYROLL.COMI or 514" disk. Applesoft programs. Certain conven­ the compressed code. DM I’ Svsrcms tions used by some programmers may ."?lv Hampton Blvd The compilers’ promise of dramat Rochester. NY 1-1612 make COMPRESS unable to do its job. Some authors have sprinkled $20 ically increased execution speed ha: tokens ($20 is the Applesoft representa­ not been fulfilled to the extent tha Books You’ll Need tion for space) into called line number users expected. And the compiled codi 6509 Software Design - $12.95, areas of their programs to discourage may actually require geater memor Programming and Interfacing the 6502 unauthorized copying. While this is space. With COMPRESS, you cat - Slf’.'5"’, i5W Microcomputer not the only condition that will 'fool' achieve many of the same goals at sub Programming t?1 Interfacing - S14.95, COMPRESS, it is typical of unconven­ stantially lower cost, while preservin; 68000 Principles «*’ Programming - all of the important features of the Ap $14 95, Advimccd 6502 Interfacing - tional programming techniques that $12.95. Add $2.75 handling. Foreign COMPRESS cannot handle. plesoft language originally envisionei add Oil. Texas residents add 596 by the designers of the Apple II. tax. Send for free list. Included with this article as listing Phil's Books 2 is an Applesoft program named HEX- Dept. M C I DEC. This program can serve two pur­ Barton M. Bauers may be contacted at 30 P.O. Box 120964 poses: it is a good test program to run Hillock Drive, Wallingford, Connecticut Arlington, TX 76012 through COMPRESS, and it will also 06492. enable the user to convert the ad­ JUCftO dresses located at $AF and $B0 to JMCftO

98 MICRO - The 6502/6809 Journal No. 52 - September 1981 It’s like having an Uncle in the Business All Prices Discounted. Get an additional 3% *

MICRO LAB DATA ENTRY Roach Hotel ...... $28.00 Datastar...... $235.00 Peeping Tom ...... $28.00 EDUCATIONAL MUSE Counting B ee ...... $25.00 FREE G IFT F ire b u g ...... $22.00 D ecim als...... $39.00 w ith any Frazzle...... $22.00 The Learning S y s te m ...... $124.00 software order ON LINE SYSTEMS Master Type ...... $33.00 Hi Res A steroid...... $22.00 SAT Word Attack ...... $39.00 over $40.00 Hi Res Mystery H o u s e ...... $22.00 Speed Reading ...... $149.00 R oad w ork ...... $33.00 Whole Brain S p e llin g ...... $30.00 Jawbreaker (Improved) ...... $25.00 FINANCIAL MODEL/PLAN. With any order Mouskattack ...... $28.00 Asset Manager ...... $159.00 of $100 or more Ulysses/Golden F le e c e ...... $28.00 C alcstar...... $159.00 W iz& P rin ce ss...... $28.00 Creative F in ancing...... $159.00 you may select F rogg er...... $28.00 V is ic a lc ...... $191.00 any one of the Cannonball B litz ...... $28.00 Wall S treeter...... $229.00 following at these PICCADILLY GRAPHICS Star Blaster...... $25.00 Arcade Machine ...... $37.00 fantastic prices! R ibbit...... $25.00 Budges 3D Graphics ...... $33.00 Computer Aquire...... $18.00 E-Z Draw 3.3 ...... $39.00 ROCKROY Bez O f f...... $24.00 Graphics Magician ...... $49.00 Conglomerates Collide ...... $33.00 C h o p lifte r...... $25.00 Hi-Res S e c re ts ...... $99.00 SIRIUS SOFTWARE Serpentine ...... $25.00 Twerps ...... $25.00 HOUSEHOLD ACCOUNTING Deadly Secrets H i-R e s ...... $25.00 ADVENTURE INTERNATIONAL Dark F o re st ...... $25.00 The Home A cco u n ta n t ...... $65.00 P ig P en ...... $19.00 Commbat ...... $22.00 Jellyfish ...... $25.00 MATHEMATICS/ENGINEERING For Kids & The Apple (Book) $15.00 Tunnel Terror ...... $25.00 M in o ta u r...... $29.00 M a thm a gic...... $74.00 Swashbuckler ...... $21.00 W a r ...... $22.00 B a n d its ...... $29.00 Thief ...... $19.00 Rear G u a rd ...... $25.00 MAILING LIST SIR-TECH First Class M a il...... $59.00 Snack A tta c k ...... $19.00 NEW GRAPHIC ADVENTURES W iz a rd ry ...... $39.00 The Mai I ro o m ...... $29.00 Zork I ...... $29.00 S.A.G.A. 1 Adventureland ...... $25.00 Z o r k ll...... $29.00 Knights of Diamonds ...... $29.00 MUSIC/SOUND/SPEECH S.A.G.A. 2 Pirates Adv...... $25.00 Nightmare Gallery ...... $25.00 (Scenario #2 for Wizardry) Apple Talker ...... $25.00 S.A.G.A. 3 Mission Imp...... $25.00 Sat Word A ttack ...... $33.00 S.A.G.A. 4 Voodoo C astle...... $25.00 STRATEGIC SIMULATIONS The V o ic e ...... $33.00 Speed Reading ...... $129.00 Cytron Masters ...... $33.00 AUTOMATED SIMULATIONS PROP. MGMT/REAL ESTATE Hi-Res Secrets ...... $85.00 Cartels & Cutthroats ...... $33.00 F o re !...... $25.00 R.E.A.P R.E.A.P. (The Best I Have Seen) $85.00 Shattered A llia n c e ...... $49.00 Crush, Crumble & C h o m p ...... $25.00 (The Best I Have S e e n ) ...... $103.00 Tax B e a te r ...... $85.00 Computer B ism a rk...... $49.00 Tues. Morn Quarterback ...... $25.00 TAX Back It U p ...... $39.00 Computer Ambush 2nd Ed ...... $49.00 AVALON HILL Loophole Louie Loves The Bag of T ric k s ...... $28.00 SUB-LOGIC Computer Aquire ...... $22.00 Tax Beater...... $105.00 Menu Generator ...... $28.00 Flight Simulator ...... $28.00 Computer Stocks & Bonds ...... $22.00 UTILITY Pin-Ball/A Great Pinball Back It U p ...... $44.00 BEZ Gam e...... $25.00 M e m .M g m t.S y s t.il...... $39.00 With any order BezOff ...... $27.00 Saturn Navigator...... $29.00 Multi Disk C a ta lo g ...... $20.00 BRODERBUND SYNERGISTIC SOFTWARE of $200 or more Super Disk Copy III...... $25.00 C h o p lifte r ...... $29.00 Nightmare Gallery ...... $29.00 you may select Serpentine ...... $29.00 U-Boat C om m and...... $29.00 UTILITY—PROGRAMMING Deadly Secrets Hi-Res...... $29.00 A tla n tis ...... $33.00 Apple D o c ...... $39.00 any one of the Apple Mechanic ...... $25.00 CPU SOFTWARE Escape From Arcturus ...... $29.00 Apple S pice...... $25.00 following at these Oil R ig ...... $33.00 TURNKEY SOFTWARE Bag of T ricks...... $33.00 Super Low Prices! Human Fly ...... $33.00 Ceiling Zero ...... $25.00 Menu Generator ...... $33.00 The Gauntlet ...... $29.00 Bus Bookkeeping Sys ...... $275.00 COMPUTEK Programming A id s ...... $74.00 Versa F o r m ...... $259.00 S olitaire...... $25.00 ACCOUNTING The B u g ...... $39.00 Accounting P lu s ...... $318.00 D B ase II ...... $450.00 CAVALIER UTILITY— PRINTER Bus. Bookkeeping Sys ...... $314 D atastar...... $180.00 Bug Attack ...... $25.00 Zoom G raphics...... $33.00 V is ic a lc ...... $175.00 Microwave ...... $29.00 Mod#1 Gen. Le dg er ...... $199.00 Mod #2 Acct. Rec...... $199.00 WORD PROCESSOR W all S tre e te r...... $200.00 DATAMOST Financial Partner...... -$189.00 Exec. Secretary...... $189.00 Form at I I ...... $229.00 Gin R um m y ...... $29.00 Gen Ledg & Pay ...... $389.00 Format I I ...... $259.00 P ig P e n ...... $25.00 Invoice F a ctory ...... $166.00 Screenwriter II ...... $99.00 Kids & The Apple (Book) Prof Time & B illin g ...... $328.00 Wordstar Req S oftca rd ...... $249.00 For Kids From 6 to 60 + ...... $19.00 Write-On! II Loaded with Features COMMUNICATIONS C asino...... $33.00 Found in W/P S/W costing more ASCII Express ...... $66.00 Sw ashbuckler...... $29.00 than double the p r ic e ...... $99.00 Solo Poker ...... $25.00 Data Capture 4 .0 ...... $54.00 Baseball ...... $25.00 Data Capture 4.0 80 C ol ...... $75.00 Missing Ring ...... $25.00 COMPILERS Country F a ir ...... $25.00 Expediter II + ...... $113.00 YANKEE PEDDLER T h ie f...... $25.00 Tasc Compiler ...... $139.00 Snack A ttack...... $25.00 DATA BASE 10810 Cantara Street DATASOFT D B. Master...... $178.00 Sun Valley, CA 91352 Tumble B ugs...... $25.00 F ile fa x ...... $159.00 GEBELLI The General M anager ...... $124.00 (213)896-3642 Neptune ...... $25.00 PFS: Personal Filing Syst ...... $99.00 Lazer S ilk...... $25.00 Versa F o rm ...... $309.00 Z e n ith ...... $29.00 DATA BASE APPLICATION DEV. 'Take an additional 3% discount il a check (certified, cashiers or personal) accompanies the Russki D uck ...... $25.00 D. Base I I ...... $524.00 order. Please allow 14 days for personal check clearance. We also accept MasterCard and Visa. Please enclose both number and exp. date. Please add 5% for shipping & handling. Minimum INFOCOM DATA BASE UTILITY shipping & handling charge is $1.50. Foreign order minimum $75.00 plus 12% shipping & handl­ Zork I ...... $33.00 D.B. Master Stat Pak...... $83.00 ing (except Canada). If we deem that shipping & handling charges are excessive, we will return Zorkll ...... $33.00 D.B. Master U tility Pak I ...... $83.00 the excess to you. Calif residents add 6.5% tax. D e a d lin e ...... $42.00 D.B. Master U tility Pak II ...... $83.00 PRICES SUBJECT TO CHANGE WITHOUT NOTICE.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 99 Book Reviews

by John Valente

68000 Assembly Language Programming, ating modes and the register set. Dia­ Section 4 covers software develop­ by Gerry Kane, Doug Hawkins and grams help to explain the various ad­ ment, from problem definition through Lance Leventhal. Osborne/McGraw- dressing modes, showing exactly what testing and debugging. The insights Hill, 1981. ISBN: 0-931988-62-4. is happening in the machine. presented here are essential to good Paper, 680 pages, $16.99. programming practice, particularly for The next few chapters develop fam­ those inclined to jump from vague 68000 Microprocessor Handbook, by iliarity with the instruction set through ideas to coding. The summary of Gerry Kane. Osbome/McGraw-Hill, example programs that get progres­ typical errors is particularly enlight­ 1981. ISBN: 0-931988-41-1. Paper, 200 sively more difficult. The problems are ening, and can save you hours of pages, $6.99. typical of those selected in assembly- frustration. In a rare departure from language texts: simple arithmetic, code their serious tone, the authors offer These two volumes are the only widely conversion, tables, and lists. The some good advice: "Sometimes the available texts on the 68000. Fortu­ reader, who may have seen these prob­ following approach may be your best nately, they are excellent. As of this lems before, sees how they can be solved bet: turn off the computer, have a beer, writing, the only 68000 computers in the 68000 environment. and let your brain rest." (p. 19-21) available are expensive business- oriented systems. ( Editor’s note: The remainder of the book alone Motorola has announced a 68000 The third section presents ' ‘Ad­ would be worth the price. Each instruc­ Educational Computer Board ($495.00) vanced Topics” such as parameter tion is thoroughly described in alpha­ that will make it much easier to begin passing and subroutines. The 68000 is betical order. Accompanying diagrams learning the 68000.) These two books particularly adept at these applications. show precisely the flow of data be­ should thoroughly prepare you for using Powerful instructions facilitate relo­ tween registers and memory. Charts in­ the full power of the 68000. Even a catable and re-entrant routines. I would dicate the op-codes for the various ad­ casual glance shows this processor to have liked more coverage of the LINK dressing modes. This is very handy for be truly a "new generation" device. and UNLINK instructions, which are quick reference while learning a new both new and apparently very useful. instruction set. And if that's not Both volumes continue the tradi­ enough, there are three tabular appen­ tion of quality in the Osborne series. The next three chapters cover I/O dices: the first is a listing of the instruc­ They are well-written, concise, and using the 6821 PIA and the 6850 ACIA. tion set by mnemonic that includes clearly printed. Major points are in Projects range from controlling a single number of bytes, clock cycles, effects boldface, so the reader may find desired LED to an A/D converter. The use of on registers, and a functional sum­ information quickly. Diagrams abound. these chips is not new, and some mary. The second is an alphabetical Extensive indexes are included. The readers may not need to read this sec­ listing by mnemonic, with op-codes, authors stick to the point and do not tion. However, the material is relevant, byte count, and clock cycles. The third waste words; the reader should have since new I/O chips for the 68000 are lists the op-code in ascending numerical some familiarity with microprocessor not yet available. In fact, the 68000 has order. These listings are a gold mine of architecture and machine language. -special signals to communicate with information for the serious programmer. the "older generation" 6800-series 68000 Assembly Language Program­ devices. m ing begins with a discussion of the merits and deficiencies of assembly Chapter 15 is an important one, I did notice a few errors in several language. Some readers may have read dealing with exception processing. programs and schematic diagrams, but similar material in other books on Most of us have used NMI and IRQ in­ they are minor. Each chapter concludes assembly-level programming. Still, the terrupts, but these are merely two with a set of problems and a list of per­ material is worth reading as an over­ members of a whole class of excep­ tinent references. Some readers might view. A detailed description of a typical tions. Others are bus and address error, wish the authors had omitted the gen­ assembler follows; it is a very good reset, illegal operations, trace, trap, and eralized chapters on software develop­ tutorial, and applies to any processor. It multiple vectored interrupts. There is ment for the sake of a lower price. I also acquaints the reader with the ter­ even a provision for extending the in­ think the price would be justified even minology used throughout the text. struction set. Exception processing can without such material, given the quality service many peripherals in a very of the text. Because the 68000 is a com­ Chapter 3 gets to the heart of the sophisticated system. The material plex device, this book is not for casual matter: 68000 Machine Structure and covered here is complex, but close reading. Fortunately, the authors and Assembly Language. The author des­ study will make it possible to take full editors have made the work as painless cribes clearly the user/supervisor oper­ advantage of the 68000. as possible.

100 MICRO - The 6502/6809 Journal No. 52 - September 1982 The 68000 Microprocessor Hand­ text begins. A functional overview of book is for the hardware designer and the 68000 precedes chapters on bus advanced programmer. If a micro­ timing and operation, exception pro­ O.S.I. CIP, C4P & C8P processor data sheet intimidates you, I cessing, addressing modes and inter­ TRS-80 Models I & III do not recommend this book. On the facing to 6800 peripherals. Selected other hand, if you can work from a very data sheets are included at the end. The Room’ s o-f Cygnes IV You are in a roo» mth »alls placed randoaly throuohout. There ire compact reference, and particularly if three to ten ROBOTS bent on destroying you mth laser tire or bv touching you. You aust destroy all the robots in a rooi to advance a you are developing system hardware, The text is very detailed, and very le v e l. The hig h e r th e le v e l th e fa s te r th e ro b o ts. HflTCH-OUT the n a ils this one is for you. Every pin and signal are electrified" There are t*o skill levels. technical. The emphasis is on hardware O.S.I. C4P !r C8P - Color, Sound & Joysticks 81! Cassette - 19.95 of the 68000 is concisely described. design; all the material you need for Tr5-00 I li I I I Sound both J2K c a s s e tte and 32K d isk v e rs io n - 112.95

Diagrams are used extensively for bus programming can be found in the other Murder Mansion - Adventure #1 cycle timings and data movement be­ You and seven other people are e«plormg a three storv house for a volume. Only if you are capable of pro­ treasure, MICH-OUT" Soaeane has decided to get a little greedy and tween registers and memory. There is gramming from a terse listing of a new is k il l in g th e o th e rs . You co u ld be N £ IT " Trs-80 version has a graphic representation of each roo *'" no tutorial information on the instruc­ instruction set should you rely on this O.S.I. CIP, C4P & C8P - 8K Cassette - *12.95 tion set, and no program examples are volume for software development. Trs-8 0 I i I I I (G raphics) 32K C assette and 48k Jis k v e rsio n - 116.95 given. However, there is a brief descrip­ Nonetheless, it is an excellent "stand­ Blaster Attack This is a t*o pi aver gaae ihere you have to protect your country fraa tion of the instruction groups, with em­ alone" guide to the 68000. For the ex­ overhead s p v -c ra ft. You and your opponent lu s t shoot doon as (any eneay c r a ft n ith »our LASER-BASE b e fo re your tia e runs o u t. Excel Ie nt phasis on the more unusual ones. Two perienced designer, it lives up to its sound and g ra p h ic s . You can p la y th e computer or a huaart opponent. concise appendices list the entire in­ title as a Handbook. You both M ill use the Saae playing field at the saae tia e '11 D .S .I. C4P t CBP - Sound 9K C a sse tte - *7.95 struction set by mnemonic and by op­ N o v a s ta r code, as in the other book. When you read about the 68000, I You are a lone x a r n o r on a seek and d e stro y u s s io n . You’ ve been sent to ALDEBERQN to destroy 4 CYClON fuel stations *hich are protected by a think you will be impressed. Users of CYCLON fighter sgadron. You a ill have 5 oldstyle nuclear aarheads to I especially liked the two-page in­ the 6502 and 6809 will see some basic destroy the stations. At the saae tile you n il have to dogfight the CYCIQN f i g h t e r s " ! 1 troduction, which gives the reader a similarities, such as memory-mapped O.S.I. W h CBP - Color V Sound 8k Cassette - feel for the uniqueness of the 68000 and I/O and extensive addressing modes. B u n k e r s compares it to the 8086 and the Z8000. However, the 68000 is a more complex this is a two player gaae in nhich you lust destroy 5 of your opponents bunkers by shooting over a rugged lountam. You control your iu z: 1 e Since many of the new machines will processor with many new features. Its velocity and barrel angle. Great COLOR graphics and sound. use 16-bit processors, this will help you speed, 32-bit registers, and provision O.S.I. C4P I C8P - Color I Sound 8K C assette - *7.95 evaluate the various CPUs. The in­ for multiple users, put it into the troduction convinced me that the minicomputer class. Many analysts see Send $1.00 foi catalog 68000 is potentially the most powerful a lack of software as a stumbling block COMP-U-GAMER SOFTWARE of the three. to its acceptance. Perhaps readers of P.O. Box 802 these two books will help solve this The conventions used in the dia­ problem. Nevada, Missouri 64772 grams are clearly described before the JMCftO

P e r r y PERiphERAls R e p a i r s K I M s !!

( S Y M s a n <) A I M s T o o )

• 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 W arranty • 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.) P er r y P e r Ip Iier a U 6 Brookhaven Drive Rocky Point, NY 11778

K I M - 1 RepIacement M o d u U s • Exact replacement for MOS/Commodore KIM-1 S.B.C. • Original KIM-1 firmware — 1K and 4K RAM versions

RepIacement K I M - 1 KsyboARds • 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. 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 W x 6 V2”, 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 5 1A” 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 DM 816-M 8A 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) DM 816- 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 DM 816-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 523 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 TM

Reviews in Brief

Product Name: SIGMON CLOADM format, and (R)ead, which loads only files made Equip, req'd: TRS-80C Color Computer with CSAVEM, W, and CSAVE. In addition, the filename, with 16K memory start address, file type, and last address are displayed. Price: $29.95 Also, the R command allows an offset to be specified to Manufacturer: Datasoft, Inc. avoid conflict between programs. Debug and auxiliary 19519 Business Center Dr. commands are also available. Northridge, California 91324 Description: SIGMON, a comprehensive assembly- Pluses: Low cost, simple syntax, short learning curve, and language monitor for the Color Computer, is distributed convenient, comfortable operation. The S command is an on cassette. This versatile monitor incorporates a full excellent and unique enhancement. disassembler and a line-by-line assembler, which doubles as a memory modify mode; it allows decimal, hexadecimal, Minuses: No printer output available; no listing furnished. and literal text to be entered while inserting the correct The display scroll speed is too fast, and the V command binary values in memory. Other abilities include the fol­ should be able to verify cassette tapes. lowing: display memory in an 8-column format, showing both hexadecimal and ASCII characters. An optional Skill level required: As with any other monitor, the user display shows graphics characters for that range of binary should have some assembly-language experience. How­ numbers. The LIST command displays memory contents ever, this monitor is perhaps the simplest to use and ex­ by memory location in a 25-column format. A data-search cellent for beginners. routine searches for text, hexadecimal values, or hex­ adecimal values specified as assembly-language mne­ Reviewer: Ralph Tenny monic string.

Pluses: The large number of functions makes a very Product Name: PAL (Personal Assembly Language) capable package. Extensive documentation is furnished, Equip, req'd: Versions for all Commodore including a full assembly dump with comments. In par­ computers except the original BASIC ticular, the string search is powerful and versatile. 1.0 PET. Printer and Commodore disk or tape optional. Minuses: Some points of syntax are not covered in the in­ Price: $50 structions. The approximately 6.5K-byte program is not Manufacturer: Brad Templeton available in ROM, and is an inconvenient size for user- 271 Westcourt PI. #201 loading in ROM. Waterloo, Ontario N2L 2R8 Canada Skill level required: The user must be moderately familiar Description: PAL is a complete 6502 assembler, entirely in with assembly language before he can use any monitor machine language. Its syntax is like that of Commodore's effectively. own assembler, except that it uses ordinary program files instead of sequential data files. This assembler is used by Reviewer: Ralph Tenny some of the best known PET programmers.

Pluses: Like its companion program, POWER, PAL is ex­ tremely simple in concept, flexible in use, and powerful in skilled hands. It occupies only 4K of memory, and may Product Name: BUGOUT easily be placed in EPROM to leave even more memory Equip, req'd: TRS-80C Color Computer free. (It is able to hold its own 4K unassembled source code with 16K memory in a single file.) PAL is also extremely fast, assembling Price: $19.95 itself in under 10 seconds after disk access time. It uses the Manufacturer: Spectral Associates familiar BASIC screen editor, POWER, or any other pro­ 141 Harvard Avenue grammer's aid, allowing highly flexible editing without Tacoma, Washington 98466 learning a new set of commands. PAL includes an un­ Description: BUGOUT is a small (< 1800 bytes), well assembler, and a converter for MAE assembler source files. done assembly-language monitor for the Color Computer. The latest version is also able to create relocatable code. Memory modification can be accomplished in two modes: normal examine/modify mode called (S)ubstitute, and Minuses: Doesn't handle macros, though that skill is (AJSCII, which enters ASCII codes in memory directly planned in an update. BASIC doesn't preserve leading from keystrokes. A (F)ill mode allows entry of a given spaces in source files when they are edited. Thus, source value in each location of a block of memory. The (M)ove files look a bit cramped before assembly. memory command allows any memory move, including overlapping code. Two display modes are available: (D is­ Documentation: The manual is well printed and quite play memory in normal screen dump format, and (T)ype, readable for skilled users. Beginners should probably buy which displays memory contents in ASCII. The cassette another 6502 machine-language quide to go along with handlers aie (W)iite, which records assembly language in PAL's manual.

No. 52 - September 1982 MICRO - The 6502/6809 Journal 103 Skill level requited: Must be familiar with BASIC's screen Minuses: The cataloging modules are slow, compared to editor and 6502 assembly language. competing disk catalogers, due to the extra information they collect. The package needs an expert mode that Reviewer: fames Strasma allows skilled users to avoid the constant query, 1 'Is this information correct?'1

Product Name: Disk Utility Pack Documentation: Six printed pages, well done, but sketchy. Equip, req'd: Commodore computer and disk drive Price: $35 Skill Level Required: Beginners can use most of the Manufacturer: Dick Immers package. However, only skilled users should use the edit op­ 152 Brookfield Ct. tion of ZAP PET. Adrian, Michigan 49221 Description: Has three main features: 1. includes a safe Reviewer: fames Strasma and versatile disk monitor called ZAP PET, which is much like Micromon, but for the disk rather than the computer; 2. attempts an automatic disk recovery after otherwise Product Name: Munch-a-bug fatal data errors, (such as doing a short "new ” to reformat Equip, req'd: Apple II Plus with 48K the diskette, or leaving the disk in place while switching Price: $49.95 disk power off and on); and 3. catalogs up to 99 diskettes. Manufacturer: Southwestern Data Systems 10159-1 Mission George Rd. Pluses: ZAP PET is reliable in use. It has been carefully Santee, California 92071 developed as a doctoral project over the past two years, and Description: Munch-a-bug provides a variety of has overcome many of the limitations of similar programs. capabilities to aid in debugging assembly-language pro­ It is also the only such program that uses the hexadecimal grams. A few of these are: Trace, a facility for listing 6502 and ASCD data used by the better computer monitors. ZAP registers as each instruction executes; Breakpoints, a PET alone is worth the price of the entire package. The facility to identify paths of execution; Examine, a facility disk recovery modules, MAYDAY and EAT MY DISK, are allowing display and change of 6502 registers. There are able to restore most or all of the data on diskettes that have many other features making the program a truly valuable been damaged accidentally. The additional data stored by utility. the cataloging programs allows a lost directory to be restored quickly and easily from the catalog. Pluses: Assembly-language programming is greatly eased with this product. Large or complex programs are done much faster if intelligent use is made of the product's features. A particularly valuable capability is the Next command which allows tracing but ignores fSRs. A feature for making three back-up copies is built in and works well.

ENGINEERS/TECHNICIANS Minuses: A built-in assembler is provided, but it's somewhat primitive. Direct SAVEs of assembly source is impossible. This is, overall, a minor inconvenience,- it can THE MICRO 68000 be worked around.

IS DESIGNED FOR YOU! Documentation: Excellent. Some fairly original tech­ COMPLETE, READY-TO-GO SYSTEM INCLUDES: niques are introduced, but the manual describes them □ 6 amp switching power supply □ Keyboard clearly. There is, perhaps, a tendency towards making the □ Display-Hex & Binary □ Pete Bug keyboard examples provided overly simple. monitor □ Optional Macs Bug CRT monitor □ At­ tractive cabinet □ Dual RS232 interface □ 32 bit Skill level required: Experienced assembly-language programmer. parallel I/O □ Versabus compatibility □ The only system that provides for direct entry of 68000 Reviewer: Chris Williams machine code. ^ F°r information call (714) 566-3911 f m i l Computer System Associates Product Name: OS-96 Equip, req'd: CBM 8032 with 8096 expansion 7562 Trade Street, San Diego, CA 92121 memory board and Commodore disk Price: $200 Manufacturer: A.B. Computers $985.00 complete 252 Bethlehem Pike Colmar, Pennsylvania Description: OS-96 is an extended BASIC interpreter. It expands BASIC workspace to an apparent 64K free (32K reserved for program text, and 32K for variables.) Also adds several commands and enhancements to BASIC, including most of those in the SM KIT programmer's aid. Further enhancements to the interpreter are planned later.

Pluses: Leaves lots of memory space free for large pro­ grams. Changing program lines, or chaining large modules

104 MICRO - The 6502/6809 Journal No. 52 - September 1982 behind small ones, doesn't clear or overwrite variables. Product Name: Write Away The BASIC stack has been lengthened, allowing deeper Equip, req'd: Apple II or Apple II Plus, 48K, 1 disk nesting of loops and subroutines. Key sequences access the drive. Recommend modified shift key, 8032's extended editing commands. Program lines and lower-case adapter, 80-column card, variable data may now be up to 255 bytes long. Spaces are second disk drive. automatically deleted from program lines, and reinserted Price: $175.00 on LISTing, with a further option moving each statement Manufacturer: Midwest Software Assoc. to a new line, properly indented for structure. OS-96 is fully P.O. Box 301 compatible with PET BASIC syntax and programs. St. Ann, MO 63074 1-800-835-2246, Ext. 467 Minuses: Program load addresses differ from usual BASIC. Description: A versatile word processor providing the user Includes a "load at” command to help. The AUTO line with a variety of levels of capability. Terminology and pro­ number feature often turns on when not wanted. None of cedures are quite similar to DEC's PDP word processing the usual SYS calls or enhancement ROMs work with software. OS-96. Pluses: The expandability is excellent. If one is familiar with DEC procedures, learning time is near zero. Documentation: The instructions I saw were preliminary. I found them adequate for those who already know PET Minuses: Very little can be found wrong with this pro­ BASIC, though they hint at undocumented commands. gram. There is a lengthy tutorial on the program disk that, perhaps, takes longer than it should to complete. Skill level required: Beginner to expert. Documentation: Excellent. The booklet provided is con­ Reviewer: James Strasma cise and informative. A separate quick-reference card of commands is inchided in the package. Without it, the user Product Name: The WIZ Database Manager would have to occasionally erase his screen of text in order Equip, req'd: CBM 8032 or 8096 computer with to use the HELP command. 8050 disk drive. CBM or ASCII printer optional. Uses phantom ROM at Skill level: No programming language knowledge needed. $9000. Some general computer familiarity is desirable. Price: $495 Manufacturer: Dr. Daley Software Reviewer: Chris Williams (Continued) Water Street Darby, Montana 59329 Description: WIZ is a data manager package. It is limited to a single file, but the file may use up to 30 diskettes, each with 2,000 or more records. Each record may be up to 250 characters long, and contain up to 64 fields of up to 78 characters each. WINCHESTER Pluses: Handles vastly larger numbers of records than competing programs. Also includes built-in plotting. Like its best competitors, the WIZ uses CBM's recommended FOR MOTOROLA screen input editor, has programmable arithmetic, and handles simple reports. It also allows sorting on any field EXORCISOR/MDOS or combination of fields, and either fixed field or global □ 10 MB Winchester hard disk runs MDOS on Motorola searches, with or without regard to the case of the text. Exorcisor System □ No modification to MDOS required Results may be sent to screen, printer, or Word-Pro se­ □ MDOS based software stays alive □ All user software quential disk file. Includes listing to allow reading and operates without modification □ Optional SA-801R ­ writing its data from other programs, and can jump from ible diskette drive system □ Optional 10 MB removable itself to other user programs. Better yet, it can read in data cartridge. from sequential disk files, avoiding retyping when up­ ^ For information call (714) 566-39 11 grading from a lesser data package. r m i l Computer System Associates Minuses: Moderate attempts are made to keep the user 7562 Trade Street, San Diego, CA 92121 from halting, listing, or changing the programs. The phan­ tom ROM will activate outside the WIZ, if its last two ad­ dresses are PEEKed; whether this is a problem depends on what other ROM shares the socket.

Documentation: Self-documenting. Includes a thick and nicely packaged manual, but you may not need it. The WIZ explains itself merely by typing "help” . This works virtually anywhere in the program, providing a total of 125 help screens.

Skill level required: Even beginners should be able to use this package effectively.

Reviewer: James Strasma

No. 52 - September 1982 MICRO - The 6502/6809 Journal 105 Product Name: Amper-Magic Minuses: The program does not allow for reordering the Equip, req’d: 32K Apple II or Apple II Plus; presentation of the files differently from the order they are Applesoft in ROM or Language Card saved on the disk. The price of the program seems some­ and one Disk II with DOS 3.3. what high in view of its limited function. Without carry­ Price: $75.00 ing out the task of entering the projection times in each Manufacturer: Aurora Systems, Inc. image file, the auto-display function is of limited use. 2040 E. Washington Ave. Madison, WI 53704 Reviewer: David P. Allen Author: Bob Nacon Description: A menu-driven utility program that allows machine-language subroutines to be added to Applesoft Product Name: Color Scribe programs. Each subroutine is given a name (see below) and Equip, req'd: TRS-80 Color Computer, 32K with is callable from the BASIC program using the Applesoft disk. Ampersand (&] command. Twenty-three ready-to-go sub­ Price: $49.95 routines and their descriptions are included with the Manufacturer: Computerware package. Volume II, with 26 routines, will be released by Box 668 the time you read this. Encinitas, CA 92024 Description: This full-featured text editor/formatter in­ Pluses: Ampei-Magic provides a convenient way to cludes full disk and cassette ASCII-file compatibiity. The package ampersand routines and Applesoft programs text editor is line-oriented, and can be used to edit BASIC together. This allows the user to avoid extra BLOAD com­ files, as well as many other text applications. The editor mands and possible adjustment of program pointers when includes edit, change, add, copy, move, and replace. The setting up a program that uses ampersand subroutines. formatter is very powerful and automatically justifies left Many options are provided for ease of use. For example, and right text. Headers and footers are allowed, as is any table of subroutines created for use by one program underlining and centering. Indentation and sending of may be saved in a binary file and used as a unit in any other printer control codes are accepted. User remarks can be program desired. entered into files, and files larger than memory are easy to create. Minuses: The names given to the subroutines are restricted to four bytes. A byte may be either a single Pluses: Easy to leam for simple applications, yet offers ASCII character or an Applesoft token name (e.g., GOTO, more powerful functions when required. The formatter is NEXT, PRINT, etc.). This restricts the user to un- one of the best I have seen. The disk operating system mnemonic names if only ASCII characters are used. works well now since bugs from an earlier version of the program have been corrected in this version. Files can be Documentation: Good. A quick reference card summarizes as large as a disk can hold by using the 'MORE' command. system usage. The READ command brings text from a file on disk into any desired position in the file in memory. Files are backed Skill level required: Facility with Applesoft. No knowl­ up automatically as they are loaded. A MACRO command edge of machine language is needed. allows the user to specify single-key entry of one or a series of commands. ESCape and CHR$ commands can be speci­ Reviewer: Richard C. Vile, Jr. fied by the formatter to allow you to use special print op­ tions, change character fonts, etc., in the printer. Com­ Product Name: Apple Flasher mands can be entered in either upper or lower case. Equip, req'd: Apple II with Applesoft in ROM or RAM card. One or more disk drives Minuses: Since the program is line oriented, the user must with DOS 3.3. press the ENTER key at least every 127 characters. Text is Price: $34.40 plus $1 for shipping difficult to visualize on screen, and the screen print for­ Distributor: Crow Ridge Associates, Inc. matter does not use a "window” format to view the text. P.O. Box 90 As a result, you must do a printout to actually view the New Scotland, NY 12127 result of formatting commands. When working on a file (518) 765-3620 brought in from disk, the file is open. If you shut off the Description: Apple Flashei provides a convenient, rapid computer, or exit Scribe via Reset, or other unauthorized way to find and display high-resolution pictures that have means, you will have an open file on the disk. You will been previously stored on diskettes by other Apple II pro­ probably not be able to read this file again. It is possible to grams. It loads the names of assumed picture files into the end up in BASIC if you press the BREAK key while access­ program and offers four options for their display: 1. A ing the directory. The manual does warn of this. A minor single keystroke to present picture; 2. Each picture scanned bug does not allow using the slash bar as extension for about two seconds in rapid succession,- 3. Picture files delimiter,- a period is used as delimiter. displayed in an emulation of a manual slide drum slide projector; 4. Automatic projector mode. Back-up replace­ Documentation: The 40-page operation manual is of excel­ ment is available for $8.50 plus return of the damaged lent quality. A demonstration file is included on the disk disk. One back-up copy will be sold in addition to the that assists in understanding the operation of the program. master disk for this price. Skill level required: The progam operation is easy to leam, Pluses: The author has developed a very fast file recovery even for the novice operator. algorithm that loads frames in about two seconds. You can also load three files at once with instantaneous shuttle to Reviewer: John Steiner either hi-res screen one or two. Files may be on two drives and "punched up” in any sequence. AMCRO

106 MICRO - The 6502/6809 Journal No. 52 - September 1982 Commodore Programs Move into the Fast Lane with P e t s p e e d — The Optimizing E asy to U se Petspeed is as S e c u rity A security device is Basic Compiler that runs Commodore easy to use as these screen displays provided to run Petspeed, but no run­ BASIC 40 times faster. You can illustrate. time key is necessary for compiled dramatically reduce long processing programs. You’re free to build in times, tedious disk handling, and long your own protection. Petspeed code print runs. No other compiler can cannot be listed by others, so com­ offer the same speed, compatability piled programs cannot be tampered and trouble-free compiling as with. Your programs belong entirely Petspeed. to you. Directory C o m p a t i b l e — Petspeed BEFORE compiles any BASIC application and is compilation. available for any combination of Move your Commodore into the fast 4000 and 8000 series Commodore lane today with Petspeed. And save equipment. $25 too! Send this coupon today to

F a s t e r The key that sets Pet­ speed apart from other compilers is optimization. Where most compilers merely translate from one language to another, Petspeed analyzes your Simply type in your program source program to eliminate unnec­ SMALL SYSTEMS ENGINEERING essary complexities, thus speeding 222 B View Street processing time. Your program is M ountain View, CA 94041 reduced to much smaller components ’CCC'*? css;: •».? *»» and reassembled into a far more effi­ (415) 964-8201 cient form. Compare these optimizing features: • 4-Pass compiler. iZ;r c'carj.v pr| Dealers: Ask for our free demo disk. • Automatically uses faster integer i'.'jr C’-;gr30i,3t erg i C'-;a«-avj" erg Price $325 arithmetic when possible. Directory AFTER • Automatically handles frequently compilation occurring variables and arrays. • Subroutines no longer need be located at the beginning of your It isn’t necessary to add compiler program. directives. Simply type in the pro­ • Petspeed automatically calls all gram name. In less than 2 minutes subroutines at maximum speed. you’ll see your program run up to 4Q_ • Petspeed runs twice as fast as times faster. ~"" other compilers. • Larger programs require far ' memory when compiled.

Offer Expires 8/31/82

Please rush Petspeed today! My disk format is □ 8050 □ 4040. My computer is □ 8032 □ 4032.

My check for $300 (plus 6Vi % sales tax for CA res.) is enclosed.

□ Please send more information □ I’m a dealer. Send me your free demo disk.

Company Street___ City ____ _State _ _Zip_ Mail to: Small Systems Engineering 222 B. View St., Mountain View, CA 94041 C 7

No. 52 - September 1982 MICRO - The 6502/6809 Journal 107 TM '\ Dr. William R. Dial 438 Roslyn Avenue Akron, OH 44320 6502 Bibliography

1. Commodore Magazine (April/May, 1982) 7. Creative Computing 8, No. 5 (May, 1982) Scott, Dave, ‘ 'An Easy Cursor Positioning Routine, ’1 pg. Ott, Jack P., "Listing/Copying Apple Text Files,” pg. 82-85. 144-154. A machine-language program for the Commodore The lack of a simple command to list or copy text files Microcomputers which allows printing a message at a on the Apple prompted design of a procedure to do specific x,y location on the screen. It is entered via the this. Written in BASIC, simple editing of whole “ SYS” command. records is made possible, but is not as versatile as a true text editor.

2. MICRO No. 48 (May, 1982) 8. Mini’App'Les 5, No. 5 (May, 1982) Engstrom, Christer, "BASIC to Machine-Language Inter­ Murrell, Mike, "Cursor Menu," pg. 9-10. face," pg. 13-17. A cursor-oriented menu control program for the Since the AIM lacks a CALL or SYS function, it is dif­ Apple. Written in Applesoft. ficult to communicate between BASIC and machine language. This interface routine makes possible the entry of the machine-language address through a 9. Call —A.P.P.L.E. 5, No. 5 (May, 1982) BASIC variable. So, Edward C., "Picture Compression,” pg. 21-35. A program in machine language for the Apple which provides a method of storing and retrieving an Apple 3. Compute! 4, No. 5, Issue 24 (May, 1982) hi-res picture in less than the 34 sectors it normally Berlin, Stanley M., "Putting the Squeeze on Your requires. The program consists of five separate VIC-20: Getting the Most Out of 5000 Bytes,” pg. routines. By examining for duplicated pixels within 136-144. the picture, one can use less than 960 pixels to store When you write a program so large that it will need the picture. every last memory cell in your computer, this article shows several ways to reduce the size of your pro­ 10. Byte 7, No. 5 (May, 1982) gram. In general, the suggestions may apply to other Sweet, Jerry N., "Chedit,” pg. 426-444. machines using BASIC. A graphics-character editor enabling the Apple Pascal user to define his own character set, using the Turtle- graphics system. 4. The Commodore Transactor 3, Issue No. 5 (May, 1982) Hook, David A., "VIC Loader for PET/CBM ,” pg. 41-48 Microcomputer Information Resources This procedure, BASIC program, and machine-lan­ guage routine will make it possible for VIC-20 users to MICRO wants to make sure our readers are aware of the exchange tapes with PET/CBM users. These routines excellent sources of microcomputer bibliographic infor­ accommodate several possibilities of incompatibility. mation that are available. • Microcomputer Index is a periodical that provides a subject index for a cross-section of popular microcom­ 5. Antic 1, No. 1 (April, 1982) puter magazines. It includes abstracts. Published by Capparell, James, "Systems Guide: Memory Map — Microcomputer Information Services, 2646 El Camino Page 0 ," pg. 9-11, 15. Real #247, Santa Clara, CA 95051, Microcomputer In­ dex has put more than 10,000 articles, indexed and In the next few issues of this new publication serving abstracted from 23 periodicals, on line with the Atari micros, a complete memory map will be Lockheed's DIALOG service. The Index is probably the constructed giving the reserved memory locations in best single source of bibliographic information in book RAM and ROM with a description of the purpose of form about articles published in microcomputer maga­ each location. The first 128 of page zero are reported zines. Compiled by W.H. Wallace and published by in the current issue. Missouri Indexing, Inc. (P.O. Box 301, St. Ann, MO 63074), The Index is not only comprehensive, but so well organized that using it is a pleasure. 6. PEEK(65) 3, No. 5 (May, 1982) • Micro ... Publications In Review is another helpful Eidbo, Carl, "OS-65U Disassembly Aid,” pg. 3-5. publication (Vogeler Publishing Inc., P.O. Box 489, The unavailability of an OS-65U disassembly manual Arlington Heights, IL 60006). This periodical repro­ led to a project to disassemble specific areas. Both duces the tables of contents of the latest issues of the BASIC and machine-language versions of a dis­ major microcomputer magazines, and provides a sub­ assembler aie given foi OSI micros. ject index. JMCRO"

108 MICRO - The 6502/6809 Journal No. 52 - September 1982 HANDS-ON LEARNING Presfax® and Apple® II

Young students, the handicapped and many others are finding the Apple® II computer more accessible than ever before. Thanks to the Presfax 100® Touch Teacher keypad from Computer Data Services. With a square, touch-sensitive area consisting of 100 ''keys," the Presfax 100 key­ pad fits right over the Apple II's keyboard, freeing users from any restrictions they may encounter with the standard keyboard arrangement. The keypad grid can be covered with overlays composed of whatever symbols the user feels most comfortable with — large alpha-numeric characters, braille, special symbols and pictures, etc. Grid values and coordinates are memory- stored and assigned individual audible pitches to ensure user feedback. Driver software comes on a 3.3 DOS disc complete with full instructions on how to incorporate it with the purchaser's own programs. Demonstration and educa­ tional programs are also available. Contact Computer Data Services, P.O. Box 696, Amherst, N. H. 03031 for full details. Or call (603) 673-7375.

Suggested Retail Price $175.00 Shipping 3.50 COMPUTER DATA SERVICES PO. Box 696 Route 122 i 1 = Amherst. NH 03031 (603)673-7375

Dealer Inquiries Invited ~ ----- — T M

No. 52 - September 1982 MICRO - The 6502/6809 Journal 109 TM Dr. William R. Dial 438 Roslyn Avenue Akron, OH 44320 6809 Bibliography

64. BYTE 7, No. 5 (May, 1982) Shorter, Ted, "Ice Lander Can Be A Slick Run," pg. 25-27. A lunar lander type of game for the 80C. Kocher, Christopher P. and Keith, Michael, "Six Personal Computers from Japan,” pg. 61-102. Nolen, Bill, "Now a Whole Bag of Dice," pg. 38-40. Descriptions in detail of six Japanese computers including How to replace your $5.00 set of dice with a $600 computer, the 6809-based Canon CX-1, the Hitachi MB-6890, and the with a few extras to boot. For the TRS-80 Color Computer. Fujitsu FM-8. Curtis, H. Allen, "Getting More from PMODE 4," pg. 42-46. Barden, William, Jr., "Ports of Entry and Soft Breezes for the Discussion of color graphics on the 80C demonstrating that Color Computer and Model ID," pg. 162-198. PMODE 4 has six other color sets. Several short programs are Instructional article for the Radio Shack 6809-based Color given. Computer. A $10 anemometer and other remote-sensing pro­ Scerbo, Fred B., Dobbert, Robert, and Haggerty, Dale, "Swamp jects using the cassette interface. Wars Can Win Your Croix de Lillypad," pg. 49-50. A color game for the TRS-80 Color Computer. 65. MICRO No. 49 (June, 1982J Mir, Jorge, "A Data File to Store All Your Information," pg. Tripp, Robert M., "Editorial," pg.5. 57-62. Discussion of new developments relating to the 6809 A flexible file system for the Color Computer, with search microprocessor. function, sorting, etc. Clements, William C., Jr., "Add a VIA and Speech Synthesizer Moses, Ray, "Stars Fall on 80C," pg. 64-65. to the Color Computer," pg. 19-21. A program giving a display of the sky using a variety of times Hardware article for the TRS-80 Color Computer, adding two of the year. user-accessible, 8-bit bidirectional I/O ports to your com­ puter and interfacing an inexpensive speech synthesizer. 70. '68' Micro Journal 4 No. 5 (May, 1982) Dial, William R., "Resource Update," pg. 99-100, 110. A list of magazines which contain information about the Anderson, Ronald W., "Flex Uer Notes,” pg. 10-12. 6502/6809 microprocessors on a reasonably regular basis. Discussion of the use of Pascal including a dump utility for 6809 based systems. Staff, "Software Catalog," pg. 101-109. Nay, Robert L., "Color User Notes," pg. 13-14. Description of some 50 different software items, including a Notes on the Super Color Writer and Flex9 for the Radio number for 6809-based systems. Shack 6809-based Color Computer. Staff, "Hardware Catalog," pg. 111-113. Cadmus, Ray, "OS-9 Notes," pg. 15-16. Some 20-odd items of hardware are described including Notes on the OS-9 operating system for the 6809 including several for 6809 systems. a program HDIR, a hiarchial directory. Dial, William R., "6809 Bibliography," pg. 117. Rowley, Blair A., "Uniflex and RSTS," pg. 19-22. A number of literature references related to 6809-based Intercommunication between Uniflex and RSTS developed systems. in 6809 assembly language. 66. Apple Assembly Lines 2, Issue 9 (June, 1982) Lilly, Randal, "Transfer" pg. 22-24. A computer link program that allows a main computer Sander-Cederlof, Bob, "Implementing New Opcodes Using (SWTCP 6809) to transfer and run programs on a remote ■BRK’," pg. 2-5. CPU (6800 or 68 09 computer). How to use the 6502 to simulate neat instructions from the Jones, Bob, "Othello," pg. 34-35. 6809 like LEAX, BSR, BRA, etc. Othello for 6809 based systems. 67. Micrccomputing 6, No. 6, Issue 66 (June, 1982) Preble, LaurenceD., "Error Messages," pg. 37. A patch for Version 17 of TSC's Extended BASIC for the Staff, "C Development Tools for the MC6809," pg. 162. 6809 to better handle error messages. An announcement of Introl-C, a set of software for Liu, Bruce, "Overlay Systems," pg. 37-39. 6809-based C programs, including a C compiler, a 6809 Improved Pascal routine for 6809 based systems. assembler, an object code linker, and an object code library manager. 71. 80 Micro Issue No. 30 (June/July, 1982J 68. BYTE 7, No. 6 (June, 1982) Berenbon, Howard, "SDS80C Editor/Assembler/Monitor" pg. 70-71. Barden, William, Jr., "A General-Purpose I/O Board for the Review of a 6809 assembler/editor/monitor. Color Com puter," pg. 260-282. This hardware article describes a low-cost interface which Commander, Jake, "Spiromania-Part n," pg. 106-115. can be plugged into the ROM slot of the Radio Shack TRS-80 Machine code routine for color graphics on 6809 based Color Computer. systems including the Radio Shack Color Computer. Norman, Scott L., "Color Computer Utilities," pg. 116-120. 69. The Rainbow 1, No. 12 (June, 1982) Power Pack and Color Diagnostics, Editor and Assembler for the Radio Shack Color Computer are reviewed. Lewandowski, Dennis S., "The Assembly Comer," pg. 6-7. Discussion of indexed addressing for the Radio Shack TRS-80 Leichtman, Kerry, “Bob Rosen — A Colorful Success Story,” Color Computer, also designated the 80C or CoCo. Several pg. 174-175. other instructions for this micro are also discussed. Build a better bulletin board and the world will beat a path to your door. Using the 6809-based Color Computer. Waclo, John, "80C Picks the National Football League," pg. 12-18. Miller, Franklyn D., "Extended Color Basic," pg. 266-270. Keep track of how the NFL is doing with this program for the Discussion and hints for using this system for the Color TRS-80 Color Computer. Computer. AMCRO

110 MICRO - The 6502/6809 Journal No. 52 - September 1982 TM

Software Catalog

editor, macro assembler, inter­ Name: Financial Records Name: Bowling Data excitement of the arcade to preter, and utilities. Manager System 2.0 your home. A tempest of a System: Apple II, DOS 3.3 System: Apple II Price: $375.00 game, it has 135 levels of play, Memory: 48K Memory: 48K minimum Includes object code for the fast action, graphics, and Language: Applesoft and Language: Applesoft ROM UCSD p-System, UCSD sound. It challenges the very Machine Hardware: 1 disk drive (2 p-System User Manual, best arcade experts and offers Hardware: Disk drive Iprinter recommended), Architecture Guide, fun for the beginners too. optional) DOS 3.3, Installation Guide, and There is no other high- Description: A menu-driven, 80-column printer Beginner's Guide to the resolution graphics arcade user-friendly program to col­ Description: A database pro­ UCSD Pascal System, with game like it! lect, sort, store, and analyze up gram for bowling league tutorial disk. Price: $24.95 on cassette to 750 checking/budget secretaries. Stores and com­ Available: $29.95 on disk records and 500 tax records. In­ putes data for multiple (and/or SofTech Microsystems, Inc. Includes program and cludes 30 user-defined budget mixed) leagues of up to 40 9494 Black Mountain Rd. instruction manual categories and 50 user-defined teams, each with up to six San Diego, CA 92126 Available: tax categories, automatic pay­ bowlers per team |not in­ (714) 578-6105 Computerware ments, search and edit func­ cluding substitutes). The Box 668 tions, average and percentage reports generated are: weekly Encinitas, CA 92024 budget analysis, tax summary recap, score sheet, season Name: Waterloo (714) 436-3512 (including approximate taxes average, and team listing. microFORTRAN due), "W hat if?’’ analysis, and Many options are included. For System: Commodore utilities. each team a cumulative record SuperPET, Volker- Price: $44.95 is kept of all pertinent data. Craig 2900, 3900, Name: FORTH-79 Includes typeset manual, Price: $149.95 4900, Northern Version 2 program disk (copyable). Includes documentation, one Digital microWAT Description: Waterloo micro- System: Apple II or Apple Author: D.M. Whittaker diskette. FORTRAN is a special dialect II Plus (also Z-80 Author: Arnold Hooton, Available: designed for teaching pur­ CP/M, NorthStar Published by Rainbow Cybertech poses. It has many of the Advantage, and Computing, Inc. 1500 W. Shaw, Suite 404 characteristics and much of NorthStar DOS Fresno, CA 93711 Available: the flavour of normal FOR­ Memory: 48K (209) 222-9094 RCI Marketing TRAN, but varies significantly Language:- Machine Language 19517 Business Center Dr. from established standards for and FORTH-79 Northridge, CA 91324 that language. This language Hardware: 1-14 disk drives Name: How to Operate (213) 349-0300 processor has many of the im­ (13- or 16-sector- the Apple II Plus portant characteristics of the compatible) System: Apple II Plus WATFIV-S compiler which is Description: FORTH- 79 (Ver. Name: The UCSD Hardware: One disk drive, 2) is a structured language p-System™ widely used on IBM com­ standard audio puters, plus some features suited for systems and applica­ System: The UCSD cassette player from the new FORTRAN-77 tions programming where ex­ p-System Description: An audio cassette definition. Examples of lan­ ecution speed is important. It Memory: 48Kb runtime mini-course for the first-time meets all provisions of the environment; guage features supported are computer user. Three audio FORTH-79. Standard and pro­ 64Kb development FORMAT, subroutines and cassettes and Apple's own grams are portable, faster than environment. functions, multi-dimensional DOS 3.3 System Master disk­ arrays, extended character- BASIC, and provide an interac­ Language: Written in UCSD ette are used to teach the string manipulation, struc­ tive environment. Its high­ Pascal and essentials of computer opera­ tured programming control, speed compiled code is well Assembly tion: how to run programs, and file input/output. In addi­ suited for real-time applica­ Support: UCSD enter data, save and organize tion, the interpreter provides a tions. Includes screen editor, Pascal, files, make backup copies, macro-assembler, strings, FORTRAN-77, powerful interactive debugging modify programs, and much facility. 32-bit integer arithmetic. BASIC, and more. No programming or Floating point and hi-res Tur­ Assembly Available: technical knowledge assumed. tle Graphics are also available. Hardware: 8086, Z80, 8080, Waterloo Computing Price: $49.95 8085, 6502, 9900, Systems Limited Price: $99.95 - BASIC $139.95 - hi-res and floating Includes three spoken-voice LSH1/PDP-11, 158 University Ave. West point cassettes with 28-page and 68000 Waterloo, Ontario Includes software and Operator's Guide in a vinyl Description: The UCSD p-Sys­ Canada N2L 3E9 200-page manual (including binder. tem is a stand-alone operating FORTH-79 and fig-FORTH] Author: Howard Manthei and system for most microcom­ Lee McFadden puters based on the 8086, Name: Storm Author: Martin Tracy and Available: 8080, Z80, 6502, 6809, 9900, System: Radio Shack Color Philip Wasson Fliptrack Training Tapes 68000, and LSI-ll/PDP-11 Computer Available: A Division of Mosaic Media microprocessors. The UCSD Memory: 16K MicroMotion P.O. Box 711 p-System includes an operating Language: Assembly Language 12077 Wilshire Blvd. Glen Ellyn, IL 60137 system, file handler, screen- Hardware: Joysticks Los Angeles, CA 90025 [312) 790-1117 oriented editor, line-oriented Description: Storm brings the (213) 821-4340 (continued)

No. 52 - September 1982 MICRO - The 6502/6809 Journal 111 $1200 desk-top calculator now Name: Universal Mailing Software Catalog (continued) standard in the investment List industry. System: Any Commodore Price: $149.95 6502 or 64 Name: BASIC Name: Cash+ Plus Memory: 3.5 (Vic 20) — Author: Donald Brown Compiler™ System: Apple II Plus with 96K on the CBM System: The UCSD DOS 3.3 Available: Language: BASIC p-System Memory: 48K CE Software Hardware: Disk drive or tape Memory: 48Kb runtime Language: Applesoft BASIC 801 73rd Street drive environment; Description: Point-of-sale pro­ Des Moines, IA 50312 Description: The program 64Kb development gram with inventory controller allows you to change, view and environment and management reporter. Can Name: TRA/C1 update addresses. It allows you Language: BASIC also be used with optional cash System: OSI Superboard II, to print one or all addresses Hardware: 8086, Z80, 8080, drawer. CIP onto mailing labels. It will 8085, 6502, 9900, Price: $395.00 Memory: 4K or more build a list and save it onto a 6809, 68000, LSI- Includes programs and Language: BASIC and 6502 cassette tape for recall. The 11/PDP-11 manual. ASM program is designed for the Description: The BASIC Com ­ Author: Lynn Graybiel Hardware: Cassette tape VIC 20, but it runs on the piler is a powerful and flexible 4016, 4032 and the 8032. Available: Description: TRA/C1 single BASIC offering you: expanded steps and traces machine-code Capacity ranges from 21 ad­ syntax, including IF THEN Southeast Computer dresses on 3.5k to 359 ad­ Concepts Corp. programs and displays all ELSE construct; INCLUDE registers, processor status, dresses on 32k. files; and virtual arrays. The 500 E. Spanish River Blvd. Boca Raton, FL 33431 stack pointer, program Price: $29.95 BASIC Compiler is fully in­ counter, instruction and oper­ Includes 3 ring binder, tegrated and compatible with and. Does not disturb any users' manual and a cassette UCSD Pascal™ and registers or the stack. This pro­ page that holds six cassettes Name: Bond Yielder FORTRAN-77. gram is an essential aid to OSI for the program and data System: Apple II Plus Price: $225.00 machine-code or asssembly- ^iles. Memory: 48K Includes object code for the code writers. Language: Applesoft Author: S. Mark Vanderbilt BASIC Compiler and BASIC Hardware: Disk drive, Price: $17.95 Available: Reference Manual. optional printer Includes casette tape and Computer Bam Available: Description: Bond Yielder per­ instructions. Old Town Salinas SofTech Microsystems, Inc. forms fast and accurate calcu­ Available: 319 Main Street #2 9494 Black Mountain Rd. lations on the profitability of D. Wolf, Ph.D. Salinas, CA 93901 San Diego, CA 92126 fixed income investments. Box 565 (408) 757-0788 (714) 578-6105 This package can replace the Port Hueneme, CA 93041 (Continued)

Feciaion S Decision Systems CSE means OSI P.O. Box 13006 Custom After Market Software y s t e m a Denton, t x 76203 for C1P and C4P machines SOFTWARE FOR THE APPLE II* ISAM -OS rs an integrated set of Applesoft routines that gives indexed file capabilities to your BASIC programs. Retrieve by key, partial key or sequentially. Space from deleted records rs automatically reused. Capabilities and performance tha; match 'Basic Enhancer: products costing twice as much. Renumber, Auto Sequencer, Screen Control func­ $60 Disk, Applesoft.

tions, and tape 1/0 system that is faster and has file PBASIC-DS rs a sophisticated preprocessor for structured BASIC. Use advanced nam es logic constructs such as IF. ..ELS£..., CASE, SELECT, and many more. Develop C 1 P ...... $21.95 programs for Integer or Applesoft. Enjoy the power of structured logic at a fraction of the cost of PASCAL. C 4 P ...... $29.95 $36. Disk, Applesoft (48K, ROM or Language Card)

O S A -D S is a dis-assembier for 6502 code. Now you can easily dis-assemble any Modified Monitor Rom Chip: machine language program for the Apple and use the dis-assembled code directly as Now get indirect jump-capabilities just like those input to your assembler. Dis-assembles instructions and data. Produces code com­ in the C1P and for no extra charge CSE will burn in patible with the S-C Assembler (version 4 Ol, Apple's Toolkit assembler and others $25 Disk, Applesoft (32K, ROM or Language Card) your machines serial num ber ...... $16.95 FORM-OS is a complete system for the definition of input and Output froms. FORM •NOTE: The C4P version of the Basic Enhancer in­ OS supplies the automatic checking of numeric inout for acceptable range of values, automatic formatting of numeric output, and many more features cludes the modified monitor Rom chip required for $25 Disk. Applesoft (32K, ROM or Language Card) proper program functioning. UTIL-DS is a set of routines for use with Applesoft to format numeric output, selec lively clear variables (Applesoft's CLEAR gets everything), improve error handling, This is only a partial listing of our products. Writs us and interface machine language with Applesoft programs. Incluoes a special load for information on new disk programs or send $2 for routine for placing machine language routines underneath Applesoft programs. catalog. Please include $2.00 shipping and handling $25 Disk, Applesoft with orders. SPEEO-OS is a routine to modify the statement linkage m an Applesoft program to speed its execution improvements of 5-20% are common. As a bonus. SPEEO-OS includes machine language routines to speed string handling and reduce the need fo* Computer garbage clean-up. Author Lee Meador. Science $16 Disk, Applesoft (32K. ROM or Language Card)

Engineering (A dd $4.00 fo r Foreign M ail) Box 50 • 291 Huntington Ave. Boston 02115 ’ Apple II is a registered trademark of the Apple Computer Co

112 MICRO - The 6502/6809 Journal No. 52 - September 1982 Software Catalog (continued)

Name: Softerm or die of thirst. Random place­ TIRED OF TYPING? System: Apple II or Apple ment of key objects makes this II Plus a new adventure each time MICRO has the solution. Memory: 48K, Autostart played. Order a diskette of three recent utility pro­ ROM Price: $9.95 Language: Assembly - 6502 Includes cassette tape, grams for the Apple. For only $10.00, plus Hardware: Serial instructions. $2.00 shipping and handling, you will receive a communications, Author: Dennis McCormack DOS 3.3 diskette containing the source and optional 80-column video, Available: assembled listings of: optional printer The Byte House Box 981 Description: High-speed CRT Applesoft Variable Dump by Philippe Francois emulator up to 9600 baud for Salem, NH 03079 following terminals: IBM 3101 (MICRO; April 1982) series, DEC VT-100 and Name: Roterm VT-52, Data General D-200, Straightforward Garbage Collection for the ADDS Regent Series, Lear System: OSI Superboard n, Siegler ADM-3A and ADM-5, C IP Apple by Cornells Bongers (MICRO, August Memory: 8K Hazeltine 1400 and 1500 1982) series, TeleVideo 900 series. Language: BASIC and 6502 Also includes file transfer with Assembly data compression, keyboard Hardware: Modem COMPRESS by Barton Bauers (this issue, page 89) macros, automatic dialer with Description: Roterm turns the built-in phone book, local con­ computer into a high perfor­ Please send check, money order, or VISA or nect or remote operation using mance cipher terminal with MasterCard number. Only prepaid orders accepted. standard modems. special enhancements for con­ venient encryption and decryp­ Price: $150.00 tion of electronic mail. Roterm If you missed April or August, order one now! Includes progam diskette, emulates a classic rotor cipher Include $2.50 for each issue. configuration diskette, machine and can operate at manual. continuous data rates of 300 Send orders to: Available: baud. Roterm is also available Apple Utility Disk Softronics specially configured for 6626 Prince Edward Place Cegmon users or users of the MICRO Memphis, TN 38119 new model Superboard. P.O. Box 6502 (901) 755-5006 Available: Chelmsford, MA 01824 D. Wolf Ph.D. Box 565 Name: FLEX - OS9 Copy Port Hueneme, CA 93041 Utility Program Description: Metacopy 130 is a file-copy utility that transfers any type of OS9 file to a FLEX Name: CW Morse sequential file, or FLEX se­ System: Atari 400 or 800 Name: High-Resolution Name: Legend Slide quential files to an OS9 file. VIC-20 Computers Plotting Routine Select This utility also provides a Memory: 16K - Atari System: VIC 20 System: Apple II directory of FLEX disk while in 5K VIC (expansion Memory: 2K Memory: 48K the OS9 operating system. The memory optional) Language: BASIC Language: Assembly program is menu driven for Hardware: Two transistor, 1 Hardware: 1515 printer, tape Hardware: Legend 64K or ease of use. IC interface player 128KDE Card Price: $135.00 Description: CW Morse allows Description: This routine Description: Legend Slide your computer to become a turns the VIC 1515 printer into Available: Select offers a way to control Morse terminal for an amateur a plotter with the highest Meta Lab the display of hi-res pictures. radio station. It is capable of possible resolution (72 P.O. Box 1559 The program permits the Ap­ sending and receiving Morse dots/inch horizontally and Suite 106 ple II to act as a slide projector, code at speeds of up to 25 vertically). Will plot the 2888 Bluff St. and allows the user to flip for­ wpm. Includes multiple 255 results of user-supplied pro­ Boulder, CO 80301 ward or backward. Control of character message buffers, grams, functions, or data log­ (303) 499-4236 the displayed pictures is user- special function keys, type- ging routines. Size of the plot selectable and can be controlled ahead keyboard buffer, and and automatic scaling with from the keyboard, game pad­ automatic speed control on number labels and tic marks Name: Mojave Desert dles, or set to run automatically. receive. Package includes doc­ are continuously user- Adventure Price: Free with card umentation, interface sche­ adjustable. Length of the plot System: VIC-20 ($349 retail) matic, and I/O connector. Memory: 3.5K may be infinite, allowing strip Includes program and Send SASE and type of com­ chart recording. Language: BASIC manual. puter for more information on Hardware: Cassette, joystick Price: $10.00 Available: this and other software (optional) Includes cassette and Legend Industries available. Description: Explore the Mo­ instructions 2220 Scott Lake Road jave Desert in search for gold. Price: $19.95 Author: Tim Bowker Pontiac, MI 48054 Includes cassette. You find gold but trouble finds Available: (313) 674-0953 you. Crunched and randomized Available: Scientific Software programming makes this treas­ Kinetic Designs 525 Lohnes Dr. ure hunt last hours. Game is 401 Monument Rd. #171 Fairborn, OH 45324 over when you find all the gold Jacksonville, FL 32211 (continued)

No. 52 - September 1982 MICRO - The 6502/6809 Journal 113 Language: Business BASIC Available: Software Catalog (continued) Hardware: 132-column Datamost, Inc. printer and either 9748 Cozycroft Avenue second diskette Chatsworth, CA 91311 drive or hard (213) 709-1202 Name: Access Name: Strobe Business drive. or your local computer store System: Apple II Plus Graphics Description: is an Memory: 48K System: Apple DOS 3.3 GL-PLUS extremely flexible and easy to Language: Applesoft, CBM DOS Machine Code Language: BASIC operate general ledger with Name: Hockey Description: A ccess is a Hardware: Apple II, Apple HI, built in receivables and System: Atari 400/800 payables. Reports include general-purpose database or CBM/PET with Memory: 16K RAM manager. Special features in­ Strobe 100 Plotter general ledger, month's jour­ Language: Assembler clude: word processor-style Description: Stiobe Business nal, balance sheet, income (Machine) editor (delete/insert charac­ Graphics provides excellent statem ent, aged receivables Hardware: Two, three, or ters, etc.); free format screen high-resolution (.002") graph­ and payables, receivable and four joysticks, design; supports most 40- or ics for business and scientific payable detail, and more! cassette recorder 80-column upper- and lower­ applications. Cost of plotter, Price: $495.00 or disk drive case hardware modifications; interface, and software is ap­ Includes operator's manual, Description: H ockey is a high­ record retrieval time by index proximately $1000. programs, and sample speed video action game for company data. two, three, or four players. It is less than three seconds and Price: $145.00 played on an enclosed rink, using any search parameters for software only Author: Dan Sargent with scoreboard including less than 23 seconds; up to Includes line, bar, and pie Available: clock overhead. Game players 1521 characters per record; up chart routines (menu driven) Great Divide Software use joysticks to control the ac­ to 39 fields per record; up to 39 and alphanumerics. 8060 W. Woodard Dr. characters per field; up to 20 tion. Offensive players skate Available: Lakewood, CO 80227 calculated fields per record; with the puck, pass, and shoot. Strobe, Inc. short forms option, and much, Defensive players steal the 897 Independence Ave. much more. puck and intercept passes. Bldg. 5A Goalies block shots. H ockey Price: $320.00 Name: Astioids Mountain View, CA 94043 includes "smart" players who Includes manual, two disks. System: VIC 20 or TRS-80 perform automatically. Author: Nik Spicer and Color Computer Mike Slaughter Memory: 5K (VIC), 4K Price: $29.95 Available: Available: Name: Specsystem (TRS-80) Gamma Software Spider Software Ltd. System: Apple II & Apple Language: BASIC Hardware: Cassette P.O. Box 25625 98 Avondale Road II Plus Los Angeles, CA 90025 South Croydon Memory: 48K Description: This program is (213) 473-7441 Surrey, England Language: Integer BASIC or an arcade-style "dodge-the- Tel. 01-680 0267 Applesoft BASIC asteroids" game for children 7-13 years old. Hardware: Specsystem disk Price: $6.65 - U.S. for use in Name: Adventure to $7.90 - Canada conjunction with Atlantis Name: SBCS AGRI­ Includes program on tape, the Eventide System: Apple II LEDGER shipping. A1B232 real-time Memory: 48K System: Apple II or Apple audio spectrum Author: Peter and Mike Language: Machine Code II + , DOS 3.3 analyzer fames, Colin Helsby Hardware: One disk drive Description: Specsystem is tor Memory: 48K Available: Description: This game com­ Language: Applesoft use with the Eventide A1B232 MFJ Electro-Enterprises bines the best features of Hardware: 2 disk drives, 80 RTA and allows you to perform P.O. Box 13076 adventure games, arcade column printer 3-dimensional spectral Kanata, Ont. games, and fantasy role- Description: Organize farm analysis and analyze reverb K2K 1X3 playing games. Adventure to financial records with the decay (RT-60). In addition, the (613) 592-2962 (Canada) Atlantis is a sequel to Odyssey: SBCS Agri-Ledger! It is Menu new hi-res 31-band real-time The Complete Adventure. The driven, a user oriented pro­ analysis display yields far straggle between the forces of greater resolution and more gram with clear, easy to follow magic (The High One) versus dynamic range options than documentation. Numerous Name: Snack Attack the forces of science (The reports, budgeting, large flexi­ previously available. Variable System: Apple II Plus Atlanteans) continues. The ble chart of accounts, yearly period averaging and range Memory: 48K game uses four methods to history, enterprise analysis, switching are available along Language: Apple Machine grab the player's attention: current market valuation can with other new functions. Language high-resolution color graphics be done. Warranty, free pro­ Price: $199.00 Hardware: Disk Drive and animation, sound effects gram updates, and friendly Includes Specsystem disk Description: An a-mazing to enhance the action, random customer service are provided. and complete instruction three-maze game that's more events at all stages of the Price: $395.00 manual. habit forming than eating adventure, and embedded Includes program disk, Author: Eventide peanuts. Anyone who can play arcade-like action. program backup, data disk just one game deserves a medal Available: Price: $40.00 and documentation. Demo for super self-control. You feel Includes one floppy disk. Eventide, Inc. a Snack Attack coming on — available for $30. 265 West 54 Street your only hope is to gobble up Author: Robert C. Clardy Author: David McFarling New York, NY 10019 as many gumdrops as you can Available: Available: (212) 581-9290 grab away from the greedy Synergistic Software Small Business Computer Gumdrop Guards! Our best 830 N. Riverside Drive Systems seller for months; one try and Suite 201 4140 Greenwood you're hooked. Happy Snacking! Renton, WA 98055 Lincoln, NE 68504 Name: GL-PLUS Price: $29.95 (402) 467-1878 System: Apple III Memory: 128K Author: Dan Illowsky (Continued)

MICRO - The 6502/6809 Journal No. 52 - September 1982 Software Catalog (continued)

Name: Nightmare Gallery Name: Starship System: Apple II Chameleon Memory: 48K System: TRS-80 Color Language: Machine code Computer P.O. Box 2025 • Corona, CA • 91720 Hardware: Disk Drive Memory: 16K (paddles/joystick Language: Assembly optional) Hardware: Cassette or disk Computer Stop 16K disabled. The Keyboard Description: This new fast-ac­ Description: In this graphics Ram Board + Plus lets you use the shift- tion game for the Apple Com­ arcade game, you are the Star­ $79.95 key as a typewriter shift-key, puter combines sound effects ship Chameleon, a special in- allowing you to enter directly and high-speed arcade action tergalaxian vessel with the This high quality 16K Ram the 128 ASCII character set into one challenging computer assignment of protecting the board acts like a Language from the APPLE keyboard. game. Players of Nightmare planet below from the aerial Card when plugged into slot The Keyboard +Plus may be Gallery are trapped in a spooky attack of enemy invaders. You 0 of your APPLE II. Com pat­ installed on any APPLE II. graveyard with only a revolver have the unique capability to ible with Basic, DOS 3.3, to protect themselves against Computer Stop change color at the push of a CP/M, PASCAL, LISA 2.5, werewolves, ghouls, ghosts, button in order to destroy the and VISICALC. With this card Omnivision vampire bats, and mummies. on-coming super bombs and you get high quality, low $129.95 Firing a stream of silver anti-matter bombs that have price, compatibility, and a 1 bullets, players dodge around been launched by the enemy Looking for an 80-column Year Manufacturer Warranty the graveyard. Points are Gabolatoks above. But watch card? Look no further! Now all for $79.95. awarded for hitting the super­ out for the semi-intelligent all your Basic, CP/M, and natural terrors. A scoreboard is aerial bombs! They home in on Pascal programs can take built into the game. your every move, seeking to LAZER Lower Case advantage of a full 80- column display. Price: $34.95 destroy you! Staiship Chame­ +P lus III Includes one floppy disk. leon has nine levels. $34.95 Author: Ron Aldrich Price: $24.95 - cassette Wizard-BPO $29.95 - disk (Buffered Printer Interface) Available: The best lowercase adapt­ Synergistic Software Includes cassette or disk and er available for the APPLE II. $139.95 830 N. Riverside Drive, instructions. This feature packed board Suite 201 Author: Kenneth Kalish has twice the features of This outstanding parallel competing boards. The interface card comes with Renton, Washington 98055 Available: Computerware Lazer Lower Case + P lu s III 16KofRam installed, ex­ is the only lower case adapt­ pandable to 32K This card P.O. Box 668 er that works with VISICALC also has Graftrax-like fea­ 4403 Manchester Ave. Name: Choplifter and is recommended by tures. So now you no longer Encinitas, CA 92024 System: Apple II Stoneware for DB MASTER. need to wait to use your (714) 436-3512 Apple II Plus The Lower Case Plus III is APPLE II while your printer is Memory: 48K expandable to 4 character busy. Com patible with Basic, Language: Assembly Name. MIMIC Speech sets (2 on board), has inverse CP/M, Pascal. Hardware: Joystick with two Processors lower case, includes ASCII buttons System: Apple II Plus and Graphics, and is com pat­ Microtek Parallel Description: With a mission to Description: Low-cost speech ible with most word proces­ Printer Interface rescue hostages from behind I/O. Based on newly patented sors. NOTE: For REV. 6 and enemy lines, Apple owners can $59.95 technique for digital recording earlier order Lower Case now take control of a heli­ and reproduction of voice +Plus at $44.95. This popular printer inter­ copter in this new arcade-style signals. game. With realistic throttle LAZER Keyboard face card, manufactured by action, players can maneuver Price: $199.00 for plug-in Microtek, is a steal at $59.95. hardware. their helicopter (in high 'j 0 Plus The printer card comes com­ resolution and simulated 3-D) $34.95 for MIMTALK $69.95 plete with a cable and a Cen­ through a sky of enemy jet software (prepares user tronics compatible con­ vocabulary). fighters and air mines. Once The Lazer Microsystems nector (Amphenol). Works you have successfully landed Available: Keyboard -f Plus has a 64 with basic, CP/M,and Pascal. your chopper, hostages will MIMIC, Inc. character type ahead buffer. This card also has graphics run toward you through a bar­ P.O. Box 921 The buffer can be cleared or capabilities. rage of tank fire and air-to- Acton, MA 01720 ORDERING INFORMATION ground missiles while you We accept: VISA/MASTERCARD (include card #, ex­ frantically try to hold off the Name: Audex enemy. Each flight back to System: Apple II (with 16K piration date, and signature), Cashier or Certified Checks, safety is especially nerve rack­ RAM Card) or Money Orders, or Personnal Checks (please allow 10 ing, as a full load of hostages Apple II Plus business days to clear). We also accept COD’s (please will perish if you go down! Memory: 48K include $2.00 COD charge). Price: $34.95 Language: Applesoft Includes software package. Hardware: Optional tape Please add 3% for shipping and handling (minimum $2.00). Foreign orders please add 10% for shipping and Author: Dan Gorlin recorder handling (minimum $ 10.00). Available: Description: Audex is a collec­ tion of utility programs that Broderbund Software California residents add 6% sales tax. All equipment is allows you to create sounds, 1938 Fourth Street subject to price change and availability without notice. All edit them, and play them back San Rafael, CA 94901 equipment is new and complete with manufacturer's war­ from your own BASIC or (415) 456-6424 ranty. or dealers and distributors assembly-language programs. (Continued) (714) 7 3 5 -2 2 5 0

No. 52 - September 1982 MICRO - The 6502/6809 Journal 115 Name: QUNIX, "C” ing), print spooling, and much Software Catalog (continued) Compiler, Fall more. Screen Editor Price: $64.70 System: Qunix Available: Price: $29.95 Fantasy effects include screen Memory: 64K MicroSoftware International, Includes instructions. graphics of gas cans exploding Language: "C " (Kemighan Incorporated Author: Pete Kosel in color, the sound of fire and Ritchie full 3300 S. Madelyn crackling, and the tic-toc of implementation) Available: Sioux Falls, SD 57106 time running out. Hardware: 6809 or Sirius Software 1-800-843-9838 10364 Rockingham Drive Price: $24.95 8088-based Sacramento, CA 95827 Author: Silas S. Warner microcomputers (916) 366-1195 Available: Description: The Qunix oper­ Direct from Muse and ating system is a UNIX™-like computer stores nationwide operating system optimized for micros. Single-user, single- Name: Jinsam Executive Name: Hi-Res Ultra tasking or multi-user, multi­ Memory: 64K Plotter Package tasking versions are available Language: Machine MP-10 Name: SpeedCOBOL and together with a full “C" com­ Hardware: CBM w/8050, System: Any PET/CBM ReadCOBOL piler [supports 8087 on IBM IBM-PC Series 2001, 3000, Memory: 64K PC) and ultra fast macro full­ Description: This fast, power­ 4000, 8000 Language: COBOL (ANSI 74) screen editor. ful, flexible data-management Computer Hardware: Any micro, mini, Price: $625 system contains file handling, (specify) or mainframe Includes assemblers, retrieval, modeling, statistical Memory: 16K minimum Description: SpeedCOBOL is debuggers, manuals. analysis, reports and labels, Language: BASIC Original, an abbreviation expander for Available: password entry, multi-user Upgrade, or 4.0 COBOL-reserved words and Quantum Software Systems command files, merge, link, Hardware: Any Commodore phrases, data names, condition Incorporated and join bases. It holds 65,000 graphics printer names, file names, and any 7219 Shea Court records, u n lim ited fields, w/ programmable other string of one to 30 San Jose, CA 95139 unlimited record lengths. line spacing characters. A direct 50% of Retrieves by scanning record, Description: This is a beautiful coding and keying productivity number, or key. plotting package that takes ad­ improvements can be realized Price: $40 - User's Manual vantage of the screen graphics and measured with Speed­ $1295 entire unit and printer's ultra-high resolu­ COBOL. Working with abbre­ Entire unit includes tion graphics. Equations must viations of one or two charac­ Name: Audio Spectrum interfaces, wordprocessing, be entered in BASIC. Domain ters for COBOL words and Analyzer VisiCalc, statistics, ROM, and/or range may be re­ phrases, SpeedCOBOL pre­ System: TRS-80 Color disks, pen, binder, and stricted, magnified, and man­ compiles these abbreviations Computer manual. ipulated. Printer graphing may to their full length. Read­ Description: This program pro­ Author: Jim and Nancy Iscaro be very small to full page and COBOL addresses the seem­ vides a colorful and graphic Available: longer having a resolution of ingly ever-present program­ display of energy in sound. 420 by an infinite number of ming resource drain of COBOL Jini Micro-Systems Inc. Audio enthusiasts can "watch Box 274 dots lengthwise. Multiple program maintenance by es­ the m usic/' color bargraphs equations can also be plotted. tablishing program structure Kingsbridge Station show the relative power dis­ Riverdale, NY 10463 Excellent for lab or school. standards. These standards are tribution over a nine-octave Price: $12.95 cassette maintained by ReadCOBOL audio range. A built-in "audio $16.95 on 4040/2031 disk automatically, not by the pro­ kaleidoscope" mode presents Includes full instructions grammer. Paragraph sequenc­ random changing visual im­ and step-by-step guiding ing, standard structuring and ages, keyed to the tonal stylizing are an automatic and through program. distribution and intensity Name: Classified™ direct result of ReadCOBOL. Author: Louis F. Roehrs ("color," in musical terms) of System: Apple n, Apple n An optional step of renaming the input signal. Plus Available: data names, file names, etc. is TELE-TREX Software available for improved pro­ Price: $19.95 Memory: 48K Systems gram quality. Inspecting the Includes Program Pak, Language: Machine instruction manual. Hardware: One disk drive 4 Waring Lane results of ReadCOBOL makes minimum Littleton, CO 80121 the improvement in quality Available: Description: Classified™ en­ obvious. Paragraph sequenc­ Radio Shack, Computer crypts and decrypts the infor­ ing, installation-wide standard Centers and participating mation stored in any standard programming structure and dealers DOS 3.3 diskette file, such as a Name: Firebug common stylizing of source file created by VisiCalc. The System: Apple statements are all direct data sectors are overwritten by Memory: 48K benefits to the user. Language: Applesoft ROM cipher text, leaving no trace of Price: $500 for Hardware: D isk drive (dual plain text. microcomputers DOS 3.2/3.3) Name: Computer Price: $39.50 $5000 for mainframes Description: Guide your me­ Business Software Includes 24-page encryption Includes documentation and chanical Firebug through a System: Ohio Scientific manual. diskette. five-level maze using your Ap­ Language: BASIC Available: Author: Foundation for ple keyboard or joystick, to the Description: This complete Passage Research Software Engineering exit on Level 1. Your Firebug business package features 945 Turquoise St. must race against time and fire Available: order entry, inventory control, Suite G to escape. A fuse is burning Computers Et Cetera mailing labels, sales reports/ San Diego, CA 92109 behind your Firebug, so your 524 W. Broadway #111 history graphs, monthly cash (714) 488-5358 time is short! Add points for Tempe, AZ 85282 reports, G/L distribution destroying the maze as you (602) 829-0888 report, multi-state, multi-pay guide the Firebug through it. period payroll [with file lock­ /AlCftO

116 MICRO - The 6502/6809 Journal No. 52 - September 1982 TM

Hardware Catalog

Name: Dual-Comm Plus each drive, a power ON in­ Images are created and pre­ Name: I/OX-122 System: Apple II or Apple dicator, and audible error viewed with the system. Once I/O Expansion II Plus beeper. The ease of write pro­ the desired image is created Board Language: Apple Pascal, tecting drives by switch versus the computer transfers it to System: 6500 BASIC diskette labels encourages 35mm color film. The film is Description: I/O expansion for Description: This two-port good operating procedure to then removed from the film re­ the SYM-1, AIM-1, and other serial I/O card combines the prevent accidentally erasing cording device and processed. microcomputers that use 6522 features of the Apple High files. All switches and in­ The system produces business VXAs for I/O and do not pro­ Speed Serial Card and the Ap­ dicators are mounted in a informational slides and ar­ vide full address decoding on­ ple Communications Card in small control box that may be tistic slides. Five type styles board. This board has physical one card with handshaking. placed on the disk unit or near are currently available in two space for four additional 6522 Thumbwheel switches select the computer. Installation is sizes. The color on the slides is VLAs, and provides additional the Apple slot locations. accomplished without special very rich. decoding for a total of 16 Selectable baud rates range tools or skills or any soldering. Price: $3495.00 (without devices at intervals of your from 50 to 19200 baud. On­ Price: $70 - $80 Apple components) choice. Connectors for all I/O board firmware provides exten­ Includes assembled unit plus Includes film recording lines, and further expansion sive printer and upper/lower installation/user device, software, graphics are included. All 6522 func­ case terminal modem support. instructions. tablet overlay, interface tions are available, with no in­ terference with previous func­ Combined with an 80-column Available: card, and manual. card, such as the FULL-VIEW tions of the original VIA. Two Optimized Data Systems Available: versions of this board are 80, it turns an Apple into a P.O. Box 595 Toucan Visual Production available. The I/OX-122 full-operation terminal for a Placentia, CA 92670 Systems mounts above, and directly computer network system. 1033 Battery Street plugs into, an on-board 6522 Price: $239.00 San Francisco, CA 94111 socket, and relocates the Includes all available (415) 392-2970 original VIA to the expansion features. Name: Olympia ESW 102 board. Where there are space Available: Memory: 4K Bytes limitations, the I/OX-222 uses BIT 3 Computer Corporation Description: This is a high- a dip header and cable for 8120 Penn Ave. S. quality, cost-effective printer remote installation. Suite 548 developed for the letter quality Name: Model 85 Digital Minneapolis, MN 55431 printer market. Standard let­ Price: $49.95 Memory (612) 881-6955 tering with varying type styles, OEM and dealer inquiries Oscilloscope proportional spacing, four welcome. System: Compatible with pitches, bi-directional print­ Includes expansion board Apple II or Apple ing, and print wheel cassette and one 6522. II Plus Name: Model 122 insertion. Print speed is 17.5 Available: Memory: 11.5K Bytes Industrial Trade characters per second. Laser- Alternative Energy Products Language: BASIC or Graphics Printer sharp print quality, a choice of P.O. Box 1019 assembly language System: All computers ribbon systems and economi­ Whittier, CA 90609 Description: Laboratory and Description: Heavy-duty 120 cal pricing for end users and automated measurements were CPS desktop graphics printer. OEMs. never easier with this com­ Name: ISAAC 132 columns with pin-address- Price: $1590.00 able graphics. Designed to pletely programmable digital System: Apple Includes interface. memory oscilloscope con­ fulfill applications such as Memory: 48K Available: business analysis, computer- trolled by a co-resident BASIC Language: Labsoft (Extended Olympia USA Inc. aided designs, data processing, program. Two channels with Applesoft BASIC | Box 22 and timesharing computer 50 MHz bandwidth combined Hardware: Disk drive, Somerville, NJ 08876 processing. with full 8-bit A/D conversion monitor, printer provide high accuracy, high Description: ISAAC provides a Price: $1195 list price frequency measurements. Un­ hardware interface and Labsoft Includes all standard Name: Model T limited storage time, wave­ language to allow the Apple II features. Computer Slide form storage on disk, wave­ Plus to interface with real Available: System form averaging, cursor DVM, world signals. Used for labora­ Centronics Data Computer System: Apple II Plus hard copy output, compare to tory automation, electronic Corporation Memory: 48K reference waveforms, and tests, or process control. 1 Wall St. Language: BASIC more. Price: $3950.00 Hudson, NH 03051 Hardware: Two disk drives, Price: $995.00 as addition to current Apple. graphics tablet, Includes Model 85, user's $6000-$9000 for total system and color monitor manual, software on one with Apple and various Name: Disk-O-Mate Description: Product allows 5 Vt" floppy disk. peripherals. System: Commodore user to produce 35mm color Available: Available: PET/CBM slides. Sold as add-on to ex­ Northwest Instrument Cyborg Corporation Hardware: 2040/4040 disk isting Apple II Plus with two Systems, Inc. 55 Chapel Street drive disk drives, graphics tablet, P.O. Box 1309 Newton, MA 02158 Description: Disk-O-Mate pro­ and monitor. Product consists Beaverton, OR 97075 vides the user with write- of a film recording device, soft­ (800) 547-4445 protect switches/indicators for ware, and overlay for tablet. (Continued)

No. 52 - September 1982 MICRO - The 6502/6809 Journal 117 Hardware: JBE Parallel operating power is from the Hardware Catalog (continued) Interface Card and telephone line. It is FCC cer­ EPROM tified for direct connection to Name: AMDEK 13-inch have from 2K to 8K of EPROM Programmer the public-switched telephone "Color ID” on the card and a real time Description: Slim is a 4.5 x network and compatible with Monitor clock is supported. An expan­ 6.5 single-board large-scale in­ the high-speed channel of the System: Apple II, Apple HI sion interface port is available tegration microcomputer using Bell 212A Hardware: Monitors, plotter, for added extra memory for a 6502 microprocessor, two Price: $495.00 disk drive future versions of CP/M and to 6522 VTAs, four 2114 RAMs, Includes operating manual, Description: The AMDEK support other Z80 peripherals. and 2516, 2716, or 2532 phone connect cable, and 13-inch color monitor provides The 6502 and the Z80A or EPROM. The fully-buffered warranty. affordable high-plus resolution Z80B processors are able to run 22/44-pin bus is similar to the Available: graphics. It is designed with simultaneously and at full KIM, SYM, and AIM expan­ Universal Data Systems RGB video input and a com­ speed. The A ppli-C ard is sion connector. Four 8-bit I/O 5000 Bradford Drive mercial grade CRT; sharp and designed to support CP/M ap­ ports connect through 16-pin Huntsville, AL 35805 crisp color separation, 260 (H) plications with only one card. DIP sockets. x 300 (V) line resolution; The unique SoftVideo™ Price: $199.95 features include upper and 80- x 24-character display Available: capability. lower case, 40-column to John Bell Engineering Name: PromQueen VIC Price: $569.00 255-column horizontal scroll­ 1014 Center Street ing, and also 70 columns by 24 Cartridge Available: San Carlos, CA 94070 lines is available using the System: Commodore AMDEK Corporation high-resolution graphics on VIC-20 2201 Lively Blvd. the Apple II. Memory: 4K up Elk Grove Village, IL 60007 Hardware: Requires Price: $595.00 (312) 364-1180 Name: Apple Interface expansion chassis Includes Appli-Caid, CP/M, TLX: 25-4786 Breadboard if used with other and WordStar. System: Apple II expansions. Available: Memory: 16K Read/write, Language: 6502 machine Name: UP-9705 5 V*" Personal Computer minimum code, BASIC, Winchester Disk Products, Inc. configuration other uP machine Subsystem 16776 Bernardo Center Dr. Language: BASIC or codes System: Compatible with Suite 203 assembly Description: A self contained many systems San Diego, CA 92128 Description: The Apple Inter­ cartridge mating to the VIC's including Apple, face Breadboard provides con­ expansion port equips the IBM PC, Q-bus, trolled access to those signals VIC-20 for 8-bit micro­ S100, and needed to control external processor system develop­ multibus systems. devices. User can design and ment. The cartridge contains Description: This is a Name: Ultimate RS- operate custom interfaces 4K's of RAM accessible both to 5-megabyte universal SVt" 4/OV-l Computer using BASIC. Data bus is fully the VIC and to an external Winchester mass-storage sub­ System: Dedicated buffered and protected. Up to microprocessor system under system that features inter­ Memory: 64K — 48K ROM, eight decoded outputs avail­ development. DIP switch sets changeable host adaptor per­ 16K RAM able; up to 256 I/O devices to any of 4 expansion blocks of sonality cards. The unit Language: Machine may be addressed. A probe cir­ the VIC. measures 4.75 x 6.5 x 14.2 Hardware: TeleVideo 912-C cuit detects logic signals and Terminal w/built- Price: $169.50 inches and weighs 16 lbs. pulse edges. All interface Includes 24 pin textool in board (64K) by Price: $2,995 for one signals available through socket and built-in 2716, Cannella Corp. Includes one host adaptor solderless breadboard for per­ 2732 and 2732A EPROM Description: The Ultimate and documentation. forming experiments using programmer with power computer is designed to handi­ hookup wire. supply. Development and Available: cap horse racing — makes a pro Price: $235.00 — Kit EPROM utility software on United Peripherals out of even an amateur. The (BG-125KJ 2732A EPROM, 32 page 432 Lakeside Drive Ultimate computes and rates $310.00 — Assembled manual. Sunnyvale, CA 94086 according to the principle of (BG-125A) (408) 730-4440 established class, assigns each Available: for 110V operation. TWX: 910-339-9359 horse a specific rating, handi­ Gloucester Computer Bus Includes power supply, all caps, summarizes data for up Co., Inc. parts, BG-110 Cablecard, to 25 horses per race, and 6 Brooks Road and text Apple Interfacing Name: Appli-Card displays them in order of bet­ Gloucester, MA 01930 w/Exp. Required but not System: Apple II ting qualification. (617) 283-7719 Memory: 64K on-board included — interconnect memory Price: $6,000 cable (BG-Cable ($14.95). $5,000 for the computer Hardware: Z80 Available: $1,000 for Epson MX-80 Name: MPC Bubble Microprocessor Group Technology, Ltd. Printer Memory Board Description: The A p p li- P.O. Box 87 System: Apple II, Apple II Available: Card™ is a single card that Check, VA 24072 Plus Cannella Corp. uses the CP/M operating sys­ (703) 651-3153 Memory: 1 Megabit Armond F. Cannella, Pres. tem and can execute Word­ Language: BASIC, Pascal, 420 E. Genesee St. Star™ and use its full features. CP/M Suite 208 The hardware contributions of Description: Bubble Memory Syracuse, NY 13202 Name: 212LP Direct the Appli-Card are 64K of on- Board has 128K bytes of non­ Connect Modem card memory for application volatile memory. It comes System: RS-232 development and execution. with software to emulate one Name: Slim 81-260 Description: The 212LP is a The Appli-Card comes stan­ floppy disk; autoboot PROM System: Apple II 1200 bps-only full duplex, dard with a 4 MHz Z80A or a 6 on board is for stand-alone Memory: 2K RAM, 4K asynchronous modem. This MHz Z80B. Also, the Z80A or pseudo disk operation. EPROM - manual answer unit requires Z80B CPUs can run at their (Continued) maximum speed. One can expandable to 32K no external AC power. All

52 - September 1982 118 MICRO - The 6502/6809 Journal No. Hardware Catalog (continued)

Price: $895.00 A peripheral that turns an IBM Includes boaid/disk Selectric* (or similar elec­ emulator software. tronic typewriter) into a fast, ^ ’ Available: letter-quality, economical Your Salvation MPC Peripherals Corp. printer. It is a sensible alter­ In The Sea O f 9424 Chesapeake Drive native to purchasing the more Inflation. San Diego, CA 92123 expansive daisy wheel printer and there are no typewriter P.O. Box 2025 • Corona, CA • 91720 modifications necessary. Name: MetaCard ’Selectric is a registered Auto-Repeat can be varied to System: Apple II or Apple trademark of IBM, Incor­ Microtek Parallel suit your needs. NOTE: Auto- II Plus porated. Repeat device will only work Memory: 48K min. Printer Interface Price: $495.00 on newer APPLE II key­ Hardware: Disk II Includes power supply and $59.95 boards. Language: CP/M-86 Supplied This popular printer inter­ connecting cable. Description: MetaCard is a face card, manufactured by Lazer Lower Case secondary processor card with: Available: Microtek, is a steal at $59.95. 5Mhz. micro­ Personal Micro Computers, The Printer card comes + Plus II processor, 64K bytes dynamic Inc. complete with cable and a $19.95 RAM expandable to 128K, ex­ 475 Ellis Street Centronics compatible con­ ternal power supply, 2716 Mt. View, CA 94043 nector (Amphenol). Works For the budget minded EPROM with power-up (415) 962-0220 with Basic, CP/M, and Pas­ user with quality in mind. This diagnostics and initialization cal. This card also has graph­ lower case adapter will work logic, real-time clock, ics capabilities. with all Rev. 7 and later AP­ CP/M-86 operating system Name: PKASOID12 PLE M’s. The Lower Case with optional MS-DOS or -Color Interface Diskettes + Plus II includes Basic and UCSD Pascal IV.0, provision System: Apple II or Apple w/Hubring 10 Pascal software. Works with for integration with future pro­ in Computers $19.95 many popular word proces­ ducts, including 8087 piggy­ Hardware: ID12 - Color sors. back board and additional Interface High quality diskettes at a 256K memory card. Description: The ID12 - color bargain price. Everyone Also Available Price: Introductory prices: Interface converts your Apple needs diskettes for backing From LAZER Computer and IDS Color 64K—$980, 128K—$1230 up other disks, saving pro­ Prism printer to a complete (U.S. and Canada) grams, etc. We buy these ANIX 1.0 $34.95, This so ft­ text and graphic output Includes power supply, 64K diskettes in bulk and then ware program is a set of in­ system. Features include: full RAM jpie-tested), CP/M-86 pass the savings onto you. credible disk utilities with a snapshot dump of any screen on Apple disks, complete Remember, they do have UNIX-like operating system. image, hi-res and lo-res screen documentation. hubring and come with a 1 LAZER Pascal $29.95 A un­ prints using accurate screen Available: year guaranty. NOTE: Please ique systems programming colors, quick commands to Metamorphic Systems, Inc. call for quanities of 100 or language for Anix 1.0 with swap and rearrange the color P.O. Box 1541 more for special pricing. many features of the 'C' pro­ set, quick commands to Boulder, CO 80306 gramming language. change printing colors even within the word processor Auto-Repeat text. Device Disk Drive Cables Name: Pi-1, Pi-2, Pi-3 Price: $195.00 - $225.00 $14.95 $24.95 Video Monitors Includes cable, instructional Description: Low-cost, high diskette and comprehensive For those who want the These cables replace the resolution monitors are manual. feature that many Main- cables that are connected to available in 9" or 12" ver­ Available: Frame Computers have, here the Apple Disk Drive already. sions. Features are: 80x24 Interactive Structures is the Auto-Repeat device. If you feel that can not put character display, resolution of 146 Montgomery Ave. This device does not take up your Disk Drives where you 1000 lines at center, band P.O. Box 404 a slot or crowd your APPLE II. want them, here’s your an­ width 20 Mhz. A front metal Bala Cynwyd, PA 19004 Auto-Repeat fits right on the swer. The Cables are 4’ long and are pre-tested for your case provides complete (215) 667-1713 newer style Apple Key­ shielding allowing stackability boards. The speed of the assurance. controls. It is compatible with ORDERING INFORMATION all small business computers. Name: Model 140-RS Price: Pi-1, $249; Pi-2, $275; Computer We accept: VISA/MASTERCARD (include card #, ex­ Pi-3, $289 retail. Interface piration date, and signature), Cashier or Certified Checks, Available: System: Accepts serial data Money Orders, or Personal Checks (please allow 10 USI International, from computer to business days to clear). We also accept COD’s (please Computer Products Division operate random include $2.00 COD charge). 71 Park Lane, access slide Brisbane, CA 94005 projector, Kodak Please add 3% for shipping and handling (minimum (515) 468-2900 or Mast $2.00). Foreign orders please add 10% for shipping and Description: This interface is handling (minimum ($10.00). designed to convert an California residents add 6% sales tax. All equipment is Name: Electric Typing asynchronous-serial data subject to price change and availability without notice. All Fingers (ETF-80J stream into signals usable by equipment is new and complete with manufacturer’s war­ Hardware: Comes with own Master Kodak random-access ranty. power supply and slide projectors. cables (Continued) (714) 7 3 5 -2 2 5 0

No. 52 - September 1982 MICRO - The 6502^6809 Journal 1 n /in and TRS-80 IH systems. Hardware Catalog (continued) assembler, debugger, and The 200 watt unit covers larger complete reference manuals. systems including 5 Vi” fixed Available: Price: $621.00 Name: Slot 8 disk drives. The desk-top unit Meta Lab Includes interface package, System: Apple II, Apple n is just 4" x 6" x 9V4"andhas P.O. Box 1559 connectings cable. Plus interna] battery for five Suite 106 Memory: 16K Available: minutes of automatic power 2888 Bluff Street Language: BASIC, Pascal, Mast Development Co. hold-up. Boulder, CO 80301 CP/M, Assembly 2212 East 12th Street Price: $395 - 90 watt (303) 499-4236 Davenport, IO 52803 (6809, 6502, etc.) $695 - 200 watt Description: Slot 8 is a Space­ Includes overvoltage Saver for the Apple II and pro­ protection and power status vides the user with an extra indicator LED, buzzer, and Name: M 78-5 TrimForm slot for peripheral use. Slot 8 interrupt signal. Printer plugs into slot 7 and provides Name: Corvus Systems Memory: Line buffer, or IK two slots on the Apple mother­ Available: Disks Cuesta Systems, Inc. data buffer board. Most peripheral cards for System: Atari 800 Language: ASCII the Apple will work in Slot 8. 3440 Roberto Court Memory: 6 Megabits San Luis Obispo, CA 93401 Description: This printer has Hardware: Winchester Disk Includes Slot 8 card and |805) 541-4160 140 characters per second, Description: The Corvus Sys­ manual of operation. tractor feed for forms up to 9.5'' tem 6 MB hard-disk drive inter­ Available: wide, 96-character set (upper/ Name: 2809 Softboatd faces with Atari 800. It has two Legend Industries, Ltd. lower), OCR-A (optional), bar System plotters and four data surfaces; 2220 Scott Lake Rd. code, vertical forms control System: 6809 SS50 Bus the diameter is 5 Vi inches. Pontiac, MI 48054 unit, quiet 56 dbA, RS-232 computers serial interface, integral form Price: $3,195 (313) 674-0954 (SWTPC, Gimix, cutting device under host con­ Includes Z80 micro­ Smoke Signal) trol, and self test. processor, controller, Name: DATASAVER™ Description: The 2809 soft- Price: $4345 managing bidirectional data board system enables 6809 transfer. AC Power Backup Includes all hardware. Unit SS50 Bus users to immediately Available: run over 2000 CP/M applica­ Available: System: Any Mannesmann Tally Corvus Systems Description: DATASAVER™ tion programs on their com­ 2029 O 'Toole Ave. puters 8301 South 180th St. provides uninterrupted AC Kent, WA 98031 San Jose, CA 95131 Price: $595.00 power to microcomputer sys­ (206) 251-5524 (408) 946-7700 tems and instruments. The 90 Includes 50 pin processor watt capacity unit is for Apple board, CP/M 2.2, editor, JUCftO

QCB-9 SINGLE BOARD COMPUTER How to run a listing in • 6809 BASED • RUNS TSC FLEX DOS $149.00 Software/Hardware ★ QCB-9/1 S-100 BUS ♦PARTIAL KIT ★ QCB-9/2 SS-50 BUS FEATURES • 5’A ” Floppy Controller The Software and Hardware Catalogs • Serial R S -232 Port • Centronics Type Printer Port are provided as a service both to our readers • Keyboard /Parallel Port and to the manufacturers. These entries • 24K Bytes of Memory • QBUG Resident Monitor are not MICRO reviews, but descriptions • 6802 Adaptor provided by the manufacturer. FULLY ASSEMBLED & TESTED $389.00 To run a free listing in either catalog, a • 48-hour Burn-in • 90 Day Warranty company fills out the appropriate form or merely mails in their material in the same NAKED-09 SS-50 6809 CPU CARD $49.95* format that appears in the magazine. * 1K OF RAM A T E 400 Assem bled & Tested $ 1 4 9 .0 0 Documentation * 6K OF EPROM AT E800-FFFF 2 MHZ Version $189.00 Only * HIGH QUALITY DOUBLE SIDED PCB * SOLDER MASKED * SILK SCREENED We try to limit entries to one company TSC, FLEX DOS, ASSEMBLER, EDITOR $150.00 per month, on a first-come-first-serve QBUG RESIDENT MONITOR $50.00 basis. * Disc Boot * Memory Test * Break Points * Memory Exam & Exchange * Zero M em ory * Jump to User Program * Memory Dump * Rll M em ory * Register Display & Change If you sell products our readers should OBUG IS A TRADEMARK OF LOGICAL DEVICES INC., 1 Copyright 1981 know about, write to Software/Hardware ______PHONE ORDERS: (305) 776-5870 ______Catalog, MICRO, P.O. Box 6502, LOGICAL DEVICES INC. Chelmsford, MA 01824. COMPUTER PRODUCTS DIVISION 781 W. OAKLAND PARK BLVD. • FT. LAUDERDALE, FL 33311 TWX: 510-955-9496 • WE ACCEPT VISA, MC, CHECKS, C.O.O., MONEY ORDER §

120 MICRO - The 6502/6809 Journal No. 52 - September 1982 READER SURVEY: SEPTEMBER 1982 WE NEED YOUR HELP! To keep MICRO in touch with the rapidly changing computer world so that we can give you the information you need, please take a minute to fill in this questionnaire and mail it back to us. THANK YOU for your time.

1. How long have you subscribed to or read MICRO? □ Less than 6 months □ 6 months to 1 year □ Over 1 year □ Over 2 years □ Over 3 years □ From the beginning 2. How did you get your current issue? □ Subscription □ Computer store □ Newsstand □ Bookstore □ Borrowed □ Library DEMOGRAPHICS 3. What is your age? □ - 1 7 □ 18-25 □ 26-35 □ 36-45 0 46-55 □ 56-65 □ 65 + 4. What is your occupation? □ Programmer/analyst □ Engineer □ Technician □ Professor/teacher □ Lawyer □ Doctor □ Business person □ Student □ O ther ______5. What is your formal educational level? □ Fewer than 12 years □ High school graduate □ Associate degree □ Bachelor’s degree □ Para-professional degree □ Advanced degree 6. What is your annual household income before taxes? □ Less than $15,000 □ $15,000-19,999 □$20,000-24,999 □$25,000-34,999 □ $35,000-44,999 □$45,000-54,999 □ $55,000 + COMPUTER INFORMATION 7. What microcomputer(s) do you use? □ AIM □ Apple II □ Apple III □ Atari (please specify model) ______□ KIM □ OSI (please specify model) ______□ CBM/PET □ SuperPET □ VIC □ SYM □ TRS-80 Color Computer □ Other 6502^ □ Other 6809______□ Other processors)______8. Where do you use the above computer(s)? □ Home □ Work □ School □ Other ______9. Approximately how much have you spent on your computer equipment so far? □ -$500 □$500-999 □$1,000-1,999 □$2,000-2,999 □$3,000-3,999 □$4,000-4,999 □$5,000-9,999 □ $10,000 + 10. Approximately how much do you expect to spend on your computer equipment in the next year? □ -$500 □$500-999 □$1,000-1,999 □$2,000-2,999 □$3,000-3,999 □$4,000-4,999 □$5,000-9,999 □ $10,000 + 11. Approximately how much have you spent on your computer software so far? □ -$ 2 0 0 □ $200-499 □ $500-999 □$1,000-1,999 □ $2,000 + 12. Approximately how much do you expect to spend on computer software in the next year? □ -$ 2 0 0 □ $200-499 □ $500-999 □$1,000-1,999 □ $2,000 + 13. What sorts of additions to your basic system have you made? □ Disk Drives □ Modem □ Serial Interface □ Parallel Interface □ RAM cards □ 6809 card □ 68000 card □ Z80 card □ Printer (type) ______□ Other______14. What additional changes or upgrades would you like to add to your system? □ Disk Drives □ Modem □ Serial Interface □ Parallel Interface □ RAM cards □ 6809 card □ 68000 card □ Z80 card □ Printer (type) ______□ Other______15. How do you use your computer equipment? □ Business □ Software Development □ Hardware Development □Telecommunications □ Entertainment □ Hobby □ Education □ Communications □ Word Processing (type) ______□ Database Management ______16. What languages do you use? □ BASIC □ Pascal □ FORTH □ COBOL □ APL □ LOGO □ LISP □ 6502 Assembler □ 6809 Assembler □ 68000 Assembler □ O ther______17. In an average week, about how many hours do you spend on a microcomputer performing the following operations? 0-2 2-4 4-8 8-10 More Programming for fun or self-education □ □ □ □ □ Programming professionally □ □ □ □ □ Using packaged programs in business □ □ □ □ □ Using packaged programs at home □ □ □ □ □ Using packaged programs for education □ □ □ □ □ Playing games □ □ □ □ □ O ther------□ □ □ □ □ 18. If you write programs, what type of programming do you spend most of your time developing? □ Business applications □ Games □ Software development utilities 19. In an average month how much time do you spend with MICRO? □ Less than 2 hours □ 2-4 hours □ 4-8 hours □ More than 8 hours 20. How would you rate your present microcomputer knowledge? Software: □ Elementary □ Intermediate □ Advanced Hardware: □ Elementary □ Intermediate □ Advanced 21. Have you ever constructed a computer or computer equipment? □ Yes □ No If yes, d e scribe______

22. Have you switched from one computer to another? □ Yes □ No If yes, explain______(Continued on reverse side) MAGAZINE 23. To what other computer publications do you subscribe? □ BYTE □ Compute! □ DDr. Dobbs □ Kilobaud Microcomputing □ Nibble □ Softside □ Softalk □ Popular Computing □ Personal Computing □ 80 Microcomputing □ 68 Micro □ Interface Age □ Transactor □ O th e r(s)______

24. Please rate the following parts of MICRO as to their interest, with 5 being very interesting and 1 not at all interesting.

5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 News □ □ □ □ □ Hardware & Software Catalogs □ □ □ □ □ Advertisements □ □ □ □ □ Articles □ □ □ □ □ System specific information □ □ □ □ □ Columns □ □ □ □ □ Reviews □ □ □ □ □ New Publications □ □ □ □ □ Editorials □ □ □ □ □

25. Please rate the following kinds of articles as to their interest, with 5 being very interesting and 1 not at all interesting. 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 Hardware tutorials □ □ □ □ □ Applications □ □ □ □ □ Review articles □ □ □ □ □ Programming techniques □ □ □ □ □ Games □ □ □ □ □ Utilities □ □ □ □ □ News & Information □ □ □ □ □

26. Is MICRO □ too technical □ not technical enough □ just right?

27. Have you written articles for publication? □ Yes □ No 28. Would you be willing to pay extra to receive MICRO'S programs inanother form? □ Yes QNo 29. If yes to #28, which form would you prefer? □ Printed □ Disk □ The Source □ MicroNet □ O th e r ______30. Overall, how do you feel about MICRO? How useful is MICRO to you?

Fold Here and Staple Closed

NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES

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

POSTAGE WILL BE PAID BY ADDRESSEE MICRO 34 Chelmsford Street P.O. Box 6502 Chelmsford, MA 01824 ON THE 6809 MICRO FOCUS WORTH SWITCHING FOR

FO CUS ... ON ITS SUPERIOR HARDWARE • 6809E Microprocessor provides 8-bit economy with 16-blt capabilities, position independent code and many advanced features THIS IS • Commercial quality Keyboard with full UPPER/lower case ASCII, numeric keypad and cursor control keys • Two double-sided double-density mini diskettes with 640K bytes of IBM-compatible storage FOCUS • 56K Bytes User RAM • Full Video with programmable screen formats, bit mapped graphics, user definable character sets, reverse video and hardware scrolling, plus a light pen interface • Full Communications support for RS-232 at 50 to 19.2K baud with programmable data formats • Built-in I/O Drivers include 6 parallel I/O ports, 3 serial I/O ports, 6 timers/counters, 20 mA current loop, and a programmable cassette interface FO CUS ... ON ITS EXTRAORDINARY SOFTWARE Choice of two ‘Universal’ 6809 Disk Operating Systems supported by many companies: FLEX ™ or OS-9™ Extended Floating Point Disk BASIC Interpreted and Compiled . Text Editor and Macro Assembler . Full feature FlexiMon debugging monitor . Built-in Word Processor FO CUS ... ON ITS VERSATILE EXPANDABILITY • IEEE-488 Bus Controller option for instrumentation . Supports multiple 8” diskette drives $ 5 4 9 5 00 • PASCAL, FORTH and other high level programming

languages are available VERy CoM plETE • Complete Application Packages are available from many software sources • Add-on Hardware includes: Date/Time, Opto-lsolators, Stepper-Motor Controller, A/D and D/A, RAM and EPROM Memory, and others from several manufacturers FO C U S ... ON YOUR

APPLICATION REQUIREMENTS 34 Chelmsford Street • FOCUS provides a completely Integrated system of Chelmsford, MA 01824 hardware and software, so that you can concentrate on Phone: 617/256-3649 your application requirements Telex: 955318 INTL DIV

'Licensing arrangement for OS-9 pending. : .•v Please contact The COMPUTERIST, tnc. for further details. D r . D o b b s J o u r n a l For Users of Small Computer Systems W

Are you ready? DDJ, the world’s foremost micro­

with topics like: computer publication, has been work­ D r Q )HBS JfXJRN.’J ing for years to prepare its readers to Small-C FORTH be innovators, to lead the wave of Lisp breakthroughs in our changing tech­ CP/M nology. S-t 00 Every issue ofDr. D obb’s Journal Cross-assemblers helps one to understand the nuts and 8086/8088 bolts of small computer systems. We 16-bit tech. Pascal offer entire listings of valuable soft­ Assembler ware: our pages have included com­ Compilers pilers,* cross-assemblers, editors, new Algorithms languages, hardware interfaces and 8080/Z80 more — usually before anyone else 6502 etc. thinks of them! Even more Each issue includes: important! As valuable and significant as all • valuable software tools those things are, there is an even grea • algorithms & problem solving er reason for you to join forces with DDJ. That is the keen, responsive • industry news readership. Our subscribers share in­ sights, correspond, and contribute t( • important product reviews one another’s work, more than any other group we know. They treat With in depth coverage of: Dr. D obb’s Journal as a “hands-on” • telecommunications publication. This warm cooperation has done • systems programming more to refine software products, am generally to advance the state of • language development microcomputer technology, than per • machine independent programs haps any other resource. And it is available to you tnrough our pages! and much, much more! For the straight

Yes! Please enter my subscription for ^ F ac ts . . . □ 1 yr. (12 issues) $25 □ 2 yrs. $47 (save $13 off newsstand) If you are a serious computing □ Please bill me □ I enclose check/money order professional or enthusiast, then you Name. should take a very close look at whal Address DDJ offers you. We’ve been on the City______State ______Zip. cutting edge since 1976.

Dr. D obb’s Journal • A Publication of People’s Computer Company, 1263 El Camino Real, P.O. Box E, Menlo Park, CA 94025 MC68000

MC68000 16-bit Microprocessor » Manufactured by Motorola. 16-bit design increases speed and Pin Assignment addressing capability. Well-suited to high-level operating systems, including UNIX, and to modular, reentrant, and relocatable D 4 C 1 * 64 Z 3 D 5 programming. D 3 C 2 63 = I D 6 D 2 C 3 62 = I D 7 Design based on PDP-11 minicomputer, includes: D1 C 4 61 = T D 8 DOC 5 60 = I D 9 32-bit data and address registers A S P 6 59 Z 3 D 1 0 16 megabyte direct addressing range UDSC 7 58 = 3 0 1 1 56 different instructions LD S [Z 8 57 Z 1 D 1 2 14 different addressing modes for most instructions R / w n 9 56 Z ID 1 3 DTA C K O 10 55 = ID 1 4 5 main data types: bit, byte, word, long word, and decimal BG C 11 54- Z 3 D 1 5 M em ory-mapped I/O B G AC K C 12 53 = 1 G N D B R E = 13 52 = J A 2 3 Programming model includes two 32-bit stack pointers, 32-bit pro­ V cc c 14 51 H IA 2 2 gram counter, 8-bit status register, eight 32-bit data registers, and C L K C 15 50 = IA 2 1 seven 32-bit address registers. The eight data registers, seven G N D C 16 49 —^V cc address registers, and two stack pointers may all be used as index H A LT C j 17 48 = IA 2 0 registers. RESET 1= 18 47 = 3 A 1 9 V M A E= 19 46 = 3 A 1 8 Included in many new computers, including TRS-80 Model 16, Cor­ EC 20 45 3 A 1 7 V P A C 21 4 4 vus Concept, SAGE II, and Fortune 32:16. = IA 1 6 BERRC 2 2 43 I3 A 1 5 Included in add-on boards manufactured by DTACK Grounded, I P L 2 C 23 4 2 ' = J A 1 4 IPL1 a 24 41 = 3 A 1 3 Motorola, and others for Apple, PET, and other 8-bit computers. IP L O C 25 40 Z IA 1 2 F C 2 C 26 39 Z1A11 FC1 C 27 38 Z 3 A 1 0 instruction Format FCOC 28 37 3 A 9 A1 C 29 36 3 A 8 15 14 13 12 10 A 2 C 30 35 = IA 7 A 3 C 31 34 ^ I A 6 O Operation Word A 4 E 32 33 i3 A 5 (First Word Specifies Operation and Modes)

Immediate Operand (If Any, One or Two Words)

Source Effective Address Extension (If Any, One or Two Words)

Destination Effective Address Extension (If Any, One or Two Words) Programming Model

31 16 15 8 7 0 DO Status Register D1 D2 System Byte U se r B yte D3 Eight D4 D a ta '1 5 13 10 4 0N D5 Registers 1 9 1 l x

M N Z < O D6 D7 Trace Mode. 31 16 15

Supervisor' AO S tate A1 In te rru p t A 2 Seven M ask A3 Address A4 Registers A 5 A 6 C o n d itio n C odes User Stack Pointer . Two Stack A7 Supervisor Stack Pointer P o inters 31 P rogram C o u n te r 15 8 7 [System Byte User Byte] Status R e g iste r

AICOO"' Data Sheet #8 MC68000 Instruction Set

Mnemonic Description Mnemonic Description Mnemonic Description

ABCD Add Decimal with Extend EOR Exclusive OR OR Logical OR ADD Add EXG Exchange Registers AND Logical And EXT Sign Extend PEA Push Effective Address ASL Arithmetic Shift Left ASR Arithmetic Shift Right JMP Jump RESET Reset External Devices JSR Jump to Subroutine ROL Rotate Left without Extend Bcc Branch Conditional ROR Rotate Right without Extend BCHG Bit Test and Change LEA Load Effective Address ROXL Rotate Left with Extend BCLR Bit Test and Clear LINK Link Stack ROXR Rotate Right with Extend BRA Branch Always LSL Logical Shift Left RTE Return from Exception BSET Bit Test and Set LSR Logical Shift Right RTR Return and Restore BSR Branch to Subroutine RTS Return from Subroutine MOVE 00 BTST Bit Test Move St MOVEM Move Multiple Registers SBCD Subtract Decimal with Extend -*-* CHK Check Register Against Bounds MOVEP Move Peripheral Data See Set Conditonal <1) CLR Clear Operand MULS Signed Multiply STOP Stop 0) CMP Compare MULU Unsigned Multiply SUB Subtract sz SWAP Swap Data Register Halves o CO NBCD Negate Decimal with Extend DBcc Test Condition, Decrement and Branch o nj DIVS Signed Divide NEG Negate TAS Test and Set Operand DIVU Unsigned Divide NOP No Operation TRAP Trap o (0 Ones Complement TRAPV Trap on Overflow NO 00 □ TST Test NO u UNLK Unlink Variations of Instruction Types* £ Instruction Instruction Type Variation Description Type Variation Description

ADDADD Add MOVE MOVE Move ADDA Add Address MOVEA Move Address ADDQ Add Quick MOVEQ Move Quick ADDI Add Immediate MOVE to CCR Move to Condition Codes ADDX Add with Extend MOVE to SR Move to Status Register MOVE from SR Move from Status Register ANDAND Logical AND MOVE to USP Move to User Stack Pointer ANDI AND Immediate ANDI to CCR AND Immediate to Condition Code NEG NEG Negate ANDI to SR AND Immediate to Status Register NEGX Negate with Extend

CMP CMP Compare OR OR Logical OR CMPA Compare Address ORI OR Immediate CMPM Compare Memory ORI to CCR OR Immediate to Condition Codes CMPI Compare Immediate ORI to SR OR Immediate to Status Register

EOR EOR Exclusive OR SUB SUB Subtract EORI Exclusive OR Immediate SUBA Subtract Address EORI to CCR Exclusive Immediate to Condition Codes SUBI Subtract Immediate EORI to SR Exclusive OR Immediate to Status Register SUBQ Subtract Quick SUBX Subtract with Extend •Additional instructions — actually special variations of those above.

Data Organization In Memory Bit Data 1 Byte = 8 Bits Data Addressing Modes

Mode Generation

Register Direct Addressing Data Register Direct EA = Dn Integer Data Address Register Direct EA = An 1 Byte = 8 Bits

Absolute Data Addressing 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Absolute Short EA = (Next Word) Absolute Long EA — (Next Two Words) Byte 1 MSB Byte0 LSB Program Counter Relative Addressing Relative with Offset EA = (PC) + d „ 1 W o r d - 16 Bits Relative with Index and Offset EA = (PC) + (Xn) + d, 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Register Indirect Addressing Register Indirect EA = (An) WordO Postincrement Register Indirect EA = (An), An ■*— An + N MSB LSB Predecrement Register Indirect An •«— An - N, EA = (An) Register Indirect with Offset EA = (An) + d16 1 Long Word = 1 Address = 32 Bits Indexed Register Indirect with Offset EA - (An) + (Xn) + d. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Immediate Data Addressing MSB Immediate DATA = Next Word(s) High Order Quick Immediate Inherent Data

Implied Addressing (address 0) Low Order Implied Register EA = SR, USP, SP, PC LSB

Notes: PC = Program Counter Decimal Data EA = Effective Address 0 = Contents of 2 Binary Coded Decimal Digits = 1 Byte An = Address Register d, = 8-bit Offset (displacement) Dn = Data Register dt« = 16-bit Offset (displacement) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Xn = Address or Data Register N = 1 for Byte, 2 for Words and MSD used as Index Register 4 for Long Words BCD 0 BCD 1 |_s d BCD 2 BCD 3 SR = Status Register «- = Replaces

JMCftO" Data Sheet #8 H i i Announcing ....A New, Authoritative Guide to The Most Important Book Ever Published for the Apple. What’s Whirs in th i 1PPLE...Plus...the Ml Mew Guide to What’s Where is William F. Luebbert’s Revised Edition of the famous Apple Atlas. The original What’s Where in the APPLE? provided more information on the Apple’s memory than was available anywhere else. Now the Revised Edition shows you how to use this valuable data. What's Ih s ri is tie APPLE...Plus... the All New ilufde to Ih a fs Where

• Guides you — with a numerical Atlas and an alphabetical Gazetteer — to over 2,000 memory locations of PEEKs, POKEs, and CALLs. • Gives names and locations of various Monitor, DOS, Integer BASIC, and Apple­ soft routines — and tells you what they’re used for. • Explains how effectively to use the infor­ mation contained in the original What’s Where in the Apple? • Enables you to move easily between BASIC and Machine Language. • Guides you through the inner workings and hidden mechanisms of the Apple.

All Apple users will find this book helpful in understanding their machine, and essential for mastering it! The Atlas and The ALL NEW GUIDE are available in one, 256-page Wire-O-Bound

Please send me: M 9 82 book for only $24.95 What's Where in the APPLE...PIus... _ *04 05 the All New Guide to What’s Where If you own the original What’s Where in the ______THE GUIDE m $ 9.95 Apple? you will want THE GUIDE to comple­ Add $2.00 surface shipping for each copy, Massachusetts residents add 5% sales tax. ment your edition. This 128-page, Wire-O-Bound Total Enclosed $ ______version contains all new material to be used □ Check □ VISA □ M aster Card A cct # ------with the memory map and atlas for $9.95 Expires ------Ask for it at your computer store

Name Use the Coupon to Order Direct from MICRO

Address or Call Toll Free Today 1-800-345-8112 City State Zip (In PA 1-800-662-2444)

MICRO INK 34 Cfcalmsford St., P.O. Bax 6502, Owlmsfard, MA 01124 83-345

No. 52 - September 1982 MICRO - The 6502/6809 Journal 125 AARDVARK - THE ADVENTURE PLACE ADVENTURES FOR OSI, TRS-80, TRS-80 COLOR, SINCLAIR, PET, VIC-20

ADVENTURES — Adventures are a unique DERELICT by Rodger Olsen and Bob Ander­ PYRAM ID by Rodger Olsen — This is one of form of com puter game. They let y o u spend son — For Wealth and G lory, you have to ran­ our toughest Adventures. Average time 30 to 70 hours exploring and conquering a sack a thousand year old space ship. Y ou'll through the Pyramid is 50 to 70 hours. The world you have never seen before. There is have to learn to speak their language and old boys who built this Pyramid did not mean little or no luck in Adventuring. The rewards for it to be ransacked by people like you. are fo r creative thinking, courage, and wise operate the machinery they left behind. The Authors note to players — This is a very gambling — not fast reflexes. hardest problem of all is to live through it. entertaining and very tough adventure. I left In Adventuring, the com puter speaks and Authors note to players — This adventure clues everywhere but came up with some in- listens to plain English. No prior knowledge is the new winner in the "Toughest Adventure genous problems. This one has captivated o f computers, special controls, or games is re­ at Aardvark Sweepstakes” . Our most difficult people so much that I get calls daily from as quired so everyone enjoys them —even people far away as New Zealand and France from who do not like computers. problem in w riting the adventure was to keep it logical and realistic. There are no irrational bleary eyed p e o p le who are s tu c k in the Except for Quest, itself unique among Ad­ Pyramid and desperate fo r more clues. venture games. Adventures are non-graphic. traps and sudden senseless deaths in Derelict. Adventures are more like a novel than a comic This ship was designed to be perfectly safe for QUEST by Bob Retelle and Rodger Olsen — book or arcade game. It is like reading a par­ its' builders, It just happens to be deadly to THIS IS DIFFERENT FROM ALL THE ticular exciting book where you are the main alien invaders like you. OTHER GAMES OF ADVENTURE!!!! It is character. played on a computer generated map of A ll of the Adventures in this ad are in Basic. Alesia. You lead a small band o f adventurers They are full featured, fully plotted adventures that will take a minimum of thirty hours (in on a mission to conquer the Citadel of Moor- several sittings) to play. lock. You have to build an army and then arm Adventuring requires 16k on Sinclair, TRS- and feed them by combat, bargaining, explora­ 80, and TRS-80 Color. They require 8k on OSI tion of ruins and temples, and outright ban­ and 13k on VIC-20. Sinclair requires extended ditry. The game takes 2 to 5 hours to play BASIC. and is different each tim e. The TRS-80 Color version has nice visual effects and sound. Not TREK ADVENTURE by Bob Retelle - This available on OSI. This is the most popular one takes place aboard a familiar starship and game we have ever published. is a must for trekkies. The problem is a famil­ MARS by Rodger Olsen — Your ship crashed iar one — The ship is in a "decaying orbit" on the Red Planet and you have to get home. (the Captain never could learn to park!) and You w ill have to explore a Martian c ity , repair the engines are out (You would th in k that in your ship and deal with possibly hostile aliens all those years, they would have learned to to get home again. build some that didn't die once a week). Your Authors note to players — This is highly options are to start the engine, save the ship, recommended as a first adventure. It is in no get off the ship, or die. Good Luck. way simple—playing time normally runs from 30 to 50 hours — but it is constructed in a Authors note to players — I wrote this one more "open" manner to let you try out ad­ with a concordance in hand. It is very accurate venturing and get used to the game before — and a lot of fun. It was nice to wander you hit the really tough problems. around the ship instead of watching it on T.V. CIRCLE WORLD by Bob Anderson - The Alien culture has built a huge world in the shape of a ring circling their sun. They left NUCLEAR SUB by Bob Retelle — You start behind some strange creatures and a lot of ad­ at the bottom of the ocean in a wrecked Nu­ vanced technology. Unfortunately, the world clear Sub. There is literally no way to go but is headed for destruction and it is your job to up. Save the ship, raise her, or get out of her save it before it plunges into the sun! before she blows or start WWIII. Editors note to players — In keeping with Editors note to players —This was actually the large scale o f Circle W orld, the author plotted by Rodger Olsen, Bob Retelle, and wrote a very large adventure. It has a lo t of someone you don't know — Three of the nas­ rooms and a lot of objects in them. It is a very tiest minds in adventure writing. It is devious, convoluted, very complex adventure. One of wicked, and kills you often. The TRS-80 Color our largest. Not available on OSI. version has nice sound and special effects. ADVENTURE WRITING/DEATHSH IP by Rodger Olsen — This is a data sheet showing HAUNTED HOUSE by Bob Anderson — This EARTHQUAKE by Bob Anderson and Rodger how we do it. It is about 14 pages of detailed one is for the kids. The house has ghosts, gob­ Olsen — A second kids adventure. You are instructions how to write your own adven­ lins, vampires and treasures — and problems trapped in a shopping center during an earth­ tures. It contains the entire text of Deathship. designed for the 8 to 13 year old. This is a quake. There is a way out, but you need hetp. Data sheet - $3.95. NOTE: Owners o f OSI, real adventure and does require some thinking To save yourself, you have to be a and TRS-80, TRS-80 Color, and Vic 20 computers and problem solving — but only for kids. save others first. can also get D e a th s h ip on tape fo r an addi­ Authors note toplayers —This one was fun Authors note to players — This one feels tional $5.00. to write. The vocabulary and characters were good. Not only is it designed for the younger designed for younger players and lots of things set (see note on Haunted House), but it also PRICE AND AVAILABILITY: happen when they give the com puter com ­ plays nicely. Instead o f killing, you have to All adventures are $14.95 on tape except mands. This one teaches logical thought, map­ save lives to win this one. The player must Earthquake and Haunted House which are ping skills, and creativity while keeping their help others first if he/she is to survive — I like $9.95. Disk versions are available on OSI and interest. that. TRS-80 Color for $2.00 additional. Please specify system on all orders ALSO FROM AARDVARK — This is only a partial list of what we carry. We have a lot of other games (particularly for the TRS-80 Color and OSI), business programs, blank tapes and disks and hardware. Send $1.00 for our complete catalog.

AARDVARK- 80 2352 S. Commerce, Walled Lake, Ml 48088 (313) 669-3110 % Phone Orders Accepted 8:00 a.m. to 4:00 p.m. EST. Mon.-Fri. TRS-80 COLOR SINCLAIR OSI VIC-20

126 MICRO - The 6502/6809 Journal No. 52 - September 198: NATIONAL Advertiser’s Index

ADVERTISING Aardvark Technical Services, Ltd...... 126 Advanced Logic System s...... 86 Andromeda, Inc...... 68 REPRESENTATIVES Anthro-Digital Software...... 21 Apple Tree Electronics...... 63 Ark Computing...... 82, 115, 119 Aurora Software Associates...... 84 WEST COAST CGRS M icrotech...... 19 C & J Supply...... 79 The R.W. Walker Co., Inc. Comp-U-Gamer...... 101 2716 Ocean Park Boulevard Com puTech...... 77 Suite 1010 Computer Case Co...... 25 Santa Monica, California 90405 Computer Data Service...... 109 The Computerist, Inc...... 121 (213) 450-9001 Computer Mail Order...... 64-65 serving: Washington, Oregon, Idaho, Montana, Wyom­ Computer Science Engineering...... 112 Computer Systems Associates...... 104, 105 ing, Colorado, New Mexico, Arizona, Utah, Nevada, Connecticut Information Systems Co...... 39 California, Alaska, and Hawaii (also British Columbia Crow Ridge Associates...... 25 and Alberta, Canada). Datam ost...... 85, 87, IBC Data Transforms, Inc...... 54 MID-WEST TERRITORY Decision System s...... 112 Digital Acoustics...... 26 Cem Com Associates D&N Micro Products, Inc...... 22 Chuck Moodhe Dr. Dobb's Journal...... 122 Eastern House Software...... 84 65 E. Palatine Road Elcomp Publishing...... 20 Suite 321 Excert ...... 9 Prospect Heights, Illinois 60070 Execom Corp...... 37 (312) 459-7311 Genesis Information Systems Inc...... 76 Gimix, Inc...... 1 serving: North Dakota, South Dakota, Nebraska, Kan­ Hudson Digital Electronics Inc...... 102 sas, Missouri, Indiana, Illinois, Iowa, Michigan, Wiscon­ Interesting Software...... 18 sin, and Minnesota. Leading Edge...... BC Logical D evices...... 120 Master Manufacturing...... 66 MIDDLE ATLANTIC AND MICRObits (Classifieds)...... 29, 38, 98 SOUTHEASTERN STATES MICRO INK...... 125, Insert Microsoft Consumer Products...... IFC Dick Busch Inc. Micro Ware Distributing Inc...... 44 Richard V. Busch Eleanor M. Angone Microware Systems Corp...... 56 6 Douglass Dr., R.D. #4 74 Brookline Modular M ining...... 77 Modular System s...... 28 Princeton, NJ 08540 E. Atlantic Beach, NY 11561 MP Computer Services...... 70 (201) 329-2424 (516) 432-1955 N ibble...... 30 Olympic Sales Co...... 70 serving: New York, Pennsylvania, New Jersey, Dela­ PEEK (65)...... 66 ware, Maryland, West Virginia, Virginia, D.C., North Perry Peripherals...... 101 Carolina, South Carolina, Louisianna, Tennessee, Mis­ Personal Computer Products...... 4 sissippi, Alabama, Georgia, and Florida. Quentin Research...... 31 RAM/RBC ...... 97 NEW ENGLAND AND RC Electronics...... 62 Real Soft...... 50 ALL OTHER TERRITORIES Sensible Software...... 40 SGC ...... 46 Kevin B. Rushalko Skyles Electric W orks...... 10 Peterboro, New Hampshire 03458 Small Systems Engineering...... 107 (603) 547-2970 Smoke Signal Broadcasting...... 2 Softel...... 21, 43 serving: Maine, New Hampshire, Vermont, Massachu­ Softside Publishing...... 88 setts, Rhode Island, Connecticut, Ohio, Kentucky, Okla­ Southeastern Microsystems...... 28, 37 homa, Arkansas, and Texas (also any other territories Southwestern Data Systems...... 6 not listed above). Spectrum Systems...... 70 Sublogic Communications Corp...... 13 Unique D ata...... 81 Universal Data Research...... 66 ADVERTISING MANAGER Versa Computing, In c...... 55 Voicetek, Inc...... 97 Cathi Bland Wesper Micro Systems ...... 44 address materials directly to: Yankee Peddler...... 99 MICRO INK, Advertising MICRO INK is not responsible for claims made by its advertisers. 34 Chelmsford Street Any complaint should be submitted directly to the advertiser. Chelmsford, Massachusetts 01824 Please also send written notification to MICRO. (617) 256-5515

No. 52 - September 1982 MICRO - The 6502/6809 Journal 127 October: Education Feature • Three Faces of Apple LOGO — An in- • One Teacher’s PET — The author, a fifth depth discussion of the three available grade teacher, discusses the growing versions of the educational computer, involvement of PET computers in her LOGO. classroom .

• A Personal Computer System for * Introduction to Turtle Graphics — This Untrained Users — A look at Applesoft article describes the Turtle Graphics BASIC programs that assist untrained routines available with Apple Pascal. A persons in using an unsupervised computer. graphics screen dump is also included.

Department Highlights Data Sheet Apple Slices More articles... PET Vet Formatted Output on the Atari New Publications Apple Pascal P-Code and the 6809 Reviews in Brief PET Machine-Language Screen Utilities Software and Hardware Catalogs The IBM Selectric as a Printer for the C1P

More MICRO for Less Money 20% OFF When You Subscribe Your money goes farther when you sub­ But on the newsstand — if you can locate the scribe. During the course of a year, when you issue you want — you pay $30.00 a year ($2.50 subscribe, you save 20% (in the U.S.). a copy). Pay only $24.00 ($2.00 a copy) for 12 monthly Special Offer — Subscribe for 2 years ($42.00) issues of MICRO sent directly to your home or and get 30% off the single issue price. office in the U.S. Subscribe to MICRO today.

MICRO 34 Chelmsford Street Subscription Rates Effective January 1,1982 P.O. Box 6502 Country Rate Chelmsford, MA 01824 United States $24.00 1 yr. Please send me MICRO fo r __1 year___2 years 42.00 2 yr. NOTE: Airmail subscriptions accepted for 1 year only. Foreign surface mail 27.00 Europe (air) 42.00 Check enclosed $______Mexico, Central America, Mid East, Charge my ______VISA account N. & C. Africa 48.00 ______Mastercard account South Am., S. Afr., Far East, Australasia, New Zealand 72.00 N o .______* Airmail subscriptions accepted for only 1 year. Expiration date ______For U.S. and Canadian 2-year rates, multiply by 2. Nam e______A d d r e s s ______Job Title: ______City/State______Zip Type of Business/Industry:

128 MICRO - The 6502/6809 Journal No. 52 - September 1982 The That’s an Open Door to ti

KIDS & THE APPLE is its name, and its game is Then, there are special sections for a parent H 1 7 ^ batamcst to prepare your child, or any child, to take CAIU50N or teacher to use so they can work along his or her place as a member of the com­ with the kids, if they wish, and heip them puter generation by teaching them the over any rough spots. mysteries of the Apple* computer in ways Perhaps the major reasons the kids will love they'll love and enjoy. Don't be surprised if this book is that it is truly written so they can you will also learn along with your child. easily understand it (without a lot of confus­ The kids of today are fascinated by com­ ing technical language) . . . and that they puters to start with. And thafs great, be­ see on-screen-results almost immediately! cause it means they’re eager to learn. But, i l Right away they realize they'll soon be pro­ until this book by Edward H. Carlson, learn­ gramming their Apple, making their own ing about the Apple was a fumbling, games! ... or creating other programs for bumbling effort for a child. school or work or to play. s* KIDS & THE APPLE was designed in every The computer world is roaring toward us. To aspect to lead them gently, interestingly be successful at work, school or even play, a yet quickly into the computer world. First, ifs child will have to be knowledgeable about a large 8 V2 by 11 book which can be computers. Make sure your favorite child is At computer stores, or from: opened flat for ease of use. Second, there prepared for the challenge. With KIDS & THE are 35 chapters, each one building upon The educational/book division of APPLE at his side, he'll enjoy learning and jhe knowledge of the prior chapter - and you'll know you've prepared him or her for a DATAMOST! successful future. Only $19.95. loaded with dozens and dozens of car­ 9748 Cozycroft Ave. toons which make a point as they amuse. Chatsworth, CA 91311 (213) 709-1202 'Apple is a trademark of Apple Computer, Inc. THE PROWRITER COMETH (And It Cometh On Like GangbustersJ

Evolution. It’s inevitable. An eternal verity. Just when you think you’ve got it knocked, and you’re resting on your laurels, some­ body comes along and makes a dinosaur out of you. Witness what happened to the Centronics printer when the Epson MX-80 came along in 1981. And now, witness what’s happening to the MX-80 as the ProWriter cometh to be the foremost printer of the decade. SPEED M X -8 0 :8 0 cps, for 46 full lines per minute throughput. PROWRITER: 120 cps, for 6 3 full lines per minute throughput. GRAPHICS MX-80: Block graphics standard, fine for things like bar graphs. PROWRITER: High-resolu­ tion graphics features, fine for bar graphs, smooth curves, thin lines, intricate details, etc. PRINTING MX-80: Dot matrix business quality. PROWRITER: Dot matrix correspondence quality, with incremental printing capability standard. FEED MX-80: Tractor feed standard; optional friction-feed kit for about $75 extra. PROWRITER: Both tractor and friction feed standard. INTERFACE MX-80: Parallel interface standard; optional serial interface for about $75 extra. PROWRITER: Parallel and serial interface standard. WARRANTY MX-80: 90 days, from Epson. PROW RITER: O ne full year, from Leading Edge. PRICE H eh. heh. Distributed Exclusively by Leading Edge Products, Inc., 225 Turnpike Street, Canton, Massachusetts 02021. Call: toll-free 1-800-343-6833; or in Massachusetts call collect (617)828-8150. Telex 951-624. LEADING EDGE For a free poster of “Ace ’ /Prowriter's pilot) doing his thing, p lease write us.