O

74470 1 1690 Feature s e m a G IMAkES P/XpERWORk PANdEIVIONiuiVI VANish

MAGIC WINDOW II turns your APPLE in­ And as an extra assurance that your system. MAGIC MAILER lets you insert to a sophisticated word processor. But document is perfect before printing and each name and address (or whatever is in because MAGIC WINDOW II operates so mailing, you can use MAGIC WORDS. your records) into your document quickly much like a standard typewriter, it’s ex­ With incredible speed, MAGIC WORDS and efficiently. tremely simple to use. In fact, because of proofreads your document for spelling er­ With MAGIC MAILER, you never have to its unique menu structure, it’s the easiest rors and typos, shows you each one in con­ retype a document or an internal address. to learn, and function selection is virtually text on the screen, and allows you to cor­ With just a few keystrokes, each letter error free. rect or ignore each in sequence. Unlike any becomes an original, and the final phase other spelling checker, it will then auto­ MAGIC WINDOW Il’s powerful word pro­ of the paperwork process is complete — matically create a corrected file as you go cessing features include automatic format­ efficiently and to perfection. so you never need to return to MAGIC WIN­ ting, editing, centering, and justification — Let's face it: The letters, invoices, and DOW II to update it yourself manually. Or. and these are all done easily “on the video other documents you send out represent screen” before you ever print. Just type if you're busy. MAGIC WORDS will go you to the public. They should be as pro­ through your file without waiting for you to your first draft quickly, then go back and fessional as possible — and they can be. make any needed corrections. You can in­ act on each error, and provide you with a All it takes is a little MAGIC sert or delete letters or words, even move printout of the errors and their locations so you can correct them at your convenience. Each program is available separately or whole paragraphs with just a few simple ask your local software store for Artsci’s keystrokes. And with a 14,000-word dictionary MAGIC PAK. AH three products are included and plenty of memory for you to add And MAGIC WINDOW II can support 40-, in an attractive library box. technical terms or customer names that 70-, and 80-column displays, as well as you use frequently. MAGIC WORDS be­ automatically providing 80-column visibility comes a totally personalized program that with scrolling. The rule is: What you see on can catch all your spelling errors and typos. the screen is what you get in print. No word processor on the market has both the But now comes the mailing, the really 213.-9 85-2922 ML features of MAGIC WINDOW II and its time-consuming part — unless you have simplicity of use. MAGIC MAILER. A mailing list merge tir ts i 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 51/»” 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 51/»” Floppy Disk Drive ★ 19 MB 51/»” Winchester DMA SubsystemDMA ★ 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 SO FTW A R E 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 ...... $4148.49 HARDWARE FEATURES: ★ 2MHz 6809 CPU ★ DMA Double Density Floppy Disk Controller ★ 56K Static Ram ★ 2 Built-in 51/4” 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 handle5 V t" two 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 are...... $4288.90 #91 includes two 19MB Drives, Interface, and Software...... $6688.91 Contact GIMIX for systems customized to your needs or for more information. 50 HZ Export Versions Available GIMIX Inc. reserves the right to change pricing and product specifications at any time without further notice. 1337 WEST 37th PLACE CHICAGO, ILLINOIS 60609 i n c . GIMIX® and GHOST® are registered trademarks of GIMIX Inc. (312) 927-5510 FLEX and UniFLEX are trademarks of Technical Systems Consultants Inc. E i m i x OS-9 is a trademark of Microware Inc. TWX 910-221-4055 1982 GIMIX Inc. THE SKILLS YOU NEED TO MASTER YOUR IN A FRIENDLY, SELF-PACED FROM WILEY

BASIC FOR THE APPLE II® 6502 PROGRAMMING Jerald R. Brown, LeRoy Finkel, & Bob Albrecht Judi N. Fernandez, Donna N. Tabler, & Ruth Ashley A complete, friendly, and virtually guaranteed in­ Puts the speed and efficiency of assembly lan­ troduction to BASIC programming on the Apple guage programming within reach of owners of II®—from fundamental principles, assignment APPLES®, ATARIs®, Commodores, or any of the statements, and stored programs to such ad­ popular based on the 6502 mi­ vanced techniques as string variables and func­ croprocessor chip. tions, subscripted variables, subroutines, and (1-86120-0) October 1982 more. approx. 256 pp. $12.95 (1-86596-6) October 1982 416 pp. $12.95 GOLDEN DELICIOUS GAMES FOR THE APPLE® COMPUTER ATARI® SOUND AND GRAPHICS Howard M. Franklin, JoAnne Koltnow, Herb Moore, Judy Lower, & Bob Albrecht & LeRoy Finkel Learn how to compose and play melodies, draw This delightful guide shows novice and experi­ cartoons, create games, and combine animation enced programmers how to use the color, sound, and sound—even if you have no previous comput­ and graphic capabilities of the Apple II® to create ing experience. their own computer games. (1-09593-1) 1982 234 pp. $9.95 (1-09083-2) 1982 150 pp. $12.95 TRS-80™ COLOR BASIC More than a million people have learned to pro­ Bob Albrecht gram, use, and enjoy microcomputers with Wiley Packed with games, experiments, and program­ Self-Teaching Guides. Look for them all at your ming problems and solutions, this manual lets you favorite bookshop or computer store. explore all the applications of the TRS-80™ Color JOHN WILEY & SONS, Inc. Computer, while it teaches you the fundamentals i8o7(W )19& 6o5 Third Avenue of BASIC programming. W New York, N.Y. 10158 (1-09644-X) 1982 374 pp. $9.95 In Canada: 22 Worcester Road, Rexdale, Ontario M9W 1L1

Apple9 and Apple II ® are registered trademarks of Apple Computer, Inc. Atari ® is a registered trademark o f Atari, Inc. TRS-80™ is a trademark of Tandy Corp. 3-8715

2 MICRO - The 6502/6809 Journal No. 54 - November 1982 cessor, we present two articles this month on the 68000. Dr. Hootman's detailed discussion of the 68000 instruc­ tion set continues (p. 27) with the binary arithmetic opera­ / M c a o tions. Handy reference tables are included. Jelemensky and Whiteside (p. 13) conclude their demonstration of November Highlights 68000 programming techniques. We haven't seen any games yet for the 68000. Is it Games Feature because its users haven't gotten over the speed and power? Or is it because these machines aren't finding their way in­ This month we expand a bit from our usual content and of­ to very many homes? fer an array of games for a wide variety of computers. Although we don't usually publish games, we feel that Atari Coverage Takes Off they may be valuable, particularly where they demon­ strate techniques or cultivate a skill in the user. Instead of With the addition of Contributing Editor Paul Swanson making games a regular part of MICRO, we prefer to do it to our staff, MICRO'S Atari coverage has improved con­ all at once! siderably. Paul's column, a new "From Here to Atari" (p. 103), starts this month. In addition, he continues his There are specific games for nearly every computer, in­ character graphics article series with a discussion of fine cluding the PET, VIC, Apple, CIP/Superboard, Atari 400/ scrolling (p. 82). This month's data sheet (p. 109 — com­ 800, and the SYM.-In addition, you will find that most can piled by Paul Swanson) is a handy reference for serious be converted easily to run on even more machines. These Atari programmers. represent a variety of types of games too — from action games like "Space Invasion" and "Shootdown," to Atari users will be interested in programming extra col­ strategy games like "Number Shuffle," "GOMOKU," and ors, even in the limited high-resolution modes. Richard "23 Matches," to "Castle Adventure." and Donna Marmon (p. 96) illustrate two techniques — one that uses adjacent color dots, and one that quickly Written in the style of Scott Adams' famous games, alternates displays. "Castle Adventure" (p. 41) tests your memory and analytical skills. You will find yourself in the evil baron's Hardware castle in a quest for treasure and the kidnapped princess. "Castle Adventure" was originally written for the PET. In keeping with our lighter theme in this issue, the We have provided specific line changes to make it run on hardware articles we present are simple, single-evening the Apple. However, except for disk commands, it is writ­ projects. All involve modifications of existing equipment. ten in straight BASIC, so owners of OSI, Atari Ralph Tenny (p. 19) shows how to get a high-quality pic­ (with Microsoft BASIC), and Color Computer [with ex­ ture from your color computer using a monitor instead of a tended BASIC) machines should be able to easily adapt TV. A monitor requires a composite video signal, not "Castle Adventure." available on the CC, and the author shows you how to add it. Jim Strasma (p. 35) shows how to take Commodore's "Solve the Pagoda Puzzle Using Recursive Assembly" cheapest model PET and convert it into a machine with (p. 53) is particularly interesting because it demonstrates a 80-column business capabilities, yet with all the graphic technique — having a subroutine call itself — that you characters still available from the keyboard. OSI owners may want to apply to your own programs. The author's ap­ can now use Atari's inexpensive joysticks with their plication is in solving the "Pagoda" or "Tower of Hanoi” machines. Joseph Ennis (p. 9) shows how to make the sim­ puzzle. The program solves the puzzle for a stack of disks ple changes in your computer board. of any practical height and outputs a list of specific moves. With a minimum of changes, it will run on any 6502 com­ Graphics for the Apple puter. You may want to try incorporating this routine into a BASIC program that actually shows the disks being moved For those interested in improving their game and graphic from peg to peg. programming skills, our graphics articles for Atari and Ap­ ple will help. Apple programmers will learn about 3-D ro­ "GOMOKU” (p. 59) is a fast, machine-language ver­ tation from Chris Williams (p. 99). If you have done much sion of the oriental game of strategy. It is presented here graphics programming on the Apple, you have probably for VIC, with modifications for PET. "Number Shuffle” is been annoyed by the unfortunate location of the graphics an Atari computer version of "Magic Square,” the game pages. Authors Bems (p. 93) and Weston (p. 79) present a where you slide the little numbered squares around until number of techniques to circumvent this problem. you get them in order. "Space Invasion,” for the C1P/ Superboard and "Shootdown" are arcade-style action New Color Computer Column Expands games. Finally, "23 Matches'' is a short machine-language 6809 Coverage game for the SYM. It makes ingenious use of the SYM's LCD display. John Steiner's new monthly column 1 CoCo Bits" covers the 6809-based TRS-80 Color Computer (p. 38). This month’s editorial (p. 7) offers some thoughts on This month he discusses some problems associated with games and their place in MICRO and in our society. transferring cassette programs to disk and presents a short program to move the game "BEDLAM." Also for the 68000 Coverage Continues Color Computer owner, Ron Anderson discusses FLEX09 (p. 23) as it is implemented by Frank Hogg Laboratories. Preliminary results from our survey indicate that a lot FLEX is a universal operating system that opens up a wide of you are interested in the 68000. As part of our continu­ range of software for the 6800 and 6809 to the Color Com­ ing effort to keep you informed on this powerful new pro­ puter owner. 4MCAO

No. 54 - November 1982 MICRO - The 6502/6809 Journal 3 Emulates these terminals exactly. IBM 3101 BREAK DEC VT100, VT52 CATALOG Data General D200 CHAIN ADDS Regent 20, 25, 40 CONFIGURE Hazeltine 1400,1410,1500 CONNECT Lear Siegler ADM-3A, ADM-5 CONVERSE TeleVideo 910 DIAL Teletype Model 33 KSR END HANGUP Apple is a trademart of LOG Apple Computer, Inc. MONITOR NOLOG ONERR PAUSE PROMPT RECEIVE REMARK RETRIES SEND SPECIAL SPEED TIMEOUT XMIT:WAIT

Supports these interface boards.

i f Apple Communicattofls Card I f Apple Parallel Printer 3 Apple Serial Interface I Apple Super Serial Card ; Bit 3 Dual-Comm Plus'* CCS 7710, 7720, 7728 Hayss Mlcromodem II™, Smartmodem™ 300, & 1200 Intra Computer PSIO Novation Apple-Cat II™ 300 & 1200 Orange Micro Grappler™ SSMASIO, APIO, AIO, AIO I

Supports your 80-column hardware.

ALS Smarten* ™ Bit 3 Fulhvlew 80“ Computer Stop Omnlvlsion™ M&R Sup’R'Tenninal™ STB Systems STB-80™ Vide* Videoterm” Vista Computer Vision 80™ Your host com Wosper Micro Wizard 80™ won’t know the difference! Softerm provides anexact terminal emulation computer to allow! __ specify the serial interface parameters for a wide range of CRT terminals which interfacewith Softerm using the Softrans pro to be used. to a variety of host computer systems. Special Softerm file transfer utilizes an easy to use function keys, sophisticated editing features, command language which allows simple defini­ Online Update Service even local printer capabilities of the terminals tion of even complex multiple-file transfers with The Softronics Online Update Service is pro­ emulated by Softerm are fully supported. Softerm handshaking. Twenty-three high-level commands vided as an additional support service at no operates with even the most discriminating host include DIAL, CATALOG, SEND, RECEIVE, additional cost to Softerm users. Its purpose computer applications including video editors. ONERR, HANGUP, MONITOR and others which is to allow fast turnaround of Softerm program And at speeds up to 9600 baud using either amay be executed in immediate command mode fixes for user-reported problems using the direct connection or any standard communi­ interactively or from a file transfer macro com­ automatic patch facility included in Softerm cations modem. mand file which has been previously entered as well as a convenient distribution method for and saved on disk. additional terminal emulations and I/O drivers Unmatched file transfer capability which become available.User correspondence Softerm offers file transfer methods flexible Built-in utilities can be electronically mailed to Softronics, and enough to match any host computer requirement. Softerm disk utilities allow DOS commands such user-contributed keyboard macros, file transfer These includecharacter protocol with user- as CATALOG, INIT, RENAME, and DELETE to be macros, and host adaptations of the Softrans definable terminator and acknowledge strings, executed allowing convenient file maintenance. FORTRAN 77 program are available on-line. block size, and character echo wait, and the Local file transfers allow files to be displayed, intelligent Softrans ™ protocol which provides printed, or even copied to another file without Most advanced communications reliable error-free transmission and reception of exiting the Softerm program. Numerous editing software available data. The character protocol provides maximumoptions such as tab expansion and space com­ Just check Softerm’s 300 page user manual. flexibility for text file transfers.Any type file pression are provided to allow easy reformatting You simply can’t buy a more sophisticated may be transferred using the Softrans protocol of data to accommodate the variations in datapackage or one that’s easier to use. Available which provides automatic binary encoding and formats used by host computers. Softerm sup­ now for only $150 from your local dealer or decoding, block checking with error recovery, and ports automatic dialing in both terminal and file Softronics, Inc. data compression to enhance line utilization. transfer modes. Dial utilities allowphone a book A FORTRAN 77 source program is supplied with of frequently used numbers to be defined which SOFTRONICS Softerm which is easily adaptable to any host are accessed by a user-assignable name and 6626 Prince Edward, Memphis, TN 38119.901-755-5006 NO. 54 NOVEMBER 1982

______THE 6502/6809 JOURNAL

STAFF GAMES FEATURE

President/Editor-in-Chief Castle Adventure for PET and APPLE .... David Malmberg ROBERT M. TRIPP 41 Publisher SYM 23 M atches...... Matt Ganis MARY GRACE SMITH 49 Editorial Staff c o Solve the Pagoda Puzzle Using PHIL DALEY — Technical editor JOHN HEDDERMAN — Jr. programmer Recursive Assembly...... Sherwood Hoyt MARJORIE MORSE — Editor JOAN WITHAM — Editorial assistant 59 VIC/PET GOMOKU...... David Malmberg LOREN WRIGHT — Technical editor

Graphics Department 6 2 Number Shuffle on the ATARI ...... Frank Roberts HELEN BETZ — Director PAULA M. KRAMER — Production mgr. EMMALYN H. BENTLEY — Typesetter 66 Sensible Use of APPLE Game Paddles...... Harry l . Pruetz Sales and Marketing CATHI BLAND — Advertising mgr. 7 0 Space Invasion for OSI C1 P/Superboard ...... Johns. Seyboid CAROL A. STARK — Circulation mgr. LINDA HENSDILL — Dealer sales 7 2 APPLE Shootdown ...... Eric Grammer MAUREEN DUBE — Promotion Accounting Department DONNA M. TRIPP — Comptroller HARDWARE KAY COLLINS — Bookkeeper n ATARI Joysticks on the O S...... I ...... Joseph Ennis EILEEN ENOS — Bookkeeper ^ A simple modification including software and programming information Contributing Editors DAVE MALMBERG ho An MC68000 Overview, Part 2 . Joe Jelemensky and Tom Whiteside JOHN STEINER 1 ^ Simple examples illustrate 68000 programming techniques JIM STRASMA PAUL SWANSON n n A Monitor for the TRS-80 Color Computer ...... Ralph Tenny RICHARD VILE 1 ^ Instructions to get composite video from the video section of the CC

Advertising Sales Representatives o o FLEX and the TRS-80 Color Computer . . . Ronald W. Anderson See Page 127 A description of FLEX09 Subscription/Dealer inquiries (617) 256-5515 p y 68000 Binary Arithmetic Operations ...... JoeHootm an ^ * A discussion of binary arithmetic instructions

q c How to Make a Graphic-80 PET from a 4016 . . . Jim Strasma DEPARTMENTS Just add inexpensive ICs and move jumpers 3 November Highlights 7 Editorial GRAPHICS 38CoCo Bits 7 q APPLE Hi-Res Graphics and Memory Use...... Dan Weston 50New Publications * ^ Avoid overwriting the graphic display area 63Letters/Updates 75PET Vet o p ATARI Character Graphics from BASIC, Part 2 . Paul Swanson 86APPLE Slices Learn about fine scrolling 88Reviews in Brief 103From Here to ATARI q q Getting Around the APPLE Hi-Res Graphics Page Eagle i. Bems 1056809 Bibliography 'S'J Utilize the graphics area without sacrificing memory 106Software Catalog 108Hardware Catalog q o Extra Colors for the ATARI ...... Richard I. and Donna Marmon 109Data Sheet Two techniques to expand your computer’s palette 111Advertiser’s Index 112Next Month in MICRO q q Introduction to 3-D Rotation on the APPLE ...... Chris Williams ' 3 ' * Learn the techniques for yaw, pitch, and roll

No. 54 - November 1982 MICRO - The 6502/6809 Journal 5 EXPANSION

Tired of trying to run your word processor or your DMB on an columns; handle 50 Hz European formats; accomodate custom OSI 64 character video screen? Now there’s the SEB-3, THE characters or character cell sizes larger or smaller than 8x8 most versatile 80x24 video board anywhere is available for OSI and transparently access the screen to eliminate screen 48 pin BUSS systems. No longer will you have to consider con­ “ glitches” . In short, the SEB-3 will meet any demands your verting your video-based system to a serial terminal because system may place on it now and in the future. The SEB-3 also you've found 64 characters stifling for serious business use. supports an OSI-style floppy disk interface which can handle Nor need you give up compatibility with any existing graphics two 5” or 8" drives. Like all of the boards in the SEB series, software because the SEB-3 allows you to choose ANY screen the SEB-3 simply “ plugs in" to your machine — there are format up to 80x24 including 32x32 and 64x32. Since the absolutely NO hardware changes. The SEB-3 is designed to SEB-3’s screen format can be changed at any time under soft­ replace your outmoded 540 board so you don't even lose a ware control, even gaming displays can benefit from screens backplane slot. Your keyboard input now also plugs into custom tailored to the game itself. The SEB-3 is so the SEB-3 — load one of the software drivers and you’re well designed and so versatile that it will not need ready to go! to be replaced — ever. Simple changes in software and/or SEB-3 Assembled $259.00 Bare Board $59.00 hardware will allow the SEB-3 to: generate displays up to 256 Kit $220.00 Manual only $5.00

If your Challenger can't generate displays like those shown Installation of either board requires absolutely NO modification of above WHAT ARE YOU WAITING FOR? The SEB-1 High your computer—they just ‘plug-in’. Nor do they preclude your Resolution Graphics and Memory Board (for C1P and using any other OSI-compatible hardware or software. In addition Superboard II) and the SEB-2 High Resolution Graphics and to the Hi-Res Graphics the SEB-1 gives C1 & Superboard II users Disk Controller Board (for C2/4/8) simply ‘plug-in’ to your 16K of additional user memory (over and above that memory computer and give you instant access to over 49000 devoted to the graphics), two 16 bit timers/counters, an on-board individually addressable pixels in up to 8 colors! Your Hi-Res RF modulator, and a parallel port with handshaking. The SEB-2 screen can go from 32 x 16 alphanumerics to 256 x 192 point gives OSI 48-pin BUS users an OSI hardware/software graphics in 11 software selectable modes. The standard video compatible Disk controller, and an RF modulator that can be of your computer is left intact, so that none of your current user-populated. software library is outmoded. Use the graphics for Business, FOR OSI IP, 2-4P, 2-8P, C4P, C8P Scientific, Education, or Gaming displays that were impossible — until now! ______SEB-1______SEB-2 SEB-1 SEB-2 Assembled and Tested $249.00 (5K RAM) $239.00 (IK RAM) Bare Board & Manual $ 59.00 $ 59.00 Kit $165.00 (No RAM) $199.00 (No I Manual only $ 5.00 $ 5.00

COMING: SEB-3 80x24 VideolDisk C ontroller (C2I4I8), SEB-4 48K Memory RAMIROM (C2I4I8), SEB-5 8 K RAMIDisklSoundlClock/Volce (C1 & Superboard). V7S4* Write for FREE catalog International Requests please SOFTWARE ASSOC. supply 2 International Response Coupons ORION P.O. BOX 310, OSSINING, NY 10562 914-762-5636

6 MICRO - The 6502/6809 Journal No. 54 - November 1982 About the Cover r /AlCftO Editorial

Responsible Gamesmanship

MICRO does not publish games. We've Judah Schwartz, Professor of Engi­ run editorials explaining why — out­ neering Science and Education at MIT, lining the weaknesses, drawbacks, and summed up the software situation in a Our brave knight, Godfrey de Good- worthlessness of many computer recent issue of Classroom Computer heart, boldly chases dragons through games. The computer was not devel­ News. Although his comments were Baron Von Evil's castle in search of the fair Princess Fatima. MICRO features oped to fill arcades or to force squeals of directed specifically toward educa­ "Castle Adventure" by David Malmberg delight or anguish from mesmerized tional material, they can be as easily (page 41). It is written for PET, Apple, users who've spent hours killing the applied to games in general: "My hope and other Microsoft BASIC computers. same aliens over and over again. is that the publishers of this country — who control the curriculum far more The photo, by Kenneth Witham, is of So why have we not only addedthan they even begin to realize — will Schloss Anif in Salzburg, Austria. The knight and dragon graphics were drawn games in this issue, but FEATURED stop doing what they are now doing and on the Apple Graphics Tablet. them? We aren't giving in; we still start to provide materials for computers believe many games are a waste of which are more open-ended, which are time. But we also believe that games — more tool-like in nature, which will when written and presented properly — help children to assume a more active can educate. In fact, they can act as an role, which will not trivialize the effective tool at all educational levels. nature of education, and which will work to make schools more nearly the For example, there are games that collaborative community of learners simulate business environments, that they should be." games that demand logical thought, games that teach us how to program, Computers are efficient, friendly, JMCftO is published monthly by: how to spell, or to calculate math­ and generally expensive. As with every­ MICRO INK, Chelmsford, MA 01824 ematical equations. The variations of thing else, we want them to be used to Second Class postage paid at: these games that are most successful their full potential. One way is through Chelmsford, MA 01824 and additional actively involve the student/partici­ well-written, mind-boggling, educa­ mailing offices USPS Publication Number: 483470 pant in problem solving and decision tional games. So, MICRO would like to ISSN: 0271-9002 making. They are not just drills to promote the use of these types of enable us to push the right button at games. We encourage manufacturers to Send subscriptions, change of address, USPS the right time or to give the right continue to produce quality products Form 3579, requests for back issues and all answer; they are lessons in learning — that get the most out of the computer other fulfillment questions to they can expand our understanding of and the participant. We encourage pub­ MICRO INK lishers of books and magazines to sup­ 34 Chelmsford Street both artificial and human intelligence. P.O. Box 6502 port the use of stimulating games that Chelmsford, MA 01824 You see, it's the games that just pit require both the use of skill and the or call one person against the computer in a growth of skills. 617/256-5515 Telex: 955329 TLX SRVC mindless battle of eye-hand coordina­ 800-227-1617 tion that irritate us the most. (Does an We hope you enjoy the games we image of your neighborhood's favorite present in this issue, but also hope you Subscription Rates PerY eai arcade leap to mind?) Maybe these will leam some new techniques and U.S. $24.00 florescent, noisy battlegrounds provide some good methods for writing your 2yr. / $42.00 entertainment for those who need to let own games. We hope you will give Foreign surface mail $27.00 off a little steam; but to have energetic, some thought to the social impact of Air mail: lively, questioning children and adoles­ computer games, as well. Europe $42.00 Mexico, Central America, cents glued to machines in meaningless Middle East, North Africa, combat for hours on end is scary. Central Africa $48.00 South America, South Africa, Far Bast, Australasia, Whose responsibility is it (yours, New Zealand $72.00 ours, the schools, the manufacturers) to offer at least enough of the really Copyright© 1982 by MICRO INK All Rights Reserved worthwhile stuff to balance off what's & already so, unfortunately, popular?

No. 54 - November 1982 MICRO - The 6502/6809 Journal MACHINE LANGUAGE SPEED WHERE IT COUNTS... IN YOUR PROGRAM!

Some routines on this disk are: Binary file info For the first time, AmperMagic 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 language routines to your Applesoft programs in seconds! And interface them Dump variables by name, 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 Swap variables &-MAGIC m akes it Easy to be Fast & Flexible! PRICE: $75 Anthro - Digital Software P.O. Box 1385 Pittsfield, MA 01202 &-Magic and Amper-Magic are trademarks of Amhro-Digital, Inc. Applesoft is a trademark of Apple Computer, Inc. The People - Computers Connection Vs

VOICE SYNTHESIZER FOR AIM/SYM/KIM WITH SPEAKER...... $139.00 AIM 65, 4K, COMPLETE WITH M A N U A L S ...... $469.00

NEW FULLY GUARANTEED PARTS 6502P, 1 M H Z ...... $ 5.95 555 TIMER...... 6512P, 1 M H Z ...... 5.95 21 1 4, 1 Kx4, 450N S ...... $ 2.25 XR 2206...... 6520P, PIA...... 4.45 61 16, 2Kx8. C M O S ...... 7 50 XR2211 . . 6522P. VIA...... 6.45 41 16. 16Kx1. DYNAMIC 1.95 DM8131 ...... 6532P, RIOT ...... 7.95 4164, 64Kx1, DYNAMIC .... 10.95 RED L.E.D., Tl 3/4. HI EFF 6545-1 P, CRT...... 19.95 2716.2K.xS...... 3.95 IN 4004...... 6551 P, UART...... 8.95 2532. 4 K x 8 ...... 8.50 IN914 6592P, PRINT CTRL ...... 26.80 4N33. OPTO-COUPLEfi...... 2.95 IN4148 6 84 7P .V D G ...... 15.60 VOLTRAX SC-01 A...... 69.00 8 POSITION DIP SWITCH

PHONE ORDERS WELCOME - FREE CATALOG - HOURS 9 A.M. TO 5 P.M. CST.

CASHIERS CHECK or MONEY ORDER ADD $ 1.75 FOR U.P.S. PERSONNEL CHECKS, 2 WEEKS WITH D.L.# ADD $2.75 for 1 st CLASS MAIL MC or VISA, MUST HAVE CARD NO. ADD ADDITIONAL $5.00 FOR C.O.D. SHIPPED VIA U.P.S. or 1st CLASS MAIL ADD ADDITIONAL $3.75 FOR OUT OF U.S. C.O.D. ACCEPTED, ADD $5.00 TEXAS RESIDENTS ADD 5% SALES TAX MAIL ORDER ONLY PRICES GOOD THROUGH DECEMBER 31, 1982 BEDFORD MICRO SYSTEMS 817 - 283-0013 P.O. BOX 1182 BEDFORD, TEXAS 76021

8 MICRO - The 6502/6809 Journal No. 54 - November 1982 Installing Atari Joysticks on the OSI

by Joseph Ennis

A simple, non-destructive Molex connector according to the fol­ joystick connector into [4, the connec­ modification to the OSI C1P or lowing table: tor in the lower left comer or closest to the keyboard (see photograph). Plug in Superboard is described. This Molex the joystick connector so that pin 1, the allows the use of inexpensive Pin Joystick 1 Joystick 2 one with a black wire on it, is toward Atari joysticks. Demonstration 1 — Black the back of the 600 board (away from 2 Black software and programming the keyboard). Bring up power and, 3 - information are also included. without touching the joystick, check to 4 — see that the keyboard works as before. 5 Green Green Now pick up joystick 1, the one with 6 Blue Blue its black wire connected to pin 2. Move Joystick 7 Brown Brown the controls on the joystick and note requires: 8 White White that characters are printed to the 9 Orange Orange C1P monitor screen according to the follow­ 10 — Hardware components ing table. Pick up joystick 2 and per­ 11 — One or two Atari joysticks form the same test. Any problem is 12 — most likely a soldering problem. For those interested in how this Joystick 1 Joystick 2 Installing Atari joysticks on the OSI modification works, figure 1 shows the Fire 1 600 board-based computers (Super­ schematic of the 600 board keyboard Q Up A 2 board or C1P) is easy. It takes $9.95 per area with the joysticks connected to Right Z 3 joystick and five minutes. connector J4. Down Space 4 Sears is a good source for Atari Testing is also easy. First do the Left / 5 joysticks; they stock them under two usual inspection for poor workman­ catalog numbers — 6K99835 for a ship, solder bridges, etc. Then plug the D on't worry about Up-Right or Up- single joystick or T3K7687 for a pair. You'll pay $19.95 for two. In addition you will need one 12-pin male Molex Figure 1: Keyboard/Joystick Schematic connector. You may purchase one from + 5V your OSI dealer for $1.00, or from Technical Products Co., Box 12983, University Station, Gainsville, FL 32604 (Molex connectors are $4.95 for four pair of male and female). My 600 board came without J4 mounted, but it took me about one minute to push a connector into the holes in the printed wiring board and solder the twelve pins to the board. When you get the joysticks, cut the Atari cables as close to the connector as possible, and strip enough of each wire to connect to a male Molex connector (about 1/8 inch). I used a drill press vise to hold the Molex connector and an X2 magnifying glass to aid in solder­ ing. I also used the trick of wrapping several turns of number 18 buss wire around the tip of my 15-watt pencil iron to give me a fine soldering point. Solder the wires of both joysticks (if you plan to use two) to the single male

No. 54 - November 1982 MICRO - The 6502/6809 Journal 9 Right-While-Filing. These combina­ Listing 1 tions are there, but right now they decode to non-printable symbols and 0 REM***************** don't show on the monitor screen. 1 REM .JOYSTICK * * 2 REM DDODLER * * This completes installation and 3 REM * * testing. The rest of the joystick opera­ 4 REM bv * * tion is software. At the time of this 5 REM Joseph Ennis ** writing OSI had not yet come out with 4 REM * * 7 REM A- DEMO o f J O Y -** any joystick programs for the 600 board 8 REMSTICK TECHNIQUES* computers, so there had not been any 9 REM ***************** standardization of the joystick move/ 10 REM JOYSTICK ONE IS SET AT 1 = FI RE. 2 = UP. 3=DOWN. 4=LEFT decode tables. Much joystick software 11 REM JOYSTICK TWO IS SET AT Q =FIRE. A = UP. Z=RIGHT. SPACE=DOWN. / =LEF 12 REM YOU HILL NOTE SOME INTERACTION PROBLEMS WITH BOTH FIREBOTTONS for the OSI is sold by Aardvark Techni­ 13 REM SET TO COLUMN 7 THIS CAN BE FIXED BY SETTING FIRE ON cal Services, 2352 South Commerce, 14 REM .JOYSTICK TWO TO F I RE=! AND MAKING A FEW CHANGES IN FIRE SUBROUT Walled Lake, MI 48088. Aardvark uses 15 DIM K(8) . M<3> , S(S> a slightly different method of connec­ 20 X = 0: U = 0 30 FOR X=1 TO 8 : READ K |X > : NEXT: REM LOADS KEY DECODE TABLE ting joysticks and a different decode. 40 FOR X=1 TO 8 : READ M IX ): NEXT: REM LOADS MOVE TABLE There are advantages and disadvan­ 50 FOR X = 1 TO 8 : READ S IX ) : NEXT: REM LOADS SYMBOL TABLE tages. Aardvark's Mod is longer and re­ 40 A =53480: B =54041: REM TANK ASB START LOCATIONS 70 AA=2: BB=128: N00P=254: FIRE=128: C=57088: SHELL=44: BLANK=32 quires cutting some traces on the 600 71 REM FIRE REALLY EQUALS 127 BUT SETTING TO 128 SAVES AT 1000 & 2110 board. However, they have a lot of good 74 FOR X = 1 TO 3 2 : PR IN T: NEXT software already developed according 75 INPUT"SELECT SPEED <1=FAST 200=SLOW) " ! DELAY to their convention. Fortunately, the 90 FOR X=1 TO 3 2 : PR IN T: NEXT: REM SLOW SCREEN CLEAR 100 POKE 5 3 0 .1 : REM TURN OFF AUTOMATIC KEYBOARD SCAN difference is not great. Joystick 2 in this 110 POKE AiS(4): POKE B.SI8) : REM INITIALIZE TANK LOCATIONS mod has the same decode as joystick 1 120 POKE C .A A : P=PE E K (C ): IF PCNOOP THEN F=2: GOTO 1000 in the Aardvark mod. Therefore, all 130 POKE C fB B : P =PEEK(C ): IF P: SYMBOL=S(X>: X = 8: REM SETS UP FOR MOVE 1025 NEXT X sticks, the following line must appear 1030 IF F = 2 THEN POKE A,BLANK: A=A+MOVE: POKEA. S YMBOL: REM CLASSIC MOV early in the program: 1040 IF F=3 THEN POKE B,BLANK: B=B+MOVE: POKE B,SYMBOL: REM MOVE B POKE 530,1 :REM TURNS OFF KEY­1045 FOR X = 1 TO DELAY: Z = 2: NEXT X 1050 ON F GOTO 1 0 0 0 .1 3 0 . 120: REM LOOPS BACK TO .JOYSTICK DET LINES BOARD SCAN, POKE 530,0 WILL TURN 1990 REM FIRE DECODE SUBROUTINE STARTS ON 2000 KEYBOARD SCAN ON AGAIN 2000 REM FIRE DECODE SUBROUTINE 2005 IF F = 2 THEN SYMBOL=PEEKIA) : L = A: REM GUN NEEDS TO KNOW WAY TANK F Later in the program, when joystick 2010 IF F = 3 THEN SYMBOL=PEEK IB) : L = B: REM WAY TANK B FACES 1 is to be polled, program: 2020 FOR X = 1 TO 8 2030 IF SIX)^SYMBOL THEN W = X: L=L+M (W ): X=8 POKE 57088,128: P = PEEK(57088)2035 NEXT X 2040 FOR U=1 TO 10*RND( X) : REM MOVE SHELL. JUST EFFECTS NO ATTEMPT TO and when joystick 2 is to be polled, 2050 POKE L.SHELL: V=l: POKE L.BLANK: L=L+M(W) 2040 NEXT U program: 2070 FOR U=1 TO 10 POKE 57088,2: P = PEEK(57088) 2080 POKE L.INTI100*RND(X)): REM A LITTLE EXPLOSION AT END OF SHELL FL 2090 NEXT U Table 1 gives all the possible values for 2100 POKE L.BLAN K: REM CLEANS UP LAST OF EXPLOSION 2110 P=P+FIRE variable P. 2120 RETURN A joystick demo program has been included at the end of this article. This demo illustrates most of the techniques line in the FIRE subroutine adds 127 one latch (these are inverting latches] is for animated graphics and their use back to P, taking out the effect of FIRE set it pulls down the line to one of the with joysticks. before turning control over to the rows of keys on the keyboard. If any This program, when running, will MOVE loop. This halves the time of key in that row is pushed, its position display two tank symbols. Each tank the loop and the size of the joystick will be read by the L SI25 bus drivers. symbol will be controlled by one decode table, as only eight values are This is why a PEEK to the keyboard ad­ joystick. A study of listing 1 will illus­ needed for two joysticks. This still dress will return the value of 255 (all trate the programming techniques re­ allows the players to move while firing. ones) when no keys are pushed. When quired by programs using joystick in­ There is one disadvantage with the only one of the LS75 latch stages is puts. It is not necessary to have a joy­ technique used in this joystick mod. energized, then only one row is set for stick decode table with all seventeen of When two players are playing and both decode. the entries given in table 1, since players are moving their joysticks at Pushing a key in any other row will FIRING is merely the position values, the same time, there are combinations not produce any output on the data bus. less 127. Therefore, note that in line 70 where there can be feedback through This is why selecting one joystick to FIRE is set equal to 128 and in line 1000 the joystick switches. With the key­ row 1 and the other to row 7 will allow P is checked to see that it is less than board polling routine that OSI uses, one one joystick to be decoded indepen­ FIRE. If it is, then the program jumps to data line at a time is set on the LS75 dently of the other, even though they the FIRE subroutine at 2000. The last latches, U2 andU3 |see figure 1). When are connected to the same columns.

10 MICRO - The 6502/6809 Journal No. 54 - November 1982 produce an output on the data bus. It is the isolating diode would be a solution. Table 1 connected to the only low latch; all the Another solution is a hearing aid Joystick Value M ovement rest are high. As long as 128 has been battery in series with the joystick's Position of P Value POKEd to the keyboard address, only a isolating diode. Or you could just give Not FIRING Current movement of joystick 1 can be read. If up the option of moving while firing. I and: Position plus joystick 1 is not being moved, then no use a software solution which, while movement of joystick 2 will produce not perfect, has yet to produce any ob- Up 190 - 3 2 Up/Right 158 - 3 1 any output on the data bus. The same jectional performance in any of the Right 222 + 01 thing happens when the computer games I am running. Move the orange Down/Right 206 + 33 wants to read joystick 2; a 2 is POKEd wire on joystick 1 from pin 9 to pin 4 and make the following software Down 238 + 32 to the keyboard address, which allows Down/Left 230 + 31 only the keys in row 7 to be active. No changes: define a new variable in demo program line 70 like FO = 251, and Left 246 - 0 1 other keys will produce any output on rewrite line 1000 as 1000 IF FIRE < P Left/Up 182 - 3 3 the data bus. The only problem occurs when both joysticks are being moved at OR (P AND FO) THEN GOSUB 2000. FIRING and: the same time. The worse case is when This way the FIRE push buttons are No movement 127 + 00 one is moving and firing and the other connected to separate columns and Up 063 - 3 2 is only firing. The low set by the latch can't feed back through each other's Up/Right 031 - 3 1 will feed through the two fire switches switches. Movements are now only Right 095 + 01 and be read as a movement by the bus slightly affected. If one joystick is do­ Down/Right , 079 + 33 driver when only a fire was intended. ing Up/Right and the other is doing Up, Down 111 + 32 This can really destroy a game. Putting then both will do Up/Right. But if one Down/ Left 103 + 31 another isolating diode in any of the is doing Up/Right and the other is Left 119 - 0 1 joystick lines doesn't help, as the doing Up/Left or anything besides pure Left/Up 055 - 3 3 LS125's are too sensitive. They see the Up, then both will move their separate forward voltage drop of the two diodes ways. In an actual game, this fix is When the computer wants to check joy­ in series (one of the diodes D1 through sufficient. stick 1 for movement, a 128 is POKEd D8 with any additional isolating into the keyboard address (polling must diode), which causes the L SI25 to You may contact Mr. Ennis at 212 20 St., be suppressed at this time by the POKE always stay high. No key closures are Niceville, FL 32578. 530,1 having already been executed) detected. A pull-down resistor to a and only a key closure in row 1 will negative supply in conjunction with JMCRO

Stankiewicz & Robinson, authors of MINOS, NIGHT RIDER, etc., OSI proudly present to you: C1P 34 original PRO G RA M S on tape all for the unbelievably low price of $29.95!! That’s less than $1 each!

PINBALL MINOS (MAZE) NIGHT RIDER RIDGE CRUISER ARCADE TYPE STRATEGY ______UTILITIES ______MISCELLANEOUS NIGHT RIDER* TAKE FOUR TAPE VERIFIER MESSAGE ENCODER COSMIC DEBRIS* MIMIC LISTING LINE RE. » TYPING TUTOR MINOS* MANCALA VERSATILE LINE RE. PHONE NUMBER STREET SWEEPERS NEIGHBORS LINE LOCATOR DEHYDRATION RIDGE CRUISER BAR BLACK JACK DRILL CAGE* LIFE FOR TWO* STATISTICS PINBALL (‘ Previously sold OSI GRAND* CHI SQUARE KALEIDOSCOPIC by AARDVARK™ ; MINE FIELD FUNCTION PLOTTER WORM LIVING PATTERNS BETTER RND. » GEN. DEPTH CHARGE KALEIDOSCOPE PROBABILITY #1 GOTCHA! DRAW ME Please add $1.50 postage & handling PA resident please add 6% sales tax All programs will run on 8k ClP. Charge customers include # and Many are compatible for C2/4 expiration date and run in 4k. VICTORY SOFTWARE CORP. 2027-A S.J. RUSSEL CIRCLE ELKINS PARK, PA 19117 Sorry, no phone orders on this special deal

No. 54 - November 1982 MICRO - The 6502/6809 Journal T he 68000 DREAM MACHINE

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

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

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

12 MICRO - The 6502/6809 Journal No. 54 - November 1982 An MC68000 Overview, Part 2

by Joe Jelemensky and Tom Whiteside

This second part of the 68000 The STRCMP subroutine begins tination means to use the pre­ overview provides simple and ends with "M OVEM .L" instruc­ decrement indirect addressing mode programming examples to tions to preserve all the registers that with the stack pointer " h i" . This is are used. The first "MOVEM" (MOVE equivalent to pushing the registers onto illustrate programming Multiple) instruction moves the 32-bit the system stack. The MC68000 techniques and special features contents of "AO" through "A l" and assembler automatically adjusts the of the MC68000. Part 1 appeared "D O" to the stack, which is pointed at number to decrement or increment in MICRO (52:32). by "A7". The assembler syntax for the based on the total size of the operation. register list on a "MOVEM” instruc­ The final "MOVEM" instruction does tion can be in the form "A0/A1/A2/ just the opposite and loads "AO" A3/A4/A5/A6/A7/D0/D1/D2/D3/ through " A l" and "DO" from the A Simple MC68000 Subroutine to D4/D5/D6/D7" or the shortened form stack using the post-increment indirect Compare Two Strings "A0-A7/D0-D7". The "-(A 7)" des­ addressing mode from “h i". This is As a first example of programming the MC68000, consider the string compari­ Figure 1: MC68000 String Compare son subroutine in figure 1. This simple subroutine will return with the Zero ROUTINE: STRCMP — STRing CoMPare flag set if the first string matches the PURPOSE: Compare two strings. If the first string matches the second second. We will use the convention that string then return with the "Z " bit set. The user points AO at all strings must be terminated with a the start of the first string, and Al at the start of the second. zero. Address registers "AO" and " A l” ASSUMPTIONS: will be used as pointers to the begin­ ning of the two strings to be compared. sample string: FCC 'this is a string' The subroutine documentation FCB 00 shows the calling sequence for EXAMPLES: First string Second string Z bit STRCMP. In the subroutine usage doc­ 'cattle’ 'cattle' 1 match umentation, the string pointers are in­ 'cat' 'cattle' 1 match itialized using the "MOVEA" (MOVE " 'any string' 1 match Address) instructions. The ".L ” suffix ‘cattle' 'cat' 0 no match on the MOVEA instructions tells the 'cat' ‘fatcat' 0 no match assembler that a long address is to be USAGE: moved. A ".W ” suffix specifies a sign MOVEA.L FIRST,AO POINT AT FIRST STRING extended 16-bit word address. In the MOVEA.L SECOND,Al POINT AT SECOND STRING MC68000, whenever an instruction has JSR STRCMP COMPARE THE STRINGS two operands, the first operand is the BEQ.S xxxx BRANCH IF MATCH IS FOUND source and the second is the destina­ tion. For the first "MOVEA" instruc­ tion, "FIRST" is the absolute memory STRCMP EQU * address to be used as a source for the * long word to be moved to the destina­ MOVEM.L A0-A1/D0, - (A7) PRESERVE ALL REGISTERS ON THE STACK tion "AO". Naturally, we can use any of the other addressing modes to LOOP EQU * specify the string location instead of ab­ MOVE.B (AO) + ,D0 GET THE NEXT CHARACTER IN THE solute if we choose to. BEQ.S QUIT FIRST STRING. IF AT THE END OF THE After the string pointers are in­ FIRST THEN IT MATCHES! itialized, the user does a "JS R " (Jump to SubRoutine) to the string compare CMP.B D0,(A1) + DOES NEXT CHARACTER IN THE subroutine followed by a branch based BEQ.S LOOP SECOND MATCH? IF IT MATCHES KEEP on the Z flag. The "B E Q .S" is a branch TRYING. OTHERWISE, FALL THROUGH WITH Z BIT = 0. if equal to zero (string match). The ".S" suffix tells the assembler that the QUIT EQU * destination is within the range of an MOVEM.L (A7)+,A0-A1/D0 RESTORE THE REGISTERS 8-bit signed displacement. An ",L " suf­ RTS AND LEAVE. fix is used for 16-bit displacements.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 13 equivalent to pulling the registers off the system stack. Figure 2: Example use of the DBcc (test condition Decrement and Branch) instruction. The actual string compare code is only four instructions long. The "MOVE.B" instruction moves the next PROCEDURE typical; character from the first string to "DO” CONST maxcnt = 10000; and bumps the first string pointer to VAR i,cat,rat:integer; BEGIN the next character. If we have reached i: = maxcnt; the end of the first string then, by our REPEAT convention that all strings end in zero, the Zero flag will be set and the short branch will be taken. (We found a match!) Otherwise, the "CMP.B" in­ i: = i - 1; struction checks to see if the lower byte UNTIL (i < 0) OR (cat = rat); in the data register matches the next END; { typical } character in the second string and bumps the pointer to the next charac­ MOVE #MAXCNT - 1 ,D0 INITIALIZE LOOP COUNTER LOOP EQU * ter. If the characters match, the routine loops back to "LO O P" and tries the next character. If they do not match (including the case where we reach the MOVE.W CAT,D1 GET CURRENT VALUE OF "CAT" end of the second string) the code falls CMP.W RAT,D1 SEE IF "C A T ” IS EQUAL TO "R A T” through with the Zero flag cleared. DBEQ.S DO,LOOP DECREMENT "1” AND LOOP UNTIL "I” = * - 1 OR "CAT" EQUALS "RAT"

MC68000 Code for a Pascal Loop The next example illustrates use of the MC68000's powerful DBcc looping instruction. DBcc is designed to speed Figure 3: Example Pascal Procedure Call up the "FO R ” , "WHILE” , and "R E­ PEAT UNTIL” loops used so frequently in high-level languages (HLL). The PROCEDURE dojunk(VAR a,b:INTEGER; c,d:INTEGER); DBcc instruction has three parameters: VAR i,j,k:IN TEGER; BEGIN a terminating condition, a data register, and a branch displacement. The in­ struction first sees if the terminating condition has been met, and if so, the END; branch specified by the branch offset is not taken. If the terminating condition * * SET UP FOR PROCEDURE CALL is not met, the specified data register is * decremented. If the result of this decre­ INIT POINTERS TO VARIABLE PARAMETERS ment is not - 1 then the branch is * taken. Otherwise, the branch falls PEA A PUSH POINTER TO VARIABLE "A" through. The "cc" part of the instruc­ PEA B PUSH POINTER TO VARIABLE "B " tion can be any of the conditions shown * in table 6 (see Part 1, MICRO 52:38). MAKE COPY OF VALUE PARAMETERS ON THE STACK The following Pascal procedure and * accompanying MC68000 code frag­ MOVE.W C,-(A7] PUSH COPY OF 11C" MOVE.W D, - (A7) PUSH COPY OF " D ” ment illustrate how the DBcc instruc­ * tion works (figure 2). The "REPEAT * CALL PROCEDURE UNTIL” loop will continue until "i" * has counted down to - 1 or "C A T ” JSR DOJUNK CALL THE PROCEDURE equals "RAT". The MC68000 code * uses "DO" for "i" and uses "DBEQ" * CLEAN UP STACK AFTER PROCEDURE AND RESTORE REGISTERS to loop until "DO" = - 1 or the * previous comparison sets the Z flag. ADDQ #6,A7 REMOVE PARAMETER LIST FROM STACK The DBcc instruction takes no more time than a simple branch instruction when the branch is taken. The equi­ valent code without the DBcc instruc­ DOJUNK EQU * tion is obviously much longer. LINK A 0,#- 3 MAKE ROOM ON STACK FOR LOCAL VARIABLES High-Level Language Procedure Calls It is becoming increasingly impor­ UNLK A0 CLEAR OFF STACK AND RESTORE A0 tant for processors to be able to handle BEFORE LEAVING subroutines efficiently as programs be­ RTS come more modular. This is true both

14 MICRO - The 6502/6809 Journal No. 54 - November 1982 at the assembly-language level and for implementing modem HLLs. Figure 3 shows a typical Pascal procedure and Figure 4: Stack Usage for Pascal Procedure Call Example how the procedure call might be im­ plemented in MC68000 code. ~ A + [31. .167 Procedure ‘'dojunk” is a typical A + [15..00] Pascal procedure with variable para­ VARIABLE PARAMETER POINTERS B f [31..16] meters " a '1 and " b ” and value para­ meters “c" and "d'\ For those un­ Bf[15..00] familiar with Pascal, a value parameter C [1 5 ..0 0 f is a copy of a variable passed to a pro­ . VALUE PARAMETERS cedure. This copy can be modified by D[15..00] the procedure but the changes are not RTN LINK [31. .16] passed back to the calling procedure RTN LINK [15..00] when the procedure exits. Variable parameters, unlike value parameters A0[31..16] OLD POINTER TO LOCAL VARIABLES are passed back to the calling procedure AO A0[15..00[ OLD as pointers to the variables. Value parameters are copies of the variables. I[ 15. .00]" The MC68000 code for calling pro­ I[15..00[ ■ LOCAL VARIABLE STORAGE cedure dojunk begins by initializing the A7 K[15..00[ stack with the procedure parameters. The two "PEA” instructions push the pointers to variables “A” and ” B ” . The two "MOVE” instructions push copies called, the LINK instruction provides a local variables are referenced with of variables " C ” and "D" on the stack. clean way to make room for local vari­ negative offsets off "A0" and The procedure is then called with the ables ("i”, "j", "k "). The LINK in­ parameters are referenced with positive JSR instruction: When the procedure struction pushes the old value of “AO” offsets. This technique of using the returns to the calling routine, the space on the stack, sets "A0” equal to the stack supports re-entrant code and made on the stack for the parameters is stack pointer, and subtracts the offset recursion with no problems. Before do­ removed with the ADDQ instruction. (in this case three words) from the junk exits, it uses UNLK to clear off the When procedure dojunk (figure 4] is stack pointer. With this technique, local variable space it used.

* * SeaFORTH for the Apple computer * * Is a consistent structured operating system providing the * * advanced program m er with the tool to easily develop * RIM + POWER * programs from machine language to high level compiled * * applications. W ith SeaFORTH, the edit-compile-execute* * from * edit cycle is measured in seconds, not minutes. * * The integrated SeaFO R TH package includes: * COMPUTECH * • Editor * • Disc I/O * * • Assembler * Check the * • Hi-res Graphics All prices * * outstanding • Transcendental Floating Point * postpaid * • Comm and Line Input with Editing * (Continental documenta­ * • Detailed 150 Page Technical Manual with * U .S.- tion supplied + Complete Source Usting/ * otherwise with AIM65! Implemented as a true incremental compiler, SeaFORTH * * * s2 credit) * generates , not interpreted address lists. * * SeaFORTH’s direct-threaded-subroutine implementation * Top quality power supply designed to Rockwell’s specs for fully * executes faster than interpreted address-list versions. * populated AIM65 — includes overvoltage protection, transient sup­ * Apple SeaFORTH requires a 48K Apple ][ + , with DOS * pression, metal case and power cable: * 3.3. Manual and copyable disk are available for only * PSSBC-A (5V 2A Reg; 24V ,5A Avg, 2.5A Peak, Unreg) .... ■64.95 * $100.00 * * Same but an extra AMP at 5 volts to drive your extra boards: Compatible SeaFORTH for the A1M requires a terminal * PSSBC-3 (5V 3A Reg; 24V ,5A Avg, 2.5A Peak, Unreg) .... 74.95 * * and is only available in EPROMs. Manual and EPROMs The professional’s choice in microcomputers: * * * 51 5 0 .0 0 * AIM65/1K RAM ...... *429.95 BASIC (2 ROMS) ...... *59.95 * Manuals available, separately, fo r only $30.00 * AIM65/4K RAM ...... ‘464.95 ASSEMBLER (1 ROM )...... *32.95 * All prices include UPS shipping. * FORTH (2 ROMS)...... *59.95. * VISA or MASTER CHARGE welcome. * SAVE EVEN MORE ON COMBINATIONS * (Dealer inquiries Welcome) AIM65/1K + PSSBC-A ... *479.95 AIM65/4K+PSSBC-3 ...*524.95 * * We gladly quote on all AIM65/40 and RM65 items as well. * TAU LAMBDA P.O. Box 808, Poulsbo, Washington 98370 ORDERS: (714) 369-1084 * * * (206) 598-4863 P.O. Box 20054 • Riverside, CA 92516 * California residents add 6% sales tax Apple |( + and AIM are registered trademarks of * * Apple Computer and Rockwell * ★★★★★★★★★★★★★★★★★★

No. 54 - November 1982 MICRO - The 6502/6809 Journal 15 Range Checking Using the MC68000 Figure 5: Array Storage on the Stack for the Range Checking Example The MC68000 "CHK” instruction provides an efficient mechanism to in­ { sample variable declaration } sure that array bounds are not exceeded Vari,j : integer; stuff before data array in high-level language implementa­ data : array[0..MAX] of integer; tions. As an example of range checking misc. : integer; { stuff after data array with CHK, consider the problem of en­ forcing array boundary checking in a simple Pascal program. Figure 5 shows the stack usage for a simple variable _A0[31..16] OLD declaration using the same scheme AO A0[15..00j OLD described in the "Procedure Call” ex­ ample. The individual elements of the Displacement to "data” array array "data” will be accessed by index­ ing off the pointer "AO” . The range data[0] checking's duty is to insure that we do not attempt to access an element of data|l] "data” before its true beginning or after Space for "data" array element "MAX". The consequences of exceeding the array bounds range from inadvertently modifying another vari­ able (such as " i " , or "m isc” ) to stepping on a subroutine return link! Figure 6 shows a simple Pascal state­ data[MAX] ment to clear the "ith” element of misc. "data” and the M C68000 code to ac­ complish it with the necessary range Stack area beyond the "data” array check. The code assumes that register "DO” contains the current state of " i” . The CHK instruction examines the lower word in the specified register ("DO") and generates an error trap if it Figure 6: Example of Range Checking Using the MC68000 is less than 0 or greater than "MAX” . Otherwise, the code falls through to { Pascal statement to clear the "ith” element of "data” the MOVE instruction that clears the data[i): =0; { note: i < 0 or i > MAX is a range error!!! "ith” element of "data”.

Conclusion MC68000 CODE TO EXECUTE THE ABOVE STATEMENT We hope this article has given you some insight into the extensive power ASSUME DO CONTAINS THE CURRENT CONTENTS OF ”i” of the MC68000. The 16-bit data bus, the 16 megabytes of directly address­ GENERATE A TRAP IF " i " < 0 OR IF " i ” > MAX able memory, the sixteen 32-bit user- accessible registers, the powerful in­ CHK #MAX,D0 struction set, numerous addressing modes, and fast execution speed are HERE IF NO RANGE ERROR OCCURRED enough to really get folks excited. MOVE.W #0,DISP|A0,D0) CLEAR THE "iTH " ELEMENT OF DATA

Future Growth The MC68000 is not the only member of this powerful microproces­ sor family. Motorola is taking advan­ MC68000 architecture. and several data communication parts. tage of its modular, microprogrammed A full 32-bit implementation (32-bit Because of this commitment to the structure to develop other processors address and data buses) of the architec­ continuation and enhancement of the which are upward and downward com­ ture with an enhanced instruction set MC68000 family, systems and soft­ patible to the MC68000. and on-board cache is in design. The ware for the MC68000 are insured a The M C68008 is a machine and part will be designated the MC68020 long useful life. assembly level-compatible version of and will contain all of the additional features of the MC68010. the M C68000 with an 8-bit data and References 20-bit address bus for low-cost systems A full complement of peripherals that need the performance of the for the MC68000 family have been in­ 1. "16-Bit Microprocessor User's MC68000 and can tolerate a slight troduced or are in development. These Manual,” Motorola Inc., 1982. decrease in throughput for reduced include a Direct Memory Access con­ 2. "Motorola Resident Structured system costs. troller (MC68440), a Memory Manage­ Assembler Manual,” Motorola Inc., With the MC68010, Motorola adds ment Unit (MC68451), a Floating Point virtual machine capabilities to the Arithmetic Co-processor (MC68881),

16 MICRO - The 6502/6809 Journal No. 54 - November 1982 FOUR TO GROW

Four software packages, that is, to HELLO CENTRAL! changes your PEN PAL gives you the power and make your Apple® computer really Apple II® or Apple II Plus® into a versatility of higher-priced word grow! Versatility is the key to com­ highly versatile communications processors in an easy-to-use format. puting success, and with Advanced center. With only 29 commands, you can Operating Systems, it's as easy as quickly and easily create lengthy Establish direct communications one, two, three. reports or short memos. PEN PAL with other computers of any make gives you 40- and 80- column screen­ is a collection of 12 APPLE-AIDS or tap into the wealth of informa­ ing, joystick control of the cursor for Applesoft and machine language tion available from the hundreds of quick editing, complete printer con­ programs designed to bring you public-base services like THE trol, plus both upper and lower case greater flexibility and control over SOURCE. capabilities. PEN PAL is the afforda­ your . HELLO CENTRAL!'s most unique fea­ ble solution to your word process­ In addition to several programs ture is its text buffer. Messages or ing needs. #25115, $59.95 which allow you to examine and entire files can be uploaded and Advanced Operating Systems has change various track/sector con­ downloaded into the text buffer four good ways to make you and tents, format new disks, and create which holds up to 18,000characters. your Apple grow and grow! and edit EXEC files, APPLE-AIDS in­ The buffer text can be scanned, cludes two programs you can't af­ changed, and then saved to disk. Now available at your local ford to be without. UNDELETE FILES software retailer, or call 1-800-428- The best thing about HELLO CEN­ allows you to recover accidentally 3696 to order. (Indiana residents, TRAL! is that you don't have to be a deleted files which you thought call (317) 298-5566.) MasterCard professional to get professional re­ were lost forever. KILL DOS removes and VISA accepted. DOS from any disk freeing up more sults. A few simple keystrokes will accomplish any of your text/com­ space for your programs or data. munications tasks. #26081, $99.00ADVANCED Russ Adams, a reviewer for INFO- skillfully combines WORLD, writes, "Its (APPLE-AIDS) MUSIC GAMES the sound and high resolution OPERATING documentation is the finest I have graphics of the popular Apple com­ seen since joining the INFOWORLD SYSTEMS puter to provide both visual and Software Review Board." Ease of 4300 West 62nd Street audible reinforcement to the study use and extensive documentation P.O. Box 7092 make APPLE-AIDS a valuable addi­ of music. Twelve different pro­ Indianapolis, IN 46206 tion to every Apple software library. grams, selected from a menu, cover #26066, $49.95 ear training, note recognition and A Division of writing, rhythm practice, and listen­ Howard W. Sams & Co., Inc. ing enjoyment. These versatile Apple, Apple II and Apple II Plus are registered games are w ritte n for ages 5 trademarks of Apple Computers, Inc. through adults. #26116, $39.95 AARDVARK - THE ADVENTURE PLACE ADVENTURES FOR OSI, TRS-80, TRS-80 COLOR, SINCLAIR, PET, VIC-20

ADVENTURES — Adventures are a unique D E R E L IC T by Rodger Olsen and Bob Ander­ P Y R A M ID by Rodger Olsen — This is one of form of computer game. They let you spend son — For Wealth and Glory, you have to ran­ our toughest Adventures. Average time 30 to 70 hours exploring and conquering a sack a thousand year old space ship. You'll through the Pyramid is 50 to 70 hours. The w orld 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. operate the machinery they left behind. The are for creative thinking, courage, and wise 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 computer 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 of 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 problem in writing the adventure was to keep far away as New Zealand and France from who do not like computers. it logical and realistic. There are no irrational bleary eyed people who are stuck in the Except for Quest, itself unique among Ad­ Pyramid and desperate for more clues. venture games, Adventures are non-graphic. traps and sudden senseless deaths in D erelict. Adventures are more like a novel than a comic This ship was designed to be perfectly safe for Q U EST 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 All of the Adventures in this ad are in Basic. Alesia. You lead a small band of 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 time. 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­ iar one — The ship is in a "decaying orbit” MARS by Rodger Olsen — Your ship crashed on the Red Planet and you have to get home. (the Captain never could learn to park!) and You will have to explore a Martian city, repai r the engines are out (You would think 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 —playingtime 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, o r get o u t o f her save it before it plunges in to 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 of Circle World, the author plotted by Rodger Olsen, Bob Retelle, and wrote a very large adventure. It has a lot 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/DEATH SHIP 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 ab out 14 pages o f 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 textof Deathship. designed for the 8 to 13 year old. This is a quake. There is a way out, but you need help. Data sheet - $3.95. NOTE: Owners of OSI, real adventure and does require some thinking To save yourself, you have to be a hero and TRS-80, TRS-80 Color, and Vic 20 computers and problem solving — but only for kids. save others firs t. can also get Deathship on tape for an addi­ Authors note to players —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 computer com­ plays nicely. Instead of 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 E arthquake and H aunted House w hich 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 TR S -80 Color and O SI), business programs, blank tapes and disks and hardware. Send $ 1 .0 0 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

18 MICRO - The 6502/6809 Journal No. 54 - November 1982 A Monitor for the Color Computer

by Ralph Tenny

This article provides step-by- over a year, and I still feel comfortable limited, therefore the signal must also step instructions to get with my decision. be limited. Even if the tuner is by­ composite video from the video The Color Computer's video output passed, the TV's display resolution is is a complete TV signal and is gener­ reduced as a cost-saving measure, since section of the Color Computer. ated by a very low-power TV trans­ high resolution is not required for nor­ You will use this signal to drive mitter mounted within the Color Com­ mal TV viewing. a standard video monitor puter. Part of the display problem is the The Color Computer uses an instead of a color or black-and- fact that the TV tuner is deliberately M C6847 Video Display Generator to white TV set. produce all the signals required to drive 10 MAW TAPTST a TV set; these include composite sync, blanking, video luminance, and color Required: 15 QPT S® information. The basic approach is to use a buffer amplifier to process the TRS-80 Color Computer 20 BRG $7000 output of the MC6847, enabling the A monitor-quality CRT signal to be fed directly to a video 25 * THIS PROGRAM WRITES ft FATTE monitor. Figure 1 shows the schematic Rjt TEJ CASSETTE TAPE. THEN BILL 0 of this buffer amplifier; it was patterned The Radio Shack Color Computer, an ECDBE THE PATTERN after circuitry suggested by Motorola, excellent low-cost computer, uses a the manufacturer of the 6847. This ♦ CHECK I US FDR TAPE ERRORS flit color TV set as the intended display m to STffPPIftG bn errors. amplifier was built on thin, two-sided, device. Unfortunately, TV sets have copper-clad board with one side etched relatively low resolution, which limits (35 ♦ THE WRITE FUNCTION IS AH EM into small pads. Figure 2 is a full-size the clarity of the display. The use of a (©LESS LQEJPj ANB HOST BE STBPPEB layout of the amplifier board, and figure TV set can be either good or bad, de­ IlSIKS RESET.! 3 shows the parts layout. pending on whether color graphics are Access to the Color Computer is used in your program. Since I use it as a Photo 1: A close-up look at a Color easy and requires only that you take text processing system, I need a video Computer display on a video monitor. out seven screws to remove the top. terminal with maximum display clari­ Note that each pixel is a sharply- Note that one screw is located beneath ty. Even the relatively low character defined square. a factory seal. If you remove this screw density of the Color Computer's video output isn't very clear on the average TV set — either color or B&W. The + 5V signal itself is of high technical quality, and a higher-resolution display can make a great improvement in the read­ ability of the display. If a B&W monitor is substituted for the TV set, this goal is achieved. As you can see from photo 1, my video monitor (which is not a super-high resolution unit| gives an ex­ cellent display capability when used with the Color Computer. Since the remainder of the article describes a process of modifying the Color Computer, you should realize that any internal modifications will probably void the warranty. If the com­ puter is more than three months old, the warranty will have expired. If you modify the computer and it needs repair, you may have to remove the Figure 1: Schematic for the video buffer amplifier, which mounts internal to the modification before Radio Shack will computer. It amplifies the video output of the 6847 and turns it into a low- repair it. I have not had any problems in impedence signal suitable for driving a cable to the external monitor.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 19 Figure 2: Full-size layout of the amplifier board. Make the board by etching the lines shown to divide the board into eight segments as shown.

you will deface the seal, which voids your warranty. Once you loosen the screws, put a piece of tape over each hole so the screws will not fall out when you turn the computer upright. With the screws loosened, the top will lift off, leaving the keyboard resting on standoffs and Photo 2: Interior view of the area where the amplifier will be mounted. The long 1C is revealing the inner RF shield. the MC6847, which will be covered by the buffer amplifier as shown In photo 3. Note that the top of the shield is a friction fit to the shield sides via numerous spring-loaded fingers. Work the shield top off by lifting it a little bit all around; keep lifting until it lifts straight off. Once you can see inside, find the MC6847 and M C1372 ICs as shown in photo 2. Also, in photo 2, you will note a solid ground wire curving up over the 6847, plus a heavy wire com­ ing from one side of C26 and smaller wire coming off the circuit board be­ tween C42 and the 1372. The solid wire is circuit common, the large wire is + 5 volts, and the small wire is the signal input to the buffer board. Photo 3 shows the video buffer installed, resting on the 6847. The large wire has been soldered to the + 5 volt input of the buffer board, the ground wire to the amplifier common, and the small wire to the amplifier input. A small 183-ohm cable has its shield soldered to the amplifier common and the center conductor to the amplifier out­ Photo 3: A view of the buffer amplifier mounted, with the output cable attached. put. The other end of the 183-ohm cable runs across to the corner of the RF shield (the top left corner of the shield as seen from the front of the computer].

Parts List for Video Buffer Amplifier Circuit

C3 68 pF dipped mylar capacitor R1 33K ohm, (4-watt resistor R2 62K ohm, 14-watt carbon resistor R3 5.IK ohm, !4-watt carbon resistor R4, R5, R6 51 ohm, '4-watt carbon Photo 4: Oscillogram of the output video Photo 5: An oscillogram of three lines of resistor showing one video frame. horizontal video. Ql, Q2 2N2222 NPN transistors

20 MICRO - The 6502/6809 Journal No. 54 - November 1982 COMMON OHIO SCIENTIFIC THE WIZARD’S CITY — search for gold in the dun­ geons beneath the Wizard’s city or in the surrounding forest. A dynamic adventure allowing progress in strength and experience. All OSI — cassette $12.95, disk $15.95. OSI HARDWARE 15% OFF RETAIL PRICES! GALACTIC EMPIRE - a strat­ egy game of interstellar con­ quest and negotiation. Com­ pete to discover, conquer, and rule an empire with the com­ puter or 1-2 other players. C4P, C8P cassette $12.95, disk $15 95 Figure 3: Parts layout for the amplifier board. Each part is soldered Into place in AIR TRAFFIC ADVENTURE - the approximate location sketched. a real time air traffic simula­ tion. C4P, C8P disks $15.95. Plus S-FORTH, PACKMAN, Once the amplifier is in place, turn on to obtain a good picture. Once the CRAZY BOMBER, ADVEN­ the computer and check the video out­ monitor is working, re-install the com­ TURE, TOUCH TYPING, IN­ put from the cable. Photo 4 shows one puter cover and enjoy your computer's TELLIGENT TERMINAL and vertical frame of video, and photo 5 new display. more. Send for our free shows three horizontal lines of video. If catalog including photos and your amplifier does not have similar complete descriptions. output, double-check the circuit and (312) 259-3150 adjust C2 until the response is correct. You may contact the author at P.O. Box Aurora Software Associates After testing the amplifier, send its 545, Richardson, Texas 75080. 37 S. Mitchell output into a video monitor and make H JMCftO Arlington Heights whatever level adjustments are needed Illinois 60005

Mfe carry close to $5,000GOO inventory at all BMC 12" O lym pic SAL6S co ______timet. Corp. accti. invited. TI-5010 Texas Instrum ents Good subject to availability; this ad supercedes Green Telex: 67 34 77 Toll-Free Phone Orders: all previous ads; fob our warehouse; prices sub • Handheld Calculator Hom e Com puter Toll-free an c a > 800-252-2153 800-421-8045 (out of CA) ject to change without notice; not responsible Monitor Plain paper printer Order Oesks open days a week! 7:00 AM to 6:00 PM Mon-Sat tor typographical errors; all orders subject to 8 verification; minimum shpg A hndlg SS.9S. Model BM-12A P.O. Sox 74545 216 So. Oxford Ave. Los Angeles, CA 90004 Send $2 (or S5 foreign) ‘or our famous catalog. $39.95 TI-99/4A Phone: (213) 739-1130 Cable: "01Y R A V " LSA $AQ95 PRICE N ow HEWLETT TP-I BREAK-THROUGH! m PACKARD LCD TEXT PRINTER Cordless Telephone Only ft£:S995.oo Daisy KP-6100 HP-16C Computer Scientist- for Programmers & Digital $0095 AFTER MFCS Designers 127.50 WE ARE AUTHORIZED *669” S t RE BA TE—you pay FULL LINE HP Dealers. S19995 HP-10C Smith-Corona K E Y P H 0 N E OSC $299.95, Tl rebates you $100. Your Cost Range of 700 feet Plus FREE $50 RF Modulator Up to 79 YOUR COST: o l i v e l k l Trimline styling lines of $429.95 Last number redial with purchase of TI-99/4A program V K # I U n $395.00 “PRAXIS 35" Instint on/off VICTOR 5080 80 Column Printer ELECTRONIC TYPEWRITER Automatic Call & ask about FREE Speech storage security lock R E :$80.00 A real work horse! 100 cps, graphics, Interchangeable 'Daisy Built-in charger Synthisizer OFFER! $80.00 buffer, 4 interfaces including HP-IB Wheel' type element, Model 61000 with automatic dialing 10" color monitor high res 339.95 Your Cost: Retail: $995.00 Wholesale:$670.00 3 sizes-Pica, Elite 81 Micro 10 memories Y/C :$119.95 32K memory module 314.95 $69.95 Fully guaranteed by Victor, in business plus cartridge ribbon 81 more! Extended Basic 75.00 since 1 9 1 8 Retail: S750.00 LEX-21 Speech synthesizer 129.95 ATARI®COMPUTERS Portable Disk memory drive 394.95 $995 Telephone coupler (modem) 189.95 ATARI 800-16K 647JS Terminal 8’/," X 11" X 2!4" Printer (solid state) 319.95 ATARI 800-48K (Axlon 32K chip) 779.95 Atari 810 Disk Drive 459.95 LEXICON Tl LOGO 99.95 Atari Interface Module 177.95 Tl EXPANSION BOX SYSTEM Atari Educator Kit 117.95 SHARP PHP 1200 Expansion Box 209.95 0KIDATA PRINTERS PHP 1220 RS232 136.00 82A Bi-directional 444.95 ATARI 400-16K HAND-HELD PHP 1240 Disk Controller 194.00 83A 8i-dir;serial/parallei 694.95 COMPUTERS PHP 1250 Disk Drive 299.00 84 Parallel, 200 CPS 1144.95 PHP 1260 32K Mem. expansion 234.00 $199.95* PC 1500 Pocket Computer 2 1 3 .9 5 84 Serial, 200 CPS 1274.95 PHP 1270 Pascal Card 194.00 * You pay OSC $259.95 81 receive a coupon CE 150 Color graphic printer w/cass. interface 1 7 3 .9 5 worth up to $60 in rebates from Atari on EXTEND-A-PHONE the purchase of add'! software or 4K Expansion module 5 3 .9 5 Programmable TI-59 EX-4000 Cordless Speaker Phone accessories for the Atari 400. 8 K Expansion module 1 0 3 .9 5 Your Cost:$169.95 plus— Re:$229.95 Y/C:SI 63.95 $20.00 rebate from Tl plus Free Library c o m m o d o r e S A N Y O MONITORS Tl LCD Programmer 59.95 High resolution, number one seder! Your WE ARE AUTHORIZED FULL Retail Cost LINE Tl DEALERS VIC-20 190.00 159.95 V M 4 5 0 9 9 " B & W FREE RF Modulator V M 4 2 1 5 15” B & W (helow our cost) 349.00 189.95 with purchese o f VIC-20 D M 5 1 0 9 9 ” G reen 200.00 169.95 APPLE COMPUTER Works with any TV! Your Cost: D M 8 0 1 2 12" B&W 250.00199.95 48K Plus 1069.95 $197.95 260.00 209.95 5K Personal Computer R e t a i l : $ 3 0 0 . 0 0 D M 8 1 1 2 1 2 " G reen Disk dr w/controller 494.95 (Expands to 32K) Model 1540 Single S'/Z'Drive 334.95 0 M C 6 0 1 3 13" Coior, hi quality 470.00 399.95 995.00 799.95 Disk dr - no controller 419.95 Model 1515 Graphics Printer 329.95 O M C 6 1 1 3 13” Color RGB hi res We are authorized FULL- D M 2 0 1 2 (N E W ) 1 2 ” B & W 179.00 139.95 Apple 2 System package 1695.00 Model 1530 Datasette Recorder 59.95 LINE Commodore dealers. D M 2 1 1 2 (NEW) 12" Green 199.00159.95

No. 54 - November 1982 MICRO - The 6502/6809 Journal 21 FOR COMPLETE GRAPHICS:

UersaUJriterEDUCATION ARTIST GAME PROGRAMMER

Whether you are a teacher, an artist, an doesn’t just trace engineer, a a picture though. With programmer, or a simple one key com­ hobbiest with little or no mands you can add programming experience, color and text to your pic­ the VersaWriter is the ! tures, move objects across answer to your graphics I the screen, make scale need. With the VersaWriter drawings and even draw exploring the world of micro with different size brushes. is as easy' The VersaWriter is as limitless as tracing. The VersaWriter as your imagination.

For com p lete graphics on your Apple II/II+, or IBM PC, the Versa Writer from Versa Computing, Inc. is your answer. Complete hardware/software system ready for use - $299.

Send for information Dealer on the complete line V Inquiries of VE^aWiHE & Graphics Welcome Products VE3M coiiipuiinc. inc. 3541 Old Conejo Road, Suite 104 • Newbury Park, CA 91320 • (805)498-1956

MICRO - The 6502/6809 Journal No. 54 - November 1982 FLEX and the TRS-80 Color Computer

by Ronald W. Anderson

Here is a brief description of the system you have 40 tracks and double­ 9. Holding three keys down and typing FLEX09 operating system as sided drives, for example. Your drives a fourth is not easy, but it's better than implemented on the TRS-80 need not all be alike. You may specify not being able to generate the code for Color Computer. drive 0 as being single-sided and having those characters. 35 tracks, and drive 1 as being double­ Sometimes disk drives run slightly The configuration described here is sided and having 40 tracks. Although fast, or irregularly, and squeezing the available from Frank Hogg Laboratories this might seem like a nuisance, you sectors close enough to get 18 on a (130 Midtown Plaza, Syracuse, NY only need to run the utility program track results in unreliable disk access. 13210] with 64K or RAM installed once. This generates a command file There is a NEWDISK utility that will ($1275), as well as an assortment of that is appended to FLEX containing in­ automatically reduce the number of disk drive packages. If you already have formation on your drives, the terminal, sectors to 17 if it encounters problems. a TRS-80, then Frank Hogg Labora­ and drivers for your printer. Another NEWDISKA utility will put 18 tories sells the operating system and I did a bit of experimenting with the sectors on closer together. I have had modification instructions separately SETUP command that does all the con­ no trouble using NEWDISKA. A sector ($99). While it is possible to run the figuring, and discovered I could specify in the FLEX system is 256 bytes long, FLEX operating system with one disk "reverse video," which is really "nor­ but four bytes are used for system pur­ drive, two are recommended. You may mal video’ ’ to anyone who has worked poses, so a sector actually holds 252 choose from a minimum package of in front of a terminal for any time. I bytes of data. A single-sided, 35-track one single-sided, double-density, find a blinking cursor to be distracting, disk will hold 612 sectors (using 35-track drive, or up to three double­ so I made it a plain block cursor. Now NEWDISKA). If your drive has 40-track sided, double-density, 40-track drives. my system will power up just the way I capability, you will get 702. A double­ The latter will hold up to 375K of data want it. sided 40-track will result in 1404. If on each drive. You may also use one of Another feature is the keyboard's these numbers don't seem to add up the 80-track, double-density drives and ability to provide all the ASCII codes. correctly, it is because FLEX uses the have over 700K bytes on one disk, The control codes, such as Control C, first track (track 0) for a loader, disk although the 80-track version is not are generated by holding the shift and system information record, and file compatible with Radio Shack's disk up arrow simultaneously (equivalent of directory sectors. Also, FLEX requires operating system. the control key on a terminal), and that track 0 always be single density. FLEX is the standard operating then pressing the desired key, C for ex­ Therefore, the tracks actually available system for 6800 and 6809 systems. ample. If you ever program in Pascal to the user are one less than the total FLEX is so universal that there are ver­ and/or "C ", you will need several number on the disk. sions that will run on the Motorola Ex- characters that are not included on the Once FLEX is running, make orciser. FLEX is a "Unix-like” Color Computer keyboard. another copy of the system disk. Use operating system and has a nice set of Without going into detail, I will NEWDISK or NEWDISKA to format a calls that do all the work to interface give an example of the key assignments blank disk, and then use a utility called your assembler program to the disk and how to access them. You may PUTBOOT.LDR to install the loader drivers. There are literally 100 utility remember that upper case (SHIFT) 8 is on the disk. The loader is readable by programs available for FLEX. a left parenthesis " ( " , and SHIFT 9 is a the Color Computer disk operating The manual that comes with the right parenthesis ")". Use the CON­ system. It loads a short program that operating system is basically the FLEX TROL combination (SHIFT A ) and loads and executes a longer loader pro­ operating system manual with addi­ type 8 and you get a left square bracket gram that loads all of the FLEX tional pages that apply to the Color " [ " . SHIFT A 9 and you get a right operating system. It sounds com­ Computer. There is a well-written sec­ square bracket "]". "C " requires the plicated but only takes a few seconds to tion on getting your system up and run­ use of curly braces. SHIFT A BREAK 8 execute. You must put the boot loader ning. First you configure the software will cause a left brace "{" to be on your disk first. If you have copied to match your hardware. The system generated, and the same combination any files onto the newly formatted boots up expecting 35-track, single­ for a 9 will generate a right curly brace disk, there is a chance that the system sided drives. To access more tracks or The control and shift keys are may have allocated you space where double-sided drives, you must run a depressed first, and are all held the boot loader needs to be. PUTBOOT utility program that will tell the simultaneously before keying the 8 or will inform you that you can only in-

No. 54 - November 1982 MICRO - The 6502/6809 Journal 23 stall the loader on a newly formatted be performed with a single disk drive disk, and quit. also. After installing the loader, you may The HELP utility and file help you PROFESSIONAL copy everything from the system disk find or remember FLEX commands If, to your new system disk except the for example, you type HELP,NEWDISK WORD PROCESSOR loader installation utility PUT- you will get a brief description of what • Double Column^, - Pjqe by Paraqraph BOOT.LDR. An attempt to copy it will Riqht Justification > Line Centering the NEWDISK utility does, and a > Printer Graphics ' Shorthand get you a DISK SPACE FULL error and a reference to a page in the manual. > Variable Lino Space ' Margin Control lot of garbage on your disk. If you try to If you have a serial printer, you will • Printer Control Code • Form Letters GET PUTBOOT.LDR (for those of you have no trouble configuring the system FOR APPLE/PET/CBM not familiar with FLEX, GET is a utility so you can use it effectively. A parallel COPY-WRITER p that reads a disk file to memory but printer will require a serial adaptor of only S1 85.00 doesn't execute it), you will find that it some sort. Epson provides one for their tries to execute, finds that you haven't printers, and Computerware of En­ EXCHANGE DATA w IBM 3740 specified a drive number, and erases cinitas, CA, offers one for about $60. PEDISK II 877 FLOPPY DISK Sys- itself from memory before returning to Of course you can run Radio Shack Jff tfjris can now read and write records FLEX. Unless you enjoy "puzzles” and Extended Disk BASIC, which comes in / ; from IBM "Basic Data Exchange” are quite familiar with FLEX and the for­ ' type diskettes. FILEX software from the Color Computer in ROM. The RS WfLSERVE does all the work! Con- mat of binary files, you will have to use disk operating system is well thought - verts EBCDIC - ASCII. your master disk to make all further out. Both Random Access and Sequen­ EXCHJliflfc'Sy3lem (877/FILEX) ...... $1295. system disks. PEDISK 877-1 8’ Floppy for PET ...... $ 995. tial files are implemented. Since the PEDISK 540*1 5’ Floppy for PET...... $ 595. Having copied all the supplied files Color Computer comes up running the CONTROLLER BOARD w PDOS...... $ 229. to your system disk, you must run one PEDISK II is a high performance floppy disk BASIC from ROM, you might wonder system designed for the Commodore PET/CBM, further utility, called LINK. LINK will where the operating system is. Actually, Rockwell AIM and Synertek SYM. It features high tell the boot loader just where on the it is part of BASIC. While running performance, simple reliable design and IBM for­ disk the file FLEX.SYS is located. My mat. BASIC you may DIR a disk (prints the advice is to make two system disks, and SOFTWARE FOR PEDISK II directory of a RS disk). You may copy COPYWRITER Pro Word Processor...... $185. hide the master and one of them in a or back up a disk, load and save pro­ MAE Macro Assembler Editor by EHS...... $170. safe place where they won't get hot, grams (either BASIC or machine lan­ FLEXFILE II Data Base Manager ...... $ 80. PAPERMATE Word Processor...... $ 60. bent, or damaged by a magnet. When guage), and still in BASIC, you may DISK UTILITY PACK...... $ 25. you wipe out your working system disk read or write any sector on the disk by FASTFILE Data Base...... $100. you can get the backup and generate FILEX IBM Access Routines...... $245. specifying the track and sector number, MENU LOAO...... $10. another backup for the safe storage area. and the ID of two string variables. The fullFORTH+...... $100. The video display looks like a ter­ first 128 bytes of the sector is read minal. Most terminals accept control to/written from the first named string Commodore Communicates1 codes to do such things as clear the COMPACK $129. variable, and the last 128 bytes to/from screen, position the cursor for the next the second. That means you can write Intelligent Teminal Package letter to be output, etc. A set of such your own disk system and have fast ac­ including: ACIA based interface codes has been provided. You can con­ cess! Naturally, the RS BASIC has all DB25 cable trol the display without getting into the STCP software the color graphics commands and v Remote Telemetry XON-XOFF Control assembler-level CRT driver code. That sound commands, so you can write v Transfer to/fr Disk ^' User Program Cntl will make it easier for software suppliers game programs and/or use graphics. v Printer Output ' Status Line to write compatible software for the The Color Computer is a good buy $139 COLOR CHART Color Computer. for anyone wanting to get into this ex­ AIM/SYM system video display, 64 x 16 The Color Computer format is 16 pensive hobby with a small invest­ characters, 8 colors, plugs into ROM lines of 32 characters each, and the ment. If you have the minimum socket, 4K RAM Multiple modes; semi character generator displays lower case system from RS, which is very inexpen­ graphics, alpha. PET/CBM color graphic display, 128 x in reverse video, which is barely usable. sive, you can first have RS upgrade your 192 pixels, generate color bar graphs Software will soon be available to allow Color Computer to 32K, and then do on one screen with data on main use of any standard ASCII RS-232 ter­ the very simple modification to 64K. screen. RS170 video color chart. 6847 based video output. minal on the of the Color From that point, you are off into the COLOR VIDEO FOR PET/CBM/AIM/SYM Computer. I have a preliminary version world of FLEX, with at least five Pascal of the software which will eliminate the compilers, three or four BASIC inter­ ROMSWITCH -4 ROMS IN 1 display problem completely, but I im­ preters, several versions of “C", For­ SPACEMAKER $39.95 agine that many purchasers will want to tran, Cobol, a couple versions of Switch 4 ROMs into the same socket A slide switch activates one of four use a TV set and the supplied keyboard FORTH, three editors, a good text pro­ Electronic controls insure no glitches for some time, before investing in a ter­ cessor, several assemblers, an excellent and allow ROM switching under soft­ minal. The enhanced display software debugger program for assembler pro­ ware control ROMs can be switched from the keyboard will therefore be welcome. grams, and much more. A SDC (single disk copy] utility ftillFORTH+ for APPLE/PET allows copying with a single drive. It FULL FIG FORTH implementation plus reads files from the source disk until conditional assembler, floating point, Mr. Anderson is vice president in charge of string handling, multi-dimensional arrays, memory is full or it has read all the files engineering for Industrial Computer and disk virtual mamory to be copied, then it prompts you to in­ fullFORTH+ from IDPC Co $100 Controls Corp. in Ann Arbor, MI. You Target Compiler ...... $ 50 sert the destination disk for a write cy­ may contact him at 3540 Sturbridge Ct., cle, etc., until the copy is complete. Ann Arbor, MI 48105. SEE YOUR DEALER OR: .cy» ^ P.O. Box 102 LINK and PUTBOOT.LDR both prompt CM IC R O T E C H ] Langhorne, Pa. 19047 you, and therefore give an opportunity * 215-757-0284 to change disks so these operations may JMCftO DEALER INQUIRIES INVITED

24 MICRO - The 6502/6809 Journal No. 54 - November 1982 ^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 For Apple II. Supplied with controller. Use with SMARTERM CP/M, Apple DOS, & Apple Pascal ...... $1995 (Not to be confused with SUPRTERM) PARALLEL PRINTERS Software switching from 80 to 40 and 40 to 80 NEC 8023 or C-ITOH 8510 51/4” DISK DRIVE 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 p r in t- 136 characters 51/4” FLOPPY DISKS 01 only 2.5 watts. per line • Tractor/friction feed • 7 different print With hub rings.Box of 10. (List: $ 3 4 5 )...... $225 fonts included • 2K printer buffer • Proportional With other purchase ...... spacing • Bit image graphics and graphic symbols. $19.95 Without purchase ...... $23.00 SMARTERM EXPANDED CHARACTER SET NEC 8023 or C-ITOH ...... $495 16K MEMORY EXPANSION MODULE 7 " x 11” matrix with true decenders. Add to above ...... $40 NEC 8023 or C-ITOH 8510 with The preferred 16K RAM Expansion Module from Parallel Interface and Cable ...... $550 PROMETHEUS. Fully compatible with CP/M' and „ „ , Combination SMARTERM and EPSON 100 with Parallel Interface Apple Pascal'. With full 1-year parts and labor BestBuy! EXPANDED CHARACTER SET and Cable...... $749 warranty. (List: $169) ...... $75 Special a t ...... $260 VIDEX, VIDEOTERM...... $249 WORD PROCESSING SPECIAL VIDEX ENHANCER I I ...... $119 Z-80 CARD FOR YOUR APPLE WITH WORDSTAR AND SUPERCALC! MICROSOFT SOFTCARD Do professional word processing on your APPLE. CENTRONICS COMPATIBLE All necessary hardware and software included. With CP/M -and MBASIC. 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, CP/M ■ software, Wordstar and word processing BestBuy!!! C-ITOH, and other printers. Fully compatible with software and SuperCALC. CP/M * and Apple Pascal * ADVANCED LOGIC SYSTEM (List: $1,128)... Special at $695 PRT-1, O n l...... y $69 :iW r 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 $ 2 6 9 )...... Special at $195 The only 128K RAM 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/M ', 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: $ 1 2 5 )...... $89 range of CP/M' software on Apple II. Includes SuperCALC. MEM-32 Two rows of 16K RAMS (List: $749) ...... $549 make a 32K RAM Card...... $209 SOFTWARE MEM-64 One row of 64K RAM. WORDSTAR...... Special at $195 U-Z-80 PROCESSOR BOARD With DOS 3.3 disk emulator...... $299 SPELLSTAR ...... $125 (From Europe) MEM-128 Two rows of 64K RAMS installed SUPERCALC $175 Software compatible with Softcard and make a 128K Card. D BASE I I ...... $525 ALS S o ftw are ...... $149 With DOS 3.3 disk emulator...... $399 VISICALC...... $149 MEM-RKT 64K RAM Add-On-Kits- DB MASTER ...... $189 MICROSOFT + PREMIUM SYSTEM 64K Dynamic RAMS. Each...... $125

Includes Videx Videoterm, Softswitch, Microsoft VISICALC Expansion Program All equipment shipped factor/ fresh. Manufacturers warranties and Softcard, Microsoft and Z-80 Card, and for MEM-128 ...... $75 included. Please add $3 00 per product for shipping and handling. Osborn CP/M - M anual ...... 5595 MEM-PSL Pascal disk emulator for California: add 6 % tax, BARt Counties. 6 '/2%. MEM-128...... $45 All items are normally in stock

% \ JOYSTICK MODEMS FOR YOUR APPLE II Phone fo r Q uick HAYES Smartmodem...... $229 * Takes the place of two MICROMODEM II ...... $279 S h i p m e n t ! Apple Paddle Controllers.

From BMP 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 AMDEK300G Four cards on one! With true simultaneous opera­ (18MHZ Anti-Glare Screen) ...... $179 tion. Includes: (1) Serial Input/Output Interface, (2) Parallel Output Interface, (3) Precision Clock/ NEC 12” HIRES GREEN...... $179 Calendar, and (4) BSR Control. All on one card. SGCThe mail order specialists SUPER SPECIAL! Fully compatible with CP/M- and Apple Pascal'. SPECIAL 12” GREEN MONITOR $99 (List: $249) ...... $169 342 Quartz Circle, Livermore, CA 94550

No. 54 - November 1982 MICRO - The 6502/6809 Journal 25 68000 Binary Arithmetic Operations

byJoeHootman

A short discussion of the be left in data register DO. Since the quotient is zero. The N bit follows the various instructions for binary most significant bit of the word is set, most significant bit of the result. In arithmetic including addressing this indicates that the result is negative both the signed and unsigned divide the and sign information. and the N bit is set in the CCR. If DO quotient is the lower 16 bits of the contains $8055, Dl contains $0002, destination register and the upper 16 and MULU D l, DO is executed, then bits is the remainder. The sign is the result |$000100AA) will be in DO. reflected by the most significant bit of The signed and unsigned divide the result. The most extensive list of instructions, have characteristics similar to the The TST instruction subtracts the and some of the most frequently used, multiply instructions. If division by designated data from zero and the ap­ are the Binary Arithmetic Operations zero is attempted, a trap will occur and propriate bits set in the CCR. This in­ (table 1). Most of the binary operations overflow is indicated by the state of the struction testing of byte, word, and are straightforward however, there are V bit in the CCR. If Z is set then the long word data is reflected in the CCR. several instructions unique to the Table 1: Binary Arithmetic Operations 68000. 'T he addressing modes will be covered in future issues. The binary operations usually do not apply to operations on the address Mnemonic Data Size/CCR registers. However, in the binary arith­ ADD 8, 16, 32 Add Binary This operation adds the binary data designated metic instruction implementation of COR by the sourcc to the data designated by the the 68000, there are several instruc­ X N Z V C destination and leaves the result in the ***** tions such as ADDA, CMPA, and destination. If the effective address is a source then all addressing modes can be used. SUBA that are designed for operation Opword Format on the address register. The operations on the address register allow special ad­ 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 dressing operations to be carried out 1 1 0 1 Register Op Mode Effective Address and, more importantly, allow the com­ Mode I Register parison of the magnitude of the address Register — Any of the eight data registers. register without using the CHK in­ Op Mode struction. Clearly the address registers Byte Word Long Word Operation can be used as data registers or index 000 001 010 Dn + EA—> Dn registers. Three instructions deal with 100 101 110 EA + D n-» EA sign extension: ADDX, EXT, and The sourcc can have all the address modes except NEGX. All of the sign extension in­ 13,14.* structions sense the sign bit of the The destination can have all the address modes operation and the sign is extended except 1, 2, 10, 11, 12, 13, 14.* through the length of the word. ADDA 16, 32 Add Address This instruction adds the source data to the When arithmetic instructions are CCR designated address register and leaves the considered, the implementation of the XNZVC result in the address register. signed multiply and divide and the un­ signed multiply and divide must be considered a most worthwhile and 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 powerful addition to the instruction 1 1 0 1 Register Op Mode Effective Address set. The signed and unsigned multiply Mode | Register and divide instructions are all 16-bit in­ structions. The data to be operated on The register field can be any of the 8 address is a word in length; the result of the registers. This is always the destination. operation is 32 bits long (long word). Op Mode The interpretation of the 32 bits 011 - Word operation the sign will be extended depends on the particular instruction. to all 32 bits of the address register. For example, if DO contains $8055, D1 111 - Long operation contains $0002, and MULS D l, DO is All addressing modes are allowed except 13, 14.* executed, the result ($FFFF00AA) will (continued)

No. 54 - November 1982 MICRO - The 6502/6809 Journal 27 Mnemonic Data Slze/CCR Function Comments MICRObits ADDI 8, 16, 32 Add This instruction adds immediate data to the CCR Immediate destination data and leaves the result in the X N Z V C destination. Deadline for MICRObits: 20th of sec­ ond month before publication; i.e., November 20th for January issue. Send 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 typewritten copy (40-word limit) with $25.00 per insertion. (Subscribers: first Effective Address 0 0 0 0 0 1 1 0 Size ad at $10.00.) Mode 1 Register

Word data (16 bits) Byte data (8 bits) 6800/6809 Software Long word {32 bits, including previous word| Includes compatible single-user, multi-user and network-operating systems, compilers, accounting and word processing packages. Free Size field: 00 - Byte catalog. 01 - Word 10 - Long word Software Dynamics 2111 W. Crescent, Sta. G All addressing modes except 10, 11, 12, 13, 14 can be used as a destination. • Anaheim, CA 92801

ADDQ 8, 16, 32 Add This instruction allows the binary addition of CCR Quick any data from 1 to 8. Lessons in Algebra X N Z V C ***** An easy and fun way to learn the 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 basic elements of high school algebra. Apple computer diskette $29.95. 0 1 0 1 Data 0 Size Effective Address 30-day money-back guarantee if not Mode Register satisfied. George Earl 1302 So. General McMullen Dr. The data field can contain any integer from 1 to 7. San Antonio, TX 78237 Size field: 00 - Byte 01 - Word 10 - Long word PET Joystick Interface All addressing modes except 10, 11, 12, 13, and 14 can be used as a destination. * Connects directly to all PET/CBM computers. Allows PET to accept ADDX 8,16,32 Add This instruction adds the source to the either Apple joysticks/paddles or CCR Extended destination and leaves the result in the Atari joysticks. No assembly required. X N Z V C destination. The sign bit of the result is Ready to plug into the user port. * • • • • extended to fill the word. Software provided. Immediate delivery. Only $49.95. Michigan residents add 4% sales tax. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 J. Systems Corp. 1 1 0 1 Register 1 Size 0 0 R/N Register 1 Edmund Place R# R# Ann Arbor, MI 48103

Destination Source Register Register OAI 65D V3.3 Guide Contains fixes and other data OSI didn't tell you about. Increase Register field R# designates any one of eight compatibility between 65DV3.X and registers. VB.3. Run extended utilities under V3.3 and more. $14.95. New York If R/M = 0 then a data register is specified. If R/M = 1 then an address register is specified. residents add 7% sales tax. Buffalo Informational Technologies Size field: 00 - Byte operation 01 - Word operation 209 Richmond Avenue 10 - Long word operation Buffalo, NY 14222

CLR 8, 16, 32 Clear an This instruction clears the effective address. CCR Operand VIC 20 Games — 5 for $10.00 X N Z V C - 0 1 0 0 Tape 1: Canon Duel, Breakout, 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Runaround, Stockcar, Space Scout. Tape 2: Target Pistol, Space Duel, 0 1 0 0 0 0 1 0 Size Effective Address B29, Tank, Roadblock. Tape 3: Sub Mode | Register Hunt, Blockade, Indy500, UFO, Jungle Driver. Add $1.50 for p/h. All 15 games for $25.00. Size field: 00 - Byte operation Skylight Software 01 - Word operation 22 Miller St. 10 - Long word operation Belfast, ME 04915 The following address modes cannot be used as destinations: 2, 10, 11, 12, 13, 14.* (Continued on page 30)

28 MICRO - The 6502/6809 Journal No. 54 - November 1982 Table 1 (continued)

A h s u v e s & o f Mnemonic Data Size/CCR Function Comments sa vin g s fro m CMP 8, 16, 32 Compare This operation subtracts from the destination CCR the source; the destination is not changed. X N Z V C 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 0 1 1 Register Op Mode Effective Address Mode | Register A pptepi& Ttee

Register field defines the destination data register. E le ctro n ics Op Mode field defines the size of the data to be compared. SOFTWARE 000 - Byte 001 - Word APPLE-ATARI- TRS80- IBM 010 - Long word A full line of software for business, games All but the Quick Immediate and Implied and education up to 35% off! addressing can be used for an effective address 13, 14.* MUSE KJS V1S1CORP STONEWARE CMPA 16', 32 Compare This instruction subtracts the effective ON LINE SmERGISTIC CCR Addresses address from the destination and leaves EDU-WARE HAYDEN X N Z V C the destination unchanged. HOWARD AND MANY MORE

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 HARDWARE 1 0 1 1 Register Op Mode Effective Address AMDEK-HAVES ■ MICROSOFT Mode [ Register FRANKLIN COMPUTER SYSTEM Register field defines the destination address register. ACE 1000 • $1,795.00

Op Mode field specifies the size of the operand. DISKS 011 - Word operator 111 - Long word Maxell Box of 10,5*4", SS-DD $35.00 5'A", All effective addressing modes except the implied Verbatim Box of 10, SS-DD $29.00 mode can be used. MONITORS CMPI 8, 16, 32 Compare This instruction subtracts the immediate CCR Immediate data from the destination. The condition LE MONITORS List Our Price X N Z V C codes a set consistanr with the results of the 9" Green $189.00 $159.00 operation. 12" Green $199.00 $169.00 ZENITH 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 12" Green $179.00 $129.00 0 0 0 0 1 1 0 0 Size Effective Address Plus a full line of AMDEK Monitors Mode 1 Register

Word data (16 bits) Byte data (8 bits) PRINTERS PAPER TIGER Ust Our Price Long data (32 bits including previous word) 460G $1,094.00 $950.00 560G $1394.00 $1,250.00 Size field: 00 - Byte operation EPSON 01 - Word operation MX 70 $449.00 $395.00 10 - Long word operation MX80FT $745.00 $595.00 The following destination effective addresses MX100FT 5945.00 $795.00 cannot be used: 2, 10, 11, 12, 13, 14.* CALL FOR THIS MONTHS SPECIAL ! CMPM 8, 16, 32 Compare This operation is used to subtract the CCR Memory source from the destination. The CCR is set in 1-800835-2246EXT. 211 X N Z V C accord with the result. The contents of the OR destination are not changed. The addressing is always done using postincrement addressing. 7024594114 !■■■■{ 5130 East Charleston BK ci , '' Suite 5MI 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Las Vegas, Nevada 89122 1 0 1 1 Register 1 Size 0 0 1 Register Phone orders welcome. Mail orders may send Rx Ry charge card number (include expiration date), cashiers check, money order or personal check (allow ten business days for personal or com­ pany checks to clear). Add 53.00 for shipping, Rx must be an address register and in the . handling and insurance. Nevada residents add destination. 5.75% sales tax. Please include phone number. Ry must be an address register and is always the All equipment is in factory cartons with manu­ source. facturers warranty. Equipment subject to price Only the Post Increment mode can be used. change and availability. Call or write for price list

(continued)

No. 54 - November 1982 MICRO - The 6502/6809 Journal 29 M IC R O b its Table 1 (continued) (Continued from page 28) Mnemonic Data Size/CCR Function Comments Elephant Disks 514" SS/SD $21/box, SS/DD (48 TPI) DIVS 16 Signed This operation divides the destination CCR Divide $24/box, SS/DD (96 TPI) and DS/DD by the source. The result is left in the XNZVC destination. The source is a 16-bit word and (48 TPI) $30/box, DS/DD (96 TPI) the destination is a long word operation.The $36/box. Write for prices on 8". Add lower 16 bits are the quotient and the remainder $1 per order shipping via UPS in USA, is in the upper 16 bits,- the sign of the remainder NJ add 5% sales tax. is the same as dividend unless the remainder is Baker Enterprises zero. Division by zero causes a trap. Overflow may be detected and flagged but the operation is 15 Windsor Drive uneffected. Atco, NJ 08004 15 14 13 12 U 10 9 8 7 6 5 4 3 2 1 0

SYM-1 Computer Plus 6502 Books 1 0 0 0 Register 1 1 1 Effective Address Mode I Register SYM-1 assembled and tested, never used (original packing). SYM The register # specifies one of the eight data programming manual and reference registers and this is the destination register. The manual included - $130.00. PMC (EMA effective address determines the source and all 5/6B) power supply - $19.95 (cable EA modes can be used except 2, 14 * connection for SYM included], 6502 [L.J. Scanlon) - $8.95 DIVU 16 Unsigned The unsigned divide is identical to the new. Programming and interfacing CCR Divide signed divide except that unsigned 6502 with experiments (M.L. Dejong) - XNZVC arithmetic is used. $10.95 new. SASE: - • • v 0 15:14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Frank Janda 19 Wilson Drive 1 0 0 0 Register 0 1 1 Effective Address Framingham, MA 01701 # Mode [ Register (617) 862-3120 ext.209 The addressing modes and the definition in the op word are the same as the signed divide. OSI Super Defender Play this great arcade game at home. EXT 16, 32 Sign This instruction extends the sign bit of a All machine code includes: scanner,- CCR Extend byte to a word or a word to a long word. XNZVC The MSB is detected and extended to the proper smart bombs,- laser fire; moving - . . 00 mountains and more. Save your length. The sign bit is considered to be the most significant bit of the word. humanoids from the alien landers. Very smooth (half character moves) graphics. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 $14.95 for C l,2,4 tape or 5 !4 " disk. 0 1 0 0 1 0 0 Op Mode 0 0 0 Register DMP Systems 319 Hampton Blvd. Op Mode field specifies the size of the extension. Rochester, NY 14612 010 - Word sign extension 011 - Long word sign extension Commodore 64 Software Register field specifies one of eight data registers. Sprite Editor - $12, Dumb Terminal - MULS 16 Signed This operation multiplies two signed words $10, Disassembler - $15, Cross- CCR Multiply together. The destination must be a specified Reference Generator for BASIC XNZVC data register. The sign of the operation is programs - $10. Descriptive catalogue - - • . 00 reflected in the sign bit. 50 cents. Contact by US mail or 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 CompuServe 70140,223. 1 1 0 0 Register i i i Effective Address NEON SYSTEMS I ?: . Mode | Register 5108 N. 23rd Road Arlington, VA 22207 Register field specifies one of the data registers and is a destination register. All effective addressing modes can be used The Wrath of Khan except Direct, Quick, Immediate, and Implied 2, 13,14.* Can you defeat a Superman? Com­ mand Enterprise in a tactical battle MULU 16 Unsigned This operation multiplies two 16-bit against the Reliant. Cl-P controls CCR Multiply integers together and leaves the result in the Reliant's maneuvers and weapons via XNZVC destination register. The operations are similar Artificial Intelligence logic routines. - • . 0 0 to the signed multiply except that signed Features full status display, sensors, arithmetic is not used. The 32-bit result is left in photon torpedoes, phasers, deflectors, the destination register. and more. Cassette 8K - $14.95 ppd. 15 14 13 1211 10 9 8 7 6 5 4 3 2 1 0 Cygnus Software 1 1 0 0 Register .0 1 1 Effective Address 791 W. Oakland Park Blvd. Mode | Register Suite 432 Ft. Lauderdale, FL 33311 Register field specifies one of eight data registers. The effective address can be anything but Direct, Quick, Immediate, and Implied 2, 13, 14.* (continued)

30 MICRO - The 6502/6809 Journal No. 54 - November 1982 Table 1 (continued) M IC R O b ltS (continued) Mnemonic Data Size/CCR Function Comments

NEG 8, 16, 32 Negate The destination is subtracted from zero. This: CCR changes the sign of the destination. The result VlsiCalc To Apple Plot XNZVC of this operation is left in the destination. * * * ' * * Interface translates from VisiCalc to 15 14 13121110 9 8 7 6 5 4 3 2 1 0 Apple Plot, prevents erroneous graphs, fits curves to data, and supplements 0 1 0 0 0 1 0 0 Size Effective Address VisiCalc with rank ordering and Mode | Register alphabetizing. Send SASE for details or $30.00 for the copyable program. Size field specifies the size of the data to be Bill Starbuck operated on. 2100 E. Edgewood 00 - Byte operation 01 - Word operation Shorewood, WI 53211 10 - Long word operation (414) 963-9750 Effective address modes can by anything but 2, 10, 11, 12, 13, 14. • VisiCalc To Apple Writer NEGX 8, 16, 32 Negate The destination is subtracted from zero and the Veecee-Writer translated VisiCalc (/PF) CCR with Extend result of the operation is left in the destination. files for Apple Writer 1. Send $15.00 for XNZVC The sign bit is extended to the end of the word: the copyable program. 15 14 13 12 11 10 9 8 7 6 5 4' 3 2 1 0 Bill Starbuck 2100 E. Edgewood 0 1 0 0 0 0 0 0 Size Effective Address Shorewood, WI 53211 Mode j Register (414] 963-9750 Size field specifies the size o l the operation. 00 - Byte operation 01 - Word operation AIM-65 FIG-FORTH 10 - Long word operation Fig-Forth for your Aim-65 with The following effective address modes cannot be assembler needs 16K memory. Cassette used: 2, 10, 11,12, 13, 14.* $20.00. With editor and assembler needs 32K memory $25.00. SUB 8, 16, 32 Subtract This operation subtracts the source from CCR Binary the destination and leaves the result in the D. Holmes XNZVC destination. 466 Palos Verdes Blvd. * •*."*' * * Redondo Beach, CA 90277 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 0 0 1 Register Op Mode Effective Address Mode | Register OSI-C3B 152K static ram, 70 MB disk, 160 1pm Register fieid specifies any one of the eight data registers./"':' printer, dual 8" floppies, software, 1 year old, used 2 months. $12,800.00 Op Mode field defines the way that the operation US or best offer. is to be performed between the data register and the effective address. Alan J. Lawson Toronto, Canada Long (416) 576-6508 Byte Word Word Operation 000 001 010 The data register is the destination and the EA is OSI C1P Chomper subtracted from the Register Positively one of the most difficult, challenging, and fun dot-eating games 100 lul 110 The EA is the destination available on the C1P. Progressively and the register is faster action, bonus characters, and subtracted from the EIA. "commercials" for high scores. Keyboard or joystick, 8K tape. $14.95 The only effective address |EA) modes which includes shipping. cannot be used if the EA is a source are 13, 14.? Watts Ware If the EA is a destination tSen the following 153 Madrona Drive effective address modes cannot be used: 1, 2, 10, Anacortes, WA 98221 11, 12, 13, 14.*______

SUBA 16, 32 Subtract This instruction subtracts the effective CCR Address address from the address register and Consulting Opportunities leaves the tesult in the address register. XNZVC Leam how to become a successful 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 consultant in your own field. Write for 1 0 0 1 Register Op Mode Effective Addiess a free prospectus: Mode | Register The Consultant’s Library 815 15th Street, NW Dept. M. Register field specifies any one of the Washington D.C. 20005 address registers. The Op Mode specifies the size of the o 011 - Word operation iiMCftO 111 - Long word operation All effective address modes can be used 10, 11, 12, 13, 14.* (continued)

No. 54 - November 1982 MICRO - The 6502/6809 Journal 31 Mnemonic Data Size/CCR Function Comments

SUB! 8, 16, 32 Subtract This instruction subtracts the immediate Announcing CCR Immediate data from the destination. The result of the XNZVC operation is left in the destination and the T H E GUIDE proper bits are set in the CCR. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 A Complete Guide 0 0 0 0 0 1 0 0 Size Effective Address to the Apple Computer Mode | Register Word data (16 bits) Byte data (8 bits) Long word data (32 bits using previous word) Size field defines the size of the operation. 00 - Byte operation data is the lower order byte of the immediate word. 01 - Word operation data is the entire immediate word. 10 - Long word operation data is the next two immediate words. The following addressing modes cannot be used: 2, 10, 11, 12, 13, 14.*

SUBQ 8, 16, 32 Subtract This operation subtracts the immediate data CCR Quick from the destination. The results are left in the XNZVC destination and the bits are set in the CCR consistent with the results of the operation. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

0 1 0 IT Data I 1 Size Effective Address ' Mode I Register If You Own the Original Data field contains the immediate data to be What’s Where in the subtracted: Any integer from 1 - 7 can be APPLE? represented and 0 in the data field represents the integer 8. You Will W ant Si2e field determines the size of the operation. 00 • Byte operation THE GUIDE 01 - Word operation A Complete Guide 10 - Long word operation to the Apple Computer The following effective address modes cannot be used: 10, 11, 12, 13, 14.' only $9.95* SUBX 8, 16, 32 Subtract This instruction subtracts the source from the The Guide provides full explanatory CCR with destination and leaves the results in the text to lead you through the most XNZVC Extension destination. The sign is extended. complete Apple memory map ever 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 published! 1 0 0 1 Register 1 Size 0 0 R/MRegister The Guide explains and Rx Ry demonstrates how to use the atlas Size field specifies the size of the operation. and gazeteer published in the 00 - Byte operation 01 - Word operation original volume! 10 - Long word operation If you missed the first edition of Rx R/M = 0 R/M = 1 What’s Where in the Apple?, a new destination data address revised edition containing BOTH the register register register for original atlas and gazeteer AND the predecrement all new Guide is available in one mode 256-page, Wire-O-Bound book for Ry data address only $24.95! source register register for register predecrement MICRO m akes it easy to order: mode Send check (payable to MICRO) to: data memory to register memory transfer MICRO INK to data register transfer P.O. Box 6502 TST 8,16,32 Test an This instruction compares the data defined Chelmsford, MA 01824 CCR Operand by the effective address with zero. The Call our toll-free number: XNZVC condition code register is set to be consistent - * * 0 0 with the result of the operation. 1-800-345-8112 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 (In PA, 1-800-662-2444) 0 1 0 0 1 0 1 0 Size Effective Address VISA and MasterCard accepted Mode | Register 00 - Byte operation *Add $2.00 shipping per book. 01 - Word operation MA residents add 5%. 10 - Long word operation The following effective address modes cannot be 83-370 used: 2, 10, 11, 12, 13, 14.* iJMCftO

32 MICRO - The 6502/6809 Journal No. 54 - November 1982 ling like it before. Nothing else like it now!

.. brings you continuous Hi-Res action-animation in every adven­ turous moment! And, real running, leaping, crawling. Real fighting, shooting, stabbing, dynamiting. Real wounding, poisoning, killing. Real action, excitement, mystery! All in a real-time challenging adventure that’s the wave of the future! V Paul Stevenson's graphic genius, first displayed in his i f t l V ,.. best selling “Swashbuckler” sword fighting game, ® outdoes itself in AZTEC. You’re inside an ancient Aztec pyramid searching for the golden idot. Descend deep into the heart of the temple— meet cobras, scorpions, giant lizards, hostile Aztec guardians and more. Watch JL for hidden trapdoors and strange death- m F rooms. Be ready to fight, or run. crawl or i * jump to possible safety. The menace is W real, the options and strategy are yours. M You've never seen an adventure like j | Aztec! You'll never tire of its amazing & m K k • action-animation.and exciting challenge. . jP E lt , • S39.95forthe Apple IT At your ' ./-m com outer store or:

m *1 • •**?*fV*’ -\

. **;V .

How to Make a Graphic-80 PET from a 4016

by James Strasma

A “Graphic 80” is an 80-column To make a 4032 from a 4016 you damage this chip, it can be inex­ PET with the graphic-style □ Insert 4116 dynamic RAM chips pensively replaced. (UD2 is the chip in keyboard. It can be made from a in the vacant positions of column UA. the upper-left of figure 1.) 4016 (Commodore’s cheapest These include UA4, UA6, UA8, UA10, □ Remove the jumpers at 6 and 7 PET) by adding some UA12, UAH , UA16, and UA18, eight between UB2 and UC3. (See figure 3.) in all. □ Add jumpers at 5 and at 8 in the inexpensive, readily available □ At the right front of the board, same area (figure 3). The jumper at 8 ICs and moving some jumpers. find the right end of jumper Y, and re­ shoud be between the most widely The author provides step-by-step route that end to the next hole toward separated of its four holes. instructions. In addition, the rear, at the right end of a line labeled □ Add 2114 static RAM chips at instructions are provided to add Z. (See figure 1.) Your PET will now UC6 and UC7. extra keys to an 8032 or a display “31743 bytes free” when it is □ Add 74LS244 octal tri-state Graphic 80. powered on. If it doesn’t, check your driver chips at UB6 and UB7. connections. □ Add a 74LS373 tri-state octal D flip-flop chip at UB8. To make an 80-column machine □ Replace the 2K ROM at UD7 The CBM 8032 offers an 80-column from a 4032 with a suitable replacement, as de­ screen and a very business-oriented □ Move the right end of all ten scribed in the next section. keyboard. Many PET owners would jumpers at BA0 one hole to the rear. like to have the 80 columns, yet still (See figure 2.) To make the result a business- maintain the easy access to graphic □ Just behind jumpers Y and Z, keyboard 8032 characters that the "graphic” keyboard move the right end of the jumper labeled □ Buy or program a ROM for UD7 offers. This does take some soldering both 3 and 40 one hole to the rear, the identical to the one supplied in that and electronic assembly skill. right end of the line marked 4 and 80. position on the 8032. Commodore's This article shows how to upgrade a (See figure 1.) part number is 901474-03. The correct "Fat Forty” 4016 or 4032 to a graphic □ Remove the short between pins EPROM substitute is a single 5-volt keyboard, 80-column machine. There 10 and 11 of UD2 from the bottom of supply 2716. are several options available, including the board, and repair those pins’ con­ □ Buy and install a business- only upgrading to 32K, making a nections on the top side of the board. If keyboard in place of the graphic one business-keyboard 8032, and adding ex­ tra keys to control video functions not Figure 1: Detail of front of board showing positions of Jumpers Y, Z, 3, and 4, and IC previously accessible from a single key. UD2. Before you begin, note that these changes are for ASSY. NO. 8032089, s im is m i located on the right edge of the board, halfway back, the FCC-approved Uni­ EL SALVADOR 8105 * versal Dynamic PET main board. Simi­ SN74S0MN lar changes worked with earlier boards, as long as the computer came with the large, 12-inch screen. Also note that procedures described SN74LSI5 below void any Commodore warrantee, guarantees non-support by them, and cannot be guaranteed to work on your particular machine. a SALVADOR 8109C The traces on current PET com­ puter boards are very tiny, and easily S N 71 L S 0 2N destroyed. Do not attempt this project unless you are skilled with a soldering iron. Before you start, unplug your machine for your safety and the computer's. Install sockets where new chips are added. This makes the job easier and makes later repairs more convenient.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 35 supplied. Since the cutouts will not match, the lower portion of the hood Listing 1 should be replaced, or you can make your own mounting plate. E6D1 3D 2E 10 03 3C 20 5B 12 To make the result a G80 E6D9 2D 30 00 3E 19 5D 40 00 □ Create a custom 2716 EPROM E6E1 2B 32 0E 3F 2C 4E 56 58 for UD7, or obtain one from a user E6E9 33 31 0D 3B 4D 42 43 5A group. The only change is to take the E6F1 2A 35 IB 3A 4B 48 46 53 80-byte keyboard look-up table from E6F9 36 34 15 4C 4A 47 44 41 locations $E798-$E7E7 in the Fat Forty E701 2F 38 16 50 49 59 52 57 ROM, and copy it into the functionally E709 39 37 5E 4F 55 54 45 51 equivalent location in the 8032’s ROM, E711 14 11 09 29 5C 27 24 22 starting at $E6D1. With this change, E719 ID 13 5F 28 26 25 23 21 the G80 will lack only the REPEAT, ESCAPE, and TAB keys of the 8032. However, as long as you have made the decision to modify the ROM, why not improve it? By changing only a few Figure 2; Detail showing jumpers BA0 - BA10 and position of replacement EPROM at bytes, you may add not only the miss­ UD7. ing keys, but also up to four others. Listing 1 shows my keyboard look­ up table, which includes keys for TEXT/GRAPHICS, INSERT/DELETE LINE, ERASE TO BEGIN/END, and an optional value for SET TOP/BOTTOM OF SCREEN. The details are described later in the article.

Adjusting the Screen There is a slight problem with the video adjustment that appears when CHR$(14| is printed. The top and bot­ tom lines disappear! To fix this, adjust the potentiometer labeled HEIGHT, from below the video display board, using a small non-conductive screw­ driver. Bear in mind that parts of this board carry over 10,000 volts, even when the computer is unplugged! Using the program below, adjust the pot so the test pattern just fills the screen: 10 PRINT CHR$(14) Figure 3: Detail showing jumpers 5, 6, 7, and 8. 20 FOR 1 = 1 TO 1999 30 : PRINT 40 NEXT 50 GOTO 50 The same fix works on any Fat Forty. To add missing and extra keys pull off the keyboard connector at the keyboard. Note that it has 18 separate connections. These correspond to the ten rows and eight columns of the key­ board matrix as shown in listing 1. There is a small hole at each posi­ tion in this connector. Using micro test clips available from Radio Shack, you can make temporary connections. For a slightly more permanent at­ tachment, I soldered tiny loops of wire to the keyboard side of the connector, as shown in figure 4. From the right edge of the keyboard connector, as viewed in place, the ten rows of the keyboard matrix are the first ten wires from the right. The eight columns of

36 MICRO - The 6502/6809 Journal No. 54 - November 1982 ANDROID ATTACK f o r A ATARI'

Figure 4: Added loops at keyboard Figure 5: Micro push buttons added near connector and clip connections. screen. Three additional buttons were in­ stalled on the other side. the matrix follow, again toward the selectable between 40 and 80 columns left. requires three ICs to switch the neces­ The six keys I have added are all in sary lines. This plan offers a simpler column 3 of listing 1. This corresponds solution. It uses a 2732 EPROM, pre­ to the thirteenth wire from the right. It programmed to mimic any two BASIC is the one with two micro test clips in 4.0 ROM sets, and switches from one figure 4. Each of these wires connects to the other by grounding one pin. to one pole of an added key (or push The disadvantage of this method is button, as I implemented it). that the 40 columns appear smaller and Rows 1, 3, 5, 6, 7, and 9 contain the centered on an 80-column screen, added keys. Connect each one to the rather than occupying the full width, as unused pole of the appropriate added on a Fat Forty. "key.” One more key could be added For information on how to obtain by attaching wires to row 2 and column this chip, see the box on this page. 5. These correspond to positions 2 and 15 from the right end of the connector, Software Compatibility and would be mated through another key. Nearly everything for the 8032 also If you prefer to implement another works on the G80, especially after ad­ keyboard value, substitute your prefer­ ding the missing keys. This includes red PET ASCII value into the keyboard the 8096 memory expansion board, look-up table of listing 1. For instance, Silicon Office, COMAL, and VisiCalc if you replace the $03 at location 8096. The exceptions are complete $E6D4 with $07, then hitting the STOP languages, including UCSD Pascal, the key would ring the chime rather than former PET supplied with the halting running programs. 8096 board, and A.B. Computer's "Ex­ I chose to mount push buttons panded BASIC” for the 8096. By modi­ through the bezel surrounding the fying the programs, I have been able to video screen, as shown in figure 5. I get all but UCSD Pascal to work with used Radio Shack's tiniest push but­ the G80. tons because they are unobtrusive, easier to push than large ones, and I Fight your way down through the couldn't find regular keyswitches. You may contact the author at 1280 Top-Secret underground 1aboratory Richland Ave., Lincoln, IL 62656. Regular keyswitches could be used, or a to save the runaway nuclear surplus keypad could be wired up. reactor, then try to save yourself One method for making the G80 4MCRO before the Androids get you!

Obtaining Alternate ROMs 16K cassette, 32K disk (SPECIFY!) To order alternate ROMs for Commodore 8032 and G80 computers, write: Jim Russo Ask for ANDROID ATTACK at your Ann Arbor Terminals, Inc. local dealer or send $10.95 + 6175 Jackson Road shipping, Hrite for our illustrated Ann Arbor, MI 48103 list of gaies for your ATARI. You may request any two of the following variations of BASIC 4: Fat Forty (Current model, but centered on an 80-column screen.) Skinny Forty (Also centered; works with far more games. No repeat function.) PRETZELLAND Eighty (Same as the 8032.) SOFTWARE Be sure to specify whether the ROM is for a G80 or an 8032. I think the 2005 D WHITTAKER RD charge is still $10 per ROM, barely above the cost of the 2732 itself. YPSILANTI, MI 48197

No. 54 - November 1982 MICRO - The 6502/6809 Journal 37 /MCftO CoCo Bits

By John Steiner

Ed. note: This is the first of our Color relative beginner t;o machine-language CoCo BASIC has two options in its Computer columns. John will be programming and only having experi­ reset routine: a cold start and a warm augmenting our coverage of 6809 com­ ence with the 6800,1 have been waiting start. When RESET is pressed, memory puters and helping to recruit authors. for Tandy's assembler (though others location 113 is checked for $55. If became available, I had a deposit on found, a warm start is done, any pro­ Tandy's]. When it finally arrived, I gram in memory is saved; string This column will have two major goals: plugged in the EDTASM + ROM pack memory, number of graphics pages to provide news about the TRS-80 Col­ (doggone it, there went the disk again), reserved, and other parameters are or Computer, and to provide a clearing­ and loaded BEDLAM using an offset of kept. If, on the other hand, anything house for CoCo information. In addi­ 16384. Using the monitor, I found the but $55 appears, BASIC assumes a cold tion, I hope to pass along any informa­ start and end addresses, and tacked a start and reconfigures the system to tion on the 6809, the 6847 video little routine at the end. This routine, power up status. This little trick will display generator, and the other major shown below, moves the program, one recover our disk when we are through components CoCo has. byte at a time (I forgot about the D with BEDLAM. Before loading the pro­ Originally, it seems, Tandy devel­ register] down to $600. It then transfers gram, from BASIC enter POKE 113,0. oped CoCo to compete with Atari, the execution to $600, the start address of Alternatively, you could add a routine VIC 20, and other game machines of BEDLAM. at the beginning of the machine-lan­ similar style. Witness the use of ROM You may enter and assemble the guage loader that will store a zero into program packs for games, etc. This em­ listing yourself, or enter the object code location 113 before executing BED­ phasis seems to be changing slightly. from the assembler listing using a LAM. When you are ready to quit Just recently, Tandy has taken the 4K monitor. Once the routine is in place, BEDLAM, just press RESET. DOS will machine off the market and replaced it beginning at $7F02, use CLOADM be reconnected. You will not be miss­ with a 16K version, at the same price. 1'BEDLAM", 16384 to load in ing any fancy end routine by leaving With the addition of the 32K upgrade BEDLAM. Transfer the whole thing to BEDLAM in this manner. [which uses 64K chips), CoCo has disk with the command SAVEM A quirk of this and the other Radio entered a new world. The newer, more "BEDLAM”, &H4600, &H7F15, Shack adventure games I've seen is powerful machine has been easily con­ &.H7F02. Notice the execute address is their STOP or QUIT command. I would verted to 64K and given the capacity to the start address of the memory move have expected control to return to run FLEX. OS-9 will probably be routine. To run the program, you can BASIC. What happens is that the key­ available by the time you read this. just use LOADM "BEDLAM” : EXEC, board will lock up, causing you to turn These two powerful operating systems or you can write a BASIC load routine, off the computer or press RESET to allow a vast range of 6809 software to and let BASIC do the work for you with regain control. As long as you have to be executed from CoCo. As I learn a simple RUN "BEDLAM” . press RESET anyway, you might as more details of these CoCo expansions, Once the program has been loaded well reconnect the disk. Though not I will pass them along. into the region at $600, disk BASIC is particularly fast or fancy, you can use Since this is the games issue, I have essentially gone. The quick and dirty the routine on any 32K machine to some game-oriented information this method to restore DOS is to shut the transfer programs. Just substitute the month. If you have a Color Computer computer off, then turn it on again. A correct start, end, and execute ad­ disk system, you have no doubt been better way is to let RESET do it for you. dresses where required. frustrated by the fact that the CoCo DOS scratchpad is located at $600, just where many machine-language tape programs like to reside. I am grateful that Tandy has started releasing some software on tape since disk users have trouble getting the disk drive and a ORG $7F02 ROM pack in the ROMport at the same •PROGRAM TO MOVE BEDLAM* time. It is a shame, though, to have to •JOHN STEINER 8/1/82* START Load current start address spend several minutes loading a 14K 7F02 8E 4600 LDX #$4600 7F05 108E 0600 LDY #$600 Load new start address adventure game from tape, when that 7F09 A6 80 MOVE LDA ,x + Load byte from current address expensive disk system just sits there 7F0B A7 A0 STA ,Y + Store byte to new address taking up space. 7F0D 8C 7F01 CMPX #$7F01 Done yet? I purchased 11 BEDLAM,” an adven­ 7F10 26 F7 BNE MOVE If not go do it again ture game on tape, and decided I would 7F12BD 0600 JSR $600 have to transfer it to disk. Being a END

38 MICRO - The 6502/6809 Journal No. 54 - November 1982 CoCo Bits (continued) AT LAST... r ] n I One more programming hint for development system is the medium for this month. Disk users are told by the several recently released educational disk system manual that "COPY" is packages, including Vocabulary Tutor For investors available for only multi-drive users. I, and Inventions That Changed Our and financial managers This is incorrect. If you have a single Lives. Talk/Tutor programs make good Stock portfolio analysis disk drive, you can enter COPY use of the high-resolution graphics and $150.00 " filename/ext” . You will be prompted audio features of CoCo. •in your office - instant valuations •compound growth measurement as to when to switch disks. In addition, In addition to these and other •pertinent company operating statistics unlike BACKUP and DSKINI, COPY is educational software, Color PILOT will Stock financial non-destructive of the program in have been released. PILOT has been statement analysis memory. If you have a long program in used by many instructors who wanted 5250.00 •input your interpretation memory and a large file to copy, how­ to develop computer-assisted instruc­ of financial data ever, you may have to switch disks a tion, yet did not want to learn the com­ •analyze up to 10 years of data couple of times. COPY can be used to plexities of BASIC. Color LOGO, •see mean, trend and stability transfer any file type, and easily another popular language with educa­ On-line data retrieval transfers machine-language or data tors, should also be available. Both pro­ 550.00 files. I will have more details on COPY grams will have disk versions; LOGO Accounting package S 150.00 next month, including a small routine will also be on ROM pack. DBM system that assists in selective disk backups. I am looking forward to comments S 200.00 I am an electronics instructor by from readers. I plan on including pro­ for 8" floppy/hard disc profession, and would like to make a gramming hints, and CoCo- and under OS65U couple of comments on CoCo in school. 6809-related news. In addition, CoCo Full Screen Editor Tandy is developing courseware that disk users are probably a distinct for Polled Keyboard runs on the Color Computer. CoCo minority and I will have information 575.00 •for OS65D & OS65U will be making appearances in class­ on Color BASIC and Extended BASIC, •machine language based rooms around the country if Tandy has as well as disk BASIC. I can be reached •type or cursor mode anything to say about it. By the time at 508 Fourth Ave. NW, Riverside, ND write for details you read this, teachers will have access 58078, or contact me through MICRO. Genesis Information to programs such as Chemistry Simula­ System^, Inc. tions. Radio Shack's Talk/Tutor AMCftO P.O. Box 3001 • Duluth. MN • 55803 Phone 218/724-3944

PERRy PERiphERAls RepaIrs KIM s!! (SYMs ANd A I M S Too) • We will Diagnose, Repair, and Completely Test your Single Board Computer • We Socket all replaced Integrated Circuits • You receive a 30-day Parts and Labor Warranty • Your repaired S.B.C. returned via UP.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 erry PERiphERAls 6 Brookhaven Drive Rocky Point, NY 11778 KIM-1 RepLacement Modul.Es • Exact replacement tor MOS/Commodore KIM-1 S.B.C. • Original KIM-1 firmware — 1K and 4K RAM versions RepLacement KIM-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.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 39 BOX 120 ALLAMUCHY, N.J. 07820 201-362-6574 HUDSON DIGITAL ELECTRONICS INC THE TASK* MASTERS

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

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

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

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

HDE TEXT OUTPUT PROCESSING SYSTEM (TOPS) DM81 6-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 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 Kl M and Kl M cassette versions. $65.00 ($68.50 Progressive Computer Software, I nc. for details. cassette) AVAILABLE DIRECT OR FROM 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 Castle Adventure for PET and Apple

by David Malm berg

Castle Adventure is a role- is purposely not included. At least half Atari (with Microsoft BASIC] or other playing game that involves the fun will be establishing the com­ 40-column systems. traveling throughout a puter's lexicon. Several commands will The second change is to convert the dangerous castle in search of be particularly useful: LOAD game (lines 24 to 36) and SAVE treasure. The goal is to rescue • INVENTORY |or just "I”) will give game (lines 219 to 233) routines so they you a list of all the items you are will be compatible with your the princess, while avoiding the carrying. machine's tape and/or disk command many dangers about you. • LOOK (or just "L”) may reveal formats. The variables you want to significant details that may help you SAVE and LOAD are: SF, LX, DF, R, in your quest. and the array IA(.), which has IL Castle Adventure • HELP (or just "H") may result in a elements (including a zero-th element). requires: valuable hint. The last thing to change is the • SAVE will cause the current status of reference to the PET ROMs in line 390. PET/CBM with 32K the game to be saved cin tape or disk. or Apple II with 48K • LOAD will enable you to resume a Acknowledgement or other Microsoft BASIC previously saved game. computer • SCORE will show you the total num­ Many of the ideas in CASTLE ber of points you have earned so far. ADVENTURE, as well as other adven­ • QUIT will end the game and show tures that are widely available, owe a In CASTLE ADVENTURE you play the you your final score. tremendous debt to Scott Adams. In the role of Godfrey de Goodheart, a bold, Remember that everything you en­ specific case of CASTLE, it uses a data­ but impoverished knight. King Fredrick counter in your adventure has a pur­ base structure and table-driven logic m has dispatched you to rescue his only pose. There are plenty of clues, but it similar to those first described by daughter, the beautiful Princess Fatima, will take imagination, perseverance, Adams in several articles. These from the dungeons of Baron von Evil's cunning, skill, and most of all luck to articles are a must for the true castle. You have also been asked to cap­ win the Princess's hand. adventurephile: ture the Baron's treasures of gold, 1."An Adventure in Small Computer Converting to Other Computers silver, and gems, which he enmassed Game Simulation,” Creative Com­ by cruelly exploiting his serfs. If you CASTLE ADVENTURE, as shown puting, (August 1979). Describes the can rescue the princess and return with in listing 1, is written for a 32K data-base structure. all of the Baron's ill-gotten treasures, PET/CBM computer. Listing 2 shows 2."Adventureland,” Softside, (July King Fredrick has promised you Prin­ changes required for an Apple II. 1980). Describes the table-driven cess Fatima's hand in marriage. However, the program is written in logic. Your quest will be filled with peril. "standard" Microsoft BASIC, so con­ 3."Pirate's Adventure," BYTE, The seven lone knights who were version to other Microsoft machines (December 1980). Also describes the previously sent on this crusade all should be a relatively trivial task. table-driven logic. vanished without a trace. If you are to There are only three areas where succeed where so many others have changes to the program will have to be failed, you must use all your strength made. Castle Adventure listing begins on and cunning — and be very lucky! First, you will have to replace the page 42. The changes for Apple II During your quest the computer screen and cursor control commands of (listing 2) are on page 46. will be your guide. You take action by the PET. These are shown in the listing giving the computer a series of one- or within square brackets in their two-word commands, such as: GO "English equivalents" so their mean­ SOUTH (or just " S ” ), OPEN DOOR, ing should be fairly obvious; i.e., CLR David Malmberg is the author or co-author of several personal computer packages; the GET KEYS, LEAVE CHEST, SWIM. means clear the screen, 3 DOWN most recent is VIC Turtle Graphics The computer has a vocabulary of only means move the cursor down three published by Human Engineered Software. about 100 words. If it does not under­ rows, etc. CASTLE AID VENTURE is You may contact him at 43064 Via stand your command, try something written for a 40-column screen, so no Moraga, Fremont, CA 94539. else. A complete list of this vocabulary spacing changes will be required for the

No. 54 - November 1982 MICRO - The 6502/6809 Journal 41 GAMES FEATURE!

y -i Oj oo z H 10 Lt «>• Ml (Ct •O M o 4ft H X y O rn II o Lt H- z 4* O 2 Cl © ■J O h - ro ii CL ID <0 y Q. © U r I- I- Z y I-.- i z H k. N r •J «X s ct H 5 Ct IS. j- * UJ •• Lt CL ■> V ' j r Z H- ** Cl - Ck H i y z M‘l ■■ 11 Z PI •o H Z a ZZ h ct I- y ■r^ U = x h a at Z z ^ z x * ^ p Cl ** H ct ». t: i- z o oo h = Q Lt Z: 2 21 y K H z v- y z Cl 1— V © x o ii ct y z y ** Ct ✓\ i- ■J V ^4 X z Ct Cl Cl V : T\ M x ^ H 1- y I- r.. > rH r- v z j_ z z N - v ■r* Z ct M i- y y VA z V z Z ^ ct X G T* Ct o 0 y ¥ * * * Z G v CL CL 1- M K ■w V © X H I- J z z z> ii z z II © 10 »- y a :: . II u * x /-•. + IL. ■N . -j x N .. l 1- M •w* P ►- h yV. ■1 "w* z ^ © V •* y 4^ n ii a H + n Lt © Z Ck ^ ii © I- *G ~ i>. [ *T- Z» ~ y II G A II ■* y © © ■jtf- y Cl ** y z Z > •I M z A y ll •w a . a s Lt H y i i . X II t i f U ■■z J X X - J II “s II 1- h - i- K A ct * r a * ►« - il u A Z y-.. z Cl Ml ■S.- © ” © Q I- o - 4* 4* Z> 5- i Ml y 1- X H a 0- 10 I- © ^ y II X X z v x V Ct k. CLX ■r* ui Cl 3. O ^ II M •v H ■* •• 4^ 3> y r. o 4* V i- ** _i y a i- z ^ II ^ * N •• A z? Z Z y. H Lt s 1“c 40+ H y ■> /*■•. => © I V 4» X A. y .--s © 7~ •v.-- X r t- T'. z ct y » ^ Cl s.- © II © H 1-1 a Q 11 X X V 4* © 10 i l l H + /*\ Z^' O F) ^ ^ | N 1— 4* H W H y 11 IX Ml y © H z ■S.-*•V X 1- z © Ml © Z II L. © G 2 10 © n z 'w* i- X. X a y H a H 11 Ct 1 y m*i : o 1- z © y © y O z> -• N tH© H •• A. © *• IS. i- z © -J w y X X Ci 1- II i ^ in r O ^ f f N is. © X NG 2 y V tl -J V V y ct -J y ** Z h a. © © Ct 10 t- * D i- z Z O D a ~ ii o o o O O " tH © I- s u m x . * * Z" CL H Z h - n H s 1-4Cl a • © II /s a. y ^ a Z * O L. h 1“ h h h a z 0 II n II X o Z z o ct y •• I- “i ct y - II X V «• x 3 Id © CP O o •• o o o o o © 0 y h N U /“•. U u. Lt O □ II 1- z z “i y z» o y V I- /S Mit. i- N ^ 1- ^ h- r in i- h X I- ^ o u o OON 1- X 0 © *- U O H A. o ^ y y »- -j o h - ct N z y V ■tl ¥ r z r N z 1 • V Q ^ y 1- - II *w o I " " \ O I- Ct© V J u_ d X o 4* H N/ X y > y --- y IX ^-1 Cl H Ct H II : z m © Ct + N U II A A A A 2 iJ O II 11 © ■S.' I- ct y s © X 10 4^ -J IN IV t - a o «• CtCty <- © a -J o •• © •• N x x x X X ^ w l-Hy II X II 4^ 2- y X © •• H II Tso: II A 2 z CL y tfl 'w CL ! 'w ^ II II x II *-• ^ H O X y W V \ s v H •• y Z X X. 1* II H y V y : \- N H 2 -fH Ct (E UJ H K X •• i 3 h X a x II ^ ,\*K ^ Z •f V 1 •• H >c z H- -j 1“ G — iH z r o II 1 h Zi D Z H m a h 1 I z z )C 1 X II •m a x z ct >c n o o o O O N II II O Id O y y y y y II y y II Cto i- O CL O y y L_ O Ct y II y y UJ N I L_ II o L_ U li. II li. o li- Id * HUH z y z 1-1y y z y H z z y H lf| X Cl y H o i- y 4* z a H O a z X H z y I M 3 li. m Z •- Z *- l*. *-• Z L. 2 2 2 2 2 J 0 »-* 0 y z 10 ^3l\ (0 0- © N ro * 10 •V l\ ft !>• © N Pi 10'O i\ K> 0- © M c-i 10 ■* 10 •0 10 IO IO 11? 11? •o •0 << •v •o •o ^5Vi •^i r%|S.N Pv r.. l\ l\ N t o ( 0 < o © © © © © '-i 1-H

X _ ■ © n y oo »- X r>. i> y 1- r -.. - y o -j 4* z K3 a X y •V - I - aj s ✓\ |.'*I z u n V “> y z b - 4^ Cl (0 a o -J y X © ^ o. r* y = = = y fl y ■». PI v LL Id h a a II _i s 4^ ^ o Z» Ot r-i Z X 0. K I- = C o y X z pi 1- y 'w 1“ o O — r z i - y X 4^ O Vj UJ o 0 ^ LL !__! y 1- 1- 1 h il OG _i y © ct Cl ii r. s y I----- II Z- »X H 'I Cl Z '.- r> 10 * j y 2 b~ vl Z z V X = y o 0 = Id H O y O Ml u 11 y i z s _ a v*t• u*i O z y 1“ © 4* M 1 x t o K Hz z y 1“ z ^ r-i H- •• n u*i = cn a *i y :■ » 'X •j y -J 4*f o ICO c i> ^ © a .. i^ n X = = u:- h o ct I I H i j h- II S c y y C-| — •z u:= U; U'J 111 Id *. \ I- H c ri i_i y M S H 1“ H I f : li?10 10 10 CL C aj y'« «- 'X z >:* X y Ct G Q n Z: 10 Ul 10 n h. h I 'I I - v*i y 'X y UJ Z' -j ■“! i_i 4* y •J O 1- 10 n 0 1- O j u o y il ii X w •1 0 m h Z “• 10 1“ 0 r , I- 1“ O u:> y a □ _J o o H in u “•• rt -i * O z |~l 1- h* HO 0 i j 10 r z ^ tfl dj O © z = Lt m P) *-* h • 1 1” <2. 0 O 0 •« © o -x z a II y UJ = I- >c X CL Ml 1“ 1* iJT t j «• ■■ s o a y l»_ H *-» 0. h © G V'l 1- * Ct N l—l O M y -J z 0 ■■ ■ ■ = z j- H J w l O . © y iij z z Z Ct 'IN in I- i- in II Ml r - z X x CL O •i a ct » 0 •I s -« O y c c X ~ II it _l H n y y O UJ -J •• y x H CL r : :X y 0 0 z s ■o O i i q ^ h u >c —: CL X = y Z z 1“ Z—t G y 2 z Ml y X CL < O 'I Cl © 1“ •*-' X X Ti a. Z l h «-»p M Ct fl. «I <1 y X O -J aj O O C J G -1 _l X II II z bJ «“i y ■Jl t-H X I j j t-H pi O r ; 0 n 1~1 .-I z O y y U Z Cl X z f t © A A. X ►H x y s y = •-J Ml H V I- H -J O O J i j •J 0 H -J X n g-|Cl •-« X L_ > y II 0 I> D- 'w* •• k y g 0 ■» ^ y <-• _l s 0 liT* s r r s = s s s s 0> z a: Q y O 4# X V V V © 0 r s UJ Cl « 5 V- U'j 1) II II 1! II li 1) 11 11 CD 0J a 1“ v r-i \ s ■■1 y 4* 11 I- cc :• II 1“ Z 0 Z CL Cl Cl Q. Cl CL Cl CL Cl I> Cl Cl O a = Z *-* Z _l „ M i/l 4^ J 1“ jC + H -J U i Z * ►« a 0*4 X CL Z h Ml *-• Cl © Ct + G 3- G m ^ X ct CL t o t~ z z z Z z ZZ z z o> G H u Cc. L. © G h u y l( ^ OC G Z u D ii I- ^ y Q ‘ •• 2 IX CL y y y y y y y y y c 1 I—I r-1 o o z ? y C II _l = :• _i -i r r Z y z + i“i z z> l“ l- »- h h i- a 2 Z K- 1“ /*% Ct O I- a. y y x v*i JOI^I <1 r* M*l © z ■■ O © -J O O 3- 2- O J h r J :: 10 O © © y o •J D x k o #► = S = O Q CCt Kt 10 I- k- Z h h v • I- O «l v Q | - = a © v Q v ‘ U*l H •• a i- o cl ;> a y Z J X «-»1 I rr» v W v l-t 11 UJ 00 •<• z y n 10 •• = s K i/I G N - © = X t" P 5s a s vs ». ^. © , r ✓ x -• ^ « ii K * -v' V II z ********** * V* * #► I— I— I—h h D h £ £l X -• -J x v . /'• v X t - •• y j- * ^ I- O K H i- x y iuf- dj X X y ll Cl Cl ll Cl a Cl Cl a z z z z z Z H x x h h z a j d x iC D 'jC 11 D Z j z D Ml Z' Z y 3 O -J -J © -I I- I- h* I- H I- I- I- I- •X z z Z 5Sa x r ll a x a x a a a ¥► a y Cl y a ct O iflH Ul H- a a c l Cl Cl U U y o OLU m o o y y y o y ct li LZL y z L_ Z Z Cl Z Cl Z O j o q : y o O L L 3 yyyyyy yyyy a a. a Cl CL Ct a Ct O G L II h m Z L z a a ^ G m O NO h L QUO. (J M M Z lit* *0 K OC' 0- © *-« «n ro ^ u‘* Is- 0j c*^ © «** w WtllJ'ON#0^ © ^ C l i*) 't it* o M )fr0H N i»)t ui *»:• r oc« c> ©^ n nnw roroniottttttttttw 10 10 10 10

42 MICRO - The 6502/6809 Journal No. 54 - November 1982 GAMES FEATURE

Q Q z Id a Z t- id z z m 0. u Id a Q. r z u a Z § CM 3 a z O t- O o CM o N a z s CM o O Ml > N K O a: z a z 3 H id u z s a a r • V O G _l H Cl , _l t - n 4ft H Ct »- a CL 1- ■ * 0. Z u z _l L_ Ml 1- G G 1- Id > z N. O Id Id )- •c »- Z z z o -1 Ct N. H u KH + 3 /\ - . :“?_l G ll z a -1 z V A — U L_ m ^ O 11 CL I- CM z c H A 10 K IX 1- H i 1-KN li_ K 40 CM _l o H Id Z u z 5 Z © -1 z H T*- ct H U IXu II K o O Z i—A _l LJ CL Id H r . t- ' t C QZ K u X H CL z : : s li_ 1- li- z Id O z u VA a i-t ■■ H •Ml ■■ K z |J »- z> 4ftX z h _l • s 1%. Q Q ». ■M’ H •• K •I V CM Id X Ct •K Ml Id O ZZ 0- s “• H 4ft N K Id Id h s Id Z z CE ■I a © i>- 1 G V a CM n Ml z II Q 1- o HA o /\ H II > 4ft H CM Z •• A u a o , r © a a l\ N 10 V (Z A s »- V G H N LL Ct V- w *- »- Ck w O' ZINZ* b - o c X V O -1 o Ml o 2 V »- o Q O H a Z V 1 1- 1- J z G s/ V > ». li_ s !Z Z H u o CM H M11 Id s Cl •^5 AA dj aj s CMi MM H ct z CM C3 a H Z 11 + = •rl © G n l> CM CL II ^4 o II li- Id )- s 4ft r IV S.* V Ml Ml H 1H1 © Z © li- a li- 4ft CM 40 II G CM > H A tt X 4ft II n IS. i\ z> O O Z i, CM 40 H CMHH CL © X II ; s X •• G H a 4ft O 1- flC>z Z U o H iH * Ct z »- z CM CM ¥ V -o J w ©• z s t- 1- O Ct i> ID ID ID ID ID 0. CMQ. z * y ! ■■ Id z K »- i> O- i> i> 1 u M z H 10X Z Id O z t- Z Z H *4 > Cl u Z •V Iji Id Z z z u Id IS 3 . Z z z »- 1 i - y T~ 1 - U z HH •• o : o Cl u ■■ z Id IX IS.CE z Z 40z G 11 Id U 1- o o A l h o z H CL CL J O l - 1- CLJ s 4ft 1 s \- X : CO 1- 1- Id !> o o o o o z X X *- X \- A V- o \- ft a a M K 1- z r • X u:- r II n K e; a H 0 z w* 1- K K »- K •• I- I- <3 z X V V4 •• IO CL O Z © U li- s u:i ir« Cl © KZ H G o zH o o o o o A »- © II G V 4ft <3 1 io a H as z z n ij II w z H H H v4 J /V © /s 1 ✓\ h 1- u o ij o u a o g © © II II 4ftH »- ii .A. X - z Id Id KN £ l*. t - •• 4ft Z O 11 v Z y V tl II T~ N K ■■ •• CM II II >✓ N -1 X a Z II V X V x CL z X •o CL O > H a H o o a Z z A K I*. O A A A A A s A AA H A A A A o 3 H H © •tj Ct ■■s' h - rs s IS.i- Ct 1- K H ~ © © © o i- © z G © H o X X X X X 2 G H G ct li- CL V v © X a X 1 t- II O N h Cl o i_i •» j- X V a S.-"ct V v © KZ + V V VVV z V VV o H O z 4ft ii V H hJ X H CM X 03li_ 1- II 1- (ClH I j Ij t- H «_> Z:- •N 3 -J _> I> II o ct a Cl W W K ;s; 1- Lt Z> z> li- I*. Id a z> a A a A h- a II H D h Z J o Z D 2 H ■■•» _l Z i- z H z Z ii li_ 2 h Z Z li- z D H tH ^ CM10 ■M’ ID Z D z z Z ■ ■h •• _l »- z H X X z I- X X o> Ct Ml G X H H H •n H x © © II H 'if X Id K II o o o o o H h G X G II V V H G X O o II Id CL I*. o Ct o a Id II II yC^ CtId li- Id li_ li- G li_ I*. Ct I*. l*. k. i*. u a z II II II II II II Id I*. I*. I*. II Id II _l i*. I*. I*. a L- cr CL ii Id li- I*. I*. u J Z CL H o a o LL Z. CL CL J Cl z H z HH H •• HHHH ct •-« o 2 3 2 Z Z H C t HH _l z X -1 H H H HH CL u. z H H 0) H C-4 10 t ID l\ 40 •> G H CM 10 't ID r-.. «l i> © CM 10 * ID V. 40 © CM 10 ' t IT* rs 40 OtG CM10■M* ID Vi rs 40 O. 6 CM 10 t “O•o •o t) •o *o i'i • 0>O- O', o o. G © © © G G © G © G ^4^4H H ** H H H rH HH H N CM« CMCM CM CMCM CM CM CMCMCM CMCM

o KS z H H ts L_ ’O N O rs rs 'O ID a a CM ’O H rs 10 x. rs L_ Id ID CM o o o IM »- u »- II c o o o Id u N z c - ID o o I IS % K > c o U O z > 3 (Z z o c CM S v Id a *0 ’O C3 10 a X H h rs CM tD *» K l-t X o o n ^ a CM IO a id CL A o Id o 'O ID o y z H O L_ II O ' ii © s o *«40 : z 2 a I- O /\ tl ID in - ID •c O C 'O c - J A o It- x 40 A «-• v a I- : U 'O i\ O _l N o U Id > CM * C-l * o ^ * N » ’O •• cl a V V H A T4 A a o- D ’Oh : ct N is. H a © G 'O rs o o • _i Z> ■■ H a a i I- O ID O ID Ct : id o o o 40 ii Id Z h ^ h H Ml * Id ii_ O "O <0 O CM s © ^ A id r O \. O r © cm o a •J I- rs = o k rs K + « » MffH CM _l ^ • K lj /N O ’O »- z z - o m ^ a r- p - O O c a -I li- © W © N io © - II - a i Ct I- M) © i- a in H Z O i_ o O CM 1 ID 'O ID IS. ^ u a t D a J CM a h II o O II z Id o l O O i I h c »- CM O O ^ CM < *-« O O is. a ** G I- Z ^ ' t K o CL s\ O Q ij t- o o o ct o ^ o V ' ‘N- v N. Z ID Z Z Id Z z o o CL Q. - •• CL -fi o - ^ o o o -O H »_ ^ |_ u ^ z o O I Id I-. r i i : •• H Z v v- Q. o. ^ rs hj t- Id Cl I o -Tl I ••a o cl I I- Z ■ • z x z r z Id i- »- o r tth ^ z o : o I i -o id i II h- " ■« o + D •• | ^ /s A •J ~ ^ •• o O O •o ^ - IS ^ Z v 3- >— Z o N <0 « <0 «• © I- o 40 ID 40 O O 49 z : ii j j j - _l -I -I z z z 0 X 0 X 0 CM -« CM in IS. Id —■ Z Id I D x ao 40 to o « o i - 40 • © Z > COI- D * j _i _i -I _l j j a (E Cl J z *-• c O OOOOQ u in •J Ml Cl iJ Ps CO |> © ^ N 10 * U> ’O K 40 Ow © W 10 ID U K «? <> © CM 10 * ID “O IS. © 0- G HN|Otlfi’CM5O>®HWntlO’ON(DOi0 eGG^Hw^H^wH^HNNNNNMMNMNnnnnnnRnnni' * * * * * * * * id in n-; in id ir> id it* id id

No. 54 - November 1982 MICRO - The 6502/6809 Journal 43 GAMES FEATURE]

i j ^4 CM CM G © rt k. © © G "O © © ■+ © > © G K G G l\ © in © © > in © G N k. k. 0 © ro rt G CM ■ " t © © © © O' •> © © 0- © G ■<5 > in © © 1" K © © © p'> k. © k. G C-4 •> G « — CM r t k. © O' © © © © © v © © CM© *. CM k. © © k- CM k. G G G k. k. IS. 'O © •«-i © © G © © © C-4 G © G N G I CM K N r t r t O- Vi 0- © Vt C-4G k. ■i- © G CM P-.. N © >in in © G r t GG k. © k. O' k. Vi Vi r t Uj © G N k. G k. © k. r t ) © in © k. k. k. G © © © G i>. k. ■+ © k. © rt ■5 G G © k. > © o;> © © G G 'O G G © k. G l\ © © Pv k. © G G k. © GG •«*i k. k. r t © © *. S © k. k. k. CM K © G G ro Vi Ps rt © © V© © © © © 0- © •5 G © k. © IV G © © ■<5 N G O' k. k. G G © O' rt © r-.. 10 G k. © © © O' © V fft © w. © G © V k. © k. rt G k. rt N IS. G G k. N k. © k. rt k. G G 10 <> iV © O k. 10 © Vi 'C © k. r t © » © © © G © N © k r t k. © ••o © G © G © © © *■ © rt K «> k. k. G o rt •* •+ © G k. ‘ ‘ © N k. O' r t <• r t ^ G © N © i. © p.. G k. k. © k. G ll^ © © fc. 10© CMiV k. CM r t © G G © © ». G k. k. CM k. rt k. © K © r\ G rt © © cm G k. © r-.. Vt k. G 0 k. © © r t k. IS. © k. •«:■ *. © © G G G G G K G © G O' G k. O' ». k. © G k. k. Q © © IT! rt G © CMQ k. k. rt Vr K k. © k. © G *. © k. O' k. k. k. k. k. ■M* r t *o G © f-4 © k. k © © CM rt © k. © © rt k. rt © © GG *■ G k. k. t cm © ^ G G G G G N k, k. G O' r t G N k GG k. k. 0 Vi P'l G rt CM k. © P-.. k. G rt © r-.. k. k. k. © © © S IO K •* K © © G G G © © k. N rt rt •+ r t r t G k. © C-4© k, k © © ij r-‘. Vi in © © © k. © k. CMij k, G G © Vl C-4 K •0 V © N G rs K K k. k. rs -O G k.N*l ’V r t Vi k, k. G ■i- © © k, k. G 10 O' © rt k. CM CM k, k, 05 © G V © IN Ps s o. © •M* r t © O G k. rt © r t k. GG © ■i- N CM© ■+ ■+■+ k. © k. © k. © k. k N T»- V; r t G rt r t k. © © © io fc. G k. -Q O IS. k. r t CM -o *■ k. •+ r t «• K © •* k. © rt k. © r-. r-. rs G in ©’ © G © V: C-4 © T»- k CM © © •o ■■t ». © G rs Ps © IS. G ^ © © K 0- © k. Ps. G k. C-4 K k. ■*■ro rt rt rt © © © k. © k. k. •+ rt rt r t CM*© r t G k, - ^ in © G k. k. k. k. k. g G -i* G -i". rt G k. k. G iT: © © G »n k v k. k. rt V© © k. U5© \ k. k. ro r t k ■* © *-* •<> 4 k, •0 •NG k. k. CM k, © © © k, © © k. © ■+ © © © Ps. k, ■i- rt CM CMCM CM © © © © © IT: © <0 © © © © CM r> OCi — G © s •- k. G r t © r t CM© © -o G s i. © rt © V. k. Vi ’0 O © k. ■i- •0 © © rt k. CM© CM r t © rt r t r\ i\ © -i* N G G G G G k. •o G k, rt k. © © C-4 o •^i k. © IT: © rt rt © iV in 10 © CM©ro CMrt V, k. rt k. k. © G © © H5 k. k. k. 9 IS. © r t G k. ^ CM© © k. O-© © © © © © ro l*K© © rt P.. CM k, k. rt © CMG CM © © © © © rt C*' CM © C-4 r*. © k, G G O' r t r\ CM 0? © © CKrt V. k. k. k. r*Krt r> rt l|'j rt K k C-4CM© k. © © P-.. k. V •+ © *. k. G ^ © 'O IS. © O' © CM V GG k. s © CC= k. © Vi P-S© k. k. O' © © S s V© k. © G rt © © P. k. © ’O CM© ’i- © © © N ^ t •+ •+ 1* G ■* © G © © 0 © IS.O- G ■*" V© © CM© © © G rt G k. k, k, TO‘0 G <> rt 1* -1- v \ rt © G © © © © G k. k. CM G © k, r t ■i- CM © © P © CM C-4CMP-. k. © k, K K© G © © k. (V k. © k. CM© ■i- v © © K © k. k. k. k. k. k. G G K rt G © G k. rt k. k. © © rt *■ r\ k. k,rt © rt © G © © k, k. © P-, © CM © r t k. CM © © ir, G © G G G © G ■i- k. © G k. k. r t G © G © © P-. © © rt © G G © © k. © k. G IS G ro ©' *0 r t r t k. G © » © © MO k. s », *0 G P\ C-4 G k. © N k. ©’ rt k. © •■.j •■0 V: rt © CM© 0- 101" CM k, *■ © V: k. G G G © © cm ^ G G © 1* 1" r t © G © Ps <* •* o © G ©' G •N© k. ijC* G © Kij •v ‘V © in © rt G © 10 G k. G G © k. V: k. ^ l\ Vl Vt P GO * © G CM S. © k. G k. k. k. ^ r» ^ C-4© © rt © K© G r t r t G © G vi v» © ©GG rt K. rs rs © r t O' G r t r t r t GN © ' © G © © k. © © © k. ©’ © G G G k. © rt k. k. k. k. © k. © k. k. k. k. CM *• *. k. s ■+ k. k, k. ■i- CM© k. k. © © © CM © k. k. © © ■* G <■■i- G 6 k. GGGG Q G © © © G G G G G G G G © •o © ■i- G G 05 G © C:4 k. © © © C-4 CMN G © © © © k. © ». k. k. © k. k. <» ’O * •>. k. k. k. s k. k. k. k. CM k. k. ■i- © k. k. k. © k. IT* k. k. G © GG © CM G G k. CM G G ► .* .© © N G G G G G G GG G © © © © G © G © H (•4 © G © © k. •* V © © © © k. rt k.Vi 1" © ». r t in © k. •O N k. V K *. *. k. © ^ CM CM © 4 © •* 'O * CM Vi v» N © ■i- © CM■i- Vi Vt ■0 Vi © © CM k. r. C-4rt © Vi •+ © G -I* ■i- <• G (M NN'CIC © 15 GGG GG G G C'4 CM r t rt G © CM C-4 C4 rt rt © Vi <• • Vi f. © O' G r t N 10 ■i- © Vi P-S © O' G rtCM © -i* O' G r t t i © -i* © 'O p.. «*i O' G r t CM© •+ © Vi Vi ■^*1"Or\ fs p-. is. rs K Pv P\ © © 05© © © © © © © 0> O' o. O' O- O' G G G G G G G © © G rt r t N CMC-4 w C-4N N CM C4 CMCMN CM NN CMN CM N N CM t i N CM CM t i CM N CM © © © © © © © p:»© © © © © © © © ©

O A = z K -J Id 1—1 1- r O V »I h o N ro I VH «• 1- = K k z o > ■o A A . A. IX r--, Q ~ O r t x > © © ». G k. V V V ^ in © © r*» v A 4ft M W PO »> © © O. r*i Q 1- P\ K 1)0 0- © y © © 1- 4ft Vl r t O Z O O O' ^ '«!* © fc- *■ i£ X CM k. V *v S *. K 10 W © © © •o © © IX •». *k. N 4ft M A . A A z 10 © -o Id = z X © -1 X > a © in' © © © Ck © ^ i—: T~~. z V OZ © 1- — V © o o KH kJ * rt K © ^ ^ T- v m © - - Cl L_ Ll. 1- 'C A 4» -0 C ro k. *. iH r-, v © U Id I- b- k. G y’l O o © © H © © © CL -J-J U • i O Z *v x CL N -■ - = -J r t V K z> W © O ‘. © © O © © •* ■»* X > <•. »N © * *• j- r L_ l>. V © in © *• G * k © V. © i__ i__ H t—i © c s jv; k a f>j» ^ i i *•■+ ir« © « G *> u G © *» 4ft k. _J © © x •• ^ k- N II 1 -• * ‘ in 10 «N « V © ro © H U- U 4ft CL Z .-. u © © v f-4 ^© *• *-* tf: lr.* r—i o ■■ z i‘ "i *►. 1- © A a - ' »'■* CL x r © ‘ in © t ^ © -. »N '• © l.M L_ UJ <1 N K o -1 1* 1* •w v-t © /n > ^ a? N K N ^ 'O e © • k ^ CM IX C M n O •! O ** z -J V c t • X *4 \ •o © in © k © © © © H © CM k-i CM 1- 1- © •s O -• k. M K X X : w r ». © w MO ^ in - K 1-1 » Z rt _> lu o X G z N © © i i h ^ - 10 -G in ^ ‘ w -• •:=•• H tl i i Z IX Z Ld O o : _J rt -J O -J G O : *-« •. © © © *• ■C *4 © •o © in IX ll- i _ i u O U -J ■■ 1- U ,k- 2 K k. H rt K - *• 2 in © ^ © © © tH \ ^4 T- - Cl X E * v O 1- A © ^ in ^ rv © © 1C © • a o a t- 1- o a x x > : x = |T| X ^ -o ■*4 © »•© w ll': © *•- Id z = lu = vi a |»_ *. r t Ct s > j'! X + + + + + t 4ft ^ K V © © O' © Id G — *- s Id Id Ml II •• CM M X X >C X X r j sr o* in * G G s Z/ Z/ Z/ i o ** *4 © © ‘. © © © © L_ 4ft CM M*i 4 w = J hC l Z K M Ct 4ft Id X > z z z z z : a ifi n © w w O' © S , © L i ' M -■ X + I- J «x Id Z Cl G I N O a t - w i u e ^ o © V G •i' > II o a 4ft •-* + I- 3 H ( 1 L . T-* (J m m x m : a ii *. *. ^ in t ro © H ’f 2 -• CL *. © v u o fc. /N /N + + + + + id »• ro *1* ^ N © o © G = © n rt © c — o z o >c > x x x x K © f n © ’O ^ © 'O © Z h v v W V V in c i s z a h = a © '-' G ^ h ^ - j h < O h O © 10 N © © © a Ir*^ H P : * i - i r t *• o -o ■ v K M * 4ft 4ft 4ft * r i/i cm s s *. *. © ^ a = v * © * — Ps . ro ^ 4 * G G © © Z> 3> Z> © © © « a ►. © in g © G G G G G i © Z V II v i W CL II m 2 - I + :> /-*. Z> I! O O X IIZz Zz Zz Zz Z z X : I! ^ X II ii x o y.i (M © ^ n io 1 * in 'O r - © o . G ^ N f O ’t i n ' * ? *4 -+ ^ ^ (>4 ro ro ro ro io to inininininin m m *0'0,0 ,*j,0 ,0 ,0 N N M N N CM CM W N CM N N «>4 NNCMNN

44 MICRO - The 6502/6809 Journal No. 54 - November 198 GAMES FEATURE

Id Q. N u £ Id £ k. O rt a X rt z rt H z u a t- O a z a _l rt «x z a a z x D x O o H • Id rt n o o t- t- X I rt IJ H z> h : rt I> r a IJ ij Z *v o u i * o o t- ij _l u o o a o > r i o CL CL D 2 a r r- ij o : D Q. a c o 2 a O i Z rt a a uj _i z o u z a z a i J CL U z o u o X m a a z I> o UJ a z }- CL Z D I CL Q z t- id Id UJ 2 a a _l I> • u. x rt O O a Z H ld 2 2 CL o c o a: I o o rt C u_ : 43 a > Q x a o _l H o ►H t- *v h »- a G O t- IJ t- O i/1 rt E *i Id Z rt Id CL L. m X 2 a O © a X u a •I CL A a rt o D rt IJ o > X • t - CL H t- s o a IJ Cl rt X X F ■ a X a rt r t- rt E a > ui • ■ ■ —• z a z Id t- a id a t- 63 KS O C U. X X Cl ■ ■HD 2 r t 2 X r g OX t- G G u i c o u a z r a UJ t- CL CL t- a t- I Oi Z 2Id a x c o f ■» a 2 X • o x r cl i-. o o Q cr i id CC rt Q •_ Z >1 s *. r t r t t- E rt -■ a -J a _i t- u a id r _i X ct rt 2 _i rt a a CL > Z L3 X o E u — o a UJ K -J > Id a c z Id CL g J I J z X r- »- C rt •H C t- 3 z a a a i - r t Id H o £ c c u id U UJ 2 a H H S D a G o a •o *-• Q *h r 3 H *-• Id j . _l a _l u. > IH o ct x (E Ct CL Z ! 2 t - X UJ C UJ 2 43 t - r i UJ a t- Il I-Il UJ 03 3 UJ O -J CL c U_ O H o 3- Z UJ u u t- z > r *. o cl cl o a o o a z ►h a c U. IJ rt z- a a UJ c t - U UJ z a u K CL UJ O u a a t- cl z n r a z G rt a t- a a CL Z > > x o o => a o o rt Cl CL Ct Ct o I > o x -■ UJ Id Cl ^ H 2 rt H H 2 K u. Z U G X U_ Id Id cl j a Id \n <1 t- Id H ct a c a i a a rt n z Z *i Z UJ z o »» s X UJ t - o LL ‘ 1 rt t- O t- Ct a _i a z 1 Id li ■! O a cl Id o UJ Id UJ dj o C 2 C Ct G ^ UJ UJ i - z * - a H o o t- ■i *i r a a a r o SC O a 43 Z r= ii z> o 3 Lt 2 CL I- J C Ui CL O u. UJ > UJ o UJ *■* Z H o o G G a 2 -• e o u UJ o o a o u c a td U 1 UJ o «• z a ^ a z X e X o a o i - i a uj o r o UJ h i h r uj r u uj z X »- o *. w CM tt H t - > E r t o C Q Id X rt a x > * ■ o H — UJ CL Z iU UJ 2 U U t- * k- •* h C* k- G t- t- © V) > -• O -1 10 rt CL U • z r t > Ct x T *-*_!*■ G X r * ». © rt -■ — G *• g v) *■ © rs k ro ■» © * s © a ro U 3 •H u JOD t - X. J G UJ Ct t - © © G s s •t MN G CM CM ’*■ © *■ o d G •» *■ s m © a e t ' p> a u j u. y y j l i - C Id Z X j. rt i »» si z a CL £ r UJ ‘- * ‘ G O G O *> ^ Id © © © - <• ro UJ G G © *■ © io a z o Z CL d j C O G- II *- id id io a rs n uj rt G a H O O r t o a a x x uj ij a I (t *. K cm *• *. k k k G © © © CM ^ ^ © k- V © © V V <1 D a D D z a u D x > r- u z> “■ O -■ 10 s v *. ■•. ro ‘ 00 ‘ ‘ *. ». *. *.0-0 (M 10 *■if; K KO ‘. «• * ^ © G G G CM CM© - © © G © © © © (M > r« io o 10 G © > © ro 10 © © 10 = I- > 2 > > »- o a t- > * * Q a a a n a a

© k, 10 ij £ GGG u O G rt — k. CL G * s ■o G © L. — k, s G rt IN © © © u j a ». k. © © G © © u _j z G GG k, © N ’O © a a i-i IN G k. — G G U G © O' 10 t- o IN k. "O k. s ^ O' k, G © s K z a — ■o G rt G G G ■o © © t- — rt s 'O s 10 k. © G s ro O' N S a j v-« G IN k. G G © l\ G G G s © o J u. J -i * *. G © — rt C*4 © 10 k, — © © G in © © © G 04 v-« k. G CM G — IN s S s G © CM U. E O C a X T IS. G © — P'. 10 k, k. k. © «« iN © G k. s 13 © G © K CM CM «J j a a O r t O o rt o »N — © k. 10© CM— ©’ k. © CM k. k. ■t G k. k. G — io a z u z CL ■* \ k. k. k. k. © © © rt © © k. G © k. s rs s a i- * * r u *■ H -J E 3 rt O Z ir t- G •t G G G © G 13 G k, ■<*>IN G k. rt — Ps 0 © UJ ^ ^ rt Q. rt a CL *■ L- ^ u z =? « z © k. © k.- k. k k. — k. — k. G G © k. Ps iT i C-4 © k. CM © ij s k, ^ > Ct ■* O 2 UJ a o a t- X I-I u:i t\ •* M — GG k. rt s 10G © "O© f\ G X U. t- -J * O o H Id © © CM rt k. k. rs G P'. k. ^ 10 — G G * © rt s © © * CL *-* 2 0. Z U. * . • » » . s 3 Id U *- I n : U; in IN »■ X 2 2 2 0: iY in 1010 rt rt k, k. rt G 10© © — r. © rs r » is © © s X U h r t O ^ 2 h O s UJ t- UJ 1 a © G k. C-4 C-4C4 G G G G © © © k. •«} —SCM ’C © © I- a * * c ii s Z rt CL -I = X X z u z o s © G ll^ rt 10 10 k. k. in io 0. rt SG Ps © i> — "0 -I -J rt » i r V ■» rt »- a t- > » - a j a © G © s k, k k. rt *NG 0 to G Ok '■*3© G k. k. s k. «« iN •3 £ O O ** *■ Id t - >■• = Q rt A u a u z K0? in tn to G GG rt C-4 © G rt © k, <> s IN G © 10© © © rt a e ct 3 uj CL £ * X II s s G UJ Z > > I> rt 3 o © © O'! G © k. k. k. k. ro G C-4 k. 0 H' G G Ps G CMG k. ■cIS s k. c? rt n a a a OOJ= ^' c a o aj o dj a rt a o © — in © G © Vi © C-4 f-i f-i C-4 fN k. C4 rs © k. C-4Ps <> — © © t- ^ o o a ». K K Z 2 O z o a o ct •* s y© © rt rt G V k k. C-4© © Ci — © G © rs CMPs © k. s z E ij J ^ ^ H K I C r t S u. u U *-• UJ Cl u:« © G k. © G © © G ro k, k. — © k. *0 © O' s k. G G Id D H y H :• u. o £ UJ ^ ‘ i : a CL CL CL UJ u _j ». <0 G G •o O-10 k. V; ». — GG k. k © k. ro © 10 © G G G * ~~t -i cl z z «• t- rt CL X = o x a a a a a 2 a j © © G k. k. k. © G G G k. © © © s © k. k. s s k. CMn: *■ ^ G *-* rt •* -■ s *- CL u ct a o ct a — © G © G G C-4 k, f-i k. G G O' G k. © k. © G © © G — 10X Z O ^ »■U ^ ^ d a x a w- 2 j : a £ j a r © ». © k. k. k. k. © k. © k. k. — © * © •<*I k. k. k. k. k. s t- 2 o a rt X CL QIU 1 - 0 0 O O O -J rt _J rt r.i k. S G G G G © 1*0 n G © © f-i k, •<3 s rt G © © © G © CL C G H W l > > a © * © •* •*■ k. k. k. t4 •o K k. G k. G s s k. k. k. © k. c G v rt X a X •■ = a a «■ * a * a a v a a © K k. © .G © G k. © © G G — k, k. ro © G G — G z *■ K _l ^ ^ o 4 rt s •ij Vl — k. ». U I j = © © © - © © © © © * © © © •t- ir © © © G ■f k, — © * © rt •c 13 •* rt Ps © rs k. © o Ct C Ct X o £ 1 a c H (M K k. k. 't k. C-4 k. IN k. k, k. k. k. k. k. ro k. a o * o h r t * rt aj ‘ - © G G © © © © r. O' ‘ © © Ps Vi © * k. G 10© C-4ro G C-4 — C4 * — ▼ © G ». ifr *. s *. *. v ii 2 •» ». s •» — © u:- G "O •t © © © C-4 G © k. CM C-4CM■o G *0 •0 — k. > u. r - U 1 o ‘ if H 1 U ‘ © «N in © © © © © © ’-I © © — — N P-. IS •* © —— © Pv G © © rt 10 •o rs — S z Q. U. r Cl D o ct C l 0 2 *.*.»» K *. *. u:> *. k. k. k. k. k. k. k, k. k. k k. k. k. k. k. S k. k. k, a D O w h J £ D Cl I- * = © — ^ © © N If} -0 © O' © PO v-« © © © G © © © f-l — © © ro — G C-4 © •t G 13© in g •. fc. s •» ». ►. s Vi G in rt in 10in © © © C-4 *0 io ro Ps IS.© © io in ’t- © t- h Q(1 J l d l - J t - rt CL © V * © © © © rs © © © G fy. f-i u:* N N N C^ n P-. P'. Ps. P.. © G — * "0 Ps IS © © in 'C © © j m j m y h Ul ce z> *-• k. *. K + 10 IT' in to in rt rt rt rt rt rt rt rt ' IS rs IS a: o a o3 a rt i a *i i iv © — in ro in r-.. © O' © ^ CM io t in o 4 ro r* n io ro ro ro ro ro 10 in -o -o "O *0 "O "O r,« ro r> r.i r< ro ro ro rt ro ro ro r> ro ro ro m rt to ro ro ro ro ro 10 ro ro ro io ro ro io 10 10 10

No. 54 - November 1982 MICRO - The 6502/6809 Journal 45 fee

a? LU .Q cr 3 O

d) O cr > £ Q_ CL cr a CD Q_ < CD *0 CD o CM ffl m i 00 CM a N- co 00 Z a < IE LU < o ■o to cr o X 44 Q- X CL o 1- I— Q_ I- 2 » O o 3 o o a CD O £ w I II O- £ X O) o LU _ O 1^ c o w fee ■o cr (U C7> -C 2 fee 1- h- 1— _i o ., cr cp .Q- O _l x CL 03 cC X NI z c z ZZ O) z UJ co N m J- ~ *0 O cC z LU CL LU LU CL CO Z «J Q) LU _l $ < _l _l tt "ca O X O ® ~ w X r? OJ O) QZ ca *_ Q U_ o Q + + u p m 1- fee >s t>e c a> m Q Z a ^ I— (0 co io , ee o < CO II S' > CT) I— 1- 3 *o 00 LU 00 I co CD Q z Q "SCD : CM _i z Q_ X fee qc O ■Q * r r A CM :' " cr .c o = cr O? _l o Q_ co LU X < LU o . CL CM : o» X ? £ CD ; CO o- _i LU _i LU CM LU c V a? cr a) r £ z • . X CL fee z N- _l N- a> ee ^ cr ° - CM Q tl ll F 5 lu cr cr cr O o o o o lu cr O uj lu X > X > X cr i ? Q cr cl a CL LL CD LL u.. o X cr cl il cr z cm oo uo CM 00 COCT) CO CM O) in CTi OCON-COO t-CMCO 00 CO N- ^r CD CO N- t-CMCMCMCMCOOOCOOO CMCMCMCMCMCMCMCMCM

UJ z y D •» o * > N D S > a y z o z O X z »- o a Q y w UJ z VI »- *- H © z a a VI X a sc z H o a O N a o © D a * -1 X h- z z U. — u. z V) z ^ © 3 o Z H m in a o O CE L_ V) o VI H z X u. V) ». A a y J3 > o H O O IX > o X a X y o y io H H Z y o u »- »- u y o a o y r z u. a n VI A O 5C o z y U H X •» y > H VI o y o H h. ^ a o o a H- Q D Vi y s _i ct y cl n N H ct r 3 O u> a o »n O a u Z UJ o Q z *. H o r •» a t- M N n a g y _ i -1 Z z CE K > Z Id HX V) 2 K > v> X y H L_ © » Z c “ D y o y CE •n H H H in CE _j K X O 2 IX Ml H i—r CE G CL 0 X y a V) N N Vi »- © c c O 1*) *» © u O CE c t M*l 2 2 H C <£i u VI z K M CL Ml X G ^ • ■n ; o r O © X *» 3 X * E h- UJ a j 2 O a 0- y t- vm c -1 O VI •* z * X a c a > H a u a L. K Vi in uj •I z ». K »- U- o o _i V LL 1- UJ P 1- Ct © y z •» X ^ tr G a y a A y o ' X X Ct K o LLId 1 a UJ X V c G 2 (1 1 0 2 y y • z z in z ct Vi o X o a a H t l u i CL Id L_ t- m j k 'O a 1- ^“5 Vi »- z VI z y s M X ** •X *•* y vi G *• h L_ *. Z 1- z ; CC o ■\ XG O G X H o © o - z CL a: o Z CC 5 Ml O a iTi I- UJ 1—4 o ■i 2 li — ■ z ‘ ■X p> Ct V) y G •» z © o N r 2 Ct -• 1*5 > y n g*i U a z c s -1 z of CC o o •n > X _i 2 Z *-« X ^ C-4 X VI o y -■ Z Cl v U o a H -1 Ml i— 2 0 z 0 C Q y a: i—r x y x _i o o ct o z y i k. 3* X y y Ct O VI C t Cl UJ X u LL a M*l H Z h- 2 o c 2- X Vi z H dj Ct aj z y tr H Q G aj u a h- X H U LL CC t—it—i u z h- 0. y z i iN u. 2 •H 3 2 UJ H H X a y Ml t-t z z y 3- hH a UJ H K a G 0 2 Id X X w z i Cl H X X cl y y u. •» t- ^ VI a 2 IX L_ ■i z Ct u Cl o z G y G x y =• s y y ti ct VI c z u. N * _i G •x k- aj •I •n U ■X z CL •nX LL O 1 z z H i i a % »n z y q y a j k 0 N V M y z S © C •n a v—: 1*1 ( i : U a LL X o 1 H Ct H y Z _i X h u. H z * o *. n »n X H © *■• Q U*l a •I Qi ~i G a 1- jcl *J N X aj ll X o H 0 x y it a t-« to * c a K X * U ~T 3 Q c — ►H u 25 O z 1 3 i—r a i: G ct z o N © r: 0 Q t-i |fi o a H i**: UJ «T< i- Cl t i Cl O UI 0 H -1 IT O U X o. Z O H- H- © H —i K »n J _i y Z Ct > M z -1 x •. z O * aj UJ h-4 c 1 • I z _1 aj H 2- H z z 2 1 U re X 1_i X aj K H o UJ X o ll -1 aj tr l\ t- m y S —- l a j H X t—i o K _i H t—1 M'l M*l X y y ce t—i k. X o ct X. X z> r» X M vi in 2 K •i ~ 2- M*l M*1 Lt z i—■ ^ _l x t—i H i 3 LL G y y -i ct X z * ■v. 1C C dj K Z 0 y aj O "> -I Q o 1 0 aj u u «n a 0 ■I z h w ■J C 0 Vi 1- Q * in o > o r? r •• u o J _ i a -I LL M*l 1 Vl G ~ z z •» i * X M z o aD J 3 UJ 5 X »;*i h-4 H G u •n a 1 X K z y z o y 3 o N i m 3 y ^ >-4 * v Ml ct ' I •z l _ a |JJ a 2- Vl LL UJ CL I 6 z 0 h t—1 z m y y u. jc r 3 W CC LL CL ij •n ct r s X LL z UJ m'i 5 _i i a Vl K u o i j i: t—i ct L_ X LL X X K CL o y x y x O G z a n UJ t-H OU U*l y*i ~i — Cl* z Cl X y z y t—1 Cl X G O O w G x O aj O LJ C k h-4 t—i H X u . CC -1 X LJ •x Z G H X •X £ _i y Cl ct i: Z X G y z z G -1 O -j VI K u -1 1- ui G Id r> U VH J- Vl z -J -i h y o •x _i _i rt X Q z Hi aj z o Cl _ l H o a: u LL Vi T* t—i «x Cl •x y o i •j *n g y -1 £ o *-• LL Id y aj G _l Z IX 0 u. y o o JLLJ o O u U •X Vi 2 •n a Lt JC r . i z z Cl t- o aj o. y o 3 X 1 O y y ►H 2 ►-4 H M G -I UJ Ml CC y G » - M*l 2 aj •n Z G Cl X o X t- M ct Ct y Vl 1 Cl CL z Z H dj •I z UJ UJ z j L CC a z z 1—4 Lt y a r a y h x y Z * o t- X O ~ i h “I UJ 2 a UJ UJ ” r UJ h i a . o K y aj vi o u o o •n aj H r i*_ _i * z o o X o o LL u z Id u X X o O X H Cl r> V- t—1 % oc* X 1—4 a x . ■+■ © o k. © o M X z z © y > K oJ _ l K a j -J H 1- ■> K K-4 K Ct •n K T4 LL K ■pH a a m o z CE X z n *.i r t i a a t *. ai m a n X X F ) & x r:< -I 1 y t-l * LL « - Id u j ■> X y * h - a •I i j 1 •I 1 IX •X 1 •X «x 1 a a •I -I •X Z 1 H 1 V i a x a i x X laoaaffhaQaN x j a X X G X X Z» 1 KKH HKK K KKK KHH HK KKX K G h h HH 1- 1- h \l-OI-l-l-H -H h *> t- X H © 1- t- N h h O h O) «r •I • i a i 4 Q CL Q \ Q Q Q G Z G dCi q u o s. Q O G O G C*- © i>4 P*« 'T U'i v. r. © iV O r:« 10 F> r* r*i T 'T ^ T li*« V' IT' ii? If' in if' TT ■f ■i- T ■i- ■f ■i- ■i- T ■* ■i- ■i- ■t ■i- ■t ■f ■i- ■i- ■* ^ ^ ■t ^ -i- T + JUORf

46 MICRO - The 6502/6809 Journal No. 54 - November 198', Lisa 59.95/79.95 Lisa Educational Pak 79.95/119.95 Alien Ambush 19.95/29.95 Bandits 19.95/29.95 Cannonball Blitz 24.95/34.95 County Fair 19.95/29.95 Cranston Manor 24.95/34.95 Cyclod 19.95/29.95 CHRISTMAS SEASON David’s Midnight Magic 24.95/34.95 Dosource 3.3 24.95/39.95 SPECIALS! Dueling Digits 19.95/29.95 Let ARK COMPUTING Make This Your Falcons 21.95/29.95 Best Christmas Ever! Firebird 21.95/29.95 Foosball 19.95/29.95 Horizon V 25.95/34.95 Super Fan II by R.H. Electronics 5 9 .9 5 /7 9 .9 5 Genetic Drift 19.95/29.95 Kabul Spy 24.95/34.95 Applicard, a high performance Z-80 card Jelly Fish 19.95/29.95 with 6 4 K Ram, complete with CP/M Lemmings 19.95/29.95 4 mhz 324.95/445.00 Labyrinth 19.95/29.95 6 mhz 395.00 /595.00 Mouskattack 24.95/34.95 Outpost 19.95/29.95 Microsoft Z-80 card with CP/M and Red Alert 19.95/29.95 Microsoft Basic Pig Pen 24.95/34.95 2 mhz 209.95/395.00 Russki Duck 25.95/34.95 Microtek Parallel Printer Interface complete Minator 24.95/34.95 with centronic compatible connector Track Attack 19.95/29.95 04.95/79.95 Thief 17.95/29.95 Space Quarks 19.95/29.95 Lazer Lower Case 4-Plus with Character Snack Attack 19.95/29.95 Set +Plus 49.95/84.90 Swash Buckler 24.95/34.95 Lower Case 4Plus alone 39.95/59.95 Gin Rummy 24.95/34.95 The Dictionary 69.95/99.95 Lazer Graphics 4-Plus 99.95/159.95 General Manager 99.95/149.95 Graphics 4-Plus and 4 Ft. Disk Cable 19.95/29.95 Lower Case 4-Plus 134.95/219.90 Visicalc 179.95/250.00 Using 6502 Assembly Computer Stop 16K Ram Board 09.95/149.95 Language Book 14.95/19.95 Computer Stop Omnivision 80 Column board Kids and The Apple 129.95/295.00 Computer Book 15.95/19.95 Apple Panic 19.95/29.95 Videx Video-term with softswitch, inverse Kraft Joystick 49.95/69.95 character set and 80 column Visicalc preboot 295.00/450.00

Wizard BPO 16K buffered printer interface m i (expandable to 32K) 134.95/179.95 Your Salvation In The Sea Of Wizard 80, 80 column board 195.00/295.00 Inflation. Lazer Pascal 29.95/39.95 714735-2250 Anix 1.0 34.95/49.95 P.O. Box 2025 Lazer Forth 44.95/59.95 Corona, CA91720 D Tack 68000 board for the Apple II with 4K Ram 8 9 5 .0 0

Lazer Model/32 (16032 board for the Apple II) CALL!

No. 54 - November 1982 MICRO - The 6502/6809 Journal 47 ROCKWELL Microcomputers from Excert, Inc

THE AIM 65/40 THE AIM 65 Single Board or Smorgasbord Take-Out Order

• 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 ACIA 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 (1 K 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 EXCERTINCORPORATED Higher quantities quoted upon request, COD's accepted, * SALES P.O Box 8600 shipping will be added. ‘ Deduct 5% cash discount on • SERVICE White Bear Lake, MN 55110 prepaid orders. Minnesota residents add 5% sales tax. * INSTALLATION Prices subject to change without notice. • CONSULTING (612) 426-4114

48 MICRO - The 6502/6809 Journal No. 54 - November 1982 SYM 23 Matches

by Matt Gan is

Two players alternate, removing matches from a pile of 23; the 23 Matches THIS IS R GAME OF 23 MRTCHES. player taking the last match EACH PERSON (THE COMPUTER AND loses. On each turn a player may THE PLAYER TAKE TURNS TAKING take 1, 2, or 3 matches. AWAY MATCHES FROM THE PILE. ON EACH TURN YOU MAY TAKE ONLY 1,2 OR 3 MATCHES. THE PLAYER 23 Matches TAKING THE LAST MATCH LOSES !! requires: BASIC VERSION FROM - 1K SYM 101 BASIC COMPUTER GAMES EDITED BY DAVID H. AHL In this version of the game the human challenges the computer. Key in G TO START GAME KEY G 0260 ' 0200 to begin the game. The LEDs will go blank and the SYM will wait for you to press any key on the keypad. Once ###ZER0 PAGE LOCATIONS USED this is done the computer informs the player that it is his turn. At this point the player enters either a 1, 2, or 3 (tak­ 80 ■ 0200 MOVE = *00 WHOSE MOVE IT IS ing away 1, 2, or 3 matches). The SYM SI : 0200 MATCHES = *01 ..'NUMBER OF MATCHES 32 : 0200 DISPLAY = *02 ,;LAST DISPLAY USED will inform the player of the number of b'3 ■' 0200 RND = *04 RANDOM NUMBER matches it is taking by scrolling the 34: 0200 PTR = *05 POINTER FOR MESSAGES message 'I SELECT....' 85' 0200 COUNT1 - *07 ; DELAY COUNTER 1 86 : 0200 C0UNT2 = *08 DELAY COUNTER 2 Modifications to the program are 87 : 0200 TEMP = *09 ; TEMP. STORAGE very simple: 38: 0200 REG = *0A J1ST REG. COMPUTER MOVE 1. To change the speed of the messages 89 : 0200 SYMM0VE = *0B COMPUTER'S MOVE that scroll on the display, decrement 30: 0200 REG2 = *0C ;2ND REG. COMPUTER MOVE 91 0200 TEMP2 = *0D , TEMP. STORAGE 2 the value at location $02FA. •• 2. To make the computer move first, change the 0 at location $0204 to 1. ':**'*M0NIT0R LOCATIONS USED#** 3. To alter the number of matches used, change the $17 (hex $17, decimal 23) 93 •• 0200 GETKEY = *8SAF GET A KEY FROM KEYPAD to the number of matches desired. The only part of the program that might be used in another program is the 'display-a-message' routine at location 94: 0200 LED *A640 LOCATION OF 1ST DISPLAY $02EE. This routine will scroll a 95: 0200 SCAND ■ *8906 ;SCAN THE DISPLAY 96 : 0200 ACCESS = *8E86 ;ENABLE SYSTEM RAM message across the SYM displays start­ 97 : 0200 SEGC0DES = *8C29 ;TABLE OF SEGMENT C0EES ing at the right-most display and ending 93 : 0200 KEYSTAT *396A IF A KEY IS DOWN C=1 at any desired display. Just set the zero page pointer (PTR) to the location of 100 0200 #= *0200 the message (lo, hi), and load the Y 110 0200 20 86 SB MAIN JSR ACCESS ENABLE RAM register with the number of displays to 121 0203 A9 00 LDA #0 be used minus one. Then do a JSR 121 0205 qc; 00 STA MOVE ;PLAYER FIRST MESSAGE. 130 0207 A9 17 LDA #23 130 0209 85 01 STA MATCHES ;MATCHES=23 14a 020B A9 42 LDA #*42 140 020D 35 02 STA DISPLAY Mr. Ganis studies computer science at 140 020F A9 A6 LDA #*A6 PACE University (Pleasantville/ 140 0211 35 03 STA DISPLAY+1 Briarcliff). He may be contacted at 150 0213 E6 04 RANDOM INC RND GENERATE RANDOM # Sheridan Road R.D. #3, Lebanon, NJ 160 0215 20 6fl 89 JSR KEYSTAT ;WAIT FOR KEY DOWN 08833. 165 0218 98 F9 BCC RANDOM ;IF N0 KEY,BUMP RND (continued)

No. 54 - November 1982 MICRO - The 6502/6809 Journal 49 23 Matches (continued) 166: 021R R9 00 PRINT LBR #0 ;PRINT MATCHES 167: 021C 85 09 STR TEMP 168' 021E fl5 01 LBR MATCHES' 170: 0220 38 PNT2 SEC DETERMINE TENS /AlCftO 172: 0221 E9 0R SBC #$0R ;BV SUCCESSIVE 174: 0223 30 04 BMI PNT3 ;SUBTRACTIONS OF 10 New Publications 176: 0225 E6 09 INC TEMP BUMP TENS SPOT 178: 0227 D0 F7 BNE PNT2 .: BRANCH ALWAYS 180: 40 Computer Games from Kilobaud 0229 18 PNT3 CLC 182: 022fi 69 m ABC #$0A .•' RBB 10 BACK Microcomputing, edited by Emily A. 184: 022C RR TAX ;TO GET UNITS Gibbs and Jim Perry. Wayne Green, 186: 022D BB 29 8C LBR SEGC0BES, X ;GET SEGMENT C0BE Inc. (Peterborough, NH], 1980, 148 188: 0230 SB 41 Re STR LEB+1 ;2NB BISPLRV 190: 6233 R6 09 pages, paperback. $7.95 LBX TEMP ;GET TENS 192: 0235 BB 29 8C LBR SEGCOBES,X .: GET THE C0BE 194: 0238 8D 40 R6 STR LEB .: 1 ST BISPRLV 40 Computer Gaines offers you some of 196' 023E f)5 01 LBR MATCHES ;TEST FOR ZERO the best game programs from recent 198: 023D D0 63 BNE OVER .: MATCHES, BRANCH IF tv 200: 023F 4C B0 02 JMF LOST .: SOMEONE LOST ! ! issues of Kilobaud Microcomputing. Nine game categories offer something 202: 0242 09 01 OVER LBR #1 ;BETERMINE’ WHOSE for everyone. Accompanying articles 204' 0244 38 SEC ;M0VE IT IS BV 206: 0245 E5 00 SBC MOVE .: COMPUTING M0VE=l-M0Vi explain how to play the games and in­ 208: 0247 85 00 STR MOVE crease the odds to beat the computer. 210: 0249 F0 27 BEG COMPUTER JIF e COMPUTER'S MOVE The games are written in different lan­ 212: 024B fi9 IB LBR KPLVRM0VE ;PRINT THE 214'- 024D guages for various computer systems. 85 05 STR PTR , "YOUR MOVE' 216: 024F R9 03 LBR #>PLVRM0VE MESSAGE 218' 0251 85 06 STR PTR+1 CONTENTS: Gambling; Racing; Space; 220: 0253 20 EE 02 JSR MESSAGE ;b i s p l r v it Board Games; Card Games; Guessing 222: 0256 20 RF 88 GET JSR GETKEV ..'WRIT FOR F'LRVERS 224: Games; Puzzles; Calculators; Odds and Ends. 0259 C9 34 CMP #$34 ; MOVE 226: 025B B0 F9 BC3 GET ; BRANCH IF KEY!; "'4 " 228: Science and Engineering Sourcebookby 025D C9 31 CMP #$31 230: 025F 90 F5 BCC GET ;BRANCH IF KEVC" 1"' Cass Lewart. Micro Text Publications 232: 0261 38 SEC .:CONVERT FROM ASCII Inc. (One Lincoln Plaza, Suite 27C, 234: 0262 E9 30 SBC #$30 ; TO INTEGER New York, NY 10023), 1982, 95 pages, 236: 0264 85 09 STR TEMP ;KEEP IH TEMP 238: 0266 R5 01 6 x 9 inches, paperback. LBR MATCHES .■ MAKE SURE PLRVER :-!S ISBN: 0-942412-02-8 $9.95 240' 0268 SEC . i I L r; T i Ah l H U K h 242 0269E5 09 SBCTEMP THAN WrtRT S IN I fl E 244: 026E30E9 jih I GET •;.c] j B R AN C H I,- SO A book of professional applications pro­ 246 02SB01 STR HATCHES t.Lb£ b 1 URL S Li L i" Li 2 Jfip grams for the TRS-80 Pocket Com­ 243: 026F4C lfi PR I H I , FiNB COHTI HUE. puter. The programs cover problems in \ :uf1PUTERS MOVE#** the field of electrical engineering, !50: 0272R501 COMPUTER LBfi fiRT CHES statistics, queuing theory, reliability, •icr • ;IF MATCHES=1 8274C'H 01 CflP #1 ;C-UMPUTER LUST graph generation, artificial intelli­ is 4: 0276B0 03 BNE CMGVE :'5t"' gence, and related technical disci­ fi2784C RB 02 JMP FINISH ; JUMP W IT H R C C =1 plines. A table of conversions make the : 027B4fl CM0VE l S'R .. COMPUTt - :t"Q: yv 7u4H l SR .'■ R = 4*IH T (!’1RT C H ES/4 } translation of these programs applic­ :62' 027D 0R RSL able to other BASIC computers. :64- 027E 0R RSL 027Fr.cr !fc*b : 0R STR RE G ,KEEP I T IH REG :SQ ■ 0281 --'o SEC CONTENTS: Foreword; Introduction; Elec­ ..COMPUTE - ;?0: 0232R5 01 LBR MR TCHES R=MRTCHES-REG trical Engineering; Data Transmission; !?2 : 02840R E.j SBC REG Number Theory; Computer Programming; :74 ■ 0286S50fi STR REG ; KEEP IT IH REG Computer Generated Plotting; Probability ;76 : 0288C9 01 CMP #1 IP REu-1 THEN and Statistics; Mathematics; Operations ■73: 028R £013 BNE CM0VE3 JMRKE RRNBOM MOVE Research; Miscellaneous; Appendix. ;***RRNB0MJMEER 1 GENERRTOR***; Games for the ATARI, by S. Roberts. iS0; 028C DS CM0VE2 CLB ;EINRRY HDDITIOH Elcomp Publishing, Inc. (53 Redrock '31: 028BP5 04 LBR RNB ;GET RUB Lane, Pomona, CA 91766), 1982, 115 i'S4- 028F0H RSL ;COMPUTE - pages, paperback. iS t '■ 0290 0H RSL ; RNB=4#RHB !:S3: 0291 IS CLC ISBN: 3-911682-84-3 $7.95 ■30: 029265 04 RBC RNB RHD=5*RND !91 ; 029413 CLC Gaines for the Atari provides ideas on £91 : 029501 69 RBC #1 RNB=5*RNB+1 ■‘92: 02978504 STR RND how to create your own computer >94'■ 02992903 RNB #■-.'000000 11 ; MAKE SURE KRND<3 games. This booklet deals primarily iS6 '■ 029BF0 EF BEG CM0VE2 ,'HO ZERO'S ALLOWED with BASIC examples with only one i!98 : 029BD0 12 BNE BONE .: BKRNCH ALWAYS •:00: example in machine language. Atari 029F13 CM0VE3 CLC >02: 62R0H5 8R LDR REG ;COMPUTE - programs show the possibilities of :i04 - 02R269 03 RBC #3 ;REG2=REG+3 using both graphics and sound features. i:06: 02R4W-JijC 0C STR REG 2 •:03; 02R6 4fl LSR .. COMPUTE - >' 10 : 02R7 4R LSR ; 4*1HT (REG2/4) CONTENTS: Drawing Figures on the J12: 02R30R RSL Screen; Movements in BASIC; Movements :J 14: 02R90fl RSL in Machine Language; Movements of 516- 02RH 850D STR TEMP2 ;flHB KEEP IH TEMF2 Missiles; Overlapping Detection; Sound- n s - 02RC 38 SEC DETERM I HE MOVE BV (Continued on next page)

50 MICRO - The 6502/6809 Journal No. 54 - November 1982 ■ i GAMES FEATURE WM

23 Matches (continued) 320 : 02AD A5 0C FINISH LDA REG2 COMPUTING - New Publications (continued) oklii! ' 02AF E5 0D SEC TEMP2 , REG2-TEMP2 324: 02E1 CjCJ 0E DONE STH SVMMGVE JTHIS IS COMPUTER'S MG'' features; Programming the Joystick; 326 : 02E3 OO SEC Backgammon; SMARTY; BOMBER; • 02B4 A5 01 LDH HATCHES .'■TAKE h Uh Y FROM FILE ROBOT ATTACK; BALL; SMART; BAR­ 330 •' 02B6 E5 0E SEC SVMMGVE qcr RIER; KNIGHT-BATTLE; CALENDAR; : 02ES 01 STA MATCHES ;PUT RESULT EACK GUNFIGHT; Appendix; The Video Pro­ 02EA 0B LDX SVMMGVE ,GET SEGMENT CODE 334- f\ 6 cessor "A N TIC " and the Atari 400/800; 336 : 02EC ED £9 SC LDA SEGC0DES,X ;OF COMPUTER'S MOVE 338 : 02BF sn 51 03 STA C0MPBVTE+1 .;STORE IN MESSAGE Display List Interrupts and the Atari, Atari 3 4 0' 02C2 f\'3 44 LDH ttCCOMPMOVE :F'RINT THE 400/800 and CTLA/GTIA; The Atari 342 = 02C4 ijc 05 STfi PTR ; "I SELECT X" 400/800 and its Character Set. 344 •• 02CS Fl9 03 LDH #>C0MF'M0VE ;MESSAGE 346 : 02C8 8:5 06 STA F'TR+1 Apple II Assembly Language, by Mar­ 348 : 02CA 20 EE JSR MESSAGE ■DISPLAY IT vin L. De Jong. Howard W. Sams & 350: 02CD 4C 1A .; CONTINUE JMP PRINT Co., Inc. (4300 West 62nd St., In­ 3 5 2 : 02D0 A5 00 LOST LDA MOVE ;SOMEONE LOST 354 : 02D2 C 9 01 CMP #1 ;WHO IS IT PRINT dianapolis, IN 46268), 1982, 334 pages, 356 • 02D4 F© SA EEQ PLAVER ;IF M0VE=1 THEN PLAYER 5 V* x 8 16 inches, paperback. “.Cj C; ■ cj"7 02D6 fi9 LDA (KC0MPL0SE ;PRINT THE ISBN: 0-672-21894-1 $15.95 360 - 02DS 85 05 STA PTR ; I LOSE .. " 362 : 02DA f\S 03 LDA #>C0MF'L0SE .: MESSAGE 3 6 4 : 02DC 85 06 STA PTR+1 This is a 6502 assembly-language man­ ■366 ; 02DE us 08 EME DISMES .: BRANCH ALWAYS! ual written for the beginning assembly- 368 : 02E0 fi9 2D PLAYER LDA IKFLYRLOSE ;PRINT THE language programmer on the Apple II. 370 : 02E2 I”! 5 05 STR PTR "YOU LOSE 372 '■ 02E4 R9 03 LDA #>PLVRL0SE :MESSAGE Dr. De Jong introduces each topic in a 374: 02E6 85 06 STA PTR+1 building-block concept, starting with a 376: 02ES 20 EE JSR MESSAGE DISPLAY IT description of a microcomputer and 02EE 4C 00 START ALL OVER -'1 JMP MAIN continuing through interrupt program­ ,:***DISPLAV fi MESSAGE*** ming and real-time applications. The book is carefully written and well il­ 02EE H0 fi:-: 3 8 0 : LDV #3 NUMBER OF DISPLAYS lustrated with programming examples. 382 : Ci2F0 B1 05 MESS1 LDA ■;p t r ;',y GET A BYTE 384 : 02F2 30 20 BMI EVE .: IF NEC, STOP The only possible flaw with the book is 33 6 : 02F4 91 02 STA (DISPLAY).. Y .: DISPLAY IT that it quickly gets technical after the 3 8 8 : 02F6 DEY first half dozen chapters. If the reader 330 : 02F7 10 F7 BF'L MESS1 ,:KEEP GOING 392: 02F9 R9 02 DELfiV LDA #2 .: DELAY H LITLE BIT were truly a beginner, he would find 394 02FE ■|C 07 STA COUNT1 the material difficult. 396 ■ 02FD A9 FF D1 LDA #$FF 398 : 02FF 85 08 STA C0UNT2 CON TEN TS: The Microcomputer System,- 400 : 0301 20 06 D2 JSR SCAND .: SCAN THE DISPLAY 402 0304 C6 08 DEC C0UHT2 Writing and Executing Simple Assembly- 404 ; 03S6 D0 F9 ENE D2 Language Programs; Branches and Loops; 406 : 0308 C6 07 EEC COUNT1 Logical Operations and Shift and Rotate 4 0 8 : 030H Dfi FI BNE D1 Operations; Arithmetic Operations; Ad­ 410 ; 030C E6 05 INC PTR BUMF’ FTR dressing Modes: Indexed Addressing; Sub­ 412: 030E D0 02 ENE D3 routines, The Stack and Interrupts; Addi­ 414: 0310 E6 06 INC PTR+1 ; DOUBLE BUMP 416: 0312 D0 DA H3 ENE MESSAGE ,BRANCH ALWAYS tional Programming Topics; Programming 418' 0314 60 EVE RTS with the 6522; Applications; Decimal, Binary, and Hexadecimal Number Systems,- Additional Circuits and Programs; Pin Dia­ 413 03 IE *= $31B grams of Some Integrated Circuits; Index. 450: 03 IB 00 00 00 PLYRM0VE.BYTE $00.. $00 .< $00 DATA FOR THE 452 03 IE 00 6E 5C . EYTE $00,$6E,$5C '"YOUR MUVE Phil Daley 454' 0321 1C 50 00 . EYTE $1C,$50,$00 ; MESSAGE MICRO Staff 456 0324 7 ft 1C 50 . EYTE $78,$1C,$50 458 0327 54 00 00 . EYTE $54.. $00.. $00 460 032A 00 00 80 . EVTE $00 , $00 $80 Kids and the Apple, by Edward H. Carlson. Reston Publishing Company, 470 032D 00 00 00 PLVRLOSE.EVTE $00 , $00 , $00 DflTFl FOR THE Inc. (Reston, VA), 1982, 218 pages, "YOU LOSE.." 472 0330 00 6E 5C . EVTE $00,$6E.. $5C paperback. 474 0333 1C 00 38 . EVTE $1C-. $00,. $38 ; MESSAGE 476 0336 3F 6D 79 . BYTE $3F,$6D,$79 ISBN: 0-8359-3669-4 $19.95 478 0339 00 76 Tf . EVTE $00, $76.. $77 480 R33C 00 76 77 . EVTE $00, $76, $77 This book teaches Applesoft BASIC on 482 033F 00 00 00 ■ BYTE $00 , $00 , $00 484 0342 00 80 . BYTE $00,$80 both disk-based or cassette Apple systems to children from 10-14 years 430 0344 00 00 00 COMPMOVE.EYTE $00 , $00 , $00 ;DATA FOR THE old. The book is intended for self- 492 0347 00 06 00 . EYTE $00, $06 , $00 , "I SELECT K " 494 034A 6D 79 3b' . BYTE $6D,$79,$38 ,■ MESSAGE study, but may also be used in a 496 034D 79 39 -7I' Oi-i . BYTE $79, $39., $78 classroom setting. The lessons contain 498 0350 00 FF 00 COMPE'VTE. EVTE $00,$FF,$00 explanations, examples, exercises, and 500 0353 00 00 00 . EVTE $00,$00, $00 502 0356 80 . EVTE $80 review questions. Notes for the instruc­ tor summarize the lesson material, pro­ 520 0357 00 00 00 COMPLOSE.EVTE $00 , $00 , $00 DATA FOR THE vide helpful hints, and give good 035A 00 06 00 . EVTE $00,$06,$00 ;-I LOSE.." 524 035H 38 3F 6D . EYTE $38,$3F,$6D MESSAGE review questions. 526 0360 79 00 7C . BYTE $79,$00,$7C 528 0363 5C SC- 00 . EVTE $5C,$5C,$00 CONTENTS: Introduction; Graphics, 530 0366 7ft 06 6D . EVTE $78,$06,$6D Games, and All That; Advanced 532 0369 6D 00 00 . EVTE $6D , $00 , $00 JMCAO" 534 036C 00 00 80 .EVTE $00,$00,$80 j m c o o Programming.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 51 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 at Quentin. the juice on your Apple, add-on 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 plug 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­ (QU€nTin) A precision lead screw positions ity and stand behind every system RESEARCH, INC.”’” '’^ the head onto the correct track. we sell you. Time-consuming retries and 19355 Business Center Drive disk-td-disk copying errors are But the best news may be the Northridge, California 91324 virtually eliminated. price— only $335.00 (40 tracks). (213) 701-1006 SIEMENS* DISK DRIVE The apple-beige unit is built around the highly reliable MORE JUICI c o d v m ID

Special Introductory Price: $335.00

) Apple is a registered trademark of Apple Computer, Inc tSiemens is a trademark o f Siemens Corporation. * Apple-Mate is a trademark o f Quentin Research, Inc., which does not manufacture Apple computers. Solve the Pagoda Puzzle Using Recursive Assembly

by Sherwood Hoyt

This routine solves the One function that can be used to and USING receives the value of TO. “ Pagoda” or “Tower of Hanoi” calculate the number of moves for n The same thing is done in the third puzzle, using a recursive discs is ( (2An)-l). A 4-disc game statement with FROM and USING. would take 15 moves; eight discs, 255. The second statement prints a move; a subroutine — one that calls The number of moves the game takes disc is taken off peg FROM and put on­ itself. Four stacks are as the number of discs goes up is to peg TO. The algorithm in this pro­ maintained for passing exponential. cedure is used in the assembly- parameters. language program to solve the puzzle. Recursion and the Tower The trick to a recursive procedure is in maintaining distinct values for the Pagoda Solver The recursive procedure to move local variables of the procedure, so that requires: the tower is quite simple; see listing 1. when the procedure calls itself the Let's assume that the pegs are num­ variables have separate values, though 6502 computer with 2K bered from one to three. The tower is the names of the variables may be the (uses 13 page-zero locations, stacked on peg 1, and is supposed to be same. To accomplish this, the variable and character OUTPUT and moved to peg 3. The procedure is called values can be put on a stack (a block of INPUT routines — provided for initially with four parameters. memory pointed to by a stack pointer] PET, Apple, and OSI OS-65D). NMDISC is the number of discs on the in much the same way that return ad­ tower, FROM is set to peg 1, TO is set dresses for a JSR are put on the 6502 to peg 3, and USING is set to peg 2. stack. In a procedure, this is done to be The Pagoda Puzzle is a game using a rectangular platform with three pegs sticking vertically out of it. The peg sticking out of the left side of the board Figure 1 has a number (usually eight) of discs stacked on it. The discs get smaller as you near the top of the stack (see figure 1). The object is to move the discs, I which could be called a tower, from the I peg on the left of the board to the peg on I DDO the right. There are only two rules to DDDDD the game; move only one disc at a time, DDDODDD DDDDDDDDD and never put a disc on top of another DODDODODDDD one so that the larger one is on top. DDDDDDDDDDDDD DDDDDDDDDDDDDDD According to Peter Grogono's book DDDDDDDDDDDDDDDDD Programming in Pascal (where I first read about this game and the algorithm THE PAGODA PUZZLE to solve it), the game was accompanied with literature saying that priests in the Temple of Bramah played the game. When they finished their game, The first operation of: the procedure able to pull the values out of the "deep it signified the end of the world. Ap­ is to check the number of discs left on freeze1’ when control returns to the parently the priests were playing with the tower. If the number is not greater procedure. When a procedure is called, 64 discs. It would take roughly 18.4 than zero, control returns to the calling and there may be indefinitely many billion billion moves to solve a 64-disc procedure. If the condition is true nested calls, its values are pushed on game. According to Peter Grogono, and (NMDISC>0), then the three state­ top of the stack. For the program to some rough calculations that I made, it ments between the IF...ENDIF are ex­ remember where the top of the stack is, would take a powerful computer about ecuted. The first statement is a recur­ a pointer is used that always points to a m illion years (if it could run that sive call. You can see that the number the top. In my assembly-language pro­ long) just to compute, not to mention of discs passed is equal to the current gram, the pointer is register Y, and it is print, the moves for a 64-disc game. It number of discs minus 1, and para­ incremented before a value is pushed to would take my OSI computer about 60 meters TO and USING are passed so the stack, and decremented to pop a million years. that TO receives the value of USING value off of the stack.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 53 SERIOUS CBM® USERS

NEW FROM KILO “The Serious Solution” 6809 + MICROWARE OS-9* + BASIC09

Tired of the frustrating limitations of Commodore Basic? Need to get a serious programming language for your Commodore computer? KILO of­ fers The Serious Solution. A 6809 plug in adaptor board including OS-9 Level I Operating System in ROM, Basic09* and 16K RAM expansion. The KILO 6809 adaptor board simply plugs in to your Commodore com­ puter. The switching between 6502 and 6809 is under software control. Expansion RAM can be used to replace protection ROMs with 6502.

With The Serious Solution, all Microware software can now be run on your computer. The standard package comes with the Basic09 Struc­ tured Basic Interactive Compiler. The fastest and most comprehensive full Basic language available for the 6809. This combines standard Basic with the best features of PASCAL. It features compiler speed, interpreter friendliness and superlative debugging facilities. Option available includes Run B...a ROMable run-time system for compiled Basic-09.

Please note: The OS-9 distribution disk format is not compatible with the Commodore disk format. OS-9 software purchased from sources other than KILO may need to be reformatted. KILO will provide this service at $10.00 per disk. Software venders should contact KILO for SS-50 to Commodore adaptor hardware and software.

SPECIAL: Buy The Serious Solution before Christmas and get Editor/Assem./Debug package for $200.

The Serious Solution $489 including 6809 adaptor board, OS-9 Level I operating system in ROM, Basic09 and 16K RAM expansion.

Microware* Software Options PASCAL compiler $400 C Compiler $400 CIS COBOL Compiler $895 Editor/Assem./Debug package $300

VISA and Mastercard welcome. Don’t forget last month

CBM and Commodore are registered trademarks of Commodore Computer, OS-9 and Basic09 are registered trademarks of Microware and Motorola. CIS COBOL is a trademark of Micro Focus, Inc.

KILO CORPORATION • P.O. Box 7530 • Ann Arbor, Ml 48107 • 313 668-1566

54 MICRO - The 6502/6809 Journal Listing 1: Recursive Procedure In Pseudo-Code

PROCEDURE MOVE RECEIVE (NMDISC,FROM,TO,USING)

IF NMDISC > 0 THEN

CALL MOVE WITHjNMDISC -1 , FROM,USING,TO) PRINT FROM/' -»■ ",TO CALL MOVE WITHjNMDISC - 1, USING,TO,FROM) Listing 2 0010 ;•**************♦*•**********• 0020 ?• ENDIF 0030 ;# PftGODfl SOLVER 0040 0050 ;♦ by Sherwood Hoyt END PROCEDURE 0060 ;* 0070 7 *****************************

0090 • ■-- parameters passed ---- 0100 The Recursive Assembly-Language 0 1 10 .ba $54 jPET 0120 jOS-65D— *10; Apple— $+0 Program 0130 nmdisc .de = 0140 ■from . de nmdisc+1 In the assembly-language piogram 0150 to . de -from+1 0160 using .de to+1 (listing 2), there are four zero-page loca­ 0170 ; tions (lines 130-160) for passing values 0180 ) -- stack ptr's to local values --- 0190 to the recursive procedure labeled 0200 nptr .de using* 1 MOVE [lines 530-820). Values are 0210 ■f ptr . de nptr+2 0220 tptr . de +ptr+2 passed from recursive procedural calls 0230 uptr .de tptr+2 via these locations, as well as initially 0240 } 0250 ;--- stack location from the calling routine. The calling 02 €0 routine (lines 470-490) jumps to lines 0270 .ba $1800 ,s*4000— 0S-65D; $800— flpp I 0280 nstack . de 3 1590-2360 to initialize the parameters 0290 ■P stack .de nstack+ $ 1 0 0 and stack pointers. Register Y is used as 0300 tstack . de -Pstack+ $ 1 0 0 0310 ustack’ .de tstack+ $ 1 0 0 the stack index, and is initialized to 0320 $FF. When MOVE is called, register Y 0330 ---- misce I laneous---- 0340 is incremented before the values passed 0350 rirtioves .de uptr+2 ; current number o-f moves are actually pushed on the stack, so 0360 i nput .de $-f-fc-f .sget character 0370 jftpp le— -$-fd©cj OS—650— $2339 that the procedure, when first called, 0380 output .de $-H»d2 joutput character will increment register Y to $00, then 0390 jftpp le--*-?ded.; 0S-65D— $2343 0400 return .de $0 d push the values on the stack indexed by 0410 1+ . de $0 a register Y. 0420 } 0430 .ba ustack+ $ 1 0 0 J0S-65D— $317© The stack pointers are initialized 0440 next. There are four stacks, one stack 0450 0460 ;--- call major subroutines --- for each value that is passed. When the 0470 procedure is called, register Y is incre­ 1 0 0 0 — 2 0 8 8 1 C 0480 jsr Init jinit. ptr's * parameters 1C03- 20 09 1 C 0490 Jsr move ;call proc. to move tower mented so that it points to a new stack 1C06- 4C 70 10 0500 jmp done 0510 position. The total number of bytes 0520 ;---recursive procedure to move tower --- used in each stack for any given game is 0530 1009- 20 R9 10 0540 move jsr push ^push values to stack equal to the number of discs on the 1C0C- B1 58 0550 Ida ,y ;get # o*f discs le-ft tower. Each stack occupies one page 1C0E- F0 2 0 0560 be-* ret ,?i-f = 0 then pop procedure 0570 ($00-$FF) of memory. Actually, the 1 C 1 0 - B 1 58 0580 Ida ,y jget values to be passed stack size only needs to be one half of a 1C12- 85 54 0590 sta •nmdisc 1C14- C6 54 0600 dec •nmdisc ;de. # o-t1 diiscs on tower page because the number of JSRs that 1016- B 1 5fl 0610 Ida <*fptr> ,y can be executed, and therefore the 1019- 85 55 0620 sta •■from lClfl- B1 50 0630 Ida ,y number of recursive calls and separate 1C1C- 85 57 0640 sta •using ; store 'to' in 'using-' values, is limited by the 6502's one- 1C1E- B 1 5E 0650 Ida ,y 1C20- 85 56 0660 sta •to ;store •'using' in 'to' page stack, which can only hold $80 1 C2 2 - 2 0 09 10 0670 jsr move two-byte return addresses. The largest 0630 1C25- 20 3F 1 C 0690 jsr prmove ;display a move tower that this program can move has 0700 approximately $70 discs on it, which 1C28- 61 58 0710 Ida ,y ;pass values to next proc. 102ft- 85 54 0720 sta •nmdisc allows part of the stack to have been used 1C-2C- C6 54 0730 dec •nmdisc ,?dec. # o-f discs on tower already by the calling routine. However, 1C2E- 61 5fl 0740 Ida C-fptr > ,y 1C30- 35 57 0750 sta •using .»store '-Prom' in 'using' having a maximum game of $70 discs is 1032- 61 50 0760 Ida ,y obviously no problem if it would take a 1C34- 85 56 0770 sta •to 1036- 61 5E 0780 Ida ,y computer a million years just to solve a 1038- 85 55 0790 sta •■from ;store 'using' in '-from' $40 (decimal 64) disc game! 103ft- 2 0 09 10 0800 Jsr move ,»do recursive call 0810 After the initialization routine 1030- 8 8 0820 ret dey .spop procedure -from stack stores zero in the location that holds 1C3E- 60 0330 rts (continued)

No. 54 - November 1982 MICRO - The 6502/6809 Journal 55 GAMES FEATURE

Figure 2: Sample Runs Listing 2 (continued)

0840 ENTER TOWER SIZE: 3 0850 print a mo^« --- 0860 0001 1 — 3 1C3F- 20 60 1 C 0870 jsr prnum ;print current. # of moves 1C42- B1 5ft 0880 Ida ' 0004 1 — 3 1C4B- BO 67 1C 0920 Ida p3,x 0005 2 — 1 1C4E- F0 06 0930 be«i p2 1C50- 20 0 2 FF 0940 jsr output 0006 2 — 3 1C53- E8 0950 inx 0007 1 — 3 1C.54- 00 F5 0960 tone Pi 1C56- B1 5C 0970 Ida < tptr >,y 1C58- 09 30 0980 ora ##30 * * * DONE * * * lC5ft- 20 0 2 FF 0990 jsr output jprint peoi# to put disc on 1C50- ft9 00 10 0 0 Ida •return ?new line 1C5F- 20 0 2 FF 1 0 1 0 Jsr output 1C62- FI9 0 ft 1 0 2 0 Ida • If 1C64- 20 0 2 FF 1030 Jsr output ENTER TOWER SIZE: 4 1C67- 60 1040 rts 1C68- 20 2 0 3E 1050 • by ' ' 00 0001 1 — 2 1C6B- 20 00 0002 1 — 1060 3 1070 *---print current number ©f moves — 0003 2 — 3 1080 > 0004 1 — 2 1C60- E6 60 1090 prnum i nc *nmoves jbump # o-f moves up one 1C6F- 00 0 2 1 1 0 0 tone prnum1 0005 3 — 1 1C71- E6 61 1 1 1 0 inc •nmoves+l 0006 3 — 2 1C73- ft5 61 1 1 2 0 prnufnl Ida •nmoves+l 1C75- 4ft 1130 Isr a ;shift hiojh nibble riojht 0007 1 2 1C76- 4ft 1140 Isr * — 1C77- 4ft 1150 Isr a 0008 1 3 1C78- 4ft 1160 Isr a 0009 2 — 3 1C79- 20 9ft 1C 1170 jsr dspbyt ^display first diojit 000A 2 — 1C7C- ft5 61 1180 Ida *nmoves+l 1 1C7E- 20 9ft 1C 1190 jsr dspbyt .>display second dioiit 000B 3 — 1 1C81- ft5 60 1 2 0 0 Ida Ininoves 1C83- 4FI 1 2 1 0 Isr a ;shift hioih nibble right oooc 2 — 3 1C84- 4ft 1 2 2 0 Isr a 000D 1 — 2 1C85- 4ft 1230 Isr a 1C86- 4ft 1240 Isr a 000E 1 — 3 1C87- 20 9ft 1C 1250 jsr dspbyt ; display third dioiit 000F 2 — 3 lC8 ft- ft5 60 1260 Ida *nmoves 1C8C- 20 9ft 1C 1270 Jsr dsptoyt ^display fourth dioiit 1C8F- ft9 2 0 1280 Ida « * 2 0 ^output 2 blanks * * * DONE * * * 1C91- 20 0 2 FF 1290 Jsr output 1C94- ft9 2 0 1300 Ida « * 2 0 1C96- 20 0 2 FF 1310 Jsr output 1C99- 60 1320 rts the current number of moves (lines 1330 J 1340 >--- convert byte to ascii and display 1830-1850], it stores the initial values 1350 for the FROM, USING, and TO pegs 1C9R- 29 0F 1360 and ##0 -f t clear high nibble (lines 1890-1940). Then in lines 1C9C- 09 30 1370 ora #*30 f convert to ascii 1C9E- C9 3FI 1380 cmp ##3a ;check -for ' a ' - ' * ' 1980-2030 the prompt "ENTER 1CR0- 90 03 1390 bcc dspbl jbranch if not 1CR2- 18 1400 c le TOWER SIZE:" is displayed, and lines lCft3- 69 07 1410 adc ##07 2080-2360 input the user response. The lCftS- 20 D2 FF 1420 dspbl jsr output ^display dioiit lCft8 - 60 1430 rts input routine will only accept a one- or 1440 two-digit hexadecimal number. If a 1450 t --- push procedure values on stacks 1460 one-digit number is entered, the return 1CA9- CS 1470 iny ; bump key must follow it. If two digits are lCfift- Fl5 54 1480 Ida •nmdisc ) push lCftC- 91 58 1490 sta ,y entered, the program will continue ex­ lCftE- fl5 55 1500 Ida •from-1 ;push ecution and no return needs to be 1CB0- 91 5ft 1510 sta ,y 1CB2- ftS 56 1520 Ida •to .jpush entered. 1CB4- 91 5C 1530 sta ,y routine makes, after initialization, is to 1CBR- 60 1560 rts the recursive procedure,- MOVE. The 1570 1580 } --- initialize stack ptr's --- first operation is to push the variables it 1590 J receives onto the stack. This allows the 1C.BB- -ft© FF 1600 init Idy #*ff ;set stack index 1610 ;gets bumped to 0 -for 1 st values variables for each successive calling of 1CBD- R9 00 1620 Ida #l,nstack jset 'nmdisc' stack ptr. the procedure to be maintained sepa­ 1CBF- 85 58 1630 sta •nptr 1CC1- R9 18 1640 Ida #h,nstack rately. When the procedure is finished, 1CC3- 85 59 1650 sta #nptr+l the stack index will be decremented 1660 1CC5- ft9 00 1670 Ida # I,fstack jset '-from' stack ptr. (line 810], effectively popping the 1C.C7- 85 5ft 1680 sta *fptr variables off of the stack. The only 1CC9- ft9 19 1690 Ida #h,fstack 1CCB- 85 58 1700 sta #fptr+l other thing done with the variables is 1710 for the procedure to call itself with the 1CCD- R9 00 1720 Ida # 1 ,tstack jset 'to' s^tack ptr. 1CCF- 85 5C 1730 sta #tptr variables (in slightly modified form) as 1CD1- R9 1 ft 1740 Ida #h,tstack 1C03- 85 50 1750 sta #tptr+l parameters. This the procedure per­ 1760 forms twice. Also, between the two 1CD5- ft9 00 1770 Ida # I ^ustack jset 'using' stack ptr. 1C07- 85 5E 1780 sta #uptr recursive calls, the procedure calls 1C09- R9 IB 1790 Ida #h,ustack PRMOVE from line 860-1030 to display 1C0B- 85 5F 1800 sta •uptr+l a move. The variables FROM and TO 1310 1820 t ---set number o-f moves to zero are passed to it. FROM is the peg to 1830 (continued)

56 MICRO - The 6502/6809 Journal No. 54 - November 198! GAMES FEATURE M S

take the disc from, and TO is the peg to Listing 2 (continued) put the disc onto. 1CD0- R9 00 1848 Id a • *0 8 1C 0F- 85 60 1850 s t a •n m o v e s 1C E 1- 85 61 1860 s t a •n m o v e s + l Trial Run 1878 > 1888 y ------i n i t i a l i z e r b e g in n in g p. In figure 2 there are two trial runs. 1890 > The first one solves the puzzle for three 1C E 3- R9 01 1900 Id a • *01 1C E5- 85 55 1910 s t a • fr o m jset 'from ' -to p«g #1 discs and the second for four discs. 1C E7- R9 83 1928 Id a • * 0 3 1C E9- 85 Remember, the number of discs that 56 1930 s t a • t o jset 'to ' to peg #3 1CEB- R9 02 1948 Id a • *02 you enter at the prompt 'ENTER IC E D - 85 57 1958 s t a • u s in g ; s e t ' u s i n ? ' t o p e g #2 TOWER SIZE:’ is assumed to be a hex­ 1960 > 1970 } ------display prompt ------adecimal number. A carriage return is 1980 > 1CEF- R2 08 1990 p ro m p t Id x •*00 required if the number entered has only 1C F1- 8D FC 1C 2 00 8 Id a p r o 3 , x one digit. (Ed. Note: The routine is 1C F4- F0 1C 201 8 be«i e n t e r written to echo the character received 1C F6- 20 D2 FF 2020 J s r o u t p u t 1C F9- E 8 2 03 0 in x to the screen. If your machine's INPUT 1CFR- 08 F5 284 0 bne p r o m p t +2 routine does this automatically, the 1CFC- 0R 0R 0D 2 0 5 0 p r o 3 . b y If If return 1C FF- 45 4E 54 character will appear twice on the 1D 82- 4 5 52 20 1 0 0 5 - 54 4F 57 screen. You may want to skip the 1 0 0 8 - 45 52 20 echoes in lines 2130 and 2210.) A four­ 1 0 0 8 - 53 49 5R 1D 8E- 45 3R 20 digit hexadecimal number in the first 10 1 1 - 80 column of output shows the number of 286 8 moves. This number will turn over to 2 0 7 0 ------in p u t number of discs c 2 8 8 8 } '0000' after it reaches 'FFFF1. The 1012- 28 CF FF 2 8 9 8 e n t e r J s r in p u t 1 0 1 5 - C9 00 2 1 0 8 cmp • r e t u r n number in the second column tells 1 0 1 7 - F 0 26 2 110 be«i e n t 3 jdone inputting which peg to take the disc off of and the 1 0 1 9 - 28 54 10 2120 J s r c h n o 101C - 88 F4 number in the fourth column tells 2 13 8 b c s e n t e r jnot a hex d ig it 1D 1E- 20 D2 FF 2 1 4 0 J s r o u t p u t jdisplay valid d ig it which peg to put the disc onto. 2 1 5 0 1D21- 20 66 10 J s r s t r i p t strip ascii -from d ig it 1 D 24- 85 54 2 1 6 0 s t a • n m d is c jstore firs t digit 1 0 2 6 - 20 CF FF 2 1 7 0 e n t 2 J s r i n p u t 1 0 2 9 - C9 80 2 18 8 cmp • r e t u r n F0 17 1D2B- 2 1 9 0 be«i e n t3 jdone inputting The author may be contacted at Rt. 1, Box 1020- 20 54 10 2200 J s r c h n o 56, Sand Springs, OK 74063. 1D 30- 8 0 F4 2 21 8 b c s e n t 2 jnot a hex d ig it 1 0 3 2 - 20 0 2 FF 2 2 2 8 J s r o u t p u t jdisplay valid d ig it 1 0 3 5 - 20 66 10 2 2 3 0 J s r s t r i p jstrip ascii from dig it AMCftO 1 0 3 8 - 0 6 54 2 2 4 0 a s I • n m d is c j s i f t 1 st digit left 1 0 3 ft- 0 6 54 2 2 5 0 a s I • n m d is c 103.C- 06 54 2 2 6 0 a s I • n m d is c 1 0 3 E - 0 6 54 2 2 7 0 a s I • n m d is c 1 0 4 0 - 85 54 2 28 0 o r a • n m d is c jp a c k 2nd d ig it with 1s t 1 D 42- 8 5 54 2 2 9 0 s t a • n m d is c j s t o r e i t 1 0 4 4 - A9 0R 2 3 0 0 e n t3 Id a • I f .»sp a c e 2 lines down 1 0 4 6 - 2 6 0 2 FF 2 31 8 J s r o u t p u t / ScotchX 1 0 4 9 - A9 0R 2 3 2 8 Id a • I f 10 4 B - 2 0 0 2 FF 2 33 8 J s r o u t p u t 10 4 E - FI9 00 2 3 4 8 Id a • r e t u r n 1 0 5 0 - 28 0 2 FF 2 35 0 J s r o u t p u t MEMOREX 1D 53- 60 2 3 6 0 r t s 2 3 7 0 } * 2 3 8 0 t ------c h e c k 0 L v a l i d he; \ferbatim 2 3 9 0 j 1 0 5 4 - C9 30 2 4 0 0 c h n o cmp • '0 1D 56- 90 0C 2 4 1 0 bcc i nv I i d 1 0 5 8 - C9 3R 242 0 cmp • ' i 10 5 A - 9 0 09 maxEll 2 4 3 0 b c c v a l i d 105C - C9 41 £ 4 4 0 cmp #'R 10 5 E - 90 84 2 45 0 b c c i n v l i d 1 0 6 0 - C9 47 2 4 6 0 cmp • '0 1 0 6 2 - 90 81 2 47 8 b c c v a l i d 1 0 6 4 - 38 2480 in vlid s e c BASF 1 0 6 5 - 60 2490 valid r t s 2 5 0 0 ? 2510 js trip ascii from input 2 5 2 0 > 1D66- C9 41 2530 strip cmp # 'f l wabash 1068- 90 83 2 5 4 0 b c c s t 3 106 R - 18 255 0 c le Diskettes and at) your media needs 1068- 69 09 2 5 6 0 ad c # * 0 3 jadd 9 if digit 'a '-'f' 1D 60- 2 9 8F 2 5 7 8 s t 3 a n d « *0f ?strip ascii O u t REGULAR prices are SPECIAL 1 0 6 F - 60 2 5 8 8 r t s 2 5 9 0 ; C A L L F R E E (8001 421-3957 2 6 8 8 ?------finished moving tower ------2 6 1 0 C.O.D. charge cards accepted. 1078- R2 81 2 6 2 0 d o n * Id x ##01 sprint that it y.s d o n e Excellent dealer program. 1072- 80 70 10 2 6 3 0 Id a d o 3 ,x 1 0 7 5 - F 8 86 264 8 be«i d o3 1D77- 20 D2 FF 265 8 Jsr output 1D 7A- E8 2 6 6 8 in x 1078- 08 F5 2 6 7 8 b n e d o n e +2 1 0 7 0 - 68 2 6 8 8 d o 3 r t s ^return to operating syste 1418 West Shaw Avenue 2 6 9 0 j 107E- 0R 0fl 80 Fresno, CA 93711 2 7 0 0 «by If If return '•*• DONE •*• If return 00 1081- 2R 2R 2R 1084- 28 44 4F 1D87- 4E 45 28 108R- 2R 2R 2R 1 0 8 0 - 8R 8 0 80 2 7 1 0 ) 2 72 0

No. 54 - November 1982 MICRO - The 6502/6809 Journal 57 Lyco C om puter M arketing & C onsultants

TO ORDER TOLL FREE 800-233-8760 CALL US In PA 1-717-398-4079

November 810 Disk Drive ___$ 4 2 9 .0 0 ATARI 32 K RAM ...... $ 7 9 .0 0 SPECIALS 400 1 6 K ...... $ 2 5 5 .0 0 8 0 0 4 8 K ...... $ 6 3 9 .0 0

PERCOM : In Stock ATARI HARDWARE Single D rive ...... • C A L L ATARI D ual D r iv e ...... C A LL 410 Cassatt* Recorder ...... ■■ $ 7 5 .0 0 o A Warner Communications Company (Read all Atari Disks) 825 Printer ...... $ 5 8 5 .0 0 830 Phone M odem ...... $ 1 4 9 .0 0 8 5 0 I n t e r f a c e ...... $ 1 6 4 .0 0 THIRD PARTY SOFTW ARE PRINTERS : In Stock PACKAGES for atari 800 or 400 CX481 Entertainer ...... $ 6 9 .0 0 E p so n M x 8 0 ...... $ 4 4 9 .0 0 KBYTE Epson Mx 80 FT III ...... $ 4 9 9 .0 0 C X 4 8 2 E d u c a to r ...... $ 1 2 5 . 0 0 KRAZY SHOOTOUT ...... $ 3 5 .0 0 Okldata 82A ...... $ 4 7 9 .0 0 C X 4 8 3 P ro g ra m m e r ...... $ 4 9 .0 0 K -D O S ...... $ 6 5 .0 0 Okidata 83A ...... $ 7 1 9 .0 0 C X 4 9 4 C o m m u n ic a to r ...... $ 3 2 5 . 0 0 K-STAR PATROL...... $ 3 7 .7 5 Okidata 84 ...... $ 1 0 8 9 .0 0 K-RAZY A N T IC S ...... $ 3 7 .7 5 C ito h ...... C A LL SOFTWARE K-RAZY K R tT T E R S ...... $ 3 7 .7 5 N E C ...... C A L L Q-BALL JOYSTICK KIT...... $ 6 .7 5 (Interfacing Available) C X L 4 0 1 3 A S T E R O ID S ...... $ 2 8 .7 5 JOYSTICKS : In Stock CXL4004 BASKETBALL...... $ 2 6 .7 5 C X 4 1 0 S B L A C K J A C K ...... $ 1 2 .7 5 AUTOMATIED SIMULATIONS A ta ri C X -4 0 ...... $ 1 8 .0 0 C X L 4 0 0 9 C O M P U TE R C H E S S ...... $ 2 8 .7 5 S ta r W a r r io r ...... $ 2 8 .0 0 L e S tic k ...... $ 3 4 .0 0 C X L 4 0 1 2 M IS S LE C O M M A N D ...... $ 2 8 .7 5 Crush, Crumble & Chomp ...... $ 2 3 .0 0 Wlco Command Control ...... $ 2 4 .0 0 C X L401 1 STAR R A ID E R S ...... $ 3 5 .0 0 WE CARRY MANY OTHER THIRD PARTY PRODUCTS CXL4006 SUPER BREAKOUT...... $ 2 8 .7 5 CXL4010 3-D TIC-TAC-TOE...... $ 2 6 .7 5 YOU CAN CALL FOR PRICES ON AND ASK FOR Computer Covers : CXL4005 VIDEO EASEL...... $ 2 6 .0 0 YOUR FREE ATARI PRODUCT CATALOG.______CXL4008 SPACE INVADERS ...... $ 2 8 .7 5 800 ...... $ 6 .9 9 CX81 30 CAVERNS OF MARS ...... $ 3 1 .7 5 400 $ 6 .9 9 CXL4020 PAC M AN...... $ 3 2 .7 5 J commodore 8 10 ...... $ 6 .9 9 (NEW) CENTIPEDE ...... $ 3 2 .7 5 C X 4121 EN ER G Y C Z A R ...... $ 1 2 .7 5 VIC-20 ...... $ 1 8 9.00 C X 4 1 0 8 H A N G M A N ...... $ 1 2 .7 5 DISKETTES : In Stock V IC 1 5 3 0 D A T A S S E T T E ...... $ 6 7 .0 0 C X 4 1 0 2 K IN G D O M ...... $ 1 2 .7 5 VIC1 540 DISK DRIVE ...... $ 4 9 9 .0 0 Maxell MD1 . . .(10) ...... $ 3 4 .0 0 C X 4 1 1 2 STA TE S 4 C A P IT A L S ...... $ 1 2 .7 5 VIC1515 PRINTER ...... $ 3 5 5 .0 0 Maxell MD2 . . .(10) ...... $ 4 4 ^0 0 CX41 14 EUROPEAN COUNTRIES.. .. $12.75 V IC 1 2 1 0 3K RAM ...... $ 3 5 .0 0 Elephant . . .(10) ...... $ 2 1 .0 0 C X 4101 P R O G R A M M IN G I ...... $1 9 .9 5 V IC 1 1 1 0 8 K RAM ...... $ 5 2 .0 0 C X 4 1 0 6 PR O G R A M M IN G I I ...... $2 2 .7 5 VIC1 211A ...... $ 5 3 .0 0 VIC-20 SOFTWARE THIRO PARTY SOFTWARE CX4117 PROGRAMMING III ...... $2 2 .7 5 V IC 1 2 1 2 P R O G R A M M ER A ID ...... $ 4 5 -0 0 ATARI PROGRAM EXCHANGE CXL4007 MUSIC COMPOSER ... . $33.75 CX8102 CALCULATOR...... $ 2 8 .7 5 VIC1213 VICMON ...... $ 4 5 .0 0 Eastern Front 1941 ...... $25.50 C X 4 1 0 9 G R AP H I T ...... $ 1 6 .7 5 V IC 1 9 0 6 SU PE R A L IE N ...... $ 2 3 -00 A v a la n c h e ...... $ 1 5 .5 0 VIC1914 ADVENTURE CXL4003 Assembler Editor .... $45.00 Outlaw/Howitzer ...... $ 1 5 .5 0 L A N D A D V E N T U R E ...... $ 3 5 -0 0 CX8121 Macro Assembler ...... $ 6 9 .0 0 D o g D a ze ...... $ 1 5 .5 0 VIC1915 PRIVATE COVE CXL4002 Atari Basic ...... $ 4 5 .0 0 W iz a rd o f W a r ...... A D V E N T U R E ...... $ 3 5 -0 0 ...... $ 3 1 .0 0 CX81 26 M icrosoft Basic ...... $ 6 5 .0 0 G o rf ...... VIC1916 MISSION IMPOSSIBLE ...... $ 3 5 -0 0 ...... $ 3 1 .0 0 CXL4018 Pilot Home ...... $ 6 5 .0 0 F ro g g e r ...... $ 2 6 .0 0 VIC1 91 7 THE COUNT ADVENTURE .... $35-00 CX405 PILOT EDUCATOR...... $9 9 .0 0 V IC 1 9 1 9 SA R G O N II C H E S S ...... $35 -00 BUSINESS SOFTWARE : In Stock C X L401 5 T E L E L IN K ...... $ 2 1 .0 0 THIRD PARTY SOFTWARE Atari Word Processing ...... $ 1 0 9 .0 0 CX41 2 3 S C R A M ...... $19.75 A L IE N B L IT Z ...... $ 2 1 .0 0 Letter Perfect...... 5129.0 0 CX4107 Biorhythm ...... $ 1 3 .0 0 T e s tW iz z a rd ...... $ 8 9 0 0 O m eg a R ace ...... $ 3 5 .0 0 CX4119 French ...... $ 4 5 .0 0 G o rf ...... $ 3 2 .0 0 D a ta s a m /6 5 ...... $ 1 2 5 .0 0 C X 4 1 18 G e r m a n ...... $ 4 5 .0 0 16K R A M /R O M ...... $ 9 9 .0 0 In te rlis p ...... $ 1 2 5 .0 0 C X 4 1 2 0 S p a n is h ...... $ 4 5 .0 0 AM O K ...... $ 2 1 .0 0 CX4125 Italian ...... $ 4 5 .0 0 SUPER H A N G M A N ...... $ 1 6 .0 0 M o n k e y W re n c h ...... $ 4 2 0 0 SPIDERS OF M ARS ...... $ 4 5 .0 0

POLICY TO ORDER Pre-paid orders receive free shipping in the continental U.S. CALL TOLL FREE Personal checks require four weeks clearance before shipping 800-233-8760 In-Stock items shipped within 24 hours of order In PA 1-717-398-4079 Back-Ordered and Out-of-Stock items shipped as soon as they are available or send order to Cancellation of Back-Order and Out-of-Stock items prior to shipping receive Lyco Computer full refund or credit towards another purchase upon request. P.O. Box 5088 All products subject to availability and price change. Jersey Shore, PA 17740 VIC/PET GOMOKU

by David Malmberg

A fast, machine-language originators of GOMOKU felt that the tional. However, remember that if you version of the popular oriental game would not be enough of a elect to play without this restriction, game, with three user-selectable challenge if this type of easy win were the computer will play accordingly. permitted. VIC/PET GOMOKU plays an ex­ styles for the computer’s play. cellent game. Its main counting and VIC/PET GOMOKU evaluation routines are written in machine language for increased speed GOMOKU The computerized version of GO­ and enhanced logic. The program takes requires: MOKU allows the enforcement of the 10 to 30 seconds between moves, de­ no-multiple open-threes rule to be op­ pending on the density of stones on the VIC with 3K or more extra RAM and joystick Listing 1 or PET with 8K or more 1 RL=22:S=256*PEEK<6485-1:A =30720: IFPEEK<648:> = 16THEHA=33792 2 FH=RND<-TI5:P0KE36879,25:DD=37154:P1=37151:P2=37152:V=36878:E=36876 3 FORI = l T08 :READX :P0KE951+1 , X :NEXTI :O ATAl ,21 ,2 2 ,2 3 , 129, 149, 150, 151 :FH=10 4 ML=PEEK< 43> +25S*PEEK (4 4 } +3339 :B=M L,'256 :DIM D<8 J , VV . < 1 4 , 1 4 :> GOMOKU is an ancient oriental game 5 F O R I = 1 T O 1 3 : R E A D X : P O K E M L + X , B :NEXT 6 QATA2,22,51,54,75,91,104,125,136,161,170,215,256 of strategy. According to Edward 7 B=B+11FORI=1T04:REHOX:POKEML+X,B :NEXT:DATA19,306,351,384 Lasker's book Go and GOMOKU s m v « = " a n a a n n a a a a a a a f t n a n a f t M " : u i h « = (Dover, 1960], GO means "five" and 9 FORI = l T08 : RE ADD :NEXT:DATA-22,-2 1 ,1 ,2 3 ,2 2 ,2 1 ,-1 ,-2 3 10 H=Q7 :C=81 :NP*="C." :P1=0 :U=0 :P R IN T"3 31ICRO GOMOKU" : IN *="N " MOKU means "stones." To play, you 11 PRINT"SJ BV DflVIO MALMBERG" and your opponent alternate placing 12 PRTNT" W UftNT TO MOVE FIRST " :GGSUB85 :PRINT 13 IFLEFT*< IN *, 1 ^"V TH E N H P *^'!-!" stones on the intersections of the lines 14 IN»="W " :PRINT"W HITE OR BLACK :G0SUB85 SPRINT : IFIN*="B"THENH=81 :C=87 of a square grid. One person plays with 15 POKE950,C::POKE951 ,H : IN *= "2 " lPRINT"SHOW SHOULD I PLflV : " :PR I NT " 1: CAUTIOUS" white stones and the other uses black 16 PRINT" 2: BALANCED":PRINT" 3: AGGRESSIVE 17 G0SU685:PRINT:X=VAL> stones. As the name implies, the object 18 IFX>30RX<1THENPRINTSPRINT” 1,2, OR 3 ONLY ";:G 0T017 of the game is to have your stones oc­ 19 ZZ=0 : PR I NT " SPLAY OPEN 3'S RULE " ,- :G0SUB85 :PRINT : IFIN *0"V "TH E N ZZ=1 20 FC=6+2*X:N=8:G =7:M T=14*14 :FORI = 1TO l4 :FORJ=1TOl4 :V «< I,J?=0:NEXTJsNEXTI :0=1 cupy five adjacent points on a grid — 21 PF;INTCHR»<28> "3 #1ICRCi GOMOKU" vertically, horizontally, or diagonally 22 PRINTTHB<0+2) "J9ABCDEFGHIJKLMN" :PRINTTA6<0 V g i ...... 11 :F 0R I=2T 013 — before your opponent gets five of his 23 PRINTTHB<0-ORIGHT* =-30000 :M T=M T-1 :IFU =H TH EN76 long will not win the game. 30 IFMT=0THEN75 31 PRINTCHR»<30) ;W H «;"Hr'0U !aaBffiaM I»1EB" : IFM =0THENI=7 : J=S :G0TQ36 The most obvious way a player can 32 C)M=C :G 0SU B46:M X=-1E15 :F0RM I = 1T014 :FORMJ= 1 TO 14 : IFVK>.2THEN35 he has four stones in a row with both 34 XJ=M J+0+2:XI=M I+4:L=S+RL*:I= M I:J=MJ 35 NEXTMJ sHEXTMI ends of the chain open for potential 36 B*="":IFI<10THENB*=" " stones. The opponent will be able to 37 PRINTCHR*<2SJ ,-MV*TAB<0+12? ,'B»;CHR*< J+64)M ID *+CL block only one end of the chain, so the 39 P=PEEK =-30000 SG0T027 player threatens a win by making an 46 11 = 1 :JJ=J:P0KE991,Q M :FO RIN=—1T01 |F0RJN=-1T01 :IFIN=0ANDJN=0THENHEXTJN open-three, the opponent must imme­ 47 FORKN= i T04 5 1 — 11+KN#IN:J=JJ+KN#JN:IFI<10RI>14THENKN=4:G0T067 diately play a stone at one end of this 48 IFJ<10RJ>14THENKN=4:G0T067 49 C L=J+0+2:R =I+4 :L=S+RL*+CL :P=PEEK : IFP=C0RP=HTHEN67 chain of three in order to avoid losing 5 0 P O K E L , P + 1 2 8 : '-IV. < I , J > = 0 : L H = I N T < L / 2 5 6 > : L L = L - L H * 2 5 6 : P 0 K E 9 6 2 , L L : P 0 K E 9 6 3 , L H the game two moves later. 51 POKEL,P :SVS sZP=P£EK<973:> : IFZP=0THEN55 As GOMOKU is played in both 52 F0RV=1T0ZP:NC=PEEK<974+Y>:NH=PEEK<982+Y>:F=FH:IFHH=0THENNH=NC:F=FC 5 3 VXCI, J > + I N T < F * N H * N H : > : N E X T V : N E = P E E K < 9 9 3 ) Japan and China, only one type of move 54 IFNEO 0THENV«< I , J J=V5i< I , j:>-N E*NE is illegal: a participant cannot play a 55 NH=0:IFPEEK<992)=0THEN67 56 FORY=1TO4:O=0:Z=O:T=PEEK

No. 54 - November 1982 MICRO - The 6502/6809 Journal 59 Listing 1 (continued) the start of BASIC to be located at 5 9 Z = D < V > : G 0 S U B 9 1 1 1 F P E E K < L > O T T H E N Q = Q - 1 $0400 (just like the PET). If you are 60 IFQ>4THENQ=0s G0T066 using either the 8K or 16K memory ex­ 61 IFQ<4THEN64 6 2 I F T = C - T H E N Q = 2 panders, this machine code should be 63 Q=Q+11:G0T066 located from $2100 to $22AB because 64 IF < N 1=HORN1=C >ANON1=N2THENQ=0 65 IFQ=3RNDC)flND0THENW ; = INT32RN0N2OCRN0N2O32THENN3=N3+1 code in the hex listing, there is no need 70 IFQ=5THENU=T:G0T072 to worry about relocating the two-byte 7 1 N E X T V 72 IFQ=5RNDU=HTHENFH=FH*1.2 addresses since lines 4-6 of the BASIC 73 IFZZTHENN3—0 program automatically adjust them to 7 4 R E T U R N correspond to the memory configura­ 75 PRINTMV*"MSTRLEMRTE" :G0T083 76 IFNP*="C"RNDW=CTHENM=M+1 tion of your VIC. 77 IFW =HTHENPRINTMV* “ JffVOU WON IN "M " MOVES" To create a working copy of GO­ 78 IFW =CTHENPRINTMV*"jflI WON IN "M " MOVES" MOKU for the VIC, first load the 79 IFM <10THENPRINT"GOOD GRME!" 80 I FM>9ANDM<20THENPR I NT " CLOSE GRME!" BASIC portion (listing 1). Then load 81 IFM >19RNOM<30THENPRINT"GRERT GRME!“ the machine-language code you had 32 IFM>29THENPRINT"FANTASTIC GRME!" 8 3 P R I N T " W A N T T O P L A V R G R I N " ,• : G 0 S U B 8 5 l I F L E F T * < I N * , 1 > = " V ' T H E N l 0 previously saved with the monitor by 8 4 E N D 8 5 Z C .= 1 : Z T = 0 Listing 2 86 G ETZ*lIFZ*<>""THEN89 . : 1300 20 ED 13 H9 00 85 5C 85 87 IFTI>=ZTTHENPRINTM ID*<"? " ,ZC , 1 > f " | | " f :Z T = T I+30 :ZC.=3-ZC 8 8 G 0 T 0 8 6 . : 130S 5D 85 48 85 49 FI5 48 85 89 IFZ*OCHR*<13>THENIN*=Z* . : 1 3 1 0 42 20 02 14 20 4D 13 H5 90 PRINT"? IN*RETURN . : 1 3 1 3 44 C9 00 F0 0C H6 49 fl5 91 Q=1lLN=L+Z . :1 3 2 0 3 C 95 4B R5 3D 95 53 E6 92 IFPEEK'< LN > =TTHENQ=Q+1 :LN=LN+Z :G 0T092 49 93 N1=PEEK:LN=L-Z . : 132S Fl5 48 C9 07 F0 05 E6 94 IFPEEK < LN =TTHENQ=Q+1 :LN=LN-Z:G 0T094 . :1 3 3 0 48 4C 0D 13 20 38 13 60 95 N2=PEEK+XJ:P=PEEK :FS=T :IFFS=PTHENFS=128+FS .: 1 3 4 0 84 03 95 32 E0 2B FO 04 97 PO KEL,FS:FZ=P:ZT=TI+9 98 PO KEE,0:OX=0:DV=0:FB=0:GOSUB11 2 :IFDXORDVQRFBTHEN101 . : 1 3 4 8 E8 4C 3fi 13 60 Fl5 3C C. 9 99 IFTI:POKEL,Z:ZT=TI+9:G0T098 . :1 3 5 8 10 4C 89 13 FI5 45 C-5 33 101 IFFBTHEH109 . :1 3 6 0 D0 07 ft9 00 85 3D 4C C5 102 POKEL,P:N=N+DV:G=G+DX:POKEE,135:U=TI . :1 3 6 8 103 IFTKU+9THEN103 13 H5 45 C5 33 F0 IH C5 104 IFN>14THENN=1 . s1370 32 F0 1 H5 5B C5 4fl D0 105 IFN<1THENN=14 . : 1 3 7 8 05 A9 0Fl 4C 80 13 fl9 08 106 IFG>14THENG=1 . :1 3 8 0 85 3C- H9 00 85 3D 4C C5 107 IFG <1THENG=14 .:1388 13 H5 3C 1 0 8 G 0 T C 9 6 C 9 04 D0 1C- Fl5 109 IFP=C0RP=HTHEN98 . r 1330 46 C5 32 F0 0D FI5 47 C5 110 G0SUB68:IFN 3>1THEN98 . :1398 32 F0 07 fl9 0D 85 3C 40 111 POKEL, T :POKEL+R,0 :POKEV,0 IPOKEE, 0 : 1 =N : J=G : RETURN . :13H0 C5 13 H9 00 85 3C 85 3D 1 12 POKEDD , 127 : B=PEEK < P2 > R N D 1 2 3 : J 0 = - < B = 0 > : P O K E O O , 2 5 5 : B = P E E K < P 1 > 1 13 J2=-<=0.') : J3= -< =0.') :FB =-< lJ l= -< . : 13FI8 4C- C5 13 fl5 3D C9 04 D0 114 IFJ0THENDX=1 . : 13B0 14 FI 5 46 C5 33 F0 EB Fl5 115 IF J 1THENOV—1 . : 1 3B8 47 C5 33 F0 E5 FI9 0B 85 116 IFJ2THENDX=—1 . : 13C0 3C FI9 00 85 3D FI9 00 85 117 IFJ3THEN0Y=—1 . : 13C8 44 fi5 3C C9 00 D0 118 RETURN 03 05 RERDV. . : 13D0 3D C9 00 D0 09 4C: E2 13 . :1 3 0 8 H5 3D C9 00 D0 04 H9 01 . ; 13E0 85 44 Fl5 4FI C5 47 D0 04 grid. By comparison, the first version of the computer will unrelentlessly block . : 13E8 fl9 01 85 5C: 60 FI2 00 B5 GOMOKU I wrote was entirely in your chances for any kind of a winning . : 13F0 32 9D 84 03 BD B 6 03 35 BASIC and took from three to six pattern. When the computer loses a . : 13F8 32 E0 2B F0 04 E8 4 C EF minutes between moves — and it did game, it will automatically play a more . : 1400 13 60 fl5 3E 85 40 R5 3F not play half as well as the current ver­ aggressive game the next time. . : 1408 85 41 H6 42 B5 34 85 43 . : 1410 FI2 00 86 3C 86 3D 86 45 sion. VIC/PET GOMOKU should be The VIC Version capable of holding its own against even . : 1418 86 46 86 47 86 4fl H5 43 very good human players — especially The VIC version of GOMOKU .:1420 38 C9 80 B0 0E H5 40 38 E5 43 B0 02 C6 41 85 40 needs at least 3K of additional memory. . : 1428 if the computer moves first. . :1 4 3 0 4C. 3E 14 E9 30 18 65 40 VIC/PET GOMOKU has three This can be obtained by using any of . : 1438 90 02 E6 41 85 40 H0 00 styles of play: cautious, balanced, and the standard VIC Super Expander, 3K, . s 1440 61 40 85 47 FI5 3E 85 40 aggressive. These styles refer to how 8K, or 16K memory cartridges. . : 1448 FI5 3F 85 41 E8 H5 43 38 much the computer will weigh defen­ The program is written in two parts. . : 1450 C9 80 B0 0C- 18 65 40 30 sive vs. offensive moves in its evalua­ Listing 1, the main part, is written in . :1 4 5 8 02 E6 41 85 40 4C 6F 14 tion of the merits of its next move. If BASIC and should be keyed-in exactly . :1 4 6 0 E9 80 85 44 fl5 40 38 E5 you select a balanced style, both of­ as shown in the listing (i.e., with no . :1 4 6 8 44 B0 02 C6 41 85 40 fl0 fense and defense have equal weights. unnecessary spaces to conserve mem­ . : 1470 00 B1 40 C9 20 D0 0FI 38 E0 2F E6 5D FIB You will find the computer will win ory). Listing 2, a hex-dump of the . :1 4 7 8 03 B0 40 . : 1430 14 C5 32 D0 02 E6 3C- C5 more games when it is playing aggres­ machine-language routines, shows the . : 1488 33 D0 02 E6 3D E0 01 D0 sively. However, when you select the machine code being located from $1300 . : 1490 02 85 4fi E0 04 D0 02 85 cautious style for the computer, you to $14AB. These locations assume you . : 1498 45 E0 05 D0 FIF 85 46 C-5 may not be able to win often because are using either the Super Expander or . s 14H0 32 D0 02 C6 3C C-5 33 D0 many games will end up in stalemate; the 3K memory cartridges, which cause . : 14H3 02 C-6 3D 60 Flfi flfl Flfl flfl

60 MICRO - The 6502/6809 Journal No. 54 - November 1982 using the command LOAD "name", Listing 3 1,1. The l's at the end of the LOAD 1 RL=40 :S=32767 :E=12#4096 :V=E :FI=3*4096 will load the code at its absolute loca­ 2 FH-RND<-TI> 3 F0R I = 1T08 :RERDX :P 0K E 951+ I ,X :N EXTI sDPITHl ,3 9 ,4 0 , 4 1 , 1 2 9 , 1 6 7 , 1 6 8 , 169 sFH=10 tion (i.e., $1300-$14AB or $2100- 4 ML=PEEK<40)+256*PEEK<41)+3839:DIMD<8), VX< 14, 14> ,DR<9:>,0C<9> $22AB), rather than automatically be­ 5 F0RI = 1T09:REHDDRTHENFB=1sRETURN of whatever memory configuration is 114 IFF*<"1"ORF*>"9"THENRETURN 115 QQ =flSC

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-61) disks )- included). Cable and RS-232 • Macro Assembler/Text Editor for Disk-based systems. $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 EPROMS - HIGH QUALITY, NOT JUNK • Conditional Assembly, Interactive Assembly. • Editor has string search/search and replace, auto line= $6.95 Use with PET, APPLE, ATARI, SYM, AIM, etc. 450 ns. $6.50numbering, move, copy, delete, uc/lc capability. System Saver for Apple - Fan, Surge Protection, 2 for 271B, $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 $169.95 BMC Green Screen Video Monitor.

SECTORED DISKEHES 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. To get this = $90.00 Highest quality. We use them on credit, return ASM/TE0 manual with order for MAE our PETs, APPLEs, ATARIs, and other computers. $22.50/10 or $44.50/20 ATARI AND PET DC Hayes Smart Modem = $235.00, Micro Modem EPROM PROGRAMMER II = $289.00, Chronograph = $225.00 NEW! C. IT0H STARWRITER F 10 Programs 2716 and 2532 DAISY WHEEL PRINTER EPROMs. Includes hardware C. Itoh Prowriter Printer. Better than MX80. We use constantly with our Apple and PET. Can be used on Letter quality, flawless copy at 40 char/sec. Bidirectionaland software. PET = $75110 - IBM, Atari, TRS-80, etc. 120 cps, friction and tractor printing, 15-inch carriage, uses standard Diablo ribbonsATARI (includes sophisticated feeds, hi resolution dot graphics, nice looking, high and print wheels. ~ $ ^ 9 S' machine language monitor) = $119.95 quality construction. Parallel - $499.00, with IEEE PARALLEL - $1495, RS-232 - $ii?^RACT0RS - $210 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. 54 - November 1982 MICRO - The 6502/6809 Journal 61 GAMES FEATURE

Number Shuffle on the Atari

by Frank Roberts

1 REM ************************************* A computer version of the 2 REM NUMBER SHUFFLE popular game Magic Square. 3 REM 4 REM Frank Roberts 5 REM 3736 F e rn d a le D riv e 6 REM Ft. Uaynfe, IN 4615 Number Shuffle 7 REM ************************************* 8 REM requires: 10 GOTO 30 20 BRD(P)=M0VE:POSITION X=X(8):X(21)=X(9):X(22)=X(10>:X(23)=X(11) 43 X(26)=X(8):X(27)=X(9):X(28)=X(10):X(29)=X(11) puzzle called Magic Square. It was 44 REM played by rearranging a random set of 45 Y<8)=5:Y<14)=8:Y(20)=11:Y(26)=14 numbers within a four-by-four matrix 46 Y(9)=Y<8):Y(15)=Y(14):Y(21)=Y(20):Y(27)=Y(26) 47 Y(10)=Y(8):Y(16)=Y(14):Y(22)=Y(20):Y(28)-Y(26) until the numbers were in numerical 48 Y(11)=Y(8):Y(17)=Y(14):Y(23)=Y(20):Y(29)=Y(26) ascending or descending order. 49 REM This program is a computer simula­ 50 GRAPHICS 2: POSITION 2,4: PRINT #6; ’ NUMBER SHUFFLE' 60 FOR MUSIC=50 0 TO 0 STEP -1.5:S0UND 0 , 0 , 8 , MUSIC:POKE 708 , I NT( RND( 0 )* 222 ) tion of that puzzle, and is built around : NEXT M'JSIC:SOUND 0 ,0 ,0 ,0 a six-by-six matrix. All positions sur­ 70 PRINT ' } D 0 YOU WANT INSTRUCTIONS ‘ ; : INPUT R $ :IF R $ (1 ,1 )< > ’ Y ’ THEN 100 80 GRAPHICS 0:POSITION 2,7 rounding the central matrix are set to a 81 PRINT 'NUMBER SHUFFLE IS A SOLITAIRE GAME IN WHICH 15 NUMBERS ARE value of - 1 and used only for com­ SCRAMBLED U ITH IN ' parison and validation of moves. One 82 PRINT ' A 4 X 4 SQUARE. THE NUMBERS ARE THEN MOVED ONE AT A TIME INTO position of the four-by-four center AN EMPT Y ' 83 PRINT ’ SQUARE IN AN ATTEMPT TO ARRANGE THENUMBERS IN NUMERICAL ORDER. matrix, set to zero, is graphically THE ONLY’ represented by a blank space. Only the 84 PRINT 'VALID MOVE IS ONE OF THE FOUR NUMBERS* numbers horizontally or vertically adja­ 85 PRINT 'ADJACENT TO THE EMPTY SPACE IN THE SQUARE.1 86 PRINT :PRINT * WHEN YOU ARE READY, PRESS RETURN’ ; : I NPUT R$ cent to the space may be moved into 99 REM ***** SET UP BOARD ***** that vacant space. 100 GRAPHICS l:P 0 S IT I0 N 4,5:F'RINT #6 ; ' ST _____ANDBY1 110 POSITION 3,7:PRINT #6;'I'M MIXING UP’ The game begins after the numbers 120 POSITION 5 , 9 : P RIN T H6;*THE BOARD' in the NBR array are shuffled 100 times 199 REM ***** CHOOSE SET OF RANDOM NUMBERS ***** (lines 210-250] and set into the play- 200 FOR J a 0 TO 15;NBRCJ+l)=J:NEXT J 209 REM ***** NOW SHUFFLE NUMBERS ***** field array, BRD (300-370). Once the 210 FOR J=1 TO 100 board is displayed on the screen, the 220 A=INT(RND<0)*15)+1 230B=INT(RND<0)*4) user is prompted for a choice of num­ 231 IF B»0 THEN B = A - l:lF B<1 THEN B=A+1 bers to move into the empty space. If 232 IF B* 1 THEN B=A-4:IF B<1 THEN B = A + 4 the number is valid, the number and the 233 IF B=2 THEN B= A + l:IF B>16 THEN B = A-1 234 IF B = 3 THEN B = A + 4:IF B>16 THEN B = A-4 space are switched. The X and Y arrays 240 TEMP=NBR

62 MICRO - The 6502/6809 Journal No. 54 - November 1982 GAMES FEATURE

Number Shuffle (continued)

499 REM ***** GET MOVE NUMBER AND PROCESS ***** 500 POP :TRY=TRY+1 505 PRINT ■ ,:P0KE 656 , PEEK( 656 ) - 1 510 PRINT ‘ENTER NUMBER TO MOVE: 1 ; 520 INP'JT MOVE 530 IF BRD( P-1 ) =MOVE THEN BRD : F' R I N T M 6 ; 1 * : G 0 T 0 600 550 IF BRD( P + l ) =MOVE THEN Bft D ( P + 1 ) = 0 : GOSU B 2 0 : P = P + 1 : PO S I T I ON X ( P ) , Y ( P ). : PRINT W 6 ; * * : G 0 T 0 600 560 IF BRD(P+6)=M0VE THEN BRD

,Y(P> SPRINT «6: 1 * : GOTO 600 Two Many Lines 570 PRINT * > I L L £ G A L MOVE*:GOTO 510 599 REM ***** CHECK BORAD FOR WIN ***** Kerry Lourash, author of " Sur­ 600 C = 0: IF BRD(29 )<)0 THEN POKE 656 i , 656>-1:GOTOPEEK 500 charge for OSI" in the August issue, 610 FOR J=8 TO 28 620 IF J = 12 OR J = 13 OR J=18J = OR l? OR J»24 OR J = 25 THEN 650 noticed an error in his listing. On page 630 C=C+1 77, there are two line numbers for 631 PRINT C r BRD < J ) 1100. Type in only one. 640 IF BRD < J > =C THEN 650 642 POKE 656,PE£K<656)-1 644 GOTO 500 650 NEXT J 69? REM ***** CONGRATULATE WITH FANFARE ***** 700 GRAPHICS 1‘.POSITION 2,6:PR IN T #6 ; * CONG* ATUL AT IONS * 710 POSITION 3 f 8:PRINT »6;*Y0U DID IT IN* Move the Decimal 720 POSITION 5, 10JPRINT # 6 ;T R Y ;‘ MOVES1 729 REM ***** PLAY SONG ***** An error in the September Software 800 FOR J=1 TO6 Catalog last month could have bank­ 810 READ S ,S 2 ,I 820 SOUND 0 , S, 1 0 , 8 : SOUND 1 , S-1,10,4 I 30UND 2 , S2, 1 0 , 4 : SOUND 3,SZ-1,10,2 rupted MicroSoftware International, 830 FOR K = 1 TO IlN EX T K Inc. Computer Business Software was 840 NEXT J wrongly listed as $64.70. It should have 850 SOUND 0 , 0,0 , 0 : SOUND 1, 0 , 0 , 0 : SOUND 2 , 0 , 0 , 0 : S0 UND 3,0,0,0 900 DATA 162,81,15,121,60,20,?6,47,25,81,40,70,96,47,20,81,40,100been $6470.00. Pardon our slip.

JMCRO

OSI Delete Modifications

VOICE I/O THAT WORKS! Claude Banon of Quebec, Canada, for the APPLE II and Commodore computers sent in this update. Voice I/O has come a long way from Ihe In the August issue of MICRO, Mor­ barely intelligible computer speech of on­ ly a few years ago. It is now possible to ris and Morishita wrote a program for enter data or commands to your computer "Delete on the OSI." Here is a just by talking to it and the computer can talk back with clear, pleasant, human modification that will save you seven sounding voice. The COGNIVOX models Vl0-1002 {tor bytes in your program. Commodore) and Vl0-1003 (for the Apple In their program to get the code for II +) are at the forefront of a new genera­ tion of Voice i/O peripherals that are easy the "O K ", you go through the output to use, offer excellent performance and are affordably priced. to CRT routine, and then get back to BASIC in address $A319. Another way SOME SPECIFICATIONS COGNIVOX can be trained to recognize would simply get you back in BASIC up to 32 words or phrases chosen by the user. To train COGNIVOX to recognize a through the warm start located at new word, you simply repeat the word $A274. This routine will print the three times under the prompting of the system. "O K ". Here are the necessary changes COGNIVOX will also speak with a voca­ bulary of 32 words or phrases chosen by in your BASIC program: 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 18 N = 57: FOR X = M TO M + N - 1 : with the computer is possible. Memory re­ and stores the voice of 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 READ J: POKE X, J: NEXT imately 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. 22 A = INT (M/256): B = M - 256*A: 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 POKE M - 6, A: POKE M - 7, B 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 I! + with 1 disk drive have a choice of voices: male, female, child, and DOS 3.3. 42 DATA 144, 5, 32, 110, 2, 240, 219, foreign. Fourth and foremost, COGNIVOX 76, 116, 162 sounds very, very good. Nothing in the ORDER YOUR COGNIVOX NOW market today can even come close to the Call us at (805) 685-1854 between 9am quality of COGNIVOX speech output. You and 4pm PST and charge your COGNIVOX There is no need for a line 44. 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 I would also like to point out a little the phone. Hearing is believing. computer. Price for either model of COG­ mistake in the text. When you write 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 MAIL). that the code is relocatable with the ex­ signal processor and an exclusive non-li­ COGNIVOX comes assembled and test­ ception of the JSR at $026E, it should near pattern matching algorithm to do ed and it includes microphone, software, speech recognition. This gives reliable op­ power supply, built in speaker/amplifier be $0266. and extensive user manual. All you need VOICETEK eration at low cost. In fact, the perfor­ Dept 8 , P.O. Box 388 Goleta, CA 93116 mance of COGNIVOX in speech recogni­ to get COGNIVOX up and running is Io JMCRO tion is equal or better to units costing plug it in and load one of the programs Also available for rhe AIM-65. many times as much. supplied. Call or write for details.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 63 PER80M ATARI Disk Drives for Atari Computers 400 Single Drive S1 ..... $649.00 800 — 48K Add-on Drive A1 .... $349.00 16K..... $269 Dual Drive S2...... $899.00 32K..... $349 *669 48K ..... $429 //-SCI 410 Recorder ...... $ 76.00 Microtek 16K RAM ...... $ 74.95 MICRO-SCI 810 Disc Drive...... $449.00 Ramdisk (128K) ...... $429.95 822 Printer...... $269.00: Itec 48K Board ...... $159.00 Disk Drives for 825 Printer...... $589.00 Itec 32K...... $ 74.00 Franklin & Apple II 830 Modem ...... $150.00 One Year extended warranty...... $ 70.00 All...... K 820 Printer...... $259.00 481 Entertainer ...... $ 69.00 850 Interface...... $169.00 482 Educator...... $130.00 CX40 Joystick...... $ 18.00 483 Programmer...... $ 49.00 CX853 16K RAM...... $ 77.95 484 Communicator...... $344.00

MODEMS . HOT ATARI. CBS Hayes Smart...... $1 ROM CARTRIDGE GAMES Chronograph ...... $‘ JK GAMES A< Microdem ll...... $J PAC-MAN...... $35.00 FOR YOUR ATARI Microdem 100...... & Novation Auto Centipede...... $35.00 Krazy Shoot Out...... $32.00 D Cat...... $’ K-razy Kritters...... $32.00 Caverns of Mars ...... $32.00 Cat...... $' Asteroids ...... $29.00 K-razy Antics...... $32.00 Anchor Missile Command...... $29.00 K-star patrol...... $32.00 Mark I (RS-232)...... $ Star Raiders...... $39.00 Mark II (Atari)...... $ Ghost Hunter...... $24.00 STICK STAND « Mark III (TI-99)...... $ Mark IV (CBM/PET)...... $ $099 Mark V (OSBORNE)...... $ RASTER Mark VI (IBM-PC)...... $ Mark VII (Auto Answer/Dial) ...... $ ARCADE ACTION FROM 9 Volt Power Supply...... $ * BLASTER YOUR ATARI JOYSTICK

ON-LINE Jawbreaker...... $27.00 MONITORS DATASOFT Softporn...... $27.00 Wizzard and Princess...... $29.00 Gamm for the Atari 300G.. . The Next Step ...... $34.00 $1 Pacific Coast Highway...... $25.00 Mission Asteroid...... $22.00 Color I ...... & Color II...... $< Canyon CUmber...... $25.00 Mouskattack...... $31.00 Color III...... $< Tumble Bugs...... $25.00 SYNAPSE Shooting Arcarde ...... $25.00 BMC Clows and Balloons ...... $25.00 File Manager 800...... $79.00 Chicken...... $28.00 12” Green...... $ Graphic Master...... $30.00 Dodge Racer...... $26.00 13” Color 1400...... $l Graphic Generator ...... $13.00 Synassembler...... $30.00 13” Color 1401 (Midres) ...... & Micro Painter...... $25.00 Page 6 ...... $19.00 ZENITH Text Wizard...... $09.00 Shamus...... $26.00 Spell Wizard...... $64.00 Protector...... $26.00 ZVM121...... X Nautilus...... $26.00 Bishops Square ...... $25.00 SHARP Slime...... $26.00 Disk Manager...... $24.00 Sharp 13" Color TV..

VISICORP TIMEX Maxell Disks VISICALC MO I (Box of 10) ...... $ Apple II + ...... $189.00 MD II (Box of 10)...... $ Atari...... $189.00 MFD I (8”)...... $ Commodore...... $189.00 TIMEX SINCLAIR 1000 MFD II (8" Double Density) ...... $ IBM...... $189.00 Syncom (Box of 10)...... $ For APPLE, IBM, FRANKUN VlskJex...... $189.00 LOWEST Computer Covei Vlsifile...... $189.00 PRICE Visiplot...... $159.00 Atari 400...... $6.99 Commodore VIC-20.. $ Visiterm...... _...... $189.66 EVER *89” Atari 800 ...... $6.99 Commodore 8032 ...... $’ Vbitrend'Ptot ...... $229.00 Atari 810 ...... $6.99 Commodore Visl Schedule...... $229.00 805

l der s a e r e rd Commodore o il a m r e t u p m o c Business Machine^ CBM 64...... 3 il L 4032...... $ 749.00 8096 Upgrade Kit...... $ 369.00 Super Pet...... $1599.00 2031...... $ 369.00 8250 Double Sided Disk Drive...... $1699.00 □9060 5 Megabyte Hard disk...... $2399.00 The Manager...... $209.00 D9090 7.5 Megabyte Hard disk ...... $2699.00 Magis...... Call 8050...... $1299.00 4040...... $ 969.00 64K Personal Computer PROFESSIONAL SOFTWARE 8300 (Letter Quality) ...... $1549.00 Hardware, software and Word Pro 5 +...... $319.00 8023...... $ 599.00 peripheral compatable with the Word Pro 4 +...... $299.00 4022...... $ 399.00 Word Pro 3 +...... $199.00 Pet to IEEE Cable...... $ 37.00 I Apple II and even has some fea­ The Administrator ...... $379.00 IEEE to IEEE CAble ...... $ 46.00 tures not found on the Apple. InfoPro Plus...... $219.00 Tractor Feed tor 8300 ...... $ 240.00 Power...... $ 79.00 New Z-Ram, Adds CP/M and 64K Ram.....$ 549.00

HEWLETT | 5 g | H EW LETT PACKARD * VK‘20 1 "HA PACKARD VIC 20 ■J" HP 41CV HP* 85 CALCULATOR *179 VIC 1530 Commodore Datassette ...... $ 69.00 s1969 VIC 1540 Disk Drive...... $ 339.00 *209 VIC 1541 (64 Disk Drive)...... CALL VIC 1515 VIC Graphic Printer...... $339.00 HP*125...... $1969.00 HP 41C...... $149.00 VIC 1210 3K Memory Expander ...... $ 32.00 BP*85 16K Memory Module...... $ 169.00 HP 10C...... $ 69.00 VIC 1110 8K Memory Expander ...... $ 53.00 5VST Dual Master Disc Drive...... $1799.00 HP 11C...... $ 79.00 16K VIC Expansion ...... $ 94.00 Hard Disk w'Floppy ...... $4349.00 HP 12C...... $114.00 VIC 1011 RS232C Terminal Interface...... $ 43.00 Hard Disk...... $3549.00 NEW 115C...... $119.00 VIC 1112VIC IEEE-488 Interface ...... $ 86.00 “Sweet Lips" Plotter...... $1199.00 NEW 16C...... $125.00 VIC 1211 VIC 20 Super Expander ...... $ 53.00 80 Column Printer ...... $ 649.00 HPIL PERIPHERALS IN STOCK! VIC Mother Board ...... $ 99.00

NEC PRINTERS COMPUTERS 8001-A...... $749.00 8031...... $749.00 Smith-Corona 8012...... $549.00 PRINTERS PC-1500 8023...... $ 549.00 SHARP 771 (V7730...... $2399.00 POCKET COMPUTER TP-1 351 (V3530...... $1599.00 ALSO AVAILABLE: MONITORS Printer w/cassette interface JB-1201...... $179.00 $599 JC-1201...... $349.00 cassette tape recorder JC-1202...... $899.00 and 4K and 6K RAM EXTENSIONS Call for price and information on the new "intelligent” letter quality printer. Televideo In-stock Items shipped same day you call. No risk, no deposit on C.O.D. or­ c. rroH (Tic) Terminals ders. Pre-paid orders receive free ship­ Staiwrtter (F10-40CPS)...... $1399.00 ping within the continental United States Printmaster (F10-55CPS)...... $1749.00 with no waiting period for certified checks Prowriter 80 Col (P)...... $ 499.00 Prowriter 80 Cd (S)...... $ 629.00 910...... $579 or money orders. Add 3% (minimum Prowriter 2 (132 Cd)...... $ 799.00 912C ...... $699 $3.00) shipping and handling on all 920C ...... $749 C.O.D. and Credit Card orders. NV and OKIDATA 925C ...... $749 PA residents add sales tax. All items 82A-...... $ 469.00 950 ...... $950 subject to availability and price change. 83A-...... $ 689.00 84 Parallel...... $1099.00 NOTE: We stock manufacturer’s and 84 Serial...... $1249.00 802...... $ Call third party software for most all com­ 802H ...... $ Call puters on the market! Call today for our — ALSO — 816...... $ Call new catalog. Talley 8Q24-L...... $1629.00 80®...... $ Call IDS Prism...... CALL

ADDITIONAL MANUFACTURER'S DISCOUNTS AVAILAB^^^QUAUFIE^EDUCATIONAUNST^^nONS east 800-233-8950 477 E. THIRD ST. IN PA Williamsport CALL PA 17701 (717)327 9575 Sensible Use of Apple Game Paddles

by Harry L. Pruetz

Some programming suggestions more than half of a degree! Labeling the BASIC or faster computer languages to improve the validity of game- paddles and marking the actual ranges may still use the paddles for game input paddle inputs. are quite helpful for many games. without noticeable effect from the slow The paddle cable that plugs into the timing speed. It is usually the machine- game I/O connector is a source of prob­ language implementations of sophisti­ lems. Each time the paddles are discon­ cated, fast-action games that avoid Paddle Use nected, cable pins may get bent when using paddles. requires: reconnecting the paddles. The pins The program listed is a RAM Apple­ Apple computer with either may be bent back into shape and the soft BASIC program to test and demon­ Integer or Applesoft BASIC electrical connection will still be strate some software techniques useful and the Apple game paddles sound. However, a simple program to with game paddles. sample and display paddle values should Lines 100 through 195 merely sam­ be run occasionally to make sure the ple paddle 0 and print a value if it is dif­ When using Apple II game paddles, paddles are functioning correctly. ferent from the previous sample. Line there are both hardware and software A monitor routine measures a pad­ 110 exits the sampling loop when any problems involved. With some knowl­ dle value by delaying 12 microseconds key is pushed. The paddle may be set to edge of inherent limitations, the pad­ for each unit value measured after the any value greater than 0 and less than dles can add to the enjoyment of com­ paddle is triggered. Thus a value of 255 255, and left untouched for a while. puter games, both while designing a takes three milliseconds to measure. Because of the sensitivity of the pot and game and playing it. Times of one to three milliseconds for the monitor routine which determines My Apple II came with two paddles each PDL call are not excessive for In­ the value PDL(0), the value often skips hooked up to the game I/O connector. teger or Applesoft BASIC. There are back and forth between two consecu­ The paddles were actually rotating usually many other statements exe­ tive numbers. This causes errors in potentiometers, rather than the cuted between PDL calls. Compiled some games that are not the player's joystick-type paddles available. Unlike two-player games, games designed for Listing 1 one player using both paddles for x-y control would be better played with a *********************** real joystick controlling both x and y is iwm * paddle: u se demos coordinate movements. 20 REM * 25 RFM * RY 'IARRY L. PRUETT The most obvious limitation on both 30 REM *********************** game paddles is the 300-degree physical 35 DIM XC%(128),YC%(128) limit on control knob movement. Nu­ 40 DEF EN X(D) = 4 * INT (1 + W ( PDL (0) * 68) / 255) merical values possible from a paddle 45 DEF EN.Y(D) = 2 * INT (2 + INT ( PDL ( I ) * 12) / 255) range from 0 at the complete counter­ 47 OTTD 95 50 REM *** PDL(0) CALC *** clockwise position, up to 255 at the 55 D = ( PDL (0 ) - 4 * XP) / 4:XP = XP + SGN (D) * INT( ABS (D )):X = 1 complete clockwise position. How­ 1 + 4 * XP: RETURN ever, these values are available for only 60 REM *** PDL(l) CALC *** about a 150-degree rotation of the knob. 65 D = (255 - PDL (1 ) - 3 * YP) / 3:YP = YP + SON (D) * INT ( ABS (D )) The values read from BASIC using :Y = 10 + 2 * YP: RETURN the PDL function may be expressed as a 70 REM ** * FRAC PDL(0) CALC * * * 75 F = 255 / 45:D - ( PDL (0) - F * XP) / F:XP = XP + SGN (D) * TNT ! ABS function of the angle of the paddle knob (D)) :X = 6 * XP: RETURN as follows: 80 REM * * * FRAC PDL(l) CAIC * * * 85 F = 255 / 45:D = (255 - PDL (1) - F * YP) / F:YP = YP+ SGN (D) * INT Angle Value ( ABS (D )):Y = 4 * YP: RETURN 0-29 95 POKE - 1 6 3 6 8 ,0 : '10ME 30-65 0 100 REM 66-101 0-63 101 RFM *********************** 64-127 102 REM * PADDLE 0 SAMPLING 102-137 103 REM *********************** 138-173 128-191 104 REM 174-209 192-255 105 VP = PDL (0) 210-329 255 110 IF PEEK ( - 16334) > 127 TIEN 195 330-359 115 VC =» PDL (0) 120 IF VC < > VP THEN PRINT VC;" The value read from a paddle may change 125 VP = VC by 1 when the knob is moved slightly 130 GOTO 110 (continued)

66 MICRO - The 6502/6809 Journal No. 54 - November 1982 Listing 1 (continued) fault. When the paddle cable is not 195 POKE - 16368,0: HOME properly plugged into the game I/O 200 REM connector, values may vary even more, 201 RUM *********************** sometimes changing when the other 202 REM * PADDLE 1 AVERAGING paddle is moved. 203 REM *********************** 204 REM Lines 200 through 295 provide a 205 VP = PDL (1) more stable readout from paddle 1. A 210 IF PEEX ( - 16334) > 127 THEN 295 different paddle is used here to allow 215 VC = INT ( INT ( PDL (1) + VP) / 2) the program to be used for paddle 220 IF VC < > VP TIEN PRINT VC;" checkout. When paddle 1 is not being 225 VP = VC 230 GOTO 210 moved, the averaged value VC changes 295 POKE - 16368,0: HOME only in very rare cases. A disadvantage 300 REM of this averaging method is that the 301 REM *********************** range is now only 0 through 254. 302 REM * SMOOTH FADING TRAIL 303 REM *********************** Averaging also slows down the rapidity 304 REM with which VC may change. Paddle 0 305 PC = 1:NP = 128 in the first case can be moved from one 310 X = EN X(0) extreme to the other during only three 315 Y = FN Y( 1) or four samplings. Paddle 1 in this case 320 FDR I = 1 TO 128:XC%(I) = X:YC%(l) = Y: NEXT I takes about five more samplings for VC 325 HGR2 to catch up to the actual PDL(l) value. 330 IF PEEX ( - 16334) > 127 THEN 395 335 HCOLOR= 0 : HPIOT X - 3 ,Y - 3 TO X + 3,Y + 3 : HPIOT X - 3 ,Y + 3 TO X + Line 215 could also be changed to give 3 ,Y - 3 the previous value more weight with 340 HPLOT XC%(PC) ,TC%(PC) the penalty of slowing down the sam­ 345 HCOLOR= 3 : HPLOT X,Y pling even more. For example: 350 XC%(PC) = X:YC%(PC) = Y 355 PC = PC + 1 : IF PC > NP THEN PC = 1 215 VC = INT(INT(PDL(1) + 2*VP)/3) 360 X = INT ( INT (X + EN X (0 )) / 2) 365 Y = INT ( INT (Y + FN Y (D ) / 2) The INT functions required in Apple­ 370 HPIOT X - 3,Y - 3 TO X + 3 ,Y + 3 : HPLOT X - 3,Y + 3 TO X + 3,Y - 3 soft BASIC make the above statement 375 GOTO 330 more inefficient than when using In­ 395 POKE - 16368,0: HOME teger BASIC. 400 REM 401 REM *********************** Lines 300 through 395 use high- 402 REM * DISCRETE FADING TRAIL resolution graphics to demonstrate pad­ 403 REM *********************** dle sampling with averaging. XC% and 404 REM YC% are arrays used as circular queues 405 PC = 1:NP = 128:XP = 0:Y° = 0 to allow display of the last 128 loca­ 410 ODSUB 50 415 Q3SUB 60 tions of the 'X' shape. The functions at $ 3 ? J5S&21 = 1 TO 128:XC%( I ) = X:YC%(I) = Y : NEXT I lines 40 and 45 convert a paddle value into x and y coordinates. Again, INT 430 IF PEEK ( - 16334) > 127 THEN 495 functions are required in Applesoft 435 HCOLOR= 0 : HPIOT X - 3 ,Y - 3 TO X + 3 ,Y + 3 : HPIOT X - 3,Y + 3 TO X + BASIC to insure integer arithmetic. 3 ,Y - 3 440 HPIOT XC%(PC),YC%(PC) The numbers in the defined functions 445 HCOIT)R= 3 : HPIOT X,Y are fairly easy to obtain by using the 450 XC%(PC) = X :YC%(PC) = Y "slope-intercept form1' for straight 455 PC = PC + 1 : IF PC > NP THEN PC = 1 lines. From Analytic Geometry: 460 QDSUB 50 465 QOSUB 60 = a + mg, 470 HPIOT X - 3 ,Y - 3 TO X + 3 ,Y + 3 : HPIOT X - 3 ,Y + 3 TO X + 3,Y - 3 where g is the independent variable, 475 GOTO 430 m is the slope of the line, 495 KKE - 1 6 3 6 3 ,0 : TEXT : HOME a is the value of f at g = 0, 500 REM 501 REM *********************** and f is the dependent variable. 502 REM * FRACTIONAL PADDLE INS We want the paddles to determine 503 REM *********************** screen location. Only multiples of 4 are 504 REM used as x-coordinate locations, so the 505 XP = 0:YP = 0 : GOSUB 7 0 : GOSUB 80:XC = X:YC = Y 510 HGR2 : HCOIOR= 2:SW = 0 figure 'X' may be plotted at 4, 8, ..., and 515 EOR I = 0 TO 275 STEP 2 276 without x -3 or x + 3 causing "il­ 520 HPLOT 1,0 TO 1,133 legal quantity” errors. Ignoring the 525 NEXT I multiplier of 4 for now, f should be 1 530 HCOLOR= 1 : EOR I=X+lTOX + 5 STEP 2 : HPLOT I ,Y TO I ,Y + 3 : NEXT when PDL(0)=0, and 69 when 535 IF PEEK ( - 16394) > 127 THEN 595 PDL(O) = 255. For f = a + m*PDL(0), 540 QDSUB 7 0 : GOSUB 3 0 : IF X = XC AND Y = YC THEN 535 a = 1 and m = (69 - 1)/|255 - 0 ), so that 545 HC01£)R= 0 : FDR I=XC + lT O X C + 5 STEP 2 : HPLOT I,YC TO I.T C + 3 : NEXTf = 1 + (PDL(0)*68)/255 and x = 4*f. Thus we get line 40, where D is an 550 HCOIDR= 0 : HPIOT XC + 2,YC + 1 TO X + 2 ,Y + 1 unused dummy variable: 555 HCOIOR= 1 : FDR I=X+lTOX+5 STEP 2 : HPIOT I ,Y TO I ,Y + 3: NEXT 40 DEF FN X(D) = 4*INT(1 +INT 560 XC = X:YC = Y: GOTO 535 (PDL(0)*68)/255) 595 POKE - 1 6 3 6 8 ,0 : TEXT : HOME 999 END M u ltip les of 2 are used as y-coordinate locations, so the figure 'X' may be plotted at 4, 6, ..., and 188

No. 54 - November 1982 MICRO - The 6502/6809 Journal 67 GAMES FEATURE without y - 3 or y + 3 causing “ illegal If PDL(0) is increased to 4, then XP horizontal, and 184 of 192 vertical quantity" errors. Ignoring the multi­ becomes 1. If PDL(0) changes back to 3 high-resolution points are used. The plier of 2 for now, f should be 2 when by itself, there will be no new XP white cursor is plotted and erased using PD L(1)=0, and 94 when PDL(l) = 255. because the difference is only 1. Now, the complimentary color between the For f = a + m *PDL(l), a = 2, m = when PDL(0) is increased to 7, there background lines. Straight black lines (94 - 2)/(255 - 0), and y = 2*f. Thus will still be no change in XP. If PDL(0) are drawn between each position of the we get line 45, where D is an unused changes to 8 by itself and then back to 7 cursor as it is moved using the game dummy variable: again, the value XP = 2 will be calcu­ paddles. 45 DEF FN Y(D) = 2*INT(2 + INT lated and will remain in effect until Fractions much smaller than (PDL(1)»92)/255) PDL(0) is changed to 4 or 12. Thus the 5.66667 may be used in the difference output of this routine is stable without calculations for game paddles. I have Line 320 initializes the circular averaging. I have chosen to call the used a fraction as small as 1.275 to get queue. The actual loop is lines 330 method differencing. Note that merely 200 stable values from a game paddle. through 375. The loop performs the dividing PDL(0) by 4 would not give The values are not exactly "one-to-one" following steps: stable results. The use of SGN(D)*INT for a game paddle. For example, (ABS(D)) is used since INT( -1.1) gives PDL(0) = 7 may give a calculated value 1. Erase current 'X'. - 2 instead of the - 1 desired. of 5 or 6 depending on the previous 2. Erase last point in trail. Note also that 255-PDL(l) is used in value. However, the calculated values 3. Plot current point in trail. are stable and the game player cannot 4. Save point location in queue. line 65 rather than just PDL(l). This see the difference. 5. Adjust queue pointer. gives the same "intuitive" coordinate change for the y-coordinate as paddle 0 If you have Integer or Applesoft 6. Plot next 'X'. does for x-coordinate values. Thus, BASIC programs that use game paddles Lines 360 and 365 average the x and y clockwise rotation of paddle 1 causes and do not give satisfactory results, you values obtained from the paddle func­ movement from the bottom to the top may consider making a few simple tions. The averaging has a smoothing of the CRT display. changes similar to the given examples. effect on movements of the figure 'X' as The rest of this case is essentially Programs that use only a few keys may it is moved around on the high- the same as lines 300 through 395. also be changed to use the game pad­ resolution grid. Finally, we have a demonstration in dles. Above all, sit back and relax. An Lines 400 through 495 demonstrate lines 500 through 595 of fractional aching back caused by leaning over a a way of obtaining reliable paddle input ranges of the paddles. The routines that keyboard is not really necessary. without averaging. The routine at line sample the paddles are at lines 70 and 50 is essentially the same as the one at 80. The fraction involved is 255/45 or Contact the author at 2929 Clydedale, line 60. However, the PDL(0] routine 5.66667. This gives a high-resolution #376, Dallas, TX 75220. will be explained in detail. Let us con­ display of 46 by 46 cells six points wide sider the case of PDL(0) = 0 and XP = 0. and four points deep. Only 276 of 280 4MCRO

Ver. 2 For your APPLE II/II+ | SIG-FORTH V 1.0 1 The complete professional software system, that meets The only stand-alone Forth system ALL provisions of the FORTH—79 Standard (adopted Oct. 1980). Compare the many advanced features of F O R T H - for O.S.I. serial machines 79 with the FORTH you are now using, or plan to buy! FEATURES OURS OTHERS 79-Standard system gives source portability. YES Features: Professionally written tutorial 8t user manual 200 PG. Screen editor with user-definable controls. YES Complete Forth source code Macro-assembler with local labels. YES Virtual memory. YES Advanced Screen editor w/source Both 13 & 16-sector format. YES 6502 macro assembler w/source Multiple disk drives. YES Double-number Standard 8t String extensions. YES Double number and CASE extensions Upper/lowercase keyboard input. YES Vectored boot capability LO-Res graphics. YES 80 column display capability YES Several Utility Screens Z-80 CP/M Ver. 2.x & Northstar also available YES Affordable! $99.95 Complete glossary Low cost enhancement option: Hi-Res turtle-graphics. YES Floating-point mathematics. YES Dos Includes: Powerful package with own manual, 50 functions in all, Bi-Directional NEC driver AM9511 compatible. 65U read capability $100.00 FORTH-79 V.2 (requires 48K & 1 disk drive) $ 99.95 POSTAGE ENHANCEMENT PACKAGE FOR V.2 NMHZ Capability PAID Floating point 8t Hi-Res turtle-graphics $ 49.95 COMBINATION PACKAGE $139.95 (CA res. add 6% tax: COD accepted) DIGI COM ENGINEERING , INC. MicroMotion P.O. Box 1656 12077 Wilshire Blvd. #.506 Kodiak, Alaska 99615 L.A..CA 90025 (213)821^340 ORDERING INFORMATION: Check, money order orC.O.D.’s accepted. Specify APPLE, CP/M or Northstar Dealer inquiries invited. Shipment VIA first class mail. Allow approximately one week for delivery.

68 MICRO - The 6502/6809 Journal No. 54 - November 1982

* NEW FROM D & N MICRO PRODUCTS, INC.

Z80A CPU with 4MHz clock and CP/M 2.2 aluminum with vinyl woodgrain decorative operating system. 64K of low power static finish. 8 slot backplane for expansion. 48 RAM. Calendar real time clock. Centronics pin buss is compatible with most OSI type parallel printer interface. Serial inter­ boards. Uses all standard IBM format CP/M face for terminal communications, dip software. switch baud rates of 150 to9600.4"cooling fan with air intake on back of computer and Model 80-1200 $2995 discharge through ventilation in the bot­ 2 8" single sided drives, 1.2 meg of tom. No holes on computer top or side for storage entry of foreign object. Two 8" single or Model 80-2400 $3495 double sided floppy disk drives. IBM single 2 8" double sided drives, 2.4 meg of density 3740 format for 243K of storage on storage each drive. Using double density with 1K Option 001 $ 95 sectors 608K of storage is available on a Serial printer port, dip switch baud rate single sided drive 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 Micropro Basic-80 $289 PL/1-80 $459 W ordstar $299 Basic Compiler $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 MuSimp/Mu Math $224 DeSpool $ 50 Pascal Z $349 Mu Lisp-80 $174 AshtonTate Pascal M $355 d Base II $595 Convert almost any static memory OSI machine to CP/M® with the D & N-80 CPU Board.

Z80A CPU with 4MHz clock. 2716 EPROM plete with 10 ft. cable. Optional Real Time with monitor and bootstrap loader. RS-232 Calendar Clock may be set or read using serial interface for terminal communica­ ‘CALL’ function in high level languages. tions or use as a serial printer interface in a Power requirements are only 5 volts at 1.4 VIDEO system. Disk controller is an Intel amps. Available with WORDSTAR for serial 8272 chip to provide single or double densi­ terminal systems. ty disk format. 243K single density or 608K INCLUDES CPM 2.2 double density of disk storage on a single D & N-80 serial $695 sided 8" drive. A double sided drive pro­ D & N-80 serial w/Wordstar $870 vides 1.2 meg of storage. DMA used with D & N-80 video $695 disk controller to unload CPU during block OptionOOl $ 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 Printer Port $125 C1P-EXP Expansion Interface $ 65 Compatible with OS-65U and OS-65D soft­ Expansion for C1P600or610 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 " Shugart SA851 double sided $585 Centronics standard parallel printer inter­ BIO-1600 Bare IO card $ 50 FLC*66ft. cable from D & N or OSI $ 69 face with 10 ft. flat cable Supports 8K of memory, 2 16 bit parallel controller to 8 " disk drive BP-580 8 Slot Backplane $ 47 ports may be used as printer interfaces. 5 51/4" MPIB51 with cable, power $450 Assembled 8 slot backplane for OSI 48 pin RS-232 serial ports, with manual and Molex supply and cabinet buss connectors FLC-51/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 8MEM-CM9F $360 minifloppy spindle motor when system is disk switch BMEM-CM9F $ 50 FL470 $180 not accessin g the drive. Complete KIT and Okidata Mlcrollne Printers 24K memory/floppy controller card sup­ manual M L 82A Dot Matrix Printer $534 ports up to 24K of 2114 memory chips and 120 CPS, 80/120 columns, 9.5" paper width, an OSI type floppy disk controller. D & N Micro Products, Inc. friction or pin feed Available fully assembled and tested with 3684 N. Wells St. ML 83A Same as 82A except $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. (219) 485-6414 tractor feed Needs separated clock and data inputs. ML84 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

No. 54 - November 1982 MICRO - The 6502/6809 Journal 69 Space Invasion for OSI CI P/Superboard

by John S. Seybold

Space Invasion requires: OSI C1P or Superboard

In this real-time arcade game you must Space Invasion fight waves of incoming aliens. Each time you clear the screen of aliens it refills with more aliens, faster and 2 DIMFK 49 ' W=53366 • WU=W-1? ' 1=12=730 ' X=34214 ■ Y=34233 closer than the last bunch. The more 3 REM-RDJUST LINES 2320 RND 2062 FOR SPEED.ROD SOUND TO 630,7900 10 GOSUB200' POKE 11,34 'POKE 1 2 ,£ :SC=0 times you clear the screen, the more 20 HS*="HIGH SCORE"1 PRINT" SPACE INVASION" points each alien is worth. 4 0 P R IN T " ------" 'G 0 S U B 29 @ ‘ V = 3 2 ' K B = 3 7 0 8 8 'M = 2 5 1 The aliens are moved by the user 30 PR. INT" C > RIGHT" PR I NT "X > LEFT" ' PR INT"M > FIRE" • PRINT routine; their addresses are updated in 8 0 P R IN T ' IN P U T "D IF F IC U L T Y LE V E L < 1 - 5 V '> D > IF < D< 1 X>R< C » 3 >THEN8® 100 PRINT"HIT ' M' TO STRRT"•POKE330,1 :POKEKB>M line 2510. Z tells the routine which 110 I FPEEK.< KB )=MTHEN910 way to move the aliens. To adjust the 120 GOTO110 pace of the game, you may adjust line 200 F0RK=1T012 ' PRINT;NEXT:RETURN 400 REM-TURRET FIRE R O U TIN E********** 2082 or line 2520. If you remove all of 410 TM=P-V • IFPEEKC TM X J-RRTHENPOKETM, 39 ‘ RETURN the REM statements, the program 420 POKETM,V •RM*RM-1:TM=0!SC=SC+1 0 'RETURN should run in 4K of memory. 600 REM-TURRET FIRE UPDRTE ROUTINE*** 6 1 0 JxPEEKC TM >: I F.J=RATHENTM =0 ■■ RETURN 620 POKETM, V ' TM=TM-V‘ IFTMTHENTM=0■RETURN 623 IFTM=RFTHENTM»0'RETURN Mr. Seybold is employed by General 6 3 0 J=PEEK< TM ) ■ IFJ=VTHENPOKETM, 39 ■ RETURN 6 4 0 POKETM :V ■TM=0' IFJ<>flRTHENRETURN Dynamics in Pomona, CA. He has owned 650 RM=RM-1' SC=SC+10■SC*=STR* ■FORK=1TOLENCSC*J an OSI Superboard for a year and a half. 660 POKEW+K,ASCC M ID*> 690 POKEWW+K-j R3C< MI D$< HS*+STR$< HS >, K , 1 ) J • NEXTK • RETURN 700 REM-RLIEN FIRE UPDRTE ROUTINE**** 710 POKERF,, V ' RF=RF+V ' J=PEEK'; RF ) • IF< .J=RR 50R< RF>P >THENRF=0 > RETURN 720 IFJ=CVTHENPOKERF,V 'AF=0' RETURN 730 POKERF,3 9 'RETURN 900 REM-SET UP S C R E E N ************************* 910 FORK*1TOSS'PRINT'NEXT'P0KE34149,V'2=34087'CV=161 920 FORK® 1T04 • POKEZ, OV • P0KE2+1 ,CV' POKEZ+V, CV 930 POKEZ+33/CV•POKEZ-V,CV•POKEZ-31,CV<2-2+5•NEXTK>P=54224+2*V : POKEAC I ) RA ' NEXT I. ' NEXTK ■ POKEF', TU ' GOSUB6S0 1040 F0RI=346T0623>READJ'POKEI,J 'NEXTI 2000 REM-MOVE ALIENS? PROGRRM L O O P ********************************: 2010 C=C-1■IFPEEK=VTHENB=B+1 2080 I FPEEK't AC BB 5 !>=VTHENBB=BB-1 2062 IFC->0THENFORK=1TOC60-3*D) 'NEXTK' GOTO4020 2083 IFRTHEN2300 2033 IFZ<0THEN2100 2090 F0RK=YT0R< B JSTEP-V ■ IFPEEKC. K ';=AATHENZ=V-Z ' R=1 ' GOTO4020 2095 NEXTK'GOTO2500 2100 FORK=XTORC B ';STEP-V ' IFPEEKC K >=ARTHENZ=V-Z ' R=1 ' GOTO4020 2 1 1 0 NEXTK £500 IFZ >0THENPOKEAZ .■ 2 ' GOTO2510 2505 POKERZ/256+2 2310 X»USR 'F0RK=BT0BB'fitK >«fl(K >+Z•NEXTK' IFFK BB )=>XTHEN7300

70 MICRO - The 6502/6809 Journal No. 54 - November Space Invasion (continued) pon’t Forge*'' 2520 R=0 • D=. 3+< RM.'3 M FABSC 2 X > 1 THEN2=2-V 4000 REM-CHECK FOP. TURRET F IR E # * # * * * 4020 J=PEEKC KB ) 1 IFC < JORM )=M )ANDTM=0THENGOSUB41 <3 V i s i t 4490 REM-CHECK FOR TURRET MOVEMENT** 4500 IFCJ0R191 X>191THEN4600 4520 IFP< >YTHEN ‘ POKEP, V > P=P+1 ■■ POK.EP, TU : GOTO5000 4600 IF< JOR127X>127THEN50Q0 4610 IFP< >XTHEN • POKEP, V > P=P-1 > POKEP, T1J AMCftO 4990 REM-RLIEH F IR E ***************** 5000 IFAF<>0THEHGOSUB710■GOTO5100 5010 AL=BB-1NT< 5*RND< 3 } >1IFRLCBTHENRL-BB 5040 IFPEEKC RL > )-flflTHENRF»RCRL H V ■POKERF,39 a t th e 5100 IFRF=PTHEN7900 3200 IFTMTHENG0SUB610•IFRM<=0THEN9000 5210 GOTO2010 7390 REM-TURRET D E S T R O Y E D * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Northeast 7900 FORI = 1TO200; POKEP,2 : POKEP, 3 7920 POKEP, 232 ■ POKEP, 2 3 3 ' POKEP, 32 : NEXT ° GOSUB200 7930 PRI NT"THE ALIENS HAVE"’ PRINT 1 PR I NT"OVERCOME YOUR DEFENSES" Computer Show 7360 PRINT ■■PRINT"RND LANDED !!"• GOSUB200 7963 PR I NT"YOUR SCORE W AS";SC■PRINT 7980 FORK*1T 0 8 ■POKEW+K, V = NEXTK >FORI = 1TO3000•NEXTI S000 FORK=XTOY • POKEK, V • NEXT POKE330,0 3023 GOSUB200: PRINT" SPRCE INVADERS"' GOSUB200 8023 INPUT"PLAY AGAIN";K *;IFLEFTSCKX, 1 ) = " Y" THENRESTORE' GOTO10 Nov. 11-14, 1982 8030 FORK=WWTOY>POKEK, V •NEXTK' END 8990 REM-NEXT S C R E E N * * * * * * * * * * * * * * * * * 9000 RESTORE! IFD<7THEND=D+1 Hynes Auditorium 9010 FORK=XTOY‘ POKEK,V 0THENPOKETM,V 9045 IFAFO0THENPOKERF, V Boston, Massachusetts 9030 POKEP, V ■GOTO910 10000 DATA 53334,53356,53338,53360,53362,53364,53366 Booth #406 10010 DATA 216,169,211,133,217,169,0,133,216,160,255,177,216,201,231 10020 DATA 203,3,32,66,2,136,208,244,198,217,169,207,137,217,208,234 10030 DATA 96,169,32,145,216,152,72,174,238,2,4S,27,24,109,238,2,16S We look fonvaid to meeting you! 10040 DATA 176,8,169,231,145,216,104,168,136,36,230,217,163,231,145 10050 DATA 216,198,217,104,168,136,96,24,109,238,2,169,24,144,228

*># VANTEC 80 The COMPLETE 80 COLUMN VIDEO Board with HIGH RESOLUTION GRAPHICS CAPABILITY for your APPLE.

At last... a complete video board for your Apple II or Apple 11+ microcomputer. No longer are “Soft Switches, Lower case Eproms” and low quality graphics necessary. By • The VANTEC 80 is the only board that can overlay an 80 mixing the 80 column video directly onto the normal video character display on the normal Apple video. output, either high resolution graphics, low resolution graphics or 40 column text may be combined with the • Software switching between 80 & 40 character displays. 80 column display. • Mix High Res or Lo Res graphics with the 80 character Save $90 on Introductory Special — (List $389)—$299* text display. • Upper and lowercase characters with shift mod provided. R C Electronics Inc. • Flashing or inverted block video cursor. 7265 Tuolumne Drive, Goleta, CA 93117 • Apple-soft, Apple Pascal and Z80 Softcard® compatable. ____ (805)968-6614 ^ •Special Introductory Pricing available for systems purchased before Nov. 30, Dealer Inquiries Invited 1982. Credit card orders add 3%. California orders add 6% sales tax.

No. ^4 - November 1982 MICRO - The 6502/6809 Journal 71 Apple Shootdown

by Eric Grammer

A type and RUN low-resolution graphics game. Listing 1: Shoot Down Applesoft Listing

Shoot Down requires: Apple II with Applesoft and 10 PRINT : PRINT CHRS (4)"BLOAD LASER FIRE.OBJ" game paddles 20 TEXT : HOME : PRINT "S4COT DOWN” 25 DIM V(40) Here is a simple game with a short 30 PRINT : PRIOT "W A T'S TOUR SKILL LEVEL?" 40 PRINT : PRINT ”1 . SIMPI£T0N" machine-language sound program. The 50 PRINT ”2 . PAIR" oject of the game is to shoot at all the 6 0 PRINT "3 . 00 0 0 “ 70 PRIVT ”4 . EJKELLANT” columns with dots in them. The dots 80 PRINT " 5 . MR. PERFECT" will fire back at you. To move your ship, 90 PRINT : PRIWT "PLEASE PRESS THE NUMBER OF TOUR CHOICE:": use paddle (OJ. To fire, press the button. 100 GET SKS: IF VAL (SKS) < 1 OR VAL (SK$) > 5 THEN 100 110 SKILL = VAL (SKS) The machine-language section 120 VlftB SKILL + 4 : ETAS1 : HTAB 1 : PRIWT SK ILL;: NORMAL should be BSAVEd with A$300, L$30. 130 VlftB 20: PRINT "PRESS ANY KEY TO BEGIN... GET AS 140 POKE 7 ,1 The lo-res graphics listing is straight­ 160 TEXT : HOME forward and is fairly self-explanatory. 170 GR : OOIOR» 1 Good shooting! 180 X = urr ( PDL (0) / 7.3): OOSUB 380 190 FOR X = 1 TO 21 STEP 4 : FOR Y = 3 TO 35 STEP 4 : PLOT Y ,X : NEXT Y,X 200 &>!£»= 5 Assembler Listing Laser Fire 210 EOR X = 3 TO 19 STEP 4: FOR Y = 5 TO 33 STEP 4: PLOT Y,X: NEXT Y,X 1 220 91 IPS = 6 - SKILL 2 225 HOME : VTftB 2 4 : PRINT 91IP S" S H IP '';: IF SU P S = 1 THEN PRINT “ LEFT 3 LASER FIRE 1 ": GOTO 230 4 227 PRINT "S LEFT" 5 ERIC GRAM® 230 IF INT ( RND (1) * (7 - SK Ili)) = 1 THEN GOSUB 440 6 240 X = INT ( PDL (0 ) / 7 . 3 ) : IF B < > X THEN OOSUB 380 7 250 IF PEEK ( - 16287) > 127 THEN CALL 768: 03SUB 280: GOTO 230 8 ORG $300 260 IF INT ( WTO (1) * (7 - SKIlXi)) = 1 THEN OOSUB 440 9 270 (OTO 230 10 REPEAT EPZ $06 280 OOLOR= 15:C = X 11 USRRPT EPZ $07 290 EOR I = 34 TO 0 STEP - 2 12 YLOOP B0U $330 300 X =■ INT ( PDL (0 ) / 7 . 3 ) : IF X < > B THEN GOSUB 380 13 XLOOP EQU $331 310 EOR L = 1 TO 2 0 : NEXT 14 SPKR BOU $C030 320 OOI£>R» 15: VUN I.I + 2ATC + 2 15 330 OOD3R= 0 : PLOT C + 2 ,1 340 PLOT C + 2 ,1 + 4 : PIOT C + 2 ,1 + 2 0300 A9 00 17 ITA #$00 350 NEXT I 0302 85 06 18 STA REPEAT 360 V(C + 2) = 1 0304 A5 06 19 LOOP I£A REPEAT 366 COI0R= 1 4 : VUN 3 5 ,3 7 AT B + 2 0306 C5 07 20 CMP USRRPT 370 RETURN 0308 FO 08 21 BEQ END 380 OOtOR= 0: HUN B,B + 4 AT 39: HUN B,B + 4 AT 38: HUN B + 1,B + 3 AT 030A E6 06 22 ItC REPEAT 37 030C 20 13 03 23 JS R FIRE 390 VUN 3 5 ,3 7 AT B + 2 030F 4C 04 03 24 JMP LOOP 400 B =■ X 0312 60 25 END RTS 410 OTI£*= 1 4 : HLIN B ,B + 4 AT 39: HUN B ,B + 4 AT 3 8 : HUN B + 1 ,B + 3 AT 0313 A2 00 26 FIRE IXSC #$00 37 0315 AO 00 27 YCLEAR UJi #$00 420 VLIN 3 5 ,3 7 AT B + 2 0317 AD 30 CO 28 IDA SPKR 430 REIUHN 031A C8 29 DELAY INY 440 IF INT ( RND (1 ) * 2) = 1 THEN 460 031B 98 30 TYA 450 Y1 = IWT ( IWD (1 ) * 6) * 4 + 1:X1 » INT ( RND (1 ) ‘ 9 ) * 4 + 3 : GOTO 031C 8E 30 03 31 STX YLOOP 470 031F CD 30 03 32 CMP YLOOP 460 Y I = INT ( RND (1 ) * 5) * 4 + 3:X1 = WT ( B B (1 ) • 8 + 1) * 4 t 1 0322 30 F6 33 EMI DELAY 0324 E8 34 INX 470 YI = YI + 1 : IF V(X1) = 0 THEN 490 0325 8E 31 03 35 s t x xm op 480 (OTO 860 0328 A9 FF 36 IDA #$FF 490 OOIDR= 15 03 2A CD 31 03 37 CMP XLOOP 500 CALL 7 68: CALL 768 032D DO E6 38 W E YCLEAR 510 EOR L = YI TO 38 - SKIIi, STEP SKILL: VUN L.L + SKILL AT XI 032F 60 39 RTS 520 X = INT ( PDL (0) / 7.3): IF B < > X THEN CDSUB 380 0330 40 END 530 NEW 540 OOLOR- 0 550 EOR L = YI TO 34 STEP 3: VUN L,L + 4 AT XI: NEXT 560 IF SCm( X I,39) < >0 THEN 590 The author may be contacted at 95 Old 570 OOir>R= 0: VUN Yl,39 AT XI Street Road, Peterborough, NH 03458. 580 OC = 0 : RETURN (contim

No. 54 - November 72 MICRO - The 6502/6809 Journal GAMES FEATURE!

Listing 1 (continued)

590 COLOR58 15 JuimHting #nflmair ^ 595 HCME 600 FDR A * 35 TO 39: HLIN X,X + 4 AT A: NEXT 610 C01£)R= 0 : 4 LIN X,X + 4 AT 3 5 : CALL 768 620 HLIN X,X + 4 AT 36: CALL 768 p r e s e n t s 630 HLIN X,X + 4 AT 3 7 : CALL 768 640 HLIN X,X + 4 AT 38: CALL 768 650 HLIN X,X + 4 AT 39: CALL 768 655 IF SHIPS > 1 THEN PRINT "PRESS ANY KEY FDR NEXT SHIP : GET A$:SHI OSI C4P-MF SOFTWARE PS = S1IPS - 1:X * INT ( PDL (0) / 7.3): OOSUB 380: GOTO 225 660 IF X < 5 THEN X = 5 670 IF X > 32 THEN X = 32 680 FDR V = 20 TO 2 3 : VTAB V: HTAB X: PRINT "GAME";: CALL 7 68: HTAB X: PRINT " ; : NEJCT V 690 FDR L * 1 TO 4 : VTAB 2 4 : HTAB X - L: PRINT "GAME : CALL 768: NEXT

700 FDR V = 20 TO 2 3 : VTAB V: HTAB X: PRINT"CWER";: CALL 768: HTAB X: PRINT " j : NEXT V 710 FOR L = 0 TO 3 : VTAB 24 : HTAB X + L: PRIWT " CVER";: CALL 7 68: NEXT

720 PRINT : PRim* 730 PRim* "CARE FDR ANOTHER GAME? (Y/N): " j 740 GET G$: IF G$ =* "NM THEN 770 750 IF G$ * "Y" THEN CLEAR : GOTO 20 760 GOTO 740 770 HOME : TEXT 780 1 *= 0 THE HOST EXTENSIVE OfcD ADVENTURE/FANTASY 790 I = I + 1 : V IM I FOR THE O S I ' YOU MUST TRAVEL THROUGH THE E V IL LANDS OF IS IE R O N . F IG H T IN G AND 8GO FOR A = 39 TO 1 STEP - 1 : HTAB A: PRim* : HTAB A: PRINT " : NEXT KILLING MONSTERS ANO MAGIC-USERS EVERY A STEP OF THE UAY! YOUR OGAL IS TO SEEK 810 1*1+1: VTAB I OUT C E R T A IN TREASURES THAT W IL L ALLOW YOU TO FREE THE LANO FROM THE E V IL CHAIN 820 FDR A = 1 TO 3 9 : H IM A: PRIWT HTAB A: PRIOT " " : : NEXT A OF MAGIC CASTLES! COMPLETE WITH FULL 830 IF I < 20 THEN 790 GRAPHICS D IS P L A Y , COLOR ANO SOUNO' 840 VTAB 1 : FOR I = 1 TO 2 0 : VTAB I : HTAB 4 0 : PRim* VTAB Is H IM 4 0 : FOR A = 1 TO 5 : NEXT A: PRim* " NEXT I INCLUDES A COMPREHENSIVE MANUAL. ALL 850 HOME : END T H IS FOR O N LY...... * 2 9 . 9 3 860 FDR CO = 3 TO 35 STEP 2 : IF V(CO) = 0 THEN CC = 1: GOTO 440 870 X = P7T ( PDL (0 ) / 7 .3 ) : IF B < > X THEN GOSUB 380 880 NEXT CO SEND TOi SENO *1 FOR OUR 890 CALL 7 68: CALL 7 68: CALL 7 68: PRINT "YOU WINI" INTERESTING SOFTWARE CATALOG OF THE 900 GOTO 720 21101 S. HARVARO BLVO. FINEST 0SI-C4P JMCftO TORRANCE• CA 90501 HF SOFTWARE...

USERS! READ . . .

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

No. 54 - November 1982 MICRO - The 6502/6809 Journal 73 Skyles Electric Works Presents

The VicTree" ...Leaves your new Vic (or CBM 64) with 35 additional commands. ...Branches out to most BASIC4.0programs. ... Roots into most printers. New from Skyles: the VicTree, a coordinated hardware and software package that allows your Vic to branch out in unbelievable directions and makes it easier than ever to do BASIC programmin< debugging and to access your disk. And the new VicTree provides routines to interface the Vic tc the powerful ProNet local network. 8kb of ROM — 4kb for the BASIC commands, 4kb for disk commands and interfacing to ProMet — plus 4kb of RAM for miscellaneous storage. Perfect not only for the new Vic but also for the Commodore 64. Unbelievably simple to use and to install, tl VicTree gives you all the additional BASIC 4.0 commands to allow most BASIC 4.0 programs to work on your new Vic or CBM 64. Now only $89.95...or $99.95 complete with Centronics standard printer cable. (Cable alone $ 19.95.) Available now from your local dealer or order through your Visa or MasterCard toll free (800) 227-9998 (California, Canada, Alaska, Hawaii: (415) 965-1735) or send check o money order directly to:

231 E South Whisman Road Mountain View, CA 94041 Skyles Electric Works (415)965-1735 No. 54 - November 1 74 MICRO - The 6502/6809 Journal / A l C f t O PET Vet

By Loren Wright on special, non-printing format lines. One powerful feature of Wordcraft If you're working with elaborate is the ruler, which indicates the posi­ tables or a particularly fancy text, the tions of your margins and tab stops. Its What to Do with 96K — continuous nature of the text and the current contents are shown on the bot­ Two Word Processor Approaches distracting format lines make it dif­ tom status line (of five). The ruler may ficult to visualize what the result will be changed at any time. If you're trying For the designers of Wordcraft Ultra look like. There is a special output-to- to get a table to look just right, you can and WordPro 5 Plus, it must have been video command that will show you the try out one arrangement of tab stops, a pleasant dilemma. Steve Punter and results on the screen, without wasting type in your text with tab characters at Pro-Micro Software had their popular paper, but editing must still be done on the right points, and then go back and WordPro 4 Plus to upgrade, while P.L. the original, continuous version, and readjust your ruler without reentering Dowson and DataView had the sleek this is time consuming. the text or the tab characters. The text Wordcraft 80 to work with. It is only WordPro has a special feature called will automatically line up at the new logical that the extra memory provide "Extra T ext," which may be used to tab stops as soon as you finish changing more room for text, but it is what else hold other text files, disk directories, the ruler. has been added to the programs that commonly used phrases and paragraphs, makes them so interesting. or files of names and addresses for fill­ A Comparison of WordPro This column is devoted to a discus­ ing form letters. In WordPro 5 Plus sion of these two word-processing pro­ there are four such extra text areas. and Wordcraft grams for the CBM 8096. Because these WordPros 3 and 4 have only one, but Now that I have discussed the versions retain all the features of their the relative sizes of the extra and main special features of Wordcraft and Word­ predecessors, my discussion should be text areas can be apportioned differently Pro, I can compare them on what they of use to people with 8032s, as well as for different needs. I used WordPro 5 have in common. Most word processors to those with 8096s. A future PET Vet Plus to write this column, primarily perform the following functions in some column will cover word processors for because of the "append characters" way. Some do them better than others. the 40-column PETs. function. I stashed the names WordPro, Entry of Text: Both programs do a Wordcraft Ultra will run on an WordPro 5 Plus, Wordcraft, and Word­ good job here. You can continue typing 8096, an 8032, or an 8032 expanded craft Ultra in extra memory, so that without worrying about the way words with Madison Computer's ZRAM with only a few keystrokes I could copy carry over to the next line. WordPro board. WordPro 5 Plus is designed those characters at the current cursor uses a simple carriage return to force a specifically for the 8096; it will not position. Whole paragraphs are handled new line and the tab key to advance to work with the 8032. Wordcraft versions in a similar manner. The extra text also the next tab stop. With Wordcraft, require a special "data key” (formerly makes it possible to have a whole file of these must be preceded by the control known as a "dongle” ), while WordPro names and addresses in memory at the key. The Commodore business key­ versions require a functional ROM in same time as the target form letter. board, with its full cursor control, is the $A000 socket. well-suited to word processing. Editing of Text: Both WordPro and I will start with a general discussion The "Flavor” of Wordcraft of the two word processor families. Ex­ Wordcraft have commands for deleting, cept where otherwise noted, Wordcraft If you've used a big, dedicated word inserting, transferring, and duplicating refers to all the Ultra configurations processor, you will be more comfort­ text. In general, Wordcraft's commands and Wordcraft 80, while WordPro refers able with Wordcraft. With a few excep­ are more powerful, making cut-and- to WordPro 4 Plus and WordPro 5 Plus. tions, what you see on the screen is paste operations very easy. WordPro's I will also discuss the extra enhance­ what you get on paper. You can tell delete, transfer, and duplicate com­ ments in the new versions. how lines will look before they are mands have restrictions, which can be printed. Even documents wider than 80 circumvented by inserting and deleting columns can be handled. The screen is spaces. Insert mode with WordPro is The “ Flavor” of WordPro a window that can be panned across the more convenient. WordPro essentially presents you text. If a really long word has been Search and Search-and-Replace: with a continuous scroll of 80-charac- moved to the next line, leaving the Neither program excels at these func­ ter lines on which to type. You start in previous one too short, you can easily tions. WordPro’s command structure is the upper left-hand comer and keep tell where to insert a soft hyphen to complicated. The search-and-replace typing until you're done. Words get even up the line lengths. Most format command is an all-or-nothing proposi­ split, but (not to worry) they will be commands are indicated by the presence tion. The search command finds the kept together at output time. This, of reverse field on a text character, but next occurrence of the search string, coupled with there being only two they don't take up space on the screen. but requires a different command se­ status lines, allows a lot of text to be Instead of giving you a continuous scroll quence to continue searching for the viewed at once. Margins, centering, jus­ of lines, Wordcraft gives you a certain same string. Both commands can act tification, paging, line spacing, and number of characters to work with. It globally or just on the current file, and several other features are handled at out­ forces new pages as needed according to there is an option to ignore case. Word­ put time. These are specified in the text your page-length specifications. craft's commands make more sense, but

No. 54 - November 1982 MICRO - The 6502/6809 Journal 75 PET Vet (continued) the master disk. The Wordcraft dealer memory, but also on all the files linked there is no global option and delimiters can obtain a PDF from the distributor to it and stored on disk. (an artifact from line editors) are re­ for just about any printer that runs off Wordcraft, instead of chaining files, quired around the search string. Both pro­ the IEEE. Wordcraft Ultra has special uses a "chapter" organization. To con­ grams use the '?' as a "w ild" character. features for supporting printers with tinue a file, save the first as chapter 1, File Maintenance: WordPro makes proportional spacing print wheels. then assign the continuation to chapter this easy. It is possible to recall files Generation of Form Letters: Word­ 2 of the same file. Files may be printed using a few characters and an asterisk craft1 s handling of these is more power­ out globally, or by specifying a certain (the same as with other PET files). ful. The fields in the letter have unique range of chapter nupibers. Also, in­ Also, file names can be read directly identifiers, so that the same piece of in­ dividual pages may be selected. How­ from the text area of the screen, such as formation from the fill file may be re­ ever, commands such as search, search- from a comment line or directory used. This avoids a lot of extra typing and-replace, and copy act only on the listing. It is also possible to get a selec­ when you construct the fill file. How­ chapter in memory. tive directory listing. When you have ever, the fill file must be used from the specified a file name that already ex­ disk, and while entries may be used What's Been Added? ists, WordPro asks you if you want to selectively, it is difficult to remember replace it. Wordcraft, with its chapter which page numbers go with which en­ Wordcraft's text size has been organization and optional descriptive tries in the file. This makes editing dif­ approximately doubled, from about names and dates, makes documenta­ ficult. WordPro, with its extra memory 11,000 characters in Wordcraft 80 to tion of the contents of a disk much feature, allows the fill file and the form over 20,000 in Wordcraft Ultra. Word­ more complete. However, saving and letter to be in memory at the same time, craft 80 requires the master disk to be loading files is more cumbersome. Full making editing much easier. Blanks in present in one drive, since the editor file names must be typed in. the form letter are filled sequentially, and print module could not reside in Support of Printers: WordPro fully so if the same item has to be reused in memory at the same time. With Word­ supports a limited number of printers. the letter it must appear twice in the craft Ultra the entire program resides in It was designed specifically with the fill file. Selective use of entries from memory at one time, leaving both NEC Spinwriters in mind, and the com­ the fill file is also more difficult. drives available for file operations. bination works very well. The Diablo Handling of Long Files: WordPro (The 8032 configuration requires a 630, Qume Sprint 5, CBM 8027, TEC has a chaining feature that allows a ROM, which contains program mod­ 1500, and dot matrix types, are sup­ document to extend beyond the capaci­ ules.) Wordcraft Ultra adds a set of ported as well. However, other printers ty of the computer. Print, search, escape codes that provide such capabili­ may not be fully supported. Wordcraft search-and-replace, copy, and output- ties as selective double-spacing and comes with a long list of printer data to-video commands can all be specified centering or right alignment of a series files, each matched to a particular with global options. A global command of lines. Other escape codes handle printer/print wheel combination, on will operate not only on the file in (continued)

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

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

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

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

M M S In c . 1 1 1 0 E. Pennsylvania St. Tucson, A Z 8 5 7 1 4 ( 6 0 2 ) 7 4 6 - 0 4 1 8 VfSA

76 MICRO - The 6502/6809 Journal No. 54 - November 1982 PET Vet (continued) tribute. Dedicated word processors data-base managers, will be written for pitch, vertical spacing, horizontal spac­ have many special keys on the key­ WordPro first. ing, and proportional spacing. Unfor­ board for all the things a word processor When you consider word processors tunately, these non-printing characters has to do. A microcomputer keyboard for the 8096 you shouldn't forget occupy space on the screen, making it a has to be used for applications besides Silicon Office — a combination word less accurate representation of what word processing, so it can't afford the processor, data-base manager, and com­ will be printed. Also added is support of luxury of all the extra keys. Both pro­ munications package. Contributing Canadian Micro Distributing's MUPET grams take advantage of what the com­ Editor Jim Strasma covered it in a full- multiple-user system. Wordcraft Ultra puter has to offer. length review in MICRO'S June issue. also has its own built-in multiple user Overall, I rate Wordcraft as a more He was particularly impressed with the system. Another big improvement is powerful word processor. However, word processor portion. It can handle the provision to handle proportional WordPro is much easier to learn. If you long files much better (the whole spacing print wheels. The price of don't use Wordcraft every day, you will disk!), can handle multiple-column Wordcraft 80 is $395, while that of find yourself frequently looking things documents, and can perform calcula­ Wordcraft Ultra is $545. up, even if you learned it thoroughly tions using information from the data WordPro 5 Plus includes the main the first time around. Beyond that, it base. The $995 price is out of the range and four extra text areas, each contain­ really depends on what you want to do. of the word processors covered here, ing 169 80-character lines. Therefore, If you plan to do a lot of "boiler- but if you need a data-base manager, the maximum length of a single file in plating'' (putting a document together too, be sure to give Silicon Office a lot memory has not increased from Word­ using standard phrases arid paragraphs) of consideration. Pro 4 Plus to WordPro 5 Plus, but then then you will find WordPro easier to WordPro is distributed to dealers by neither has the price (both $450). use. If you're working on a really long Professional Software, Inc., 51 Fremont WordPro 5 Plus has added support of document, such as a book, then the Street, Needham, MA 02194. Word­ the MUPET system, as well. I have just chapter organization of Wordcraft will craft 80 and Wordcraft Ultra are barely begun to explore the possible be handy. For full control of a variety of distributed to dealers by Computer uses of the extra text areas. letter-quality printers, for tabular Marketing Services, Inc., 300 W. material, and for material wider than Marlton Pike, Suite 26, Cherry Hill, NJ 80 columns, Wordcraft has the edge. A 08002. Conclusions big point in WordPro's favor is that it is With the possible exception of the (in its many versions) already the most IBM PC, the CBM 8032/8096 has the popular word processor on the market Special thanks to Jim Lucivero of best keyboard for microcomputer for Commodore systems. This means NEECO in Needham, MA, for the use business applications. Easy cursor con­ that it is easier to exchange files with of letter-quality printers used in this trol, built-in screen editing, and the other people and that commercial pro­ review. separate numeric keypad all con­ grams, such as spelling checkers and MICRO ANNOUNCING A NEW JOURNAL OSI Disk Users DEVOTED TO ALL ASPECTS Double your disk storage capacity Q * o f microcomputer 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- U S E A T T H E density adapter that doubles the storage capacity of UNDERGRADUATE each disk track. The DiskDoubler plugs directly into an OSI disk interface board. No changes to hardware or software are required. V 01 ' ^ < ' s LEVEL v * v c The DiskDoubler increases total disk space under OS- 65U to 550K; under OS-65D to 473K for 8-inch floppies, PREM IER to 163K for mini-floppies. With the DiskDoubler, each drive does the work of two. You can have more and ! SSUE larger programs, related files, and disk utilities on the same disk—for easier operation without constant disk changes. FEBRUARY 1983 Your OSI system is an investment in computing power. Get the full value from the disk hardware and software wr1t e : 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. Col I egiate Microcomputer ™DiskDoubler is a trademark of Modular Systems. Rose-Hulman In s titu te of Technology Post Office Box 16 C Oradell, NJ 07649.0016 Terre Haute IN 47803 USA Telephone 201 262.0093

Prospectus sent upon request.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 77 Now... The Ultimate In Wordprocessing For The Commodore Computer. WORDCRAFT ULTRA!

Wordcraft ULTRA™ turns your Commodore microcomputer into one of the world’s most advanced word processing systems, incorporating features previously found only in systems priced thousands of dollars higher! • True proportional spacing with inter-character and inter-word spacing!

• Multi-user with up to 8 CPU’s sharing one or more disk drives and printers with no extra hardware required other than a cable! • Screen layout matches the printed document! You’ll love the “ what you see is what you get" feeling.

• Continuous centering, delete and insert, movement of text, search and replace, tab and indent, bold print and underline . . . a seemingly endless list of features designed to make text editing as simple and complete as possible!

• Wordcraft ULTRA runs on the CBM 8032, 8096 or Madison Computer’s Z-RAM™ board. The Z-RAM Board not only expands your computer to 96K but also adds CP/M™.

Why settle for less when you get so much more with W ordcraft ULTRA on the Commodore Computer!

Contact Your Nearest Commodore Dealer Today ... You’ll Be So Glad You Did!

In The East Call: In The W est Call: COMPUTER CIMARRON MARKETING SERVICES INC. CORPORATION 30 0 W . Marlton Pike, Suite 26 666 Baker Street, Suite 31 9 Cherry Hill, New Jersey 0 8 0 0 2 Costa Mesa, California 92626 [609] 795-9480 [714] 641-1156

Z RAM is a trademark of Madison Computer CP/M is a trademark of Digital Research W ordcraft Ultra is a trademark of Dataview Ltd

78 MICRO - The 6502/6809 Journal No. 54 - November 1! Apple Hi-Res Graphics and Memory Use

by Dan Weston

This article examines the end of memory. Hi-res page 1 display at the upper end of the hi-res page (1 or conflicts of programs and hi-res area sits between $2000 and $4000 2), so that simple variables and arrays graphics on the Apple II, plus (16384-24575), and hi-res page 2 sits will be stored above the hi-res area several techniques to avoid from $4000 to $6000 (24576-32758). rather than across it. This method re­ these conflicts. There is a 6K block of memory between quires that the program be less than 6K, $800 and the beginning of hi-res page 1. and that the LOMEM statement come If your program is longer than 6K and before any variables are defined. invokes HGR, you will find that the LOMEM: 16384 will store variables Hi-Res last portion of your program has been above hi-res page 1. LOMEM: 24576 requires: wiped from memory. Even with pro­ will store variables above hi-res page 2. grams shorter than 6K, an HGR call can Another method is to put graphics Apple II with 32K wipe out arrays and variables that are on hi-res page 2 instead of page 1. This stored above the program. frees the 8K bytes of the first hi-res page To avoid this problem, set LOMEM for program and variable storage, giving When you begin to write long programs that use the hi-res pages of the Apple II, you will overwrite the graphic display Figure 1: Applesoft Memory and Variable Pointers area if your program and variables are longer than 6K. There are many ways Pointer to get around this problem, which in­ Name Hex Dec Normal Setting Special Effects volve manipulating the pointers Apple­ soft uses to control memory usage. Here Beginning of $67 103 program loads POKE 103,1 program loads I discuss several methods for making the Applesoft $68 104 at $800 POKE 104,64 above hi-res most of your computer's memory. program POKE 16384,0 page 1 Normally a BASIC program is loaded POKE 103,1 program loads beginning at memory location $800 POKE 104,96 above hi-res (2048). The program fills memory up­ POKE 24576,0 page 2 wards from $800. LOMEM is set to the end of the program and will change as LOMEM $69 105 end of current POKE 105,1 put variables the program changes. beginning of $6A 106 program POKE 106,64 above hi-res Simple variables are stored from simple page 1 LOMEM upward as they are defined by variables POKE 105,0 LOMEM at $800 the program. Arrays are stored from the POKE 106,8 below hi-ies end of simple variables upward. An ad­ dition to the simple variable space will End of $6B 107 adjusts with POKE 107,0 simple push the array variables upward with simple $6C 108 size of POKE 108,8 variables no loss of integrity. Finally, string variables variable table below hi-res variables are stored from the top of End of array $6D 109 adjusts with POKE 109,0 array available memory, HIMEM, downward variables $6E 110 size of POKE 110,8 variables in memory, with new strings being variable table below hi-res placed in successively lower memory locations. The pointers that guide the End of string $6F 111 adjusts with POKE 111,0 strings put placement of variables are summarized variables $70 112 size of string POKE 112,32 below hi-res in figure 1, and will be discussed later table page 1 in this article. HIMEM $73 115 top of usable POKE 115,0 HIMEM at The problem with this storage beginning of $74 116 memory, low end POKE 116,32 $2000, below scheme is that the hi-res pages are string data of DOS buffers hi-res page 1 located between the program and the

No. 54 - November 1982 MICRO - The 6502/6809 Journal 79 options. Here are just a few: Listing 1 1. You can locate shape tables, especially long tables that will not 100 HCME : PRINT "VARIABIZ POINTER CHANGE TEST" fit at location $300, below the hi-res 110 PRINT : PRINT : INVERSE : PRINT "BEFORE MWE": NOIMAL : PRINT : PRINT page, beginning at $800. The table can either be POKEd into that mem­ 120 OOSUB 1000: REM PRINT POINTER LOCATIONS 130 GOSUB 1300: REM CHANGE POINTERS ory range or BLOADed at $800. Then 140 GOSUB 1200: REM DECLARE VARIABIES the pointers at 232 and 233, which 150 OOSUB 1400: REM RETRIEVE VARIABLES tell Applesoft the location of the cur­ 200 SID rent shape table, should be POKEd to 1000 REM PRINT POINTER LOCATIONS point to this location. You could put 1005 PRINT PEEK (103) + 256 PEEK (104) PROGRAM BEGINNING" 1010 PRINT PEEX (105) + 256 PEEK (106) LCMEM,VARIABLES START" several tables below page 1 and 1020 PRINT PEEK (107) + 256 PEEK (108) SID OF SIMPUE VARIABLES" change the pointers as the program 1030 PRINT PEEK (109) + 256 PEEK (110) BID OF ARRAYS" used one or another of the tables. 1040 PRINT PEHC (111) + 256 PEEK (112) BID OF STRINGS" 2. The DOS TOOL KIT's high- 1050 PRINT PEEK (115) + 256 PEEK (116) HIMEM, STORT OF STRINGS" resolution character generator 1090 RETURN (HRCG) can be forced to load below 1200 REM DECLARE SCME VARIABLES 1210 A = 3:B = 6:C% » 7 page 1 by modifying to LOADHRCG 1220 A? = "T.T.nj.Tiiuji.".n$ = "UUUUUUUUUU" program from the TOOL KIT. Insert 1225 PRINT : PRINT the statement 1 HIMEM: 8190 ' in 1230 INPUT "NEW STRING?" ;C$ the LOADHRCG program just before 1232 PRINT : PRINT 1235 DIM X (l,l,l) the step that says 1 PRINT CHR$(4); 1240 PRINT : PRINT : INVERSE PRINT "AFTER VARIABLES DEFINED": NORMAL "BLOAD RBOOT'' '. RBOOT uses PRINT : PRINT HIMEM to determine where to load 1250 GOSUB 1000 the character generator. By giving a 1290 RETURN value of 8190 for HIMEM, the pro­ 1300 REM CHANGE POINTERS 1310 POKE 105,1: POKE 106,8: REM LCMEM gram is fooled into putting the 1320 POKE 107,1: POKE 108,8: REM SIMPUE VAR END character generator below page 1, 1330 POKE 109,1: POKE 110,8: REM ARRAYS rather than at the top of memory. 1340 POKE 111,255: POKE 112,31: REM STRINGS You must insert one more step in the 1350 POKE 115,255: POKE 116,31: REM HIMEM LOADHRCG program: 1 HIMEM: 1360 PRINT : PRINT : INVERSE : PRINT "AFTER POINTER CHANGE": NORMAL : PRINT 38400 ' is needed to reset HIMEM to : PRINT 1370 GOSUB 1000 the top of memory, just below the 1390 RETORN DOS buffers. This step should come 1400 REM TEST EOR VARIABLE RETRIEVAL after the step that reads 1 CALL 1410 PRINT : PRINT : INVERSE : PRINT "VARIABI£ RETRIEVAL": NORMAL : PRINT ADRS: REM INITIALIZE HRCG’. : PRINT The value you use to reset HIMEM 1420 PRINT "A=";A 1430 PRINT "B=";B will depend on the size of your sys­ 1440 PRINT “C%=" ;C% tem; the value given is for a 48K 1450 PRINT "A$=”;A$ Apple. Check the DOS manual for 1460 PRINT "B$=":B$ the figures for other size systems. 1465 PRINT "C$=” ;C$ 3. If you are writing a very large pro­ 1470 RETURN gram that uses lots of variables, especially arrays, you may find that the variables will overwrite the you an effective program space of 14K, to load above page 1 strings, or vice versa, and then you instead of the 6K you would have if you POKE 103,1 have problems. Applesoft uses a set used page 1. To use page 2, just use POKE 104,64 of pointers that tell the program HGR2 instead of HGR. POKE 16384,0 : REM A 0 MUST BE where to store variables as they are But there are some problems with PLACED IN MEMORY encountered. If you change the this method. First of all, you cannot JUST AHEAD OF WHERE pointers you can fool the program in­ use the four lines of text below the THE PROGRAM WILL to using the memory below page 1 graphics screen with HGR2. This will LOAD for variable storage, thus freeing not be a problem if you are using some to load above page 2 room at the top of memory for your sort of hi-res character generator like POKE 103,1 program. the DOS TOOL KIT’s HRCG. The POKE 104,96 See the chart in figure 1 for a more other problem is that you may want to POKE 24576,0 complete description of the pointers. use both of the hi-res pages, say for If the program is loaded above page Here are the POKEs that will cause a page-flipping. In this case you would be 1 you will have about 22K (in a 48K program loaded above the hi-res area to back to the original 6K limitation. system) for the program and variables. place its variables in the memory be­ The next method that might be use­ If you load above page 2, you will have tween $800 and $2000. Note: These ful is to relocate the program above the about 14K. The 6K of memory below POKEs must be done before any vari­ hi-res page (or pages). This is done by page 1 ($800-$2000) will remain unused ables are used by the program. POKEing values into the memory loca­ by Applesoft. POKE 105,0 tions that Applesoft looks at to see where Once you have loaded your program POKE 106,8 : REM LOMEM AT $800 to LOAD or RUN a new program. above a hi-res page you will probably These POKEs must be done before the want to figure out some way to use the POKE 107,0 program is loaded or run, say from a memory that is just sitting empty POKE 108,8 : REM SIMPLE VARIABLES "h ello” program. Here are the POKEs: below page 1. Again, there are several ENTERED AT $800

80 MICRO - The 6502/6809 Journal No. 54 - November 1982 POKE 109,0 Listing 2 POKE 110,8 : REM ARRAY VARIABLES ENTERED AT $800 Our Current POKE 111,0 POKE 112,32 : REM STRINGS ENTERED AT $2000 Best-Seller POKE 115,0 POKE 116,32 : REM HIMEM AT $2000 ]RUN LISTING 1 These values are adjusted VARIABLE POINTER CHANGE TEST dynamically by Applesoft as variables /AlCftO are encountered. This is why many of on the Apple the pointers are set to the same value BEFORE MOVE Volume^ I INCLUDES H I initially. You may want to set the | DISKETTE M ! pointers differently to allow room below hi-res page 1 for some of the 16385 PROGRAM BEGINNING shape tables or routines that were 17481 LCMEM,VARIABLES START discussed in the first part of the article. 17481 END OF SIMPLE VARIABLES 17481 END OF ARRAYS Play around with the values until you 38400 END OF STRINGS can use as much of the Apple's memory 38400 HIMEM,START OF STRINGS as possible. Listing 1 tests the use of these pointers. The program must be loaded AFTER POINTER CHANGE above one of the hi-res pages, as dis­ cussed earlier. The program displays the pointer values before any manipula­ 16385 PROGRAM BEGINNING tion, after they are lowered, and finally 2049 LOMEM,VARIABLES START after a selection of variables is defined ti* 2049 END OF SIMPLE VARIABLES by the program. Listing 2 is the output $24.95 = 2049 END OF ARRAYS of this program. It shows how the 9 8191 END OF STRINGS variable pointers are high, above the 8191 HIMEM,START OF STRINGS program, then shift low, below hi-res page 1, then adjust with the definition More than 40 new programs on of variables. diskette to help you get more from NEW STRING7ANYSTRING Once these values are set this way, your Apple: attempts to add lines to the program will result in an "OUT OF MEMORY” • Machine-Language Aids error, because HIMEM is lower than • I/O Enhancements the end of the program. Otherwise, the • Applesoft Aids AFTER VARIABLES DEFINED program should run normally and the • Graphics and Games memory manipulations will be trans­ • Reference Information parent to the user. 16385 PROGRAM BEGINNING 19 ch o ice a rticle s I cannot hope to have covered all 2049 LOMEM,VARIABLES START 43 tested programs on diskette the tricks that can be used to get the 2091 END OF SIMPLE VARIABLES (16 secto r DOS 3.3 form at) most out of your Apple, but I hope that 2142 END OF ARRAYS Volumes 1 & 2 also available at $24.95' 8182 END OF STRINGS the ideas I have put forward will allow 8191 HIMEM,START OF STRINGS you to do some exploring and manipu­ To g ether MICRO on the Apple 1, lating on your own. 2, & 3 provide more than 110 pro­ grams on diskette for less than VARIABLE RETRIEVAL $1.00 each. No need to type in References: hundreds of lines of code. 1. Applesoft Basic Programming Refer­ MICRO makes it easy to order: A=3 ence Manual, Apple Computer Co., Send check (payable to MICRO) to: B=6 1978, pp 127, 137, 140. C%=7 2. Lechner and Worth, Beneath Apple DOS, Quality Software, 1981, pg. MICRO INK B$=UUUUUUUUUU 8-42. P.O. Box 6502 C$=ANYSTRING 3. Wagner, 1'Assembly Lines, Part 17,” Chelmsford, MA 01824 Softalk, February, 1982. ] C all o urtoll-free number: 1-800-345-8112 (In PA, 1-800-662-2444) Dan Weston is currently teaching a self- VISA and MasterCard accepted contained eighth grade in Brooks, Oregon. Contact Mr. Weston at 195 23rd NE, Also available at your local computer store. Salem, OR 97301. 'Add $2.00 shipping per book. MA residents add 5%. AlCftO

No. 54 - November 1982 MICRO - The 6502/6809 Journal 81 Atari Character Graphics from BASIC, Part 2

by Paul Swanson

The author adds fine scrolling to tions. Its program is called a display GRAPHICS 18 statement (mode 2 his character animation list. Each instruction does something without a text window): program, and introduces on the screen taken in order from the programming ANTIC’S display top of the screen to the bottom. Hex Decimal Instruction list. ANTIC's program usually starts 70 112 Blank 8 lines with "blank 8 lines" instructions, 70 112 using three of them so that the dis­ Character Graphics II 70 112 played images are all visible on the 47 71 LMS ANTIC requires: screen. Televisions are set up with mode 7, Atari 400/800 "overscan,” which means that part of XX XX = BASIC mode 3, the actual picture is off the screen in all XX XX plus 2-byte Last month (53:84) I showed you a very four directions so that the movies and memory location. simple method for using a custom char­ commercials won't have borders 07 7 Display ANTIC acter set in BASIC. The amount of around them. On the computer, you mode 7 memory saved by using character usually want to see the whole screen, 07 7 graphics instead of map-mode graphics so the borders are not so annoying. 07 7 is substantial. A mode 7 screen would Once you have the blank lines out 07 7 normally use almost 4K of memory. of the way, you need an instruction 07 7 Replacing it with character graphics re­ called a Load Memory Scan (LMS) in­ 07 7 quires ViK for the character set plus struction, which tells ANTIC where 07 7 about 240 bytes for the 20 x 12 the next line is in memory that you 07 7 character screen, for a total of about want displayed. This command is three 07 7 770 bytes. bytes long. The first byte is the LMS in­ 07 7 Of course, character graphics does struction and the next two define the 07 7 have its drawbacks. For example, how memory location. 41 65 JVB do you move an image across the screen If you continue using LMS instruc­ XX XX without having it "jump” from one tions for each line on the screen, you XX XX character position to the next? The nor­ can put every line on the screen in a dif­ mal ways to put characters on the ferent part of memory. This is not screen don’t offer many alternatives. usually done. Instead, you can follow As you can see, the ANTIC numbers You could invent additional characters an LMS instruction with a Mode Line for the modes are not the same as the to mimic the movements. All that in­ instruction, which tells ANTIC to keep BASIC numbers for the modes. As you volves a lot of programming and many incrementing the memory "pointer” become more familiar with display characters for each figure on the screen. for each consecutive line. lists, you will find that there are more Are character-graphics screens dedi­ The last instruction in the display modes available than the few that cated to only those applications where list is the "Jump on Vertical Blank” BASIC allows. For this example, you nothing on the screen moves unless (JVBJ instruction. A JVB tells ANTIC to need to know that BASIC's mode 2 is you introduce a player or missile? Are wait until the television picture is com­ ANTIC's mode 7. they just to display a pretty background pleted, which is the end of a sixtieth-of- So, what has all this to do with for your program? a-second cycle, then "jump" to the moving characters around on a location it has in the two bytes that character-graphics screen? If there is follow the JVB. The LMS and the JVB nothing more to gain than being able to ANTIC are both three-byte instructions. The see what ANTIC's program looks like, Fortunately, you have an Atari com­ Blank Line and Mode Line instructions then this looks like a mildly educa­ puter. The Atari has not one, but two are both one byte long. tional exercise, right? Read on. microprocessors you can program. The All of this may mean very little to you without an example. To put an ex­ Atari has one processor, a 6502, which Fine Scrolling functions as the "brain" of the system. ample together with the numbers in It has another, called ANTIC, that con­ decimal would also mean very little ANTIC has a few more little twists trols just the screen display. because ANTIC interprets them in to it than just displaying normal char­ ANTIC's language is a machine lan­ binary. Hexadecimal is a good com­ acters on the screen, or even modified guage, which means it is all numbers, promise. In hexadecimal and decimal, characters. It has fine scrolling capabil­ but the language is easy to learn the following is the program for ANTIC ities, both horizontally and vertically. because there are only a few instruc­ that BASIC sets up in response to a To use them, you must set the "mode-

82 MICRO - The 6502/6809 Journal No. 54 - November 1982 line" instruction of each line in the display list that corresponds to the line you want to be able to scroll. That's why you need to know what the display 1 REM *** Custom Character Set *** list looks like. 2 REM *** Program for Part II *** 3 REM Fine scrolling allows you to move 4 REM the entire character row |or all of the 5 REM *** Program by... *** 6 REM *** Paul S. Swanson *** rows if you like, which is what the pro­ 7 REM gram at the end of this article does) one S REM dot at a time horizontally and/or ver­ 9 REM ------C a lc - p o s i t i o n i n m e ff. ------10 DIM S*(1024> tically. Using a combination of fine 20 A=ADR(SS) scrolling and moving the entire charac­ 30 B=INT(A/512+1)*2 ter a whole character position will 40 CBASE=B*256-A+1 4 7 REM allow you to move a character display 4 8 REM smoothly. 4 9 REM ------C l e a r S s t r i n g 50 SS(1)=CHR*(0) To see how to enable the fine scroll­ 60 SS(1024)*CHRS(0) ing function, you must first take apart 70 SS(2)=S*(1) the two instructions that result in a 7 7 REM 7 8 REM line on the display. In hexadecimal, for 7 9 REM ------M o v e s t a n d a r d s e t d o w n ------an ANTIC mode 7 display, these in­ 80 FOR 1=0 TO 511 90 SS(CBASE+I,CBASE+I)=CHRS(REEK(1+57344)) structions are the LMS instruction, 47, 1 0 0 N EXT I and the mode-line instruction, 07. In 1 0 7 REM binary, these are 0100 0111 and 0000 1 0 8 REM 1 0 9 REM ------S e t # t o c h a r a c t e r ------0111. Using the numbering that makes 110 FOR I«24 TO 31 the leftmost binary digit number 7 and 1 2 0 READ N 130 S* (I+CBASE, I+CBASE7=CHRS(N) the rightmost one number zero, the 1 4 0 NEXT I binary digits we want are numbers 4 1 4 7 REM and 5. Number 4 enables horizontal 1 4 8 REM 1 4 9 REM ------GR.2 - No text window scrolling: 0101 0111 and 0001 0111. 150 GRAPHICS 18 Number 5 enables vertical scrolling: 1 5 7 REM 1 5 8 REM 0110 0111 and 0010 0111. Setting both 1 5 9 REM ------F i n d D i s p l a y L i s t ------to one enables both: 0111 0111 and 160 DLIST=PEEK(560)+PEEK(561)*256 0011 0111. 162 SLQC=PEEK(DLIST+4)+PEEK(DLIST+5)*256 1 6 7 REM To use these from BASIC, we need 1 6 8 REM the decimal equivalent. To enable hori­ 1 6 9 REM ------S e t s c r o l l e n a b le s ------zontal and vertical scrolling, add deci­ 170 POKE DLIST+3,PEEK(DLIST+3)+48 180 FOR 1=6 TO 16 mal 48, which is binary 0011 0000. That 190 POKE DLIST+I,PEEK(DLIST+I)+48 changes the LMS from 71 to 119 and the 2 0 0 NEXT I mode-line instruction from 7 to 55. In 2 0 7 REM 2 0 8 REM decimal, the final display list for a 2 0 9 REM ------I n i t i a l i z e p o s i t i o n ------GRAPHICS 18 screen would be: 112 112 210 VP0S=96 112 119 xx xx 55 55 55 55 55 55 55 55 55 220 HP0S=80 2 2 2 POKE 7 5 6 , B 55 55 65 xx xx, where xx stands for a 2 2 4 W ING=1 memory location not yet determined. 2 2 6 S=14 2 2 7 REM 2 2 8 REM Special Memory Locations 2 2 9 REM ------Draw character in position ------230 V*INT(VPOS/16) Now that we know what to do with 232 IF WING=1 THEN SOUND 0 ,1 0 ,0 ,6 the display list, where do we find it? 240 VSCR0L=VP0S-V*16 250 H=INT(HPOS/8 ) There are special memory locations in 260 HSCR0L=HP0S-H*8 the Atari that can give us, or accept 262 IF WING=1 THEN WIN6=2:SS(CBASE+25,CBASE+25)=CHR$(0 )sSS(CBASE+26, from us, all kinds of information. For CBASE+26)=CH RS(2 3 1 ):GOTO 266 264 WING=1: SS(CBASE+25,CBASE+25)=CHR*(1 9 5 ):S*(CBASE+26,CBASE+26)=CHRS(36) example, locations 560 and 561 contain 266 POKE 559,0 the location of the start of the display 270 POKE SLOC+P,Os P=V*24+H:POKE SL0C+P,3 list. If we declare a GRAPHICS 18 280 POKE 54276,HSCROL 290 POKE 54277,15-VSCROL screen in a program, then set a variable 292 POKE 559,34 to PEEK(560) + PEEK(561)*256, that 294 SOUND 0,10,0,2 2 9 7 REM variable will have the location of the 2 9 8 REM display list ANTIC is using. You can 2 9 9 REM ------Read Joystick ------write a new location to 560 and 561 if 300 OLDS—S: S=STICK(O) 310 IF S=15 THEN S=OLDS you form one on your own, but it is 320 VM0VE=0 usually easier to just modify the one 330 HM0VE=0 3 4 0 I F S = 9 OR S = 1 3 OR S = 5 THEN VM 0V E=2 BASIC has already set up. 3 5 0 I F S = 1 0 OR S - 1 4 OR S=6 THEN VM0VE=-2 In the program, we can find the dis­ 360 IF S>4 AND S <8 THEN W10VE=*1 play list, then modify all the instruc­ 3 7 0 I F S >8 AND S<12 THEN HMOVE=-l 380 IF VMOVE+VPOS>=0 AND VMOVE+VPOS<191 THEN VPOS=VPOS+VMOVE tions that display a line on the screen 390 IF HMOVE+HPOS>=0 AND HMOVE+HPOS<192 THEN HPOS=HPOS+HMOVE by adding 48 to it. That will enable the 400 IF VM0VE=2 THEN WING=2 scrolling we want. We also need a few 4 1 0 GOTO 2 3 0 1000 DATA 0,195,36,24,24,36,0,0 other special locations. Two locations are required to put the amount of

No. 54 - November 1982 MICRO - The 6502/6809 Journal 83 scrolling we want and one is required to equal to the location where the display main part of the program begins. turn ANTIC off when we change the list created by BASIC starts. Line 162 Lines 230 through 260 calculate the scrolling values. If we don't turn AN­ looks at the memory location in that character position on the screen with TIC off, we get some very annoying display list where the screen starts in the remainder from the division deter­ "snow" on the screen. Other, less memory. This is required later on. mining the fine-scrolling amount. predictable things have been reported From there through line 200, the Since the characters are 16 dots high happening when ANTIC was on when program sets the enable bits on all of and 8 dots wide in mode 2, these are the scrolling values were changed. the ANTIC instructions that display a two values by which we divide. The line on the screen. Since you know that SOUND statement doesn't have any­ one will be changed from 71 to 119 and thing to do with the position, exactly. The Program the other from 7 to 55, you could use It is placed there as a matter of timing It is always easier to see what is the number 119 in line 170 instead of so that the "wingflapping" noise is in­ happening when you have a real exam­ PEEK(DLIST + 3)+48 and 55 in line itiated properly. ple in front of you. Enter the program 190 instead of PEEK|DLIST + I)+48. Lines 262 and 264 take care of put­ into your Atari so that your reading The more generalized form in the pro­ ting the wings in the correct position, keeps up with the amount you have gram will make it more easily adapt­ alternating by setting WING to 2 if it is entered. That will make it easer to see able to other display list applications. 1 and to 1 if it is 2. Again, the subscripts what's going on. Moving up to line 224 presents a for the S$ string and the values for the Lines 1 through 150 are actually all few unusual statements. These state­ CHR$ function are explained in Part 1. explained in Part 1. ments initialize everything that didn't Finally, we get to where the real ac­ Lines 10 through 40 find a lAK fit into the above categories. VPOS and tion takes place in the program. Line boundary in the S$ string. Lines 50 HPOS are initialized to somewhere in 266 puts a zero in location 559, which through 70 clear the S$ string to ASCII the middle of the screen. VPOS and turns ANTIC off as soon as it finishes code zeroes. Lines 80 through 100 HPOS are the vertical and horizontal the current sweep of the screen. The move the "built-in" character set positions — not character positions, next statement will not need ANTIC down (not required for this program]. but the positions in dots — of the figure off, but will function as enough of a Lines 110 through 140 insert the we will be moving. Each character is 16 delay to guarantee that the current special character into the set, and line dots high and 8 dots wide. Line 222 sets sweep of the screen is completed before 150 declares graphics mode 2 without a the character set base address. This state­ the fine scrolling values are POKEd in­ text window. ment was also used in Part 1. WING to the special memory locations. After you have lines 1 through 150 (line 224( keeps track of which position Line 270 erases the old position of typed into your Atari, enter through line the "w ings" are in. S is initialized so the figure, then calculates the new 162. Line 160 sets the variable DLIST that the bird will be flying up when the position and puts the figure there.

TIRED OF TYPING? MICRO has the solution. “INTERESTING SOFTWARE” Order a diskette of three recent utility pro­ 8781 Troy St. • Spring Valley, CA 92077 grams for the Apple. For only $10.00, plus (714) 466-2200 $2.00 shipping and handling, you will receive a DOS 3.3 diskette containing the source and WORLD ALPHABETS assembled listings of: -J!i,3 rJt --ML o i | J o|oi[ Applesoft Variable Dump by Philippe Francois H M w f 4 =) H d ^Tl- J d .;! 4, (MICRO, April 1982) B e rn eajit 66cshm3 .h n w e H H q a , Straightforward Garbage Collection for the Ten type fonts allow user to create text or use pro­ A pple by Cornelis Bongers (MICRO, August nunciation tables in Arabic, Cherokee Indian, 1982) Hieroglyphics, Greek, Hebrew, Japanese, Rus­ sian, Sanskrit or Roman. Author: W.C. Jones COMPRESS by Barton Bauers (MICRO, October, 1982) Diskette $89.95 Please send check, money order, or VISA or MasterCard number. Only prepaid orders BASIC LEARNING accepted. If you missed the above issues of PACKAGE MICRO they can be ordered now! Include $2.50 An introduction to the Apple II or II Plus Computer. Teaches beginner to program in BASIC. Author: J.J. for each issue. Sudikatus Send orders to: Diskette $49.95 Apple Utility Disk Both require an Apple II with Applesoft, 48K, plus disk MICRO drive. Epsom p i„ite r with Graftrax is optional. P.O. Box 6502 Apple II or II Plus and Applesoft are trademarks of Apple Computer, Inc. Chelmsford, MA 01824

84 MICRO - The 6502/6809 Journal No. 54 - November 1982 POSITION statements do not work When you move the joystick, lines Note that I did include a few state­ when you enable the scroll because 320 through 390 interpret the move­ ments in the program that weren't des­ ANTIC automatically assumes a "wide ment into the new position by updating cribed. These statements are set up to playfield” instead of a normal one, VPOS and HPOS. The vertical move­ cause the bird to flap its wings when it which has 24-character lines instead of ments are all 2 dots at a time to com­ is moving horizontally or up (i.e., 20-character lines. That is why the for­ pensate for the difference in the two VMOVE does not indicate "down"). mula P = V*24 + H is required. The dimensions so that the bird will fly up When the bird moves downward, the variable P will be the "old ” position for at about the same rate as it will fly wings do not flap and the flapping the next loop, so that you don't have to horizontally. Lines 380 and 390 make sound stops. calculate anything to erase the old sure the figure stays on the screen, then The program is not the most effi­ figure before you POKE the new one line 400 goes back to put the figure cient way to scroll character-graphics into place. where you just moved it. Line 1000 is screens, but it does show the general Lines 280 and 290 set the horizontal the character shape for the READ at idea of how it is done. You can make and vertical values into the special line 120. the program more efficient by doing memory locations reserved for them. Now you can RUN the program things like replacing the part that reads Note that the vertical scroll value runs and move the figure around the screen and interprets the joystick with a faster in the opposite direction and must be with your joystick. If you don't have routine. You may develop a different subtracted from its maximum value, a joystick, you should be able to way of handling the positions from the 15, to get the correct one. When these figure out how to move it with the four VPOS and HPOS approach. If you keep values are POKEd, ANTIC is turned arrow keys. the character position and the scroll back on by POKEing 34 into location Notice that the figure does flash a values separately, you will not need the 559, as is done in line 292. Line 294 little when you move it. This happens two divisions. If you do it right, you stops the "wing-flapping" sound and, when you turn ANTIC off. This can be can gain some speed there. Remember like line 232, is positioned here for the limited by decreasing the delay (line that the program was written to be in­ sake of timing the sound. 270) after you turn ANTIC off. Remem­ structional rather than efficient, so you Now that we have all of the state­ ber that line 270 does not require that should find many areas where you can ments in place for moving the figure ANTIC be off, so it functions as the speed up. around, we need some way to control delay. You can shorten the delay as Play around with the program until where it moves. I chose the joystick for much as you like until you start getting you get ideas on how to use character input. It is read at line 300. Line 310 snow on the screen when you move the graphics for your own programming causes all readings where the stick is in figure horizontally. You can do this by project. Your own project will familiar­ the "neutral" position to be ignored. breaking the line up so that the first ize you with the advantages of charac­ These two statements will use the last statement executes before the POKE ter graphics. Remember, too, that you non-neutral position for the direction, 559 statement. This snow is the prob­ are saving lots of memory. if the joystick is centered. lem you avoid by turning ANTIC off. JMCftO

Challenger 1P OSI SOFTWARE Superboard II

HEXDOS is a remarkable disk operating system which sur­ HEXASM is a powerful macro-assembler which supports passes the capabilities of OS65D. But because HEXDOS uses conditional assembly, linked source files, symbol tables, and subroutines in OSI’s ROM BASIC, it is very compact (only 2K). user-defined macros. Designed to replace OSI’s considerably HEXDOS provides you with easy-to-use commands and saves less powerful assembler. Also included: a simple editor for text 10K of memory and disk space! files, a utility to renumber BASIC programs, and a disk tester/ copier. Requires HEXDOS and 20K RAM. • Load or save BASIC programs, machine language, and data Price: $38.50 (diskette and manual) files by name. Chain BASIC programs from disk. • Up to 22 data files may be open simultaneously. TEC65 is an OSI version of DEC's popular TECO editing • Resides at the beginning of RAM, leaving maximum space language. TEC65 allows you to perform complex editing tasks for user programs. and major text reorganization with simple command strings. Right • Full trace of BASIC programs with optional single-stepping. justification and title centering options for word processing. Re­ • True line editing allows you to correct mistakes easily. quires HEXDOS. • Supports random-access data files, real-time clock, and tone Price: $38.50 (diskette and manual) generator. • Includes a disassembler and demonstration programs: FOCAL-65 is an implementation of DEC’s unique pro­ CHECKBOOK and ADDRESSBOOK (personal data base gramming language. With 9-digit floating-point arithmetic and management), LIFE, SURROUND, REVERSI, BACKGAM­ transcendental functions, FOCAL-65 is especially suited for MON, and BSR CONTROLLER (home control). mathematical and scientific programs. Easy to learn and pro­ • Satisfaction guaranteed, or your money promptly refunded. gram. Requires HEXDOS and 16K RAM. Price: $66.00 (diskette and two manuals) “Documentation is clear and complete, the best I have seen from any source." Your satisfaction guaranteed, or your money promptly and - Ronald C. Whitaker, Compute! magazine, April 1981 completely refunded. For more information, send $1.00 for Price: $49.50 (51/4-inch diskette and 40-page manual)our catalog of OSI, Apple, AIM, KIM, an d SYM softw are.

The 6502 Program Exchange MasterCard 2920 W. Moana, Reno, NV 89509

No. 54 - November 1982 MICRO - The 6502/6809 Journal 85 /A lC f t O Apple Slices

By Tim Osborn source combined with an overlap, it is A similar problem exists where the necessary to move the data starting at destination start address is lower than the source end working toward the the source start address and the two This month's column discusses one of source beginning, which is called a ranges overlap. In this case the right- the fundamental elements of any com­ right-move, as opposed to a left-move. move jsource-end first) will cause the puter system, the block move. I also By doing a right-move in the above same sort of problems and it is neces­ present a subroutine to perform block example and dumping the range of sary to use the standard left-move moves. If you find yourself saying "but memory, the following results would (source start first) to avoid these prob­ the monitor already includes a block- be obtained: lems. When the ranges do not overlap, move routine,” read on; I'll show you it makes no difference which type of 3000- 03 03 04 03 04 05 06 07 why you may want to use my block move is used, either the right-move or move instead. I'll also show you why it These results are correct. the left-move. is sometimes advantageous to use the monitor's routine. L .**************************** 2 ;* * 3 r* BLOCK-M3VE * What Is a Block Move? 4 ; * TIM OSBORN * 5 . * * A block move is a byte-by-byte 6 ;* A P P L E SLICES* 7 7* * movement of data from one range of q .**************************** memory to another. The area from 9 r where the data originates is called the 10 ; PAGE ZERO EQUATES source and the target area is called the 11 ? destination. The length of the move is 12 :A1 THRU A4 ARE PASSED FROM THE MONITOR 13 rA5 I S COMPUTED INTERNALLY the difference between the source end 14 ; and the source beginning plus one. The 003C 15 AIL EPZ $3C ?A1*THE START OF SOURCE distance of the move is the difference 003D 16 .AIM EPZ $3D between the source beginning and the 003E 17 A2L EPZ $3E ; A2=THE END OF SOURCE 003F 18 EPZ $3F destination beginning. 00 4 2 19 A4L EPZ $42 ; A4=THE START OF DESTINATION Let's use the monitor's routine to il­ 0043 20 A44 EPZ $43 00 4 4 21 A5L EPZ $44 ;A5=THE END OF DESTINATION lustrate some examples of block moves. 0045 22 A!H EPZ $45 Type in the following sequence: 080 0 23 ; 080 0 24 ,-OTHER EQUATES ]CALL -1 5 1 080 0 25 (enter the monitor) OflOO 26 ; CTRL-Y VECTOR LOCATION *3000:01 02 03 04 05 06 07 08 03F 8 27 IKRADR EQU $3F8 0 8 0 0 28 • (initialize memory) 03 0 0 29 ORG $300 *3000 < 3002.3003M 0300 30 OBJ $800 (move 3002 - 3003 to 3000 - 3001) 0300 31 030 0 32 ?START W IU j ESTABLIS1 THE CONTROLr-Y Now type: 0 3 0 0 33 rVECTDR. vhen THE w dnitor ENCOUNTERS 0300 34 ?A CONTROLr-Y IT WILL JUMP TO ENTRY *3000.3007 030 0 35 (dump range of memory) 030 0 A9 4C 36 START LDA #$4C ; JUMP INSTRUCTION 0302 8D F8 03 37 STA USRADR and receive the following dump: 0305 A9 10 38 LDA #ENTRY ; LOW BYTE OF ENTRY ADDRESS 0307 8D F9 03 39 STA USRADR+1 3000- 03 04 03 04 05 06 07 08 030A A9 03 40 LDA /ENTRY ;HICH BYTE OF ENTRY ADDRESS 030C 8D FA 03 41 STA USRADR+2 Observe that the block move was suc­ 030F 6 0 42 RTS * INITIALIZATION COMPLETE cessful. Now try this: 031 0 4 3 031 0 44 ; DISTL+DIST1 RECYCLE START'S STORAGE *3001 < 3000.3006M 031 0 45 ?SINCE START I S CNLY NEEDED AT BRUN (move 3000 - 3006 to 3001 - 3007) 0310 46 0300 47 DISTL EQU START ? INTERNAL STORAGE FOR *3000.3007 0301 4 8 DISTH EQU START*1 ;THE DISTANCE OF THE M3VE (dump range of memory) 031 0 49 • 0310 50 rENTRV IS THE MAIN ENTRY POINT and receive the following dump: 0310 51 I S REACHED VHEN THE CTRL-Y 0310 52 ; I S ENCOUNTERED 3000- 03 03 03 03 03 03 03 03 03 1 0 53 031 0 38 54 ENTRY SEC r COMPUTE DISTANCE The computer first moved 3000 to 0311 A5 42 55 U5A A4L ;BY SUBTRACTING 3001, then 3001 to 3002, and so on, so 0313 E5 3C 56 SBC AIL ;THE SOURCE START (A l) FROM that the full destination range is filled 0315 8D 00 03 57 STA DISTL T THE DESTINATION START (A4) 031 8 A5 43 58 LDA A4H with the same value. 031A E5 3D 59 SBC A1H This situation is called an overlap. 031C 8D 03 01 60 STA DISTH (Continued) When the destination is higher than the 03 1 F 18 61 CLC

86 MICRO - The 6502/6809 Journal No. 54 - November 1982 The Block-Move Routine

BLOCK-MOVE (listing 1) incor­ 0 3 2 0 AD 0 0 03 62 IDA DISTL ;ADD DISTANCE porates the ideas expressed above by 0323 65 3E 63 ADC A2L ;TO SOURCE END 0325 85 44 64 STA A5L rTO OBTAIN DESTINATION END performing all block moves where the 0327 AD 01 03 65 IDA DISTH destination address is higher than the 032A 65 3F 66 ADC A21 source address with a right-move and 032C 85 45 67 STA AM all moves where the destination ad­ 032E A5 42 68 IDA A4L ;SE E I F DESTINATION IS 0330 C5 3C 69 CMP A IL ; GREATER OR LESS THAN SOURCE dress is lower than the source address 0332 DO 0 7 70 BNE ENTRY 1 with a left-move. 033 4 A5 43 71 IDA A4H ; ALSO CHICK TO MAKE SURE To install BLOCK-MOVE you must 0336 E5 3D 72 SBC A1H rTHAT Al DOHS'NT = A4 0338 DO05 73 ENE 0fIW2 BRUN the object code. The routine 033A 60 74 RTS ;A1=A4 SO RE7IURN START will enable the CTRL-Y vector 033B A5 43 75 e n t r y i LDA A'W by initializing a JMP $310 (the address 033D E5 3D 76 SBC A1H ; SOURCE of BLOCK-MOVE's ENTRY routine) 033F BO 03 77 BCS NCVERT ; I T ’ S GREATER -M3VE RIOTT 0341 4C 67 03 7 8 JMP M3VELT ; I T 'S LESS -M3VE LEFT into $3F8 through $3FA. When the 0344 79 ■ monitor encounters a CTRL-Y (control 0 34 4 8 0 rMOVERT M3VES THE DATA STARTING AT 'THE key pressed simultaneously with the Y 0344 81 ; SOURCE END WORKING TOWARDS THE key) it will effectively JSR to $3F8. 0344 82 ; SOURCE BEGINNING 03 4 4 83 After START initializes the CTRL-Y 034 4 AO 0 0 8 4 MOVERT LOT #$00 vector the monitor will effectively JSR 0346 B1 3E 85 M0VERT1 IDA (A2L) ,Y ;GO FROM OID END to ENTRY upon encountering a CTRL-Y. 0 3 4 8 91 44 86 STA (A5L) ,Y ;TO NEW END The syntax to use BLOCK-MOVE is 034A C6 4 4 8 7 DEC A5L ; DECREMENT DESTINATION POINTE exactly the same as that to use the 034C A9 FF 88 LDA #$FF monitor M command: 034E C5 44 89 CMP A5L ; IF A5L=SFF 03 5 0 DO 02 9 0 B*E NDVERT2 (dest) < (start).(end) 0352 C6 45 91 DEC AM rTHEN DECREMENT A5H 03 5 4 C6 3E 92 MOVERT2 DEC A2L rDECREMET'TT SOURCE POINTED 0356 C5 3E 93 CMP A2L rIF A2L=$FF The (end) statement is then followed 03 5 8 DO 02 9 4 BNE MOVERT3 by a CTRL-Y instead of the usual M. 035A C6 3F 95 DEC A S rTHEN DECREMENT A7H When execution reaches ENTRY the 035C A5 44 96 M0VERT3 IDA A5L ;SE E I F WE HAVE NDVED 035E C5 42 97 CMP A4L ;ALL BYTES (A5=A4) monitor subroutines have already 03 6 0 A5 45 98 IDA A91 converted: 0362 E5 43 99 SBC A4H 0364 BO EO 1 00 BCS M3VERT1 ;NO MUST CONTINUE 1. (dest) to a sixteen-bit integer stored 03 6 6 6 0 101 RTS ; ALL DONE at $42 through $43 [A4L through 0367 102 A4H or A4). 0367 103 ;MCVELT NDVES THE DATA STORTING AT 0367 104 ;THE BEGINNING OF THE SOURCE WORKING 2. (start) to a sixteen-bit integer stored 0367 105 ;TCMARDS THE END OF THE SOURCE at $3C through $3D (AIL through 0367 106 0367 AO 0 0 107 MDVELT 1U i #$00 r INITIALIZE Y-REG A2H or Al). 0369 B1 3C 108 M3VELT1 IDA (A 1 L ),Y rMOVE FRCM OID SOURCE 036B 91 42 109 STA (A 4 L ),Y ;TO NEW DESTINATION 3. (end) to a sixteen-bit integer stored 036D E6 3C 110 INC AIL ; INCREMENT SOURCE POINTER at $3E through $3F (A21 through 036F DO 02 111 BNE MDVELT2 r I F EX5UAL TO ZERO A2H or A2). 0371 E6 3D 112 INC A1H rTHEN INCREMENT HICH BYTE 0373 E6 42 113 M3VELT2 INC A4L r INCREMENT DEST POINTER 0375 DO 02 114 BNE M3VELT3 ; I F EQUAL TO ZERO All of the above values are in 03 7 7 E6 43 115 INC A4H rTHEN INCREMENT HIOT BYTE modulo-256 form in low-byte, high- 0379 A5 44 116 M3VELT3 IDA A5L ; CHECK TO SEE IF byte order. A user-written program can 037BC542 117 CMP A4L rWE ARE DONE WITH MOVE (A4=A5 make use of BLOCK-MOVE by setting 037DA545 118 IDA A5H up the above values and JSRing to 037F E5 43 119 SBC A4H ENTRY. 0381 BO E6 120 BCS M3VELT1 ;NOT DONE, LOOP 0383 6 0 121 RTS rELSE RETTORN TO CALLER BLOCK-MOVE must first compute 0384 122 END the distance (DISTL through DISTH, $300 through $301) by subtracting Al (source end) and moves them to A5 have completed their task. Experiment from A4 and storing the results at DIST (destination end]. It decrements both with BLOCK-MOVE and the monitor (see lines 54 through 60). After this, values moving another byte after each move command to get a feel for the dif­ DIST is added to A2 to obtain the decrement until A5 = A4, which ferences between the two routines. destination end address — A5 (lines 61 means the destination pointer is equal The advantage of using the monitor through 67). Next destination start is to the destination beginning. (See lines subroutine is that it allows you to in­ compared to the source start in lines 68 84 through 101.) itialize memory to desired patterns of through 76. If the source start is greater MOVELT takes bytes starting at Al byte values. It can be very handy, for than the destination start, the (source start) and moves them to A4 instance, to initialize ranges of MOVELT routine is used to perform (destination start). It increments both memory to binary zeros, but it is not the block move. If the destination start values moving another byte after each limited to that. All sorts of patterns can is greater than the source start then increment until A4 = A5, which be created depending upon the nature MOVERT routine is used. If the means that the destination pointer is of the overlap. For those times when destination start is equal to the source equal to the destination end. (See lines you are moving data forward with start then no move is performed and an 107 through 122.) overlapping ranges of memory, use RTS is done at line 74. Both routines return to the monitor BLOCK-MOVE. MOVERT takes bytes starting at A2 (or user-written program) when they JMCftO

No. 54 - November 1982 MICRO - The 6502/6809 Journal 87 /AlCftO Reviews in Brief

Product Name: The Programmable Cube users complain of the joystick action at first, but practice Equip, req'd: Apple II with 48K or 64K and DOS 3.3 does improve its action. Price: $34.95 includes diskette and extensive Documentation: A single sheet instruction. documentation Manufacturer: Metacomet Software Skill level required: Anyone who can handle a joystick can P.O. Box 31337 play the game, but expert skills are required to get past the Hartford, CT 06103 first two or three screens. Description: This program will solve a Rubik's cube. Reviewer: John Steiner ‘'Cube" will scramble a cube and solve it for you. It also has an option to make designs and patterns. It is easy to use and relies on standard cube notation for entering moves. Product Name: Speed Reader Pluses: The Programmable Cube comes with an extensive Equip, req'd: Apple II with Applesoft in ROM and user's guide to teach how to write programs to make DOS 3.3 designs or even solve cubes based on your own cube-solving Price: $ strategy. It has a "mirror'' behind the graphics cube to Manufacturer: Special Delivery Software show the obverse sides of the cube. The program also in­ 10260 Bandley Drive cludes simulated rotation of the cube as moves are made. Cupertino, CA 95014 You can enter a cube of your choice or choose the order of Description: Speed Reader is a five-part reading program the colors on the cube. designed to improve comprehension and increase reading speed through the development of concentration, atten­ Minuses: The language, while not difficult to leam, is tion span, and more effective eye movement. Two copies similar to many of the graphics-control programs and of the Speed Reader Master Program diskettes, one copy of takes a fair amount of time to become familiar with it. the Speed Reader Data diskette, and an easy-to-read manual are included in the software package. The main Skill level required: Ability to follow directions is needed menu has five lessons: warm-up excercise (letters), warm­ to run the solving portion. Previous programming ex­ up exercise (words), eye movement exercise, column perience in any language would be a help to program in reading lesson, and reading passage lesson. cube language. Pluses: The manual contains charts for each lesson on Reviewer: Phil Daley which progress can be recorded; user's scores are provided after each activity is completed. Several reading selections are offered in Lessons 3, 4, and 5, most of which are in­ formative and interesting. You can increase reading speed, change column justification, and decrease window size in Product Name: Ghost Gobbler Lessons 3, 4, and 5. Equip, req’d: TRS-80 Color Computer with 16K Price: $21.95/cassette; $24.95/disk Minuses: Vocabulary level and topics of several selections Manufacturer: Spectral Associates are beyond that of an average fifth-grade student. It is not 141 Harvard Ave. clear to the user whether the RETURN key should be used Tacoma, WA 98466 to continue the program; no editing is permitted and selec­ Description: Ghost Gobbler is Spectral Associates' version tions cannot be added to the disk. Only one user can use of the popular arcade game, PAC-MAN. Using a joystick, Speed Reader-, booting the diskette will not provide several you control a gobbler that travels around a maze eating users with the program. dots. You must be wary of the four ghosts that also fre­ quent the maze. If they catch you, you will be eaten. Your Skill Level Required: Grades five through adult; private in­ only protection is to eat an "energizer1' dot, whereupon struction. Spelling proficiency is a must as well as typing you can score points by gobbling the ghosts. There are skills. 17 + screens, and extra points can be gained by gobbling bonus shapes. Extra men can be gained by scoring high. Reviewer: Cathy LaSalle Pluses: The game is in 6809 machine language, and comes on cassette. The program will load onto disk and execute Product Name: GR2716 ROM/EPROM Emulator properly from disk once loaded. The game is fast action, Equip, req'd: Not applicable and operates smoothly in all skill levels. A teleportation Price: $78.00 spot allows the player to quickly escape to another section Manufacturer: Greenwich Instruments Limited of the board. Sixteen skill levels are available, so novices U.S. Distributor: LMS Electronics and experts can compete on a more even scale. 3401 Monroe Road Minuses: The game supports only one player at a time, Charlotte, NC 28205 though it does keep records of the ten highest scorers. It Description: The GR2716 EPROM Emulator is a pin-for- operates as a linear device rather than a switch type. Many pin replacement of the 2716 EPROM for use during system

88 MICRO - The 6502/6809 Journal No. 54 - November 1982 Reviews in Brief (continued) The watch is quiet. Scanners show nothing of rebel activity as you comb development. The device consists of RAM memory and a lithium power cell housed in a 24-pin package about .6 in­ ches high. When used in the read mode, the device is plug­ ged into a normal system EPROM socket, and functions QUADRANT exactly like an EPROM. Connectors with leads are sup­ plied also. The package is provided with three additional wirewrap connections on the end between pins 1 and 24. Two of these pins are connected to the system reset to pre­ Suddenly, a stargate gapes open. A lone rebel vent inadvertent writing to the memory during system ship surges into space. More alien restart. When the third pin, labeled WE, is connected to a comrades follow in attack. You normal system static-write enable signal, it causes the cir­ must hold the Quadrant cuit to function as a static RAM chip. The battery is guaranteed to retain memory for three years, with ten From the invaders. years quoted as typical. Other versions are available to And you must replace other EPROMS. doit alone! Pluses: This processor performs exactly as specified. The documentation is terse, but adequate. New literature has come out since this review. Sample WE circuits are given for several CPUs. Minuses: The legs appear fragile and could be broken easily. The problem can be circumvented by installing the GR2716 into a 24-pin soldertail socket and then plugging the entire assembly into the system. One other minor problem is the placement of the WE and Reset pins on the end of the device. There have been fit problems on crowded boards, but the chip-in-a-socket approach also solved this problem by raising the chip above board level. Skill level required: Reasonably serious hardware and machine-language system software developer. Reviewer: Wayne D. Smith

Product Name: Telewriter (disk version) Equip, req'd: TRS-80C, 16K, RS disk system, printer Price: $49.95 cassette, $59.95 disk Manufacturer: Cognitec 704 Nob Ave. Del Mar, CA 92014 (714) 755-1258 You’re combing the quadrant, defending your turf, Description: Telewriter is a word processor for the TRS- and suddenly, as if from nowhere, an alien ship 80C. The editor features a cursor-oriented, 51- x appears. You spin and shoot, lazers blazing and 24-character display with real lower-case characters. The blast him into oblivion, with more attackers soon graphics screen is used for text display, and provides a " to follow. The battle continues and you gain the much greater area of visible text than most color computer upper hand. Just when you think you’ve got word processors. things under control, the alien commander ap­ Pluses: Telewriter is one of the better editors I have seen. pears. He's extrem ely fast and a very good shot, Many features, including embedded printer commands, but you have a secret weapon, HEAT SEEKERS! not found on more expensive processors, are available in The flick of a finger destroys every alien in your Telewriter. quadrant. With a few seconds rest you prepare yourself for the next wave of alien attack ships. Minuses: Requires a disk I/O program on disks. The GET READY, HERE THEY COME...FIRE! binary file format adds extra steps when using Telewriter with an ASCII file. Neither horizontal scrolling nor right Get Quadrant 6112 from your favorite dealer or justification is supported. directly from Sensible Software for only . .34.95 (Game Paddle Required) Documentation: Seventy pages of well-written reference material are included.

Skill level required: No previous experience with word processors is required.

Reviewer: John Steiner iSMCftO TM Designates U.S. Trademarks of Sensible Software Inc. Copyright 1982 Sensible Software Inc.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 89 3 exceptional books join the DATAMOST library

Here is a series of ;easy to read, easy to -wonder why you were ever intimidated use, easy; to "Understand hdaksf which. by the thought of programming! - teach you how to 'write' usable,, useful If.you want to get the very most out of programs on your-computer. And you your Apple, IBM-PC or TRS-80 then you don't have to worry about irrelevant really want HOW TO WRITE A PRO­ material which has no interest for you, GRAM. Before you’re past Chapter 2 because there are three specific volumes. you'll be programming. By the end of the One for the Apple,* one for theIB M -P C r book you’ll be willing to tackle business and one for the TRS-80’ programs, personal use programs and In each of these books author Ed Faulk even games and adventures! $14.95 leads you through your favorite com­ Get your copy now. Available at computer puter and takes.the mystery out of writing and book stores, or: programs for it. As you proceed, interest­ ing chapter by interesting chapter, you'll (213) 709-1202 E DATAMOST Reston Publishing Con 9748 Cozycroft Ave., Chatsworth, CA 91311A Prentice-Hall Compa V\pp!e is a trademark of Apple Computer. Inc./iBM-PC is a trademark of IBM Corp.-TRS-80 is a trademark of Tandy Corp Reston, Virginia VISA MASTERCHARGE accepted. $2.00 shipping/handling charge. (California residents add 6Vv.% sales tax.) Toll free (800) 336-0338 mansTER mnsH

It is late at night in a monster infested graveyard and you have been given the job of keeping the monsters in. All you have between you and complete chaos is a new MonsterMasher System and quick reflexes. Monster Mash is an original and unique arcade action game written in The Software Farm assembly language for the Apple II and Apple / / / (in emulation mode). 3901 So. Elkhart Aurora, CO. 80014 PH: (303) 690-7559 $29.95

No. 54 - November 1982 MICRO - The 6502/6809 Journal m m VISA/MASTERCARD accepted. J2.00 shipping/handling charge. shipping/handling J2.00 accepted. VISA/MASTERCARD 'A p p le II is a trademark o f A pple Computer, Inc. Computer, pple f A o trademark is a II le p p 'A tax.) 6V4%sales add residents (California e are Bew the 9748 9748 Cozycroft Ave., Chatsworth, CA 91311. (213) 709-1202

At At computer stores, or:$29.95 for the Apple II* DATAMOSTi by Bob Bishop you've ever had ai MUNCHERStoday- thousands of ranc mazes; get MON F For the most rpaze millionaire tonight

Getting Around the Apple Hi-Res Graphics Page

by Eagle I. Berns

This article describes a method statement before location $2000 is directly after $4000. It then finds the to split an Applesoft BASIC reached. At this point a number of places to POKE, relinking the program program in order to make dummy statements are inserted. (This across the dummy statements (where available the core both above version uses the &Renumber utility the graphics area is located). Since a from the Apple II tool kit to renumber LOAD will reset all links, the two and below the hi-res pages. This the program in a way that allows the in­ POKEs must be a part of the original allows the program to utilize the sertion of a number of dummy state­ program. Also, since the POKEs must graphics area without having to ments. A simple modification is neces­ be there when the split is complete, sacrifice portions of memory. sary if some other renumber utility is they must be inserted before we begin used.) The utility then proceeds to find the split, so as not to destroy the the link that exists between the loca­ relative positioning of statements in GETTING tion before $2000, and the location the program. requires: Apple II with 32K Listing 1: SPLIT RENUMBER 100 TEXT : HOME 110 PRIWT "ENTER NAME CP PROGRAM TO SP L IT": PRINT : PRINT : HTAB (7): INPUT A$ 120 priw t If your Apple II has 48K of memory, and 130 PRIWT "ENTER LCMEM ADDRESS FOR LEADING PROGRAM": PRINT : PRIWT : HTAB (7): INPUT L you write a program that starts at 140 PRIWT : PRIWT "INTER 1 IF SPLITTING OVER HGR1,” $0800 (hex) and goes to, say, $4100, 150 PRIWT " 2 IF SPLITTING OVER HGR2," you may notice that though there's still 160 PRIWT " 0 IF SPLITTING OVER BOTH ." a lot of core available for your program, 170 PRIWT : PRIWT "VHICH : INPUT S you have lost the ability to use either of 180 A = IWT (L / 256) 190 B = L - A * 256 the hi-res graphics pages (the first runs 200 REM from 2000 to 3FFF and the second from 210 POKE 2 1 0 ,B: REM SAVE IXMEM $4000 to $5FFF). When this problem 220 POKE 211, A came up for me, I wondered if there 230 REM might be some way to have my pro­ 240 RB4 SET SPLIT BOUNDS. 250 REM 212 HOUS START OF PAGE gram bridge the gap over either or both 251 REM 213 HOUS LENCJIH the graphics areas and continue on the 260 REM 771 HOUS LENGIH other side. 270 REM In reading current literature I found 230 IF S = 1 THEN 320 various references to ways in which 290 IF S = 2 THEN 330 300 IF S = 0 THEN 340 this could be done. However, they all 310 GOTO 140 required multiple steps and patching 320 POKE 2 1 2 ,3 2 : POKE 2 1 3 ,3 2 : GOTO 360 source statements. What I wanted was 330 POKE 2 1 2 ,6 4 : POKE 2 1 3 ,3 2 : GOTO 360 an automatic process. There are several 340 POKE 2 1 2 ,3 2 : POKE 2 1 3 ,6 4 EXEC files used in the process I even­ 350 REM 360 D$ = CHR$ (4) tually developed, but the user of the 370 PRINT D$; "OPEN SPL.SETOP" program need only issue the one com­ 380 PRIWT D$; "DEUJTE SPL.SEIUP" mand "RUN SPLIT” , and the rest of 390 PRIWT D$; "OPEN SPL.SEIUP” the process is automatic. 400 PRIWT D$;"WRITE SPL.SETOP" "pp" The EXEC files and utility program 410 PRIWT needed to do the job are listed at the 420 PRIWT "RUN IQADAPA" 422 PRIWT "POKE 103, " ;B + 1 end of this article. First, however, I will 424 PRIWT "POKE 1 0 4 ," ;A give a general description of how the 426 PRIWT “POKE " ; B ; " ,0 " task is accomplished, and then a detailed 430 PRINT "IOAD ";A$ description of the program itself. 440 PRIWT "&R 2 ,1 " Basically, the statements of the 450 PRINT "1 POKE 0 0 0 0 ,0 0 0 -.POKE 0000,00' 460 PRINT "SAVE SPLITPROG" Applesoft program to be split are scanned 470 PRINT “E X E SPL. FINDER" via their internal pointer links from 480 PRINT D$; “CU3SE SPL.SETOP" statement to statement, until the last 490 PRINT D$; "EXIC SPL.SEIUP”

No. 54 - November 1982 MICRO - The 6502/6809 Journal 93 When the RUN SPLIT command is modifications since SPLITPROG does LOAD < program > < loads the issued, you see the following: not accept modifications gracefully. program > Now I will present the programs and ENTER THE NAME OF THE PRO­ support utilities, with a description of &R 2,1 < renumbers to GRAM TO SPLIT their execution sequence. allow a dummy < type in the name > line 1 to be inserted that will ENTER LOMEM ADDRESS FOR be modified > LOADING PROGRAM SPLIT Description < Normally this is 2048 (or $0800], but 1 POKE OOOO^OO^OKE 0000,00 you may change this, if you like > Lines 180-350 are POKEd away for SAVE SPLITPROG Cthis will the rest of the utilities to use. Loc's 210 eventually ENTER 1 IF SPLITTING OVER HGR1 and 211 are for program start-up loca­ become the split 2 IF SPLITTING OVER HGR2 tion,- 212 and 213 are the addresses for program > 0 IF SPLITTING OVER BOTH the boundaries of the split. Lines 370-400 and 580-590 create EXEC SPL.FINDER your needs > the following:

FP < cleans things Then wait as your screen goes up a bit > through some contortions, writing RUN LOADAPA < from Apple II SPL.FINDER Description messages, etc. Finally it will write out: Tool K it> END OF JOB. A program called SPLIT­ PROG will have been created which, POKE 103, for loading the the user program and then that part is hi-res graphics are used. Be sure to hold POKE ,0 user program to executed. on to the original program for making be split > Lines 63980-63984 scan the pro­ gram to be split to find the statement just preceding the hi-res page beginning. Lines 63984-63986: if the program isn't large enough to require splitting, Listing 2: SPLIT FINDER we stop here. Lines 63987-63988 POKE away the 63980 1=1+ PEEX (210) + PEEK (211) * 256 statement number detected for later use. 63981 J = PEEK (I + 1) Line 63989 invokes the next phase, 63982 IF J = PEEK (212) THEN 63987 63983 M = 1 :1 = J * 256 + PEEX ( I ) which does the actual splitting process. 63984 IF I <> 0 THEN 63981 63985 PRINT "PROGRAM DOES NOT REACH HICH-RES PAGE" 63986 END 63987 POKE 208, PEEX (M + 2 ) : POKE 209, PEHC (M + 3) 63988 POKE 103, 1: POKE 104, 8: POKE 2048, 0 63989 PRINT CHR$(4); "RON SPL.EXEC MAKER" SPL.EXEC MAKER Description RUN 63980

Lines 5-6 compute the number of Listing 3: SPLIT EXEC MAKER dummy REM SPLIT statements to be inserted to cover the appropriate 5 Y = 36 graphics area. 6 IF PEEX (213) = 64 THEN Y = 72 7 Z = PEEX (209) * 256 + PEEX (208) Line 7 retrieves the 8 D$ = CHR$ (4) where the split starts. 9 PRINT D$; "OPEN TMPEXEC" Lines 8-80 create and execute 10 PRINT D$: ''DESfTTE TEMPEXEC" TEMPEXEC, which performs the 20 PRINT D$; "OPEN TEMPEXEC" following functions upon invocation: 30 PRINT D$; "WRITTE TEMPEXEC" 31 PRINT "POKE 103,PEEX(210)+1” Lines 31-34 set up the appropriate 32 PRINT "POKE 104,PEE X (211)" LOMEM value and then load 33 PRINT "POKE (PEEX(210)+256*PEEX(211)),0" SPLITPROG. 34 PRINT "UDAD SPLITPROG" Line 35 renumbers the program to 35 PRINT “S.R ";Z + 3 + Y;",1,";Z allow insertion of the REM split 36 PRINT Z ;" GOTO ";Z + 3 + Y 37 PRINT Z + 1 ;" REM SPLIT” statements. 40 EOR I= Z + 2TOZ + 2+ Y Line 36 adds a GOTO statement 50 PRINT I;" RBI SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT S around the REMs so they can't be PUT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPL executed. IT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT SPLIT Lines 37-60 add the dummy REM SPLIT SPLIT SPLIT SPLIT SPLI" 60 NEXT I statements. 65 PRINT "EXEC SPL.PATCHER” Line 65 EXECs the final phase of the 70 PRINT D$; "CLOSE TEMPEXEC" splitting process, which creates the ap­ 80 PRINT D$;"EXEC TEMPEXEC" propriate POKE for line 1 to relink the final program execution.

94 MICRO - The 6502/6809 Journal No. 54 - November 1982 Listing 4: SPLIT PATCHER Lines 63981-63995 create and EXEC TEMPEXEC, which does the following: 63970 1=1+ PEEK (210) + 256 * PEEK (211) 63971 J l = PEEK (208) :J2 = PEEK (209) 63972 IF ( PEEK (I + 2) = J l) AND ( PEEK (I + 3) = J2) THEN 63976 Lines 63985-63988 replace the 63973 I = PEEX (I) + PEEK (I + 1) * 256:M = I initial dummy POKE with the ap­ 63975 GOTO 63972 63976 K = M propriate POKE for relinking the 63977 J = PEEK (M + 1) program. 63978 IF J = ( PEEK (212) + PEEK (213)) THEN 63981 63979 M = J * 256 + PEEK (M) Lines 63989-63993 clean up 63980 GOTO 63977 some of the garbage left by the pro­ 63931 PRINT CHR$ (4); "OPEN TEMPEXEC" 63982 PRINT CHR$ (4 );"DELETE TEMPEXEC" cess, save the final SPLITPROG, and 63983 PRINT CHR$ (4); "OPEN TEMPEXEC" print the "END OF JO B" message. 63984 PRINT CHR$ (4);"WRITE TEMPEXEC" 63985 PRINT "1 POKE ";K;",“; As you can see, a lot goes on, and a 63986 L = PEEK (M): J = 2: IF L > 9 TH0J J = 1: IF L > 99 THEN 63988 number of EXEC files are executed. 63987 PRINT LEFT$ (,,000,‘,J); This is mainly for the purpose of mak­ 63988 PRIWT L;": POKE ";K + I;","; PEEK (M + 1) ing the entire process automatic. I 63989 PRINT "PRIWT CHR$(4);"; CHR$ (34);"DELETE SPL.SETUP"; CHR$ (34) 63990 PRINT "DEL 63970,63995" welcome any changes or modifications 63991 PRINT "SAVE SPLITPROG" that would streamline the process. 63992 PRINT "PRINT "; CHR$ (34);"END OF JOB"; CHR$ (34) 63993 PRINT "PRIWT CTR$(4);"; CHR$ (34); "DEUTTE TEMPEXEC"; CHR$ (34) 63994 PRINT CHR$ (4);“CLOSE TEMPEXEC" 63995 PRINT CHR$ (4);"EXEC TEMPEXEC" Mr. Berns has been involved in computing RUN 63970 since 1959, working on large-scale computer systems as a systems analyst/ programmer. He has written both the BASIC compiler and interpreter and the LISP system for Stanford University where he has been employed for the past 14 SPL.PATCHER Description years. He may be contacted at 735 La Para Lines 63970-63980 compute the ac­ Ave., Palo Alto, CA 94306. The EXEC is copied to the end of tual machine addresses before and after the user program and then that part is the split, which must be modified to executed. relink the program. JMCftO

Model EP-2A-79 QCB-9 SINGLE BOARD COMPUTER EPROM Programmer 6809 BASED RUNS TSC FLEX DOS $149.00 ★ QCB-9/1 S -100 BUS * PARTIAL KIT ★ QCB-9/2 S S -50 BUS ______FEATURES • 5'A” Floppy Controller • Serial RS-232 Port • Centronics Type Printer Port • Keyboard/Parallel Port • 24K Bytes ol Memory • QBUG Resident Monitor • 6802 Adaptor FULLY ASSEMBLED & TESTED $389.00 • 48-hour Burn-in • 90 Day Warranty Three years in the field with unsurpassed performance. Software is available for the EP-2A-79 for most all of the microcomputers including the popular CP/M, NAKED-09 SS-50 6809 CPU CARD $49.95* FLEX, HDOS operating systems. Write or call for specific hardware/software inter­ PCB & * 1K OF RAM AT E400 Assembled & Tested $149.00 Documentation facing. Driver packages available for F-8, 6800. 6809, 8080,8085, Z-80, 1802, * 6K OF EPROM AT E800-FFFF 2MHZVersion 5189.00 Omy 6502 and 2650 based systems. * HIGH QUALITY 00UBLE SI0E0 PCB * SOLDER MASKE0 * SILK SCREENED EP-2A-79 115V 50/60 H Z ...... $169.00 TSC, FLEX DOS, ASSEMBLER, EDITOR $150.00 Personality Modules QBUG RESIDENT MONITOR $50.00 PM-0 TM S2708 ...... $17.00 PM-5 2716,2758 ,...... $17,00 PM-1 2704,2708 ...... 17.00 PM-SE 28 1 6 ...... 35.00 * Disc Boot * Memory Test * Break Points PM-2 2732 ...... 33.00 PM-8 MCM68764 , ...... 35.00 * Memory Exam & Exchange * Zero Memory * Jump to User Program PM-2A 2732A ...... 33.00 PM-9 2764 ...... 35.00 * Memory Oump * Fill Memory * Register Display & Change PM-3 TMS 2716...... 17.00 SA-64-2 TMS 2564...... 39.00 QBUG IS A TRADEMARK OF LOGICAL DEVICES INC., ' Copyright 1981 PM-4 TMS 2532 ...... 33.00 SA-64-3 2764 ...... 39.00 ______PHONE ORDERS: (305) 776-S870 ______

Optimal Technology, Inc. LOGICAL D EVICES INC. COMPUTER PRODUCTS DIVISION Phone (804) 973-5482 781 W. OAKLAND PARK BLVD. • FT. LAUDERDALE, FL 33311 Blue Wood 127 Earlysville, VA 22936 TWX: 510-955-9496 • WE ACCEPT VISA, MC, CHECKS, C.O.D., MONEY ORDER

No. 54 - November 1982 MICRO - The 6502/6809 Journal Extra Colors for the Atari

by Richard I. and Donna M. Marmor

Two techniques are presented to Listing 1 achieve extra colors on the Atari 1 REM MPROGRAM 1** screen. One uses alternating 2 REM adjacent dots of different colors, 3 REM ILLUSTRATES COLOR DOT M IXING 4 REM YOU INPUT THE COLORS YOU WANT while the other uses alternating 5 REM THE PROGRAM THEN DISPLAYS THEM displays of different colors. 6 REM AND MIXES THEM FOR YOU- 7 REM AGAINST A WHITE AND BLACK BACKGROUND 8 REM Extra Colors 10 GRAPHICS 7 requires: 2 0 SETCOLOR 0 , 0 , 14iCOLOR 1 3 0 FOR 1 -8 0 TO 159 STEP 1 Atari 400/800 (8K) 40 PLOT 1,01DRAWTO I , 79lNEXT I 50 PLOT 10,10 6 0 DRAWTO 2 0 ,1 0 1 DRAWTO 2 0 ,2 0 3 DRAWTO 1 0 , 2 0 : DRAWTO 1 0 ,1 0 Atari graphics modes are limited in the 70 PLOT 30,10 number of colors that can be displayed 80 DRAWTO 4 0 , 10IDRAWTO 4 0 , 2 0 : DRAWTO 3 0 , 2 0 : DRAWTO 3 0 ,1 0 90 PLOT 20,30 at any one time. In Mode 7, for exam­ 100 DRAWTO 3 0 ,3 0 1 DRAWTO 3 0 , 4 0 : DRAWTO 2 0 , 4 0 : DRAWTO 2 0 ,3 0 ple, only four colors can be used. There 110 COLOR 0 are many techniques available that will 120 PLOT 90,10 expand your choices. In this article we 130 DRAWTO 1 0 0 ,1 0 1 DRAWTO 1 0 0 ,2 0 IDRAWTO 9 0 , 2 0 : DRAWTO 9 0 ,1 0 describe two of them and provide sam­ 140 PLOT 110,10 1S0 DRAWTO 120,101DRAWTO 120,20:DRAWTO 110,20:DRAWTO 110,10 ple program illustrations. 160 PLOT 100,30 170 DRAWTO 1 1 0 ,3 0 : DRAWTO 1 1 0 ,4 0 : DRAWTO 1 0 0 ,4 0 : DRAWTO 1 0 0 ,3 0 180 COLOR 2 Color Dot Mixing 190 FOR 1 = 11 TO 19 STEP 1 With this technique you place pix­ 200 PLOT 1,11:DRAWTO 1,19 210 PLOT I +80,11:DRAWTO 1+80,19 els of different colors next to one 2 2 0 NEXT I another in an alternating pattern. For 2 3 0 FOR 1 -2 1 TO 2 9 STEP 2 instance, a red pixel followed by a blue 2 4 0 FOR J=31 TO 3 9 STEP 2 pixel followed by a red pixel, and so on. 250 PLOT I,J:PLOT 1+80,J In a relatively large bounded area, such 260 NEXT J:NEXT I as a square, the overall perceived shade 2 6 2 FOR 1=22 TO 29 STEP 2 264 FOR J=32 TO 39 STEP 2 is distinct from the individual colors 266 PLOT I,J:PLOT 1+80,J comprising the pattern. Using this ap­ 268 NEXT J:NEXT I proach, the number of distinct colors in 2 7 0 COLOR 3 Mode 7 expands to 10: primary colors 280 FOR 1—31 TO 39 STEP 1 1, 2, 3, and 4; and the "m ixed” colors 290 PLOT 1,11:DRAWTO 1,19 300 PLOT 1+80,11:DRAWTO 1+80,19 1-2, 1-3, 1-4, 2-3, 2-4, and 3-4. Of 3 10 NEXT I course, you must make a judicious 3 20 FOR 1 -2 2 TO 2 9 STEP 2 choice of the four primary colors so 3 30 FOR J —31 TO 3 9 STEP 2 that the mixed colors will look good 340 PLOT I,J:PLOT 1+80,J and appear distinct. 3 50 NEXT J : NEXT I 3 5 2 FOR 1=21 TO 2 9 STEP 2 Program 1 will help in your explora­ 354 FOR J=32 TO 39 STEP 2 tion of Color Dot Mixing. It places two 356 PLOT I,J:PLOT 1+80,J sets of two squares on a Mode 7 screen, 358 NEXT J:NEXT I one against a white background and 360 PRINT "First color(0-15), lum<0-14 even)" one against a black background. The 370 INPUT CF,LF 380 PRINT "Second color(0-15), lum<0—14 even)" program then asks you to type in a pair 390 INPUT CS,LS of color-luminance combinations. It 4 0 0 SETCOLOR 1 ,C F ,L F colors a square in each set with each 4 1 0 SETCOLOR 2 ,C S ,L S color you chose, and then shows you 420 PRINT jPRINT :PRINT the result of the mix in a square directly 430 PRINT "First: Col o r-";CFj" Lum=";LF 440 PRINT "Second: Col or = “;CS;" Lum=";LS below. Why are there two sets of 4 5 0 GOTO 3 6 0 squares? Since colors look different

96 MICRO - The 6502/6809 Journal No, 54 - November against different background colors, we decided to experiment with different backgrounds. Listing 2 You can easily modify this program to further enlarge the technique. Why not mix more than two colors? Or how 1 REM ttPROGRAM 2 ** REM about different cycles; one red pixel 2 3 REM ILLUSTRATES COLOR DOT ALTERNATION followed by two blue pixels, for exam­ 4 REM YOU INPUT THE COLORS YOU WANT ple? Try background colors other than 5 REM THE PROGRAM THEN DISPLAYS THEM black and white. You'll really see the 6 REM AND MIXES THEM FOR YOU difference! 7 REM 10 GRAPHICS 7 The possibilities from color dot 2 0 SETCOLOR 4 , 0 , 1 4 mixing are great and they are suitable 30 PRINT "FIRST COLOR(0- IS ), LUM(0-14 EVEN)" for many applications. The resulting 4 0 INPUT CF, LF colors, however, appear rather coarse to S0 P R IN T "SECOND COLOR( 0 - 1 5 ) , L U M (0 -1 4 EVEN)" the eye. The next technique uses dis­ 60 INPUT CS,LS play list interrupts to create new colors 7 0 SETCOLOR 0 ,C F ,L F 8 0 SETCOLOR 1 ,C S ,L S that are much purer and far more pleas­ 9 0 COLOR 1 ing to the eye. 100 FOR 1 *21 TO 39 110 PLOT 1,21:DRAWTO I,39:NEXT I 120 COLOR 2 Color Dot Alternation 130 FOR 1-51 TO 69 140 PLOT I , 21:DRAWTO I,39|NEXT I To understand this technique, we 170 SETCOLOR 2 , 0 , 0 must first review some Atari display 180 COLOR 3 theory. When you look at a display on 190 FOR I - 2 6 TO 54 your television or monitor, it appears 2 0 0 PLOT I , 5 1 iDRAWTO I , 6 9 : NEXT I almost as if the display is painted on 2 1 0 POKE 3 6 7 7 0 ,2 4 0 2 1 5 RESTORE the screen. Actually, the display is be­ 2 2 0 FOR 1 -0 TO 3 9 ing regenerated by ANTIC, 60 times per 2 3 0 READ Al POKE 1 5 3 6 + 1 , A: NEXT I second. But this is so fast that you 240 DATA 72,138,72,169,0,141,10,212 don't see the resulting flicker. 2 5 0 DATA 1 4 1 ,2 4 , 2 0 8 , 1 6 9 , 2 0 , 1 4 1 , 0 , 2 An explanation of the display list 260 DATA 104,170,104,64,72,138,72 and display list interrupts appears in 2 7 0 DATA 1 6 9 ,0 , 1 4 1 ,1 0 , 2 1 2 , 1 4 1 ,2 4 ,2 0 8 280 DATA 169,0,141,0,2,104,170,104,64 many places, so we won’t go into that 2 9 0 POKE 1 5 4 0 , C F *1 6 + L F i POKE 1 5 6 0 ,C 8 *1 6 + L S in great detail: just enough to give a 3 0 0 POKE 5 1 2 ,0 1 POKE 5 1 3 ,6 frame of reference. Every 60th of a sec­ 3 1 0 POKE 5 4 2 8 6 ,1 9 2 ond [or frame), ANTIC goes through its 3 2 0 END display list and associated display memory, retrieving the color register number for a given pixel from display memory and displaying the pixel at the correct point on the screen in the color specified in the appropriate color regis­ ter. What would happen if, on alternate frames, different colors were displayed for the same pixel? During frame 1, for display list interrupt routines shown in junction with tables giving the mode instance, the color of a pixel might be listing 3. In listing 2, the routines are lines to be mixed. red. During frame 2, it might be blue. POKEd into memory at lines 220-280. The implementation given here During frame 3, it would go back to When the routines are executed in their uses two display list interrupts for red, and so on. The result, according to appropriate frames, the color register alternate frames. Another method is to color wheel theory, is that the pixel used for the third square is flip-flopped use a single display list interrupt that should appear purple. And indeed it between the two colors you chose. Dur­ flip-flops a color register. You would does. If you kept track which pixels of ing the odd frames, the color register is change the contents of the color regis­ your display should be pure red, which set to the first color. During the even ter during alternate frames. A final should be pure blue, and which should frames, the color register is set to the method, although costly in memory, is be alternating red-blue, you would ob- second color. Each interrupt routine to have two separate display memories. train three pure and distinct colors for causes the other one to execute during One would contain the color register the price of two! In a Mode 7 display, the next frame by modifying the dis­ numbers used during the odd frames, this makes 10 colors a possibility. play list interrupt vector. The input and the other would contain the color This technique may be imple­ colors are set into the interrupt rou­ register numbers used during the even mented in several ways. Program 2 tines by line 290. The result on the frames. If a pixel is to be a pure color, demonstrates one way. As in program screen is that the third square has a dif­ its associated color register number 1, program 2 asks you to type in two ferent color than the other two. would be the same for odd and even color-luminance combinations. These To fully utilize Color Dot Alterna­ frames. If a pixel is to be mixed, its colors are displayed in separate squares, tion, some additional programming is color register number would alternate and then below them a rectangle is dis­ needed. You must keep track of which in the two display memories between played with the colors alternating on pixels are to be mixed and which are the two registers to be mixed. A display different display frames. not. This can be accomplished by using list interrupt would be used to change The alternation is produced by the multiple display list interrupts in con­ the display list itself to point to the two

No. 54 - November 1982 MICRO - The 6502/6809 Journal 97 display memory areas for different Listing 3 frames. One warning about this technique. When you alternate between colors of DISPLAY LIST INTERRUPT ROUTINES FOR PROGRAM 2 different luminances, flickering will occur. The flickering will worsen as the PHA ODD FRAME D L I ROUTINE luminances get farther apart and will be TXA PHA almost non-existent when the lumi­ LDA «0 AT RUN TIME CONTAINS FIRST INPUT COLOR nances are the same, especially with STA USYNC the higher color numbers. This flicker STA COLPF2 PUTS F IR S T COLOR IN COLOR REGISTER 2 effect can be very useful for special ef­ LDA * 2 0 SETS EVEN FRAME D L I ROUTINE fects in your programming. STA * 5 1 2 TO EXECUTE DURING NEXT FRAME The expansion possibilities for Col­ PLA TAX or Dot Alternation seem endless. You PLA can experiment with cycles of three or RTI more. With a cycle of two, your color palette is 256. With higher cycle num­ bers, the choices are greater, of course. PHA EVEN FRAME D L I ROUTINE We have used the technique effectively TXA with cycles of up to four. PHA Both Color Dot Mixing and Color LDA # 0 AT RUN TIM E CONTAINS SECOND INPUT COLOR Dot Alternation are simple techniques STA WSYNC that expand the color possibilities of STA C0LPF2 PUTS SECOND COLOR IN COLOR REGISTER 2 your Atari. By using these techniques, LDA # 0 SETS ODD FRAME D L I ROUTINE STA * 5 1 2 TO EXECUTE DURING NEXT FRAME or variations, you can begin to realize PLA the full graphics potential of your TAX computer. PLA RTI Contact the authors at 901 Green Forest Drive, Montgomery, AL 36109.

JMCRO

APPLE II PERIPHERAL DEVELOPERS:

Your complex (unction prototype requires the best wirewrap board available.

SPECTRUM SYSTEMS ...... MAKES IT!

Fully Extended Wirewrap Protoboard.

Size: 2.8 by 10.7 inch 2 layer PC.

Capacity: up to 58*16 pin or 12-40 pin or any combination sockets inbetween.

Carefully designed + 5 and GND planes provide tor the minimum electrical noise, low impedance, hi

capacitance, and maximum versatility in the layout of IC's, capacitors, discretes and I/O connectors. Wire-wrap technique documentation included. the LEADER Terms: • $45.00 + {6% Cal. Res. tax) + S2.00 S&H. of the pack . . . • All payments must be in U.S. funds drawn on a U.S. bank. • Outside U.S. add 10%. Write for free catalog with more than 400 fantastic

• Cashier check/money order allow 30 day ARO. values for all your word and data processing needs. Outside USA, enclose $1.00 . • Personal checks add 2 weeks. • No credit cards or cash, Please! ABM PRODUCTS Spectrum Systems 8868 CLAIREMONT MESA BLVD. P.O.Box 2262 SAN DIEGO, CALIFORNIA 92123

Santa Barbara, Ca. 93120 Toll Free 800-854-1555 Orders Only For information or California Orders (714) 268-3537 Apple II ais Uademark ol Apple Computers.

98 MICRO - The 6502/6809 Journal No. 54 - November 1982 Introduction to 3-D Rotations on the Apple

by Chris Williams

The techniques of 3-D rotation object are numbered points. They cor­ is related to X and Y as X = sin(45)*Z, are discussed. An Applesoft respond to the CR array in the program. Y = sin(45]*Z. Sine and cosine of 45 demonstration program is This array is dimensioned (3,8). The degrees are both .707. Specify a comer's provided, which includes object has eight comers and each comer position in 3-D space as CR(1,1), general-purpose routines for has three elements representing X, Y, CR(2,I), and CR(3,IJ where I selects the yaw, pitch, and roll. and Z coordinates. Lines 170 through comer and 1,2,3 is XYZ. A comer's 2-D 400 of the program simply define the projection onto the X-Y screen is com­ box in 3-D space. puted in lines 490 and 500 using ROTATE Now you need to project it onto the X = X+ ,707*Z, Y = Y+.707*Z. Lines requires: 2-D plane. X and Y coordinates corres­ 510 and 520 are there merely for scaling pond precisely so they pose no problem. and putting the box near the center of Apple with Applesoft The Z coordinate is another matter. the screen. Since Z is defined to be at 45 degrees The edges of the box are defined I am fascinated by the computer-gener- to both X and Y, then the Z coordinate even more simply. They are in a table ated special effects recently proliferated look-up contained within arrays II and through the film industry. The primary 12. Notice that both these arrays are building block for these special effects dimensioned as 12 as there are 12 edges is the 3-D rotation. I've discovered that on the box. these effects are remarkably easy to The number in each element of produce,- this article and program pass these arrays is a comer (see figure 2). on the techniques required. That means an edge exists from point The program is written entirely in 11(1) to point 12(1). If you look at lines Applesoft and isn't offensively slow, 550 through 590, you'll see HPLOT but don't expect fluid motion. The pro­ draws an edge from X(I1 (I)),Y(I1 (I)) to gram documentation is thorough, but X(I2(I)),Y(I2(I)). you should make two copies (one with That's all it takes to draw a 3-D REMs, one without). Executing the box. You can convince yourself of this REMed program will try your patience. by turning off the rotation in the pro­ I won't provide an in-depth discus­ gram (insert line 455 GOTO 480). This sion on the math; you don't need to will display the box in X,Y. understand it to do rotations. Just strip Now take out the GOTO and try out my subroutines and use them rotating. Here, the problem is again one where you need them. The program draws a hi-res 3-D rec­ tangular box and then rotates it. The rotation occurs in discrete steps of 15 degrees. It takes about 90 seconds to rotate through 360 degrees. This box is a real-world object — it has height, width, and depth. The task in doing 3-D display is to project real- world objects onto a two-dimensional surface. Figure 1 is the Apple hi-res screen for X and Y. Z is supposed to be an axis drawn out of the screen and perpen­ dicular to it. Since that can't be done, represent Z as a line drawn at a 45-degree angle, upper left to lower right. This line allows you to put depth on the screen. Figure 2 introduces the box and shows how the 3-D to 2-D projection works. Notice that the comers of the

No. 54 - November 1982 MICRO - The 6502/6809 Journal 99 of axis definition. Refer back to figure 1. Listing 1 Call rotation about the Z axis — Roll, RfM REM ROTATE 'TUTORIAL about the X axis — Pitch, and about the REM BY C. WILLIAMS Y axis — Yaw. The program does a Yaw RFM Q3PYRICHT 1932 RIM BY C. W ILLIAM rotation only. *************** The trick is in the matrix multiply. REM If you let a given corner's coordinates 10 DIM CO(3),C(3) 20 DIM 11(12),12(12) be X1,Y1,Z1, then 30 DIM FT(3,3) 40 DIM CRNR(3,8) 'X1 50 DIM XP(8),YP(8) = [ROTATION MATRIX) X[ Y1 60 DIM D(3) 65 RIM READ EDGE-START POINTS INTO I I 7 0 FOR I = 1 TO 12 9 0 READ A where X2,Y2,Z2 is that point's new, 90 11(1) = A 1 00 NEXT rotated coordinates. 110 DATA 1,2,3,4,5,6,7,8,1,2,3,4 If you don't understand that, don't 115 REM REM EDGE-END POPfTS INTO 12 worry. You'll be able to just plug 120 FOR I = 1 TO 12 130 READ B numbers; you won't need to under­ 140 12(1) = B stand it. 150 DATA 2,3,4,1,6,7,8,5,5,6,7,8 The rotation matrix above is defined 160 NEXT in lines 620 through 720. The angle for 165 REM DEFINE 3-D POSITION OP CORNERS the sine and cosine call comes from 170 CRNR 1,1) = 0. 180 CRNR 2,1) = 0. line 450 where degrees are incremented 1 90 CRNR 3 .1 ) = 0 . by 15 each time through the loop and 2 0 0 CRNR 1.2) = 0. then converted to radians. 2 10 CRNR 2,2) = 1. 2 20 CWJR 3 .2 ) = 0 . The choice of where the sine and 2 3 0 CRNR 1 .3 ) = 1 . cosine terms go in the rotation matrix 2 4 0 CRNR 2 .3 ) = 1 . determines whether the rotation is 2 5 0 CRNR 3 .3 ) = 0 . Roll, Pitch, or Yaw. Looking at the pro­ 2 60 CRNR 1 .4 ) = 1 . 2 70 CRNR 2 .4 ) = 0 . gram, see that for Yaw 2 8 0 CRNR 3 .4 ) = 0 . 2 9 0 CRNR 1 .5 ) = 0 . I c(Yaw) 0.0 s(Yaw) \ 300 CRNR 2 .5 ) = 0 . DIM RT(3,3) = I 0.0 1.0 0.0 I 310 CRNR 3 .5 ) = 2 . \-s(Yaw) 0.0 c(Yaw) j 3 20 CRNR 1.6) = 0. 3 30 CRNR 2,6) = 1. 3 40 CRNR 3 .6 ) = 2 . 3 50 CRNR 1 .7 ) = 1 . 3 60 CRNR 2 .7 ) = 1 . 3 70 CRNR 3 .7 ) = 2 . 3 8 0 CRNR 1.8) = 1. How to run a listing in 3 90 CRNR 2,8) = 0. 4 0 0 CRNR 3 ,8 ) = 2 . MICRO’S Software/Hardware 4 05 REM LINE 4 1 0 SETS VARIABLES EOR SPEED 4 1 0 P7 = .707 :OE = 1:TW = 2:TR = 3:TT = 30:SF = 75:EV = 15:EI = 8:HU = 150 4 20 HCOIOR= 3 The Software and Hardware 4 30 HOME : VTAB 5 : INPUT "ENTER IN ITIA L ROTATION ANGUS ";AG Catalogs are provided as a ser­ 440 RAD = 3.14159 / 130. vice both to our readers and to 4 4 5 REM THE IOTP BEGINS HERE WITH ANGLE INCREMENT 450 AG = AG + FV:AG = AG * RAD the manufacturers. These entries 4 6 0 QDSUB 6 2 0 : REM RT DEFINED are not MICRO reviews, but 4 70 OOSUB 7 4 0 : REM MATRIX MULTIPLY 4 7 5 REM THIS LOOP DOES THE 3-D— >2-D PROJECTION, PLUS SCREEN SCALING descriptions provided by the 48 0 FDR I = OE TO E l manufacturer. 490 XP(I) = CRNR(OE,I) + P7 * CRNR(TR.I) 500 YP(I) = CRNR(TW,I) + P7 * CRNR(TR,I) 510 XP(I) = (XP(I) * TT) + HU To run a free listing in either 520 YP( I) = (YP(I) * TT) + SF catalog, a company fills out the 5 3 0 NEXT 535 REM ERASE OLD BDX, FULL SCREEN appropriate form or merely mails 540 HGR : POKE - 16302,0 in their material in the same 545 REM CRAW IT , PLUS T IE EDGES 5 5 0 FOR I = 1 TO 12 format that appears in the 560 PI = ll(I) magazine. 570 P2 = 12(1) 580 HPIOT XP(P1),YP(P1) TO XP(P2),YP(P2) 5 9 0 NEXT We try to limit entries to one 6 0 0 GOTO 4 5 0 company per month, on a first- 6 1 0 END 615 REM SUBROUTINE AT 6 2 0 DEFINES RT come-first-serve basis. 6 2 0 CANGLE = CDS (AG) 6 3 0 SANGLE = SIN (AG) If you sell products our 640 EOR I = I TO 3 6 5 0 FOR J = 1 TO 3 readers should know about, write 660 RT(I,J) = 0. to Software/Hardware Catalog, 6 7 0 NEXT J : NEXT I 680 RT( 1,1) = CANGLE MICRO, P.O. Box 6502, 690 RT(2,2) = 1. Chelmsford, MA 01824. 700 RT(3,3) = CANGLE 7 1 0 RT( 1 ,3 ) = SANGLE (con tin\

100 MICRO - The 6502/6809 Journal No. 54 - November 1! doesn't matter. Just rearrange lines 680 Listing 1 (continued) through 720 to produce arrays as shown 720 R T (3 ,1 ) = ( - SAMGIE) above and you can rotate any way you 7 30 RETCJRN wish. 735 REM SUBROUTINE AT 740 DOES X,Y,1 GETT That's all there is to 3-D rotation. I 7 40 FDR X = OE TO E l 7 5 0 FDR J = OE TO TR cringe as I say that because there are all 760 C(J) = CRNR(J,I) sorts of things to be reckoned with. Re­ 770 NEXT J fraction, shading, and hidden lines and 780 OOSUB 8 4 0 : REM m 3 objects are not topics to be discussed in 790 CRNR(OE,I) = GO(OE) 8 0 0 CRNR(TW, I ) = CO(TW) an article with a title like this one. But 810 CRNR(TR.I) = GO(TR) the program here is a good foundation. 8 2 0 NEXT : RETURN There is room for improvement, of 8 3 0 END 8 3 5 REM LINE 8 4 0 STARTS THE MATRIX MULT. course. The more adventuresome 3 4 0 FDR K = 1 TO 3 readers might try defining other 3-D 850 D(K) = 0. shapes and then rotating them. The 8 6 0 NEXT K subroutines are all there. Or you might 8 7 0 FDR I I = OE TO TR 8 8 0 FDR J = OE TO TR work for speed; a more fluid update 8 9 0 D( I I ) = D( I I ) + R T ( I I , J ) * C( J ) : NEXT J would certainly be a plus. Let me know 9 0 0 NEXT I I what you come up with. 9 1 0 FDR I I = OE TO TR 920 CD(II) = D (II) 9 3 0 NEXT I I 9 4 0 RETURN

If you’d like to do Pitch rotations, And for Roll rotations, like this: Mr. Williams is an electrical engineer/ rearrange the array to look like this: writer. He may be contacted at 5676 S. / c(Roll) s(Roll) 0.0 Meadow Lane #101, Ogden, UT 84403. 0.0 0.0 DIM RT(3,3)= -s(Roll) c(Roll) 0.0 DIM RT(3,3) = c(Pitch) - s(Pitch) \ 0.0 0.0 1.0 s(Pitch) c(Pitch) If you don't know matrix algebra, it JMCftO

^ ) e c is io n P E T /C B M ™ 0«ci«ion System* S P.O Box 13000 ystema D.n»on,TX7«»3SOFTWARE SELECT!

SOFTWARE FOR THE APPLE II* 8 0 3 2 o r 4 0 3 2 ISAM -DS is an integrated set of Applesoft routines that gives indexed file capabilities to your BASIC programs. Retrieve by key, partial key or sequentially. Space from DISPLAY DISPLAY deleted records is automatically reused. Capabilities and performance that match products costing twice as much. FROM THE KEYBOARD OR PROGRAM $50 Disk, Applesoft. NOW RUN WORD PRO 3 OR WORD PRO 4 PBASIC-DS is a sophisticated preprocessor for structured BASIC. Use advanced logic constructs such as IF...ELSE..., CASE, SELECT, and many more. Develop programs for Integer or Applesoft. Enjoy the power of structured logic at a fraction of the cost of PASCAL. FROM THE SAME MACHINE $35. Disk, Applesoft I48K, ROM or Language Card).

D S A -D S is a dis’assembler for 6502 code. Now you can easily dis-assemble any Available for either 4000 or 8000 Series machine language program for (he Apple and use the dts-assembled code directly as input to your assemblet Ois-assembies instructions and data. Pioduces code com­ ALSO: patible with the S-C Assembler (version 4 0), Apple's Toolkit assembler and others. $2S Disk, Applesoft (32K. ROM or Language Cardl For 2001 / 3000 Series Computers FORM-OS is a complete system lor the definition of input and output froms. FORM- DS supplies the automatic checking of numeric mout for acceptable range of values, Operate these Models in a Full8032 Like automatic formatting of numeric output, and many more features $25 Disk. Applesoft <32K. ROM or Language Card) Display For Word Pro 4*

UTIL-DS is a set of routines for use with Applesoft to format numeric output, selec­ and all other 80 Column Software tively dear variables (Applesoft's CLEAR gets everything), improve error handling, and interface machine language with Applesoft programs Includes a special load All installation instructions included. routine for placing machine language routines underneath Applesoft programs $25 Disk, Applesoft

SPEEO-OS is a routine to modify the statement linkage in an Applesoft program to EXECOM CORP. speed its execution improvements of 5-20% are common As a bonus, SPEEO-DS includes machine language routines to speed string handling and reduce the need fo- 1901 Polaris Ave. garbage clean-up. Author Lee Meador Racine, Wl 53404 $15 Disk, Applesoft (32K, ROM or Language Card) Ph. 414-632-1004

(Add $4.00 for Foreign M eill PET/CBM a trademark of Commodore Business Machines ‘ Apple II is a registered trademark of the Apple Computer Co ‘ trademark of Professional Software, Inc.

No. 54 - November 1982 MICRO - The 6502/6809 Journal 101 6502 DEBUG! 2 0 1 8 3 8 9 0 2 7 THE TACKLER" DUAL • MODE PARALLEL INTERFACE FOR FAST n EASY THE APPLE* 2 BOARDS IN ONE FOR NO MORE COMPATIBILITY PROBLEMS! An intelligent board to provide easy control of your The PTD language Way printer’s full potential. Plus a standard parallel board at the flip of a switch -- your assurance of compatibility with essentially all software for the a p p l e ®. Hires printing with simple keyboard commands that replace hard to use software routines. No disks to load. Special features include inverse, doubled, and rotated graphics and many text control features, available through easy keyboard or software commands. It’s simple to print HIRESgraphicsfroman APPLE computer withTheTackler 05 LOCI = *7C80 ^ from TYMAC. This is the first truly universal parallel interface! Plus the ROM for your specific printer. Sophisticated intelligence when you need it, total compability that never lets you down. 10 PC = S3FC 7 Change printers -- no need to buy another board. Just plug in one of our ROM’S and you're all s e t ROM'S available for Epson, C. Itoh, NEC, and 20 LABL: STEP 100 NODISP Okidata ~ others available soon. You’ve asked us to make the TACKLER better than the othars and we did. ______$ 1 5 9 .0 0 1 38 IF X<*3E OR @L0C1#*17 THEN GOTO LABL UPGRADEABLE PARALLEL PRINTER CARD 40 PRINT "HERE IS THE CULPRIT" A Universal Centronics type parallel printerboard complete with cable and connector. This unique 50 SHOW O00 board allows you to turn on and off the high bit so that you can access additional features in many printers. Easily upgradeable to a fully intelligent printer board with graphics and text dumps. Use with EPSON, C ITOH, ANADEX, STAR-WRITER, NEC, OKI and others with standard Centronics PTD-6502 is a high speed, compiled BASIC-like lan­ configuration. ______$1 3 9 .0 0 THE PERFORMER PRINTER guage, light years ahead of the Apple II Single Stepper FORMATTER BOARD for Epson, OKI, NEC and far more sophisticated than any other 6502 de­ 8023, CITOH 8510 provides resident HIRES screen dump and print formatting in firmware. bugger available. It allows you to sit back effortlessly Plugs into Apple slot and easy access to all while your computer glides through your code at a thou­ printer fonts through menu with PR# command. Use with standard printercards to add intelligence. sand instructions per second looking for your bugs. Or $ 49 .0 0 specify printer.______you can select a slower speed with updated display of THE MIRROR FIRMWARE FOR NOVATION APPLE CAT II* memory. A paddle-controlled single stepper mode is The Data Communication Handler ROM Emulates syntax of an other popular also available. At either of the slower speeds, the Apple Modem product with improvements. Plugs directly on Apple CAT II Board. Supports Videx and Smarterm 80 column cards, touch tone and rotary PTD-6502 monitors and saves the last 128 instructions dial, remote terminal, voice toggle, easy printer access and much more. executed for review at any time. List $ 39 .0 0 Introductory Price $2 9.00 is per­ DOUBLE DOS Plus Virtually unlimited breakpoint complexity A piggy-back board that plugs into the disk*controller card so that you can mitted with the PTD-6502. IF statements with mixed switch select between DOS 3.2 and DOS 3.3. DOUBLE DOS Plus requires AND’s and OR’s can be created to test conditions such APPLE DOS ROMS.______$ 3 9 .0 0 as memory change, memory = value, instruction loca­ tion, ... and many others. You can have as many named breakpoints as you wish in both ROM and RAM. NIBBLES AWAY II • Fast AGAIN! Ahead of all others. Some other features of the PTD-6502 include AUTO-LOAD PARAMETERS . . . Free’s the user from having to subroutine execution. • Hex calculator/converter. Manually Key in Param values used with the more popular software • Hex/ASCII memory dump. • Up to 16 machine lan­ packages available for the Apple II. EXPANDED USER MANUAL . . . incorporates new Tutorials for guage cycle timers. • Ability to monitor specific labeled all levels of expertice; Beginners Flowchart for ‘where do I begin’ to areas in memory while stepping. • Effective address. ‘Advanced Disk Analysis' is included. TRACK/SECTOR EDITOR . . .An all new Track/Sector Editor, • Accessible monitor commands. • A documented mod­ including the following features: Read, Write, Insert, Delete Search, ule for relocation of the PTD-6502 to virtually any loca­ and impressive Print capabilities! DISK DIAGNOSTICS . . . Checks tion (source code supplied). such things as: Drive Speed, Diskette Media Reliability, and Erasing Diskettes. The debugging program shown on the monitor is a HIGHEST RATED . . . Best back up simple example; it could be far more complex. If you can Program in Softalk Poll (Rated 8.25 out of 10). think of it, you can probably scan for it at 1000 instruc­ CONTINUAL UPDATES. . .Available tions per second. If you’re a professional, the PTD-6205 from Computer Applications and new $ 6__ 9 .9 5 listings on the source. ______" ______can pay for itself in the first few hours of use. If you’re a novice, you’ll soon be debugging like a pro. Super PIX 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 ORDER: PTD-6502 Debugger the Apple Hires screen horizontally or vertically. Use with EPSON* MX-80 with or without GRAFTRAX* Roms, MX-70 - OKI* Microline 8 0 ,8 2 ,8 3 ,82A, including DOS 3.3 Disk 83A - C. ITOH* 8510 and NEC 8023A Requires Tymac Parallel Printer and instruction manual...... $49.95 Board PPC-10 0 ... $24.95. (Note that disk is not copy protected. Order only Ai^LE LINK- A versitile modem utility that provides the Apple user the ability to transfer disk files and software over the phone. Only one package one for each business or institution.) In Califor­ needed for full transfers. Compatable with all DOS file types. 959.00 nia, add 6.5% sales tax. (requires Hayes Micro Modem) P TD -6502 requires Autostart ROM for last breakpoint. TH E APPLE CARD-Two sided 100% plastic reference card Loaded with information of interest to all Apple owners. 93.98 HBPl...... I M\CRO-WA«l DIST. INC. PTERODACTYL P 0 B0X 113 P0MPT0N PLAINS, N.J. 07444 Dealer and Distributor Inquires Invited. SOFTWARE® 1452 Portland Ave. • Albany CA 94706 • (415) 525-1605

102 MICRO - The 6502/6809 Journal No. 54 - November 19! /AICEO From Here to Atari

I’ve heard of a 64K board but haven't machine-readable copies will be avail­ By Paul Swanson seen it yet. The Atari can't address 64K able. If you really don't want to type it directly because of the 16K reserved for in, check with your local user group to the operating system ROM and the see if anyone already typed it in. We are pleased to introduce our new hardware registers. The 64K board is My December column will feature Atari Column. Paul Swanson has pub­ bank-selectable so it doesn't exceed the the Atari Regional Software Acquisi­ lished articles in several microcom­ 48K allowed. Available pseudo disks tion Centers; January will include puter magazines and has authored a give you 128K of memory that you can available technical literature. Decem­ book on disk techniques. He runs his access as if it were a disk. ber’s column will be of particular in­ own software consulting firm and Many new products have been an­ terest if you plan to market any of your markets a full-size keyboard for the nounced for the Atari, and many are Atari software. January's topic covers Atari 400. about to be announced. Much of the places where you can find lists and ex­ new software available is in response to planations of all those special memory The Atari has two microprocessors in­ Atari Inc.'s interest in home educa­ locations that you need to develop fan­ stead of one, unlike what you would tional applications. My First Alphabet, cier software. _ find in most systems. The main pro­ by Fernando Herrera, is still one of the 4MCRO cessor is the 6502. Atari, Inc., custom- best educational software packages made the second processor, ANTIC, available for younger children. A new which is used to control just the program called Master Type, from graphics screen. A few other custom Lightning Software, makes an interest­ chips in the Atari are not full micro­ ing spaceship game out of learning processors, but you can control them touch typing. If you want to learn how through the hardware registers. to type, you may want to get your local It Pays Taking advantage of all the Atari’s computer store to demonstrate this special hardware can be quite com­ program for you. It is listed at $39.95, plicated. Fortunately, because of the requires 32K and a disk drive, and to Write various graphics modes available, keeps your interest with 17 levels of much of this hardware can be accessed complexity. These two software through BASIC without knowing very packages, as well as the memory for MICRO! much about the hardware itself. boards, are available at most computer You can write simple programs stores that carry Atari. Get paid for your ideas: This column, on occasion, will try using the information in the BASIC write for MICRO! Thousands Reference Manual supplied with the to clarify conflicting rumors. For exam­ BASIC cartridge. More complex pro­ ple, I have heard three or four people of people read MICRO every grams that take advantage of Atari's asking about the "special vector" you month. MICRO is sold in special chips require more information. can use in the Atari to get rid of the key computer stores and on I will supply you with details of this click. I can appreciate the need for newsstands worldwide. Send eliminating that noise — it seems much special hardware in upcoming columns. for a copy of our Writer’s Each month's column will focus on louder when everyone else is asleep — some feature of Atari’s hardware. I in­ but I disassembled part of the operating Guide now. Our author tend to take these topics from letters I system looking for the keyboard click payment rate is competitive receive, so if you have questions or need and found no place to POKE anything with the leading magazines in more information on a specific func­ that would eliminate it. The part in the industry. tion, send me a letter at 97 Jackson St., question is in ROM and you can't alter Cambridge, MA 02140. (If you don’t ROM with a POKE. It doesn't check want your name mentioned, be sure to with any RAM locations before the JSR We welcome articles on any note that in your letter. I will include (Jump to SubRoutine) that produces the aspect of 6502/6809/68000 excerpts from letters in my columns.) click. The only ways I can see to hardware and software for the In addition to answering questions eliminate the click include physically Apple, Atari, CBM/PET, concerning the Atari, this column will disconnecting the keyboard speaker or TRS-80 Color Computer, VIC, also contain information on new hard­ writing your own keyboard handler. ware and software from Atari and other Even writing the keyboard handler OSI, 6809, or 68000. Topics for manufacturers. Already available from would not eliminate the click under upcoming issues are: second sources are memory boards for every possible condition; you have to Programming languages both the 800 and the 400. The 32K initiate the handler every time one of a (besides BASIC), board (for both) has been available from variety of different things happens. Communications, Operating several different companies for over a Future columns may also include a year now. There is also 48K on a single listing of a short utility program Systems, and new Computers. card that you can plug into your 400. (BASIC) that is in the public domain. No

No. 54 - November 1982 MICRO - The 6502/6809 Journal 103 NEW SOFTWARE forTRS80 Model III and the Color Computer IW s e a t i n g ■ Church Contribution System designed to simplify and facilitate the tedi­ ous chore of recording envelopes. Provides a variety of reports. Maintains its own data­ files. Only $150 y o u r A p p l e ? ■ Data Base Manager designed to help organize all your data and pro­ vide you with meaningful reports. Add or delete any information. New files can be created and old information transferred. Only $150 Find out with Apple-Cillin II™ ■ Single Entry Ledger designed as an uncomplicated control of finances for home or small business. Add, de­ It’s a fact of computer life. Software and lete, edit at any time. Compatible with hardware interact. If there’s a problem eating DBM. O n ly $ g 5 your Apple, you can spend hours trying to Write or phone for complete software price list. find out whether software or hardware is the [universal: VISA' culprit. Unless you have Apple-Cillin II. \DATA Apple-Cillin II is a comprehensive diagnostic RESEARCH 2457 Wehrle Drive Amherst, NY 14221 system developed by XPS to check the l^'NC 716/631-3011 performance of your Apple II computer system. Apple-Cillin II contains 21 menu driven utilities to thoroughly test the operation CSE means OSI of your system, and either identify a specific Custom After Market Software problem area or give your system a clean bill for C1P and C4P machines of health. Quickly and easily.

Apple-Cillin II works with any 48K Apple “ Basic Enhancer: Renumber, Auto Sequencer, Screen Control func­ system equipped with one or more disk tions, and tape 1/0 system that is faster and has file drives. names C 1 P ...... $21.95 To order Apple-Cillin II - and to receive C 4 P ...... $29.95

information about our other products - Call Modified Monitor Rom Chip: Now get indirect jump-capabilities just like those XPS Toll-Free: 1-800-233-7512. In in the C1P and for no extra charge CSE will burn in Pennsylania: 1-717-243-5373. your machines serial num ber ...... $16.95 'NOTE: The C4P version of the Basic Enhancer in­ Apple-Cillin II: $49.95. PA residents add 6% cludes the modified monitor Rom chip required for State Sales Tax. proper program functioning. This is only a partial listing of our products. Write us for information on new disk programs or send $2 for catalog. Please include $2.00 shipping and handling XPS, Inc. with orders. 323 York Hoad Carlisle, Pennsylvania 1/013 Computer 800-233-7512 Science XPS 717-243-5373 Engineering Box 50 • 291 Huntington Ave. Boston 02115

Apple II is a trademark ot Apple Computer Inc 104 MICRO - The 6502/6809 Journal No. 54 - November 1S82 Dr. William R. Dial 438 Avenue /AICRO Akron, OH 44320 6809 Bibliography

78. Color Computer News, Issue No. 10 (July, 1982) Waclo, John, "The NFL Report Can Choose This Fall's Win­ Jackson, Jesse W., "TTYPELOG," pg. 58-60. ners," pg. 50-64. A utility for the Color Computer to log tape information to Put the National Football League on your Color Computer. your printer. 81. Compute! 4, No. 1 (January, 1982) Rouse, Alan, "Mortgage," pg. 62-64. A "What If" program for the Color Computer. Mansfield, Richard, "BRANCH NEVER and QUIF Assembling Eichman, Steve, "Shaplist," pg. 65-67. on SuperPET," pg. 146-149. An Inventory/File program for the 6809-based Radio Shack An instructional article for SuperPET users. Color Computer. 82. Microcomputing, 6, No. 8 (August, 1982) Aker, Jack L., "BASIC Program Line Mover," pg. 69-70. A utility for a Color Computer with Extended BASIC, and Whitman, James A., "Pascal and BASIC Square Off, Con­ 16K or 32K memory. tinued,” pg. 22. Becus, Georges A., "TRACETXT Listing Produced by PRIN- Benchmark tests including data on the 6809-based TRS-80 TXT CTRACE," pg. 71-75. Color Computer. A trace utility for the 6809-based Color Computer. 83. MICRO, No. 51 [August, 1982) Pretty, Richard, "A Pull on Your 'Art' Strings,” pg. 77. A simple string art program for the TRS-80 Color Computer. Steiner, John, "Interfacing the Color Computer," pg. 33-36. Barnes, Mark, "Gold Mine," pg. 78-81. Circuits to interface the TRS-80 Color Computer to an A graphics maze game for the 6809-based Color Computer. RS-232 port and a motor control relay are presented. A Morse Code send/receive program is included as a demonstration. Wright, Darrel, "Convert That File," pg. 83-84. A utility program to convert a Telewriter text file to a standard Staff, "MICRO Reviews in Brief," pg. 39-41. ASCII data file or vice versa. For the TRS-80 Color Computer. Reviews include discussion of a disassembler for the 6809 and the Compuvoice Synthesizer for the 6809-based Color Peterson, Russell M., II, "Exploring Graphics Modes,” pg. 87-88. Computer. Using the SDS80C Editor/Assembler on the TRS-80 Color Computer. Dial, Wm. R., "6809 Bibliography,” pg. 118. Some 26 items relating to 6809 literature are listed. 79. 80-U.S. Journal, 5, No. 7 (July, 1982) 84. 80 Micro, No. 52 (September, 1982) Roberts, R.N., "Togetherness," pg. 88-89. Tape merge for the 6809-based TRS-80 Color Computer. Miller, Franklyn D., "The Colorful Computer — Part II," pg. Causer, R. Shane, "17K of RAM,” pg. 94-95. 152-162. Squeeze extra space from memory on your TRS-80 Color Twenty programs for the 6809-based TRS-80 Color Computer. Computer. This is done by saving IK of memory out of a pro­ Tucker, Richard, "Cheaper Upgrade,” pg. 186-188. gram requiring 16K of memory. Do it yourself and save substantial cost in converting a 4K Color Computer, 8K Color BASIC to a 16K Extended Color 80. The Rainbow, 2, No. 1 (July, 1982) BASIC by installing the new ROM yourself. Parkman, Bob, "Silent Answer," pg. 4. Norman, Scott L., "Pascal Goes Color,” pg. 198-202. A driver to interface a TI Silent 700 with the 6809-based Compiled Pascal for the Color Computer is discussed. TRS-80 Color Computer. Sprouse, Gerald, "Joystick Paintbrush," pg. 230-232. Mir, Jorge, "Let's Go On A Simple Rainbow Adventure,” pg. Use the Color Computer like a drawing board, employing 9-17. two programs listed. An adventure-type program for the Color Computer. Osborne, Frank H., "Conversion,” pg. 238-240. Blyn, Steve, "Design Programs to Help Children Learn,” pg. Rewrite Level II BASIC programs to run on the 6809-based 18-19. Color Computer. BEEPEROO is a simple program for the Color Computer Heusinkveld, John, "PCLEAR 0,” pg. 282. which can be used to reinforce the concept of simple addition Make hi-res graphics use high memory on the 6809-based of three-digit numbers. Color Computer. Penrose, Paul, "Playing Around With Your 80C,” pg. 22. Playing music with the TRS-80 Color Computer. 85. Personal Computer, 5, No. 8 (August, 1982) Morgan, Alan J., "Synchronizing with Your SAM Chip,” pg. Curtis, Mike and Whelan, Joe, "The Dragon," pg. 112-116. 24-25. Dragon 32 is a new 6809-based British microcomputer with Using the 6883 SAM chip with the 6809-based Color Computer. full color, 32K RAM, 16K Microsoft BASIC, etc. Nolan, Bill, "Make Magic Rings on Magic 80C,” pg. 27-29. For addicts of fantasy role-playing programs, this Color Com­ 86. Color Computer News, Issue No. 11 (August, 1982) puter listing rolls up magic rings for you. Morrow, Ken, "Program Relocation," pg. 19-21. Rutledge, E.P., "Disk File Helps You Keep Track of Every­ Discussion and listing for program relocation on the thing," pg. 30-33. 6809-based TRS-80 Color Computer. A utility for the 6809-based Color Computer. Bassen, Howard, "Optimizing High-Resolution Animated Lewandowski, Dennis S., "Let's Soak Up Some Assembly," Games in Extended BASIC — Part 2," pg. 23-26. pg. 38-39. Tutorial on the use of game routines with several demo A second tutorial on 6809 assembly-language programming. listings. Ebbert, Jim, "Is There Any Escape from No Escape?", pg. 42-45. Lester, Lane P., "Motion Picture Programming and the A space-navigation graphics program for the Radio Shack Teacher," pg. 27-28. TRS-80 Color Computer. Animation on the Color Computer. JMCftO

No. 54 - November 1982 MICRO - The 6502/6809 Journal 105 /AlCftO Software Catalog

Name: Adventuie to Name: Astro Blast Name: Frazzle Name: 3D Drawing Board Atlantis System: TRS-80 Color System: Apple II or Apple System: TRS-80 Color System: Apple II Computer II Plus Computer Memory: 48K Memory: 16K/cassette Memory: 48K Memory: 16K Language: Machine Code 32K/disk Language: 6502 Assembly Language: BASIC Hardware: One disk drive Language: Assembly Hardware: Disk Drive (Dual Description: 3D D raw in g Description: This game com­ Hardware: Joysticks DOS 3.2/3.3) Board is a tool for education, bines the best features of Description: Astro Blast is a Description: Muse announces entertainment, or serious proj­ adventure games, arcade space "shoot-em-up” featuring the release of Frazzle, the com­ ects. It helps you draw objects games, and fantasy role- the highest resolution puter game that puts you in in three dimensions, rotates playing games. Adventuie to graphics, lots of color, and the future. The scene begins in them, and changes elevation, A tlantis is a sequel to Odyssey: dramatic sound effects. Wave space, with you commanding a size, and distance. The draw­ The Complete Adventure. The after wave of alien attackers Frazzle Force Ship that is sud­ ings can be saved to tape or struggle between the forces of are a challenge to your joystick denly under attack by Beasties. disk for future use. magic (The High One) versus and fire-button skills. Three Colorful screen graphics show Price: $24.95/cassette the forces of science (The selectable skill levels coupled your position on the ship's $29.95/disk Atlanteans) continues. The with automatic game accelera­ radar screen, the force field Includes complete game uses four methods to tion challenge both novice and surrounding you, and odd­ instruction manual and grab the player's attention: professional. shaped Beasties zooming in. program with samples. high-resolution color graphics Price: $24.95/cassette Your ammunition is pulsating Author: Mark Laessig and animation, sound effects $29.95/disk Energy Probes, which beep and Available: to enhance the action, random Includes full instructions. flash as you release them on Computerware events at all stages of the the screen. You must stop the Author: Ron Krebs Box 668 adventure, and embedded Beasties while avoiding colli­ Available: Encinitas, CA 92024 arcade-like action. sions with them, with the walls Mark Data Products (714) 436-3512 of the force field, and with Price: $40.00 23802 Barquilla Includes one floppy disk. your own ammunition. Sound Mission Viejo, CA 92691 Author: Robert C. Clardy effects include the electronic Name: Computer-Aided hum of a radar monitor and the Instruction for Available: squish of Energy Probes dis­ General Chemistry Synergistic Software solving the Beasties. System: Apple, 830 N. Riverside Drive Commodore PET, Suite 201 Price: $24.95 TRS-80 m Renton, WA 98055 Author: J.C. Nolan Memory: 48K/Apple II Name: INTROL-C/6809 Available: Language: Applesoft/Apple II Compiler System Direct from Muse and Hardware: Apple — DOS 3.3 computer stores nationwide Name: The Business System: FLEX, UniFLEX, PET — 4040 or Bookkeeping OS-9, CP/M 2031 disk drive Memory: 56K System™ Name: K-Razy Kritters Description: A comprehensive Language: C System: Apple II, Apple II System: Atari 400/800 set of 20 programs designed to Description: Powerful C lan­ Plus, Apple IH Memory: 8K supplement a course in general guage compiler develops pro­ Memory: 48K Language: Machine Code chemistry. Each program con­ grams in C for systems run­ Language: Applesoft BASIC Hardware: ROM Cartridge tains 50-70 drills, exercises, ning under FLEX, UniFLEX, or Hardware: Two disk drives, Description: This challenging and problems [approximately OS-9; also as cross-software for video monitor, celestial adventure with ten 24 Vi hours of machine time) CP/M-based development sys­ printer, emulation levels of play begins with three presented in an interactive for­ tems. Full-blown implementa­ mode (Apple HI) command ships. The player's mat. The questions are ran­ tion provides full support of all Description: The Business active command ship attempts domly generated. No computer standard C except initializers Bookkeeping System is a cash to destroy free-falling alien experience is necessary. In­ and bitfields. Written entirely accounting system that in­ patrol "Kritters" descending tended for introductory college in C itself, Introl-C includes a cludes general ledger, cus­ from above. Weapons include level or advanced placement in C compiler, 6809 assembler, tomer activity, vendor activity, standard missiles and super­ high school. linking loader, standard run­ and employee activity. It con­ missiles. If a command ship is Price: $325.00 time library and library tains eleven general ledger destroyed, a sanitation crew Includes four disks for the manager, and unsurpassed reports, five customer activity will remove the wreckage. Apple II, two disks for the code efficiency. reports, four vendor activity Price: $39.95 suggested retail PET, and four or five disks Price: From $400.00 reports, and six employeee ac­ Includes ROM cartridge and for the TRS-80, and Includes diskette, user tivity reports. instruction booklet. complete documentation. manual, one-year Price: $395.00 Author: Torre Meeder Authors: William Butler Includes indexed maintenance/update. Raymond Hough Available: documentation, ten Author: Richard D. Pennington K-Byte Available: diskettes, toll-free softw are Available: 1705 Austin John Wiley & Sons, Inc. support. Introl Corp. Troy, MI 48084 Eastern Distribution Center 647 W. Virginia St. Available: or your local computer Order Processing Dept. Milwaukee, WI 53204 Dakin 5 — Authorized Apple software dealer 1 Wiley Drive dealer (414) 276-2937 Somerset, NJ 08873 JMCRO

106 MICRO - The 6502/6809 Journal No. 54 - November 1982 Super Sale! 40% Off On Ohio Scientific Superboard II A Complete Computer System On A Board Includes full-size 53-key keyboard, video and audio cassette interfaces; SWAP, Modem, sampler cassettes; manual; 8K BASIC-in-ROM, with 8K RAM. Requires 5-V/3 amp regulated DC power supply. 30-day limited warranty. Supply is limited. ONLY $200.00

Plus Sensational Limited-Time Savings On Ohio Scientific C1P Series personal Cleveland Consumer Computers & Components computers, Superboard and C1P 1333 S. Chillicothe Road, Aurora, OH 44202 TO ORDER: CALL 1-800-321-5805 TOLL FREE accessories, spare replacement parts, (Ohio Residents Call 216-562-4136) printers, monitors, integrated circuits,

and other computer-related components. □ SUPERBOARD II, $200.00 To Order □ Send Detailed Catalog/Order Form Call us directly or return order coupon with your check, money order, or Mastercard or Name . Visa Account Number. Orders will normally be shipped within 48 hours after receipt. Address . $100.00 minimum order. t t_i y ______State_Cit -Z ip - Payment by enclosed check or money order or charge to: FREE Sampler Cassettes with each Superboard II and □ MasterCard □ VISA C1P series order! Account #______Expiration Date Taxi (Game), Electronic Equations, Loan Finance, Straight Total Amount Charged or Enclosed $ ______„ and Constant Depreciation, Uneven Cash Flows Tiger Tank, Flip Flop, (Logic Game), Hectic, Black Jack, Ohio Residents Add 5.5% Sales Tax. All Orders Will Be Shipped Insured By UPS Unless Master Mind Requested Otherwise. comp case IS THE PERFECT GIFT FOR THE COMPUTER THAT HAS EVERYTHING

Your investment in a computer is long term. You expect Comp Case is the perfect Christmas many years of reliable service. Comp Case protects gift. Comp Cases are available in your investment when not in use or while transporting it better computer stores in our area, from office or home. Your computer never leaves the Or call 800-848-7548 direct to case — you simply remove the lid, make the electrical receive your Comp Case in connection, and operate. Comp Cases are available for time for Christmas most brands of computers and peripherals.

COMPUTER CASE COMPANY • 5650 INDIAN MOUND COURT • COLUMBUS, OHIO 43213

No. 54 - November 1982 MICRO - The 6502/6809 Journal 107 /AICEO Hardware Catalog

Name: Joystick RS-232C serial ports, a Z8038 Name: Pro-Guard 8” ticipant gets a hand-held System: Apple II Plus F10 I/O interface, and sup­ Floppy Controller keypad to respond to multiple- Description: This joystick is a ports up to three users. It re­ System: Apple III choice questions. Voter 3C joy to use. Its heavier metal quires on-board software and Memory: 2.2 megabytes tabulates the responses and case doesn’t slip or slide like OS drivers. Hardware: 8" Shugart- produces a color bar chart plastic. And the very sensitive Price: $438.11 compatible drives showing the breakdown, while switch is guaranteed for Includes 4K RAM. (Software Description: Pro-Guard 8" keeping a record of the in­ 1,000,000 pushes. Better con­ is optional.) Floppy Controller adds up to dividual station responses. trol and reliability. Available: 2.2 megabytes of removable Price: $595 for interface card Price: $59.95 Gimix Inc. media and provides backup for with programs and manual. Available: 1337 W. 37th PI. Apple profile. IBM 3740 format $125.00 each for polling Datamost, Inc. Chicago, IL 60609 allows 8 " disks to be read on stations with cable and 9748 Cozy croft Avenue (312] 927-5510 other computers, including connectors. IBM mainframes. Chatsworth, CA 91311 Available: |213) 709-1202 Price: $695 Reactive Systems, Inc. Includes DOS, SOS, Pascal, or computer stores Name: The Spectrum 40 North Van Brunt Street Stick CP/M distribution software, Englewood, NJ 07631 cables, manual. System: TRS-80 Color (201) 568-0446 Name: Apple-Mate Available: Hardware: Floppy disk drive Computer Memory: 4K and up Apple Dealers Description: Add this floppy Hardware: Joystick MICRO-D Name: Mini-Video disk drive to your Apple com­ Description: This new joystick SUA, Inc. #82-140 puter. It is 100% compatible System: 6502-based video with the Apple Disk II drive, has a hair-trigger firebutton and swivel-ball type compo­ board and with all Apple software in­ nent stick. The extra-long Memory: 4K RAM/ cluding half-track-protected Name: Programmable cable makes it easier to put 4K EPROM software. Sound Module your joystick where you want Language: Video Display,- System: TRS-80 Color Price: $335.00 it. Red LED indicator reminds Monitor &. Tom Computer Includes cable. you to shut off the Color Pittman's Tiny Memory: 4K and up Available: Computer. BASIC Language: BASIC Quentin Research, Inc. Hardware: Assembled circuit Price: $39.95 plus $2.00 S/H Description: The Program­ 19355 Business Center Dr. Includes 10-foot cable, red board mable Sound Module is a plug­ Description: Add a videc Northridge, CA 91324 LED indicator, joystick, in cartridge for the Color Com­ display to your AIM or othe: [213J 701-1006 firebutton, case, and joystick puter. A separate audio- computer. It will run Ton: control microprocessor and ROM in­ Pittman's witl Name: Freedom 100 Available: side the cartridge combine to the addition of the paralle Description: This is an ASCII Spectrum Projects extend BASIC's vocabulary keyboard, 5V power supply CRT terminal. It has a block 93-15 86 Drive with a versatile sound-effects and video monitor. Thf mode, ten function keys, 15 Woodhaven, NY 11421 system. Complex noises can 2716-character generator wil graphics characters with full (212) 441-2807 Voice be created with short BASIC produce 256 8x8 characters attributes, one-page screen (212) 441-3755 Computer phrases and maintained in­ ASCII upper- and lower-case memory, and separate attri­ dependently of your program, and graphic characters. Th< butes buffer. allowing simultaneous video 44-pin expansion connecto: and audio effects. Price: $595 Name: Disk-O-Tier can be used to add up to 6K o System: All disk-based Price: $139.95 memory or extra I/O ports Available: systems Includes PSM cartridge, The cursor is flashing under Liberty Electronics, USA 5!4" or 8" operating system in ROM, line type. Power requirements 100 Clement Street Description: A convenient and full instructions. 5 volts, 600 MA, 3 watts. San Francisco, CA 94118 desktop holder for diskettes Available: Price: $149.95 that prevents damage by laying Maple Leaf Systems Includes documentation and them flat, but allows full Name: Gimix Intelligent Box 2190 assembled board without Serial I/O visibility of all diskettes. It is Station "C " EPROMs. Processor Board molded of durable NAS smoked Downsview, Ontario Available: plastic, and holds eleven System: Gimix 6809 Canada M2N 2S9 John Bell Engineering, Inc. diskettes. Memory. 128K minimum 1014 Center Street Hardware: S-30 I/O bus Price: $9.50 plus $2.00 San Carlos, CA 94070 board postage Name: Voter 30 (415) 592-8411 Description: This board re­ $19.00 for twin-pack, ppd. System: Apple II duces the number of interrupts Available: Language: BASIC between user terminals and ETS Center Description: Voter 30 is a 4MCRO the host CPU by buffering data Dept. 97 peripheral hardware/software tjansfers between system and Box 651 package for training, market­ users and preprocessing of the 35026-A Turtle Trail ing, and educational uses using data. It has on-board CPU and Willoughby, OH 44094 a group response system for up RAM/EPROM memory, three (216) 946-8479 to 30 participants. Each par­

108 MICRO - The 6502/6809 Journal No. 54 - November 198! ATARI 400/800 Atari 400 and 800 are color-and-sound computers. 6502 is the main processor and ANTIC handles video. Atari 400 has a membrane keyboard and Atari 800 has a full-size typewriter keyboard.

Peripherals may include up to four disk-drive units, a cassette unit, printer, and the 850 interface module. Four programmable controller ports handle joysticks, paddles, light pens, and other accessories.

Sophisticated graphic capabilities include: 256 colors (16 may be displayed on the screen at once), 17 graphic modes (6 character and 11 map), high-resolution graphics (up to 320 X 192), and powerful player/missile graphics.

Some Useful Memory Locations on the Atari 400/ 0 0 /8 0 0 4 I R A T A AMCftO Page 0 Locations:

Hex Dec Length Name Description 0010 016 1 PQKMSK IRQ mask

0012 018 3 RTCLOK Real time clock #10 Sheet Data 018 is hi order 0041 065 SOUNDR Noisy I/O flag 0042 066 CRITIC Critical I/O flag 004 D 077 1 ATRACT Attract mode flag 0052 082 1 LMARGIN Left margin 0053 083 1 RMARGIN Right margin 0080 128 2 * LOMEM Buffer used to tokenlze line of BASIC 0082 13Q 2 * VNTP Variable name table start 0084 132 2 * VNTD Variable name table dummy end 0086 134 2 * VVTP Variable value table start 0088 136 2 * STMTAB Statement table 008A 138 2 * STMCUR Current statement pointer 008C 140 2 * STARP String and array area 008E 142 2 * RUNSTK BASIC’s software stack 0090 144 2 *MEMTOP Top of memory used by BASIC program 00BA 186 2 STOPLN Line number of most recent stop or error 00C3 195 1 ERRSAV Error number causing TRAP branch 00CB 203 7 Available for user machine-language programs 0000 21.2 2 Value return from machine language to BASIC

* Indicates location is a vector

ANTIC Commands (Display List) ANTIC Commands (Display Modes) Blank line commands: Command is (# lines + 1)*16 Scan Ex.: Blank 8 lines is (8 + 1)*16, or $70 = dec. 144 Lines Per Mode Jump instruction: $01 = dec. 1 (2-byte instruction) Mode Horlz. Char/Map IR BASIC Pixels Line Colors Mode Jump on vertical blank = $41 = dec. 65 (2-byte instruction) 02 0 40 8 1.5 C Display line instruction is equal to the IR mode number 03 40 10 1.5 C ($02-$0F). 04 40 8 c To set special features, add these values to the instructions:05 40 16 . 5 . c 06 1 20 8 5 c Add 07 2 20 16 5 c Hex Dec. For 08 3 40 8 4 M 09 4 80 4 2.- M 10 16 Horizontal scroll enable 0A 80 4 4 M 20 32 Vertical scroll enable 5 0B 6 160 2 2 M 40 64 Load memory scan (makes it a 2-byte OC 160 1 2 instruction) M 0D 7 160 2 4 M 80 128 Display list interrupt enable 0E 160 1 4 M Note: Display list interrupt can be enabled on any command,OF 8 320 1 1.5 M but scrolling and load memory scan can be enabled only on display commands

JSNCftO Data Sheet #10 Compiled by Paul Swanson ATARI 400/800

COLOR VALUES: 0 Black-gray-white Default colors (SETCOLOR values): Joysticks: 1 Burnt Orange 0,2,8 (Orange) 14 2 Orange 1,12,10 (Light green) 3 Red-orange 2,9,4 (Dark blue) 10 4 Red 3,4,6 (red) 5 Purple 4,0,0 (Black) 6 Blue-purple 11- 15 7 Blue 8 Blue 9 Gray-blue For COLORS: 10 Turquoise POKE hue*16 + luminance into COLx 11 Aqua For SOUND: 13 12 Green POKE frequency into AUDFx 13 Yellow-green POKE distortion*16 + volume intoAUDCx 14 Orange-green 15 Orange

Hardware Registers and Shadows

Address Shadow (R)ead or Address Shadow (R)ead or Hex Dec Hex Dec Name Description (W)rlte Dec Hex Dec Name Description (W)rlta COLORS: D012 53266704 02C0COLPMO Player-missile 0 W ! CONTROLLER PORTS. D013 53267705 02C1 COLPM1Player-missile 1 W D0105326- 0284644TRIGO Joystick trigger 0 R 001453268 02C2706 COLPM2 Player-missile 2 W D01153265 0285 645Joystick TRIG1 trigger 1 R D015 53269707 02C3COLPM3 Player-missile 3 W D012532660286646TRIG2 Joystick trigger 2 R D016 5327002C4708COLPFO Playfield 0 W D0135326"' 0287 647Joystick TRIG3 trigger 3 R D017 5327102C5709 COLPF1 Playfield 1 W D200 537600270 624POTO Paddle 0 R D018 53272710 02C6 COLPF2Playtield 2 W D20153761 0271625POT1 Paddle 1 R □01953273 02C7711COLPF3 Playfield 3 W D202537620272 626POT2 Paddle 2 R D01A 5327402C8712COl BK Playfield background W D20353763 0273 627 POT3 Paddle 3R D20453764 0274628POT4 Paddle 4 R SOUND: D20553765.0275629 POT5 Paddle 5 R D200 53760 AUDF1 Channel 1 Frequency W D20653766 0276 630Paddle POT6 6 R D201 53761 AUDC1 Channel 1 Control W D2075376’ 0277POT7 631 Paddle 7 R D20253762 AUDF2 Channel 2 Frequency W D20853768 ALLPO Pot port state R D203 53763 AUDC2 Channel 2 Control W D20B53771 POTGO Start pot scan W D20453764 AUDF3 Channel 3 Frequency W D30054016 0278PORTA 632 STICK0 R D205 53765 AUDC3 Channel 3 Control W 0279 633PORTA STICK1 R D206 53766 AUDF4 Channel 4 Frequency W 540’ S PORTA Direction register W D20753767 AUDC4 Channel 4 Control W 54017 0280634PORTB STICK2 R D20853768 AUDCTL Audio Control W 0281 635 PORTB STICK3 R 54017 PORTB Direction register W PLAYERS AND MISSILES: 54018 PACTLPort A control W D00Q53248 HPOSPO Horiz. pos. Player 0 W 54019 PBCTL Port B control w D00153249 HPOSP1 Horiz. pos. Player 1 W D002 53250 WPOSP2 Horiz. pos. Player 2 W iLLANEOUS: D00353251 Hi 'OSP3 Horiz. pos. Flayer 3 W 53279 CONSOL Consol switches R D00453252 HPOSMO Horiz. pos. Missile 0 W 53279 CONSOIKeyboard speaker W D005 53253 HPOSM1 Horiz. d o s . Missile 1 W 53770 RANDOM random number gen. R H00653254 HPOSM2 Horiz. pos. Missile 2 W 53775 0232SKCTI 562 Serial port control W D007 53255 HPOSM3 Horiz. pos. Missile 3 w 54283 VCOUNT Vertical line counter R D008 53256 SIZEP0 Size of Player 0 w 542840234 564PENH Light pen horiz. pos. R D0095325:' SIZEP1 Size of Player 1 w 54285 0235PENV 565 Light pen vert. pos. R >00/*53258 SIZEP2 Size of Player 2 w )00B53259 S1ZEP3 Size of Player 3 w D00C 33260 SIZEM Size of all Missiles w Collision Registers for Players and Missiles D40754279 PMBASE Player-missile base w D000 53248 M0PFMissile 0 - playfield R D001 53249 M1PFMissile 1 - playfield R D002 53250 M2PFMissile 2 playfield R CHARACTERS: D003 53251 M3PFMiss-'le 3 - playfield R Character control D401 6427302F3755CHACT1 w D00 53252P0PF Player 0 - playfieldR Horizontal scroll D40454276 HSCROL w D005 53253 P1PFPlayer 1 - playfield R D405 54277 VSCROL Vertical scroll w D006 53254P2PF Player 2 - playfield R Character set base D409 5428102F4756CHBAS w D00753256P3PF Player 3 - playfieldR D00853256 M0PLMissile 0 - player R CONTROL REGISTERS: D00953257 M1PLMissile 1 - player R D01B 53275026F623PRIOR Priority Select w D00A 53256 M2PLMissile 2 - player R D01D 53277 GRAC L Graphics control w D00B 53259 M3PLMissile 3 - player R D20E 537740 0 1 0 016IRQEN IRQ enable w DOOC 53260 P0PLPlayer 0 - player R D402 54274559 0230DLISTL Display list ptr., low w D00D53261 P1PL Player 1 • player R D403 542750231560DLISTH Display list ptr., high w D00E 53262 P2PLPlayer 2 - piayer R D40E 54286 NMIEN Non-maskable int. enabl. W DOOF 53263 P3PLPlayer 3 - player R JMCftO" Data Sheet #10 Advertiser’s Index Aardvark Technical Services, Ltd...... 18 NATIONAL ABM Products...... 98 Advanced Operating Systems...... 17 ADVERTISING Anthro-Digital Software...... 8 Apex Co...... 84 Apple Tree Electronics...... 29 REPRESENTATIVES Ark Computing...... 47 Artsci, Inc...... IEC Aurora Software Associates...... 21 Bedford Micro Systems...... 8 WEST COAST CGRS Microtech...... 24 Cleveland Consumer Computer Components...... 107 The R.W. Walker Co., Inc. Collegiate Microcomputer...... 77 2716 Ocean Park Boulevard Computech...... 15 Suite 1010 Computer Case Co...... 107 Computer Mail Order...... 64-65 Santa Monica, California 90405 Computer Marketing Service...... 78 (213) 450-9001 Computer Science Engineering...... 104 serving: Washington, Oregon, Idaho, Montana, Wyom­ Datamost...... 33, 34, 90, 92 ing, Colorado, New Mexico, Arizona, Utah, Nevada, Decision Systems...... 101 California, Alaska, and Hawaii (also British Columbia Digicom Engineering, Inc...... 68 and Alberta, Canada). Digital Acoustics...... 12 D&N Micro Products, Inc...... 69 Eastern House Software...... 61 Excert, Inc...... 48 Execom Corp...... 101 MIDDLE ATLANTIC AND Genesis Information Systems Inc...... 39 Gimix, Inc...... 1 SOUTHEASTERN STATES Hudson Digital Electronics Inc...... 40 Interesting Software...... 73 Dick Busch Inc. Kilo Corp...... 54 Richard V. Busch Eleanor M. Angone Leading Edge Electronics...... BC 6 Douglass Dr., R.D. #4 74 Brookline Logical Devices...... 95 Lyco Corp...... 58 Princeton, NJ 08540 E. Atlantic Beach, NY 11561 MICRObits (Classifieds)...... 28, 30, 31 (201) 329-2424 (516) 432-1955 MICRO INK...... 32, 82, 84 serving: New York, Pennsylvania, New Jersey, Dela­ Micro Motion...... 68 ware, Maryland, West Virginia, Virginia, D.C., North Microsoft Consumer Products...... IBC Carolina, South Carolina, Louisianna, Tennessee, Mis­ Micro-Ware Distributing Inc...... 102 sissippi, Alabama, Georgia, and Florida. M.M.S...... 76 Modular Systems...... 77 Olympic Sales Co...... 21 Optimal Technology...... 95 Orion Software...... 6 NEW ENGLAND AND PEEK(65]...... 73 Perry Peripherals...... 39 ALL OTHER TERRITORIES Pretzelland...... 37 Pterodactyl Software...... 102 Kevin B. Rushalko Quentin Research...... 52 Peterboro, New Hampshire 03458 R C Electronics...... 71 (603) 547-2970 Sensible Software...... 89 SGC...... 25 serving: Maine, New Hampshire, Vermont, Massachu­ 6502 Program Exchange...... 85 setts, Rhode Island, Connecticut, Ohio, Kentucky, Okla­ Skyles Electric Works...... 74 homa, Arkansas, and Texas (also any other territories Softel...... 100 not listed above). Softronics...... 4 Software Farm...... 91 Spectrum Systems...... 98 Star Micronics...... 26 ADVERTISING MANAGER Tau Lambda...... 15 Universal Data Research...... 104 Cathi Bland Versa Computing, Inc...... 22 address materials directly to: Victory Software...... 11 Voicetek, Inc...... 63 MICRO INK, Advertising John Wiley & Sons...... 2 34 Chelmsford Street XPS, Inc...... 104 Chelmsford, Massachusetts 01824 (617) 256-5515 MICRO INK is not responsible for claims made by its advertisers Any complaint should be submitted directly to the advertiser. Please also send written notification to MICRO. ,

No. 54 - November 1982 MICRO - The 6502/6809 Journal 111 Next Month in MICRO

Commodore Feature • SuperPET’s Waterloo ASCII Character Set — A • It’s All Relative — CBM Disk Techniques, Part description of the ASCII character set used in the 1 — An explanation of how to get the most from Waterloo interpreters supplied with the SuperPET. CBM’s powerful disk operating system. Examples • BASIC Squeeze — A routine to squeeze out are drawn from a well-written mailing list imbedded blanks, line separators, and comments package. for a BASIC program. • VIC Jitter Fixer — Add this routine to your • Microcomputers in the Chemical Engineering programs to help get reliable readings from your Curriculum, Part 2 — Analog transducers in a VIC paddle, joystick, and light pen registers. digital world. And more... • Add a BASIC Line Delete Command — A BASIC Macro Function for Cursor Control BASIC line delete command allows the user to on the OSI delete blocks of BASIC program lines at the touch Applesoft GOTO/GOSUB Checking Routine of a single key. The article shows how to Logic Instructions of the 68000 implement this command, in machine language, Atari Graphics on Commodore computers, including the VIC-20. • SOUP — An efficient compare program for machine-language program files on Commodore New Columns! disk; Uses BASIC 4.0 disk commands, but is CoCo Bits — for the Color Computer otherwise compatible with other Microsoft From Here to Atari returns BASICS.

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 for _t 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, No______Australasia, New Zealand 72.00 Expiration date ______* Airmail subscriptions accepted for only 1 year. For U.S. and Canadian 2-year rates, multiply by 2. Name ______Address ______Job Title: ______City/State______Zip Type of Business/Industry:

112 MICRO - The 6502/6809 Journal No. 54 - November 1982 Turn your Apple into the world’s most versatile personal computer.

The SoftCard™ Solution. S o ftC a rd BASIC included. A powerful tool, Basic Compiler and Assembly Lan­ turns your Apple into two computers. BASIC-80 is included in the SoftCard guage Development System. Ail, more A Z-80 and a 6502. By adding a Z-80 package. Running under CP/M, ANSI powerful tools for your Apple. microprocessor and CP/M to your Standard BASIC-80 is the most Seeing is believing. See the S oftC ard Apple, SoftCard turns your Apple into powerful microcomputer BASIC in op era tion at yo u r M ic ro s o ft o r A pple a CP/M based machine. That means available. It includes extensive disk I/O dealer. We think you'll agree that the you can access the single largest body statements, error trapping, integer SoftCard turns your Apple into the of microcomputer software in exist­ variables, 16-digit precision, exten­ world's most versatile persona! ence. Two computers in one. And, the sive EDIT commands and string func­ co m p u te r. advantages of both. tions, high and low-res Apple graphics, Complete information? It's at your PRINT USING, CHAIN and COM­ Plug and go. The SoftCard system dealer's now. Or, we'll send it to you starts with a Z-80 based circuit card. MON, plus many additional com­ and include a dealer list. W rite us. Call Just plug it into any slot (except 0) of mands. And, it's a BASIC you can us. compile with Microsoft's BASIC your Apple. No modifications required. Com piler. SoftCard supports most of your Apple SoftCard is a trademark of Microsoft. Apple ll and Apple II Plus are registered trademarks of Appie M ore languages. W ith SoftCard and peripherals, and, in 6502-mode, your Computer. Z-80 is a registered trademarkof Zilog, Apple is still your Apple. CP/M, you can add Microsoft's ANSI Inc. CP/M is a registered trademarkof D'gitai Standard COBOL, and FORTRAN, or Research, Inc. CP/M for your Apple. You get CP/M on disk w ith the S oftC ard package. It's a powerful and simple-to-use operating system. It supports more software than any other microcomputer operat­ /HfCRO SO fT ing system. And that's the key to the V CONSUMER^ PRODUCTS r versatility of the SoftCard/Appie. MICROSOFT Inc. 10700 Northup Way • Bellevue, WA 98004 THE PROWRFTER COMETH. (And It Cometh On Like Gangbusters.)

Evolution. It’s inevitable. An eternal verity. Just when you think you’ve g o t 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-80:80 cps, for 46 full lines per minute throughput. PROWRITER: 120 cps, for 63 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, sm ooth 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. PROWRITER: One full year, from Leading Edge. PRICE H eh. heh. Distributed Exclusively by Leading Edge Products, Inc., 225 Turnpike - Street, Canton, M assachusetts 02021. Call: toll-free 1-800-343-6833; or in Massachusetts call collect 16171828-8150. Telex 951-624. LEADING EDGE. For a free poster of “Ace ” /Pro writer's pilot! doing his thing, please write us.