NO. 35 $2.00 APRIL 1981

'ErI . : 3 f ; l i T 'flj iEJKUOFHH 2 :TKBflRLE3 : 0 3 3 ^ 3 5 » J : H T O Q The Perfect Fit The Micromodem II data communications system The other part of the Micromodem II datacomm and the Apple II* computer. What better combination to system is a Microcoupler which connects the maximize the capabilities of your personal computer! Micromodem board and Apple II to a telephone line. This popular direct connect modem can transmit The Microcoupler gets a dial tone, dials numbers, data between an Apple II and another Apple II, a answers the phone and hangs up when a transmission terminal, another , minicomputer or is over. There are none of the losses or distortions even a large time-sharing computer anywhere in North associated with acoustic couplers. The Microcoupler is America. The Micromodem II has unique automatic compatible with any North American standard dialing and answer capabilities which further increases telephone lines and is FCC-approved for direct the communications possibilities between the Apple II connection in the U.S. It works with standard dial and another computer or terminal. phone service orTouch-tone service. You can send and/or receive messages or data The Micromodem II is completely compatible with when you are out of your office, home or out of town. Bell 103-type modems. Full and half-duplex operating Your branch business locations can communicate with modes are available as well as speed selectable each other regarding inventory and other matters over transmission rates of 110 and 300 bps. the phone. Or you can communicate with friends Why not increase your Apple M’s capabilities by across the country. And you can access information outfitting it with the sophisticated Micromodem II data utilities like the SOURCE for various business and communications system? The Micromodem II is personal applications. available at retail computer stores nationwide. For the The Micromodem II consists of two parts. One part store nearest you, call or write: includes the printed circuit board which holds the Micromodem II, ROM firmware and the serial interface The board plugs directly into the Apple II providing all the functions of a serial interface card plus ©Hayes programmable auto dialing and auto answer Hayes Microcomputer Products Inc. capabilities. The on-board ROM firmware enables the 5835 Peachtree Corners East, Norcross, Georgia 30092 (404) 449-8791 Micromodern II to operate in any of three modes to ™ Micromodem II Is a trademark of Hayes Microcomputer Products, Inc. perform different tasks-terminal mode, remote console ^ 'Apple II is a registered trademark of Apple Computer Inc. and program control mode. The Micromodem II can also be used with the Bel* & Howell computer.

MADE IN USA hook c

Up to 5 million bytes of on-line storage ...... _ floppies. And, without stealing power from your Apple II*! Your business is more complicated Technically Inclined? than anyone realizes. Or, you’re The card operates under Apple DOS growing faster than expected. Does 3.1 or 3.2, with 48K Apple II. It has full that mean you have to trade in your compatabllity with mini-disks. Handles reliable Apple II for a bigger, more from one to four 8” floppy drives. costly system? Or, is there a simple, Single or double density disks use reasonable solution? DMA transfer techniques . . . with ou bet there is, now that Programma high speed transfer of half million International has introduced the bits per second. Teeter Electronics PRODISK control­ ler card. Priced Right The amazing PROOISK controller PRODISK is like having the storage card is priced at $645.00. And it’s capability of ten Apples! Because a tax deductible business expense. with just four 8" drives, its Its low price works out to be even on-line storage capacity goes to a lower! Same for the special business-slze 5 million bytes. Plus it Programma 8" floppy disk drives delivers high-speed transfer of a half (800 or 850 Shugart equivalent). PRODISK million bits per second. Example: two single sided drives, With storage and speed like that you priced at $1549.00. can really get a handle on your entire Get big business storage capacity business. And, It won’t Interfere with for your small business right now your Apple's operation. You see, the . . . with PRODISK, available at new PRODISK card Is powered from your better computer stores, or the drives, not the Apple. Since there’s direct from Programma Inter­ no significant power drain, other national. cards can be used with no problem. B ig power for small business

ernational ln< Naomi Street C A 9 1 5 0 4 2 4 0

and Apple DOS are trademarks of Apple Computer, Inc.

No. 35 - April 1981 MICRO - The 6502 Journal 1 A BRILLIANT FUTURE FOR YOUR AIM-65 WITH THE BANKER MEMORY

: i

Your 36K of free address spac,e is the AIM's most valuable and limited re­ source. With today's large capacity RAM boards, ROM boards, disk systems, video boards, and other expansion accessories it is easy to deplete this resource before the applica­ tion requirement is satisfied. MTU has solved this problem.

THE BANKER MEMORY contains 32K of RAM, 4 PROM sockets for 2716/2732/2332, a PROM programmer, 40 bits of parallel I/O, and 4 timers from two 6522 I/O chips. Addres°sing is extremely flexible with the RAM independently addressable in 4K blocks, PROM's independently addressable, and I/O addressable anywhere on a 64 byte boundary (even in AIM’s I/O area at AXXX by adding a single jumper to the AIM). This may sound familiar, but read on! Unlike other AIM compatible memory boards, THE BANKER MEMORY has on-board bank- switching logic! The four 8K blocks of RAM plus the 4 PROM sockets make up 8 resources, each associated with a bit in an Enable Register. Through this Enable Register resources may be turned on and off under software control. When a resource is off, its address space is freed for other uses. You can even put BANKER resources at the same address and switch among them for virtually unlimited RAM and PROM expansion! You can even have multiple page zero's and stacks! Do you need 160K byte of memory? It only takes 5 of THE BANKER MEMORY boards and you end up with 5 page zeros and stacks to boot! There’s more! The BANKER MEMORY also incorporates 18 bit addressing which allows for the 256K address spaces of the future. RAM, PROM, and I/O each has its own full 18 bit address decoder which allows these resources to be in different 64K banks. This board and other MTU products, such as our 320 by 200 dot VISIBLE MEMORY and Floppy Disk Controller with 16K DMA RAM, can turn your AIM into a truly powerful 6502 computer that far surpasses the packaged systems in functional performance. INTRODUCTORY SPECIAL K-1032-1 32K BANKER MEMORY FULLY ASSEMBLED AND TESTED $395.00 ($450.00 as of March 1, 1980) or the K-1032-2 16K RAM only with bank switching and 18 bit address bus only $295.00 Isn’t it time you took a closer look at MTU — we offer you power now with an eye to the future. WRITE OR CALL TODAY FOR OUR 48 PAGE FALL 1980 6502 CATALOG International requests include $1.00

VISA and MASTERCARD accepted

Photo credit: l l l l Micro Technology Unlimited l l l l 2806 Hillsborough Street SUPERNOVA CRAB NEBULA: P.O. Box 12106 Palomar Observatory, Raleigh. NC 27605. U.S.A. California Institute of Technology {919) 833-1458 NO. 35 APRIL 1981

THE 6502JOURNAL STAFF

Editor/Publisher ROBERT M. TRIPP CONTENTS Associate Publisher RICHARD RETTIG - S-C ASSEMBLER MODIFICATIONS Associate Editor I Enhance the usefulness of the S-C assembler for the Apple MARY ANN CURTIS By Ned W. Rhodes Special Projects Editor . o PRINT USING FOR THE PET MARJORIE MORSE \ o Popular program adapted to run on any PET or CBM machine Art Director By David Malmberg GARY W. FISH . - MEMSEARCH FOR THE AIM 65 Typesetting 1 / Scan through memory using this machine language utility program EMMALYN H. BENTLEY By Bob Kovacs Advertising Manager JOYSTICKS FOR THE OSI C4 L. CATHERINE BLAND C.O Make your own joysticks Circulation Manager By Charles Platt CAROL A. STARK 0 _ APPLE MEMORY MAPS, PART I MICRO Specialists C . f Draw your own memory maps and display them APPLE: FORD CAVALLARI By Peter A. Cook PET: LOREN WRIGHT O T SYM TIME-REMAINING TIMER OSI: PAULGEFFEN 0 ( Measure elapsed time and create an “alarm” for your SYM Comptroller By Ralph Orton DONNA M. TRIPP . 0 OH NO — IT’S GARBAGE COLLECT! Bookkeeper Find out what garbage collect is, and how to avoid it KAY COLLINS By Gordon A. Campbell „ ADD A LIGHT PEN TO YOUR MICRO 0 1 Hardware details to install a light pen on any 6502 W C ftO jS published monthly by: MICRO INK, Inc., Chelmsford, MA 01824 By Peter Alan Koski Second Class postage paid at: Chelmsford, MA 01824 and additional INTEGER BASIC INTERNALS offices O O A sorted list of Apple Integer BASIC memory locations Publication Number: COTR 395770 ISSN: 0271-9002 By Glenn R. Sogge ATARI ERROR MESSAGES Subscription Rates: Per Year 0%7 English language versions of Atari’s number-coded error messages U.S. By David P. Allen through March 31 $15.00 thereafter $18.00 _ n BASIC PROGRAM CONVERTER BETWEEN SYM AND KIM Foreign surface mail $21.00 Air mail: / y Transfer BASIC programs from SYM to KIM, and vice versa Europe $36.00 By Lee Chapel Mexico, Central America $39.00 Middle East, North Africa $42.00 South America, Central Africa $51.00 DEPARTMENTS South Africa, Far East, Australasia $60.00 5 Editorial — Robert M. Tripp 6 Letterbox For back issues, subscriptions, change 15 MICRO Club Circuit of address or other information, write to: MICRO 47 New Publications P.O. Box 6502 51 MICRO Dealers Chelmsford, MA 01824 55 PET Vet — Loren Wright or call 617/256-5515 77 Challenges — Paul Geffen Copyright© 1981 by MICRO INK, Inc. 81 Microbes and Updates All Rights Reserved 83 The MICRO Software Catalog: XXXI 89 6502 Bibliography: Part XXXI — William R. Dial 95 Advertisers’ Index

No. 3 5 - April 1981 MICRO - The 6502 Journal 3 16K RAM Expansion Board for the Apple II* $195.00 • expands your 48K Apple to 64K of programmable memory • works with Microsoft Z-80 card, Visicalc, LISA ver 2.0 and other software • eliminates the need for an Applesoft* or Integer Basic ROM Card • switch selection of RAM or mother board ROM language • includes installation and use manual • fully assembled and tested

Visa and MasterCard accepted Shipping and handling will be added unless the order is accompanied by a check or money order VISA N.C. residents add 4% sales tax

* Apple II and Applesoft are trademarks of Apple Computer, Inc. ANDfiOMEDA P.O. Box 19144 Greensboro, NC 27410 (919) 852-1482

"Formerly Andromeda Computer Systems

4 MICRO - The 6502 Journal No. 35 - April 1981 and lies flat when open to make it easy only a few wanted to ' ‘print the best to use. material without regard to micro­ computer''; Other books in the MICRO/Apple more wanted to "publish an Apple /AlCftO series will include reprints, original supplement or quarterly” or "pub­ articles, new reference works, and lish a monthly Apple magazine"; more. This will permit us to present Editorial most chose to "increase the size of various types of material which do not MICRO to accommodate additional work well in a magazine format: long Apple material without reducing articles or listings, good articles of the coverage of the other micros." limited scope, and so forth. Staff and Stuff This reader feedback and our in- We are looking for additional house staff discussions agree, and the material for other major microcom­ decision has been made to expand Most readers probably never read puters to support similar books for the MICRO. Starting with the June 1981 the staff listing on the Table of PET, OSI, AIM, SYM, KIM and Atari. If issue, there will be “extra" pages Contents page, but those who do will you have material which you may not devoted to Apple articles and adver­ note that since the beginning of this have submitted because you felt that it tisements. The number of pages will be volume, (June 1980) we have added an was not suited to a magazine presenta­ determined partially by the extra adver­ associate publisher, special projects tion, please consider it for one of the tising required to cover the additional editor, art director, advertising books. If you have a complete manu­ production, printing and postage manager, three micro specialists and a script for a 6502-based book, or even costs—without requiring an increase in typesetter. This improved staffing just the idea for one, please contact us. either the single copy or subscription permits MICRO to deliver a better pro­ We may be interested in publishing it price. There will be at least 16 extra duct each month and to undertake a and distributing it to the 6502 world pages, and possibly 32 pages. This number of other projects as well. through our dealer network. expansion will permit us to provide One major undertaking is book timely Apple coverage while maintain­ publishing. A series of Apple books is ing our policy of serving the entire 6502 under way, with the first, MICRO/ An Apple Solution community. Apple, Volume 1, to be released April 1. This collection of Apple articles from The February editorial addressed past issues of MICRO is intended for the problem of “Too Many Apples" the beginner-to-intermediate Apple —more Apple articles on a regular basis user. All of the material has been re- than we can incorporate in MICRO edited, re-typeset and many articles without overwhelming the other have been updated by the original 6502-based . The reader authors and/or the MICRO staff. All response may be summarized as: programs have been re-entered, listed and tested. They are provided on a no one favored "no change" or diskette which is an integral part of the "print the extra Apple material in Robert M. Tripp book. The 224-page book is wire-bound book form”; Editor/Publisher

About the Cover— Cruising Down the River... entered into the computer, manually in a simple system or automatically in a more Imagine yourself cruising down the river on advanced one, the display could change to r n r ~ i NORTH TIME: IU37 the Delta Queen. To navigate rivers you provide the current map information. ! I /f, HEADI MG; IB7 need maps and charts. Currently these are I j | OJHBEWT: 5 available as printed material, very detailed In addition to the pure mapping \ \ SPEED: IE CEPTH: U3 and very accurate. Accurate? Well, the chart function, the computer could provide a was accurate when it was made, but how wealth of other information. Time of day, ___ <5: FEATURES: OHIO Rl'JEB long ago was that? And what changes have current speed, vessel speed, direction, rate \ Lamm bridge occurred since then? of fuel consumption, estimated time to \ <3> misty is m ® S \ <^> GEH. HOSPITAL destination or check point, and other \S: \ How about a computer displayable map operating parameters could be displayed. —one that could be updated continuously Automatic radio tracking equipment could by whateyer authority has the charting provide accurate positioning information. responsibility, the U.S. Coast Guard or the Depth information in coastal waters could U.S. Geodetic Survey? A diskette could be be continuously updated and modified as a generated which contains the latest infor­ function of tide tables. The possibilities for mation along a particular route. It could this type of microcomputer application are Screen display on this month’s cover provide — whatever level of detail is required; almost limitless. from the human point of view. from an overview as pictured on the cover, to the detail normally provided in naviga­ But for now, I guess I'll just keep drifting. (Cover photo by Michael Rakip) tional charts. As the position of the vessel is

No. 35 - April 1981 MICRO - The 6502 Journal 5 Dear Editor: Dear Editor: I appreciated the letter by Robert V. Davis, MICRO, January 1981, but his I'd like to share the following infor­ letter didn't take full advantage of mation in response to your Editorial in /AlCftO OSI's BASIC-in-ROM accuracy and he the January 1981 issue (MICRO Goes doesn't solve the absence of the PRINT to School). Letterbox USING command for anything but whole dollars. Our math department was given the Dear Editor: That would be trouble if you're job of learning how to operate the com­ working in any accounting program puters, then teach our students, then First, I don't know of any available where you need to keep track of pen­ teach any interested non-math printed material that has been as nies. The subroutine I am enclosing teachers. Granted, year #1 was trial and interesting and informative as will print out amounts in dollars and error. We spent many hours on our own "MICRO Magazine". cents from $0.00 to $167,772.15 with time getting our act together. full accuracy and amounts close to one Many little problems related to pro­ gramming have been removed due to billion with 7 + decimal accuracy Several members of the department the care and testing that is done, by before going into scientific notation formed a core group which learned how writers, proofreaders, editors and by errors. Since Michigan income tax asks to program and joined area users the production people. The quality is that you don't round off at one place, groups, and then brought this informa­ outstanding as witnessed by the brevity this program would keep you out of tion back to the rest of the department of your "M icrobes” pages. trouble with the taxman. Also by for general use. We subscribe to the Now, the second part—I feel that I simply changing the value of H in line leading magazines for help and greatly have received more value from this 20000 by a power of ten, and making appreciate MICRO'S help with the source than it has cost. Therefore, I the opposite change of T, you can set Club Circuit. offer this little tip for Apple n owners up for printing in the thousandth place By using small ads, we have fortunate enough to have Disk n. or any other decimal place you wish contacted and exchanged ideas, pro­ Perhaps I am lazy, but my fingers get with 7 + decimal accuracy. This grams, and student booklets with tired of constantly typing "catalog” routine will also increase the amount teachers in several states. There is a following the end of a program. I know of decimals printed with any other vast network out there of independent that many programs exist to change the disk command to cat or just plain 'C'. BASIC computer. math teachers which the computer will They are good, but why not insert these bring together. 50 INPUT'AMOUNT OF lines in place of "END" statement in This year, in our lab, we are more the programs used frequently? CASH” ;B: A = B organized. Lab slots are assigned on a 60 PRINT“ BALANCE";:GOSUB week-to-week basis and we have lab XXO IN PUT" WANT DISK 20001? assignments sheets for the students, CATALOG (Y/N) ?";A$ 70 REM REST OF PROGRAM that they receive before they enter the XX1 TEXT:HOME 19999 PRINTING SUBROUTINE lab. The sheets contain information as XX2 IF A$ = "Y ” THEN PRINT 20000 H = 100:T = 1000: to what programs they should work on, D$;“ CATALOG” G = 0:C = A:IF A > T *9 what section of particular programs, Your program is still in memory THEN G = T*INT(ATT):C = what disks to use, which computers to should you choose to re-run it. Or with A - G + T be worked on, if the printer is to be the catalog menu in front of you, a 20010 PLACE= INT(LOG used, etc. Thus, any computer center change to a different program is quite (H)/LOG(10) + .5):IF A < 1 means preparation by the teachers simple. THEN 20070 involved if the center is to achieve its 20020 A$ = STR$(INT(H* C + .5)): goals in the educational environment. Another simple little tip is to type ACS = RIGHT$(A$,PL): And with the availability of data base '' VTAB < 1 THROUGH 20 > ” to move B = LEN(A$) the cursor up to the program desired, programs, the department has its grades, enter your command, and use the right 20030 A$ = LEFT$(A$,B-PL) + orders, inventory, small supplies, etc., arrow key to trace over the program +AC$:IF G > 0 THEN on disk. listing, hit return, and your command A$ = STR$(G/T) + MI D$ is executed. Be sure that you don't (A$,3) Our computer center has taken a lot leave any part of the program type or 20040 PRINT TAB(20-LEN(A$))“ $ of effort, but it is well worth it. If any sector information before tracing over ” ;A$:RETURN teacher or department requires more the program title. Those little left­ 20060 REM AMOUNTS LESS information, they may write to Apple overs produce nice error statements. THAN 1 Bit’N Pieces Educators Group c/o our Thanks again for an excellent 20070 A$ = STR$(INT(A*H school. publication. I look forward to seeing it + .5)/H):IF each month for it makes the Apple n LEN(A$)

6 MICRO - The 6502 Journal No. 35 - April 1981 S-C Assembler Modifications

The usefulness of the S-C Listing 1 assembler for the Apple can be 1000 ★ enhanced with the addition of a 1010 ★ 1020 ★ command to automatically 1030 ★ 1040 * generate line numbers for the 1050 k programmer while he is entering 1060 * 1070 k the source code. lo a o k ROUT I ME TO DO'AUTO NUMBERING 1090 k 1 1 00 ★ 1 1 10 .OR S ID 2 I AFTER MULTIPLY ROUTII Ned W. Rhodes 11 20 k 1 1 30 k 2001 No. Kenilworth St. 11 40 * DO WE DO IT ?? Arlington, Virginia 22205 1150 * 11 60 k. I 02 I - 2C 70 1 0 1 1 70 A MUM B IT FLAG TEST AUTO-FLAG The S-C assembler is one of the many ID 2 4 - 10 27 1 1 80 BP I. E XIT NOT TURNED ON assemblers available for the Apple 1026- 4E 70 1 D 11 90 tS R FLAG CLEAR THE FLAG 1 0 2 9 - E0 00 1200 CPX #0 IF NOT IN COLUMN 1 computer system. The original version ID 2 B - DO 20 1210 BNE EXIT THEN DON'T DO IT of the S-C assembler was cassette-based 1 220 * 1230 * and performed well for the user with a 1240 * PRINT IT OUT , AND STORE IN minimal system. Subsequent versions 1250 * INPUT BUFFER of the assembler have been disk-based. 1260 k 1270 k With the announcement of version 3.2, ID 2 D - 20 5C ID 12U0 JSR CONV4 CONVERT LIN E NUMBER previous owners were invited to 1290 ★ 1300 ★ upgrade their assemblers for $12.50. 1310 k INCREMENT TH = LIN E NUMBER This I did, and along with my upgrade 1320 k kit came information on how the S-C 1330 ★ ID 3 0 - Fd 1340 SED SET DECIMAL MODE assembler could be modified to incor­ 1 D 3 I- 18 1350 CLC CLEAR CARRY porate more features. In this article I 103 2 - AD 7A 10 1360 LDA NUM+l A TO L S I'S will describe modifications to the S-C ID 3 5 - 6D 7C ID .1370 ADC INC+I ID3b- 8D 7A ID 1380 STA NUM+l assembler that allow the S-C assembler ID 3 B - AD 79 1 0 1390 LDA NUM ADD MSB'S to work with the auto-start ROM, ID 3 E - 60 7B 10 MOO ADC INC 1 0 4 1 - dD 79 ID 1410 STA NUM automatically generate line numbers 1D 4 4 - D8 1420 CLD SET BINARY MODE for source code entry, and allow the ID45- A9 A0 1430 LDA #$A0 5 END A SPACE TOO user to change the starting line number 1047- 20 72 10 1 440 JSR CHO 1D 4A- 4C OC FD 1450 JMP SFDOC INPUT NEXT CHARACTER and increment for the auto-line 14 60 ★ numbering mode. 1470 * 1480 * CALL THE MONITOR TO HEAD KEY 14 90 * CHECK IF CONTROL-N. Adding Back the Multiply Routine 1500 ★ IF SO, SET AUTO-FLAG AND 1510 k CHANGE TO CARRIAGE RETURN 1520 k In the auto-start ROM, Apple has 1530 k incorporated some features that make ID 4 D - 20 IB FD 1540 EXIT JSR SFDIB MONITOR ICEYIN 1 0 5 0 - C9 8E 1550 CMP *S8E CONTROL-N?? line editing easier and allow the Apple 1 0 5 2 - DO 05 1560 BNE RTRN HO to automatically boot itself when 1 D 54- A9 an 1570 LDA #$ap CHANGE TO CONTROL-M power is applied. In order to give us all 1 0 5 6 - 80 70 ID 1580 STA FLAG SET FLAG 1 0 5 9 - 4C OB 1 3 1590 RTRN JMP SI3bQ RE-JOIN SCAII of these features, they had to replace 1600 ★ some old (and very useful) code in the 1610 ★ 1620 * CONVERT AND STORE FOUR D IG IT S F8 ROM with their new routines. One 1630 ★ of the deleted routines happened to be 1640 ★ the Integer multiply routine which is 1650 C0NV4 105C - AD 79 ID 1660 LDA NUM FIRST TWO DIGITS used by the S-C assembler. So, if you 1D5F- 20 65 ID 1670 JSR CONV2 have the auto-start ROM, you must ID 6 2 - AD 7 A ID I6U0 LDA NUM+l LAST TrtO D IG IT S 1690 * patch the assembler and add the 1700 k multiply code in order to make the 1710 * CONVERT AND STORE TWO D IG IT S 1720 k

No. 35 - April 1981 MICRO-The 6502 Journal 7 assembler run properly. Bob Sander- Cederlof (the S-C assembler creator) 1730 ★ included the patch along with my 1740 C0NV2 upgrade kit and I will repeat it here. I 0 6 5 - 43 1750 PH A SAVE BYTE ON STACK ID 6 6 - 4 A 1760 LSR Before we can patch the assembler, ID 6 7 - 4A 1.770 LSR GET LEFT D IG IT ID 6 B - 4A 17 BO LSR we have to create some room for the ID 6 9 - 4A 1790 LSR patch. Bob suggested that we move the ID 6 A - 20 70 ID 1800 JSR CONVI CONVERT AND STORE IT starting address of the symbol table up I D6D- 68 1810 PLA GET BYTE FROM STACK 1D6E- 29 OF 1820 AND #S0F ISOLATE SECOND DIGIT a page or two, and make all patches and Id 30 CONV 1 modifications in this new space. The ID 7 0 - 09 BO 1B40 ORA #SSO CONVERT TO A S C II ID 7 2 - 9D 00 02 Id 5 0 CHO STA S 200.X STORE IN INPUT RUFFER assembler resides in memory from 1 0 7 5 - EB 1860 INX INCREMENT BUFFER POINTER $1000 through $1BFF, and the symbol 1 D 76- 4C ED FD Id 7 0 JMP SFOED P R IN T THE CHARACTER table follows, starting at $1C00. The 1880 * 1 0 7 9 - 10 00 IB 90 NUM .HS 1000 IN IT IA L NUMBER moving of the symbol table is 107B - 00 10 1900 INC .HS 0010 INCREMENT accomplished by changing location 1 0 7 0 - 00 1910 FLAG .HS 00 $1010 in the assembler. Now, I suggest 1920 • END that we start the symbol table at $1E00 so that we have plenty of room for the SYMBOL TABLE enhancements that are to be described ANUM ID 2 I E X IT 1040 RTRN ID59 later on. The step-by-step instructions C0NV4 1 050 CONV 2 1D65 CONVI 1D70 CHO ID 72 NUM 1079 INC 1 D7B for moving the symbol table are: FLAG 1070

1. Load the assembler Listing 2 I 000 2. Change contents of$1010to$lE IOIO 1020 3. Re-save the assembler using BSAVE 1030 IO40 ASMB,A$10O0,L$E00 1050 1060 Note that the older versions of the 1070 TH IS Anns THE AUTO COMMAND T o THE 1000 S -C . ASSEMBLER. THE AUTO COMMAND assembler may also be patched in this 1090 ALLOWS YOU TO SET THE STARTING LINE. fashion, but that the address to be II 00 NUMBER AND THE INCREMENT FOR AUTOMATIC 1 1 10 LIN E ENTRY . patched will not necessarily be the 1120 same. In that case, use the Monitor 1130 THE FORMAT OF THE COMMAND W ILL RE: disassembler and examine memory on II 40 1150 * AUTO START, INC either side of address $1010 until you II 60 * find either a $ 1C or $1D, as that was 11 70 * 11 BO SPACE .EO S?0 SPACE the default-starting page number of the 1190 LBU F .EO $200 LINE PUFFER symbol table. 1200 COMMA .EO $2C COMMA 1210 WARM .EO SI 003 WARM START 1220 NJM .EO SID79 STARTING LINE WJMFIER The multiple routine may now be 1230 INC •EO SID7B INCREMENT added, starting at location $1D00 using 1240 .OR S I07E AFTER THE AUTO L IN E NUMRES GENERATOR 1250 ■k the monitor insert command. 1260 k 1270 ★ *1D00: A0 10 A5 50 4A 90 0C 18 ID 7 E - AO 03 1280 AUTO LOY #3 START AT FOURTHCHARACTER 1D80- B9 00 02 1290 SLOP LDA LBUF.Y GET CHARACTER A2 FE B5 54 75 56 95 54 ID 8 3 - FO 60 1300 BEQ DONE ALL DONE — DO NOTHI'G 1D 85- C9 20 1310 CMP #SPACE IS IT « SPACE?? * 1D10: E8 DO F7 A2 03 76 50 CA IDd7- FO 03 1320 BEQ GSPAC YES 10 FB 88 DO E5 60 1D89-C8 1330 INY BUMP Y ID d A - DO F4 1340 BNE SLOP IDLE UNTIL A SPACE 1350 And finally, we need to change the JSR 1360 instruction that points to the multiply 1370 GOT A SPACE. IDLE U 'JTIL No MORE SPACES I3B 0 routine to point to the relocated code 1390 for the multiply routine. You should 1400 GSPAC find a JSR $FB63 at location $1122. The 1 D8C- C3 1410 INY RUMP Y ID8D- B9 00 02 1420 LDA LBUF.Y GET CHARACTER following will change the destination 1D90- FO 53 1430 BEO DONE WE ARE DONE address to $1D00. 1092- C9 20 I 440 CMP iKSPACE IS IT A SPACE 1 0 9 4 - FO F6 1450 REQ GSPAC L"OP U NTIL NO SPACE 1460 *1123: 00 1D 1470 1480 COUNT THE NUMBER OF CHARACTERS 1490 U NTIL THE AND SAVE THE PO SITIO N Now, the assembler may be saved as 1500 NUMBER OF THE LAST CHARACTER. instructed in step 3 above. This 1510 1520 modified version of the assembler will 1D96— A2 00 1530 LOX #00 GET A ZERO now work properly with the auto-start ID 98— C9 2C 1540 CLOP CMP #C0HMA IS IT A COMMA?? ROM. I 09 A- FO 09 1550 BEO S A V IT YES ID 9 C - EB 1560 INX BUMP COUNT Automatic Line Numbers ID 9 D - Cd 1570 INY BUMP CHARACTER SCAN I 09E- B9 00 02 I5d0 LDA LBUF.Y GET NEXT CHARACTER I DA I - FO 02 1590 BEQ SAVIT SAVE PARAMETERS The other little goodie that Bob I DA3 - DO F3 1600 BNE CLOP TRY AGAIN included in my upgrade kit was a 1610 routine that allowed the assembler to 1620 1630 WE GET HERE AND SAVE X AND Y FOR I.ATER automatically generate line numbers so

8 MICRO - The 6502 Journal No. 35 - April 1981 1640 * as to relieve the programmer of that 1650 ★ task. I have often wanted that sort of a 1660 S A VIT feature when I am doing a lot of coding 1 DA5 - BE 2D 1 E 1670 STX SCNT SAVE COUNT ID A B - 8C 2E 1 E 1680 STY EPOS END POSITION + 1 with the S-C assembler. I have included 1 DAB- B9 00 02 1690 LDA LBUF.Y GET CHARACTER AGAIN the code that will automatically ID A E - FO IE 1700 BEO DSTRT IF ZERO GO AWAY 1710 ★ generate the line numbers in listing 1. 1720 k It is placed immediately after the 1730 ■k SCAN THE INCREMENT multiply routine that is listed in the 1740 * 1750 k previous section. The steps that are ID BO - Cd 1760 INY NEXT CHARACTER required to incorporate the routine into 1 D B I- A2 00 1 770 LDX #00 ZERO COUNT the assembler are: 1D B 3- B9 00 02 1780 I LoP LDA LBUF.Y GET CHARACTER IDB6- FO 04 1790 BEQ DINC DONE WITH SCAN IDB8- EB 1800 INX BUMP COUNT 1. BRUN the asssembler 1DB9- CB 1810 INY NEXT CHARACTER 1 DBA- DO F7 1820 BNE I LOP REPEAT T I L DONE 2. Enter the source code from listing 1 1830 ★ IB 40 * 3. Assemble the code using the assembler IR50 ★ CONVERT THE INCREMENT AND SAVE IB 60 * 4. Batch an assembler address that will 1870 * allow access to the auto-line routine. IDBC- BA 13B0 DINC TXA SET CONDITION CODE ID BD - FO OF 1890 BEO DSTRT IF ZERO DO START Location $1388 should contain a JSR 1 DBF- 20 EB ID 1900 JSR GETNUM CONVERT NUMBER $FD1B. Change the address to $1D21 1 DC2 - AD 2F IE 1910 LDA HOLD GET MSB using the monitor command: 1 DC5- BD 7B ID 1920 STA INC SAVE 1 DCB- AD 30 1 E 1930 LDA HOLD+1 GET LST3 ID C B - 8D 7C ID 1940 STA IN C +I SAVE *1389:21 1D. 1950 * I9 6 0 * 1970 * DO THE START LIN E NUMRER The automatic line number routine 1980 * is started by typing a control-N instead 1 990 * 2000 DSTBT of a RETURN. So, whenever you type ID C E - AE 2D 1 E 2010 LDX SCNT GET COUNT control-N, the assembler will generate 1D D I- FO 12 2020 BEQ DONE IF ZERO — IGNORE a carriage return, a line feed, and then !Dn3- AC 2E 1 E 2030 LDY EPOS GET POSITION 1DD6- 20 ER ID 2040 JSR GETNUM CONVERT display the next line number on the 1DD9- AD 2F IE 2050 LDA HOLD GET MSB screen. I incorporated this routine in IDDC- RD 79 ID 2060 STA NUM SAVE 1 DDF- AD 30 1 E 2070 LDA HOLD+I GET LSR my assembler and was very happy with ID E 2 - BD 7A 1 D 20 BO STA NUM+l SAVE it with one exception. In order to 2090 change either the starting line number 21 00 •k 21 10 * DONE OR ARORT or the increment, you had to change 2120 •k the values stored in memory. This soon 21 30 * got to be very tedious, especially when ID E b - 4C 03 10 21 40 DONE JMP WARM WA RM STA HT 2150 * I had to refer to the source listing in 2160 + order to find the address that I had to 21 70 * GETNUM — CONVERTS A S C II TO BCD 21 80 * change if I needed a different starting 21 90 * line number or increment. I longed for 2200 GET NUM a command to change one or both of ID E B - A9 00 2210 LDA #00 GET A ZERO ID E A - BD 2F IE 2?20 STA HOLD ZERO OUT the numbers. ID E D - BD 30 1 E 2230 STA HOLD+I ZERO OUT ID F 0 - 20 20 IE 2240 JSR REAIW GET S ’U TS The 'AUTO' Command for the S-C ID F 3 - Bl) 30 1 E 2250 STA HOLD+I SAVE B IT S Assembler 1D F6- CA 2260 DEX DECREMENT l/'O P COUNT ID F / - FO 26 2270 BF.O EXT DONE 1 D F9- 20 20 1 E 22 80 JSR RFADR GET 8 ‘1ITS Listing 2 is the code to include the ID F C - 20 71 1 E 2290 JSR SHIFT SHIFT LEFT 4 'AUTO' command to the S-C 2300 ID F F - IB 2310 CLC CLEAR CARRY assembler. The format of the AUTO IE00- 6D 30 IE 2320 ADC HOLD+1 PUT IN B IT S command is the same as for Integer IE 0 3 - 8D 30 1 E 2330 STA HOLD+1 SAVE BACK BASIC, which is: 1 E 0 6 - CA 2340 DEX DECREMENT LOOP COUIW IE 0 7 - FO 16 2350 BEQ EXT DONE IE 0 9 - 20 20 1 E 2360 JSR READS GET 8 BITS AUTO starting line number, IE 0 C - 8D 2F IE 2370 STA HOLD SAVE R ITS 1 EOF- CA 2380 DEX DECREMENT 100P COUNT increment. 1 E 10- FO OD 2390 BEQ EXT DONE I E I 2 - 20 20 1 E 2400 JSR READ8 GET BITS The design of the routine is quite 1 E 1 5- 20 27 IE 2410 JSR SH IFT SHIFT LEFT 4 simple. First the routine goes to the IE I B - 18 2420 CLC CLEAR CARRY I E I 9 - 6D 2F 1 E 2430 ADC HOLD ADD IN BITS input line buffer and begins to scan the IE I C - 8D 2F 1 E 2440 STA HOLD SAVE BACK command, beginning with character I E I F - 60 2450 EXT RTS RETURN 2460 * four. It throws away all characters until 2470 ★ it finds a space. This is done so that the 2480 ★ READS — READ B BITS FROM LINE BUFFER user may type any character string that 2490 •k 2500 * starts with the first three letters 'AUT'. 2510 HEAD& After we have encountered a space, we IE20- 88 2520 DEY DECREASE POINTER count the number of characters from J E 2 I- B9 00 02 2530 LDA LBUF.Y GET CHARACTER IE24- 29 OF 2540 AND #S0F ONLY FOUR BITS there until the comma. This is the number of digits in the starting line number and this value is saved for later use. Note that this value can be zero,

No. 35 - April 1981 MICRO - The 6502 Journal 9 which implies that you can change only the increment, but don't have to change the starting line number also (for example AUTO ,10). 1 £ 2 6 - 60 2 5 5 0 RTS DONE 2560 * Next we scan the character string, 2570 ★ starting with the first character after 25 B0 2590 * SHIFT — SHIFT LEFT 4 BITS the comma, and ending with the null 2600 * byte that terminates the input buffer 2610 * string. Again the number of characters 2620 SHIFT 1E 27- 18 2630 CLC CLEAR CARRY is saved and, as mentioned above, it IE 2 8 - 2A 2640 ROL LEFT 1 also may be zero if you only want to 1 E2-9— 2A 2650 ROL LEFT 1 1 E2A- 2A 2660 ROL LEFT 1 change the starting line number and IE 2 B - 2A 2670 ROL LEFT 1 keep the same increment (for example 1 E2C- 60 2680 RTS RETURN 2690 ★ AUTO 1000). The increment character 2700 * string is converted from ASCII to BCD 2710 * STORAGE by the GETNUM routine. The 2720 * 2730 * resulting BCD number for the incre­ 1 E2D- 00 2740 SCNT .HS 00 COUNT ment is saved as the new increment. 1 E2E- 0 0 2750 EPOS .HS 00 POSITION Finally, the starting line number string IE 2 F - 00 00 2760 HOLD .DA 0 TEMP STORAGE 2770 + is converted to BCD and saved as the 2780 ★ new starting line number. Then we 2790 * CHANGE JO IN TO AUTO 2800 * jump back to the assembler command 2810 * mode. 2820 .OR S1289 IN DISPATCH ' 1 2 8 9 - 41 55 54 2830 .AS /A U T / AUTO COMMAND Only a small problem now 128C- 7E ID 2840 .DA AUTO ADDRESS exists—there is no 'AUTO' command 2650 ,EN in the S-C assembler. We have two options: we can find the command dispatch table in the assembler and add another command to it (this may be complicated), or we can replace one of

the existing commands with our new is command. I chose to do the latter. The code at the end of listing 2 changes the 'JOIN' command to 'AUTO' by chang­ ing the ASCH command string and the address of the routine that actually from Brtfderbund Software does the command in the command dispatch table. As before, the code STRRTEGY FAST ACTION needs to be assembled as part of the GflfTlES! GflmES! assembler and saved as indicated above.

I have recommended that you create a source file and assemble that in order to incorporate these new features. This is not necessary, since I have included the object code as part of the listings. Instead, you could just enter the object code directly into memory and make THE SAGA CONTINUES the patches listed above. The only problem that I see with that method, is IV TRWflLfl'S LAST R6DOUBT that it can be very tedious, if you were The cruel Emperor Tawala has been forced from his throne on the world of Galactica and has fled Apple Galaxian — In brilliantly colored array, the to make a small mistake. Also, it is a for his life to the planet of Farside, where he and Galaxians swoop down from all sides In good idea to make yourself a back-up a small bank of adherents prepare to make their dazzlingly swift attacks to do battle upon the last stand. Extreme solar conditions have lone defender. This faithful rendition of that most copy of the assembler until you have isolated Farside from the rest of the galaxy, and popular of all bar games may drive you around tested out your new and improved so it remains to Benthi, leader of the local-insur­ the bend, but think pf all the quarters you'll be rectionists, to press the final assault on Tawala saving! Apple II Integer or Plus, 48K disk, $24.95. version. and his minions. TAWALA’S LAST REDOUBT puts you in the Ned W. Rhodes received his BSEE from How to order: Ask your dealer or send check or position of rebel leader. You must intercept and money order for the exact retail price to: the University of Minnesota and his MS in decipher Tawala's secret messages to his sup­ Computer Science from the George porters, form alliances with local chiefs, detect Tawala's spies in your midst, separate hard intel­ & Washington University in Washington ligence from enemy disinformation, avoid Ta- D.C. He is currently employed by the wala’s military forays against you and, finally, Brtfderbund Software David W. Taylor Naval Ship Researched lead the assault against the Prince's stronghold. Box 3266. €ugene, Oregon 97403 Development Center, where he develops Minimum Configuration: Call (503) 343-9024 to order. NO CHARGE FOR SHIPPING AND HANDLING! high-speed minicomputer-based data TRS-80 Cassette, 16K, Level II, $19.95 Visa and Mastercard accepted. acquisition systems for use during full- TRS-80 Disk, 32K, *24.95 APPLE Disk, 48K with APPLESOFT, $29.95 W ava got moral Sand for our frM catalog! scale trials aboard naval vessels. "Apple, Apple II Plus and Applesoft are trademarks of Apple Computer Co. TRS-80 is a trademark of Radio Shack.* JUCRO

10 MICRO - The 6502 Journal No. 35 - April 1981 Now your Jcippkz ]C really can be used as a word processor

w ith the TM B y . f a z e r J t & m c n o s y s te m s -a JNC. Act now 99.95 ... May 1st $119.95 P.O.Box 55518 Riverside, Calif * 92517

A real shift key A true type-ahead buffer Now you can easily enter upper/lower case data Pascal and Visicalc users have already experienced the using the s h ift key on your Apple keyboard. Existing convenience of a type-ahead buffer. Now all software systems word processors use the ESCAPE or right arrow keys running on the Apple II can take advantage of a hardware as a "software" shift key. This works, but it takes type-ahead buffer. a few weeks to get used to. And, if you are using a A type-ahead b u ffer l e t s you enter commands and data even typewriter in your day to day activities, you may though the computer i s busy doing something else. For example, never get used to the "software" shift key. i f you type "SAVE PGMNAME" you do not have to wait for the BASIC The Keyboard +Plus can be teamed up with most of prompt before typing "CATALOG", Since you can type "CATALOG” your existing software to allow lower case entry while the disk is s till spinning, the catalog will be displayed into programs which previously did not. When paired immediately after DOS has saved your program. The savings is two with the Lazer Microsystems’ Lower Case +Plus, your fold. First, the few seconds required to type "CATALOG" after e x i s t i n g s o ft w a r e t a k e s on new d im e n s io n s . the prompt reappears i s saved. Second, and even more important, The Lazer Microsystems Keyboard +Plus lets you the operator's attention is not required while the program is e a s i l y e n te r the e n tir e 128 ASCII c h a ra cter se t being saved. Typically, up to 10% of a programmers time is saved directly from the Apple keyboard. The extra when a type ahead b u ffer is used. Programmers and Apple users ch a ra cters are [, ], {, } , \, andU. This will greatly appreciate the fact that keys will not be lost is especially handy for Pascal and CP/M users. because you can type faster than the current operating system or The keyboard +Plus features a capslock mode in program can accept data. This problem is especially evident when which the Apple keyboard behaves as i f the Keyboard entering new lines into a large Applesoft program. +Plus was not present. This allows programs which The need for a type-ahead buffer is sort of like the need cannot properly handle lower case to function for a telephone. If you've never used one, you probably won't normally. see the need for one. But once you've used one, it's The Keyboard +Plus i s d ir e c tly compatible with indispensable. After all, if a type-ahead buffer wasn't useful, B a s ic , P a s c a l, CP/M, LISA, and most major word you wouldn't fin d i t on most expensive minicomputers or on the processor programs including ApplePIE and SuperTEXT. Apple / / / .

and the Act now $59.95 May 1st $69.95

Up to 128 displayable characters. Inverse and normal upper and lower case. Two on-board character sets. Software Compatibility 1. Standard Word processor set. 2. Graphics set. The Lower Case +Plus i s compatible with a ll major 7x8 font size (maximum). software systems running on the Apple II. All word Character set can be redefined with a 2716 EPROM, processors and any other software that is compatible EPROM programmer and a HIRES character generator such w ith the Paymar LCA w ill work even b e tte r with the as the "Keyboard f i l t e r ” from Mountain Computer. Lazer Micro Systems' Lower Case +Plus. When paired with Optional fonts provided on diskette the Keyboard +P lu s, you get a dynamite word processor BASIC software provided on diskette. combination. Pascal patch provided for 1.0 and 1.1 CP/M applications utilizing lower case can also Expansion socket compatible with other Lazer take advantage of the Lower Case +Plus' display Microsystems' products. capabilities. High quality double sided PC board with solder mask Pascal users (version 1.0 and 1.1) can use the and silk screen. patch provided with each Lower Case +Plus to display One board works with a ll Apple II computers. lower case from Pascal programs. Extensive documentation booklet. Compatible with most word processors.

Why buy an Apple III to sim ulate an Apple II when you can buy Lazer M icrosystem s Order from: products fo r your Apple II to sim ulate Apple / / / ' s features (and save a bundle). faa z e r ICRO SYSTCM Major Dealers Distributors Consumer Computer Conrouter Data Services P .O.Box 55518 8314 Parkway Dr. 64 rinedale Riverside, C alif./92517 La Mesa. Calif. 92041 Hauppauge, NY 11787 a w 682-5268 (714) 465-8888 (5161 360-0988

Have your name listed Micron Distributing here as a dealer or 409 Queen St. West Give aproximate date your Apple was purchased new. distributor. Contact Toronto Ontario Visa and MC accepted. Give card number, expiration Lazer Microsystems M5V 2A5 Canada Inc. for details. (416) 363-6058 date, and signature. Personal 4 business checks require 2 weeks to clear 4 will increase delivery time by that much. Calif, residents must add 61 sales tax. Lover Case +Plus, Keyboard +Plus, and +Plus are all U.S.A. orders add $2.00 shipping 4 handling. All trademarks belonging to Lazer Microsystems Inc. Apple is a registered trademark of Apple Cooqmter Inc. other countries add $15.00. Paymar LCA is a trademark of Dan Paymar. C.O.D. orders available only with non-refundable CP/M is a registered trademark of Digital Research. $4.00 shipping 4 handling fee paid in advance.

Dealer and Distributor inquiries invited.

No. 35 - April 1981 MICRO - The 6502 Journal 11 Last year we tested or listings, 105 reviewed 141 PET programming hints, programs, evaluated and 116 news stories 54 peripherals ranging about the CBM/PET. from light All this pens to added up to printers, more than and ran THE 150,000 27 major words of articles on TRUTH essential PET pro­ PET infor­ gramming. mation. Our gossip ABOUT We are columnist PRINTOUT, blew the THE PET the inde­ gaffe on pendent dozens of inside magazine about the stories, receiving two CBM/PET. Shouldn't death threats, five you subscribe?

poison pen letters and $36 buys you the ten issues of Volume 2 (1981) or the complete set of Volume 1 (1980). Simply send us a cheque, postal or a dead rat for his money order or the number of your Barclaycard/Visa, Access, Mastercharge or Eurocard pains. We also We also accept credit car orders by telephone on 0635-201131. Sample published 53 letters copies of the latest issue are available at <£5 All prices include UK from PET users, 88 postage.

M381 X To PRINTOUT PO Box 48, Newbury, Berkshire RG16 0UJ, England.

My Name i s ...... Address...... Postcode ......

Please Enter my Subscription to : [ I Volume 2 (1981) ] Send me the set of Vol 1 (1980) [ ] I enclose my cheque or Postal Order OR [ ] Debit my Access/Mastercharge/Eurocard/Barclaycard/Visa account No [ ] UK £9.50 [ ] Eire £12.50 Punts [ ] Europe (surface) £14.50 ( 1 Europe Airmail £18 [ ] USA Airmail $45 [ J USA (surface) $36 [ ] Rest: of World .Air £25 [ I Rest of World (surface) £14.50 Send me a sample copy [ ] UK £1 [ ] Europe Air £1.50 []USAAirS5 Send me .... binders @ [ ] UK £3.50 [ 1 Eire £4.50 Punts [ 1 Europe £5 [ ] Rest of World £7.50 [ ] USA $19

MICRO - The 6502 Journal No. 35 - April 1981 PRINT USING for the PET

This sequence will cause the following printed only if there is at least one digit This is an excellent PET version to be printed: to the left of it. If the value is negative, of Gary Morris’ Apple program. It the minus sign will be placed to the left runs on any PET or CBM TOTAL IS $ 1,234.56 of the highest digit. machine. The edit pattern to be used in for­ matting the output must be specified The value to be edited is passed to David Malmberg by the string variable ED$. The edit the PRINT USING routine as the 43064 Via Moraga pattern may contain almost any valid parameter of the USR function, e.g., X Fremont, California 94538 character (such as, $ #, %, ' = / K . in the previous example. This etc.). These characters will be "skipped parameter may be a complex expres­ over” and the various digits of the sion, rather than just a variable or a Gary Morris recently published a number will be inserted into the blanks numeric value. The value returned by PRINT USING program for the Apple in of the edit pattern, or overlaid on any the USR function to BASIC (Y in the the October 1980 issue of MICRO 0’s in the pattern. The value to be previous example) will be garbage and (29:14) . His program made use of some printed will be edited from right to left. have no meaning. Be careful not to use of the ROM routines in Applesoft. If the value is too large for the edit field, a variable name that is significant to Since Microsoft developed both the left-most characters will be trun­ the rest of the program as the left hand Applesoft and the various versions of cated. A comma in the pattern will be side of the USR equation. PET BASIC, I felt that Gary's routine could be easily adapted for the PET. After consulting Jim Butterfield’s many Listing 1 memory maps of the PET ROMs, and a fair amount of experimentation, I suc­ ceeded in modifying Gary's basic 10 PRINT 11CCLRH 2 D0WMPRINT USING FOR THE PET" 26 PRINT "CDOUNJBV DAVID MALMBERG" routine to work on the PET. 30 REM ADAPTED FROM A ROUTINE FOR THE APPLE 40 REM EV GARV MORRIS IN OCT-1980 MICRO Listing 1 is a BASIC program that 50 PRINT "[HOME] LOADING 2ND CASSETTE BUFFER" 68 FOR I = 826 TO 984 : READ DC: POKE I ..DC PR I NT ’ CH0ME3 " I j DC: NEXT I POKEs the machine code for the 70 REM EASIC 3.8 VERSION routine into the second cassette buffer 80 BATA , 220 .* 169 69 .* 162.' 196 , 133 (from 826 to 984). This program also 98 DATA 66 .• 134,67 .• 32.201,207,160,2, 177 detects which of the three versions of 100 DATA 6y, 133,93, 136, 177,6b, 1 , 9^', 1 :;6 110 DATA 177, 68,281,16, 144 • 2.- 169,1 b • 141 BASIC is operable in the specific PET 128 DATA 32,3,.168, 136,177,92, 153,33,3 and modifies the machine code accord­ 138 DATA 136, 16,248,168,0,185,0,1,248 ingly. This is done by PEEKing into 140 DATA 3■280,208,248,174,32,3,136,185 50003 " 0 " 150 DATA 0,1,72,104,72, 281,45,288,14,139 location which contains a 168 DATA 32,3,201,45,144,22,202,208,240 for BASIC 2.0, a "1 ” for BASIC 3.0, 178 DATA 104, 24,144,54,189,32,3,201,32 and a "160” for BASIC 4.0. The pro­ 130 DATA 240,8•201,44,240,238,201,48,144 gram in listing 1 will also set the USR 198 DATA 234.184,157,32.3,202,240,32,192 208 DATA 1,208■205,232,24,144,16,189,32 vector (locations 1 and 2) to point to 210 DATA 3 >201,36,240 ,17,201,46,176,5 the beginning of the code in the second 228 DATA 169■32.157,32,3,282,240,5,236 cassette buffer. Once this program has 238 DATA 32,3,144,232.174,32,3,169,0,157 been run, the machine language routine 240 DATA 33,3,168,3,169, 3>:, o2, 2y .■ £!8i±!, 169 258 DATA R, 1 . 7.96 is available to any BASIC program via 268 POKE 1,58:POKE 2 ,3 :REM SET USR VECTOR the USR function. 270 IP PEEK<50003.)0 160 THEN 310 280 REM EASIC: 4.0 MODIFICATIONS As an example of how this would be 290 POKE 827,147:POKE 828,207:POKE 838,135:POKE 839,193 308 POKE 978,29:POKE 979,187 used, consider the following BASIC 3 10 IF PEEKC50003K>0 THEN 370 instructions: 328 REM EASIC 2.0 MODIFICATIONS 330 POKE 827,175:pOKE 828,220:pQKE 838,215:R0KE 839,207 10 EDS = “ $ , 0.00” 348 POKE 978,39:POKE 979,202:POKE 983,94 358 POKE 834,148:POKE 836,149:POKE 843,150: poke 845,175 20 X = 123456 360 POKE 348,150:POKE 850,174:POKE 853,150:POKE 866,174 30 PRINT'TOTAL IS ” ;:Y = 378 PRINT "[ 6 DOWN]LOADING COMPLETED" USR(X)

No. 35 - April 1981 MICRO - The 6502 Journal 13 The routine works by editing the ASCH representation of the number Listing 2 passed as the USR parameter. The routine assumes that this value has 001 0 ; PRINT USING FOR THE PET been "integerized" and that the ASCII 0020 :■ EV DRV III MALMBERG representation does not contain a 0030 ,43064 VIA MORftGA decimal point. The position of the 0040 :FREMONT, CALIFORNIA 94538 0050 decimal point (if any) will be implied 0060 ; ADAPTED FROM ft ROUTINE FOR THE APPLE by the edit pattern, i.e., the variable 0070 / EV GARY MORRIS IN OCT-1980 MICRO EDS. 0080 0090 ,EH $033fi 0100 ROMS .BE 3 If the actual value you wish to for­ 0110 . OS mat has a decimal point, or if you wish 0120 STRING .BE *100 to scale the number to be printed dif­ 0130 LENGTH ,DE 800 ferently from the way it is represented 0140 EDITBUF .DE 801 0150 internally in the PET, you can use a 0160 IFE ROMS-3 BASIC user-defined function to handle 0170 FLPASC .DE $HCE9 the conversion before going to the USR 0180 STROUT .DE fCFllC 0190 NAME ■DE $42 routine. For example: 0200 VARIABLE ■DE $44 0210 FIND •DE $CFC9 10 DEF FNS2(X) = INT(X*100 0220 PNTR ■DE $5C + 0.5) 0230 VARTVP .DE $07 0240 *+'♦' 20 DEF FNPK(X) = INT(X/2.21 ^ 0250 + 0.5) 0260 IFE ROMS-4 30 ED$ = “ $ , 0.00” 0270 FLPASC .DE $CF93 40 Y = USR(FNS2(12.3456)) 0280 STROUT ■DE $EB1D 0290 NAME .DE $42 50 EDS = “ KILOS = 0300 VARIABLE .DE $44 60 PRINT 0310 FIND ■DE $C1S7 70 Z = 1000.0 : REM POUNDS 0320 PNTR .DE $5C 9330 VARTVP ■DE $07 80 Y = USR(FNPK(Z)) 0340 *** 0350 will cause the following output: 0360 IFE ROMS-2 0370 FLPASC .DE $DCfiF 0380 STROUT ■HE $CA27 $ 12.35 0390 NAME .DE $94 KILOS = 452 0400 VARIABLE ■DE $96 041 0 FIND .DE $CFD7 Listing 2 gives the assembler source 0420 PNTR .DE $AE 0430 VARTVP .DE $5E code for the PET PRINT USING 0440 routine. The appropriate ROM routine LW-.'fc! locations are given for all three versions 0469 ; FIRST CONVERT NUMBER PASSED BV USR of PET BASIC, with conditional 047S FUNCTION TO FLOATING ACCUM TO 0430 ASCII STRING STARTING AT "STRING'' assembly determined by the value of y490 ROMs in line 100. The assembled code 033ft- 20 E9 DC 0500 ■JSR FLPASC shown along side of the source code is 0510 .:N0W FIND THE VARIABLE TO USE 0520 ; IN THE EDIT PATTERN for BASIC 3.0—the "new” ROMs. The 8530 assembler source is almost identical to 033D- A9 45 0540 SEARCH LDA #"E , BftSIC VARIABLE that shown in Gary Morris' original 033F- ft2 C4 0550 LDX #$C4 ; NAME IS EB$ Applesoft article, with the exception of 0341- 85 42 0560 STA *NAME 0343- 86 43 0570 STX *NANE+1 the use of the STROUT ROM routine 0345- 20 C9 CF 0530 JSR FIND to print the formatted representation of 0348- A0 02 0590 LDV #2 the number (line 1450). The assembler 034ft- El 44 0600 LDA (VARIABLE?,V ; GET ADDRHI source also has several slight dif­ 034C- 85 5D 0619 STfi *PHTR+1 034E- 88 0620 DEV ferences to accommodate the dif­ 034F- 81 44 0630 LDA (VARIABLE>, V GET ADDRL0 ferences between how Applesoft and 0351- 85 5C 0640 STA *PNTR PET handle the ASCII represen­ 0353- 88 0650 DEV tation of numbers, and the value the 0354- El 44 0660 LDft (VARIABLE), V GET LENGTH 0356- C9 10 0670 CMP #16 USR function returns. The assembler 0358- 90 02 0630 BCC LENOK MAXIMUM LENGTH source is well-commented and is very 035ft- ft9 10 0690 LDA #16 ;ALLOWED IS 16! ! ! straightforward. 035C- 8D 20 03 0700 LEN0K STA LENGTH 0720 ; move THE ED$ PATTERN TO EDITBUF 035F- A8 0730 TAV 0360- 88 0740 DEV 0361- El 5C 0750 L00P2 LBA ,V 0363- 99 21 03 0760 STA EDITBUF,V 0366— BS 0770 DEV 8367- 10 F8 0730 BPL LOOF'2 0790 0300 ; FIND THE ASCII STRING END 0369- A0 00 0310 LDV #0 0o6B— B9 00 01 0320 LOOP LDA STRING,V ; GET CHAR

14 MICRO - The 6502 Journal No. 35 - April 1981 036E- F0 03 0830 BEQ EDIT 0370- CS 0840 INV 0371- B0 F8 0850 BNE LOOP 0860 ;MOVE ;STRING TO THE EDITBUF, FROM RIGHT /AlCftO 0870 ;T0 LEFT.. FILLING OVER NUMBERS BUT 0880 :SKIPPING COMMA'S ANB PERI0BS. 0890 : IF WE COME TO A MINUS SIGN THEN Club Circuit 0900 .: KEEP i30ING LEFT UNTIL THE PATTERN 0910 ;h r s a BLANK OR. R COMMA, THEN KEEP 0920 ..GOING LEFT STORING BLANKS IN THE 0930 .:EDITBUF UNTIL IT ENBS OR WE COME Mike Rowe 0940 ; TO R ]DOLLAR SIGN Club Circuit nOCf4 P.O. Box 6502 0373- RE 20 03 0960 EDIT LDX LENGTH .:FIELD WIDTH Chelmsford, MA 01824 kJ970 0376- SS 0980 EBL00P BEV 0377- B9 00 01 0990 LBfi STRING,V ;GET CHARACTER The following club announcements aie 037R- 48 1000 PHA ;SAVE IT presented in zip code order. 037B- 68 1010 CHECK PLR 037C- 48 1020 PHA 037B- C9 2D 1030 CMP .: IF R MINUS SIGN 037F- B0 0E 1040 BNE DIGIT .'■SKIP TO R BLANK 0381- BB 20 03 1 050 MINUS LDA EBITBUF-1,X Richmond Computer Club 0384- C9 2B 1060 CMP Gary F. Cowardin is Treasurer for this 0386- 90 16 1070 BCC BROF'IT group which meets on the last Monday 0388- CR 1080 SKIPIT BEX of each month at 7:30 pm at the 0389- B0 F6 1090 BNE CHECK 038B- 68 1100 F'Lfi Science Museum of VA. This club has a 038C- 18 1110 CLC membership of over 50 active members 038B- 90 36 1120 BCC DONE who meet to encourage organized com­ 038F- BB 20 03 1130 DIGIT LBA EBITBUF-1,X 0392- C9 29 1140 CMP #' puter use involving Ohio Scientific, 0394- F0 08 1150 BEQ BROPIT Heath, TRS-80, Apple, and many other 6396- C9 2C 1160 CMP # microcomputers. For further informa­ 0393- F0 EE 1170 BEQ SKIPIT tion, write: 039R- C9 30 1180 CMP #"0 039C- 90 EH 1190 BCC SKIPIT Secretary 039E- 68 1200 BR0PIT PL A GET IT BACK 1004 Lorraine Avenue 039F- 9B 20 03 1210 STfi EBITBUF-1,X Richmond, VA 23227 03R2- CR 1220 BEX 03R3- F0 20 1230 BEQ DONE 03R5- C0 01 1240 CF'V #1 ; ENB OF STRING? Jacksonville Atari & PET Society 03R7- B0 CIi 1250 BNE EDLOOP (JAPSJ 03R9- E8 1260 INX This group meets at various member's 03RR- 18 1270 CLC homes and businesses to assist 33RB- 90 10 1280 BCC NEXT 1 03AB- BB 20 03 1290 BLANK LBA EDITBUF-1,X ;BLANK FROM members, exchange ideas, information 03B0- C9 24 1300 CMP #"* ;HERE TO $ and experiences. Russell A. Grokett, Jr 03B2- F0 11 1310 EEQ BONE is president for this newly-formed 03B4- C9 2E 1320 CMP #"'. group. For monthly information on 93B6- BR 05 1330 BCS NEXT 1 03B8- R9 20 1340 LBR #' club meeting locations contact the 03BR- 9B 20 03 1350 STA EDITBUF-1,X president at (904) 725-0435 evenings 03BB- CR 1360 NEXT 1 BEX and weekends. Or write to: 03BE- F0 05 1370 BEQ DONE 401 Monument Road #171 03C0- EC 20 03 1380 CPX LENGTH 03C3- 90 E8 1390 BCC BLANK Jacksonville, FL 32211 03C5- RE 20 03 1400 DONE LBX LENGTH 03C8- R9 00 1410 LBR #0 6502 User's Group 03CR- 9D 21 03 1420 STA EDITBUF,K .: PUT @ AT ENB Chairman Gerald Key heads this group 03CB- R0 03 1430 LDV #H, EDITBUF 03CF- R9 21 1440 LBA #L, EBITBUF of 28+ members which meets every 03B1- 20 1C CR 1450 JSR STROUT 3rd Thursday of the month at 7:30 pm. 03B4- R9 00 1460 LDA #0 ;SET TVF'E TO NUMERIC Meetings are held at the State Savings STR *VARTVP ;T0 RVOID BASIC ERROR 03B6- 85 07 1470 Bank Community Room, 444 Havens 03B8- 60 1480 RTS 1490 XEND .EN Comer Road, Gahanna, OH. This club states its purpose as a means to ex­ change ideas, provide assistance to LRBEL FILE: C / = EXTERNAL ] members, and promote the use of microcomputers. This club provides a /ROMS=0003 .,STRIHG=0100 ,'LENGTH=0320 forum for all 6502-based users and is /EBITBUF=0321 ,"'FLPRSC=DCE9 ,'STR0UT=CA1C the only Columbus area alternative to /NfWE=0042 A'HRIflBLE=0044 /FIND=CFC9 /PNTR=005C /VHRTVF-0007 SEARCH=033B many Apple user's groups. For further LENOK=035C LOOP2=0361 LOOP=036B information, write: EBIT=0373 EDLOOP=0376 CHECK=037B Chairman MINUS=03S1 SKIPIT=0383 BIGIT=038F 141 Flintridge Drive DROPIT=039E BLANK=03AD NEXT1=03BH BGNE=03C5 XENB=03B9 Gahanna, OH 43230

JMCRO (Continued on page 20)

No. 35 - April 1981 MICRO - The 6502 Journal 15 80 COLUMN GRAPHICS

CBivi The Integrated Visible Memory for the PET has now been • JK redesigned for the new 4 m screen column W ancJ forthcoming 40 - ■ - 1 - W column PET computers w from Commodore. Like 1 earlier MTU units, the . r new K-1008-43 package mounts inside the PET case for total protection, f To make the power and flexibility of the 320 by 200 bit mapped pixel graphics display easily accessible, we have designed the Keyword Graphic Program. This adds 45 The image on the screen was created graphics commands to Commodore BASIC. If you have been by the program below. waiting for easy to use, high resolution graphics for your PET, isn’t it time you called MTU?

10 VISMEM: CLEAR K-1008-43M Manual only $10 (credited toward purchase) 20 P“160: Q=X00 . JO XP=144: XR-1.5*3.14159^7 k-1008-43 Complete ready to install package $495 40 YP-S6: fcP=64 50 XF=XR/XP: YK=VP/yR: 8f=XR/ZP Mastercharge and Visa accepted 60 FOR ZI—Q TO Q-l 70 IF ZI<-ZP OR 11>ZP UUTO 150 Write or call today for our full line catalog describing all 80 ZT»ZI*XP/ZPj ISZ*ZI MTU 6502 products, including our high speed 8" Floppy 90 XL=1NT(.5-SOKIXF*XP-ZT*ZTJ, 100 FOR XI'-XL 10 XI, Disk Controller for up to 4 megabytes of PET storage. 110 XT=SQRfXI*XX+SHT*ZT)*XF! XX»XI 120 YY= (SIN (XT) +.4*SIN(3*XT)} *TB 130 GOSUB 170 140 NEXT XI 150 NEXT ZI 160 STOP 170 XI=XX+ZZ+P ^'MicroTechnology Unlimited 180 yl=YY-ZZ+Q l l l l ?80fi Hillstiorouqh Street 190 GMODE Is MOVE XI,Vis WRPIX I I P Q Bo* I ?106 200 IF yl=0 GOTO 220 ' R.tlt'iqh NC ?760h I) S A 210 GMODE 2: LINE X1,Y1-1,X1,0 HU;)!833 I-158 220 RETURN

NOW 80 COLUMN PETS CAN HAVE MTU HIGH RESOLUTION GRAPHICS

MICRO - The 6502 Journal No. 35 - April 1981 MEMSEARCH for the AIM 65

“ MEMSEARCH” is a machine language utility program which quickly scans through memory searching for a user-specified sequence. It can assist in PRINT TITLE locating an ASCII string or an instruction code group. A wild START card feature allows for partial GET BEGINNING ADDRESS AND ENDING ADDRESS matching of sequences up to 16 bytes long.

GET HEX ENTRIES FROM KEYBOARD INTO BUFFER Bob Kovacs 41 Ralph Road SAVE West Orange, New Jersey 07052 SAVE CURRENT ADDRESS POINT TO 1ST ENTRY IN BUFFER

p . Have you ever had to manually search through memory to look for a certain CONVERT ENTRY TO HEX L ^ f sequence? Whether you're searching for a particular series of op-codes or ASCII YES VALID NO text, doing it with the help of a dump HEX ^ MATCH ALWAYS utility or even a disassembler can be COMPARE ENTRY painfully slow and prone to error. AND DATA Clearly this is another job for the com­ puter! The machine language routine described here will accept up to a N 0 ^ EQUAL^ YES 16-byte sequence (easily increased if J. that isn't enough) and identify the NEXT ' f SKIP

starting locations of any matching RESET Si ADVANCE ENTRY PTR sequences within the memory range TO SAVED VALUE specified by the user. NO Although this program was IT'S A MATCH specifically written for use on the AIM MATCH 65, using existing monitor routines PRINT S TARTING whenever possible, it shouldn't be too ADDRESS OF MATCH difficult to adapt it to any other 65XX system. NEXTl

ADVANCE Si

NO DONE The Program DONE The flow diagram in figure 1 defines PRINT CR/LF the major events and decision points in memory search routine. Entry point labels are also included to relate these functions to the implementation (see Figure 1: MEMSEARCH Flow Diagram program listing in figure 2).

No. 35 - April 1981 MICRO - The 6502 Journal 17 Figure 2 0800 1 / The program begins by establishing 0800 2 J a memory search range and the data 0800 3 sequence to be found. This sequence is t 0800 4 t stored in a buffer using keyboard entry 0800 5 ;MEMSEARCH FOR AIM 65 format |2 ASCII bytes per hex byte 0800 6 ; BY BOB KOVACS entry) and is converted to its numerical 0800 7 ; 41 RALPH ROAD equivalent each time it is compared to 0800 8 ; WEST ORANGE, NJ C-7052 memory. Although this approach is not 0800 9 } terribly efficient, it was necessary in 0800 10 ;ALL KEYBOARD ENTRIES order to allow for wild card or 0800 11 ; IN HEXADECIMAL don't-care entries, and still permit all 0800 12 ;NONHEX ENTRIES— "DON'T CARE" 256 possible byte values for valid com­ 0800 13 ? parisons. I'm sure that other 0800 14 ;ALL MATCHES RETURN BEGINNING approaches could have been used to 0800 15 ; ADDRESS OF SEQUENCE speed up execution time somewhat, 0800 16 ? but this method is still fairly fast. The 0400 17 ORG $400 worst case of a search through 4K of 0400 18 OBJ $800 memory (when all but the 16th entry 0400 19 FROM EQU $E7A3 always match) takes about 6 seconds1 to 0400 20 TO EQU $E7A7 complete. 0400 21 MOVE EQU $F910 0400 22 LDAY EQU $EB58 0400 23 PACK EQU $EA84 0400 24 NUMA EQU $EA4'6 0400 25 OUTPUT EQU $E97A The main body of the program 0400 26 REDOUT EQU $E973 operates by comparing the entry 0400 27 BLANK EQU $E83E sequence to the data within the 0400 28 CRLF EQU $E9F0 memory bounds specified by the user. 0400 29 QM EQU $E7D4 This is performed one byte at a time, 0400 30 STIY EQU $A427 starting with the first entry and then 0400 31 ADDR EQU $A41C searching for a corresponding value in 0400 32 SI EQU $A41A memory. If a match is found, then the 0400 33 / 0400 34 second entry is compared to the con­ 1 tents of the next memory location on­ 0400 35 {OUTPUT TITLE ly. This operation is repeated, always 0400 AOOO 36 TITLE LDY #$00 0402 B9BD04 37 TITLE1 LDA M S G ,Y comparing the next entry with the data 0405 F006 38 BEQ TITLE2 in the next memory location. If suc­ 0407 207AE9 39 JSR OUTPUT cessive successful comparisons exhaust 040A C8 40 INY the total number of entries in the buf­ 040B D0F5 41 BNE TITLE1 fer, then the entire entry sequence has 040D 20F0E9 42 TITLE2 JSR CRLF been matched. At this point the 0410 43 9 memory address corresponding to the 0410 44 ;GET BEGINNING & ENDING ADDRESSES first entry is output, and the search 0410 20A3E7 45 START JSR FROM continues at the memory location 0413 BOFB 46 BCS START following the matched sequence. 0415 203EE8 47 JSR BLANK 0418 2010F9 48 JSR MOVE 041B 20A7E7 49 START1 JSR TO 041E BOFB 50 BCS START1 0420 51 ! If at any point an entry fails to 0420 52 ;PROMPT USER FOR HEX INPUT match the contents of memory, then 0420 20D4E7 53 LDBUF JSR QM 203EE8 54 JSR BLANK the starting address corresponding to 0423 0426 A200 55 LDX #$00 the first entry is incremented by one, 0428 56 and the entire operation begins again. t 0428 57 ;GET ENTRY PAIRS & STORE IN BUF 04.28 58 ;EXIT ENTRY MODE WITH CR 0428 2073E9 59 LDBUF1 JSR REDOUT C90D 60 CMP #$0D A number of monitor routines were 042B 04 2D FOll 61 BEQ LDBUF2 used in MEMSEARCH to minimize its 042F 9DCA04 62 STA B U F H I ,X length (192 bytes program and 36 bytes 0432 2073E9 63 JSR REDOUT variable space). A summary of the 0435 9DDA04 64 STA BUFLO,X monitor routines used here is shown in 0438 203.EE8 65 JSR BLANK figure 3, Along with the name and 043B E8 66 INX entry point is a brief description of 043C EOlO 67 CPX #$10 what the routine does. Those registers 043E 90E8 68 BCC L DB UF 1 affected by that call to the monitor are also listed.

18 MICRO - The 6502 Journal No. 35-A pril 1981 Using the Program 0440 8EC904 69 LDBUF2 STX ENTCNT 0443 20F0E9 70 JSR CRLF Load MEMSEARCH through the 0446 71 7 assembler using the listing in figure 2. 0446 72 ; SAVE CURRENT ADDRESS Save the program on tape using the 0446 AD1AA4 73 SAVE LDA SI 'DUMP TO TAPE' command from 0449 8DC704 74 STA TEMPI $400 to $4BF. 044C AD1BA4 75 LDA Sl+1 044F 8DC804 76 STA T E M P 2 0452 77 t After loading MEMSEARCH, begin 0452 78 ;READ BUF & CONVERT TO HEX its execution using the' *' and 'G' com­ 0452 79 ;NON-HEX ACTS AS DON’T CARE mands. The beginning address and 0452 A200 80 LDX #$00 ending address + 1 are entered in 0454 BDCA04 81 CNVRT LDA B U F H I ,X response to the 'FROM' and 'TO' 0457 2084EA 82 JSR PACK prompts. The sequence to be found is 045A B014 83 BCS SKIP entered following the ‘V prompt. 04 5C BDDA04 84 LDA BUFLO,X Values are in hex notation without 045F 2084EA 85 JSR PACK spaces between bytes (spaces are 0462 B00C 86 BCS SKIP automatically inserted). Two 0464 87 t characters must be entered per byte, 0464 88 ;COMPARE TO DATA AT ACTIVE ADDRESS and up to 16 bytes can be specified. 0464 AOOO LDY #$00 89 Non-hex entries act as wild cards and 0466 A91A 90 LDA #$1A match anything. Terminate the se­ 0468 2058EB 91 JSR LDAY quence (if less than 16 bytes) with a 046B CD29A4 92 CMP STIY+2 carriage return. The addresses of any 046E DO IE 93 BNE NEXT matching data sequences in memory 0470 94 / 0470 95 ;MATCH OR DON'T CARE are output and the program loops back 0470 E8 96 SKIP INX to search a new memory block. 0471 ECC904 97 CPX ENTCNT 0474 B007 98 BCS MATQH Applications 0476 20A804 99 JSR ADVS 1 0479 B027 100 BCS DONE What can MEMSEARCH be used 047B 90D7 101 BCC CNVRT for? Well, everyone has his own needs. 047D 102 1 I was prompted to write MEMSEARCH 047D 103 ;GOT A MATCH! in order to locate certain entry points 047D 104 ;OUT SAVED ADDRESS and page zero usage in the AIM 65 047D ADC 804 105 MATCH LDA TEMP2 BASIC interpreter. Unfortunately 0480 2046EA 106 JSR NUMA Rockwell hasn't provided much infor­ 0483 ADC 704 107 LDA TEMPI mation in this area. Nevertheless, I 0486 2046EA 108 JSR NUMA suspected that this was a version of 0489 203EE8 109 JSR BLANK Microsoft BASIC similar to the one 048C D00C 110 BNE NEXT1 known as Applesoft (used in the Apple 048E 111 t IIJ. Although quite a bit is known about 048E 112 ;N0 OR PARTIAL MATCH Applesoft, the memory locations used 048E 113 ;BACK-UP ACTIVE ADDRESS in the Apple and AIM weren't 048E A D C 704 114 NEXT LDA TEMPI necessarily the same. Thus the code 0491 8D1AA4 115 STA SI wouldn't be the same (hence the need 0494 ADC 804 116 LDA TEMP2 for a wild card). With the help of 0497 8D1BA4 117 STA Sl+1 MEMSEARCH I was able to identify 049A 20A804 118 NEXT1 JSR ADVS 1 the required entry points and page zero 049D B003 119 BCS DONE locations in a minimum of time. 049F 4C4604 120 JMP SAVE 04A2 121 7 04A2 122 ;N0 MORE DATA— START AGAIN 04A2 20F0E9 123 DONE JSR CRLF 04A5 4C1004 124 JMP START 04A8 125 i Bob Kovacs is an electro-optics engineer at 04A8 126 .•COMPARE £ BUMP ADDRESS PTR Bendix where he is currently responsible 04A8 AD1AA4 127 AD VS 1 LDA SI for the development of a charge-transfer 04AB CD1CA4 128 CMP ADDR imaging system used for celestial 04AE AD1BA4 129 LDA Sl+1 navigation. He is using an AIM 65 for 04B1 ED1DA4 130 SBC ADDR+1 imager sequencing, data collection and 04B4 EE1AA4 131 INC SI processing in the evaluation of a 04B7 D003 132 BNE ADV breadboard system. At home, Bob is involved with hardware/software projects 04B9 EE1BA4 133 INC Sl+1 on his Apple n. He also enjoys skiing, RTS 04BC 60 134 ADV gardening and photography. 04BD 135 t 04BD 136 t (continued)

No. 35-April 1981 MICRO - The 6502 Journal 19 MICRO Club Circuit (Continued from page 15) 04BD 4D454D 137 MSG ASC 'MEMSEARCH' Apple PI Computer User’s Group 04C0 534541 Rod Nelson, President, William T. 04C3 524348 Davis Secretary preside over this club 04C6 00 138 BYT $00 boasting a membership of 276. Meet­ 04C7 00 139 TEMPI BYT $00 ings are held on the first Thursday of 04C8 00 140 TEMP 2 BYT $00 each month at 7:00 pm, at the Colorado 04C9 00 141 ENTCNT BYT $00 School of Mines, Golden, CO. The 04CA 313233 142 BUFHI ASC '12345678' group meets to help each other learn 04CD 343536 and enjoy computing with Apples. 04D0 3738 Contact: 04D2 313233 143 ASC •12345678’ Secretary 04D5 343536 P.O. Box 17467 04D8 3738 Denver, CO 80217 04DA 313233 144 BUFLOASC •12345678' 04DD 343536 Las Cruces Computer Club 04E0 3738 This dual Apple/TRS-80 users group 04E2 313233 145 ASC '12345678' meets on the first Thursday of each 04E5 343536 month at 7:30 pm at the SW Computer 04E8 3738 Center (121 Wyatt Suite 7, Las Cruces, NM 88001). Leonard Fetterhoff is club president for 25 members. For further information contact the club secretary: John Martellaro Registers 2929 Los Amigos Ct. Apt. B Name Las Cruces, NM 88001 Address Changed Description FROM E7A3 A,X,Y Output 'FROM’ prompt; user in­ Original Apple Corps puts 4 character hex address (ESC Kip J. Reiner is president for this club of & DEL are active) which is stored 300 members. Meetings are held on the @ADDR. Carry set if non-hex second Sunday of the month at noon at value entered. UCLA campus, Young Hall, Room 2224, Los Angeles, CA. This group TO E7A7 A,X,Y Same as FROM except for prompt. publishes a club magazine, "Apple­ sauce” for $15.00 a year. They meet to REDOUT E973 A Return with a single character expand the knowledge of Apple com­ from keyboard in accumulator. puters, hardware and software. For Echo to output device unless CR further information, write: input. Secretary 19041-2 Hamlin Street MOVE F910 A,X 2-byte move from ADDR to SI. Reseda, CA 91335 LDAY EB58 A Performs a LDA (S1],Y without Apple-Can using page zero. Enter with This 200 + membership club meets at accumulator pointing to SI via off­ 7:30 on the first Wednesday of each set from $A400 base address. month, currently at Forest Hill Public Library. Louis H. Milrad is the club PACK EA84 Converts ASCII character in president. This club features many accumulator into hex and packs it guest speakers and promotes the better with previous value (saved in understanding of the Apple computer, STIY + 2). If not hex (i.e. 0-9,A-F) its applications and limitations. They then original character is returned publish a bimonthly newsletter. Many with carry set. active subgroups in Telecommunica­ tions, Medical, Pascal, Forth, Introduc­ NUMA EA46 — Output contents of accumulator as tion to BASIC, Games, Business, etc, 2 character hex. all with an extensive program library. For further information, contact: OUTPUT E97A — Output ASCn code in accumulator Secretary to active output device(s). Suite 204 2 Gloucester Street BLANK E83E A Output a single space. Toronto, Ontario, CANADA M4Y 1L5 CRLF E9F0 A Output a carriage return and line feed.

QM E7D4 A Output a question mark. Figure 3: AIM 65 Monitor Routine Summary JUCftO'

20 MICRO - The 6502 Journal No. 35 - April 1981 TASCll 'EXPh^^ « r > < > „ -?/» < > COMMUNICATIONS by BILL BLUE Described in INFOWORLD as "The GAP9?? finest program for Apple data 2 r T E R M communications..." ASCII EX­ WE’VE GOT YOU PRESS II allows your Apple to com­ by BILL BLUE municate with virtually any com­ puter with dial-up access. _ COVERED!! Written in Applesoft and Machine The Rolls-Royce of communica­ language, Ascii Express II includes tions software. You may find everything you'd expect in a cheaper programs but you'll complete communications pack­ never find one better. Not only age. It features a variety of power­ does it provide everything Ascii ful features including full support Express II does, but then some. of upper/lower case, autodial and Designed for the CP/M environ­ answer capabilities (when used ment using the Z-80 Softcard, Z- with the Hayes Micromodem), and file oriented upload/down­ TERM permitsa number offeatures load facilities. not available elsewhere. S.D.S. offers a complete selection of A built-in line editor gives full communications software to meet editing functions, and program­ almost every user's need. Wethlnkyou'll mable keyboard MACROS reduce • Receives up to 41K of data at a find the three programs described here time. Can send files of any size. complicated log-in procedures to the best available anywhere — and we a few simple keystrokes. back that cldlm with our unconditional • Auto save mode send XOFF Downloaded files may be printed guarantee of satisfaction or your character when buffer is full, while being received, saved to money back. and resumes (with operator disk, or printed later when offline. prompting) after save. The copy mode allows everything To find out more about these programs, shown on the screen to be saved send for more information, or see your in the large (20K) buffer. • Terminal emulation allows you local Apple dealer. to define what kind of terminal Ascii Elxpress II works with the Hayes your Apple should appear as. Micromodem II, Apple communi­ cations card, the CCS Asynchro­ • Entirely in machine language nous Serial card, SSM-AIO Board, Lynx Telephone Linkage System, for maximum speed and and many other communications ijnunE power. devices. by BILL BLUE ONLINE is a completely secure dial-up system Uses include: that allows you to call your Apple computer Z-TERM fully supports the Hayes • Send/receive letters/files from while you're away from home. It also provides Micromodem, Apple Communi­ networks like the SOURCE, for up to 50 optional user accounts. cations card, SSM-AIO board, CCS MICRONET, or other bulletin Asynchronous Serial Card, Lynx ONLINE includes a versatile mail system and board type systems. Communications system and built-in line editor with provisions for up­ others! Fully supports the local loading and downloading programs and • Transferring program files be­ Apple 40 column screen, external files. tween Apples, an Apple and a terminals, and all 80 column TRS-80, PET, etc. Its many applications include use by busi­ boards interchangeably and with nesses for 24 hour answering of field repre­ NO configuration necessary! • Use the Apple as a terminal to a mainframe at a remote loca­ sentatives inquiries, taking orders or adver­ tion with the added advantage tising for your company. It can also be used of being able to process data at by clubs or groups for posting announce­ If you have a Z-80 card, you owe it the Apple before or after ments, or transferring files. to yourself to check this one out transfer. Requires 48K Apple with Hayes Micromodem before you buy any communica­ and DOS 3.3. tions software. If you don't have • Minimize on-line costs by the Z-80 Softcard, you may want quickly transferring files and to get one just to run this package! otheir data. SOUTHWESTERN DATA SYSTEMS P.O. BOX 582-M . SANTEE, CA 92071 'Note: CP/M and Apple DOS files System requirements include a (714) 562-3670 48K Apple with Applesoft in ROM are not directly compatable. or the Language Card, a disk drive, and one of the above com­ munications devices. A lower case display board is recommended, but not required. I No. 35 - April 1981 MICRO - The 6502 Journal 21 OSI SOFTWARE FOR OSI OSI

A JOURNAL FOR OSI USERS!! ADVENTURES Adventures are interactive fantasies where you give the The Aardvark Journal is a bimonthly tutorial for OSI computer plain English commands (i.e. take the sword, users. It features programs customized for OSI and look at the control panel.) as you explore alien cities, has run articles like these: space ships, ancient pyramids and sunken subs. Average playing time is 30 to 40 hours in several sessions. 1) Using String Variables. There is literally nothing else like them — except being there yourself. We have six adventures available. ESCAPE FROM MARS - Explore an ancient 2) High Speed Basic On An OSI. Martian city while you prepare for your escape. NUCLEAR SUBMARINE - Fast moving 3) Hooking a Cheap Printer To An OSI. excitement at the bottom of the sea. PYRAMID — Our most advanced and most 4) An OSI Disk Primer. challenging adventure. Takes place in our own special ancient pyramid. 5) A Word Processor For Disk Or Tape Machines VAMPIRE CASTLE — A day in old Drac's castle. But it's getting dark outside. 6) Moving The Disk Directory O ff Track 12. DEATH SHIP - It's a cruise ship — but it ain't the Love Boat and survival is far from certain. Four back issues already available! TREK ADVENTURE - Takes place on a familiar starship. Almost as $9.00 per year (6 issues) good as being there.

$14.95 each

NEW SUPPORT ROMS FOR BASIC P.C. BOARDS SCREEN EDITORS IN ROM MACHINES MEMORY BOARDS!! - for the C1P. - and they These programs all allow the editing of basic C1S — for the C1P only, this ROM adds full contain parallel ports! lines. All assume that you are using the standard screen edit functions (insert, delete, change Aardvarks new memory board supports 8K OSi video display and polled keyboard. characters in a basic line.), Software selectable of 2114's and has provision fo r a PIA to give a C1P CURSOR CONTROL - A program that uses scroll windows, tw o instant screen clears (scroll parallel portsl It sells as a bare board fo r $29.95. no RAM normally available to the system. (We window only and full screen.), software choice of When assembled, the board plugs into the expan­ hid it in unused space on page 2). It provides OSI or standard keyboard format, Bell support, sion connector on the 600 board. Available now! real backspace, insert, delete and replace func­ 600 Baud cassette support, and a few other tions and an optional instant screen clear. PROM BURNER FOR THE C1P - Burns single $11.95 features. It plugs in in place of the OSI ROM. supply 2716's. Bare board — $24.95. NOTE: this ROM also supports video conversions C2/4 CURSOR. This one uses 366 BYTES of for 24, 32, 48, or 64 characters per line. All that MOTHER BOARD — Expand your expansion RAM to provide a full screen editor. Edit and and it sells fo r a measly $39.95. connector from one to five connectors or use it change lines on any part of the screen. (Basic in C1E/C2E fo r C1/C2/C4/C8 Basic in ROM ma­ to adapt ou rC IP boards to your C4/8P, *$14.95. ROM systems only.) chines. FOR DISK SYSTEMS - (65D, polled key­ This ROM adds full screen editing, software board and standard video only.) selectable scroll windows, keyboard correction ARCADE AND VIDEO GAMES SUPERDISK. Contains a basic text editor with (software selectable), and contains an extended functions similar to the above programs and also machine code monitor. It has breakpoint utilities, A LIEN INVADERS with machine code moves — contains a renumberer, variable table maker, machine code load and save, block memory move for fast action. This is our best invaders yet. The search and new BEXEC* programs. The BEXEC* and hex dump utilities. A must for the machine disk version is so fast that we had to add select­ provides a directory, create, delete, and change code programmer replaces OSI support ROM. able speeds to make it playable. utilities on one track and is worth having by Specify system $59.95 Tape - $10.95 - Disk - $12.95 itself. — $24.95 on 5” disk • $26.95 on 8 ".

TIME TREK (8K) — real time Startrek action. See your torpedoes move across the screen! Real DISK UTILITIES graphics — no more scrolling displays. $9.95 A AR D VAR K IS NOW AN OSI DEALER! SUPER COPY - Single Disk Copier This copy program makes multiple copies, STARF1GHTER — a real time space war where Now you can buy from people who can support copies track zero, and copies all the tracks you face cruisers, battleships and fighters using a your machine. that your memory can hold at one time — variety of weapons. Your screen contains w ork­ -THIS MONTH'S SPECIALS- ing instrumentation and a real time display of the up to 12 tracks at a pass. It's almost as fast Superboard )l $279 as dual disk copying. — $15.95 alien ships. $6.95 in black and white • $7.95 in color and sound. C1P Model II 429 MAXIPROSS (WORD PROCESSOR) - 65D C4P 749 polled keyboard only • has global and line edit, MINOS — A game with amazing 3D graphics. right and left margin justification, imbedded You see a maze from the top, the screen blanks, . . . and we'll include a free Text Editor Tape margin commands, choice of single, double or and then you are in the maze at ground level, w ith each machine! triple spacing, file access capabilities and all the finding your way through on foot. Realistic features of a major word processor — and it's enough to cause claustrophobia. — $12.95 Video Modification Plans and P.C. Boards only $39.95. fo r C1P as low as $4.95 This is only a partial listing o f what we have to offer. We now offer over 100 programs, data sheets, ROMS, and boards fo r OSI systems. Our $1.00 catalog lists it all and contains free program listings and programming hints to boot.

Aardvark Technical Services • 1690 Bolton • Walled Lake, Ml 48088 OSI (313)669-3110 0 5 1

22 MICRO - The 6502 Journal No. 35 - April 1981 Joysticks for the OSI C4

You can do better than to buy This routine is similar to a keyboard Atari joystick plug exactly fits the C4 OSI joysticks for the C4P. Here’s PEEK routine, and the joysticks can be joystick socket. Moreover, the switch­ how to make and test your own. thought of as extensions to the ing inside the Atari joystick unit is keyboard. similar to the switching of C4 joysticks, and there are precisely six Charles Platt There is a chart on page 90 of the old wires in the Atari connecting cable- P.O. Box 556 C4 user's manual, giving the possible just right for the six active pins in the New York, New York 10011 PEEK numbers and the joystick posi­ C4 socket. tions which they represent. Unfor­ The Ohio Scientific Challenger C4 is tunately, the column headings in this There is one snag however. If you designed for use with joysticks, which chart are incorrect. The figures in the look in the holes in the Atari plug, you are available from the manufacturer as columns headed "Action Key De­ will find that not all of them contain an optional extra. Anyone who really pressed” are in fact produced when the metal connectors. Some holes are not enjoys playing and/or programming action key is not depressed, while the used and do not connect to anything. video games will want to take advan­ figures in the "Action Key Not Unfortunately, these holes correspond tage of this feature, since it is much Depressed” column are in fact pro­ with pins in the C4 socket which axe easier to control a game with joysticks duced when the action key is de­ used and must be connected to than by pressing keys on the keyboard. pressed. If you write your own game something. So you have to slice open However, Ohio Scientific joysticks are program it is important to bear this in the molded plastic Atari plug to get at expensive, not as strong as one would mind. This has been corrected in the the metal connectors, which must be like, and often out of stock at one’s 1981 version of the C4P User's reshuffled into the right sequence, leav­ local OSI dealer. Having learned these Manual. ing holes 7, 8, and 9 empty to corre­ hard facts of life, I decided to take mat­ spond with unused C4 pins 7, 8, and 9. ters into my own hands. Either I would Connecting Non-C4 Joysticks convert Atari joysticks (which are very widely available and not too highly There are four trapezoidal sockets The Atari wires are color coded and priced], or I would make my own. on the back panel of the C4, adjacent to should be matched to the C4's pin the fan. The top socket is for Joystick numbers as follows: Joystick Operation A, the next one down is for Joystick B. (The other two sockets are for keypads Black Pin 1 During a game program the com­ A and B.) Orange Pin 2 puter needs to know in which direction Green Pin 3 each joystick is being pushed by the Neither the C4 user's manual nor Blue Pin.4 player|s), and whether the “action the maintenance manual gives precise Brown Pin 5 key” on each joystick is being pressed. information about which pin does White Pin 6 what, in the joystick sockets. How­ Inside the joystick assembly are ever, some trial-and-error tests revealed Once you have opened the plug and four switches which close, one at a the functions that follow. extracted the little metal connectors time, when the stick is pushed up, which slide onto the pins in the down, left, or right. If the stick is Looking at the outside of the joystick socket [some connectors may pushed diagonally, two of the four socket, numbering the pins from left to be tom loose in the plug-opening opera­ switches close simultaneously. In addi­ right, the top row of pins in each socket tion and will need to be resoldered to tion there is a fifth switch which is can be labelled pins 1 through 5, and their wires), you can slide these con­ closed when the player pushes the the bottom row, pins 6 through 9. In nectors individually onto their separate action key. this case, pin 1 is the ground, pin 2 con­ pins, and separate them with small nects to the action key, pin 3 connects pieces of electrical tape to prevent The computer detects these switch to the “Left” switch in the joystick, accidental shorts. You can then test the closures via a POKE command in the pin 4 goes to the ' ‘Down" switch, pin 5 joystick, using the procedure described game program. For example, POKE to the “Right" switch, and pin 6 to the later in this article. 57088,128 directs the computer's at­ "U p” switch. Pins 7, 8, and 9 are un­ tention to Joystick A. Tf the program connected. When you're sure the joystick is next asks for a PEEK c emory loca­ working properly, and all your connec­ tion 57088, this will yield a number My first experiment was with Atari tions have been made correctly, you which corresponds to which switches joysticks. By a rare fluke of standard­ can drip some quick-setting epoxy over are closed inside the joystick assembly. ization in the computer industry, the the metal connectors to encapsulate

No. 35 - April 1981 MICRO - The 6502 Journal 23 them. When the epoxy is dry, the con­ Using microswitches allows a much Since ''Control-C” has been disabled nectors can be slipped off the pins in more positive ''feel” than is available in the program/there is no way of stop­ one unit. The epoxy has, in fact, from the Atari joysticks. My home­ ping the program once it has started, created a new ''plug'' around the con­ made units provide much more precise short of hitting the Break key. So a loop nectors, to replace the original plug control of video games. is used, incrementing K by 1 in each of which had to be sliced open. 200 cycles. The program ends at the Checking Joystick Operation end of the loop. A delay loop is also Making Your Own Joysticks used, to stop the figures from racing To make sure you have wired your uncontrollably across the screen. After using Atari joysticks for a home-made or Atari joysticks correct­ while, I became dissatisfied with their ly, you can run a simple "POKE and Note: line 30, the POKE command, response and decided to build my PEEK” test program. is inside the K loop. This is because own. This turned out to be extremely you must POKE 57088 again after each simple. Program for Joystick A time you have PEEKed it and it has yielded data. If you write a program Each joystick unit consists of a box 10 POKE 2073.96.REM — which repeatedly PEEKs 57088 for data with a wooden top and bottom and DISABLES CONTROL-C. and does not re-POKE it each time, you aluminum sides. (The thin aluminum THE ROUTINE WONT will find that the joysticks won't work is bent around the wood and nailed to FUNCTION TILL YOU DO properly. For a demonstration of this it.) The stick is pivoted where it is THIS. fault, you can run the sample program screwed to the bottom of the box; some 20 FOR K = 1 TO 200:REM — listed on page 93 of the old C4 user's self-centering action is provided by a SEE NOTE BELOW manual, or pages 45-47 in the new manual. This program erroneously fails small compression spring. The stick 30 POKE 57088,128:REM — to POKE 57088 after PEEKing it. protrudes through a 1” square hole in ACTIVATES JOYSTICK A the top of the box. Arranged around this Consequently, as listed, the program hole, screwed to the underside of the 40 P = PEEK(57088) AND doesn't work. top of the box, are four microswitches, 31 :REM — PEEK JOYSTICK A positioned so that their contact buttons 50 PRINT P When you test Joystick A, using the are just touching the four sides of the 60 FOR D = 1 TO 200:NEXT test program shown here, you should stick (which has a square cross-section D:REM — DELAY LOOP find that moving the stick generates, at this point). Lastly, a pushbutton is 70 NEXT K on the video screen, the various mounted on the outside of the top of 80 END numbers listed on page 90 of the old the box to serve as the action key. manual, page 43 in the new manual. If the numbers are as listed, but they ap­ pear in the wrong sequence, you've probably made an incorrect connection in the joystick socket. If the numbers on the screen do not in any way match the numbers in the manual, you have probably made a programming error. Be sure that your PEEK command is PEEK(57088| AND 31. Without the "AND 31" it won't work.

If you are using Atari joysticks and you find that pushing the stick directly up and down, or from side to side, pro­ duces numbers which wrongly indicate diagonal motion, the problem is simply that you are pushing the stick too hard, thus turning on two switches instead of only one at a time. Only very light pressure is required.

Once you have tested Joystick A, you can test Joystick B by rewriting two lines of the test program:

30 POKE 57088,16 40 P = PEEK(57088) AND 248

These are the POKE and PEEK which give access to Joystick B.

Happy game playing!

AlCftO

24 MICRO - The 6502 Journal No. 35-April 1981 AN ENTIRE STAR FLEET FOR $39.95 YOU'LL LOVE ITI THE STARSHIPS. With twelve diffe­ rent starship designs - ranging from dreadnoughts and fighters to star bases and base stations - representing five Qalactic Empires you can set up an astronomical variety of confrontations against another player or the computer. Each class of vessels is awarded a point value to reflect its relative strength so you can assemble fleets of comparable power for a balanced game Of course, your're free to play the intrepid hero against seemingly hopeless odds -perhaps mere fighters against a star base! Employing up to ten ships, both sides can give individual or fleet orders, the latter allowing all your ships to execute your commands in unison. THE COMPUTER aside from being the game's perfect administrator and referee; also serves as your ever- ready, ever-capable nemesis in the multiple solitaire scenarios provided: The Reman Chase (replete with the Cloaking Device, Plasma Torpedoes, and Neutral Zone); Attack on Star Base; Attack on Base Station; and Dogfight THE TWO-PLAYER VERSION is essentially free-form. With each player choosing starships from a different Empire you can create scenarios ranging from space skir­ Like some future starship other "space" games because it mishes to a full-scale, all-out star admiral hurtling through the vast doesn't just fill your screen with war! void of hyperspace at speeds pretty pictures and little substance. FOR $39.95, THE WARP FACTOR is beyond comprehension, you are THE WARP FACTOR is a high- undeniably the most complete and challenged to a battle for cosmic powered tactical simulation that detailed simulation of tactical star­ supremacy. places you squarely in the Captain's ship combat yet designed. It comes THE WARP FACTOR the latest role, dealing with the critical with the 5W' program disc; a computer strategy game from SSI, is parameters of interstellar battle Starship Operating Manual; 3 Star­ what every space war fan has been such as sensor and scanner ship Data Cards; and a Game waiting for - the ability to command readings; energy allocation for Selection Card - all of which will a star fleet in realistic battle weapons (phasers, disruptor bolts, convert your computer into the simulation against alien vessels. photon and plasma torpedoes), gateway to galactic adventure shields* and warp engines; and It is light years ahead of all battle damage. THE WARP FACTOR”. The Universe Awaits Your Command. Credit card holders, if you own ari All our games carry a 14-day □ Computer Quarterback (a real­ Apple®II 48K (Applesoft ROM) and a money-back guarantee. time strategy football game): $39.95. mini-floppy disc drive, call 800-227- While you're at it you can also get our □ Computer Conflict (two modern- 1617 ext 335 (toll free)and charge other games: day tactical warfare simulations REBEL FORCE RED your order to your VISA or MASTER­ FOR YOUR APPLE®: featuring and CARD. In California call 800-772-3545, □ Computer Bismarck: $59.95. ATTACK)-- $39.95 □ Computer Air Combat (a simula­ ext 335. □ Computer Ambush (a tactical sim­ tion of air combat in WW1I): $59.95. To order by mail send your check ulation of man-to-man combat in to: Strategic Simulations Inc Dept M, WWIl): $59.95. FOR YOUR TRS-80®: 465 Fairchild Drive, Suite 108, Moun­ □ Computer Napoleonics, the Bat­ □ Computer Bismarck, 48 K Disc tain View, CA 94043. tle of Waterloo: $59.95. $59.95. 32K Cassette $49.95. Apple Is a registered trademark of Apple Computer Inc. TRS-80 Is a registered trademark of Tandy Corporation

No. 35 - April 1981 MICRO - The 6502 Journal 25 DATA CAPTURE 4.0 The most advanced and easiest to use telecommunications program for use with the MICROMODEM II® or the Apple COMMUNICATIONS CARD®

Q. Will DATA CAPTURE 4.0 work with my Communica­ Q. What type files can I read and save with DATA tions Card**' and a modem? CAPTURE 4.0? A. It makes using the Comm. Card almost as easy as using A. Any Apple DOS sequential text file. You can create and the Micromodem II. edit EXEC files, send or receive VISCIALC© data files, Q. Do I need an extra editor to prepare text for transmis­ send or receive text files created with any editor that uses sion to another computer? text files. A. No. DATA CAPTURE 4.0 gives you control of. the text Q. Can I leave DATA CAPTURE 4.0 running on my Apple buffer. You can use DATA CAPTURE 4.0 to create text. at home and use it from another system? Q. Can I edit the text I have prepared? A. Yes. If you are using the Micromodem II** you can call A. Yes. You can insert lines or delete any lines from the text. DATA CAPTURE 4.0 from another system. This is handy if you are at work and want to transmit something to your Q. How about text I have captured. Can I edit that? unattended Apple at home. A. As easily as the text you have prepared yourself. You can delete any lines you don't want to print or save to a disk file. Q. Where can I buy DATA CAPTURE 4.0? You can also insert lines into the text. A. Your local Apple dealer. If he doesn't have it ask him to order it. Or if you can't wait order it directly from Southeast­ Q. Just how much text can I capture with DATA ern Software. The price is $65.00. To order the Dan CAPTURE 4.0? Paymar Lower Case Adapter add $64.95 and include the A. If the system with which you are communicating accepts a serial number of your Apple. stop character, most use a Control S, you can capture an Q. If I order it directly how can I pay for it? unlimited amount of text. A. We accept Master Charge, Visa or your personal check. Q. How does that work? And do I have to keep an eye on You will get your order shipped within 3 working days of how much I have already captured? when we receive it no matter how you pay for it. Send your A. When the text buffer is full the stop character is output to order to us at the address shown or call either of the the other system. Then DATA CAPTURE 4.0 writes what numbers in this advertisement. You can call anytime of has been captured up to that point to a disk file. This is day, evening or Saturdays. done automatically. Q. I bought DATA CAPTURE 3.0 and DATA CAPTURE 4.0 Q. Then what happens? sounds so good I want this version. What do I do to A. Control is returned to you and you can send the start upgrade? character to the other system. This generally requires A. Send us your original DATA CAPTURE 3.0 diskette and pressing any key, the RETURN key or a Control Q. documentation, the $35.00 price difference and $2.50 for Q. Are upper and lower case supported if I have a Lower postage and handing. We will send you DATA CAPTURE Case Adapter? 4.0 within 3 working days of receiving your order. A. Yes. If you don't have the adapter an upper case only Q. What kind of support cm I expect after I buy it? version is also provided on the diskette. A. If you have bought from Southeastern Software in the past Q. Do I need to have my printer card or Micromodem ir* you know we are always ready to answer any questions or Communications Cartin any special slot? about our products or how to use them. A. No. All this is taken care of when you first run a short program to configure DATA CAPTURE 4.0 to your system. Requires DISK 11®, Applesoft If® and 48K of Memory Then you don't have to be concerned with it again. If you move your cards around later you can reconfigure DATA CAPTURE 4.0. DATA CAPTURE 4.0© O. Do I have to build a file on the other system to get it Copyright© 1980-Southeastem Software sent to my Apple? A. No. If the other system can list it you can capture it. ‘ Apple*, Apple II P1u*», Dak II™ and APPLESOFT II* are trademark of Apple Q. How easy Is It to transmit text or data to another Computer Company. system? * Micromodem ir» is a Irademarii of O.C. Hayes AsaooaM, Inc A. You can load the text or data into DATA CAPTURE 4.0 from the disk and transmit it. Or you can transmit what you • ViaicalC(e>-Copyrl 0M by Software Aits, Inc. have typed into DATA CAPTURE 4.0. Q. How can I be sure the other system receives wtiat I send it? A. If the other system works in Full Duplex, it ‘echoes' what We welcome your person^ you send it, then DATA CAPTURE 4.0 adjusts its sending check. We also accept Visa and Master Charge. speed to the other system and won't send the next charac­ ter until it is sure the present one has been received. We call that ‘Dynamic Sending Speed Adjustment*. Q. What if the other system works only In Half Duplex. A. A different sending routine is provided for use with Half Southeastern Software Duplex systems. Q. What If I want to transmit a program to the other Dept. MK system? 6414 Derbyshire Drive • New Orleans, LA 70126 A. No problem. You make the program into a text file with a program that is provided with DATA CAPTURE 4.0, load it 504/246-8438 504/246-7937 into DATA CAPTURE 4.0 and transmit it.

MICRO - The 6502 Journal No. 35 - April Apple Memory Maps, Part 1

Your Apple can draw accurate memory maps of Integer BASIC and Applesoft programs, together with their associated Applesoft Card variables, arrays, and strings, by using the Information contained in various pointers. DOS, APPLE II NO CARD MAXFILES, and RAM Applesoft can also be displayed. Switch up Switch down Peter A. Cook 1443 N. 24th Street Mesa, Arizona 85203

This article will be presented in two Integer Integer Integer parts. Part 1 contains examples of DOS ‘INT’ BASIC BASIC BASIC memory maps produced by the Apple, which show where the computer stores programs in its memory. Part 2 will contain the “Memory Map” program listing and a description of how it works. RAM Memory maps show where com­ ROM ROM puters store data in their memories. A Applesoft DOS ‘FP’ Applesoft Applesoft (disk) 48K Apple actually has 65,536, or 64K, memory locations in which data can be stored. Locations 0 to 49151, the first 48K, are available for storing changeable information (Random Access Memory), while locations 49152 to 65535, the last 16K, are for permanently-installed data which can't be changed by the user (Read Only Memory). The computer places data Integer Integer into specific locations in the RAM BASIC BASIC memory area, depending on what type data it is, and which language is being used. ROM Various charts in the Apple no DOS Applesoft reference manuals show where pro­ grams are stored in RAM, along with their associated variables, arrays and strings. The disk and cassette versions of Applesoft are also stored in this area, RAM RAM and so is the Disk Operating System Applesoft Applesoft and its file buffers. The charts are (cassette) (cassette) adequate for simple programs, but for more complex ones you need to know exactly how much space is used by the different program components. This is especially important if the Hi-Res Figure 1: Language availability for various configurations of the Apple II. graphics pages are used, or if machine language subroutines are included.

No. 35-April 1981 MICRO - The 6502 Journal 27 Description

The following maps cover the MEHORV Apple's RAM memory area from 2048 HfiP: INTEGER BfiSIC to the highest available RAM location i ______in your machine. The area from 0 to HH 4 9 1 5 2 $ C 0 0 0 1 2047 is not included because it is used 1 by the computer for various internal i

functions and is not generally available 1 for BASIC programs. 1 i

i The MEMORY MAP program will HIRES provide the following information:

2 4 5 7 6 |

1. Maximum amount of RAM $ 6 0 0 0 ! FREE SPACE 4 7 1 0 4 $ B 8 0 0 1 available. i

1 6 3 8 4 I 2. Whether or not DOS has been booted. $ 4 0 0 0 i i i

1 3. Number of DOS file buffers re­ 8 1 9 2 i

served (MAXFILES). $ 2 0 0 0 1

!

4. Current language in use. i

i 5. Whether or not a program has been loaded, or run.

LM 2 0 4 8 $ 0 8 0 0 1 6. Location and length of program, i variables, arrays, and strings. Figure 2: Integer BASIC map with nothing In memory. 7. Amount of free space remaining.

8. Setting of LOMEM and HIMEM.

9. Location of Hi-Res graphics pages.

10. Extent; of the "garbage collection” MEHORV HftP: INTEGER BASIC of old strings.

i ______The program will work with all ver­ HM. 4 9 1 . 5 2 $ C 0 0 0 * 1 sions of the Apple II or Apple n Plus, ranging in size from 16K to 48K, with i either the old monitor ROM or the new autostart ROM installed. It will accept i

i programs from cassette as well as disk, HIRES i but it will only work with DOS version I 3.2. i 2 4 5 7 6

The program was designed for use $ 8 0 0 0 ! F R E E S P A C E 4 7 0 9 8 $ B 7 F P i with Integer BASIC, RAM Applesoft, or I i ROM Applesoft. However, I do not 1 6 3 8 4

i know what the results will be if you $ 4 0 0 0 use these languages with the Pascal I ! language system installed. Language availability for various configurations 8 1 9 2 2 0 5 4 $ 0 8 0 6 of the Apple II is shown in figure 1. $ 2 0 0 0 ! UARIRBLES

i R R R f t V S Integer BASIC Memory Maps |

The following examples show how ! S T R I N G S i — the MEMORY MAP program can be LH 2 0 4 8 $ 0 8 0 0 used with Integer BASIC programs. We will use a 48K Apple II with Applesoft card in slot 0, printer in slot 2, and disk Figure 3: Integer BASIC map showing area for variables. drive in slot 6. For the first example, turn on the computer without loading DOS. Enter the monitor and load the

28 MICRO - The 6502 Journal No. 35 - April 1981 MEMORY MAP machine language pro­ gram from cassette. Enter BASIC and use CALL 13000 to run it. More de­ MEHORV MAP: INTEGER BASIC tailed loading instructions will be pro­ vided in Part 2, along with the actual ■! HM 49152 $C000 program itself. PROGRAM 3200.38DFR 49138 $BFF2 Control B CALL 13000

HIRES Figure 2 shows that LOMEM is set at 2048, HIMEM is set at 49152, and 24576 47,104 bytes of free space are waiting to $6000 FREE SPACE 47090 $B7F2 be used. Now define a simple variable and 16384 call MEMORY MAP again. $4000 A = 1 8192 CALL 13000 $2000 Figure 3 shows that the variable is stored just above LOMEM and contains 6 bytes, as do all simple variables in Integer BASIC.

i------1 2048 $0800 Clear the variable and enter the same statement in the form of a program. Figure 4: Integer BASIC map showing program area. Reset, Control B 10 A = 1 20 END CALL 13000

Notice that the program has been stored just below HIMEM, as shown in MEHORV MAP: INTEGER BASIC figure 4.

HM 49152 $C000 Load the program again, and this PROGRAH time ran it to see what happens. 49138 $BFF2 Reset, Control B 10 A = 1 20 END HIRES RUN CALL 13000 24576 $6000 FREE SPACE 47084 $B7EC The program creates the same variable in figure 5 that was entered in figure 3.

16384 Now load the DOS. Type INT to $4000 remove the greeting program, then re­ enter the above program and run it. The h i 3 2 2054 $0806 DOS boot will clobber MEMORY $2000 UARIABLES MAP, so it too will have to be reloaded. Now that we have DOS, we can use BRUN MEMORY MAP instead of the ARRAVS separate commands for loading and calling 13000. STRINGS „H 2048 $0800 Reset, Control B PR#6 INT Figure 5: Integer BASIC map after running program. 10 A = 1 20 END RUN BRUN MEMORY MAP

No. 35 - April 1981 MICRO - The 6502 Journal 29 Figure 6 shows the large amount of space used by the DOS and its file buf­ fers. The default number of buffers, three, has been reserved and HIMEM MEHORV MAP: INTEGER BASIC has been reset to 38400. 49152 $C000 For a more complex case, let's f ills , reserve the maximum number of file FILES <3} buffers, 16, drastically change the values of LOMEM and HIMEM, and HM 38400 $9600 run our same program again. Be aware PROGRAM that LOMEM: and HLMEM: are not HIRES 38386 $95F2 legal Integer BASIC commands, but can be used with DOS. 24576 $6000 INT FREE SPACE 38332 $8DEC MAXFILES 16 LOMEM: 14000 163U4 HIMEM: 15000 $4000 10 A = 1 20 END 8192 RUN 2054 $0806 BRUN MEMORY MAP $2000 VARIABLES

The memory map in figure 7 shows ARRAVS that everything has been set as specified. Note the small amount of STRINGS free space remaining. i------! l m 2048 $0800

Applesoft Memory Maps Figure 6: Integer BASIC map showing DOS and program.

Applesoft stores everything quite differently than does Integer BASIC. To demonstrate, type FP to change languages and clear the preceding pro­ gram, then call MEMORY MAP.

FP MEM0RV MAP: INTEGER BASIC CALL 13000

Figure 8 shows that the program $C000 storage area is now at the bottom of DOS* memory instead of at the top. With no FILES <16) program loaded, the program pointer 30665 $7?C9 starts at 2049 and the end of program HM 15000 $3A98 pointer starts one or two bytes higher. HIRES LOMEM is set above the program. PROGRAM Location 2048 contains a "O'' because 14986 $3 ASA each program line must be preceded by 24576 a zero. $6000 FREE SPACE 980 $0304 16384 $4000 In Applesoft, the variables, arrays, 1400G $36B6 and strings are all stored in separate 8192 VARIABLES areas instead of in the one combined $2000 area used by Integer BASIC. We can see ARRAVS this by creating some simple examples and looking at the result with MEMORY MAP. STRINGS LM 14000 $36B0 A = 1 2048 $0800 DIM B(10) C$ = “ STRING” CALL 13000 Figure 7: Integer BASIC map with changed LOMEM and HIMEM.

30 MICRO - The 6502 Journal No. 35 - April 1981 Notice in figure 9 that the variables start at LOMEM. Applesoft variables ! MEHORV MAP: APPLESOFT are seven bytes long. The variable area contains 14 bytes, for A and C$. Arrays f ' ! 49152 $C000 in Applesoft can be multidimensional, ! DOS, so they are placed in a separate location above the variables. The array space is ! FILES <3> determined by rules given in the ! HM 38400 $9600 Applesoft reference manual, pages 119 and 137. The string variable C$ is ! HIRES stored in the variable area with a pointer to the word “STRING'' in the ‘ 24576 string area. Note that the string area ! $6000 ! FREE SPACE ! 36349 $8DFD contains exactly six characters. Something interesting happens ! 16384 when you put the above statements ! $4000 into the form of an executable program. Clear the memory, type in the pro­ ! 8192 gram, and look at its memory map to see that the program has indeed been ! $2000 stored. See figure 10.

> LM 2051 $0803 FP ! PROGRAM 10 A = 1 ! 2049 $0801 20 DIM B(10) 30 C$ = “ STRING” ! 2048 $0800 CALL 13000

Now run the program and look at it Figure 8z Applesoft map with only the DOS In memory. again.

RUN CALL 13000

Figure 11 shows that the variable area C i MEM0RV MAP : APPLESOFT still contains 14 bytes, and that array B is still the same, but there is no string ) 49152 $C000 in the string area. This is because the ! DOS, letters of the string are contained in the i FILES < 3 > program area, and the pointer in C$ HM 38400 $9600 obtains the string from the program. STRINGS 38394 $95FA HIRES Whenever new characters are assigned to the same string variable, 24576 they are added to the string area even if $6000 FREE SPACE 36267 $8DAB they are the same as those already assigned to that variable. A clutter of 16384 old strings thus begins to form, known as the "garbage collection." Its forma­ $4000 tion can be demonstrated by entering 2127 $084F the same statement several times. 8192 ARRAVS $2000 2065 $0811 FP VARIABLES A$ = “ STRING” LM 2051 $0803 A$ = “ STRING” A$ = “ STRING” PROGRAM CALL 13000 2049 $0801 2048 $0800 Notice in figure 12 that there are now 18 bytes stored in the string area, even though only six of them are being used. Figure 9: Applesoft map showing variable, array, and string areas.

No. 35 - April 1981 MICRO - The 6502 Journal 31 The variable area contains seven bytes for A$, the one variable in use.

The Applesoft reference manual ! MEMORY MAP: APPLESOFT makes the following statement on page i 53: i 49152 $C000 ! DOS, "Applesoft stores duplicate strings I only once. That is, if A$ = FILES <3 > j "PIPPIN" and B$ = "PIPPIN" then HM 38400 $9600 the string "PIPPIN'' will be stored i only once." ! HIRES

Let's try it and see. ! 24576 ! $6000 FREE SPACE 36314 $8QQA FP ! A$ = “ PIPPIN” ! 16384 El$ = “ PIPPIN” ! $4000 CALL 13000 i

Figure 13 shows that there are 12 bytes i 8192 in the string area instead of only six. If ! $2000 you enter the monitor mode and ex­ i amine the variable area you will see I LM 2086 $0826 that the two string variables point to i PROGRAM different locations in the string area. I ------2049 $080 i This obviously indicates that Applesoft I does not store duplicate strings only 2048 $0800 once. I

The actual length of a program Figure 10: Applesoft map showing program area. doesn't always correspond with the amount of memory required. Just because your program is short doesn't mean you have lots of memory left over. In Applesoft it is easy to create a i multidimensional array which uses up MEMORY MAP. APPLESOFT i all memory space in a 48K machine. 1 i - FP 49152 $C000 1 DIM A(97,73) i DOS, i BRUN MEMORY MAP i FILES C 3 > 1 i HM 38400 $9600 ! i Figure 14 shows that there are only 80 i free bytes remaining after dimensioning HIRES ! i the array. To verify that MEMORY MAP 1i is indeed providing accurate informa­ i tion, you can check the free space re­ 24576 ! I maining by using the FRE(0] command. $6000 ! FREE SPACE 36238 $8D8E ! j i PRINT FRE(O) 16384 J 1 80 $4000 ! 1 i - 2162 $0872 ! 8192 i If you don't need to use floating ARRAYS i point numbers, a good way to save $2000 ! - 2100 $0834 ! array space is to define the array as an VARIABLES 1 t- integer array. LM 2086 $0826 ! PROGRAM t FP i . 2049 $0801 ! DIM A%(97,73) i BRUN MEMORY MAP 2048 $0800 i i

Figure 11: Applesoft map after running program.

32 MICRO - The 6502 Journal No. 35-April 1981 Note the large difference in space required for the array in figure 15 as MEHORV MOP: APPLESOFT compared to the preceding one. The ad­ dition of a % sign saved 21,756 bytes! 49152 $C000 If you don't have ROM Applesoft in­ DOS# stalled, you must load Applesoft into FILES <3> RAM from either cassette or disk. To HM 38400 $9600 demonstrate, turn off the computer and STRINGS remove the Applesoft card. Turn the HIRES 38382 $95EE computer back on and load Applesoft from disk by typing FP. Then run 24576 MEMORY MAP to see where RAM Applesoft is stored. $ 6 0 0 0 FREE SPACE 36324 $8DE4 Control B 16384 PR#6 $4000 FP BRUN MEMORY MAP 8192 $2000 2058 $080A Figure 16 shows that RAM Applesoft is VARIABLES stored below the program area, and that LM 2051 $0803 it uses a large amount of space. By referring to the Hi-Res locations on the PROGRAM left, you can see that Hi-Res graphics' 2049 $0801 page one is not available when using 2048 $0800 RAM Applesoft.

For our final example, let's create Flgun 12: Applesoft map showing formation of “ garbage collection” for one string the most complicated map possible by variable. using RAM Applesoft, a different LOMEM and HIMEM, and all types of variables. I also tried to change MAXPILES, but it doesn't seem to work with RAM Applesoft. See figure 17. MEMORV MAP: APPLESOFT LOMEM: 15000 49152 $C000 HIMEM: 20000 DOS, A - 1 FILES <3> DIM B(10) C$ = "STRING” HM 38400 $9600 CALL 13000 STRINGS HIRES 38388 $95F4

24576 $6000 FREE SPACE 36323 $8DE3 That concludes the examples. Next month's article will contain the Memory Map program listing and will 16334 describe how it works. $4000

8192 Lieutenant Colonel Pete Cook is a jet pilot $2000 2065 $0811 instructor at Williams Air Force Base. He is assigned to the Air Force’s Human VARIABLES Resources Laboratory, Operations Training LM 2051 $0803 Division, a large research facility for PROGRAM designing advanced aircraft simulations, and one of the largest computer complexes 2049 $0801 in Arizona. i------2048 $0800 i This is his third article for MICRO.

Flgun 13: Applesoft map of two string variables with duplicate strings. (continued)

No. 35 - April 1981 MICRO - The 6502 Journal 33 APPLE II SOFTWARE FROM POWERSOFT r P. O. BOX 157 PITMAN, NEW JERSEY 08071 MEMORY MRP: APPLESOFT (609) 589-5500 49152 $C000 SUPER CHECKBOOK 3 .0 -A vastly improv- ed version of our popular selling program. DOS* With new features such as: simplified but powerful transaction entry and modifica­ FILES <3> tion routines, new reconciliation routines, additional features such as 30 percent in­ HM 38400 $9600 crease in the total number of checks han­ dled, posting of interest from interest bear­ ing checking accounts, automatic teller transactions, bullet proof error handling, HIRES and smart disk routines. Plus the program still contains the options of bar graphs, sorting, activities, and account status ...... Disk Only/Applesoft $34.95 24576 Of special interest to owners of older ver­ $6000 FREE SPACE 80 $0050 sions of the program is a limited trade-in period ending May 31, 1981. Trade-in value $19.95 cassette $24.95 diskette. Original tape or diskette must be returned to receive 16384 new version plus $1.50 freight and the dif­ ference between $34.95 and the trade-in $4000 value. A conversion program is included to convert data files to the new format. ADDRESS FILE GENERATOR —Allows the 8192 user to create any number of four types of $2000 38320 $95B0 address files: Holiday, Birthday, Home and Commercial. The program contains a menu ARRAYS of seven major commands used to: Create, Add, Edit, Display, Search, Sort, -and LM 2051 $0803 Reorganize Files. Up to three fields may be used for the sort criteria. Major commands PROGRAM have subordinate commands which adds to the flexibility of this powerful software 2049 $0801 system. We doubt you could buy a better program for maintaining and printing ad­ 2048 $0800 dress files ...... Disk Only/Apple Printer Card/Applesoft $24.95

SPANISH VOCABULARY DRILL FRENCH VOCABULARY DRILL Figure 14: Applesoft map of large floating point array. ITALIAN VOCABULARY DRILL GERMAN VOCABULARY DRILL These programs provide practice in foreign language vocabulary by means of three types of drills: Matching, Foreign Language to English and English to Foreign Language. Although the diskette comes with some lessons on it, these are intended MEMORY MAP: APPLESOFT to be samples. The most effective way to use these programs is to enter your own lessons from the course you are studying. To facilitate the entry of new lessons, each 49152 $C000 program contains a complete Lesson Editor which has various entry and revision op- DOS, tions. The manual also contains instruc­ tions for converting the programs to other FILES <3> languages ...... Disk Only/ Applesoft each $24.95 HM 38400 $9600

SPACE TREK J —Your mission is to patrol the galaxy, and to seek out and destroy the ships of the Kfarian fleet. At your command HIRES is the starship Lexington. The Lexington has a wide variety of weapons, sensors and other devices useful in your mission. There 24576 are two kinds of Klarian ships Regular and Super. Regular Klarians have an average $6000 FREE SPACE 21836 $554C energy supply of 5000 to 12000 quarks while Super Klarians have 12500 to 15000 quarks and are protected from some of the Lex- ingtons’ weapons and attack strategies ... 16384 Oisk Only/Applesoft $19.95 $4000 WORLD OF ODYSSEY-An adventure game utilizing the full power of Disk II, which enables the player to explore 353 rooms on 6 different levels full of dragons, 8192 dwarfs, ores, goblins, gold and jewels. The program allows the player to stop the game $2000 16564 $4084 and to resume at a later tim e ...... Disk Only/Applesoft $24.95 ARRAYS GALACTIC EMPIRES-Pits 1 to 20 players LM 2051 $0803 against each other and the computer in a struggle for control of up to 40 star PROGRAM systems.The players compete by sending 2049 $0801 out fleets of ships to capture neutral planets and to attack the colonies of other 2048 $0800 players. The victor is the player who con­ trols the most stars by game's end ...... Applesoft $14.95 Dealer Inquiries Invited Visa and MasterCard Figure 15: Applesoft map of large Integer array. POWERSOFT P. O. BOX 157 I PITMAN, NEW JERSEY 08071 I I. _____(609) 589-5500 J 34 MICRO - The 6502 Journal No. 35 - April 1981 MEMORY MOP: APPLESOFT

49152 $C000 DOS, FILES <3) HM 38400 $9600

HIRES

24576 $6000 FREE SPACE 26109 $65FD 16384 $4000

8192 $2000 LM 12291 $3003 PROGRAM 12289 $3001 APPLESOFT 2048 $0800

Figure 16: Applesoft map with RAM Applesoft loaded.

Fast, inherently structured, MEMORY MRP: APPLESOFT programming system ready for your APPLE II or II + (24K). 49152 $C000 Extensive, professional, 100 page bound documentation. Cleanly DOS , interfaced to DOS 3.2 or 3.3. Files FILES <3> are completely compatible with 38400 $9600 DOS or BASIC. HM 20000 $4E20 • Control C break and continue HIRES STRINGS for reasonable debugging. 19994 $4E1A • Built-in, convenient editor. 24576 • FORTH structured assembler. $6000 FREE SPACE 4918 $1336 • The best blend of FORTH and the APPLE'S capabilities 1 C30.il $3AE4 • Supports games, music, I/O, I O J o 'r 15076 graphics, disk, tape. $4000 ARRAYS • Supplied on APPLE diskette. $3AA6 15014 • Excellent for applications or 8192 VARIABLES systems programming. $2000 LM $3A98 • After two years, still $49.95 12291 $3003 Calif, residents a d d $3.00 PROGRAM sales tax 12289 $3001 From your dealer or direct from: APPLESOFT SOFTAPE, Dept. f. 2048 $0800 10432 Burbank Blvd. North Hollywood, CA 91601 or Call: 1-213-985-5763

Figaro 17: Applesoft map showing most complex case. FOG-279 $49.95 Master Charge/Visa Accepted. JMGRO~ Apple is a registered trademark of APPLE COMPUTER. INC.

No. 35 - April 1981 MICRO - The 6502 Journal 35 AIM SUPPORTWARE * ★ ★ BRINGS YOU A FULL SPECTRUM ★ ★ M M M M OF SUPPORT for your AIM-66 SYSTEMI ★i ★ ★ END FRUSTRA TIONH ENCLOSURE, extra board opt. (enclosure gp)...... $ 46. ★ Dram Plus (Computerist) 16K. . . .$325. . . .32K. . . .395. FROM CASSETTE FAILURES * f t Video Plus II (Computerist) ...... 325. ★ PERRY PERIPHERALS HAS Additional memory, 2114’s 300nS. each ...... 5. ★ THE HDE SOLUTION 2K dynamic RAM, 4116’s 200nS. each ...... 5. ★ OMNIDISK SYSTEMS (5" and 8") Power Supply: 5V-10A, 24V-.5A, - 12V-2A ...... 65. ★ Mother Plus (Computerist)...... 125. ACCLAIMED HDE SOFTWARE ★ Stand alone processor, 2MHz Industrial Qual ...... 12. • Assembler, Dynamic Debugging Tool, ★ 1 MHz Commercial Qual ...... 8.50 Text Output Processor, Comprehensive ★ *2MHz processor will not run machine at 2MHz. Memory Test PRINTERS: Epson MX-80 9 x 9 matrix, bidirectional, 80 ★ ★ • Coming Soon—HDE BASIC CPS, enhancement mode, normal or double enhancement PERRY PERIPHERALS S-IOO PACKAGE mode, adjustable # characters per inch, right hand justifica­ ★ tion, graphics...... $645. ★ Adds Omnidisk (5") to PRINTERS! Ml2 7 x 16, red & black, bidirectional, 180 CPS, ★ Your K IM /S - 1 0 0 System tractor feed up to 19 inches...... $900. Construction Manual—No Parts BASIC .... $96 ... . PL/65 .... $125 .... FORTH .... 146. FODS & TED Diskette AMDEK (Leedex) B/W Monitor ...... Video 100 ...... 169. $20. -*-$2. postage & handling. (NY residents Video 100 G (Green Phosphor Tube) ...... 189. add 7% tax) (specify for 1 or 2 drive system) ★ Video 100-80 (has room for std. disk & 11” 11” x14” PC Place your order with: board for control electronics)...... 199. ★ ★ PERRY PERIPHERALS Coming soon from Amdek — Terminal keyboard ★ 58 key, 2 microprocessor control of video. P.O. Box 924 Has RS-232 and built-in telephone coupler. ★ Miller Place, N.Y. 11764 ★ FORTH is a high speed interpreter. It runs approximately 10 (516) 744-6462 ★ times faster than BASIC. It is extensible, meaning you can add to it and even change word meaning. (There are no ★ Your Full-Line HDE Distributor/Exporter reserved words.) New command words can be as much as 31 char, long, containing any char, but space, rtn. or exc., f ------even in first position. FORTH is modular for fast develop­ ment and debugging. AIM 65 FORTH has floating point For your A IM 65 arithmetic, unavailable on some machines. FORTH is the most advanced language available on any 8-bit micro, and comes in two 4K ROM’s that plug into the BASIC SLOTS. No MI-J I User applications connector disk system is necessary. With FORTH on board, you will - Convenient features definitely be proud to be an AIM owner, and will hopefully — add to the growing wealth o f software written in FORTH. MIC and EAR jocks for cassette recorders AIHI Supportware shops around to bring you the best prices. Also available: A run-time monitor for the AIM. RS232C or 2 0 mAmp serial ports 2K in EPROM, $95, or cassette, $70. The Run-time Monitor is a tremendous value when the AIM is used as a controller. 16 I/O lines + 4 control lines— VIA signals It incorporates a task scheduler which allows vectoring to and from sub-routines written in machine code or a higher Solder pads for remote lines level language. And if you don't yet have an AIM, from ROCKWELL MICRO .INTERFACES, INC. © Mi-JI INTERNATIONAL, we have the Advanced Interactive Micro­ computer with 8K Monitor, 20 char, display and 20 char. printer: 1K RAM...... $419. 4K RAM...... 499. 4K Dual Pass Assembler...... 82. 'i li p p M r Coming soon from AIM Supportware: A versatile extended editor, with convenience foremost. Features Grab & Stash # of lines, paragraph, or page, for move or dup. Homing point. Global search and replace, MICRO INTERFACES, Inc. Assembled, fas tad 29.95 Improved Change and much more. P.O. Box 14520 ( SO-day warranty) Also available from AIM Supportware: Custom software Minneapolis, MN 554I4 Bora PC board 13.95 (6I2 - 426-4 603 } and hardware development. And within Indiana, Applica­ tions Engineering consultation. A** about our Microcomputer DC Control System (UCS) For detailed information on any of the above, write AIM Iwith ROM-based software for real-time control with BASICc \ Supportware, P.O. Box 681, 1112 So. FORTH St., Terre Haute, IN 47802 or call (812) 232-8824.

36 MICRO - The 6502 Journal No. 35 - April 1981 SYM Time-Remaining Tim er

This program measures elapsed 08 0 0 1 ************************* 0 8 0 0 2 * time and sounds an alarm when 0 8 0 0 3 * TIME RAMAINING TIMER * 0 8 0 0 4 * * the preset limit is reached. 0 8 0 0 5 * RALPH R. ORTON * 0 8 0 0 6 * * 0 8 0 0 7 0 8 0 0 8 0 8 0 0 9 FOR THE SYM-1 Ralph Orton 0 8 0 0 10 SHOWS TIME REMAINING ON READOUT 16015 San Fernando Mission Blvd. 0800 11 AND SOUNDS A SETTABLE WARNIN.G. 0 8 0 0 12 DISPLAYS READY WHENEVER TIMER Granada Hills, California 91344 0800 13 IS STOPPED. 0 6 0 0 14 0 8 0 0 15 TWO MODES OF OPERATION: 0 8 0 0 16 " R E S E T " & "ACCUMULTE" 0 8 0 0 17 0 8 0 0 18 L O A D riMEF INTERVAL AND WARNING 0 8 0 0 19 TIME STARTING AT ADDRESS $0000 AS Here's a neat little timer for a 0 8 0 0 20 SHOWN . LOAD MODE AT $0006. PRO­ "barebones" IK SYM that can satisfy a 0 8 0 0 21 GRAM STARTS AT $0200 ...... 0 8 0 0 22 host of timing chores for you. Time 0 8 0 0 23 HRSSETEPZ $00 ;SET HOURS HERE phone calls, eggs, exercise sessions and 0800 24 MINSET EPZ $01 ;SET MINUTES HERE 0800 25 SECSET EPZ $02 ;SET SECONDS HERE contests. Don't miss TV shows, dates 0 8 0 0 26 HRSWAR EPZ $03 ;WARNING HOURS HERE or appointments. My own most fre­ 0800 27 MINWAR EPZ $04 ;WARNING MINUTES HERE 0 8 0 0 28 SECWAREPZ $05 ;WARNING SECONDS HERE quent use is to keep from ‘‘timing out” 0 8 0 0 29 MODE EPZ $06 ;"AC" = ACCUMULATE on the local amateur radio repeaters 0800 30 HRSREM EPZ $07 ;CURRENT HOURS HERE 0 8 0 0 31 MINREM EPZ $08 ;CURRENT MINUTES HERE and thus I avoid the embarrassment 0800 32 SECREM EPZ $09 ;CURRENT SECONDS HERE associated with such a happening. 0 8 0 0 33 FRACNTEPZ $0A ;20THS OF A SECOND ARE HERE 0 8 0 0 34 DISPIN EPZ $0B ;INPUT FOR ’LODISP" SUBROUTINE Operating features include: 0 8 0 0 35 DISPOP EPZ $0C ?STORAGE FOR "LODISP" SUBROUTINE

0 8 0 0 36 1. No peripherals required 0 8 0 0 37 MONITOR SUBROUTINES: 2. Two modes of operation 0 8 0 0 38 0 8 0 0 39 NIBASCEQU $ 8 3 0 9 3. Long timing internals (more than 4 0800 40 INSTAT EQU $ 8 3 8 6 days) with one second resolution 0800 41 DELAY E Q U $ 8 3 5 A 0 8 0 0 42 SCANDEQU $ 8 9 0 6 4. Positive status indications 0 8 0 0 43 BEEPEQU $ 8 9 7 2 5. Settable pre-time out warning 0 8 0 0 44 O U T D S P E Q U $ 8 9 C 1 0 8 0 0 45 A C C E S S E Q U $ 8 B 8 6 6. Ease of operation 0 8 0 0 46 0 8 0 0 47 DISBUF EQU $A640 0 8 0 0 48 TVEQU $ A 6 5 6 Before entering into an explanation 0 8 0 0 49 of timer operation, I would like to 0 0 1 0 50 DATA ORG $ 0 0 1 0 0 0 1 0 51 thank John Gieryic for his helpful arti­ 0 0 1 0 50 52 B Y T $50 ;R THESE ARE SEGMENT cle in the April, 1979 issue of MICRO-, 0 0 1 1 79 53 BYT $79 .;E CODES FOR "READY" 0 0 1 2 77 54 B Y T $ 7 7 ;A ‘‘SYM-1 6522-Based Tim er.” It was 0 0 1 3 5E 55 B Y T $ 5 E ; D John's article that provided the heart of 0 0 1 4 6E 56 B Y T $ 6 E ;Y 0 0 1 5 00 57 B Y T $00 ,-SPACE this timer. 0 0 1 6 58 0 2 0 0 59 T I M E 1 O R G $ 0 2 0 0 0 2 0 0 2 0 8 6 8 B 60 START JSR ACCESS 0 2 0 3 F8 61 SED 0 2 0 4 A 9 0 0 62 RESET LDA #$00 INITIALIZE FRACTION 0 2 0 6 8 5 0 A 63 STA FRACNT ?COUNTER Operation is straightforward. After 0 2 0 8 A 5 0 0 64 LDA HRSSET entering the program, enter desired pre­ 0 2 0 A 8 5 0 7 65 STA HRSREM ;TRANSFER TIME SET 0 2 0 C A 5 0 1 66 LDA MINSET ;VALUES TO TIME time out warning (hours, minutes, 0 2 0 E 8 5 0 8 67 STA MINREM ;COUNT LOCATIONS seconds) and desired operating mode. 0 2 1 0 A 5 0 2 68 LDA SECSET 0 2 1 2 8 5 0 9 69 STA SECREM These are entered sequentially in the 0 2 1 4 A 9 0 4 70 LDA #$04 ;INITIALIZE MODE OF OPER- order indicated above, starting at ad­ 0 2 1 6 8 D 7 9 0 2 71 STA STOMOD+1 ;ATION TO RESETABLE.. 0 2 1 9 78 72 CONTIN SEI /•INHIBIT INTERRUPTS dress "0000”. For example, you have 0 2 1 A A 2 0 5 73 L D X # $ 0 5 decided, as an exercise in self improve­ 021C B510 74 LODE LDA $10,X ;LOAD DISPLAY:BUFFER 0 2 1 E 9 D 4 0 A 6 75 STA DISBUF,X ;WITH "READY"... ment, to restrict yourself to 10 Vi hours 0 2 2 1 C A 76 D E X of TV per week. However, you're not 022210F8 77 BPLLODE crazy about the timekeeping involved

No. 35-April 1981 MICRO - The 6502 Journal 37 0 2 2 4 2 0 0 6 8 9 78 SHORDYJSRSCAND SHOW "READY" 0227206683 79 JSR INSTAT CHECK FOR KEY DOWN 0 2 2 A 9 0 F 8 80 BCCSHORDY IF KEY NOT DOWN, SHOW "READY".. 022CA900 81 LDA t$ 0 0 0 2 2 E 8 D 7 E A 6 82 S T A $ A 6 7 E ;LOAD IRQ VECTOR 0 2 3 1 A 9 0 3 83 LDA # $ 0 3 ;WITH ADDRESS 0300 0 2 3 3 8D7FA6 84 STA$A67F 0236A9C0 85 LDA # $ C 0 ;LOAD IER VECTOR 0 2 3 8 8 D 0 E A 0 86 S T A $ A 0 0 E 0 2 3 B A D 0 D A 0 87 LDA $A00D ;LOAD IFR REGISTER 0 2 3 E 2 9 B F 88 A N D # $ B F 0 2 4 0 6D0DA0 89 STA$A00D 0 2 4 3 A 9 C 0 90 LDA # $ C 0 SET TIMER FOR 0 2 4 5 8 D 0 B A 0 91 STA $ A 0 0 B FREE RUN MODE, 0 2 4 8 A 9 5 0 92 LDA # $ 5 0 THEN.. 0 2 4 A 8D06A0 93 STA$A006 LOAD HIGH & LOW ORDER 0 2 4 D A 9 C 3 94 LDA # $ C 3 COUNTER LATCHES TO 0 2 4 F 8 D 0 5 A 0 95 S T A $ A 0 0 5 GIVE 50MS INTERRUPT 025258 96 CLI 0 2 5 3 A 5 0 7 97 LOAD LDAHRSREMGET 0 2 5 5 6 5 0 B 98 STA DISPIN AND 0257206E03 99 JSRLODISP LOAD 025A A508 100 LDAMINREMTIME 0 2 5 C 8 5 0 B 101 STADISPIN REMAINING 0 2 5 E 2 0 6 E 0 3 102 JSR LODISP INTO DISPLAY BUFFER 0 2 6 1 A 5 0 9 103 LDA SECREM HRS. 0 2 6 3 6 5 0 B 104 STADISPINMIN. 0265 206E03 105 JSRLODISPSEC. 0268 A9AC 106 L D A # $ A C DETERMINE MODE SELECTED 0 2 6 A C 5 0 6 1 0 7 CMP MODE AND 0 2 6 C F O O D 108 BEQSETMOD CHANGE IF REQUIRED. 0 2 6 E A 9 0 4 109 SHOW L D A # $ 0 4 DISPLAY TIME REMAINING 0 2 7 0 8 D 5 6 A 6 110 STATV UNTIL INTERRUPTED 0273 205A83 111 JSR DELAY OR KEY IS DOWN 0276 90DB 112 BCC LOAD 0 2 7 8 4 C 0 4 0 2 113 STOMOD JMP RESET 04 MAY BE CHANGED TO 19 0 2 7 B A 9 1 9 114 SETMODLDA f $1 9 UNDER PROGRAM CONTROL, 027D 8D7902 115 STA STOMOD+1 DEPENDS ON MODE. 0 2 8 0 4 C 6 E 0 2 116 J M P SHOW 0 2 8 3 2 0 7 2 8 9 117 WARNJSR BEEP •BEEPER ROUTINE 0286 207289 118 JSR BEEP FOR WARNING 0 2 8 9 2 0 7 2 8 9 119 JSRBEEP 0 2 8 C 2 0 7 2 8 9 120 J S R B E E P 0 2 8 F 2 0 7 2 8 9 121 J S R B E E P 0 2 9 2 60 122 RTS 0293 207289 123 TIMOUT JSR BEEP BEEP! 0 2 9 6 124 ; 0296 208683 125 JSR INSTAT CHECK FOR KEY DOWN 0 2 9 9 9 0 F 8 126 B C C TIMOUT IF NO KEY DOWN, BEEP AGAIN 029B 4C0002 127 JMP START IF KEY DOWN, JUMP TO START 0 2 9 E 128 ; 0 2 9 E 129 ; 0 3 0 0 130 TIMER O R G $ 0 3 0 0 0 3 0 0 08 131 PHP INTERRUPT ROUTINE 0 3 0 1 48 1 3 2 PHA STARTS HERE SO 0 3 0 2 8A 133 TXA SAVE IMPORTANT 0 3 0 3 48 134 PHA REGISTERS 0 3 0 4 98 135 TYA 0 3 0 5 48 136 PHA 0 3 0 6 E 6 0 A 137 I N C FRACNT INCREMENT FRACTIONS 0 3 0 8 A 5 0 A 138 LDA FRACNT OF A SECOND COUNTER 030A C914 139 C M P # $ 1 4 IF FULL SECOND IS 0 3 0 C F 0 0 3 140 BEQ REFRAC NOT UP YET JUMP TO 0 3 0 E 4 C 6 4 0 3 141 JMP ENDINT END INTERRUPT ROUTINE 0 3 1 1 A900 142 REFRAC L D A # $ 0 0 0 3 1 3 8 5 0 A 143 STA FRACNT AFTER RESETTING FRACTION 0 3 1 5 38 144 SEC COUNTER SUBTRACT 0316 A509 145 LDA SECREM ONE SECOND FROM TIME 0 3 1 8 E 9 0 1 146 S B C # $ 0 1 REMAINING. IF NOT TIME 0 3 1 A 8 5 0 9 1 4 7 STASECREM TO SUBTRACT 1 MINUTE 0 3 1 C C 9 9 9 148 CMP # $ 9 9 GOTO "CHKEND* 0 3 1 E D 0 1 A 149 BNE CHKEND ROUTINE 0 3 2 0 A 9 5 9 150 LDA # $ 5 9 ONE MINUTE HAS ELAPSED 0322 8509 151 STASECREM SO RESET SECONDS TO 59 0 3 2 4 38 152 S E C 0 3 2 5 A 5 0 8 153 LDA MINREM SUBTRACT 1 MINUTE 0 3 2 7 E 9 0 1 154 S B C # $ 0 1 TIME REMAINING 0 3 2 9 8 5 0 8 1 5 5 STAMINREM IF NOT TIME TO SUBTRACT 032B C999 156 CMP # $ 9 9 O N E H O U R ____ 0 3 2D D O O B 1 5 7 B N E CHKEND GOTO "CHKEND" ROUTINE 0 3 2 F A 9 5 9 158 L D A # $ 5 9 ONE HOUR HAS ELAPSED 0 3 3 1 8 5 0 8 159 STA MINREM SO RESET MINUTES TO 59 0 3 3 3 38 160 SEC 0 3 3 4 A 5 0 7 161 LDA HRSREM 0 3 3 6 E 9 0 1 1 6 2 S B C # $ 0 1 SUBTRACT 1 HOUR FROM 0 3 3 8 8 5 0 7 163 STAHRSREM TIME REMAINING 0 3 3 A A 5 0 7 164 CHKENDLDAHRSREM IF HRS«, MIN. AND 0 3 3 C C 9 0 0 1 6 5 CMP # $ 0 0 SEC. ARE ALL ZERO 0 3 3 E D O O F 166 BNECHECK THEN TIMER HAS TIMED OUT 0 3 4 0 A 5 0 8 167 LDA MINREM 0342 C900 166 CMP # $ 0 0 0344 D009 169 BNECHECK IF NO TIME OUT 0 3 4 6 A 5 0 9 170 LDASECREM HAS OCCURRED GO TO 0 3 4 8 C 9 0 0 171 C M P # $ 0 0 CHECK AND DETERMINE 034A D003 172 BNECHECK IF TIME FOR WARNING 0 3 4 C 4 C 9 3 0 2 173 JMP TIMOUT IS TO BE SOUNDED 034F A 50 5 174 CHECK LDASECWAR COMPARE WARNING HR/MIN/SEC

Figure 1: Main Routine

38 MICRO - The 6502 Journal No. 35 - April 1981 in such an effort. So, you guessed it, 0351 C509 175 CMP SECREM TO TIME REMAINING HR/MIN/SEC here comes the SYM Timer. Starting at 0353 D00F 176 BNEENDINT IF NOT A MATCH, GOTO 0355 A504 177 LDAMINWAR END INTERRUPT ROUTINE address "0 000 ” you punch in "1 0 ” 0 3 5 7 C 5 0 8 178 C M P MINREM ' '30" "0 0 ''. Then to provide a one-hour 0 3 5 9 D 0 0 9 179 BNE ENDINT 0 3 5 B A 5 0 3 180 LDAHRSWAR warning you continue with "0 1 ” "0 0 ” 0 3 5 D C 5 0 7 181 CMPHRSREM ‘‘0 0 ". At this point you are ready to 0 3 5 F D 0 0 3 1 8 2 BNEENDINT 0 3 6 1 2 0 8 3 0 2 183 J S R WARN SOUND A WARNING select mode of operation. 0 3 6 4 AD04A0 184 ENDINT LDA $ A 0 0 4 RESET TIMER INTERRUPT FLAG 0 3 6 7 68 185 PLA RESTORE 0 3 6 8 A8 186 TAY ALL 0 3 6 9 68 187 PLA PREVIOUSLY 0 3 6 A A A 188 TAX SAVED By entering "AC" you will select 0 3 6 B 68 189 PLA REGISTERS the "Accumulative" mode of opera­ 0 3 6 C 28 190 PLP AND 0 3 6 D 40 191 RTI RETURN FROM INTERRUPT... tion. In this mode you can "start” and 036E A50B 192 LODISP LDADISPIN GET DIGITS TO BE "stop" the timer as often as required. 0370 850C 193 STA DISPOP DISPLAYED AND SAVE 0 3 7 2 6A 194 ROR FOR LATER RECALL. The timer will continue timing at each 0 3 7 3 6A 195 ROR POSITION MSD FOR CONVERSION "start" from where it was last stopped. 0 3 7 4 6 A 196 R O R T O A S C I I 0 3 7 5 6 A 197 R O R If you had entered anything other than 0 3 7 6 2 0 0 9 8 3 198 JSR NIBASC "AC" you would have selected the 0 3 7 9 2 0 C 1 8 9 199 JSR OUTDSP L O A D D I G I T 037C A50C 200 LDA DISPOP GET OTHER DIGIT AND CONVERT "Resettable" mode of operation. In 037E 200983 201 JSR NIBASC TO ASCII.... this mode each "start" causes the 0381 20C189 202 JSR OUTDSP THEN LOAD DIGIT 0 3 8 4 60 203 RTS RETURN FROM SUBROUTINE,.,.. timer to begin again from the original timer interval you set.

With a simple "Go” "200'' "CR" SYM displays "ready". To start the timer press any key and time remaining is displayed. To stop the timer once more press any key and "ready” is displayed again.

When the timer reaches the pre­ time out warning the beeper will sound momentarily, and when time out oc­ curs, the beeper will sound continuous­ ly until it is reset by pressing any key.

Well that's it—maybe! I keep fighting off the urge to toss in more and more. For instance, how about a 1 year timer that reads out "Hrs x 100” "Hrs.” "Min.”? Or if that's a little ridiculous, then maybe one that displays "days” "hrs." "m in." for in excess of 3 months of timing. Then of course we could have an option to display elapsed time as well as time re­ maining. I don't suppose it would be too difficult to toss in a 24 hour clock while we're at it. Of course it would have to operate simultaneously with all the other options.

So on and on it goes. For now, however, I will leave it to others to perfect the ultimate time machine. JMCRO

Figure & Interrupt Routine

No. 35-A pril 1981 MICRO - The 6502 Journal 39 G E T FREE ADSONTVI GET FREE SOFTWARE TOO I

How? U » our ADVERTISING SOFTWARE! You put it in the APPLE and produce colorful, dynamic ads on the screens of TV sets in your shop window. Evan if you are How? Order any of the rtems below, and for each $100 worth of merchandise ordered, not a shop owner, you can ins this software to broadcast mensgsi on TV screens in we will give you one of the items at left for FREE! schools, hospitals, factories, e tc The following menage-making programs are available. APPLE ADDONS SUPER MESSAGE: Creates metngsi in full-pags "chunks". Each name allows state* ra n ts of mixed typestyles, typesizes and colon, in mixed upper & lower case. Five type- HAYES MICROMODEM for APPLE ...... $ 300. styles v e M tlabie. They range from regular APPLE characters, up to double-size, Z80 SOFTCARD by MICROSOFT...... $ 275. doubie-wktth characters w ith a hewy, bold fo n t Six colors may be used for each 16K RAMCARD by MICROSOFT...... $ 159. different typestyle. Vertical & horizontal centering are available, and word-wrap is auto­ FORTRAN for APPLE by MICROSOFT...... $ 159. matic U srs can chain pages together to make multi-page massages. Pages can be advan­ COBOL for APPLE by MICROSOFT...... J 599. ced manually or automatically. Multi-page mswagei can be stored to disc or recalled BASIC Comoiier for APPLE by MICROSOFT ...... $ 315. instantly. PRINTERS REQUIRES 48K & ROM APPLESOFT...... S 50. CENTRONICS 737 (3 mo. warranty)...... $ 795. MULTI-MESSAGE w ith INTERLEAVED COLOR PATTERNS'. Up to tO messages can CENTRONICS 737 (15 mo. warranty) ...... $ 915. be nin in iiequence.. Colorful, dynamic patterns (kaleidoscope or abstract art) can be EPSON TX-B0 with TRACTORS & GRAPHICS...... $ 645. interleaved between messages, at user option. Consists o f 28 crisp, readable characters/ EPSON MX-80 with TRACTORS & 132 C olum ns ...... $ 515. iineX4 |in«s/pageX3 pages of text per message. Characters are 1/8 screen-height and PAPER TIGER 460G with GRAPHICS & 2K Buffer ...... S 1136. " p u ff' onto the screen at comfortable reeding speed. PAPER TIGER 445G with GRAPHICS & 2K Buffer ...... S 749. REQUIRES 3 2K & INTEGER BASIC...... $ 36. WORD PROCESSING HI-RES ALPHANUMERIC MESSAGE: Same as Mutti-Menage above, but has only one meseege/sel and no interleaved color-pattem*. Still vary good general message-maker! EZ WRITER PROFESSIONAL SYSTEM for A PPLE...... $ 239. EZ MAILER (Interfaces to E2 WRITER above)...... $ 65. THE SCROLLING WONDER: 4 brief messages appear in APPLE uppercase characters VIDEX VIDEOTERM (80-Column Card for A P P LE !...... $ $ 295. by “ floating” onto the screen from below. Msssages enter in random sequence, with ran­ VIDEX VIDEOTERM (Sameas abova with GRAPHICS) ...... $ 32a dom 50% o f mewsgei "flash". A multiple-rainbow grand finale ends the propem. Very SUP'R'TERM (80-Column Card for APPLE) ...... $ 32a good program to run at point o f purchase. BUSINESS PROGRAMS fo r APPLE h TR-80 by SPECTRUM SOFTWARE GIANT LETTER: Brilliantly-colored letters, o f full screen height, appear one-at-a-time, in sequence, to spell out mesaeges. Successive words have different colors. A running MICROACCOUNTANT: An idael peckage for the very small business, based upon classic Ajmmery oif letters, in APPLE characters, appears in the bottom 4 lines o f the screen, as T-eccounts & Double-Entry Bookkeeping. This efficient program records end produces the giant tellers are presented. Vary good program for shop windows. reports on aocount balances, general ledger journals, revenues & expenses 40-column or screen reports. Handles up to 1000 journal entries/month, for up to 300 accounts. A LL 3 ABOVE TOGETHER. ON DISK. FOR 32K. INTEGER B A S IC ...... $ 3 a Indudes a short primer in Financial Accounting. LET APPLE PLOT YOUR DATA AND KEEP YOUR RECORDS TOO! REQUIRES 48K & ROM APPLESOFT ...... $ 4a APPLE DATA GRAPH Z I : Plots up to 3 superimposed curves on the Hi-res Screen BUSINESS CHECK-REGISTER with BUDGET: Unique system allows setting up pre­ both the X & Y axes dimensioned Each curve consists o f up to 120 pieces o f data. defined purpose & recipient accounts (60 each). Supports unique nemes too. Rapid- Graphs can be stored to disc and recalled immedUtety for updating. Up to 100 graphs eccess to check-filea with scrolling display & 40-col printout, if desired Up to 100 can be stored on the same disc. Great for Stock-market Charting, Business Management, checks/mo. + reconciliation + AUTOMATIC BUDGET VARIANCESI and Classroom Instruction! REQUIRES 48K & APPLESOFT ROM ...... $ 4a REQUIRES 4 8K & ROM APPLESOFT ...... $ 4a STOCK MARKET APPLE RECORD MANAGER: Allows complete files to be brought into memory so that record seerchei and manipulations are instantaneous. Records within m y file can contain STOCK MARKET ANALYSIS for APPLE by GALAXY ...... $ 4ft up to 20 fields with user-defined headings. Inf ormation can be string or numeric Users can browse thru files using pegs forward page-backward o r random March commands. COD'S & Persona! Checks are Welcome! Records cert easily be searched, ehered o r sorted at w ill Files can be stored on the same <*ive as the mester proyam, or on another, if a second drive is available. Records or filas can be primied, if deaired Additional modules coining are a STATISTICS INTERFACE, CHECKBOOK, MAILING LIST & DATA-ENTRY. CONNECTICUT INFORMATION SYSTEMS CO. REQUIRES 48K & ROM APPLESOFT ...... S 36. 218 Huntington Road, Bridgeport, CT 06608 (203) 579-0472 * AH Software above on Disk for APPLE DOS 1 2 APPLE ARCADE

Asteron - The definitive hM res implementation of the As- Sbootin£ Gallery F teroids arcade game. Fea­ Star Avenger -High speed tures: Ship movement, hyper­ Shooting Gallery - A real guerrilla warfare in space pit­ space, alien saucers, sound time simulation of a midway ting you against your Apple. effects, graphic routines arcade. Features: row targets, Featuring a new universe allowing up to 25 objects to pop targets, different-skill each game and varying skill be displayed with real time re­ levels, and bonus time. May levels. Universe consists of sponse. Played from paddles be played using either game 16 hi-res screens with instant­ or keyboard. $27.50 paddles or joy sticks. $22.50 aneous crossover. $27.50

All Western MicroData game software is For U.S. and foreign orders, Available Now! written In assembly language for maximum prices are in U.S. dollars. For speed. All programmes require 48K and Canadian orders, prices are in MultiBootrM Upgrade Canadian dollars. Send cheque DISK DRIVE and will work on standard or Postal Money Order only. Apple II, Apple II plus, and Pascal systems, Allow 3-4 weeks for cheque to Have you not wished that your clear if not certified and allow Basic software would work In both with either DOS 3.2 or DOS 3.3. up to 4 weeks for delivery. DOS 3.2 and DOS 3.3? Tired of spending hours “ Muffin” ing your Dealer and Computer Club en­ old programmes? Now your prob­ Western MiJtoData quiries invited. lems are solved with MultiBootrM Enterprises Upgrade. Upgrade a whole disc in Ltd. just seoonds and use your disc on P.O. Box G33, Postal Station G Apple is a registered trademark of any of DOS 3.3, DOS 3.2 and the Calgary, Alberta Apple Computer Inc. Language Card. Canada T3A2W1 Disk II Is a registered trademark of $50.00 1-403-247-1621 Apple Computer Inc.

MICRO - The 6502 Journal No. 35 - April 1981 REAL TIME SAVER

Minutes are money. So, when iFs possible to easily handle many times your workload, with better results, you’re on to something. And, that something is Programma’s versatile and powerful Word Processing System. Because it’s designed from the user’s viewpoint, it's easy to work with. You can start right out doing basic word pro­ cessing. And, since each step logically leads to the next, you’ll be handling even complex work problems in a very short time. Our WPS consists of two superior programs, Apple PIE (Programma Improved Editor) and FORMAT. PIE is a free-form, live-screen-oriented editor, for creating and editing text for processing. The commands let you enter or alter anything, any­ where on your screen. You can search and replace, add, delete, move, or insert, by character, word, line or paragraph. And you know what’s happening, as you see it right on the screen. PIE also allows use of a lower case adapter, and can even be used as a soft­ ware development tool. The other half of our real time saver is FORMAT. It uses simple, embedded codes to set formats for letters, manuals, scripts, documents or catalogs to your specifications. You want this centered?... that underlined?... those areas indented?... something paragraphed? You make the decisions, FORMAT does the work PROGRAMMA’S immediately, accurately. Then, if before printing, you WORD PROCESSING SOFTWARE want to revise copy, or change a document’s final appearance, you can do it with ease. FORMAT is FOR THE very forgiving! I * To make the most of your time, order today. Our WPS for the 32K Apple II, on mini-floppies, with thorough documentation, is now just $129.95. At your local computer store. Or direct from Programma, 2908 No. Naomi Street, Burbank, CA 91504. (213)954-0240.

* Apple II is a trademark of Apple Computer, Inc

No. 35-April 1981 MICRO - The 6502 Journal 41 V « MWIM « « • M4W m « k consumer Cart* <») computers fomwHjr Computers H ' i

OPEN EVERY DAY 9 to 6 PST ORDER TOLL FREE Californio, Alaska & Foreign orders (714) 696-6066 Shipping Information or Backorders call (714) 696-0260 Service Center and for Technical Information (714) 460-6502 600- 054-6654

tcippkz computer W Authorized Dealer A ALL EQUIPMENT IS ATARI’ FCC APPROVED M O M l 600 16K *799 APPLE II PLUS 16K...... 1049 m y APPLE II PLUS 48 K (APPLE Memory)...... 1189 APPLE II Stondord Models... CALL Challenger 4P...... 699 DISK II DRIVE & CONTROLLER. 529 C4PMF (Mini Floppy System). 1599 This model includes DOS 0.3 16 sector Cl P Model II ...... 449 TOP FIVE SELLERS Sargon II (Disk or Cassette).... 35 Language System W/Pascal...... 425 Fig Forth (Disk Only) ...... 69 Silentype Printer W/lnterfoce...... 549 Hayes Micromodem H...... 019 Atori 400 16K...... 499 Videx Videoterm 60 w/grophics...... 005 810 Disk Drive...... 499 Z-80 Microsoft Card ...... 299 410 Program Recorder...... 69 A m i COMPUTER MC. 650 Interfoce Module...... 175 APPLE SOFTWARE Disk II Drive Only...... 445 822 Thermal Printer (40 col)...... 069 DOS Toolkit...... 65 Integer or Applesoft tl Firmwore Cord. . . 155 825 Printer (80 col)...... 795 Appleplot...... 60 Graphics Tablet...... 649 Atori 16K Rom Module...... 155 Tax Plonner...... 99 Porollel Printer Interface Cord...... 155 Atari Light P en...... 65 Apple Writer...... 65 Hi-Speed Serial Interface Card...... 155 We stock oil Atori accessories b Apple Post...... 45 Smorterm 60 Column Video Card...... 005 software, pleas# coM lor moro Info. DJ. Portfolio Evaluotor...... 45 MOUNT AM COMPUTER MC. DJ. News & Quotes Reporter...... 65 Music System (16 Voices)...... 479 Apple Fortran...... 165 A/D h - D/A Interface...... 019 Apple Pilot...... 129 Expansion Chossis ...... 555 PRINTERS DOS 0 0 Upgrade...... 49 lntrol/X-10 System...... 249 Music Theory...... 45 Clock/Calendar Cord...... 209 The Controller Dus. Sys...... 519 Supertolker SD-200...... 249 Anodex DP-9500 W/2k Duffer...... 1075 MISC APPLICATIONS PACKAGES Romplus + Cord...... 105 Anadex DP-9501 W/2K Duffer...... 1450 Visicalc...... 125 Romwriter Card...... 155 C. Itdh Starwriter 25 CPS...... 1750 Desktop Plan II...... 169 CAUFORMA COMPUTER SYSTEMS C. Itoh Storwriter 45 CPS...... 2450 CCA Data Management DMS...... 85 Clock/Calendar Module...... 109 Centronics 7 0 7 ...... 825 Easywriter Word Processor...... 225 GPID IEEE-488 Cord ...... 259 Epson MX-70 W/Graphics ...... 449 ASCII Express ...... 65 Asynchronous Serial Interface Card...... 129 Epson MX-80 102 Col ...... 620 Super Text 11...... 109 Centronics Parallel Interface Card...... 99 Poper Tiger IDS-445 W/Dot Plot...... 749 Progrommo Apple Pie...... 119 We carty oil CCS hardware. Please call Poper Tiger IDS-460 W/Dot Plot...... 1195 The Landlord Apt. Mgmt. Pkg...... 649 MBC. APPLE HARDWARE Paper Tiger IDS-560 W/Dot Plot...... 1495 Peachtree Business Software...... CALL 16K Ram Cord Microsoft...... 189 Qume Sprint 5/45 Daisywheel...... 2550 Tax Preparer by HowordSoft...... 89 ACT Numberic KeypocKold or new kytxd).115 Silentype w/lmerfoce for Apple ...... II 549 Applebug Assem/Disassm/Editor...... 75 ALF 0 Voice Music Card...... 229 Wotonobe Digiplot...... 1295 0-D Graphics By Oil! Budge...... 50 Alpha Syntouri Keyboard System...... 1099 GAMES Corvus 10MD Hord Disk...... CALL Flight Simulator...... 04 Lazer Lower Case Plus...... 50 The Wizard and The Princess...... 02 Micro-Sci Disk Drives...... CALL VIDEO MONITORS Cosmos Mission (Space Invaders) ...... 24 SSM AIO Serial/Porollel Cord A&T...... 189 Amdex/Leedex Video-100 1.2" B&W.... 109 Sargon II Chess...... 02 Sup-R-Terminol 80 Col. Cord ...... 009 Hitachi 10” Color...... 089 Hi-Res Footboll...... 09 SVA 8 inch Floppy Disk Controller...... 045 NEC 12" P01 Green Phospher...... CALL Adventure by Microsoft...... 27 Versowriter Digitizer Pad ...... 229 Panocolor 10” Color...... 075 Phantoms Five...... 09 Sanyo 9" BGW...... 179 Reversol (Othello)...... 04 WiE HAVE MANY MORE ACCESORIES Sanyo 12" B&W...... 255 FOR THE APPLE « M STOCK— Sanyo 12" P01 Green Phospher...... 295 PLEASE CALL OR WRITE PLEASE CALL OR WRITE FOR A PRICE LIST. Sonyo 10" Color...... 445 FOR A COMPLETE SOFTWARE LIST.

ORDERING INFORMATION; Phone Orders invited using VISA. MASTERCARD, AMERICAN EXPRESS. DINERS CLUB. CARTE BLANCHE, or bonk wire transfer. Credit cords subject to seivice charge; 2% for VISA & MC, 5% for AE. DC 6 CD. Mail Orders may send credit card account number (include expiration dote), cashiers or certified check, money order, or personal check (allow 10 days to clear). Pleose include a telephone number with all orders. Foreign orders (excluding Militory POs) odd 10% for shipping oil funds muse be in U.S. dollors. Shipping, hondling and insurance in U.S. odd 0% (minimum &4.00). California residents add 6% soles tox. We accept COD's under $500. OEMs. Institutions 6 Corporations pleose send for written quotation. All equipment is subject to price change and availability without notice. All equipment is new and complete with manufacturer warranty (usually 90 doys). We cannot guarantee merchantibility of ony products. We ship most orders within 2 days. WE ARE A MEMBER OF THE DETTER BUSINESS BUREAU AND THE CHAMBER OF COMMERCE SHOWROOM PRICES MAY DIFFER FROM MAIL ORDER PRICES. PLEASE SEND ORDERS TO: CONSUMER COMPUTERS MAIL ORDER 6314 PARKWAY DRIVE. GROSSMONT SHOPPING CENTER NORTH LA MESA CALIF. 92041

42 MICRO - The 6502 Journal No. 35 - April 1981 Oh No — It’s Garbage Collect!

This article describes Garbage FOR J = 0 TO N: per string. The ways to reduce garbage Collect in Microsoft’s 6502 A$(J) = B$: collect are fairly obvious: don't have BASIC. The worst case is NEXT: more strings than are absolutely re­ described, and a few A$(0) = "B ": quired. For example: T = TI: suggestions made on how to PRINT FRE(0) Tl-T 1. Re-use work variables. avoid it. The program sets up bunches of 2. Use numbers rather than strings strings, changes the first one, and for switches. forces garbage collect while printing Gordon A. Campbell the time required. (The CHR$ is re­ 3. Put literals right into PRINT statements rather than use con­ 36 Doubletree Road quired since assigning a string a literal Willowdale, Ontario value results in the string pointer stant strings. M2J 3Z4 pointing at the literal in the program, rather than use of string space.) 4. Try to create the most stable strings first. I was really pleased! The simple text Changing N showed that the number of strings has a roughly 5. Avoid loops which createa string editor worked well. It even had a by concatenatinga character ata fancy quasi-INPUT routine, just like exponential effect on the time required. time onto the string. CURSOR. And it only took a couple of Changing the size of B$ showed that the number of characters in the strings days to develop, since it was written has no apparent effect on the time. 6. Apply the usual techniques to entirely in BASIC. Now to get on with keeping your program small. some articles. To find the worst case, some swift calculation shows that N can be set to 7. Avoid sorting techniques which The first opus went well. After 7908, and garbage collect takes 84 involve changing the actual con­ several input sessions, I ran a full draft. minutes and 13 seconds. But we can go tents of the array. Instead, use All the changes were going well, when higher. Drop the start-of-BASIC down QUICKSORT, or an Assembler suddenly, right in the middle of enter­ to the first cassette buffer, and raise the sort which changes the string ing a command, the PET went dead. top-of-memory to the end of the screen. pointers. Pushing the STOP key did nothing, so I Now N can be set to 8261, for a time of sat back to consider my sins. After a 91 minutes and 56 seconds! Garbage collect will happen in any minute, the cursor returned, and the case. In interactive programs without a editor was again working. How about other machines? A call large number of strings, it can be made to a friend showed that Applesoft is invisible to the operator by forcing it The light came on. I was the victim compatible with the PET. The only dif­ (X = FRE(0) ) during times when the of the dreaded garbage collect. ference is the 10% that the PET spends operator doesn't expect to use the looking at the keyboard and cassettes, keyboard. For 'batch' programs, the Garbage collect is the compression and updating the clock. Down at our least amount of time will be consumed of string space. In Microsoft's 6502 neighborhood Radio Shack we found by just letting it happen when it must. BASIC, string contents are placed at the that string space must be reserved with top of memory, working down. When a a 'CLEAR n' command. There is no In summary, the next time your string is assigned a new value, it is apparent time spent in garbage collect, PET [Apple, SYM) seems to crash, placed below all previous strings. At but there is a value for the CLEAR com­ don't reset it right away. It may just be some point, memory is filled, so gar­ mand which seems to crash the collecting its garbage. bage collect squishes all the strings system, so that may be it. Presumably back up to the top. It may also be the Atari with its fixed-length strings forced, by using FRE(O). doesn't create garbage in the first place. After 15 years in main-frame data processing, Gordon Campbell purchased a The following one-liner provide® cassette-based PET in the spring of 1979. the basis for some experiments: Published information indicates Since then, the PET has grown a disk, that the latest PET ROM-set does gar­ printer, and modem. The latest expansion provides CB2 sound in stereo. 5 N = 1000: bage collect much more quickly. In a classic trade-off of speed versus B$=CHR$(1): JUCAO" DIM A$(N): memory, it also takes two bytes more

43 No. 35 - April 1981 MICRO - The 6502 Journal Enter our world of microcomputing.. Discover our exciting world of microcomputing by reading SoftSide Magazine, the monthly that helps you learn to use your 6502-based system more effectively and enjoyably. In SoftSide, you’ll read helpful programming hints, follow regular columns by such well-known authors as Scott Adams, and explore the wide range of 6502-compatible software and hardware. The focus of SoftSide is lots of entertaining software — great games, simulations and educational programs all ready to type right into your computer, each one fully documented and carefully explained. Every month you'll find at least three programs for the Apple, and three for Atari. The value of these programs is impressive — one reader told us that he estimates the value of the software in SoftSide at $18 per issue! SoftSide isn’t for everyone. We're looking for the kind of reader who feels challenged by tackling all kinds of programs, long or short, and Is rewarded with consistently fine graphics, great adventures, and simulations, and arcade games that don’t lose their appeal after one play. If you’re the kind of person who ought to be reading SoftSide, take advantage of our special offer while it lasts — 13 issues for the price of 12 (you must order with the coupon in this ad or a photocopy). For a small admission price, you can become a part of SoftSide’s world of microcomputing! “ As a recent purchaser of an Atari 800 and a recent subscriber to SoftSide, I am more than a little thrilled to find a magazine like yours available. Here I am looking for clever programs and clever programming ideas. Your magazine fits the bill! I have enjoyed nearly every hour of typing in the programs (at least I do after I see the program run with the fantastic graphics).” R.K.

our viewpointaca is strictli]

Here’s my ticket to SoftSide’s world of microcomputing. Please send me 13 issues for only $18 (at a savings of 40% over cover price). □ Check enclosed □ Bill Me □ Bill my Visa □ MasterCard Card # ______Expiration d a te ______

I own a(n)

N am e____

Address City ___ State . Z'P

SoftSide Publications 6 South Street, Milford, New Hampshire N181

44 MICRO - The 6502 Journal No. 35 - April 1981 TSEHARDSIDE HAS IT ALL IN ONE! How many times have you wished that there was a single source forv your personal computer needs? Well look no further, TSE­ HARDSIDE, located in pleasant New Hampshire, has virtually every conceivable item for your micro. Whether you’re shopping for your Apple, Pet, TRS-80 or Atari, TSE-HARDSIDE has it all. We stock hardware, software, books, magazines and specialty items for all of the popular machines. So the next tim e you’re out shopping for your system don’t be surprised, be satisfied. Remember the name TSE­ HARDSIDE as your choice for quality, service and reliability.

\ TS£:HflRDSID€ An AIM 65 Intelligent?e Test

F’lease answer each question: Who has been offering complete 6502-based products since 1976? 1 □ Rockwell International □ The Computerist

Who makes a video expansion board for the AIM 65 that fully supports the AIM Monitor, Editor, 2 Assembler and BASIC? □ Rockwell International □ The Computerist^

Who offers a memory expansion board with 32K, RAM, provision for up to 16K 3 EPROM, and an EPROM programmei □ Rockwell International □ 1]

Who offers an en □ Rockwell Inte^

Which company has 5 year warranty on alj.,of 4

ntroller, RS232 6 id quarter of 1981?

7

Answers: 1. The Computerist starte< 2. The Computerist Vid< fmable screen formats, EPj orts all major AIM firmwaj not cur- rently offer any 3„ The Compute£

Answer If you answered “ The Computerist" to question 8, then you pass the AIM Intelligence Test. So send for our 1981 Product Guide. If you answered "Rockwell International", then maybe you didn’t understand the question.

Prices listed are US only and do not Include Shipping and Handling. mm 34 Chelmsford St, Chelmsford, MA. 01824 617/256 3649

46 MICRO - The 6502 Journal No. 35 - April 1981 CONTENTS: Introduction— The Games General Microcomputer Board. Music Player—Play a sequence of up to 255 notes (13 different notes) and record The Personal Computer Bookby Robin it automatically. Translate —The computer Bradbeer. Input Two-Nine, an imprint displays a binary number. Each player in of MCB Publications Limited (198/200 /AlCftO turn must press the hexadecimal equivalent as quickly as possible. The first to score 10 Keighley Road, Bradford, West York­ New Publications wins. Designed for two players. Hexguess— shire, England BD9 4JQ), 1980, 220 Guess a 2-digit hex number generated by the pages, illustrated, 814 x 5-6/8 inches, computer. The computer will tell you how paperbound. far off your guess is. You are allowed up to ISBN: 0-905897-56-0 U.S. $15.00; Mike Rowe 10 guesses. Magic Square— Light up a £5.25 New Publications perfect square on the board. Each key in­ P.O. Box 6502 verts some LED pattern. Skill and logic are An introductory work on microcom­ Chelmsford, MA 01824 required. Spinner— A light is spinning puters, written especially for readers in around a square. You must catch it by hit­ the United Kingdom. This column lists new publications ting the corresponding key. Every time you received for review and also reports on succeed, it will spin faster. A game of skill. Slot Machine—A Las Vegas type slot pertinent publication announcements machine is simulated, with three spinning received from book and periodical wheels. Try your luck. Echo—Recognize CONTENTS: What's It A ll About!— The publishers. and duplicate a sound/light sequence (also computer can assist us tremendously, both known as SIMON—A manufacturer trade­ in business and pleasure; How is it mark). Mindbender—Play against the dealer General 6502 possible?; The first hobby computer; Who (the computer) with a deck of 10 cards. You buys personal computers?; What do you use may hit or stay. Don't bust! Blackjack— The 6502 Instruction Handbook by the computer for?; Developments in the Guess a sequence of numbers generated by Scelbi Publications (20 Hurlbut Street, next few years. Where Do I Start !—Ten the computer. It will tell you how many Elmwood, Connecticut 06110], 1981, hints to help you on your way. The Com­ digits are correct and in the right position puter—What Is It! How Does It Work !—The 44 pages, 3M x 8 Vi inches, paper- (also known as MASTERMIND—a manu­ computer—confusingly versatile; How the bound. $4.95 facturer trademark). Tic-Tac-Toe— Try to computer works, in simple terms; Binary achieve three in a row before the computer numbers; How does the computer handle Designed as a shirt-pocket guide for does in this favorite game of strategy. The binary numbers?; The processor —the computer's ability improves with yours. programmers, technicians, and engi­ CPU—from the inside; The computer's own Can you outsmart it? Appendices: A. 6502 neers. Portions of the publication road network—the bus; Storage inside the Instructions—Alphabetic; B. 6 5 0 2 - appeared originally in SCELBI’s 6502 computer. How Do I Talk to the Instruction Set: Hex and Timing. Index. Software Gourmet Guide et) Cookbook Computer!—Machine Language; Assembly (by Robert Findley, 1979). This slim AIM 65 language; High-level languages; At which reference work, available from com­ level do I begin?; BASIC—a convenient puter stores or for an extra 50* from the language; Firmware; Software; Which AIM 65 Laboratory Manual and Study publisher, contains a synopsis of each microprocessor is best? What's In the Guide by Leo J. Scanlon. John Wiley & Boxes!-, instruction set for the 6502 CPU. Mne­ Input devices; Keyboard-based Sons (605 Third Avenue, New York, input; Speech recognition; Direct Input; monics and machine codes in hexa­ New York 10158) 1981, 180 pages, Storage media; Cassette storage; Disk decimal format are provided for each diagrams and charts, 8 Vi x 11 inches, storage; Other storage media; Output addressing mode. Appendices list the paperbound. devices; Video output; Printed output; Elec­ instruction set alphabetically by ISBN: 0-471-06488-2 $7.95 tric typewriter/TTY; Matrix printers; Daisy assembler mnemonics as well as wheel printer; Other printers; Speech syn­ numerically by machine code. Other thesis. What Can I Buy!— The Computer A study and exercise book designed to system; Personal computer equipment information provided includes a introduce students to microcomputers hexadecimal-to-decimal conversion survey; Part 1, Section A—Single board by working with the AIM 65. Pages are computers; Kit-built systems; Training chart, a chip pinout diagram, timing perforated so that the student's systems, Part 1, Section B—Desk top data, and diagrams of chip architecture. answers, written in the book, can be systems. Part 1, Section C—Bus-based handed in, lesson by lesson, for review systems—S100 Bus. Part 1, Section 6502 Gamesby Rodney Zaks. 6502 by the instructor. The author, D—Other Buses—SS 50, Non-standard. Series, Volume IV, Sybex Inc. (2344 employed by Rockwell International, Input/Output devices, memory storage media; other media; Part 2—Printers. Part Sixth Street, Berkeley, California the manufacturer of the AIM 65, pro­ 3—Video display units. Part 4—Other 94710), 1980, x, 292 pages, 50 figures, vides 32 pages of answers to the 5 Vi x 8 Yi inches, paperbound. peripherals. How do I choose a system? experiments. What Can I Do With It!— ISBN: 0-89588-023-9 $12.95 Games; Educa­ tion; Business use; Word processing; Infor­ mation handling; Controlling things; Mak­ This book is designed as an educational CONTENTS: Getting to Know the AIM 65; ing money; Examples of personal computers text for the programmer who wants to Addition Operations; Subtraction and in use. Appendices: A. Binary Arithmetic; learn advanced programming tech­ Logical Operations; Program Sequencing; Octal; Hexadecimal; ASCII Code. B. Bus niques by using the 6502. Although it Debugging Programs; Multiplication Opera­ Standards; S100 (IEEE); SS50, etc. C. can be used merely to play games with tions, with Shift & Rotate; Division Opera­ Manufacturers and Distributors in U.K. D. a 6502-based board, for educational tions; Subroutines and the Stack; Computer Clubs in the U.K. E. Magazines Unordered Lists; Sorting Unordered Data; in English... UK/USA/Continent. F. purposes, the reader should be familiar Code Conversion from Input; Code Conver­ both with the 6502 instruction set and Bibliography of Selected Microcomputer sion for Output; Input/Output; A More Books. G. Glossary. H. Some Hints on Kit- with basic programming techniques. Powerful 1/O Device, the R6522 VIA; Inter­ build Systems. The programs listed are for the SYM rupts; A Tuning Program with Decimal but can be adapted to other 6502-based Output; The AIM 65 Assembler; Answers to microcomputers. Experiments. (Continued on following page)

No. 35 - April 1981 MICRO - The 6502 Journal 47 The Call Helmets Personal Computer Program; Sorting Computer Data; Program Computer System—Getting into it; Using Letteris a monthly newsletter which Analysis,- "NAMELIST"; Self-Help Test the consultant; Finding the consultant; began publication with the January Questions; References. Inventory Con­ Finding the vendor; Getting it all in writing; 1981 issue. Helmers, a co-founder of trol— Objectives,- Who Needs an Inventory?; Involving your staff,- The happy outcome. Byte magazine and its former Editorial Inventory as a List; Inventory Functions,- Buying Services Instead— Service bureaus; Program Analysis; Program Evaluation; Timesharing; Whither timesharing? Amen, Director, provides subscribers with Rapid Search Methods; Summary; Self-Help amen. The Minicomputer—But anyway,- analyses of issues and trends affecting Test Questions; Reference. Payroll Pro­ Acquisition notes; Again, what's a mini?; the small computer industry. Helmers grams— Objectives; Payroll Requirements; Making a decision; The cloudy crystal ball; plans to offer subscribers the oppor­ Printing on Prepared Forms; Program Devel­ The onrushing dawn. Shopping for Your tunity to participate in a monthly Per­ opment; The Master File; Master Payroll Hardware —How much to buy?; The double sonal Computer Industry Conference Program; Entering Employee Data,- Payroll system; System in one cabinet? Memory Call which he will moderate. Each Entries and Calculations; Entering Pay options; Where to buy; Guarantees; Notes issue is a minimum of 8 pages; some Data; Pay Procedure; Payroll Summary; on I/O devices; Keyboards; Writehander™; may run to 24 or 48 pages. A one-year Conclusion; Self-Help Test Questions; Test Teleprinters, Teletype™; Electric General Ledger subscription is $200.00 from North Programming Project. typewriters; CRT display,- Other displays; Programs— Objectives; Terms Defined; Cassette drive; Floppy disks, diskettes; American Technology, Inc., 174 Con­ General Ledger Defined; System Overview,- Hard disks: Winchesters,- Printers; Isolators, cord Street, Suite 23, Peterborough, Transaction Examples; Program Descrip­ noise suppressors; Power supplies; Front New Hampshire 03458. tions; Operating the General Ledger panel; Modems; The computer room; System; Self-Help Test Questions,- Test Pro­ "Desk tops" and accessories,- Cost and ject. An Introduction to Word Process­ quality; Watch out. The Professions and the ing—Objectives ; Word-Processing Func­ Computer—The accountant; The law of­ Microcomputers and Business tions,- Office of the Future; Hardware Re­ fice; The doctor's office; The writer's office; quirements; Suitable Software; Time Shar­ That bottom line (financing); Leasing; Tax Basic Business Software by E.G. ing. Basic Computer Modeling and Simula­ benefits. The Butcher, The Baker and The Brooner. Blacksburg Continuing tion— Objectives; The Break-Even Example,- Candelstick Jobber —The small manufac­ Education Series, Howard W. Sams & Graphical Method; The Computer Techni­ turer; Construction and lumber; Ware­ Co., Inc. (4300 West 62nd Street, In­ que; Other Simulation Problems; Random houses; Real estate; Insurance; A portrait dianapolis, Indiana 46268), 1980, 142 Numbers,- Self-Help Test Questions; studio; Pharmacy; Restaurant; Finding out References. Appendix—ASCII Code Chart; more. Glossary. Appendix—How It All pages, charts, diagrams, and listings, Glossary,- Index. Works. Index. 5 Vi * 8 Vi inches, paperbound. ISBN: 0-672-21751-1 $9.95

This book is designed primarily for Small Computers for the Small business people who want to under­ Businessman by Nicholas Rosa and stand some of the fundamentals of Sharon Rosa, dilithium Press (30 N.W. business software development. But it 23rd Place, Portland, Oregon 97210), General Computer is also for programmers who want to 1980, x, 332 pages, 5 Vi x 8-5/16 leam more about business software. inches, paperbound. Software News — The Computer Soft­ Some familiarity with BASIC-language ISBN: 0-918398-31-2 $12.95 ware Products Newspaperis a programming is assumed. The author newspaper tabloid which will appear aims to teach readers either to write This book is written for small business monthly beginning in May. Sentry some of their own business software or people and is mostly about small com­ Database Publishing, a division of evaluate programs written by others. puters, specifically microcomputers. It Technical Publishing, will issue the Sample programs are included. is intended to help the reader select the tabloid (Technical Publishing is the computer that best meets his business publisher of Datamation and is owned CONTENTS: Introduction to Small- needs. by The Dun & Bradstreet Corporation). Business Software —Objectives; Small- Software News will report on the soft­ Business Computers Defined; Effect on CONTENTS: The Small Computer Revolu­ ware industry. It will provide analysis Paper Work; Businesses that Benefit; Soft­ tion—but we're not trying to sell you; ‘ 'The and commentary on applications ware Costs,- Self-Help Test Questions. Soft­ price of a new car"; Then why shouldn't packages, systems software, produc­ ware Fundamentals— Objectives; Software you wait?; Now, about that rash idea...; tivity aids, databases, and language pro­ Functions,- Computer Languages; The Oper­ Affording it; Turnkey in the store; cessors. It will cover data and software Graphics; How "big" a system,- Making ating System; Software Defined; Language- security, software legal issues, and job Independent Programming; BASIC Compar­ money directly; "But I'm not a computer ison and Translation; Self-Help Test Ques­ freak..."; That mini- and micro- distinc­ opportunities; and it will offer user tions; References. How To Choose tion; What about just renting services?; ratings and surveys, software vendor Appropriate Business Software— Objectives; Now whaddaya mean, "Revolution?"; The profiles, market statistics, and other Practical Limits,- Where To Get It; When integrated circuit; But what's a semicon­ business and financial information. Customizing Is Needed; Compatability; ductor?; Large scale integration; And sud­ The newspaper will be distributed to Self-Help Questions. How Programs Are Put denly—; Voila!; The significance. The 50,000 software buyers and specifiers. Together—Objectives,- Terms Defined; The Small Business Computer— Interfacing; For information, write Software News, Use of Symbols in Programming; The Step- Memories are made of this...; A final 5 Kane Industrial Drive, Hudson, by-Step Method; Subroutines, or Modules,- memory; Mass storage; The other stuff. Massachusetts 01749. Programming Hints; Summary of the Step- This Thing■ Called Software— Documenta­ by-Step Method; Debugging Hints and tion; Programs,- Computer languages; Those Other Techniques; The Disk Subsystem; translating programs; What BASIC looks Self-Help Test Questions. Information like,- Enough, already; Now, about that Storage and Retrieval— Objectives; Data problem...,- Acquiring the stuff. Data Pro­ Generation and Storage; How Data Is cessing and Word Processing— The nature of Stored; Disk Handling; The Disk Library; data processing; The nature of word process­ File Structure; Overview of "CHECKING'1 ing; Choosing a system. How to Shape Your

48 MICRO - The 6502 Journal No. 35 - April 1981 (------^DR. DALEY OFFERS SOFTWARE FOR EVERYONE

DATA______BASE The data base package allows total user control $299.95 over the contents of each entry in the file. Index 99.95 Features user selectable record size from 5 to 242 For PET oi CBM 4000 or 8000 series with 32K memory please specify characters per record, statistical and plotting your machine configuration. package, output with WORDPRO files or printer. Includes full user definable output for­ matting. With optional indexing routine can produce a comprehensive index of a data set. ______MAIL______LIST $159.95 This powerful mailing list package features a For p e t or cbm 4000 or 8000 series variety of options for producing labels. It in- 7iur ma^CTcZi£doTcify cludes user defined file structure and label for­ mat. Label format can list to the printer or to WORDPRO format files. SOFTWARE______LIBRARY Hundreds of schools and individuals have pur- Cassette $69.95 chased this package for use as an educational Diskette 79.95 tool or just plain fun. It contains 50 (yes fifty!) For APPLE II or PET programs. This ranges from our famous TREK 3 and horse race to fun learning programs for children to checkbook and a micro mail list pro­ gram with lots in between. At about $1.40 per program how can you miss?

Charge to your MC/VISA DR. DALEY'S SOFTWARE 425 Grove, Berrien Springs, Michigan49103 Phone (616) 471-5514 Sunday-Thursday noon to9 p.m. Eastern Time

No. 35 - April 1981 MICRO - The 6502 Journal 49 CONTINENTAL SOFTWARE THE flP P lf SOJRCL

For Apple owners only. Thor­ THE COMPUTER PROGRAMMED Disbursement Journals. Customized oughly tested, well documented ACCOUNTANT FOUR MODULES journals. Allows simulation of manual programs lo r business and pleas­ Buy all four now—or add as you special journal entries. Prints Aging expand $175 each ($250 after 6/1/81) Report to 150 days, vendor list and ure. All written by professionals. labels and even a Cash Requirements Each checked out carefully by The first programs for your Apple that Report. Posts to General Ledger. experts in its field. your accountant will like as much as you do. Nobody makes it better—or HYPERSPACE WARS easier to use—than Continental Soft­ CPA4 PAYROLL 2 GAMES FOR THE PRICE OF 1 $29.95 ware. Simple step-by-step instructions. Maintains personnel records for as 48K Trek. Stardate 3421. Excellent error checking. Modules can many as 100 employees. Quarter-to- The Terraunion is being attacked. be used individually, or integrated into date and year-to-date earnings and You command United Starship Excali- a complete Accounting System. deduction records. Employees are bur. Your mission: destroy the deadly Manuals only: just $15 each. departmentalized and designated Klepton invasion force. Four levels, hourly or salaried. Prints complete Novice to Master. CPA1GENERAL LEDGER. Payroll Checks, 941 information, W-2s, True double entry bookkeeping with State of California DE-3 information. 3-D Space Battle. Use your on-board^ complete, accurate audit trails show­ scanners to search for alien ships in hi­ Prints Payroll Journal and posts to ing the source of each entry in the General Ledger. res three-dimensional space. Destroy general ledger. Concise, meaningful as many aliens as you can before you reports generated include Balance These are just some of the fea­ run out of fuel or your ship is destroyed. Sheet, Profit & Loss Summary, Trial tures of each CPA module. All require Hi-res graphics. Req. 48K, Applesoft in Balance and Complete Journal Activity 48K, Applesoft in Rom, Dos. 3.3, 2 disk Rom+1 disk drive. Dos. 3.2 or 3.3. Report. Reports show monthly, year-to- drives-(-printer. L.A. LAND MONOPOLY $29.95 date and last year monthly+YTD for At your local dealer or fill out and Bankrupt your opponents while becom­ comparison. Custom charting feature mail today. Phone for immediate ing the richest player in the game. Buy, includes hi-res plotting of one or more delivery. sell, rent and trade to accumulate the accounts. most cash and property. Two to six may CPA2 ACCOUNTS RECEIVABLE play. Computer is banker. Create your own special version using streets in • Prints invoices on available custom OK, I’LL BYTE. ■ your own town. i forms or on plain paper. Back orders Send me these revolutionary ‘ and extensions computed. Issues state­ programs: | Hi-res graphics. Req. 48K, Applesoft ments for all customers, one or more □ Hyperspace Wars. . . ______$ g in Rom+1 disc drive. Dos. 3.2 or 3.3. customers, or only those with current, □ L.A. Land Monopoly. HOME MONET MINDER $34.95 30-, 60-, 90- or 150-day balances. □ Home Money Minder H Z I Maintain up to 300 customers. Custom­ □ The Mailroom...... Complete home financial system com­ I bines an excellent Home Checkbook ized journals. Allows simulation of □ CPA1 General Program with Budgeting. Transactions manual special journal entries. Posts to L edger...... ■ □ CPA2 Accts. Rec. . . by month by budget category. Bank General Ledger. Prints aging report to I reconciliation. Budget for year. Total 150 days. Also prints customer lists □ CPA3 Accts. Pay. . . expenses compared monthly and year- and labels. □ CPA4 Payroll...... I to-date. Plus much more. CP A3 ACCOUNTS PAYABLE No. C.O.D.s Subtotal I Req. 48K, Applesoft in Rom, 1 disk Cal. res. add 6% Prints checks to vendors and non- TOTAL 1 drive+printer. Avail, in Dos. 3.3. vendors on available pre-printed checks or plain paper. Each check stub| Name______I THE MAILROOM $34.95 Address ______Stores up to 750 names per disk. Prints shows invoice(s) paid, discounts taken, I net paid, Prints Purchases and Cash tCity_ _State_ master lists and labels 1, 2 or 3 across. ard No._ I Sorts in 5 seconds. Sort on any of 12 M14/81 items, search any sorted item in 10-20 seconds maximum. Easy editing, cus­ tomized inputs. GONTMNTAL!UJSOFTVARE Req. 48K, Applesoft in Rom, 1 disk drive+pririter (132 column capability' 12101 Jefferson Blvd., (213) 371-5612 needed to print Master List.) in Dos. 3.3. Culver City, CA 90230

50 MICRO - The 6502 Journal No. 35-A pril 1981 Southbury Professional Systems Inc. Software: Educational, Personal, D.B.A. The Micro-Computer Store Business, Games Union Square Publications: MICRO, Byte, Creative Southbury, Connecticut 06488 Computing, Interface, Call-APPLE /AlCftO Contact: Marilyn or Joseph Osterman 203/264-2983 North Carolina Hardware: Apple, Atari, Vector Dealers ETC Corporation Graphic P.O. Box G - OLD NC 42 Software: Educational, Personal, Apex, North Carolina 27502 Business, Games, Professional Contact: Jeff Butler 919/362-4200 New Jersey Hardware: AIM, CBM, KIM, OSI, PET, Software City Billings 111 Grand Ave. Software: Educational, Personal, Presented here in zip-code order are River Edge, New Jersey 07661 Business, Games, Scientific, Custom those MICRO dealers who responded Publications: MICRO, Byte, Micro­ to our newsletter request for Informa­ New York computing, Compute tion concerning their dealership. Time Enterprise Many have been MICRO dealers for 8247 Genesee Road Florida quite some time while others are new. Springville, New York 14141 Associated Information Systems This service is provided to acquaint Contact: Paul Zielinski 825 Osceola Drive readers with these dealers and to en­ 716/592-7665 Rockledge, Florida 32955 courage readers to visit dealers in Hardware: OSI Contact: D.R. Hendricks their area. This listing is provided Software: For OSI 305/632-1090 twice a year to update previous Hardware: OSI listings (see MICRO 29:69). This is not Pennsylvania Software: Educational, Personal, intended as a complete listing of Computer Mail Order Business, Games, Custom Pro­ MICRO dealers. 501 E. Third St. gramming Williamsport, Pennsylvania 17701 Publications: MICRO United States Contact: Randy Gail it 717/323-7921 AMF Microcomputer Center, Inc. Maine Hardware: Atari, CBM, PET 11158 N. 30th St. Maine Micro Systems Inc. Software: Educational, Personal, Tampa, Florida 33612 555 Center Street Business, Games Hardware: Apple Auburn, Maine 04256 Software: Educational, Personal, Contact: Hugh Blair/AI Celetti Maryland Business, Games 207/782-7139 Publications: All major computer Computer Crossroads, Inc. Hardware: Aim, Apple, Atari, CBM, magazines 9143 G Red Branch Road KIM, PET, TRS-80 Columbia, Maryland 21045 Software: Educational, Personal, Ohio Contact: Richard Simpson Business, Games 301/730-5513 Microage Computer Store Publications: MICRO, Compute, Kilo­ Hardware: Apple, Atari 2591 Hamilton Road baud, 80-Microcomputing Software: Educational, Personal, Columbus, Ohio 43227 Business, Games Contact: John W. Spencer Vermont Publications: Many 616/868-1550 Computers Plus Hardware: Apple, Atari, North Star, 177 Church St. Virginia HP, Tl, Archives, Altos, Ithica, Zenith Software: Educational, Personal, Burlington, Vermont 05401 Computerland of Tysons Corner Contact: Tim Barden Business, Games 8411 Old Courthouse Road 802/658-5858 Publications: All Vienna, Virginia 22180 Hardware: Apple, Atari, HP-85 Contact: Rich Doud Software: Educational, Personal, Michigan 703/893-0424 Business, Games, General Accounting Hardware: Apple, Atari, CBM, PET, New Dimensions in Computing, Inc. Publications: MICRO, Byte, Creative North Star, Dynabyte, T.I., Cromemco 541 E. Grand River Computing, Microcomputing Software: Educational, Personal, East Lansing, Michigan 48823 Business, Games, Languages, Contact: Robert Gibbs Connecticut Utilities, etc. 517/337-2880 The Computer Store Publications: MICRO, Byte, Kilobaud, Hardware: Atari, Exidx, Vector 63 South Main St. Personal Computing, Creative Com­ Graphic, Intersystems Windsor Locks, Connecticut 06096 puting, Nibble Software: Educational, Personal, Contact: Susan Bramley Business, Games 203/627-0188 Computer Center Publications: MICRO, Byte, Interface Hardware: Apple, HP-85 2927 Virginia Beach Blvd. Age, Microcomputing, 80-Micro- Software: Educational, Personal, Virginia Beach, Virginia 23452 computing, Compute, Creative Business, Games Contact: Jeff Wilson Computing Publications: MICRO, Byte, Nibble, 804/340-1977 Creative Computing Hardware: Apple, Atari

No. 35 - April 1981 MICRO - The 6502 Journal 51 Wisconsin Call APPLE, Kilobaud, 80 Micro­ Business, Games computing, Byte, Creative Com­ Byte Shop of Milwaukee Publications: Byte, Creative Com­ puting, Interface Age 6019 W. Layton Avenue puting, Personal Computing Greenfield, Wisconsin 53220 Wallace Computers, Inc. Contact: Kathleen Preston Nevada 2619 N. University 414/281-7004 Home Computers Peoria, Illinois 61604 Hardware: Apple, CBM, PET, North 1775 E. Tropicana #6 Contact: Ronald A. Wallace Star, APF Las Vegas, Nevada 89109 309/685-7876 Software: Educational, Personal, Contact: Ike Hardware: Apple Business, Games 702/798-1022 Software: Educational, Personal, Publications: MICRO, 68 Micro, Byte, Hardware: AIM, Apple, Atari, CBM, Business, Games Creative, Kilobaud, 80 Micro­ PET, Bally Publications: MICRO, Byte, Call computing, onComputing, Interface Software: Educational, Personal, APPLE, Nibble, Softalk Age, Nibble, Apple Orchard, Com­ Business, Games, Functional pute, Softside, Personal Computing, Programs Main Street Computer Company etc. Publications: Wide variety of com­ 215 N. Main puter magazines Decatur, Illinois 62523 PETTED micro systems Contact: David B. Herriott 4265 W. Loomis Rd. The 6502 Program Exchange 217/429-5505 (P.O. Box 21851) 2920 Moana Lane Hardware: Apple Milwaukee, Wisconsin 53221 Reno, Nevada 89509 Software: Educational, Personal, (moving soon) Contact: David or Don Marsh Business, Games Contact: Theodore J. Polczynski 702/784-4991 Publications: MICRO, Byte, Creative 414/282-4181 702/825-8413 (eves.) Computing, interface Age Hardware: Atari, CBM, KIM, PET, Software: Educational, Personal, Software: Educational, Personal, Missouri Games, High-level Languages and Business, Games, TRS-80 Instant U tilities Back to Basic Computer Center software and creative computing 43 Cross Keys Publications: MICRO, Compute, California Florissant, Missouri 63033 Kilobaud, Creative Computing Contact: Fred or Jane Hahn Malibu Microcomputing 314/837-4495 2391 DA DeVille Way Minnesota Hardware: Atari, OSI, Vector Graphic Malibu, California 90265 Personal Business Systems Software: Educational, Personal, Contact: T. Nalevanko 4306 Upton Ave. So. Business, Games 213/456-1137 Minneapolis, Minnesota 55410 Publications: MICRO, Compute, Byte, Hardware: Apple Contact: Mike Carlson Kilobaud, Microcomputing, Creative Software: Educational, Personal, 612/929-4120 Computing Business, Games Hardware: Apple Publications: MICRO, Byte, 80 US, Software: Educational, Personal, Computer Mart Compute Business, Games 1904 E. Meadowmere Publications: MICRO, Apple Orchard, Springfield, Missouri 65804 Omni Unlimited Creative Computing, Peelings, Nibble Contact: Rob Lurvey 105 S. Los Robles 417/862-6500 Pasadena, C alifornia 91101 Illinois Hardware: Apple, Atari, IMS Contact: Don K. Fenstermaker 213/795-6664 Data Domain of Schaumburg Software: Educational, Personal, Hardware: CBM, PET, Billings 1612 E. Algonquin Rd. Business, Games Software: Educational, Personal, Schaumburg, Illinois 60195 Publications: Most monthlies and Business, Games, Legal, Medical, Contact: Marilyn Clark, Steve quarterlies at present Dental, MFG Shendelman Publications: MICRO 312/397-61700 Nebraska Hardware: Apple, Alpha Micro, Computers West Hewlett-Packard Calculators and 7351 Pacific St. Computer Systems Design Group Accessories Omaha, Nebraska 68114 3632 Governor Drive Software: Educational, Personal, Contact: Kevin J. Burke Business, Games 402/391-3737 San Diego, C alifornia 92122 Contact: Mary Elizabeth Kroening Publications: Large selection Hardware: Apple, Atari, Data General, 415/856-1954 Archieves Software: CAI/Adventure Authoring Farnsworth Computer Center Software: Educational, Personal, system for Apple II named “GROW” 1891 N. Farnsworth Ave. Business, Games Aurora, Illinois 60505 Publications: MICRO, Interface Age Contact: Luke Snyder 312/851-3888 Utah Computer Business Systems Hardware: Apple, Hewlett-Packard, 22963 La Cadena Computer Translation, Inc. Laguna Hills, C alifornia 92653 HP-85 A 1455 S. State Street Software: Educational, Personal, Contact: Lou Orem, Utah 84057 951-4640 Business, Games Hardware: Apple Publications: MICRO, Apple Orchard, Hardware: OSI, Data General Software: Educational, Personal, Software: For same

52 MICRO - The 6502 Journal No. 35 - April 1981 Desert Data & Electronics Hardware: Atari, CBM, PET, S-100 Belgium 212 Balsam (PO Box 1396) Software: Educational, Personal, MICRO 2000 Ridgecrest, California 93555 Business, Games 32 Galerie D’lxelles Contact: Larry Jenkins Publications: MICRO, Byte, Interface Brussels, Belgium 1050 714/375-4818 Age, Kilobaud, 80 Microcomputing, Contact: J. Marsily Hardware: Atari, CBM, OSI, PET, Tl, S-100 Microsystems, Creative 512 4305 Northstar, Dynabyte Computing Hardware: Apple, TRS-80 Software: Educational, Personal, Software: Educational, Personal, Business, Games Business, Games Publications: MICRO, Byte, Creative FOREIGN Publications: MICRO, Nibble, 80-US, Computing, Kilobaud Canada Call APPLE, Compute (Ontario) FORTH Interest Group Compulec P.O. Box 1105 Naamsesteenweg 382/W5 Computer Innovations Head Office 3030 Leuven (Heverlee) San Carlos, California 94070 1719 St. Laurent Blvd. 415/962-8653 Belgium 3030 Ottawa, Ontario, Canada K1G 3V4 (Mail Order) Contact: Y. Rummens Contact: Kathryn Miller, Purchasing 16-22.34.88 Products/Services: Source Listing for or Bruce McLaws, Sales 6502 Hardware: AIM, Apple, Sharp-ITT 2020 Hardware: Apple, CBM, PET, Software: Educational, Personal, Cromemco Sunset Electronics Business 2254 Taraval St. Software: Educational, Personal, Business, Games San Francisco, California 94116 Netherlands Contact: John Warburton Publications: Byte, Compute, Computercollectief 415/665-8330 Kilobaud, Nibble, etc. Amstel 312a Hardware: OSI 1017 AP Amsterdam, Netherlands Software: Educational, Personal, House of Computers Inc. Contact: Frans de Vreeze Business, Games 368 Eglinton Avenue West 020-223573 Publications: All computer Toronto, Ontario, Canada M5N 1A2 Contact: Anita Tchoryk Software: Educational, Personal, Business, Games (for Apple, Sorcerer Computerland Hardware: Apple, CBM, KIM, PET and TRS-80) 22634 Foothill Blvd. Software: Educational, Personal, Publications: At least 30 magazines, Hayward, California 94541 Business, Games Publications: MICRO, Byte, Interface 300 books 538-8080 Hardware: Apple, Atari, CBM, PET Age, Microcomputing, 80 Magazine, France Software: Educational, Personal, Nibble, Compute, Creative Computing Business, Games Alpha Systemes Publications: MICRO, Byte, 80 US, 80 The Computer Centre 51 Rue Thiers Microcomputing, Kilobaud, Creative 259 Davis Street Grenoble, France 38000 Interface Sarnia, Ontario N7T 1B4 Contact: P. Binet 519/337-6332 76.87.98.27 Hardware: Apple, OSI, Sharp, Computer Scene Publications: MICRO and others 753 So. State St. Hewlett-Packard Ukiah, California 95482 Software: Educational, Personal, (British Columbia) Contact: A.D. Rorabaugh Business, Games 707/462-1578 Conti Electronics Ltd. Publications: Many Hardware: Atari, CBM, PET 7204 Main Street Software: Educational, Personal, Vancouver, British Columbia, Canada SIVEA Business, Games V5X 3J4 31 BD des Batignolles Contact: Gary W. Skett Paris, France 75008 Oregon 604/324-0505 Contact: J. Cleenewerck Hardware: PET 522 70 66 Computerland of Portland Software: Educational (limited), Per­ Hardware: Apple, TRS-80 12020 S.W. Main sonal, Business, Games, Industrial Software: Educational, Personal, Tigard, Oregon 97223 Monitoring and Testing Hardware Business, Games Contact: Cliff Bihl Publications: MICRO, Compute, Publications: MICRO, Nibble, Call 503/620-6170 Creative Computing APPLE, Byte, Creative Computing, Hardware: Apple, Atari, CBM, PET, 80-US, etc. Cromemco, Vector Australia Software: Educational, Personal, Business, Games Electronic Concepts Pty. Ltd. Publications: MICRO, Byte, etc. 55 Clarence Street Sydney, N.S.W. Australia 2000 Washington Contact: D.T. or L. Hoess Hardware: Apple, Onyx The Electronics Shop Software: Educational, Personal, 131 North Decatur Business, Games, Scientific Olympia, Washington 98502 Publications: MICRO, Byte, Interface, Contact: Tim Personal Computing, Kilobaud 206/357-6304

No. 35 - April 1JI81 MICRO - The 6502 Journal 53 r e c is io n Decision Systems Singing the file transfer blues? Then... ( 2 P.O. Box 13006 O y s t e m s Denton. TX 76203 Get B. I.T.S.!

SO FTW A R E FOR THE A PP LE II* Use your fs/l icro modem H,1 A I □2Cand, or IS A M D S is an integrated set of Applesoft routines that gives indexed file capabilities Apple Comm Card3 to: to your BASIC programs. Retrieve by key, partial key or sequentially. Space from deleted records is automatically reused. Capabilities and performance that match Send data files. BASIC programs, products costing twice as much. even machine code $50 Disk, Applesoft. t o mos t computers over phone I ines. 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 Copy anything you see the cost of P A S C A L. $35. Disk, A pplesoft (48K, ROM or Language Card). into a 31 K buffer then save it on disk

DSA— DS is a dis assembler for 6502 code. Now you can easily dis-assemble any and/or print it under your complete control. machine language program for the Apple and use the dis-assembled code directly as input to your assembler. Dis-assembles instructions and data. Produces code com­ Many more features! patible with the S-C Assembler (version 4.0), Apple's Toolkit assembler and others. $25 Disk, Applesoft (32K, ROM or Language Card). See it at your favorite computer FORM-DS is a complete system for the definition of input and output froms. FORM- store today. DS supplies the automatic checking of numeric input for acceptable range of values, automatic formatting of numeric output, and many more features. $25 Disk, Applesoft I32K. ROM or Language Card).

UTIL-DS is a set of routines for use with Applesoft to format numeric output, selec­ Trademarks held by: tively clear variables (Applesoft's CLEAR gets everything), improve error handling, and interlace machine language with Applesoft programs. Includes a special load 1 - Hayes Microcomputer Products routine for placing machine language routines underneath Applesoft programs. $25 Disk, Applesoft. 3- Apple Computer Inc.

SPEED-DS is a routine to modify the statement linkage in an Applesoft program to B.I.T.S. is a trademark of: speed its execution, improvements of 5-20% are common. As a bonus, SPEED-DS includes machine language routines to speed string handling and reduce the need for M icroSoftw are Systems garbage clean-up. Author: Lee Meador. 7927 Jones Branch Dr. Suite 400 $15 Disk, Applesoft (32K, ROM or Language Card). McLean, Virginia 22102 [703) 385-2944

{Add $4.00 for Foreign Mail)

*Apple II «s a registered trademark of the Apple Computer Cu. Don’t buy Apple Software

until you read this bode First check The Book— the one complete critical analysis of most Apple Software available. Games, Educational, Business, Utility programs and ADDRFRS more. Each comprehensively rated on 11 separate points. Each reviewed by OITYSTATF ZIP an expert in its field. Just $19.95. Now you can compare and get more for your software dollar. Does the CARD NUMBER EXP. program you need exist? How good is it? Which software vendors offer the M 14/81 best support? Find out all this and much more. MasterCard & Visa accepted. Fill out and mall today or call for shipment eBookcor n p a n y 16720 HAWTHORNE BLVD., LAWNDALE, CA 90260. (213) 371>4012. Calif residents add 6% I

54 MICRO - The 6502 Journal No. 35 - April 1981 I call your attention to "PRINT 80-Column Functions USING for the PET” by David Malmberg in this issue. Not only has The 80-column function table that he reworked an excellent Apple pro­ appeared in last month's column con­ /AlCftO gram for the PET, but he has also tained some errors. The corrected ver­ accommodated all three PET ROM sion, with a couple of additions, is P E T V e t sets. This involved knowing the right shown in table 2. page-zero locations and system calls for each ROM set. These are available from The window feature on the 80-col- the memory maps and entry point lists umn machines can be very powerful. It By Loren Wright published by Jim Butterfield in Com­ confines user input |and the com­ pute and The Transactor. Malmberg puter's attention] to a restricted area of Numbering of BASIC Versions also uses the contents of 50003 to iden­ the screen. The SET TOP and SET tify which BASIC is being used: 0—1.0; BOTTOM commands fix the upper left There seems to be a bit of confusion 1—2.0; 160—4.0. Because the numbers and lower right comers of the window. on the numberings of BASIC versions. involved are easy to remember, this is The window may also be defined by One popular numbering system for the fast becoming a standard technique. POKEing four values into memory for BASICs is the one I have been follow­ Some other frequently-used locations the four edges: ing: 2.0, 3.0, and 4.0. However, the one that vary from BASIC to BASIC are used by Commodore is a little dif­ given in table 1. Address Range ferent. The original BASIC (the "old'' TOP 224 0 to 24 ROM's) is called 1.0. The “upgrade'' Page zero locations tend to be the BOTTOM 225 TOP to 24 version, produced until recently, is 2.0, same in BASIC 2.0 and 4.0, but in 1.0 LEFT 226 0 to 79 and now we have 4 .0 .1 will use the lat­ they are completely different. PET RIGHT 213 LEFT to 79 ter convention from now on, and will system calls have different addresses, edit manuscripts published in MICRO but generally they work similarly in The window may be cleared by printing accordingly. each BASIC. Malmberg's BASIC pro­ or striking on the keyboard two suc­ gram will run on any PET or CBM cessive HOMEs. All 80-column machines have 4.0 machine without modification. ROMs, as do recent production 40-col- umn machines. These new 40-column machines are called 4016 and 4032, but Table 1 the actual circuit board is still the same. Some of the enclosures have 1.0 2.0 4.0 plastic tops, apparently enlarged to accommodate a disk drive. The disk 1) End of memory pointer 134,135 52,53 52,53 drive idea doesn't seem to have caught 2) # characters in keyboard buffer 525 158 158 3) Disable STOP key pQj^g on, but I expect we'll be seeing more 537,136 144,49 144,88 and more plastic tops. Also, boards 4) Enable STOP key pQ^g continue to be delivered with holes 537,133 144,46 144,85 drilled in the traces of 4016 PC boards where the second row of RAM chips would go. This is to prevent users or unscrupulous dealers from making a Table 2 cheap and easy memory upgrade.

There is an upgrade kit to go from Function ASCII Reverse Field Keyboard 2.0 to 4.0 BASIC, and you could even Character Combination go from 24-pin 1.0 ROMs to 4.0 if you had another socket to install the eighth BELL 7 g chip. As far as I know, there is no DELETE LINE 21 u ESC, RVS, K 28-pin (6540) upgrade kit. ERASE to BEGINNING of line 150 V LS,-<-, 3 There are several good reasons to ERASE to upgrade—faster garbage collection and END of line 22 V Q ,4 more powerful disk commands, for in­ GRAPHICS screen 142 N LS, RS stance. All but the most serious pro­ INSERT line 149 U SH, ESC, RVS, K grammers will stay with what they SCROLL DOWN 153 Y LS, ESC, K have. After all, the old ROMs weren't SCROLL UP 25 y so bad were they? SET BOTTOM 143 o SH, Z, A, L SET TOP 15 0 Z, A, L Toward Universal PET Programs SET TAB/CLEAR TAB 137 I SH, TAB TAB 9 i TAB MICRO will continue to publish TEXT screen 14 n articles for all three BASIC ROM sets, and for both disk operating systems, SH = either shift but as I mentioned in a previous col­ LS = left shift umn, articles that apply to all three are RS = right shift much preferred. All digits are on the numeric keypad, not the main keyboard.

No. 35 - April 1981 MICRO - The 6502 Journal 55 Bii| Savings On Atari & PET! No Risk - No Deposit On Phone Please Call Between 11AM & 6 P M O r d e r s - Shipped Same Day You (Eastern Standard Time) Call° - C.O.D. or Credit Card * On all in stock units (800) 233-8950 ATARI® 800™ ATARI® 810™ PERSONAL COMPUTER DISC List $1080 DRIVE

$ 7 5 9 List $599.95 New Low Price

only $489.00 A" Maxell Disks...... 10 for $34 Sycom Disks ...... 10 for 29 ATARI’ Atari Disks...... 5 for 22

400 8 K ...... $4.19 CX4115 Mortgage & Loan Analysis ...... $13 400 16K...... 449 CX4101 An Invitation to Programming 1 ... 17 C X8104 Atari 810 410 Recorder...... 62 CX4106 An Invitation to Programming 2... 20* 815 Disk...... 1199 CX4117AnlnvitationtoProgramming3... 20* M aster D iskette II 822 Printer ...... 359 CX4107 Biorhythm ...... 13 825 Printer...... 779 CX4103 Statistics I ...... 17* N ew DOS 2 Operating 830 Modem...... 159 CX4121 Energy Czar ...... 13 System Master 850 Interface Module ...... 179 CX4108 Hangman ...... 13 CX852 8K RAM ...... 94 CX4102 Kingdom...... 13 only $21.00 CX853 16K RAM ...... 149 CX4112 States & Capitals...... 13 CX70 Light Pen ...... 64 CX4114 European Countries CX30 Paddle...... 18 &Captials...... 13 Microtek RAM 16Kor32K CX40 Joystick...... 18 CX4105 Blackjack...... 13 CX86 Printer Cable ...... 42 CX4111 Space invaders...... 18 • Full 1 year warranty C016345 822 Thermal • Compatible with 400 or 800 * These are scheduled for release in the first • Assembled and Tested Printer Paper...... 5 quarter of 1981. CA016087 825 80-col. Talk & Teach Courseware; 16K...... $ 99 Printer Ribbon 32K...... 189 (3/box)...... 17 CX6001 thru CX6017 ...... 23 CX4119 Conversational French ...... 45 CX4118 Conversational German __ 45 CX4120 Conversational Spanish __ 45 Atari Specialists . . . Atari March Releases: CX4125 Conversational Italian...... 45 W e carry it all! CX8106 Bond Analysis ...... $20 CXL4009 Chess ...... 30 CX8107 Stock Analysis ...... 20 CXL4011 Star Raiders" ...... 45 CX8108 Stock Charting ...... 20 CXL4004 Basketball...... 30 Combination Special! CX4104 Mailing List ...... 17 CXL4006 Super Breakout" ...... 30 CX4110 Touch Typing...... 20 CXL4010 3-D Tic-Tac-Toe...... 30 825 Printer &850 Interface CX8102 Calculator ...... 24 CXL4005 Video Easel'...... 30 825 Lists for $1000 CX4109 Graph It...... 17 CXL4007 Music Composer ...... 45 Regular Mail Order Price: $779 CX4120 Conversational Spanish ...... 45 CXL4015 TeleLink"...... 20 850 Lists for $220. CXL4002 BASICComputing Language 46 Regular Mail Order Price: $179 CXL4001 Education System S o f t w a r e Master...... 21 Save $20.00 CXL4003 Assembler Editor...... 45 WordPro 3 (40 col.) ...... $186 Buy Both For Only $938 WordPro 4 (80 col.) ...... 279 WordPro 4 Plus (80 col.)...... 339 Commodore Software co m m o d o re Visicalc - Apple...... $122 EBS Accounts Receivable Atari...... 163 Inventory System ...... $695 PET...... 163 Commodore Computers: Dr. Daley Mailing List ...... 129 4032 N ...... $1090 Dr. Daley Inventory 1...... 89 4032 B ...... 1090 OZZ Information System ...... 329 BPI General Ledger ...... 329 P r i n t e r s 8032 ...... 1499 Tax Package...... 399 NEC 5530...... $2495 Commodore Peripherals: Dow Jones Portfolio Management __ 129 Diablo 630 ...... 2195 CBM_ 2022 Printer...... 675 Pascal...... 239 Trendcom 100 ...... 299 CBM 4040 Dual Drive Floppy Disk ... 1090 Trendcom 200 ...... 489 CBM 8050 Dual Drive Floppy Disk ... 1420 Cables: Paper Tiger 445G...... 769 CBM C2N Cassette Drive...... 87 PET to IEEE Cable ...... 37 Paper Tiger 460G ...... 1219 Tally 8024 Printer ...... 1679 IEEE to IEEE Cable...... 46 Epson MX-80 ...... 539

To Order: Computer Mail Order Phone orders invited (800 number is for order desk only). Or send checkor money order. 501 E. Third St. Equipment Shipped UPS collect. Pennsylvania residents add 6% sales tax. Add 3% for Williamsport, PA 17701 Visa or MC. Equipment is subject to price change and availability without notice. (717) 323-7921

56 MICRO - The 6502 Journal No. 35 - April 1981 Add a Light Pen to your M icro

Figure 1 +5v This article includes the hardware details necessary to install a light pen on any 6502 system. Software is included for an OSI implementation.

Peter Alan Koski 27 Dogwood Drive Allendale, New Jersey 07401 Bill of Materials

R1 — photo-resistor (see text) R2 — 1.8K Many computer installations today offer R3 — 18K alternate forms of user 1/O other than R4 — 120K the standard CRT/keyboard combina­ tion. Among these is the light pen. In R 6 - 10K using a light pen, the user, if choosing R7 — 470 from a menu for example, simply Q1 — 2N5300 (RS 276-2009) points the pen at what he desires. Q2 — 2N5226 (RS 276-2032) When locating a point on a grid, the C l — .005 uF user simply locates the point using the PI — 100K PC-type potentiometer pen, rather than inputting coordinates through the keyboard. Table 1 Although the user may find this 4 5 6 7 simplification of input fabulous, for the 0 1 2 3 D020 D028 D030 D038 programmer there exists a lot of D000 D008 D010 D018 overhead. The programmer must keep 11 12 13 14 15 track of where the information is 8 9 10 D120 D128 D130 D138 located on the screen as the program D100 D108 D110 D118 progresses, and how the information 20 21 22 23 changes during program execution. 16 17 18 19 D200 D208 D210 D218 D220 D228 D230 D238 Principles of Operation 24 25 26 27 28 29 30 31 D320 D328 D330 D338 In theory, the operation of a light D300 D308 D310 D318 pen is extremely straightforward. 34 35 36 37 38 39 When a request is made to locate the 32 33 D420 D428 D430 D438 pen, a distinguishable token is swept D400 D408 D410 D418 across the display until the pen 44 45 46 47 recognizes its presence. At that time, if 40 ' 41 42 43 D528 D530 D538 we know where the token is, we also D500 D508 D510 D518 D520 know where the pen is. Simple as this 52 53 54 55 may seem, the hardware and software 48 49 50 51 D620 D628 D630 D638 doesn't always follow suit on simpli­ D600 D608 D610 D618 city. On graphics systems where there 61 62 63 is often a stand-alone microprocessor to 56 57 58 59 60 D720 D728 D730 D738 control the terminal functions, the D700 D708 D710 D718 "token” is the raster sweep. This is

No. 3 5 - April 1981 MICRO - The 6502 Journal 57 probably the most sophisticated and elegant approach since the resolution is extremely high and the scan is invisible 0 8 0 0 1 **************************** 0 8 0 0 2 * * to the user. 0 8 0 0 3 * LIGHT PEN QUADRANT QUERY * 0 8 0 0 4 * ROUTINE * I have taken a much more simpli­ 0 8 0 0 5 ** * * fied approach. Rather than search the 0 8 0 0 6 PETER A. KOSKI 0 8 0 0 7 * * entire screen for the pen's location, I re­ 0 8 0 0 8 **************************** quest verification at given screen loca­ 0 8 0 0 9 tions. With this approach, the token 0 8 0 0 10 must be displayed on the screen in 3 2 8 0 11 ORG $ 3 2 8 0 3 2 8 0 12 PENWRD EQU $FC00 order for the pen to see it. Since the 3 2 8 0206C33 13 JSR GETBLK standard scan rate for a monitor is 1/60 3 2 8 3 14 second, we have to display the token 3 2 8 3 15 GET USR ARGUMENT (QUADRANT NUMBER) — INSU and then wait the required 1/60 second RE 3 2 8 3 16 THAT THE VALUE IS ONLY 0-63 to guarantee that the token reaches the 3 2 8 3 17 display. Obviously if we were to poll 3 2 8 3A5B2 18 LDA $B2 2048 display locations, the time re­ 3 2 8 529 3 F 19 AND #%00111111 quired wouldn't make this practical. 3 2 8 7A8 20 TAY ;GET ADDR LOOKUP OFFSET 3 2 8 8 21 Hardware 3 2 8 8 22 LOAD BASE ADDRESS INTO STORE/BLANK/SCAN/RE STR Figure 1 and the accompanying 3 2 8 8 23 R OU TINES "bill of materials” presents the design 3 2 8 8 24 3 2 8 8B 9B A 33 25 LDA LOADDR, Y for the light pen circuit I am using. The 3 28B8DB B 32 26 STA STORE+1 sensor used is a small Calectro photo­ 3 2 8 E8DC332 27 STA BLANK+1 resistor mounted in a magic marker 3 2 9 18 D 0 2 3 3 28 STA SCRN1+1 casing. The choice of the photo-resistor 3 2 9 48 D 3 D 3 3 29 STA RESTRE+1 3 2 9 7 30 over a photo-transistor was based on 3 2 9 7B 9 7 A 3 3 31 LDA HIADDR, Y spectrum sensitivity. Photo-transistors 329A8DB C 32 32 STA STORE+2 that I found were not responsive to a 3 2 9 D8 D C 4 3 2 33 STA BLANK+2 phosphorus source. The photo-resistor 32A 08 D 0 3 3 3 34 STA SCRN1+2 32A 38 D 3 E 3 3 35 STA RESTRE+2 was, so the choice was obvious. 32A 6 36 32A 6 37 INITIALIZE ADDRESSES FOR SAVE BUFFER The light/dark conditions are 32A 6 38 BUFFER STARTS AT $337E reflected via an RS-232 line which is 32A 6 39 LDA #$7A toggled between + 5 and - 9 volts. 32A 6A 97 A 40 32A 88D B E 32 41 STA SCRN+1 RS-232 was chosen as the communica­ 32AB 8 D 3A 33 42 STA SCRN2+1 tions link since I have an RS-232 port 32AE A 9 3 3 43 LDA * $ 3 3 on my machine |as do most). By using 3 2B 08D B F 32 44 STA SCRN+2 8 D 3 B 3 3 45 STA SCRN2+2 the light pen to drive the RTS line on 3 2 B 3 3 2B 6 46 the port, I can monitor the status of the 3 2B 6 47 SAVE BLOCK DATA/BLANK (DARKEN) SELECTED pen by monitoring the status word of 3 2B 6 48 QUADRANT the ACIA. The pen's condition will be 3 2B 6 49 found at the RTS bit. 3 2B 6AOOO 50 LDY #00 3 2B 8A 2 0 0 51 SAVE LDX t00 32BA BDFFFF 52 STORE LDA $FFFF,X The circuit goes together nicely on a 32BD 8DFFFF 53 SCRN STA $F F FF ; SAVE CHAR IN BU small piece of perf-board. The intercon­ FFER necting line used is a piece of miniature 3 2 C 0A 9 2 0 54 LDA # $ 2 0 3 2 C 29DFFFF 55 BLANK STA $FFFF,X shielded micro-phone cable. There 3 2 C 5E EB E32 56 INC SCRN+1 shouldn't be any problem assembling 32C8D 0 0 3 57 BNE N0CRY1 the circuit and all that remains is to 32CA E EB F32 58 INC SCRN+2 adjust the light pen to match the CRT 32CD E8 59 NOCRY1INX 32CE E 008 6 0 CPX #08 ;8 CHAR/LINE/QUA used. D 3 2D0D 0E 8 61 BNE STORE A BASIC routine can be used to 3 2D2 C8 62 INY initially align the pen. While printing 3 2D 3C 004 63 CPY #04 ;4 LINE/QUAD F 0 1 A 64 BEQ OUT1 the contents of the status port, adjust 3 2D 5 32 D 7ADBB32 65 LDA STORE+1 the monitor's brightness/contrast and 32DA 18 66 CLC PI of the light pen circuit. A point 32DB 6 9 4 0 67 ADC # $ 4 0 should be found so that touching the 32D D 8D B B 32 68 STA STORE+1 pen to an illuminated position will 3 2 E 08 D C 3 3 2 69 STA BLANK+1 3 2 E 3A DB C32 70 LDA STORE+2 cause the RTS bit to be set low ("0 "), a 3 2 E 66900 71 ADC #00 dark position should set the RTS bit 3 2 E 88D B C 32 72 STA STORE+2 high ("1 "). It should be possible to find 32EB 8 DC 432 73 STA BLANK+2 ;GET NEXT LINE A a position which is comparable to nor­ DDR 32EE 4CB832 74 JMP SAVE mal viewing intensity. 32F 1 75 ’

58 MICRO - The 6502 Journal No. 35 - April 1981 Software

32F 1 76 ; SEE IF LIGHT PEN WENT DARK The two routines presented here are 32F1 77 ; essentially identical except for the 32F1 2 0 6 F 3 378 OUT1 JSR TVDLA ;1/60 S. SCAN DE LAY resulting resolution. Both are called via 32F 4 79 the BASIC USR function. The longer of 32F 4A D 00FC 80 LDAPENWRD the two routines accepts argument 32F 7 2 908 81 AND # % 0 0 0 0 1 0 0 0 values from 0-63, the number corre­ 3 2 F 9F 0 3 7 82 BEQNOTFND ;DARK PEN SETS P. TS sponding to the screen quadrant to be 32FB 83 queried. Table 1 shows the quadrant 32FB 84 PEN IEDARK/ENABLE QUADRANT AND SEE IF numbering scheme. The address 32FB 85 PEN SEES CHANGE associated with each quadrant is the ad­ 32FB 86 32FB AOOO 87 LDY too dress of the upper left memory location 32FD A 20 0 88 ENABLE LDX too in the quadrant. Quadrants run eight 32FF A 9A 1 89 LDA ♦ $A1 ;WHITE SQUARE CH locations horizontally and four loca­ AR. tions vertically, or 32 locations total. 3 3 0 19DFFFF 90 SCRN1 STA $ F F F F ,X 3304 E8 91 INX Thus, touching the pen to any of these 3 3 0 5E408 92 CPX $08 locations will score a hit. A hit is 3 3 0 7 D0F8 93 BNE SCRN1 returned to BASIC as a 1 from the USR 3 3 0 9C8 94 INY function, a miss is returned as a 0. This 330A C 004 95 CPY t04 330C F 014 96 BEQ OUT2 ;ENTIRE QUAD ENA routine is thus most useful when BLED resolution is not critical, such as for 330E A D 0 2 3 397 LDA SCRN1+1 menu selection. 3 3 1 118 98 CLC 3 3 1 2 6 9 4 0 99 ADC # $ 4 0 The single-cell query routine polls 3 3148 D 0 2 3 3100 STA SCRN1+1 3 3 1 7 A D 0 3 3101 3 LDA SCRN1+2 individual memory locations and thus 3 3 1 A6 9 0 0 102 ADC too provides 64 x 32 resolution. The argu­ 331C 8 D 0 3 3103 3 STA SCRN1+2 ment of the USR function should be the ;ADDR OF NEXT LI 3 3 1 F 4CFD32104 JMP ENABLE requested memory address, less 32768. NE i 3 3 2 2 105 (BASIC only allows signed 15-bit 3 3 2 2 106 CHECK TO SEE IF PEN SEES ENABLED QUADRANT arguments.) The return value is the 3 3 2 2 107 same as the previous: 1 if hit, 0 if miss. 3 3 2 2 2 0 6 F 3108 3 OUT2 JSR TVDLA ; 1/60 S. SCAN DE LAY Both routines use the same idea in 3 3 2 5 109 3 3 2 5ADOOFC 110 LDA PENWRD polling the requested position. The in­ 3 3 2 82 908 111 AND ♦ 4 0 0 0 0 1 0 0 0 formation at the quadrant or single cell 332A D 0 0 6 112 BNE NOTFND ;HI PEN DISABLES is first saved and replaced by OSI RTS graphics character $20 (blank). If the 332C 113 332C 114 RETURN CODE .FOR PEN: pen is presently looking at a dark loca­ 332C 115 1 TO BA SIC = PEN WAS IN QUADRANT tion, we might have its position. If not, 332C 116 0 TO BA SIC = PEN WAS NOT IN QUAD we replace the data and return a miss. 332C 117 Should the pen be dark, we replace the 332C A 901 118 LDA #01 3 3 2 E 48 119 PHA ;SAVE RETURN COD $20 with $A1 (full illumination E ON STACK character). At this point, if the pen sees 3 3 2 F 4 C 3 5 3120 3 JMP REPLCE a transition to light, we are at the cor­ 3 3 3 2 121 ' rect position and return a hit after #00 3 3 3 2 A 90 0 122 NOTFNCLDA restoring the data. Had the transition 3 3 3 4 48 123 PHA ;SAVE RETURN COD E ON STACK not been seen by the pen, we obviously 3 3 3 5 124 were not at the right location, and 3 3 3 5 1 25 RESTORE ORIGINAL DATA FOUND AT QUADRANT would return a miss. 3 3 3 5 126 3 3 3 5AOOO 1 27 ?EPLCE LDY #00 3 3 3 7A 2 0 0 128 RPLCE LDX #00 3 3 3 9ADFFFF 129 SCRN 2 LDA $FFFF 3 3 3 C9DFFFF 130 RESTRE STA $ F F F F ,X Programming with a Light Pen 3 3 3 FE E 3A 33 131 INC SCRN2+1 3 3 4 2 D 0 0 3 132 BNE NOCRY2 When using the light pen, screen 3344E E 3B 33 133 INC SCRN2+2 locations become very critical, thus 3 3 4 7 E8 134 NOCRY2 INX 3 3 4 8E 008 1 3 5 CPX #08 careful formatting should be used 3 3 4 ADO ED 136 BNE SCRN2 through the memory map supplied by 3 3 4 C C8 137 INY OSI. Remember that when using stan­ 33 4 DC 004 138 CPY #04 dard input and print statements, the 334F F014 139 BEQ OUT 3 3 3 5 1A D 3D 33 140 LDA RESTRE+1 screen has a tendency to scroll. For­ 3 3 5 4 18 141 CLC tunately, this can be avoided by dis­ 3 3 5 56 9 4 0 142 ADC # $ 4 0 abling the line feed. POKE 9644,42 will 3 3 5 7 8 D 3 D 3143 3 STA R ESTRE+1 disable the scroll, POKE 9644,98 will 144 LDA R ESTRE+2 335AA D 3E 33 re-enable the scroll routine. 3 35D 6 9 0 0 145 ADC #00

(continued on page 63)

No. 35 - April 1981 MICRO - The 6502 Journal 59 (Add a Light Pen...)

/AICRO 335F 8D3E33 146 STA RESTRE+2 3362 4C3733 147 JMP RPLCE 3365 148 Classified 3365 149 ;RETURN TO BASIC CALLING ROUTINE 3365 150 3365 68 151 OUT3 PLA ■POP RETURN CODE Programmer Fatigue? 3366 A8 152 SYM—BUG/MONEX adds 15 commands TAY 3367 A900 153 LDA #00 to SYM's repertoire including an inter­ 3369 6C0800 154 JMP (08) RTS active trace/debug. Cassette @ $0200 or 336C 155 $3800: $19.95. EPROM (2716-5v) @ 336C 6C0600 156 GETBLK JMP (06) $F000-$F7FF: $39.95. Commented source 336F 157 listing: ,59.95. RAE-1|/2| FORMAT 336F 158 ;TV SCAN DELAY CASSETTE: $35 (requires 8K). Custom 336F 159 assembly add $2.00. Foreign add $2.00. 336F A040 160 TVDLA LDY #$4 0 SASE for nore information. 3371 A2FF 161 L00P1 LDX #$FF 3373 CA 162 LOOP2 DEX Jeff Holtzman 3374 DOFD 163 BNE LOOP2 6820 Delmar-203 3376 88 164 DEY St. Louis, Missouri 63130 3377 D0F8 165 BNE LOOP1 3379 60 166 RTS PET Machine Language Guide 337A 167 337A 168 ;QUADRANT CHARACTER HOLD BUFFER Comprehensive manual to aid machine 3 37A 169 i language programmer. More than 30 337A 170 BUFFER EQU *+32 routines are fully detailed so that the 337A 171 1 reader can put them to immediate use. 337A 172 ;ADDRESS LOOK UP TABLE FOR 64 GIVEN QUADRAN TS OLD or NEW ROMS. $6.95 + .75 postage. 337A 173 VISA & Ms.stercharge accepted. 337A D0D0D0 174 HIADDR HEX DODODODODODODODO Abacus Software 337D DODODO P.O. Box 7211 3380 DODO Grand Rapids, Michigan 49510 3382 D1D1D1 175 HEX D1D1D1D1D1D1D1D1 3385 D1D1D1 Spanish Hangman 3388 D1D1 338A D2D2D2 176 HEX D2D2D2D2D2D2D2D2 2,000 SPANISH words and sentences 338D D2D2D2 taught in a :lun way on the Apple. Send for 3390 D2D2 your school's free 30-day evaluation 3392 D3D3D3 177 HEX D3D3D3D3D3D3D3D3 diskette, from: 3395 D3D3D3 3398 D3D3 George Earl 339A D4D4D4 178 HEX D4D4D4D4D4D4D4D3 1302 South General McMullen 339D D4D4D4 San Antonio, Texas 78237 33A0 D4D4 33A2 D5D5D5 179 HEX D5D5D5D5D5D5D5D5 Save Money — You Can) 33A5 D5D5D5 33A8 D5D5 By building your own computer inter­ 33AA D6D6D6 180 HEX D6D6D6D6D6D6D6D6 faces. 80% savings. Send $3.95 for simple 3 3 AD D6D6D6 how-to package today. 33B0 D6D6 ADS 33B2 D7D7D7 181 HEX D7D7D7D7D7D7D7D7 33B5 D7D7D7 Box 9770 33B8 D7D7 Jacksonville, Florida 32208 3 3 BA 182 / 3 3 BA 000810 183 LOADDR HEX 0 008101820 28 3038 C1P Extended Monitor 33BD 182028 33C0 3038 2K EPROM has 14 cursor control/editing 33C2 000810 184 HEX 0008101820283038 functions, improved keyboard decoding. 33C5 182028 Machine language save, load, display, 33C8 3038 modify, move, breakpoint processing and 33CA 000810 185 HEX 0008101820283038 much more. For 24, 32, 64 char/line. 33CD 182028 $39.95 plus $1.00 shipping. $1.00 for 33D0 3038 complete information. 3 3D 2 000810 186 HEX 0008101820283038 33D5 182028 Bustek 33D8 3038 P.O. Box A 33DA 000810 187 HEX 0008101820283038 St. Charles, MO 63301 33DD 182028 33E0 3038 The DI-SECTOR Disk for the Apple 33E2 000810 188 HEX 0008101820283038 33E5 182028 makes 'Disecting' your Apple diskettes 33E8 3038 fast and easy. Now you can display and 33EA 000810 189 HEX 0008101820283038 edit any sector from an Apple diskette on 33ED 182028 the screen and more for only $20.00 33F0 3038 postpaid! ROM Applesoft is required and 33F2 000810 190 HEX 0008101820283038 both DOS 3.2 and 3.3 versions are 33F5 182028 supplied. 33F8 3038 Mike Rowe Productions P.O. Box 43504 Tucson, Arizona 85733

60 MICRO - The 6502 Journal No. 35 - April 1981 Liquidating Selling out all my software—all for CP/M

*************************** disks: Cobol, Fortran, Pascal, Compiler, 0800 1 Editor, Assembler, Linker, Macro, 0800 2 * * 0800 3 * SINGLE VIDEO CELL QUERY * Utilities, Sorts, Forth, CBas2, CP/M Vols. 0800 4 * ROUTINE * 1-45. All of iMSAI's software. Some TRS, 0800 5 * * Apple, too. 0800 6 * PETER A KOSKI * Mike Sheffield * 0800 7 * 3204 "A " Production *************************** 0800 8 Oceanside^ California 92054 0800 9 3280 10 ORG $3280 Flg-FORTH for OSI C1 P/Superboard 3280 11 OBJ $800 This implementation of the FORTH 3280 12 ’ENWRD EQU $FC00 Interest Group model (Release 1.1) runs JSR GETBLK 3280 20C432 13 under OS-65D and includes single/double 3283 14 3283 15 TURN USR ARGUMENT INTO 6502 ADDRESS precision integer arithmetic, compiler, 3283 16 editor and assembler. $50.00 includes 3283 A5B2 17 LDA $B 2 postage, fig-FORTH installation manual, 3285 48 18 PHA source listing, operating manual for 3286 A5B1 19 LDA $B1 CIP/Superboard and 5 V4" disk. ORA #%10000000 3288 0980 20 Mike Alport 3 28 A 85B2 21 STA $B 2 328C 68 22 PLA 5 Woodland Mounds Road 328D 85B1 23 STA $B 1 Iowa City, Iowa 52240 328F 24 AIM-65 High Quality Power Supply 328F A200 25 LDX #00 Exceeds Rockwell's specifications. Over­ 3291 26 voltage protection, fuse, switch, pilot 3291 27 SAVE CHARACTER AT CELL AND DARKEN light, line cord, cable—all included. Hand­ 3291 28 SELECTED CELL 3291 29 some metal case. Satisfaction or return 3291 A1B1 30 LDA ($B1,X) unit within 10 days for full refund. 3293 48 31 PHA ;SAVE CHAR ON ST VISA/MC, check (allow 2 weeks to clear’. ACK $64.95 plus shipping (5 lbs.). 3294 A920 32 LDA #$20 CompuTech STA ( $B1, X) 3296 81B 1 33 P.O. Box 20054 3298 34 3298 35 SEE IF LIGHT PEN WENT DARK Riverside, California 92516 3298 36 AIM-65 Newsletter * * Target JSR TVDLA .1/60 S. SCAN DE 3298 20C732 37 Target provides hardware and software LAY information useful for AIM-65 and 6502 329B AD00FC 38 LDA PENWRD 329E 2903 39 AND #400001000 users. The 1979 and 1980 back issues are 32A0 F013 40 BEQ NOTFND ;DARK PEN SETS R available for $12.00 while a continuing TS subscription costs $6.00. Just write to: 32A2 41 Target PEN IS DARK / ENABLE CELL AND CHECK IF 32A2 42 Donald Clem 43 PEN SEES TRANSITION 32A2 Route 2 32A2 44 32A2 A9A1 45 LDA #$A1 ,-WHITE SQUARE CH Spenserville, Ohio 45887 AH. OSI SUPERB/C1P - New MonitorROM 32A4 8 IB 1 46 STA ($B1,X) You haven't seen a better utility ROM 32A6 47 Exchange MonitorROM and get: Screen- 32A6 48 CHECK TO SEE IF PEN SAW ENABLED CELL 32A6 49 editor (insert, delete), cursor control, f. 32A6 20C732 50 JSR TVDLA ;1/60 S. SCAN DE 24/32/64 chr/line; cassette-sys. w. file LAY name handler (3-4 times faster), handles 32A9 51 ; BASIC, Hexcode and variable arrays, and 3 2A9 AD00FC 52 LDA PENWRD more. Further applications and program 32AC 2908 53 AND #100001000 information $1.00. 54 BNE NOTFND ;HI PEN DISABLES 3 2AE D00A Gerwin Bleich RTS 32B0 55 Boschstr. 1,3004 32B0 56 ,-RETURN CODE FOR PEN: Isemhagen 1, West Germany 32B0 57 ;1==PEN WAS AT CELL New — Wine Steward and Bar Guide ;0==PEN WAS NOT AT CELL 32B0 58 Want to know which wine to buy for that 32B0 59 32B0 68 60 PLA ;GET CELL'S CHAR special meal, or any occasion? The Super ACTER Bar and Wine Guide has it all. Complete 32B1 81B1 61 STA ($B1,X) description of over 54 Red, White and 32B3 A900 62 LDA *00 Specialty types as well as over 200 Brand 32B5 A 001 63 LDY #01 Name recommendations and prices. 32B7 6C0300 64 JMP (08) 3 2 BA 65 ;RTS — BASIC Glossary of Terms, Wine Tips, Pronuncia­ 32BA 66 J tion Guide, Serving Suggestions and 3 2BA 68 67 NOTFND PLA ;GET CELL'S CHAR "Computer" Wine Steward. Also included ACTER is a Bartender's Guide and recipes for 40 32BB 81B 1 68 STA ($B1,X) popular Mixed Drinks. An incomparable 32BD A900 69 LDA #00 value! Applesoft, 48K, Disk, $24.95 + 32BF AOOO 70 LDY #00 $1.50 postage. 32C1 6C0300 71 JMP (08) 32C4 72 ;RTS — BASIC Cine-Aero 1821 N. Frederick Street Burbank, California 91505

No. 35 - April 1981 MICRO - The 6502 Journa. 61 Ohio Scientific SPACE WARS for C1P, Hi- or Lo-Res (Add a Light Pen...) graphics. Maneuver into attack position making S turns and then make the kill 32C4 73 with your lasers! Or use evasive action and 32C4 6C0600 74 GETBLK JMP (06) hide off the screen, but be careful! Don't 32C7 75 get lost! 8K, $4.95 for cassette. 32C7 76 •DELAY TO ALLOW FOR STANDARD TV SCAN 32C7 77 Danny Ledesma 32C7 AOOO 78 TVDLA LDY #00 P.O. Box 5784 32C9 A200 79 LOOP1 LDX #00 Elmonte, California 91731 32CB E8 80 LOOP2 INX 32CC D0FD 81 BNE LOOP2 Atari — PET Owners 32CE C8 82 INY 32CF C040 83 CPY #$40 KINETIC DESIGNS has software for you! 32D1 D0F6 84 BNE LOOP1 Games and Simulations, Music, 32D3 60 85 RTS Astronomy, Ham Radio, home use, utili­ ty, and many others. MTU Visible Memory and music programs now available! Prices start at only $2.50! (Atari $3.50) Guaranteed! Send SASE for full details. Kinetic Designs 401 Monument Road 171 Jacksonville, Florida 32211

Want Something Different? 950 REM 1. Be Your Own Astrologer—AST-T2-001 952 REM * * 954 REM * LIGHT PEN DEMONSTRATION * ($15.95). For anyone with 8K PET. 956 REM * BY PETER A KOSKI * 2. Primary Arcs—AST-T1-002 ($24.95). 958 REM * * For experienced Astrologers with 16K 960 REM *************************** PET. Calif ornia residents add 6% sales 1004 REM CALL IN SCREEN CLEAR ROUTINE tax. Foreign add $3.00. 1005 REM Access 1006 DISK!"CALL 3280=31,3" P.O. Box 8726 1010 POKE 574,128: POKE 575.50 1020 X=USR(X) Rowland Heights, California 91748 1021 REM 1022 REM LOAD SELECTION.DATA ONTO SCREEN 1023 REM OHIO SCIENTIFIC 1030 PRINT " == ELEMENTARY MATH LIGHT PEN DEMO ==" 1040 PRINT : PRINT : PRINT S-FORTH - a full implementa­ 1050 PRINT " 0 1 2 3 4 5 6 7 tion of Fig-FORTH including oQ n ;. editor, virtual disk sub-sys­ 1060 PRINT " 9" 1070 PRINT : PRINT : PRINT : PRINT tem, and compatibility with 1080 PRINT " + - * /J OS65D-3 on 51A" or 8" disk. 1090 PRINT : PRINT : PRINT : PRINT . PRINT $29.95. 2000 REM Source listing $24.95. 2010 REM RUN THE PROGRAM USING SUBROUTINES Both for $49.95. 2020 REM 2021 REM CALL IN SINGLE CELL QUERY ROUTINE TOUCH TYPING - 15 lesson 2022 REM set teaches you to use all let­ 2025 DISK!"CALL 3280=31,2":RPT=0 ters and numerals without the 2030 GOSUB 3000:A1=NUM need to look at the keyboard. 2040 GOSUB 4000:O=OP:RPT=RPT+l 2050 GOSUB 3000:A2=NUM Requires 32 x 64 display. 8K. 2060 ON 0 GOTO 2100,2200,2300,2400 $19.95. 2100 ANS=A1+A2 FAILSAFE +2 - a sophisti­ 2110 GOTO 2500 cated game based on the elec­ 2200 ANS=A1-A2 2210 GOTO 2500 tronic warfare environment en­ 2300 ANS=A1*A2 countered by aircraft during 2310 GOTO 2500 nuclear war. 8K. $8.95. 2400 ANS=A1/A2 INTELLEGENT TERMINAL 2500 REM EMULATOR - down load, edit, 2510 REM PRINT OUTPUT 2520 REM then send files back to host 2530 POKE 9644,42: REM DISABLE SCROLL ON PRINT computer. Full or half duplex, 2600 PRINT " THE RESULT IS ";ANS many other features. Disk sys­ 2605 FOR PS=1 TO 200:PS= ABS (PS): NEXT PS tems. $24.95. 2620 PRINT " 2625 IF RPT=5 THEN 5000 Send for a FREE complete 2630 GOTO 2030 software and hardware cata­ 3000 REM 3010 REM NUMERIC INPUT (SINGLE DIGITS) log. 3020 REM 3025 NUM--0 : CNT=0 Aurora Software Associates 3030 FOR CELL=54402 TO 54458 STEP 6 P.O. Box 99553 Cleveland, Ohio 44199 (216)221-6981

62 MICRO - The 6502 Journal No. 35 - April 1981 Other thoughts to keep in mind, especially if taking input from a graph, is that the pen can move only to a block adjacent to the one where it is present­

3040 NUM=USR(CELL-32768) ly. Thus, once the original position is 3 0 5 0 IF NUM = 1 THEN NUM=CNT: RETURN known, the next move can only be one 3060 CNT=CNT+1 of, at most, eight positions. The ac­ 3100 NEXT CELL companying demonstration program 3 1 1 0 CNT=0 3120 GOTO 3030 should help to explain. The two 4 0 0 0 REM routines and a screen clear are on track 4010 REM OPERATOR INPUT 31 in this example, and are all called in­ 4 0 2 0 REM to $3280 for execution. The quadrant 4 0 2 5 CNT-1 routine is on sector 1, the individual 4030 FOR CELL=54 730 TO 54760 STEP 10 4040 OP=USR(CELL-32768) cell routine on sector 2, and the screen 4045 IF OP=l THEN OP=CNT: RETURN clear code on sector 3. The program is a 40-46 CNT=CNT+1 simple arithmetic demo. Single-digit 4050 NEXT CELL arguments and operators are input via 4100 GOTO 4025 5 0 0 0 REM the light pen and the result is printed to 5 0 1 0 REM ANOTHER 5 ROUNDS ? the screen without line feed. After five 50 20 REM repetitions, the program asks the user if 5021 REM CALL IN SCREEN CLEAR he would like another session. Again, the 5 0 2 2 REM yes/no response is accepted through 5030 DISK!"CALL 3280=31,3 5040 X=USR(X) the light pen. 5 0 4 5 REM 5046 REM CALL IN QUADRANT QUERY ROUTINE 5 0 4 7 REM Conclusion 5050 DISK!"CALL 3280=31,1 5060 POKE 9644,98: REM RE-ENABLE SCROLL Although the routines presented 5 0 6 5 REM were written for an OSI mini-floppy 5066 REM DISPLAY QUESTION/INPUT SELECTION 5 0 6 7 REM system, any 6502 system supporting 5070 PRINT " WOULD YOU LIKE ANOTHER GO AT IT ?" memory mapped video should be able 5080 PRINT : PRINT : PRINT : PRINT to employ them. The only changes to 5090 PRINT " YES NO" be made are the addresses of the display 5 1 0 0 PR IN T : PRIN T 5110 IF USR(49)=1 THEN 950 block and of the ACIA. 5120 IF USR(52)=1 THEN 6000 5130 GOTO 5110 One last thought for disk owners—a 6 0 0 0 REM menu or display block which is 6 0 1 0 REM E X IT TO B A S IC 6 0 2 0 REM repeatedly used at various points of the 6030 DISK!"CALL 3280=31,3 program may be held resident on a disk 6040 X=USR(X) track and then CALLed to $DOOO. As 6 0 5 0 END you'll discover, speed plays an impor­ tant part in light pen I/O, since the time spent for input is nil. The process­ ing and output must therefore be as streamlined as possible in developing an efficient system. jMcno

- — ■■■ m m in r OHIO SCIENTIFIC USERS

SOFTWARE - GAME AND UTILITY PROGRAMS FOR AS LOW AS $1.00. ALL WITH LISTINGS AND COMPLETE DOCUMENTATION.

KITS - UPDATE YOUR COMPUTER TO PLAY MUSIC, IN CREASE OPERATIN G IVE SPEED, HIGH RESOLUTION GRAPHICS AND MUCH MORE. KITS INCLUDE PARTS AND COMPLETE ASSEMBLY INSTRUCTIONS. LOW AS $3.00.

OUR $1.00 CATALOG INCLUDES OSI PROGRAMMING TIPS PLUS DESCRIPTIONS OF AVAILABLE PROGRAMS AND KITS. am MrrTENDORF ENGMEERMG 905 VLLA NUEVA DR. UTCHFELD PARK.AZ 85340

No. 35 - April 1981 MICRO - The 6502 Journal 63 t t o e 1 6 % c«*n® .—e t°r « « r O * e r *

e x c i u s ;

* £ & ■ u tev ^ ;argesteve^

o n e S - «ts< " (T'e e« e^pp'e,esl For^’c o ^ e'%W . • u s S S e r M)P fvpp'e ')Set!„„\e(est c o ^ , i e s day se

m e s o s w e ^ , \Aoroe> ,.w\\ca^ . yjselu\ Pu_, ^rodvic^s w p 'eI'est'^Jetv "00' ai r r tee p V f ta' sess&sas&ssas-** m a ^ a * a r e ve9' A ster s o « * * r®'B . M > P 'eS_ ^ e t a t 'd j n a r s c a r ' s e r o VOVJ $3pet ‘JaV' ne,V°° ' 2 a«jo» C V ef ^ ' n« ' pegu'f ose we Pe_ ot *ret ^ e t * * 7 1 9 8 1 3 d°or’°se ^ e a tf'-'00 JaV June '>so0dav X VoU^ \ o rn'sS . _ S u n d f X’ e.oo p »*s 6 - '* “ -oo *' wr<)aV’ »>■» achusetts

red' i reg’Astei ^pp'e * MICRO - The 6502 Journal No. 35 - April 1981 Integer BASIC Internals

Here’s a sorted list of Apple 16-bit number contained in the X (lo) "If you've ever accidentally pressed Integer BASIC memory locations and A [hi] registers to a decimal RESET while an Integer BASIC program and routines, with some number from 0-65535 and prints it out. was running, this is for you. In the examples of how to use them. monitor, enter: The routine at $EE68 prints out the " * * * RANGE ERR" message and the *E3E3G routine at $E36B prints out the Glenn R. Soqge "*** MEM FULL ERR” message. A and the statement number which was P.O. Box 203 couple of useful tricks are also men­ last executed is displayed. Press RESET Evanston, Illinois 60204 tioned in the Apple material . again and re-enter DOS with *3D0G. This method can also be used to find the statement number of an outstand­ ing Integer BASIC input statement. Apple Computer Co. has released to its 1. To find the absolute address of a When the input prompt occurs, press dealers a set of application and informa­ given line, place the line number (in RESET and *E3E3G to find the state­ tion notes that are quite informative. hex) into locations $CE-$CF (lo and ment number. Exiting the program Included in the package is a listing of hi). Then jump to address $E56D with control-C will not show the state­ memory locations and routines used by (*E56DG); the absolute address will be ment number if an input statement was Integer BASIC. The table with this arti­ returned in locations $E4-$E5 (lo and active." cle is a numerically sorted (by hex ad­ hi). dress) listing of this information. Also You should also notice that there included are the corresponding decimal 2. To execute a GOTO from the seems to be some discrepancy between equivalents of the addresses and a little monitor, put the absolute address of the list of page zero locations used information about the routines. In gen­ the line (found by the above procedure) given in the list and the chart on page eral, routines without descriptions are into $C6-$C7 and put a negative byte 75 of the new Apple II Reference the handlers for the functions named. into the mode location (eg., $80 into Manual (the white book). According to $D9—a negative value indicates run the chart, locations $E0-$FF are not Hardly any information is given mode, a positive one indicates im­ used by Integer BASIC but the detailed about how the routines are called or are mediate mode). Then jump to $E867 list shows this to be incorrect. Some of used but with a little digging I'm sure (*E867G) and you will be back in those locations are indeed used by you can figure out how to use at least a BASIC ru n n i n g at that line. BASIC! Also, some locations are used few of these in your own programs. At for a couple of things, depending on the least, you now know where to begin This item was picked up from a routine in command, so the values looking. For example, the routine at bulletin board here in Chicago and is might not always be what you would $E51B ("HEX/DEC") converts the from Mark Pump. expect.

bl l' RfcPOR FOR Mi.CS*6 «0CE 206 ACL GEN’L ACC LO HEXDECNAME DESCR 00CE 206 VALGETL PRIMARY EVAL TEMP L0 •04A 74 LOrtEML LOW MEMORY L0 00CE- 00CF 206-207 VAL 16-BIT 1EMP fOR MH1H 0048 75 L0MEMH LOW MEMORY HI 00CF 207 VALGETH PRIMARY EVAL TEMP Hi O 0 K 76 HIMEML HIGH MEMORY L0 «0CF 207 ACH G E N ’L ACC H) 0040 77 HIHEMH HIGH MEMORY HI 00D0 208 SRCHL PTR FOR SEARCH VAR TBL L0 004E 78 RNDL RANDOM H L0 00D1 209 SRCHH PTR FOR SEARCH VAR IBL HI 004F 79 RNDH RANDOM « HI 0001- 00F0 209-240 T0KNDXSTK TOKEN INDEX STACK 00b0-006F N0UNS1KL NOUN STACK L0 0002 210 SRCH2L VAR TAD SEARCH PTR2 L0 0058-0077 88-119 5YNSTKH SYNTAX STACK HI L0CS 00D3 211 SRCH2H VAR TAB SEARCH PTR2 HI 0078-0097 120-151 N0UNSTKH NOUN S1ACK. HI 00D4 212 1 F S H P IF ? THEN FAIL FLAG 0080-009F 128-159 SYNSTKL SYNTAX STACK: L0 L0CS 001)5 213 CRFLAG CARR RTN FLAG 00A0-008F 160-191 N0UNS1KC NOUN STACK: COUNTER 00D6 214 VERBN0W CURR VERB IN USE 00A8-00C7 168-199 TXTNDXSTK TEXT INDEX STACK: 00D7 215 PRIN0W PRINT IT NOW FLAG *0Cb 200 IXVNDX TEXT INDEX VALUE **D8 216 XSAVE TEMP FOR X-REC OUTPUT VAL TEMP 00C8 200 0UTVAL 00D9 217 RUNMODE RUN MODE FLAG TEMP FOR Y-REG *0C9 201 YTEMP 00DA 218 AUXL AUX CNTR LO 00C9 201 LEADBL LEADING BLANKS INDEX 0008 219 AUXH AUX CNTR HI PPL PGM PTR L0 *0CA 202 **0C 220 PRL CURR LN VAL LO 00CB 203 PPH PGM PTR HI 0000 221 PRH CURR LN VAL HI **cc 204 PVL CURR VAR PNTR L0 00DE 222 PNL CURR NOUN PTR LO PVH 00CD 205 CURR VAR PNTR HI 000* 223 PNH CURR NOUN PTR HI

(continued)

No. 35 - April 11581 MICRO - The 6502 Journal *0E0 224 PXL CURR VERB PTR LO E7E2 -6174 AUTO AUTO LINE i 00E1 225 PXH CURR VERB PTR HI E828 -6104 IF/THEN IF ? THEN ROUTINE WE.’ 226 P1L AUX PTR1 LO EB3C -6061 GOSUB •0E2 2 2 6 DELL DELETE LN PTR LO E85B -6056 GOTO 00E3 227 DELH DELETE LN PTR HI E h * 7 -604.1 GOLINE GOTO LINE ADDR IN *C6-C7 0*6:3 227 P1H AUX PTR1 HI E875 -6027 GETNEXT FETCH NEXT TEXT STATEMENT 00E4 228 FLAG GEN’L FLAG BYTE E8A5 -5979 RETURN 00E4 228 P2L AUX PTR2 LO E8C3 -5949 STOPPED AT PRINT ’STOPPED AT LINE ,V *•1:4 228 INAL LINE S ADDR LO EBU6 -5930 NEXT NEXT END LOOP 00E5 229 LNAH LINE « ADDR HI E93A -5830 FOR FOR INITIAL ENTRY «0E5 22? P2H AUX PTR2 HI f.950 -5808 TO/FOR LOOP CNTR $ 10 * ST:LP £ 00E6 230 NXTL NEXT PTR LO EAHMEA87 -5616 -5497 VERBADRL VERB DISPATCH CAB LO «0E6 230 P3L AUX PTR3 LO EA88-•EAHh -5496 -5377 VERBADRH VERB DISPATCH TbL Hi 00E7 231 NEXH NEXT PTR HI EB00-•EB99 -5376 -5223 MESSTXT ERROR MESS. TEXT «0E7 231 P3H AUX PTR3 HI EBAA -5201'. INPUT INPUT ROUTINE 00F1 241 TOKNDX TOKEN INDEX VAL EC00-■EDFF -5120 ■“460? SYNTABL SYNTAX TABLE LIST :*F2 242 CONL CONTINUE PIR LO EE03 PRN-STR PRINT M SIRING 00F3 243 CONH CONTINUE PTR HI EE22 -4574 LEN «>0h4 244 ALHOlNa AUTO INC VAL LO Et 34 -4556 GETYAI.<255 GET VALUE 00F5 245 AUTOINCH AUTO INC VAL HI EE3F -4545 PLOT EE4t -4530 COLOR *0F6 246 AUTOLNL CURR AUTO LINE 3 LO EE54 -4524 MAN 00F7 247 AUTOLNH CURR AUTO LINE ft HI 00F8 248 AlflOMODE AUTO FLAG EE57 -4521 VTAB 00F9 249 COUNT GEN’L CNTR BYTE EE68 -4504 RNGERR PRINTS ’*** RANGE ERR* 00F9 249 CHAR CURR CHAR EEA0 -4448 CALL CALL A ML SUBR 00FA 250 LEAOZR LEADING ZEROS INDEX EEB* -4432 HLIN 00FB 251 FORNDX FOR/NEXT LOOP INDEX EEC6 -4410 VLIN EE03 PRINT PRINT ERROR HSG/BELL 00FC 252 GOSUBNDX GOSUB INDEX -4397 WFD 253 SYNS'fKNDX SYNTAX STACK: INDEX VAL EEF6 -4362 PEEK GETVAL255 GET A VALUE FOR 1 BYTE 00FE 254 SYNPRfit SYNTAX PAGE PTR LO EF00 -4352 -4344 POKE 00FF 255 SYNPAGH SYNTAX PAGE PIR HI EF08 EF10 0200-02FF 512-767 INBUFF INPUT BUFFER -4336 DIVIDE EF1E E000 -8192 CNTLB COLD ENTRY -4322 D1MVARB DIMENSION A VARIABLE EF4t: -4274 RND E003 -BI89 CN1LC HARM ENTRY RANDOM « GENERATOR EFEC -4116 RUN E W 6 -8186 SETPRMPT SE1 UP > PROMPT RUN FROM BEGINNING EFFi! -4110 RUN «N E02A -8150 NXTBYTE GET NEXT BYTE 16BIT PNTR RUN FROM LINE * F000 -4096 SCRATCH E04B -8317 LIST LIST ALL SCRATCH EVERYTHING F04U -4019 E05D -8099 LISTXY LIST A RANGE HIMEM F0C9 -3895 LOMEM k D -8083 UNPACK TOKENED CODE 10 MNEMONICS F0DF -3873 LOAD El 30 -7888 DIMSTR DIMENSION A STRING LOAD A PGM FROM TAPE ri ie; -3810 5ETHDR SETUP HDR FOR SAVE/LOAD PARAM E171 -7823 INPUT5TR INPUT A STRING F12C -3796 SETBUF SETUP PGM SAVE/LOAD PARAM E222 -7646 HULTMULTIPLY F140 -3776 SAVE SAVE A PGM TO TAPE E-'7A -7558 HOD F161 -3743 PRNTERR E28A -7542 SCRN RETURN SCRN COLOR PRINT AN ERROR MESS FJ67 E2B3 -7501 MAINLINE MAIN COMPILE/EXEC CODE -3737 POP FI 71 -3727 TRACE E36B -7317 MEMFUL PRINTS ’»*# MEM FULL ERR1 F176 -3722 NOTRACE E36F -7313 DELETE DELETE LINES X-Y F17D -3715 E3C0 -7232 ERRORMESS« INPUT ERROR MSG TRACEIT EXEC TRACE FUNC E3CE -7218 GETCMD GET KEYBOARD CMD F279 -3463 STEP FOR/NEXT STEP FUNC E3E0 -7200 ERR0RME5S PRNT ERR MSG GOTO MAINLINE F2E0 -3360 NODSP E51B -6885 HEX/DEC PRINT VALO>LO ACC=HI> 0-655 F304 -3324 DSP E56D -6803 LINADR FIND LINE S»S ADDRESS F30A -3318 CON CONTINUE EXEC E5AD -6739 NEW F31D -3299 ASC E5B7 -6729 c l r F33B -3269 PDL F351 E6EC -6420 BRANCH GET LO/HI THEN JSR -3247 RDKEY READ AN INPUT E6FF -64*01 GETVERB NEXT VERB TO USE F371 -3215 EXP A RAISE TO A POWER F3C9 E715 -6379 GE1163IT GET A 16-BI'l VAL -3127 PRwS E736 -63! 46 Nor F41A -3046 INvS E74A -6326 ABS E75C -6308 SGN E782 -6270 SUBTRACTION E785 -6267 ADDITION fc/A'l -6236 TAB E7C1 -6207 COMMA JMCftO

T.M. LJK EDIT 6 5 0 2 Two Pass Assembler, Disassembler, and Editor Single Load Program

D O S 33 ., 4 0 /8 0 C olum ns, fo r A pple II o r A pple II Plus*

A MUST FOR THE MACHINE LANGUAGE PROGRAM MER. Edit 6502* is a two pass Assem­ LOOK AT THESE KEY BOARD FUNCTIONS: Copy to the end of line and bler, Disassembler and text editor for the Apple computer. It is a single load program exit: Go to the beginning of the line: abort operation: delete a that only'occupies 7K of memory. You can move freely between assembling and disas­ character at cursor location: go to end of line: find character after cursor location; non destructive backspace: insert a sembling. Editing is both character and line orientated, the two pass disassemblies character at cursor location: shift lock: shift release: forward create editable source files. The program is so written so as to encompass combined copy: delete line number: prefix special print characters. Com­ disassemblies of 6502 Code, ASCII text, hex data and Sweet 16 code. Edit 6502 makes the plete cursor control: home and clear, right, left down up. Scroll a user feel he has never left the environment of basic. It encompasses a large number of line at a time. Never type a line number again. pseudo opcodes, allows linked assemblies, software stacking (single and multiple All this and much much mare — Send for FREE Information. page) and complete control of printer (paganation and tab setting). User is free to move source, object and symbol table anywhere in memory. Requirements: 48K of Introductoiy Price $50.00. RAM, and ONE DISK DRIVE. Optional use of 80 column M&R board, or lower case availa­ ble with Paymar Lower Case Generator. fiIt11ifIi■t TAKE II LOOK AT JUST SOME OF THE EDITING COMMAND FEATURES. Insert at line » n Delete a character Insert a character Delete a line # n List line # nl, n2 to line # n3 Change line It nl to n2 "stringl'' Search line It nl to n2 "stringl". LJK Enterprises Inc. P.O. Box 10827 St. Louts. MO 63129 |314| 846-2313 COMPUTER BASED SOFTWARE MU ‘ Edit 6502 T.M. ol LJK EnL Inc.. — ‘ Apple T.M. of Apple Computer Inc.

66 MICRO - The 6502 Journal No. 35 - April 1981 The SoftCard™ Solution. SoftCard 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. All, 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 S tandard B A S IC -80 is the m ost Seeing is believing. See the SoftCard Apple, SoftCa^d turns your Apple into powerful microcomputer BASIC in operation at your Microsoft or Apple 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 personal ence. Two computers in one. And, the sive EDIT commands and string func­ computer. advantages of both. tions, high and low-res Apple graphics, C om plete in fo rm a tio n ? It's at your Plug and go. The SoftCard system PRINT USING, CHAIN and COM­ 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. Write us. Call Just plug it into any slot (except 0) of mands. And, it's a BASIC you can us. Or, circle the reader service card your Apple. No modifications required. compile with Microsoft's BASIC number below. SoftCard supports most of your Apple Compiler. SoftCard is a trademark of Microsoft. Apple II and peripherals, and, in 6 5 0 2 -mode, your More languages. With SoftCard and Apple II Plus are registered trademarks of Apple Computer. Z-80 is a registered trademark of Zilog, Apple is still your Apple. CP/M, you can add Microsoft's ANSI Inc. CP/M is a registered trademark of Digital Standard COBOL, and FORTRAN, or CP/M for your Apple. You get CP/M Research, Inc. on disk with the SoftCard package. It's a powerful and simple-to-use operating system. It supports more software than any other microcomputer operat­ ing system. And that's the key to the c o n s u m er versatility of the SoftCard/Apple. ! PRODUCTS I Microsoft Consumer Products, 400 108th Ave. N.E., CIRCLE READER SERVICE NUMBER Bellevue, WA 98004. (206) 454-1315 ©UersaLLIriter & APPLE II: The Keys to Unlimited Graphics

DRAWING TABLET GRAPHICS SOFTWARE Although VersaWriter operates on a Easily the most capable and com­ simple principle, it produces graphics plete graphics software for the home which match or exceed those of other computer available. Fast fill drawings digitizers. Rugged construction, trans­ in 100 colors. All text in five sizes, lucent base, easy to use — plugs compile and display shapes, edit, directly into APPLE II. move and much more!

UNIQUE OFFER See VersaWriter at your local dealer and pick up a copy of our demonstration disk. The complete VersaWriter hardware and software package Is a real bargain at $249. For more information call or write: Versa Computing, Inc. • 887 Conestoga Circle • Newbury Park, CA 91320 • (805) 498-1956

NIKROM TECHNICAL PRODUCTS PRESENTS A DIAGNOSTIC PACKAGE FOR THE APPLE II Presenting.. AND APPLE II + COMPUTER. ,TM A-STAT “ THE BRAIN SURGEON" All major computer systems are checked for functional hardware analysis on a regular basis for logical as well as some practical reasons. Finding what is exactly 79 wrong can account for most of the money consuming down-time. Apple Computer Co. has provided you with the best equipment available to date. A Statistical Analysis and File Maintenance System The Diagnostic’s Package was designed to check every major area of your computer, for the Apple II™ Microcomputer* detect errors, and report any malfunctions.The Brain Surgeon will put your system through exhaustive, thorough procedures, testing andreporting all findings. A subset language of P-STAT™ 78 The Tests Include computes: • MOTHERBOARD ROM TEST FOR BOTH APPLE II AND APPLE II + • APPLESOFT CARD TEST • INTEGER CARD TEST • MEMORY RAM TEST FREQUENCIES . DISK DRIVE ANALYSIS • MONITOR ALIGNMENT BI-VARIATE TABLES - CHI SQUARES • DC HAYES MICRODODEM » TEST CORRELATION MATRICES System Diagnosis is an invaluable aid to your program library even if your system MULTIPLE REGRESSIONS is working fine. Hours have been wasted trying to track down a "program bug” when actually hardware could be the blame! APPLE FILE CABINET INTERFACE COMPLETE VARIABLE TRANSFORMATIONS The Brain Surgeon allows you to be confident of your system. This can be critical when file handling, sorts or backups are involved. Youm ust depend on your computer during all these critical times. RunningThe Brain Surgeon prior to these Uses Standard DOS Text Files and EXEC’s important functions helps to insure that your system is operating at peak performance. A-STAT™ 79 on disk with 80-page manual... $125.00 The Brain Surgeon is easy to use and supplied on diskette with complete documentation. PRICE $45.00 48K version — All programs in Applesoft™ REQUIRES: 48K APPLESOFT In ROM, 1 Disk Drive ^ DOS 3.2 or 3.3 i Available from: ©Nlkrom Technical Products Rosen Grandon Associates 25 PROSPECT STREET • LEOMINSTER. MA 01453 296 Peter Green Road Order Toll-Free A n y tim e Tolland, Connecticut 06084 Master Charge & VISA users call: 1-000-835-2246 Kansas Residents call: 1-800-362-2421 (203) 875-3541

* Apple II™ Is a trademark of the Apple Computer, Inc.

P-STAT™ 78 is a trademark of P-STAT Inc., Princeton, N.J.

A-STAT™ 79 Is copyrighted by Gary M. Grandon, Ph.D.

68 MICRO - The 6502 Journal No. 35 - April 1981 Atari Error Messages

This program, when included in a BASIC program, will display 2 PRINT REM CLEARS SCREEN 5 DIM SNAPS(50):TRAP32500 the English language versions of 6 REM Atari’s number-coded error 7 REM messages. 10 REM « < ERROR TRAPPING DEMO » > 20 REM <« BY DAVID P. ALLEN »> 30 REM 40 REM David P. Allen 50 REM 19 Damon Road 60 REM Scituate, Massachusetts 02066 70 REM 80 REM THIS PROGRAM DEMONSTRATES 90 REM THE PRINTOUT OF ERROR Within a few days after putting my 100 REM STATEMENTS. THE FOLLOWING Atari computer in operation I wound up 110 REM LINES ARE DESIGNED TO PRO­ with a sore thumb. This was a result of 120 REM DUCE ERRORS. AFTER EACH having to continually thumb through 130 REM ERROR, TYPE 'GOTO' PLUS THE the Atari manual to find out the mean­ 140 REM THE LINE NUMBER WHERE THE ing of the latest error message which 150 REM ERROR OCCURRED +10. I.E., the Atari was giving me. My threshold 160 REM IF THE ERROR MESSAGE SAYS of discontent was being depressed 170 REM THE ERROR OCCURRED AT LINE lower and lower by the invidious 180 REM 220, THEY TYPE 'GOTO 230' ' CONTINUE THE DEMONSTRATION message "ERROR- 12 AT LINE 200", 190 REM 195 REM which continually thrust me back to 197 RfM the manual to find out just what I had 200 GOTO 1000 done wrong. I figured there had to be a 210 NEXT X better way. There is. 220 READ Y 230 SAVE "D2:TEST" Atari BASIC language is equipped 240 PRINT #1,A$ with the very handy 'TRAP' function 250 PRINT "}": POSITION 5,12 which you can cause to spring into 260 PRINT "*** END OF DEMONSTRATION ***" action every time it encounters an error 270 END condition. This command tells the 326 LIST 32660 computer to go to the line number 32490 REM « < ERROR TRAPPING » > immediately following the command 32491 REM « < SUBROUTINE » > (such as TRAP 32000) and continue 32493 REM executing the program at that point. 32494 REM The solution to my problem was simp­ 32495 REM INSERT 'DIM SNAP$(50): ly to direct the computer to a list of er­ 32496 REM TRAP 32500’ AT AN ror messages with instructions to find 32497 REM EARLY LINE NUMBER. the right message, and then print it out 32498 REM 32499 REM on the screen in plain English. 32500 SNAP = PEEK (195) = 256 * PEE K (187) + PEEK (186): GOSUB SNAP + 32500: Here's the way it works. The error PRINT **** ":SNAP$: PRINT "AT LINE trapping subroutine is started at line ***■ 32500, high enough to be included in 32501 TRAP32500: PRINT " ": END most programs without getting in the 32502 SNAPS = "INSUFFICIENT MEMORY": RETU way of the rest of the program. Way up RN in the beginning, at the earliest line 32503 SNAPS = "VALUE ERROR": RETURN 32504 SNAPS = "TOO MANY VARIABLES": RETUR possible (line 0 is a good place) we enter N 'DIM SNAPS150): TRAP 32500’. This 32505 SNAPS = "STRING LENGTH ERROR": RETU sets up SNAPS to collect the error RN messages (‘snap’, ‘trap’, — get it? Oh, well...) and instructs the program to

No. 35 - April 1981 MICRO - The 6502 Journal 69 proceed at line 32500 whenever it encounters an error condition. Line 32506 SNAPS = "OUT OF DATA": RETURN 32500 takes a PEEK at two locations 32507 SNAPS = "ERROR > 32767": RETURN which find out first what error occurred ' 32508 SNAP$ = "INPUT STATEMENT ERROR": RE TURN |SNAP], and where it occurred (LNM). 32509 SNAP$ = "DIM ERROR": RETURN The computer then finds the correct 32510 SNAPS = "ARGUMENT STACK OVERFLOW": error message and prints it out on the RETURN screen. 32511 SNAPS = "FP OVER/UNDERFLOW ERROR": RETURN Line 32501 resets the trap and ends 32512 SNAPS = "LINE NOT FOUND": RETURN the program, but you can have your 32513 SNAPS = "NEXT WITHOUT FOR": RETURN program continue. If you replace 'END' 32514 SNAPS = "LINE TOO LONG": RETURN with 'INPUT A$ : GOTO LNM + 10’ 32515 SNAPS = "GOSUB/POR LINE DELETED": R your program will pause at the error ETURN message while you reflect on the 32516 SNAPS = "RETURN WITHOUT GOSUB": RET wisdom of what it is telling you, then URN when you press 'RETURN' the program 32517 SNAPS = "GARBAGE": RETURN will jump to the line number that is ten 32518 SNAPS = "INVALID STRING CHARACTER": places further down from where the RETURN error occurred. To make this work, all 32519 SNAPS = "CAN'T LOAD - TOO LONG”: RE your line numbers must be ten TURN 32520 SNAPS = "DEVICE # >7 OR =0": RETURN numbers apart, and you must ‘DIM A$( 1]' back in the beginning of the pro­ 32521 SNAPS = "NON-LOAD FILE": RETURN gram. If you leave 'END' in place in 32628 SNAPS = "BREAK KEY ABORT": RETURN line 32501, then you must use 'RUN' 32629 SNAPS = "I0CB ALREADY OPEN": RETURN or some other immediate command to get things going again. 32630 SNAPS = "NON-EXISTENT DEVICE": RETU RN To save this program for inclusion 32631 SNAPS = "IOCB WRITE ONLY": RETURN in your future programs, enter lines 32632 SNAPS = "INVALID COMMAND": RETURN 32633 SNAPS = "DEVICE/FILE NOT OPENED": R 32500 through 32761 into memory ETURN through your keyboard. If you are going 32634 SNAPS = "ILLEGAL IOCB #": RETURN to save the routine on cassette, then set 32635 SNAPS = "IOCB READ ONLY": RETURN the program recorder up to record and 32636 SNAPS = "END OF FILE": RETURN execute 'LIST "C:” ’ and the whole 32637 SNAPS = "RECORD > 256 CHARACTERS": nine yards will be saved on your tape in RETURN tokenized form. To retrieve it for use in 32638 SNAPS = "DEVICE DOESN'T RESOND”: RE another program execute 'ENTER TURN "C :” ' after cuing up your tape to the 32639 SNAPS = "GARBAGE AT SERIAL PORT": R right spot for this routine. The error ETURN 32640 SNAPS = "SERIAL BUS INPUT FRAMING E trapping subroutine will then be added RROR": RETURN to whatever program you have in 32641 SNAPS = "CURSOR OUT OF RANGE": RETU BASIC memory at that time. RN 32642 SNAPS = "SERIAL BUS DATA FRAME OVER Disk users follow almost the same RUN": RETURN routine except use 'D:' and a filename 32643 SNAPS = "SERIAL BUS DATA CHECKSUM E where 'C:' is mentioned above. The RROR": RETURN filename will be the one you use to 32644 SNAPS = "WRITE PROTECTED": RETURN identify this subroutine on your disk. I 32645 SNAPS = "DISK/SCREEN MODE HANDLER E RROR": RETURN use 'ERRSUB.LST' which reminds me 32646 SNAPS = "FUNCTION NOT IMPLEMENTED": that this file was put on the disk with a RETURN 'LIST' instead of a 'SAVE'. 32647 SNAPS = "GRAPHICS MODE NEEDS MORE M EMORY": RETURN That's all there is to it. If you enter 32660 SNAPS = "DRIVE NUMBER ERROR”: RETUR XI the listing contained herein, the line M numbers below 32490 will cause a 32661 SNAPS = "DISK FULL": RETURN demonstration of the subroutine pro­ 32662 SNAPS = "DISK FULL": RETURN cedure to be executed. The price you 32663 SNAPS = "UNRECOVERABLE SYSTEM DATA - I/O ERROR": RETURN pay for all of this is the use of 1982 32664 SNAPS = "FILE NUMBER MISMATCH": RET bytes of memory. Atari 800 users with URN 48K of RAM memory will not give this 32665 SNAPS = "FILENAME ERROR": RETURN a second thought; Atari 400 users with 32666 SNAPS = "POINT DATA LENGTH ERROR": only 8K will pause and reflect before RETURN dedicating almost 2K to the reduction 32667 SNAPS = "FILE LOCKED": RETURN of their irritation. If it fits your program 32668 SNAPS = "INVALID COMMAND": RETURN and your memory then try it out. 32669 SNAPS = "DIRECTORY FULL": RETURN You'll like it. 32670 SNAPS = "FILE NOT FOUND": RETURN 32671 SNAPS = "POINT INVALID": RETURN JMCRO

70 MICRO - The 6502 Journal No. 35-April 1981 FOR a p p l e I r c o m p u t e r s NEW FROM TYMAC 201-8W-5478 DEALER INQUIRES INVITED CONTROLS CORP.

DOUBLE DOS PLUS - DPI3-16 A piggyback board that plugs into the disk controller card so that you can switch select between 13 and 16 s e c to r d is k s . Works g re a t w ith the language system eliminating the need in many cases, to boot the Basics disk. Eliminates the need to convert all of your disks to 3.3 fo rm a t ...... ONLY $39.00 ,------REWIRES APPLE'DOS ROUS -= = [|||||||P ^ | I ^ U |-L 90 DAY WARRANTY |— |

THE APPLE CARD - A TWO SIDED 100 PERCENT PLASTIC 85 X 11 REFERENCE CARD FOR THE APPLE COMPUTER.LOADED WITH INFORMATION OF INTEREST TO EVERY APPLE OWNER OR USER...... $ 3.9 8 PARALLEL PRINTER CARO - PPC-100 A u niv e rs a l C entronics® type Memory Boards for ATARI™ 800 & 400 Computers parallel printer board complete with cable and connector for the Apple computer. This unique board w ill aHow you to turn on and o f f the high b it in softw are so th a t te x t and g raphics can Assembled and Tested Ready to plug in be mixed on many p r in t e r s ...... S139.00

Completely Compatible One Year Warranty THE DOUBLE BQOTER ROM PLUGS INTO THE EMPTY Dti SOCKET ON No Modifications necessary THE APPLE MOTHERBOARD OR INTEGER CARO. A SIMPLE CALL WILL PROVIDE A 13 SECTOR BOOT FROM ANY MACHINE WITH 3.3 ROMS IN THE DISK CONTROLLER. THIS CHIP WILL NOT WORK IN APPLE PLUS MACHINES UNLESS THEY CONTAIN AN INTEGER CARD. THE 16K ...... $ 99.95 DOUBLE B00TER ROM MAY ALSO BE USED ON THE MOUNTAIN COMPUTER ROM PLUS BOARD IN ANY OF THE SPARE ROM SOCKETS. ELIMINATES 16K with gold plated connector tabs...... 109.95 THE NEED FOR USING THE BASICS DISK FOR 3.2 BOOTING. ONLY ...... $29.00 32K with gold plated connector tabs...... 199.95 SOFTWARE FOR,THE- APPLE,- SUPER SEA MAR - HIRES BATTLESHIP TYPE SIMULATION...... $13.95 V ULTIMATE TRANSFER - A TELEPHONE SOFTWARE TRANSFER, USES DC HAYES MICROMODEM...... $25.00 V ROAD RAIIYF - Visa and Mastercard accepted Quality discounts available HIRES DRIVING GAME WITH 5 DIFFRENT FULL SCREEN TRACKS....$ 1 5 .0 0 GRAPH FIT - HIRES BAR,PIE A LINE GRAPHING SOFTWARE ...... S25.00 Dealer inquiries invited MISSILE CHALLENGER - HIRES ARCAOE TYPE GAME WHERE YOU DEFEND YOUR CITIES AGAINST FALLING MISSILES. WRITES NAME & HI-SCORE TO DISK...... S19.95 Anderson Peripherals, Inc. SUPER-PIX HIRES SCREEN DUMP FOR THE EPSON MX-80 - OFFERS 2 ORIENTATIONS, NORMAL OR INVERSE, LARGER THAN FULL PAGE SIZES, SCRUNCH MODES. NEEDS TYMAC PPC-100 PARALLEL PRINTER CARD OR P.O. Box 629 WE WILL UPGRADE YOUR EPSON BOARD FOR S25.00...139..95

Richardson, Texas 75080 ALL OF THf ABOVE PRODUCTS ARE AVAILABLE FROM MICRO-WARE DISTRIBUTING INC. PO BOXI 214-231-6866 NBTfi APPiE It « remitter* trtfe u n at APPLE CQttUlH iiC., CUPttHU, 439 A ROUTE 23. POMPTON PL.NJ 07444 CALL 201/839-3478 MON THRU FRI C ilifofflii. Rm Plus is 4 rcqiitcrcd of Houat » Coaputcr, JOt* ™ATARI is trademark of Atari Corp. Hifv*, K. truz, C«.,

••SPECIAL INTRODUCTORY OFFER** Hardware: C1P Video Mod: Makes your 600 Video every ri.ij Programmable Character Generator Board $89.95 bit as good as the 4P and 8P. Gives 32/64 CHR/Line with You can use OSI’s characters or you can make your guardbands 1 and 2 Mhz. CPU clock with 300, 600 and own. Imagine you can now do true high resolution 1200 baud for Serial Port. Complete Plans $19.95 graphics 512 x 256 dots in the 64 x 32 screen format. KIT(Hardware and Software) $39.95 I And all under your control! Installed: 32CHR — $79.95, 64CHR-$89.95 % Other mods available — send for catalog. Extra K of Video RAM for 64CHR not included! Set of 3 ROMs available $75.00 SOFTWARE (with Documentation) C1P Sound Effects Board: Completely programmable! PC Chess V1.9 $14.95 For the discriminating hobbiest, the best board on the Play Chess against your computer! market for creating sound and music. Can be interrupt Helicopter Pilot: (64CHR Video Only) $ 8.95 driven so that you can use it for gaming purposes. Has An Excellent Graphics Program! on board audio amp, 16 bit interval timer, 128 Bytes of r Golf Challenger $14.95 RAM and tw o 8 bit parallel I/O Ports. From 1 to 4 players. Play a round of golf on your 18 hole Assembled and tested $89.95 Bare Board $39.95 golf course. One of the best programs I have ever seen! Both include Prog. Manual and Sample Software. You can even design your own course. Comes with full documentation (14 pages). C1P HI Speed Cassette Kit: Gives a reliable 300, 600, and 1200 Baud. No symmetry adjustments — the ideal Two Very Intricate Simulations! fix for OSI’s cassette interface. Easily implemented in Wild Weasel II: You operate a Sam M issile base during a 30 minutes. Will save you time and money even the first Nuclear War. Not as easy as you think! You must night you use it! $12.95 operate in a three dimensional environment. Many, many more. Send for Catalog with free program Failsafe II: The shoe is on the other foot! Here you are in (Hard Copy) and BASIC Memory Map. $1.00. Two the attacking bomber and you must penetrate deep into locations to serve you: enemy territory. Can you survive? An extremely complex Progressive Computing electronic warfare simulation! SPECIAL: both for 19.95 3336 Avondale Court, Windsor, Ontario Canada, N9E 1X6 (519) 969-2500 or 3281 Countryside Circle, Pontiac TWP, Ml 48057 & VISA MASTER CHARGE (313) 373-0468

No. 35 - April 1981 MICRO - The 6502 Journal 71 Advertisement y i ■ i ©KID© ©©DiKlTOtFD©'

Introduction to OS-65D V3.3 Keyboard Driver

The standard OSI polled keyboard driver has OS-65 V3.2 was an ultra sophisticated been replaced in OS-65D V3.3 by an all new keyboard decoder. The SHIFT LOCK key now acts development-oriented operating system. However, as a CAP LOCK key and the RUBOUT key actually several problems kept arising: does delete characters. However, three characters still cause problems. These are listed below along 1. Output was difficult to format in BASIC. with their keystroke equivalents: 2. There was no way to trap disk errors in BASIC. 3. Disk file operations were both slow and limited. A - SHIFT N 4. The nature of the OSI polled keyboard made the [ - SHIFT K use of lower case alphabetics tedious. ] - SHIFT M OS-65D V3.3 has been designed to eliminate Note: The SHIFT LOCK key must be depressed these problems in earlier releases of 65D. In addi­ when these three characters are typed. tion, the 65D BASIC line editor has been added as a permanent feature of BASIC. The following describes all the changes that have been made in V3.3. Enjoy! Random Files

OS-65D V3.3 incorporates several improve Compatability ments in the random file capabilities in OS-65D. First, the DISK GET command has been altered OS-65D V3.3 has the BASIC workspace moved to check which track is currently resident in to $3A7E as opposed to $327E on OS-65D V3.2. RAM before actually reading a track. If the GET This change makes no difference whatsoever to command determines that this is the tract that is the average BASIC programmer. In fact, needed, no reread is performed. Thus, the random enhancements to 65D V3.3 allow existing V3.2 file access time is up to 48 times faster than in files to be both upward and downward compatible 65D V3.2. to the new system. However, care must be taken when using V3.2 files that contain assembler Secondly, a DISK FIND command has been language subroutines. The subroutines will be added. The syntax is “DISK FIND,string” where transferred, along with the program that contains string is any BASIC string variable or quoted them, but will be physically relocated in memory literal. The search begins at the current file and will probably not execute properly, if at all. pointer and will continue through the file. If the string is not found, an ERR#D will be reported (unless the TRAP command is used). If the string is found, the file pointer will be set to the begin­ Programmable Error Action ning of the next field entry. For example:

In OS-65D V3.3 BASIC, the WAIT command has 10 DISK OPEN,6,“ DATA” been replaced by the TRAP function which is used 20 DISK GET,10 as an “ ON ERROR GOTO” (but is easier to type). 30 PRINT#6,'‘HELLO” :PRINT#6,‘‘THERE!” The TRAP function can be used either in the 40 DISK GET.O immediate mode or inside BASIC program and is 50 DISK FIND, “ HELLO” effective whether a BASIC ERROR or DOS ERROR 60 INPUT#6,A$ occurred. For example, consider the following 70 PRINT A$ program segment: This program will print out “ HELLO!”. 10 TRAP 1000 20 DISK OPEN,6,"DATA” Note: The search rate for the FIND command is 30 TRAP 40 about 8K/second on 8” systems and 5K/seeond on 40 INPUT#6,A:B = A/A mini-floppies. 50 PRINT A:END 1000 ?“ DISK ERROR” :END Printer Drivers

If a DISK ERROR occurred in line 20, control would The printer drivers in OS-65D V3.3 (devices 1 be transferred to line 1000. Lines 30 and 40 are and 4) have a programmable paging feature which used to read the first non-zero number in the file. is enabled by the following: The TRAP function is disabled by the statement “ TRAP0” . PRI NT#LP,CH R$(27); “ C” ;CH R$(FL)

CALL 1-800-321-6850 TOLL FREE

72 MICRO - The 6602 Journal No. 35-April 1981 Advertisement SMALL SYSTEMS JOURNAL

where LP is the printer device number and FL is Table 2 the form length you want. Ten percent of the form length is always reserved for the top and bottom -> /CTRL-L/Forward Space Non-destructive margins. For example, forward space. Moves the cursor PRINT#1,CHR$(27);"C” ;CHR$(66) one space to the right.

indicates form length of 66 where 60 lines are <- /CTRL-H/CTRL-P/Backspace Non-destructive printed per page and six lines are reserved for the backspace. Moves top and bottom margins. Immediately after the the cursor one form length is set, a top of form is executed. At space to the left. this time, position the paper in the printer as desired. To print a top of form to the next page, RU BOUT/DELETE/SHIFT-0 Single character enter delete. The editor makes the correct PRINT#LP,CHR$(12); delete keys opera­ tional as well as The printer drivers also have a screen dump the old ones (i.e., utility which may be used if you have an EPSON the RUBOUT key MX-80 printer and a standard OSI 540 video as well as SHIFT-0 system. To use this feature, enter will work on the OSI polled PR I NT#LP,CH R$(27);“ P’ ’; keyboard when the editor is enabled).

@/SHIFT-P Entry delete. This OS-65D V3.3 Editor will erase the line currently being In OS-65D BASIC, the keyword NULL is re­ edited, leaving the placed by the word EDIT. After the system is line in the text as booted, immediately type a non-destructive for­ it was before it ward and backspace to tell the editor what type of was edited. keyboard you are using, (CTRL-L and CTRL-P are the forward space and backspace, respectively, CTRL-R Non-destructively for the OSI keyboards.) The syntax for editing a moves the cursor line is given in table 1. to the rear of the statement.

CTRL-F Non-destructively Table 1 moves the cursor 0 = < L N < 64000 to the front of the statement. EDIT LN < CR > or !L N < C R > Edit the statement with the line CTRL-I Non-destructively number LN. moves the cursor eight spaces for­ EDIT! < C R > or !! Edit the same line ward (to the right). that was just edited. CTRL-T Retypes the state­ ment you are cur­ EDIT< CR > or ! Edit the line im­ rently editing. mediately follow­ ing the line that /< RETURN>/< ENTER>Enters the line as was just edited. written or viewed. The line will look (to the BASIC in­ The line with its line number will be displayed terpreter) as if it following the . If the line number LN does were typed in by not exist, the statement with the next line number the user from will be displayed. (Typing EDIT0 or !0 will always scratch. give the first line of the program.) After the state­ ment Is displayed, the cursor will reside at the end of that line. The commands listed in table 2 are used for the actual line editing.

OHIO SCIENTIFIC 1333 S. Chillicothe Road • Aurora, Ohio 44402 • (216) 831-5600

No. 35 - April 1981 MICRO - The 6502 Journal Advertisement

- ( o f f l ® )©Di[M¥D^D©!

Character insertion and deletions can be CHR$(18) Moves cursor to the accomplished anywhere by using the commands home position, i.e., (0,0) for non-destructive movement of the cursor. After — the upper left-hand the cursor is positioned, the user can type in inser­ corner. tions or delete unwanted characters. Note: Characters are inserted to the left of the character CHR$(19) Deletes the line the cur­ on which the cursor resided. The character on sor is on. Lines below the which the cursor resides is deleted until the end of cursor scroll up one line. the line is reached, and the characters to the left will be deleted if the cursor resides at the end of a CHR$(24) Clears from the current line. cursor position to the end of the screen.

Video Driver CHR$(25) Causes output to be printed in no color The video driver for 65D has been rewritten in (black). order to provide (X,Y) cursor addressing and more than a dozen screen editing commands. These CHR$(26) Inserts a line at the cur­ commands are used by printing CHR$(27), an sor position. Lines below ASCII ESC, followed by the desired command. For the cursor scroll down example, one line.

PRINT CHR$(27);CHR$(28); CHR$(28) Clears screen and homes cursor. clears the video screen and homes the cursor. The rest of the commands are given in table 3. CH R$(29);CH R$(n) Clears all occurrences of color n on the screen.

CHR$(31);CHR$(n) Causes the following Table 3 data to be printed in the color n. Code Effect Sends the character at Causes following data to CHR$(33) C HI R$(1) the cursor position be printed in the color through the keyboard yellow. driver, e.g., CHR$(2);CHR$(n); All screen positions Print CHR$(27); CHR$(m) marked by color n are CHR$(33) changed to color m. INPUT A$

CHR$(5) Sends the current cursor address through the keyboard driver, i.e., Indirect File Problems? Why Not Use a Diskette? PRINT CHR$(27); CHR$(5);:INPUT A$ In this section we describe a method for merging two BASIC files under the OS-65D then, operating system. The procedure uses the disk I/O A$ = CHR$(65 + X) capabilities of 65D to make your diskette into an CHR$(65 + Y) indirect file. The following step-by-step procedure can be used to merge two programs. We start with CHR$(11) Cursor moves down one both programs, say PROG1 and PROG2, stored on line. a diskette.

CHR$(12) Cursor moves up one PROG1 N1 = 1 TRACK line. 40 REM THIS IS PROG1 50 REM CHR$(15) Clears from the current 60 REM cursor position to the end 70 END of line. PROG2 N2 = 1 TRACK C H R$(17);CH R$(X): Moves cursor to screen 10 REM THIS IS PROG1 CHR$(Y) position (X,Y). 20 REM 0 —X < 64 30 REM 0 < :Y < 24 40 END

CALL 1-800-321-6850 TOLL FREE

74 MICRO - The 6502 Journal No. 35 - April 1981 Advertisement SMALL SYSTEMS JOURNAL

1. Load PROG 1 into the workspace DISK! “ IO 02,02":DISK CLOSE,6

DISK!“ LOAD PROG1” 8. Load PROG2 into the workspace by entering

Enter DISK!“ LOAD PROG2” EXIT 9. Reopen the file DATA and merge PROG1 into The number of tracks necessary to hold PROG1 PROG2 by entering will be displayed, say N1 tracks. Return to BASIC by entering DISK OPEN,6,“ DATA” :DISK!"IO 20”

RE BA 10. Reset the I/O pointers, close the file, and enable scrolling by entering

DISK! IO 02,02” :DISK CLOSE,6 Now do the same with PROG2, obtaining its size, POKE 9770,64 N2 tracks. 11. Store the merged file by entering 2. Run the disk utility CREATE and create a file PROG3, N1 + N2 (N3) tracks long, to hold the DISK! “ PUT PROG3” merged programs. If PROG2 already has enough space, the merged program can be stored as 12. Clean house by rebooting the system. PROG2. If each of the programs has a line with the 3. The number, N1, of tracks necessary to store same number, the line in PROG1 will be the one PROG1 was determined in step 1. Run CREATE that appears in the merged program. again and make a file called “ DATA” with three times N1 tracks for a five inch diskette, and four times N1 tracks for an eight inch diskette. Answer NO to the query about pages per track. Specify four pages per track.

4. Load PROG1 into the workspace MERGED PROGRAM PROG3 N3 = 1 TRACK N1 + N2 DISK!“ LOAD PROG1 ” 10 REM THIS IS PROG2 20 REM 5. Enter the following POKEs to create a four- 30 REM page buffer and to disable the scrolling of the 40 REM THIS IS PROG1 screen (the screen will hold the buffer). 50 REM 60 REM 70 END POKE 8998,0 POKE 8999,208 POKE 9000,0 POKE 9001,212 Note: Line 40 of PROG2 was overwritten. POKE 9770,0 Finally, by changing the LIST specification in step 6, you can merge any part of a program, or just 6. Enter on a single line break up large programs. The uses are unlimited.

DISK OPEN,6,“ DATA” :DISK!” IO ,22” :LIST

A listing of the workspace will appear on the screen while PROG1 is being stored in the file DATA.

7. When the listing is finished, reset the I/O pointers and close the file by entering

OHIO SCIENTIFIC 1333 S. Chillicothe Road • Aurora, Ohio 44402 • (216) 831-5600

No. 35 - April 1981 MICRO - The 6502 Journal * SOFTWARE FOR OSI VIDEO GAMES 1 ...... $15. Three Games. Head-On is like the popular arcade game. Tank i* Battle is a tank game for two to four. Trap! is an enhanced ^ blockade style game. 1 jy VIDEO GAMES 2 ...... $15. r^DISK Three games. Gremlin Hunt is an arcade-style game for one to j y three. Gunfight is a duel of mobile artillery. Indy is a race game for one or two.

M ADVENTURE: MAROONED IN SPACE ...... $12. A fantastic new game disk for OSI-C4P's j - An adventure that runs in 8K! Save your ship and yourself from running with DOS 3.2. Most of the i* destruction. DUNGEON CHASE...... $10. games on this disk are single player such k, A real-time video game where you explore a twenty level as a multiple level Othello game, dungeon. Cavern Chase, and more. Other games M BOARD GAMES 1 ...... $15. Two games. Mini-gomoku is a machine language version of are designed for single or multiple i* five stones gomoku. Cubic is a 3-D tic-tac-toe game. Both with players such as Tank, and Crystalize. graphics. Over seven games and variations in all. DISASSEMBLER ...... $12. (Note that many of these games are in Use this to look at the ROMs in your machine to see what makes BASIC tick. Reconstruct the assembler source code of machine code for enhanced play-ability machine language programs to understand how they work. Our disassembler outputs unique suffixes which identify the and speed.) l addressing mode being used, no other program has this! SUPER! BIORHYTHMS...... $15. >£ A sophisticated biorhythm program with many unique features. To order send $26 to: C1 SHORTHAND...... $12. Use only two keys to enter any one of the BASIC commands or keywords. Saves much typing when entering Simulations Rt. 2 Box 98 programs. Written in machine language. Burton, WA For all BASlC-in-ROM systems. Selected programs available Programming 98013 on disk Color and sound on video games Send for FREE catalog ADinMSOFTWARE ASSOC > V ^ I I I 1^1147 Main St. Ossining, NY 10562

OSI BASIC

Summary Manual for 65U & 65D Disk — 65U VI.2 U tility Enhancements Your CCIisht... ..Is COj Command' It's all in. a 24-p in . T?ona a t CHS !1 Tired of searching for commands & statements, peeks, error msgs, system limits? Need hints? Then send $9 for our 12/80 manual.

Want prompts for utility pgm inputs? File search­ ing demo? pgm exits? round numbers to 3 "PeV Oumers decimals? more disk space with utility pgms? Qranted 3 CUi.ihcs 1. Ta&r Cassette lo ad latest updating? Then send license copy and $20 Z- A ulo-rppeat on. a ll KSi^S for 8” Floppy. Specify video or serial. 3.memory Trest and IS Commands. Both for license copy and $25. (Indiana residents add 4% sales tax.)

C & J Supply

ROM and MANUAL — $49.95 Box 806, Marion, IN 46952 Specify 3.0 or 4.0 Basic (Works with or without toolkit)

Ea s t e r n H o u s e So f t w a r e (919) 924-2889 3239 Linda Drive (919) 748-8446 Winston-Salem, N. C. 27106

76 MICRO - The 6502 Journal No. 35 - April 1981 groups are for. There are a few good “Small Systems Journal.” Most of the books available which offer much informative material here is also useful information, both for the begin­ available, and better presented in ner and the experienced programmer. Carlson's or Williams and Domer's /AlCftO books. Perhaps the best to start with is Ed Challenges Carlson's OSI BASIC in ROM. This Unfortunately, that about covers book, now in its second edition, is the available books written specifically written by a C2P/C4P user, but almost for the OSI user. In addition to these By Paul Geffen everything in the book applies to the books, two other sources of informa­ Superboard because the same BASIC tion exist: periodicals and plans for The Superboard comes with both machines. Carlson sale. describes the capabilities of BASIC in The OSI Model 600, better known considerably more detail than the Two of the best periodicals were as the Superboard, is one of the oldest User's Manual and he includes a few described last month, the OSIO of the single-board microcomputers. At things the manual leaves out, like the Newsletter and PEEK(65). I also recom­ $299 (list) it provides more computing bugs. Carlson goes into detail on solu­ mend the Aaidvaik Journal, which is power per dollar than almost any other tions to the infamous Garbage Collec­ now about six issues old. This is a bi­ system in its class. For the beginner tor bug (which OSI doesn't even men­ monthly journal, published by a this system is close to ideal, both tion). Then he explains how to write leading supplier of software for OSI good, well-organized BASIC programs affordable and accessible. systems. For more information write and he provides many useful utility to: Aardvark Journal, 1690 Bolton, For $299 you get one board with programs for clearing the screen (fast), Walled Lake, Michigan 48088. these features: a typewriter-style converting hex to decimal, writing keyboard, a 6502 microprocessor, 4K of monitor format tapes, and so on. There is one other OSI-only program RAM, IK of display RAM, publication, the Independent Newslet­ video output circuitry, 8K Microsoft The material on the actual ter, O. S. I. U. I. N. put out by Charles BASIC-in-ROM and a 2K ROM mechanics of the BASIC interpreter is Curley at 6061 Lime Ave., #2, Long monitor. The board comes with a very useful and informative, and gives Beach, California 90806. I have seen User's Manual to help the beginner find the key to many clever and efficient only one issue of this, and I don't feel it his way around. You will also need a ways of writing programs for this is enough to judge this relatively young power supply (five volts at two amps) machine. Finally, this book has a com­ newsletter. prehensive list of publications and ven­ and a video monitor or an RF dors of software for the OSI. In short, modulator to connect the computer to MICRO publishes at least one OSI- this is the book every Superboard a TV set. These may cost between fifty related article each month as well as owner should have alongside his User’s and two hundred dollars more. this column. COMPUTE! has an "OSI Manual. Gazette" and Kilobaud Micro­ Or you could buy the OSI C1P for computing runs about four or five OSI- The next book I recommend for the $429, which is a Model 600 with an ex­ related articles per year. more experienced user, is Williams and tra 4K of progr am RAM in a case with a Domer's First Book of OSI, published power supply. A good cassette recorder All of these publications supply by Aardvark Technical Services. (Do |not battery operated) is almost essen­ short programs and hardware projects not confuse this with a book with tial, and you would do well to arm of real utility as well as good introduc­ almost the same title, by Clothier and yourself with additional reference tory material. Adams, published by ELCOMP.) materials which I will describe below. Williams and Domer provide much of Finally, it is possible to buy plans the same information as Carlson, with Now you have a complete computer and/or kits for various modifications to less introductory material, and more system which will allow you to write the Superboard. Ads for these run in technically sophisticated material. programs in BASIC and/or machine MICRO and other publications, and Williams and Domer's book is not for language. You can also run programs similar plans can be found in the above- the beginner, as Carlson’s is, so this which others have written, as long as mentioned publications. For instance, should be the second book to buy. they were written for the OSI Super­ Video Mods, to increase the number of board or C1P. Converting BASIC characters displayed per line, are The User's Manual does have some programs from other machines is described in Aardvark #5 (simple), and good points, namely a good job of print­ sometimes easy, but sometimes almost PEEK(65) #11 (complex). ing and production. Of the books I have impossible. For instance, tapes written mentioned, it has the best graphics for other micros probably won't load on I plan to publish a more complete table and the best hex-to-decimal con­ the OSI. list of OSI information resources in a version table. Carlson has the most future column. I am sure that I have Information Resources complete map of BASIC ROM entry overlooked some newsletters and points. Williams and Domer go into magazines. I am particularly interested As they become more experienced, more detail on what the ROM routines in boards or kits or plans that will: ex­ most beginners notice that there is a lot do. pand the Superboard memory, expand that can be done with the Superboard the video display, increase the cassette that isn't explained or even hinted at in The First Book of Ohio Scientific speed, and provide RS 232 and modem the OSI documentation. Many of the and Second Book of Ohio Scientific by support. Please send catalogs, etc. in apparent limitations of the board are Clothier and Adams contain mostly care of this column, to ensure your pro­ really only deficiencies in the User's promotional material reprinted from duct's inclusion in this list. Manual. Of course this is what user's OSI newsletters and entries from the

77 No. 35 - April 1981 MICRO - The 6502 Journal C o m p l e t e AIM 65 Expansion

For complete AIM 65 G expansion, Fore-, byb y Marka Pelczarskl thought Products for the Apple II brings y o u th e AIM- Mate Series, quality • Over 100 Hl-Res colors! expansion products with • Drawing program Includes automatic filling and price, performance and versa­ user-definable “paintbrushes”. tility that puts them in a class o f their own. • The finest 3-D graphics available, capable of color and multiple figures with machine language AIM-Mate Series expansion, including RAM (to 48K), speed. PROM, I/O, video and floppy disk interface, STD BUS • Create shape tables w ith paddles or keystrokes. interface, parity protection and more, lets you con­ figure the kind of system y o u need. • Hl-Res text anywhere on the screen. Define your own fonts. The compact AIM-Mate case puts it all together in a • Thorough, easy-to-use manual even shows how sturdy, portable, desk top unit. to use drawings and 100 color fill routine In Write today for complete details on the AIM-Mate your own programs. System- AIM 65 expansion products for the $5095 ton. CO-OP O professional. software IFORETHOUGHT firmware or language system. a division of Micro Co-op VISA and MasterCard accepted PRODUCTS Dealer inquiries invited Post Office Box 432 87070 Oukhobar Road, Eugene, Oregon 97402485-8575 (503) West Chicago, IL 60185 Apple n Is a trademark of Apple Computer, Inc. (312) 231 -0912

PET & APPLE II USERS From AVANT-GARDE CREATIONS — — — — — T iny Pascal SEN TENC E DIAG RAM M ING Plus + GRAPHICS ^ PARTS OF SPEECH USAGE Includes: The TINY Pascal System turns your APPLE II micro into a 16-bit P-machine. You • 3 Levels of Difficulty, 20 sentences per level too can learn the language that is slated to become the successor to BASIC. TINY Pascal offers the following: • Optional Record-Keeping on Data Disk * LINE EOITOR to create, modify and maintain source • Optional Print-outs of Records * COMPILER to produce P*code, the assembly langauage of the P-machine * INTERPRETER to execute the compiled P-code (has TRACE) • Teacher-formatted Requirements for Advancing * Structured programmed constructs: CASE-OF-ELSE, WHILE-DO, IF-THEN- ELSE, REPEAT-UNTIL, FOR-TO/OOWNTO-DO, BEQIN-END, MEM, CONST, to the Next Level VAR ARRAY • Teacher-formatted Options to Exclude Actual Our new TINY Pascal PLUS+ provides graphics and other builtin functions: GRAPHICS, PLOT, POINT, TEXT, INKEY, ABS AND SQR. The PET version sup­ Sentence Diagramming ports double density piotting on 40 column screen giving 80 x 50 plot positions. • Student Option for Record-Keeping The APPLE II version supports LORES and for ROM APPLESOFT owners the HIRES graphics plus other features with: COLOR, HGRAPHICS, HCOLOR, HPLOT, POL and TONE. For those who do not require graphics capabilities, you may still order our original Tiny Pascal package.

TINY Pascal PLUS + GRAPHICS VERSION- PET 32K NEW Roms cassette...... $55 PET 32K NEW Roms diskette ...... $50 APPLE II 32K/48K w/DOS 3.2 or 3.3...... $50

TINY Pascal NON-GRAPHICS VERSIONS- PET 16K/32K NEW Roms cassette...... $40 PET 16K/32K NEW Roms diskette...... $35 APPLE II w/ROM Applesoft 32K w/DOS ...... $35 APPLE II w/RAM Applesoft 48K w/DOS ...... $35

USER'S Manual (refundable with software order)...... $10 6502 Assembly Listing of INTERPRETER-graphics...... $25 6502;Ass»mbiy Listing of INTERPRETER-non graphics.. $20 APPLE n PLUS, 48K $19-95 1 or 2 Disk Drives VISA/Mastercharge FREE poatag*in U.S. and CANADA. Order* may tM prepaid of by bankcard (Include card numbaf and expiration data). Michigan resident* Include 4% stale salae tax. Ordara ac­ cepted via THE SOURCE CL06S2 AVANT-GARDE CREATIONS ® PHONE: ABACUS SOFTWARE P. 0. Box 7211 Box30160* 5 0 3 -3 4 5 -3 0 4 3 1 0 0 0 1 Grand Rapids, Michigan 49510 Eugene.OR 97403 NOON to SEM. PST

78 MICRO - The 6502 Journal No. 35 - April 1981 BASIC Program Converter Between SYM and KIM

This program allows a person to transfer BASIC programs from SYM to KIM or from KIM to SYM without having to spend hours typing In and debugging the programs. Figure 1

Lee Chapel 2349 Wiggins 4000 00 14 40 05 00 97 22 48 49 20 54 48 45 52 45 22 3A 88 35 Springfield, Illinois 62704 Pointer Line PR H THERE GO TO 5 Have you ever wanted to put to next num INT somebody's SYM BASIC program on your KIM without spending hours typ­ line ber ing the program in and debugging it? Or have you ever wanted to put somebody's KIM program on your SYM? This converter program allows Comparison of SYM and KIM equal to the first hex digit of C, and E is you to easily transfer BASIC programs Systems set equal to the other hex digit of C. from SYM to KIM, or from KIM to D, E, and B are then placed in an equa­ SYM. It is especially useful for long, 8 KIM begins program storage at 4000 tion where F becomes the value of the to 12K, programs. I used it to transfer a hex, SYM begins storage at 0200 hex. address of the next line pointer. Since 14K program I call "M onster Combat'' Since the data and the tokens are the only the high byte needs to be changed, from KIM to SYM in roughly half an same, only the line pointers and actual the address A + 1 is POKEd with a new hour. program location in memory need to be value. A is then set equal to F and the changed. The program can be relocated entire process continues with a new Description of BASIC Format on SYM by use of the Block Move, value of the line pointer until two zeros "B ". On KIM the use of a supplemen­ are found in adjacent addresses. The BASIC format used in the SYM tary monitor such as "XIM" can be and KIM is as follows. The first two used to relocate the program. It's also bytes of a program line point to the possible to relocate the program by Program Examples start of the next line (see diagram). The using the tape load FF function and new next two bytes are the line number, and address. The regular KIM tape record The following is an example of a the remaining bytes are BASIC tokens and playback are the same as the low KIM to SYM conversion. First check or data in ASCII. A token is one byte speed SYM tape record and playback. addresses 7D and 7E. These are, respec­ (80 to C5 hex] which represents a 2 to 6 tively, the low and the high bytes of the letter BASIC word. The only remaining difference be­ end of the program being transferred. tween the two systems is the pointer Make a record of these values and make Tokens or Data in ASCII Code values. They all need to be changed to a recording from 4000 hex to the (Hex) reflect the new location in the other address in those two memory locations system. The BASIC converter program at normal record speed. Next the tape is LO HI LO HI is written to convert all these pointer loaded into SYM at slow speed and Byte Byte locations. The BASIC program takes placed in memory so that it starts at Next line Line number only a few seconds to convert long pro­ 4000. SYM BASIC is then entered with pointer in hex in hex grams, so speed is not a problem. a J 0 and when Memory Size is asked for, a low value, such as 1500, should The tokens in both SYM and KIM Converter Program Description be entered. Type in the converter pro­ (such as INPUT and PRINT) are the gram. Make sure there are no errors and same hex value. For example, on both In both program listings, A is the then run the program. Once the pro­ systems INPUT is 84 in hex, and address where the low byte of the first gram finishes, go back into the PRINT is 97 in hex. An example of how pointer is located. B is the value found monitor, move the program at 4000 hex a BASIC line is formed is shown in in the address A, and C is the value of down to 0200 hex. Take the value in figure 1. the high byte of the pointer. D is set 7D that you noted and subtract 3E hex

No. 35 - April 1981 MICRO - The 6502 Journal 79 from it, and place that number in 7D. 1/Os will have to be modified. It should Next take the value noted for 7E and also work on AIM, assuming the tokens Lee Chapel has been working with KIM place it in 7E. Then set memory loca­ are the same. These programs have saved and SYM for about 3 years. He is majoring tions 87 and 88 to the proper size of many hours of retyping programs be­ in Computer Science at the University of your BASIC program area. tween systems. Wisconsin-Madison and has worked there as a programmer in the Agriculture Converting from SYM to KIM is Economics department. similar. Again, check memories 7D and 7E and make a note of them. Make a JMCftO tape of the program in the SYM's low speed format. Load it into KIM and Listing 1 place it in memory so that it starts at 5000 hex. Then start KIM BASIC and 5 REM SYM TO KIM CONVERSION IN BASIC when you are asked for Memory Size, 10 A=20481 give a low value such as 17000. Type in 15 IFPEEK(A)=0ANDPEEK(A+l)=0THENEND the conversion program, make sure 20 B=PEEK(A):C=PEEK(A+l) there are no errors, and run it. When, 25 D=INT(D/16) :E=C-16*D the program finishes, go back to the 30 monitor and move the converted pro­ F=4096*D+256*E+B+1S968 gram from 5000 to 4000. Take the 35 POKEA+1, C+6 2 value noted for 7D and add 3E hex to it. 40 A = F : G0T015 Take the value noted for 7E, and place 45 END it in 7E. Change memory locations 87 Listing 2 and 88 to the proper size of your BASIC program memory. After moving and 5 REM KIM TO SYM CONVERSION IN BASIC testing, a final tape dump can be made. 10 A =16385 15 IFPEEK(A)=0AND PEEK(A+l)=0THENEND Conclusion 20 B=PEEK(A):C=PEEK(A+l) I have used both these conversion 25 D=INT(C/16):E=C-D*16 programs successfully on several 30 F=4096*D+256*E+B BASIC programs. Any USRs or special 35 POKEA+1,C-62 40 A=F:GOTOl5

16K MEMORY 32 K BYTE MEMORY EXPANSION KIT RELIABLE AND COST EFFECTIVE RAM FOR 6502 b 6800 BASED MICROCOMPUTERS FOR APPLE, TRS-80 KEYBOARD, AIM 65-*KIM*SYM EXIDY, AND ALL OTHER 16K DYNAMIC SYSTEMS USING PEFS44-BUS MK4116-3 OR EQUIVALENT DEVICES. * PLUG COMPATIBLE WITH THE AIM-65/SYM EXPANSION CONNECTOR "BY USING A RIGHT ANGLE CONNECTOR ★ 200 NSEC ACCESS, 375 NSEC (SUPPLIED) MOUNTED ON THE BACK OF THE MEMORY CYCLE BOARD. ★ BURNED IN AND FULLY * MEMORY BOARD EDGE CONNECTOR PLUGS INTO THE 6800 S 44 BUS. TESTED » CONNECTS TO PET OR KIM USING AN ADAPTOR CABLE. ★ 1 YR. PARTS REPLACEMENT * RELIABLE-DYNAMIC RAM WITH ON BOARD INVISIBLE REFRESH-L00KS LIKE STATIC MEMORY BUT AT GUARANTEE LOWER COST AND A FRACTION OF THE POWER REQUIRED FOR STATIC BOARDS ★ QTY. DISCOUNTS AVAILABLE * USES +5V ONLY. SUPPLIED FROM HOST COMPUTER. * FULL DOCUMENTATION ASSEMBLED AND TESTED BOARDS ARE GUARANTEED FOR ONE YEAR AND ALL ASSEMBLED BOARDS AND PURCHASE PRICE IS FULLY REFUNDABLE IF BOARD IS RETURNED UNDAMAGED WITHIN 14 DAYS. MEMORY CHPS CARRY A FULL ONE ASSEMBLED WITH 32K RAM ...... $395.00 YEAR REPLACEMENT WARRANTY t WITH 16K R A M ...... $339.00 TESTED WITHOUT RAM CHIPS ...... $279.00 HARO TO GET PARTS (NO RAM CHIPS) WITH BOARD AN0 MANUAL ...... $109 .00 BARE BOARD S M A N U A L ...... $49.00

v’f ’ -N^PACF rONNbCTS rn£ 32K 3AM B0AHD ro 1250 tu.couin5 ove. .> Pt I C' N’A.NS :NTE^FACE CABiF. bOARO ORPnCE, cn 92668 power supply wgoif-cat-on kit and covpletf. ■*;stpuc:ons $49oa (714)633 7280

U.S. PRICES ONLY

80 MICRO - The 6502 Journal No. 35 - April 1981 Line 16 as shown, produces the max­ If this short program is appended to imum allowable field width and is suf­ the front of the A/S-R/N-M and the ficient to handle dollar amounts from whole mess is BSAVEd as a unit under /AICEO $-999,999.99 to $9,999,999.99, the name RENUM, then the loading and which is the range handled by Mr. reconfiguration is quickly achieved by Microbes Bauers' original routine, and which should be adequate for most small BRUN RENUM ana Updates applications. (It is certainly adequate for my personal checkbook.) The field width can be changed anywhere in the calling program by assigning the Here's how: Mike Rowe desired value to the variable “FW". Microbes & Updates Line 15110 as shown left-justifies the 1. RUN Apple’s RENUMBER from P.O. Box 6502 leading " $ " , but this is easily changed. the system disk. Chelmsford, MA 01824 2. Because of the behavior of the 2. POKE in the 20 bytes of the pro­ This month, we offer the following function "IN T " (described by Mr. gram as follows: improvements, iathei than corrections. Bauers in his article), the routine as it POKE 36332.169 stands will round fractional cents in­ POKE 36333,0 Les Cain, of Grand function, Col­ correctly for negative amounts, e.g. POKE 36334.133 orado, sent this update to his article in -1.009 rounds to -1.00 instead of POKE 36335.115 the January issue (32:75): There is a -1.01. (Fractional cents occur most POKE 36336.141 problem with Control C in "Fun with often when computing percentages.) POKE 36337.246 O SI." I apologize to the readers for the Here is a simple fix to line 15 which 36338.3 oversight in not replacing the Disk con­ solves the problem: POKE trol C POKE with the proper ROM POKE 36339.169 36340.142 POKE. To correct the problem, change 15 DEF FN VL(X) = INT((X + POKE the following lines: SGN(X)* .0001 )* 100 + .5) POKE 36341.133 POKE 36342.116 Line 760 POKE 530,1 :K = 57088 POKE 36343.141 Line 1710 POKE 530,0:END POKE 36344.247 Line 1740 POKE 530,0:END POKE 36345.3 John P. Molineaux of Cheverly, POKE 36346.169 Maryland, sent this enhancement: POKE 36347,76 There is always a better way. On POKE 36348.141 reading Frank Chipchase's excellent ar­ POKE 36349,245 Charles F. Taylor, Jr. of Monterey, ticle on "Better Utilization of Apple POKE 36350.3 California, offers the following tip: Computer Renumber and Merge Pro­ POKE 36351,96 “Business Dollars and Sense in gram" in the August 1980 issue Applesoft" by Barton M. Bauers, Jr. (27:17), I was struck by the awkward­ (MICRO 27:65] was most interesting ness of the series of EXEC file POKEs Of course, the monitor is zippier on and useful. Here are a couple of simple required to configure the A/S-R/N-M this kind of task, if you want to enter changes which will make the routine program. Machine language is far better "Mask” even more useful: than Applesoft at POKEs and it doesn't the hex equivalents of the decimal POKEs in $8DEC through $8DFF. fill the screen with Applesoft prompt 1. "Mask" produces output left- characters (]). justified in a variable-width field. While this is useful for some applica­ Recall that HIMEM:32352 is equiv­ 3. BSAVE RENUM,A36332,L2068 tions, it will not do for producing col­ alent to POKE 115,0:POKE 116,142. umns of figures. Ideally, the output Hiding A/S-R/N-M and resetting the Notice that an additional 20 bytes spill should be right-justified in a predeter­ &-pointer therefore translates to: over onto one more track in the mined field width (specified by the RENUM data set. user). This can be accomplished by Assembly Decimal adding lines 1(5 and 15025 and by modi­ LDA 0 169 0 15110 fying line as shown below: STA 115 133 115 This way of saving the program STA 1014 141 246,3 saves a second or two on each run and 16 FW = 12 : REM SET FIELD LDA 142 169 142 dispenses with the screenful of empty WIDTH (5 = FW =12) STA 116 133 116 " ]' ’ lines that scoot your last display off 15025 BL$ = “ ” : REM 8 BLANKS STA 1015 141 247,3 the screen. After the BRUN RENUM, 15110 XW$ = XV$ + LEFT$(BL$, LDA 76 169 76 the 20-byte program is eventually FW — 4 — LEN(XX$)) + XX$ + STA 1013 141 245,3 destroyed the next time an Applesoft XZ$ RTS 96 string is created.

No. 35 - April 1981 MICRO - The 6502 Journal 81 ■* C t ' * * - ^ - • k

D r . D oBB'S joURNALof

COMPUTER (Calisthenics ^ 5 Orthodontia

Running Light Without Overbyte

Twelve Times Per Year $21/1 Year — $39/2 Years

Recent issues have included:

ZX65: Simulating a Micro

EXOS-6500 Software Development Tool Kit

6502 Assembler—Pet 8K-32K

A Note on 6502 Indirect Addressing

The C Programming Language

What you see is what you get.

To subscribe, send your name and address Dr.to D obb’s Journal, Department V4, Post Office Box E, Menlo Park, CA 94025. We'll bill you. Kg

82 MICRO - The 6502 Journal No. 35 - April 1981 Mike Rowe P.O. Box 6502 /AlCftO Chelmsford, MA 01824 Software Catalog: XXXI

Name: The DI-SECTOR Disk Price: $15.00 for cassette and Available: Mind Machine, Inc. System: Apple II, Apple Plus documentation 31 Woodhollow Lane Memory: 48K Author: Claud E. Cleeton Huntington, New York Language: ROM Applesoft, Available: Claud E. Cleeton 11743 Assembly 122-109th Ave., S.E. Hardware: D isk Drive, optional; Bellevue, Washington printer, language card 98004 Name: SEX-0-SC0PEtm: Description: A set of seven disk utility THE PRIVATE-LIFE programs to help 'DI-SECT' your disks. Name: Star Cruiser HOROSCOPE*” Now you can easily display and edit System: Apple II or Plus System: Apple II or TRS-80 any sector of a disk, list sectors used by Memory: 32K RAM Memory: 32K for screen version, a file, create a new VTOC, display free Language: 20K of assembly 48K for printout version and used sectors, create 'EXEC' files Hardware: One drive. Either 13 or 16 Language: Apple II—Applesoft in easily, print text files on the screen or a sector controller. ROM with DOS 3.2; printer, and load the language card with Description: Simply stated, the TRS-80—Disk BASIC 2.3 Hardware: Apple II— 1 disk w ith the old ROM code. ULTIMATE ACTION GAME. If you're screen version, 2 disks Price: $20.00 on disk postpaid. looking for fast Hi-Res action with col­ with printout version. Includes both DOS 3.2 or, sound and action to rival Atari’s and 3.3 versions, and Galaxian game, then this is it. Make it TRS-80—2 disks with documentation. past the first two levels and the third both versions. Author: Jeffrey Durham level will really kill you. Hundreds sold Description: Casts an accurate Available: Mike Rowe Productions in the first week of sale. horoscope, then interprets it from a P.O. Box 43504 Price: $24.95 sexual viewpoint in 1500 words or Tucson, Arizona 85733 Author: Nasir Gebelli more. Not just a paragraph about your Available: Sirius Software sign, but rather a reading of all the Name: NDE—Package 1537 Howe Ave., planets, signs and houses in a System: CBM Commodore Suite 106 horoscope that is unique to the in­ Memory: 32K Sacramento, California dividual. Text, by best-selling author of Language: BASIC 95825 Planets In Love and former editor of Hardware: CBM 3032/ Sexology Today, outlines tastes, turn­ ons and hang-ups in a tolerant, witty CBM 3040/CBM 3022 Name: Commodity File style. Computations are precise within Description: It is a whole package for System: Apple n, Apple Plus handling the results of X-Ray-Exam- Memory: 32K with Applesoft ROM a tenth of a degree for any date and time inations and liquid dye examinations of or 48K with Applesoft from 1880 to 2000. welds, 6 languages (German, Italian, RAM Price: $30.00—screen version $200.00—printout version French, English, Spanish and Portu­ Language: Applesoft II (includes license to repro­ guese), aic implemented. Hardware: D isk II, 132 column duce textual material Copies: Disk printer (optional) commercially) Price: $800.00 Description: Commodity File stores Author: M. Bauer and retrieves virtually every commodi­ Author: John Townley and AGS Available: M. Bauer ty traded on all Future's exchanges. A Software Aindorferstr.86 self-prompting program allowing the Available: AGS Software Box 28 D-8000 Muenchen 2A user to enter short/long contracts. Orleans, West Germany Computes gross and net profits/losses, and maintains a running cash balance. Massachusetts 02653 Name: 0-1. Options Takes into account any amending of System: PET cash balances such as new deposits or Memory: 8K withdrawals from the account. Instan­ Name: The Ultimate Catalog Language: BASIC taneous readouts (CRT or printer) of System: Apple E/Apple II Plus Hardware: PET/CBM contracts on file, cash balances, P/L Memory: Min. 20K (ROM Description: Options are evaluated. A statement. Includes color bar graphs Applesoft) unique measure of option value is com­ depicting cumulative and individual Language: Applesoft and Machine puted and used to compare options for transactions. Also includes routine to RWTS up to three expiration dates and three proofread contracts before filing. Hardware: Apple n, Disk II, DOS 3.2 striking prices. Normal prices for puts Price: $19.95 plus $2.00 (p&h) Description: Now you can format your or calls may be computed for any first class mail. directory to appear any way you wish. assumed situation and tables printed as Author: Mind Machine, Inc. Block similar programs together; write a function of stock price.

No. 35 - April 1981 MICRO - The 6502 Journal 83 headers mid-directory; separate by sec­ Price: $24.95 includes disk, Name: Small Business Account­ tions. This 5K, menu-driven utility is manual, demo sheet. ing (SBAJ easy to use and performs the following Author: Avant-Garde Creations System: OSI C4P MF functions: Alphabetize any portion or Available: Avant-Garde Creations Language: BASIC under OS65D all of directory, move any file, ex­ P.O. Box 30161 MCC Hardware: Printer, 2 Disks (second change any two files, highlight or Eugene, Oregon 97403 optional) remove highlighting from any file Description: Provides double-entry name, insert blank line(s), delete any Name: Z-Term journal system for cash flow analysis file, lock or unlock all files, delete or System: Apple II or Apple II Plus and reports. Automatic checking of restore all files. Memory: 48K distribution account totals at time of Price: $6.50 for listing/ Language: CP/M , entry. User-defined fields in data base instructions (Machine Language] files; up to 99 expense and income Author: Larry Abrams Hardware: Disk II (DOS 3.2 or 3.3], accounts, 999 vendor/customer Available: ARIES SOFTWARE Z-80 Softcard, Micro­ accounts, with names up to 72 char­ P.O. Box 58 modem II or most other acters. Six digit (XXXX.xx) capability Los Altos, California communications devices, in base module is expandable. Prints 94022 80-column board or exter­ Income Statement, Trial Balance, nal terminal optional. Charts of Accounts and Vendor/ Name: The Math Machine Description: Upload and download Customer lists. Summary financial in­ System: Apple data files between the Apple and formation totalable by month, quarter, Memory: 32K another computer. A number of ''lux­ and YTD. Sorting is available on user Language: Applesoft in ROM ury" features are also provided. Com­ specified fields. All records are MDMS Hardware: Disk, optional printer monly used systems can be put into a compatible and code allows user Description: Kid-tested, effective in­ directory for auto-dialing, keyboard system configuration. structional software to improve math Macros allow you to define strings for Price: $100.00 (3rd Class mail skills. Covers pre-math through divi­ output with simple keystrokes for fast free, 1st Class add $2.00). sion with over 110 skill levels. Designed log-ins to system, or to issue various Includes: (1) program disk and (1) by educators and written by program­ commands within the system. Table- data disk with sample mers for use by parents and teachers. driven prefix keys allow you to produce file. User manual and Includes such features as: reinforce­ any character not already on the Apple Accounting System Guide ment system, management, record keyboard without losing any other and sample source keeping, individualization, personal­ keys! Fully compatable with standard documents provided. Pro­ ized lessons, performance objectives, CP/M sequential text files, and can gram listings only are and immediate feedback. send files from disk of any size, and can available for $20.00 each. Price: $79.95 includes original receive up to 36K of data at a time. Author: J.O. Rector and back-up disk, teacher Auto-save mode will send XOFF Available: Video Ventures and parent manual, character to host, save file (with 1708 Beechwood Avenue support. operator prompting) and then continue. Fullerton, CA 92635 Author: Larry Johnson Price: $79.95, introductory Available: Southwest EdPsych (until May 1, 1981) Name: GRAFPAK APPLE Services Author: Bill Blue System: Apple II P.O. Box 1870 Available: Southwestern Data Memory: 32K minimum Phoenix, Arizona 85001 Systems Language: Either BASIC and 6502 P.O. Box 582-M ML Name: The Mailing Label Santee, California Hardware: Disk and graphic printer and Filing System 92071 Description: GRAFPAK is a family of System: Apple n programs for reproducing the Hi-Res Memory: 48K pages using grab-the-wire printer Language: Applesoft graphics. 1 x and 2 x scaling are stan­ Hardware: Apple n, Disk II (one or Name: Display-it dard, and 3 x and 5 x are available with two drives) System: OSI, C1P or Superboard some printers. Normal and inverse ink­ Description: Has loads of features: Memory: 4K ing is selectable, and variable indent is binary sorting; 1 - 3-second access of Language: 8K BASIC-in-ROM provided. Features vary with make and records by name or record number; user Description: Displays messages from model of printer. Packages available for formatted; optional 9-digit zip code right to left in large letters made up of IDS-440,445 and 460, Anadex DP-9xxx update; performs COUNT/SORTS any graphics character. Messages can family, and Epson MX-70 and MX-80 which enables the user to display a cer­ be up to 255 characters long. with graphic PROMs. tain type of population off the disk Price: $5.95 ppd. Price: $24.95 (+1.65 in Ohio] and/or make print-outs or mailing includes cassette and includes diskette and labels; reversible directory reading; documentation user's guide (specify DOS special backup programs, insert pro­ Author: Brian and Craig Zupke release and printer model). grams, copy-by-record (for backup] pro­ Available: ■ BC Software Available: SmartWare grams; automatic formatting file and 9425 Victoria Drive 2281 Cobble Stone Court directory updating; edit; delete; write; Upper Marlboro Dayton, Ohio 45431 count; read; print; customized mailing Maryland 20870 labels, quicksort utilization; much more.

84 MICRO - The 6502 Journal No. 35 - April 1981 M lR . presents our valuable free catalog (over 100 pages). He PROMPTS you to peek at the latest collection of software and hardware products for your APPLE ll™

VERSAWRITER II A drawing tablet, A STELLAR TREK simply plugs into your game I/O port. Trace, draw, the definitive Hi-Res design, or color any type of color version of the classic graphic. Adds words to Startrek game. Three pictures. Creates schematics, different Klingon opponents. computes Distance/Area of any Many command prerogatives figure. New - fill any area from use of weapons to on the screen in seconds with repair of damages. Needs over 100 different and 48K Applesoft ROM. distinct colors. Needs 32K Disk... $24.95 Applesoft ROM and disk drive. A bargain at... $249.95

SUPER SOUND BOWLING DATA Musical rhythms, SYSTEM gunshots, sirens, laser blasts, This data mangement explosions... add these and program provides accurate many more exciting record keeping and report sounds to your Apple, use generation for bowling leagues them in your programs, of up to 40 teams with or create your own 6 bowlers per team. super sounds . Needs Needs 80-column printer, 16K Applesoft. 32K Applesoft ROM. Have a blast for only Disk... $79.95 $12.95... Tape $16.95... Disk

ADD $2.00 U.S. $10.00 FOREIGN FOR SHIPPING CALIFORNIA RESIDENTS ADD 6% SALES TAX Open Tues. - Sun. Don't see what you want here, then w rite or call today for your free catalog, we're saving one just for you. CARDEN PLAZA SHOPPING CENTER 9719 RESEDA BOULEVARD DEPT. 1MI NORTH RIDGE, CALIFORNIA 91324 Visa/Mastercharge welcome. PHONE (213) 349-0300

No. 35 - April 1981 MICRO - The 6502 Journal 85 A The Newest In Apple Fun Solar Energy For The Home------We’ve taken five of our most popular programs and With the price of fossil fuels rising astronomically, solar space-heating systems are starting to become very combined them into one tremendous package full of attractive. But is solar heat cost-effective for you? This program can answer that question. fun and excitement. This disk-based package now of­ Just input this data for your home: location, size, interior details and amount of window space. It will then fers you these great games: calculate your current heat loss and the amount of gain from any south facing windows. Then, enter the data Mimic—How good is your memory? Here’s a chance for the contemplated solar heating installation. The program will compute the NET heating gain, the cost of to find out! Your Apple will display a sequence of conventional fuels vs. solar heat, and the calculated payback period—showing if the investment will save you figures on a 3 x 3 grid. You must respond with the ex­ money. act same sequence, within the time limit. Solar Energy for the Home: It’s a natural for architects, designers, contractors, homeowners.. .anyone There are five different, increasingly difficult ver­ who wants to tap the limitless energy of our sun. sions of the game, including one that will keep going Minimum system requirements are an Apple II or Apple II Plus with one disk drive and 28K of RAM. indefinitely. Mimic is exciting, fast paced and Includes AppleDOS 3.2. challenging—fun for all! Order N o . 0235A D (disk-based version) $ 34.95 Air Flight Simulation—Your mission: Take off and land your aircraft without crashing. You’re flying blind —on instruments only. A full tank of fuel gives you a maximum range of Math Fun about SO miles. The computer will constantly display updates of your air speed, compass heading and The Math Fun package uses the techniques of immediate feedback and positive reinforcement so that altitude. Your most important instrument is the Angle students can improve their math skills while playing these games: of Ascent/Bank indicator. It tells if the plane is climb­ Hinging—A little man is walking up the steps to the hangman’s noose. But YOU can save him by answering ing or descending, whether banking into a right or left the decimal math problems posed by the computer. Correct answers will move the man down the steps and turn. cheat the hangman. After you’ve acquired a few hours of flying time, Spellbinder—You are a magician battling a computerized wizard. In order to cast death clouds, fireballs and you can try flying a course against a map or doing other magic spells on him, you must correctly answer problems involving fractions. aerobatic maneuvers. Get a little more flight time Whole Space—Pilot your space craft to attack the enemy planet. Each time you give a correct answer to the under your belt, the sky’s the limit. whole number problems, you can move your ship or fire. But for every wrong answer, the enemy gets a Colorimeter—Test your powers of deduction as you chance to fire at you. try to guess the secret color code in this Mastermind- Car Jump—Make your stunt car jump the ramps. Each correct answer will increase the number of buses your type game. There are two levels of difficulty, and three car must jump over. These problems involve calculating the areas of different geometric figures. options of play to vary your games. Not only can you Robot Duel—Fire your laser at the computer’s robot. If you give the correct answer to problems on calculat­ guess the computer’s color code, but it will guess ing volumes, your robot can shoot at his opponent. If you give the wrong answer, your shield power will be yours! It can also serve as referee in a game between depleted and the computer’s robot can shoot at yours. two human opponents. Can you make and break the Sub Attack—Practice using percentages as you maneuver your sub into the harbor. A correct answer lets you color code...? move your sub and fire at the enemy fleet. Star Ship Attack--Your mission is to protect our or­ All of these programs run in Applesoft BASIC, except Whole Space, which requires Integer BASIC. biting food station satellites from destruction by an Order No. 0160AD $19.95 enemy star ship. You must capture, destroy or drive off the attacking ship. If you fail, our planet is doomed. . . Trilogy—This contest has its origins in the simple ---- Skybombers — game of tic-tac-toe. The object of the game is to place Two nations, seperated by The Big Green Moun­ three of your colors, in a row, into the delta-like, mul­ tain, are in mortal combat! Because of the terrain, ti-level display. The rows may be horizontal, vertical, their’s is an aerial war—a war of SKYBOMBERS! diagonal and wrapped around, through the “third di­ In this two-player game, you and your opponent mension” . Your Apple will be trying to do the same. command opposing fleets of fighter-bombers armed You can even have your Apple play against itself! with bombs and missiles. Your orders? Fly over the Minimum system requirements are an Apple li or mountain and bomb the enemy blockhouse into dust! Apple II Plus computer with 32K of memory and one Flying a bombing mission over that innocent look­ minidisk drive. Mimic requires Applesoft in ROM, all ing mountain is no milk run. The opposition's aircraft others run in RAM or ROM Applesoft. can fire missiles at you or you may even be destroyed Order No. 0161A1D $19.95 by the bombs as they drop. Desperate pilots may even ram your plane or plunge into your blockhouse, sui- cidally. Paddle Fun Flight personnel are sometimes forced to parachute This new Apple disk package requires a steady eye and a quick hand at the game paddles! It includes: from badly damaged aircraft. As they float helplessly Invaden—You must destroy an invading fleet of 55 flying saucers while dodging the carpet of bombs they to earth, they become targets for enemy missiles. drop. Your bomb shelters will help you—for a while. Our version of a well known arcade game! Requires Ap­ The greater the damage you deal to your enemy, the plesoft in ROM. higher your score, which is constantly updated at the Howitzer—This is a one or two person game in which you must fire upon another howitzer position. This pro­ bottom of the display screen. gram is written in H1GH-RESOLUTION graphics using different terrain and wind conditions each round to The sounds o f battle, from exploding bombs to the make this a demanding game. The difficulty level can be altered to suit the ability of the players. Requires Ap­ pathetic screams from wounded parachutists, remind plesoft in ROM. each micro-commander of his bounden duty. Press Space Wars—This program has three parts: (l)Tw o flying saucers meet in laser combat—for two players, (2) On, SKYBOMBERS—Press On! two saucers compete to see which can shoot out the most stars—for two players, and (3) one saucer shoots the Minimum system requirements: An Apple II or Ap­ stars in order to get a higher rank—for one player only. Requires Applesoft. ple II Plus, with 32K RAM, one disk drive and game Golf—Whether you win or lose, you’re bound to have fun on our 18 hole Apple golf course. Choose your paddles. club and your direction and hope to avoid the sandtraps. Losing too many strokes in the water hazards? You Order No, 0271AD (disk-based version) $19.95 can always increase your handicap. Get off the tee and onto the green with Appie'CoIf. Requires Applesoft. The minimum system requirement for this package is an Apple II or Apple II Plus computer with 32K of memory and one minidisk drive. Order No. 0163AD $19.95

* A trademark of Apple Computer Inc. PETERBOROUGH, N.H. 03458 Instant Software 603-924-7296 86 MICRO - The 6502 Journal No. 35 - April 1981 Apple* Software From Instant Software ------Santa Paravia and Fiumaccio Buon giorno, signore! Welcome to the province of Santa Paravia. As your steward, I hope you will enjoy your reign here. I feel sure that you will find it, shall we say, profitable.

Perhaps I should acquaint you with our little domain. It is not a wealthy area, signore, but riches and glory are possible for one who is aware of political realities. These realities include your serfs. They constantly request more food from your grain reserves, grain that could be sold instead for gold florins. And should your justice become a trifle harsh, they will flee to other lands. Yet another concern is the weather. If it is good, so is the harvest. But the rats may eat much o f our surplus and we have had years of drought when famine threatened our population. Certainly, the administration of a growing city-state will require tax revenues. And where better to gather such-funds than the local marketplaces and mills? You may find it necessary to increase custom duties or tax the incomes of the merchants and nobles. Whatever you do, there will be far- it, you can see how much land you hold, how much of it is under the plow and how reaching consequences.. .and, perhaps, an elevation of your noble title. adequate your defenses are. We are unique in that here, the map IS the territory. Your standing will surely be enhanced by building a new palace or a magnificent I trust that I have been of help, signore. I look forward to the day when 1 may ad­ cattedrale. You will do well to increase your landholdings, if you also equip a few dress you as His Royal Highness, King of Santa Paravia. Buonafortuna or, as you units of soldiers. There is, alas, no small need for soldiery here, for the unscrupulous say, “Good luck” . For the Apple 48K. Baron Peppone may invade you at any time. Order No. 0174A $9.95 (cassette version). To measure your progress, the official cartographer will draw you amappa. From Order No. 0229AD $19.95 (disk version).

TO SEE YOUR LOCAL INSTANT SOFTWARE DEALER OR USE THE ORDER FORM BELOW ORDER For Fast Service Toll-Free Name 1-800-258-5473 Address City. . State _ - Z ip - Apple Cassettes □ Check D Money Order D VISA □ AMEX □ Master Charge Card No------Exp. Date - 0018A Golf...... $7.95 0025A Mimic...... $7.95 0040A Bowling/Trilogy...... $7.95 Signed - Date 0073A Math Tutor I...... $7.95 0079A Oil Tycoon...... $9.95 0080A Sahara Warriors...... $7.95 Order your Instant Software today! 0088A Accounting Assistant...... $7.95 0094A Mortgage w/Prepayment Option/ Quantity Order No. Program name Unit cost Total cost Financier...... $7.95 0096A Space Wars...... $7.95 0098A Math Tutor 11...... $7.95 0174A Santa Paravia and Fiumaccio...... $9.95 0148A Air Flight Simulation...... $9.95 We Guarantee It!

Sot ,Wa; e Guarantee Shipping and handling *1.00 OUR PROGRAMS ARE GUARANTEED ■ ■ 0% ■ Total order TO BE QUALITY PRODUCTS. IF NOT COMPLETELY SATISFIED YOU MAY RETURN THE PROGRAM WITHIN 60 inson aoTTware me DAYS. A CREDIT OR REPLACEMENT WILL BF WILLINGLY GIVEN FOR Peterborough, N.H. 03458 ANY REASON.

No. 35 - April 1981 MICRO - The 6502 Journal 87 Apple 1 [ ’ Memory Management System"

A LITTLE HISTORY APPLE II PLUS OWNERS ONE TIME GOOD DEAL Many years ago, when the Apple II first came Owners of Apple II PLUS™ computers can MMS diskette...... $ 39.95 out, it was possible to program a 48K computer. At follow the same procedure with an INTEGER ANDROMEDA 16K RAM BOARD...... $195.00 this time you were somewhat constrained to Integer ROM card in slot 4. ANDROMEDA 16K RAM BOARD BASIC and a cassette storage medium. The final configuration of your Apple will be plus MMS diskette ...... $215 00 Shortly thereafter, APPLESOFT™appeared. The the same as above. original (RAM) version improved upon the Apple’s 2 ANDROMEDA BOARDS capabilities but reduced the programmer memory plus MMS diskette ...... $375.00 by about 12K. Youcould now do more but had less memory to do it with. SINGLE LANGUAGE ALSO The situation soon changed again when Apple If you don’t need dual language capabilities introduced the APPLESOFT ROM card. For $195 (PLUS owners who only program in APPLESOFT, A FEW PROGRAMMER NOTES the programmer now had both Integer and for example), then MMS will still relocate DOS on DOS is somewhat altered with MMS. The com­ APPLESOFT capabilities and 48K available. the 16K RAM card in slot 0. A full 48K will still be mand INIT is disabled, so you should INIT all your In keeping with tradition, Apple followed the available to the programmer. diskettes prior to starting up with MMS. In addition. ROM card with an even more classier act: the Disk MAXFILES automatically defaults to2 but can be drive. A majority of Apple owners now have a 48K changed if desired. Apple computer with Integer BASIC, APPLESOFT, The MMS program uses page 3 ($300-$3FF) for and a Disk Operating System (DOS). But the 48K WHAT IS REQUIRED interfacing and it is not available for programmer use. in the computer is no longer fully available to the ’ 48K Apple II or Apple II PLUS Regardless of your Apple’s configuration, approxi­ programmer since DOS occupies 10.5K of mem­ ‘ 1 or more disk drives. mately 2K of memory is devoted to the internal oper­ ory (actually 10752 bytes). A 48K Apple actually • 1 or 2 16K RAM EXPANSION BOARDS or ating system (monitor). has 37.5K of programmable memory if DOS is APPLESOFT or INTEGER ROM CARD Special configurations of MMS are available upon booted. . MEMORY MANAGEMENT SYSTEM by C.D.S. request.

HOW TO ORDER MMS and the ANDROMEDA 16K RAM EXPANSION BOARD are avail­ THE MEAT OF THIS AD able through your localcomputer MEMORY MANAGEMENT SYS­ store. TEM (MMS)™ by C.D.S. is a unique, ' Or you can order direct by calling exciting new way to get back the COMPUTER DATA SERVICES at 10.5K of memory alloted to DOS. (516) 360-0988. VISA. MasterCard, Here’s how it operates: and COD accepted. Credit card and (1) A 48K Apple is configured with check orders are shipped a 16K RAM EXPANSION BOARD postage - paid. Shipping charges in slot 0. and an APPLESOFT card are: or another 16K RAM EXPANSION $1.50 for MMS BOARD in slot 4. $3.00 for ANDROMEDA 16K (2) DOS is booted as you normally would, using a RAM BOARD. DOS 3.3 System Master diskette, or DOS 3.2 BASICS diskette followed by a DOS 3.2 System 16K EXPANSION BOARDS Master. Currently there are three 16K RAM boards avail­ MEMORY MANAGEMENT SYSTEM (MMS) (3) BRUN the M M S program. able for the Apple computer. is a trademark of Computer Data Services (C D S.)

In a few seconds your Apple computer Apple Language Card™ (retail $495.00) Apple II, Apple II PLUS, APPLESOFT, Apple Lan­ will recognize both Integer BASIC and MICROSOFTRAMCard™ (retail $195.00) guage Card are trademarks of Apple Computer APPLESOFT AND the DOS will be relocated on ANDROMEDA BOARD™ (retail $195.00) Company. the 16K RAM EXPANSION BOARD! ALL of these boards will work with MMS. How­ RAMCard is a trademark of Microsoft.. With DOS now resident on the 16K RAM board, ever, since we market the ANDROMEDA 16K 10.5K of memory is released for your program­ RAM EXPANSION BOARD, we are able to make ANDROMEDA 16K RAM EXPANSION BOARD ming use. the following offer: is a trademark of ANDROMEDA, Inc.

COMPUTER DATA VISA (516) 360-0988 SERVICES P.O. Box 94, Hauppauge, N.Y. 11787

88 MICRO - The 6602 Journal No. 35 - April 1981 Dr. William R. Dial 438 Roslyn Avenue /AlCftO Akron, Ohio 44320 6502 Bibliography: Part XXXI

890. The Cider Press (October, 1980) Huffman, David, "Personalizing Your Catalog Heading,” Weiglin, Peter C., “Formatting," pg. 5-6. Pg- 5. An Apple DOS 3.2.1 tutorial. Formatting and printing backwards on the Apple. Bartley, David, “Getting There Faster in Applesoft Bemheim, Phil, "Initialize New Files Automatically/' pg. 6. BASIC,” pg. 6-7. Speed up your Applesoft programs. A handy tip for handling files kept on a periodic basis. For the Apple. Sethre, Tom, "The Official Computer Game Player Bemheim, Phil, “Another Way to Find Hidden Cheater's Guide,” pg. 7-8. Characters,” pg. 6. Sethre, Tom, "Memory Display," pg. 9. A fix for hidden characters in Apple programs. A machine language routine for the Apple. Bemheim, Phil, “D ates/' pg. 8. An easy way to encode and decode dates. 894. The G.R.A.P.E. Vine (September, 1980) Hertzfeld, Andy, "D elete the Flashing Cursor," pg. 8. Sander-Cederlof, "One-Liner,” pg. 1. A short: monitor routine to silence the flashing cursor. A one-liner for the Apple. Bemheim, Phil, "Converting String Dates,” pg. 11. Anon., "Hi-Res Plotting of Characters from Character Routine to convert string dates to datum of the form Table," pg. 2. MMDDYY. A Hi-Res writing program. Wilson, Gene, "Je M'Apple' PASCAL.” Anon., "Faster Shell," pg. 8. Several Pascal programs for the Apple. This Faster Shell Sort is approximately 25% faster than the Hibbard Sort appearing in the last issue. 891. The Apple Barrel 3, No. 7 (September/October, 1980) 895. The Seed 2, No. 10 (October, 1980) Anon., "File Cabinet Partially Exposed,” pg. 5-6. A tutorial on the use of this important Apple utility. Anon., "Apple Pi Conventions,” pg. 7. A listing to standardize title pages on donated pro­ Winter, Kevin, “Using the Backspace as a Delete Key,” grams—for the Apple. Pg- 7. A technique to add special functions to the Apple. 896. Applications 3, No. 2 (August, 1980) McGee, Pat, “Pascal Problems,” pg. 9-13. A number of problems with Apple Pascal and the fixes. Camiller, Derek, "GET vs. INPUT,” pg. 12. Simplify your input statements and responses. Barber, Bruce, "Screen Create,” pg. 13-19. A poor man's graphic tablet for the Apple. Webster, Ian, "Telecom, Modems and Other Mysteries/' Meador, Lee, “Disassembly of DOS 3.2,” pg. 19-31. pg. 14-17. All about Modem use with the Apple in Australia. The fifth installment of this excellent series, on the Apple E>OS 3.2. Webster, Ian, "Relocation of Apple Machine Code,” pg. 20-25. 892. Stems from Apple 3, Issue 10 (October, 1980) This program will relocate machine code programs. Haines, Ron, "Some Notes on the UCSD Assembler," Sittel, Randy, "Are You Overtaxing Your Computer?”, pg. 26-27. pg. 3. Additional comments to augment skimpy documenta­ A table of the current requirements of various Apple tion of the Apple Pascal system. peripherals. Fields, Randy and Thompson, C., "Shorten Disk Com­ Ward, Dennis, "Display and Dec/Hex Converter,” pg. 5. mands," pg. 28. Two short programs for the Apple. Significantly shorten the Apple Disk Operating Anon., "Kent's Puzzle Entries,” pg. 8-11. commands. A series of 18 short programs for the Apple. Todd, Allen W., "Blockedit,” pg. 13-20. 897. Radio Electronics 51, No. 10 (October, 1980) An Apple Pascal disk utility, allowing examination and Staff, "Buyer's Guide to Home Computers,” pg. 45-84. editing of any diskette block. Among others, covers Apple; PET, OSI and Atari micros, including peripherals and accessories. 893. The Apple-Dillo (October, 1980) Sethre, Tom, "R oots,” pg. 3. 898. Fort Worth Apple User Group Newsletter (FWAUG) 2, Another installment of this tutorial on Apple machine No. 2 (October, 1980) language, dealing with handling keyboard input. McVay, Ray, "Ampersoft," pg. 2-4. Teas, George, "Pascal Primer,” pg. 5. Three routines for machine language string manipula­ A new column to help novice Pascal users with helpful tion to forestall garbage collection and quicken sorting. programming hints.

No. 35 - April 1981 MICRO - The 6502 Journal 89 Meador, Lee, "DOS 3.2 Disassembly—9," pg. 6-21. Mulligan, John P., "Programming with Pascal,” This installment of this important series discusses the pg. 59-63. Output State Machine and the data area and tables of Tutorial and Sorting routine for Apple Pascal. commands and error messages. Ellis, Dawn E., "Cassette Label Program,” pg. 65-67. Matzinger, Bob, "Make a Hello a Binary File,” pg. 23. Let the computer do the dirty work printing labels for A tricky way to put the boot program in Binary, for the those tape cassettes. For the Apple. Apple. Rowe, Mike (Staff), “The MICRO Software Catalog: XXV,” pg. 73-75. 899. Peisonal Computing 4, No. 10 (October, 1980) Sixteen new items of software for 6502 systems are reviewed. Fischer, Mike, "Word Search,” pg. 34-39. An Apple program to solve those jumbled letter Dial, Dr. William R., "6502 Bibliography: Part XXV," matrices with hidden words. pg. 76-77. Some 65 new references to the extensive 6502 Lubar, David, "Problem Solving and Computers,” literature. pg. 49-50. Use of the Apple in problem solving. 901. PEEK(65J Vol. 10 (October, 1980J Gaylord, Sam, "Cash In On the Power of Pascal,” pg. 52-53. Williams, Jim, "Cold Start/System Crash Recovery,” Pascal program on the "melt value” of silver coins. pg. 4-5. Recovering from system crashes caused by errant POKE Jones, Jeremy C., "A Computer Spelling Exercise," statements on OSI micros. pg. 54-55. An educational program for OSI computers. Lewton, Maurice P., "C1P or Superboard n GET Routine,” pg. 7. Welsh, Dave, "Rating BORIS 2.5,” pg. 78-90* A listing for OSI micros providing a 'GET' routine. All about the 6502-based computer programs called BORIS 2.5/Sargon 2.5. Criscione, J.R., Jr., M.D., "More on OS-65U Password File Protection," pg. 11. 900. MICRO No. 29 (October, 1980) Comments and listing for program security. Berger, Thomas R., "An OSI Cheep Print,” pg. 7-12. 902. Ham Radio 13, No. 10 (October, 1980) Hardware and. Software to interface OSI systems with a printer. Skeen, W.S., "A CW Keyboard Using the Apple n Com­ puter,” pg. 60-62. Morris, Gary A., "PRINT USING for Applesoft," Program Listing and simple interface hardware for pg. 14-17. using the Apple n with your Amateur station. Program permitting user-defined formatting of the out­ put of Applesoft. 903. The G.R.A.P.E. Vine (October, 1980) Kolbe, Werner, "Define Your Own Function Key on Anon., "Automatic Free Space with Catalog,” pg. 3. PET," pg. 19-20. Short modified routine for the booting of your disks. Program routine to call a commonly used BASIC func­ Anon., "DOS Changes on Disks,” pg. 4. tion from the keyboard. How to personify your disks. Dejong, Marvin L., "An Improved Morse Code Receive Anon., "What is Theomatics?”, pg. 5-7. Routine and Interface,” pg. 23-26. Discussion and two listings related to biblical Hardware and Software for the AIM 65. literature. Borton, David, "Undedicating A Dedicated Micro­ computer," pg. 27-28. 904. Creative Computing 6, No. 10 (October, 1980) Developing a time-shared process controller for the McClure, Jim, "The C2-4P Ohio Scientific Computer," KIM-1. pg. 17-23. MacDonald, R., "A 'Stop-On-Address' Routine for KIM." A review of a new micro. A routine to debug more efficiently through the use of a trap to stop on a specified address. Lubar, David, "Sound Advice," pg. 26-29. DAC's and Music boards for 6502 machines. Schultz, Robert, "Tiny Pilot Complemental (Co-Pilot).” Modification to Tiny Pilot improving the ‘Match’ Ahl, David H., "Easy Writer,” pg. 34. A Eeview of a word processor for the Apple. statement—for the SYM. Platt, Charles, "Bargain-Basement Word Processing," Boynton, G.R., "For Multiple File Tape Backups," pg. 36-38. pg. 54-55. Review of the WP6502 word processor useful for OSI This PET utility takes the drudgery out of making micros, Apple, PET, Atari, etc. multiple backup copies of cassette files. Carpenter, Chuck, "Apple-Cart," pg. 162-167. Wright, Loren, "PET Vet," pg. 39. Comments on PET documentation and literature How to avoid 'extra ignored' messages, saving strings references. on tape, listing for AC control routine, etc. Burcher, P.E., "Biorythm: An AIM BASIC Programming Yob, Gregory, "Personal Electronic Transactions," Exercise," pg. 51-55. pg. 168-172. Programs providing an interesting demonstration for How to get lower case letters on a PET, program pro­ using the AIM and its printer. viding automatic repeat of keys, PET machine language tutorial and examples, etc. Moyer, LeRoy, "Hexadecimal Printer," pg. 57-58. A simple Apple n program permitting the user to Blank, George, "Outpost: Atari," pg. 174-177. specify the limits within which he wants the String array demonstration, precautions for input/out­ disassembler to operate. put, printer interface, programmer’s aid, etc.

90 MICRO - The 6502 Journal No. 35 - April 1981 905. Apple/Sass (October, 1980) Owens, James, "Computerized Estate Planning," Burson, Dick, "Name that Tone!”, pg. 9. pg. 31-35. Tone generating routines for the Apple. An OSI program to take the tedium out of this chore. Anon., "M ath Drill n ,” pg. 14. Perdue, William H., "PET Mini Monitor," pg. 88-91. An educational Apple program. A short PET routine makes creating and saving machine language programs a snap. Golding, Val J., "Hidden REM Formatter.” Two listings for the Apple. Shawcross, William E., “OSI in the Sky," pg. 102-104. A mail labeling program for the OSI family. 906. Softalk 1 (October, 1980) Carlson, Edward H., "Speed Up Your BASIC Programs,” Wagner, Roger, "Assembly Lines,” pg. 3-4. pg. 128-130. Everyone's machine language guide. Hints for better programs on the OSI C2-4P. Phillips, Terry Edward, “Whoa, Apple,” pg. 132-133. 907. Dr. Dobb’s Journal 5, Iss. 9, No. 49 (October, 1980) Two machine language routines to tighten the reins on Gordon, H.T., "Opcode Design: 9 or 16 Bits?”, galloping video displays. pg. 22-23. Greenberg, Gary, "Betting on Old POKEy,” pg. 180. Discussion of 6502 code and codes of other A PET program using the POKE command to enter microprocessors. graphics. Bauers, Barton M., Jr., "A Roundoff Function in 908. The Harvest 2, No. 2 (October, 1980) Applesoft,” pg. 210. Peterson, Todd C., "A Free Remote Control for Your Keep your numbers at a manageable length with this Apple." Apple function. Use a receiver, a transmitter, and a patch cord for a remote control set-up. 912. Byte 5, No. 10 (October, 1980) Anon., "Parallel vs. Serial Printer Boards,” pg. 7. Zimmermann, Mark, "Floptran-IV: A Tiny Compiler,” A discussion of the merits of these two options. pg. 196-285. Anon., "Need to Get a Text File to a Printer in Pascal?”, A utility for the PET. pg. 8. Harrod, Dennette A., "The 6502 Gets Microprogram- A pascal starter routine for the Apple. mable Instructions,” pg. 282-285. Holle, Dave, "Physical and Logical Sectors of DOS 3.3," A hardware approach to adding 64 user-defined instruc­ Pg- 9. tions to the 6502. Some information on the new Apple DOS system. Robbins, Mike, "16 Sector Patch for Dan's Disk Utility,” 913. SoftSide 3, No. 1 (October, 1980) Pg- 9. Laurence, Matthew, "One Liner,” pg. 4. Just two lines added to fix this one up for 16 sectors. Short graphics program for the Apple. Alexander, Leon, "Leon’s Bell,” pg. 10. Clark, Terry, "IMHOTEP,” pg. 18-21, 82-84. A short machine program that toggles the bell upon an A game for the Apple. INPUT or GET statement on the Apple. Pelczarski, Mark, "SoftSide Database-Part 2,” pg. 22-23. Program for Atari and Apple. Part 2 of a series. 909. The Apple Shoppe 1, No. 7 (July/August, 1980) Bohlke, David, “World Series,” pg. 26-28. Staff, "Pascal PEEK and POKE,” pg. 7-8. A game for Atari. A short tutorial for Apple Pascal. Garon, James, “Octadraw,” pg. 41, 68. Jeske, Mark, "General Purpose Plotter Program,” A graphics utility for the Atari. pg. 11-13. Ward, Dennis, “Intema-Maze,” pg. 43, 64-65. An educational plotting program for Apple. A maze game for the Apple. Footprints, aerial view and all. Staff, "Programming the Graphics Tablet," pg. 14-18. Sandy, Herb, “Moonlanding," pg. 44-45. A tutorial and a Hi-Res Labeling program for the Apple A graphics program for Apple. fitted with a Graphics Tablet. Bohlke, David, "Double Cannon,” pg. 50. Crouch, Bill, "Down to Business,” pg. 18-20. A game in Atari graphics. A better formatting routine and hints on developing a Ohlund, Mark A., "Strings and Things,” pg. 60-61. business application for the Apple. An article dealing with Atari graphics and comparison Staff, "Spinterm Hi-Res Dump in Assembly,” pg. 21-27. with TRS-80 systems. An improved Apple program. Bouchard, Rich and Garon, James, "Atari One-Liners,” Hugard, James, "Printing in Pascal,” pg. 27-29. pg. 61. Some useful information for Pascal users. Two shsort programs for the Atari. Truckenbrod, Joan, "Computer Graphics,” pg. 66-67, 80. 910. O.S.I. Users Independent Newsletter No. 6 (October, Two Apple graphics programs—easily translated to 1980) Atari. Curley, Charles, "65D ," pg. 2-4. Garon, James, "Hidden Colors in Graphics 8,” pg. 69, 74. Here starts a series of articles on the innards of 65D. A new Atari concept and sample programs.

911. KB Microcomputing No. 46 (October, 1980) 914. Abacus II2, Issue 10 (October, 1980) Baker, Robert W., "PET-Pourri,” pg. 12-14. Britto, Arthur, "No DOS INIT,” pg. 2. Proganal is a useful PET utility. Several other items of This program removes the DOS from a diskette to allow PET software are reviewed. more room on the diskette. For Apple.

No. 35 - April 1981 MICRO - The 6502 Journal 91 Anon, "IAC Application Note: Pascal Long Integer Fix,” A machine language sort with assembly language pg. 3-4. routine and a BASIC Demo for the PET. This program is designed to repair the library module Comito, foAnn, "Stringing Your PET Along,” pg. 12-15. LONG-INTEGER in Apple Pascal. Two related discussions of Strings with examples, in­ Anon., "Pascal Hi-Res LOAD/SAVE to Disk," pg. 4-5. cluding an expression analyzing string routine for the This Apple Demo creates a Hi-Res picture in Pascal, PET. then saves it to disk. Then it is reloaded and displayed. Fowler, James, "Assembly Language Programming: Part Anon., "IAC Application Note: Pascal Utility Program,” 1, pg. 16-17. pg. 8-9. Part One of a series for the PET programmer. Program in Apple Pascal which reads from REMIN and Eisner, Gerry, "POKE a Border,” pg. 17-18. writes to disk. A utility for the PET, with examples. Anon., ' 'IAC Application Note: Linefeed-Pascal Utility.” Bressler, Ralph, "Moving Around the Screen," pg. 19. Program to set or defeat Linefeeds, Apple Pascal. A utility for the PET. Yee, David R., "Catalorganizer," pg. 12-13. Comito, JoAnn, "N otlf's, And's or But's,” pg. 20-22. Organize the catalog on Apple diskettes in alphabetical A tutorial on the PET's If-Then statement. order. Bressler, Ralph, "BASIC Does It Better," pg. 23-25. Anon., "IAC Application Note: COMCARD-Pascal Utili­ Discussion of a number of details in PET BASIC. ty ," pg. 13-14. Program in Apple Pascal to set up COMCARD Haluza, Doug, "Trouble-Shooting Your PET,” pg. 26-28. parameters. Some hints for reviving the dead PET. Yee, David R., "M ass Lock and U nlock," pg. 14. Bressler, Ralph, "Time Passes Quickly,” pg. 28-29. An Applesoft to lock or unlock all the files on an Apple A tutorial on the use of the PET timing routine. diskette at once. Comito, JoAnn, "Writing That Good Educational Pro­ Anon., "IAC Application Note: Program Foreign—Pascal gram," pg. 30-33. U tility," pg. 15-18. Two related articles on writing PET educational pro­ A major utility in Apple Pascal. grams, with examples. Bressler, Ralph, "PET Files,” pg. 36-39. 915. 73 Magazine No. 242 (November, 1980) A tutorial for PET Tape Files and a sample listing. Erdei, Steven C., "PL Tones from a KIM -1," pg. 112. Comito, JoAnn and Bressler, Ralph, "Merging A KIM program that will generate a square wave tone Programs," pg. 40-41. anywhere in the range of 191 Hz to 66 Hz. All about the PET merge system. Haluza, Doug, “An 80 by 50 Plotting Routine,” pg. 42. 916. Personal Computing 4, No. 11 (November, 1980) A PET listing for a plotting program. Gillie, Michael D., "Printing Pictures from Your PET," Haluza, Doug, "PEEKing at BASIC,” pg. 42-43. pg. 52-54. A utility for PET. A PET program to gather the characters off of the PET Bressler, Ralph, "PET's Round Off Problems," pg. 43, 48. screen and print them on the Commodore 2022 printer. Lubar, David, "M icrobiocide," pg. 79-80. 919. The Harvest 2, No. 3 (November, 1980) A discussion and hints for debugging programs on the Lyle, Guy A., "Float, Float, Float Your Point,” Apple. pg. 1-5. A tutorial on floating point representation on the Apple. 917. Byte 5, No. 11 (November, 1980) Cesa, Louis, "Kinetic String Art for the Apple,” 920. Nibble No. 6 (November, 1980) pg. 62-63. Connolly, Rick, "P.I.P. II: PIP Goes Disco," High resolution program for the Apple. Pg. 9-13. Sokol, Dan, ' ‘Three-Dimensional Graphics for the Apple A disk version of P.I.P. (Personal Inventory Program). n ,” pg. 148-154. Litwin, Larry M., "A Simplified Way For a Tiger to Eat A novel program for Hi-Res Apple graphics. Apple Pie,” pg. 21-22. Ramsdell, Robert E., "The Power of VisiCalc,” An Apple graphics Pascal program outputting to a Paper pg. 190-192. Tiger. All about this interesting piece of business related soft­ Mottola, R.M., "Amper-Interpreter,” pg. 27-44. ware for the Apple. Add "Print-Using” to your Apple's Instruction Set. 918. The Paper (Summer, 1980) Harvey, Mike, "Blocking Very Large Files,” pg. 45-47. A technique for file management on the Apple. Haluza, Doug, "Cross Referenced Memory Map,” Figueras, John, "Roundoff!” , pg. 47. pg. 4-6. Round off decimal values to a manageable format on the Memory map comparing locations on old and new PET Apple. ROMs. Haluza, Doug, "M achine Language is Faster Than You Reynolds, William HI, "Finding the Slot Number,” Think,” pg. 7. pg. 48. How to write programs addressing interface cards on Some examples for the PET. the Apple. Batcher, Bill, “The Evolution of a Puzzle,” pg. 8-9. Harrell, Keith, “Pascal Pointers and Principles,” A tutorial on handling strings on the PET. pg. 51-52. Haluza, Doug, "Machine Language is Still Faster Than A new column for Apple pascal programmers. You Think,” pg. 10-11.

92 MICRO - The 6502 Journal No. 35 - April 1981 Rogan, J.A., "Four-In-A-Row," pg. 55. Blank, George, "Outpost: Atari," pg. 170-171. A Lo-Res graphics game for the Apple. Atari Pascal is on the way, Atari Visicalc is available, Crossman, Craig, "An Assembly Language Tutorial," also description of the PIA, ANTIC, CTIA, and POKEY pg. 57. chips for Atari. This installment discusses the Screen Clear, RDKEY, Carpenter, Chuck, "Apple-Cart," pg. 172-180. and COUT in the Apple monitor. Absolute indexing, Indirect indexing, Interrupts, etc. Crossman, Craig, "Apple Tricks," pg. 59. on the Apple. More Apple tricks including Fast DOS, Special Characters, and Unstable programs. 925. MICRO No. 30 (November, 1980) Williams, Richard, “How to Use the Hooks,” pg. 7-9. 921. Iridis 2 (November, 1980) Hooks allow the user to break the normal flow of con­ Staff, "Fontedit," pg. 2-22. trol and redirect the Apple to his own routine. A program to allow the Atari user to design character Hart, John E., “An Ultra-Fast Tape Storage System," sets. Listing and complete information on the design pg. 11-14. and use of the program. A simple hardware modification to the OSI Superboard Staff, "Knotwork,” pg. 22-36. and a good home tape recorder yield data-transfer rates How to design a type of manuscript illumination in of up to 9600 baud. Atari programs. Listing and complete description. Sebra, Randy, "SY M -Bell," pg. 17-24. Staff, “Hacker’s Delight,” pg. 36-46. Use your SYM as a telephone memory dialer. A compendium of useful memory locations for the Morse, P. Kenneth, "Self-Modifying PET Programs," Atari operating system. pg. 29-31. Staff, "Loadfont,” pg. 46-49. A tutorial on writing a self-modifying program. A utility for use in writing programs on the Atari using Needleman, Ted, "General Ledger for the Apple II," private fonts. pg. 33-34. The SBCS general ledger is a major business program for 922. KB Microcomputing No. 47 (November, 1980) the Apple II. A review. Smith, Wayne D., “A Mini Logic Monitor and Single- Froelich, Jerry W., M.D., "Microprocessors in Medicine: Cycler for Hardware Debugging," pg. 59-66. the 6502," pg. 36. Hardware for your KIM-1. How the 6502 microprocessor is able to perform tasks in medical education nearly as well as large computer Bugg, Michael L., "Tinkering with Tiny BASIC," pg. 88-96. systems. Add four new and useful commands to Tiny BASIC as Morris, E.D., Jr. and Finkbeiner, Tim, "O hio Scientific implemented on the KIM-1. Users: Stop Those S-1 Errors,” pg. 37-39. Correct the BASIC error message output, put out Brock, Thomas D., "Hard Copy for Apple Graphics," messages of your own, etc. pg. 100-102. Software for printing the high-resolution screen using a Allen, David P., "A Versatile Hi-Res Function Plotter for Diablo printer. the Atari 400 and 800," pg. 47-50. Bruey, Alfred f., "Microcomputer Hardware for the Discussion and listing of an Atari color graphics Handicapped," pg. 173-174. program. Single-key data entry for the PET. Bridge, Theodore E., "John Conway's Game of Life Using Display Devices with Automatic Scrolling," 923. Recreational Computing 9, No. 3, Issue 48 pg. 53-58. (November/December, 1980) A KIM listing easily adapted to other 6502-based micros. Berggren, Stephen R., "DOZO in Pascal,” pg. 32-36. A Japanese DOZO game in Apple Pascal. Peterson, Craig, “Step and Trace for the Apple n Plus," pg. 61-63. 924. Creative Computing 6, No. 11 (November, 1980) Restore the Step and Trace functions of the original Apple n. Guerard, Michael P., "Another Slice of P i,” pg. 8. Flynn, Christopher J., "AIM 65 File Operations: Writing A way around a minor bug in arcsine and arccosine Text Files with BASIC," pg. 65-70. functions in Applesoft and TRS-80 Level n BASIC. The value of AIM BASIC is greatly enhanced with this Piele, Donald T., "How To Solve It—With the technique of writing text files. Computer," pg. 66-71. Rowe, Mike (Staff), "The MICRO Software Catalog: Part 3 of this series discusses Apple graphics and XXVI," pg. 72. FOR—NEXT statements. Review of five new 6502 software items. Kielian, Greg, "Bombproof Data Entry,” pg. 102-104. Dial, William R., "6502 Bibliography: Part XXVI," Unusual data entry methods for the Apple. pg. 76-77. Lubar, David and Forsen, Richard, "Car Race: Anatomy , Some fifty-five new references to the 6502 literature. of a Translation,” pg. 118-119. Translation for the Apple from a program written for a DEC PDP/11. Yob, Gregory, ‘‘Personal Electric Transactions," pg. 164-169. PET music programs, hardware for blinking lights with the PET, and a video car driver game.

No. 35 - April 1981 MICRO - The 6502 Journal 93 Introducing:

Introducing LISP. The language that can think for itself. With SmartWare, your micro­ computer possesses intelligence. Solves invocation problems like never before. Actually can learn language. Uses from its mistakes. And educates itself in much syntax and data the same way your brain operates. It’s a new structures upon which esoteric applications concept in the way information is handled in may be implemented. Remembers data microcomputers. along with “relationships affecting it” Offers We appropriately called our version of LISP, REAL power to micros. 48K diskette $125.00. SmartWare. Because it’s as limitless as the At MIT, they say LISP is the language of human imagination, mind, memory. the future. An advanced, high-level language, LISP was At Datasoft, we say, why wait. Ask your local first developed for use in artificial intelligence on computer dealer for SmartWare. Right now! And large computers. And now, LISP is available from turn your computer on to thinking. Datasoft for use on the Apple II. Store multiple programs' in memory. It can take it. Program other languages into LISP. It’s Smarfttaiety no problem. Because LISP offers greater capacity and power. And, it’s a faster, more streamlined DatWMrG Oods language. For example, just 2 lines in LISP could ------— ^ C O M P U T E R S O F T W A R E equal hours of BASIC programming. The facts: Relational data base capabilities. 16606 Schoenbom St., Sepulveda, CA 91343 User and program definability. Pattern-directed (213) 894-9154, (800) 423-5630 Serendipity ADVERTISERS’ INDEX Math Tools for y o u r April 1981 pplen Advertiser's Name Page Aardvark Technical Services...... 22 Abacus Software...... 78 Aim Supportware...... 36 Anderson Peripherals...... 71 IN TER -STA T offers you a full range of interactive statistical Andromeda, Inc...... 4 analysis techniques, from averages and medians to binomial Applefest '8 1 ...... 64 and poisson distributions, correlation coefficients and one-and Aurora Software Associates...... 62 two-way analysis of variance. $169. Avant-Garde Creations...... 78 Beta Computer Devices...... 80 ADVANCED MATH ROUTINES is the mathematical tool kit The Book...... 54 for common, yet complex numerical problems. Routines include: Broderbund Software...... 10 linear regression, matrix operations, numerical calculus, C & J Supply...... 76 differential equations and data set recall for iterative calculations. Computer Data Service...... 88 $169. The Computerist, Inc...... 46 Computer Mail Order...... 56 Thoroughly tested, well documented and easy to master, each Connecticut Information Services...... 40 package includes a 30+ page self-teaching manual. Consumer Computers...... • ■ 42 Serendipity’s complete line of software solutions for business, Continental Software...... 50 education and professional applications are available at your • Co-op Software...... 78 local Computerland or Apple dealer. For a free brochure, or to order direct contact Serendipity Datasoft, Inc...... 94 Systems, 225 Elmira Road, Ithaca, NY 14850. Decision Systems...... 54 Phone 607-277-4889. Visa and MC accepted. Dr. Daley...... 49 Dr. Dobb's Journal...... 82 '“Apple Computer D.R. Jarvis Computing...... 95 Eastern House Software...... 76 Forethought Products...... 78 SERENDIPITY SYSTEMS Hayes Microcomputer Products, Inc...... EFC Instant Software...... 86-87 Lazer Systems...... 11 FINANCIAL MANAGEMENT SYSTEM II LJK Enterprises...... 66 MICRO , ...... IBC A FAST. EASY-TO-USE ACCOUNTING SYSTEM MICRO Classifieds...... 60, 61, 62 DESIGNED FOR HOME AND BUSINESS ACCOUNTING Micro Interface...... 36 OBJECTIVE Enter an entire month's checking, charge card, and cash Microsoft Consumer Products...... 67 accounts iri just a few minutes using yourawn personalized macro MicroSoftware Systems...... 54 lists. Instant error correction on all entries. Audit all Tiles by Code Micro Technology Unlimited...... 2, 16 and month. PERFECT FOR TAX ACCOUNTING. Powerful new BUDGET Micro Ware Distributing...... 71 MANAGER for planning and comparing budget with audits. Printer Mittendorf Engineering...... 63 routines for listing disk files, balance, reconcile, search, macro lists, Nibble...... 96 audit and budget reports. Nikrom Technical Products...... 68 ALL THE ORIGINAL FEATURES + NEW BUDGET MANAGER Ohio Scientific...... BC * 1-3 KEYSTROKE ENTRYS Ohio Scientific "Small Systems Journal"...... 72-75 * AUTOMATIC TAX COOING * SINGLE OR DUAL DISK DRIVE Orion Software Associates...... 76 ★ ACCOUNT MANAGER: A self-prompting, error avoiding entry Perry Peripherals...... 36 system which includes disk files, balance, reconcile, edit, and sort. Powersoft, Inc...... 34 ★ BUDGET MANAGER: Plan, review, and balance your budget. Then Printout...... 12 generate complete reports with summation for any 1 -12 month Programma International...... 1, 41 period. Progressive Computing...... 71 ★ SYSTEM UTILITY: Enter your own Item and tax Code Macros, up to Rainbow Computing...... 85 100 each. Configure program to match almost any printer/disk system. Rosen Grandon Associates...... 68 ★ SEARCH RECORDS: Search for any given data. Make specific and Serendipity Systems, Inc...... 95 expanded searches using the Macro lists. Simulations Programming...... 76 ★ ACCOUNT AUDITOR: Totals all files by tax Code and any 1-12 Softside Publications...... 44 month period with year-to-date totals. Softape...... 35 ★ 48K APPLE with ROM APPLESOFT and disk required (printer Southeastern Software...... 26 optional) Southwestern Data Services...... 21 PRICE: S39.B5 -- Check, VISA, or MASTER CHARGE accepted. Strategic Simulations, Inc...... i . 25 D R JARVIS COMPUTING T.S.E. Hardside...... 45 1039 Cadiz Dr.- Slml. CA 93065 Versa Computing...... 68 Phone |805| 528-0151 Western Micro Data Enterprises...... 40 Dealer Inquiries Invited______......

No. 35 - April 1981 MICRO - The 6502 Journal "NIBBLE IS TERRIFIC" (For Youp Apple)

NB8LEIS: The Reference for Apple computing!

NB8LEIS: One of the Fastest Growing new Magazines in the Personal Computing Field.

NBBLEIS: Providing Comprehensive, Useful and Instructive Programs for the Home, Small Business, and Entertainment.

NBBLEIS: A Reference to Graphics, Games, Systems Programming Tips, Product News and Reviews, Hardware Construction Projects, and a host of other features.

IWBLEI8: A magazine suitable for both the Beginner and the Advanced Programmer. Each issue of NIBBLE features significant new Programs of Commercial Quality. Here’s what some of our Readers say :

- “Certainly the best magazine on the Apple II” - “Programs remarkably easy to enter”

- “Stimulating and Informative; So much so that this is thefirst computer magazine I’ve subscribed to!”

- “Impressed with the quality and content”

- “NIBBLE IS TERRIFIC!”

In coming issues, look for: □ Numeric Keypad Construction Lab □ Assembly Language Programming Column □ Pascal Programming Column □ Data Base Programs for Home and Business □ Personal Investment Analysis □ Electronic Secretary for Time Management □ The GIZMO Business Simulation Game And many many more! NIBBLE is focused completely No. 4 on the Apple Computer systems. nibble Box 325, Lincoln, MA. 01773 (617) 259-9710 Buy NIBBLE through your local Ill try nibble!bie! Apple Dealer or subscribe now with Enclosed isis mym y: $17.50 (for one year). the coupon below. □ check □ money order lpyaNBBLE! (Please allow 4 to 6 weeks for delivery of I st issue) BACK ISSUES of NIBBLE are available for $2.00 + .50 postage and handling. Name______

NOTE: Address______First Class or A ir Mail is required for all APO, FPO and all foreign addresses with the follow ing additional amount*. — USA, Canada. Mexico, APO, FPO $7.50 City______— Central and South America $9.00 — Europe $12.00 State______Zip____ — Asia and elsewhere $15.00

(^I9W> by MICRO-SPARC., INC., Lincoln. Mass 01773. A ll rights reserved. 'A pp le II is a registered trademark o f Apple Computer Company

96 MICRO - The 6502 Journal No. 35 - April 1981 $ 2 4 .9 5

H. W ith d / s k e t t e i Ohio Scientific's top of the line personal com­ OS-65U and two types of information manage­ These features collectively give the C8P DF puter, the C8P DF. This system incorporates ment systems, OS-MDMS and OS-DMS. capabilities to monitor and control home func­ the most advanced technology now available The computer system comes standard with a tions with almost human-like capabilities. in standard configurations and add-on options. high-speed printer interface and a modem in­ Process Controller The C8P DF has full capabilities as a personal terface. It features a full 53-key ASCII The C8P DF incorporates a real time clock, computer, a small business computer, a home keyboard as well as 2048 character display FOREGROUND/BACKGROUND operation and monitoring security system and an advanced with upper and lower case for business and 16 parallel I/O lines. Additionally a universal word processing applications. process controller. accessory BUS connector is accessible at the Personal Computer Features Home Control back of the computer to plug in additional 48 The C8P DF features ultra-fast program execu­ The C8P DF has the most advanced home lines of parallel I/O and/or a complete analog tion. The standard model is twice as fast as monitoring and control capabilities ever signal I/O board with A/D and D/A and other personal computers such as the Apple II offered in a computer system. It incorporates multiplexers. and PET. The computer system is available a real time clock and a unique FOREGROUND/ Clearly, the C8P DF beats all existing small with a GT option which nearly doubles the BACKGROUND operating system which allows computers in conventional specifications plus speed again, making it comparable to high end the computer to function with normal BASIC it has capabilities far beyond any other com­ mini-computer systems. High speed execution programs at the same time it is monitoring puter system on the market today. makes elaborate video animation possible as external devices. The C8P DF comes standard C8P DF is an 8-slot mainframe class computer well as other I/O functions which until now, with an AC remote control interface which with 32K static RAM, dual 8" floppies, and have not been possible. The C8P DF features allows it to control a wide range of AC appli­ several open slots for expansion. Ohio Scientific's 32 x 64 character display with ances and lights remotely without wiring and graphics and gaming elements for an effective an interface for home security systems which resolution of 256 x 512 points and up to 16 monitors fire, intrusion, car theft, water levels Prices start at under $3,000. colors. Other features for personal use include and freezer temperature, all without messy Computers come with keyboards and floppies where specified. a programmable tone generator from 200 to wiring. In addition, the C8P DF can accept Other equipment shown is optional. 20KHz and an 8 bit companding digital to Ohio Scientific's Votrax voice I/O board and/or analog converter for music and voice output, Ohio Scientific's new universal telephone inter­ For literature and the name of your local 2-8 axis joystick interfaces, and 2-10 key pad face (UTI). The telephone interface connects dealer, CALL 1-800-321-6850TOLL FREE. interfaces. Hundreds of personal applications, the computer to any touch-tone or rotary dial games and educational software packages are telephone line. The computer system is able to currently available for use with the C8P DF. answer calls, initiate calls and communicate OHIO SCIENTIFIC Business Applications via touch-tone signals, voice output or 300 a AjfaCOM Company The C8P DF utilizes full size 8" floppy disks baud modem signals. It can accept and and is compatible with Ohio Scientific's ad­ decode touch-tone signals, 300 baud modem 1333 SOUTH CHILLICOTHE ROAD vanced small business operating system, signals and record incoming voice messages. AURORA, OH 44202 • [216] 831 -5600