International Edition: U.S. Edition: JUNE...

86
U.S. Edition: International Edition: JUNE 1984 Better Random Number Generator Musical Notes 16 Bit 68000 Supermicros Programming with Macros

Transcript of International Edition: U.S. Edition: JUNE...

Page 1: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

U.S. Edition: International Edition: JUNE 1984

Better Random Number Generator Musical Notes

16 Bit 68000 Supermicros Programming with Macros

Page 2: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

C

The Fast BASIC Compiler

“...BASIC pro­grams running up to 20 times faster”

A stunning show delighted the crowd at the Whisman Theater in Mountain View last night. Called BLITZ!, loaded and performed by Robert Skyles in a one-man virtuoso programming display, the show fea­tures the spectacular compiler for--------------------- the COMMODORE 64.1C pro- The BLITZ! com-

piler is faster than'Unning PET SPEED, and

i ti m q faster than anyt 111 I IC O other Commodorecompiler that has

_____________appeared to date.Shortly after Skyles took his seat and inserted BLITZ!, he had normal BASIC programs running up to 20 times faster after he BLITZed them.

The performer explained that BLITZ! translates the slow BASIC

language into a much faster code, thus improving the performance of the BASIC routines. BLITZ! reads the entire BASIC program, decides which operations only have to run once, and compiles the operations. It then re-writes the program into its special P-code.

Skyles also showed how BLITZ! adds security to your programs, because once a program has been compiled, it is not readable. That means protection is an automatic part of the re-writing.

The highlight of the show was, for this reviewer, when BLITZ! compiled a string of BASIC programs such that one loaded the next. An im­pressed audience looked on as Skyles effortlessly passed informa­tion from one program to another.

BLITZ! on disk for the Commodore 64 costs only $99.00.(You can also get one for the older PET CBMs on a special-order basis.It puts on quite a show!)

Cbwjpo F lp r f r i r W n rk * Available from your localoKyiGS E lectr ic WOrKS Commodore 64 dealer or231E South Whisman Road ca|| 1 -800-227-9998.Mountain View, CA 94041 ' , '/ y i ic \ n c c 1 -70ET BLI TZ! IS a t radem ark of Skyles Electr ic Works.( 4 1 5 ) y b b - l / S O C o m m o d o re is a trademark of C o m m o d o re

Page 3: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

There are three ways to learn 6502 Assembly Language on your Apple Computer:

HardO TH E R A S S E M B LE R S

Easy EasiestLISA v2 .6 LISA ED PAC

Introducing the Easiest Way: The LISA Ed Pac"

Y o u ca n t d e n y th a t le a rn in g a s s e m b l y is e x t r e m e l y im p o r t a n t f o r y o u if yo u w a n t to m a k e th e m o s t of y o u r w o r k If a s s e m b l y la n g u a g e w a s n ’t so im p o r ta n t , w h y a re a lm o s t al l of t h e t o p s e l l i n g p ro g r a m s a v a i la b le fo r t h e A p p le II w r i t t e n in a s s e m b ly l a n g u a g e 7 B u t le t ' s f a c e it. le a r n in g 6 5 0 2 a s s e m b l y la n g u a g e isn t a p ie c e of cake . At le a s t n o t un t i l now . B e c a u s e n o w th e r e 's t h e L IS A E d u c a t i o n P a c k a g e " f r o m L a z e rw a re . I t ’ ll h a v e y o u up to s p e e d w i th a s s e m b l y la n g u a g e in a f r a c t io n o f t h e t ;m e it w o u ld o t h e r w i s e take.

T h e L IS A Ed P a c ' b e g in s w i th L IS A v2.6. t h e fa v o r i t e a s s e m b l e r o f b e g in n e r s a n d p r o f e s s io n a ls a l ike. M o r e A p p le o w n e r s h a v e le a r n e d 6 5 0 2 a s s e m b l y la n g u a g e u s in g L IS A th a n al l t h e o t h e r a s s e m b l e r s c o m b in e d . M o r e tu to r i a l m a te r ia l is av a i la b le fo r LISA, i n c lu d in g b o o k s by D. F u d g e , R. H yd e , W. M a u re r , a n d R. M o t to la . R a n d y H y d e ’ s 3 0 0 - p a g e Us i n g 6 5 0 2 A s s e m b l y L a n g u a g e is i n c lu d e d m the L IS A Ed P a c " .

N e x t w e t h r e w in S P E E D / A S M a s e t o f 6 5 0 2 s u b r o u t i n e s th a t m a k e p ro g r a m in g in a s s e m b ly la n g u a g e as e a s y as BASIC. A n d f o r t h o s e w h o w a n t to s e e h o w it ’s d on e , t h e S P E E D / A S M s o u r c e l i s t in g s a re a lso m d u d e d . W e a l s o i n c lu d e d t h e L U D * 1 (L is a U t i l i t y D isk - 1 ( w h i c h in c lu d e s an e x t e n d e d e d i t o r f o r L IS A an d a L IS A s o u r c e f i le l i s t in g u t i l i t y . Final ly , w e a d d e d M A X W E L L 'S D e b u g g e r " t o t he L IS A Ed Pac Th is u l t r a - p o w e r f u l d e b u g g e r / m o n i t o r m a k e s ' l e a r n m g an d d e b u g g in g 6 5 0 2 a s s e m b ly la n g u a g e a b r e e z e

LISA Ed Pac Pr ice S1 45 .9 5 . A S 2 2 9 75 V a lue ( s u g g e s te d retai l*A vai lab le at d e a le rs e v e ry w he re , o r d i r e c t ly f rom.

F o r a c o o y of L i z w o i w i r e s A C ,. N o te L 'SA. l ISA 6 i . ;SA n Pi.'. A p p le A[:p<t-‘ li a ^ d A rt;:*-

;,r ,7 1 4 ; 7 3 b ' 1 041

Page 4: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

This Month in MICRO

This is a very special m onth for M ICRO. It's been redesigned to m ake it easier to read and easier to use. The listings are being typeset in clearer, larger print, and they are now proofed by computer for typos before being published.

The Staff believes that it has chosen features w hich w ill truly interest and excite serious com puterists. However, to be certain of this, an extensive, in-depth Reader Survey has been included in this issue. The answers we receive w ill guide the future direction of M ICRO'S editorial m aterial; be certain that your opinions, your desires, your likes and dislikes are considered. Return the Survey (with additional com m ents if you like] and m ake M ICRO the magazine that you want it to be.

Featured This Month

Random Number Generator — Based on seven years of research, this is one of the best RN G 's you w ill ever find. W hether you want it for software d e v e lo p m e n t, g a m es , g a m b lin g , co m p u te r sim ulation, scientific experim entation, or any of its myriad other uses, you w ill discover that it is in an understandable form w hich you can easily use in your own programs.

Musical Notes — For the budding m usician in each of us, a program that gives you control over a five octive range covering the entire treble, bass and alto clefs. W ith a 200 note table and rhythm ic variations, this is far more than just a toy. It even offers the unusual option of changing notes if you don't quite get your m asterpiece right the first tim e.

Programming with Macros — For the advanced com puterist who writes in Assembly Language, M acros can be the key to m ore efficient, cleaner, more easily debugged programs. They are a powerful tool in knowledgeable hands.

Under the Commodore 64 ROM — Use the entire potential of your computer and free up your BASIC m emory w ithout sacrificing program messages. Here, at last, is a way to print messages to the screen (even full screens) using the 16K of RAM located under the BASIC and Kernal ROM chips.

Sixteen Bit 68000 Supermicros — The 68000 is thought by many to be the 6502 of the '80s, the future of m icrocom puting. To keep you aware of the latest trends, two seasoned com puterists share their views and insights into this relatively new chip fam ily. Their thoughts may influence the directions that your own hardware and software planning take.

Useful Math Functions — Save yourself tim e and m athem atical aggrevation w ith this practical com pilation of defined functions assembled into a very friendly program. Once entered, the m ath formulas are at your disposal as needed w ithout the frustration of entering them again and again.Apple lie Guide and Atlas — A very special gift to our readers this m onth is the com plete Apple lie Supplement to our best selling b o o k ," W hat's Where in the A pple." This w ill bring earlier copies of the book up-to-date w ith the m aterial included in the latest printing. For those who have not yet discovered the importance of this book for your programming efficiency, this w ill give you a chance to see the type of m aterial available to you. (An order form may be found on the inside back cover, if you would like to own a com plete copy.)

Question Mark — For those who enjoy a good mystery, our staff has com e up w ith som ething that may pique your curiosity. Test your computing knowledge and find the answer.

Inside the CIA — No, we haven't gone political - just practical. In his ongoing 'Interface C lin ic'

series, Ralph Tenny exam ines a toggle mode of operation useful for output and input of m ultiple bytes of parallel data, and the advantages and methods of using the Shift Register. He also looks at ways to interface directly to a m icroprocessor bus w ithout damaging the computer.

Spotlight — Acorn, a new computer system widely used in Great Britain, but just coming into American m arkets, is studied in detail. Developed for education, this versatile, sophisticated system w ith its excellent color graphics and advanced sound should go far in hobbyist, hom e and business applications.

2 MICRO No. 72 ■ June 1984

Page 5: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Dear Readers,

As you read through this issue you will notice a few new things in Micro. While preserving the integrity and thrust of Micro, we are always working towards improving what we already have. To this end we have made some changes in the physical layout of the magazine to make reading Micro even easier and more enjoyable. You will notice that now we are typesetting our listings rather than taking them directly from the printer. This is in direct response to readers' comments on the legibility of listings. In addition to being typeset, the size of the actual type in the listings is slightly larger. (Hopefully this will help slow down the loss of your eyesight due to staring at too many computer screens for too many years.) We have also improved the layout of the articles to make reading easier.

Now some of you may feel that these changes reflect a loss of the 'original' Micro. To the contrary, we are more committed than ever to bring you articles that are intelligent and thought provoking. As part of this commitment we have added to some articles a 'Key to Understanding.' Don’t get your hopes up; this is not some magical method to 'knowledge.' Nor is it a leftover from 'Secrets of the East.' Instead, it is our way of making more of our articles accessible to more readers. How often have you picked up a magazine and found that due to a lack of some assumed 'basics' an article was beyond your reach. If only you had a basic foundation you could then use the article. Or on the flip side, you come across an article which, although it has information you find interesting, is interspersed with Pablum explaining every other word. How many times have we read what a binary digit is? To help eliminate both of these problems we have taken out the basic information needed to understand an article and put it in a sidebox. This 'Key to Understanding' explains any terms or concepts that are necessary for intelligently reading the accompanying article. Those who are already familiar with the subject matter can go on to the article, being spared what for them would be repetitious. This tool will be used as is appropriate and necessary. In this issue you will find two articles that utilize this style - The Random Number Generator by Cem Kaner and John Vokey, and Programming with Macros by Patty Westerfield.

And now you have an opportunity to outdo yourselves -yes, it's Survey Time. (Why aren't you jumping up and down?) Last year Micro readers proved their stuff with a return rate of over 20 percent! In the world of surveys this is fantastic. Now you can do it again; don't miss out -

this is your big chance to help out your fellow man (i.e. the Micro staff and Micro readers). And it is faster, easier, and much more pleasant than giving blood, although some have likened it to pulling teeth. Seriously, we would greatly appreciate your taking a few minutes of your time to fill out the survey and return it to us. We will pay the postage and put in the time and expense necessary to tabulate it. Why? It is through the survey results that we can decide how best to serve you. Everyone could be

waiting for an article on interfacing your computer to your pet dog, but unless you fill out the survey and tell us we will never know. In the past, Micro readers have shown their stuff by responding in numbers much better than usually projected for survey returns. We hope this year to do even better. Although we can't give out a lollipop for each survey returned, we can guarantee that your opinion and information count and will be responded to.

In closing, I would like to reiterate that we feel we are here to serve you and not the other way aroun. Micro is not just a magazine, but rather a community of dedicated readers. We invite you to participate and come out and play - write a letter to the editor, submit articles, give us a call, or - if you find it's Friday night and your computer is down - fill out the survey. Thanks.

Mark S. Morano Technical Editor

On The Cover

Sum m er is here and m usic is in the air. Play the old favorites or com pose a new tune to honor the season, w ith M usical Notes for the Apple.

No. 72 ■ June 1984 MICRO 3

Page 6: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

NEC PRINTERSNEC 2 0 5 0 ................................................. *999 .00NEC 3 5 5 0 ................................................ '1 6 7 9 .0 0

PERCOM/TANDOM DISK ORIVES

5 'A " 320K Floppy.....................................*229.005 Meg Hard w/Concroller...............................CALL10 Meg Hard w/Controller............................ CALL15 Meg Hard w/Controller............................ CALL20 Meg Hard w/Controller............................ CALL

AMDEK310A Amber M onitor............................... *169.00□XY 100 R o tte r....................................... *599 .00Color II............................................. .......... *399 .00

AST RESEARCHSix Pak R is ...from .................................... *279 .00Combo Rus I!...from..................................*279,00Mega Rus .from ...................................... *309 .00I/O B us...from ........................................ *139.00

QUADRAMQuadlink....................................................... *479 .00Quacftoard ..as low as............................... *2 8 9 .0 0Quad 512 Rus..as low as.........................*249 .00Quadcolar...as low as..................................*219.00Chronograph ................................................*09 .00Parallel Interface Board............................... *89 .0064 K RAM Chips K it.....................................*59 .00

MICROPRO\AfordS tar/M ailMerge.................................*349.00In foS ta r........................................... . ..,*299 .00SpellStar ................................................... *159.00CalcStar ......................................................*99 .00

MICROSTUFCrosstalk...................................................... *105.00

MICROSOFTMultiprfan................................................ *159.00

ASHTON-TATEdSASE II ................................................... *389 .00Friday!........................................................... *185.00

iu sEasy W rite r II ..................... .................... *249 .00EasySpetler............................................. *119.00Easyfiter .................................................... *2 2 9 .0 0

CONTINENTAL SOFTWARE1st Class Mal/Form Le tte r.........................*79 .00Home Accountant Plus.................. .......... *88 .00

IBMVISICORP

IBM APPLE VisiCalc *159.00VisiCalc 4 *159.00VisiCalc Advanced *269-00VisiWord/Spell *249.00Visitrend/Rot *199.00 *199.00VisiUnk *169.00Visi File *199.00 *169.00VisiSchedule *199.00 *199.00Visidex *159.00VisiRot *135.00VisiTerm *75 00Oesktop Ran *199.00 *169.00Blb .Forecast Model *75 .00 *75 .00StretchCalc *75 .00 *75 .00VisiTutor Calc *59 .00 *59 .00VisiTutor Advanced *75 .00 *75 .00VisiTutor \M rd *2 5 9 .0 0 *59 .00Visi—On Calc *2 0 9 .0 0Visi—On Graph *1 79 00V is i— On W ord »275 00V is i— On Mouse. *159 00V is i— On Host *319 00

pfsIBM APPLE

W rite *09 .00 *79 .00Graph *89 .00 *79 .00Report '7 9 .0 0 *79 .00File *09 .00 *79 .00Solutions’ : as low as *16.00 *16.00

‘ Call On Titles

MONOGRAMOollars and Sense. *109 00

LOTU81-2-3............................................................ *399 .00

PROFESSIONAL SOFTWAREPC Rus/The Boss................................. *349.00

SYNAPSERle Manager................................................. *89.00

SOFTWARE ARTSTX Solver....................................................*109 .00

PRINTERSAXIOM

AT-100 Atari Interface...............................*239.00GP-100 Parallel Interface......................... *199.00AT-B46 Interface.........................................*99 .00

BMC401 Letter Q uality................... ......... .*509 .00BX-80 Oot M a trix ..................................... *269 .00

CENTRONICS122 Parallel ...........................................*299 .00739-1 Parallel..............................................*199.007 39 -3 S e ria l..............................................*249 00

C.ITOHGoriHa Banana.............................................*209.00Prownter 051OP....................................... *379.00Prcwncer 1550P .......................................'5 9 9 .0 0A10 [18 cps)...............................................*569 .008 6 0 0 P .......................................................*929.00F10-40 ....................................................... *999.00F10-55 ..................................................... *1499.00

COMREXComW nter || Letter Quality.................... *499 .00

DIABLO6 2 0 Letter Quality .............................. *949 .006 3 0 Letter Quality................................*1749 00

DAISYWRITER2 0 0 0 ...................................................... *9 9 9 .0 0Tractor Feed................................................ *109.00

EPSONMX-BOFT, MX-100, RX-00, PX-0OFT.

FX-80, FX-100 ............................................ CALL

IDSPrism 00 ..For Configurations ..................CALLPrism 32 ..For Configurations ...................CALL

M A N N E S M A N TALLY1 6 0 L .............................................................*509 .001 0 O L ........................................................... *799.00Sptnt 8 0 ..................................................... *309 .00

MBC-550...............CALLMBC-555...............CALLMBC 1100............................................... *1499.00FDD 3 2 00 -320K Orive.......................... *309 .00MBC 1150...............................................*1099.00M8C 1200 ..............................................*1049.00FDD 6 4 00 -640K Orive.......................... *469 .00M8C 1250..............................................*2099 .00PH 5 5 0 0 P rin te r......................................*599.0C

^ S A N Y O

APPLE/FRAIUKLIN DISK DRIVES

MICRO-SCIA 2 .................................................................*219.00A 4 0 ............................................................. *299 .00A 7 0 .............................................................. *319.00C2 Controller................................................*79.00C47 Controller.............................................*09.00

RANAElite 1 .......................................................... *279.00Bite 2 .......................................................... '3 0 9 .0 0Bite 3 .......................................................... *569.00

APPLE lie STARTER PACK64K Apple lie, Disk Orive & Controller, 80 Cdumn

Card, Monitor II & DOS 3.3 COMPLETE......................................... CALL

ACE 1000 Color Computer....................... ..CALLACE Famrfy Pack System............................. CALLACE PRO PLUS System............. ................. CALLACE 1200 Office Mgmt. System................. CALL

"N o t lie Expensive"

TERMINALS9 1 4 ..............................................................*569 .009 2 4 ......................................................... '6 0 9 .0 09 2 5 .........................................................*739 .009 5 0 .............................................................*929 .009 7 0 ........................................................... *1 0 3 9 0 0

COMPUTERSTeleport Portable............................................ CALL8 0 0 A .........................................................*1099.000 0 2 *2699 .008 0 3 ........................................................... *1949.008 0 2 H ........................................................*46 9 5 .0 08 0 6 /2 0 ....................................................*49 9 9 .0 08 1 6 /4 0 .....................................................*9199.00160 2 ..................................................... *3 3 9 9 .0 0160 3 .............................................................. CALL

f t T eU M deo

ANCHOR MODEMS

NEC2 0 1 0 /2 0 3 0 ................................................ *099 .008 0 2 3 Oot M atrix ......................................*379 .008 0 2 5 Oot M atrix ......................................*669 .003510 Serial/Letter Quality.....................*1449.003 5 3 0 Parallel/Letter Quality.................. *1499.00771 0 /7 7 3 0 Serial/Parallel.....................*1949.00

OKIDATA02, 83 , 84, 92, 93, 2350 . 241 0 .......... CALL

SM ITH CORONATP-2 ..........................................................*399 .00Tractor Feed................................................ *119.00

SILVER REED5 0 0 Letter Quality.................................... *469 .005 5 0 Letter Quality.................................... *699 .00

STARGemini 1 0 X ................................................ *299 .00Gemini P15X ............................................ '3 9 9 -0 0Oelta 1C...................................................... '5 5 9 .0 0Serial Board...................................................*75.00

TOSHIBA1350 ........................................................*1699 .00

TRANSTAR1 2 0 P ........................................................... *49 9 .0 01 3 0 P ........................................................... *689 .003 1 5 C o lo r................................................. *499 .00

APPLE INTERFACE CARDS & BUFFERS

Choose from PKASO, Orange Micro, MPC. M icroM ax, Tymac. Quadram & PracticalPeripherals. PRINTER CABLESare avalable for m ost aM computers on the market. W e supply aH your computer needs.

PAPER SUPPLIES1000 shts. 0V$x11 Tractor P aper..............*1 9 "1000 shts. 14V&X11 Tractor Paper.........* 2 4 "1 or 2 " Address Labels....................................* 9 "

Vdksmodem.......... ................ ......... '5 9 .0 0......... *79 .00

Mark VII (Auto Ans./Auto Oial]...... ....... *119.00Mark XII [1200 Baud]................... .. .*299 .00TRS-00 Color Computer................ ......... *99 .009 \M t F^jwer Supply ................. ............*9 .00

HAYESSmartmodem 3 0 0 .......................... ..... *209 .00Smartmodem 120 0 ........................ ...... *499 .00Smartmodem 1200B ..................... ...... *449 .00Micromodem lie.......... .................... ...... *269 .00Micromodem 100............................ .... '2 9 9 .0 0

......... *89 .00Chronograph...................................... .......*199.00

NOVATIONJ-C at.................................................. ......... *99 99SmartCat 103 . . ..... *179.00SmartCat 1 0 3 /2 1 2 ....................... .. *399 00A jtoC at ............ ........*219.00212 AutoCat..................................... ... *549 .00Apple Cat II................. . . .. '2 4 9 .0 0212 Appte Cat.............................. .. ..*569 .00Apple Cat 212 Upgrade................. ... . *309 .00C a t..................................... .. . .'1 3 9 .9 9

ZENITHZT-1 ........................................... . ..*339.00ZT-10.................................................. ..... *309 .00ZT-11 .......................................... ..... *369.00

AMDEK3 0 0 Green.....3 0 0 Amber 310 Amber....Color 1 .........Color 1 Rus..Color 2 .........Color 2 Rus ..

MONITORSPRINCETON GRAPHICS..*149.00

...*159.00 ..*169 00 .. '2 7 9 .0 0 ..*299 .00 .. '3 9 9 00 ...*419.00

Color 3 ......................... .......................... *349 .00Color 4 ........................................................*699 .00

BMC12” G reen....................................................*00 .9912" Green Hi-Res...................................... *119.999191- 13 " Color........................................*249 .00

GORILLA12” Green...................... ..............................*BB.9912" Amber....................................................*95 .99

NECJB 1260 Green................. ........................*109.00J8 1201 Green......................................... *149.99JB 1205 Amber........................................*159.99JC 1215 Color.......................................... *269 .00JC 121 6 HGB.......................................... *4 2 9 .0 0JC 1 4 6 0 Cotcr........................................ *3 5 9 .0 0

HX-12 RG8..................................... ..... *519.00

SAKATA1 0 0 ....................................................... . . '2 6 9 .0 0

TAXAN210 C okr RG8.................................. ....*299.0040 0 Med-Res RGB .................. ..... *319.00415 Hi-Res RGB............................... ...*439 .004 2 0 Hi-Res RGB [IBM ].................... ...*409 .00100 12" G reen ................ .... *125.00105 12" Am ber................. .. *135.00

USIPi 1. 9 " G reen .......................... .. . ........*99.99Pi 2, 12" Green . ..................... . .. *119.99Pi 3, 12" A m b e r ............................. . . ..*149 99Pi 4, 9 " Amber................................. *139.991400 Color......................................... ....*269 .99

QUAORAMQuadchrome 0 4 0 0 ........................... .. *5 4 9 .0 0

ZENITHZVM 122 Amber ......................... ..... *109.00ZVM 123 Green............................... ........*09.99ZVM 135 Cotar/RGB........................ ..... *469 .99

east 800-233-8950In PA call [7 1 7 ]3 2 7 -9 5 7 5 ,D e p t 40 515

Order S tatus Number: 3 2 7 -9 5 7 6 Customer Service Number: 3 2 7 -1 4 5 0 477 E. 3rd St., Williamsport, PA 17701

CanadaOntario/Quebec

800- 268-3974O ther P rovince8800-268-4559

In Toronto call p ie^S -O S ee.D ep t 4051 5 Order Status Number: 828-0866

2505 Ounwvin Drive, Unit 3B Mississauga, Ontario, Canada L5L1T1

west800-648-3311In N V call (702]58a-5654,Dept. 40 5 1 5

Order S tatus Number: 588-5654 P.O.Box 6689

Stateline, N V 89449No risk, no deposit on C.O.D. orders and no waiting period for certified checks or money orders. Add 3 % (minimum *5 ) shipping and handling on all orders. Larger shipments may require additional charges. N V and PA residents add sales tax. All items subject to availability and price change. Call today fo r our catalog.

Page 7: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

KoalaTechnologies Corporation

KOALA PADSAtari [Disk]..A tari [ROM]C-64 [Oisk].C-64 [ROM],IBMApple/Franklin

KOALA SOFTWARE........ CALL

commodoreCBM 8 0 3 2 ............................ *5 9 9CBM 4 0 3 2 ............................*599

MSO S01 Disk Drive..............................*349 .00MSD SD2 Disk Drive..............................*599 .00CBM 8 0 9 6 ...............................................*8 6 9 .0 0C8M 9 0 0 0 ...............................................*999 .00B 1 2 B -B 0 ................................................... *769 .008 0 3 2 to 9 0 0 0 Upgrade.........................*269 .002031 LP Disk Onve............................... *299 .008 0 5 0 Oisk Onve......................................*949 .008 2 5 0 Disk Drive...................................*1 1 9 9 .0 04 0 2 3 P rin te r............................................ *379 .00802 3 P rin ter............................................ *569 .006 4 0 0 P r in te r ........................................ *1399 .00Z—R AM ..................................................... *499 .00Silicon Office..............................................*699.00The Manager ..........................................*199 .005o ftR O M .................................................. '1 25 00VisiCaic....................................................... *159 .00

PROFESSIONALSOFTWARE

W ord Pro 2 Plis .....................................*159 00W ord Pro 3 Rus......................................*109 .00W ord Pro 4 Plus/5 Plus...each.......... *279 .00InfoPro........................................................ *1 7 9 .0 0Acfrninistrator........................................... *399 .00Power.................. ......................................... *79 .00

SX-64PORTABLE*839

VIC 2 0 ................................... CALLCBM 6 4 ...............................*199C1541 Oisk Drive.................................... *249 .00C1530 Datasette .......................................*69 .00C 1520 Color P rin te r/R o tte r..................*1 2 9 .0 0M-B01 Dot M atrix P rin te r.....................*2 1 9 .0 0C 1526 Oot M atrix/Serial....................... *2 9 9 .0 0C 1702 Color M onitor.............................. '2 4 9 .0 0C1311 Joystick..............................................»4.99C l 31 2 Paddles............................................ *11 .99C 1600 VIC Modem.................................... *59 .00C 1650 Auto Modem............................... *89 .00 .Logo 6 4 ..........................................................*49 .00Pilot 6 4 ..........................................................*39 .00W ord Pro 64 Plus....................................... *59 .00Parallel Printer Interface........................... *4 9 .0 0Caic Result 6 4 ..............................................*65 .00Caic Result Easy..........................................*39 .00Codewriter 6 4 ..............................................*75 .00Quick Brown Fox..........................................*49 .00MCS 801 Color P r in te r .........................*4 9 9 .0 0OPS 1101 Daisy P rin te r.........................*45 9 .0 0Mage Voice Speech Module...................... *54 .00Desk Organizer Lock................................... *49 .00Vidtex Telecommunications......... ............*34 .95

We stock a full inventory of software for Commodore, such as: Artworx, Broderbund, Commercial Data, Creative Soft­ware, EPYX, HES, MicroSpec, Nufekop, Romox, Sirius, Synapse, Thorn EMI, Tronix, UMI, Victory, Spinnaker, Rain­bow & Timeworks!___________________________________

INFOCOMZork 1,2,3 [AT/AP/CBM/IBM].....Deadline [AT/AP/CBM/IBM].........Enchanter (AT/AP/CBM/IBM) ...Planet fall (AT/AP/CBM/IBM)........W itness [AT/AP/CBM/IBM]......Starcross [AT/AP/CBM/IBM]... .

ATARISOFTIBM/AP C64/VIC

PacMan *29-99 *37 .99

*32.95 Centipede *2 9 9 9 '3 7 .9 9

.*32.95 Oig Dug *29 .99 *37 99

*32.95 Donkey Kong * 2 9 9 9 '3 7 .9 9Defender *29 99 •3 7 .9 9

*29.00 Robotron '2 9 .9 9 '3 7 99S tar Gate *29.99 '3 7 99

CMO’S PORTABLE CORNERm

HP 71B •499”

4 1 CV..................................*1 9 94 1 CX................................... * 2 4 9 "HP 1 0 C ....................................................... *51 .99HP 11C .........................................................*69 .99HP 12C .........................................................*8 0 .9 9HP 15C .........................................................*80 .99HP 16C .........................................................*08 .99HP 75C .................................................. *749 .99HPIL Module.................................................*90 .99HPIL Cassette or P r in te r .......................*359 .99Card R eader.............................................*143 .99Extended Function Module......................... *63 .99Time Module .............................................*63 .99

TIMEX/SINCLAIRTimex/Sinclair 1 0 0 0 ............................................... . CALLTimex/Sinclair 2 0 8 6 ......................................CALL1 6K M em ory.......... . ...............................*25 002 04 0 Printer ........................................... *99 .99VuCalc..........................................................*17 99Mindware P rin ter....................................... *99 .99

NECPC-0221A Thermal Prin ter................*1 4 9 .9 9PC-0201 A Data Recorder...................... *99 00P C -0201-06 8K RAM C hips................ *1 0 5 .0 0PC-8206A 32K RAM Cartridge...........*32 9 .0 0

.•165”

...* 8 8 ”

......... *1 2 0 .9 9*171 99 .*93 99

*1 3 4 99 .. *2 9 .9 9

PC-1500A.....PC-1250A..........CE-125 Printer/Cassette............CE-150 Color Printer/Cassette.CE-155 0K RAM .........................CE-161 16K RAM........................CE-500 ROM Library .................

HOME COMPUTERS

ATARI 1WHILE SUPPLIES LAST!

ATARI 600XL *149

101 0 Recorder......................................... '7 4 .0 0102 0 C dor Prin ter.......... .......................'2 4 9 .0 01 02 5 Dot Matrix f t in te r .......................*349-001 02 7 Le tter Quality................................*30 9 .0 01 0 3 0 D irect Connect Modem...............'1 1 9 .0 01 0 5 0 Oisk Orive...................................... *33 9 .0 0CX30 Paddle................................................'1 2 .0 0CX40 Joystick ..each....................................*8 .00CX77 Touch Tablet..................................... *64 .00CX80 Trak Baff............................................*48 .00CX85 Keypad............................................'1 0 5 -0 04 8 8 Commuricator II.............................. *22 9 .0 04 0 0 3 Assorted Education...................... '4 7 .0 04011 Sta- Raders................................... *33 004 0 1 2 Missile Command............................*29 .004 0 1 3 Asteroids.......................................... *29 .005 0 4 9 VisiCalc........................................... *1 5 9 .0 07 0 7 9 Logo................................................... *79 007101 Enterta iner...................................... *69 .007 1 0 2 Arcacfc Champ................................. *75 .006 0 2 6 Oig Dug.............................................*33 .008 0 3 0 E.T Phone Home.. .. ...................*33 .000031 Donkey Kong................. . .*39 .000 0 3 3 Robotron.. .. *35 006 0 3 4 Pole Position *39 008 0 3 6 Atari W r ite r ................................ *79 .008 0 4 0 Donkey Kong, J r. . ................... *39 .000 0 4 3 Ms. Pacman.....................................*39 006 0 4 4 Joust................................................ *39 .00

DISKETTESMAXELL

5 / 4" M O -1............................................... *29 .005 ’/«” M O -2............................................... *39 000 - F0-1 [SS/DO].................................. *39 000 " FO-2 [0 S /0 0 ].....................................*49 .00

VERBATIM5 1/ * " SS/OO..............................................*26 .995V4” D S /0 0 ........................................... *36 99

ELEPHANT5 V i" SS/SO..............................................*18 495 % " SS/DO................................................. *22 .995 V i” D S /0 0 ................................................. *28 .99

HEAD5 /> " Oisk Head Cleaner.........................*14 .99

DISK HOLDERS INNOVATIVE CONCEPTS

Rip-n-Rle 1 0 ....................................................*3 .99Rip-n-Fle 5 0 ............................................*17 .99Rip-n-Rle [4 0 0 /8 0 0 ROM]Hoider .. .. *17 99

800XL......................*2991200XL.................. CALL1400XL.................. CALL

PEflCOM

U KAtari Letter Perfect D isk(40/80], . A tari Letter Perfect RGM(40 col].. A tari Letter Perfect ROMfSO col] A tari Data Perfect ROM [0 0 col] . A ta ri Spell Perfect Disk ....A tari U tility /M alM erge.........Apple Letter Perfect.......... . .Apple Data Perfect...................Apple LJK Utility......................Apple Lower Case Generator..

*79 .99 *79 .99 •79 99 '7 9 .9 9 *59 99 *21 00 *9 9 .0 0 *75 .00 ..*21 00

.*19 .00

AT 80-S1 .............................................. •369 .00AT 08 -A 1 ............................................... '2 5 9 00AT 08-S1 PO...................................... *449 .00AT 8 0 -D O A ........................................... *119 .00RFD 4 0 -S 1 ........................................... . '4 4 9 00RFD 40-A1 .......................................... '2 6 9 .0 0RFO 40 -S 2 ............................................. '6 9 9 .0 0RFD 44 -S 1 ....................................... '5 3 9 .0 0RFD 44-S2 ........................ *869-00

TEXAS INSTRUMENTSTX 99-S1 ............................................ *2 7 9 .0 0

RANA1 0 0 0 ....................................................... •3 2 9 .0 0

TRAKAT-D2 ............................................ *389 00

INDUSGT-Dnve ............................................... •3 7 9 0 0

M EM ORY BOARDSAxlor 3 2 K .............................................. •59 .00Axlor 4 8 K ............................................... ...*99 .00Axlon 12BK *299 00Intec 32K .............................. . . '5 9 .0 0Intec 48K. . . . *04 00(ntec 6 4 K .................. .. '9 9 .0 0Intec Real Time Clock........................... *2 9 .0 0

ALIEN VOICE BOXA t a r i ...................................................... •1 1 9 .0 0Apple .................................................... •1 4 9 .0 0

CONTROLLERS &JOYSTICKS

W ICOJoystick .................................................. •2 1 .9 93-way Joystick .. ..................... *2 2 .9 9Famous Red Ball................................... .. '2 3 .9 9Power Grip............................................. . *21 .99BOSS Joystick..................................... . *17 99ATARI/VIC Trak B a ll........................... •3 4 .9 9Apple Trak Ball..................................... *5 4 .9 9Apple Adapter....................................... '1 5 99Apple Analog..................... *37 .99

KRAFTAtari Single Rre ................................. •1 2 99Atari Switch H i t te r ............................ *1 5 .9 9Apple Paddles............................... ... *34 .99IBM Paddles................................... ... *34 99IBM Joystick ................................. . *46 99

AMIGA3 1 0 0 Single........................................ *13 .993101 Pair .............................. *19 .99Joyboard .............................................. •37 99

TGAtari Trak Gail. . . ......... * 4 7 9 9Apple Joystick . *47 99Apple Trak Ball...................................... ... *4 7 .9 9

east800-233-8950

CanadaOntario/Quebec

800- 268-3974west

800-648-3311In N V call (7 0 2 )5 8 8 5 6 5 4 ,Dept 40515

Order S tatus Number: 5 8 8 -5 6 5 4P.O.Box 6 6 8 9 1 ' ' ’i

S tateline, NV 8 9 4 4 9

In PA call [7 1 7 ]3 2 7 -9 5 7 5 ,D e p t. 4 0 5 1 5 £ ^ S S 2 5 S S 4 0 5 1 * In NV call (7 0 2 )5 8 8 -5 6 5 4 ,Dept 40515O rder S tatus Number: 3 2 7 -9 5 7 6 ''5 “ * « “ » dumber: 5 8 8 -5 6 5 4 / W

Customer Service Number: 3 2 7 -1 4 5 0 aS Q5 D u n lin Orivs, Unit 3B P .O .B O X b b o a i . \477 E. 3rd St., Williamsport, PA 17701 Mississauga, Ontario, Canada L5L1T1 Stateline, N v 8 9 4 4 9 \CANADIAN ORDERS: All prices are subject to shipping, tax and currency fluctuations. Call for exact pricing in Canada. —INTERNATIONAL ORDERS: All shipments outside the Continental United S tates must be pre-paid by certified check only. Include 3 % [minimum *5 ] shipping and handling.EDUCATIONAL DISCOUNTS: Additional discounts are available to qualified Educational Institutions.APO S FPO: Add 3% [minimum *5] shipping and handling.

Page 8: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Publisher/Editor-in-chief

Associate Publisher.Cindj^Kochet „

Producfion Manage'Jennifer Collins

Technical Editor-'' Mark S Moiariq

Technical EditorMike Howe

Advertising MaWilliam G. York

Dealer Sales ManagerLinda Hensditl

Circulation MfanagerLinda Hensdill

Office ManagerPauline Giartf

Shipping DirectorMane Ann LeClair

ComptrollerDonna M Tripp

AccountingLouise Ryan

Contributing EditorsCornells Bongers

Phil Daley David Malmberg.

John Steiner Jim Strasma

Paul Swanson Richard C Vife. Jr

Loren Wright

MICRO is published monthly by MICRO, Chelmsford, MA 01824.'itxond Class. postage paid a r

. ii in . i ' l M\ U1«M aiiiii iiMfuanal m.nl mg officesUSPS Publication Number. 483470- V ‘—<ISSN 0271-9002.Send subscriptions, change of address,. USPS Form 3579, requests for back issues , and all othe fulfillm ent questions, t o : .

P O Box 6502 Chelmsford, MA 01824

or ta ll 617/256-3649 Subscription Rates: (per year}- •U S $24 00 or $42 00 for t«o i ears roreiqrt surface mail $27 00 Air mall Europe $42 00 ■ •Muxico Central America. Middle East, • N> ith Africa. Central Aftica $4800 -;- * rf^uth America.'South Africa, Far f Au train. New Zealand $72JOO

Copyright © tgSjT by MICROL;. All Hichts Reserved.- ’.‘V

/AlCftOfor the Serious Com puterist

J U WE 198420 Musical Notes for the

ApplePhillip Bowers

23 Under the C64 ROMJohn A. Winnie

26 A Better Random Number GeneratorH. Cem Kaner and John R. Vokey

36 ControlM itche ll Esformes

43 Sixteen Bit 68000 SupermicrosPaul Lamar and Richard Finder

47 Programming with MacrosPatricia West erf ield

52 Useful FunctionsPaul Garrison

56 Apple lie Supplement to “What’s Where in the Apple”

Phil Daley

72 Inside the CIARalph Tenny

With five octives and rhythm, too, you can play old tunes or compose new.

Gain BASIC memory without losing program messages using RAM under ROM.

A better version for simulations, games and gambling, forecasting.

A program for assembly code efficiency, or statistics, step/trace debugging and more.

Is this the 6502 of the 80’s? What will it mean for your computing plans?

Make your assembly language more efficient, cleaner, easier to debug.

Save time and mathematical aggrevation with a compilation of defined function.

PEEKs, POKEs, CALLS, etc. specific to the Apple lie, from Micro’s best selling book.

Advantages of the shift register on the CIA, and direct expansion from the microprocessor bus.

Page 9: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

KJO. 72Product Reviews

15 Autoterm A communication package with added features for the CoCo.

18 Advanced X-tended Editor

An Applesoft line editor for BASIC program development.

15 SuperText Professional

The most recent version of this powerful Apple word processor.

18 The Oddsmaker An “ Electronic Bookie” for the Apple or Commodore.

17 Super-Text Professional Word Processor

A simple business- powered processor for the Atari.

18 BASIC Tutor A course in BASIC programming on the Apple.

17 G.A.L.E. An Applesoft Line Editor with the most complete set of commands.

19 Card? A Commodore parallel printer interface for text/graphics.

17 LOGO A fairly extensive implementation of the language for Commodore 64.

Departments

2 Highlights 75 Catalogs3 Editorial 77 Books

8 Feedback 78 Question Mark

10 Spotlight: Acorn 79 Listing Conventions

15 Reviews 80 Advertiser Index

Page 10: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

At last! . . . A dual 6522 versatile interface adapter (VIA) board

for the Commodore-64.The 6522 V IA , long the preferred

input/output chip for 6 5 0 2 m i­crocomputers, is now available for the C -64 . 6522 programming techniques, covered in many available books, can now be applied to the C -64 for even the most sophisticated real-time control applica­tions. Board allows full use o f the IRQ interrupt. W hen com bined w ith the C -64 ’s memory capacity, it provides an extremely powerful yet cost-effective de­velopment system and controller in one package. Includes extensive application notes and programming examples.

Up to four boards can be connected to­gether, providing sixteen 8-bit ports. Order Model 64IF 22 , $169 fqr one, post­paid USA. Each additional $149.

Complete reconstructed Assembly Lan­guage source code for the C-64’s BASIC and

KERNAL ROMs, all 16 K!Extensively com mented and cross-

referenced. Far more than a mere “ memory map" o f useful locations, this book really does tell all. An incredible time-saver in effective C-64 programming and understanding. Order C-64 Source $29.95, postpaid USA.

SCHNEDLER SYSTEM S1501 N. Ivanhoe, Dept. M6

Arlington, VA 22205 Telephone orders/information: (703) 237-4796 VISA MASTERCARD

ATARI 48K * TRS C/C 32K COMMODORE 64

747 FLIGHT SIMULATOR

A C T U A L S C R E E N P H O T O G R A P H

Superbly rea lis tic in strum enta tion and p ilo t's view in life like s im ula tion which includes emergencies such as engine fires and system s failures. This program uses high resolu tion graphics to the fu ll to produce the m ost rea lis tic flig h t-d e ck d isp lay yet seen on a home com puter. There are 21 real d ia ls and 25 other in d ica to rs . Your co n tro ls opera te th ro tt le , a ile rons, e levators, flaps, s la ts , spo ile rs , landing gear, reverse thrust, brakes, etc. You see the runway in true perspective. Uses jo ys ticks and includes options to s ta rt with take-off or random landing approach. A real s im ula tion , not just another game! Cassette only, $27.95 (add 6% in Calif-)- Sole U.S. d is tr ib u to r fo r D.A.C.C. Ltd., England.

F. AshtonP.O. Box 7037

Chula Vista, CA 92012

Dear Editor:

My programming abilities are just enough to get me into trouble. But I’ve been following your series on graphics and hope you can help me.

I want to graph a time series of data as line graphs. Data is: High, low, close, date and I want to display it in the form:

H

L

I also want to label the axis as to price and time:

Then overlay a moving average of the data:

" S .

-I—I—I—I—I—I—I-1(1 2/1 3/1 DATE

Possibly adding a second series of data on the same chart, requiring a third label on axis:

50--

45--

40--

35--

3 0 -

2 5 -

20 - -

f I I---1—I---1—I—I---h

--100

3n DATE

The kicker is that data may cover an extended period of time (e.g. 200 days) and for clarity maybe only 50 days

could be displayed at a time. So, I want to be able to scroll back and forth, timewise (left, right) and change the text labels as this occurs, stopping as necessary and then dumping the screen to a printer.

Big order? That's why I need help.

Harvey L. Taback Vancouver B.C., Canada

68000: The 6502 of the '80’s

Dear Editor:

It's a real pleasure to be writing to you using the Amdek monitor that you and your staff awarded me for "Country 5 ." I was really quite elated the day I received the registered le tte r announcing my good fortune in the Micro graphics contest. Thank you all very much for the recognition.

I've been a follower of Micro since the days of the KIM-1 computer which served as my training wheels in the world of 6502 programming. In fact, I still have the motherboard and proto board from the Computerist holding the ol' KIM system together.

As a reader of Micro I'd like to take this opportunity to make a suggestion that I believe will benefit many present Micro followers and perhaps attract a whole new following.

The 6502 obviously has a lot of life left in it. Apple has just introduced the Apple lie and, as you must already know, the Western Design Center in Mesa, AZ is about to release the first full implementation of its 16 bit versions of the 6502 (65802 and 65816]. That's great for all of us die hard 6502 programmers. I understand that Apple and Atari have already ordered a significant number of these chips for evaluation.

I believe, however, that the M o toro la 6 8 000 series of microprocessors will become the 6502 of the 80's. I know that you folks are already 6809 enthusiasts, so I don't expect to run into too much resistance to the idea of supporting another great Motorola product. In fact, I seem to recall a 68000 series of articles around the end of 1982. What happened?

I've begun programming the 68000 using the QPak-68 coprocessor board for the Apple II. The QPak-68 is a complete 68000 development package from QWERTY, Inc. It's based on the

8 MICRO No. 72 - June 1984

Page 11: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

68008 and is a superb product. Anyway, my initial reaction to the 68000 has been nothing if not enthusiastic. It's almost like working in a high level language after so many years of being zero page bound and, indeed, 8 bit bound with the 6502.

As you know, Apple has adopted the 68000 family of processors and Sinclair is about to unleash a $500 computer based on the 68008. There is no magazine that I know of that is supporting the 68000 as of yet. Why not do the world a favor and be the first to offer your readers a pathway into the current generation of high performance microprocessors.

I must sound like a member of the Motorola marketing team after that last paragraph. No, in fact I'm a relative newcomer to the 68000, but I see a vast future for this chip family and apparently an increasing number of computer systems designers do also. How about putting the question to your readers and find out how they feel about Micro supporting the 68000.

Once again thank you for the wonderful validation in selecting my Apple graphic as the first prize entry in the Apple II category.

Thomas WilsonSan Rafael, CA

Editor’s Note: The staff o f Micro also feels that the 68000 chip m ay well be the 6502 o f the '80's. We need to know our readers ’ interest in a regular 68000 column and feature articles on this fam ily from time to time. These would be in addition to (not in place of) our other chips. Please take a few minutes to answer the Reader Survey Questions on the card in this issue; we will analyze your responses carefully to determine the direction you want Micro to follow .

Medical Programs

Dear Editor:

Several months ago I wrote to you asking if any of your readers would be interested in contributing programs to a book, “ M icrocomputer Programs In Medicine. ” The response from your readers was astounding.

I had letters, post cards, packages of discs and printouts from all over America, various parts of Canada,

England, Ireland, South Africa, Saudi Arabia, Israel, Australia, Malaysia and even one from mainland China.

I had phone calls in the middle of the night from foreign parts apologizing for the time zone difference, but asking for details of the impending book.

As a result, the programs have now been published in book form in two volumes. Volume I contains scheduling and appointment programs, direct patient billing and accounts receivable, patient file retrieval, simple statistics including standard deviations, etc., graph drawing and curve fitting, numeric and alphabetic sorting. Volume II contains programs on patient h isto ry tak in g and h isto ry summarization, respiratory function, pediatric growth percentile calculation, bar graph drawing, analysis table making, using a VisiCalc template, obesity advisory program for weight loss, CHI square statistics and analysis of variance.

The book is now in print and is available from the publishers,

Com puter M edica Corporation, Medical Software Company, 328 Main Street, Center Moriches, N.Y. 11934, at $80 per volume.

I must thank your readers again for the fantastic response.

Derek Enlander, M.D.New York, NY

AtCftO

Don’t Forget to Send Your Reader Survey. Do

It Today!

OS9APPLICATION

SOFTWAREACCOUNTS PAYROLL

PAYABLE GENERAL ^ jm

a o q q l e d g e rY m W W w i th

CASH SMALLACCOUNTS JOURNAL BUSINESS RECEIVABLE £ Q Q Q INVENTORY

$299 $299COMPLETE DOCUMENTATION $19.95

OS9 & BASIC 09 ARE TRADEMARK OF MICROWARE. INC. & MOTOROLA CORP.

SPECIALTY ELECTRONICS

(405) 2 3 3 -5 5 6 4 2 1 1 0 W . WILLOW - ENID, OK 73701

No. 72 - June 1984 MICRO 9

Page 12: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

AcornMicrocomputer

SystemDistributor

Acom Computers Corporation 400 Unicom Park Drive Woburn, MA 01801

Introduction

The Acom microcomputer was first developed in response to an invitation issued by the BBC to computer firms to compete in creating a new micro that would meet their specifications. The contract was awarded to Acom, which, at the time, was only five years old.

Various features, in particular a Local Area Networking capability of up to 254 Acorns, led to the acceptance of the Acom as an educational tool. Presently more than 85% of English schools use the Acom. The Acom has made its entrance into the U.S. market with a few model systems established, the most recently publicized being the school system of Lowell, Massachusetts, where a network of Acoms is serving grades K-12.

Memory and Optional Expansion Features

The Acom has a series of co-processors that allow optional expansion of the standard 64K of memory. The Operating System is 16K built-in ROM, 16K built-in Word Processor |VIEW), built-in ROM BASIC interpreter, 32K RAM for User Programs. The co-processors enable the addition of three expansion features:1) a 3MHz 6502 (includes an additional 64K RAM): this will run any program faster with more space available to the user2) a Z-80B with 64K RAM: 'the software with this unit allows CP/M programs to be run with more memory than a normal CP/M environment. In addition, the main user program is left free to do calculations, leaving the BBC Microcomputer to deal with graphics, printers, clock, floppy disk, etc.'3) a NS 16032: a 16 bit machine with 32 bit internal architecture, can be used with up to 16 Megabytes of RAM.

The Acom has a built-in (ROM) BASIC interpreter, which also includes a 6502 Assembler. This permits Assembly Language to be mixed in the middle of a BASIC program. All the standard features and statements are available with some nice enhansions such as local variables, subroutines that pass parameters and recursion.

Also built into ROM is a 16K word processor called VIEW. This package is of professional quality featuring local and global control, search, change, replace, automatic page numbering, etc.

Graphics

When first viewing the Acom one immediately notices the high quality graphics; an RGB Video is used to display the high resolution screens. The Acom uses a number of display modes, including 640 x 200 for 2 color graphics (80 x 25 text), 320 x 200 for 4 color (40 x 25 text), and 160 x 200 for 16 color graphics (20 x 25 text), to list a few. There are a number of commands which facilitate graphics control, including the familiar commands such as PLOT, DRAW, and MOVE.

Sound/Music

To generate sound and music the Acorn employs four 'channels.' Through the use of SOUND and ENVELOPE commands a great deal of control is available to the user, and a full five octave range gives plenty of room to work in. The ENVELOPE offers a great deal of control with six parameters, governing the attack, decay, and release of a note.

Voice Synthesis

The Acom also has a built-in voice synthesizer, including a Speech Processor and a PHROM (Phrase Read Only Memory). The Speech Processor is one made by Texas Instruments, the TMS 5220. In the PHROM chip is stored 206 ready-made words, and other PHROMs fitted with different words will be available in the future. The speech system can be accessed from BASIC and Assembly language.

Interfaces

The Acorn includes a number of interfaces: Floppy Disk Interface up to 1 MB unformatted; RS423 Serial Interface (RS232 enhanced for speed and distance); Software Selectable Baud Rates between 75 and 19,200 Baud; 8-bit 'Centronics-type' parallel printer port; four 12-bit Analog Input Channels -input voltage range 0-1.8V, 10ms conversion time for each channel; standard audio cassette for low-cost storage.

10 MICRO No. 72 • June 1984

Page 13: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Peripherals

Peripherals supported include: 5 1/4-inch floppy disk drives with capacities of 400K-800K formatted; monochrome, color (RGB, Composite Video) and TV; dot matrix and daisy-wheel printers, game paddles and joysticks.

Keyboard and Physical Description

The 73-key Qwerty keyboard is cleanly laid out, including10 User Definable Function Keys. It has a nice touch and has the break key safely put out of normal reach. The size is 16"W x 13 1/2''D x 2 3/4''H, weighing in at 16 lbs. The dual disk drive is compact and neatly designed, taking the space of a normal-sized single disk drive.

ancient geography. The only problem is that it is fun and addictive. Plato's Cave is an introduction to the relation between evidence and inference (using a Platonian approach). The subjects covered by Krell and other manufacturers of Educational Software is quite varied, developed for all levels and covering subjects from color to transpiration to gas chromatography.

Price

The price breakdown is as follows: for the basic microcomputer the price is $995.00; the 800KB dual disk drive is $995; a 400KB (double sided) single disk drive is $545; a 200KB (single sided) single disk drive is $395; a RGB high resolution monitor (12 inch) is $595; Monochrome monitor (12 inch) amber or green is $195,

Software

The software available for the Acom is growing every day. Although all of the software that is presently in use in England isn't available here, there is certainly enough to keep anyone busy. There are packages covering business applications, graphics, languages and a plethora of educational software. American companies have been enlisted in converting some of the English software, in particular the education packages, for use in the United States. The name that stands out in this area is Krell Software Corporation (1320 Stony Brook Road, Stony Brook, NY 11790). The most well known of their software are Alexander the Great and Plato's Cave. Alexander the Great is a cross between Risk and Scrabble, developing word and arithmetic skills as well as touching upon

both the RGB and Monochrome include cables. Prices for the additional co-processors are not available at this time.

Conclusion

Although the past emphasis has been in the area of education, the Acom has just begun to conquer the many fields that it is capable of handling. Given its memory, telecommunication, graphic and other well developed features it certanly merits consideration for home or business use.

JMCftO

No. 72 • June 1984 MICRO 11

Page 14: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

80 COLUMN PRINTER SALE—$ 149.00*

COM-STAR T/FTractor

FrictionPrinter

15 Day Free Trial -180 Day Immediate Replacement Warranty• Lowest Priced, Best Quality, Tractor-Friction Printers in the U.S.A.

• Fast 80-120-160 Characters Per Second • 40,46,66,80,96,132 Characters Per Line Spacing• Word Processing • Print Labels, Letters, Graphs and Tables • List Your Programs

• Print Out Data from Modem Services • “The Most Important Accessory for Your Computer”

•STX-80 COLUMN PRINTER—$149.00

Prints full 80 columns. Super silent operation, 60 CPS, prints Hi-resolution graphics and block graphics, expanded cha rac te r set, exce p tio na lly clear characters, fantastic print quality, uses inexpensive thermal paper! Best thermal printer in the U.S.A.! (Centronics Parallel Interface).

"DELUXE COMSTAR T/F 80 CPS PRINTER—$199.00

The COMSTAR T/F (Tractor Friction) PRINTER is exceptionally versatile. It prints 8 V x 11” standard size single sheet stationary or continuous feed com­puter paper. Bi-directional, impact dot matrix, 80 CPS, 224 characters. (Cen­tronics Parallel Interface).

Premium Quality—120 CPS COMSTAR T/F SUPER-10X

PRINTER—$289.00COMSTAR T/F (Tractor Friction) SUPER- 10X PRINTER gives you all the features of the COMSTAR T/F PRINTER plus a 10” carriage, 120 CPS, 9 x 9 dot matrix w ith double strike capability for 18 x 18 dot matrix (near letter quality), high resolution bit image (120 x 144 dot matrix), underlining, back spacing, left and right margin settings, true lower decenders w ith super and subscripts, prints standard, italic, block graphics

and special characters, plus 2K of user definable characters! The COMSTAR T/F SUPER-10X PRINTER was Rated No. 1 by "Popular Science Magazine." It gives you print quality and features found on printers costing twice as much!! (Cen­tronics Parallel Interface) (Better than Ep­son FX 80).

Premium Quality—120 CPS COMSTAR T/F SUPER-15V’

PRINTER—$379.00COMSTAR T/F SUPER 15'A” PRINTER has all the features of the COMSTAR T/F SUPER-10X PRINTER plus a 15%” car­riage and more powerful electronics components to handle large ledger business forms! (Better than Epson FX 100).

Superior Quality SUPER HIGH SPEED— 160 CPS

COMSTAR T/F 10” PRINTER—$489.00

SUPER HIGH SPEED COMSTAR T/F (Tractor Friction) PRINTER has all the features of the COMSTAR SUPER-10X PRINTER plus SUPER HIGH SPEED PRINTING— 160 CPS, 100% duty cycle, 8K buffer, diverse character fonts, special symbols and true decenders, ver­tical and horizontal tabs. RED HOT BUSINESS PRINTER at an unbelievable low price!! (Serial or Centronics Parallel Interface)

Superior Quality SUPER HIGH SPEED—160 CPS

COMSTAR T/F 15^” PRINTER—$579.00

SUPER HIGH SPEED COMSTAR T/F 15’/:" PRINTER has all the features of the SUPER HIGH SPEED COMSTAR T/F 10- PRINTER plus a 15'/i" carriage and more powerful electronics to handle larger ledger business forms! Exclusive bottom paper feed!!

PARALLEL INTERFACESFor VIC-20 and COM-64—$49.00

For All Apple Computers—$79.00NOTE: Other printer interfaces areavailable at computer stores!

Double Immediate Replacement

WarrantyWe have doubled the normal 90 day war­ranty to 180 days. Therefore if your printer fails within “ 180 days” from the date of purchase you simply send your printer to us via United Parcel Service, prepaid. We w ill IMMEDIATELY send you a replacement printer at no charge, prepaid. This warranty, once again, p r o v e s t h a t WE L O V E OUR CUSTOMERS!

|--------------------------------------------------------- 1• Add $17.50 for shipping, handling and insurance. WE DO NOT EXPORT I j TO OTHER COUNTRIES EXCEPT CANADA. j■ Enclose Cashiers Check, Money Order or Personal Check. A llow 14 days j J for delivery, 2 to 7 days for phone orders, 1 day express mail! Canada ■ I orders must be in U.S. dollars. VISA — MASTER CARD ACCEPTED. We JI ship C.O.D. '

PROTECTO(WE LOVE OUR CUSTOMERS)ENTERPRIZES

BOX 550, BARRINGTON, ILLINOIS 60010 Phono 312/302-5244 to order

SUPER-10” A B C D E F G H IJ K L M N O P Q R 8 T U V W X Y Z ABCDEFGH1JKLMNOPQRSTUVWXYZ 1 2 3 4 3 6 7 B 9 0

Page 15: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

■ H COMBINATION “ DAISY WHEEL^ W \ J \ V I I I I J I C I PRINTER/TYPEWRITER

• SUPERB COMPUTER PRINTER COMBINED WITH WORLD’S FINEST ELECTRONIC TYPEWRITER!

• BETTER THAN IBM SELECTRIC — USED BY WORLD’S LARGEST CORPORATIONS!• TWO MACHINES IN ONE — JUST A FLICK OF THE SWITCH!

• SUPERB EXECUTIVE CORRESPONDENCE - HOME, OFFICE, WORD PROCESSING!• EXTRA LARGE CARRIAGE — ALLOWS 14-1/8” PAPER USAGE!• DROP IN CASSETTE RIBBON — EXPRESS LIFT OFF CORRECTION OR ERASER UP TO

46 CHARACTERS!• PRECISION DAISY WHEEL PRINTING - MANY TYPE STYLES!• PITCH SELECTOR — 10, 12, 15 CPS, AUTOMATIC RELOCATE KEY!• AUTOMATIC MARGIN CONTROL AND SETTING! KEY IN BUFFER!• ELECTRONIC RELIABILITY, BUILT IN DIAGNOSTIC TEST!• CENTRONICS PARALLEL INTERFACE BUILT-IN (SERIAL OPTIONAL)!

• 15 DAY FREE TRIAL - 90 DAY FREE REPLACEMENT WARRANTY!

I Add $17.50 for shipping and handling!!

| Enclose Cashiers Check, Money Order or Personal Check. A llow j 14 days for delivery, 2 to 7 days for phone orders, 1 day express | mail! Canada orders m ust be in U.S. dollars. VISA — MASTER | CARD ACCEPTED. We ship C.O.D.

PROTECTOENTERPRIZES (WE LOVE OUR CUSTOMERS)

BOX 550, BARRINGTON, ILLINOIS 60010 Phone 312/382-5244 to order

No. 72 - June 1984 MICRO 13

Page 16: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

• SANYO MONITOR SALE!!

9" Data Monitor

• 80 Columns x 24 lines• Green text display• Easy to read - no eye strain• Up front brightness control• High resolution graphics• Quick start - no preheating• Regulated power supply• Attractive metal cabinet• UL and FCC approved

• 15 Day Free Trial - 90 Day Immediate Replacement Warranty

9" Screen - Green Text Display 12" Screen - Green Text Display (anti-reflective screen) 12" Screen - Amber Text Display (anti-reflective screen) 14" Screen - Color Monitor (national brand)*PLUS $9.95 for Connecting Cable.

Display Monitors From SanyoWith the need for computing power growing every day, Sanyo has stepped in to meet the demand with a whole new line of low cost, high quality data monitors. Designed for commercial and personal com­puter use. All models come with an array of features, including up­front brightness and contrast controls. The capacity 5 x 7 dot characters as the input is 24 lines of characters with up to 80 characters per line.Equally important, all are built with Sanyo’s commitment to technological excellence. In the world of Audio/Video, Sanyo is synonymous with reliability and performance. And Sanyo quality is reflected in our reputation. Unlike some suppliers, Sanyo designs, manufactures and tests virtually all the parts that go into our products, from cameras to stereos. That’s an assurance not everybody can give you!

• LOWEST PRICES • 15 DAY FREE TRIAL • 90 DAY FREE REPLACEMENT WARRANTY• BEST SERVICE IN U.S.A. • ONE DAY EXPRESS MAIL • OVER 500 PROGRAMS • FREE CATALOGS

PROTECTQENTERPRIZES (WE LOVE OUR CUSTOM ERS)

BOX 550, BARRINGTON, ILLINOIS 60010 Phone 312/382-5244 to order

I Add $10.00 for shipping, handling and Insurance. Illinois residents f I please add 6% tax. Add $20.00 for CANADA, PUERTO RICO, HAWAII I j orders. WE DO NOT EXPORT TO OTHER COUNTRIES. jI Enclose Cashiers Check. Money Order or Personal Check. A llow 14 { | days for delivery, 2 to 7 days for phone orders, 1 day express m ail! I | Canada orders must be in U.S. dollars. Visa ■ MasterCard - C.O.D. |

9 S A N Y O

Official Video Products of the Los Angetes 1984 Olympics

*$ 69.00 *$ 99.00 *$ 99.00 *$249.00

Page 17: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Product Name: AutoteimEquip. Req'd: Price:Manufacturer:

Color Computer with 32K $39.95 cassette;$49.95 disk PXE Computing11 Vicksburg Lane Richardson, TX 75080

Description: A full-feature communication package with added features. An extensive amount of effort has been spent to insure user-friendliness; several detailed menus guide the operator in setup and operation. Any operation can be temporarily suspended or allowed to run in background mode while the user accesses a HELP screen. The communications ability seems to be standard - 110 to 1200 baud full- or half-duplex, with send and receive capability for text, graphics, BASIC and Assembly Language data. Full communications using any modem can continue in the background mode while data is reviewed or edited. The connection will not be broken during cassette loads and save, if you desire. Provisions for embedded text and menu-selected print options make it easy to use any printer. Received data can be printed in any menu-defined format, regardless of the width of text lines received.

An outstanding feature of this package is called keystroke multipliers. The purpose is to automate the sign-on procedures for various modems, i.e., invoke a keystroke multiplier which will make the connection, complete the contact and sign off, all automatically.

Pluses: The low cost of this software makes it viable for an unlimited number of simple control and measurement tasks, aside from its intended communications and editing ability. Although full utilization of the package would be complex, the learning process seems to be optimized and friendly.

Minuses: So far, no bugs have been found, and any perceived problem has been overcome with more study and experimentation.

Documentation: An 81-page manual details the operation of the program in a well written format, with additional reinforcement from the program itself. The book is well organized with a complete and logical index, and numerous detailed examples are used where needed.

Skill level: By the time a CoCo owner has progressed to the need or desire for communications, he will be ready to use this program.

Product Name: SuperText ProfessionalEquip. Req'd: Apple II, I I+ , He with Applesoft ROM,

DOS 3.3, 48K, lower case capability Price: $175 ($99 special]Manufacturer: MUSE Software, Inc.

347 N. Charles Street Baltimore, MD 21201

Description: The most recent version of one of the first powerful Apple word procesors. With it, a skilled user can write, edit, store, preview, and print documents in a wide variety of formats. The program supports the Smarterm, Full-View 80, and Videx 80-column boards for the II +, and either of the He 80-column cards, as well as the Apple 40-column format. It is simple to configure the program for most of the popular printers.

Pluses: One of the most unusual features is the "Math Mode”, which permits calculations within files. This is particularly useful for preparing invoices, cost estimates, and proposals. The screen can be split and each half scrolled and edited separately. A key can be defined as any string up to 30 characters long, useful for reviews where a single title occurs over and over. Cursor movement is smooth and unobtrusive. It seems to be nearly impossibleto make such a serious error that text is lost from memory. You can easily set up multi-line running heads or feet, embed codes for bold, italic, and other tyepface changes, and save or load files. There is a quick reference card.

Minuses: SuperText creates nonstandard disk files. The program uses several of the same code sequences in different modes, and it is fairly easy to forget what mode is on. There is no provision for footnotes, super- or sub­scripts, or hyphenation.

The Apple He uses CTRL I to tab; SuperText has not provided a substitute control code to turn on italics printing, so it is necessary to embed a dummy character while entering text, then use the 'change' mode to alter it.

Documentation: The manual has no index and needs one. It is comprehensive, however, and almost any answer can be puzzled out by working through the extensive table of contents.

Skill level: It requires either experience with word processors or great persistence to learn. A person who learns the program and uses it regularly, however, will have the use of an effective writing tool.

Reviewer: Ralph Tenny Reviewer: K.C. Tinkel

No. 72 ■ June 1984 MICRO 15

Page 18: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Subscribe to MICRO...Save 20% and we'll send you a

BONUS GIFTwith your subscription!

Receive a coupon good for one Each Disk contains a variety of programs MicroDisk of your choice. from Micro, all entered and ready to run onA $ 1 5 .0 0 Value — FREE! your machine. Saves time, avoids enois.

Fill out the attached card and mail today!

Each diskette includes all of the programs in BASIC and/or Assembly Source, plus binary 'load-and-go' files. The price of only $15.00 includes shipping and handling.

16 MICRO No. 72 - June 1984

Page 19: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Product Name: Super-Text Professional Word ProcessorEquip. Req'd: Atari 400/800/1200XL, with minimum

Product Name: G.A.L.E.

Price:Manufacturer:

48K$99.00Muse Software 347 N. Charles Street Baltimore, MD 21201

Description: 'Super-Text Professional is designed to be a business-powered processor simple enough for home and educational use,' according to the developer. It contains Atari DOS making all DOS functions available to the user. All of the basics are included; delete, find/replace, block operations, cursor movement, local and global control.

Pluses: Starting with an Introduction and Help Menu, the user has a variety of choices and options available. The user can set parameters for his printer with most of the major printers parameters provided, the users simply selects the one he needs. The printer can also be controlled from within the text. Other nice features are automatic page numbering, single key commands (underlining with one command), format and tab specification control. Super-Text has a system status line displayed upon request which gives pertinent information when needed. Muse Software has also provided something called Autolink (trademark) which ‘greatly increases the Atari’s file organization and manipulation capabilities.' With this feature you can link files on the same or different disks and then do global finds, replaces, etc. through those linked files. There is a user defined function key called The Key whose character set you can define - up to thirty characters.

Minuses: Super-Text has seperate modes for Changes, Adds, and file manipulation. Changing back and forth between modes is a little awkward to start with. It is not at all like other word processors in this respect. To those who are familiar with other packages this method will undoubtedly seem a bit cumbersome at first. Once this peculiarity is gotten used to it becomes acceptable. Again it differs from other word processors in its use and definition of inserts. If you go searching for Insert instructions you will find it very frustrating. There isn't any defined Insert; rather through manipulation of the delete command and the Change and Add mode you can achieve what is an insert. For those not used to other packages I suspect neither the modes or insert would be a problem. Those who are familiar with other WP packages will find a period of adaptation to these different features is necessary.

Documentation: The manual provided with Super-Text is clearly w ritten , w ith good chapter ou tlin es. Unfortunately, as with many software packages, there is a continuation of the belief that indexes are obsolete.

Skill level: This package is geared more for the advanced WP user, having all of the advanced features such a user would want and use. Beginners would certainly be able to use Super-Text, and actually may benefit from the concept of modes, to seperate the various functions.

Reviewer: Mark S. Morano

Equip. Req'd: Price:Manufacturer:

Apple II 49.95MicroSPARC, Inc. 10 Lewis St. Lincoln, MA 01773

Description: A Global Applesoft Line Editor with edit mode, macro mode, global commands, hex/dec conversion, auto line number and help are easily accessed from BASIC or the monitor. It includes search and change, BLOAD information, free sectors, macro definitions for single key entry, a "hide" command to temporarily store a program, line finding, pointer dump, renumber, variable cross reference, append, converting hex to dec and vice- versa, and a line editor with insert, delete, lower case entry, find, verbatim entry, and a help screen.Pluses: GALE is easy to use and is a great time saver for Applesoft programmers. It includes the most complete set of commands among the current popular line editors. It doesn't use the &.

Minuses: The more commands there are, the more you need a reference card. It should have been included to make the package complete.

Documentation: A clearly written, helpful guide to making the most from GALE is included (53 pages) in an easy-to-read manner.

Skill level: Some programming expertise is desirable to make the best use of GALE.

Reviewer: Phil Daley

Product Name: LOGOEquip. Req'd: Commodore 64 and 1541 Disk DrivePrice: $49.95Manufacturer: Commodore Business Machines Inc.

1200 Wilson DriveWest Chester, PA 19380

Description: This is a fairly extensive implementation of LOGO (a procedural language developed at M.I.T.). Supplied on a single disk, it includes system primitives (commands) for graphics, arithmetic &. logical operations and list processing. A second disk containing instructive demos, games and various utilities is also included. Most notable among the various utilities is a LOGO assembler which facilitates the addition of assembly language extensions to the language.

Pluses: This is a powerful language which is suited to many levels of application. At the bottom level it is almost ideally suited for entertaining and teaching children logical thought and expression. At a higher level it is a good vehicle for the study of structured recursive programming. At the top level, the list processing capabilities make LOGO a suitable candidate for implementing AI (Artificial Intelligence) concepts on a micro computer.

No. 72 - June 1984 MICRO 17

Page 20: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Minuses: LOGO is fairly large and complex (compared to BASIC). It was apparently necessary to cut a few comers in order to implement it on micro’s. One indication of this is the fact that the garbage collection routines do not function properly. It's possible for lists of unused words or procedure names (usually resulting from typo's] to accumulate and reduce the available workspace. This defect will only be noticed during long program development sessions.

Product Name: Equip. Req'd:

Price:Manufacturer:

The OddsmakerCommodore 64 orApple IIDiskPrinter optional$44.95CZ Software358 Forest RoadSouth Yarmouth, MA 02664

Documentation: In addition to the demo's and examples on the utilities disk, a 400 + page manual is provided. This manual contains major sections on graphics, computation, and list processing. It also covers sprites and sound/music generation. Extensive appendices cover assembly language programming and contain a complete glossary of LOGO primitives. The manual is good as a tutorial, but leaves something to be desired in conciseness and accessibility for quick reference purposes.

Skill level: The skill required depends on which level you approach LOGO. Little skill is required to "drive" the turtle around the graphics screen. More is required to write concise structured programs, and considerable skill is required to implement AI constructs.

Reviewer: Roger C. Crites

Product Name: Advanced X-tended EditorEquip. Req'd: Apple IIPrice: *Manufacturer: Versa Computing, Inc.

3541 Old Conejo Rd. Newbury Park, CA 91320

Description: This program could be called "The Electronic Bookie” , for that is exactly its function! Through an easy-to-use menu driven system you take bets on some activity, calculate and display the para-mutual odds, display the amount bet on each team/horse/fighter, print tickets for each bet, and when the contest is over, display the pay-offs for each bet. Additional features include automatically taking a 'house cut' percentage from each bet and saving the betting data to disk. The program is so complete that the creators hope they do not get in trouble with ‘you-know-who’!

Pluses: Easy to use by anyone. Provides a good understanding of the para-mutual betting process - quite educational. The printed tickets feature makes the package really useful (for fun only, of course!).

Minuses: Perhaps overpriced at $44.95.

Documentation: The twenty page booklet is clearly written and easy to use.

Skill level: Can be used by anyone.

Reviewer: Robert M. Tripp

Description: AXE is an Applesoft line editor which includes many time saving features for BASIC program development. Search and replace, auto line number, memory status, monitor commands, special formatted listings and line editing features are all available with AXE running. Editing commands include insert, delete, gobble, copy, uncopy, lower case, verbatim mode and a complete macro definition and table use for single key entry of often used strings.

Pluses: AXE appears transparent to the user and is a great help in editing lines without the POKE 33,33 routine. Search and replace strings are easily defined and are very useful in locating and changing variable names.

Minuses: A quick reference card is needed to help in remembering the different commands. I had some trouble in listing programs full width to the printer while AXE was active.

Documentation: The 50 page manual is well written and clearly explains how the various commands operate.

Skill level: Some experience with BASIC programming is necessary to derive all the benefits.

Reviewer: Phil Daley

Product Name: BASIC TutorEquip. Req'd: Apple 11+ or He, 1 DrivePrice: *Manufacturer: Courseware Applications

Savoy IL (c) 1983 Distributor: SuperSoft

P.O. Box 1628 Champaign, IL 61820

Description: A course in BASIC programming with lessons and exercises on disk and in the manual. Covers: what is programming, variables, expressions, entering &. editing code, output (PRINT, TAB), input, branching (IF- THEN, GOTO], looping (FOR-NEXT-STEPJ, and READ- DATA. Material is fairly sophisticated. Can be used in a classroom or for self-study.

Pluses: Quality of presentation is quite good. Overall program is well designed. Covers all major BASIC commands. Examples not trivial, as in many BASIC teaching programs.

Minuses: Interaction is weak and inconsistent: sometimes when you answer incorrectly, you are shown the answer immediately; other times, you get 2 or more

18 MICRO No. 72 ■ June 1984

Page 21: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

tries. You are not forced to enter the correct answer (to show that you accept it) before proceeding. Does not protect against keybounce - if you press RETURN several times quickly, you may flash through the next screen(s) of info without time to read.

Documentation: Superb manual with lesson outlines & goals, recaps of disk lessons, additional info, summaries, problems with solutions, reference list of disk commands, and glossary. Material presented well for older audiences; too many words per page for 12 yr olds to absorb (plus adult vocabulary).

Skill level: Some reasoning &. problem-solving skills; age 15-adult.

Reviewer: Mary Gasiorowski

Product Name: Card?Equip. Req'd: Commodore 64 or VIC 20 and a parallel

(Centronics cable) printer Price: $75Manufacturer: Cardco, Inc.

313 Matthewson Wichita, KS 67214

Description: A printer interface to print text and graphics from your Commodore computer to any parallel printer. The included cables plug into the computer's cassette and

disk drive ports without interfacing with those devices. Internal dip switches allow for permanent selection of features and software selection is also available. Card? features ASCII conversion, graphics printing (if your printer allows it], and a listing mode that converts color change/cursor move functions to understandable abbreviations. Several appendices will tutor you in screen dumps, printer control characters, and device selection.

Pluses: Card?'s flexibility is its chief asset and the newest version supports Epson Graftrax +. Setup is easy and the instructions form a useful tutorial.

Minuses: Interfacing Card? with word processors can become complex if the program attempts ASCII conversion prior to sending the data through Card?. The problems arise when you attempt to imbed printer commands in the text. However, Cardco, Inc. provides suggestions and promises technical support to overcome these obstacles.

Documentation: A new booklet is in the works for the Graftrax update. Until then an addendum fills the gap. The instructions are detailed with intelligent examples and should answer your questions.

Skill level: Recommended for intermediate and advanced users only. If you don't know what ASCII conversion is you'll have trouble taking advantage of Card?'s features.

Reviewer: Mike Cherry

CRACKINGTECHNIQUES

Share the secrets of the world's greatest crackers.. .Axe Man, Bozo NYC, Candy Man, Cloneman,

Disk Zapper, Lock Buster, Long John Silver, Jim Phelps, Mr. Krac-Man, Red Rebel, Trystan II, Reset Vector, The Woodpecker, Mr. Xerox.. . ana many more!

Study complete tutorials on Boot Tracing, Software Tricks, Non-Maskable Interrupt, Ram

For faster service, charge your order to

Card Modifications, Hardware Tricks and other tried and true techniques. Discover indispensable tips on over 40 specific programs for Apple users.

Customize your software to suit your own needs! Order your copy of CRACKJNl , TECH­NIQUES ’84 today. Supplied on disk for Apple Computers.

MasterCard or VISA.

*39.95Call our toll free number and ask for Operator 68

1-800-824-7888In California, call 1-800-852-7777

JJL PIRATES HARBOR

PIRATES HARBOR, INC.P .O . Box 8928, B o sto n , M A 02114

VOICE: (617) 227-7760 M O D EM : (617) 720-3600

A pple is a registered tradem ark of A pple Com puter, Inc.

III

YES, I want to leam the secrets of Cracking Techniques ’84.□ E n clo sed is my check/m oney ord er for $39.95 (M assach u setts resid en ts

add 5 % sales tax).

NAM E: _

A D D RESS:

CITY: _ STATE: _ ZIP

PH O N E: L

® PIRATES >< HARBOR

PIRATES H A RBO R, IN C., P.O . Box 8928, Boston, MA 02114

III

No. 72 - June 1984 MICRO 19

Page 22: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

J i f ^ 1 7 * c££XMusical Notes lor lie Apple

by Phillip Bowers

With a 200 note table and a five octive range covering the entire treble, bass and alto clefs, you can do more than just whistle ‘Dixie’.

The greatest limitation I found with my APPLE II + (APPLESOFT) is its inability to produce a variety of sounds. To overcome this I wrote a small assembler program (28 bytes long] that is CALLed by a Basic program using at least one POKE command.

Once loaded, the assem bler program is capable of producing tones from 1.54hz to well over 15,000hz (cycles per second). Any tone can be held, from several seconds for very high tones, to minutes for lower tones. Four bytes are used in page zero (from $FC to $FF: 252 to 255] to control both the frequency of the tone and its length. The first two bytes set the frequency, and the last two limit the lingth (time) of the tone. Because two bytes are used for each, their combined values range from 1 to 65024 ($01 to $FE00]. The use of the values 0($00) and 255 ($FF) are restricted by the relationship between the two programs.

By using page zero, it allows the assembler program to be located anywhere in RAM where it will be safe.

For our purposes here the assembler program will be at address $6000, and the variable ASSEM, in the Basic program, will equal 24576. Once the values are set in page zero, the Basic program uses the command CALL ASSEM

to produce the desired tone. Moving the assembler program only requires that the variable ASSEM be set to the decimal equivalent of the assembler’s starting address.

The assem bler program can reproduce any musical note, including sharps/flats, up to G# below A of 880hz. Above 880hz the rounding errors for many notes are too great to be of much use. Up to 880hz the largest error is 2.74 cycles, at G and G# just below 880hz. As the frequency decreases, so does the error in cycles.

The useable musical notes are from G § below 880hz, to A at 27.5hz. This gives a 5 octive range covering the entire treble, bass, and alto clefs. The Basic program will allow a 10 octive range of inputs, from 0 to 9, but octives

1 to 5 cover the above clefs, with 1 being the lower octive.

To setup the assembler program enter MonitorCALL • 151

then the RETURN key. Once you have the asterisk prompt, enter the following after it:

6000:A5 FE 38 EA A6 FC AE 30 CO A6 FC A4 FD CA DO FD 88 DO FA E9 01 DO EB C6 FF DO EB 60 00

then RETURN.

The above should be entered as one continuous string, with each byte seperated by a space. It is shown as it would basically appear in a memory dump. A memory dump is done by entering 6000.601 C

By entering 6000Lyou will get an assembler listing. The listing is reproduced as a debugging aid.

20 MICRO No. 72 ■ June 1984

Page 23: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

6000-6002-6003-6004- 6006-6009- 600B- 600D- 600E-6010- 6011- 6013- 6015- 6017- 6019- 6 0 1 B- 6 0 1 C-

A5 FE38EAA6 FC AE 30 CO A6 FC A4 FD CADO FD 88DO FA E9 01 DO EB C 6 FF DO E8 60 00

LDA $FE SEC NOP LDX SFC LDX SC030 LDX SFC LDY $FD DEXBNE $600D DEYBNE $600D SBC #BNE $6002 DEC $ F F BNE $6006 RTS BRK

To save this to disk, use the following:BSAVE ASSEM SOUND, A$6000, L$1C

The length shown ($1C) will not save the last byte at $601C; it is included to show the ending address only.

Still in Monitor, enterFC.F9 02 07 18

then6000G

when the RETURN key is pressed it will execute the assembler program using the values at $FC to $FF. The note should be G below middle C, and last 15 seconds. After the assembler program has executed, the value at address $FF should be equal to 0 ($00), the other values should be untouched. If your values differ, check for an error.

For A below middle C:FC:C2 02 D9 1A

for D above middle C:FC:50 02 81 23

these values should all give 15 second notes when the assembler program is executed.

After the "Musical Notes" program is entered the keyboard keys "QWERTYU"should be marked to read ‘'ABCDEFG” , respectively. The sharp/flat of a note is obtained by pressing the "CNTL” key and the note key together. A rest note is given by the space bar.

As each note is entered, it will be stored in an internal table for replaying, and displayed to the upper 20 text lines. The note table (NT) holds the values for the note frequency and its length in a low order, high order format that are POKEed directly into addresses $FC to $FF. Each note displayed to a text line will have the format "ABCb” , where:

A = the octive the note is in [0 to 9).

B = the note value, A through G. C = the note time;W : whole H : half 4 : fourth 8 : eighth 1 : sixteenth 3 : thirty-second 6 : sixty-fourth

b = space, note separator.A sharp/flat of the note will have

the same format, except that it will be in the INVERSE mode. A rest note will be displayed as "bRCb” . The "R ” meaning a rest note, and the “C" the rest time.

This format allows 10 notes per text line, and by using the first 20 text lines, it permits 200 notes to be displayed. The last 4 text lines are for program information.

When the program is executed, the first input line will be:ENTER BEATS PER MINUTES (4TH NOTE)If no value is entered, the beats per minute will be set to 120. Some sheet music will have a note symbol (like a quarter note), followed by an equal sign, then a number in parenthesis near the upper left comer. This number is the beats per minutes. Whatever value is entered at this point will be the base for timing all other notes.

Once the beat is entered, you are ready to start entering notes. To change the octive, press any of the numeric keys (0 to 9). Line 22 (VTAB 22) will show the current octive.

The "BEAT = ” shows the base

beat of 120 at a quarter note value. To change the beat for any note, or group of notes, the keys "ASDFGHJ” are used.

A = whole note.S = half note.D = fourth note.F = eighth note.G = sixteenth note.H = thirty-second note.J = sixty-fourth note.

By pressing the "A ” key, the beat will change from:BEAT = 120 AT 4TH = 120

to:BEAT = 120 AT WHOLE = 30

the last number is the beats per minute for a whole note.

Once a note is entered it cannot be deleted, but it can be changed to any value. The ", " and keys are used to move the cursor over any note you want to change. The " , ” will move the cursor to the left, lower in the note table, while the " will move it to the right, but will not allow movement beyond the next enterable note position.

While the left and right arrow keys would have been better, they were not used because the right key has the same value as the "CNTL” and "U ” keys, which would give the note G#.

The option "Z : RUN NOTES (0)” shows how many notes are currently being stored, and will run all notes regardless of the cursor position.

In the event either the "X ” or "C " is pressed, you will be asked if you really want it before they do their thing. Option " X " will CLEAR everything, and restart the program to

Listing 1

510

15

20

25262728293031 35

40

G0SUB 255: HIMEM: ASSEMVTAB 21: PRINT "ENTER NOTE OR OPTION : ":PRINT "0CTIVE= "0L" BEAT="BM" AT "BV$" = "BM / BV" "PRINT "Z:RUN N0TES("N0")" TAB( 20)"X:NEW NOTES": PRINT "C: END PROGRAM"VTAB VT: HTAB HT: GET IN$:ER = 0:KI = ASC (IN$): G0SUB 100:IF ER IF KI IF KI IF KI IF KI IF KI IF KI IF KI IF KI HTAB

= 0 THEN VTAB 23: HTAB 1: GOTO 15= 65 THEN BV$ = = 83 THEN BV$ = = 68 THEN BV$ = = 70 THEN BV$ = = 71 THEN BV$ = = 72 THEN BV$ = = 74 THEN BV$ = > = 48 AND KI1: GOTO 10

"WHOLE":BV = 4: GOTO 70 "HALF":BV = 2: GOTO 70 "4TH":BV = 1: GOTO 70 "8TH":BV = .5: GOTO 70 "16TH":BV = .25: GOTO 70 "32ND":BV = .125: GOTO 70 "64TH":BV = .0625: GOTO 70 < =57 THEN 0L = KI - 48:

IF KI = 44 AND NP.- G0SUB 225: GOTO 20

1 > - 1 THEN NP = NP - 1:

©

No. 72 ■ June 1984 MICRO 21

Page 24: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

■s6070

o100

105

Listing 1 (continued)45 IF KI = 46 AND (NP < NO) THEN NP = NP + 1: GOSUB 215: GOTO 20

IF KI = 90 THEN GOSUB 200IF KI = 88 OR KI = 67 THEN 180GOTO 20SB = (60 / BM) * BV:TM = INT (((SB * (IE + 6)) / 36372) + 0.5): HTAB 1: GOTO 10SV = OL: IF KI = 32 THEN OL = 0:XF = 0: GOSUB 145:IN$ = " R» + LEFT$ (BV$,l) + " ": PRINT IN$:NT(NP,0) = FL * ( - 1):NT(NP,l) = FH:NT(NP,2) = LL:NT(NP,3) = LH:OL = SV: GOSUB 215: GOSUB 170: RETURNFOR X = 0 TO 11: IF KI = KV(X,0) THEN NV = KV(X,l):XF = X:X = 98

©110 NEXT : IF X = 12 THEN ER = 1: RETURN115 GOSUB 145:NT(NP,0) = FL:NT(NP,1) = FH:NT(NP,2) = LL:

NT(NP,3) = LH 120 IN$ = "":IN$ = STR$ (OL) + MID$ (KL$,NV,1) +

O LEFT$ (BV$,1) + " ": IF KI < 32 THEN INVERSE 125 PRINT IN$: NORMAL : GOSUB 215130 POKE 252,FL: POKE 253,FH: POKE 254,LL: POKE 255,LH:

q CALL ASSEM135 IF (NP + 1 > NO) THEN NO = NO + 1:NP = NP + 1: RETURN 140 NP = NP + 1: RETURN145 OC = (2 t OL) * (2 t (XF / 12)):CY = SC * OC:TC = TM * OC:

O PS = IE + 6 / (2 # CY)150 FH = INT ((PS + 1254) / 1279):FT = 21 + (5 * FH - 1) +

(1274 * (FH - 1)):FL = INT (((PS - FT) / 5) + .5)155 TI = TC:LH = INT (TI / 255):LL = (((TI / 255) - LH) * 255):

© IF LL = 0 THEN LL = 1160 LH = LH + 1165 RETURN

O 170 IF (NP + 1 > NO) THEN NO = NO + 1:NP = NP + 1: RETURN175 NP = NP + 1: RETURN180 IN$ = "END": IF KI = 88 THEN IN$ = "NEW"185 VTAB 21: HTAB 1: INVERSE : PRINT "ENTER 'Y' FOR "IN$",

ANY KEY TO IGNORE. : GET IN$: NORMAL :IF IN$ < > "Y" THEN HTAB 1: GOTO 10IF KI = 67 THEN 300CLEAR : HOME : GOSUB 260: GOTO 10IF NO = 0 THEN RETURNFOR X = 0 TO NO - 1: POKE 252, ABS (NT(X,0)):POKE 253,NT(X,1): POKE 254,NT (X,2): POKE 255,NT(X,3):IF NT(X,0) < 0 THEN POKE ASSEM + 8,0 CALL ASSEM: POKE ASSEM + 8,192: NEXT : RETURNHT = HT + XI: IF HT = 41 THEN HT = 1:VT = VT + 1:IF VT = 21 THEN GOSUB 235RETURNHT = HT - XI: IF HT < 1 THEN HT = 37:VT = VT - 1:IF VT = 0 THEN VT = 1:HT = 1RETURNINVERSE : VTAB TO CONTINUE. ";NP = NP - 1: VT RETURNHOME : PRINT "MUSICAL NOTES FOR THE APPLE": PRINT :PRINT "BY PHILLIP BOWERS": PRINT :PRINT "ROCHESTER, N.Y.":PRINTBM = 120: INPUT "ENTER BEATS PER MINUTE (4TH NOTE)SB = VAL (B$): IF SB > 0 THEN BM = SBBV$ = "4TH":BV = 1:SB = 60 / BM:TM = INT (((SB * (IE + 6)) / 36372) + 0.5)ASSEM = 24576: DIM KV(ll,l): DIM NT(199,3): FOR X = 0 TO 11: READ NO,NP:KV(X,0) = NO:KV(X,l) = NP: NEXT :KL$ = "ABCDEFG"VT = 1:HT = 1:XI = 4:NO = 0:NP = 0:ST = 13.75:SC = ST:OL = 1X = PEEK (ASSEM): IF X < > 165 THEN IN$ = CHR$ (4):-PRINT IN$;"BLOAD ASSEM SOUND"HOME : RETURNDATA 81,1,17,1,87,2,69,3,5,3,82,4 DATA 18,4,84,5,89,6,25,6,85,7,21,7 VTAB 21: HTAB 1:PRINT "PROGRAM END ROUTINE ": END

o

o190195200205

° „210215

O 220 225

O 230235

240 O 245

255

260

265

° 270

275O 280

21: PRINT "TABLE FULL !! ANY KEY :: GET IN$: NORMAL

VT - 1:HT = 37: IF NO < 200 THEN NO = NO + 1

",B$:

O

285290295300

the initial beats per minute.Option "C ” does not directly END

the program, rather it passes control to line 300. The lines 300 through end have been left open so that you can save the note table, or whatever else you may want to do before ENDing.

Any key oth er than those mentioned above will be ignored. The program will just continue along its merry way.

The note table is defined in line 270 DIM NT(199,3) whereNT(NO,0) = low order value for the

N T|N O ,l) = high order value for the note.NT(NO,2J = low order value for the

note length.NT[NO,3] = high order value for the

note length.The current number of table entries is equal to NO - 1. The value of ASSEM is also set in line 270.

Even though the number of entries can be made greater than 200, it is not suggested because you will lose the relationship between the screen notes and the notes in the note table once more than 200 notes are entered.

In conclusion, I would like to point out that the note table (NT) uses over 9 times more space than is necessary to store the note values and their lengths. This is because we are using an array defined by a Basic program. Because of this it is not possible to use HGR (page1). While the basic program uses about 2400 bytes, the note table requires an additional 9600 bytes to save the 800 bytes needed by the assembler program.

While it is possible to POKE these values directly into RAM, it should be noted that it will actually require 1000 bytes to store the data. An additional byte is needed for each note to indicate a rest value. In the basic program a rest note uses the same 4 data bytes as any other note, except that the low order rest value is negative (NT(NP,0))...line 100 in the program.

When the notes are replayed the absolute value (ABS) value is POKEed into address $FC (252), and the assembler program is altered so as not to reference the speaker location when a negative value is encountered. But it is executed in the same manner as any note. So if you decide you need more space, or want to use HGR, then remember to include the additional byte for each note.

JMCRO

22 MICRO No. 72 - June 1984

Page 25: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

tia tu n e

Under the 64 ROMby John A. Winnie

Free up your BASIC memory without sacrificing program messages using the 16K of RAM under the BASIC and Kernal ROM chips.

Requirements: Commodore 64

Although the Commodore 64 has a hefty chunk of free BASIC memory (38911 bytes at power-up), sometimes it can still turn out that additional memory will make the difference between a polished program and dull code serio u sly w eakened by compromises. In many programs the chief memory-muncher is the string data: the various descriptions and messages that eat up BASIC bytes by just being in the program, and then go on to cost even more when they are accessed by arrays. A good adventure game, for example, may inflict hundreds of different messages on its player ("You can't take that. It's tied down.''), and if these are all stored in the BASIC programming area, valuable programming space is lost.

The program presented here, called "Printout'', solves the problem of string data storage simply and economically. Although it is written in machine language , it is unnecessary to know machine language in order to use it most effectively; however, it is a good idea to know just what it does.

What Printout Does

Between them, two ROM (read-only memory) chips in the 64 use up to 16K of what would otherwise be free RAM. The first chip contains the 64's version of BASIC and lies over memory addresses 40960 through 49151 ($A000-$BFFF). The second ROM chip contains the operating system of the 64 and is called the "Kernal” . It covers memory addresses 57344 to 65535 ($E000-$FFFF). Since the first chip contains BASIC and the Kernal ROM contains the operating system 's machine code routines, it seems that the 16K of RAM has been sacrificed to some good purpose-and, of course, this is quite true. Remarkably, however,

much of the sacrifice can—with a little finagling-be avoided altogether.

First of all, data may be placed in these locations in the usual ways: by direct pokes from BASIC, for example, or by loading a file straight into the under-ROM area. The trick is to get the data out once it has been stuffed in. A PEEK to any of these locations, for example, will read the contents of the ROM chip at that address, not what is stored in the underlying RAM location.

Fortunately, there is a way around the problem. Both ROM chips may be switched out by a simple poke (POKEl,52), exposing the underlying RAM in all its glory! Peeking is now added to poking-or would be, except for one thing: with BASIC so cavalierly switched away, so too for PEEKing! This is why we need machine language to finally solve the problem. We can switch off the two ROM chips using BASIC, but we need machine language to access the now-exposed RAM, and, when we are through with that, switch us back again to BASIC.

Now Printout does all this and more. Once the ROM chips have been switched out, Printout prints to the screen any messages that have been stored under the ROM chips. Of course, the messages must be stored there in the appropriate form. First of all, each message must be surrounded by zeroes; the message itself is coded by simply using the ASCII number of each of its characters. Thus the sequence:

H E L P ! E R R O R

0 , 7 2 ,6 9 , 7 6 ,8 0 , 3 3 ,0 , 6 9 ,8 2 , 8 2 ,7 9 , 8 2 ,0 ,

when stored in memory locations 40960 through 40972, encodes the two messages: "HELP" and "ERROR". When strings are stored in this way, all

that Printout needs to know is which message you would like printed out (counting 0,1,2,...), and where your block of messages begins (in this example, at 40960). So to use Printout, POKE the message number into memory location 2 (decimal), and the low and high bytes of the base address of the message block into locations 251 and 252 (decimal), respectively. (Much of this is done for you by subroutine 50000 in the program Printoutloader of Listing 1).

Using PRINTOUT

Listing 1 is a BASIC loader for Printout. After adding it to your program, a call to subroutine 60000 loads Printout into memory locations 828 through 883. The other subroutine included (50000) may now be called when a message is to be printed. It needs to be supplied with only two pieces of information. First, the base address of the block where your messages are stored; this is the value of the variable ADD. And second, the message number must be supplied; this is the value of the variable ME. When subroutine 50000 is now called, the ME-th message will be printed, beginning at the current cursor position. (Normally, that cursor position will be set by the rest of the program before calling this subroutine). The load address (828 decimal) in lines 50010 and 60002 of Listing 1 (and Listing 3) is not critical. Since the machine code is relocatable, any free area of RAM may be used to hold Printout's 56 bytes.

Of course, in order to use Printout, messages must be previously stored under the BASIC or the Kernal ROMs. An easy way to do this is to create a

No. 72 ■ June 1984 MICRO 23

Page 26: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

program file of these messages, and then load this file at the beginning of your program. Listing 2, Messagewriter, is designed to create such files. In line 20 you specify the total number of messages |minus one), and in line 25 you specify the base address of this block of messages. You supply the actual messages in the data statements beginning at line 500. Since you will need to keep track of your messages and their numbers, Messagewriter also generates a numbered, hardcopy list of your messages.

Listing 3 provides an example of using Printout to list the messages used earlier in Listing 2. It assumes that you already have run the program of Listing2 and have the program file '‘Messages” on your disk. Although the program of Listing 3 does not do anything spectacular, it does wrap up all that has come before. If you understand how it works, then the power of Printout and the new 16K that comes with it is at your fingertips! One more thing. Since Printout places no restrictions on string length, an entire screen may be stored under R O M as a single 999 byte string. When Printout is called, the stored screen is displayed almost instantly, certainly much more rapidly than when a screen is loaded from a disk file.To the Machine Language BeginnerAs the assembly listing shows, Printout is in general quite straightforward. The one slightly tricky thing is that it uses a Kernal R O M routine (CHROUT, at $FFD2] on data stored under the Kernal R O M itself. So the Kernal, after first being switched off to permit access to the character data, is next switched back on to permit the Kernal routine CHROUT to print out the character. Next-and here is the tricky part- the Kernal is switched back off again to get the next character. But CHROUT, it happens, restores the hardware interrupts along its way! Should such an interrupt now take place while the Kernal R O M is switched out, the system will crash, since the interrupt routines are themselves Kernal R O M routines. Hence the added step (SEI) to repeatedly disable the hardware interrupts each time CHROUT is used. The moral should be clear: even though interrupts have been disabled initially, each time a Kernal routine is used-any Kernal routine-the safest bet is to again disable interrupts before going on to switch off the Kernal ROM.

PRINTOUTLOADER50000 REM * PRINTOUT SUB *50005 REM * INPUTS ARE ME AND ADD *50010 POKE 2,ME:HB=INT(ADD/2 56):LB=ADD-2 56*HB:

POKE 251,LB:POKE 252,HB:SYS 828:RETURN 60000 REM * LOAD PRINTOUT DATA SUB *60002 FOR 1=828 TO 883:READ Q:P0KE I,Q:NEXT:RETURN60005 DATA 120,169,52,133,1,162,25560010 DATA 160,255,198,252,232,200,20860015 DATA 2,230,252,177,251,240,260020 DATA 208,245,228,2,208,240,20060025 DATA 208,2,230,252,177,251,20860030 DATA 6,169,55,133,1,88,9660035 DATA 162,55,134,1,32,210,25560040 DATA 120,169,52,133,1,208,227

MESSAGEWRITER10 REM * MESSAGEWRITER *20 NMESS=5:REM * NUMBER OF MESSAGES -1 *25 ADD=57344:REM * BASE OF MESSAGE BLOCK *30 RESTORE:PRINT"{CLEAR,DOWN10}"

TAB(10)"PRINTOUT OR FILE(P/F)?"35 GET A$:IF A$=""0R(A$<> "P"ANDA$<> "F") G0T035 37 PRINT"{CLEAR,DOWN10}"TAB(15)"THANK YOU."40 IF A$="P"THEN GOSUB 100:GOTO 30 45 REM * WRITE MESSAGE FILE *50 OPEN 15,8,15:PRINT#15,"S0:MESSAGES"60 OPEN 5,8,5,"0:MESSAGES,P,W"65 HB=INT(ADD/256):LB=ADD-256*HB 70 PRINT#5,CHR$(LB)CHR$(HB);:

REM * FILE WILL LOAD AT ADDRESS = ADD *75 FOR 1=0 TO NMESS:READ D$:L=LEN(D$)80 PRINT#5,CHR$(0);85 FOR J=1 TO L:PRINT#5,MID$(D$,J,1);90 NEXT:NEXT95 PRINT#5,CHR$(0); -.CLOSE 5'.CLOSE 15:G0T0 30 100 REM * PRINTOUT SUB *110 OPEN 1,4:PRINT#1,CHR$(14)"MESSAGE LIST"CHR$(15)120 FOR 1=0 TO NMESS:READ D$:PRINT#1,I,D$:NEXT 130 PRINT#1:CL0SE1:RETURN500 DATA HELLO THERE,YOU ARE IN A DARK CAVERN 510 DATA WHY NOT?,THAT WAS VERY FOOLISH 515 DATA STOP RIGHT THERE!,

YOU HAVE BEEN KILLED. TRY AGAIN?

MESSAGE DEMO'5 REM * MESSAGE DEMO *10 IF L=0 THEN L=1:L0AD "MESSAGES",8,1 20 GOSUB 60000:REM * LOAD PRINTOUT *100 ADD=57344:REM * BASE ADDRESS OF MESSAGE BLOCK *105 NMESS=5:REM * (NUMBER OF MESSAGES)-1110 FOR 1=0 TO NMESS:ME=I:GOSUB 50000:PRINT CHR$(13):NEXT120 GOTO 11050000 REM * PRINTOUT SUB *50005 REM * INPUTS ARE ME AND ADD *50010 POKE 2,ME:HB=INT(ADD/256):LB=ADD-256*HB:

POKE 251,LB:POKE 252,HB:SYS 828:RETURN 60000 REM * LOAD PRINTOUT DATA *60002 FOR 1=828 TO 883:READ Q:P0KE I,Q:NEXT:RETURN60005 DATA 120,169,52,133,1,162,25560010 DATA 160,255,198,252,232,200,20860015 DATA 2,230,252,177,251,240,260020 DATA 208,245,228,2,208,240,20060025 DATA 208,2,230,252,177,251,20860030 DATA 6,169,55,133,1,88,9660035 DATA 162,55,134,1,32,210,25560040 DATA 120,169,52,133,1,208,227

O

©

©

©

o

o

©

o

©

24 MICRO No. 72 ■ June 1984

Page 27: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Listing 1

O

©

PRINTOUT STRINGS STORED UNDER BASIC OR UNDER THE KERNAL.

STRINGS ARE STORED IN THE FORM:0 , - , - , - , 0 , - , - , - , - 0 ,— ETC.

THE STRING PRINTED IS THE N-TH STRING STORED IN THAT BLOCK OF STRINGS WHICH BEGINS AT THE BASE ADDRESS POINTED TO BY BASELO,BASEHI.

THE STRING NUMBER N IS PREVIOUSLY POKED

RELOCATABLE

; INTO MEMORY LOCATION 2

0828t

f ORG $828 ;

0002 'string EQU 200FB BASELO EQU 25100FC BASEHI EQU 252

0828 78 SEI0829 A9 34 LDA #52082B 85 01 STA $01

082D A2 FFj

LDX #255082F A0 FF LDY #2550831 C6 FC DEC BASEHI

0833 E8 'count INX0834 C8 HUNT INY0835 D0 02 BNE GTBYTE0837 E6 FC INC BASEHI

0839 B1 FB ’gtbyte LDA (BASELO),Y083B F0 02 BEQ CHECK083D D0 F5 BNE HUNT

083F E4 02 ’check CPX STRING0841 D0 F0 BNE COUNT0843 C8 PRINT INY0844 D0 02 BNE OUTPUT0846 E6 FC INC BASEHI0848 B1 FB OUTPUT LDA (BASELO),Y084A D0 06 BNE CHROUT084C A9 37 LDA #55084E 85 01 STA $010850 58 CLI0851 60 RTS

0852 A2 37 *CHROUT LDX #550854 86 01 STX $010856 20 D2 FF JSR $FFD2

; DISABLE INTERRUPTS ; OUT KERNAL/BASIC

; SET CNTRS

NOT PAGE END? GO ON.PAGE END. NEXT PAGE.

j GET BYTE A ZERO. THE RIGHT ONE?NOT ZERO. KEEP HUNTING.

THE RIGHT ZERO?NO? FIND NEXT ZEROREADY TO PRINTNOT END OF PAGE? PUT IT OUT.END? TURN PAGE.

; GET CHARACTER NOT END OF BLOCK? PRINT IT. END OF BLOCK. RESTORE KERNAL.

RESTORE INTERRUPTS DONE!

RESTORE KERNAL/BASIC

CHROUT(KERNAL); TRICKY! $FFD2 RESTORES INTERRUPTS, ; SO THEY MUST BE DISABLED AGAIN.

0859 78 SEI085A A9 34 LDA #52085C 85 01 STA $01085E D0 E3 BNE PRINT

TAKE OUT KERNAL

NEXT CHARACTER

0860 END

©

No. 72 - June 1984 MICRO

Page 28: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

ABetterRandomNumber

Generator

by H. Cem Kaner and John R. Vokey

Reap the fruit of 7 years of labor—a superior version of the random number generator, for simulations, gambling, forecasting.

NOTE: The work for this article was supported by a research grant from the Natural Sciences and Engineering Research Council of Canada (NSERC) to Dr. A.B. Kristofferson, and by NSERC Postgraduate Scholarships to the authors. The authors would also like to thank John Lyons for the many helpful discussions o f RNG design.

In this article we present an assembly language program, interfaced to Applesoft via the USR function, which provides three in d ep en dently addressable RNGs. Because there is so l i t t le av a ilab le in re la tiv e ly nontechnical language about RNGs, and because of their growing importance, we will also describe how we chose them. Finally, we will outline some of the tests that we performed on them. The quality of a random number generator is not determined by the elegance of its code, but instead by the randomness of the sequences of numbers that it produces. The test results are always the most important part of the documentation of any RNG.

The RNG Algorithm

There are many ways to produce pseudo-random numbers, a few of which work reasonably well. Donald Knuth's excellent 178-page chapter on RNGs describes quite a few of all varieties. We use what is called a mixed linear congruential generator. Suppose that you store the numbers you generate in an array, so R[l] is the first number, R[2] is the second, and so on through R[N]. Let a, c and m be constants. We'll be concerned with their values later. The mixed linear congruential generator is defined by the following equation:R [N +1] = (aR [N ] + c ) m odulo m

In other words, if your last random number was R[N], your next one is obtained by multiplying R[N] by a, adding c to the product, and finding the value of that result modulo m. As usual (see the integer BASIC manual on MOD for more details] to obtain a number modulo m you divide it by m but keep the remainder rather than the quotient. For example:13 mod 10 = 23 mod 10 = 972863 mod 10 = 3

A mixed congruential generator does not produce “ truly random" numbers (no software RNG can] because it is possible, given knowledge of a, m and c to predict the next number from the last. However, if a and c are properly chosen and m is reasonably large, a person who did not know the formula, or even one who did know it but who didn't have a very good calculator handy, would be hard- pressed to predict the next number.

Selection of the RNG's Parameters

Not every mixed linear congruential random number generator is good. Most are terrible. The values of a, c and m determine how good the RNG will be. These three numbers are called the parameters of the generator. Different considerations are involved in choosing each number. Generally, m is chosen first, then a and c.

It is easy to find values of a and c which will guarantee that the RNG will

Random number generators (RNGs for short) are functions that produce pseudo-random numbers. Usually the numbers produced are fractions between 0 and 1. Ideally, a computer language’s RNG should be able to generate every fraction that the language can represent, every fraction should be as likely to be generated as every other, and the order of the numbers should be completely unpredictable to the user. Slightly more formally, the RNG should produce sequences of numbers which, so far as standard statistical tests can tell, behave in the same way as "truly random" number sequences would behave.

RNG’s are used to simulate imperfectly predictable real life events. Computer games use them in this way. So do some insurance companies, when setting rates. E co n om ists , p sych o lo g is ts , sociologists, consumer behavior researchers of various backgrounds, often work with theories of such complexity that the only way that they can decide whether a theory is correct is to simulate the behavior of a population on the computer, and to compare this with the actual behavior shown by the groups they are studying. Gamblers use random number generators to “shuffle” cards or “roll” dice. They try different betting strategies at the computer, where it’s free, rather than at the casino (or the stock market), where they can lose their shirt. Simulation involving random number generators is o ften ca lled M onte C arlo simulation, after the casinos in Monte Carlo: much of the earlyresearch on probability and statistics was financed by gamblers. As final example of simulations, estimates of the likelihood of an accident in a nuclear reactor, and of its probable severity , are o ften m ade by simulation, before the reactor is built, to check if safety measures are adequate.

RNG’s are also used to provide random test data for input to complex computer programs. It is impossible to test every branch or path in a major program . Random inputs or combinations of inputs often expose bugs that a systematic selection of test cases missed.

26 MICRO No. 72 ■ June 1984

Page 29: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Numerical analysts work with RNGs to obtain numerical estimates of the so lu tio n s of com plex mathematical functions for which no theoretical solutions exist, or to provide estimates against which a theoretical solution (which may be wrong) can be checked.

Randomization of the order of events in experiments, so that people (rats, whatever) cannot predict exactly what will happen next, has been a necessary part of the design of every experiment that we have run.

These are only some of the uses of random number generators: among other common ones are random sampling (for surveys and for quality control, for example), and partially random decision making (sometimes the best way to make an important decision, as studied in Game Theory).

The better the random number generator, the more lifelike or interesting the sim ulation, the stronger the test of the theory, the more likely the numerical solution is to be right, the more hidden bugs can be expected to be found in the program , the more valid the statistical test, the tighter the experimental control, the more representative the survey, the more unpredictable the decision.

Most implementations of high level computer languages provide something in their function library that the manual calls an RNG. Applesoft’s RND function is typical of those we’ve seen on small systems. The reference manual describes RND as a source of random numbers, but it provides no evidence whatever that this claim should be believed, nor any warning that it should be taken with a mountain of salt.

RND, when subjected to standard statistical tests, fails them badly.

We should stress here that we are not singling out Apple for criticism. In our experience with various mini and microcomputers, manuals which admit to low-grade RNG’s are nearly as rare as language implementations that provide an RNG worthy of the name.

It is not surprising that many languages’ RNGs are poor. Much of the best research is very recent, conducted after some of these generators were written. Simulations require a great deal of computer time. They were not of general interest until compu t e r t i me became very affordable.

produce every number between 0 and m-1 before the sequence starts to repeat itself. Eventually, no matter what a, c and m are, the series must repeat. How long it goes without repetition is called the period and the longest period that you can get with a congruential generator is m. For many reasons, the longer the period, the better the generator.

The second factor involved in choosing m involves computational convenience. As defined above, our RNG produces integers. To obtain fractions between 0 and 1, just divide these integers by m. Applesoft reserves 32 bits for the digits of any number. If we used m = 232, our sequence from 0 to m-1 would include every bit pattern than can be stored for a number. In general, since we are dealing with a binary computer, so numbers are stored as bit patterns, m should be a power of 2 .

Unfortunately, m = 232 will not yield every fraction that the Apple can store, because Applesoft uses an extra byte per number to hold the exponent. This allows representation of billions of different very small numbers, including numbers near 10-38. Working with fractions of the form R[N]232, we can produce only one number in this region, namely zero. Tiny fractions in floating point languages are always under-represented by congruential

generators: many fractions that the language can work with cannot be generated. We can alleviate the problem somewhat, and increase the period, by increasing m to 240. Not every possible fraction will be generated with this m — R[N] would have to be 17 bytes long for that and the RNG would be very slow — but when m is 2 40, R[N] can take on1,099,511,627,776 different values, which is plenty. This is the value we use.

Our next decisions involve a and c and these are more difficult. It is easy to find values of a and c that allow the period to be m. If a mod 4 = 1 and c is any odd number, the period will be 240 (i.e. m). But this is only part of the story.

As an absolutely awful example of a full period mixed linear congruential generator, suppose that a is 1 and c is also 1. So our generator is defined byR [N +1] = (R [N ] + l ) modulo m

It works in the sense that we will indeed get all the numbers between 0 and m-1, but the sequence is 0, 1, 2, 3, etc., and this is hardly random.

The apparent randomness of a sequence of numbers is determined by the ordering of the numbers. This is where most RNGs, including all linear congruential generators, have at least some problems.

a .

10■9

3 -sID O OZDO -7

V -5

q:S t -3II

T -2

Ct -1

0.

• • # •

• . .

* • . •••

••

1— I •

• / ’ / ••.• • .

• • • • • •

• •

• / *• • • • • •

• •• •

• • • • * .• • % • •

•• • • • • • . ••

• • • •• • •

• • • •• • • • • * » • *•

• ••«

• • • * . • .- m

• • . * .*• • •

• • • • * • • .• • .• t ••

• • • • • •• •

• •• * • • *

• • • • • • . •

1 ,• . ft 1 ftl • I 1 ft 1■1 -2 -3 -4 -5 -6 -7 -8 -9 10

Nth RANDOM NUMBER: R[N]Figure 1

Linear patterning of successive pairs of numbers obtained from linear con­gruential random number generators. A good generator spreads the points across more lines, yielding as few as possible on each line. Nonlinear soft­ware generators exhibit nonlinear patterns in graphs of this type but the patterns are just as pronounced.

No. 72 ■ June 1984 MICRO 27

Page 30: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

We can think about the ordering problem by thinking about short subsequences of the form |R[I], R[I1], R[I2], R[IK]). Consider pairs first. There are m2 possible pairs of numbers, [R[I], R[I1]], between 0 and m-1 but a generator of period m can only yield m different pairs. Which m pairs is the critical question.

In the case of R[I1] R[I] 1, agraphof R[I] along one axis and R[I1] along the other would show a single straight line.

A truly random sample of m numbers from the possible m2 would result in points scattered all over the graph.

All linear congruential generators will produce graphs which show patterning, and that patterning will always be a set of parallel lines (see Figure 1). The trick is to find a generator which produces as many of these lines as possible, with as few points on each line as possible. The result will be a more even coverage of the m2 possible pairs.

Note, by the way, that the larger m is, the more lines we can have and the closer they will be. The shorter the period, the poorer the generator.

A two dimensional graph, with R[I] on one axis and R[I1] on the other, is graph of a plane. A one-dimensional graph is simply a line. A three- dimensional graph, of a cube, contains planes just as a two-dimensional graph contains lines. If we plot sequences of three pseudo-random numbers, (R[IJ, R[I1], R[I2]), on a cube, all of the points will fall on parallel plane and all of the points on each plane will be on parallel lines. In this case, only m of a possible m3 triplets can be produced by the RNG, so coverage of the cube is even more sparse than coverage of the plane in the two dimensional graph. The problem of patterning of triples is potentially more severe than patterning of pairs. In higher dimensions (longer seq u en ces), we find p ara lle l hyperplanes, and sparser and sparser coverage of the space.

We call this problem of patterning of linear congruential generators the lines and planes problem. Our goal is to minimize it. The more lines, planes, and hyperplanes we can cause our RNG to generate, the fewer the points on any given line, plane, etc., and the less patterning there is. In a truly random sequence, there is no patterning, and this is what we want to approximate with our pseudo-random sequence.

(If you are intrigued by this discussion but a little lost, George

M arsag lia 's chapter in the Encyclopedia of Computer Science is excellent and quite readable. Knuth's discussion of random numbers also deals with this problem at great length, w ith num erical exam ples and exercises. It is more technical, but in our opinion it is the best source available. For references to the original research, see Knuth).

The value of the RNG multiplier, a, is the main determinant of the degree of serial patterning. We want to choose a so as to produce as many lines and planes as possible, and to space them out as evenly as possible. This can be translated into the goal of minimizing the maximum distance between any two lines (planes, hyperplanes, etc.). Let 1/V2 be the maximum distance between any adjacent lines in a graph (such as Figure 1) of R[I1] against R[I]. Let 1/V3 be the largest distance between pairs of parallel planes in the graph of triplets (R[Ij, R[I1], R[I-2J), and so on. Our goal is to maximize V2, V3, V4, V5 and V6. (Note that these V’s are inverses. The bigger the V, the smaller the largest distance between lines or planes in the graphs). We stop at 6 because if these values are good, higher dimensional sequential interactions are a lm o st certa in ly u n im p ortan t. According to Knuth, we would be pretty safe stopping at 4.

The V values for linear congruential generators can be determined using a method first proposed by Coveyou and McPherson in 1965, which is based on the finite Fourier transform. The mathematics underlying this test, the Spectral Test of an RNG, are beyond the scope of this article, but they are well described by Knuth. The Fourier transform itself is a mathematical technique for detecting and describing repeating patterns in a set of data.

To compute the values of the V's, we used Knuth's Algorithm S, which requires high precision Integer arithmetic. Apple's Pascal provides Long Integer type variables, which allowed us the Integer precision we needed. (We do not list this program because it is a direct implementation of Knuth's algorithm S). The algorithm takes only a and m as input - the value of c is irrelevant. It quickly determines the values of the V's for the output of the generator across its entire period.

This is so spectacular that we want to say it again. The statistics V2, V3, and so on, which take only minutes to calculate, take into account the ordering of every one of the

1,099,511,627,776 different values the random number generator produces. (!)

Until the theorems behind this amazingly powerful algorithm were proved, testing of random number generators was done by examining a relatively "sm all" subset of the sequence the generator produced. "Sm all” here means maybe a million numbers. On an Apple, this type of testing can take months of computer time. (We report some subsequence tests below, and they took days. Tests of other generators not discussed here actually did take months). One of the reasons that old generators are so poor, relatively speaking, is that it took so long to test one. T estin g of replacements was a tedious and very expensive business.

To choose the multipliers for the three generators we present here, we computed V values for just over 30,000 different values of a. (A life's work for at least 100 long-lived Apples if they were all tested in the old ways, and this only took two weeks). We stopped when three suitable values of a were found.

The values of the V's tell us what the largest distance is between a pair of lines, planes or hyperplanes in a sub­sequence graph of the entire period. These values depend on the period of the generator: the larger m is, thelarger V can be. These numbers can get so large (see Table 1) that it’s very hard to tell whether a value of V is good or not. For any given period, there is a best possible value for each of the V’s. The easiest way to tell how a given V value rates is to convert to a different number [call it U), that takes the period of the generator into account. Knuth gives formulas for converting from V2 to U2, V3 to U3, ..., V6 to U6. The Spectral test is usually defined in terms of the U values. If U is greater than 0.10, the generator "passes" the test. According to Knuth, every generator known to be bad fails the test at this level. He defines a "pass with flying colors" as a value of U greater than 1.0.

The Spectral test is the most powerful test known of random number generators. The U and V values should be part of the documentation of any RNG. We list the values of the three generators presented here in Table 1. Our smallest U is 2.37.

For comparison, the U values of RANDU, a very common RNG on 32-bit mainframes, are 3.14 (U2), less than 0.0001 (U3), less than 0.001 (U4), less than 0.01 (U5) and 0.02 (U6).

28 MICRO No. 72 - June 1984

Page 31: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Table 1Results of the Spectral Tests

Generator X USR(1) YUSR(O)Z USR(-1)

Multiplier 271828196218413453205

31415938565

AdditiveConstant

3 9999126407

V2 9829749626001112748837514

908473954394V3 72937326 103184754

79566866V4 1023550

8059701036504

V5 58786 6067059710

V6 9916 8142 11636

U2 2.81 3.18 2.60U3 2.37 3.99 2.70U4 4.70 2.91 4.82U5 4.01 4.34 4.17U6 4.58 2.54 7.40

Knuth (pp. 102-104) provides a table of U and V values for many mainframe generators. Most (fortunately) are better than RANDU. Some are better than the three we are presenting here, but not many of them.

The problem with many of the older generators is that they were speed- optimized. A full period is obtained from any generator whose c is odd and whose a is any even power of 2, plus 1. These are not the only full-period multipliers (far from it), but if you choose a so that it is a power of 2, plus 1, all that you have to do in the m u ltip lica tio n is to sh ift the accum ulator a few tim es (the multiplication degenerates into a simple set of shifts), and then add.

As an example of a fast generator, if you choose a = 28 +1 and a 32-bit generator, as was recommended for the Apple not too long ago by someone else, you don't even need to shift anything. Add the lowest byte to the second lowest. Add the (8-bit plus carry) sum of these to the third lowest byte. Add the (8-bit plus carry) sum of these to the high byte and you are done. This is short, sweet, elegant, very fast, it passes some of the sub-sequence tests, but it fares badly on the Spectral

test and it would probably be inadequate for many applications.

We aren't going to say who suggested this generator, or in what magazine, because it could needlessly embarrass an author who doesn't deserve to be embarrassed. He consulted a standard, fairly recent (1971), and well written text on random numbers (Newman & Odell's, The Generation of Random Variates), followed their recommendations, and conducted their tests. Unfortunately, the importance of the lines and planes problem wasn't widely enough or fully enough realized in 1971, and the full- period tests, many of which had not yet been developed or polished, were not widely enough appreciated. Newman and Odell's otherwise very good summary of generation techniques and applications of random numbers made virtually no mention of full-period results. Their recom m endations favored multipliers with few bits set, such as 28 +1 or 28+3. Similarly, Abramowitz and Stegun's numerical bible (also known as the Handbook of M athem atical Functions, 1964) recommends generators of the power of2 plus 1 type. Finally, and in another book deserving a home on any

programmer's bookshelf, Carnahan, Luther and Wilkes’ Applied Numerical Methods (1969) makes much the same recommendation.

The very fast generators, with few b its set to allow jazzed-up multiplication routines, have generally fared badly when subjected to the Spectral test. RANDU, for example, used a multiplier of 216 + 3. The problem seems to be that so few bits are set, and so few operations are thus performed on the number, that the number's digits are not sufficiently scrambled each time. In the 1950's and early 1960's, generators of this type were considered ideal, rather than poor. They passed many of the simpler tests of randomness. And, critical for large sim u la tio n s then, fast m eant (relatively] cheap. (We keep talking about cost. Here's an illustration that makes the point. In 1978-79, Kaner and John C. Lyons conducted a moderately large simulation of the behavior of the Kolmogorov-Smirnov and related statistics, using three PDP-11 lab minicomputer. Some tests of the validity of their work required greater numerical precision than was easily obtained on the PDP’s, so they also did some work on a CDC 6400 mainframe. Out of curiosity, they ran benchmark tests to determine how much the simulation would have cost if all of the work had been done on the CDC. It would have cost over $100,000, or more than enough, at that time, to but three well equipped PDP-ll's).

The recognition that tests of sequential patterning are more important than tests of frequency (discussed below) for generators that produce all possible numbers between0 and m, and the discovery of fast techniques to search for patterns across the entire period, have caused something of a revolution in the way RNG's are created and tested. Almost all of this has taken place over the last 20 years, and much more has yet to come.

Readers familiar with statistical techniques may have grumbled, by this point, that there were tests of sequential patterning long before the Spectral test. We will mention the results of a few of these below, but one of them, the Serial Test, is relevant here.

Suppose that you split the range of fractions generated (R[N]m) into 10 equal subranges, 0 to . 10, . 10 to .20, .20 to .30 and so on. If you generate a sample of 10,000 numbers, you can

No. 72 - June 1984 MICRO 29

Page 32: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

count how many fall in each subrange. A random source would produce about 1000 for each, and this can be compared to the number that the RNG produces. This simple test, of the frequency of single numbers (rather than of pairs or triples), is called the Chi-Square Test. Similarly, you can examine the pairs, (R[I], R[Ilj). From a sample of 10,000, you should obtain approximately 100 of each type of pair. That is, in about 100 cases, both R[I] and R[I1 J should be between 0 and .10. In another 100 cases, R[I] should be less than .10 while R[I1] is between .10 and .20, and so on. There are 1000 types of triples (R|I|, R[I1], R|I2]) and on average we'd expect to obtain 10 of each. The traditional test used to examine the difference between the actual number of each number, pair, triple, etc. and the number that we should obtain on average is called the Serial Test. There are a number of versions. We prefer Good's, developed in 1953. [Knuth presents a different one that is also popular.)

The Serial test is a subsequence test. You take a sample of the numbers produced by the generators (we used the first 850,000 from each in our tests, for example). If you didn't mind tying up your Apple for a few years you could test the entire output of the RNG (all trillion-plus numbers), obtaining a full- period test the hard way. For such a large sample, this test is known to be extremely sensitive to deviations from randomness.

Over the last ten years, Neiderreiter has proved a very important set of theorems about the relationship between the Spectral test and the full- period Serial test (see Knuth for references and details). In short, any RNG that passes a full period Spectral test will also pass a full period Serial test. By using the Spectral test to determine the three values of a we ensured that the RNGs would pass both tests.

We have now settled on values for m and a. How do we decide what c should be? The additive constant in the generator makes no difference for the Spectral test, but it does influence the value of another traditional test of ordering, the Serial Correlation Test. You can think of the serial correlation, lag K, as a measure of the degree to which the relationship between R[I] and R[IK| can be described as linear. A value of 0 indicates that there is no linear relationship between the random number produced now by the RNG and

the value that it will produce K calls from now. A value of ± 1 indicates a perfect linear relationship, and an atrocious RNG.

K nuth’s Theorem K gives a method to establish upper and lower bounds on the correlation, across the entire period. We applied it to test several additive constants, for each of the RNGs, for serial correlations lag 1 through 20 (again in a Pascal program not listed here that followed Knuth directly). There were thus 60 correlations, 20 for each generator. For the values of c chosen, the largest correlation lies somewhere between -0.00000001135 and 0.00000000569. The second worst case lies between -0.00000000038 and 0.00000000072. We don't know the exact values, just the upper and lower bonds on the correlations, but whatever they are they are pretty close to zero, which is where they should be.

In summary, the modulus value of 240 resulted from a compromise between considerations of speed and space on the one had, and of period length and tiny value representation on the other. The critical full period tests from here were tests of sequential relationship. Equal frequency is, of cou rse, a m ajor c r ite r io n of randomness, but this entered into our parameter selection only insofar as values of a and c that would not guarantee equal frequency were rejected automatically. The parameter selection was determined, for each generator, by performance on the major full period tests of sequential relationship.

Empirical Tests of the RNGs

Full period tests only tell us about the performance of the RNG across the entire period. They do not guarantee that the sub-sequences will be good. It could be that a strong trend in the first100.000 values will be counterbalanced by a reverse trend in the next 100,000, and so on. Since no application that we know of would use the full trillion number period, the only way to be confident about quality for actual use is to examine the RNG's sub-sequence behavior.

To do this, we ran a number of standard statistical tests on the output of each generator, examining the output in batches (sub-sequences) of1.000 to 10,000. For each test, sampling started at the (same) starting values of the generators. Many users

will only need these first few hundred thousand numbers, so these should be the ones most carefully examined.

1) Serial TestsWe described these in the final

discussion of the Spectral test, above. Samples of 10,000 numbers were tested for simple frequency (number of R[I]'s < .10, between .10 and .20, etc.) and for clustering of pairs and triples. Eighty-five batches were examined and the 85 results, for each test and each generator, were compared to the distribution of results we would expect from a random source, using the Kolmogorov-Smirnov Test. All three generators passed the simple frequency (p> .10) and triples [p> .20) tests. The generators listed as X and Y in Table 1 passed the doublets test, but Z did not. The problem with Z, which we will see again later, is that it does too well on these tests.

If you test a truly random source many times, it will sometimes fail a test of randomness and it will sometimes only marginally pass it. Not often, but sometimes, and we can calculate how often theoretically. Z's performance was sometimes poor, but not often enough to mimic a random source (.05 > p > .02). Since nothing can be "more random’’than a "truly random'' source, this must be a flaw in Z.

It should be realized, though, that these tests are very sensitive to minor deviations from random source behavior when such huge (850,000) sample sizes are involved. Z does not perform ideally, but its performance is far from bad.

2) Frequency TestsEqual frequency over the full period

is guaranteed in a full period generator: one and only one of each number is produced each time through the trillion number series. But the fact that all possible numbers will eventually appear is no guarantee that they will come in a reasonable order. It all too often turns out that an RNG yields too few, then later too many small (large, whatever) numbers. We described the Chi-Square test of frequency as a special case of the Serial test. (Historically, the Serial was an extension of Chi-Square). A different test requires no grouping of the numbers and it is often more sensitive to departures from equal frequency than Chi-Square. This test, the Kolmogorov-Smirnov test (KS test for

30 MICRO No. 72 • June 1984

Page 33: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

short), compares the proportion of numbers generated that are less than any given number (across all numbers between 0 and 1) with the proportion that we'd expect from a random source.

A hundred such tests, for each generator, were run on batches of 1,000 numbers, and the KS test was then used to compare the distribution of KS values from these 100 tests with the distribution a truly random source would give. X and Y passed (p > .20). Z failed, even though it had already passed Chi-Square. The problem with Z, as before, was that its test performance was too good, too often (.05 > p > .02). This is a most unusual problem for an RNG, but searching techniques for "terrific'1 generators, like the search we performed across30,000 potential generators, are becoming commonplace, so we can expect this to arise more often.

3) Runs TestsA run up is a succession of

increasing numbers (eg. .1, .2, .35, .36) which ends when the next number generated is lower than the last. A run down is similar. In this case, successive numbers get smaller. The number of increasing or decreasing numbers in a run is the length of the run. Tests of how many runs, and how many runs of each length, are further tests of sequential trend in the RNG. Both types of tests were run, for each generator, on a sample of 50,000 numbers. All generators passed them handily.

4) Other TestsWe developed these generators two

years ago (summer, 1981) and have used them often since. Kaner has mainly used them to simulate logistic, triangular, normal, and geometric distributions, and the behavior of various functions of variables having these distributions (such as the kurtosis of weighted sums of a logistic plus a triangular plus a geometric, which is an important variable in a theory of time perception that he works with). Z was never used in these simulations. X and Y performed quite adequately. Numerous comparisons of theoretically predictable values with the simulation results were made along the way, and none of the comparisons suggested any problems with the RNGs.

Vokey has conducted simulations involving binomial, t, F, and various other d istributions of common

hypothesis testing statistics, and of m ultinom ial and hypergeometric distributions and functions of these involved in theories of choice and category learning. X and Y have performed well consistently. Z has performed strangely: extreme values of complex statistics are not as likely as they should be with Z.

In sum, X and Y have passed all tests, theoretical (full period) and empirical (sub-sequence). Z's sub­sequence behavior has been less good (i.e., too good), and the more of it that we see, the more hesitant we are to use it again as a "stand-alone" RNG. This does not mean it's useless, as we shall see below.

X and Y appear sufficiently random for most needs, and they have performed empirically beyond our hopes for them. But they are not perfect. We have minimized the lines and planes problem, but we have not gotten rid of it. For very precise simulations, especially of events correlated over time, this is not go enough. However, if more than one RNG is available (which is why we provide three), we can do much better than we have done so far.

Combination of RNGs

The graph of the last number generated, R[N], against the number generated this time, R[N 1), shows a family of parallel lines when all pairs (R[Nj, R[Nl]) are plotted (as illustrated in Figure 1). This is the parallel lines problem. If our goal is to break down this linear structure, as we must do to mimic the random structure produced by a truly random source, why not just randomly rearrange the order of the numbers generated by the RNG, as it produces them? This is George Marsaglia's insight, and in practice it works out very well.

Here's an example of the procedure for wiping out the lines and planes patterns. Generate 100 values from X and store them in a matrix, say XRAN[I]. Now sample a value from generator Y and use this value to determine which value you'll choose this time from XRAN, i.e. set RANDOM XRAN[Y * 100], Replace the sampled value of XRAN with a new value from generator X |XRAN[Y *" 100] USR (II) and you're done.

A sequence of numbers, RANDOM [I], will have the same good sub­sequence frequency properties as X does, but the last remnants of

sequential patterning from X typically disapper. Knuth gives examples of quite poor generators which perform surprisingly well when combined in this way. All combinations that we've examined in X, Y and Z have been good, but we recommend that Z be restricted to the role of selection generator (the role played by Y in the example above) due to its too equal sub-sequence frequencies. We see no problem in using Z as a selection generator. Some people would argue that Z might be a better selection generator than X or Y. We're not sure.

A second approach is to sample from X, then Y, then Z, in turn. This triples the period and it can destroy the lower-dimensional patterns (the lines], but it will not do for all generators combined in this way. In fact, Lewis' Multi-RNG Theorem (pp. 18-19) states that if any multiplier in a bank of equal period RNG's is near sq.rt. m , the problem will return with a vengeance. (A sad result because the old generators were often chosen to be near sq.rt. m deliberately, and the older textsrecom m end this heartily ). Werestricted selection of multipliers for X, Y and Z to values far from sq.rt. m = 1,048,576 in order to allow this form of generator combination. For these generators, according to Lewis, the technique should be very effective.

The last approach that we'llmention is to use one generator (Z) to decide which of the other two will be sampled from this time. This only doubles the period of the resulting generator (if you need 3 trillionnumbers, use a different RNG), but it does randomize the order of sampling from the generators, which is not done above.

It seems probably important for each solution above that the different generators' outputs be unrelated. Otherwise, replacing a value of X with one from Y, for example might make little difference. Our final test of the generators involved computing the co rre la tio n (m easure of linear relationship) between X and Y, Z and Y and Z. A hundred correlations were taken, on samples of 1,000 numbers per generator. All were reasonably low. The averages were 0.0003 for X and Y, 0.0038 for X and Z, and -0.0017 for Y and Z, which should be low enough to allow combinations.

Using the RNGOnce you have entered the RNG program into your Apple (below), you

No. 72 ■ June 1984 MICRO 31

Page 34: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

access it via the USR function. A statement of the form RAN USR(SELECT)

in either immediate or deferred mode, will put a random number into the variable RAN. SELECT must be a Real or Integer number, variable or expression. If it is less than 0, the output will be from Z. If SELECT is 0, the output is from Y. If SELECT is larger than 0, output is from X. If SELECT is a String, output is "?SYNTAX ERROR".

Some of the locations of the program hold the last values generated by each RNG. Unless you are debugging a program and want the same number sequence again and again (in which case, see below), you should never use the same random numbers twice. If you never have to reload the program, this is taken care of automatically. However, if you must reload the program, it will start from the initial values of 3, 99991 and 26407. It is easy to avoid this problem by always updating your copy of the program on the disk. At the end of every program that uses an RNG, we PEEK the contents of decimal locations 768 to 969 (the entire program) and save them on the disk. (Equivalently, BSAVE RNG, A$300, L$C9). At the start of every RNG-using program, we BLOAD the program from the disk. This ensures that we always start with the next random number in the sequence.

To obtain a standard sequence instead, keep another copy of the RNG program, and deposit it into core as needed, but never update it. This downloads the same values every time, yielding the same sequence every time.

The RNG Program

The program starts by determining which generator is requested, and does so by calling Applesoft’s internal SIGN subroutine. Variable LOOKUP holds the offset value, determined from the sign variable in USR|), which, when added to ADDBAS, yields the final location of XADD (LOOKUP = $22), YADD($13) or ZADD ($04). These are the additive constants, c, of the generators and the final locations are used because our DO loops are most conveniently done as 4 DOWNTO 0.

LOOKUP added to MULBAS (m ultiplier base address) yields XMULT, YMULT or ZMULT, the values of a.

LOOKUP + LSTBAS points to the last value generated from X, Y or Z,

XRAN, YRAN orZRAN, i.e. to theR[N] ofR [N +l] = (aR[Nj+c) mod m.

By loading the appropriate value of LOOKUP into the computer's Y register, we access the appropriate RNG. To avoid constantly worrying about which generator we are dealing with, we store the values in a set of standard locations (freeing register Y for other uses).

NEWRAN will hold the new value generated. By depositing c into it directly, we perform the addition of c automatically. MULT and OLDRAN hold a and R[N]. This is the function of the program segment labelled TRNSFR.

The next section of the program thoroughly confuses readers unfamiliar with modular arithmetic. Remember that the value of A mod B is the value of the remainder of the division of A by B. The quotient itself is irrelevant. Since 240 will divide evenly into any multiple of 240, any number greater than 5 bytes in length reduces to the least significant 5 bytes (40 bits) directly. Every bit more significant than the 40th (or 39th if you number from 0) is an even multiple of 240 so it cannot enter into the remainder of the division. Combine this with the fact that(AB) mod C (A mod C B mod C) mod C and you will see that we never need any bits past the 40th. Thus we never store them. The multiplication segment calculates the least significant 40 binary digits and quits. The additions always ignore the carry from the sum of the highest bytes.

The multiplication algorithm is the same as the one we all learned in elementary school. Here is an example of standard multiplication:

12 3 4 5 OLDRANX 11111 MULT

12 3 4 51 2 3 4 5 1 2 3 4 5 1 2 3 4 51 2 3 4 51 3 7 1 6 5 2 9 5 PROD

To multiply OLDRAN by MULT, we multiply by the least significant digit of MULT, shift OLDRAN left by one, multiply the next least significant digit, shift again, etc. If MULT held a zero at any point, we would shift OLDRAN for the next digit of MULT, but not add anything to the answer, PROD. In the RNG program, we do it the same way, with register Y keeping track of the bits of the byte of MULT by

which we are currently multiplying. Index X and BYTCNT keep track of MULT's byte. The difference between our algorithm and the traditional one is indicated by the vertical line in the example. We need no digits past the line, so we never calculate anything past it.

The third section of code, MOVRAN, is executed after the multiplication and the addition are done. We now have R[N +1], which we store as is in XRAN, YRAN or ZRAN. Which generator it goes back to is kept track of by XYORZ. R[N + 1] is always stored as a fixed-point integer, because all computations are and always should be fixed-point integer for the modulo operation to work. Why store a normalized value and have to decode it each time?

(Note Bene: We now know of three cases in which programmers have ''im p ro v e d ” on con gru en tia l generators by doing floating point computations rather than fixed integer computations. More precision is better, right? Wrong! Not here! The theorems we reference above all assume fixed- point integer arith m etic , w ith tru n catio n not rounding. The computational errors involved in integer arithmetic are part of the algorithm. Maybe floating point calculations will be good for some generators, but this is uncharted territory. In our experience, this "improvement” has always led to a bad generator).

NRMLIZ puts NEWRAN into the floating-point format that Applesoft expects. To convert fixed-point to floating-point, left-rotate the number until its most significant digit (the first set bit) is the leading bit of the number. As long as we keep track of the number of rotations performed (held in register Y), we could convert back to fixed point easily if we wanted to. Floating­point format, which stores an exponent (reflecting the number of rotations) along with the normalized digits, allows a wider range of values to be stored to high precision than does fixed-point format.

Once normalization is done, we either branch to BITSET if a set bit (most significant digit) was found, or fall through to it if R[N] = 0. At BITSET we first load a 0 into a byte reserved to hold the number's sign (making it positive), then convert to Apple's convention for storing exponents. In this format, if the exponent is $80, no rotations were required and the number lies between

32 MICRO No. 72 ■ June 1984

Page 35: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

0.999999999 and 0.50. If the exponent is $70, one rotation was done and the number lies between 0.5 and 0.25, and so on.

To store our integer as a fraction, we need only load the exponent with a value no greater than $80, and less than $80 by the number of rotations needed to get the top set bit. This is exactly equivalent to dividing R[N + 1] by 240, except where R[N + 1] is 0. In this case, the program returns 241 instead of zero. This is close to zero but it removes the chance of a "?DIVISION BY ZERO" error if you divide by a random value. This is probably academic anyway, as the starting values ensure that 0 will be the 1 ,099 ,511 ,627 ,776 th number generated by each RNG.

Below are the parameters for the Apple, Commodore, and essentially any other 6502 machine that uses a Microsoft BASIC. See Editor’s Note, Page 34.

APPLE - to set up the USR function - POKE 10,76: POKE 11,61: POKE 12,3 |These would be altered if you are starting the program elsewhere inMemory.)MULTMP EQU $9DRANEXP EQU $9DNEWRAN EQU $9EBYTCNT EQU $ACSIGN EQU $EB82

COMMODORE - to set up the USR function - POKE 785 and 786 with address of RNG Subroutine.MULTMP EQU $61RANEXP EQU $61NEWRAN EQU $62BYTCNT EQU $02SIGN - see below FEXP EQU $61 FSGN EQU FEXP+5

The following is the Applesoft sign routine converted to a form for the Commodore. In line 0344 of the main program there is a JSR to SIGN. The location $EB82 is where the sign routine is located in the Apple. For the Commodore you can place the SIGN subroutine anyw here as it is completely relocatable.Floating Point Exponent - FEXP Floating Point Sign - FSIGN C 64: FEXP EQU $ 6 1

F S IG N EQU $ 6 6 APPLE: FEXP EQU $9D

F S IG N EQU $ A 2

A5 61 SIGN LDA FEXPF0 09 A5 66 2AA9 FF B0 02 A9 01 60 RTN

BEQ RTN LDA FSGN R0L A LDA $FF BCS RTN LDA $01 RTS

Listing 1

0300 0300 0300 0300 0300 0300 0300 0300 0300 0300 0300

0RG $300* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

A BETTER RANDOM NUMBER GENERATOR FOR APPLESOFT

COPYRIGHT 1984 THE C0MPUTERIST INC.ALL RIGHTS RESERVED

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

TO USE THE RNG SUBROUTINE, YOU MUST SET UP THE USR FUNCTION.SEE EDITORIAL NOTE

LOAD IN PARAMETERS FOR THE RNG'S

Z: RAN(3l4l5938565*OLD24607)MOD20

O

©

o0300 00 00 00 ZADD BYT $00,$00,$00,$67,$270305 07 50 89 ZMULT BYT $07,$50,$89,$2E,$05030A 00 00 00 ZRAN BYT $00,$00,$00,$00,$00 O

Y: RAN(84l3453205*OLD99991)MOD20

030F 00 00 01 YADD BYT $00,$00,$01,$86,$970314 01 F5 7B YMULT BYT $01,$F5,$7B,$1B,$95 ©0319 00 00 00 YRAN BYT $00,$00,$00,$00,$00

X: RAN (27182819621*0LD3)MOD20

03 IE 00 00 00 XADD BYT $00,$00,$00,$00,$03 °0323 06 54 38 XMULT BYT $06,$54,$38,$E9,$250328 00 00 00 XRAN BYT $00,$00,$00,$00,$00

ADD LOOKUP TO BASE L0CS FOR ©PARAMETER ADDRESSES FOR CURRENT RNG.

032D 04 13 22 LOOKUP BYT $04,$13,$22 ; Z, Y, X

0330 00 XY0RZ BYT $00 ; WHICH GENERATOR ©0331 00 YTEMP BYT $00 ; Y-REG ON ENTRY0332 00 XTEMP BYT $00 ; X-REG ON ENTRY0333 00 00 00 MULT BYT $00,$00,$00,$00,$00 q0338 00 00 00 OLDRAN BYT $00,$00,$00,$00,$00

033D 08 RNG PHP ; SAVE EVERYTHING033E 8E 32 03 STX XTEMP ©0341 8C 31 03 STY YTEMP0344 20 82 EB JSR SIGN ; SEE EDITOR'S NOTE FOR

; SIGN ROUTINE; FAC HOLDS S OF USR(S)°

PUT FF IN A IF S0,PUT 0 IF 0, 1 IF S0

03^7 AA TAX ; FROM THIS q03^8 E8 INX ) DECIDE WHICH RNG034 9 BC 2D 03 LDY LOOKUP,X ; VIA LOOKUP TABLE AND034C 8C 30 03 STY XYORZ ; SAVE IT FOR LATER

o

NOW THAT WE KNOW WHICH GENERATOR, MOVEITS CONSTANTS TO THE TEMP L0CS.

034F A2 04 LDX $04 ; LOOP TO TRANSFER °0351 B9 00 03 TRNSFR LDA ADDBAS,Y ; RNG'S VALS TO

STANDARD LOCS, I.E.0354 95 9E STA NEWRAN,X ; ADD CONST TO NEWRAN, ©0356 B9 05 03 LDA MULBAS,Y ; MULT CONST0359 9D 33 03 STA MULT,X ; TO MULT,035C B9 0A 03 LDA LSTBAS,Y ; LAST RND VAL FROM03 5F 9D 38 03 STA OLDRAN,X ; THIS RNG TO OLDRAN O0362 88 DEY0363 CA DEX ; 5 BYTES DONE

No. 72 ■ June 1984 MICRO 33

Page 36: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

©

©

©

o

©

©

©

©

©

©

0364 10 EB BPL TRNSFR IF NO, DO NEXT> IF YES, MULTIPLY.

0366 A2 04 LDX $04 INDEX OF BYTES0368 86 AC STX BYTCNT KEEP TRACK OF BYTES

• DEALT WITH SO FAR036A BD 33 03 NXTBYT LDA MULT,X LEAST SIGNIF BYTE036D 85 9D STA MULTMP036F A0 07 LDY $07 COUNT BITS0371 46 9D MULPLY LSR MULTMP GET LEAST SIG BIT.0373 90 0C BCC SHIFT BIT0 DON'T ADD.0375 18 CLC BIT SET, SO ADD0376 BD 38 03 ADD LDA OLDRAN,X OLDRAN TO NEWRAN.0379 75 9E ADC NEWRAN,X037B 95 9E STA NEWRAN,X037D CA DEX ALL BYTES DONE037E 10 F6 BPL ADD NO ADD NEXT0380 18 CLC YES, SO PREPARE TO

SHIFT OLDRAN (IEMULT * 2). DROP LASTCARRY AS IT IS0 MOD20 ANYWAY.

0381 A6 AC SHIFT LDX BYTCNT BYTES TO SHIFT0383 3E 38 03 SHFTIT ROL OLDRAN,X0386 CA DEX BYTE LEFT0387 10 FA BPL SHFTIT YES, SHIFT IT.0389 A6 AC LDX BYTCNT RECOVER BYTES.038B 88 DEY MORE BITS LEFT

■ IN THIS BYTE038C 10 E3 BPL MULPLY YES, MULT BY NEXT.038E C6 AC DEC BYTCNT NO, DONE A BYTE.0390 A6 AC LDX BYTCNT ANY BYTES LEFT0392 10 D6 BPL NXTBYT YES MULT BY IT.

0394 AC 30 03 LDY XYORZ DONE. PUT THE0397 A2 04 LDX $04 > NEW RND INTO THE; RESPECTIVE RNG'S039B 99 0A 03 STA LSTBAS,Y LAST RAN STORAGE.039E 88 DEY039F CA DEX J MORE TO MOVE03A0 10 F7 DONE. NOW TO NORMALIZE FAC, ALIAS NEWRAN.

03A2 A0 28 LDY $2 ; $28 (40) BITS IN FAC.03 A4 A5 9E NRMLIZ LDA NEWRAN FIND HIGHEST SET.03A6 2A ROL : SIGNIFICANT

. 28 - NOT SET03A7 B0 0E BCS BITSET \ LEAVE WHEN TOP

BIT FOUND03A9 26 A2 ROL NEWRAN4 y NOT FOUND YET, SO03AB 26 A1 ROL NEWRAN3 f GET RID OF THE 003AD 26 A0 ROL NEWRAN2 j BIT AT THE TOP.03AF 26 9F ROL NEWRAN1 i Y WILL KEEP TRACK03B1 26 9E ROL NEWRAN : OF OF BITS LEFT.03B3 88 DEY : ANY LEFT03 B4 D0 EE BNE NRMLIZ : YES, KEEP LOOKING

. NO, ALL DONE.03B6 88 DEY . PROTECT AGAINST

. DIVIDE BY 0.03B7 A9 00 BITSET LDA $00 > PUT 0 IN FAC'S03B9 85 A2 STA NEWRAN4 i SIGN BYTE.03BB 98 TYA . GET SIG BITS03 BC 18 CLC . PUT IN FACS $8003BD 69 58 ADC $58 J FORMAT: $58$28$80.03BF 85 9D STA RANEXP . PUT IN EXPONENT

BYTE AND DONE.03C1 AC 31 03 LDY YTEMP . SO, UNSAVE03C4 AE 32 03 LDX XTEMP . EVERYTHING03C7 28 PLP . AND03C8 60 RTS . SAY GOODBYE.03 C9 END

References

A b ram o w itz , M & Stegu n , I. A ., H an d book of M a th e m a tic a l F u n c tio n s , N a tio n a l B u reau of Stand ards, 1964 (R ep rinted w ith C o rre c tio n s by D over P ress, 1972).

C arn ah an , B ., L u th er, H . A ., & W ilk es , J .O ., A pplied N u m erica l M eth o d s, John W iley & So n s, 1969 .

G ood , I. J., T h e seria l test for sam p ling n u m b ers and o th er te s ts for ran d om n ess, P roceed in gs of th e C am brid g e P h ilo so p h ica l S o c ie ty , 1953 , V o l. 4 9 , 2 7 6 -2 8 4 .

K an er, H . C . &. L y on ss , J .C ., T a b le s and P ow er C o m p ariso n s for D iffe re n t V ersio n s of th e K o lm o g o ro v -Sm irn o v and S ch u ste r S t a t i s t i c s , T e c h n ic a l R ep o rt N o . 6 7 , D e p a r tm e n t of P sy c h o lo g y , M c M a s te r U n iv e rs ity , 1979 .

K en d all, M . G . and S tu art, A ., T h e A d vanced T h e o ry of S ta tis t ic s , V o l. 2: In fe re n ce and R e la tio n sh ip (third ed itio n , 19 7 3 ), V o l. 3 : D esig n and A n aly sis , and T im e Series (third ed itio n , 19 7 5 ), H afner P ress.

K n u th , D . E ., T h e A rt of C o m p u ter P ro g ra m m in g , V o l. 2 , S e m in u m e r ic a l A lg o rith m s. A d d ison :W esley , 1981 (Second Ed ition ).

L ew is, T . G ., D is tr ib u tio n Sam p ling for C o m p u ter S im u la tio n . L ex in g to n B ook s,1975 .

M a r s a g l i a , G . , R a n d o m N u m b e r G e n e ra tio n . In A. R a ls to n 's E n cy clo p ed ia of C o m p u ter S c ie n ce , V an N ostran d R ein h old ,1976 , 1 1 9 2 -1 1 9 7 .

N ew m an , T . G . & O d ell, P ., L ., T h e G e n e ra tio n of R an d om V aria tes, H afn er P u b lish in g C o ., 1971 .

Editor's Note: When adapting this random number generator subroutine we found it to be essentially free from machine specific code. The two places the code differs are in the use of the USR function which accesses the program from a BASIC file, and in the use of floating point notation, in particular the APPLESOFT Sign routine. After examining the available documentation the USR function for the Apple and Commodore we found it wasn’t clear as to how parameters were passed. The locations used were different, but this was expected. The

34 MICRO No. 72 - June 1984

Page 37: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

question was how the floating point notation operated. To solve this problem we wrote a small program (see below) which allowed us to display the floating point accumulator, PEEKing the locations where the exponent, mantissa and sign were stored in each com puter. If they were stored differently, then further modifications would have to be made. Happily our little program proved that they store the parameters in the same form. Now for the bad news - we found the Atari didn't use floating point notation in its USR function. This, combined with a different convention for storing floating point notation (com bining the exponent and the sign), made easy adaption of this program impossible. Certainly if those readers with Atari's wish to meet the challenge it can be done. Bear in mind the different USR function and the use of floating point notation in the RNG subroutine, and how it would have to be changed to accomodate the Atari’s conventions.

JMCftO

10 REM PROGRAM TO DISPLAY FLOATING POINT ACCUMULATOR

20 UV10 : REM USER VECTOR 30 PN3 : REM PAGE NUMBER 40 FA157 : REM FLOATING POINT ACCUMULATOR 50 MPPN*256 : REM MEMORY PAGE 60 POKE UV,76:POKE UV1,00:POKE UV2,PN 100 MPPN*256 : REM MEMORY PAGE 110 POKE UV,76:POKE UV1,00:POKE UV2,PN 120 MVMP:SV128:I0 130 POKE MV,165:POKE MV1,FAI 140 POKE MV2,l4l:POKE MV3,SV:P0KE MV4,PN 150 MVMV5:SVSV1:III 160 IF 16 THEN 130 170 POKE MV,96 200 INPUT VALUE ;A 210 BUSR(A):PRINT VAL ;B 220 PRINT EXP ;PEEK(MP128)230 PRINT MSB ;PEEK(MP129)240 PRINT ;PEEK(MP130)250 PRINT ;PEEK(MP131)260 PRINT LSB ;PEEK(MP132)270 PRINT SIGN;PEEK(MP133)280 GOTO 200

O

o

o

o

o

C64-FORTH/79 New and Improved

for the Commodore 64C64-Forth/79T“ for the Commodore 64-$99.95• New and improved F O R T H -7 9 im plem entation w ith

extensions.• Extension package including lines, circles, scaling,

window ing, mixed high res-character graphics and sprite graphics.

• Fully com patible floating point package including arithm etic, relational, logical and transcendental functions.

• String extensions including LE FT S, R IG H T S, and M ID $.• Full feature screen editor and m acro assem bler.• Com patible w ith V IC peripherals including disks, data set,

modem, printer and cartridge.• Expanded 167 page m anual w ith examples and application

screens.• "SA V E T U R N K E Y " norm ally allows application program

distribution w ithou t licensing or royalties.

(Com m odore 64 is a tradem ark of C om m odore)

TO ORDER-D isk only.-C heck, m oney order, bank card, C O D 's add $ 1 .6 5 -Add $ 4 .0 0 postage and handling in U SA and Canada -M ass. orders add 5% sales tax -Foreign orders add 20% shipping and handling -D ealer inquiries w elcom e

PERFORMANCE MICRO PRODUCTS770 Dedham Street Canton, MA 02021

(617) 828-12096 8

SOPHISTICATED TELE-COMMUNICATION IS HERE

THE COMMUNICATORfor 4.0 Commodore Computers

JIM STRASMA’S REVIEW:“ THE BEST TERMINAL PACKAGE I ’VE SEEN YET”

By April 1 (maybe sooner) It Will Be Even Better

SPEEDS UP TO 9600 BAUD XON — XOFF

TRUE CTRL KEY (we do our own keyboard scan)

THE HARDWARE — A printed circuit board; easily installed in the CBM. It uses no C8M connectors; gives a serial port with true RS232C standard.THE SOFTWARE —— Em ulates the ADDS Regent 100, ADM 31 and/or the

TeleVldeo 950.1 Or choose the VT100 model for use with DEC and VAX computers.

— Runs coresident w ith BASIC program s; le ts BASICprograms and program on host computer communicate to develop real­ly sophisticated communication and control capabilities.

— The program is on ROM at e ithe r address; no d isk loadingrequired. Uses only 512 bytes of RAM; will relocate itself around any othermachine language program at top of memory.

— W ifi upload and download and run BASIC programs. With BASICprogram wifl upload and download standard data files. 100 page manual gives program listing for BASIC programs.

Excellent text editor designed to work with THE COMMUNICATORTHE COMMUNICATOR $200

Text Editor $401200 baud modems beginning at low, low $365, and even less when purchased

with THE COMMUNICATOR

AMPLIFY, INC.2325 Macbride, Iowa City, Iowa 52240 319-337-83781 trademarks Adds Regent, Inc., Lear Liegler, Inc., Televideo Systems, Inc.

No. 72 ■ June 1984 MICRO 35

Page 38: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

le d & i£

CONTROLby M itchell Esformes

Test your assembly code for efficiency, or adapt the program for statistic, step/trace debugging and more.

CONTROL is a machine language program that runs your machine language/assembly level program instruction-by-instruction and allows you to control its operation and/or collect statistics about your program. This could be used for as simple an application as counting cycles in a program (details shown in this example], as a step/trace function with disassembly of each instruction, as a sophisticated debugging tool that traps on specified instructions and/or memory locations, and so forth.

The program works by setting up a pseudo program counter, fetching and evaluating each instruction from the program under control, performing any special operations that you define, and then executing the instruction. It is written in such a way that you can easily add your own processing routines. The demonstration process shown here simply counts the number

of machine cycles used by a program. While this can be useful in developing optimally efficient code, it is only a hint of what can be done with this technique. CONTROL will run on any 6502 microcomputer. The only requirements are four page zero locations and about IK of program space.

Program DescriptionEQUATES: These are the addresses of locations used by the program for its program counter, table pointers and for saving the 6502 registers. PCTR is a two byte page zero vector which contains the pseudo program counter; TEMPLO and TEMPHI are a page zero pair of bytes used for vectoring to the CONTROL tables. The 6502 registers are saved in ACC (A reg), XREG, YREG, STREG (status) and STKPTR (stack pointer). These do not have to be

on page zero. TALLY is an eight byte table used to hold the cycle count in this particular example. If you design some other function for the CONTROL program, then this will not be needed. START puts the address of a location containing a BRK command, BREAK, on the stack to be used to halt the program when an RTI is encounted in the test program, sets the status to 0 to enable interrupts, and clears the TALLY counter. If you are not counting cycles, the TALLY counter does not have to be cleared.FETCH is the beginning of the main processing loop. It picks up the first byte of the current instruction, the OPCODE, and converts it to the range $00 to $0F to speed up the table lookup. The table INST1 is searched for an OPCODE match. If found control goes to SERVICE. If an illegal opcode was fetched, then it goes to ERROR.

36 MICRO No. 72 ■ June 1984

Page 39: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

SERVICE indexes the CYCLE table to get specific information about the current opcode and then jumps to your custom test/evaluate/count routine. The OPCODE has been found. In this example, the routine ACCYC is used to count the cycles in the instruction being executed.PROCESS is the return point from the custom service routine. It starts the actual processing of the current istruction. If, as indicated by a plus value in the A reg (from the CYCLE table), the instruction can be directly executed, then the program goes to TRANSF w hich com pletes the instruction execution.SUB through FORWRD are the routines that service instructions that may not be directly executed. These are the instructions that modify the real program counter: JSR, JMP, JMP (X), RTS, RTI, and the conditional branches BEQ, BNE, BCC, BCS, BMI, BPL, BVC and BVS. Each of these instructions requires special processing to calculate the new program counter. This is handled by the various routines starting with SUB and ending with FORWRD. Once the new program counter has been calculated and set into PCTR then the instruction has effectively been executed! The program now goes back to FETCH for the next instruction at the new PC address. The call to subroutine OVER is specific to the TALLY cycle counting example and increments the count to reflect the extra cycle taken in crossing a page boundary. If your custom routine does not require special processing on page boundary crossings, then simply replace OVER with an RTS.TRANSF to EXBUF are the real 'guts' of this program. This is where all of the instructions, except for the JMPs and BRANCHes handled above, are processed. The CYCLES table contains important information about each instruction. This is in the form:

Bit Use in Cycles

01 Number of cycles02 used by the 04 instruction08 Number of operand 10 bytes in instruction 20 If set add X reg to indexed address,

else add Y reg 40 If set check if page boundary

crossed80 If set do not directly execute the

opcode

TRANSF m oves the com p lete instruction to the three byte EXBUF andFILLED pads with NOP's if the instruction is less than three bytes long.POINT calculates the address of the next instruction.OVERPG ch eck s for indexed instructions and branches to RUN if not indexed.SCAN2 checks for mode and branches to IND for indirect indexed mode. ADDY,ADDX service a simple index instruction by modifying the address in the EXBUF and then go to RUN.IND fixes up the address for the indirect indexed mode.RUN restores all of the registers that were saved on entry.EXBUF now contains the correct instruction to execute. It is executed and then drops through to the next code which saves all of the registers and then goes back to FETCH the next instruction.BREAK is a BRK command that is executed when CONTROL encounters an RTI instruction. This stops CONTROL and returns you to your microcomputer monitor.

Tables

TABIN contains index values into the main opcode table. This considerably speeds up the search for the correct opcode during execution.INST1 contains the values of all valid opcodes.CYCLES contains the significant information about each opcode as described in the table above.INST2 contains the value of all opcodes that require special service on page boundary crossovers.ADRMOD indicates the addressing mode for each of the opcodes in INST2. A $00 byte indicates Indirect Indexed; an $FF indicates Absolute Indexed.

Utility Specific Routines

ACCYC is the basic cycle counter mechanism used in the cycle counting utility. It simply adds the number of cycles for the current instruction to the TALLY counter, an eight byte counter. This is called by SERVICE. For your own utility, write code to service your requirements (disassembler, trace mode, or whatever) and have SERVICE jump to it. Return to the mainline program with a JMP PROCESS.

OVER is an additional cycle counter used for page boundary crossovers that add one cycle to the instruction. If your utility does not need extra service for page boundaries, simply replace OVER with an RTS.ERROR is called when an invalid opcode is encountered or when the utility code detects an error. It can be as simple as a BRK to abort processing and return to the system monitor; it can sound a tone and then BRK; it can include an error correcting scheme,- or whatever you desire.

Using CONTROL

A simple application of the CONTROL program is that of counting the number of cycles used by a machine level program or subroutine. If you program in assembly language there are times when you would like to know how many cycles your coding uses. This information is useful for comparing the efficiency of one algorithm to another and when writing interrupt service routines that have a limited amount of time to perform their operations. Using; CONTROL with the two cy cle counting support routines provided will compute the exact number of cycles, including page boundary crossover cycles, used by your program. CONTROL runs your coding, but slower since there are instructions executed between each of the instructions in your program.

To use the cycle counter you should have a debugging monitor to display and change memory locations. Load CONTROL with the support routines ACCYC and OVER. Load the program you wish to test. Put the starting address of your program in PCTR ($B1 in our assembled version, may be different in your customized version). The least significant byte (LSB) goes in PCTR, the most significant byte (MSB) in PCTR+1. If you need to initialize the 6502 registers, do so by putting the values in the storage locations ACC, XREG and YREG (A, X and Y registers), STREG (status register) and STKPTR (stack pointer). These locations are at $0BF8 to $0BFC in our version. Note that when using this program to count the cycles used by an interrupt service routine, the operation of the service routine is by CONTROL and begun by you, not by an interrupt. After an RTI instruction is processed, the BRK at BREAK w ill be processed and CONTROL will stop.

No. 72 ■ June 1984 MICRO 37

Page 40: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Now you can run CONTROL in the cycle counting mode. When it stops, display TALLY, the eight bytes starting at $0BF0 in our version, to see how many cycles your program used. The LSB is in the highest address, $0BF7. If an illegal opcode was fetched or there isn't enough room in TALLY to accumulate the cycles, then the error handler at ERROR will cause a BRK. See the separate examples for having ERROR sound a tone on the Atari, Apple and Commodore 64.

Adapting CONTROL

The original version of CONTROL was written on an Atari. The version listed here was run on the Apple II. The only

change required was the memory location of the program itself. For the Atari, change the origin to $0600 or any other available IK RAM. The Page Zero equates are okay. For the Commodore 64, $C000 is a handy origin for the program. Since Page Zero on the C64 is pretty full, the locations that you choose may depend on what else you are running. If you are not using the cassette tape and RS-232 port, for example, then the current equates of $B1 to $B4 should be okay.

The best way to make the adaptation is to key source into your assembler, change the equates and origin and re-assemble. This will give you a working version of CONTROL that you can then easily modify for other services: trace, single-step,

disassemble, trap and so forth. If you do not have an assembler, the listed code can be directly keyed in. Make sure that you change the instructions that have direct references (generally the instructions with a value of 08 to OB in the third byte of the instruction], plus the high byte address of BREAK that is referenced in the very first instruction.

[ E d i t o r ’s N o t e : T h is “ c y c lecou n tin g ” d em on stration o f the CONTROL program is only one very lim ited use o f this powerful technique. I f you find CONTROL useful and extend its operation, MICRO is eager to help you share your work with the rest o f the world. We are reserving space for C O N TR O L e n h a n c e m e n t s an d guarantee extrem ely rapid publication.]

JMCftO

o Listing 108ID B1 B1 LDA (PCTR),Y081F 48 PHAo ; Set BASE for IK program area 0820 29 F0 AND #$F0

0800 BASE EQU $0800 0822 F0 05 BEQ INDEX0800 ORG BASE 0824 4A LSR A

; Equates. PCTR, TEMPLO and 0825 4A LSR A; TEMPHI must be on Page ZERO 0826 4A LSR A

00B1 PCTR EQU $B1 0827 4A LSR A00B3 TEMPLO EQU PCTR+2 0828 A8 TAYo 00B4 TEMPHI EQU PCTR+3 0829 BE 33 0A INDEX LDX TABIN,Y

; Other equates can be anywhere, 082C 68 PLA; Including Page ZERO 082D E8 SCAN1 I NX

0BF0 TALLY EQU BASE+I3F0 082E DD 43 0A CMP INST1,Xo 0BF8 ACC EQU TALLY+8 0831 F0 05 BEQ SERVICE0BF9 XREG EQU TALLY+9 0833 B0 F8 BCS SCAN10BFA YREG EQU TALLY+IA 0835 4C CA 0B JMP ERRORo 0BFB STREG EQU TALLY+$B Start service when OPCODE foundV 0BFC STKPTR EQU TALLY+IC Save info from CYCLES table on

; Entry and Initialization stack. The JMP ACCYC is for the; Put BREAK address on stack for TALLY Counter. Other operationso ; call via RTI in user code could be used instead.

0800 A9 0A START LDA #BREAK/256 0838 BD DA 0A SERVICE LDA CYCLES,X0802 AE FC 0B LDX STKPTR 083B 48 PHA

A 0805 9A TXS 083C 4C 9F 0B JMP ACCYCo 0806 48 PHA Now Process instruction. First0807 A9 32 LDA #BREAK8c$00FF test if the instruction can be0809 48 PHA directly executed. If so, goo 080A A9 00 LDA #0 to TRANSF to execute.080C 48 PHA 083F A0 00 PROCESS LDY #0080D BA TSX 0841 68 PLA080E 8E FC 0B STX STKPTR 0842 30 03 BMI SUB0 ; Clear TALLY counter 0844 4C 8A 09 JMP TRANSF0811 A2 07 LDX #7 Instructions that change the PC0813 A9 00 LDA #0 counter must be individually

n 0815 9D F0 0B CLR STA TALLY,X serviced.. V 0818 CA DEX Test for JSR = $200819 10 FA BPL CLR 0847 B1 B1 SUB LDA (PCTR),Y

; Main Loop. Get 0849 C9 20 CMP #$20© ; OPCODE of current instruction 084B D0 33 BNE ABSJMP

; Lookup in tables 084D A5 B1 LDA PCTR081B A0 00 FETCH LDY #0 084F 85 B3 STA TEMPLO

38 MICRO No. 72 • June 1984

Page 41: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Listing 1 (continued)0851 A5 B2 LDA PCTR+1 08CB AE FC 0B LDX STKPTR0853 8D B4 00 STA TEMPHI 08CE 9A TXS0856 C8 INY 08CF 68 PLA O0857 B1 B1 LDA (PCTR),Y 08D0 85 B1 STA PCTR0859 48 PHA 08D2 68 PLA085A C8 INY 08D3 85 B2 STA PCTR+1 ©085B B1 B1 LDA (PCTR),Y 08D5 E6 B1 INC PCTR08 5D 85 B2 STA PCTR+1 08D7 D0 02 BNE CNGPTR085F 68 PLA 08D9 E6 B2 INC PCTR+10860 85 B1 STA PCTR 08DB BA CNGPTR TSX o0862 A5 B 3 LDA TEMPLO 08DC 8E FC 0B STX STKPTR0864 18 CLC 08DF 4C IB 08 JMP FETCH0865 69 02 ADC #2 ; Test RTI = $40 ©0867 85 B3 STA TEMPLO 08E2 C9 40 RTINT CMP #$40 V /

0869 90 03 BCC STACK 08E4 D0 15 BNE BRANCH086B EE B4 00 INC TEMPHI 08E6 AE FC 0B LDX STKPTR086E AD B4 00 STACK LDA TEMPHI 08E9 9A TXS o0871 AE FC 0B LDX STKPTR 08EA 68 PLA0874 9A TXS 08EB 8D FB 0B STA STREG0875 48 PHA 08EE 68 PLA /r\0876 A5 B3 LDA TEMPLO 08EF 85 B1 STA PCTR ©0878 48 PHA 08F1 68 PLA0879 BA TSX 08F2 85 B2 STA PCTR+1087A 8E FC 0B STX STKPTR 08F4 BA TSX ©087D 4C IB 08 JMP FETCH 08F5 8E FC 0B STX STKPTR

; Test JMP = $4C 08F8 4C IB 08 JMP FETCH0880 C9 4C ABSJMF CMP #$4C ; Must be a conditional Branch0882 D0 0F BNE INDJMP 08FB AD FB 0B BRANCH LDA STREG ©0884 C8 INY 08FE 48 PHA0885 B1 B1 LDA (PCTR),Y 08FF B1 B1 LDA (PCTR),Y0887 48 PHA ; Test BEQ = $F0 A0888 C8 INY 0901 C9 F0 CMP #$F00889 B1 B1 LDA (PCTR),Y 0903 D0 05 BNE BR1088B 85 B2 STA PCTR+1 0905 28 PLP088D 68 PLA 0906 F0 49 BEQ TRUE ©088E 85 B1 STA PCTR 0908 D0 39 BNE FALSE0890 4C IB 08 JMP FETCH ; Test BNE = $D0

; Test JMP I = $6C 090A C9 D0 BR1 CMP #$D0 o0893 C9 6C INDJMP CMP #$6C 090C D0 05 BNE BR20895 D0 30 BNE RTSUB 090E 28 PLP0897 C8 INY 090F D0 40 BNE TRUE0898 B1 B1 LDA (PCTR),Y 0911 F0 30 BEQ FALSE ©089A 48 PHA ; Test BCC = $90089B C8 INY 0913 C9 90 BR2 CMP #$90089C B1 B1 LDA (PCTR),Y 0915 D0 05 BNE BR3089E 85 B2 STA PCTR+1 0917 28 PLP 008A0 68 PLA 0918 90 37 BCC TRUE08A1 85 B1 STA PCTR 091A B0 27 BCS FALSE08 A3 A0 00 LDY #0 ; Test BCS = $B008A5 B1 B1 LDA (PCTR),Y 091C C9 B0 BR3 CMP #$B0 ©08A7 48 PHA 091E D0 05 BNE BR408A8 A5 B1 LDA PCTR 0920 28 PLP08AA C9 FF CMP #$FF 0921 B0 2E BCS TRUE ©08AC F0 0B BEQ RESET 0923 90 IE BCC FALSE08AE C8 INY ; Test

BR4BMI = $30

08AF B1 B1 LDA (PCTR),Y 0925 C9 30 CMP #$3008B1 85 B2 STA PCTR+1 0927 D0 05 BNE BR5 o08B3 68 PLA 0929 28 PLP08B4 85 B1 STA PCTR 092A 30 25 BMI TRUE08B6 4C IB 08 JMP FETCH 092C 10 15 BPL FALSE o08B9 A9 00 RESET LDA #0 ; Test BPL = $1008BB 85 B1 STA PCTR 092E C9 10 BR5 CMP #$1008BD B1 B1 LDA (PCTR),Y 0930 D0 05 BNE BR608BF 85 B2 STA PCTR+1 0932 28 PLP Q08C1 68 PLA 0933 10 1C BPL TRUE08C2 85 B1 STA PCTR 0935 30 0C BMI FALSE08C4 4C IB 08 JMP FETCH ; Test BVC = $50 O; Test RTS = $60 0937 C9 50 BR6 CMP #$5008C7 C9 60 RTSUB CMP #$60 0939 D0 05 BNE BR708C9 D0 17 BNE RTINT 093B 28 PLP

No. 72 - June 1984 MICRO 39

Page 42: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Listing 1 continued) 09A4 4C 9B 09 JMP MOVE093C

; If less than three bytes of50 13 BVC TRUE ; instruction, pad with NOP's

© 093E 70 03 BVS FALSE 09A7 C0 03 FILLED CPY #30940

; Must be BVS = $70 09A9 F0 0A BEQ POINT28 BR7 PLP 09 AB A9 EA LDA #$EA

I r, 0941 70 0E BVS TRUE 09 AD 99 1A 0A PUT STA EXBUF,Yviz ; On branch condition FALSE, simply 09B0 C8 INY; set PC counter to next instruction 09B1 C0 03 CPY #3

0943 A5 B1 FALSE LDA PCTR 09B3 D0 F8 BNE PUT© 0945 18 CLC ; Calculate address of next

0946 69 02 ADC #2 ; instruction0948 85 B1 STA PCTR 09B5 68 POINT PLA094a 90 2C BCC FCH 09B6 18 CLC

© 094c E6 B2 INC PCTR+1 09B7 69 01 ADC #1094E 4C IB 08 JMP FETCH 09B9 65 B1 ADC PCTR

; On branch condition TRUE, calculate 09BB 85 B1 STA PCTR© ; new PC relative to current address 09BD 90 02 BCC OVERPGU 0951 C8 TRUE INY 09BF E6 B2 INC PCTR+1

0952 B1 B1 LDA (PCTR),Y ; Use Opcode info from table to0954 48 PHA ; see if Page boundary check is

© 0955 A5 B1 LDA PCTR ; necessary.0957 18 CLC 09C1 A5 B3 OVERPG LDA TEMPLO0958 69 02 ADC #2 09C3 29 40 AND #$40095A 85 B1 STA PCTR 09C5 F0 41 BEQ RUN

® 095C 90 02 BCC DIRECT ; Service indexed instructions095E E6 B2 INC PCTR+1 09C7 AD 1A 0A LDA EXBUF

; Test branch direction 09CA E8 SCAN2 I NX© 0960 68 DIRECT PLA 09CB DD 71 0B CMP INST2,X

0961 10 18 BPL FORWRD 09CE F0 02 BEQ MODE; Backward branch service 09D0 B0 F8 BCS SCAN2

0963 49 FF EOR #$FF 09D2 BD 88 0B MODE LDA ADRMOD,X© 0965 18 CLC 09D5 F0 IB BEQ IND

0966 69 01 ADC #1 09D7 A5 B3 LDA TEMPLO0968 85 B3 STA TEMPLO 09D9 29 20 AND #$20

_ 096A A5 B1 LDA PCTR 09DB D0 06 BNE ADDXQ 096C 38 SEC ; Add Y reg to operand

096D E5 B3 SBC TEMPLO 09DD AD FA 0B LDA YREG096F 85 B1 STA PCTR 09E0 4C E6 09 JMP ADDY

© 0971 B0 05 BCS FCH ; Add X reg to operand0973 C6 B2 DEC PCTR+1 09E3 AD F9 0B ADDX LDA XREG0975 20 BA 0B JSR OVER 09E6 18 ADDY CLC0978 4C IB 08 FCH JMP FETCH 09E7 6D IB 0A ADC EXBUF+1

© ; Forward branch service 09EA 90 1C BCC RUN097B 18 FORWRD CLC 09EC 20 BA 0B JSR OVER097C 65 B1 ADC PCTR 09EF 4C 08 0A JMP RUN

_ 097E 85 B1 STA PCTR ; Indirect Indexed Address mode® 0980 90 F6 BCC FCH 09F2 AD IB 0A IND LDA EXBUF+1

0982 E6 B2 INC PCTR+1 09F5 85 B3 STA TEMPLO0984 20 BA 0B JSR OVER 09F7 A9 00 LDA #0

© 0987 4C IB 08 JMP FETCH 09F9 8D B4 00 STA TEMPHI: Move current instruction to 09FC A8 TAY; buffer for execution. Use 09FD B1 B3 LDA (TEMPLO),Y; Opcode information from table 09FF 18 CLC

© ; to determine number of bytes of 0A00 6D FA 0B ADC YREG; instruction to move to buffer 0A03 90 03 BCC RUN

098A 85 B3 TRANSF STA TEMPLO 0A05 20 BA 0B JSR OVER© 098C B1 B1 LDA (PCTR),Y ; Restore all registers

098E 8D 1A 0A STA EXBUF 0A08 AE FC 0B RUN LDX STKPTR0991 C8 INY 0A0B 9A TXS0992 A5 B3 LDA TEMPLO 0A0C AD FB 0B LDA STREG

© 0994 29 18 AND #$18 0A0F 48 PHA0996 4a LSR A 0A10 28 PLP0997 4a LSR A 0A11 AE F9 0B LDX XREG

_ 0998 4A LSR A 0A14 AC FA 0B LDY YREG° 0999 48 PHA 0A17 AD F8 0B LDA ACC

099A AA TAX ; Execute direct instruction099B CA MOVE DEX ; stored in next three bytes

© 099C 30 09 BMI FILLED 0A1A 00 00 00 EXBUF BYT 0,0,0099E B1 B1 LDA (PCTR),Y ; Save all registers09A0 99 1A 0A STA EXBUF,Y 0A1D 8D F8 0B STA ACC09A 3 C8 INY 0A20 8C FA 0B STY YREG

40 MICRO No. 72 ■ June 1984

Page 43: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Listing 1 (continued)0A23 0B

0B1A 8B 4D 0C BYT $8B,$4D,$0C,$0E8E F9 STX XREG 0B1E 02 54 74 BYT 2,$54,$74,$170A26 08 PHP 0B22 0E 0B 0B BYT $0E,$0B,$0B,$0B O0A27 68

0BPLA 0B26 02 02 14 BYT 2,2,$l4,$l4,$l4

0A28 8D FB STA STREG 0B2B 8B 0E 0C BYT $8B,$0E,$0C,$0C0A2B BA

0BTSX 0B2F 0C 02 15 BYT $0C,2,$15,2,$15 o0A2C 8E FC STX STKPTR 0B34 0A 0E 0A BYT $0A,$0E,$0A,$0B

0A2F 4C IB; And back to Main Loop 0B38 0B 0B 02 BYT $0B,$0B,2,$0A

08 JMP FETCH 0B3C 02 14 14 BYT 2,$14,$14,$14; Ccme here when an RTI is encountered 0B40 8B 4D 0C BYT $8B,$4D,$0C,$0C o

0A32; in the User Program being tested 0B44 0C 02 54 BYT $0C,2,$54,2,$7400 BREAK BRK 0B49 74 54 0A BYT $74,$54,$0A,$0E

0A33 FF 08 10; Index values to speed opcode search 0B4D 0B 0B 0D BYT $0B,$0B,$0D,2,$0ATABIN BYT $FF,8,$10,$1B 0B52 02 14 14 BYT 2,$14,$14,$16 VJ

0A37 23 2D 35 BYT $23,$2D,$35,$3F 0B56 8B 4D 0C BYT $8B,$4D,$0C,$0E0A3B 47 50 59 BYT $47,$50,$59,$65 0B5A 02 54 74 BYT 2,$54,$74,$170A3F 70 7B 83 BYT $70,$7B,$83,$8E 0B5E 0A 0E 0B BYT $0A,$0E,$0B,$0B o0A43 00 01 05

; All of the valid opcodes 0B62 0D 02 0A BYT $0D,2,$0A,2INST1 BYT 0,1,5,6,8 0B66 14 14 16 BYT $14,$14,$16

0A48 09 0A 0D BYT 9,$0A,$0D,$0E 0B69 8B 4D 0C BYT $8B,$4D,$0C,$0E o0A4C 10 11 15 BYT $10,$11,$15,$16 0B6D 02 54 74 BYT 2,$54,$74,$170A50 18 19 ID BYT $18,$19,$1D,$1E Opcodes that require page boundary0A54 20 21 24 BYT $20,$21,$24,$25 crossover check0A58 26 28 29 BYT $26,$28,$29,$2A 0B71 11 19 ID INST2 BYT $11,$19,$1D,$31 o0A5C 2C 2D 2E BYT $2C,$2D,$2E 0B75 39 3D 51 BYT $39,$3D,$51,$59,$5D0A5F 30 31 35 BYT $30,$31,$35,$36 0B7A 71 79 7D BYT $71,$79,$7D,$B10A63 38 39 3D BYT $38,$39,$3D,$3E 0B7E B9 BC BD BYT $B9,$BC,$BD,$BE0A67 40 4l 45 BYT $40,$41,$45,$46,$48 0B82 D1 D9 DD BYT $D1,$D9,$DD o0A6C 49 4a 4C BYT $49, $4A, $4C, $4D, $4e 0B85 FI F9 FD BYT $F1,$F9,$FD0A71 50 51 55 BYT $50,$51,$55,$56 Addressing mode table0A75 58 59 5D BYT $58,$59,$5D,$5E 0 = Indirect Indexed addressing o0A79 60 61 65 BYT $60,$61,$65,$66,$68 FF = Absolute Indexed addressing0A7E 69 6A 6C BYT $69,$6A,$6C,$6D,$6E 0B88 FF 00 00 ADRMOD BYT $FF,0,0,$FF0A83 70 71 75 BYT $70,$71,$75,$76 0B8C 00 00 FF BYT 0,0,$FF,0,00A87 78 79 7D BYT $78,$79,$7D,$7E 0B91 FF 00 00 BYT $FF,0,0,$FF o0A8B 81 84 85 BYT $81,$84,$85,$86 0B95 00 00 00 BYT 0,0,0,00A8F 88 8A 8C BYT $88,$8A,$8C,$8D,$8E 0B99 FF 00 00 BYT $FF,0,0,$FF,0,00A94 90 91 94 BYT $90,$91,$94,$95 Service specific code goes here0A98 96 98 99 BYT $96,$98,$99,$9A,$9D This version is a cycle counter O0A9D A0 A1 A2 BYT $A0,$A1,$A2,$A4 0B9F A2 07 ACCYC LDX §70AA1 A5 A6 A8 BYT $A5,$A6,$A8,$A9 0BA1 29 07 AND #70AA5 AA AC AD BYT $AA,$AC,$AD,$AE 0BA3 18 CLC0AA9 B0 B1 B4 BYT $B0,$B1,$B4,$B5 0BA4 7D F0 0B ADC TALLY,X y0AAD B6 B8 B9 BYT $B6,$B8,$B9,$BA 0BA7 9D F0 0B STA TALLY,X0AB1 BC BD BE BYT $BC,$BD,$BE 0BAA 90 0B BCC ACCEND0AB4 C0 Cl C4 BYT $C0,$C1,$C4,$C5 0BAC CA ADDU DEX o0AB8 C6 C8 C9 BYT $C6,$C8,$C9,$CA 0BAD 10 03 BPL PROC0ABC CC CD CE BYT $CC,$CD,$CE 0BAF 4C CA 0B JMP ERROR0ABF D0 D1 D5 BYT $D0,$D1,$D5,$D6 0BB2 FE F0 0B PROC INC TALLY,X0AC3 D8 D9 DD BYT $D8,$D9,$DD,$DE 0BB5 F0 F5 BEQ ADDU o0AC7 E0 El E4 BYT $E0,$E1,$E4,$E5 0BB7 4C 3F 08 ACCEND JMP PROCESS0ACB E6 E8 E9 BYT $E6,$E8,$E9,$EA Specific service to count cycles0ACF EC ED EE BYT $EC,$ED,$EE This increments the count when ao0AD2 F0 FI F5 BYT $F0,$F1,$F5,$F6 page boundary is crossed.0AD6 F8 F9 FD BYT $F8,$F9,$FD,$FE Most routines could just put a

; Opcode information bytes RTS in place of OVER0ADA 07 0E 0B CYCLES BYT 7,$0E,$0B,$0D,3 0BBA A2 07 OVER LDX #7 o0ADF 0A 02 14 BYT $0A,2,$l4,$l6 0BBC FE F0 0B TAL INC TALLY,X0AE3 8B 4D 0C BYT $8B,$4D,$0C,$0E 0BBF D0 08 BNE LEAVE0AE7 02 54 74 BYT 2,$54,$74,$17 0BC1 CA DEX /H0AEB 96 0E 0B BYT $96,$0E,$0B,$0B,$0D,4 0BC2 10 F8 BPL TAL o0AF1 0A 02 14 BYT $0A,2,$l4,$l4,$l6 0BC4 68 PLA0AF6 8B 4D 0C BYT $8B,$4D,$0C,$0E 0BC5 68 PLA0AFA 02 54 74 BYT 2,$54,$74,$17 0BC6 4C CA 0B JMP ERROR o0AFE 86 0E 0B BYT $86,$0E,$0B,$0D,3 0BC9 60 LEAVE RTS0B03 0A 02 93 BYT $0A,2,$93,$14,$16 Machine and Routine specific error0B08 8B 4D 0C BYT $8B,$4D,$0C,$0E handler. Can be just BRK.0B0C 02 54 74 BYT 2,$54,$74,$17 0BCA 00 ERROR BRK o0B10 86 0E 0B BYT $86,$0E,$0B,$0D,4 That's all !0B15 0A 02 95 BYT $0A,2,$95,$l4,$l6 0BCB END

No. 72 ■ June 1984 MICRO 41

Page 44: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

o

©

Commodore 64 Beeper

Note: There is not enough room at the end of the main program for this code since 0BF0 ... is used for storage.Put a JMP ERRORX at the current ERROR BRK location pointing to this code which may be relocated in any available memory.

0000 A9 00 ERRORX LDA #$000002 AA TAX0003 9D 00 D4 CLEARS STA $D400,X0006 E8 INX0007 E0 19 CPX #$190009 D0 F8 BNE CLEARS000B A9 09 LDA #$09000D 8D 05 D4 STA $D4050010 A9 0F LDA #$0F0012 8D 18 D4 STA $D4l80015 A9 B1 LDA #$B10017 8D 00 D4 STA $D400001A A9 19 LDA #$19001C 8D 01 D4 STA $D401001F A9 21 LDA #$210021 8D 04 D4 STA $D4040024 A2 00 LDX #$000026 A0 00 LDY #$000028 C8 WAITS INY0029 D0 FD BNE WAITS002B E8 INX002C D0 FA BNE WAITS002E 00 BRK

y Atari Version of Beeper

0BCA A9 00 ERROR LDA #00BCC 8D 08 D2 STA $D2080BCF A9 03 LDA #30BD1 8D 0F D2 STA $D20F0BD4 A9 A8 LDA #$A80BD6 8D 01 D2 STA $D2010BD9 A9 79 LDA #1210BDB 8D 00 D2 STA $D2000BDE 00 BRK

; Apple II Version of Beeper

0BCA 20 E4 FB ERROR JSR $FBE4 0BCD 00 BRK

M eZ B l S u r e

i t i s i n s u r e d ?SAFEWARE™ Insurance provides full replacement of hardware, media and

purchased software. As little as $35/yr covers:• Fire • Theft • Power Surges

• Earthquake • Water Damage • Auto Accident

For information or immediate coverage call:

1-800-848-3469In Ohio call (614) 262-0559

SAFEWARE, THE INSURANCE AGENCY INC.

Let MICRO Reflect

Your Com puting Needs.

Fill out the Reader Survey

and tell us what you want.

(see page 64A)

42 MICRO No. 72 • June 1984

Page 45: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

• » v t n i n

by Paul Lamar and Richard Finder

Two seasoned computerists share their insights into the world of the 16 bit 68000 Supermicro.

Editor's Note: While we normally do not publish articles that are essentially “one m an ’s o p i n i o n ' we are m aking an exception in this case because 1) it touches on a very important area, the 68000, and 2) they are eminantly qualified to talk about the issues.

It may have been a result of reading an over-abundance of IBM PC ads that caused people, without knowledge of assembly language or microprocessor architecture, to blatantly predict that MS-DOS on the eight bit 8088 chip will become the measure by which all sixteen bit microcomputers will be judged during the coming decade. That view is simply wrong, and such comments (especially by people who should know better) may be the result of an understandable impatience with the performance of slow, memory limited, eight bit microcomputers -but to declare that the 80XXX is going to be the de facto industry standard is short­sighted at best, and misleading at worst.

For those preparing to buy a serious microcomputer for the first time (not just an elaborate toy), be aware that even though the IBM PC and all its clones use 8088 chips, they use them as eight bit CPUs. (IBM claims the 8088 in the PC is sixteen bits, but it just isn't so. The 1983 Intel Microprocessor and Peripheral Handbook clearly states, on page 3-79, that the 8088 is an eight bit microprocessor, and they should know. They invented the chip). IBM justifies this claim by citing the 16 bit internal registers in the 8088. The Commodore 6502 used in the Apple and the Commodore 64 has one, sixteen bit register (the program counter). The 6502 is not called a sixteen bit microprocessor. The Motorola 6809 used in the Radio Shack Color

Computer has six, sixteen bit registers and it is not called a 16 bit microprocessor. Why call an 8088 a sixteen bit microprocessor?

Watch Large Computer Corps. (LCCs) carefully,- they take advantage of ignorance every chance they get. Rather than try to educate the user, the LCC uses seduction to persuade the buyer into a purchase not suited to the individual's needs or desires. A corollary of the business maxim "buy low, sell high” is "sell as little as possible for as much as you can get” . It is the buyer's responsibility (in computers, as well as cars, houses, and health insurance) to learn something about microcomputers before writing out that first check. Any LCC ad which doesn't set forth facts about number-of- characters-on-the-screen, disk storage capacity, RAM, ROM, megabytes and megahertz is hiding something (probably mediocre performance or operational deficiencies).

There is a common myth that speed and power in a microcomputer are not really necessary when "all you are going to use that microcomputer for is word processing". A fast typist types about 60 words a minute. If each word is an average of five characters in length; that means that one character is going into the computer every 200,000 micro seconds. When you are typing characters into a wordprocessing program , it takes a ty p ical microprocessor and program about 10,000 micro seconds to process that

character. The other 190,000 micro seconds the processor is twiddling its thumbs so to speak. Why not put that time to good use by a fast and powerful microprocessor. How many characters of spelling or grammar could that micro check in those remaining 190,000 micro seconds?

It's not a matter of being a microcomputer speed freak, but of not wanting to waste time while some infernal machine which knows nothing about time and couldn't care less does something useful. "Disgruntled" is an eleven-letter word for the owner of a micro-word processor who has to look up a word in a dictionary because the human works faster than the computer. There is nothing more useless than a $150 spelling checker which isn't used - because the machine is too slow.

The dream word processing program is one which checks the spelling of the word as it's being typed in. Ideally, it could not only check the spelling of the word, but could finish writing out the word. For example, the writer would begin the word "spelli” ; the computer would fill in "ng” and the cursor would jump to the next word position (there's only one word spelled "spelling"). Of course, turning off such a feature would be a necessary option. As an alternative, a misspelling could cause a word to be flagged or prompt a beep, and optionally show the suggested correction as part of a dictionary in a window, along with the

No. 72 - June 1984 MICRO 43

Page 46: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

definition(s) of the word.Computers are tools to increase

p ro d u ctiv ity . An au to m o bile manufacturer who designed a factory to produce automobiles 20% slower than that of the competition faces business failure. As a writer, accountant, or business manager, why buy an eight bit 8088 based microcomputer that is one fourth as fast as a true sixteen bit 68000 based supermicro?

As was said by the philosopher, Dionysius of Halicarnassus, "...history is philosophy learned from examples". The philosophical point espoused here is the superiority of the 68000 chip for state-of-the-art microprocessing. My own history (which brought me to this point of view), is that several years ago I was part owner of one of the first Apple peripheral and softw are manufacturing firms. Our company bought one of the first two hundred Apple II processor boards made, which was delivered with 4K of RAM, with no keyboard, power supply or case. Documentation consisted of a printed color brochure and some photocopied pages in a plastic-covered binder off a drug store shelf. No system monitor source listing came with the computer,- a complaint to Steve Wozniak brought a photocopy of it.

Before the Apple II, I wire wrapped an Intel 4040 and RCA CMOS 1801 (not an 1802) microprocessors. The 4040 was a nightmare with many different silicon technologies that required voltage level shifting among the various required chips. Intel's promotion literature did not mention this. Only after you bought the $100 chip and received the data sheet did this become apparent. I bought an early IK RAM, 2K ROM, MOS Technology KIM-1.

The KIM-1 was a revelation and very easy to use. I wrote a real-time, m u lti-ta sk in g , in terru p t-d riv en program on the KIM-1 using the KIM-l's hex keypad and 6 digit LEDs. That program required six months to write, yet it was only 2K bytes in length (I kludged on another IK RAM).I designed and manufactured an industrial microcomputer called the SUPERKIM which we are still manufacturing.

We bought the Apple II board because we needed a more powerful microcomputer than the KIM-1 to w rite 6502 assem bly language software. (Writing and assembling programs is one of the most demanding tasks you can ask of any computer.]

We attached a homemade power supply, a surplus keyboard, and a used video monitor to our new Apple II board - and it worked. We wrote a crude printer driver routine using the built-in miniassembler for a South West Technical Products PR 40 printer, then designed a very simple printer interface board for the Apple II. To my knowledge, this was the first printer interface ever sold for the Apple II.

We searched for a symbolic assembler to use on the Apple. (We where not sure at that time what a symbolic assembler was, but our friends assured us that it was something we needed.) A symbolic assembler allows you to jump to a name (symbol) of a routine within a program, rather than to its address. (Jumping to the address of a routine is what you do in BASIC when you say GOTO 1010.) Unlike an address, the name of a routine doesn't change regardless of how much code you put in front of it. Most symbolic assemblers automatically calculate the branch addresses as well, unlike the mini assembler in ROM, in the Apple II.

Bob Bishop and I typed in a four character symbolic assembler written by Carl Moser (lately of Eastern House Software], and Bob (later of Apple Vision fame] made it work. Our assembler was a big step above the Apple mini-assembler, and we sold many of those four-character symbolic assemblers. This too was a first for the Apple II.

So it went for several years until other computers arrived on the market and we slowly began to realize what we were missing: eighty columns on the display, a screen editor, larger disk and RAM storage and speed. Eighty columns was particularly missed when writing assembly language text files as there was no room for comments on the right side of the screen. We needed larger disk storage because a 2K assembly language program occupies about 32K of commented text file on a disk. We did not want to utilize any of the third party solutions to these problem s due to p o ten tia l incompatibility with our then present software-and there was a tendency of Apple II software vendors to copy- protect their product, making their software impossible to store on hard disk or make back up copies.

By this time we had become au thorized dealers for Apple, Commodore, Zenith and Kaypro, in addition to manufacturing and selling

our own CP/M, eight inch drive, Z80 system; all of these were too slow. The Commodore 8032/8050 was the best of the bunch thanks to the legendary Chuck Peddle, designer of the 6502 (then working for Commodore). It had an amazing 500K on each single sided five-inch disk. Poor Chuck made a big mistake on the Victor when he designed in the eight bit 8088 rather than the 68000 (he's now an ex­president of Victor-and Victor is in Chapter 11), apparently a victim of the IBM mystique. The Commodore 8032 lacked the speed or RAM memory desired to justify switching from the Apple II.

The imminent arrival of the Apple III carried hopes that it would have a 68000 microprocessor, but it had instead a 6502A microprocessor-only 143K on the disk, memory bank switching, and a steep price tag. Several computer store owners actually shouted epithets at Apple's Barry Zargoni when he introduced the Apple III at the pre-release dealer's meeting. Apple management ignored their dealers.

While the Apple III had a few hardware problems when it was first announced, those were not the main reason for its disappointing sales. In the very early days of the Apple II some wordprocessing programs—horribly slow- were written with interpreted integer BASIC. An operating system, a high level language or a wordprocessing program written with a high level language (an HLL, such as BASIC) results in very slow performance. The only proper way is to use assembly language. Thus, the Apple III BASIC ran about the same speed as Applesoft on the Apple II despite the fact that the processor was twice as fast.

The Apple III BASIC was written with a HLL and compiled. There were no schematics or source listings provided for the Apple III, nor even instructions for using the built-in system monitor. How could we design peripherals or write assembly language software (or even fix it if it broke)? When the wonderful Apple II came out, it was accompanied by all these am enities. Furthermore, for the assembly language programmer, the Apple Ill's memory bank switching was a horrible feature. Memory bank switching stemmed from Apple's choice of the eight bit 6502A. Since the 6502A could directly address only 64K bytes, memory bank switching was necessary, and meant that the

44 MICRO No. 72 ■ June 1984

Page 47: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

programmer had to keep track of which bank his subroutine was in (the one that he would like to call) and which bank he himself was in, when he called that subroutine to return to the bank in which he had been working. Such systems limit the practical size of a non-bank switched program to just 64K~but the Apple III had 256K of bank switched RAM!

Assume m om entarily that a controlling operating system program is 16K bytes long. It can never be switched; that would be like jumping to an undefined area of memory with no meaningful program stored in it. Another 16K bytes is allocated to program modules which do different things, whether in the control system or elsewhere, and can be switched as needed. This leaves only 32K in a standard 64K system for text files. To search through a large dictionary, one must bank-switch that dictionary in from the disk or from another bank of RAM memory, 32K bytes at a time. The larger the program modules, the smaller the text files must be. Imagine the frustration of sorting something larger than 32K

Thus, the statement that memory bank switching was ''horrible''; it's a piece of hardware designed to give an assem bly language programmer nightmares, besides being slower than storage in a large linear address space, such as is available on the 68000. If only Apple had used the 68000 in the Apple III and had written the system software in assembly language they would now be in an unassailable position, instead of second place and dropping. (Significantly, they now use the 68000 in their Macintosh, but have yet to introduce an operating system with any significant amount of software to match the chip... but that's a different story, having to do with the P-System).

In Motorola's sixteen bit 68000 microprocessor, the assembly language instructions set is similar to the 6502, but immensely more powerful. The 68000 is about one fourth as difficult to program in assembly language as the 6502, yet about four times faster to program for any given application. The 68000 was designed four or five years ago with thirty-two bit internal architecture, while Intel and Zilog were designing th e ir s ix te en bit microprocessors with sixteen bit internal architecture. Because the 68000 has thirty-two bit internal registers, including the address

counter, it can address sixteen megabytes without memory bank switching.

A thirty-two bit address bus implies four gigabytes (four thousand megabytes) of address space, though only twenty-three address lines and upper and lower byte address strobes are brought outside the chip; hence sixteen megabytes. All of the following microprocessors can only address 64K without memory bank switching: eight bit Intel 8088, 80188; sixteen bit Zilog Z8000, or Intel 8086, 80186, 80286, 80386.

Intel advertises one megabyte-plus addressing on these last-mentioned chips because they built in that horrible bank switching circuitry. Intel calls it "segm enting” , but the programmer still has to do the dirty work. The longest internal register these chips contain is sixteen bits, therefore, the most memory they can address is 64K bytes. For this and other reasons their assembly language instruction set is unorganized and inconsistent compared to the 68000. [Besides, the 68000 is twice as fast as a sixteen bit 8086-not to mention the much slower eight bit 8088 IBM uses in the IBM PC).

A fifty dollar 12.5 mhz 68000 is as fast as a $150,000 Digital Equipment Corporation (DEC) VAX 11/780 CPU. Furthermore, the VAX 11/780 can only address eight megabytes; the 68000 addresses sixteen megabytes. It may be hard to believe, but it's true. A sixteen megahertz version of the 68000 is in the sampling stages already.

Hardware floating point operations on the 68000 are three times faster than the 8086/8087 combination because National Semiconductor's 16081, high speed math chip (sixty-four bit floating point multiply in twenty three microseconds) works faster with the 68000 than with National's own sixteen bit microprocessor.* Software written for the present 68000 will have a long and useful life because it is upwardly compatible with the full 32 bit address (4 gigabytes) and data bus version of the 68000 (the Motorola 68020). Not only that, but the 68020 is four times faster than the 68000. Consequently, the 68020 has a three or four year head start on software compared to any other full 32 bit

* DTACK GROUNDED, The Journal o f S im p le 6 8 0 0 0 S y stem s . I s su e 24, October-1983. DTACK GROUNDED 1415E. McFadden, Ste. F, Santa Ana, CA 92705

microprocessor. No other 32 bit microprocessor on the horizon is sufficiently better or faster than the 68020 to overcome the software lead the 68020 enjoys.

Unfortunately, greed is still around, and getting worse. Most large software houses think like this; “Knock it out with an HLL—nobody will notice how slow it is until after we make a k illin g ". Such software houses therefore need increasingly faster microprocessors so they can justify writing new word-processing programs and operating systems in a new HLL, that was written in an old HLL.

About two years ago we read an ad in "Byte" for theSAGEsupermicro and co n tacted SAGE Com puter for inform ation. We were in itia lly impressed because it came with the P -System , w ordprocessing,spreadsheet, PASCAL and a 68000 macro assembler, along with an assortment of other software. When we saw the extensive documentation, the schematic, the memory map, the powerful system monitor in 16K byte EPROM, and the monitor source listing-in other words, a completely open system-we were sold.

The experience was like that of a few years before, when we were first introduced to the Apple n, except that with the SAGE we were given an extensive assortment of software and a built in printer interface just to start up our acquaintance. In short, we bought a SAGE and have been pleased with the supermicro to this day; it has proven its reliability and speed.

We use it with a 6502 macro cross assembler to write all our software for other uses, and for wordprocessing. We were even able to upload 6502 assembly language text files to the SAGE and cross assemble them after a few changes with the editor. (An unexpected bonus, most welcome). BASIC and PASCAL text files were also uploaded. The secret to doing this is to use the Apple II serial printer interface and a free utility on the P-system called "TEXTIN". The P-system, program editor's replace function is easily used to change 6502 assembly language pseudo-ops and Applesoft BASIC commands to conform to P-system language requirements.

Floppy disk access and load time (20K per sec) execute on the SAGE about ten times faster than on the Apple II disk operating system (DOS],

(continued on page 51)

No. 72 ■ June 1984 MICRO 45

Page 48: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

C A D /C A M ! D O N 'T S P E N D 2 5 k , 5 0 k

o r $ 5 0 0 , 0 0 0 B E F O R E Y O U S P E N D $ 7 9 °

OBJECTIVESThis book will provide managers, engineers, manufacturing personnel and any interested persons an understanding of the fundamentals of Computer Aided Design [CAD] and Computer Aided manufacturing [CAM] applications and technology.

PROGRAM DESCRIPTIONThe program will expose you to the various CAD/CAM terminologies used. Hardware and software comparisons will be explored with heavy emphasis on their advantages and disadvantages. Cost justification and implementation are presented using case studies.

WHO SHOULD PARTICIPATEThe course is designed for but not limited to:

— Those managers, engineers and research professionals associated with the manufacturing industry.

— Personnel from Product, Tool Design, Plant Layout and Plant Engineering who are interested in CAD/CAM.

ADVANTAGES— END RESULTThis program will enable participants to:

1. Learn basic CAD/CAM Vocabulary.

2. Better understand the various hard­ware and software components us­ed in a typical CAD work station.

3 .Select the existing CAD/CAM system most appropriate for cur­rent and projected needs.

4. Make an effective cost justification as to Why they SHOULD or SHOULD NOT implement a CAD/CAM system.

5. Apply and use computer graphics as a productivity tool.

PROGRAM CONTENT1. Introduction

a. History of CAD/CAMb. Importance of CAD/CAM

2. Graphics work station peripheralsa. Inputb. Outputc. Advantages and disadvantages

of input and output devices.

3. Computer Graphics Systems [Hardware]a. Microsb. Minisc. Main Framesd. Turnkey Graphics systems

4. Softwarea. Operating systemsb. Graphics Packagesc. Graphics Modules

5. Computer Aided Designa. Geometric Definitions

[Points, Lines, Circles, ETC..]b. Control functionsc. Graphics Manipulationsd. Drafting Functionse. Filing functionsf. Applications

zB

CONTINUING EDUCATION FOR BETTER

JCAD / CAM:

A PRODUCTIVITY ENHANCEMENTTOOL

6. Implementationa. Determining needsb. Purchasing and Installingc. Getting Started

7. Cost Justification and Surveya. Cost comparisons of two and f

work station systems.b. Presentation of recent survey

CAD system users

ZANIM SYSTEMS MAKES THIS SPEC OFFER: IF YOU BUY CAD/CAM: PRODUCTIVITY ENHANCEMEI TOOL BEFORE APRIL 15TH, WE W INCLUDE FREEOFCHARGEJHESE T\ PAPERS PUBLISHED NATIONALLY ZANIM SYSTEMS CAD/CAM EXPER

1. “Creation of a Large Data Basea Small Graphics System”

2. “Shortest Path Algorithm UsincComputer Graphics"

Of course you could spend as much $495, $595 or $695 for a similar 3 seminar even though this book is nc computer program.

We tell you April 15th for a spe reason...this product may be ■ deductible depending on your field needs. This 170 page course will sat any of your CAD/CAM needs. ' guarantee it.

Please send $79 to:ZANIM S Y S T E M S CAD/CAM GROUP P .O . BO X 4 3 6 4 FLINT, M l 4 8 5 0 4 [ 3 1 3 ] 2 3 3 - 5 7 3 1

QUANTITY DISCOUNTS AVAILABLE FOR COLLEC UNIVERSITIES AND/OR SEMINAR USE.

Page 49: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

P r o g r a m m i n g

w i t h

M a c r o s

by Patricia Westerfield

You can make your assembly language more efficient, cleaner, easier to debug.

Introduction

The techniques and examples described in this article use the ORCA/M Macro Assembler for the Apple II, from Hayden Software Co. The ORCA assembler has its own specific macro language, explained fully in the manual, which allows the programmer to write macros tailored specifically to his needs. But, because the system sup­plies over 150 macros with complete subroutine library support, the typical assembly language programmer will probably never need to write a macro. For this reason, this article will focus on the ways in which macros can be us­ed to enhance and simplify assembly language programming, and not the symbolics of the macro language.

Replace HEX Addresses

The first, and perhaps simplest, reason to use a macro is to replace an easily forgotten address. The Apple monitor contains 32 subroutines, documented by Apple, for use by the assembly language program m er. T hese subroutines range from generating a carriage return to drawing a horizontal line of low resolution graphics blocks. To access these routines, the correct memory location or 6502 registers are loaded, followed by a jump to subroutine instruction and the hex­adecimal number which is the subroutine's starting address. The Ap­ple monitor will then perform the desired functions and return to the in­struction immediately following that from which it was called.

The COUT macro is used to il­lustrate this point; it prints out the character contained in the A register. Without a macro, the code to initiate this subroutine would look like:

LDA # 'A ■

JSR $FDED

In this example the A register is loaded with the character A '. This is followed by the jump to subroutine call, which goes to the memory loca­tion $FDED where the subroutine in the Apple monitor performs the necessary instructions to print out the A ' character.

To circumvent the problem of hav­ing to remember the 32 hexadecimal addresses needed to access the monitor subroutines, a macro can be used to replace the address with a short name which describes the function of the subroutine. This name is more easily remembered, saving the programmer time and reducing the chance of error. When using a macro to call the character out subroutine, the LDA and JSR instructions are replaced by a single macro:

COUT §'k'

Replace Repetitive Code

Another use of macros is to replace repetitive bits of code that are too small

Key to Understanding

Macros are a group of commands in assembly language assigned a mnemonic which can then be used alone in a program. When the program is run, those commands assigned to the Macro mnemonic are processed in a manner similar to a subroutine. Macros become a tremendously powerful tool for the programmer when the way that they can be used is understood. Assembly language programming is often avoided because of its simplistic and tedious nature. But for many programmers it has become a necessity because of memory limitations and the requirement for fast programs. Maintaining a program or system written in any language can be difficult and time consuming. Problems encountered are compounded when the program is written in assembly language. Macro instructions change this by enabling the programmer to retain the efficency of assembly language while providing the capacity to emulate some features of higher level languages.

Macros also alleviate debugging and other problems by bringing about a standardization of code. Operations used repeatedly throughout the program are handled in the same manner, and are, therefore, easily identified. The code is much shorter with mnemonicaily named macros and considerably easier to read. This, combined with the basic comment structure all assembers provide, puts structured programming within the reach of every assembly language programmer.

No. 72 - June 1984 MICRO 47

Page 50: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

to require w riting a separate subroutine. Suppose a program re­quired getting the characters from a line one at a time. The code needed to get the next character from a line of in­put and load it into the A register would need to be duplicated in several places throughout the program.

Below is an example of what the code to perform this function might look like:

INC CCHARLDX CCHAR

LDA L IN E.X

A line of input can contain up to 255 characters. In this example CCHAR (current character] is the index number of the position in the line the computer is looking at. The first in­struction increments CCHAR so it is now pointing to the next character. Next, the line position of the character is loaded into the X register and then the character X is pointing to is loaded into the A register. A desirable alter­native to writing these 3 lines of code numerous times in the program is to define a macro NCHR (next character) to perform this function. By using this macro each time a new character is needed, the number of lines of code the programmer will have to write, and later wade through when debugging, will be decreased significantly. The code to execute this would look like:

NCHR

Define New Instructions

New instructions can also be written with macros to eliminate the require­ment for many different instruction se­quences to handle variations of an operation. The ADD macro is a case in point. Not only can variable parameters be passed, designating different numbers and locations to be operated on, but the macro will optimize the add by skipping unnecessary instructions.

The following code illustrates a typical two byte add in assembly language:

CLC

LDA NUM1

ADC NUM2

STA NUM3

LDA NUM1+1

ADC NUM2+1

STA NUM3+1

The first step in performing the add operation is to clear the carry flag. In this example, the low bytes of the numbers contained in NUM1 and NUM2 are added together and stored in the location designated here as NUM3. This is followed by an add of the high bytes of the numbes contained in NUM1 and NUM2 which is stored in the high byte of NUM3. The total number of bytes needed to perform this add is 19 (assuming that no variables are in page zero).

The ORCA assembler provides an ADD macro which replaces these 7 lines of code with one while duplicating the above operation:

ADD NUM1,NUM2,NUM3

The macro performs the same 2 byte add and stores the result in NUM3. The macro also required 19 bytes.

The ADD macro in ORCA will always do a 2 byte add, but when ad­ding a 1 byte immediate number to a 2 byte number, the standard shortcut is automatically taken.• What follows is the code needed to add 4 to NUM1 without macros:

CLC

LDA NUM1

ADC # 4 STA NUM1

BCC PAST INC NUM1+1

PAST ANOP

After the carry flag has been cleared the 4 is added to the low byte of the number stored in the location NUM1. The next step is to increment the high byte of NUM1 if the first add resulted in an overflow. Notice that in this ex­ample the sum of the two numbers is returned to the location NUM1. The total number of bytes required to per­form this operation is 16, assuming no zero page locations.

To illustrate the fact that the ADD macro will take the shortcut when ap­plicable, the same ADD macro is used, this time with the GEN ON directive in place. This directive is provided with the ORCA assembler. When it is turned on at the beginning of the program all the lines generated by the macro expan­

sion are printed in the output listing. These lines of code are preceded by a1 + '. Notice that the following lines of code are basically the same as those above:

ADD NUM1.#4+ CLC+ LDA NUM1+ ADC # < 4+ STA NUM1+ BCC SL2+ INC NUM1+1

+SL2 ANOP

If the carry flag is clear after the low bytes of the two numbers are added together, the high byte of NUM1 is not incremented. Instead the assembler branches around this instruction to the label SL2 which is a ANOP (assembler no-operation). Because the ADD macro was able to recognize and use the stan­dard assembly language shortcut, a sav­ings of 3 bytes resulted. At first glance this may not appear to be a significant savings, but when the number of times these macros are used in a large pro­gram is taken into account, the savings in space and the speed up during assembly time become significant.

Notice that the two previous ex­amples used the same ADD macro to perform two different types of add:

ADD NUM1.NUM2.NUM3.ADP NUM1.#4

The ADD macro, like many other macros in ORCA, allows variable parameters to be passed to the macro. In the first example the result of the add is stored in NUM3. If a destination is not specified, as in the second case, the result is stored in the first location by default, in this case NUM1. This feature alone saves the programmer from having to code many different in­struction sequences to do basically the same operation, thereby adding to the efficency of assembly language pro­gramming.

Shorten Code

Macros also shorten the number of lines of code in a program, making it easier to read and less prone to error. This also speeds up program develop­ment: an oft quoted result of several studies on programming is that a pro­grammer programs a constant number of lines of code per hour, regardless of the language. By reducing the number

48 MICRO No. 72 - June 1984

Page 51: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

of lines of code, program development speeds up.

The following statements load the address of a two byte number AD2 into ADI least significant byte first:

LDA # < AD2STA ADI

LDA # > AD2STA AD1+1

These 4 lines of code can be replaced by the load address macro, LA:

LA AD1.AD2

thus performing the same function without extra lines of code.

Hide Confusing Code

A major advantage to programming in Pascal or another high level language, rather than in assembler, is the ability to give a function or procedure a name which clearly describes the operations being performed. Because of the simplistic nature of assembly language the purpose of even a few lines of code can become difficult to discern a very short time after the code has been writ­ten.

The ORCA PRINT macro hides what can be confusing lines of code while at the same time stating clearly the procedure to be performed. The macro is straightforward, emulating its BASIC counterpart by writing out the characters contained in ticmarks:

PRINT 'A LINE OF OUTPUT'

would result inA LINE OF OUTPUT

printed out to the CRT or the printer, whichever was specified by the pro­grammer. The expansion of this macro would look like:

PRINT 'A LINE OF OUTPUT'

+ JSR SRITE

+ DC H ' 8 0 1, I 1 ' L : S L 2 1

+SL2 DC C'A LINE OFOUTPUT'

The macro statements generated, the ones preceded by the ' + ', show the steps the PRINT macro takes to per­form its task. First a jump to subroutine call is made to SRITE, which is contained in the system library. This is followed by two DC (declare constant) assembler directives.

These statements tell the subroutine the length of the output and whether or not a return needs to be generated after the line of output is printed. These three lines handle a number of tedious coding steps the programmer would be required to code if this macro was not available. The efficency of assembly language is retained, while at the same time it is possible to achieve some of the advantages of a higher level language.

Standardize Code

A great deal of confusion can be eliminated through standardization of code using Macros. Consider Fig. 1 and Fig. 2. Both of these subroutines per­form the same task, that of printing a menu on the screen and accepting user inputs. Fig. 1 is written in straight assembly code, while Fig. 2 uses macros and and implements a simple commenting structure. An experienced assembly language programmer would be required to decipher the purpose of the code in Fig. 1. The macros and com­ments used in the example in Fig. 2 enable the main points of the subroutine to be understood even by programmers unfamiliar with assembly language.

Alternate Instruction Sets

Another feature macros provide, useful to the advanced programmer, is the ability to write alternate instruction sets. An excellent example of this is a cross assembler which would allow code written using the ORCA 6502 Assembler to be run on another microprocessor such as the 6809. The gap between these instruction sets is bridged with macros.

The only major problem that arises when writing a cross assembler in­volves handling identical instructions which assemble differently on each microprocessor. To get a better idea of the problem, consider the RTS (return to subroutine) instruction on the 6502 and the 6809. The RTS on the 6502 is equivalent to a hex 60 while the RTS on the 6809 is the same as a hex 39. In order for the assembler to distinguish which RTS is meant to be used at a given time there must be a way to separate the instruction sets. The first way to solve this problem is to code all 6809 instructions in lowercase and leave all 6502 instructions in upper-

Another way is to precede each 6809 op code with an identifier, such as a 1.1:

.RTS

Macro Libraries

The ORCA assember’s macro library provides a collection of standard macros which can be used to perform common functions. Because these macros come with the system, they need need not be recoded for each pro­gram.

To use the macros effectively, the programmer builds a small library of the macros used in a particular pro­gram. This file takes very little time to colate and speeds up the assembly of the program. With a separate macro library the assembler only has to search through the macros needed by the pro­gram, and not the entire 150 macros provided with the system.

Subroutine Libraries

In order for macros to be of optimum use to the programmer they must be backed up with subroutine libraries. The reason for a subroutine library becomes apparent when the SUB (sub­tract) macro is compared to the MULT (multiply) macro. With the GEN ON directive in place at the beginning of the program the code the subtract macro would generate would look like:

SUB NUM1,NUM2

+ SEC

+ LDA NUM1

+ SBC NUM2

+ STA NUM1

+ LDA NUM1+1

+ SBC NUM2+1

+ STA NUM1+1

Compare this with the multiply macro:

MULT NUM1.NUM2

+ ANOP

+ LDA NUM1 move NUM1 to

+ STA MIL m u lt r e g

+ LDA NUM1+1

+ STA M1H

+ LDA MUN2 move NUM2 to

+ STA M3L o t h e r m u lt r e g

+ LDA NUM2+1

+ STA M3H

+ JSR SMULT p e rfo rm

m u lt ip ly

+ LDA MIL move an sw er t o

+ STA NUM1 NUM1

No. 72 ■ June 1984 MICRO 49

Page 52: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Listing 1

©GT5 RTS

A KEEP MENU,V10 MSG1 DC C'MENU'w SMENU START MSG2 DC C' 1) CATALOG'

PRBL EQU $F94A PRINT BUNKS MSG3 DC C' 2) LOAD A FILE'HOME EQU $FC58 MONITOR MSG4 DC C' 3) QUIT'o HOME ROUTINE MSG 5 DS 0RDKEY EQU $FD0C READ KEYBOARD ENDCROUT EQU $FD8E DO CARRIAGE

RETURN KEEP MENU,V10© BELL EQU $FF3A RING BELL MCOPY MENU,MACROS,V10

************************************************JSR SINIT * *

O m i JSR HOME WRITE MENU * SMENU - PRINT MENU ON SCREEN AND *V LDX 20-(MSG2-MSG1)/2 * ACCEPT USER INPUTS *JSR PRBL * *LDX MSG1 ************************************************

© LDA MSG *LDY MSG2-MSG1 SMENU STARTJSR SRITE jJSR CROUT j WRITE MENU

© JSR CROUT jLDX MSG2 JSR SINITLDA MSG2 MN1 HOME

© LDY MSG3-MSG2 PRINTC 'MENU'JSR SRITE CROUTJSR CROUT PRINT ' 1) CATALOG'LDX MSG3 CROUT

© LDA MSG3 PRINT ' 2) LOAD A FILE'LDY MSG4-MSG3 CROUTJSR SRITEJSR CROUT PRINT ' 3) QUIT'

© LDX MSG4 CROUTLDA MSG4 CROUTLDY MSG5-MSG4 j

© JSR SRITE ; GET AND INTERPRET USER INPUTJSR CROUT jJSR CROUT GT1 RDKEY CRS GET A LEGAL INPUT

CMP '1'© GT1 JSR RDKEY GET A LEGAL BLT GT2

INPUT CMP '4'CMP '1' BLT GT3BLT GT2 GT2 BELL ERROR FOUND

© CMP '4' JMP GT1BLT GT3

GT2 JSR BELL ERROR FOUND GT3 CMP '1' CATALOG THE DISK© JMP GT1 BNE GT4

JSR SCTLGGT3 CMP '1 ' CATALOG THE DISK JMP MN1

BNE GT4© JSR SCTLG GT4 CMP '2' LOAD A FILE

JMP MN1 BNE GT5JSR SLOAD

n GT4 CMP '2' LOAD A FILE JMP MN1BNE GT5JSR SLOAD GT5 RTS QUIT

0 o

o

JMP MN1 END

50 MICRO No. 72 ■ June 1984

Page 53: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

+ LDA M1H+ STA NUM1+1

Both of these macros generate these lines of code in the program at the place where they are use. Notice however that the SUB macro completed the en­tire operation in 7 lines of code. On the other hand the MULT macro merely set up the numbers given it in a stan­dard format and called the multiply subroutine [JSR SMULT) to perform the calculation. The fact that a subroutine library was called from a macro means that the dozens of lines of code in that subroutine are not generated each time the macro is call­ed; instead it is stored in one place in memory, thus cutting down the amount of memory the program re­quires in order to run.

The beauty of subroutine libraries lies in the fact that they are

Supermicros

(continued from page 45)

and BASIC programs run four times faster than on IBM 's Personal Computer. It is as fast to program in high level compiler languages as using interpreters on 8-bit machines. Our 6502 assembly language programming productivity doubled.

With an unexpanded, 256K SAGE II, you can plug in your own 64K bit dynamic RAM chips for 5 12K bytes and your own second Mitsubishi floppy disk drive; sockets, cables and connectors are provided with the unexpanded machine. One hundred and fifty nanosecond, 64K bit RAM chips cost about six dollars each at the present, and 36 chips make up 256K of RAM memory.

The video display and keyboard aren't built-in on the SAGE, unlike the Apple II; a separate RS232 serial

preassembled, and therefore never need to be assembled again. The subroutines required by the program are automatically linked in at assembly time by the link editor. For this reason no assembly time is lost on these subroutines.

The concept of subroutine libraries can be invaluable to a programming shop involved with software develop­ment. Only a central shop is required to develop and maintain the system libraries. Because not everyone has the source code to these libraries it becomes difficult to alter code, which is (presumably) known to be error free. At the same time interfacing with these routines becomes standard, thereby making the finished program easier to maintain and update.

Conclusions

The macros supplied with the ORCA system effectively extend the 6502

terminal is required. However, not having a built-in display and keyboard can be advantageous, because the user only pays for what he needs. Separate 19.2K baud serial terminals are also faster than most built-in hi-res bit­mapped displays. This is due to the dedicated CPU in the terminal that has nothing else to do but update the screen while bit mapped displays are usually updated by the main CPU. (Multi­processing if you will). It has 640K on each floppy disk drive, 512K of parity RAM and 24 bit address, 16 bit data bus, expansion connectors. It comes with a built-in Centronics parallel printer port, an IEEE-488 port and two RS-232 serial ports, one which is used with the terminal, the other already set up for a modem. Options include hard disk up to forty megabytes and a six-

assembly language instruction set to over 200 instructions. Many instruc­tions not commonly found in the 6502 assembly language, like PRINT and HOME, are now available to the pro­grammer via macros. Areas where the processor was inadequate, including I/O and arithmetic, are handled with ease. Because of these added instruc­tions, assembly language is no longer tedious and difficult to use. Instead, it approaches the simplicity of a higher level language.

Through macros, the full potential of programming in assembly language is reached. Macros enable the program­mer to write fewer lines of code to ac­complish a given task, and to do so in a precise and straightforward way. For this reason assembly language need no longer be feared by the average pro­grammer; instead, it becomes a language within the grasp of everyone.

JMCftO

user system with 1 megabyte RAM.Several other operating systems will

run on the SAGE, including CP/M 68K, Mirage, PDOS, BOS/5, MBOS/5 and Idris (a UNIX-like operating system). Languages that run under the standard and optional operating systems are several versions of Fortrans, BASIC, ADA, Forth, Cobol, Microcobol, APL, Modula II and several "C "s .

Here's the most serious advice to anyone con tem p latin g w riting software: write it in assembly language for the 68000. The 68000 and its derivatives will become the de facto standard microprocessors for at least the next ten years, despite IBM's temporary lead with the 8088.

JUCRO

No. 72 - June 1984 MICRO 51

Page 54: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

U a tu z e

Useful Functionsby Paul Garrison

Editor’s Note: The following program is given in its entirety to illustrate one way o f setting up a program to easily access various defined functions. In the next two issues, programs 2 and 3 will be published in their entirety. We invite you to send in any defined functions you m ay be using that are not m en tion ed . T he su bm ission s we receive w ill be collected and published in a future issue.

Save time and mathematical aggravation with this compilation of defined functions in a very friendly program.

Many of us, depending on what we do for a living, find that we must use a variety of arithmetic formulas, and more often than not we’re faced with the task of looking them up in some book or other research material, after which we must key them into our computer or calculator making sure that they're exactly correct. That can, on occasion, become quite a task when the formula involved includes a half dozen pairs of parentheses or other complicated combinations of fixed and variable values. A typical example of such a formula is shown below. Such

lengthy arithmetic expressions simply invite errors.

The programs that make up the main portion of this article are designed to simplify the task. They are made up

61 DEF FNDENALT(PA,F)=(145426*(1-(((288.15-PA*.001981)/288.15)15.2563/((273.15+F)/288.15))

t.235))of 60-odd user-defined functions representing all of the arithmetic expressions that I have ever needed in

the more or less technical writing that I have done.

In addition, all three include a group of three subroutines and an END line (lines 130 through 160) that I automatically put in all the programs I write. My reason for dividing the functions into three separate programs is based on the need to keep them within a 48K limit, or rather the 14-plus K limit that is available with a 48K RAM when MBASIC is loaded into the computer.

The programs consist of the actual functions (lines 1 to 99), where the line

52 MICRO No. 72 - June 1984

Page 55: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

numbers are not duplicated in the three programs in order to be able to merge portions of the programs into new programs without getting involved with a confusion of line numbers, the subroutines (lines 130 thru 160), a menu (lines 200 thru 400) plus a means of using all of the defined functions in order to perform a given calculation with optional variables. The three programs are recorded on a disk that also contains the CP/M system, MBASIC and the CP/M PIP program which simplifies the task of copying them onto another disk where they can then be merged with a new program. Since it is unlikely that all of the functions will be used in such a program, it is then a simple matter to delete those functions and other material not applicable to the program being written.

The programs are written in the Apple version of Microsoft BASIC-80 (MBASIC), using the WordStar wordprocessor. The changes that must be made in order to translate them into other versions of BASIC are described below.

Other BASIC Dialects

VARIABLE NAMES: BASIC-80, TI BASIC, TI EXTENDED BASIC, Atari BASIC and some other versions will recognize 40 or more characters in a variable name, while Applesoft, TRS-80 and several others recognize only the first two characters (plus the $ in case of string variables). Therefore, variable names that exceed two characters may have to be examined in order to avoid inadvertant duplication. For instance, Applesoft and TRS-80 would look at BOLD and BOLT and read both as BO.

MULTIPLE STATEMENTS PER LINE: In most versions of BASIC, multiple statements on one line, separated by a colon (:) are permitted. In TI BASIC, multiple statements per line are not accepted. In TI EXTEN D ED BA SIC, m u ltip le statements must be separated by two colons)::).

INPUT WITH PROMPT STATEMENT: Most versions of BASIC accept INPUT followed by a prompt statement in quotation marks. In BASIC-80, the prompt statement may be followed by a semicolon, resulting in a displayed question mark (?), or by a

comma eliminatingthe question mark. In Applesoft and TRS-80, the prompt statement must always be followed by a semicolon. In both versions of TI BASIC, the prompt statement must be followed by a colon. Atari does not permit a prompt line after INPUT. Instead, the prompt must be used as a PRINT line, followed by INPUT and the variable(s).

DEFINED FUNCTIONS: BASIC-80 uses DEF FNABC(X) with no space between FN and the function name ABC(X). In Applesoft, it can be typed without a space, but the computer will insert a space automatically, resulting in FN ABC(X). The two TI BASICs do not use FN. Instead DEF ABC(X| is used to define ABC. In the reference books for TRS-80 and Atari, I have been unable to find the DEFine command. The way to get around that is to simply assign an arithmetic expression to a variable name,- ABC = 1/A would, when ABC is PRINTed, display the reciprocal of the value assigned to the numeric variable A. In that case no variables in parentheses can be used because the computer would recognize that as an array, and would respond with a SUBSCRIPT OUT OF RANGE error message if the variable in parentheses exceeds the maximum allowable number and no prior DIM statement was encountered.

TO CLEAR THE SCREEN:BASIC-80 and Applesoft use HOME to clear the screen. TRS 80 uses CLS for the purpose. With computers that do not include a clear-screen command, use FOR X = 1 TO L:PRINT:NEXT X where L is the number of lines displayed on the screen. The two TI BASICs use CALL CLEAR for that purpose.

TAB(X) and VTAB(X): In the TIBASICs, the TAB(X) statement must be followed by a semicolon. In some versions of BASIC TAB and/or VTAB are not available. In that case, spaces within parentheses can be used to effect the TAB position and FOR X = 1 TO Z: PRINT: NEXT X can be used to move the text to a given vertical position on the screen, represented by the value of Z.

There are other differences between the versions of BASIC used by different computer makes and models, but these are the only ones used in the programs reproduced here.

PROGRAM #\T h is program co n ta in s the mathematical formulas for all versions of SINE, TANGENT, and SECANT that are not built in functions [such as SIN(X), COS(X), TAN(X) and ATN(XJ) au tom atically available on all microcomputers. In addition, it contains conversions of degrees to radians and vice versa which are frequently needed in conjunction with the others.

Lines 2 and 3 assign standard values to PI and RAD. Lines 16 through 37 use the DEF FN statement to create the user-defined functions. Lines 100 through 160 are the lines that I use at the beginning of all my programs. Lines 200 through 400 contain the menu that allows you to use any of the defined fu n ctio n s to perform a given calculation, using your own variables. Line 420 sends the computer to the appropriate line number based on the selection made from the menu. And lines 690 through 1560 are used to perform the different calculations.

PROGRAM #2This program includes the formulas for trigonometric ratios, two formulas dealing with matters related to aviation (the effect of wind on ground speed and density altitude), the formulas for con v ertin g tem p eratu res from Fahrenheit to Celsius and vice versa, plus the formulas that comprise Ohm's Law and determine the resistance factor of electrical wires, and finally the formula that determines future values based on compound interest, present value and the time span to be examined. The structure of the program is identical to the one described above. See editor's note.

PROGRAM #3

This program contains a variety of formulas, such as those used to determine the lesser, greater or average value of two variables, rounding off figures to a given number of decimals, polar-to-rectangular and rectangular-to- polar conversions, figuring roots of any variables (square root, cube root and so on), determining the reciprocal of any number, and determining the surface areas and volumes of cubes, rectangular shapes, spheres, pyramids and cylinders. Beyond that the program is structured like the others, except that the menu is at the end (lines 2000 and up). See editor's note. MuroG'

No. 72 • June 1984 MICRO 53

Page 56: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

©

©

©

©

©

1 REM FUNCTIONS (DELETE THOSE NOT USED IN A PROGRAM)2 PI=3.141593 RAD=57.295816 DEF FNARCSIN(A)=ATN(A/SQR(-A*A+1)):17 DEF FNSINH(A)=(EXP(A)-EXP(-A))/2:18 DEF FNARCCOS(A)=-ATN(A/SQR(-A*A+1))+1.5708:19 DEF FNC OSH(A) = (EXP(A)+EXP(-A))/2:20 DEF FNC0T(A)=1/TAN(A):21 DEF FNARCCOT(A)=ATN(A)+l.5708:22 DEF FNTANH(A)= EXP(-A)/(EXP(A)+EXP(-A))#2+1:23 DEF FNCOTH(A)=EXP(-A) / (EXP(A)-EXP(-A))#2+1:24 DEF FNSEC(A)=1/COS(A):25 DEF FNCSC(A)=1/SIN(A):26 DEF FNARCSEC(A)=ATN(A/SQR(A#A-l))+SGN(SGN(A)-l)*1.5708:REM ARCSECANT27 DEF FNARCCSC(A)=ATN(A/SQR(A#A-1))+(SGN(A)-1)#1.5708: REM ARCCOSECANT

Listing for Program 1

REM ARCSINE REM HYPERBOLIC SINE REM ARCCOSINE REM HYPERBOLIC COSINE REM COTANGENT REM ARCCOTANGENT REM HYPERBOLIC TANGENT REM HYPERBOLIC COTANGENT REM SECANT REM COSECANT

28 DEF FNSECH(A)=2/(EXP(A)+EXP(-A)):29 DEF FNARCSINH(A)=L0G(A+SQR(A#A+1)):30 DEF FNARCCOSH(A)=LOG(A+SQR(A#A+l)):31 DEF FNARCTANH(A)=LOG((1+A)/1-A)/2:32 DEF FNARCSECH(A)=LOG((SQR(-A#A+l)+l)/A):33 DEF FNARCCOTH(A)=LOG((A+l)/(A-l))/2:34 DEF FNARCSCSH(A)=LOG((SGN(A)#SQR(A#A+l)+l)/A):36 DEF FNDEG(A)=A*(PI/180):37 DEF FNRAD(A)=A/(PI/180):120 GOTO 200130 ?"----------------------------------------

REM HYPERBOLIC SECANT REM HYPERBOLIC ARCSINE REM HYPERBOLIC ARCCOSINE REM HYPERBOLIC ARCTANGENT REM HYPERBOLIC ARCSECANT REM HYPERBOLIC ARCCOTANGENT REM HYPERBOLIC ARCCOSECANT REM DEGREES TO RADIANS REM RADIANS TO DEGREES

REM TESTING FUNCTIONS

140 HOME:VTAB(10):RETURN150 ?:INPUT "Press > RETURN< (Q to quit) ",R$155 IF R$="Q" THEN 160 ELSE RETURN 160 GOSUB 140:GOSUB 130:?TAB(33)"End.":GOSUB 130:END 190200 GOSUB 140:?"Menu: ".-GOSUB 130 210 ?1,"Arcsine"220 ?2, "Hyperbolic sine"230 ?3,"Arccosine"240 ?4,"Hyperbolic cosine"250 ?5, "Cotangent"260 ?6, "Arccotangent"270 ?7,"Hyperbolic tangent"280 ?8, "Hyperbolic cotangent"290 ?9, "Secant"300 ?10,"Cosecant"310 ?11,"Arcsecant"320 ?12,"Arccosecant":GOSUB 130322 ?"To choose one of the above, press > RETURN< "324 INPUT "To see other choices, press > Y < ",Z$326 IF Z$="Y" THEN GOSUB 130:GOTO 330 ELSE GOSUB 130:GOTO 410

-":RETURN

330 ?13,"Hyperbolic secant"340 ?l4,"Hyperbolic arcsine"350 ?15,"Hyperbolic arccosine"360 ?16,"Hyperbolic arctangent"370 ?17,"Hyperbolic cosecant"380 ?18,"Hyperbolic arccotangent"390 ? 19, "Hyperbolic arc'cosecant":GOSUB 130 392 ?20,"Convert degrees to radians"394 ?21,"Convert radians to degrees":GOSUB 130400 ?22,"Exit program":GOSUB 130410 INPUT "Which? ",WHICH:GOSUB 140420 ON WHICH GOTO 690,730,770,810,850,890,930,970,1010,1050,1090,1130,1170,1210,

1250,1290,1330,1370,1410,1490,1530,160 690 ?"Find the arcsine of a number":GOSUB 130 700 INPUT "Enter any number ",A710 X=FNARCSIN(A):GOSUB 130720 PRINT "The arcsine of ";A;" is »;X:G0SUB 150:GOTO 200730 ?"Find the hyperbolic sine of a number":GOSUB 130 740 INPUT "Enter any number ",A750 X=FNSINH(A):GOSUB 130760 PRINT "The hyperbolic sine of ";A;" is ";X:G0SUB 150:GOTO 200770 ?"Find the arccosine of a number":GOSUB 130 780 INPUT "Enter any number ",A790 X=FNARCCOS(A):GOSUB 130800 PRINT "The arccosine of ";A;" is ";X:G0SUB 150:GOTO 200____

54 MICRO No. 72 • June 1984

Page 57: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

0

Listing 1 (continued) 810 ?"Find the hyperbolic cosine of a numberGOSUB 130 820 INPUT "Enter any number ",A830 X=FNC0SH(A):GOSUB 130840 PRINT "The hyperbolic cosine of ";A;" is ";X:G0SUB 150:GOTO 200 O850 ?"Find the cotangent of a number":GOSUB 130860 INPUT "Enter any number ",A870 X=FNCOT(A):GOSUB 130880 PRINT "The cotangent of ";A;" is ";X:G0SUB 150:GOTO 200 V890 ?"Find the arccotangent of a numberGOSUB 130 900 INPUT "Enter any number ",A910 X=FNARCCOT(A) .-GOSUB 130 O920 PRINT "The arccotangent of ";A;" is ";X:GOSUB 150:GOTO 200930 ?"Find the hyperbolic tangent of a numberGOSUB 130 940 INPUT "Enter any number ",A950 X=FNTANH(A):GOSUB 130 °960 PRINT "The hyperbolic tangent of ";A; " is ",-X:GOSUB 150:GOTO 200970 ?"Find the hyperbolic cotangent of a number":GOSUB 130980 INPUT "Enter any number ",A q990 X=FNCOTH(A):GOSUB 1301000 PRINT "The hyperbolic cotangent of ";A;" is ";X:GOSUB 150:GOTO 2001010 ?"Find the secant of a number "-.GOSUB 1301020 INPUT "Enter any number ",A ©1030 X=FNSEC(A) .-GOSUB 1301040 PRINT "The secant of ";A;" is ";X:GOSUB 150:GOTO 2001050 ?"Find the cosecant of a number":GOSUB 1301060 INPUT "Enter any number ",A1070 X=FNCSC(A):GOSUB 1301080 PRINT "The cosecant of ";A;" is ";X:G0SUB 150:GOTO 2001090 ?"Find the arcsecant of a number":GOSUB 130 Q1100 INPUT "Enter any number ",A1110 X=FNARCSEC(A):GOSUB 1301120 PRINT "The arcsecant of ";A;" is ";X:GOSUB 150:GOTO 2001130 ?"Find the arccosecant of a number":GOSUB 130 ®1140 INPUT "Enter any number ",A1150 X=FNARCCSC(A) .-GOSUB 1301160 PRINT "The arccosecant of ";A;" is ";X:GOSUB 150:GOTO 200 Q1170 ?"Find the hyperbolic secant of a number":GOSUB 1301180 INPUT "Enter any number ",A1190 X=FNSECH(A):GOSUB 1301200 PRINT "The hyperbolic secant of ";A;" is ";X:GOSUB 150:GOTO 200 ©1210 ?"Find the hyperbolic arcsine of a number":GOSUB 1301220 INPUT "Enter any number ",A1230 X=FNARCSINH(A) .-GOSUB 1301240 PRINT "The hyperbolic arcsine of ";A;" is ";X:GOSUB 150:GOTO 200 01250 ?"Find the hyperbolic arccosine of a number "-.GOSUB 1301260 INPUT "Enter any number ",A1270 X=FNARCCOSH(A):GOSUB 130 O1280 PRINT "The hyperbolic arccosine of ";A;" is ";X:GOSUB 150:GOTO 2001290 ?"Find the hyperbolic arctangent of a number":GOSUB 1301300 INPUT "Enter any number ",A1310 X=FNARCTANH(A):GOSUB 130 ©1320 PRINT "The hyperbolic arctangent of ";A;'' is ";X:GOSUB 150:GOTO 2001330 ?"Find the hyperbolic arcsecant of a number":GOSUB 1301340 INPUT "Enter any number ",A —1350 X=FNARCSECH(A) .-GOSUB 1301360 PRINT "The hyperbolic arcsecant of ";A;" is ";X:GOSUB 150:GOTO 2001370 ?"Find the hyperbolic arccotangent of a number":GOSUB 1301380 INPUT "Enter any number ",A ©1390 X=FNARCCOTH(A):GOSUB 1301400 PRINT "The hyperbolic arccotangent of ";A; " is ";X:G0SUB 150:GOTO 200 1410 ?"Find the hyperbolic arccosecant of a number ".-GOSUB 1301420 INPUT "Enter any number ",A ©1430 X=FNARCSCSH(A):GOSUB 1301440 PRINT "The hyperbolic arccosecant of ";A;" is ";X:GOSUB 150:GOTO 2001490 ?"Convert degrees to radians":GOSUB 130 q1500 INPUT "Enter number of degrees ",A1510 X=FNDEG(A):GOSUB 1301520 PRINT A;" degrees equal ";X;" radians":GOSUB 150:GOTO 2001530 ?"Convert radians to degrees "-.GOSUB 130 ©1540 INPUT "Enter number of radians ",A1550 X=FNRAD(A):GOSUB 1301560 ?A;" radians equal ";X;" deprees":GOSUB 150:GOTO 200_______________________

No. 72 - June 1984 MICRO 55

Page 58: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

< ifi£ c C a l £ e a tc v ie = =

Apple lie Supplementto

What's Where in the Appleby Phil Daley

A .l Overview

The latest Apple II, called the “ //e" for "en h an ced ", has several features added that m ake it more standard and versatile. The keyboard has been improved and w ill now generate all 128 ASCII key codes, including screen display of lower case. The RESET key now r e q u ir e s p r e s s in g th e C O N T R O L k ey sim ultaneously and rebooting can be accom plish­ed by pressing CTRL-OPEN APPLE-RESET, sav­ing wear and tear on the on/off sw itch, always a weak point. A CTRL-CLOSED APPLE RESET initiates a built-in self-test. The screen display has been improved to allow either 40 or 80 col­umn display under software control. There is also a full cursor control in all four directions. The 16K language card has been made a built-in feature and slot 0 has been elim inated. Inter­national versions are available for European and Asian buyers w ith sw itchable character sets.

D esp ite a ll th ese ad d itio n al fea tu res, com patability was kept w ith m ost of the previous software. All of the standard m onitor entry points were preserved so that, unless software uses un­documented m onitor entries, it should run on the //e. The only other problem that m ight arise is the utilization of one formerly unused page zero location. A program that used that location will probably not function properly on the new Apple.

Another new feature is the addition of a 64K expansion available as an enhanced 80 column card, w hich w ill m ake additional memory available to sophisticated programs such as Visicalc.

A.2 A Third Apple Monitor

There is now a third m ajor version of the Apple m onitor to go along w ith the Auto-Start and (old) System m onitors. W hile all of the documented entry points rem ain the same, m ost of the routines jump to the new ROM in the $C100-$CFFF range. These new routines check on the availability and status of 80 colum n and

extended 80 colum n cards, and use this additional hardware for enhanced displays and cursor control, when available.

The major differences between the II + and the //e are as follows:

a) RESET, OPEN APPLE and CLOSED APPLE keys: The Control key m ust now be pressed to in itiate the RESET cycle. This w ill elim inate ac­cidental RESETs as the keys are on opposite sides of the keyboard. The APPLE keys are paddle button extensions to the keyboard and can be used in conjunction w ith the RESET cycle to in ­itiate the self diagnostic tests (CLOSED) or power-on reboot (OPEN).

b) EDITING : In addition to the I, J, K, and L diamond cursor control pattern, there are four ar­row keys that can also be used to move the cursor on the screen. Pressing ESC to enter the editing mode changes the cursor to an inverse 11 + " to in­dicate editing mode. Additional commands are also available. ESC-R enters upper-case restrict mode, which allows only upper-case letters during keyboard entry except after typing a when both upper and lower case are allowed for PRINT statem ent. Typing another " " returns to upper-case only. ESC-T exits this mode. ESC-4 displays a 40 colum n screen sim ilar to the II + , while ESC-8 shifts to the new 80 colum n screen display. ESC CTRL-Q exits the new made entire­ly, returning to the old 40 colum n display, and turning off the 80 colum n card.

A.3The New Display

In order to m aintain com patability w ith the old II and II + , it was necessary to design a screen display that utilized the old screen memory ($400-$7FF). This was insufficient for 80 column display, so Apple designed an 80 colum n card w ith its own memory mapped into the same ad­dresses. The hardware alternates its scans from one set of memory to the other when in 80 col­umn mode. Characters are stored alternating from one address to the next, w ith all the odd screen locations in m ain memory and all the even ones on the auxiliary card.

56 MICRO No. 72 ■ June 1984

Page 59: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

There are routines in the new m onitor areas that can convert an 80 colum n screen to 40 by moving the alternate characters to the m ain board and throwing away the last 40 characters in each colum n. The opposite sw itch is accom plished by a sim ilar move to the auxiliary card, using only the leftm ost 40 colum ns for the characters previously on the screen.

A.4 Hardware Locations

O n th e o ld er A pples, th e ad d resses $C 000-$C00F were equivalent addresses and were only partly decoded by the hardware. This m eant that reading any of those would yield the same result (reading the keyboard), which was also true of $C 010-$C01F (clearing the keyboard strobe). These addresses are now fully decoded and pro­vide a set of soft switches/status indicators for the new 80 colum n card and extended 80 colum n card (with 64K memory expansion).

The sw itches include options to read and/or w rite either the m ain board locations or the aux­iliary card locations, to set the standard zero page and system stack (main board) or the alternate zero page and system stack (auxiliary card), to turn on or off the $C X00 ROM s, to enable or disable the 80 colum n display, and to turn on the norm al or alternate character sets (normal has upper case flash instead of lower case inverse).

Additionally, there are a group of locations that can be read to determine the current sw itch settings so that any program changing the sw itches can save the current settings and restore them at the end. States that can be determined in­clude READ/WRITE status, language card bank status, 80 colum n status, page status, and text mode.

A. 5 Software Status

Apple has always reserved some unused loca­tions in the text page RAM as scratch memory for the 7 hardware slots (1-7). Several of these loca­tions are now permanently assigned to the new 80 colum n cards, when they are in use, and are used to store the current cursor location, I/O status, and BASL/BASH in Pascal.

One particular location ($4FB) is the software M ODE status. Each bit is indicative of the cur­rent state of operations: BASIC/Pascal, interrupts set/cleared, Pascal 1.0/1.1, norm al/inverse video, G O TO X Y in progress/not in progress, upper case restrict/literal mode, BASIC in ­put/print, and ESC-R active/inactive.

These locations enable a program to deter­m ine the current state of the m achine more easily than before, and m ake it sim pler to utilize the new hardware configurations in programming.

A .6 Programming Considerations

The standard Applesoft G ET and IN PU T (and associated m onitor routine KEYINJ were not designed to work w ith an 80 colum n display and using them while in 80 colum n mode can cause loss of data or erasure of program in memory, but this can be overcome by a routine explained in Appendix E of the new Applesoft Tutorial. Reading the keyboard directly ($C000) functions the same as before.

Do not assume an Apple //e or 80 column card when writing programs; one of the first routines should check for the type of m achine be­ing used. Apple supplies a program that w ill do this on "T h e Applesoft Sam pler"; and Call A .P .P.L.E. has also published a routine for this purpose. HTAB w ill not function beyond the 40th colum n. W hile POKE 36,PO S works m ost of the tim e, Apple recommends POKE 1403,POS (0-79) for the //e. T h is routine w ill not work at all for an old Apple.

It is the programmer's responsibilty to turn off the 80 colum n card at the end of a program. Do not quit the card w ith the cursor beyond the 39th colum n, as this can cause unpredictable results including program erasure. In case of accidently executing this command, pressing RETURN im ­mediately will usually recover the cursor to the left margin. It is also necessary to turn the 80 col­umn card off before sending output to printers, modems, etc.

VTAB no longer works when a window is set (by POKing 32,33 etc.). The solution is to VTAB to the location -1, and then do a PRINT prior to PRINTing the actual data. This causes the firmware to recognise the new VTAB location.

These cautions are a sm all price to pay for the increased versatility and flexability of the new Apple //e.

Editor’s N ote: This m aterial is intended to be used in conjunction with the original version o f What's Where in the Apple which did not contain Apple He material. The 1984 edition o f WWA is now available for $19.95 from your local bookstore, com puter store, or by m ail from MICRO, P.O. Box 6502, Chelmsford, MA 01824 (add $2 shipping)

No. 72 - June 1984 MICRO 57

Page 60: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

HEX

LOCN

(D

EC

LOC

N)

[NA

ME]

\

USE

-TY

PE

\

- D

ES

CR

IPT

ION

i

i

58

COoo

c$0»k_ow*c0»co3c3

0)co0).c

*o ac <D cWW i<D oO —COO — u*o (0 o

cnO /-N<c <D U GDa» £ _ w• k. c > +—! cn*o 0) ro flj < CO<D £ £ o —CD<0 k_ 03 w a3 •— a> (T3 O 3a a Q W W k. <D3 o (0 C (0 k. > <Do ij l_ *o — Q_ a (D Oc o c "O (T3 'W3 (0> 0) o k. O k. C O0) w ■ — o W <D k. 03 k.• — 0) 0) <D o AS *D <D.c o ^ (T3 <T3 Q_ O *o B£ . (T3 •w O 'W£ C <D Co k. o •—k. LL —•— u. o — *o 0) as.c o 4-t (0 o *o c <D o* (fi r: 0) u. £ o <D(D—

a o £ k_ CO O“D Q> <x> <T3 (0 a <T3<D a k_ o k_ 3 c — a k_ u. _ _<0 <T3 (T3 w O •— as w (D <D (TJ 03k. •w k_ £ c — O O

O W o 0J k_ (0 —> — (0 CO> (T3 k_ o k_ 03 03 (0 <Q— CO r: 0) > <D z t - u u a. a.l_ a k_ a<D > (0 0) o£ k_ 0) a k_ w c C cu. (T3 Q o o o o o o oO k. « 0 a x c

0 a u. £ u <D o © © o 1—a o 0) k_£ +—! *o u. •i—l

o 0 ) X w — 3c \— o (D < c u B B B B B B

+—! u.CO03 Q>* .il W

3£03 C

£ . • —CM4—1w Oc c ao o flj— — a / /

+—! +—! r* /CO (T3 w Q. Q. i—o y O / / Q_o T - O /

Q_/

(/>Xo

COr .o

Q.UUJz o oa> u. •— LU _l OCb > £ . > - 0 2

< >a CO

>0)w 0)i— t—1 c0 •— ^ r-.

co ✓—S, u. T—CM•—

CO30

r*'W'W'Wa? 'W <D k_k- 00 GD GDa> u_ a? > r- h- ll£ . T— c r r r\ - h- < * * * *

CO— COr c oo coCO 03 <* Q.

oO CD0) *o

<D*DOe -

<_> « ® ® — <j "D <n tj\ <n O « < « £ o m o.

□ m o ®O w — Jk- 0} k_ O 0) 0)o . k. — o o

a w s. n a ®C C- ® k. 3 3 >— k. k. ® a o — ®

a a c c t - t - - w >® a. « « z D o —to 3 ------a_« a: Z c (Jo — — - «

« c c® ® <_> u cc a:i_ ---------i i

cn cn <_> <_>

oc

<D

X X - (t o o ® o > (— (— a ~£V_ _ _

o c o o a - d 3 < < co cn

a»c

3o

>Xoh-oo J I

»- (/)(/) — <D C < < — GD CD<QO O

x — asu

* - C ■*- C ■*- C ■*- c c •*- c

<D *0 TD(J) (J)

»- 03 <S > >c ® r c s «£ > u - M id3 -OO O 3 O <fl «o w O O u o

i - s. o co in0 3 C « «00 <_> — X CL CL

/ / a. a.1 - / CL / /

cl cl i- / y y cl <— —

/ - j i ^ ^ a cn cnX > •—■ cc < <U O CC O CD DC K O Q D 3 D I U J J G O O X O O

co y - <T> t"~ in coo n u i oo i - v

in CD o ) o

m m m m m mr- ll r- u_ h- llin <o <o r*- r--^ if* & 4* 4* ^

cn<

ccLU2r>z

0)ss

aa<a>jr

CDr .

ojr :

0).o.oCD3

Ol_a.

r--o

oooo

MICRO No. 72 • June 1984

Page 61: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

nu

JZ ■J

2 -

<D -C (0 COre re u —

CO<D

-Co

<s *D

* o XD 2E(0 o w_ re O\ w re o CCCO CO o nc c c 1 3 ©o £ C c TD — k- ©

— 3 E •— k . re 03 X— 3 re re E O u

03 O — E uU o O c c —

O o c c o o cc— © o o c

CO © z 2a> 0 0 z z < < <Di . 0) < < GC CC 4—10! — <D GC CC c

n — 0 ) 0 ) •—

*C re -Q -C 4-1 4-»(0 03 re re • —— C a> Q> w <D

X a UJ GC GC ^ ^ cn

l. 0)X <D o —o a c -Q

O re a 03re 3 • CM C4—> CO <D <Dw \ £ to X\ <D o CO 03 C SCD O <D O 03 U 03 <o re TD <D — i 3 GC03 a z — •o H—

<D O N N

a> co4->

03 O C O w CO<t> u

(0- a>03 —

-Q

0) <D Ccn co u j

> — >

c

§ i— 3 O —o o

o©00 o

000)— 0 -Q — 03 n (0 03

— cC i UJ

« }£ L. k . 4-> W<D O 01 03 03 03(0 — O O<« CO COO <D <D

CO O v- v- 03 0 ) 0 3£ > oo c c- - 0J

0)O Q h O re < oc u 3 UJ 3 * o a a c ^ ooC J 2 K re < < UJ

03 <D C * o O O - £(0

_J X CD ®

\ ---------QC CD cn > h -

0 ! 03 CO CO CO CO CO£ £ *0 *0 *0 *0 *0w k . 03 0J 0J 03 03O O <0 <D a> <D <Dz Z cc cc cc cc cc

/ / / / / / f T - T-X 1 - 1 - X X X/ X X / / /

/ /

CO — 2 z00 «J _J < < < t - O O C C Q C C C O U U Z Q Z ^ O O - £E - I 00 00 < < < C J 0 C I - Z U Zin j u j u o oc t - c j tn ac gc ^

/

/ X ▼- / X / —

2E — O z cn< x cc u O » -cc z< - u j- c r u j^ cn

/

X/

/ / / /

X X/ /

CL CL rsi m Q t -

Z X XO / / CCCO *u a a

o > >V— - J « J o ©cn < cn oo oo

k - C C h - UJ —I UJcn u cn

UJ UJcn cn

/ /

X X / / / 1 -

Xr-n ^ /

CC cc < < - ,X X 04 U U ^*“ *“ z-J -J CD < < <J GC -J J LU OU ( /) GC

// / T - /T— T - x T—

X X / X/ / /

1—->1—1 «—' t— 1—1

2 a < cc a : Z o <-J cca c: GC GC

cc -JS o S u< oGC 00a aGC GC

(0 CO• o *o03<3) <0 GC GC

/

X / / 1 -

X — / GC <CD h - _J X CD UJ > t - a a GC GC

^ o >•w cc <D rere•— © O— © o -o

— 00 —— LL c oX o3 a — CDn £.o-a cc c 3 CDre •— LL L.

re-a <b •c © C.0

re •— © <po T— c3 u •—c O 4>J£ o 3 CO3 X2 O— 3 u. CDO CO COo CL ; COX Z *—© u - 5 LL a00 o ; Q>J— "O<P O c£ O re >>>4-> re •

<b • S <<D JZ CO— 4—> Z W* o O <D <Dc £ GC C COre 0n © <x>•4— © r: «

o X 4—»O4 *D u GC<D a>—CO <u u.

<9 <Dn re *DC 4—1 C■— c CO re4—> <D c <D3 o c O CO •— cu . — CA M re

CO ID c 3 ^ 33 3 k_ o4—1 CO — 3 u. v—

re 4—> o4—> <4— « sCO o CO . CO

CO CD 3CM Q 4—> 4 ^ :\ — <D o a reT— > CO — 3 * . 4—•

© (0 <D CO<D CO JCM — ® c a> O if)re UJ c •— 4—* z rea CO c n

< > •CO (0 o x*o T3 / o CO <D CJ03 03 CD E 4—> l. 03<D 0) cn a> <D 4->GC GC / E CO > cn

a. c

CDyc

CO <K ®

TD0)«3

O CO 0J <1 * - >

0)a)c

oaTD

a z *-* - — 3c > o— UJ »-

"Oo -o o0) *— a> v 4 - Wj-> co

> £ J<X>c

Q QJ ■*—<n .C - ~ X£ o o ^ c a i<D 03 . c

u . c • ^ >

i c

oc

co<Dc

UJcn

ore03.CU

COa>•o a.o c

U UJ GC

C _ lo u

oc3

a . o

0) a

GC 03u

j j n «b cn-J O -J Z LU

u j O u j O i- - 2 GC GC UJ — > XO U J J 2 LU -x c n u u - ^ i L

oZ CO 5 - t—UJ ®cn • -

0)

T3 — w t <u. 0 ) 1re a CD 1 <Do C 'O <D 1 ^

0 ) O Cn u. <J I

<D <D 1 C1 —

4—> 1o --- 1 <D4—> * ■3) 1 ~

c CO 1 <Da CO 3 i rc a> i Bo CO c -■ i

•— 4—> 1 0)CD 4-> c 1

ID o 3 it CDO > CO 1

CO CO ai I £ .c X u. I Bo TD — • — a i :

• — — — •4— i4—> o 03 •4— i wre > <D --- i «•

o re ■_ a | 4mJ

o O re • 1 ^— o •4— u T3 1 01

4»> CO w- 1 £ i0 ) 4—> UJ re 1

«— ■o o i ato 0 ) 1 3r * 4 ^ o o •«. i ^

re Q o )<- a •4—5 — > Js: 1CD — o 4—» 1 ok . ■p. 4_* 0) CO 1O 3 c j * <D 1 CL

*o —-----

re

ZoGC o o X

/ / u

X X ~/ / Z-'

CM Q CM UJ — COa > in < © i CL 00 00a a ©GC GC ^T — — <7)

^ -C M C O ^ T in C O f^ O O — W O U J U h

/ / UJ UJ

/ co cnUJ / /cn

^ UJ— z zU CJ oz z z3 D 3 ) U . LL LL.

C7) © T“ CO ^ in co o © T- CM CO1/5 CO CO CO CO CO CO CO COy—T~ T“ r* T“ T“ T“ y—y—T—C7) G) a ) o C7) CD C7) CD C7) 0 ) 0 0 ) O)

V ^r ^ ^ ^ ^ ^ * r ^ r ^rw s ./ s*/ s>/ s ./ s»/

00 a> CD U O l U L L r cm co ^r oo© © o © © © © © 1- T—T—T“ T—© © o © © O © © © © © © ©u CJ u U U U U U U u u u u1* 4* 4* i * 4& if* 4& 40

CD QD CD

00 i/5 OJ © t- CJ(J ) <J) (J>

O S UJ © © ©C J u u1A <& 4&

aa

No. 72 • June 1984 MICRO

UJ©

o

©©©o

59

Page 62: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

HE

X

LO

CN

(D

EC

L

OC

N)

[NA

ME

] \U

SE

-TY

PE

\ -

DE

SC

RIP

TIO

N

X<J

co

a3

CL3

a E . o ac o a a

•— a» <D •—jc 4-< C — JCo o •— <d oo £3 > - c o— o c

oO CO N

ID » CD —• — <D i_

l_ 3 O o1 <D <J X 1

cc * c CD V. co • o * a o o•— <D o O a» 43) CD a CO • —4-1 a T3 C O £ do <T3 4-1 C o CD ■ — <u (D 3 CJc Q •— CO c — CD a C CJ c •3 CD CD — c co •— 3 0) CO

s*— C — T3 — s«— •— s«— * » 4-1 c cO CO C o — o o CO c •— E

CD 4-1 a o <T3 CD *o o 0) CD 4-1.C D T3 o •— r~ *o (D T3 c CD CO 3 —

O c CD 5 c c • — i- o o<D Q ■Q OD •— CD — 3 3 CJ

s*— o (TJ O a CJ CJo o CD w E o C O w O o o

4-1 o 4—> <D X w w 4-1 00CO i_ a — <D 3 CD CO Nco cn o cn — 4-1 *-> a a co CO oCD * - O CO o — o CQ CQ cd <D a> » -

cn 4-1 •— 0) a 4-1 CO ■Q 7D cn*o o — — — £ c t : )T3 <D U o « r~ « o o CJ CO w 5 <d T3 4) O

o a» — 4—> A j / 73<Q CO w • c o o o o o o o <d H C

CD CD 43) •— « • 0) 4-1 w 4-1 a 0) <d —w 3 cn C a» CD 4—> a w $> CO o — C <D 0) a> 0) CD CD Q > CO

<D • — i •— cn c c c c C c —O CD 0) o J — •— •— — — ■_ •— w o o X

S 'O £ . X 43) o w 4-1 w 4-1 *-> X o * "O CDO w c C T3 — CD CO 3 3 3 3 3 3 <D n M— c (TJ O c CD o o o o O o 4-1 o — c

CD E — a» — •— c k- CO OD —73 O 13 a (TJ w z •— CD T3 -C cdC J— 3 o E C CE 4-» k- .C c C t - E<Q o w CD 3 D o o o o o o 4—> o cd

4—> — o h - o w 4-1 4-1 4—> 4-1 <D . o» > - l_ — c UJ •— ■ — — • — • — •— JC — > - c

JC <Q o cd Cfl GC c c c c c c rt CJ O JCO > CD o 43) 4—> CD * $ o o o o o o CD <D H o w<Q — *a o — CD — UL <D E E £ E E E — .c c <TJ ID CD4-» O c CO CJ CO CJ C CJ o CD COCO X3 •— o l_ u •_ <D 0) 73

CD O * o o O o 4-1 o o O o o o o o o w CD or* X 4-1 4-1 M M M M 4-1 4—> CJ X w5 CD — CD CO o <D

T3 CC _ GC GC GC GC c 4-1 4-1 4-1 4-1 GC GC ■Q GCC \ o N N N N • — c c c c c c c N N c C N

u — cn cn cn cn cn 4—> ■ «. — •— •— •— cn cn • — CJ ••— cno D o Q o Q o o

LU V. 0) w o a a Q a a a a X LU0) _ ) O o o O O o O CJ <0 _ | o<D CD M 4—> w > > > > > > 4-1 <D CD 4-1

H < • — <Q • — — •— •— 4-1 i_ v- ■— 0) r < —CO \— c CD c c C — 4—> 4-1 4-1 4—> 4-1 4-1 c > CO J—3 . o — o o o o X c £ c c c £ c o o 3 » o

CL LL z O Z Z Z Z L U L U L U L U lU liJliJliJZ Z cnC L C D z

CO<DO73 co

j c $ oCO ® — Ha» cj

*-» jcy~ CJcd <d

73 O— wOo c

s•- oO 73

COcXco X

> L L 3 ® CD <-»JC CD

E *- : o

— cQ CflQ >

< »- » : o o

E c ® —

O £ ~s*— 4_f

0) O)CO W COj C V) <D O <fl >- <D —.C ID CO CJ T3

*» <A ®

E o c ® - ~ w Zo) co o > o cn 0) c

o x <d c j

® - CO T3 **- 0) —u . *->

3 CD O O CD

.C «

c<DE0)>oE

oCO

3cj

I

o

c

T3cCd

0) * <cj ^- I c<0 <o - ■-C I <BO v w

Cd CJ- X3 Cd

X3 C >-Cd cd

cn .cN E oco -

jc >- * o o

*1 - £ c oO Q >*- £ rt

E T3 —

o o o

a> r

*• •*-< JC ^CJ > i-a u j as ^ * a>O Q -

cn o— o

O

0)co

CO — > ^ CD Cd JC —

COJ c o «

cd cd w O 0) ID

O -----o

— e oCd o £ CO

4-1 CC ^C N —

o t n >a - co

o c > ^ k. -------- 34-1 C ^C O ® LU Z CC

o • z

cd • —.a * « ->

CO 73 • 4-< a3 — • CO

O a ID<d '—■ CD T3 <d

C COco > cd —

-1 < 73V a A

> c CO ocd u j •— 4-» N

a —3

X Q 0) aCJ 4-1 4-» c

o CD —CD GC cd w >> cn C cd<d *> cd CDCO r

- CJ ao c c

CD J •— CD43) JC .C

CO C CJ COc O CD c —o CO 0) H o CD•— .c CJ •—4-1 c 4—> 4-1 CO• — o o <TJ a>■Q 4—> CO CJ cT3 2 D — o ■ —<d Ll a cd —

LL D5 ^ • » p oCD • t o oC CJ 0) CD 73

cn 4—> a» c Z^ < o cd ow cd — E cn•— o

o cd CJ CD X« n ^ CJ

> CJ o 4-1

<D w > Ev o c <D - o0) c JC X

<d 0) aCD l_ 3 cd Z

73 c o 4-1 cn wcd CO CD 4-1 •—CD 4-1 <X) 73 X

3 — a c CDQ cd 73 cd

o c C o O4-1 * • — cd 4—> - I 4-1

CO o oCD 3 •— <D Z CDc 4-1 c cn C— cd o O ■— —

4—> 4-1 o MD CO 43) w 3 c 3Q .c CO O — os.. 4-1 w 4—>

a t : c3 0) w <D

0 u- cd o E QM o Q w 43)• — CD 4-1 — • —

w CO c CJ co C 43) <D o C oz • — X Z — z

aGC

COJC(Ja»

o

jcCJcd

Eo

>

1“ Z ' O f-------- tc Z---------CO —— w <tjX ) co <d cj < « « ® « c cd — Cd cd co c j o_

cn<_ i

aGCIDz3z

<DNN

aa<

CDH

CdH

<DIDCD

O

CL

60

/ /LU / / / / / / / / / / / UJ / / / / / /cn UJ UJ UJ UJ UJ / UJ UJ LU UJ UJ / U J / / cn lu LU / UJ LU LU / UJ/ c n / c n c n c n c n / u j c n c n c n c n c n u j / c n u j u j / cn cn / UJ / cn co cn / co cn

/ u j / / / / _ i c n / / / / / c n i u / c ^ c ^ / / / / cn LU / / / CO CL /r—< cn / / / ( / ) / / i—« UJ TT Q_ / cn CL /CJ 1—1 / ■—11—' r - . i—i ^ ^ ^ / 1—' x ~ CO — CL / / *—> r-, / r-,Z CL _l _l Q M — — _l _l M CL Q ^ GC'-' — O X / X / — Z \—3 O - J O Z J i - O J O J O Z H ^ O X ’- Z K — Z cn Z 3 — CL ZLL L U L U 0 L U B 0 L U U 0 L U 0 L U 5 U J I U H U U B LU r— LL i—11— — > 3 — O H Z UJa a r z c n c n » - i u a : z a : a : i u c c i “ c / ) z u » - z j- cn 01 <J Z 3 > -1 t - CJ CJ CL “ > CJ- i J 0 C J J L U J 0 3 C J J J J L U L U 0 L U L U 3 LU LU a cn — O UJ Q UJ ------LL * —o c j x c n c j c n c j ( 5 L L c n c j c j c j c n c c x > c D L L cn cc < UJ <J CJ > GC CO CO CO CO CO• — » cn cn * UJ • < < < CM <CD l l l l l l l l i l i l i l g o c d c d c d c d c d c o c d c d q q c d CD CD O CD UJ UJ CD LL CD CD CL t- CDUJ UJ l__l UJ UJ U.I UJ l__l l__l w- •—/ •—1 •—1

>—s >—s >—s >—s >—s >—s >—s0 ) a ) i n i / ) c o c o ^ ’ O O J c o o u o c o a ) C i i / ) e o © '» - O) co T- TT CJ CO o CJ a> O S ^ S C OCO ^ r i^ c o c o T rc D c o h - '» - '» - r> J c o c o ^ rT rc o r>- c o 00 <0 CJ) 0 ) o CO O) CJ OJ CO CO TT

^ ^ ^ m m u o i n i n t o c o c o t o c o c o c o c o c o c o <0 h - h - CO CO 00 0) O) 0) 0) 0)0 ) 0 ) 0 ) 0 0 ) 0 ) 0 ) 0 ) 0 ) 0 ) 0 ) 0 ) 0 0 ) 0 ) 0 ) 0 ) 0 ) 0 ) O) 0) O) 0) O) O) 0) 0) 0) O) 0) 0) 0) 0)

^r ^ ^w ’w ' ’w ' ’w '

ll 0 ) C O Q Q < U ^ ^ Q C O 0 ) r S < Q L L l U T - O) i - UJ O CO <0 CD O S C D ^ - NT— C s j T T T } - S C 0 a ) < < U Q Q l U l U L U L U L L O T - •»- CO CO <0 CO CO CO <J LU O O O y - T -T— CNJ CNJ CNJ CNJ CNJ CNJ CNJ CNJ CNJ CO CO CO CO COCJ < J < J < J < J C J C J C J C J C J C J C J C J C J C J C J C J C J C J CJ CJ c j a CJ CJ CJ CJ CJ u u u u u^ ^ 1A ZA 1A 1A iA 9# w sjr 9# w V" sjr Trr Trr vT ^7 SJT v " VF wT VT vT if* 4& *0 4 * & if* « * if* if* « « » « » « » « »

MICRO No. 72

N-

COt i

I

LL

<J<s*

Page 63: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

zo

GCCJcoluQ

/LUCL>J—1LUcn

05a£D

T3C0J

a

COCJ

COoo<J

©<0

OS©- z« O

GCoo<J CO

<Jac c0)D <J

CO CO ~ < O CD CO *o> o c o rtM- O

o E y> « c ) k_D O

Aa4- co

LU 3 a t - Q h h £ - < - < ^ Z U J G C K — ' — CC B CO

<Q <Q 03 (C (QO O CJ CJ CJCO <0 to « O)<Q 03 (Q (*C 03

flj 0) k-4—1 • — k-CO

UJ CJ<D LU oO CO • w

<* *o ©D 1 k. No * Q COCO TJ LU a ■o

l_ CO k_II <n 4* o 0JCJ *oT- < c

< o <TJ k. «J** CO ©k_ COc © CO .

— > c © X0J <0 CA o2 © D 0J

— o J**— k_ •— CO CO<n o > CO c \CJ c ©

03 © o4-> o © E flj© £ aCO *o k_

k_ 4-* o0) > <n © © .JC o O) — © J—c k- o N o<TJ <fl o > _lr) u 4—1 u. o © COu. 4>J 00> * *o 03 — 03 ’. u4 k_ a C O <Q k_ c c£ 03 O »> © flj •—<D r) k. AE CO © •— CO

c *o <n C CJto c •— CO k_ o 4#CO o <n c 03 ©O E 0J o CO CO

*-• rj 3 <Q ©o CQ E C0J c c o c CO o— k_ c c> 4-J 03 o 0J 03 CO cnk_ CO Z a £ © ©o © — D £ •E Q O o o —<D 4—1 k_ TJ c • oE II 4—1 © © — GC O

■O c CO CO O© T w o D © UJ ”) 4-J> < 03 (J O OUJ Oo CJ © to 03 CO 4-> k_E • E X c — o a

■o <TJ © <TJ 1 co c o a o4—1 © o © > UJ 0- o

o A CO 2 00GC © w w to • -> CJ\ u <n a O C Xcn w © a a CO 03 a

3 — $ <Q © — cco o © CO £ *-> CO > —

O CO to to 3. 4-1 > to © \ »- a■— M c <TJ © o © Dc k_ « “C © a CO 4—1 4—1

; o cm 03 *o — — c ©2 < U h 0J o a < lu co

COCL

<nO<TJCOcj©ao*oc<T3

<TJ<J

Xa)

a)05

■ocCO

2oGCCO<J

a)a

■o©

<D

CO<GD

> i- *- ©*- aOJ ©U 4- ,

c © <n — *d *- O <tj ©© to — <o cj cj

< ccc

- zUJ2 uO —GC CO

<CO GD©

Oa «-»oo 4-.

©>

zo

*- GCC 00 — LLO 0) • -C

CL CJ

O• aE0) o4-J -W

COto co

©.C TJ4- cCO

O Bc cn <n <j n

c■Oo o o \ a —4- (Jo —C CO <

— CD— a«- DCO

<J)— in

®■C

>- r ao o a o _i ® o >-

e >o

o«k-0J.ca

OJX

•3CJ

<J

E -c E o

c — — o

CJ©w. oO 00

O Ic ~

©<0

*0 c<T3

c 0)0)k- CO C I -

*o cOS 4-»cj rt

0) *- ^ <0

£ cj

o CO c

E *o»- D *D « — O 0) O — O *-u —

o *00 •© c*0 W <DO © > £ CO ©

<o03c0)*0c<T3

<D*0O

jc eoo c j: £

3V) *-• —

> 3 0o a o •a c c — o — oo J o

• UCO T- o CJ «-A <c x a a o «s co ©^ G Aq c l u

<D *0 C0 C 0) OS OS £0 O

a? —»- T3 ( D O *-11 e xO ®— X C

o— ® o ® £ ~</) O

XO O h4-f Oa> © a c c z 3

O o

0)> 4-Jo

4- cCJ<D

- a>- to o *-U C 03

<TJ <P*- H — O CJ

*DC C

“O « O

<TJ C *0 — >

« *-Z O *- < <n oj GC o

X1 U iu a> o ® a> a o A o uo o4-> ^ ■*-<

cd <n <d C CJ c

- _J c ^ h (!)- <J ®J3 Z *-

CL UJL. GD COa>- o <s>

~ r .

sfl ^Z *- Cfr c— <TJ 3 OOC -® oQ_ — »- *-GD CJ £ . 03

4- r . o • u4- CO —

I — <s> .C _ ] flj «c a c e **“ *-D H*O U - 4-»_ 4- Cn *- o -4- O C »-

aco *4-— & — *a— JC c03 O - 0 3

*4- a> c IZ *- •“

* CJ D 4-i O 4- —C - 0) -Q

— OC *-~ < r .C X * 04-- u c c

03a c 4-j

- CO 0) <J to o— W Ocn a> o o < *■* o *-*03 o u. w

os a O U- GC+* os *

£ co Xu j y - u QO 4-J ^2 3 • * 03

a o

*o •~ k- ( Jtn <tj co< o LUGD GC A o

< » zO X <D~ <J X O

c *o a>»- C £ CL3 « 4 - 24-< -5a> - £»- c o c

o a> *0 — ^

*oc0J

> > CO •O) X CO<D 0)o »-a> oC 4-

to

to « <J o A CO a u ujk. <q wo oCO 4_ C

<D D Oo —0) c •

r o com •— (D

4- a4-» — 010 ) to CJa o co

a uj4-> 4-j a

* d c c c a © — o c TJ--- - d

D — - <J O CJ CO — cO CO 4 - -a < os

CD

O O flj 03 co r r o o

D UJo a

0) 2 - © > c

0 ) COto CO

0)O 4 - 4_> (J)co co — a

« 3 — ® (a O >-

3 W O TD1- c

3O

O O V> o >- 3 o

<D ® C C

Z «-■ <fl3 < 3 CC (X £ ccO DC O N X O Ni- i- <s) i/> in

O _li - *■> t— f f i -o o o o t- o4—1 J 4—1 4—1 CJ— o -------------- -C C C C C C i - CO f f l O O O O O

o o o

owDu

<D>oECD

3 l / 3 / 1/ 1 UJ “ 5 UJ

I CO CL / CO / 1\ / 1—■ / / LU / / / / / / / / / UJ 1

>—> | UJ UJ CO UJ / LU UJ / -J _J UJ UJ / LU COUJ 1 ^ c n cn / cn / / UJ CO — CO _ ] / / / CO CO _J co / 1Z I CM 00 / / / UJ UJ CO / »— / — / / / / LU / / / / I< 1 1 - i - — cn cn / — o — _J _ l _ l CO IZ i z O UJ ■—' / / — z I— ' —»1— <J / / / / — I— 1— * <— > 1“ 1l__l j LU O 1— Q H“ 1— (— » T~ — ▼" CM --------- 1 - -J 1 - I - 3 1

1 (J in — < — < « - /—i oo J - CJ 1 - Q 1 - OC 01 (—> r— — ^ Z UJ 3 CL 1/■> 1 ~ 1 Z UJ GC 1 - UJ GC CJ — — — < — < < CJ CO I------------ CJ GC CL Z 1Z I CO in — gc B cn > UJ t— Z co z UJ z UJ GD CD CD CD 3 GC z O Z -CJ 1 < O) CL CL CL CL O LL UJ — < — CC — —1 00 00 oo O O O Q . CL 1O i GD O) “5 “5 “5 2 X CO a gd CD a GD CJ CJ CJ CJ CJ CD CD CD CD GO CD 1_ l 1

1u~l '—, '— ' — ■— 1— 1 I— . M I— 1— 1 '— ' *— 1 1 1 1

CJ 1 W z- ' /■ > / - S / - V / - H / “ V / - N / - H / - S / - V / - N / - H / “ \ / - n y“s / - V /“ \ /-H i inUJ 1 m •»- co <j> CO in O CO CJ CM O CO CM CO CO o T - ^r CO C£5 T 1 oQ I ( \ l O) O O r r <J> in o o CM n c c a ) o ’r - CM in co o CM ^ CD 1 O)

' I CD CO O) o o o o o i— CM CM CM CM CM CM CO CO CO CO CO CO ^r i a1 O) co a ) o o o o o o T“ 1— " r - i — r — i — t— r - 1“ ■»— i - i - 1 4ft

Z 1 ^r c j -^r in m in in m in in in in m in m in m in in in in m in m in iU 1 O 1

4 * W w W V # > -» W W i i

_ l 1 CD CD CD ^ r^- Q CO o CD O CO co CD O Q CO ^ UJ O CO •»- C J cm cd in 1 CO1 CO in m in co CD UJ o o t— t in in <o O) O) < u U J L L O 1 CO

X » CO CO CO CO CO CO CO CO CO 00 00 00 oo oo ao oo 00 00 00 oo CO 00 00 00 O) I COU J I CJ u c j a c j c j c j CJ <J c j a CJ u u u u C J C J C J U C J C J C J C J C J 1 c jX 1 4 # 4 0 4 * 4P> 4& 4 f> 4 f> 4 * 4 * 4 * 4 f* 4ft 4A 4& 4ft 1 4 f t

to<

<J

ccLUz3z

aa<0)A

asnB

CDAA4)D

O

CL

No. 72 • June 1984 MICRO 61

Page 64: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

zo

CCCJcnUJo

CL>-

cn3

CO0CJc03o*0)CO

: <&) u j

> - ;* h- c

k_ 0 z0) • Da 4—' k_ 4—'a o 0 0D £L H— — k_

4-J —O • — X <9 0*—> 5 CJ CJ O)c 0 ■—

•— < £ O Jo 4—»

0 T ) (DCO <9 •* c £L

O 4—' 4—'O — o D o

c 4—'• 0 »

0 0 0) a£ 4—» zO 0 • — * —

— £ . 4-* CL4-f o <

CO • — c cnCO CJ

• 0) UJa

0 O»» <9 4—' 4—'

> LZ o® CJ <9 •— cx .

0 <9 ► DT3 . c . c CO 4—'c O <n <D

0P —- o£ — O O •Oo * 4—' a a>

c (/><9 0 o * o

4—< o c 4—'0) cj <9 • —

h— <* ® r )LU COa <* 4—< c x :

. c o Cft» o J —c 4-* 4—< £ .0) T3 c o® — c Q)

— Dcj <9 a * « - 4—'CO > :

— 0)c <* * o <9 <9o c — £

k_ <9 CJo 0 >

o • a U-0) c r 0) 4—'

CD < c3 < X ; 0)O h U O

CJ CJ 1 GC0 cn co _i <a l u u j c r x

h— CJCJ ® O U CJ «cn .c 4—< j cnUJ 4—< c UJ 0

*o —0) CO c _0 JC X <9 <«cj CJ ® * * U<9 0 * o ;— £1 c CC H— OQ_ o •— j --- 4—'

0T3OE

p. <4—» >*—

0 ) c —O 0 > o H— 0t - 0 ) o c ----- E T 3

k_ ' — - 0 0<9 CJ 4- a ► 0 c 03 k- 0

w c TD 13 0 ) CJ **-* - T3 0 0 <9 »- O D 0 c£ 1 <D 7 3 T 3 £ L « E w CJ - QJO * - O U CJ 0 O c

— CJ E 0 k_ • —

O o •* <*-----k. <*} <U— — a. 0) CJ CJC C Z * - 0 ) 0)O O UJ •— flJ flJ

2 2 I------- CL Q .

C UJ CJ 4—' _ u 1 C/>o 0) 4—* 0 X

c 0 o cn CJ 4—> — 1 ***’C O a 0 c a 13 z y— .C o 0 1 0

N-> 0 D CJ N 1 -O— a ■— 1 ^

O ) O a x • 1 0o II c D > o > 1 D

X “O c O £ 1 _ lc •— <Q 1

a c (Q — — 40 0)D <Q ; <« CO o 0) 1 <4—i

D 0 U CO u 0 0) 0 1 o4—< 4-» E <0 CJ <0 CJ U 10 0 o <Q <Q 0 D 0 1 CL

cn Q.:

CL c o C 111

/ 1 / / /1 UJ / h- / / / _l UJ UJ1 cn h- t- UJ _l - J / / CO CO| / a . cn / / / / / - J / / / / / LU

UJ 1 CL / / UJ UJ _J — / LU -J LU cnZ 1 / CO CO r— / •—< c r — '—1 CO / CO /< 1 C 3 r—* i—i / / z »- < — c r o / /Z i z — c r cn < « - I h O r—« i—i>—i i — GD < o r—« CJ CL —1 CJ UJ — i - «—i CM i—i UJ

I Q. < i h ac <j X — Z X CC GC Q h—i < f— CJ < O to I J < » Z Q . -------— < —

Z 1 <J CJ CJ f— O u j CJ IL CJ IL — 1- z z z LU c rCJ 1 cn cn co co x o ........................UJ c rO I UJ UJ UJ CL CL Z m m m m m to CL CL CL CL CL_J ii — m m M ^ M M M M M M *— M ta-‘<J i /-s /-s /-s /•“*» /-s / - s /•“*» / - s / - s / - s /—H /-S /-S / - s /•“*»UJ 1 o O S ^ T 04 a> a> CO CJ 00 •»- CC T - CO COa i CD N CO O w CO r - o •»- cm in 00 05 05 CM in

■*T in in <o < 0 CO s0 N N S S S h- h ' h- CD CDi T “ 1“ T “ T “ T “ T “ T “ T “ T “ T “ T “ T “ i- ▼“ ▼“

Z 1 m m m in in in m m m m m m m m in in<j i o i ^ w w w w W W W W W > w / w w "O 1 -J 1 CO OJ CO < 0 h - LL N CM < S < u_ ^ UJ

\ i— r^- oo 05 < CD Q LL O O CM CM COX 1 CD 05 CD 0) 0 ) CD 05 CD < < < < < < < < <UJ 1 U CJ cj U CJ cj CJ cj CJ CJ CJ CJ U U CJ CJ oX 1 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * ^ ^ <* <0

aa<0

UJCO<u4*I

CO

COCJ

62 MICRO No. 72 • June 1984

Page 65: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

zo

ccocnUJa

/UJ0.>h-IUJcnr>

a*c

<u*

aUJGD

0 CO— c•— k_.c 35 4—<

003 k_c .o >

— > a4-* * 0C

< 3o Oo CO

— > oc o c

E k_ k_ —o 3 4—1 CO*D 4-1 to 3C 0 0

k_ "D 0k_ C

-o * —0 c T3 —£ <T3 k_4-1 « c

0 <J 0a .Q 0c O c k_— k_ e CJw 4—* D COc 03 —0 o w£ -o o O0 k. •*-k. oCJ O 00 COc n 0>• — »•*- 0

0 o k_•X 2■O 0k. 0 O fl5

<T3 cO ■w 0 0n 0) 0)> k. 0 .0 ra k_ • XI X

jc 0 a 4—1 to— o 0 <0 o k_ c 4_> GD.c o 03 \4—* ►U—•*- — _l

< — D to■a 4-f o <03 o 0) UJ — GD0 0) Z flk_ c 4—1 GD CJ CO o „ O4—1 k_ 4—» 0 4—1

CQ k. __cc n cr 0 GC 3\ CJ s \ i/itn cn 4-> cn 0

0 k_l. £ k_ 0) l.o 4—< o •— o CO4—1 4—1 0--- *o *o — k_c 03 c k. c Oo O o o 4-»Z — z o Z cn

O00V©

»- o o 0 «- .c

o0)^ oO «-* 0r Oo cc

CO030oo

toCO0k_T3*a<Q0)C

DO

<Q <Q > > c c

II II

o ©

c)o■O

aD

O03

3'J

010

TDCDT3•U_ o O _ 0 0 1> u. 4~> k_ CO CO o 0 0 1O — 4—1 0 0 k_ k_ c 1

z < c c C <J 1o to o 03 03 •4— 1c c o 4-< _ 1• — 0) •— D 3 c 10) 0 O o o o 0 1n 0) k. o W 0 ■O 1D <« •4— a> o I0 £ D c CJ o £ 1c • CJ * h- 0) (0 — 4—1 1•—— T3 o — "O o CO ■O I— a • C 03 < 0) w ) c 4-1 k_ o — 1

o 0) 03 4—1 k_ 0 o 0 0 00 o { 0c 0) k_ ff 0) 0 4> ■O a h- 1 \0 03 0 £ •. 4—1 o c 0 > 0 4—1 o 1 \0 O. 4-* O o •*—CD o 0 0) T3 • £ 1k_ u O 4—< _l LL 03 w c c ) w X 03 0a c <TJ c i k. 0 •— £ > T3 1 0to — — o UJ 0) c — 0 0 03 03 C k_ 1 ““<TJ o GQ 03 £ O — CO — > C •— a o 03 i aw n k. _J ■a o — 0 c o •—— > a O i ao o o 4—1a • 0 c 0 — c £ u — J - A i <•4— c c < 00 £ k. 0 — o 0 o o V; o > i— O _l LL D 0 •4— J o k. c —■ © 03 E C ■O o 0 1 003 ■O 0 O »“ to o 0 ; o k. o c O o k. c -a X 1 -C0) c k. ( j 0) 0 03 C O 0 c * CO c 4—1 D c0 a 4—' 4-J 03 • k. a •— 0 *0 c o a o c k. £ 4—1 0 0 ■a J -o fk. c o *o < 0 CO— T3 o o 3 T3 O £ <J> o Q 0 c k_ c I c*0 -O o c c 0 o 0 0 ■— > o 00 D £ — 03 X 0 0 <x c 03 1*o 0 o 03 £ c 03 a- c *o 0 > k. C c \ — 4*-> o a — 0 TD *0 o £ C Ia) — •*- 03 o a 03 ■— k. 0) 0 k. o "D 0 0 O o o o k. • C O O D £ O 1 0

jo T3 •—X 0) CO — 03 k. _ CO o •*- 0 0 0 ^ o o •4— k. •*— £ £ c _ D 0 1 k.0 <n c Q a _ * k. 0 k. ■4— 0 k. k. 0 O o O o _ £ O T3 1 00) c 03 tO < * c o k. k. k. > £ 0 CO a k. o ^ a 0) c C D CJ O i r .03 0 £ (J -J k. •— 03 UJ 03 o 0 k. > CO 0 0 CO CO o o . *o L_ ■a 0 P E _ o > t BX) £ CD H- 0 T 3 D o Z 0 k. O C 0 CO C > a c 3 c k_ D 3 O O i0) o (J c o — c •— CO0) — 0 0 — — — 0 0 — — O 00 o I v>0 — <j * 0 03 « X O aj « ; ; 0> 0 — £ r . — — c k_ < 4—1 O O 04-» *0 £1 • 0 a 0 k. 4_>4-J o o o o 03 U O 0 O c CJ a o — CO I«3 o 0) 0 o) cn a 0 0 0 0 0 0 0 0 0 k_ T3 0 0 k_ k. 0 tn 4-J £ -4-» 0 00 — 0 0 I &— GC 0) 4—< D h- CO*o 4-* 4—14-* 4-1 4- *o -O -- -- £: u — < o o D k. k. 1 £1—• 0 D a a c 2 D D D 3 3 J D T3 (0 D —- — o CO 0) — O GD k. k. k_ ao 4S •4—o 1 B<J (J U a +-> o O O O U O o O 03 O o O o 03 0 03 03 — 4 » I :— •4— o 0 o 0 0 — 0 0 0 0 0 0 0 0 0 0 k. k. o o o k. O 0 £ 0 0 4 D CO k. i03 k. X 4-» 0 03 X X X X X X X X 0 4 X o o 4-J 4-1 u — o — — 0 0 a 0 0 0 1 ftO a 0 rt n 5 0 0 0 0 0 0 0 0 4-» > 0 CO CO 0) > o H a O CO CO CO k—C i *

-O • 0 > ,o 0 0 0 0 o k.O c CO o >*- C o O o O O o O O o o n O o o c c c o C k_ o o o o o O 4—< o o o i k.4—1 03 4—1•— 4-< 4-> 4-* 4-< 4-t 4—S 4-> x: 4-t 4 — •— 0 4_> 4> 4—1 4> 4_> 4 o i a>

a * o w 4-» D CO \ 1 £icr 0 3GCU 3 0 GC GC GC GC GC GC GC GC GC GC o —GC GC GC 3 D 3 GC GCXGCXGCCCXGCCC 4—1 1 -O\ JJ k_ \ (J O 4—1\ \ \ \ N \ \ \ \ \ — x: \ \ \ O o O V O \ \ \ \ \ \ \ s •*- l 0cn o k_ to CD k_ D to cn cn cn to tn tn cn to to tn to to k_ k. k- to k_ o cn tn to to tn cn to to to 0 1 3

£ 0 u **- +-» 1 —1w 4-t CO k. 0 k. k. k_ k. k. k. k. k. k. o o k. k_ k_ k. k_ k_ k_ k_ k. k_ k. k- k. k. k. 1O c c o C o X o o o o O 0 O o o o o o o o o o o o c o o o o o o o 0 o p

£ 4—1 k. 0 4—1 4—' 4-J 0 0 4> 4—1 k. 4—1 4-J 4 4-J 4—>■*-> o t •*-i o

c _ k. CZj

c *c c c c c c c c c C C -Q -O c c c c c c c c 4- c c c c c c c c c1 W 1 k.

o o o o 0 o C o o o o o o o o o O 03 o o o o o o o o 0 o o o o o o o 0 o o 1 CLz o — z k. z (0 Z Z Z Z Z Z Z Z Z Z i - i - Z Z Z Z Z Z Z Z G C Z Z Z Z Z Z Z Z Z i D 1

/ 1 / y / I1 LU UJ y / / UJ UJ / / -1 UJ 11 cn UJ cn UJ y cncn/ / j u / to / 1

UJ / cn / tn -J uj / csjcm / / _ i _ i / c n / / / / LU 1UJ 1 cn / / / / / / «— / / / LU UJ LU cn / 1Z i / <— i i— < / U J L U U J U J t n U J U J U J U J / / U J — — — J- ujujuj — tocncn/tu {< 1 Q i— i N i— i r~i tncncncn/tntntntn tncLZ — — o — lu c n c n t o r s j / / / to 1z 1 <— i CC <j ( J X cr — / / / / s s s s / D Q i - c \ ) o D m i r / / / _i — / I•—* ( > < -J < LU _1 — * J I _1 _l _1 _1 _J 3 _: o — — — o 1

1 UJ CJ < < X LL J r —i 1— .C D 1—. r - i r - i 1—. Q Q r ^ J J J J J ^ C C «— —'«—' uj •»- Csi ao '—1 1y—\ | »— <j CJ CJ X u j » - t n x z D t n c n o — < < l l 0 0 0 0 0 _jo t - L L c n c / ) u o < j k 1Z I h- cn tn cn - J -1 GD — G D C J U J C n i L 3 C 0 C n j . J J G C G C G C G C G C G C t n > L L O O Q a Z j - 1U 1 UJ UJ < < »— »— • < .................J - » - - u u u u u u • ....................................3 Z> 1O i _J i

a *— CD CD o ( J x ^ x x x x x x x x o c j x t n c n c n t n c n t n x x x x x x x x n a 11i

<J I y S /~s /—s yS y—S /*N N y>-s yS y«> ,rs y"-s /—N ys s ys y s y- /"» y>-\ /*s s ys y's 11 <

UJ I 0) TJ- 0 ) Cj o c o i n r ^ ^ r ~ o < M C o r ^ c o o 5 ' V C 7 ) o o ' V f l o o o c o c r ) r ^ mcDOJC0 05 0 5 ^ r m o 1 <a i CO O m Cj m i r j r ^ f l o o c o i n c D r ^ o o ’- ^ r c o o o O T O T O ’- c o o ) •»-^rmin<£}O5OJ00in 1 o^ i 05 o o o i - t - i - OJOJCMCMCMCMCOCOCDCOCOCOCO'V'V'V'V i n i n m m i n m c D C O C D 1 o

! CJ CM 04 04 04 o j o j o j o j c j c m c m c m c m c m c m c m c m c m c m c m c m c m c m c m C J CM C\J Cv) C\) Csl CM Csl Cs) 1 <*Z I m in m m m m ininmininininininininioininioininioinin i n i n i n m i n m i n i n i n 1( J 1 O 1 w w w 'w' Vrf- W N_/ 'w' W »w' N_/ 'W %_✓ W "W %_✓ <W W %_✓ \y< w >«/ w Sy1 1 1vj 1 -J 1 in Tf r - O) CO C J L L Q D C J Q < C D ^ 0 5 C sI L L 0 0 ^ ^ J * < U J C 0 O ^ ^ C00l00UJ05r^-OGD< 1 m1 C4 m in 05 CD C D U Q L U O i - M C O ^ i n i n N O ) < < < C D U Q i - C M ^ ^ ^ - i n r ^ 0 5 0 ) < 1 ^X 1 GD GD CD CD CD 03 GDGDGDGDCJCJCJCJCJCJCJCJCJCJCJCJCJCJCJO Q Q O Q Q O Q Q O 1 GOUJ 1 (J a cj cj CJ CJ CJCJCJCJUCJCJCJCJCJCJCJCJCJCJCJCJUCJO < JO<JCJCJCJ<JOCJ 1 OX I 4* * * 4* ^ ^ ^ ^ 1 * *

No. 72- June 1984 MICRO 63

Page 66: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

c c< jCD

Q_>I—

IUJCO3

O

03o£

co0 )>

*o

o-C

CO

<D>Oz

c

£3

OU

O0 3

a3

CO0>>o£CDCO<*u

J Iu

>< j

Xu

<0c

34—'<D

C<D<Dk_UCO

£ ' o

o00zUJLL!a :

c a o cn

> —

c 4- o c

— o4 - N

03 k-

CO Oo r 0 3 a a a :

3 O X O h-< J k_ CO

-Cii o4—'

> co — J I

— cj

CDCO

<D. c

o^ ra .oi—cn

c0 )<Dk_U<0

co

<DCO

c *o c k_ — — o o i i 0 ) c u u.0 ) c 0 ) u o JI a - c <J u. •4— <0 c 0 )0 ) • — 0 ) 05 4—> 5 c O k_ « >k_ k_ <D — II “O 4—' o A > k_ co o c CO 0) c <D <0 CO 00 C ACO o 0) £ 03 c 4—' — k_ 4— > 03 k_

03 r 3 C £ 0 ) O c k_ k_ » 4-> 3 ► , 4—'c C c — £ 03 3 CO * 03 o c o o 0 ) 4—> c 4—' C 3£ £ o £ O 3 0 ) — 03 N o k_ •4— r 03 03 <D 0) 0) a3 3 4— 3 o — o o <s> c 4—' — •— o Z k_ 03 03 0)— — — O <* u *o • — c k_ 4-> < UJ > k_ k_ “OO O 5 o o o a o — 03 o • — c LL! *o U > u cu u o o 00 o £ ii 03 0 ) c cc •4— c 03 03

*o o c ^r •4— k_ o 03 •— <J •4—o o c o c ^ 03 c o 3 c a 01 03 -- c 03 ccr ^r — GO o 03 o £ U 03 u u. *o c i: k_ A <

O 4—' 3 *o 03 c CO 03 o c 0 ) 4— *o 3 4—' XO O O 03 4-> U — c 03 0 ) 4—> 4- t 03 c 4—' <J4— 4— o 4— c 03 o o 03 JI U 03 c u c <0 03 c

0 0 0 o 0 0 o 4— CO k_ o <0 CO » u o o cc o c — 0 0 H £ u k_ 03 0 ) 03 »07 CO £ 0 ) 4—' 4—' £ o o 4-> 4-> 03 k_ <0 r a k_ c *o u.03 o 03 • — £ 0 o k_ <0 <0 0 ) -C CJ 03 03 0 c 0 ) u.

£ k_ 03 o .a k_ 4— 4—' u c a a 4- « 4- 0)u o ■4— o o k_ c u. < <0 o 4—' u 4- o 4-CO k_ CO a ■4— ■4— — 0 0 03 <0 k_ A <0 ■«. c <9 u

k_ 0 u. +» c u. k_ 03 A £ CO 03 <0c 0 ) c o 03 03 > c U — 03 <0 u. — O <0 0 03 <0 k_£ 03 4—' £ C 4—' X <0 « 4—' i: O O r k_ ii a ii <n3 c o 3 •— — a <j ii k_ k_ u o 4—' ^r ? u u C3 i:— •— — 4—> — 4—> 03 <0 CO k_ 03 uO — k_ O CO ii k_ JD ii u. 03 • 0 ) k_ 03 o 03o O O 03 c 03 C3 u <0 k_ <D 4- 03 ii CO 0> A 4—'

03 -C £ C 4-> ii <0 CO JI o o *o <0 4—> 4- k_ A 4- co c C3 o o i i o 03 03 k_ o •4— O — o 3 4-1 03GO o tT 4—' o X — i i 03 £ 3 <0 03 U 0)

Q •4— 4-> • — 03 <J 4—> ii 0) 4—> C3 u £ k_ u.4—> T- +- C 4—' 03 k_ k_ c cc CO C3 ii 03 u. — <0 o 4—' O o 3k_ UJ k_ o k_ — 03 O 3 CO 4—' 03 CO O <0 i i 4- 0 ) 4—' C30) o <J> 03 > u. o 03 k_ 03 ii •4— C3 U 03 C3> ii_ 03> < > 0 ) > O C <0 03 — 03 “O 4—' > 03C CL c > C o 03 > 4—> c > o • — 03 o 03 O O u. O > 1—O h- o o o o — o 0 ) 3 C ■*-> 0 ) 03 X 4—' i: 4- 4—> 03 4—' rt u jC3 X o £ C3 c CJ £ 03 • — 03 u. X C3 4 -t 03 CC

1— 03 o O o O <D 03 0) 03 O 0) <Jo o o O 03 4—> o o O o O o < 4—' — A c *o c C « c O 014—' o 4—> 4—> 4—' w 4- 4—> o 4—' a C3 •— (C •— •— k_ UJ

4—' C3 s 4—> c s 4—' 03 4—> 4—' <0 4—'CC cc cc cc 03 ac cc cc cc CC CC CC — cc k_ 3 3 3 A 3 CCs 05 s s s s s s s 03 X s s X o C 0 o O C3 O s ___01 k_ oi cn 01 k_ cn cn cn cn 4—' £ L 0 1 cn 0 1 k_ 01 •4— <0 k_ 03 k_ u. k_ 01 >

03 03 03 a 0) 03 03k_ k_ k_ k_ k_ k_ k_ 03 — u. k_ k_ > u. u. i: u. k_ COo u o 0 o o o 0 o o o o o C3 o 0 0 o 0 o c

<T5 4—' 4—' 4—> <9 4—' 4—' 4—' * ■*-> « 0) 0) 4—' u. 4- 4—> 4— 4- k_k_ • — •— — k_ • — •— 0) k_ •— — • — k— •— — 0) 03 *o 3c <0 c c c <0 c c c c *o c c c « c C3 > C A c c c c

O -C o o O -C o o o o o 03 o o o ii o <0 G 4—> o o 03 O o 03C3 z z z C3 z z z z £ C Z Z Z C3 z > cn z o 1 1 k_ z z CC

* o<D><U0 )

CO

J

. c

<D

COc

03 f i j CD k- 03 4->

3

>

“O CO Cco c

X -O

« z > <O CC

\

zco O <D CC

* aC COu . • 4— <3 *o a> ~ cn •0) 03 k- CJ •

k_"D <D <Dc a —<U CU 03

3 C C O <D C »- <D <TJ ~U 0 ) 0 )

J lc « -o

o

<b . k_

o

<D

1 a

034—><S4—'05

053O

>0 )k_a

05

<* c c c <j

— 0 1 O LD

0) Au a<0 3

— o a >-<D A

03I

cj Or t CC k_

GO A ILo

<D4- A 3 4-a

CD 03CO k_4-J<D03 y <• o

101 ti­ ti­c ll. ll.p <J CJ3 4*O 4—oo 03 0?00 0) 03o uTT 4—

c c0? LU UJVo .03 03 0)

*o *ca O o

£ £c co £ £— 3 34-1 — —.« O Ok_ • o o03 oa c o oo — tT 00c— k- c c(3 3 — U *-»01 0) 01 * • - cCL O

<D —

0 )c

O O O *-c cn3 34 - 2

O o)

CC <0 X ILc n

»- cc o <4 - X— CJco c z -

> . 4 ^

a — ocj . c

cj

o - *- .c J

01 03 ar t x a c o

< O GD k- \ <D _ l n c n

< a gd3

CO4-J (J)

3 CC O X»- cn

o o

c C Bo o c n2 2 U

03 (TJ* o

o a~ 3

c c * o » s c

a c o r t c

— U. *C 0 ( 5

3 — LL < - C > <D O Z ‘- Z -

0 ) £ a c nr t 3

c j _ j c n a .UJ

itk_o —

« - CD A

o) rt <D _J0) w 0)0 ) _ l k- _ l •o o *o c c<U CJ

0 3

O > . A

<D— -O £ <D (TJ 0) I— 3

GD <B < Q h<u a

a Zc/) BUJ

IIw

o —»*— <D

. o03 (TJ OJ _l CO W 030) _J

_ l ■a O •o cr(TJ <j

cn o >

A03— 13

A 03 <3 03 I— 3

/ I 1 1 / / /

/ / UJ

/ UJ

/ 01

/UJcn

/_ l

/_ l /

/UJ /

/0 )

/0 )

UJ 1 Z I < 1

UJ</T/ \S

E\S

E\ \SE u j cn /

01 / UJ/ / cn

— _ i /

UJ /cn // ■—1 UJ

CC 01

/

i—

/

o

\L\

0]

\

\L\

\SE\

UJcn/

/ 01 _ J / /

LUcn/

CL/

CL/

Z 1 <—i '—• <—i ■— IL / — < / — 00 — TJ- i—i i—. — Z i—. UJ UJ^r CC — GO UJ _ J — 1 - X z z o z o — u_ ►“ o CL

1 00 O ^ 1 - < — X H CJ '—1 UJ UJ 00 UJ Z Ll UJ cc 32 £ CD1 z IL 00 Z < X GO CJ UJ c c ^ UJ UJ cc UJ OC O O oc > 1— < <Z I c r UJ 1 - CC m r ^ H > O o cc cc o oc O u < J < J CL LU i— h-< J 1 < j H UJ U C J O UJ Z I-------- <J <J 1 - <J i - cn cn 01 O 01 . .O I 01 < o cn i L u o c n — cn cl cn cn o i cn cn u j UJ UJ <J CL LL GD_ i :

i,— , i— i—i fc— •— •— •— fc— .—. i U—l W-J

< j i /*•» ^ ^ ^ ^ ^ y—S y—s ^ ^ /-S y—N / « . /« . y—N y-^v r~ \UJ 1 05 CO O CO m ■»- cn ■»- r- co co 00 CO r - <o CO CM CM CJ CO ina i CD r- co CO CO 0 ) t“ 1/5 h - O) 0 ) o co co r- 0 ) o ■»- 0 ) CM CO

CO r - r - r - GO 00 00 0 ) 0 ) 0 ) 0 ) 0 ) o o o o o o CJ CJi OJ CM OJ CM CM CM CM CM CM CM CM CM CO CO CO CO CO CO CO CO CO CO COz l m m m m m m m m m m m in in i/i in in in in in in m in

CJ 1 O 1 _ j i

w 'w ' Vw' >_✓ Vw' 'W' '•w ' '•w ' s—y

CD < CM CM CO T - CO u_ a cm t - <0 UJ < N < CnJ UJ 00 03 < COi a O CM CO CO 0 ) < < Q U_ O o o CM CO CO <0 Is- CJ LU IL

X 1 o UJ UJ UJ UJ UJ LU UJ LU LU Ll u_ u_ LL LL u_ u_ u_ u_ u_ IL U_ u_UJ 1 < j < J CJ CJ CJ < J CJ CJ CJ CJ CJ u <J U <J U <J c j u u a CJ CJX 1

64

* * * * * * * * * * * * * * * * * * * * ** ** ** **

MICRO

* * * * * * * * * * * * * * * *

aa

<

j i

CDQaa4 *

No. 72 • June 1984

Page 67: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

MICRO SURVEY: JUNE 1984HELP YOURSELF! To keep MICRO in touch with the rapidly changing computer world so that we can give you the information you need, please take a few minutes to fill in this questionnaire and mail it back to us. THANK YOU for your time.

DEMOGRAPHICS1. What is your age?

□ -1 9 □ 20-29 □ 30-39 □ 40-49 □ 50-59 □ 60 +

2. What is your occupation?□ Programmer/analyst□ Professor/teacher□ Business person□ O t h e r ___________

EngineerLawyerStudent

□ Technician□ Doctor□ Self Employed

□ Associate degree □ Bachelor’s degree □ Para-professional degree3. What is your formal educational level?

□ Fewer than 12 years □ High school graduate□ Advanced degree

4. What is your annual household income before taxes?□ Less than $20,000 □ $20,000-29,999 □ $30,000-39,999 □ $40,000-49,999 □ $50,000 +

COMPUTER INFORMATION

5. What microcomputer(s) do you use?□ AIM □ Apple II □ Atari (Model) ____________ □ Commodore 64 □□ PET/CBM □ SYM □ VIC □ TRS-80 Color Computer □ Other 6502□ Other computers/processors _______________________________________

□ Macintosh □ OSI (Model)N_ _______ □ Other 6809 _______

6. Where do you use the above computer(s)?□ Home □ Work □ School □ O th e r __________________________________________

7. Approximately how much have you spent on your computer hardware so far?□ -$500 □ $500-999 □ $1,000-1,999 □ $2,000-2,999 □ $3,000-3,999 □ $4,000-4,999

8. Approximately how much do you expect to spend on your computer hardware in the next year?□ -$500 □ $500-999 □ $1,000-1,999 □ $2,000-2,999 □ $3,000-3,999 □ $4,000-4,999

9. What additions have you made to your basic system?□ Disk Drives □ Modem □ Serial Interface □ Parallel Interface□ Hard Disk □ Graphics Tablet □ Printer (type) _________________

□ $5,000-9,999 □ $10,000 +

□ $5,000-9,999 □ $10,000 +

□ RAM cards □ 6809 card □ 68000 card □ Z80 card

10. What additional hardware changes or upgrades do you plan to make to your system?□ Disk Drives □ Modem □ Serial Interface □ Parallel Interface □ RAM cards□ Hard Disk DGraphics Tablet □ Printer (type) _______________________________□ Other hardware____________________________________________________________

□ 6809 card □ 68000 card □ Z80 card

11. Have you ever constructed a computer, computer board, or major computer equipment?If yes, describe_______________________________________________________________

□ Yes □ No

12. Have you switched from one computer to another?If yes, explain _______________________________

□ Yes □ No

13. Approximately how much have you spent on your computer software so far?□ -$200 □ $200-499 □ $500-999 □ $1,000-1,999 □ $2,000 +

14. Approximately how much do you expect to spend on computer software in the next year?□ -$200 □ $200-499 □ $500-999 D $1,000-1,999 □ $2,000 +

15. How do you use your computer equipment?□ Business □ Software Development □ Hardware Development □ Telecommunications□ Hobby □ Graphics □ WordProcessing □ Database Management □ Other ________

16. What languages do you use?□ BASIC □ Pascal □ Forth

□ Entertainment □ Education

□ 6502 Assembler□ C □ COBOL □ APL □ LOGO

□ 6809 Assembler □ 68000 Assembler □ Other __□ LISP □ Fortran

17. In an average week, about how many hours do you spend on a microcomputer performing the following operations?0-2 2-4 4-8 8-10 More

Programming for fun or self-education □ □ □ □ □Programming professionally □ □ □ □ □Using packaged programs in business □ □ □ □ □Using packaged programs at home □ □ □ □ □Using packaged programs for education □ □ □ a □Playing games □ □ □ □ □Other □ □ □ □ a

18. If you write programs, what type of programming do you spend most of your time developing?□ Business applications □ Games □ Software development utilities □ O th e r_______

19. In an average month how much time do you spend with MICRO?□ Less than 2 hours □ 2-4 hours □ 4-8 hours □ More than 8 hours

20. How would you rate your present microcomputer knowledge?Software: □ Elementary □ Intermediate □ AdvancedHardware1. □ Elementary □ Intermediate □ Advanced

Magazine Information

21. How long have you subscribed to or read MICRO?□ Less than 6 months □ 6 months to 1 year

22. How did you get your current issue?□ Subscription □ Computer store

□ Over 1 year □ Over 2 years □ Over 3 years

□ Newsstand □ Bookstore □ Borrowed □ Library

□ From the beginning

23 To what other computer publications do you subscribe?□ BYTE □ Commander □ Compute! □ Creative Computing□ Kilobaud Microcomputing □ Nibble □ Personal Computing□ 80 Micro □ 68 Micro □ Other(s) -------------------------------------------

□ Dr. Dobbs □ In'Cider □ Popular Computing □ RUN □ Softalk

Page 68: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

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

News □ □ □ □ □ Advertisements □ □ □ □ □ Hardware & Software Catalogs □ □ I— □ □Articles □ □ □ a □ Columns □ □ □ □ □ System specific information □ □ □ □ □Reviews □ □ □ □ □ Editorials □ □ □ □ □ New Publications □ □ □ □ □

25 Please rate the following kinds of articles as to their interest, with 5 being very interesting and 1 not at all interesting.

5 4 3 2 1 5 4 3 2 1 5 4 3 2 1Hardware tutorials □ □ □ □ □ Applications □ □ □ □ □ Review articles □ □ □ □ □Programming techniques □ □ □ □ □ Games □ □ □ □ □ Programs □ □ □ □ □Utilities □ □ □ □ □ News & Information □ □ □ □ □ Languages □ □ □ □ □

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

27. What new areas would you like to have MICRO cover: ___________________

28. Do you key in the longer programs published in MICRO? □ Yes □ No

29. Would you be willing to pay extra to receive MICRO'S programs in diskette form? □ Yes DNo

30. Overall, how do you feel about MICRO? How useful is MICRO to you?

Fold Here

31. What are your favorite software packages in the following categories:

Software Package First Choice Second Choice Third Choice

Data Base Manager ___________________________ ___________________________ ___________

Word Processors ___________________________ __________________________ ___________

Editor/Assembler ___________________________ ___________________________ ___________

Spread Sheet ___________________________ ___________________________ ___________Monitor/Debugger ___________________________ ___________________________ ___________

Communications ___________________________ ___________________________ ___________

O t h e r _______________________________________________ ______________________________ ___________For the _____________________________________ computer.

Please feel free to write comments, suggestions and so forth on an additional page of paper and attach it to this form.

Fold Here

NO POSTAGE NECESSARY IF MAILED

IN THE UNITED STATES

BUSINESS REPLY CARDFIRST CLASS PERMIT NO. 60, CHELMSFORD, MA

POSTAGE WILL BE PAID BY ADDRESSEE

A lC ftOP.O. Box 6502 Chelmsford, MA 01824

Tape Here

Page 69: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

HEX

LOCN

(D

EC

LOCN

) [N

AM

E]

\US

E-T

YP

E\

- D

ES

CR

IPT

ION

CJ ©LU • wO o a© cn o © o© o a: x tr0 a <j L_o o > ® ©c r~ a♦ ■o o c © © a

73 a: •— T3 Dcn c o T3 4o ~3 w © E C O(j d n cd 4-1c CO CO ^ o CM <dC p © CO o ® z JC r~

E 5 o ^ ■a 4 D3 — a II CO >- r>

cn < f-<CJcrLU2 3

, zX sz ^C W 3rt Q

■ ® > UJ _ „ _O U • »— Q. 'O ^ o —O M 3 O 4_- 3t C

o >. < w o c o o ®O !C (D UJ u ® *-> OC "O «<o j £ < ( * a ) c •_ x ® «

■ i- i T U T J oD O ®O 3 0) <D

o r : c ®® ■- *-> Jc. c. >- o4-« 4«j CO © —

© aco u c ~o — o o *-© — 4-» — © I OJ,c rt « > ino •*- © o c i \

h- »- Z oO u II o4-1 © >- 4-»CO C& flJ <D O® ® c x r t) i ato c o c_ " • > o i ao — — o ® uj E "o i <a ~ i - ® c y ®- 3 O O c — O ® «3 0 0) C O — " OC 03 3a •_ *-• j-> 3 i_

O Z O 3 O »- ® "0 J 3 — ^ Q ■- O > «C ® > >- c . <z— C - U J Q O T J — ~r ® n ' t ^ e ) c « ’ i <dO < *-■ H II 3 ® — ® 1- •_ X I t-

CM C C >- >- Cfl — • C — •*-• O ® <fl ■ i ®ii <3 •• — ii — to ^ a> i .ci > - > - ® x x > - o < r t C i - o £ E i 3f l T J i - U U " U ~ 3<H — ■ I

- - - - ^ - C X O O O O X " o >- Q ~ 03 I 01Q.o o (j — j i - ^ i - u ' j a u ' > - h i - u ' o i i ( D u « z c a o n r ® ® o u o u o c o o o oi L r in ® r < ®« Q f f l 3 Z ) ' o c ( 3 ^ o - i - o o i m m h a ® " U J c u ~ « i «

t- Z « O - O " : >- O — ® o O c r i £- UJ 3 > - Z > - C O O O 0 3 0 TJ ® O O O « OCC T5 3 <1 “ 13<n cn 1— cj uj o o 4-* 4-j 4-j ^ w — ^ 4 -j w .c x ■‘-1 ^ o cd

I^UJ UJ X 05 SC J 1- £ o o > o o o u o o m c o«* cc in ® cn o uj o u r a i i " * ■ c. c. — o cn ~ tj — c

I I — o T 3 0 C 0 — 0 0 1-T30 0 *1-1— 01 C "C9J ® > - Q ® l - ® — ® O C L C - t tX o c c c a w o c t t o . « * M >O .C a ^ o r o ^ rt > « 0C E o * - ffl K (5 E z o tn o ~ .c -C ~ X < *-' O O W ' - Q ' - 3 0 i - > _ 3 — C - ) Z « " 2 0 D I ®

u ® a o . n o a - i- ' a n - ^ > £ ii zi i no i c o - ' c o c n - o z o o o ® ® hi o o o n i c o n - i n— — i— i — ~ - 4-j o z ~3 o o * - o a * - o o o o ^ - ® " “ — SC o I ®O ^ 4 ^ ^ 4-J 4~< 4~< ^ CO (J I 3

.. © <rj »— © .e © « > *0 o : 0 — 0) > o © fi - ©n. a, — a cj a — © — c ’o ' o < ’o ^ c j ’O ’O ’O — c *- o o o *•- :Q C O C C C ^ u fll ® OI ® © cn G ) ® © w w © C C * - C ' J C< * r t ~ u j r t r t r t . c o © a c? a * a a. z a a c & © D £ } r t r t O r t © < «

n _ i . £ i - . e c j c j g t f l c — c c j c x o o c c c s * * .c .c « .c •- >. 1 0« o a: cl u jd o — o - ^ i -<* cn a. £ 0 0 0 £ 0 £ C C £ - x .c .c r o a: ac 3 o od t CL

£ II 4 cc 5 4 c •—in

CJO 4-> cO <T3 CD © D© o w •4—

© o "Oo c c II 01 «c © flj © (ft ©© 0) N ©<S) © E N 4—'© L_ 3

a V i 4»> cra — w ©© •—. CC© sr: 4—< •— ■ —o .

T3 CC (A© W © ;00 u o O — 4m> o LU3 o ■*— ■4— r*> c CJ£ a © CL5 5 J < w o Q.

5 0 O w CO <a Q — — 3n —» — — O CJ L_ A— o CJ

O "O © O CO 1_O o c > 11 1 ii4—' — © > 1- >

X w "O <0© © o x a> x

0) *o "O n O o CJ 1- u© "O O O o 41 o o

J < -> Al A a < J - LL CCu z u : u < u u u u ll — A A o < u :^ f-> o h-—> *—> ^ — 1- ^ X CE •— N — CNJr—• — a X a i~ cc - j cj — -I -I — — X r—1 cc|— UJ z CJ o a: —*o -i o il O O ZU LU cc oUJ _i a o L u > iu r o h l l uj lu — cn a CJ XCO i— h- h- occlzi- c e o - cc a: >- uj z f- HLU — LU o j o o d u o z J JL U Q D o / 3a: f- cn o cj cj x < cn x cn CJ CJ *£ cc LL z <1- UJ uj t_i t_11_< t_i t__i t_i UJ l-J t—J t—1 t__> / CL —T- //-V y"N /•-N. Q.

CNJ 05 O CO r 0) CO 0) C S 0) O O 00 CO in / ^ in2 CNJ CO ~ r 00 0) o O CJ CM CO C O S O O r CO X CJO CJ CO 1- Z ^ LO LO CO CO CO CO CO CO CO CO 00 CO oo ^ — CJCC TT O ^ ^ ^ ^ ^ ^ ■T ^ ^ TT h- u_ cnCO CO CO g — co CO CO CO CO CO CO CO CO CO CO CO CO CO cn s co© 1 1 1 z cn i 1 1 1 I 1 1 1 1 1 1 1 1 1- 1 i- 3 1o N* CO N CJ CC CO CO CJ O ^ ^ CO 0) 00 o CO ■»“ o CJ ^ cl cn i-cc ^ i— CJ CO 0*! UJ CO K 00 O O OJ CJ CJ (0 S fl) o o cn co < ^ C JLl C*“ T- CJ CO UJ > in uo co co co co co CO CO h*- 00 CO UJ CO CJ CJ CJ

tT •— ^ ^ ^ ^ tt ^ ^ ^ ^ ^ ^ — in© CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO<— /•"•N 'W 'W Nrf- /*v 'w' W <w> S * <w> V> ■w' 'w' /*—>. wN- 0) in CO & 0?CO < Q Tr co o in N CD 1- ^ CD O N- O 00 O ■»- CO 0} 0) 0)TT h- O CO TT cj 'C cn cn co n n cd 05 < C-J OJ CM 00 ^ 00 y- CJ•— co < CD CD QD CJ CJ CJ CJ CJ CJ CJ o o o o o o in luCO LL Ll ll CO co ll ll LL LL LL LL LL LL u. u. u. u. u. co u_ CO CO LL0)fi) w iA 4* **1 1 4A 4A <* 4ft 4A 4* *f> *f> *f>1 1 1 1 1 ^ 4ft

wa Ll lo1 1

< r" CO co 1 1 1 1 1 1 1 cj co co cj o cj cn

1 1 1 1 1 o uj m i- cn o CJ co u_ cnc IL h*» o < CD CD <T> 0) T- C>) CM co CO < CJrt Is- < CD CD CO QD CD a cj cj cj cj cj cj o o o a o o a a UJ UJr Ll Ll Ll ll LL iL LL ll iL Ll Ll Ll Ll ll U. IL U. U. U- Ll Ll Ll Ll llo «* v* ifi 4& 4& <& 4& <& 4& 4& 4ft 4ft 4ft 4ft 4ft

LLLLLLLL4ft

LLLLrLL

No. 72 ■ June 1984 MICRO 65

Page 70: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

zo

Q_

crcnidQ

/UJQ_>H-I

UJ

T J •- o

CO O UJn o > z ®

X O4-> ®® X3 £ 1 O~ 2 E

o05

<fl c j a ' i ^ co ’—

CJ UJ

aDac

CO -

> o o

z -> > uj n

050)

a-0)

>DO

■OJ

£

■a *-co o D •X- £5 E

o a •-

O ®

CO —

a-TJ

0 — 0rt 0)0) c a o a fij +->

® a

— ® d —

•4- - 4- OQ — O ^

C■a ® -o ■- c ■- c

- ® > C C O 'O*J l l 4J C

ft flJ *■ai ® ® ^

o o o * -*—• -*—• -*—• i

® ® ®C C C T )

4_' 4 J 4-1

D 3 Do o o Eu . u . u . *•

X

C O O —'

- ®

T- T31 —o o O'4—r~— 5 »

4-1 ■— 4-J05 4-' o

® <J c4-J - — c .• — ■4- D ® ■4--- C —

- ® Ia c

- « oco c j c o ui a u j c

a ®C C - "D® - ® o- 73 4-. S- 3 0 D — —CJ CJ •-

C -^ — c. ®f t CJ 4_-

- ■- a? — <3 .c.c .c ®cj o . c

vO ® 4-1 *« £ 3 « £ w O ®a *- c • ^ — > O O

^ Dc 05 o— 05 01

® h- ® ■- cr £T3 73 ®O 7 3 ® Cy rt

®^ ' j i '*_ r

05*

®®

OCO

T3Caj

®73O£acr

— > .

5 jocn* <D

4-> 4-> ® Q0) —C ®o rf c ® oj ^ o01 o c ^>. ®• - c c o o o o c

- ® D 00 > <N- C W O X

o o J - o o cr£ 4-, CD — — *- •*- '4-. 4J

o o o a £ £ £ g

® COCO CO - .c

® £ o® O CO 4->> o \ — c a £ - a d co

0 - 0 0 0 ^ 4-J 4-Jaj

® ® ® c c

oT J

®CO

CR®c

_ \s— cj 03 *

4-J05

' >- »-

« cr- \ • oi

^ jQ O4ft 4-i :

CO c O I

^ 2

C Oaj 4-( > — • ■— cGD 5 : Z

4-» 4-i 4-» r r C C C \----- coO O o a a q •-

o> > > ^

c c c oUJ UJ LU Z

O -t—1 4—>3 05 D D0 ^ 0 0 - D ^ -

<J

o ® o o4—' ^ 4—' 4^

o - — c ^ c co ® o o2 - Z 2

C N-® II 05 >®

Xa —

>.£ l ■*- I

— ®■o a ® • aj o X "O <j ® ^ CO

aj uj — c o c

3O ® u . —

o 2 r®

— t >o 5-6a yj o h-

« J ■*-> ® CD•- < 4-1 o*-< W h 05 0) 4-1 >C D • ® CUJ CL CD \— U UJ 01

Oa x

( J>.•- ®

05 05® ® X o ao <J o cr ET3 05 ■w CD — D

\ ■ —>o >- c ® O < c © 05® UJ — CO ® i 0 ^r 73— .c <d • — a Co a a ® o LL 4-> o ®

cr D LL — o ®•• »• <J 05 '4—.c a ►

05 T3 a- 4-J o o aD — c a Q 05 r. aJ4-J o — 4-1 y o —

4-J 4-J (Q — O 4-J f j '4—4-1 Q 05 CO ®05 > o CO 4-J . r~ a J-l h—

_l — T3 o ® f—> CJ cr 05 —j / o — 4-J ■ — O <J z> > o N QC . IL Ps UJ (j c 4-1 > LL oIQ 2 £ o 05

w o LU z '4—X o 1 O T3 X a a co OCJ 4-> ■4— 05 • c CL ®r~ X /— ® — _ 05® cr o 05 X !_ ■o o 05 05 ® 05 o> cn • — >U - D o 05 D 05 _* “ 5 4-1 ® CD 4-1 5 D —05 o V* ® ® D ® ® CO• c E c c CJ r~ ►. a CJo c D ® ; o • — 05 E • — • — —4-> ® <*— C ® 73 — J c D 4-J — — aJ ►

CD -— — *- C o E — c o Q_ oor ® 4-> a aj ® ■o D O ® £ C 05 4-Jo .c D a > c c a ® ® <T3 734—> o 05 4—> O < > o O ® ® CL £ h—

D ■— : o a- J o o D aj oa c <*— E c a 00 U O c _lc — o o o ® •— o 4—>o 05 05 m CO—73 4-J o £ 4-J X CO c 4-J X 00

73 : 0) •A— 4-J — ® \ — ® ■w 4—> uE CTJ LL 05 CO 05 ® — 4—>o a- o o o *0 U- ® K OJ w Oi o ^r 05 ■4— c > 05

5 <* 'w cr 05 ® •_ 4-J 73‘4- ® ; ■o M •— (> •* ® Q £ 05 CO■o ®t t "O ® ® — 05 05 o ■«— CO 05 £ < 05CS j/ r- S3 05 *o ® ®

® r < i j ■a o o c o ® — »--- 4-< ® «• ® 4 •— c 01 73 73 ■o QC OJ— *. 05 ® D . D 73 73 ® < ®rt J o > 05 o £ ® ® >"“v. & — X 2o 05 j3 <s 5 •— c c 4-1 CD — n <J >» OJ O

>, o 4—> -—— X ® < O ® ® rt — cro ® D 3 73 05 05 O ® a h- O 05 05 c 05 ® CD

a O > o n D D 4—> « Q . <T3 ® ® <J 00— c 05 o O U Z o ^3 x £ i > OJ CJc aj 5 ® a x i_ — CO 5 00 01 05 OJ o

® "O OJ o LU ® < ® • — 05 c cD T3 c C H- ® — E M c 4-J CD 4-J a • ——4-J •!TJ 05 ■a o o o OJ \ oj O > o 05® ® 4-J CD — 4-J 4-1 o o — — _l — cr 4-J _ 3 <J

D > _ ■— — c «+—® X D CO D — c a —a ^ D ® c c £ i o o < O .— a 05 CO

o O o >. O O ® o o 4—> 05 ® — CD — o <«3 4-J <4-< «• OJ ^ 4-J 05 £ £ ® ® _ l SZ OJ — a O CD

05 4-J 4-J 05 CO■w o o £ o ■J) —® ® D 05 TJ ® • — O 05 -o , >. w 05 ■ac 4-> ® o o O ® j o o o c 05 ® —— — OJ C X - — ’i—<*—4—> 'm- _l 4 4-J 4-> OJ 4-1 05 > o4-> 4-> o ® 4-! 4-> 73 73 O -- a c c uD D 05 D l_ 4-> 4-1 cr T3 cc cr cc cr ® D ® T J OJO O T“ c O <T3 £ £ N rf CJ \ \ CO\ 73 i_ C-*-> <J •— O ■ —CO cn co CO ® CO O o OJ o

a <ft 05 J3 o Q '4- £ ® \UJ ® a a •_ o > 4 >— .. O E

o Q 05 _l o — o n o o CO o r* c 054-> ® CD 4 O >, >. 4 ® 4 4-> 0) 4 £ — CJ D 05 rt— ■ — E o — — 73 — •— — 5 — w C 5

c 4~' 05 1— £ £ ® r~ o r- — l_ CD OJ i_0 o c D • 5 o 3 05 5 4 0 O O < 3 oz z — CL U- 2 5 0 0 L U U J 2 H- D 2 2 u i 2 o CD 05 H- 4->

t- cnCD U U UJ U- I

CO IXI 1 1 i / / / / / / /

/LU /

// / UJ / / /

/UJ

/ 1 u in / / uj lu Lu uj / _i / UJ UJ / / / cn UJ UJ LU CO / LU / UJ UJ CO1 / i n o _ i _ i c o c o c o c o u j / / LLl CO CO LU LU / UJ / CO CO CO / CD CO LU 01 CO /

z 1<J 1

U J U U J / / / / / / C 0 CO LL IL / / <fttft — — — A

]\

L\

\S

E\

S / / CO CO _l CO / / / /

LL

/ / / CL /

^ * 0)

/ CO /

/ /

CDO 1 i— i— CMLl COCD-’- U J ' — o — lu r - — -—- ■—• T— r Q N f u_ ^ r r- CO_J \ O D Q Q liJ CD UO < ^ — 1- O O ^ UJ ^ CO T- CO CJ LU CJ CO ll ▼- in T- CO

1 < C ) ' r "T “ T“ C'JO O N O r r- 1- < © 0J Q0 CJ CJ 1- 1- O LL in CD co CJX 1 o co uo c j c j c j <j c j c j fJi 4ft LL O C-J U U r c-J < CJ 4ft CJ CJ CJ 4ft LL CJ CD t 1 4ftLU I LU O C-J 4ft 4ft 4ft 4ft CJ ' 0J CJ 4ft 4ft CJ ( J CJ CJ t__i 4ft 4ft 4ft CJ 4ft CJ 4ft 4ft i—iX 1

1

CJ CD CvJ ■—11—- ■—1 ■—1 ■—1 ‘—'^ LH ^

U_ CD CD **~vCJ CJ 4ft 4ft ^

OJ '

^ i— 4ft ^ 4ft 4ftt—J L—J

CO

u-i ^ 4ftK-J

o

4ft

*<r1 LL 1 I ^ O O m C O ^ * ^ Cvl ^ CJ lO ■ ,s- ^ CO CD CO 05 00 ^ C-J CO i^

Z 1 r«-T— CvJC0N--»- r - ^ OJ T- C-J 00 OO o ^r ▼- co cd in CD CD in CDCJ 1 U-CDOOJr^CDCDCDCD^CD ▼“ CO 00 00 ^ ^ r - ^ © CD CD CD CD CO CD ''T © CD CDO i « co cj t- t- 'C D O C D O ^ t in o o cd o a) in cd oo CD 0) 0) * CJ O © CvJ CD—J I ^ 0) - r CD CO T- O) •w ^ w co CJ in r 'W'

iCJ 1 UJ I

c j c o c o w w w w w w i nm w w w

1 ^ ^ J— Z —1 fsi Q_ X

t- a cc m t w< w w

w w tj- ^ m •’T

UJ ^CJz X

w w inX w

J Q Q

w i n

cr M h—CMH-

a i a0 T-OJ — < 0 - 1 0 — h- X T- z z o x z 3 1— _J Z Z UJ O c j CJ z zi , r t r a : a : _ i u i u o i u i L D u n u u U CJ u CJ LU — LL LU O B ^ —• h- —I _i UJ UJi n o o o z ^ t r u J c u Q . x - z z z z z i - c r > - a 01 CC H- I - CD CJ < < o CJ

UJ 1 b i l x k i j j j w z - J D D D n D L U Z l U _l UJ CJ UJ LU < LU <J CJ — —Z I ^ t U I - l - U U U U U t l ] - Ll U. Ll Ll U_ Ll Ll C9 — ^ o QC CO 01 CO 1- > 01 CO 01 CO< 1 i - 3 n ................................... . • < < < <Z 1 ■ > ' < < < m c D C O C D O D m m CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD

66 MICRO No. 72 • June 1984

Page 71: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

GCC JCOLUO

01CE3

OOo

c j» U J

> ah - er CO

OJ ; c cr : 3 :4-* 4-< OJ o

O CD 0) * o 4-J£ *—— L_ o4—> — E o c• — X <33 COJ o <J 01 <D “5

CD ■ — a< -C o « 01

CJ 4-f C J «73 <D CO oCD £ r" U J aa o 4_i 4-i— O 3 o c .

c j <D c 4—1 oiCO a - CD * > ,U J n o i VD c 0)3 •_ Z • — j:05 <S— * —0) O .C CL E $o ■*-» 4-1 O < a> oA c • —e'­ CO l.—• —0) u :

CL 01 LU

oi <D— o o 73rt j—' 4-/ Sfc. Co .C O <3

O <« — c t-Jk- k_ <D E0) 0) * 3 CO) £ £ 01 4—1O <J 01 CD 4—1 ..— CD k_ • —

— cj .Q «01 — o o * •—k_ 4-1 <-3 • a CD aa L_ c CO •— o<D O 73 r: *_* O c 4—1 i>, CJ -- oi $<D 0) n « oJI 0) 73 ~

<d 4-» <“ <- Q —73 .c 5 a O «ra

o o

a' a> .ca ----- n o.O .Q O -o rt rt .c~ »- H- < 5

<D a < 1 UJc- I UJ•— CO 1 h-4 > a t J—T” ' — o c 1 UJ* 4—1 CD L_ — 1 N*o c O c- 4—1 a 1 <a CD O ai u_ 4 05 c 1 CD> CD —Ll 0) a> 1CO i- 73 (J 7D — 73 r. i _J05 o <D <- •— o 1 <</) — o (0 ii < 1 <J'J) 4—14 > •—c 4-‘ u o l t—J o 01 o 01 cc I UJ— n 03 5 <- 3 1 GO4-J 73 0) £J o O *0 1 <+ • — CD 1 X.C : O o 2 4-1 • 01 1 CL*-> \ 05 4—1 O X 3 I _JCD •— c CC J M CJ 1 <c fji 3 UJ X o 5 cc . ICD %— 01 a O CJ 73 — Z) 4—1 1CD CD £ c C c o o 1> 'w— ••<D CD •—c k- c 1cj C o > 5 73 ii $ o 3 05 I0) — CD o <« O O 4 73 4-« a Sfc. 1• a- CD 73 0) o £ 0) 01 _ 14-) C <d 4-1— C c 01 Tf k- \.c D L_ a — c E <D UJ 1a 3 CD k_ E 3 0) O 73 . z 14—1 — <D 3 — u. O 4—1<S C GO 1c 73 0) o £. 0) — O a) 4-.’ ii <d o 1 ©o c a 4—1 o O o 4-i 01 * 4-1 05 « 1 \

73 o • — —o <P <D o 0) L_ CD<D 1 \7D C 4—1<D O £ 73 a n 3 4—14-1 1CJ cc C a) a o TT <d C c O O o o 1 :< « o O) <«Tf u. 4—1 3 3 1 <Dn X a) 4—1<D O $ 4_l 0) CJ CJ 1 —u c n C a C a c COii i a<x> 4-« — • — 4—1 • o $ 0) <D i a<D c <D o c o ? <D 00 73 _ — i <4—1 • — o <JQ3 o 01 00 o <s c <n 3 n \o o 4-1 u O • —c 73 c •— E D 3 i ©<« •— 3 4-) o £ C 4—1 o a O o O O 1 SZ• !_ O 3 • — o ■ — 3 n 73 73 i ^C <D o 2 — 4—1 y-N J 3 O •4— >. CD io o C Aad O ' O o T” •4— O <d rj 01 rt I co — o cc « CO c u k_

t— L_ — 0) 3 cn c a 3 ZD <D£ a ® 73 u 1—UJ o <D c <J X —■—•4— Z c 3 ) 4—1 <p 0) CD 1 ©acc sz u 4—1 •4— • — •u > — — — D o r 4—1 <D> 1 L—o o o — <D ® 2 — O C — o 4-> o 4—1 O 1 CD•—C/) <TJ V E 4—1 <Do Q CO o — L_ O 1 iiau j w 73 <D<*-» C o c £ — <TJ D <D < <TJ u. k— a 1 B•— c C <Do -i C o o r: <S) <d c 1o <D o <3 •— E — —tn cl O CO • • o ^ 0) r: rt 1 v>o L_ o 4—1 o z ^ c a H3 UJ a> <D o ii oO c t—cc o 3 E ii 4—1 — ii <D<Do o « 1 m

® r: D CO <S) o • — L_ L_ — <D C £ . 0) a I <*o a <J c 3 <A *— 4-1 X 01— o o — <D 13 r: o w r: 0) 1 ^<« 3 o a 0) k- UJ 0) rt — c •4— <D> O < 4_l i B— O <D ■— 73 H3 rt cc J J O n c X <D7D o i :a L_ > t— 4—1 o O 0) 0) <D • o o L_ 4—1 01 o 4-1 u > H3 o H3 i<d n ffl LU <TJ 4—1 u —— —LL 73 u ® J <J (DOW O <3>4-< <D UJ ^ I oico CC — o O <J •—01 01 CO 0) t—h- E c amu CO<D0) o — <S) CO o o cc l Mo COo CO c C a o o o * c •4— o O (D _ l O CD o O o 05 • — | L—

— 4-1 UJ — H3 4^ 4-f •— — 4—1 4—1 -1 4-> c j-f i o— u U 0) — ■O O \ r t 3 <D i ncc rt CC (TJ 4—1 3 cn cc cc cc — 3 CC CC 73 GC CC CC o CC GC r GC Q *0 1 £1\ IL N ■ — O UJ N \ \ • —o o • — \ \ (J \ \ u ai \ \ a \ O 1 <Dcn cn > I CO CO CO L_ CO CO CO CO CO CO CO CO 3 E I 3

• — •4— 3 o a o <D O 1 _JGC 01 * o L_ o CO c •_ O ■_ U. c •4— C. — 1o < o c o o o o o — o o o o u 0) o o 4-1 o cfl4-1 X 4—1 «•4—1 4-1 4-1 — 4-f <s 4-1 4-J 3 .Q T— 1 <4—• — o • — 3 •— — •— •— •— — • — — 73 •<— 4-1 •— *o — CL D 1 Oc c c n c c c ' — <Dc <3 c r> 0) c £ a> o c f - c Z 1 k_o c o <s —5 o rt o o o X — o C o 5 01 o o CC CC o <n o O UJ _ 1 CL2 —z cc : 0) I I H 3 I z —z z —z t- — I

UJ 1 r—1CL 1 a> 1 CMt— l

1 1cLL

UJ 1CO I3 1 / / / / / / / / 0 ) // 1 UJ N- / LU UJ LU LU UJ LU / OJ LU

1 C/) T” / I ^ C 0 C 0 C 0 / / C 0 co co cn / / a / COI—I 1 / / CL / UJ / T T / ^ - / / / _ I L U / / / 0 - UJ LU LL / UJ /Z 1 LU / ^r cn LU q___ i c l y co / CO CO ^ lu cn<J 1 CO / Ol y CO s s s ^ ^ ^ *—• — / / ^ CO / f—>O I / -J oo / / Q U O ) " 02 O < "—1 / r-*_J 1 / T“ CO " f—> •— — — a> cnj't— «—• uj oo < *—• /-» CnJ

1 CD ao 1—'CO LO r—> ^ r u j c \ i ’» - ’» - ’» - < c o c j 1- 1- UJ CO GD CO ^ in <X t «—1 <J 0> o < CO C4 CO CD N U U U u U CJ tL CO O) y - CM T-UJ I CO CO — M <J 00 cc LL to O J l L O J ^ ^ W U r W i * i * U uj a oo CnJ goX I CNJ < o «—« ^ C i IL CJ U- ^ ^ CJ CJ TT LU CJ>—< 1 CJ LU CO 1—'CJ w <J ^ ^ ^ i * ^ * * CO CJ * *

I a ^ > ^ «—» 1 .. I GCy—V I ^ ^ u_ o L—1 k—< CO ^ 0 ) ^ O) LO CC ^ O) T- I oZ I ^ 00 N- y—>-vy-vCOCO^’ 0 > ^ 0 ) oo co ^ O m —-CJ 1 UJ TT 00 0 ) CO co cj o lo lo co in co 'f ) c j <n in oo N- ccO I y~ T~ C*4 ^ O) TT o o s o o o i n N a ) O) <J) CM co co ^r o oo T— 1 CL_J I CO <J) >-v 1/) t- (7? Tf o r^ N r - i n ^ T r T T O ) T r T r tt co 00 CO CO cd in 1 t—

1 N* O) co ^ LO r-* TT CO o o ) co —1 o ) — LO CnJ CJ ^ r - *»- >«_✓ I LUCJ 1 CD 03 T— w CP CO in CO TT LO LO ^ ^r m in cm in l CDLU 1 cj oo o vn w ^ 1 N Q- '—' Z _J Q m CC 1O 1 ^ lo Z cc — w O J O H GC _ ) Z LU — o 1 1>«_✓ 1 V-' co — < 5 LL h- H QD HI O UJ LU UJ D O 5 _I LU O X > 1

1 C/) '-'CL x z o U_ Z 3 L u < o : L u a : a : Z H cc h- QD h- 00 LU •*r uj a: 1 COUJ 1 CD 00 < <J - z o o O C C H J J J O O U J <J UJ < < _) CJ co ^ Cl ) o2 i < cj cj CJ O CJ CJ CJ c j c j c j u u c j c d x c c CO CO t— CC _l Z h- h- h- 1 << 1 — O co co CO co co cn co CO CO C O ............ 0 3 3 LU LU LU I —Z I Q Q LU LU LU LU LU UJ LU l u u j u j u - l l l l l l l l l l F F F Ll l l l l O CD a 1 o

No. 72 • June 1984 MICRO 67

Page 72: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

zo

ccoCOUJo

/UJOl>

o ao CDx a :o

>co c

>u

t - <D *3 .Q X4-i c j

oft 4-J

w c~ o Qa * o3 O 4-1

o (4O

<D C O*-f o —-c —

•— *-l co 0)

^ c 0)CD 30) cj

* to to a>

to

0) »- c4-J — CDr t 3m aco a> 3

cc Ozo • (DGC « x :

—*-» oc o 4-1CD <Q1- o - 003 (DO i - 4-<

c oQ SW t—> Jfr i <d > rtto *o x :

O X oo o a ~ O CD

^ *— .C(D <D O■ o c aO •• 4-»O o o

O 4-» CD>

o u r : cc o •—

to an o

CO t - 4-JC LC L no z GC 1Z - j o N

4-1 cn> * o

— c *o• - r t 3) o® a 4—1c U ) c • —

2 ( t co o x: oU - cc a 2

CO 3 O I- < <

UJ I- CC CO

rt rt o o tn w <fl «

a cl

• )4-J o a>

<n(4 H34-1 (4 O

— CO <D— 4-J ■ a■ — (D 01 4-J4-i o a w

to o 4-1CM 3 •— r t

TD z O *

C — CO T3 4-1 4_<

<Q > u «UJ II r t (D

* * o 0to T— O c■w O < o ■ aa 4-1 4-« > * o3 r~ a 0 )i_ 4-> c 0 * o

a •— •—' o 0 )O 3 J 0 )4-i O 2 o cc *«. — o N— r — SW SW

4-> H3 O SW CDa O * — W o oc W jc : c

■— — 4 ^ o w — o— o o 3 --- —

o to H3 w a 03<D c ■*— • o c O o.C o V) > — zO JC • O

4-» <D c u . w — 4-1 •

o <Q a flj H3 03 0 )0 ) O c A O (D 0*0

— O o • 4-> CD c o— — 4-1 > o 4-« • — E

0 ) 4-» — c* £ o w O ~ 0 )

Q o c £ 3 0 )GD * 0 «

s4-« x : c 4-: •«.

C Z 4 ^ C CO o 0 ) 0 )— •— 3 !_ >

E > n w l<— — 4-1 co UJ 0 ) O aj * o •—

0 ) ^ o O — E o .H— x : i . 4-/ u 4-/ 5

4-» & — o • o o 0)> II * o <Q c c c w CC w 4-1

0 ) ft> ■— — a> < o^ X o > * *-* tn 4-> X 3 03

Q X o CO z CO o a oZ < J H3 O CD a> 3 03

GC O E Q O o a c CD4-» 1- <D 4 ^ o '— £ . OCD * 0 O * 0 E ll <D 4 ^

a c a o ■a a — a JD<a E <D ■q* c SW

o o > < H3 o 3 o 034-1 _ j 4-> a O a 4—1 O * o

o c E *• * o o 0 ) c0 ) Z a •— *o <D 4 ^ CLC GC E 4-1 o c o C ft in O 4->— 3 01 4-* <D • — 4 ^ z w4-J a •—. 4 ^ 3 o3 c 0 ) GC <D 3 a o 03O — O a n O H3 O c o 4->i_ 4-J 4 ^ o c n 0 ) w •— SW in

c 3 — 0 ) CD—

<D T3 4-J O a w — . o ao E 0? c o c n O c

; 0 ) o 0 ) 4 ^ > -w 4 ^ r t Oc • — ll — CD 3 r w

1 C o c c 4-J a oi o c r 3 O C J H3 o • — c 3z — o a 2 < o 2 — — < O

<Bx _ i w t n t n d < <CD CD t- Ov3 T3 »- 0) <D > > ~ ft R 4)« to tn

-------- X« « <_) o o0 <0 T3 « « — 0- CL O

1 CC£ . 1 UJ

to 1 LU■— 1 >—

1 h -to 1 UJ

<J0 ft 1 (SI* c - 1 <

* o *o to 1 <33 O 3 C 1w (4 E 4-1 E 1 _ )<P <P 3 1 <

<p — 1 CJto O

»• o 03 T— u 1 h -—- o 1 UJ

T~ o 1 CD4-J X 00 I- <c o o ■*— I Xo ■ — o 1 CLN x : o 1 _ )

— o — ft I <QC to 1

O • — < X 1£ . <D 03 X CJ I

o E CJ <D Iil 03 . c X \

a o » c <J 1> c C •— c 1

o 1C 4-> 3 0) c 1o 0) O 4-> o CO 1

— fsl CO o •— 14-» 4-» 4-t c 1 <D• — • ft to 03 1 NCO 5 T3 *o . 3 1 No O c ft a 4-« 1a *D 01 01 4-1 a c 1 :

C o •— o — 1 0)c c X ) c<D J c CD — ft i a

o <D 03 3 4-« i a4-« o CJ 4-« 3 i <

<J O c o •— to CD a ito to to x : <Q 4-1 1 <D

3 CL 3 1 £ .to 4-» ►4-> c •n <X> OCD 03 <D o > 1c 0) *o ft Q O o 1 C

•— — O o £ ■*— * — o4-» n CD E c o <D < <x> 13 oi 4—1 to CD X ) 4—1 z 1 OO 4-* <J to w C o 3 O 1 w

03 CD to 3 ►■— « X a — 1 CD— to .— O a cn c t - 1 £ .

4-1 o 03 £ O GC < •— < < ^<J .C * 4—1 < O CD GC I

o o o T— o — * _ 3 o x N t - LU I toa 03 •— a 03 <J _J O CLa o CD t- T— fsi cn O 1 ^3 X -C CO y-v * 03 c < 1 03CO a o 4-« c c <q u j c £ . a c D > _ ) i x :

o o O t L U CD O 3 o 3 * o < i ^<D £ . * 0 — • — — a> * * o to « a

00 4—1 4—1 o > 03 CD 4-i <D ® LU iCM 03 CD <Q <q C LU o O 4-> _ ) 1 COT— 3 fsl fsl •— Q to — ■*-> ■4-1 to 03 _J

— £ a ■— 4-1 •— c X ) (D O 3 TD 1 4—103 o < — — — c o « <3 a O a — 'w ' 1 k_

o O •— 3 4-1 03 c 03 3 Z 03 4—1 T— c 4—1 3 I 0)■*— X •— O c — — •— a> ■— X > 1 X2

u 4—1 CC • — •41 4—1 — a 3 ft < r *o (J *D 1 X )a> T— o N . . . o • — CD o E /0Xd

c 0) 1 t tc CD » « cn c • c o ll 3 C « tn 01 . c 0) 1 3

X ) £ > T— CD •— T— ■*— x *o — >— c T— o 1 - J3 c . . . ft 1

— — o o —- — —- a c 03 — — — o a —o O 03 4—1 03 03 03 03 3 03 s3 ; 03 _ ) 03 o 1 ■*—

a o to o O -•» O u O 3 0) O <J CO O — Ll O c 1 o£ to to c 03 to to to 4-1 E to to CJ to c > to 13 O 3 03 <Q o x : 01 01 <D CD o 03 4 * (0 o z <a *— 1 CL“ 3 CO U Q . Q . 2 o Q_ Q_ CL tn .C Q_ CL : CL z a — 1

1

t— 1 O r-. CJ 1

1 1 CJ i—» o CO CO 1

UJ 1 CD CD CJ CO 1cn i U- m Q Q CJ 1

3 1 V * CJ U- U- / 4* 1/ i 1 U- / 4A / LU 1 / 1

i / / / / UJ / 1 1 CO / / tn CD / LU 1<—» i CD 1 UJ UJ LU LU cn LU CD / CJ / CL CO / / LU / / / LU tn 1

Z I CD 00 cn cn cn cn / cn T— / LU T— T— / CL LU / LU cn _J CO LU tn / 1CJ 1 U- m / / / / / o LU tn o CL CL / / / t n LU t n / i— i/ CJ t n i— i/ I

O i V * a U- y c n / U- / / T— i— iT— / c n / < 4* / CD i—i 1-J t <__/ U- <— »i— »t—t i— » ¥ ¥ i — / 4 * Q_ T— Q_ 0 . i— » / i— i i— i i— i ■V i— i J

I V * Q CD Q m CO i—i CL i—* i— i 1—1i— i/ T— / / CD i— i i— io < T— i— i 00 00 CD 1X 1 y-v I—I Q m in CO CJ / i— i h- GO CD CO o CO i— i U- o CJ in y-s CJ CJ CD 1LU 1 OO UJ CO CO CO CM CO CD y-s LL h - i—i CJ i— i1—1CO < T— 00 4* < 00 V * U- CJ 1X 1 y-v a a a CJ ¥ ¥ <J o •— •CO CD i n h - h - GO 4^ GO CD CJ CD o < CJ i— iCJ T— < CJ 4* 1| CO 4* 4* v > 4^ o CD CO CO 4^ V * h- h- U- 4* a LL CJ 4* 4* o CJ V * i—i 1

1 o i—i i—i i—i i—i i—i 00 U. <J oo i—i i n i n i—i 4* CJ 4* i—i i—i o V * y~vI—I i cn^ | CO CO 4 * i—i 4^ V * i—i 4* M <0 in 1—1 CM y-s 1 3Z I 1 y-s /-V y-s h - y-V CO 4* i—i CO y-skw h - y-s y-s00 y-s i h - i t—(J 1 CO CO r ^ i n T— CO O CM 1 i—i y-s 1 CO in CO T— / N o h - CO i n ✓-N. CM CM o i <O I CO 1 m CD o T— O CO i n CD T— CD / N CO CM y~v T— o T— CD CD 00 T~ CD CO i h --J 1 o CD CD o o o 00 CD y-sCD CO CO o h - CD CO T— CD CM CO CD CM i n h - CD CM in T~ T~ i c n

1 o CM CD o o i n CD h - i n CO oo CM o CO CD CO CD h - T— T— CD 00 'w'CO i n l CLCJ | CO CO i n i n i n 'w' h - O T— 'w' T— i n T— CD T— i n i n T— in 'w' iLU 1 'w' "w*'w' 'w' CD CM o m CO T— T— T— i n CM i n o >»✓in o i ia i CD LU 'w'T— i n 'w' 'w' X _J 'w'Q- 'w ' W 'w ' m w %-✓ • c n i'w ' ( X 'w' ♦— Q \— 1 - > t n c n Z \— 'w' T— T—CM c n CL 3 1 X1 CJ GC — < < — _J z CJ CC < < X - 5 X > CL ♦— ♦— CL a Q 3 h - 1 oLU i o LU UJ z LU ♦— GC Q LU UJ t n CJ CD CD CJ CJ CJ U- o — -- — — z < < h- < I oZ 1 H- z > GC c n > > O > LU t— a a Q 00 GC CC t n o CJ z z z z 3 UJ UJ UJ ♦— 1 h-< 1 o o Z Q_ CL CL CL LU UJ o o o o _ j _ j _J CM 3 3 < X — — — — — —> CC GC c n c n I oZ ! a X " 5 - 5 - 5 —> 'XL z z z z o o O •*“ O O CL CL CL CL CL Q_ CL CL CL CL CL CL I e>

68 MICRO No. 72 ■ June 1984

Page 73: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

NAME

(D

EC

LOCN

) [H

EX

LOCN

] \U

SE

-TY

PE

\ -

DE

SC

RIP

TIO

N

cdacdcoxoCDz.oTDCcd

03CJ

<QC

OQC05©aoo

©

©0)

c03ZOQCCOo

©

c o c— a — oa »h-

*- z>.■*-< LU '—COw 0 —c crt <D O < N CD O - N O— CJ

Otn < CC CD <X oCJ —

T3 C C L. cd 3

o©.CO

01

C©CD001

© JZ

©.c

* <DC u *-»O h- - T 3 Z C*-» c — oCd QC

CL u < CD 03 JZ

T3 O O C *-»03 ©

-C .C O *■»3 >- 'J

«Oa

— cj .□ ZCL X -C CD Oa a— O -l.c *-» o« r £ * - 0 0 Cd 3 •- © O *-

©.C

3 O — ‘ >- C

: £ —

>> h-o

©

<p3

03 01 01

a a i1 01 o— T3 <D— C C cd cd

0 il *-» «-^ c —

©CO — k_ *1 - ®T3

—I cd «- c • cc «- Cd -*-» Q o cd <D

O C —

co

"D ©

© cd o —03 <J v-cd cj .c —O (fj

< cd CD

3 ©a a c ©•— w •i c ©

— TJ© o oi © £

01- cd c

o £3 C —- Oo©l. oo oo

©05CdOCOc

©

o cn *-» — < cCO CD - < O

. gd o a E© o o4-1 y ) i-»

0) ©>> 01 £ B w © o cnr.

— © o i : c»4-» <dC v-0 co n— o01 C "O^ cd c © ,c cd >

c 2*cd“Dn c <d*o

c Bcd crt o

> c2 T 3 >O O w OO <ncc o « N > oa a ------o oeo <« u_ xsLl — ( J c O

o Ll i- — — ooc — cn 5

_ t - Z <---------------CD « O

— Z O »-0) --------<J1 a —

® — — cn n < <fl m c® o•DC LU (« Q

O <D Z■oO •“ £ ©(0c£ o 3 *->

O —

v>Xosfc- <d

* *-» oO - •c ^ CO

— QC k_ "O<c — < ^

c o x -o 5- 00 w CJa

o c *- »- oD ~w 0) ©

O >o*-» co

® <4-

cdo

01 c cd -

cE -oD TJ — O Oo »-

0)o a *j « a ® —U OTI•— c >- o tn o <fl ®0 ) < 4-1

i- CD Do o CC

« <® X>- LU U O Q " O T J w Z rt

o r

o« X »- T3o c« "O <fl</> —

ai c « c o ® o —O '- «>- >- z a a d < <a

o cc<o x x o— o o ®

® ® ££ O

— o o

aic « oo

®— M Q}

>cd

a o i cd © *a t ja © »- i-3 01 m o — —

3 ■4— 03 cd •O © > > 054- . o c c 01

> . > - -4- ©4^ U- © o3 'O co 11 II Qa cd C ^ cdc o cd c w o o a

01cd

X n01

, , , , o© 01 01 0101 « Z 3 © ©

© > • < O c c <o — O QC •— • — •—

o • \ > 4j 4-1 cu. « z © 3 3© *o o i O u O 0

c © QC a L. L.O cd a £ n cd— 01 01 3 3 i>~

c 01 ’ 4-1 01 01 o4^ © © 'O ©© a *- cn >- 01 .

© L_ cd cd © 01‘ > CJ a o • o 4^c 01 L_ 4-J o ~ ©o c © © cd o 4-<o © 0 s* - T5 cd o

cd © cd oi L> cd t_ cdo © k- 3 c cd ^ ca

— o a cd a o £ cd01 C L o £Z

*o cd w © ; — o© * £Z — a LU O —c 01 3

O CD oi acO "O k- £

c o *-»cd

* cd >, k- ® —

"Ocd o o £

o ^ 01 cd E

aT3g

0)cocd

o o o.O il M-

o o

o o a> <do o

X<d a c z

<o

CD CD C C

a a> 01o o

3ac

CD 01 cd o

c n t o « - - i i ii ii — Z ® >- >- >- (HO a r . <r a x x xD O O O " 00

o o o .c u.

<n r a c-S£ fll

O — On ®

_ i - oCL CL C< ooCNJ -00 o1 »-

®r. t- \- i- aw O O O — ® >- c.

o o

o ____® # ( 3 ( 3 0o -a —4-i — *- o o o(I) > 4-14-1*-!

o w ® ® (0 c c o

®■C

_ (fl 4-1 4-1 2 3 D C C C C CC £ 3 3 < O O N N W N O O O C C '- '-tn tO 'i-'tn i - i -

c _i o— o o o o E o i - o o

j £ 4 - l L 3 £ ^ u u u u g ) u | j u u 2o w « « a o — — — — t_ — — — o® 4 - i ® 4 - i ( f l ® c C C C O C » - C C C C

£ » - ® — ® » - £ O O O O C O O O O O O

® a ® ® m C Z £ “O Z

c c E £® 3 3

c -----— o O

0 £ il01 o o <d c c o cd cd

3 01 O T3

c3L- oO U4—1- o c 01 o —

( d 3 « O Oo o o

£ CJ •- CO 00o ^ ® ®

01 CD 0> 0) > CD cd t- 01

'Ocd c © a — cd — oo o i : -

o 01 o o — ©4-1 4-1 ^

>cc cr ^ .o _ _ O N N O « « « ( / ) ( I ©

B £"O "O "O 5- - co ^

o o

00 01 O © 01 y- 01 © 01 01 © 01

( J *- © w*0 - : 7D TDcd *o

^ cd£. © a *-» ©-->. 4-»i- XJ >.>> na -c o a J

o £ —o -

o * - c o

C •*-' CJ o — — — © © © o O CJCd 3 © •*-' .Q .O£ O •- — cd cdO N ^ C 01 01

C O O ----

O Of Q w w \ oic c cd cd

c ---cd © 3 --------

Q £ £ £ O O W

/ / / // LU / UJ LU _ l_ ! cn _ i / cn cn // / / LU / / /

cn _ l _ l —I ~•—«<—•»—« / »—i *—> / COO CO OJ o COin I L LU ^ o < (—> s — oooo oo 00 CO oo 00 TT UJ o oO O o 0 ) o o h - 1^ <J) 4 *

00 ^ 4 * CO CO CO <—•LJ I—I CJ 1 u O ' ' o

4 * ^l - j LJ I—I •—»CsJ

o co co ^ r oOO ^ OJ ^ o CO COCM TT O TT CO CO CO TT1- T - i - I/) y - y— ^ CJ ^ inin in in co in in CO CO CO wVw* W w ^ w Vw ^ 1“

in in in in oCN 1— I— — _f J— w >»✓ —

J - 3 LU h - z cn— CL QC t - O CJ CO ^ <Z Z o 3 z QC GD GD CD GD-------------O CL CL 00 00 00 00GD CD CD CD CD CD O O o o

/

a - cn a cp a o i i i i - s ^ i i i I H < < - u i Q Q Z u u u 2 j u § 2 z h h

~ h. a < in<j> o

/ U U . CJ■»- l l ^ u ./ / / x ^ I ^

T - r r / | LU | / /CL / X X U CD OJ U LU/ _ i/ / ^ a > U T r c o c n

CL / U J U L L U / /

r ^ T - < Q O O O ^ *—»■»” 00 c o o - L u v n o o ^ ^ o)C O / U - O O U O ^ ^ C D ^ U J L L o 05 h«- T - CJ ( JLl ' - ^ C O C O O O 4 * 4 *4 * cd <—* c o c o ^ v n ^ t a ji—i h«. >»». y-s y-s CO ^ CO ^

CO 0 ) OJ ^ t” CO | CO ^'-v ^ CD CO in CO 05 I O I y - OnIO')*—>^“ O ) i - t- - ^ ’ C 0 N - C 0 0 0 ' » _C> l / ) C ' J 0 5 0 ) >—1• CDCOf s- O O t -oo ^ co ^ co^-mcNJcoTrcDwi .n^^cr^rco^r inmC 0 u ^ ^ < CD W CD w WW C 0 X _ l Q X w W

--------f - O — O N LL Z1 - w l L — 0 > h - J J Q - J Ocn z cc o © j o o o < cct— C C 2 D < 0 0 0 0 < L U L U L U X > -CL<c/)Luocxa:a:Qca:QCQ- < 1 ^ —I —J J J —l _ l _ l _ l Oo o o o o o o o o o o o

/UJ / /cn UJ LU/ cn in // / UJ*—• C/)CO <—• <—• /o O h-00 o o ^o CO CO CO4* o o y-«—« 4* ^ 00

CO h—*o O h-CJ CJ CJ ^T— 0) 0) win 05 05 CJVw t t c j

1— in— 1— 1— Wz Z 3— — O y~o O O h-

cn cn co z< < < -GD CD CD CD

0)05 o© •— ct - —*o J■a 01cd Z

> o >1© L. QC © cdc cd TD *•— •— O O4^ — O O T33 «» 00 —O — U. c O

X O3 ©cd £Z- ©

4^ C C 3 ©Coo

j*:ocd

cd

o c_ 3

— U.

Co

■a © ‘ W c o cd - oO 4-1 f—

3 Oc o£ *- o3 0 - — 3 O 01 01a

x o o 00 o

3 01 O »- ©

0)

- O

Q C <O _i O I—

O

" ) I l a : © *o »-

c • cd >.> cd - © • £ < © r. oi

© o

ooT3C« cn§ o

CDO0 • T3</> ®01 4-1

® D O O O ® »- Ka ®o »-

cn uN <J tn cd

O T3 C C

— Xa<

«®c

■O _ _c get ca o 3c. ■- o ®»- o r. ■O x ~ a" T3 ( J CC

® ® — 1_ ® !_® £. rt T34-1 Cc© c

o01 — 01

c3 *-» *-0 1 — 3O © i-i X

cd O co » •* - 01 CD

0 ^ 3

il • O01 CO U3 i— n acr

oi cd ©c ^

c cd n

©- cd © o a4-. 0 1 — 33 ©o ~ ^1- 3 ©O C

cd01 © 01

o o CO u. © c 1“© o c O X < > •— . •o © © AW !_ © !_ o X w

•— — — •— 3 •— / o 01 © o Qw A A r" 4^ c *o CD £ cdo cd cd 5 © o c cn © © 4^ CLZ h h z - z cd / £ 01 >- O)

r-*u.h- Ll

in IIo OIL 4 04*1 / / / OCO LU / O^ OJ CJ cn _ i T“O CL CL / / oIL / / 4 #

»—« r —«i— i i— < 05 CO

CO IL 05 CD y—\in CD CD h-

0) o o O o z05 O O «» CJ oin 4* u l_ CO cc^ t— u in oCD o1 o CO XOJ 05 CJ in o o00 ^ 1- T—in co co CJ CJ 05 1TT CJ CJ in in Vco in in Vw w \—Vw' W ---

CC cc Z zJ- X -1 < UJ o —CC Q Q X IL cc o>- < < o X o —CL -1 -1 -1 -1 o COO H h 1— f- X <o o o o o o CD

CCLULU

UJN<O

<o

LUGD<XCL

©NN

aa<©r.

©r.

cdsz

©nn©3

No. 72 • June 1984 MICRO 69

Page 74: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

zo

crotnLUo

a>

tn

cjo

XLUX

z< j

cjLUa

LU2<z

4»< (U 04—< <4— « COc — 0) _

■4— 0 k_ 0 J— E *o o O

0 0 (0 a 0<ji k_ 0 k_ Aco u ^ 3 • 4—10 C o *a o0 — 0O C 4—< »k_ »•— 0 o oa c — CO r r. 0 \ c X

*0 0 C *■ £ oC »- *o 3 1—« O 3 0 tn

0) ^ *o O0 0 0 o o

*a c »- 0 4—1o o C o2 0 00 A

a a>- - « •— c cX (U (TJo o *- O 0 k_I— >- k_ ^ *a .oO O (d o oO - ^ O o E

CO 4-J 0o *a o 0

o 0 *0 o ~ c (00 CO 00 o 0r — *o CO >O 0 C o 0

4 - h *0 II a ---

■4— 0 0 > *o >■<- 3 T3 C *- 0 *aO i- O o (TJ x A c

- £ • o O CJ 4—> 03k_ C * A O

c0 • © c *- o o —CO

o00zLULUXoCO o

1 O 4—> > 1—1 CO — c 3 o 0 O1 »- 0 T3 X CD1 3 «- k_ 0 C1 O »- • — *o O1 (d a 5 c1 c ^ co *o OJ1 k- CO c C c a1 3 (d (U E o Ei ~ *a k_ 3 0 3 0J c 4-> k_ — TD1 * (U o O • —1 0 CO o > O «\ Cb> ■ — CM C\ « X 3 O 01 Q.O X O 0 *a ^1 I— o CO 0 c z1 o o 0 0 0 0 a a <1 «- o A H k_ c .o X1 0 O 4—> o1 N <4- 4—> ► n *a * a

0 X OS tn u ^1 0 c

~ .c oD U Na -

— co <u to o CO o m 0 a c

o0 (0

0 CO O 0 (U k_

a o 0 *-> k_

CC • \» tn

0cO _l o O

< j o

<*- oo0 I- — LU

tn£O <o ~ *o

O 0n x

o »- <*

*o - o*- OJ

z ©— o>- <*

3x a

h- CLU 5 > «tn < ------

cr<0*a *a m «0 0 cr a:

a « — o ■ >O C Ioo o :

*0 CO »- 3 (TJ 0 0 O <U +*A +* 0J C CO 4- — CO

o00cco)—to

aoc

~ 3 0 •*—>(f) 0 >

*a *- c

. - a

l c 0> (TJ 0 l k_

- O0 CO

c *o o o c « 0— aj a £4-J 4^— c r <n <u u e o ® — o a >- r i-

o J ■<- i- wo a> >-CO 0 ■*-* 0^ a a ~3 ~ — O U 3 (TJ

£ u »- *-* o — <U0 *- <* .CO '* - u o

0 ^ - 0 0 <3 QC in 0 ~ A

4-> 4-> --- (| 4-> 4-1

£ <a O O i- a

>4—

X»- CJ 04- ito « >

o

COoE

c£3

OO

ooo

aa3O

CO

OH5

CO0>O2

*o

(U

o

0*aoo

LUtnLUcr in

0 (0 E *o »- <* O 0

cr

0 (TJ O £ (U3 Co o c <* 2 - <

QCCO*G *0 « (TJ 0 0QC QC

CM\ a

<LU

0 ac « < a a cCO CO*a *a(U (U 0 0 CC cc

CO 0*a

h- oi e X «- Z X < 0 QD t—CO CO*a *a03 (TJ 0 0QC QC

<* 0 > c r o * - x- <j CO c o

- J oQD 0 <13> a

c oCO (TJ w*o r m o x0 COQC < “>

0 O C (* — ^

3 Ho u

0

— *a c m c 0 z

0C *0- (TJ4- 03 wO ». 0

<0o i— 0 c r

(TJ ► — ^ 0 <*O

o* 0 ^ 0 (TJ CO CO 0U L. «

o o4_ -4-o z

< LU C LU 0 C CC 0 — CJ»- tn o »- CO 0 o

4—< 4—<

c o O (U to

k- 0 »- OJ .c « £ O ■*-' (J c O (* (TJ • k-

0 A 03 >_r o o u •*-- r

CO0k_ 0 0 0*0 4 ^ .4 - O<n £I- 0 *_0 CO oH - >— CO 0 - X

X O O U 0~ — a

a o\ac *o \ o cCO -4- 03

»- 2 O

c00k_<JOIc

o — *o o c u5 o

CO0> o

o cOJ 0

0 C W £ O3 coo c O E

3o — ^ o

o>— o c ^ o

— 0 o > »- cu oCO <J

o o

ac ac \ \ CO CO

o « o oW 0 CO *-• 4-J-------0 ----------c u > c co m o oZ > CO z z

co0>o

C 2 0 0 . *- CO 0 CO 0c o E co 3— Co £O 3

O O CO OC Oo rco Oc ~o— c4-^ 0— 0

0 0 3 CO— (U

o>

n< oo £- *CO c

0CO

o c £3

CO Oo o £ o *-> CO

0 4—<— LU

0 O O > < 4 c a

o h-O X

cocE

oO CO

co £ CO 3 \ — o o ^ u

CMII k- o

>- ox —O X — O U OI— 0 k_o r o

<J CO

0c

0 C *0 — O — £

■4—

I- c o O E

3 *0 C 0

C00k_U0)0H

0Coa3

C00k_UCO

0H

tn oo o o uc o

£.:CO

CO c CJ — CO

<30

CO x 0 oo *o ^ c tn (tj

c 0 0 Ok_ 4-f Ooco ac

\ COtn *-

0 0 4—> ^ 4—>u o oOJ OJ OJ C 03r o r0 2 0

— o o o «-

O O O O COoCO c

EO 3

a 0 0 E c c3 — —

OCO

3 3 O O O

* 0 ^ 4 -0 O O o ^ c - - m c c r o o<J 2 2

Oac o \tn o

ooO O O 0

— n c « o cZ LU

o o 0*a »-— 0 > 5o c — £3 0— </) O *- O 0

>o c 00 —

\ 0 — — «

E « *- c oLU Z

JC o (d 4—>CO\ ■ X0 — (Jo o x« O 3a o oo o ~ c‘- ‘- 0 3 0 a co N o

o o 0 0 - ^ 0 ■*-> 00 4-<03 ( J X C \ <0 4^»- O CO ~ AO X 0 Q ■*-> — k_ <j) —— O ^03 Q. 4-j

3 — 0 k_+* C *o

0 0 O O 0co co x E c

CO < h*CM CJ/ Q / < Ii. T—•*“ U_ / y - / U_ y 4^ XX 4» y— X / y - 4A LU y 1 / LU LU y— y— / T—

y T— T— / 1 X T- X y - ▼— X X X 1 tn UJ / / O _j tn tn x x XLU X X y— / X X X T- / in y CO LU LU h* _j _i y y y y y 1— 1/ ytn y / / ~ CM ^ / / X h* / tn CO CJ u. UJ UJy LU CO Q i— i CM / — < i— i i— i y / Ii. i— i i— i t—ii— i i— i o 1— 1CO COtn <— 1•— IO Ii. y— O <— I 0) u_ h* LU CD 4^ <— i i— io < y - Q o cn y

y CO Ll o w CM O CJ CO T- <— 1 4» CO O O T— i— i— i L U C O C J < < O O C J OLU T- T- CJ — O T- u *- T- o < o •— Ii. Ii. Ii. a cm QD < QD cj CJ cj o o o 1— 1.— i00 o o 4* u o w o o u T- CJ CJ CJ CJ CJ CO Q y—sCJ O CJ CJ CJ CJ CJ CJ CD LL< < CJ CJ 4^ CJ 4A 4A 4A CJ LU Q in cj cj 4* 4* 4* 4A 4^ 4» UJ <CJ < 4* 4* CO 4 4 CJ — CM 4* CJ CJ CM 4* 4* y—S i—i CO UJ4* Q y-s O y-s. •_ 4* CM — 4* 4^ CD h* CJ CJU in co y—v y—s y—s T" y—s y—s y—s y~n y—S /*Sy—s y—sCD y—s4* 4^m cd y—vin y—sCM h* CD CO y—< CD y—s y—scd co co in T— y— 1»— CO CO y - CD CD O **“ o T— r y—s cd O cn CO y~" y—s f 00 CO T- cn 00 in CD 05 CD XCO 0) 1 T- N 0) CD N CO 1 o o cn CO CD 0) <J> O TT CO CO i — y— T— y—sy—s CJin T- T- y - 0) T- •*- T- 0) r- a> r- CO CO CM co 0) CMCO^rCMCMCJOO) O) in 1— h-CO o 0) o W o a) ^ o o ^ T- t- in in in C4 h' CD c D C M C M i n m i n ^ ^ r in 1— UJtn CO ^T v-'0) >»✓ in cj CM in in sy X >»y cn i cntn CO v-'2 v >»y >»y w in in CD N«y >*✓ < o CM iw CM < CD 0 J < 1— X CD o o i— W w w o z o __ i a x a m m i iin j o i r X Z l C M Q X < w 00 — QD ^ CM CO 0 3 0 - CJ N iLU w o — a Z < Z LU X B 1 - QD Z z Z D CO _) J _ J _i_i_i <j > i— i— 1 UJ1— CJ > X CJ QD X - 0 2 2 X _) 1- LU LU LU tn ^r CO _) _i_i_io o _ ) _ ) ao X i i—— i— o o < c n c j u < < < < LU QD LU LU LU LU -J z z O O O O O O c o c o < < c j ( j i —X — c o c o u L U _ i _ ) 2 a x x 1 - > CO X X X X X X X X X X X X l — 1— 1— 1— 1— 1— l X

Z) Q O Q Q Q Q Q Q Q Q O O LU CJ CJ CJ CJ CJ CJ a cj cj cj u cj UJ UJ UJ UJ UJ UJ 1 Ba o X X X X X X X X X X X X X tn tn tn tn co tn tn tn tn tn tn co tn tn tn tn tn tn a

70 MICRO No. 72 ■ June 1984

Page 75: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

toCO

to<DO

O

mo

cE3

Oo

oCO

c03

<D<Jc<D05<D

©A

*O

<D*ooE

o<D

3O

©x :

xo©

x :o

<DC

3O

zo

QCCJtnLUC l

i

a .>h -

IUJtnD

Zuo

XLUX

zuo

ULUa

2O 2CC o

a :o0 ~X oC J —

CO

01 o c ok- CO © UC © < -

A +-> C5 © C

t n lu

aUJCO

0)c

>

c<D©

O0)

©

Co

cooa

m

• c c o0) N <D ■- k_ k— o o w r

© c . c ©4- (J)

fc- c oo <o

Cl Cl (TJ

03

o

X<J ai m *o 4- oco o \<D Q 00 Q Z H <U ^ > a h

lu x o tn c j »- O © © f—

n x : o4- e ,

*D‘- C OCtJ — *-*

T3 Cm

* 03 © i- c « m

3 JZ < 4 - 0

W• • (J)© co .C

“O 4-O ~

U Q ( D D w

O i - O © k_ *->

"O <D to

0) JZ O Oc cco m rtj

r »- ~ o A ©

in < aj

> c o

o -O <1> * - c c

co —k- w<d <d 3

o o**- CJ w

CO 3

o <03k- c m -

. cO k-

0) <D * -

a O 0J k_

a) m»- -Co o +■*to a)o o4—' 4^

co©C O

>

<

>o

toCD

“O

03O

CE3

Oa

o00

a ~ o c

o

/ / i - ^ xX / /

r-, CDr - o o oO CJ CJ 4f t

y—S CO 05 COm t -

0505

2 Oo ccQC CO X c j C J h - h - O Z - J — to

^ r 1/5 CD LL

/ ^

X *T- / 1/5

CD— Li­ao 4f t O — OCJ ^ 4* O—

COy-s r fO CO CO I •»- r - co co ^ co

CO Q_ w NJa a I - z0 5 3

Ccn

0 5 cn c c - x

ur*CD05CJU.

I1/5P -CJ

0 O 0

4 ) 4_»O to LUcn © z|- *-' Q3 O4- o - « 4 <D

k-> Q C ©

« ( / )w-O k- «a o — E - © — *o

C k- O <d

< 2 0

00CO

<LU

II+

COo4* h -II — © < \ B \

« 00

~ <Ji— 03

© ©- ea o3 a co

<

* - < o

c*o o c- aX c-C “Do c— a?

n a £ ©

*oco « -

c©©w_oto

03©

O

o

LUGD

00

Xo

© © — -Ca o a

< »-

*oLU O - J Oaa o < -

0J ) -

OSo o

cQC Ost n 5

< i - QC O4—' <])•— 4—'c — o »-

X 3

050J © © o E <u <tj a w to

x - o

*- ©<d©a ©0)

Da o © © © x

©

ck_D

©

<dO

10 c — n <d£ o

© © © a - "om o o

- £ £ k_»- c c m £ £0 3 3m o o

o o©~ o o3 00oQ ^ 4—IX © ©© tn to

0)c ©»- o 3 m « - a ©© « c

QC*o —

i - m ^ o ^ oto k-

UJ I - o *o2 3 C O O ©x m

© o © r © ~3 3 » -o © o m © £ © © X O X — >© -C © o

cJo

*o

a3

Otoco

ac

*oc©a©■o

©c

£o

©C "O - 0)

— ©

© © >- c

c © ©

I - 3m o © © — x o ©

o o o o o o o o o o

O C C Q C C C C C Q C G C C C C C C C\ \ \ \ \ \ \ \ \

^ t n t n t n t n L O t n c n t n c o<nr k_k_k_k_k_w_k_k_^

O O O O O O O O O

— c c c c c c c c c 1 - 0 0 0 0 0 0 0 0 0

QC QC \ \ t n tn

“O»- o m no

k_ c o £3 a — o •O +■' CJ O -J

* - < o m u oo © tn

- < ~ O GD

3 o m c r ~ —

>o ©~ C I-

— <D\ 3 <f> CC ^ 3 \ Ot n i - o

© 1 ccw_ to 1 LUTJ c X I UJTJ m CD C i i—m © m m j h -

E — a 1 LU0) 1 IM

•— w_ c 1 <m > o «

UJ © — 1LU — » 4—> 1 -JCO o x m 1 <4 ft o c 1 CJ1 > m — 1 —

a w_ M 4—> I h -LU w_ to to I UJCO m \ © 1 CD4 ft o © "O 1 <

a> 1 X• m c i a

m to a - i -J0) i <k_ 03 o UJ i© O 1- LU i> © CO i

o N 4 ft i© 4—> 1 io tj a i

•— k- i- UJ i> © m co i

TJ 4ft ik- to c io c m to i

m ~ © i ©"D k_ CO CO i \k_ 4—> 3 i \m © io w co O I :

c 3 CO i <po m — CO4—> © to < © i a

*o E c to i a© TJ « • o » <© k_ 4—> © a j

m © £ a k_ i a>© o to m 3 i r :c a k_ 4-> a w 1 4—*- 0)

— a m

© atok_ Q© o c > —

m © ' o * -

> m c »- ©

m m o £ o

a£ • mo

<D— O

© a « -c w

sz a o ©C k_m>- >

o o o o c4^ *-» 4-< 4-« ^— — --------- 3c c c c « -o o o o ©2 2 2 2 a :

c o © k- c 3 © 10 i■— c — © o CO > N © 1 CO

: o m k_ — c a ro o m - © c 4—> 1 4—>

© © © © > k- k_ TJ o i m4-* +-> +-> X ■w k. m cc — k- i x :3 3 D 3 k_ o c m c tn O i ^O O o O m h- o c o “3 k- <*_ i :© © © © © o o O A © o iX X X X — CD a 4—> 4-> © 1 CO© © © © o E 3 c --- o Cb

c m m C X m 1 4—>O O o O o — k_ *o m CJ k_ 1 U.

*-> a © E © 0 - 0 o 1 <l>© o co 2 I - 4> 1 10

CC CC CC QC OC 4—> 3 o 3 - 3 0 CO ( 10\ \ s \ \ m a O 4—i CD 1 a)CO CO CO CO CO c © (0 m > 1 3

— k_ X k_ c •— O k- 1 _Jk- k_ k- k- *o © © © (C > m 1o o o o o <«_ © w■*-* *—> *—> o CO © CO £ w a o•— •— ■ — • — o c 10 c © 2 a 1 0c c c c c o m m 4—> 4— —> E 1o o o o o w o w © c © 1 CL2 2 2 2 2 X i— CO UJ < h- 1

/ /UJ UJtn tn

/ / / /

— / /

tn tn tn tn

r -coco

COI

05

COVto

Orcc

ztn

< <eg

Ll . U -c j c j4 * 4 *

COCO CO O O CO CO 1/5 1/5

i—> / .—i CM t- rrLi- a. CM UJ / CD U CJ4 *- O D w .

r ^

00 4 * •'Tr - •— o05 O0 4 ^ CnI in v m

s /

aoCDU-4 ^I

<OCD

'C C t O < ^ CC 1 X <CJ T- (Joc a. k- o 2 tn

h - h - LU LUtn to to i—i—

/ /T“ 1“X X/ / /

UJ / // / LU LU / / /

L u m ^ r / L U L u t n t n u j L U L u t n o o t n t n / / t n t n t n

/ / /CJ CJ CJ ^ ^

<—’ 4 ^ 4 ^ G D ^ ^ 0 5 r ^ ^ ^ ^ U - — — C D G D C J i n r ^ - Q C M C O CJ C J O U J O O O T O )0 D ^ ^ 4 » G D m c j C J C j Q C Ju s c o ^ u u w « u u uW l O l D 4 » 4 ^ • •— 4 ^ 4 * 4 *

o o :co <

QC QCo o <

UJ

h - >

05 ^ r r1/5 'w 'r ^

2CM <m ocw Q

ccI - < — c j < c c ? 3

05 COm

V-/ T~CM

2 m< ~QCZ - I

✓“S 05 0 5 y—S•’T CO 05 f^- CD CM

oo o m m c o co■»- CM CM CM CM i n CMo j cm m t o cm cm cmm m w w m m m

CM< i 2 CD lQC •B X X X X X X X X X X X X X

t n cc c j c j 2 l l t nI GD CJ Q Q LU LL Ll

t n lu /

a( J

O O 4 *•—

ac j ^4A 00— m

m^ CMcm m m w mCM Nm _ i w o

LUt n co a a

/- j/

// uj »-* uj tn •»- tn / i - / a

^ c j^ 0 4^

05 — 05 Q CJ CJ ^c j ^ r ^ 4A a> — -

CMy-s m 05 CnJ —' CO CO CO CM Kcm m u j m w cc

ccL l < c j - j Z tn

// / M l / / / / LU LU tn LU LU -T- LU tn tn / tn tn a . tn / / / / / /

CM 05 f ^ CO GD O m CJ CO CM LL 00CJ CJ (J CJ O CO CO CJ CJ 4* CJ CJ 4* CJ 4f t 4* •— 4* 4* ^ 4*

/—s y—s o ^co r - in co in oo coO 05 C'j N S O) CO CM CM CM in v- o CM CM in CM CM —' Oin in —' in in inw w w w Q w

cd a: - O D t n h - o c t n t n t n d > o u j

..............................c j l lX X X X X X X

^Tr ^c j

iCMr^-c jl l

^ /00CM 0- C0 / ^TCO r—11 I L CO •»“ CM 4ft CO —

•<rCO "-'s

1— CO

xuO 1- I - >o < a t n x >

(V-C

><t n>

ZoccX

UJt n

Page 76: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

fa ltU M

Insidelthe c iaby Ralph Tenny

Last month we examined several programming modes on the 6526 CIA used for I/O on the Commodore 64. The shift register (SRJ on the CIA was examined briefly, in that we learned to toggle the SR output (SP) by setting the mode to input (SP high) or output (SP low]. This toggle mode of operation is useful if you wish to output multiple bytes of parallel data on the eight Port B lines of U2 (User Port). That is, by using SP1 (Ul), SP2 [U2), PA2 and PA3 (U2) as clock strobes, eight bit values can be latched in four different latches as shown in Figure 1. Simply program all the port lines (PB0-PB7] as outputs, then load the port with the output data. Pulse one of the four strobe lines and the data will be transferred to the strobed latch.

You should note a few things shown in Figure 1. First, all the 74LS374 latches are wired identically. Pin 11 is the Clock pin which causes the input data to be captured on the rising edge of the clock signal. Each clock line is driven from a different strobe output on the port, thus allowing different data to be saved in each latch. Pin 1 on each latch is the Output Enable line; these lines are all tied low to keep the latch permanently enabled (compare with Figure 2). Also note that output latches do not have to have tri­state outputs, but input latches (Figure 2) must be able to disconnect from the bus unless it is a dedicated input.

□ h O Oh 1

□A3□ fit

□fitOAT

0E3aetOBSact□en

]D0 GO 1 • □D £ □D3 □0*t □05 □0& ODT

If you want to use the port for input instead of output, Figure 2 shows a tri-state latch connected for input. In this mode, the port must be programmed for input. Also, note that pin 1 (output enable) is separately controlled so the programmer can select one latch at a time to input from. The external hardware must load data into the latch by pulsing INLATCH, and it is wise to have some method of handshaking so the latch output doesn't change when the port tries to read the data. If four latches are attached, only one can be enabled at a time to avoid bus conflicts. If you use care in programming, it is possible to have (for example) two input and two output latches. This is what must happen: The input latches must be enabled only while they are being read, one at a time, and the port must be set for input. When outputting data, disable the output lines of the input latches, set the port for output, output the data, and clock the destination latch. If you want to go to extremes, one of the four output latches could be designated as a controller, enabling up to (for example) four inputs and four outputs, or any combination of eight 8-bit ports!

The CIA serial port is not a UART or ACIA, and requires some understanding to use. If you want to communicate with a computer, it is probably easier to

PBOPB1PBZPi5 USER PDRTPi*tP65PB6penSP1SP 2Pfi2Ph5

PBOPB1P B 2PB3P B *t

PBSP B 6

PETSP1

c-e.'t

USER PORT

♦5U

Z 3 - I NOt 5 - I N I* -| - I HZ8 -5 - IN 312 13 - I N'tl*t 15 - IN Si s n - INS.IS - i r n2 0 11 - IN L f iT C H1 10

1

Figure 2. The 74LS374 latch can also be used for input if data is strobed in by external hardware and the output enable is controlled by the C-64 User Port.

Figure 1. For 74LS374 latches selected by four unique strobes allows eight output lines to become the 32 output lines.

72 MICRO No. 72 ■ June 1984

Page 77: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

write a software UART program which toggles a single line for output and receives on another line. The specific problems you will have using the SR for communication are:

1. The SR outputs 8-bit words only - normalasynchronous communication uses 10 bits minimum.

2. The SR inputs only 8 bits, so incomingasynchronous data will be scrambled. In addition, reliable asynchronous input involves an input clock 16 times the data rate; the CIA Shift Register is a synchronous device which depends upon the external source to furnish a properly timed input clock, one pulse per bit.

So, what is the SR good for? This port can be used as an I/O expander as shown in Figure 3. The output data from the SR becomes valid as the CNT line switches low, so the shift register used is positive-edge triggered and will accept data directly as shown. Also, the SR outputs the MSB (most significant bit) first, and assumes that incomingdata has the same organization. If you use a negative-edgetriggered shift register, the CNT line must be inverted. The shift registers used in Figure 3 are CD4015 CMOS parts, and are internally organized as two four-bit shift registers. Each successive section is cascaded with the previous one, and data is passed down the line. In order to output data to the circuit of Figure 3, the CIA SR is loaded with data for the output port B. This byte is shifted out; then, when the data for Port A is loaded, the Port B data is shifted into B and A's data is shifted into A. You need to realize that if the changing data will affect the external hardware, the scheme shown won't be acceptable. In that situation, the CD4094 is a four-bit register which allows data to be shifted in, then strobed onto the output lines when shifting is done. To use the SR for input, the external circuit must present data at the SR pin and then clock the CNT pin a short time later.

Figure 3. Subject to the limitations discussed in the text, the CIA ShiftRegister section can be used as an output expander.

A major advantage of the SR is that it can operate unattended in either polled or interrupt modes. Instead of using software timing loops to drive the serial port, the CIA uses Timer A in the free-running mode to drive the CNT pin and shift data out. After data has been transmitted or received, bit 3 of the Interrupt Control Register (ICR) is set high. If the CIA has been enabled for interrupt and the IRQ line is not masked, the processor will be interrupted. If you are outputting data, writing new data to the SR clears the interrupt bit and initiates the next transmission. Polled operation of the SR on input would require another CIA output line to be used for handshaking; otherwise it is possible to lose successive data bytes if the register isn't cleared in time.

This is an abbreviated step-by-step procedure for using the Shift Register in the non-interrupt (polled) mode:

1. Write $7F (127) to the ICR ($DD0D or 56589). This disables all interrupts from CIA 2 (U2).

2. Write $41 (65) for output mode or $01 for input mode to Control Register A ($DD0E or 56590).

3. For output mode, Timer A must be enabled; this was accomplished as part of step 2. The maximum bit rate will be just faster than 250 kHz, which is set by writing 01 to the Timer A low byte and 00 to Timer A high byte, in that order. The Control Register setting (step 2) provided for continuous square wave output from the timer, so the SR will begin clocking data on the next rising edge from Timer A.

4. Write a data byte to the Serial Data Register ($DD0C or 56588) to start sending data. Eight data bits will be shifted out, then Bit 3 in the ICR will be set. Poll this bit until it goes high, then load the next byte into the Data Register.

Input operations consist of initializing the Shift Register and polling the SP bit in the ICR. Save the input data and poll again until all data is received. As mentioned above, some I/O line could be used as a status flag or handshake.

All of our interface experiments so far have used either the C64 User Port, any RS-232 Serial Port, or the Radio Shack Color Computer printer port. All these computer inputs except the User Port are clumsy at best, leading to contrived or inefficient hardware. Expansion using the User Port is possible as discussed above, with little hardware penalty. The major tradeoffs are in operating speed and software overhead, especially for expansion beyond four 8-bit ports. One important advantage in using these ports is that it is relatively difficult to bomb your computer through these ports, compared to using the expansion ports. The expansion port on most appliance computers is unbuffered, which means a slip on your part can allow you to crater the microprocessor itself, killing your computer.

Since our next type of expansion will deal with direct expansion from the microprocessor bus, we need to discuss ways to avoid damage to the computer. Unless specific machines are mentioned in the context of hardware design, comments in future columns and the remarks to follow will apply equally to the Color Computer, VIC-20 and C64. Many will be applicable to the Apple, and possibly to the Atari computers. However, I have no documentation on Atari, and Apple expansion using the Peripheral Connectors is a detailed and complicated process.

No. 72 - June 1984 MICRO 73

Page 78: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Successful interfacing to a microprocessor bus involves a detailed understanding of bus timing, bus drive capability and characteristics of the devices connected to the bus. I'll take it easy on the details, but there will be a lot of explanation which you need to follow. Figures 4 & 5 show the two major m achine cycles of the 65xx microprocessor - one of this family is used in C-64, VIC-20, Apple and Atari computers. Note that these two cycles are almost identical, except for the phase of the R/W* (READ/WRITE NOT) waveform. In both cases, the action takes place during the last half of the cycle. Early in either cycle the Address lines come up with the memory address being accessed, and either READ (Figure 4) or WRITE* [Figure 5) comes true about the same time. In the READ cycle (Figure 4), data comes from the memory or peripheral (such as PIA or CIA) and must be available for a minimum of time T4. That is, the 65xx microprocessor is guaranteed to capture data available within that time frame. You would need to make such a study when choosing memory devices or designing hardware to use with the processor. Similarly, Figure 5 shows that the 65xx processor is guaranteed to make data available for memory or peripherals no latex than T4 seconds after tADDRESS and R/W* comes true. These times are important when designing peripherals for the processor family.

Figure 4. Timing for the 6502 READ machine cycle. See text for details of operation and clock speed.

Figure 5. Timing for the 6502 WRITE machine cycle. See text for details of operation and clock speed.

The other times shown in Figures 4 & 5 are: T I - the maximum time required for ADDRESS and R/W* to come true; T2, T3 & T5 - the minimum time each signal will be available after the end of the current clock cycle (one full clock cycle shown). This kind of design study is called w oist case design, because those times most likely to cause a circuit failure are chosen from the manufacturer's data sheets.

The following table lists the times corresponding to the T times in Figures 4 & 5 for a processor clock rate of 1 MHz. At 1 MHz, the machine cycle is one microsecond (1000 nSec) long. For slower clock speeds on a 1 MHz rated processor, the times will be approximately the same, which allows more time for the hardware to deliver or

• TIME Figure 4 Figure 5

T I 225 nSec 225 nSecT2 30 nSec 30 nSecT3 30 nSec 30 nSecT4 650 nSec 150 nSecT5 10 nSec 10 nSec

It will be helpful if you keep this latter portion of this column handy for reference during future columns, since this basic information will be needed for reference as you read some future columns.

74 MICRO No. 72 - June 1984

Page 79: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

c a tc d o a

BusCard IICommodore 64

Name:System:

Description: Allows any Commodore- compatible disk drive, including hard disk, and virtually any printer to be added to your system. Mix and match peripherals with no fear of software incompatibility. BusCard is both hardware and software invisible. The cartridge mount allows cartridges to lie flat and device allocation switches remain in function mode at all times.

BusCard gives the added power of extended BASIC as well as selectable conversion of Commodore code to standard ASCII. It comes with a full machine language monitor including assemble/disassemble commands. It just plugs in to install and comes with a one year warranty and documentation.

P r i c e : $200Contact: Batteries Included

186 Queen St. West Toronto, Ontario M5v lz l Canada 416/596-1405

Name: BLAST (BlockedAsynchronous Transmission)

System: Over 60 micros, etc.(not for Atari/Commodore)

D e scrip tio n : A synchronous com m unications software which allows any computer with BLAST to talk to any other computer with BLAST, using any asynch modems, or directly linked at speeds from 300 to 19,200 baud. This package will already run on more than 60 micros, minis and mainframe systems. Unlike earlier asynchronous software, this provides truly bidirectional operation, allowing a system to receive one file, while sim ultaneously sending another. BLAST operates through common RS-232 serial ports and asynchronous modems, over dial-up lines or private networks, as well as from port to port. It is menu driven, supports unattended operation, perm its user-defined function keys,etc.

Price: $250 (for micros)Contact: Communications

Research Group 8939 Jefferson Hwy Baton Rouge, LA 70809 504/923-0888

Name: The ConsultantSystem: Commodore computers

D escrip tio n : Form erly D elp h i's ORACLE, this program lets you design a "layout" for any kind of information you want to file, then allows you to search, sort, and analyze information. The file structure offers expandable record size up to 9 display pages (7,000 characters), with up to 99 fields per record. Any field may be a key-field, and a single field can be an entire screen of information. The number and overall size of the files is limited only by disk storage capacity. Sorting and searching is alm ost unlim ited, including multiple-field and wild card in non-keyed fields. Full Four-function arithmetic is included. There is a password security system. Output functions include page numbering, printer control characters and optional line length. There are also built-in routines for mailing labels and forms.

P r i c e : $125Contact: Batteries Included

186 Queen St.West Toronto, Ontario M5V 1Z1 Canada 416/596-1405

Name: MasterFORTHSystem: Apple II/II + /HeLanguage: FORTH

Description: A complete professional programming language which includes a built in macro-assembler with local lables, a screen editor and a string handling package. The input and output streams are fully redirectable and make full use of the Apple DOS 3.3 file system. Floating Point and HIRES options are also available. This meets all provisions of the Forth-83 International Standard.

The package includes FORTH Tools, a 200 page textbook, a technical reference manual, and a complete listing of the MasterFORTH nucleus. It gives the user a view of input and output from reading the input stream to writing a mailing list program. Numerous examples are provided.

P r i c e : $100-$160Contact: MicroMotion

12077 Wilshire Blvd. Ste 506Los Angeles, CA 90025 213/821-4340

No. 72 - June 1984 MICRO 75

Page 80: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Name: The Print ShopSystem: Apple II + /Apple lieMemory: 48KHardware: Popular printers such as

Epson, Imagewriter,Apple Dot Matrix, C.Itoh

Description: Write, design, and print your own greeting cards, stationery, letterhead, signs and even banners. No special knowledge of graphics is required for this menu-driven software. With keyboard or joystick you can produce a finished piece in one of eight different typestyles, in two sizes and in solid, outline and three-dimensional formats. There are nine border designs, ten abstract patterns, and dozens of pictures and symbols with which to create. A built-in graphics editor allows you to create your own pictures or modify those provided. You can also print work generated with other graphics programs.

Text-editing features such as automatic centering, left and right justification and proportional spacing give added help in design. Comes with a colorful assortment of pin-feed paper and matching envelopes, and a reference manual.

Price: $49.95Contact: Broderbund Software

17 Paul Drive San Rafael, CA 94903 415/479-1170

Name: Romar D(xJ ComputerMemory: 64K (expandable to 192K)

Description: An Apple compatible computer with detached keyboard and dual capability featuring both Apple DOS and CP/M operating systems.

Based on a 6502 with 64K ROM, expandable to 192K, plus a Z080 circuit card for running CP/M programs. The separate fully encodedkeyboard contains 87 keys, including both special function and numeric keypads with CAP LOCK and status keys. Built- in command software allows most keys to be pre-programmed for special functions. The design accommodates dual floppy disk drives and an 80 watt switching power supply. It contains eight expansion slots for Apple accessories and add-ons.

The computer is designed to work with Apple programs and accessories without infringing on Apple proprietary circuitry or ROM. Besides operating with a variety of today's languages, it can adapt to future software languages.

P r i c e : $695Contact: Romar Computer

Systems22110 Clarendon St., Ste 103Woodland Hills, CA 91367818/999-1083

Name: Video * Clear InterferenceCable

System: Commodore, RadioShack CoCo, any with TV monitor

Description: An Interference Rejection Cable designed to reduce or eliminate radio frequency interference in television sets that are being used as monitors for home computers. It is easy to in s ta ll , requ ires no modifications to either the computer or TV, and comes with all adapters necessary to interface with a wide variety of TVs. It contains a special RF filter that is designed to reduce the level of interference generated by the computer. The cable comes with 90-day warranty.

P r i c e : $16.95Available: Computer Associates

Box 683West Fargo, ND 58078

__________________________________________________ -

Name: PerfectViewSystem: Virtually All

Description: Designed to fit virtually all terminals, this is an effective, simple and cost-efficient computer screen filter with circular polarization. It improves user comfort with glare reduction and contrast enhancement, cutting eyestrain and fatigue. It is lightweight and durable, anti-reflective coated polyester laminated to a circular polarizer. PerfectView is available in five screen sizes and mounts to the CRT housing with no tools. This is manufactured by Polaroid Corp.

Price: $49.95Contact: PerfectData Corp.

9174 Deering Avenue Chatsworth, CA 91311 213/998-2400

76 MICRO

Page 81: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Title: Microcomputer Communications - A Window on the World

Authors: Barbara E. McMullen and John F. McMullen Price: $14.95 Publisher: Wiley Press

Written in an easy, readable style, Microcomputer Communications is a guide for using your personal computer as a telecommunications tool. Methodology, equipment, and the process of information transmission is explained. It gives the essential information that is necessary for setting up telecommunications links between micros and such services as CompuServe, Dow Jones and other information sources. Telenet, Tymnet and Uninet telephone numbers for across the United States are also provided.

Level: beginner to intermediate.

Title: Engines of the Mind - A History of the Computer (hardbound)

Author: Joel Shurkin Price: $17.50Publisher: W.W. Norton & Company

This book presents a history of the computer from 'the mad genius of Charles Babbage and the remarkable Countess of Lovelace, through the invention of the first electronic all-purpose digital machine, to the creation of the chip and beyond.' ‘Engines of the Mind' covers more than machines; it is really about people. Covering the various controversies involved in the creation of the computer, the history of the computer is painted in terms of humanity rather than a list of dates and events.

Title: Commodore 64 Graphics & Sound ProgrammingAuthor: Stan Krute Price: $15.00 Publisher: Tab Books

Through various programs the reader is instructed in how to master the graphic and sound capabilities of the Commodore 64. Written in non-technical terms the programs use BASIC to produce effects that would require assembly language on other computers. A total of 68 programs are included with many figures, charts and diagrams interspersed throughout the text. Taking a ‘learning by doing' approach, each chapter has a summary and exercises. Each chapter takes a similar format: a short introduction, programming example, detailed discussion of the example, suggestions for modifying the original, short review questions and several programming exercises. Answers and possible solutions to the problems are provided.

Level: advanced beginner to intermediate.

Title: Experiments in Four DimensionsAuthor: David L. Heiserman Price: $17.50 Publisher: Tab Books

This is an introduction to fourth dimensional geometry and its applications. There are experiments that illustrate various theories and principles of one, two and three dimensions, as well as time, matter and space. The construction of four dimensional objects is explained through the plotting of lines, plane figures and space objects. Hyperspace objects, scaling and rotations in four dimensional space are also covered. There are ample drawings and examples throughout the text. Paper and pencil are the tools that are necessary; drawing the figures on your microcomputer is optional. For those with micros, a program is provided to enable you to draw and manipulate four dimensional objects.

Level: intermediate to advanced.

Title: Picture Perfect Programming in Applesoft BASICAuthors: Dr. Thomas Mason, Steve Payne, and Barbara

Black Price: $14.95Publisher: Reston Publishing Company

This book takes the approach that programming in BASIC can be learned more enjoyably through computer graphics than business or math problems. Requiring only basic math skills, the reader is guided through loops, subroutines, interactive programming, high resolution graphics, and business graphics. The basic premise the book is built on is that there are only two key concepts to mastering programming - loops and decomposition. These and all concepts are demonstrated visually, using the old adages - seeing is believing and a picture is worth a thousand words.

Level: beginner.

Title: The Microcomputer Users Handbook 1984Authors: Dennis Longley and Michael Shain Publisher: Wiley-Interscience

Written for a wide range of business people, this handbook address the problems of choosing and upgrading microcomputer systems. Divided into two parts, the first part explains what the role of microcomputers in business is, the right way to buy a computer system, maintenance and after sales support, planning for growth, project planning and staff participation and questions to be asked at a demonstration. The second part consists of over 200 reviews of business micros and several hundred peripherals. The workings of a computer are explained, with most every related subject (languages, operating systems, telecommunications, etc.) being touched upon. There are plans for a yearly update of this handbook to keep material abreast with the market and industry.

Level: beginner to advanced.

No. 72 • June 1984 MICRO 77

Page 82: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Iq u e & tto a m x s iK t

Recently I received a long letter from Paulo C., a reader in Mexico, requesting help from the other readers of Micro. The following is excerpted from this letter:

"Approximately five months ago an archaeological team from the University of Mexico at Quihexl made a startling discovery while digging at the base of a pyramid in Teotihuacan. As you may know, this site has long been regarded as an area rich in artifacts and relics. This particular expedition, headed by Drs. Jose Ferra and Juan Cortese sought to discover a burial chamber in the lower levels of the pyramids, in hopes of finding similarities to the pyramids at Giza, Egypt.

After excavating an area 10' by 12' to a depth of 7', a solid stone table was struck. At first thought to be a fallen slab, it was soon realized that the stone was the top of an entrance way. Further digging revealed a wooden door, covered and sealed with gold panels. It was carefully examined by Drs. Ferra and Cortese and determined to be authentic. After being removed, the door was shipped to the Museum at Mexico City where it underwent carbon 14 tests, its age - the same as that of the Egyptian pyramids. Following removal of the door, the team worked to clear the passageway of dirt and rocks; at last entrance was gained. The inside walls were polished smooth and the floor was made of smaller stones, cut and laid cobblestone fashion. Travelling some 8 feet down the passageway another door, similar to the first, was found tightly sealed. This door was also removed and shipped back to the Museum where it underwent many tests, including a carbon 14 confirmation. Behind it, a wider corridor ran about ten feet, then turned sharply to the right and quickly narrowed. It is perhaps best to directly quote Dr. Cortese's description of the next part of the expedition - 'There was much excitement as we walked around the comer of the corridor. When I saw that it narrowed I was particularly excited as this was the construction used in Giza preceding a staircase. So, I was not surprised to indeed find a staircase at the corridor's end.

With great anticipation I slowly descended the steps, almost falling once as the generator faltered, momentarily flickering the lights. Could some angry, disturbed spirit be at work? I continued with Dr. Ferra close behind me. As we cautiously descended, we could hear a faint rustling, rushing noise, becoming louder the further we went. I shone my lantern down the stairs and, unexpectedly, it was reflected back. We reached the bottom to discover rushing water flowing over the last steps and filling the connecting passages within a few feet of the top. With the depth measured at over five feet, it was obviously too deep to negotiate without a boat, especially given the strength of the current. Alas, we had to resign ourselves to going back for the time being.'

As the team wandered back up the stairs and returned to the campsite, it was decided that canoes would be the best solution to exploring the water-filled passageway, being light and easily maneuvered. Arrangements were made to have two canoes sent immediately by the University. Two days later, equipped with canoes, lanterns, photographic equipment and excavation tools the team once again descended the stairway. The canoes and equipment were carefully placed in the water, with

Drs. Ferra and Cortese in the first canoe and two of their assistants following in the second. The rest of the team remained behind. Again Dr. Cortese comments, 'We carefully got in the canoes so as not to upset them and lose our equipment. Drifting with the current, we noted an end to the passageway some forty yards further on. As the current slowed near the end, an arch top became visable. Ducking our heads low, with a few good strokes of the paddles we were through the end and out the other side. It is so hard to describe moments like this. Dr. Ferra and I both gasped. We had found the burial chamber. The ceiling was quite high, particularly when you considered we were already elevated five feet by the water. As our assistants entered, their extra lanterns illuminated the chamber more clearly and they expressed equal astonishment. We were most impressed by what appeared to be a large altar rising up out of the water against one wall, being somewhat reminiscent of the old Catholic wail altars. Next to it, on the left, was a pedestal with a large falcon type bird carved out of what appeared to be black onyx. It looked very much like the Egyptian god Horns. On the altar top, leaning against the wall, was the most interesting object of all. A large, carved, circular stone; Dr. Ferra's first impression was that of the Rosetta stone.'

The two canoes returned, cameras filled with pictures of the chamber. The exploration and retrieval of the artifacts proceeded well, the wheel being removed and sent back to the Museum. It is still under investigation and being subjected to further testing. Underwater divers photographed a carving on the front of the altar. It depicts an ancient warrior who is sitting above an illuminated rectangular box.

Unfortunately at this time there isn't any more information regarding the stone. After examining a drawing of this stone, I felt perhaps one of Micro's readers could possibly ascertain its hidden meaning. Included for you is a rendering of the stone's carvings."

Well readers, good luck and please send any theories to me, as Micro would like to be able to contribute to, if not provide, the solution. We will acknowledge whoever is the first to solve, or lead to the solution of, this mystery. Thanks,- if anyone can do it, I'm sure it will be one of you.

78 MICRO No. 72 - June 1984

Page 83: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

MICRO Program Listing Conventions

CommodoreL I S T I N G C64 KEYBOARD

Commands

(CLEAR; □ ' CLR

(HOME! HOME

( INSERT} !« ■ INST

(DOWN) a CRSR DOWN

(UP) □ ' CRSR UP

(R IGHT) Ii CRSR RIGHT

(LEFT} 19 A CRSR LEFT

C o l o r s

(BLACK} ■ CTRL 1 BLK

(WHITE) 4 CTRL 2 WHT

(RED) CTRL 3 RED

(C YN> W. CTRL 4 CYN

(PURPLE) il CTRL 5 PUR

(GREEN) hi CTRL 6 GRN

(BLUE) r mub CTRL 7 BLU

(YELLOW) IU CTRL 8 YEL

(RVS) a CTRL 9 RVS ON

( RVSOF F } ■ CTRL 0 RVS OFF

(ORANGE) = 1

(BROWN) IS = 2

(GREY I ) s = 3(GREY l ) so = 4

(GREY 2 ) = 5

(LT GREEN) ii = 6(LV BLUE) □ = 7

(GREY 3) ■i * 8

F u n c t i o n s

(F l f ■ i 1(F2) a f2

(F 31 9 n

( F 4 } K ' f 4

(F5 ) i l f 5

( F o ) Si '' f 6

(F7 ) 11 f 7( F 8 ) i " f 8

S p e c i a l C h a r a c t e r s

{ P }{POUND}

(UP ARROW}

(BACK ARROW

tr ' P i Char

£ Pound S ign

t Up A r r o w

*r Back A r r o w

AtariConventions used in ATARI Listings.

Nor#al Alphanuneric appear as UPPER CASE:SAMPLE

Reversed Alphanumeric appear as lower case:yES (y is reversed)

Special Control Characters in quotes appear as:(conAandl as follows:

Listing Cotaand ATARI Keys

{UP} Cursor Up ♦ ESC/CTRL -(DOWN) Cursor Down * ESC/CTRL ={LEFT} Cursor Left *■ ESC/CTRL +{RIGHT} Cursor Right * ESC/CTRL *{CLEAR} Clear Screen * ESC/CLEAR(BACK) Back Space 4 ESC/BACK S{TAB) Cursor to Tab ► ESC/TAB(DELETE LINE} Delete Line □ ESC/SHIFT DELETE(INSERT LINE) Insert Line H ESC/SHIFT INSERT

(CLEAR TAB) Clear Tab Stop □ ESC/CTRL TAB(SET TAB) Set Tab Stop B ESC/SHIFT TAB

(BEEP) Beep Speaker □ ESC/CTRL 2

(DELETE} Delete Char, U ESC/CTRL BACK S

(INSERT) Insert Char. 13 ESC/CTRL INSERT{CTRL A} Graphic Char. h CTRL A

where ft is any Graphic Letter Key

Non-Keyboa rd Commands

( D IS =';(LOWER CASE)

(UPPER CASE i ( ‘RETURN}

(DEL)

(SPACE>

N o t e s :

C H R I ( 8 i

CHR*i 9 1

CHR$ i 14)

C H R I (142)

CHRI (142)

C H R I (20) C H R I (160)

1. A r e p r e s e n t s SMlf : T KEY

2. * r e p r e s e n t s Commodore Key i n

l o w e r l e f t c o r n e r of k e y b o a rd

3. CTRL r e p r e s e n t s CFRL Key

4. G r a p h i c s c h a r a c t e r s r e p r e s e n t e d

i n L i s t i n g by k e y s t r o k e s r e q u i r e d

t o g e n e r a t e t h e c h a r a c t e r

5. A number d i r e c t l y a f t e r a {SrM&Ol..

i n d i c a t e s m u l t i p l e s o + t h e 6 i M ti 0 L.:

(D0WN6) wou ld mean DOWN 6 t im e s

. 72 ■ June 1984 MICRO 79

Page 84: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

Advertiser's IndexA m p lify .............................................................................................. 35B a tte r ie s In clu d ed ...................................................................... 75Broderbund Softw are ................................................................. 76C o m m u n ica tio n s R esearch G roup .................................. 75C o m p u ter A sso cia tes ................................................................. 76C o m p u ter M ail O rder ............................................................. 4 ,5F. A sh to n ............................................................................................ 8Lazerw are ............................................................................................. 1M IC R O M agazin e ....................................... 1 6 ,In s B a c k C vrM icro M o tio n ................................................................................. 75M icro w are D is tr ib u to rs ........................................................... 42P erco m ........................................................................... B a c k C ov erP erfe ctD a ta C o rp .............................................................................. 76P erfo rm an ce M icro P rod u cts ................................................ 35P ira tes H arbor ................................................................................. 19P ro te cto .............................................................................. 1 2 ,1 3 ,1 4R om ar C o m p u ter S y stem ........................................................ 76Sch n ed ler S y stem s ......................................................................... 8Sk y les E le c tr ic W orks ..................................... In s . F ro n t C vrS p e cia lty E le c tro n ic s ................................................................... 9Z an im S y stem s .............................................................................. 4 6

More Fun Than The

French Foreign LegionJoin the elite corps of authors—Join MICRO!

We are looking for a few good writers who have what it takes:• a technical understanding of computers• innovative techniques and programs• good writing skills• a desire to- participate in an exciting and

growing field• the ability to take old ideas beyond

themselves• the willingness to contribute and make a

difference.Don’t wait-send for your Writer’s Guide today.Send a S.A.S.E. to:

Mike Rowe MICRO INK

P.O. Box 6502 Chelmsford, MA 01824

rni in i in i in i ~ in i in i im — ■ ira in i in i irn im i im i in i icm------- 1n 0

Next Month In MICRO0

Features

The Dvorak — A look at the alternative to the 3 standard QWERTY keyboard, one which can

speed up your typing unbelieveably.

h Compression — This p ro fess iona l quality Applesoft program will save large amounts of storage space by eliminating unnecessary data

? and redundancies.

HiRes Printer Dump — The beginning of a three- part series on dumping graphics from the Commodore 64.

Flight Simulator — An in-depth look at the newFlight Simulator II program for armchair pilots which includes a WW II dogfight, as well as realistic instruction in flying a Piper.

n i— in i im i in i in i - ini inr inr

Hilister — The first of a two-part series covers the highlighting of text within a program for emphasis. Part 2 will cover moving around within a program listing.

Commodore to Apple Cassette — Transfer files from Commodore to Apple and learn, in detail, how the Commodore tape is generated.

Plus More...

DepartmentsReviews in Brief Software/Hardware Catalogs New Publications Interface Clin ic

0

im i m ~im ~ i n i i p m = i r i i n t ^ = ^ = i

80 MICRO No. 72 ■ June 1984

Page 85: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

This famous book now contains the most comprehensive description of firmware and hardware ever published for the whole Apple II family. A new section with guide, atlas and gazeteer now provides Apple lie specific information.

• Gives names and locations of various Monitor, DOS, Integer BASIC and Applesoft routines and tells what they’re used for• Lists Peeks, Pokes and Calls in over 2000

memory locations

• Allows easy movement between BASIC and Machine Language• Explains how to use the information for easier,

better, faster software writing

This expanded edition is available at the new low price of only $19.95

For the 35,000 people who already own previous editions, the lie Appendix is available separately for just $5.00.

Please send me:_________ What’s W here in the Apple @ $19.95 ea.

(Plus $2.00 per copy shipping/handling)

Apple lie Appendix @ $5.00 ea. ___(includes shipping charges)

Mass residents add 5% sales tax $ ___

Total Enclosed $

For faster service Phone 617/256-3649

Name

Address

City

Signature .

Aoot # .

State Zip

□ Check □ VISA □ MasterCard

Expires.

MICRO, P.O. Box 6502, Chelmsford, MA 01824

L

Page 86: International Edition: U.S. Edition: JUNE 1984archive.6502.org/publications/micro/micro_72_jun_1984.pdfbytes of parallel data, and the advantages and methods of using the Shift Register.

ATARI COMPUTER OWNERS:

Pick the positively perfect, practical,

printer-port peripheral package, from PERCOM DATA!

That's right the positively perfect PERCOM DATA 5’/4". floppy disk drive with a BUILT-IN PRINTER-PORT, for your A ta rr 400/800 is now available!

Until now. Atari computer owners who wanted to hook a printer to their computer had only one choice spend about $220 for an interface device. THOSE DAYS ARE OVER PERCOM DATA has built a parallel printer-port right into its new AT88 PD model. Now you can add a quality disk drive

system AND have a place to plug in a printer WITHOUT BUYING an interface.The AT88 S1 PD” disk drive operates in both single density (88K bytes formatted) and double

density (176K bytes formatted)What more could you want? NO INTERFACE a high quality PERCOM DATA disk drive AND a

built-in PRINTER-PORT . all with a price of $599 Pick up a positively perfect PERCOM DATA disk drive, with

printer-port pronto!For the name of an authorized PERCOM DATA Dealer near you, call our TOLL-FREE HOTLINE 1-800-527-1222 NOW, or write

for more information

W 7 .

Perfectly Priced

$599.PEHXM OARC O R P O R A T I O N

Expanding Your Peripheral VisionDRIVES NETWORKS SOFTWARE

11220 Pagemill Road, Dallas. Texas 75243 (214) 340-5800 1-800-527-1222

Atari is a registered trademark of Atari, Inc • AT8B SI PD is a trademark of Percom Data Corporation. • COPYRIGHT PERCOM DATA CORPORATION 1983Prices subiect to change without notice.