micro 6502 journal june 1979

66
8/3/2019 Micro 6502 Journal June 1979 http://slidepdf.com/reader/full/micro-6502-journal-june-1979 1/66 The Mag1azine af the APPL I KIMJ PET and Other '~~ I! ~ Systems I I ! I i I NO 13

Upload: cubemanpdx

Post on 06-Apr-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 1/66

The Mag1azine af the APPL I KIMJ PET

and Other '~~ I! ~ Systems

I I

!

I

i I

NO 13

Page 2: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 2/66

'PER'FECTAIM

- - - - - -

A.TTRACTIV'E FUNCTIONAL PACKAGINGFOR YOUR AIM·65 MICROCOMPUTER

• Professional Appearance• Striking Grey and BlackColor Combination

• Protects Vital Components

ENGINEERED SPECIFICALLY FORTHE ROCKWELL AIM·55• All!Switches Accessible• Integral Reset ButtonActuator

• Easy Paper Tape Replacement

EASILY ASSEMBLE!D• Absolutely No Alterationof AIM-65 Required

• All Fasteners Provided• Goes Together in Minutes

MADE OF HIGH IMPACT STRENGTHTHERMOFORMED PLASTIC• Kydex 100*• Durable• Molded-In Color• Non-Conductive

AVAILABLE FROM STOCK.• Allow Three to FourWeeksfor Processing and Delivery

'. No COD's Please• Dealer Inquiries Invited

TO ORDER: 1. Fill in this Coupon (Print or Type Please)2. Attach Check or Money Order and Mai'l to:

·TM Rohm & Haas Patent Applied For

NAME __

STREET _

CITY _

STAT._- ZIP __

enclosuresgroup

Please Shlp Prepaid SAE 1;-1(s)@ $43.50 each

Cal lfornia Resildents Please Pay$46.33 (Includes Sales Tax)

753 bush streetsan francisco, california 94108

Page 3: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 3/66

Harmonic Analysis for the Appleby Charles B, Putney

Case of the Missing Tape CounterbyWilliam F..Pytlik

The BaslcMorse Keyboardby William L aylor

A SYM·phony in Stereoby Phil lip M. Rlnard

Sorting with the APPLE 11- Part 1by Gary A. Foote

Streamlining the C2·4Pby James L Cass

6502 Information Resources Updatedby WllliamR Dial

TlieColor Gun for the Apple IIby Neil D.Lipson

ASK the Doctor.;_ Part VReading KIM Tepes on theAIMandSYMby RobertM. Tripp .

Computer·OetermlnetiParameters forFre~Radlcal··Polymerizationby L.S•.Reich

AIM 6S22Based Frequency Counterby MarvlnL Dejong

KIM - The Tunesmithby Anthony R. Scarpelli

MICROBESThe MICRO Software Catalog: IX

by Mike RoweSYM·1: Speak to Me

byJack GieryicReading PET Casset tes Without a PET

By DavidP. Kemp

41

43

5253

57

Advertiser's Index

June 1979Issue Number Thirteen

Editor/PublisherRobert M. Tripp

Business ManagerMaggie E. Fisher

Circulation ManagerCarbl A.Stark

Dls.tributic:,nEileen M. Enos.

Janet Santaguida

Micro-Systems LabJames R Witt, Jr.Stepheri L Allen

. ComptrollerDonna M .Tripp

Chief GoferFred Davis

MICRO- .l s publ ish ed mon thl y by ;MICRO Ink. Inc .'34'Chelmsford SlreetChelmstord t Mas5'achu~et's617/256-55 .15 .

Mailing address for all correspondence, subscrlpticnsand address changes is:

MICROP.O:Sox 6502Chelmsford. M A01824

AppHca tl ~n t o ma il a l se cono- cl ass p os ta ~e -catesis pending at; Chelmsford,MA 01824.Publica tion Number: COTR 395770Subscript ion in Uni ted Sta les:

$15.00 per yeari12 issues.Entire contents copyrlg~t '<)1979 by:

MICflO Ink; Inc :

AS ComputersCompas MicrosystemsComputer ComponentsComputer ForumTheComputerist. Inc.Computers hop

Connecticut microComputersCreative ComputingDr. DaleyEliam AssociatesEnclosures GroupH. Geller Computer SystemsHudson Digital ElectronicsMICROMicroproducts

5556201

47,49,5116

64591060

IFC612

359

MlcrospanMICRO Technology UnlimitedOptimal Technology, Inc.P.S.Software HousePlainsman Micro SystemsPowersoft. Inc.

Programma InternationalProgressive SoftwarePygmy.ProgrammingRNBEnterprisesSoftouchSpeakeasySYBEXWestSide ~Iectr()nics

Page 4: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 4/66

POWEH§OF~ INC.P. O. BOX 157PITMAN, NEW JERSEY 08071(609) 589-5500

products for the

APPLE IIADDRESS FILE GENERATOR $19.95

A professional piece of software which al lows the user to create four different types of addressf iles: a) Hol iday Fi le, b) Birthday Fi le,cl Home Address File, and d) Commercial Address File. The program contains a menu of sevenmajor commands: 1) Createa File, 2) Add to File,3) Edit File, 4) Display File, 5) Search File, 6) Sort File, and 7) Reorganize File. Most of the major commands havesubordinate commands whichadds to the flexabil ity of this powerful software system. We doubt you could buy a bet ter program for maintaining and print ing addressf iles.REQUIREMENTS: Disk II, Apple Printer Card, 32K of memory with Applesoft Rom Card or 48K of memory without Applesoft Rom Card.

SUPER CHECKBOOK $19.95A totally new checkbook program with a unique option ... Bar Graphs.These bar graphs, outputed to a printer or video screen,provide

trend analysis data on code expense,income, expenses,or gain/loss on a month by month basis.The program contains a total of fourteen options:1) Check/Deposit Entry & Modification, 2) Reconciliation of Checksor Deposits, 3) Sort by Check Number, 4) Sort by Codefor Year, 5) Sort byCode for Month. 6) Output Year to Date. 7) Output Month Activity. 8-11) Printer/Video Plot Trend Analysis-Bar Graphs. 12) Account Status.13) Reconciled Check Status. and 14) Quit. An excellent program for maintaining your checkbook, or that of a small business.REQUIREMENTS:Disk II, 32K of memory with Applesoft Rom Card or 48K of memory without Applesoft Rom Card.

FUNCTION GRAPHS AND TRANSFORMATIONS $14.95This program usesthe Apple II high resolution graphics capabilities to draw detailed graphs

of mathematical functions which the user defines in Basicsyntax. The graphsappear in a largerectangle whose edgesare X and Y scales(with valueslabeled by up to 6 digits). Graphs can be

superimposed, erased. drawn as dashed (rather than solid) curves. and transformed. The trans-formations available are reflection about an axis. stretching or compressing (changeof scale).and sliding (translation). The user can alternate between the graphic display and a text displaywhich lists the available commands and the more recent interactions between userand program.Expected usersare engineers.mathematicians, and researchersin the natural and social sciences;in addi tion. teachers and students can use the program to approach topics in (for example)algebra, trigonometry. and analytic geometry in a visual. intuitive. and experimental way whichcomplements the traditional. primarily symbolic orientation. REQUIREMENTS: 16K ofmemory with Applesoft Rom Cardor 32K of memory without Applesoft Rom Card.

/

\ I. . .. . . , ,~

-4 888 - z . . . . . I I .Z .. . . 4 ....

GAMES APPLICATIONSAutomotive Diagnosis .Basic StatisticsElectrical Engineering I .Statistics I . . . . . . . . . . .

$14.959.959.9514.95

9.95

Apple Casino .Apple Derby .Apple II OrganCubik .

Radar Interceptor ..Rocket Pilot ..Saucer Invasion .Space Maze ..Star War .Swarms .Wampus Hunt

$ 9.959.9519.959.95

9.959.959.959.959.9514.959.95

$ 9.959.959.959.95

Vector Analysis '"

FINANCIALFinancial Wizard ...Financial Wizard II .Financial Wizard IIIFinancial Wizard IV ..

SYSTEMS SOFTWAREMemory Dump .Program Unload .File Editor .

(Programs recorded on cassettetape. Documentation included.)

$ 7.457.45

24.9524.95

HARDWARELight Pen . ... $34.95

Assembler ..... (I ncludes Demo-Software)(Fi le Editor requ ired for

use with Auembier)

Call or write for our free SOFTWARE & ACCESSORIES CATALOG

POATEB§tlFT, INC.P. o. BOX 157PITMAN, NEW JERSEY 08071(609) 589·5500

DEALER INQUIRIES INVITED• Me ster Charlie a nd VISA

orders accepted_• Include $1.00 for

shipplnll and handling.• New Jer.ay r.. ldent.add

5%sal_ Tax.(Prices wbject to chllnf/ll.)

App le II is a regls t ... ed

trad eme rk o f Apple Com put .... In c.

Page 5: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 5/66

Harmonic AnalysisFor the Apple

Fourier Analysis is a powerful tool in many fields, butthe number of calculation is requires makes it very

laborious to perform by hand. A program in ApplesoftFloating Point BASIClets the APPLEII do the work.

One of the most important tools ofmodern technology is the oscilloscope.They can be found everywhere from yourlocal auto repair shop to the hospitaloperating room and by the thousands inlaboratories around the world. The peo-ple that use them know that the shape ofthe squiggly line which appears on thescope screen can tell whether their 'pa-tient' is sick or well and if the former,

what to do about it. Sometimes, how-ever, simple visual study of a scope pic-ture does not provide enough informa-tion. In this case, the modern day scien-tist or engineer can resort to quitesophisticated (and expensive) equip-ment to automatically dissect the pic-ture and to spew out all sorts ofnumerical data concerning same. Thiseffortless analysis of wave forms is afairly recent technical development. Itwas not always quite so easy.

Before the advent of modern electroniccomputer technology, the analysis of aparticular wave form was an all dayor allweek affair. First, one started with agraph of the function which was scaledto cycle every revolution of 360·. Thiswas divided into equal angular steps andthrough careful measurements a table ofX,y coordinates for each step on thecurve was developed. The curve shownin Figure 1 illustrates a representativeplot of data which could have been col-lected from the vibrations of a gasolineengine, torque variations of a syn-chronous motor or some other physicalphenomenon.

The next step was to calculate the coeffi-cients of the terms of a Fourier series.This calculation is a repetitive 'numbercrunching' exercise and was best doneby two or more people armed withmechanical calculators. The team ap-proach was advisable because, with thehundreds or even thousands of calcula-tions required, mistakes were inevitable.At this point, numbers were available forthe design of counterbalance weightsfor your engine, reshaping of poles ofthe synchronous motor, etc.

June 1979

The mathematical proof of the fact thatany single valued periodic function, suchas the one in Figure 1,can bedefined byan infinite series and the method forcalculation of the coefficients for theterms of the series was developed byJean Fourier, a French mathematician(1768-1837). The series which he in-vestigated and which is given hisname is:

Y = aO + a1(SinX) + b1(CosX)+ a2(Sin 2X) + b2(Cos2X)+ a3(Sin 3X) + b3(Cos3X)+ a4(Sin 4X ) + b4(Cos4X)+ a5(Sin 5X) + b5(Cos5X)+ etc.

It is easy to see that, if it is desired tocarry a calculat ion for a Fourier seriesout to say the tenth harmonic, a lot ofsines and cosines get into the action, infact, ten of each for each point of thecurve being investlqated. The sheermagnitude of the pencil-pushing typecalculation tasks that some of themathematical geniuses of the past, suchas Fourier, set before themselves stag-

gers the imagination.

Fortunately, for most engineering prob-lems, the relative significance of har-monics above the fifth are slight andmost curves can be defined to sufficientaccuracy by a Fourier series with a cut-off at this level. (One of myoid textbooks describes a hydraulic penstockVibration problem involving the beat fre-quency between the 17th and 18th har-monics of the system!) The accompany-ing program, written in Applesoft IIFloating .Point BASIC, calculates alisting of coefficients of each term to thefifth harmonic and continues to show acalculated plot of the input data curveand all five harmonics within a couple ofminutes. Admittedly, this does notmatch the speed of a fast Fouriertransform system, but i t sure beats theold way.

Harmonic analysis of the data listed forFigure 1 with this program yields thefollowing information:

Charles B. Putney1085Unguowa RoadFairfield, CT 06430

1. The curve is defined by the equa-tion;Y = 4.008 + 2.39Sin(X) - 0.19Cos(X)

- 0.49Sin(2X) - 0.50Cos(2X)- 0.13Sin(3X) + 0.12Cos(3X)+ 0.23Sin(4X) - 0.08Cos(4X)- 0.07Sin(5X) + 0.07Cos(5X)

2. The average of the curve is offsetfrom zero about Y = 4.

If this data and results had beendeveloped with respect to say a vibrationproblem, it could probably be safelyassumed that if the second harmonicvibration component were taken care of,the system would be satisfactory. On theother hand, it might be desired to pro-vide for a flexible mounting to absorb adeflection amounting to the differencebetween the curve average and the max-imum deflection of 7_3.A vertical expan-sion of the plot of this curve can be ob-tained by subtract ing 4 from the Y com-ponent of the input data. This will yield agraph balanced about the X axis as il-lustrated by the 'average line' in thefigure.

Directions for running the program arepretty well built into the listing. After theinitial instruction page,the form of the Xor angular component must be inputted.(D,for degrees or R for Radians followedby a RETURN)Then the data for eachpoint of the curve being analyzed mustbe entered as X,Y(for example, Figure 1,Point 1 would be entered as 30,4_3RETURN)until all pomts are in the com-puter, then enter Done, Done RETURN. Ifa mistake is made while entering any ofthe data points, the program must berestarted. Usea Control C to get out andstart over with a RUN. Note, that zerodegree X and the 360· X are the samefrom the definition of a periodiCwave,soone or the other of these points shouldbe entered but not both of them. It is notnecessary to input the data points inorder and any 360· span may be used(for example -180· to + 180°). However,the plotted graph with this program willalways come out starting at the zeroposition.

MICRO 13:5

Page 6: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 6/66

For those who don't havean APPLE,theprogram can be used as far as instruc-tion 1225without missing output of thereal important results from the analysis,the term coefficients. While checkingout this. program, I recalculated ex-amples from several old textbooks andwithout exception, I found at least oneerror in the answer listings in each one

.of them. Needless to say, this createdbig headaches for the students of thatera.

JLIST

10 HOME: VTAS 5: HTAB 13: PRINT"HARMONIC ANALYSIS"! PRINT

20 PRINT" THIS PROGRAM CALCULATES COEFFICIENTS OF FOURIER SERIES TO THE FIFTH HARMONIC"

30 PRINT "OF PERIODIC FUNCTIONSF( Y )=F( X )"

40 PRINT "FUNCTIONS MUST MEET THI S CRITERIAt "

50 PRINT: PRINT" (A)Y IS NOT INFINITE"

60 PRINT" (B >THERE IS ONLY0NE VALUE OF Y FOR EVERY VALUE OF X"

70 PRINT" (C)Y HAS ONLY AFINITE NUMBER OF MAXIMA ORMINIMA"

100 PRINT110 PRINT "MAKE A TABLE OF X,Y V

ALUES PICKED FROM THE GRAPHFOR EACH SECTION"

120 PRINT "EVEN IF THE FIRST ANDLAST HALVES OF THEGRAPH ARESYMETRICAL, X,Y VALUES FOR

ONEFULL CYCLE MUST BE ENTEREDO

122 PRINT "START DATA AT POINT I1 NOT POINT 10"

125 PRINT" HIT ANY KEY AND RETURN TO CONTINUE": INPUT 0$

200 HOME: VTAB 2: PRINT "INPUTX,Y VALUES OF POINTS ON GRAPH UNTIL ALL INPUTTED. AFTER LAST ENTRY TYPE 'DONE,DONE'"

MICRO .13:6

205 PRINT! PRINT "ARE> : DATA PINTS EQUAL STEPS DEGREESOR RAD IANS(R)1"

206 INPUT [1$: IF D$ = "[I" THEN= 1

207 PRINT : PRINT " INPUT DATS X,Y"

210 INPUT X$,Y$220 IF X$ = "DONE" THEN 1000300 X = VAL (X$)!Y= VAL (Y$)

301 . REM CALCULATING SUMS OFFICIENTS

305 AO = Y + AO: IF R THENX := (X/ 360) * 6.28318

310 FOR I = 1 TO 5320 A( I ) = Y * SIN (1 * X) + A(I

)

330 B( I) = Y * COS (I * X) + B( I)

340 NEXT I

350 N = N + 1360 IF T < ABS ey) THEN T= AB(Y )

390 GOTO 2101000 AO = (AO / N): REM CALCUL

ING COEFFICIENT AVERAGES1010 FOR I = 1 TO 51020 A( I) = (A( I) / N) * 21030 B( I) = (Be I) / N) * 21040 NEXT I1100 HOME1110 PRINT "TERMS OF THE FOUR

SERIES ARE:"1120 PRINT: PRINT "TERM tl-(WIL BE ZERO IF GRAPH IS"! PR

"SYMMETRICAL)"1121 PRINT" ";AO1122 PRINT "TERM 12":H= 1: GOSU

12001123 PRINT "TERM 13": GOSUB 12

1124 PRINT "TERM 14":H= 2: GOSU1200

1125 PRINT HTERM IS": GOs8B 12

1126 PRINT "TERM 16"!H= 3: GOSU1200

1127 PRINT "TERM 17": GOSUB 12

1128 PRINT "TERM IS"!H= 4: GOSU1200

1129 PRINT "TERM 19"! GOSUB 12

June 1979

Page 7: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 7/66

Tables I through IV list data points for Table Ivarious standard reference curves. I t is Three POint Triangularinteresting to go through them to see theharmonic patterns for each. For exam- XD ypie, the triangular wave is an all odd 90, 1harmonic system. The sawtooth wave,which is the basis for many electronic 180 , 0music generators, is the sum of all har- 270 , -1monics to Infinity.

I. l 360 , 0

Table II Table III Table IV

Triangular Sawtooth SquareXO y XD Y XD Y

-160 , -3 20 , 8 20 , 1

-140 , -2 40 , 7 40 , 1

-120 , -1 60 , 6 60 , 1

-100 , 0 80 , 5 80 , 1

- 80 , 1 100 , 4 100 , 1

- 50, 2 120 , 3 120 , 1

- 40 , 3 140 , 2 140 , 1

- 20 , 4 160 , 1 160 , 1

0, 5 180 , 0 180 , 020 , 4 200 , -1 200 , -1

40 , 3 220 , -2 220 , -160 , 2 240 , -3 240 , -1

80 , 1 260 , -4 260 , -1

100 , 0 280 , -5 280 , -1

120 , -1 300 , -6 300 , -1

140 , -2 320 , -7 320 , -1

160 , -3 340 , -8 340 , -1

180 , -4 360 , 0 360 , 0

8

- J

6

s

-l----~

Avo!l..AC.E.L'N~

>-~

,0ee

XO

June 1979

Figure'30 I. / .~,() 5.7so 6.811.0 7.~150 5.1.180 l.SflO 2.1Z~O 1.8-Z10 /.9300 2.13!O Z.T"360 '3.S

----- ---Avff.yo!J1.12 . &3.'St.t

-0.S'-I. >-z.a- t.1-I. 3-I.,-o.s

MICRO 13:7

Page 8: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 8/66

1130

1131

11321200

1210.

1225

1250

12601290

1300

13011310132013211322132313301335

1340

135013551360139015001510

1520

1530

1540

1550

1580

.MICRO 13:8

1600PRINT "TERM t10":H= 5: GOSUB1200 1610PRINT "TERM t11" : GOSUB 121 1620

oGOTO 1250 1630PRINT" ";A(H)j" * SIN(II;H;"X)"t RETURN 1640PRINT" ",B( H);" * COS(" 1645;H;"X)" : R ETURN 1650

REM OK NON GRAPHICS TO HER 1660E ALSO CHANGE 1132 GOTO 1132 16702000

INPUT "DO YOU WANT A PLOTYOR N? . .A$ 2010IF A$ = "NN THEN 6010

S = 70tH = 0: REM SETTING I 2020NITIAL SCALE AND CALCULATIONCONSTANT TO ZERO 2031PRINT : PRINT: PRINT "PLOTOF INPUT DATA CALCULATED TO 2032FIFTH HARMONIC. Y

2033T 100= ";T: HGRHCOLOR= 3HPLOT 0,79 TO 279,79HPLOT 0 ,0 TO 0,159HPLOT 0 ,79 - S TO 5,79 - SHPLOT 0,79+ S TO 5,79 + SHPLOT 269,77 TO 269,81FOR K = a TO 269 STEP4

X = K / ( .75 * 360) * 6 .28318531Y = AO + A( 1) * SIN (X) + B 2090( 1) * COS (X) + A(2) * SIN 2100(2 * X) + B(2) * COS (2 * X 2110

) + A(3)

* SIN (3'* X)

+B(

22003) * COS (3 * X) + A( 4-) * S IN 2 22 0( .. *X) + B(") * COS (4 * X) + A(5) * SIN (5 * X) + B(5) * CO5 (5 * X)Y = (1 / T) * Y * SIF ABS (Y) > 79 GOTO 6000HPLOT 1( ,79 - YNEXTKHCOlOR= 6PRINT : PRINT : PRINT "FIRS

T HARMONIC": GOSUB 1600PRINT : PRINT : PRINT "SECO

ND HARMONIC": GOSUB 1600PRINT : PRINT : PRINT "THIRD HARMONIC"! GOSUB 1600PRINT : PRINT : PRINT "FOUR

TH HARMONIC"! GOSUB 1600PRINT : PRINT : PRINT "FIFT

H HARMONIC": GOSUB 1600GOTO 2000

2034

2035

2040

2045

223022402270

2280229033006000

6002

6004600660086010

6020

H = H + 1: REM ROUTINE FOPLOTT ING HARMONICSFOR I( = 0 TO 269 STEP 4

X = K / ( .75 * 360) * 6 .283185Y = A( H) * . SIN (H * X) + B(H) * COS (H* X)Y = (1/ T) * Y * SIF ABS (Y) > 79 THEN 6000HPLOT K,79 -YNEXT KRETURNHOME tH = 1: REM SETTING

P COEFF IC IENT TABLEVTAB5: PRINT"COEFF IC IENT TABLE "PRINT: PRINT: PRINT"SINES"," COSINES"PRINT : PRINT "FIRST HARMOIC"! GOSUB 2100PRINT t PRINT "SECOND HAR

NIC": GOSUB 2100PRINT : PRINT "THIRD HARM

IC"; GOSUB 2100PRINT : PRINT "FOURTH HAR

NIC": GOSUB 2100PRINT : PRINT "FIFTH HARMOIC": GOSUB 2100PRINT : PRINT "CONSTANT ::

;AO;u Y AT 100 = ";TPRINT : PRINT "HIT SPACE B

R FOR REVIEW"H = 0: GOTO 2200PRINT A( H ), B<H)

H = H + 1: RETURN

REM REVIEW ROUTINEIF PEEK ( - 16384) ~ 127 TH2220POKE - 16368 ,0POKE - 16303,0IF PEEl( ( - 16384) < 127 THE

2270POKE - 16368 ,0POKE - 16304,0GOTO 2220PRINT "PLOT IS OFF SCALE.

RYING AGAIN" t

S = S - 10 : REM SHORTEN VE

TICAL SCALEFOR K = 1 TO 1000NEXTKGOTO 1300REM C.B.PUTNEY,

FAIRFIELD,CONNECICUTVER 3/1 /79

END

June 1979

Page 9: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 9/66

Apple II E P R OMExpand Your ROM SoftwareAdd capabi li ty t o your sy st em mon it or or BASIC for busi ne ss o r ot he r appl ic at ion s. Addcommands to the opera ting sys tem. New opera ting sys tems can be put into EPROM memorywith our EPROM progr ammer and plugged dir ectly int o your APPLE II board wi th ourEPROM socket adaptor. The MICROPRODUCTS EPROM Programmer wil l program INTEL2716$,27585 and other s-vot t replacements for 27165.

Add to or replace existing APPLE II AOM software with opera ting sys tems of your own de-s ign. Other sof tware sys tems s imilar to PASCAL, FORTH, LISP, APL, FORTRAN, COBOL,ALGOL. o th er BAS tC 's, e tc . may be i ncorpor at ed i nt o your APPLE I I ROM space.

The EPROM Prog rammer l ooks j ust l ik e memory t o t he compu ter and can becon fi gu red t oprogram memory locat ions f rom 8000 to FfFF for 8 t ot ar of 32K byt es . Th is mean s t hat t heEPAOMs can be u sed i n compu te r appl ic at ion s o the r t han t he APPLE I I, i .e. t he MICAO-PRODUCTS Superklm. e tc . This tumsyour APPLE IIIn to a very low cost powerfu l, sof twaredevelopment system.

SUPERKIMby MICROPRODUCTS

Here i s a power fu l m ic rop ro ces so r cont rol

sy st em devel opmen t t ool and a compl at emicrocomputer In one low-cost package. TheSupe rk im si ng leboar d compu te r ha s mor efeatures, more interlace and expansionc apabi li ty wi th a hi gher Qual it y d esi gn andconstruction than any other In its creee.

Have you got a thousand hours tied up insoftware foryour ·KIM-1 BASeD control system

and now your ·KIM-1 is 100small? The Super-

kim Is the economical next step tor expanaloninto more RAM', user EPROM' and prototypearea on one modern, compact , h igh densi ty,ful ty assembled and integra ted beard . TheSuper tdm has more sof tware ayallab le thanany o the r si ng leboar o compu te r s in ce i t i stotally compatible with KIM-1.The Superkim has a wide r ange of appeal t oengineers, teachers and industry.• K IM- }s. proclUGI 01 MOS Technoogy

FEATURES:• Fully assembled.• Completely self-contained• Tex tool Zer o i nse rt ion f or ce so cket f orEPROM

• Onboard 25 vol t power supply• Doub le si ded pl at ed t hr ough ho le s on

fiberglass PC board• Gold pla ted edge connector• Fully socketed• Lates t low-power Schot tky IC's• SOlder mask

ADVANTAGES:• Put memory in two empty ROM sJots InAPPLE II

• Replace memory in Bl(isting APPLE II ROMslots

• Add new oparating systems to APPLE II• Programs INTEL 2716 2K byte EPROM's,

2758 1K byte EPROMsand omer compatible5 vott EPROMs• Putperipheral drivers in permanent memory• Use APPLE" to program EPROMsfor othercomputers

$99.95MICROPRODUCTS will CUllom prog,..mEPROM. with your program on reque.t 2'07 ARTESIA BOULEVARD

REDONDO BEACH, CA 90278(213) 374-'673$445.00

Add a Printer to Your Apple IIWithour PC Board that interlaces with thehighly popular SouthwestTechnical Products PR-40Printer.Bothour Printer Interface andPA-40 Printer are availableat computer stores.

micrapraclucts2'07 ARTESIA BOULEVARDI REDONDO BEACHI CALIFORNIA 902781 (2'31374-'673

Printer InterfaceApple II to PR-40nterface 1&completely assembled, tee:tedand guaranteed.ncluding' Interconnectingcable. software stored onaudioassette, PCBoardwhichplugsdirectly intoyour APPLEII

EATURES:PrIntsonel inea t a t imewhen returnkeyIspressed.Ideal lor wri ting programs, asyou haveacomplete permanentrecord of all changesanddeletionsto your program.Whi le InBasiC,us ing the list mode, printerwill list the entireprogramwithoutStopping85 the screenscrolls upone line 81a time.You c an r efer 1 0an earl ier part 01 yourprogram without the necessity of relistlng ilon the screen.Printer can becal led from Basic to printentire contents of "ideo screen.Whenusingassembly languagemode, one linea ta t imewi ll be printed ir: the same formatasthe ",deo screen.

$49.95

CENTRONICS TOO!HICROPRODUCTS/APPLE II

PARALLEL INTERFACE BlI.OCHUlI.E

The HIClI.OPRODUCTS Par a L l e I Ouptput card allows your Apple If" computer to

cceeuntcat e with the outside world.

Applications include:

Printer I nterface

Power controller

Tone/MUSiC generator

Plotter Driver

LED/LAMP Driver

A. pple rr/ Superkim CO ftI Iunications interfa ce

Features:

* 8- bits output* 15 ma output, current sink or source

(Can dr Ive L.E. 0.5 directly)

" TTL or CMOS compatible

* Will go in any slot on the Apple II*

* Data available strobe

General Information :

SPECIFICATIONS:Interface hardware consists ot:• anepoxyfiberglass Fe Board• double-sided• platedthrough holes• snkscreenprinted legends• gold platededge card connector.

Data can be transferred to an external device by a STA. STY or STX from

assembly language, or a POKE f rom BASIC. ThE' 8 bits output can drive 27-seglllent L.E.D. displays, relays, SCRs, Printer, or anything which requt res

up to 8 bits of data.

Application notes and software to drive a Southwest rectm rce I PR-40 printer

is a . ... ilable for a nominal S5.00 ext re .

Included .... th the Par a Ll e I Interface are instructions on how to rnt e r t ace to

• Centronics 719 printer and wiring diagrams for use as a power controller.

Additfonal soft .... are and applications notes available.2'07 ARTESIA BOULEVARD

REDONDO BEACH, CA 90278(213) 374-1673 *APPLE II is a tndesark of APPLE COHPUTER, INC.

$44.95

Page 10: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 10/66

D R . D A LE Y 'SS O F fWA R E FO R TH E

DR. DALEY's software continues to expand offerings. Listed below are our most popular programs.No PET owner should be without these. Dealers, you should stock them as well.

P E T TR EK 3

B A C K G AMMO N

M A S TE R M IN D

R E N UM B E R

Like STARTREK, but has several UNIQUE features. Forexample, the unpredictable EXPERIMENTAL RAY, who

knows what it will do ,.................. $ 7.95It's you vs the PET with an exciting game of BACKGAM-MON $ 7.95Plays two simultaneous games, one where you guessPET's secret code, and another where PETguesses yours $ 7.95Will renumber your BASIC programs, including all jumpstatements. For a 6K source code requires less than 5seconds... . .. .. . . . . . .. .. . . .. $12.95

P I L O TA BASIC coded PILOT interpreter. A second high levellanguage for the PET. Simple to use, even a ten year oldcan learn to use PILOT quickly. With sample PILOT pro- $12.95grams and documentation .

C H E C K B O O KWill balance your checkbook and save totals in 16categories on tape. Will produce end of month and year todate summaries. Categories can easily be changed tosuit your own purposes. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. $12.95

M A IL L IS TKeeps a mailing list and will sort the list into sub groups $12.95using up to three search parameters .

All of our programs are available on tape or for the Compu-Think disk. We charge $5.00 for the diskand shipping, but you can subtract $1.00 for each program which we place on the disk. Order 5 pro-grams and you get the disk free!

The above program has been modified for disk files. Willbe placed on a disk by itself which you can then use foryour mailing list $19.95We have just acquired the rights to distribute a linkingloader for BASIC programs! This will allow you to link ex-clusively numbered BASIC subroutines in memory. No

~~~~~i:;~~~~~~.~r. ~~~~.I~.~~. ~~t.h.~~t.~~i.~.u.s.e.f~~ ~r.o.-$12.95An ideal companion to the linking loader will be our library of useful subroutines whichcan be linked into your own program. Currently over 25 useful routines are included.

:~~~~~~~~:/;~:s~~~~;~gn~t~l:t.i~~ :~. ~ .~e.~~t.i~~I.~i.S~.I~~ r.~I~i~~. ~i.c.e..~~i.t~ .~r.~~I.I.f~~ $49.95

M A IL L IS T

F LA SH !

* * *

Remember that we GUARANTEE that your order will be shipped within four business days fromreceipt or you will receive a coupon for a discount on a future purchase.

Charge your order toMCIVISA

D R . D A LEY ,425 G ro v e A ve n u e , B e r r ie n S p r in g s , M ic h ig a n49103Phone (616) 471-5514 Sun. to Thurs. noon to 9 p.m. eastern time

Page 11: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 11/66

Case of the Missing Tape CounterThe lack of a tape counter on the PET cassette tape unithas led to hours of frustration. The technique presentedhere provides a fairly automatic method of locating yourfiles on the PETcassette.

The PET has an excellent file manage-ment system, Unfortunately, since thePET does not have a tape counter, ac-cess to any file or program other thanthe first requires either an uncanny"touch" to find a file by using FASTFORWARD or an infinite amount of pa-tience weiting for the file managementsystem to find the program at 1-7/8inches/second. The obvious solut ion isto use a large number of C-10 or C-5cassettes. Of course, this solution iscostly and requires one to store a largenumber of tapes.

Fortunately, the PET does have a realtime clock and the ability to start andstop the cassette motor via BASIC POKEcommands. These two capabilities, com-bined with the use of constant lengthfiles, allow ready access to any programor f ile on a user created tape.

The use of constant length fi les impliesthat every file or program on anycasset te has the same space al locatedto it regardless of how long the actualprogram is. This means that some of thetape on the cassette will not actually beused, but the method is much cheaper touse than using C-5/C-10 cassettes foreach program/data file_

After experimenting, we found that amaximum FAST FORWARD time of tenseconds is adequate to store the largestprogram capable to be stored in the PET8K memory. Of course, this is at thebeginning of the tape. As the tape ad-vances, more tape is actually wasted.Still, A C-90 cassette allows approx-imately 13 large programs or files to bestored and accessed via this method. Ac-cess time to the last file on a C-90cassette is approximately two minutes.

The program shown is pretty self- ex-planatory and easy to enter.

Usage of this method requires that theprogram be saved as the first program onevery cassette. To use the program,press SHIFT/RUN. After the program isloaded and run, DO NOT press STOP/EJECT on the cassette drive. The pro-gram wni inquire which drive you are us-ing by displaying:

ENTER CASSETIE 1OR 2

After you enter the number only, the pro-gram will present a catalog of all files orprograms on that tape. Dummy names

June 1979

will be listed for unused file locationslike:

PROGRAM 1PROGRAM 2

Although a C-90 cassette will hold 13programs, we have chosen to use onlyten.

Next, the program will ask if you wish toread or save a program by displaying:

READORCREATE PROGRAM/FILE --RORC

The program will then ask which file youwish to read or write bydisplaying:WHICH PROGRAM/FILE --I.E. 1,2, __.

If you have entered a number greater

than 1,the machine will display:PRESS F.FWD and HIT RETURNWHEN READY

(The program wil l skip the previous stepif you ask for program/file number 1because the tape is already in the cor-rect position). If you enter R to read af ile/program, the program will advancethe tape to the correct position, stop,and display:

HIT STOP/EJECT AND LOAD ASUSUAL

At this point, you simply load theselected program in the usual manner.

William F_Pytlik6828 Payne

Edwards, CA 93523

Similarly, if you entered C to create anew file/program, the tape will advance

to the selected port ion of the tape, stop,and display:HIT STOP/EJECTTAPE ISNOW READYTO SAVE NEWPROGRAM/FILE

Now, you can save any program. If youwish to use descriptive names for yourprograms or files, just reload this pro-gram, change the names in the appro-priate data statement, and resave theprogram as the first file on the cassette.

Since the length of a file allocation isdetermined by time in seconds (thenumber 10 in line 300 of the program).the user may change this number to

accomodate any length file. Also, sinceeach program occupies a unique well-defined location and the length allocatedis for a maximum length file. there is noproblem replacing one file/program withanother.

We use this method on all our tapes. Wealso use the program as a subroutine inprograms requiring access to other files,i .e., a recipe program. The use of the PETcassette drives becomes simple, quick.and enjoyable, and presents a solutionto the case of the miSSing tape countermystery.

MICRO 13:11

Page 12: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 12/66

1 0 REM TH I S PROGRAM ALLOWS THE PET USER TO2 0 REM ACCURATELY POS I T I ON H I S CAS SETTE F I L E S3 0 REM BY US ING THE FAST FORWARD FUNCT ION OF4 0 REM THE TAPE DR IVE .5 0 R EM6 0 REM7 0 PR INT " * * * PROGRAM / F I L E LOCATOR * * * "8 0 PR I NT9 0 I N PUT " ENTER CAS SETTE 1 OR 2 " ; CA

1 0 0 READ Xl l O D IM C $ ( X )1 2 0 FOR I= 1 TO X1 30 R EA DC $( I )1 40 P RI NT C$ ( I )1 5 0 NEX T 11 6 0 PR I NT : I N PUT " READ OR CREATE PROGRAM / F I L E - - R O1 7 0 I N PUT "WH ICH PROGRAM / F I L E - - I . E . 1 , 2 , • . . " ;W P1 8 0 I F WP= 1 THEN 2 4 01 9 0 REM STATEMENTS 2 0 0 AND 2 1 0 I N I T I A L I Z E THE MOTOR2 0 0 I F CA= 1 THEN POKE 5 9 4 1 1 , 6 12 1 0 I F CA= 2 THEN POKE 5 9 4 5 6 , 2 2 32 2 0 PR I NT " PRE S S F . FWD AND H I T RETURN WHEN READY "2 3 0 REM STATEMENT 2 4 0 WA I T S FOR RETURN TO BE DEPRE S2 4 0 GET A l $ : I F A l $= ""THEN 2 4 02 5 0 REM STATEMENTS 2 6 0 AND 2 7 0 TURN ON SELECTED MOT2 6 0 I F CA= 1 THEN POKE 5 9 4 1 1 , 5 32 7 0 I F CA= 2 THEN POKE 5 9 4 5 6 , 2 0 72 8 0 T= T I2 9 0 REM STATEMENT 3 0 0 WA I T S FOR TAPE TO ADVANCE TO3 0 0 I F T I < T + ( 1 0 * 6 0 * (WP - l ) ) THEN 3 0 03 1 0 REM STATEMENTS 3 2 0 AND 3 3 0 TURN THE MOTOR OF F3 2 0 I F CA= 1 THEN POKE 5 9 4 1 1 , 6 13 3 0 I F CA= 2 THEN POKE 5 9 4 5 6 , 2 2 33 4 0 PR I NT3 5 0 I F R $= " R " THEN PR INT "H I T STOP / E J ECT AND LOAD AS U3 6 0 PR INT : I F R $= " R " THEN 5 0 03 7 0 I F R $= "C " THEN PR INT "H I T STOP / E J ECT "3 8 0 PR I NT " TAPE I S NOW READY TO SAVE NEW PROGRAM / F I3 9 0 REM CHANGE NUMBER IN STATEMENT 5 0 0 TO CHANGE T4 0 0 REM NUMBER OF PROGRAMS PER CAS SETTE4 1 0 REM CHANGE NAMES IN STATEMENTS 5 1 0 THRU 6 0 04 2 0 REM TO YOUR PROGRAM NAMES5 0 0 DATA 1 05 1 0 DATA " PROGRAM 1 "5 2 0 DATA " PROGRAM 2 "5 3 0 DATA " PROGRAM 3 "5 4 0 DATA " PROGRAM 4 "

5 5 0 DATA " PROGRAM 5 "5 6 0 DATA " PROGRAM 6 "5 7 0 DATA " PROGRAM 7 "5 8 0 DATA " PROGRAM 8 "5 9 0 DATA " PROGRAM 9 "6 0 0 DATA " PROGRAM 1 0 "1 0 0 0 END

MICRO 13:12--June 1871

Page 13: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 13/66

The Basic Morse Keyboard

For the HAMs •. here is a way to use your system to makean ASCII keyboard perform as a Morse keyboard. lm-plemented on an OSI system, the program is in BASICand should be readily convertible to other systems.

A computer, as with any appliance,should be a useful tool to aid the ownerwith his dally tasks, or to bring enjoy-ment.

Being an amateur radio operator and acomputer hobbyist, I felt that the com-puter should aid the operator with histasks either when operat ing the stationor other activities. From this desire tohave the computer as an assistant, I fel tthat one of the best uses for my corn-

puter was to aid me in sending andreceiving of the Morse code. With this inmind I went to work developing a pro-gram that would allow me to use theASCII keyboard as a "Morse Keyboard".The program and the interface lntorma-tion in this art icle wil l help other amateurradio operators, who own the OSIChallengers with a Model 500 CPU withthe PIA port populated, get on the airwith the "Morse Keyboard".

First, an explanation of my system is inorder. My computer system consists ofthe system boards sold by Ohio scten-tific Instruments. I have the Model 500CPU with BASIC in ROM. The PIA port is

populated with a 6820 PIA, and is ad-dressed at the standard location on the500 board. The address for the PIA is63232 decimal or F700 hex on the 500CPU board. The program was written toservice the 6820 at this location. TheBASIC program uses the B side of the6820 as the output and PBO is thespecific port. PBO of the PIA is con-nected to a tone oscillator board togenerate the sidetone and a relay driveron the board is used to drive a 12 voltrelay that keys the transmitter.

The "BASIC Morse Keyboard" programis written in MicroSoft BASIC andAssembly Language. The Assembly por-

tion of the program is stored In DATAstatements, and is entered into usermemory with the READ and POKE func-tions of BASIC. On initialization, theDATA at line 1620 is READ and POKEDinto memory with the FOR NEXT loop atline 1605. This machine code storesubroutine is called at line 15 at thebeginning of the program. The machinecode rout ine is stored at hex OCOO. This

June 1979

machine code routine calls up thesystem monitor to get the ASCII codefrom the system keyboard. When a key isstruck on the keyboard the ASCIIequivalent of the letter or number Isplaced in the accumulator of the 6502microprocessor. The ASCII character isthen stored at hex OFOO where it will beavailable for the BASIC program to cep-ture it with a PEEK statement. This PEEKstatement is located at line 125 of theBASIC program.

The contents of hex OFOO will hold thepresent keyboard ASCII entry, and afterbeing read with the PEEK statement thecharacter will be stored in the A variable.The contents of variable A is now com-pared with the contents of a look uptable to determine the offset to theMorse element table where the conver-sion to Morse elements are formed. TheASCII table starts at line 130. The Morseelement table starts at line 1500.

The Morse equivalent of the ASCIIcharacter is loaded into the stringvariable A$, and on return from thesubroutine the program jumps to a

subroutine at line 1000 where theelements of A$ are seperated into thedot-cash elements of Morse code. Thisseperation is done by loading eachseperate element into 0$, and if the ele-ment is a 1 then a dot is generated in asubroutine at line 1200 through line1220. If the element read into 0$ is thenumeral 3 then a jump to the subroutineat line 1300 through 1320 causes a dashto be generated. After each characterhas been separated and sent to the PIAport the program returns to the inputstatement line 122.At statement l ine 122a jump to tne machine code subroutineis executed with the USR function ofBASIC. The machine code subroutine

causes a jump to the system monitorand the program will loop until a key isdepressed on the keyboard.The subroutine at line 1200 and 1300generate the Morse elements (dots anddashes). This is done by turning on andoff PBOfor a duration of time. For exam-pie if a 1 was decoded in the routine at1000then PBOwould be turned on (high)for the duration of time contained in the

William L. Taylor246 Flora Road

Lea~lttsburg. OH 44430

loop at line 1205. This loop (FOR J = 1TO X:NEXT J) is the dot length. The dotlength time element is stored in variableX at line 106. When the loop has timedout then PBOwill be brought low and areturn executed. The next Morse ele·ment is identified and generated ineither the subroutine at 1200 or 1300depending if it Is a dot or a dash. The dotlength, dash length, and the length be-tween characters are contained invariables at lines 102 through 109.The H

variable at line 102 holds the informationthat identifies PBOand turns PBOon inthe subroutines at 1200 and 1300. The Rvariable contents are used to turn PBOoff. The variable at line 106 is the dotlength. The variable at line 108 Is thedash length. The variable at line 109 isthe length between characters. Thisvariable can be eliminated if desired. Thevariables X and R can be adjusted for anydesired dot dash length. The routine atlines 10, 20 and 30 init ialize the PIA. Thisinitialization sets the B port as the out-put port. The value In variable G at 100ident ifies the ini tial locat ion of the PIA.

The object code subroutine for the pro-

gram is stored at Hex OCOO.The objectcode contents are:OCOO 20OCOl EDOG02 FEOC03 800c04 00OG05 OF0C06 60

The tone oscillator board is a straightforward construction project requiringfew components. The schematic inFigure 1 shows the schematic for thetone and relay driver board and the com-ponents that will be needed to constructthe board. Pref board and a wire wrapsocket can be used for the construct ion

of the board or you can etch a board ifyou feel that would be a more desirablemethod. A printed circuit board layoutwas not included in this article becauseit was felt that the user could use anymethod that was thought best. The con-nections to the PIA port on the 500 CPUboard can be any length of wire. I usedribbon wire and etched a small boardthat would mate with a Molex male 12

MICRO 13:13

Page 14: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 14/66

pin connector such as the connectors onthe 480 backplane board. This male plugconnects to the 500 CPU board at the Bside port connector on the 500 CPUboard. The power for the Tone board istaken from the computer except the 12volt DC for the relay. This must be ob-tained from another source. Be sure thatthe external power source ground beconnected to the tone board ground inorder for the relay keying transistor towork correctly.

A note of warning must be given at thispoint. The memory size must be set to3071 decimal when bringing up BASIC.This will be for the protection of themachine code routine that is storedabove O C O OHex.

In conclusion, the program as writtendoes not have any buffer so typing aheadIs not possible. This leaves the programopen for modificat ions, such as, install-ing the buffer. Also I have a version ofthe program that allows the operator toload ASCII into a memory zone and usethis ASCII as preloaded message text.The program and the sidetone keyer

works well on the OSI system used at myshaCk and I have had many pleasurablehours using the "Morse Keyboard" onCWoI wish you the same. Good luck.

Figure'

The author wishes to giveparticular recognition tothe article entitled:

"The Morse Master"

which appeared in theJanuary 1979 issue of73 Magazine, written byWilliam A. Thornburg.

The article provided theconcepts upon which thisprogram is based, and gavea program listing for theHSmicrocomputer.

MICRO 13:14

Tone Oscillator and Driver BoardParts List

1 1N4001Diode1 Pref board .100by .100hole centers1 555Timer IC1 8 Pin wire wrap socket (or 14pin)1 .1MF Disc capacltor1 50MF Electrolytic capacltor3 10K V2Watt Resistors1 2N2222NPNTransistor1 8 Ohm speaker1 12Volt DC relay1 MaleMolex 12Pin plug KK1561 Wire wrap wire 32Gauge (if used)1 Hand wire wrap tool (if used)

RadioShack 276-1394Radio Shack 276-1723

Radio Shack 40·245RadioShack 275·003

Misc. Wire for connection to computer and external 12volt power supply. Solder

Note: A 14 pin IC socket can be used for the 555. Only use 8 of the pins. I used aSigma 162R23-2600 relay for RY1.

RI. 10K

PBO

7 6 5

5552 3 4

+5'1CI, :1JA f

6HD

12VDC

+1~4001

June 1979

Page 15: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 15/66

1 R EM MORSE KEYBOARD FEB 1 9 7 92 P R I N T " MORSE CODE KEYBOARD"3 P R IN T :P R IN T :P R IN T :P R IN T5 " * * * * * * * * * * * REA DY * * * * * * * * * * * * "10 X=632321 5 GOSUB 1 6 0 02 0 POKEX+l, 0 : PO KE X +3 ,O : P OK E X ,O : P OK EX+2,2553 0 POKE X + l , 0 4 : POKE X + 3 , 0 41 00 G = 6 32 3 21 0 2 H = l1 0 4 R = O106 X=251 0 8 T = 10 01 0 9 F = 15 01 1 0 POKE 1 1 ,O : P OKE 1 2 , 1 21 2 2 X = US R(X )1 25 A = P EE K( 38 40 )1 3 0 I F A = 6 5 THEN GOSUB 1 5 0 01 3 1 I F A = 6 6 THEN GOSUB 1 5 0 11 3 2 I F A = 6 7 THEN GOSUB 1 5 0 21 3 3 I F A = 6 8 THEN GOSUB 1 5 0 3

1 3 4 I F A = 6 9 THEN GOSUB 1 5 0 41 3 5 I F A = 7 0 THEN GOSUB 1 5 0 51 3 6 I F A = 7 1 THEN GOSUB 1 5 0 61 3 7 I F A = 7 2 THEN GOSUB 1 5 0 71 3 8 I F A = 7 3 THEN GOSUB 1 5 0 81 3 9 I F A = 7 4 THEN GOSUB 1 5 0 91 4 0 I F A = 7 5 THEN GOSUB 1 5 1 01 4 1 I F A = 7 6 THEN GOSUB 1 5 1 11 4 2 I F A = 7 7 THEN GOSUB 1 5 1 21 4 3 I F A = 7 8 THEN GOSUB 1 5 1 31 4 4 I F A = 7 9 THEN GOSUB 1 5 1 41 4 5 I F A = 8 0 THEN GOSUB 1 5 1 51 4 6 I F A = 8 1 THEN GOSUB 1 5 1 61 4 7 I F A = 8 2 THEN GOSUB 1 5 1 71 4 8 I F A = 8 3 THEN GOSUB 1 5 1 81 4 9 I F A = 8 4 THEN GOSUB 1 5 1 91 5 0 I F A = 8 5 THEN GOSUB 1 5 2 01 5 1 I F A = 8 6 THEN GOSUB 1 5 2 11 5 2 I F A = 8 7 THEN GOSUB 1 5 2 21 5 3 I F A= 8 8 THEN GOSUB 1 5 2 31 5 4 I F A = 8 9 THEN GOSUB 1 5 2 41 5 5 I f A = 9 0 THEN GOSUB 1 5 2 51 5 6 I F A = 4 8 THEN GOSUB 1 5 2 61 5 7 I F A = 4 9 THEN GOSUB 1 5 2 71 5 8 I F A = 5 0 THEN GOSUB 1 5 2 81 5 9 I F A = 5 1 THEN GOSUB 1 5 2 91 6 0 I F A = 5 2 THEN GOSUB 1 5 3 01 6 1 I F A = 5 3 THEN GOSUB 1 5 3 11 6 2 I F A = 5 4 THEN GOSUB 1 5 3 21 6 3 I F A = 5 5 THEN GOSUB 1 5 3 31 6 4 I F A= 5 6 THEN GOSUB 1 5 3 4

1 6 5 I F A = 5 7 THEN GOSUB 1 5 3 51 6 6 I F A = 4 6 THEN GOSUB 1 5 3 61 6 7 I F A = 6 3 THEN GOSUB 1 5 3 71 6B I F A= 6 4 THEN GOSUB 1 5 3 81 6 9 I F A= 4 7 THEN GOSUB 1 5 3 91 7 0 I F A= 4 4 THEN GOSUB 1 5 4 01 7 2 GOSUB 1 0 0 01 7 5 FOR 1= 1 TO F : N EX T II BO FOR M= 1 TO G 9 : N EX T M1 9 0 GOTO 1 2 2

June 1979.

1 0 0 0 - L = LEN (A $ )1 0 0 5 FOR 1 = 1 TO L1 0 1 0 R $ = MID $ ( A $ , I , l )1 0 1 5 I F R $ = " 1 " THEN GOSUB 1 2 0 01 0 2 0 I F R $ = " 3 " THEN GOSUB 1 3 0 01 0 2 5 NEXT I

1 0 3 0 GOTO 1 3 2 01 2 0 0 POKE G+ 2 , H1 2 0 5 FOR J = 1 TO X : NEX T J1 2 1 0 POKE G+ 2 , R1 2 1 5 FOR J = 1 TO X : NEX T J1 22 0 R ET UR N1 3 0 0 POKE G+ 2 , H1 3 0 5 FOR J = 1 TO X : NEX T J1 3 1 0 POKE G+ 2 , R1 3 1 5 FOR J = 1 TO X : NEX T J1 32 0 R ET UR N1 5 0 0 A $ = " 1 3 " : R E TURN1 50 1 A $= " 31 11 ": RE TU RN1 50 2 A $= " 31 31 ": RE TU RN1 5 0 3 A $ = " 3 1 1 " : R ETURN

1 5 0 4 A $ = " 1 " : R ETURN1 50 5 A $= " 11 31 ": RE TU RN1 5 0 6 A $ = " 3 3 1 " :R E TURN1 50 7 A $= " l1 l1 ": RE TU RN1 5 0 8 A $ = " 1 1 " : RE TURN1 50 9 A $= " 13 33 " :R ET UR N1 5 1 0 A $ = " 3 1 3 " : R ETURN1 51 1 A $= " 13 11 " :R ET UR N1 5 1 2 A $ = " 3 3 " :R E TURN1 5 1 3 A $ = " 3 1 " : R ETURN1 5 1 4 A $ = " 3 3 3 " : R ETURN1 51 5 A $= " 13 31 ": RE TU RN1 51 6 A $= " 33 13 ": RE TU RN1 5 1 7 A $ = " 1 3 1 ' " : R E TURN1 5 1 8 A $ = " I l l " : R E TURN1 5 1 9 A $ = " 3 " : RE TURN1 5 2 0 A $ = " 1 1 3 " : RE TURN1 5 2 1 A $ = " 1 1 1 3 " : R E TURN1 5 2 2 A $ = " 1 3 3 " : R ETURN1 5 2 3 A $ = " 3 1 1 3 " : RE TURN1 5 2 4 A $ = " 3 1 3 3 " : R ETURN1 5 2 5 A $ = " 3 1 1 " : RE TURN1 5 2 6 A $ = " 3 3 3 J 3 " : R ETURN1 5 2 7 A $ = " 1 3 3 3 3 " :R E TURN1 5 2 8 A $ = " 1 1 3 3 3 " : R ETURN1 5 2 9 A $ = " 1 1 1 3 3 " : R ETURN1 5 3 0 A $ = " 1 1 1 1 3 " : R ETURN1 5 3 1 A $ = " 1 1 1 1 1 " : R ETURN1 5 3 2 A $ = " 3 1 1 1 1 " : R ETURN1 5 3 3 A $ = " 3 3 1 1 1 " : R ETURN1 5 3 4 A $ = " 3 3 3 1 1 " : R ETURN

1 5 3 5 A $ = " 3 3 3 3 1 " : RE TURN1 53 6 A $= " 13 13 13 " : RE TU RN1 53 7 A $= " 11 33 11 " : RE TU RN1 5 3 8 A $ = " 3 1 1 1 3 " : R ETURN1 5 3 9 A $ = " 3 1 1 3 1 " : R ETURN1 54 0 A $= " 33 11 33 ": R ET UR N1 6 0 0 FOR R= 3 0 7 2 TO 3 0 7 81 6 0 5 R EAD Q : POKE R ,Q : N EX T R1 61 0 R ETU RN1 62 0 D ATA 3 2 , 23 7 , 25 4 , 14 1 , 0 , 15 , 9 6

MICRO 13:15

Page 16: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 16/66

VISA ,1 \'D \14STER-CH 4 RGE ORDERS.4 RE80 TH -1CCEP1ED.

C1 P MF: $995!First floppy disk based computerfor under $1000! A dramatic breakthrough in price and per-

formance. Features 081's ultra-fast BA8IC-in-ROM, full graphicsdisplay capability, and large library of software on

disk, including entertainment programs, personal finance,small business, and home applications. It's a complete pro-

grammable computer system ready to go. Just plug-in a videomonitor or TVthrough an RFconverter, and be up and running.

Can be expanded to 32K static RAM and a second mini-floppy. It also supportsa printer, modem, real time clock, and AC remote interface, as well as 08-650

V3.0 development disk operating system.

LlJrnpUTEASHlJP288 Norfolk St. (Cor. Hampshire St.)

Cambridge, Mass.02139617-661-2670

590 Commonwealth Ave.Boston, Mass.02215

617-247-0700

Route 16BUnion, N.H. 03887603-473-2323

Page 17: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 17/66

A SYM·phony in Stereo

All you Symmers who are frustrated because you cannot play the music from Star Wars on your systems --take heart. Here is a program that not only plays music,but plays it in STEREO!

Excellent tune player programs for corn-puters abound, but some features of theSYM·1 make it easy to generate stereomusic and may be of interest to SYM·1owners. Such a program also illustratessome of the uses of the on-board UART's(a SY6532 and two SY6522's) and someof the SUPERMON monitor routines. Thelisting explains the procedures of theprogram, but a few comments here maybe helpful. With no attempt at makinguse of the memory at the greatest effi·ciency, each stereo note consists of f ivebytes: the duration is given by the firstbyte, then two bytes give the frequencyfor each of the two stereo tones havingthat duration. For the program given, theduration is in multiples of about 0.01second and is timed by counting down inthe 6532. The frequency bytes are placedinto the latches of the 6522's for use inthe timer 1, tree-runntnq mode. Tile6522's timers generate square-wave out-puts with a frequency based on the con-tents of the latches, The 6532 t imer corn-putes when the next 5 bytes should be

read and new values placed in thelatches.

Two subroutines allow for repeating allor part of the tune. A duration byte of$FF causes a return to the beginning ofthe tune for a single repeat of the tuneup to that point. Upon reading the $FF asecond time, the repeat is ignored andthe rest of the tune played. If the dura-tion is $00, the tune is over, but im-mediately begun again as if for the firsttime. The output port AA used by the6522 #3 is buffered and thus can drive aspeaker after putting about a 200 Ohmresistor between two points of therightmost buffer's PC holes. As shownon page 4-12 of the SYM ReferenceManual, these are points 4 and the onebetween and below points C and 7.The Aport can be buffered by one of the threeremaining on-board buffers (or one ofyour own off the board). Place another200 Ohm resistor in another set of PCboard holes and place the input signalfrom port A on the exposed wire of the

Phillip M. Rinard2019 Park Ave.

Emporia, KS 66801

on-board resistor immediately above thetransistor. The outputs to both speakersare then available from port AA (see page4-11of the SYM Reference Manual for ex·act pin numbers).

As an illustration of the stereo player, alisting of data for the "Star Wars" musicis given_ The "notes" of zero frequencyprovide brief intervals of silence be·tween notes to more realistically lrn-mitate a musical instrument. This pro-gram and data fi t into the 1K of on-boardmemory provided from the factory.Sockets for 3K more memory are pres-ent, as is a socket for a third 6522. Ifmore of this memory is used for extend-ed tunes, then additional programmingis necessary similar to that in locat ions1B through 21 where "starting" ad-dresses are changed so that as the Yregister increments up to 255 the propernote is retrieved. Obviously, an en-thusiast could expand on this type ofprogram with the SYM-1 capabilities. f . . l

REAL GRAPHICS FROM OUR VISIBLE MEMORYOver the last year and a half we have delivered hundreds of our VisibleMemory graphic display boards and customers are still finding novel usesfor them. The Visible Memory is an 8K byte memory board that is directlycompatible with the KIM/SYM/AIM computers and functions just like an 8Kmemory expansion. Its content however is also displayed on a standardvideo monitor as a 320 by 200 dot array with each dot corresponding to a bitin memory. Since each dot is individually controllable, any kind of image,even text (22 lines, 53 characters) with subscripts/superscripts is possible.Our assembly language graphics/text software package makes programmingthe Visible Memory easy. Microsoft 9·digit BASIC users now have accessto the graphics and text routines through our just released BASIC PatchesPackage. In fact, the images above were created entirely with SIMPLEBASIC programs.

K·1008A VISIBLE MEMORY $240.00OTHER ITEMS

KIM Power supply $35.00 AIM Power supply $80.00Enclosed card file for 4 boards KIM $75 SYM $80 AIM $958-bit audio system DAC-Filter-Amp. KIM/SYM/AIM $40 PET $50PET to MTU style KIM/SYM/AIM bus adaptor $79Prototyping board, f: ts In card file, 2 regulators $42We have sophisticated music and graphics software too!

P LEASE R EQUE ST OUR NEW, EX PANDED SP RING 1979 CATALOG

KIM ISYM IAIM ACCESSORIES BY MTU

16K LOW POWER MEMORYDo you want more memory for yourKIM/SYM/AIM but don't have a 5 amppower supply or fan to cool it? Our16K low power dynamic RAM board isdesigned for these processors anddraws a mere 200MA from 8 voltsunregulated and 200MA max (75 MAtypical) from + 16 volts unregulated.Our little K·1000 power supply can infact run 64K of these boards plus aKIM easily.

K·1016A 16K RAM $340.00We now have available a multifunctionsystem board for the KIM/SYM/AIMprocessors. II has a PROM capacityof 12K using the industry standard2708 PROM or 14K using the readilyavailable TI 2716. Also included is a270812716 PROM programmer, 4 para-IIel ports, and a bidirectional serialport. Low power: + 8 at 350MA, + 16

250MA.

K·1012A PROM/10 $237.00

June 1979

MICRO TECHNOLOGY UNLIMITED, 841 Galaxy Way, Box 4596, Manchester, NH 03103 (803)627·1464

M ICRO 1 3;17

Page 18: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 18/66

SYM - 1 S TEREO TUNE PLAYER

BY PH I L L I P M . R I NARDMAY 1 9 7 9

MOD I F I ED BY M IKE ROWE DU

S UP ERMa N R EF ER EN CE SR

F FAR R

ACCES S* $ 8 B 8 6 A CC ES S S UB KO UT IN E T E EOUTBYT* $ 8 2 FA OUTPUT BY TE SUBROUT INE I Q Q

OUTCHR* $ 8A 4 7 OUTPUT CHARACTER TO D I S P LAY0

ACR * $AOOBAUX IL I ARY CONTROL REG I S TERN ONE TWO

ACRX * $ACOBACR D I F F ERENT V IA 2 7 0 0 5 0 0 0 0 0 0 0 0I E R * $AOOEINTERRUPT ENABLE REG I S TER2 7 5 6 0 BC 0 3DA DI ERX * $ACOEI ER D I F F ERENT V IA 2 7A 0 5 0 0 0 0 0 0 0 0TOL * $A 0 0 6 T IMER LATCH 2 7 F 3 0 FC 0 4 F 7 0 9TOC * $A 0 0 5 COUNTER 2 8 4 0 5 0 0 0 0 0 0 0 0TOLX * $AC 0 6 T IMER LATCH 2 8 9 0 7 ED 0 5 DA Dr o c x

*$AC 0 5 COUNTER 2 8 E 0 5 0 0 0 0 0 0 0 0

S T IME * $A 4 1 E 6 5 3 2 T IMERS 2 9 3 07 A7 0 6 4 C ODRT IME* $A 4 0 4 2 9 8 0 5 0 0 0 0 0 0 0 0

2 9D 0 7 7 7 0 7E E DJOOO ORG $ 0 0 0 0 2 A 2 0 7 0 0 DO0 0 0 0

2 A 7 6 0 BC 0 3 DA D0 0 0 0 0 0 LOW = $ 0 0 LOW PO INTER 2AC 0 5 0 0 0 0 0 0 0 00 0 0 1 0 0 H IGH = $ 0 0 H IGH PO INTER 2 B 1 3 0 FC 0 4 F 7 0 90 0 0 2 0 0 RE PEAT= $ 0 0 R EP EAT C OU NT ER 2 B 6 0 5 0 0 0 0 0 0 0 0

2 BB 0 7 ED 0 5DA DTUNE TABLEPO INTERS 2 CO 0 5 DO ' 0 0 0 0 0 0

2 ( 5 0 7 A 7 0 6 4 C OD0 0 0 3 0 0 TUNES= $ 0 0 O F F SET FOR F I R S TTUNE 2 CA 0 5 0 0 0 0 0 0 0 0

0 0 0 4 7 0 F I R S T = $ 7 0 F I R S T TUNE LOW 2CF 0 7 7 7 D 7 EE DE0 0 0 5 0 2 = $ 0 2 F I R ST TUNE H IGH0 2 7 0 2 D 4 07 0 0 0 0 0 0 DO0 0 0 6 7 0 S ECOND= $ 2 F SECOND LOW 2D9 6 0 BC 0 3 DA D0 0 0 7 0 3 = $ 0 3 S ECOND H IGH0 3 2 F 2 DE 0 5 0 0 DO0 0 0 00 0 0 8 F F END = $ F F END OF TUNE TABLE 2 E 3 3 0 FC 0 4 F 7 0 9

2 E 8 0 5 0 0 0 0 0 0 0 02 E 1 ) 0 7 9 8 0 5 E 1 0 8

MA IN PROGRAM 2 F 2 0 5 0 0 n o 0 0 0 02 F 7 0 7 ED 0 5 E 9 0 7

0 2 0 0 ORG $ 0 2 0 0 2 FC 0 5 0 0 0 0 0 0 0 03 0 1 0 7 9 8 0 5 E 1 ' ( ]

0 2 0 0 2 0 8 6 8 BMA IN J SR ACCES S ALLOW WR I T I NG TO SY STEM RAM3 0 6 0 5 0 0 8 0 0 0 0 00 2 0 3 A 9 CO LDA IM $COSET ACR 6 , 7= 1 J OB 6 0 A 7 0 6 F 7 0 90 2 0 5 8 0 0 0 AO STA ACR FOR T IME 1 , F REE RUNN ING3 1 0 2 0 0 0 f l On o 0 00 2 0 8 8 0 0 0 AC STA ACRX W ITH OUTPUT ENABLED3 1 5 0 7 FC 0 4 0 0 0 00 2 0 8 A 9 7 F LDA IM $ 7 F D I SABLE I RQ 3 1A 0 5 0 0 0 0 0 0 0 00 2 0 0 8 0 OE AO STA I ER W I TH 3 1 F 07 FC 0 4 0 0 ( l 0

3 2 4 0 5 0 0 0 0 0 0 0 03 2 9 0 7 F 7 0 9 F 7 0 93 2 E F F

MICRO 13:18 J u n e11 7 9

Page 19: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 19/66

0 2 1 0 8D DE AC STA IERX I ER= 00 2 1 3 A9 0 0 LDA IM $0 0 IN I T TUNE TABLEPO INTER0 2 1 5 8 5 0 3 STA TUNES0 2 1 7 A4 0 3 REST LDY TUNESGET TUNE TABLE PO INTER0 2 1 9 B l 0 4 LDA I Y F IRSTGET LOW ADDRESS D0 2 1B 8 5 0 0 STA LOWFROM TABLE U0 2 1D C 9 FF CMP IM $FFEND OF TABLE? R

0 2 1 F DO 0 1 BNE OKAY A F F

0 2 2 1 0 0 BRK ELSE , RETURN TO MON ITORTR R

0 2 2 2 C 8 OKAY INY BUM P PO IN TER I E E0 2 2 3 B l 0 4 LDA IY F IRSTGET H IGH 0

Q Q

0 2 2 5 8 5 0 1 S TA H IGH N ONE TWO02 2 7 A 9 0 1 LDA IM $0 1 I N I T REPEAT INDEX0 2 2 9 8 5 0 2 STA REPEAT

3 2 F 1 5 F 7 0 9 F 7 0 9

0 2 2 B AD 0 0 RESETLDY IM $0 0 START THE TUNE 3 3 4 OS 0 0 0 0 0 0 0 0

0 2 2D B l 0 0 DUR LDA IY LOWREAD THE DURAT ION 3 3 9 6 0 E 1 0 8 C 1 1 1

0 2 2 F FO E6 BEQ RESTI F ZERO , RE START THE TUNE3 3 E a s 0 0 0 0 0 0 0 0

0 2 3 1 C 9 FF CMP IM $FFI F D UR AT IO N= F F 3 4 3 1 3 9 8 OS 2 E DB

0 2 3 3 DO 0 6 BNE OUTB CHECK TO SEE I F REPEAT HAS3 4 8 0 3 0 0 0 0 0 0 0 0

0 2 3 5 C 6 0 2 DEC REPEAT TEST SECOND T IME THROUGH34 °D1 3 ED OS DA DB

0 2 3 7 1 0 F 2 BPL RESETREPEAT UNT IL M INUS 3 5 2 0 3 0 0 0 0 0 0 0 0

0 2 3 9 3 0 F 2 BM I DUR CONT INUE 3 5 7 1 3 A7 0 6 4C oD0 2 3B 2 0 FA 8 2OUTB J SR OUT BY T D I S P LAY D URAT IO N3 5C 0 3 0 0 0 0 0 0 0 0

0 2 3 E AA TAX PLACE DURAT ION IN X3 6 1 1 5 7 7 0 7 E E DE

0 2 3 F C8 INY IN CREMEN T DATA INDEX3 6 6 0 3 0 0 0 0 0 0 0 0

0 2 4 0 8 1 0 0 LDA IY LOWREAD THE LOWER PORT ION OF3 6B SO7 7 0 7 E E DE

0 2 4 2 2 0 FA 8 2 J SR OUTBY T FREQUENCY ONE , D I S PLAY IT3 7 0 0 3 0 0 0 0 0 0 0 0

0 2 4 5 8D 0 6 AD STA TOL AND STORE IT IN A LATCH3 7 5 07 A7 0 6 4C oD

0 2 4 8 C 8 INY INCREMENT THE DATA INDEX3 7A 0 3 0 0 0 0 0 0 0 0

0 2 4 9 B l 0 0 LDA IY LOWREAD THE H IGHER PORT ION OF3 7 F 0 7 ED OS DA DB

0 2 4B 2 0 FA 8 2 J SR OUTBY T FREQ . ONE , D I S P LAY IT3 8 4 0 3 0 0 0 00 0 0 0

0 2 4E 8D 0 5 AD STA TOC AND STORE IT IN A LATCH3 8 9 0 7 A7 0 6 4C oD

0 2 5 1 C 8 INY INCREMENT THE DATA INDEXi 3 8E 2 0 0 0 0 0 0 0 0 0

0 2 5 2 B l 0 0 LDA IY LOWREAD THE LOWER PORT ION OF3 9 3 3 0 F 7 0 9 F 7 0 9

0 2 5 4 8D 0 6 AC STA TOLX FREQ 2 AND STORE I T : 3 9 8 0 3 0 0 0 0 0 0 0 00 2 5 7 C 8 INY INCREMENT THE DATA INDEX'391> 6 0 E 1 0 8 C 1 1 1

0 2 5 8 8 1 0 0 LDA IY LOWREAD THE H IGHER PORT ION OF3A2 0 3 0 0 0 0 0 0 0 0

0 2 5A 8D 0 5 AC STA TOCX FREQ 2 AND STORE IT 3A7 1 5 9 8 O S 9 8 0 5

0 2 5D A9 7 7 STARTLDA IM $7 7 START THE 6 5 3 2 T IMER, 3AC 0 3 0 0 0 0 0 0 0 0

0 2 5 F 8D . IE A4 S TA ST IMEON A 0 . 0 1 SECOND COUNT' 3B 1 1 5 ED OS ED 0 5

0 2 6 2 A9 0 1 REFR LDA IM $0 1 REFRE SH THE 3B6 0 3 0 0 0 0 0 0 0 0

0 2 6 4 2 0 4 7 8A J SR O UT CH R D IS PL AY 3BB 1 0A7 0 6 A 7 0 6

0 2 6 7 AD 0 4 A4 LDA RT IMEREAD THE 6 5 3 2 T IMER 3CO 1 5 0 0 0 0 0 0 0 0

0 2 6A 1 0 F 6 BPL REFR AND WAIT FOR T IME OUT3C5 0 3 7 7 0 7 DE 0 1

0 2 6C CA DEX DEC REMEN T THE DU RAT ION3CA OS0 0 0 0 0 0 0 0

0 2 6D DO EE BNE STARTRESTART T IMER I F NOT ZERO3CF 6 0 FC 0 4 3 F 0 1

0 2 6 F C8 INY INCR . THE NOTE INDEX3D4 2 0 0 0 0 0 0 0 0 0

0 2 7 0 DO BB BNE DUR 3D9 0 7 F 7 0 9 FC 0 40 2 7 2 E 6 0 3 INC TUNESBUMP TUNES PO INTER 3DE OS 0 0 0 0 0 0 0 0

0 2 7 4 E 6 0 3 INC TUNESTWICE 3E 3 0 7 F 7 0 9 FC 0 4

0 2 7 6 4C 1 7 0 2 JMP REST 3E 8 OS0 0 0 0 0 0 0 03ED 07 F 7 0 9 FC 0 43 F 2 0 0

June 1979 MICRO 13:19

Page 20: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 20/66

we have the Most complete Stock of APPLEandPETSoftware in Southern California.

(Send for our Catalog - $1.. 00)16K RAM CHIP SET FORAPPLE II Reference Books For APPLE and PET Owners

ONLY (Tested & Bumed In) . . . . . $95 00 Programming the 6502 9.95PETUser Manual {New from comrnodorei 9.95

WORKSHOPS: Call for details. First Book of KIM 8.95• PET-3rd Saturday of the Month MOSTech Programming Manual (6502) 12.00

• APPLE-4th saturday of the Month MOSTech Hardware Manual 12.00

CLASSES:APple Topicswe offer a series of classes on Apple II to aqualnt owners with some of the unique features and capabilities

of their system. rcoics covered are Apple Sounds, lOW Res. Graphics, Hi Res. Graphics, Disk Basics, and How to UseYour Reference Material. Sessions are held every Thursday Night at 7:00 o.m.

HARDWAREPET HARDWARE

• centronics 779-2 for Apple IIWith parallel Interface ' , , .. , , , ,51245.00

JOIN THE APPLE COMMUNICATION NETWORK(APPLE COM-NET)

computer components of Orange County is initiating acommunication network for all APPLE OWNERS. weneed the help of dedicated APple users. Become aCHARTERMEMBERof this APPLETEAM by helping us setup this network. Contact Dave Smith or Dwain Graham714-891-2584.

* *COMPLETECOMMUNICATIONHARDWARE*-FORYOURAPPLE * * * -S379.oo* - - *

see if you qualify for a CCI of OCP I F cardand get great discounts on selected

purchases for your Apple and PET.WHY SHOULD YOU BUY FROM US?

Becausewe can help you solve your problems and answer your questions. we don't claim to knoweverything, but we try to help our customers to the full extent of our resources.

-Prices subject to change.-

APPLE II HARDWARE:• upper .. LOwer Case BOard

Now you can display both upper and lower case characters onyour video with the APple II. Includes assembled circuit boardand sample software, , , , ' ' , ,549.95

• Programmer Aide , , '. ' 550.00PRINTER SPECIALSFOR APPLE AND PET

• TRENDCOM 100 with interface for APple or PET, , ' , , $450.00

LIMITED OUANTITYRefurbished selectric typewriters serially Interfaced fOr plUg Into APPLE II.•. _...•.• __ • . $1000.00All orders must be prepaid. Delivery In 4 to 8 weeks AROor full refund.

• Anadex DP-8000 with tracter8" paper width and APple interface , ",51050

• PET2001-8 COmputer standard PETwith integral cassetteand calculator tYpe keyboard 8K bytes of memory«7167 nen , , .. , .. , , , , , $795.00

• PET2001-16N COmputer PETwith 16K bytes of memoryand large keyboard with separate numeric pad andgraPhiCS on keys. External cassette OPtional.(15,359 neo .. , , , ' " $995.00

• PET2001-168 Computer As,above but has standard tyPe·writer keyboard. No graphiC keys ' . , ' ,'.. $995.00

• PET2001-32N COmputer Identical to 2001·16N with 32Kbytes of memory. (31,743 nen $1,195.00

• PET2001-328 Computer Identical to 2001·328 with 32Kbytes of memory. (31,743 neo $1.195.00

PERIPHERALS

• PET2021 Printer 80 column dot matrix electrostatic printerwith full PETgraphics c ao aom tv , , $549.00

• PET 2022 Printer 80 column dot matrix printer with plainpaper or forms handling tractor feed. Has full PETgraphics. , , . $995.00

• PET2023 Printer 80 column dot matrix printer. Plainpaper printer with full PETgraphiCS ' $849.00

• PET2040 Dual Drive Mini FlOPPYDisk- Dual drive intelligentmini floppy system. 343K net user storagecapacttv , , ' , . , $1,095.00

• PET2041 Single Dr ive FlOpPY Disk Single dr ive intelligentmini flOppy 171.5K net user storage , , $595.00

• PETExternal cassette Cassette player 1 recorder to use withPET 2001/8/16/32 , , , , .. $95.00

• PETuser Manual 160 page expanded user manual coveringall facets of user operation, porogramming and I/O forPE T computers. , , . , $9.95

"Retrofit kit required for operation with PET2001·8.

COMPUTER COMPONENTS OF ORANGE COUNTY6791 Westminster Ave., Westminster, CA 92683 714-891-2584

Hours: Tues-Fri 11:00 AM to 8:00 PM-sat 10:00 AM to 6:00 PM(Closed Sun, Mor»Master Cha'rge, Visa,B of A are accepted. No COD.Allow 2 weeks for personal check to clear.

Add $1.50 for handling and postage, For computer systems please add $10.00 for shipping, handling andinsurance. California residents add 6 Cic sales Tax.

Page 21: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 21/66

Sorting with the APPLE IIPart I

The first of a series of articles which will deal with sort-ing in general and on the APPLE II in particular. This in-stallment presents some background material, a com-

parison of three sorting techniques, and a program forimplementing the Shell·Metzner sort.

Whether you are maintaining complexdata bases, compiling mailing lists, orsimply keeping track of your checkbook,at some time you will need to sortrecords. There are a multitude of sortsavailable - from the agonizingly slowone in the APPLE CHECKBOOK pro-gram, through the relatively fast BASICsort, to my exceedingly fast (bya factorof 200) machine language sort. Whatmakes a sort fast , and which sort is thefastest? These are the questions I willcover in my series on exploring sortingwith the APPLEII.

Background

There have been many magazine articleswritten on sorting. The ones I based myinitial investigation on were those in theNov·Dec 1976issue of CREATIVECOM·PUTINGcovering the SHELL·METZNER,bubble, delayed replacement, and heap-sorts, and the JAN·FEB 1978issue of thesame magazine on the Buttertly-Hartsort. The first article found the Shell-Metzner and heapsorts to be a vast im-

provement over the bubble and delayedreplacement sorts. The second articlefound the Butterfly-Hart to be evenfaster. The Shell-Metzner and heapsortare replacement-type sorts; that is, therecords are compared to one anotherand replace each other according tosome unique algorhythm. They are rela-tively small in size and don't rely onmuch extra storage for their processing.The Butterfly-Hart is a linked list sort. Atree structure is built from the recordsand broken down into several smallersorted lists. These lists are then mergedto form the final result. This sort is muchfaster for large numbers of records, butis quite complex and requires extra

storage to hold the lists and tree struc-ture. For more details on how thesesorts operate, I leave you to refer to theoriginal artlcles.

I programmed each of these sorts inINTEGERBASIC and compared them bysorting various numbers of random tencharacter strings. Below were theresults.

June 1979

GaryA. Foote127Mt. Spring RoadTolland, CT06084

Table1- Sorting in BASICSORTED WORDS

SORT 10 100 500 1000

SHELL·METZNER 1 34 268 647BUTTERFL Y·HART 2 38 266 606HEAPSORT 1 35 261 600

(All sorting times in seconds)

For further exploration, I decided to usethe Shell-Metzner sort because it waseasiest to program and most compact.Many things had to be taken into ac-count before implementing this sort inINTEGERBASIC. Because of the limitedstring support in this BASIC, it is easierto store records to be sorted in memorybetween the upper end of the datavariables and the lower end of the pro-gram area, accessing them with PEEK'sand POKE's_At first, as I sorted these

records, I exchanged the actual recordsin memory when necessary. Thisbecomes very time consuming becauseforexchanging two 10character records,you must move 30 bytes (10 to a workarea, 10 from one record to the other,and 10 from the work area back to theother record). A much more eleganttechnique is to store the address of eachrecord as a member of an array.When anexchange is necessary, you need onlyexchange the addresses in the array, atotal move of 6 bytes (2 + 2 + 2) for anysize record. When the sort is complete,the addresses of the sorted records canbe found sequentially in the array. Thefirst memberof the array will point to the

lowest sorted record, and the lastmember to the highest sorted one. Therecords can be read out in the properorder quite simply, and can easily besorted in reverse order simply by readingthe array backwards. The beauty of thismethod is that the records haveneverac-tually moved and can be read in theoriginal order as simply as the sortedorder. This reduction alone increases the

speed of the sort by a factor of three fora 100 record sort, and exponentiallyabovethat.

My BASICversion is divided into severalparts. The first part generates randomcharacter strings in memory, dependingon the record size and count entered.This is for benchmark tests and can bereplaced with your own I/O routine foryour application. Line 140 actually putsthe random characters in memory, soreplactnq this line with a REM after yourfirst run allows you to test other sortingmethods while using the same records.The second part merely init ializes thememory pointer array and prints the un-sorted strings. This can also be includedin your I/O routine. The third part is theactual SHELL-METZNER sort. Theroutine can be easily changed if youwish to sort numbers in an array insteadof strings in memory. Finally, there is aroutine to print the results, and a handyroutine from CALL·APPLEfor finding theaddress of a variable in the data area.

SWEET·-16 for Size

Never being satisfied, I decided to con-tinue another step and try to program thesort routine in SWEET·16 (as all youAPPLEpeople know, a 16 bit interpreterimplemented in ROM). An excellent ar-ticle in the NOV 1977 issue of BYTE(or the BEST OF BYTE VOL 1) was mysource for SWEET·16 information.SWEET·16was 4 to 9 times faster thanthe BASIC sort, and very compact due

MICRO 13:21

Page 22: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 22/66

Page 23: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 23/66

1000101011001200130014-0015001600

170018001900191020(1)2005201.0202020302040205020603000300530103020303030403050306040004-0054010

4-02040304040

4-050

REM t~t~~t SORT ROUTINE .~t t t tREMPRINT : PRINT ~STARTING SORT~N;:NUM:M;:NM;M/2 : IF M=O THEN 1900 :K;N-M:J;1I ;JL=I~M:II~A(I) :LL;A(L)FOR X~O TO LEM·l :W~ PEEK (II .X) - PEEK (LLtX): IFweo THEN 1800 : IFW>O THEN 1700 : NEXT X: GOTO 1800T;A(I) :ACI)=A (L):A(L):T:I=I -M: IF 1>~1 THEN 15 00J;J~ l : IF J>K THEN 1300 : GOTO 1400PRINT : PRINT ~ENDING SORT~REMREM t~tt~~ PRINT RESULTS .t~~t tREMA$;~A$~: GOGUB 4000FOR X=l TO NUMT~A(X): GOSUB 30 01)NEXT XENDREMREM tt~~~~ STRING PRINT ROUTINE .t~t~~REMFOR Z;O TO LEN"lPOKE ADDR~Z, PEEK (T.Z): REM ARRAYA$NEXT Z: POKE ADDR~Z,30PRINT X,A$RETURNREMREM .~~~t FIND VARIABLE'S ADDRESSREMADDR; PEEK (74)~ PEEK (75 )t256 ·1:K= LEN(A$):J~ PEEK (204-)~PEEK C2)t2 56 -1:L;0 : IF A $(K,K)~~$" THEN 40 20 :K~K-l :L;1FOR 1=1 TO K: IF ASC(A$(I»~ PEEK CADDR+ I) THEN 404-0 :NEXTrIF PEEK (ADDR~ltL»l THEN 4040 :ADDR=ADDR~Kt4~L: RETURNFOR 1=1 TO 100 : IF PEEK (I~ADDR»l THEN NEXT 1:I=ADDR~lt l :ADDR=(I)~ PEEK (1~1)t2 56 -1IF ADDR(J THEN 4020 : PRINT "VARIABLE"'A$'~ NOT FOUND": END

Flgu,e2

1000 R~M tt t t . t SORT ROUTINE tt t t t tL010 REML100 PRINT : PRINT "STARTING SORT"1200 A$="A": SOGue 4-0001300 'POKE O,AOOR MOD 256 : POKE 1,ADDR/256 : REM STORE ARRAY ADDRE14-00 POKE 2 ,LEN: REM5TOR~ RECORD LENGTH (MUST BE< 256 )1500 POKE 4,NUM MOD 256 : POKE 5 ,NUM/256 : POKE 6 ,NUM MOD 256 : POKE

256 : REM STORE NUMBER OF RECORDS1600 CALL 768: REM CALL SORT ROUTINE1700 PRINT : PRINT "ENDING SORT"

June 1979 MICRO 13:23

Page 24: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 24/66

0301)- 1+6 070302" 66 060301+..DO 050306- A5 070308 ...O 01030A ..60030B ..38030C ..A5 04-030E" E,5 060310 ..85 OE0312 ...5 050314, E5 070316- 85 OF0318"!'A9 01031At!'85 OC031C", A9 00031E- 85 OD0320:- A5 OC{)322" 85 080324-- A5 000326,. 85 09

MICRO 13:24

1000 ~~~.~~-~---~~~-~~~~--~~~~~~~.~~~

1010 ~ SHE,LL·METZN~R SORT ~1020 ~ BV GARV A. FOOT~ ~1030 ~ COPYRIGHT 1979 ~1040 ~ COMMERCIAL RIGHTS RESERVED ~1050 ~_8.~~~~~-~~._~-__.__~.~~~~~~~~1060 ~1070 ~1080 ~1090 ~ ALL VARIABLES ARE TWO BYTES.1100 ~ THE LISTED NAME IS THE LOW ORDER BYTE.ill0 ~ THE NAMEt1 15 THE HIGH ORDER ByTE.1120 ~ EX. I ~ LOW ORDER BVTE1130 ~ It1 : HIGH ORDER BYTE111+0 ~1150 ADRA .EQ SOO1160 LEN .EQ $021170 N .EQ $041180 M .EQ $06

1190 I .EQ S081200 L .EQ SOA1210 J .EQ SOC1220 K .EQ SOE1230 PTRI .EQ $101240 PTRL .EQ S121250 ADRI .EQ $141260 ADRL .EG $161270 ~1280 ~1290 ~1300 .OR 53001310 SORT LSR Mt1

1320 ROR M1330 BNE SRT1131+0 LDA Mt11350 BNE SRT11360 RTS1370 SRTl SEC1380 LDA N1390 SSC M1400 STA K1410 LDA Nt11420 SSC M+11430 STA Kt11440 LDA f:f11450 STA J1460 LDA f:f01470 ST~ Jt11480 5RT2 LDA J1490 5TA I1500 LDA Jt11510 STA It1

Figure 3

VARIABLES AND CONSTANTS

ARRAY A ADDRE.5SRECORD LENGTHNUM OF RECORDSM

I (RECORD IIL (RECORD L)JKPTR TO ADDRPTR TO ADDRADDR OF RECADDR OF REC

SORT ROUTINE

M :: M I 2

IF M = 0

THENDONE!

J = 1

I ::~

OF A( I)OF A( L IA<l)A(L)

June 1979

Page 25: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 25/66

0328- 18 1520 SRT3 CLC0329. , A5 08 1530 LOA I L ;; I . .M0 32 8: <"6 5 0 6 15t t .0 AOC M032D- 85 OA 1550 5TA L032F- A5 09 1560 LDA 1+-10331" 65 07 1570 AOC Mf-10333- 85 08 1580 STA LH0335~ A5 01) 1590 LOA ADRA INITIALIZE PTRS0337~ 85 10 1600 STA PTRI TO ARRAY A0 339 . . 85 '2 .1610 5T~ PIRL ADDRESS0338- A5 01 1620 LDA ADRAf-10330- 85 11 1630 STA PTRI" l033F- 85 13 164-0 STA PTRL+-103t t . l " AO 02 1650 LDY ~203t t .3 - 18 1660 SRT4- CLCo3 t t . 4 - A5 10 1670 LDA PTRI PTR TO A (I ' =034-6- 65 08 1680 AOC I ADDR ARRAYA f-034-8 . 85 10 1690 STA PTRI 2 Ie I034-A· A5 11 1700 LOA PTRlf -103t t .C- 65 09 1710 ADC 1 ..03 t t .E- 85 11 1720 STA PTRlf -10350- 18 1730 CLC

0351I!'

A5 1217t t .0 LOA PTRL PTR TO A(L'

-0 35 3 . . 65 OA 1750 ADC L ADDR ARRAY A . .0355-- 85 12 1760 STA PTRL 2 ti l L0357. A5 13 1770 LOA PTRL+-10359- 65 OB 1780 ADC L"l035B· 85 13 1790 STA PTRLH0350- 88 1800 DEY DO 2 TIMES035E- DO E3 1810 BNE SRT4. (PTR DISP 15 2 BYTES'0360~ Bl 10 1820 LOA (PTRI) ,Y II : : A(I '0362 - 85 14 1830 STA ADRI0364- Bl 12 1840 LOA (PTRL' ,Y0366- 85 16 1850 STA ADRL0368- C8 1860 IN,(

0369- B1 10 1870 LOA (PTRI"Y LL.. .

A(L'.0368- 85 15 1880 STA AORIH0360- 81 12 1890 LOA (PTRL' ,Y036F- 85 17 1900 STA AORL+- l0371= 88 1910 DEY0372- 81 1t t . 1920 SRT5 LDA (ADRI"Y COMPAREONE BYTEIN0374- Dl 16 1930 CMP (ADRl) ,Y RECORDSI Ii L0376. 90 31 1940 BCC SRT8 I c L0378- DO 07 1950 BNE SRT6 I > L0371. - C8 1960 INY I iii L037B· C4 02 1970 CPy LEN END OF RECORD?0370- DO F3 1980 BNE SRT5 NO, NEXT BYTE037F - FO 28 1990 BEQ SRT8 RECORDS EQUAL

0381- AO 00 2000 SRT6 LOY~O0383- A5 14 2010 LOA ADR! A (X, ( -> A(L'0385- 91 12 2020 STA (PTRL) ,Y0387- A5 16 2030 LOA ADRL0389- 91 10 2040 STA (PTRI ' ,y038B- C8 2050 INY0 3BC; 17A 5 15 2060 LOA ADRIf- l

JUM1178 MICRO 13:25

Page 26: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 26/66

038E ..91 12 2070 5TA (PTRL),,,(

0390 - A5 17 2080 LOA AORL"l

0392- 91 10 2090 STA (PTRI),"(

039~- 38 2100 SEC0395- A5 08 2110 LOA I I .. , I - M. .0397 - E5 06 2120 S8C M

039911'85 OB 2130 STA I039B- A5 09 21LtO LOA 1"10390- E5 07 2150 S8C MH

039F· 85 09 21605TA IH

03Al· 90 06 2170 BCC SRT803A3 ... 0 83 2180 SRT7 8NE SRT3 IF I > 0 THEN STR3

03A5· A5 08 2190 LOA I03A7 ..DO FA 2200 BNE SRT7o3M) ... 6 DC 2210 SRT8 INC J J = J +- 1

03AB- 00 02 2220 BNE SRT903AO~ E6 00 2230 INC J"l03AF- A5 OF 22~0 SRT9 LOA 1<"103Bl- C5 00 2250 CMP J+-l IF J > I<

0383- 90 aB 2260 Bce JMP2 THEN SORT

03B5· 00 06 2270 BNE JMPl ELSE. SRT1.

03B7 ... 5 OE 2280 LOA I<

03B9- C5 OC 2290 CMP J03B8- 90 03 2301) BCC JMP20380 ..~C 20 03 2310 JMP1 JMP $RT2 CHANGE IF RELOCATED

03CO ...tC 01) 03 2320 JMP2 JMP SORT CHANGE IF RELOCATED2330 .EN

:$300.3C2

1J300- Lt6 07 66 06 DO 05 ~5 070308::- DO 01 60 38 A5 O~ [5 060310 .. 85 O E . A5 05 E.5 07 85 IJF031B~ A9 01 85 OC A9 00 ~5 000320 II' AS OC 85 08 A5 00 95 09

0328- 18 A5 08 65 06 B5 O A A5 S,,(M80L TA8LE0330 .. 09 65 07 85 06 A5 00 850338- 10 85 12 A5 01 85 11 85 ADRA oaoo LEN 001)2 N OOO~

0340 - 13 AO 02 18 A5 10 65 08 M oa06 I 00a8 L OODA

0348- 85 10 A5 11 65 09 85 11 J OOOC I< DoaE PTRI 0010

0350- 18 A5 12 65 OA 85 12 A5 PTRL 0012 AORI 001~ AORL 0016

0358- 13 65 OB 85 13 88 DO E.3 SORT 03ao SRTl 030B SRT2 0320

03601:'61 10 85 1~ 81 12 85 16 SRT3 0328 SRT~ 03~3 SRTS 0372

0368- C8 Bl 10 85 15 61 12 85 SRT6 0381 SRT7 03A3 5RT.B 03A9

0370 .. 17 88 Bl 1~ 01 16 90 31 SRT9 03AF JMPl 0360 JMP.2 03CO

0378- DO 07 C8 C4- 02 DO F3 FO0380 - 28 AD 00 A5 1Lt 91 12 A50388- 16 91 10 C8 A5 15 91 120390 C I' A5 17 91 10 38 A5 08 E50398- 06 85 08 A5 09 E5 07 8503AO::l 09 90 06 D O 83 A5 08 DO03A8- FA E6 OC DO 02 E6 00 AS0360- OF CS 00 90 08 DO 06 11.50368- DE C5 DC 90 03 ~C~O Q~ c.H/II-IGL IF e.£~TE-/)03CO - 4C \00 o~•MICRO 13:26

June 1979

Page 27: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 27/66

A T L A S TE N H A N C E T H E F U L L C A P A B I L I T I E S O F Y O U R D I S K I I

SOFTOUCH ANOUNCES THE

.. D IS C MANAGEMENT SYSTEM "EIGHT PROGRAM S ON D ISK TO PROVIDE THE USER WITH ACCM PL ETE U ND ER STAN DIN G OF TH E D IS K D RIV E COMM AN DSPL US A U TI L IT\' PACK AG ETO IN D EX AND CATAGO RI Z E A LLP RO GRAM S WRITTEN F OR TH E A PP LEII CCM PU TER. TH ESYS TEM PROV ID ES FU LL S EARCH , ED ITIN G AN D D ATATRANSFER CAPABILITIES .

A TW EN TY-S IX PAG E B OOKL ET P RO VID ES D ETA IL ED ,E DU CATIO NA L TEC HN IQ U ES G IV IN G A TH ROUGH UNDER STA ND -IN G OF AL L D OS CCl+lAN DS.

IN CL UD ED AR E S UCH TECH NIQ UES A S:• INITIALIZATION OF TEXT FIL ES• WRITING & READ IN G OF TEXT FI L ES• CREATING TEXT FI LES• EDITING FILES• TR AN SF ER RIN G D ATA TO OTH ER D IS KETTES• L ISTING OF DATA FI LES• SEAR CH IN G D ATA BY VARIOU S OPTION S

A D OCUMEN TED L IS TIN G P RO VID ES L IN E CH AN GES F ORADA PTIN G TH E S YS TEM TO P REF ORM NUMEROU S O TH ERAPPLICATIONS.

THE BOOKLET IS W RITTEN IN A M AN NER W HICH M AY BE USEDBY TIlE N OV ICE A S W EL L AS TH E EXP ER IEN CED P RO GR AMM ER .D OZ EN S OF P ROG RAI+IIN G TECH NIQ UES AR E S HOW N A ND F UL LYD OCUM EN TED . AL SO IN CL UD ED S EPAR ATELY, IS A P RO GR AMM ER SAID G IV IN G Q UICK REFEREN CE TO IN TEG ER, APPL ESOFT AN DDOS COMMAND SW ITH I L L U STR ATlV E EX AM P LES .

S YS TEM R EQU IR EM EN TS : D IS KII & APPL ESOFT TAPE OR ROM CAR D

PRICE $19.95 (P RO CES SED !; S HIP PED W IT HIN4 DAYS)

S EN D CH ECK OR M CN EY OR DER TO:

SOFTOUCHP.O. BOX 511LEOM INSTER, M ASS .01453

t""P/-. -=:::c~ YGMY

I :~JPROGRAMMINGuln~J • A pP LE S OF TWA RE *di J = "P.O. BOX 3078 • SCOTTSDALE, ARIZONA 85257

APPLE-SCRIBE-2 disk or cassette $49.00(Word processor with any length line,printing in any shape or form. Requires 16kor larger system)

APPLE-OMS 48k & disk required $49.00(Universal data management system)

UNLISTABLE-BASIC disk required $39.00

(Make Integer BASIC listings unintel-ligable)

BCOPY disk & 16, 32 or 48k $19.00(Single disk drive binary file copier)

DEFLECTIONS disk or cassette(Real time color graphics game)

$10.00

Custom programs. , . write for details!

A P P L EI I ®OWNERWest S ide E lectr on ic s i ntr oduces the

APPLETIMETM,a R ealnmeC lo ck f or th e App IenThe Applet ime (Model APT·1) is a single peripheralboard which plugs directly into any 1/0 slot on theApple II. Timing is done completely in hardware (ie.

NOT an interrupt dr iven clock). Thus, the Applet imecontinues to operate even when the computer is turnedofL Our exclusive Three Way Power System keeps theclock running via it s own AC supply, the computer's,or battery backup in case of power failure, Otherfeatures include 12/24 Hour select ion, AC or crystaltimebase, 50/60 Hz, and BCD or ASCII dat a format.Fullyassembled and tested, with instructions and

APT·1Real Time Clock $79.95

Proto- .... . for Apple II. Over 1300 holes on 0.1 inchcentersfor designing your own circuits.

API·I Prototyping Board , $16.95

VERBAT IM 51/.. " D ISKETTES $34.50Soft sector, in plastiC file case. Box of 10

WE S T S ID E E L EC T R O N IC SP.O. 10.636

CHAnwOnH , CA. 9 13 11We pay a/l shipping in Continental U.S.A.

Others add 10%; California residents add 6 % tax:

APPLE 11SOFTWARE

Tabular 4-Way Number ConverterInteger BASIC (BK min) $3.50

Apple Pi Life (4K min) $5.00

Agenda (16K min) $5.00

HIRES Shape Encode (16K min) $5.00

Integer BASIC Floating PointInterface (2K Machine Code) $6.50

Each program completely documented.Prices Include postage and handling.Send SASE for Software List today!Send check or money order to:

Mlcrospan Software2213A Lanier DriveAustin, TX 78758

(Texas residents add 5% sales tax)

Page 28: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 28/66

Streamlining the C2·4P

Here are three modifications you can make to your OSIC2·4P to raise its speed, increase the cassettethroughput, and add reverse video to the display.

I amconcerned by the paucity of articleson 051 computers in MICRO and hopethat this will reversethe trend. I feel thatthe Challenger 2-4P running speed andeaseof modification more than offset itsshortcomings. I will describe three modi-ficiations I have made, mainly. raisingthe CPU clock rate, raising the cassettedata rate, and reversing the videopresentation.

Raising the CPU Clock Rate

My computer is happily working with aclock frequency a little under 2 MHz(1.9648actual, 1.96608nominal) in placeof half that, which is the way it was de-livered. The CPUclock is taken from thevideo timing chain, which uses a crystaloscillator near 12MHz.a divide by three.and then a series of binary diViders toform 15,360 and 60 Hz sync pulses. Itwas only necessary to move the CPUclock takeoff one stage higher in thetiming chain. To do this, move thejumper wire coming from bus pin #18offIC #E4 pin #13,and onto pin #14. If youintend to make this change,use a small,low power, preferably grounded solder-ing iron, as recommended for all ICwork.Another word of caution: make a long,thorough shakedown run of severaloperational programs looking fordropped bits from memory. I did thissince I have two RAM chips marked"550" (presumably not fast enough toqualify as 450nsec.), but there was abso-lutely no hint of dropped bits. Instead,I have very snappy video display opera-tion, slightly fast keyboard repeat, and,best of all, running times cut in half. Amachine language LIFE program up-dates a full screen of 1792cells 14timesa second!

Doubling the Bit Rate

I successfully doubled the bit rate of mycassette interface from 300to 600 baud,after speeding up my CPU. I naturallytried 1200baud; while it seemedto readproperly, the load program seemed tochoke up on very long (64 to 71 charac-ter) lines sometimes and miss the CRand next line. The 555 IC oscillator fre-quency is doubled from 4800to 9600Hzby substitutiong a 0.01mfd capacitor forthe 0.022and then adjusting the trimpot.

MICRO 13:28

A frequency counter is a big help, if noteSsential. Since the tone frequenciesshould remain at 1200and 2400 Hz, anextra divider is needed. The unusedhalf of the 7474already in the interfaceworks nicely, or you can install a 74163in the convenient prototyping vacantspace, and get several baud rates forprinters and the like. Rate selection canbe conveniently brought to a switchmounted to the left of the keyboard.Figure 1 shows the circuit using the7474.I have found "reversed" video to bemuch easier to view for extendedperiods. Also, the black "reversed"characters have less apparent intensityvariation, that is, they look evener. Thereversed video connection is indicatedin the schematics, but there is no pro-vision made in the printed wiring, so thatit is necessary to cut a printed con-ductor. The junction of R 11and R23 is

James L. Cass19559Tulsa Street

Northridge. CA 91326

moved from Pin 8 to Pins 9·10-11of theIC at 04. I installed a switch near thekeyboard with short, direct small wires,but find that I could have left the wiringat "reversed" with no loss.

Conclusions

Doubling the CPU ctock rate and hencethe speed of the C2-4Pis quite easy todo. The main risk is that some 2114type RAM chips may be too slow. Thedata rate in the cassette interface canbe doubled to 600 baud, but only withsome effort and decrease in reliability;1200baud does not work. Reversing thevideo to display black characters onwhite is relatively Simple and the re-versed video format is preferred byeveryone. Cassette speed selection andnormal-reverse video are convenientlybrought to switches installed near thekeyboard.

~

FROMU13-555PIN 3

+5V

lK

BREAK --;,

......_ _ +-...... 00

TO 6850300 ACIABITRATESWITCH

10

13,l

U 237474

7 47 4 C IRCU IT

Figure 1

June 1979

Page 29: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 29/66

6502 INFORMATIONRESOURCES UPDATED

A list of regular publications which have material ofinterest to 6502users.

WI lliam R . D ia l438 Roslyn Ave.Akron, OH 44320

Did you ever wonder just what magazines were therichest sources of information on the 6502 micro-processor, 6502-based microcomputers, accessoryhardware and software? For several years this writerhas been assembling a bibliography 6502 references re-lated to hobby computers and small business systems.The accompanying list of magazines has been corn-

MICRO$15.00 per year

MICROP.O. Box 3S.Chelmsford, MA 01824

502 USER NOTES$13.00 per6 issues

Eric RehnkeP.O. Box 33093Royalton, OH 44133

OHIO SCIENTIFIC - SMALL SYSTEMS JOURNAL$6.00 per year (6 issues)Ohio Scientific1333S. Chillicothe Rd.Aurora, OH 44202

PETGAZETTEFree bi-monthly (Contributions Accepted)Microcomputer Resource Center1929 Northport Drive, Room 6Madison, WI 53704

Robert Purser's REFERENCE LIST OF COMPUTERCASSETTESNov. 1978$2.00/Feb 1979$4.00Robert PurserP.O. Box 466EIDorado, CA 95623

THE PAPER (PET)

$15.00 per year (10 Issues)The PAPERP.O. Box 43Audubon, PA 19407

THE CIDER PRESS (APPLE)Scot KaminsBox 4816San Francisco, CA 94101

June 1979

piled from this bibliography. At the top of the list areseveral publications which speclallze in 6502-relatedsubjects. An attempt has been made to give up-to-dateaddresses and subscription rates for the magazinescited. Subscription rates are for U.S. Other countriesnormally are higher.

STEMS FROM APPLEKen HoggattAPPLE PORTLAND PROGRAM LIBRARY

EXCHANGE9195 SW EIRose CourtTigard, OR97223

APPLE SEEDBill HydeThe Computer Shop6812San PedroSan Antonio, TX78216

KILOBAUD/MICROCOMPUTING$18.00 per year

Kilobaud MagazinePeterborough, NH 03458

BYTE$18.00 per year

Byte Publications, Inc.70 Main St.Peterborough, NH 03458

DR. DOBB'S JOURNAL$15.00 peryear(10 issues)

People's Computer Co.BoxE1263EICamino RealMenlo Park, CA 94025

ON·LlNE$3.75 per year (18 issues)

D.H.Beetie24695 Santa Cruz Hwy

Los Gatos, CA 95030RECREATIONAL COMPUTING(formerly PEOP-LE'SCOMPUTERS)$10.00per year (6 issues)People's Computer Co.1263 EICamino RealBoxEMenlo Park, CA 94025

MICRO 13:21

Page 30: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 30/66

INTERFACE AGE$18.00 per year

McPheters, Wolfe & Jones16704Marquardt Ave.Cerritos, CA 90701

RAINBOW (APPLE)$15.00 per year

Rick Simpson and Terry Landereau, EditorsP.O. Box 43Audubon, PA 19407

POPULAR ELECTRONICS$12.00peryear

Popular ElectronicsOne Park Ave.New York, NY 10016

PETUSERNOTES$5.00 per year (6or more issues)

PETUser GroupP.O. Box 371

Montgomeryville, PA 18936

PERSONAL COMPUTING$14.00 per year

Benwill Publishing Corp.1050Commonwealth Ave.Boston, MA 02215

73 MAGAZINE$15.00 per year

73, Inc.Peterborough, NH

CONTACT - User Group NewsletterGratis to Apple owners

10260 Bandley DriveCupertino, CA 95014(408)996~1010

SOUTHEASTERN SOFTWARE NEWSLETTER(APPLE)10 issues $10.00George McClellandSoutheastern Software7270Culpepper DriveNew Orleans, LA 70126

CREATIVE COMPUTING$15.00 per year

Creative ComputingP.O.Box 789·MMorristown, NJ 07960 COMPUTER MUSIC JOURNAL

$14.00 per year (6 issues)People's Computer Co.Box E1010Doyle St.Menlo Park, CA 94025

POPULAR COMPUTING$18.00 per year

Popular ComputingBox 272Calabasas, CA 91302

SSSCINTERFACESouthern California Computer Soc.1702AshlandSanta Monica, CA 90405

EON (Electronic Design News)$25.00 per year

Cahners Publishing Co.270 St. Paul St.Denver, CO80206

RADIO ELECTRONICS$8.75 per yearGernsback Publications, Inc.200 Park Ave., SouthNew York, NY 10003

MINI·MICRO SYSTEMS$18.00 per yearModern Data Service5 Kane Industrial DriveHudson, MA 01749

a ST$12.00 per year

American Radio Relay League225 Main St.Newington, CT 06111

IEEEComputerIEEE345 E. 47th St.New York, NY 10017

DIGITAL DESIGN$20.00 per year

Benwill Publishing Corp.1050Commonwealth Ave.Boston, MA 02215

ELECTRONIC DESIGN(26 issues per year)

Hayden Publishing Co., Inc.50 EssexSt.Rochelle Park, NJ 07662

POLYPHONY$4.00 per year

PAIA ElectroniCS, Inc.1020W.Wilshire Blvd.Oklahoma City, OK 73116

CALL A.P.P.LE.$10.00 per year (includes dues)Apple Puget Sound Program Library Exchange670839th Ave. SWSeattle, WA 98136

MICRO 13;30 June 1979

Page 31: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 31/66

The Color Gun for the Apple II

With some quite inexpensive hardware, you can turnyour APPLE II into a color detector .. a device which willautomatically determine the colors of any object.

Shortly after I developed my light pen forthe Apple back in May, 1978, I beganthinking about other devices that couldbe hooked up to ttie paddle inputs. Oneidea was making a "color gun" whichwhen pointed at an object would tellyou the color. The idea is similar to thatof the operation of a television transmit-ter. Color is broken down into three maincolors, which are red, blue, and yellow.Therefore by having three inputs intothe Apple, into paddle 0, paddle 1, andpaddle 2, we could in effect have a de-vice that would "see" the three colorbreakdown ratios of any object. By fur-ther analysing this rat io, we could seedifferent shades of color and with highquality color filters, we could make anextremely accurate device which couldeven give the exact color temperatureof the object. One of the interesting as-pects of this device that sets Ie apartfrom any other color temperature meter,is that you can calibrate it by pointing itat a piece of white paper to adjust fordifferences in the light source. There-fore, the color gun will work in any typeof artificial lighting within certain para-meters (you could not use it under a redlight for example).

Building the Color Gun

To start off with, buy three sensitivecadium sulphide photo cells (physicallybetween 1/4 to 1/2 inch in diameter). Ifthe cells are not equal in sensitivity, theycan beequalized easily in software. Thisis illustrated in the listing. Merely pointthe gun at a white piece of paper (or atthe light source itself if its not too bright)during the calibration procedure. Theconstruction of the gun is very simple.Mount the three cells in a triangle about2" for eachsideon a piece-otwoodOrvfhermateriaL Then placethree filfersover the cells, with red on paddle (0)cell, blue on paddle (1) cell, and yellowon paddle (2)cell. The purer the filter, thebetter. Photographic filters are the best,and will give the best results. However,red, blue or yellow clear plastic will worksatisfactorily in most situations. Notethe use of the REM statements in theprogram. Theseare for slowing down thepaddle readings just a hair in order toavoid having the readings "overlap". Thewiring diagram is shown in Figure 1.

June 1979

Mount the entire setup in some type ofbarrel or cylinder about 4 inches long,with the inside of the barrel paintedwhite, and glue everything together andseal against light leaks. Plug it into thegame paddle after the wiring is completeand you ready to go. For the pin numbersof the paddles, consult your red manual.

The Color Gun Program

Type the program into the Apple in Ap-plesoft 2 and run. The gun will onlyrecognize 6 colors, and when it isn't surewhat the color is, it will give you twocolors (one primary color and one sec-ondary). This should not happen if thecolors are absolutely pure, but mostcolors are not, so expect this situationmore often. Notice the correction al-gorithm in statement 70 in the programto correct for the blue cell. Thecells thatI used were somewhat more sensitive toblue than the other colors (which is com-mon of cadium sulfide). This was noticedwhen the color gun kept saying "orange"(the compliment of blue). The correction

Red

Nell D. Lipson29S. New Ardmore Ave.Broomall, PA 19008

algorithm elimates most of this problem.If the gunacls strangely, runft againuntil it gests a good calibration. It some-times takes more than one run to get itworking properly (usually because it isconfused bya bright color nearby).

By fine tuning the software, and usingmore exact rat ios, you can determinemany other colors. Given enough ratiosto choose from, you can give the colortemperature of the object (with highquality cells and filters). The typicalphotographic filters you can use are theyellow (K2), the red (25 or 25A) and theblue (47).These may be varied if desiredto meet the spectral response of theparticular cell you buy. You could evenuse different colors in the filters as longas you adjust the software accordingly.Buy the smallest filter you can (it onlyhas to cover about 1/2 inch diameter),but make surethere is no light leak fromthe sides of the·cells. If you follow thes-einstructions, the gun will work perfectlythe first time around. Havefun!

Blue YellowI

5V pdl '0' pdl'1' pd. '2'Figure'

MICRO 13:31

Page 32: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 32/66

1 CALL - 9 3 62 VTA8 1 0 : HTA8 1 0 : PR INT "COLOR

GUN 8Y NE IL D . L I P SON "3 HTA8 1 5 : PR INT "COPY R IGHT 1 9 7 9

"4 HTA8 1 2 : PR INT "ALL R IGHTS RES

ERVED " : FOR I = 1 TO 2 0 0 0 : N EXTI

5 REM ' 0 ' RED6 REM ' 1 ' 8 LUE7 REM ' 2 ' Y ELLOW10 CALL - 9 3 61 5 R EM Y EL LOW, BL UE ,R ED2 0 PR INT : P R INT : PR INT PR INT

2 5 GOSU8 1 0 0 03 0 CALL - 9 3 6 : PR INT PR INT3 2 A = POL ( 0 )3 5 REM4 0 8 = POL(l)4 5 REM5 0 C = POL ( 2 )5 5 REM6 0 A = A* A l6 1 8 = 8* 8 16 2 C= C * C l7 0 8 = 8 / 1 . 51 0 0 PR INT "RED CELL = " ;A1 1 0 PR INT " 8LUE CELL = " ; 81 1 5 PR INT "Y ELLOW CELL = " ; C1 1 6 PR INT : PR INT1 1 7 PR INT "THE COLOR I S : " : PR INT

1 1 8 PR INT " * * * * * * * * * * * * * * * * * * * * *

"1 2 1 I F C< 8 AND C< (A ) THEN PR INT"YELLOW"

1 2 3 I F A< 8 AND A<C THEN PR INT" RED "

1 2 4 I F A > 8 AND A> C THEN PR INT"GREEN "

1 2 5 I F 8 > A AND 8 > C THEN PR INT"ORANGE "

1 2 6 I F C < A AND C > 8 THEN PR INT" PURPLE "

1 2 9 I F 8 < C AND 8< (A ) THEN PR INT" 8LUE "

1 3 0 PR INT " * * * * * * * * * * * * * * * * * * * * *"

1 3 1 FOR X = 1 TO 2 3 0 0 : N EXT X1 4 0 GOTO 3 02 0 0 END

MICRO 13:32

1 0 0 CALL - 9 3 6 : PR INT1 0 1 0 PR INT " PO INT GUN AT A WH

SHEET OF PAPER "1 0 2 0 FOR I = 1 TO 1 5 0 0 : NEXT I1 0 3 0 A l = POL ( 0 )1 0 3 5 REM10 4 0 B l = POL ( 1 )1 0 4 5 REM10 5 0 C l = POL ( 2 )

1 0 5 5 PR INT "A l = " ; A l1 0 5 6 PR INT " 8 1 = " ; 8 11 0 5 7 PR INT "C l = " ; C l1 0 6 0 0 1 = A l* 8 1 * C l1 0 7 0 A l = 0 1 / A l1 0 8 0 8 1 = 0 1 / 8 11 0 9 0 C l = 0 1 / C ll l OO PR INT "CORRECT ION FACTOR

R RED = " ;A l1 1 1 0 PR INT "CORRECT ION FACTOR

R 8LUE= " ; 8 11 1 2 0 PR INT "CORRECT ION FACTOR

R Y ELLOW= " ; C l1 1 2 5 FOR I = 1 TO 2 0 0 0 : NEXT I1 13 0 R ET UR N1 0 0 0 0 END

Whr......... hr F-8, .... , .... ,lOIS, u., 6S1l,. .... I~ .HZ.

The EP·2A·79 will program the 270<1,2708,TMS 2708, 2758, 2716, TMS 2516, TMS 2716,TMS2532, and 2732. PROM type i , selected bya personali ty module which plugs into the frontof the programmer. Power requirements are 115VAC, 50/60 HZ at 15 watts. It is suppl ied with a~inch r ibbon cable (14 pin plus) for connect ing

to microcomputer. Requires 1 'h I /O DOrtS.Anembled and telted $145, Plul $15-25 fo reach petlOnality module. SpecIfy software.

OPTIMAL TEC.IOLOGY, IIC.......... 127, EwIy . .. . V.. DtH

,._ ..... 73-5412

June 1979

Page 33: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 33/66

Software:

PROGRESSIVE SOFTWAREPRESENTS SOFTWARE AND HARDWARE FOR YOUR APPLE

SALES FORECASTThis progr am will give you the best lorecast using the lour moat popular l or ecastl ng techniques, such as linear regr essi on,l og t rend. power curve tr end. and exponent ial smoothing. The pr ogram uses anl ficial inteiligenca to make t he decision ont he beat fi t, and displays all result s f or manual opeatlon Ifdellr ed. Wr itt en by Nell D. Upoon. requlrel18K memory.

CURVE F ITWill take any number 01 data polntl In any laslon, and give you the choice 01 having the computer choose the tiestcurve fit, or you may choose yourself what type of fit you desire. The lour given are log curve fit. exponential curve fit.l ea st SQua re l. a nd power cu rv e f it . The r esu lt s a re t hen g raphed. Wri tt en by Dave Ga roon, r equ ir es 18K memory.

CALENDARThis progr am wi ll perlorm two functions: days between dat es ( any two dates) or a perpet ual calender . If t he c al endar. I schosen, It will automatically give the succelsl .. monthl by merely hitting the return key. May be u8ed with or without apr in te r. Wri tt en by Ed Han ley, r equi res 18Kmemory.

STARWARSThe o ri gi na l a nd bes t s tarwar a game. w ri tt en by Bob Bllhop. You fire upon the tie fighter after aligning the fighter in yourclosshalrs. Thi s II a high resolution game I n c olor that usel t he paddles. Requir es 18K memory.

ROCKET P ILOTThis II an exciting game where you are on a planet taking off with your rocket shiP. trying to fly over a mountain. Thesimulation 01 the rocket bl al 1ers actuall y accel erate. you up, and Ifyou are not carelul, you wi ll run out of Iky. The contourolt he land changes each tlmayou play t he game. Writ ten by Bob Bishop, requires 18K memor y.

S PACE MAZ EThis game puts you in a maze with a rockey .hlp, and you try to "l1eer" out of It with your paddles or joysti ck. I t's a realchall enge. I t I s d one I n high r eoolutlon gr aphics In color, done by Bob Bishop. Requir es 18K memory.

SAUCER INVASIONThis pr ogram was wr itt en by Bob Bishop. You are being Invaded by a flying saucar and you can shoot at It with your

mlsl ile and contr ol the position with your paddle. ReqUir es 18K memor y.

MISSILE·ANTI.MISSILEMlssII.Antl·Mlaslle Is a high reaclUlion game. The viewer will 888 a target appear on the acraen, followed by s 3 -dimenSional digit al dr awing of the Uni ted States. Then a small submar ine appean. The submari ne Is contr ol led by hOotileforces ( upon pressing the space bar) which launches a pr.. ."., pt lve nuclear str ike upon t he United Stat88( cont rolled bypaddle No.1). At the time that the mls.lle Is fired Irom the submarine. the United States launches Its own antl·mlsslle(t he antl ·mlssll el s cont rolled by paddle No. 0). There are many level. of play depending upon the speed. Written by DaveMot el es and Nel l Ll poon. Requi re s 18K memory.

MORS E CO DEThis program allows the ueer to leam morae code by the user typing In letters, words or sentences In english. Then thedots and dashes are plotted on the .creen. At the same time aounds are generated to match the screen's output. Severalt ra nsmi ss ion spe ed l eve l. ar e avai lab le . Wri tt en by Ed Handl ey. Requi re s 18K memory.

P OL AR COOR DIN A TE P L OTA high r eoolut lon gr aphics pr ogram which pr ovides t he user with 5 pr imary c la sa lc pol ar coo rd in at e p lot s and a method bywhich the user can Insen his own equallon. When the user's equation Is Inserted Into the program It will plot on anumbered grid and then Immediately after plotting. flash, In a table lorm, the data needed to construct suCh a plot onpapar. The prog ram t akes 18K 01 memory and ROM board. Wri tt en by Dave Mot el .s .

U TIL ITY PAK 1This IS.a combinalion 01. programs: (by Vince Corse t11)

Integer to Applesof t Conversion ·t hls pr ogram wil l convert any I nt eger basic pr ogram to an applelOft progr am. Af ter youfinished, you merely correct all olthose syntax er rors that occur with appleaoft only.Di Sk Append· wil l append any two Integer progr ams Ir om a disk I nt o one progr am.Integer Basic Copy· allows you to copy an Integer baalc program Irom one disk to another by merely hitting return.Uselul when copyi ng the same pr ogram many times.Updat e Appleaolt • w il l corr8C1 Appleaoft on t he disk t o eliminate the headi ng that alwsys occur s when It I s I niti all y r un.Binary Copy· thl. program copies a binary llie Irom one disk to another by merely hitting return. It automat ical ly f indst he l eng th end s ta rt in g addr e. e o f t he p rogr am for you r conveni en ce .

BLOCKADETwo peopl e tr y to block each other by bui ld ings wal ls and bl ocki ng t he ot he r. An exci ting game wri tten In Integer ba.lc f or18K. Written by Vince Corsetti.

TABLE GENERATORIs a program which lorms shape tables with ease. Shape tables are formed lrom directional vseto", and the program alaoadds other Information such as starti ng address. length and posi tion 01 ea ch shape. The t ab le gener at or .lIowa you tosave the ehape table In any usable locatloq In memory. It Is an appleaoft program. Written by Summary Summers.Price: $11.95

All Program ••..••.. ".96 EACH

All Program •• ,. 11K unl. .. . paclfled.

HARDWARE:

L IGH T P ENI nc lude s 5 prog rams. I .l gh t Met er , wh ich gi ve s you r eadi ng 01 light every Iractlon 01 a seoond Irom 0 to 588. The light graphwill gr aph the value 01 l ight hit ting t he pen on the acreen. The light pan will "draw" on the acreen points which yoU havedr awn and t hen conn8C1 t hem. II wi ll al lO give t he coordinat es of t he poi nt s If desi red , d rawn In kHes. The lourth programwill do the same except draw II In hl . ..es. The fifth program Is a utility program that a'iowe you to place any number 01points on the screen lor use In menu eeieCtlon or In gamee,and When you touch this point, II will chOoee It. II Is notconfuSed by outside light, and usee artificial Intelligence. Only the hi ..... light pen requ'res < 4 8 1 <and ROM card.Written by Nell D. Llpaon.

Light P.n .upported by &program •••... _.

Send Check or M.O.t o P.O. Box 273, Ply. Mt g. , PA 111482 Program,Accep ted l or Publ ica ti on -H lgheet Roya lt y Pai d

Po8tage and Handli ng· Add SI.00 l or f1ret I tem then 50' l or . . ch add" PA Aeaidents Add 8% Sales Tax

Page 34: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 34/66

ASK the Doctor - Part VReading KIM Tapes on the AIM and SYM

The Doctor discusses some problems that arise in tryingto load KIM format cassette tapes on the AIM or SYM,and "with a little help from his friends" presents a shortroutine to get by the SYM "2F" loading bug and a sub-routine which mimics the KIM SCANDS routine on theSYM.

Reading KIM Tapeswith the AIM

The AIM 65 has two speeds for readingthe KIM format tapes. The normal KIMtape records at about B 1/3 charactersper second. Early in KIM history, Jim But-terfield published "Hypertape", a pro-gram that permits KIM formats to bewritten at higher rates: 2 times, 3 timesand even 6 times the normal KIM rate -and still be readby the regular KIM moni-tor and hardware with no changes! TheAIM 65 people recognized the value ofthe higher speed KIM rates and madetheir monitor capable of loading either 1time or 3 times KIM tapes. (The full 6times would have been very nice, but Iguess we can' t have everything.) TheAIM documentation is very vague aboutusing these KIM formats. To use the KIMloader, you must first set a "user alter-able" RAM location A40B as tonows:

C7for normal AIM format tapes5Afor normal KIM format tapes58 for 3times KIM format tapes

On power up, C7 is automatically set, sothat the AIM format isthe default, asonewould expect. The A40B location mustbe set by the user manually to the cor-rect KIM speed value before calling onthe tape load or dump routines. Thismust be reset either manually or by apower up reset to return to the AIMformat. If you do not have the correctvalue in A40B for what you are trying todo, it will not work and, in general, willnot give you any indication that i t is notworKing. The KIM Toader/6r DumpeTlsinvoked by specifying "K" as the I/Ode-vice.

Now tha. you finally understand how touse the AIM to load a KIM tape, you setA408 to 5A for a regular KIM tape whichhas your favorite program and run theAIM Load specifying K for the input de-vice, the program identifier that youused when you recorded the tape as thefile name,and the correct tape unit. Yousit back and wait for the load to com-plete. But what's this! The AIM is sud-denly in some strange state! It may besaying "OUT =" which does not"makesense, or even worse ma, be dumping

MICRO 13:34

reems of paper out of the printer! Whathappened? What happened was thatyour typical KIM program which usesall available memory on the KIM - lo-cations 0000 to 03FF - has found asmall problem with the AIM KIM formatload program. The problem is theSTACK. The programmers who develop-ed the KIM monitor were super-smart inrealizing that, given the very limited on-board memory of the KIM, users wouldoften want to load ALL of the RAM, from0000 to 03FF, right over page zero andpage one - stack all. They made theKIM load and dump routines work with-out using page zero or page one in anyway that would not interfere with data inthose pages. You might want to examinethis code sometime in the KIM monitorlistings, as it is quite instructive. TheAIM programmers were only smart aboutthe KIM format - not super-smart. Theygave the multiple speeds, but did notwrite the loader is such a way that itcould load over the page one stack. So,the loader works fine until it hits thestack that is being used by the loaderitself. Then, it SELF DESTRUCTS! Itover-writes a return address in the stackand then returns to "never-never-Iand".Where it goes will depend on the byteof data that over-writes the stack. I donot know of any simple solution to thisproblem. You can, of course, divide yourKIM program into two portions: 0000to 01FO (or there abouts - I think itbombs at about 01FB but have not doneany detailed testing), and 0200 and up.This assumes that you have access to aKIM. If not, my friend, I am afraid youhave a real problem.

ReadingKIM Tapes with theSYM

The SYM monitor bug which causesloading of KIM tapes to abort when it

encounters a "2F" has been document-ed In previous columns, is "cured" bySkov's program, and Is fixed in the newSYM SY1.1 version of the monitor. Itwill not be discussed here.With the "2F"bug fixed, the SYM stili has probJemswith reading KIM format tapes. The prob-lem Is .the same as discussed with theAIM above. It can NOT load over the endof the Dage one stack. The SYM has an

Robert M.Tripp, Ph_D.TheComputerist,lnc.

P.O.Box3So.Chelmsford, MA01824

additional , related problem. It can notread over the last two bytes in page oneeither. These two bytes are used by theload routine asthe indirect pointer to thenext location to be loaded. Once yourKIM formatted tape hits them - Good-bye! So, we have here the same prob-lem, and the same solution. To load KIMtapes into a SYM,they must be loaded inthree segments: 0000 to OOFD,0100 to(about) 01FC, and 0200 and up. I thoughtI hada great ideato get around this prob-lem. I dumped my KIM tapes with every-thing shifted up to start at 0200,with theintention of using a simple SYM Block-move command to relocate them downto their proper addresses. That is, theKIM tape would be set to load from 0200to 05FF and then be moveddown to 0000to 03FF.Good idea, right? Well, it may bea good idea, but i t doesn' t work. Block-move has the exact same problems asthe tape load: it uses the last two loca-tions in page zero as well as subroutineswhich require access to the pageone stack!

AIM/SYM/KIM TapeSummary

While there are obviously some prob-lems in using the KIM format tapes onthe SYM and AIM, this format is the onlyone which is compatible between thethree machines, and should be used asa common medium of exchange for pro-grams and data between them. To be"universal" the tapes should be writtenat the normal KIM speed and shouldstart at location 0200or above. I am surethat there will be SYM and AIM versionsof Hypertape published soon, perhaps inMICRO. Maybe someone will even havethe time to come up with a KIM LOADprogram for the SYM and the AIM thatcan be tacked on the front of a tape to beexchanged - in normal speed - and

which once loaded will permit the load-ing of KIM format programs and datainto any address (except for those occu-pie" by the loader itself which shouldbe out-Of-the-way somewhere), and atthe higher speeds. Until then, keep theAIM and SYM loading problems in mindas you make plans to transfer your pro-grams and data from one of the ASKfamily members to another.

# JJune 1979

Page 35: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 35/66

SYM " 2F " BUG K ILLER A Solution to the SYM"2F" Bug

CODE I S COMPLETELYThe problem around SYM·1, with KIM·tape compatability, I solved, at first, by

RELOCATABLE . ACCESS* $ 8B 8 6 writing a small program, that controls

LOADT* $ 8C 7 8 the loading. When loading terminates

2 0 8 68B STARTJ SR ACCESS CHKT * $ 8E 7 8because of a "2F" in the data stream, itcan be assumed that it will result in a

2 0 7 8 8C J SR LOADT CHAR * $OOFC checksum error too. What the program

BO 01 BCS TWOF does, is simply store the "2F" that was

6 0 RTS SU CC ESS FU L L OADihe probable cause and then reenter the

tape reading as though there had notA9 2 F TWOF LDA IM$2 F 2 F ERROR been an error.

2 0 7 88E J SR CHKTAD 00 LDY IM $0 09 1 FE STA IY $OOFEE6 FE INC $OOFEB UM P P OI NT ER SDO 02 BNE OKAY Submitted by

E6 FF INC $OOFFBUMP H IGH JanSkovAS FC OKAY LOACHAR Majvaenget 7

2 0 3F8 0 J SR $ 8D3 f DK·6000Kolding

BO EA BCSTWOFTheNetherlands

6 0 RTS

Issues 13 on: .All Payments must be in US dollars. Make checkspayable to: MICRO.Foreign payments in InternationalMoney Order (or cash) only.

If you are a subscriber, attach label or write subscripton number here: Sn .

Issues 7·12: , .

PO Box 6502Chelmsford, Mass 01824

"The BEST of MICRO Volume 1" contains all of theimportant material from the first six issues of MICROin book form. .."All of MICRO Volume 2" is all six issues of Volume 2,numbers 7 to 12,at a special reduced price for a limitedtime only. ...Back Issues:

Subscription: One Year = 12 Issues. Please circlethe correct category and write the amount in the spaceprovided.

Surface:United StatesAll Other Countries

Air Mall:Central AmericaEurope/So. AmericaAll Other Countries"BEST of MICROVolume 1"SurfaceAirMail

"ALL of MICROVolume 2"Surface $8.00Air Mall $12.00No Surface @ $1.75each _

.. . 'Air Mail @ $2.75each -No Surface @ $2.25each _

... 'Air Mail @ $3.25 each -TOTAL

$15.00$18.00

$27.00$33.00$39.00 $ .

S 7.00$10.00 $ .

$ .

$ .

$ .

$......•........

Name: .

Address: .

City: State: '" ZIP: .

Country (If no US): .

Please circle answers on questionnaire below to help us keep MICRO bringing you the type of information youwant.

Microcomputers Owned/Planning to Buy: AIM SYM KIM PET APPLE OSI Other .

Peripherals Owned/Planning to Buy: Memory Disk Video Printer Terminal Other .

Languages Used: Assembler BASIC FORTH PASCAL Other .

Your comments and suggestions on MJCRO .

Page 36: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 36/66

2 0 8 6 8 BAD 0 3B 9 F 4 0 04A4A4A4AAA98OA

A8BD 2 9 8C9 9 3E A 69 84AA8B9 F 4 0 02 9 OFAA9 8OAA8BD 2 9 8C9 9 3 F A 68 88 8FO 0 69 84AA 81 89 0 0 34C 0 6 8 9

MICRO 13:31

SY M STAT I C D I S P LAY

S YM R EF ER EN CE S

ACCES S*SCAND*S EGSM*D I SBUF*

$ 8 B 8 6$ 8 9 0 6$ 8 C 2 9$A 6 3 F

C OMP L ET E LY R E LOCATABL E

STAT I C J SR ACCES S ENTER HERE UNLES S ACCES SALTNTR LDY IM $0 3 ALREADY SET . S E T UP FORMOVE LDAY $0 0 F 4 3 NUMBERS . GET NUMBER INTO A

LSRA SH I F TLSRA LEFTLSRA FOURLSRA T IMESTAX PUT RESULT IN XTYA Y HAS NUMBER INDEXASLA MULT I P LY BY 2

TAY PUT BACK INTO YLDAX SEGSM GET CORRECT SEGMENT CODESTAY D I SBUF - 0 1 PUT INTO D I S P LAY BUFFERTYA GET INDEX B ACKLSRA D IV IDE B Y 2TAY PUT BACKLDAY $ 0 0 F 4 NUMBER INOT AAND IM $OF MASKTAX RESULT INTO XTYA GET I NDEXASLA MULT I P LY BY 2TAY PUT BACKLDAX SEGSM GET SEGMENT CODESTAY D I SBUF PUT INTO D I S P LAY BUFFERDEY DECREMENT INDEXDEY TW ICEBEQ EX I T I F HAVE LOADED 6 D IG I T S , EX I TTYA NOT DONE , GET INDEXLSRA D IV IDE INDEX BY 2TAY PUT BACKCLC PREPARE TO GO TO MOVEBCC MOVE GO !

EX I T JMP SCAND L IGHT UP D I S P LAY AND RETURN

NOTES :F 7 CORRES PONDS TO K IM PO INTH AT FBF 6 CORRES PONDS TO K IM PO INTL AT FAF 5 CORRES PONDS TO K IM INH AT F 9

Y KEEPS TRACK OF LOCAT ION IN D I SBUFWHEN MULT I P L I ED BY 2 ,AND LOCAT ION IN F 5 - F 7 WHEN NOT .

SYM Static Display

This program is a utility for the SYM-1that I have found useful in adapting rou-tines for the KIM. It loads the DISBU~from three locations, F5 to F7, corre-sponding to the three display locations,F9 and FB, used in the KIM monitor. Itends with a JMP SCAND, and thus canbe used to replace a JSR SCANDS com-mand as used in a KIM routine. It givesa static display.

Submitted by

PaulW. ZitzewitzDepartment of Natural Sciences

University of Michigan - Dearborn4901Evergreen RoadDearborn,MI48128

June 1979

Page 37: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 37/66

SYM-l, 6502-BASED MICROCOMPUTER• FULLY-ASSEMBLED AND COMPLETELY INTEGRATED SYSTEM that's

ready-to-use• ALLLSI Ie'S ARE IN SOCKETS• 28 DOUBLE-FUNCTION KEYPAD INCLUDING UP TO 24 "SPECIAL"

FUNCTIONS• EASY-TO-VIEW 6-DIGIT HEX LED DISPLAY• KIM-1 * HARDWARE COMPATIBILITY

The powerful 6502 8-Bit MICROPROCESSOR whose advancedarchitectural features have made it one of the largest selling "micros"on the market to d ey.

• THREE ON-BOARD PROGRAMMABLE INTERVAL TIMERS available tothe user, expandable to five on-board.

• 4K BYTE.ROM RESIDENT MONITOR and Operating Programs.• Single 5 Volt power supply is all that is required.• 1K BYTES OF 2114 STATIC RAM onboard with sockets provided for

immediate expansion to 4K bytes onboard, with total memory expan-sion to 65, 536 bytes.

• USER PROM/ROM, The system is equipped with 3 PROM/ROM ex-pansion sockets for 2316/2332 ROMs or 2716 EPROMs

• ENHANCED SOFTWARE with s implified user interface• STANDARD INTERFACES INCLUDE,

-Audio Cassette Recorder Interface with Remote Control (Twomodes, 135 Baud KIM-1 * compatible, Hi-Speed 1500 Baud)

-Full duplex 20mA Teletype Interface-System Expansion Bus Interface-TV Controller Board Interface-CRT Compatible Interface (RS-232)

• APPLICATION PORT, 15 Bi-dir ectional TTL Lines for user applicationswith expansion capability for added lines

• EXPANSION PORT FOR ADD-ON MODULES (51 I/O Lines included inthe bas ic system)

• SEPARATE POWER SUPPLY connector for easy disconnect of the docpower

• AUDIBLE RESPONSE KEYPAD

Synertek has enhanced KIM-1 * software as well as the hor dwore. Thesoftware has simplified the user interface. The basic SYM-1 system isprogrammed in machine language. Monitor status is easily accessible,and the monitor gives the keypad user the same full functional capabili-ty of the TTYu ser. The SYM-1 has everything the KIM-1 * has to offer,plus so much more that we cannot begin to tell you here. So, if you wantto know more, the SYM-1 User Manual is available, separately.

SYM-l Complete w jmanuals $269.00SYM-l User Manual Only 7.00SYM-l EKpansion Kit 75.00

Expansion includes 3K of 2114 RAM chips and 1-6522 I/O chip.SYM-1 Manuals: The well organized documentation package is com-plete and easy-to-understand.SYM-1 CAN GROW AS YOU GROW. Its the system to BUILD-ON. Ex-pansion features that are soon to be offered,

• BAS-18K Basic ROM (Microsoft)• KTM-2 TV Interface Board

$159.00349.00

'We do honor Synertek discount coupons

QUALITY EXPANSION BOARDS DESIGNED SPECIFICALLY FOR KIM-l, SYM-l & AIM 65These boards are set up for use with a regulated power supply such as the one below, but, provisions have been made so that you can addonboard regulators for use with an unregulated power supply. But, because of unreliability, we do not recommend the use of onboardregulators. All I.C's are socketed for ease of maintenance. All boards carry full 90-day warranty.

All products that we manufacture are designed to meet or exceed industrial standards. All components are first qualtiy and meet fullmanufacturer's specifications. All this and an extended burn-in is done to reduce the normal percentage of field failures by up to 75%. To you,this means the chance of inconvenience and lost time due to a failure is very rare; but, if it should happen, we guarantee a turn-around time ofless than forty-eight hours for repair.

Our money back guarantee: If, for any reason you wish to return any board that you have purchased directly from us within ten (10) days afterreceipt, complete, in original condition, and in original shipping carton; we will give you a complete credit or refund less a $10.00 restocking

charge per board.

VAK-l 8·SLOT MOTHERBOARDThis motherboard uses the KIM-4 * bus structure. It provides eight (8)

expansion board sockets with rigid card cage. Separate jacks for audiocassette, TTY and power supply are provided. Fully buffered bus.

VAK-l Motherboard $129.00

VAK-2j4 16K STATIC RAM BOARDThis board using 2114 RAMs is configured in two (2) separately

addressable 8K blocks with individual wr ite-protect switches.VAK-2 16K RAM Board with only $239.00

8K of RAM (Y: ! populated)VAK-3 Complete set of chips to $175.00

expand above board to 16KVAK-4 Fully populated 16K RAM $379.00

VAK-5 2708 EPROM PROGRAMMER

This board requires a + 5 VDC and ± 12 VDC, but has a DC to DC

multiplyer so there is no need for an additional power supply. Allsoftware is resident in on-board ROM, and has a zero-insertion socket.

VAK·5 2708 EPROM Programmer $269.00

VAK-6 EPROM BOARDThis board will hold 8K of 2708 or 2758, or 16K of 2716 or 2516

EPROMs. EPROMs not included.VAK·6 EPROM Board $129.00

VAK·7 COMPLETE FLOPPY·DISK SYSTEM (May '19)

V AK-8 PROTYPING BOARDThis board allows you to create your own interfaces to plug into the

motherboard. Etched circuitry is provided for regulators, address anddata bus drivers; with a large area for either wire-wrapped or solderedIC circuitry.

VAK-S Protyping Board $49.00

POWER SUPPLIESALLPOWER SUPPLIES are totally enclosed with grounded enclosures for safety, AC power cord, and carry a full 2-year warranty.

FULLSYSTEM POWER SUPPLYThis power supply will handle a microcomputer and up to 65K of our

VAK-4 RAM. ADDITIONAL FEATURES ARE: Over voltage Protection on 5volts, fused, AC on/off switch. Equivalent to units selling for $225.00 or

KIM· 1 " Custom P.S. provides 5 VDC @ 1.2 Ampsand +12 [email protected] Amps

KCP-l Power Supply $41.50more.Provides +5 VDC @ 10 Amps & ± 12 VDC @ 1 Amp SYM-l Custom P.S. provides 5 VDC @ 1.4 Amps

VAK-EPS Power Supply $125.00 VCP- 1 Power Supply'KIM is a product of MOS Technology

ENTERPRISESINC 0 R P 0 RAT E 0

$41.50

2967 W. Fairmount AvenuePhoenix AZ. 85017

(602)265-7564

Page 38: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 38/66

Computer- Determined Parameters forFree·Radical Polymerization

Don't let the title scare you. If you are using your systemfor complex equation solving, the general techniquespresented will be useful·· even if the particular exampleis not your cup to tea.

During the formation of polymers by so-called free-radicals, the followinglengthy and "sensi tive" equation is gen-erally valid,W(R) ::::AZ'RpR-, + «1-A)/2)Z3R(R-1)PR-'

(1)where, W(R) = weight-fraction of poly-mer possessing size R; A and P are para-meters; and, Z :::: 1-P (A or P cannot ex-ceed unity). Various methods have beenpreviously attempted to solve eqn. (1)for the parameters, A and P, which are oftheoretical and practical importance.Thus, approximate graphical procedureshave been employed (Smith et al., J.Polym. Sci., Pt. A·2, 4, 365 (1966); J.Phys. Chem., 72, 216 (1968); Ibid., 72,2933 (1968)) as well as more direct ap-proaches (Reich et al., J. Appl. Polym.Sci., 17, 3709 (1973)).The purpose of thisarticle is to present a novel trlal-and-er-ror computer program whereby para-meters A and P (or Z) can be readily ob-tained from eqn. (1). Although eqn. (1)applies to polymers, the solut ion of eqn.(1) Involves mathematical procedureswhich are common to various scient ificdisciplines and the program presentedshould therefore be of general Interest.Prior to running this program, W(R)-Rdata is entered in line #200. An initial(trial) value of P (PO) is entered in line#65. Since P is generally close to unity,an arbitrary initial value of P should beselected between .995-.999 (regardlessof which value is chosen, the computerwill search for the correct value in orderto obtain final values of A and Pl .

From eqn. (1), it can be readily SAenthata least squares treatment of the O!UC:I

(y = A1-+ A2)() where, Y ;;; W(R)/[ 1-PtRPR-. and X ::::(R.1)1p, will afford bestvalues of intercept (Ai) and slope (A2)where, A1 = A and A2 = (1-A)Zl2 (theleast squares procedure is given in line#'s 75-120).Then (cf.line #140).

z = 2_A2/(1-A) (2)Under the conditions used, more thanone solution for Z is possible. However,there can only be one unique physicallyreal solution for A and for Z (or 1·P).Thephysical ly unreal solution for Z affords

MICRO 13:38

values of A > 1 (which is theoretic-ally impossible). By uSing line #163,when A > 1, PO is lowered in order toachieve conditions whereby a phYSicallyreal value of A may be obtained. Otherlimitations that must be met are: P can-not be greater than unity (see line #150);A1 cannot be less than zero (#170). An·other condition (arbitrary) to be met is(line #156), 1·PO > = Z. This ensures

that prior to a series of iterative calcul·ations to determine final parametervalues, the initial value of P is such that1-PO> :: ::Z. Then, values of P are gradu-ally increased (line #180) until the follow-ing conditions (3) hold (line #'s 160,168),at which time, A, Z, and the correlationcoeff icient (from the least squares cat-culation of A 1 and A2) are displayed(line#168),

ABS (R)> .9 (3a)and, 1·P> ;;; Z or ABS(1·P·Z)/Z< =4E·04

13blSince eqn. (1) is sensitive to changes indata, i.e., small changes in data can re-sult in relatively large changes in A,there is a requirement that correlationcoefficient (R) be above .9 (3a). Thus,even though (3b) is satisifed, if (3a) isnot, then the screen will display thestatement that the data is not accurateenough (in order to afford reasonablysignificant values) (line #165). In (3b), thesecond term involving the absolute valuemay not apply sometimes, but Z·trialvalues will generally decrease fasterthan Z-calculated values to that 1-P <= Z halts further iterations and finalparameter values are displayed. Further,because of the sensitivity of eqn. (1),when A·values are between ·.05 and 0,then A Is considered to possess a zerovalue (line #'s 165, 1000). Insufficientlyaccurate data may also cause relativelylarge negative At-values (#165)and end-less loops (iterations) to occur. After 200such i terations, the screen will display astatement that the data may not be ac -curate enough (to achieve closed para-meter values) (l ine #155). However, it isalso possible that due to an unfortunatechoice of a PO value in line #65, morethan 200 iterations will be required prior

Dr. L.S. Reich3 Wessman Drive

W. Orange, NJ 07052

to the display of f inal values. Hence, theadditional statement in line #155 thatanother value of PO should be entered inline #65 (and another run attempted). Ifanother run is made and a similar situa-tion arises then omitting W(R)-R data atlow values of R and/or at very highvalues of R may afford closed parametervalues (the former W(R)·Rvalues general.Iy lie along the steepest part of a

dist ribution curve and are subject to er-rors in W(R) while the latter values liealong a relatively flat portion of the curveand are subject to errors in R). From thepreceding, data in #200 must be derivedfrom precise experimental techniques,which are available, e.g., gel permeationchromatography, due to eqn. (1) sensi-t ivi ty to relatively small inaccuracies indata (which are prone to occur at the tailends of a distribution curve).

Prior to the display of final results,values of Z (trial) and Z (calcd.) will becompared in tabular form on the screen(line #'s 68, 155) in order to apprise theviewer of the status of the iterative cal-

culations in progress. After final para-meter values have been displayed,values of W(R) (obsd.) and W(R) (calcd.)are compared in tabular form (line #'s190,500-520).

Explanatory REM statements are to befound in line #'s 9, 64, 105, 130, 152, 158and ca. 3·3.5K bytes are required depend-ing upon the amount of data entered (thedata is limited to 19W(RrR pairs). Apple-soft II Basic in ROM was employed anda run, as given in the Program Examplesection, required ca. 1 min. but this canvary considerably depending upon theaccuracy of the data and the initialchoice of the PO value (more iterat ionsare necessary when the PO value is tur-ther away from the true P value). Finally,it may be noted that the parameterValues A and Z can be used. to estimatevarious pertinent quantities. e.g.. the so-calleo welgnt·average degree of poly-merization of a polymer which is equal to(3-A)/Z.

June 1979

Page 39: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 39/66

Program Listing

5 PR INT "TH I S PROGRAM ALLOWS THE PREC I S E CALCULAT ION OFMOL EC ULA R WE IG HT D I ST RIB UT ION PA RAMET ER S, ' A '& ' l - P ' ,FOR FR EE -RA DIC AL PO LY MER IZ AT I ON . WE I GH T- FRA CT I ON V S.DEGREE OF POLYMER I ZAT ION (D P ) DATA I S ENTERED IN L INE# 2 0 0 . " ;

6 PR INT " THE IN I T I AL VALUE OF ' P ' ( ARB I TRAR I LY CHOSEN BETW. 9 9 5 - . 9 9 9 ) I S ENTERE ~ IN L INE 6 5 . CA . 3 - 3 . 5K BY TES ARE

REQU IRED AND EX PLANATORY ' REM ' S TATEMENTS ARE IN L INE9 , 6 4 , 1 0 5 , 1 3 0 , 1 5 2 , 1 5 8 . " : S TOP9 REM ' I S 1 0 - 6 0 ALLOW THE FORMAT ION OF THE ARRAY W ( J , K ) FOWT . - FRACT ION VS . DP DATA IN L INE1 2 0 0

1 0 D IM W( 2 0 , 2 )2 0 FOR J = 1 TO 5 03 0 FOR K = 1 TO 2 : READ W( J , K )4 0 I F W ( J , l ) = 0 THEN 6 05 0 NEXT K , J6 0 J = J - l6 4 REM1 6 5 L I S TS THE IN I T IAL VALUE OF ' P I& I ' S 7 0 - 1 0 0 ALLOW

FOR A LEAST SQUARES TREATMENT OF THE DATA6 5 PO = . 9 9 7 4 56 8 PR INT ; PR INT "Z -VALUES ( TR IAL ) " ; TAB ( 2 1 ) ; " Z -VALUES ( CALCD

P RI NT " - - - - - - - - - - - - - - - - " ; TAB ( 21 ) ; " - - - - - - - - - - - - - - - - "7 0 P = PO7 5 FOR I = 1 TO J8 0 Y = W( I , 1 ) / (W ( I , 2 ) * A(W ( I , 2 ) - 1 ) * (1 - - P ) A 2 ) : X = (W ( I , 2 ) - l ) / P9 0 X Y = XY+ X * Y : XX = XX+ X * X : SX = SX+ X : SY = SY+ Y :

YY = YY+ y * y1 0 0 NEXT1 0 5 REM IN I ' S 1 1 0 , 1 2 0 ARE G IVEN THE LEAST SQUARE SLOPE (A

I NT ER CE PT ( AI ) ,& THE CORRELAT ION COEFF . ( R )1 1 0 A2 = ( J * X Y - SX * SY ) / ( J * X X - ( SX )A 2 ) : A l = ( SY / J ) - A 2 * ( SX / J )1 2 0 R = (XY - J * ( SX / J ) * ( SY / J » / ( S QR (XX - SX * ( SX / J » * SQR (YY - S y *

( SY/J)

»1 3 0 REM I ' S 1 4 0 , 1 5 0 ALLOW THE CALCULAT ION OF Z AND THE ADOF PO I F Z<O

1 4 0 Z = 2 * A 2 / ( 1 - A I )1 5 0 I F P > l OR Z<O THEN PO = PO - . 0 0 0 0 1 : XX = 0 : SX = 0 :

SY = 0 : Y Y = 0 : GOTO 7 01 5 2 REM11 5 5 I ND ICATES A POS S IB LE ENDLES S LOOP& 11 5 6 LOWERS THE

IN I T IAL VALUE OF PO IN L INE t 6 5 I F I - PO< = Z1 5 5 PR INT I - P ; TAB ( 2 1 ) ; Z : PC = PC+ 1 : I F PC > 2 0 0 THEN PR INT :

P R INT " T~ ~ PROGRAM IS GO ING THRU AN ENDLESS LOOP ? THEMAY NOT BE ACCURATE ENOUGH ! TRY ANOTHER VALUE OF PO& SEE I F THERE I S ANY CHANGE ! " : END

1 5 6 I F I - PO<Z OR Z<O THEN PO = PO - . 0 0 0 0 1 : XX = 0 : XY = 0 : Y YSX = 0 : SY = 0 : GOTO 7 01 5 8 REM11 6 3 LOWERS PO VALUE I F A l > l& I ' S 1 6 0 , 1 6 5 , 1 6 8 , 1 8 0ALLOW FOR THE CALCULAT ION OF F INAL VALUES OF 'A '& ' l - P ' S HI LE# 1 7 0 ACCOUNTS FOR VAL .UES OF A l < 0

1 6 0 I F I - P < = Z OR ABS ( l - P - Z ) / Z < = 4 E - 0 4 THEN A = A l1 6 3 I F A I > l l H EN PO = PO - . 0 0 0 0 1 : XX = 0 : X Y = 0 : YY = 0 : SX =

SY = 0 : GO TO 7 0

June 1919 MICRO 13:38

Page 40: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 40/66

1 6 5 I F (ABS (R ) ( . 9 OR A l ( - . 0 5 ) AND ( l - P ( = Z OR ABS ( l - P - Z ) / Z ( = 4E -THEN PR INT : PR INT "DATA I S NOT ACCURATE ENOUGH" . : END

1 6 8 I F ABS (R » . 9 AND ( l - P ( = Z OR ABS ( l - P - Z ) / Z = 4E - 0 4 ) THEN PRPR INT · "VA lUES OF 'A '& : ' l - P ' = ".1 : GOSUB 1 0 0 0 : PR INT A " AND"Z " ; AND , CORRELAT ION COEFFF . = " ; : PR I NT CC : GOTO 1 9 0

1 7 0 I F A l (O THEN 1 8 01 8 0 P = P+ . 0 0 0 0 1 : XX = 0 : YY = 0 : SX = 0 : SY = 0 :

GOH1 , ' 7 51 9 0 PR INT : PR INT ' " W (X ) , OBSD . " ; TAB ( 2 0 ) ; "W (X ) , CA l CD . " :

2 00 D ATA 7 . 4 5E -0 4 , 4 00 , 7 . 6 2E -0 4 , 60 0 , 7 . 3E -0 4 , 70 0 , 4 . 4 1 E- 04 ,1 2 0 0 , 2 . 9 E - 0 4 , 1 5 0 0 , 1 . 3 E - 0 4 , 2 0 0 0 , 2 . 1 E - 0 5 , 3 0 0 02 1 0 DATA 05 0 0 FOR I = 1 TOJ5 1 0 W = (A I+ A2 * (W ( I , 2 ) - l ) / P ) *W ( I , 2 ) * P " (W ( I ,2 ) - 1 ) * ( l - P ) " 25 2 0 PR INT TAB ( 4 ) ; W ( I , l ) ; TAB ( 2 0 ) ; I NT (W* lE 0 6+ . 5 ) / l E 0 6 :

N EXHEND10 0 0 I F A<O AND A> - . 0 5 THEN A = 0 : A l = 01 0 1 0 A = INT (A * 1 0 0+ . 5 ) / 1 0 0 : Z = INT ( Z * lE 0 6+ . 5 ) / l E 0 6 :

CC = I NT (R * lE 0 4 ) / l E 0 41 0 2 0 RETURN

Program Example

COMMAND : RUN - - - - - - > STATEMENTS 5 , 6 , a n dCOMMAND : CONT - - - - - >

W(R) vs. R data for the polymer, poly-styrene (from gel permeation chroma-tography techlques), was entered In line1200 and an arbitrary value of PO =.99745 in line 1 1 6 5 . Then a run was carriedout as follows,

" Z -VA lUES ( TR IAL )

2 . 5 4 9 9 9 9 8 6 E - 0 32 . 5 3 9 9 9 9 7 8 E - 0 32 . 5 2 9 9 9 9 71 E - 0 32 . 5 1 9 9 9 9 6 3 E - 0 32 . 5 0 9 9 9 9 5 5E - 0 32 . 4 9 9 9 9 9 4 8 E - 0 32 . 4 8 9 9 9 9 4 1 E - 0 32 . 4 7 9 9 9 9 33 E - 0 3

Z -VA lUES (C AlCD . )

2 . 4 9 7 9 4 1 9 2E - 0 32 . 4 9 5 3 6 3 0 2 E - 0 32 . 4 9 2 7 5 4 9 6 E - 0 32 . 4 9 0 1 2 1 0 9E - 0 32 . 4 8 7 4 7 2 7 6E - 0 32 . 4 8 4 8 1 4 8 7E - 0 32 . 4 8 2 1 6 11 5E - 0 32 . 4 7 9 5 1 8 6 6 E - 0 3

VALUESOF ' A ' & : ' l - P ' = . 6 5 AND 2 . 4 8 E - 0 3 ; ANDCORRELAT ION COEFF . = . 9 9 9 9

W( X), ( B SD .

7 . 4 5 E - 0 47 . 6 2 E - 0 47 . 3 E - 0 44 . 4 1 E - 0 42 . 9 E - 0 41 . 3 E - 0 42 . 1 E - 0 5

W(X), CA lCD .

7 . 5 3 E - 0 47 . 6 E - 0 47 . 2 4 E - 0 44 . 4 E - 0 42 . 9 E - 0 41 . 3 E - 0 42 . 1 E - 0 5 "

J u n e1979

Page 41: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 41/66

AIM 6522 Based Frequency Counter

The AIM 65 obviously is going to find its way into theelectronics laboratory. Here it is used as a frequencycounter.

The program listed performs as a six-digit frequency counter. It will count atleast as fast as 450kHz, perhaps faster.A simple interface circuit is shown inFigure 1. Although the signal to bemeasured could beconnected directly tothe PB6pulse counting pin of the 6522,Iprefer not to connect strange andunknown signals directly to the com-puter. In any case, the signal pulses tobe counted should really be shaped intothe form of a squarewave before they ap-

pearat PB6.The counter uses timer T1 in a free-run-ning mode with 50,000clock cycles be-tween settings of its interrupt flag. Thetimer T1 is not allowed to interrupt the6502, rather its interrupt capability isdisabled and the flag is "watched" byreading the interrupt flag register, IFA.With $14 = 20,• intervals of 50,000clockcycles apiece, one gets a total interval ofone second. $14is located in $0000.TheT1 timer is loaded with instructionsstarting at $0230.Note that the number Iused is less than 50,000because myAIM65 crystal is slow by 244 parts in onemillion cycles. Youmaywish to makead-

justments with this number also, de-pending on your system's clock frequen-cy.

The frequency counter works as follows.Timer T2 in its pulse counting mode is in-itially loaded with $FFFF = 65535.Onceit is loaded, timer T1 is started and PBOis brought to logic 0 to allow the NANDgate to let pulses through. At the end ofthe timing interval, described in thepreceding paragraph,the gate is closed,the timer T2 is read, the result is sub-tracted from $FFFF, this number is con-verted from HEXto BCD,and it is addedto the display locations using the ADCinstruction in the decimal mode. If, at

any time the T2 timer counts throughzero, an interrupt request (IRQ) occursand the display registers are in-cremented by65536 = $FFFF + 1,T2 isreloaded with $FFFF, and counting con-tinues. At the end of one second, thetotal number of counts is displayed bythe display subroutine, which, by theway, is identical to the 24-hour clockdisplay routine in the February 1979

June 1979

issue of MICRO. It is a bit unfortunatethat the 6522designers did not allow theT2 timer to continue producing inter-rupts without reloading it, because in thetime interval between the interrupt re-quest and the reloading of the T2 timer(starting at instruction $0296in the inter-rupt routine), a few counts or pulses onPB6might bemissed. This would only beof concern at large counting rates.

The HEX to BCD conversion routine

starts at address $0250 and ends at ad-dress $028E. The 16-bit number repre-senting the number of counts in timer T2is stored in locations $0010and $0011.If$PQRSrepresents this number,then

$PQRS = (PA096,o) + (0.256'0) +(R.16,0) + (S. 1).

If the calculation on the right-hand sideof the above equation is done in thedecimal mode, the $PQRS will be con-verted to BCD. Inother words, 4096is ad-ded to itself P times, 256 is added to

Marvin L.DeJongDept.of Math-Physics

TheSchool of the OzarksPt. Lookout, MO65726

itself a times, 16 is added to itself Rtimes, and 1is added to itself Stimes, allin the decimal mode. These results areall added together, giving a BCDnumber.Better routines exist, I am sure, but thisone isn't too slow. Note that P,O,R,andS are each one nibble of the 16-bitnumber obtained from timer T2. (Hasanyone yet suggested calling 16-bitnumbers "gobbles," giving nibbles,bytes, and gobbles?) The table starting a$0300 must be loaded into memory for

the HEXto BCDconversion to work.The symbol table given may help you ifyou wish to modify the program or if youwant to change it to run on a microcom-puter other than the AIM 65. Also, Iwould be interested in knowing anexactupper limit for the frequency at which itwill operate and in any further im-provements to the rate at which it willcount. Currently I do not have enoughtime to do this experimentation myself.

Table IADDRESS TABLE FOR THE AIM 65 FREQUENCY COUNTER

$AOOO = PBD (ORB)$A002 = PBDD (DDRB)$A004 = T1L-L (Read)$A005 = T1L-H$A006 = T1L-L (Write)$A008 = T2L-L$A009 = T2C-H$AOOB = ACR$AOOD = IFR$AOOE = IER'$A404 = IROL$A405 = IROH$0000 = Count-to-twenty register$0001 = Display register, low-order byte$0002 = Display register, middle-order byte$0003 = Display register, high-order byte$0010 = PO = Low-order byte of count from timerT2$0011 = RS = High-order byte of count from timerT2$0340 = Starting address of display subroutine$0295 = Starting address of IRO routine

MICRO 13:41

Page 42: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 42/66

~:i2~3(i A9 L[:q~ #950202 80 STA A404~J205 A9~ L[)H #62

e3:4ti R5 L[:IA 01~:f~>42 ;::5 5TA ;·)4

0270 00 BNE 0266

0280 30 BMI 02SE03:46 ; : ;5 STR ti5~j::4;:; A5 L[)A ~]::~3::4A ;::5 5TA 06~)J:4C: A2 L[ :< :· ::# :13

020C 80 SIR A00E

ti

2e9 D~) Er·~Ee2SE~ 4C .J t'1F~3i~:~Es C L D

0211 80 STP A0000214 80 STA A002

0219 80 STR A00Bt!21C A9 "LDA #14€i21E ~:~5 TA fj~:i~:i22~j AS LDA #FF

028F 20 JSR 0340

0298 8D SIR A009 (1::5E 46 L5F~ f16j.)J :60 ~~ FC~F:: ~35

022C: ~:;5 STR ~:i2i-322E ;:;5 5TA ~3J:~32::ti AS L[:q:~ #420232 80 STP A006

ti2A~: AS L [)A 02~32P5 69 A[::C #55

03:6;:; A ·A TA > ;03:69 C:A[)E>~

~32A9A55TA ~32L [)A 03:

0247 AS ~DA 0~3 {M)=0300 96 56 16 01( ) 0304 40 02 00 00249 00 BNE 82JD

PBOi24F AS LDA #FF~~~~ ED SSC A008

~:~25E: ;::5 S TR : 1 . : 1 .

~j25[) A2 LD>:: #03 7404

0263 F0 BEQ 027F

026A 7D SDC 01B0 , !026[:: 85 5TA 01

0271 7D RDC B304.X~~t274 :35 STA 02(~276 R5 L.[)A ~J::

SIGNAL 7400Figure 1

I n t er f a c e Ci r cu i t f o r t h e AIM 65Frequency Coun t er Us i ng t h e 6522 VIA

MICRO 13:42 June 1979

Page 43: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 43/66

KIM - The Tunesmith

A number of programs have been offered which permityou to play music on your micro. The program presentedhere also permits you to compose music on your KIM, aswell as save it and play it back.

Anthony T. ScarpelliRR1,Box 426

N.Windham, ME 04062

Have you ever wanted to composemusic, but knew nothing about how togo about doing it? 00 you lack a musicalinstrument and have a tune goingthrough your head and don't know whatshould go after the first few notes? Wellhere is a program for a basic KIM·1 thatwill help you compose a tune, and you

don't even have to know how to read orwrite music.

I have really never learned how to playamusical instrument, and I never havetime to practice. Yet every once in awhile I want to try out a few notes goingon in my head, or I j ust want to see how acouple of notes sound together, to see ifthey have any effect on me. So what I didwas to develop a program that uses abasic KIM·1 and the speaker circuitshown on page 57 of the KIM·1 UserManual that plays a tune I compose onenote at a time. I use the keypad as dataentry to place into the program notes oftwo octaves, including sharp notes, with

four possible lengths and a rest or nonote. I used the lettered keypads as wel las the 9 which looks like a small G for allthe notes which are seven in number,basically ABC D E Fand G .

Tunesmlth Operation

Once you start the program, you pressone of the note letters. It will sound theappropriate note. If you want the sharpfor that note, if it has one (8 and E donot), press 5. To get the upper octave ofthe note you want you press 7, and if youwant the upper octave sharp of the note,press 5 first, then 7. The keys 1, 2, 4,and8 will give you a whole note (1), a half

note (2), a quarter note (4),and an eighthnote (8). After you choose your note, youchoose' your length. If you don't want thenote, start again, only this time thelength is not automatical ly a half note asit would be when you first start out,you'll have to change it to what youwant.

June 1979

Now that you have your nice note thatsounds just right, press 3. This will savethe note and place it in a tune table. Toknow that the note is indeed saved, thedisplay will flash a SAVE. You have tohold the 3 key down until the SAVE isseen, though. Now the chosen note willbe played and you can pick another note,

or a rest which isO .The procedure is thesame for a possible 72 note tune. If you

like your tune and want to write it down,press the + key. The display will showyou the first note of the tune, and everytime you hit the 3 key, the next will bedisplayed. If you want to start again,press the DA(00 Again) key.

The Tunesmith Program

We can go over the program now. Table Iis a listing of the keypad numbers andwhat they represent. The main programstarts at 0200 and initialization goes onto 021A. From 021C to 0228 we test thekeypad and 022A to 022E we test for the

fi rst time through the program. This stepeliminates any noise in the speaker whilechoosing the first note. 0230 to 0236gets the program to step through all thenotes, and 0238 to 0230 delays the pro-gram, not only to give you more time tochoose a note, but also to put a spacebetween the beginning and ending of thetune. 0242 to 0248 is for the beginningsilence. 024A thru 0263 loads the noteyou have chosen into a temporary toea-tion. 0265 to 026E will jump to all thesubroutines which we'll explain in aminute. 0271 thru 0278 tests for the savekey, which you press if you want thatparticular note. From 0278 to 0283 wetest for the DA key. 0285 to 028F will

cause the program to jump to the rout inewhich will allow us to see what notes wehave so that they can be written downand saved for the "Top Ten". 0295 to02A9 sets the save flag, resets the notecounter, and because the program goesdeep into the stack territory, resets thestack pointer to avoid trouble.

The Get High subroutine is the first onewe come to. From 0356 to 035E we testto see if we want a high note. If we don't,we return from the subroutine. If yes,we'll first test to see if it's to be a sharpnote that is to go to the next octave. If itis, then from 0366 to 036A we'll load thehigh sharp note into the temporary loca-

tion, otherwise from 036F to 0373 we'llload just the next octave note. The GetSharp subroutine is similar and the GetLength subroutine is simple enough.

The Play Tune subroutine is next. From0300 to 0306 we set up the first note,then we play it. This is the unsaved notewe are trying out. Then we'll test for asave flag from 0313 to 0317, and test fora note or notes in the tunetable up to0310. If there is one or more notes in thetunetable, from 031F to 0330 we'll playthem. If we had a save for the temporarynote, we reset the save flag, store a restso we don't hear the saved note twice,

then load the note into the next posit ionof the tuntable, and we'll also put ourchosen length into the length table; allthis from 0333 to 0345. Since we savedthe note, not only do we need some in-dication that it was saved, we also needto indicate that our finger is on the 3keypad long enough for the program tocatch the keypad entry, so at 0347 we goto the subroutine that displays a big red"SAVE". At 034A we play all our notesagain, and then go back to the main pro-gram to get another note, then back hereagain so we always hearour tune.

In the Tone subroutine, at 0200 and020F we set the ports to outputs; and at

02E2 and E4 we start KIM's internaltimer. We load the note frequency, andwhen it runs down we change the outputto its other state, whatever it was. If youhook a speaker circuit on the port as inthe KIM manual, a note will be producedas we repeat this procedure every timethe timer times out at 02EF; and if we do

MICRO 13:43

Page 44: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 44/66

this for a length of time determined bythe note length at 02F9, we have justplayed a note in our tables or one we'retesting out.

Our Save subroutine starts at 03AAwhere we load a number for a particulart ime we want to keep the SAVE letterson. Next at 03AE and 0380 we set thedirect ion registers and since we wantonly 4digits lit we load the number 4 intothe X register. When we store one of sixnumbers, from 09 to 13 into the location

S80(1742), one of the six digits will belit, and then it we load a particular hexnumber representing a letter, number orother shape into another locationSAO(1740), then the seven segmentdisplay will light. We also need somedelay, because if we did not, the displaywould light and go out in a couple ofmicroseconds, which few of us couldsee.All this is taken care of from 0383 to03CC. And finally we want to end thetune after 72 notes so we willautomatically go the the Display Notesroutine from 03CE to 0304. We want tokeep count of how many notes we saveso at 0307 we increment the note count.

If we have a nice little tune runningthrough our circuits and we say toourselves, "Hey, that's a catchy tunethat might make the top 40," then we' llneed some wayof finding out what notesare in the tunetable so that we can writethem down. The Display Notes routinedoes just that. What we want this sec-t ion to do isto display a lettered note, toshow that it is a sharpand/or a high note,and to show what i ts length is. We wantit to stay on the display until we're readyfor the next note and we need some in-dication that the note has changed whenwe do go to the next note. Finally wewant the option of starting again. Soherewe go.

From 0100 to 010Awe test the countersto see if we've reached the end of ourtune table, then we take our note andlength and put them into a temporarylocation from 0100to 0115.From0117to0110 we check for a rest; if it isn't onethen at 011F on we determine whatnoteit is. What I did was to compare theunknown note to the note table and forevery wrong comparison increment acount. We also have four groups of 7notes ana to determine what group, Isubtract a number until I get a carry flaQ.This then tells me the group and also thenote. The group indicates whether thenote is high, sharp, or high/sharp. Weload the correct shape for the display onthis information. If it was just a rest, at0180 we load a zero shape. At 018A to0198 we test for the length and thenstore the length shape. Up to 018C wedisplay the shapes as before, only thistime, as we go through a test for the nextnote, and "do again", we keep the

MICRO 13:44

0 0 0 0

0 0 0 0 FB0 0 0 1 DF0 0 0 2 C 60 0 0 3 BB0 0 0 4 A 60 0 0 5 9 30 0 0 6 8 A

0 0 0 7 7B0 0 0 8 6D

0 0 0 9 6 1OOOA 5BOOOB 5 1OOOC 4 8DODD 4 3

OOOEE DOOOF D 20 0 1 0 0 10 0 1 1 BO0 0 1 2 9C0 0 1 3 0 10 0 1 4 8 3

0 0 1 5 7 40 0 1 6 6 70 0 1 7 0 10 0 1 8 5 6

TUNESM ITH

BY ANTHONY T . SCARPE LL IMAY 1 9 7 9

I CRO NUMBER 1 3JUNE 1 9 7 9COPYR IGHT (C ) MAY 1 9 7 9 BYTHE COMPUTER I ST , I NC .

K IM M ON IT OR REFE RENCE S

PAD * $ 1 7 0 0 D ATA R EG IS TE RPADD * $ 1 7 0 1 DATA D IREC TION RE GI ST IMER* $ 1 7 0 4 SET T IMERTT IMER* $ 1 7 0 7 TEST T IMERST IMER* $ 1 7 0 F START T IMERSAD * $ 1 7 4 0 SY STEM DATAREG I STER ASADD * $ 1 7 4 1 S YSTEM DATAD IRECT ION ASBD * $ 1 7 4 2 SY ST EM DATA REG I STERPBDD * $ 1 7 4 3 SY ST EM DATA D IR ECT IOKEY I N* $ l F 4 0 KE YPAD INPU TGETKEY* $ l F 6A GET KEYBOARD IN PUT

PA GE ZE RO LOCATIONS

ORG $ 0 0 0 0

LOW NOTETABLE

NOTE = $ FB G= $D F A= $C 6 B= $ BB C= $A 6 D

$ 9 3 E= $ 8A F

H I GH NOTE TABLE

H INOTE= $ 7B G= $ 6 D A

= $ 6 1 B= $ 5B C= $ 5 1 D= $ 4 8 E= $ 4 3 F

LOW SHARP NOTE TABLE

SHPNOT= $ ED G SHARP ,A F LAT= $ D 2 A SHARP ,B F LAT= $ 0 1 NO NOTE= $BO C SHARP ,D FLAT= $ 9C D SHARP ,E FLAT= $ 0 1 NO NOTE= $ 8 3 FSHARP,G FLA T

H IGH SHARP NOTE TABLE

H I SHRP= $ 7 4$ 6 7$ 0 1$ 5 6

G SHARP , A FLATA SHARP , B F LATNO NOTEC SHARP , D FLAT

===

June 1979

Page 45: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 45/66

00 19 4COOlA 0 10018 3F

COIC 00OOlD 0 0(1CIE00COIF 00

0020 020021 000022 000023 000024 000025 000026 000027 000028 000029 00002A 000028 00002C 00002D 00002E 000112F000030 000031 000032 000033 000034 000035 000036 000037 000038 000039 00003A 000038 00003C 00003D 00003E 00003F 00

0040 010041 020042 040043 080044 200045 100046 080(147040048 8600 49 D8004A E600 48 FF00 4C 8D0(14DF7004E FC00 4F 890(j50DE00 51 F90052 Fl

0053 00

J une 1 97 9

DELT1M=TIMED =TIMEC =SAVFLG=TLENTH=NOTPTR=KEYPTR=TNOTE =HIFLG =SHPFLG=NOTNUM=PRMNOT=FSTFLG=PLENTH=TNTNUM=NEXNOT=DELAYA=DELAY8=

PNTPTR=DELAYC=TT8PTR=NT8PTR=NOTCNT=DNTCNT=TEMNOT=TEMLEN=COUNT =DFOUR ::DTHREE=DTWO ::DONE =LNTPTR=

CONSTANTS

KEYLNT ::

LNTH =

LNSHP =

NTSHP ::

LETNUM=

= $4C D SHARP, E FLAT$01 NO NOTE$3F F SHARP, G FLAT

$00 UNUSED$0 0$0 0$0 0

display lit . If we hit the 3 key we jump toa delay which blanks the display. Thislets us know a new note has entered thecircuits so that we can distinguish twoor more same notes in a row. Finally wereset the stack pointer again and displaythe next note. If we want to start again atany time, we hit the DA key and off we goto the beginning again. By the way, thedelay subroutine we go to is a gooddelay to get very long times. It uses theKIM·1 's internal timer.

==

===::

$02 DELAY TIME$0 0$0 0$00 SAVE FLAG$00 TEMP. LENGTH$00 NOTE POINTER$00 KEY POINTER$00 TEMP NOTE$00 HIGH FLAG$00 SHARP FLAG$00 NOTE NUM8ER$00 PERMANENT NOTE$00 FIRST TIME FLAG$00 PERM. LENGTH$00 TEMP. NOTE NUM8ER$00 NEXT NOTE$00 DELAY A$00 DELAY 8

$00 PERM. NOTE POINTER$OODELAYC$00 TUNETA8LE POINTER$00 NOTE TA8LE POINTER$00 NOTCNT NOTE COUNT$00 DISPLAY NOTE COUNT$00 TEMP. NOTE$00 TEMP. LENGTH$00$0 0$0 0$0 0$0 0$00 LENGTH POINTER

So that's it. I know it Is a long program,because of all the explanation, but Iwantas much understanding as possible,because of the possibilities it holds. Thesimple tone generation can be replacedwith a CIA converter, an erase note modecan be implemented, a larger scale withmore lengths and other variables can bedeveloped, and so on. There is no limit.But for a beginning, with a small corn-puter, all you potential Bachs, here it is,go to it.

Table' - Keypad RepresentationsA = A noteB = B noteC = C noteD = D noteE = E noteF = F note9 = G noteo = rest1 = whole note

2 = 1/2 note4 = 1/4 note8 = 1/8 note5 = sharp1 upper octave3 = save or display next noteDA = DoAgain+ = Display notes

=$01 (1) WHOLE NOTE$02 (2) HALF NOTE$04 (4) QUARTER NOTE$08 (8) EIGHTH NOTE$20 LENGTH$10$0 8$0 4$86 (1) LENGTH SHAPE$D8 (2)$E6 (4)$FF (8)$8D (G) LETTER SHAPES$F7 (A )

$FC (8)$89 (C)$DE (D)$F9 (E)$Fl (F)

==

=::

=

::

==::

=====

$0 0 LETTER NUM8ER

MICRO~3:45

Page 46: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 46/66

0054 OF = $O F0055 OD = $O D0056 OB = $O B0057 09 = $09

0058 00 LETTER = $00 LETTER SHA PES

0059 F9 = $F9005A BE = $BE005B F7 :: $F7005C ED :: $ED

005D TUNTBL * $0060 TUNE TABLE

005D LNTTBL * $00A8 LENGTH TABLE

DISPLAY NO TE RO UTINE

0100 ORG $0100

DIDO A9 01 DISNTS LDAIM $01 RESET DISPLAY NOTE

0102 85 37 STA DNTCNT0104 AS 37 NX TNO T LDA DNTCNT TEST FOR END0106 C5 36 CMP NOTCNT

0108 DO 03 BNE BEGIN010A 4C El 01 JMP DOAGNB010D A6 37 BEGIN LDX DNTCNT STO RE NO TE010F B5 60 LDAZX TUNTBL AND LENGTH

0111 85 38 STA TEMNOT0113 B5 A8 LDAZX LNTTBL0115 85 39 STA TEMLEN0117 A2 00 LDXIM $000119 AS 38 RP T LDA TEMNOTTEST FOR TESTOIlB C9 01 CMPIM $01O IlD FO 61 BEQ DISZEROIlF D5 DO CMPZX NO TE TEST FOR NOTE121 FO 04 BEQ SUB0123 E8 INX0124 4C 19 01 JMP RPT0127 38 SUB SEC TEST FOR FIRST0128 8A TXA GROUP0129 E9 07 SBCIM $07012B BO OD BCS NXGRPA012D B5 4C LDAZX NTSHP STO RE NO TESHAPE012F 85 3D STA DTWO0131 A9 CO LDAIM $CO0133 85 3E STA DONE0135 85 3C STA DTHREE0137 4C 8A 01 JMP DISLEN

013A 38 NXGRPA SE C TEST FORSECOND013B 8A TXA GROUP013C E9 OE SBCIM $O EODE BO 13 BCS NXGRPB0140 8A TXA0141 E9 06 SBCIM $06 STORE NO TE SHA PE0143 AA TAX0144 B5 4C LDAZX NTSHP0146 85 3D STA DTWO

0148 A9 F6 LDAIM $F6 STORE HI SHAPE0l4A 85 3E STA DONE014C A9 CO LDAIM se n014E 85 3C STA DTHREt0150 4C 8A 01 JMP DISLEN

MICRO 1~6June 1979

Page 47: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 47/66

0153 380154 8A0155 E9 1557 so 1359 8Ao15A E9 co015C AA015D B5 4Co15F 85 3D0161 A9 ED0163 85 3C0165 A9 CO0167 85 3E0169 4C 8A 01

016C 38016D 8Ao16E E9 150170 AA0171 B5 4C0173 85 3D0175 A9 ED0177 85 3C0179 A9 F6017B 85 3E017D 4C 8A 01

0180 A9 BF0182 85 3D0184 A9 CO0186 85 3E0188 85 3C018A A2 00C A5 398E D5 440190 ro 040192 E80193 4C 8C 010196 B5 480198 85 3BDl9A A9 80

019C 85 33019E A9 7Fnun 8D 41 1701A3 A2 0401A5 AD FF01A7 B5 5301A9 8D 42 17DlAC B5 3ADlAE 8D 40 17DlBl 88DlB2 DO FDDlB4 CAO lB5 10 EEDIB7 A4 33O lB9 88O lBA 84 33DlBC DO E5O lBE 20 40 IFO lCI 20 6A IFDIC4 C9 031C6 rn DCl C 8 20 40 IF

O lCB 20 6A IFE C9 11

June 1871

NXGRPB SEC TEST FOR THIRDTXA GROUPSBCIM $15BCS NXGRPCTX ASBCIM $oD STORE NOTE SHAPETAXLDAZX NTSHPSTA DTWoLDAIM $EDSTA DTHREELDAIM $COSTA DONEJMP DISLEN

NXGRPC SEC STORE NOTE SHAPETX ASBCIM $15TAXLDAZX NTSH PSTA DTWoLDAIM $ED STORE SHARP SHAPESTA DTHREELDAIM $F6STA DONEJMP DISLEN

DISZER LDAIM $BF STORE ZERO SHAPESTA DTWoLDAIM $COSTA DONESTA DTHREE

DISLEN LDXIM $00RPTB LDA TEMLEN TEST FOR LENGTH

CMPZX LNTHBEQ GTSHPINXJMP RPTB

GTSHP LDAZX LNSHP STO RE LENGTH SHAPESTA DFoUR

DIS LDAIM $80 LOAD DISPLAY

STA DELAYC LIGHT TIMELDAIM $7F SET DIRECTION REGISTERSTA SADD

RPTC LDXIM $04 SET UP 4 LETTERSLITE LDYIM $FF AND DISPLAY

LDAZX LETNUM LIGHT LETTER SSTA SBDLDAZX COUNTSTA SAD

WAIT DEY DELAYBNE WAITDEX GET NEXT LETTERBPL LITELDYZ DELAYC DELAYDEYSTYZ DELAYCBNE RPTCJSR KEVIN TEST FOR NEXT NOTEJSR GETKEYCMPIM $03BEQ NEXTJSR KEVIN TEST FOR START AGAINJSR GETKEYCMPIM $11

~C3~~~\1 l:J~[])@lem FOR

AIM/SYM/KIM

8K STATIC RAM ~~ :RSockets for 8K Eprom

65221/0 PortON BOARD REGULATORS

AIM/SYM/KIM

UPPERl lowa r ca . . A SCI I

128Additional U.ar Prvgr.mmabtaCh.racteR: GRAPHICS-

SYMBOLS-FOREIGN CHARACTERS

Programmable Screen Forma. up 10

a o CHARACTERS· 2 4 LINES

KEYBOARD and LIGHT PEN Intarf ac ••

Up 10 4 K DISPLAY RAM

PnMalon 'O f2K EPROMPnrrtaaon 10 add 8502,or

STAND·ALONE SYSTEM

ASSEMBLED AND TESTEDWITH 2K DI SPLAY RAM

VIDEO PLUS: $245 00

FOR

ADD UP TO AYE ADDIT IONAl BOARDS

AUDIOITTl ' CONNECTIONS

POWER TERMINALS

APPLICATION CONNECTORS

AIM/SYM/KIM

FULLY BUFFERED

FULLY DECODED

KIM·4 Bus Structure

MOTHER PLUS: $8000 FULLY ASSEMBLED AND TESTED

AIM/SYM/KIMS a.. S IZ E.nd SHAPE a s l elM ISYM

Two Sets of GOLD Plaled l hNJ 2 2 F i, .. en

Dftianed for WIRE WRAP orSOlDER Connections

Pr or is io nl f or 4 0 1 411' p in IOdeb.2 . ,40pin IOdets

3-"_"",,, PROTO PLUS: 54000

...7/25.-384"

PO Box JS Chelmsford. m A0182 ..

MlCA013:47

Page 48: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 48/66

MICRO 13:48

O lDO FO OF' O lD 2 DO C6

0 1D 4 2 0 AC 0 2O l D 7 E 6 3 7O l D 9 A2 F FO ID S 9AO lDC EAO lDD EAO lDE 4C 0 4 0 1

O l E l A 9 0 00 l E 3 8 5 3 6O l E 5 4C 0 0 0 2

1 5 1 6 1 7

S EQ DOAGNSSNE D I S

NEXT J S R DELAYINC DNTCNTLDX IM $ F FTXSNOPNOPJMP NX TNOT

INCREMENT D I S PCOUNT . R ES E TPO INTERPADD ING

DOAGNS LDA IM $ 0 0S TA NOTCNTJMP NUTUNE

MA INPROGRAM

0 2 0 0 ORG $ 0 2 0 0

0 2 0 0 A 9 0 0 NUTUNE LDA IM $ 0 0 IN I T IA L I ZE0 2 0 2 8 5 2 3 S TA SAVFLG0 2 0 4 8 5 2A S TANOTNUM02 0 6 8 5 2 C STA F S T FLG0 2 0 8 A 9 0 1 LDA IM $ 0 10 2 0A 8 5 6 0 S TA TUNT SL0 2 0 C 8 5 A 8 S TA LNTT S L

0 2 0 E 8 5 2 7 S TA TNOTE0 2 1 0 A 9 1 0 LDA IM $ 1 00 2 1 2 8 5 2 4 S TA TLENTH0 2 1 4 A9 0 6 NUNOTE LDA IM $ 0 6I NI TI AL IZ E N OT0 2 1 6 8 5 2 5 S TA NOTPTR0 2 1 8 A 9 OF LDA IM $OF0 2 1A 8 5 2 6 S TA KEY PTR0 2 l C 2 0 4 0 I FP LAYSJ S R KEV INTES T KEY PAD FO0 2 1 F 2 0 6A I F J S R GETKEY0 2 2 2 C 5 2 6 CMP KEYPTR0 2 2 4 FO 2D SEQ GTNOTE0 2 2 6 C 9 0 0 CMP IM $ 0 0 FORRE S T0 2 2 8 FO 2 0 S EQ GTRE S T0 2 2A A 5 2 C LDA F S T F LG TE ST FOR F Ii0 2 2C C 9 0 0 CMP IM $ 0 00 2 2 E FO 1 2 S EQ NOPLAY0 2 3 0 C 6 2 6 DEC KEY PTR S ET UP FOR NNO0 2 3 2 C 6 2 5 DEC NOTPTR0 2 3 4 1 0 0 2 S P L DELYA0 2 3 6 3 0 DC BM I NUNOTE

DELYA LDXZDEXSTXZBNEJMP

DELAYA DELA Y

DELAYAPLAYBSVNOTE

0 2 3 8 A6 3 00 2 3A CA0 2 3 B 8 6 3 00 2 3D DO DD0 2 3 F 4C 6 5 0 2

0 2 4 2 C 6 2 60244 C 6 2 50 2 4 6 1 0 D40 2 4 8 3 0 CA

0 2 4A A 9 0 10 2 4 C 8 5 2 C0 2 4 E 8 5 2 70 2 5 0 4 C 6 5 0 2

NOPLAY DECDECS P LBM I

KEYPTR S ET UP FOR NNOTPTRP LAYBNUNOTE

GTRES T LDA IM $ 0 1 LOAD RE STSTA F ST F LGSTA TNOTEJMP SVNOTE

June 1979

Page 49: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 49/66

ENCLOSURE

2AC A5 20 DELAY LDA DELTIM GET DELAY VALUE WITH BU ILT IN

2AE 85 21 STA TIMED POWER SUPPLY2BO A9 FF DELA LDAIM$FF LOAD TIMER SPECIFICATIONS:

2B2 8D 04 17 STA TIMER INPUT: 11 01 2 20VAC_Hz

2B5 2C 07 17 TEST BIT TTIMER TEST TIMEROUTPUT: + 5 V 0 SA

+2 .V@1A

2B8 10 FB BPL TEST BRANCH IF NOT RUN OUTG RO UN DE D T HR EE ·W lR E U NE C OR D

2BA C6 22 DEC TIMECREDUCE TIME VALUE O NIO FF S WIT CH W IT H P Il.O T U GH T

2BC DO F2 BNE DELASTART AGAINEncloou ....... _lor Ih i AIM.net . .. ..ddla_I ..... "" M EM OR Y PL US or V ID EO P LUS

2BE C6 21 DEC TIMED REDUCE DELAY VALUE AIM and AIM PLUS: $475 00

2CO DO EE BNE DELA BRANCH IF NOT DNOEAIM PLUS: $1()()OO

2C2 60 RTS

253 A9 01255 85 2C7 A6 259 A9 0025B 85 2825D 85 2925F B5 00261 85 27263 86 32

265 20 56 03268 20 86 0326B 20 DA 0326E 20 00 03271 20 40 IF274 20 6A IF277 C9 03279 FO 1627B 20 40 IF27E 20 6A IF281 C9 11283 FO 13285 20 40 IF288 20 6A IF28B C9 1228D FO 15

28F DO 8B

291 A9 01293 85 23295 4C 14 02

298 A9 0029A 85 36

A2 FF9A

29F EA2AO EA2Al 4C 00 02

2A4 A2 FF2A6 9A2A7 EA2A8 EA2A9 4C 00 Dl

2DD

June1979

GTNOTE LDAIM $01 LOAD FIRST NOTE FLAGSTA FSTFLGLDXZ NOfPTR LOAD CHOSEN NOTELDAIM $00STA HIFLGSTA SHPFLGLDAZX NOTESTA TNOTESTXZ PNTPTR

SVNOTE JSR GETHI GET HIGH NOTEJSR GETSRP GET SHARP NOTEJSR GTLNTH GET LENGTHJSR PLATUN PLAY NOTEJSR KEYIN TEST TO SAVE NOTEJSR GETKEYCMPIM $03BEQ SAVEJSR KEYIN TEST OFR START OVERJSR GETKEYCMPIM $11 DA= DO AGAINBEQ DOAGNJSR KEYIN TEST FOR DIPSLAY NOTEJSR GETKEYCMPIM $12 = +

BEQ DNOTES

BNE PLAYB

SAVE LDAIM $01 SAVE NOTESTA SAVFLGJMP NUNOTE

DOAGN LDAIM $00 RESET NOfE COUNTERSTA NOTCNTLDXIM $FF RESET STACK POINTERTXSNOP PADDINGNOPJMP NUTUNE

DNOTES LDXIM $FF RESET SfACK POINTERTXSNOPNOPJMP DISNTS JUMP TO DISPLAY NOTES

DELAY SUBROUTINE

ORG $02DD

TONE SUBROUTINE

by Commodote

lite OriaiR; ll6S01 Sy. tem

MICRO 13:49

20 mA Curren' loop TTY Intm~«

Aud io CURft e I nt er f. lc e

1S UHr 110 l in er.

l lnterv. l1 Time, .

1k+ RAM

2k kiM Monitor ROM

kIM-1: $1eooo

The Ult imate Enclosure

for the KIM·1

P ro te ct s ' ro ur k iM ·'

Nut, Ath.. ctiYe, ProfHlional

fullAce", to the (~mion .andAppliation Conn«ton

ENCLOSURE PLUSfor KIM: S3()OO

Room for the k1M-1 .. nd OMAdditioNl lewd IUd. M

MEMORY pLUS o rVI Dl O PLUS.

by Roc::kwll ' l I ln~rnational

T he Compl et e . SOl S"ltem

Hi lh Sp ee d Aud io C .. ue tt e

keyboard verwriie Bk ROM Monitor

AIM l i5 : 1 37$1101k RAM-MZOOO4k RAM

I TN. II.'7/258-384'

@@~~(!JJtr~~o§tr ,_1 1 ~PO Box 3 INC-Chelmsford. m A 0182<4

Page 50: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 50/66

M IC RO 1 3:5 0

0 2DD A9 0 1 TONE LDA IM $ 0 1 OP EN PORTo2D F 8D D l 1 7 STA PADD2E 2 A9 2 0 SOUNDLDA IM $ 2 0 START T IMERo2 E 4 8D OF 1 7 S TA ST lMERo 2 E 7 A 6 2 B NOTEXLDXZP RMN oT NO TE FR EQU0 2 E 9 CA NWA I TDEX0 2 EA DOFD BNE NWA I T0 2 EC EE 0 0 1 7 I NC PAD T OG GL E O UT PU0 2 E F A9 8 0 LDA IM $ 8 0 T ES T C OU NT ER0 2 F l 2 C 0 7 1 7 B I T T T IMERo2 F 4 3 0 0 3 BM I T IMoUTo2 F 6 4 C E 7 0 2 JMP NOTEXo 2 F 9 C 6 2D T IMOUTDEC PL EN TH N OT ELENGTHo2 FB DO E 5 8NE SOUND0 2 FD 6 0 RT S

PL AY T UNE S oBR OUT INE

0 3 0 0 ORG $ 0 3 0 0

0 3 0 0 A5 2A P L AT U NLDA NoTNUMSET UP F IR S T0 3 0 2 8 5 2 E S TA TNTNUM0 3 0 4 A 9 0 0 LDA IM $ 0 0

0 3 0 6 8 5 2 F S TA NEXN oT0 3 0 8 A5 2 7 LDA TN o TEP LAY NOTEo 3 0A 8 5 2 B S TA PRMNoT0 3 0C A 5 2 4 LDA TLENTH0 3 0E 8 5 2D S TA PLENTH0 3 1 0 2 0 DD 0 2 J SR TONE0 3 1 3 A 5 2 3 LDA SAVFLGTES T FOR SAV0 3 1 5 C 9 D l CMP IM $ 0 13 1 7 FO l A BEQ SAVEX0 3 1 9 A 5 2A LDA NOTNUM TEST FOR No 3 1 B C 9 0 0 CMP IM $ 0 0 ( NO T R EQ UI RE0 3 1D FO 1 3 BEQ RETURN0 3 I F A 6 2 F P LAYCLDXZNEXNOT LOAD NEXTNOTE0 3 2 1 8 5 6 0 L DAZ X TU NT BL0 3 2 3 8 5 2 8 S TA PRMNOT

0 3 2 5 8 5 A 8LDAZX LNTTBL LOAD NELENGT

0 3 2 7 8 5 2D S TA PLENTH0 3 2 9 2 0 DD 0 2 J SR TONE PLAY NOTEo 3 2 C E 6 2 F INC NEXN oT SE T UP FORo 3 2 E C 6 2 E DEC TNTNUM NEXT NOTE0 3 3 0 1 0 ED BPL P LAYC0 3 3 2 6 0 RE TURN RT S

0 3 3 3 A 9 0 00 3 3 5 8 5 2 30 3 3 7 A 9OJ0 3 3 9 8 5 2 70 3 3 8 E 6 2A0 3 3D A6 2Ao nF A 5 2 B0 3 4 1 9 5 6 00 3 4 3 A 5 2 40 3 4 5 9 5 A 80 3 4 7 2 0 AA03o 3 4A 4C 0 0 0 3

SAVEX LDA IM $ 0 0 RE S ET SASTA SAVFLGLDA IM $ 0 1 NO PLAYSTA INOTEINC NoTNUM LOAD NOTLDX Z NOTNUM TUNETABLDA PRMNOTS TA ZX TU NTB L

LDA TLENTH LOAD LENSTAZX LNTTBL INTO LENJ SR D I S P LYJMP P LATUN

0 3 5 6 ORG $ 0 3 5 6

June 1979

Page 51: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 51/66

6 2 0 4 0 I F3 5 9 2 0 6A I F3 5 C C 9 0 73 5 E DO 1 53 6 0 A 5 2 93 6 2 C 9 0 03 6 4 F O 0 93 6 6 A 6 3 23 6 8 B 5 1 53 6A 8 5 2 76 C 4 C 7 5 0 36 F A 6 3 27 1 B 5 0 77 3 8 5 2 77 5 6 0

8 6

8 6 2 0 4 0 I F8 9 2 0 6 A I F8 C C 9 0 58 E DO OA9 0 A 9 0 19 2 8 5 2 99 4 A 6 3 29 6 B 5 DE

8 5 2 7A 6 0

AA

AA A9 8 0AC 8 5 3 3AE A 9 7 FBO 8D 4 1 1 7B 3 A 2 0 48 5 AD F F8 7 B 5 5 38 9 8D 4 2 1 7C 8 5 5 88 E 8 0 4 0 1 7C l 8 8C 2 DO FDC 4 CAC 5 1 0 E E

C 7 A 4 3 3C 9 8 8CA 8 4 3 3CC DO E 5CE A 5 3 60 0 C 9 4 80 2 DO 0 3D 4 4 C 0 001

Jun. 1979

GE T H IGH SUB ROUT INE

G ETH I J S R KEY IN T E S T F OR H IGH NOTEJ S R GETKEYCMP IM $ 0 7BNE RE TRNBLDA SHP F LG T E S T S HARP NOTECMP IM $ 0 0 ( N OT R EQU I R ED )B EQ LOADH IL DX Z PN T P T R LOAD H IGH SHARP NOT EL DA ZX H IS HR PS TA TNO f EJMP RET RNB ( COU LD HAVE BE EN R T S )

LOADH I LOX PNT P TR LOAD H IGH NOTEL DA ZX H IN OT ES TA TNOTE

R ETRN B RT S

ORG $ 0 3 8 6

G ET S HAR P SUBR OUT INE

GET SR P J S R K EY IN TE S T FOR SHARP NOTEJ S R G ETK EYCMP IM $ 0 5BNE RET RNCLDA IM $ 0 1 L OAD SHARP F LAGSTA SHP F LGLDX Z PNT P TR LOAD SHARP NOTEL DA ZX S HP NO TSTA TNO TE

RET RNC RT S

ORG $ 0 3AA

D IS PL AY S AV E S UB RO UT IN E

D I S P LY LDA IM $ 8 0 L OAD D I S P L AYSTA D ELAY C L IGHT T IMELDA IM $ 7 F S E T D I R ECT I ON REG I S T ERS TA SADD

RE P EAT LDX IM $ 0 4 S E T UP 4 L E TTE R SL I GHT LDY IM $ F F AND DELAY

LDAZX L ETNUM L IGH T LET TER SS TA S BDL DA ZX L ET TE RS TA SAD

WA I T Y DEYBNE WA I TYDEXB PL L I GHT

LDY DELAYC DELAYDEYSTYBNELOACMP IMBNEJMP

D E LAY

GET NEX T LET TER

DELAYCRE P EATNOTCNT$ 4 8I NCNOTD I SNT S

T E S T FOR 7 2 NO TE S4 8 HEX= 7 2 D EC IM AL

~®w~~ [;)~[!!)@l.m

~ ~~~~~ ~ ~I? ~Hl

All METAL HEAVY Dun CAS(

OHIOFF SWITCH and PILOT LICHT

115/60lh Of 23OtSOHzINPUT

CROUNDED THIEE-WIIE

rOM. COlO

POWER PLUS 5: + 5V 0 'SA, ± 12V 0 '1A 575 00

POWER PLUS SUPER 5: + 5V 0 'lOA, ± 12V 0 '1A 59510POWER PLUS 5124: + 5V 0 '5A, + 24 0 '2.SA, ± 12V 0 '1A $950 0

SPECIFICALLY DESIGNED FOR THE AIM 65

Worb on 11SV"Otbar l3IV150fb.

Prowides . . . . ted + S\I .. SA ... + U\' .t 14

GroundedT1fte-WiTe'ower Cord

OHIOFf Swib: h ilnd 'ilot LiahtPOWER A PLUS: s SOOO

ALL THE POWER AKIM-1/SYM-1 NEEDS

Hm, C OM p K t .(cOftOf'nllal

T'ho.tsuMh i n U se

INPUT: 115VI"'tL

OUTPUTS:lep' . . .. ed + SV at 1.4.4+12V.11.oA.

U"' ........ + 1\1.... &.lA+1,\I..,101.oA

WiU Power . IU"M/S1'M-1 _ o n e..ck_ .......

5udI .. MEMORV PLuS or VIOIOPLUSPOWER PLUS: S 4 0 0 0

SUPERSCOPE C-190by Marantz

"H"'QoaIIty~."""".nth.N of .. FealUrf t Required'Of MicfoaMnputefSyt1et115:

vu_DIrtoIa ............. LnoI

11ev AC or ""DC or•• n.ry Op.ntion

r .p el .o cM: io IIC . ... .. 'n . -._ . ._'v.,lUte 5pM4 CoetroI: ±."I IfMOR Control Le. . .. . E6ect ronia ON

SUPERSCOPE C-190: S 9 ( ) OO

PO Box 3S Chelmsford. m A0182'-

MICRO 13:51

Page 52: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 52/66

Page 53: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 53/66

THE MICRO SOFTWARECATALOG: IX

Mike RoweP.O. Box 64

S. Chelmsford, MA 01824

Name: MASTER CATALOGSystem: Apple II with diskMemory: 32K (min)Language: Applesoft II and machine languageHardware: Apple II, Disk IIDescription: MASTER CATALOG creates a singlealphabetized file and listing of each diskette catalogentry by program name, volume number, and programtype. MASTER CATALOG will help you locate your pro-grams. A machine language sort will speed the sort byprogram name or volume number.Copies: Just releasedPrice: $S.OOIncludes: Cassette and instructionsAuthor: Alan G. HillAvailable from:

Alan G. Hill12092 Deerhorn Dr.Cincinnati, Ohio 45240

Name: BASIC OPTIMIZERSystem: Apple IIMemory: 24K(mln) Cassette version, 32K(mln) DiskversionLanguage: Interger BasicHardware: STANDARD (DOS for Disk Version)Description: Restructures your basic program by

eliminating all remarks, condensing code to longstrings, eliminating unneeded line numbers and renam-ing numeric variables. In affect, the Optimizer creates aproduction program. You will get a 10% to 40% in-crease in the speed of execution by running your pro-gram through the Optimizer. Now you can write yourprogram with all the remarks you need; give yourvariables meaningful names. After the program is done,let the Optimizer create a fast efficient productionversion.Copies: Just releasedPrice: $19.95 for Cassette Version. $25.95 for Disk Ver-sion. Texas residents add 5% sales taxIncludes: Cassette Version: Cassette and Instructions.Disk Version: Diskette with sample program and

instructions.Author: Bruce H. BarberAvailable from:

Bruce H. Barber11803Rosewood DriveHouston, TX 77070

J u n e1179

Name: PET PILOTSystem: PETMemory:SKLanguage: BASICHardware: Student use: no extra hardware.Teacher use: cassette #2Description: Full Pilot for PET, with full BASIC in Cstatements & programs to SOK characters. No morememory limitation on program size: you can write realcourses in this PILOT.Copies: Release date 4·15·79,5 test sites.Price: $12.00 postpaid in US(prepaid orders only)

Includes: Teacher's Manual Cassette, Reference Card,Licence for 1machine.Order Info: Must be prepaid and include PET serialnumber.Author: DaveGomberg + Martin KampAvailable from:

DaveGomberg + Martin Kamp7,Gateview CourtSan FranciSCO,CA 94116

Name: Series OneSystem: PETMemory:8KLanguage: Not SpecifiedHardware: Basic SKPETor 16132KFull·keyboard PET

Description: Series One is a collection of 25 programsfor the Commodore PET personal computer. For lessthan one collar each, Series One contains 16 gamesand 9 general programs. Games include Space Wars,Motorcycle Jump, Saucer Attack, Ping Pong, BombSquad, Crack the Safe, Bombs Away, Bite the Wall,Auto Race, Break Away, and six others. Other programsinclude Mortgage Loan, Perpetual Calendar, Elemen·tary Math, Savings Account, Clock, and more. Most pro-grams take full advantage of the graphics capability ofthe PET.Copies: Not SpecifiedPrice: $24.95Includes: Not SpecifiedAuthor: Not Specified

Available from: Local PET Dealers, or,ADPSystems95West 100 SouthLogan, UT84321

M ICRO 13 :5 3

Page 54: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 54/66

Name: An 8080 Simulator for the 6502 - KIM·1 VersionSystem: KIM·1Memory: 1KLanguage: Assembly language.Hardware: Unexpanded KIM·1 and (optionally) 8switches, 1 resistorDescription: Executes the full 8080 instruction set asthough KIM were an 8080·based computer. Supportsslnqle-step, trace and run modes and allows monitoringand modification of all Internal 8080 registers. Userdefinable input and output ports, breakpoints and ac-

cess to 6502 subroutines directly from 8080 programs.Up to 224 bytes of 8080 programming space availableon an unexpanded KIM-1. Also simulates 8080 inter·rupts. An excellent training aid for 8080 programmingand useful for debugging 8080 code as well as for run-ning non-time dependent 8080 application software.Can be relocated in ROM.Copies: 90+Price: $18.00 + $1.50 Shipping & Handling. Californiaresidents must add 6% sales tax.Includes: KIM-1 format cassette tape, User Manual,Assembly Source and Object Listings and 8080 Time-Of-Day Clock Demo.Order Info: Send check or money order.Author: Dann McCrearyAvailable from:

Dann McCrearyBox 16435-MSan Diego, California 92116

Name: Light Pen No.4System: AppleMemory: 16K and ROM Board, and Light PenLanguage: Apple II SoftDescription: Program allows user to plot points on thescreen in Low-Res, than converts the data to Hi-Res.Plot can be in colors.Price: $34.95 + $1.00 postage & handling (PA res. add6% sales tax)Includes: Light Pen and 4 other support programsCopies: 20

Author: Nell D. LipsonAvailable from:Progressive SoftwareP.O. Box 273Ply. Mtg., PA 19462

Name: Morse CodeSystem: AppleMemory: 16KLanguage: Integer BasicDescription: Program allows user-to learn morse codeby typing English into computer and having morse codedots and dashes appear on the screen and hearing thebeeps (audio) at the same time. Program has transmis-sion speed control.

Copies: 10Price: $9.95 + $1.00 postage & handling (PA residentsadd 6% sales tax)Includes: Cassette with instructionsAuthor: Ed HanleyAvailable from:

Progressive SoftwareP.O. Box 273Ply. Mtg., PA 19462

MICRO 13:54

Name: GRAFAXSystem: OSI Challenger liPMemory: 4k (6k optional with buffer)Language: BASIC and machine languageHardware Required: Challenger II(SOX cpu,540 videowith graphics rom, polled keyboard)Description: If you have OSi's rom graphics generatorchip then you have been looking for GRAFAX! GRAFAXis designed to give you finger-tip control over the fullOSI graphics capabilities. You no longer will needlaborious poke list, BASIC string conversions, or

machine language kludges just to get something on thescreen. GRAFAX uses Single key-stroke commands forcursor movement, character selection, 32164 format,screen save/restore (optional, requires at least 2k rambeyond the basic 4k machine), and cassette savelload.GRAFAX is not an X-Y plotter, but rather a full screenimaging tool carefully devised to free your creativeability for drawing instead of programming.Copies: New, just released.Price: $10.00 + 1.00 postage (USA)Includes: 300 baud cassette (BASIC/machine languagesource, sample screens), and documentation.Author: Mark BassAvailable from:Mark Bass269 Jamison DriveFrankfort, Illinois 60423

Name: Polar Coordinate PlotSystem: AppleMemory: 16K and ROM BoardLanguage: Apple II SoftDescription: A high resolution graphics program.whichplots polar coordinate equations (4 classic equationsand user's own equation). After plot is completed, data(in cartisian and polar coordiante system) will appear onthe screen in a summary table form so that the plot canbe easily duplicated.Copies: SOPrice: $9.95 + $1.00 postage and handling (PA

residents add 6% sales tax)Includes: Cassette with instructionsAuthor: T. David MotelesAvailable from:

Progressive SoftwareP.O. Box 273Ply. Mtg., PA 19462

Name: DISC COpySystem: Apple IILanguage: Applesoft IIHardware: Apple II, Disc IIDescription: For those Apple owners who have onlyone disc drive but would still like to copy discs thatcontain Integer Basic and Applesoft programs, this

two-part program Is a must. It results in an automaticsystem that can copy a whole discs worth of programs.Price: $15Copies sold: Just releasedAuthor: Jules H. GliderAvailable from:

Softsell Assoclates2022·79th StreetBrooklyn, NY 11214

June 1979

Page 55: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 55/66

.H n H " H .,

M O R E IN N O V A T IO N S IF R OM

t P.S. SOFTWARE HOUSEFORMERLY PETSHACK

PET"" INTERFACESNEW!

PET to CENTRONtCS INTERFACEPET to PARALLEL INTERFACE wi th 5V .8A power suppl yPET 10 2nd CASSETTE INTERFACE

PET"" SCHEMATICSFOR ONLY $24. 95 YOU GET:24" X 30" SChemat ic of the CPU board, plus oversized schematics of the Vi deoManilor and Tape Recorder, plus complete Parts layout· all accurately andpains takingly drawn to the minutest detail

PETTI'ROM ROUTINESFOR ONLY $19.95 YOU GET:Complete Disassembly l is tings of al l 7 ROMS, p lus i den ti fi ed sub rout ine ent rypoints; Video MonHor, Keyboard routine , Tape Record and Playback routine , RealTime C lock, e tc. To ent ic e you we ar e a ls o I ncl udi ng ou r awn Machi ne LanguageMonitor program for your PET uSing the keyboard and video display.You can have t he Moni to r p rog ram on cas se tt e f or onl y 59, 95 ex tr a.

SOFTWARE:6502 DISASSEMBLER $12.95MAILING LIST· Forpersonal Or business applications. $9.95MACHINE LANGUAGE MDNITOR· Wri te Machi ne Code . Save on t ape $9 .95BUDGET· NEW· Keeptrack of BllsandChecks. Update asneeded $14.95STAATREK . An-ume favorite written tor the PET's special.Graphics $ 7 .95

Sand (or oar f ree SOFTWARE BROCHURE. Dea le r inqui ri es welcome.

P.S. SOFTWARE HOUSEP.O.Box966 Mishawaka,IN46544

[II Tel: (219) 255-3408 C E lP n •• '_ d~"__

, " _ u I" .

PET SPECIALSL I ST SAlE

PE T16K $ 995 $ 860PE T32K $1295 $1125PE T8K $ 795 $ 695PE T2040 DualDi sk $1295 $1125PE T2023 Pr in t e r( pre ss ure f ee d) $ 849 $ 750PE T2022 Pr in t e r(tra cto r fe ed ) $ 995 $ 860

SYM-1 $ 229$ 199$ 3 2 5$ 99

KIM-1 $159Memory P lusSEA-16 New 16K Static RAMseawen Motherb oard -4K RAM sp ace

(FORKIMS YM

AIM)

3M "Scotch" 8w d i sksVe rb atim 5 " d is ke tte s S A L E

10/$31,0010/$28.50

2114 L 450 ns 4K Static HAM27 16 EPHOM (5 v olt)P rog ramming the 6502(Zaks)65 02 App lic atio ns B oo k(Zaks)65 00 P ro gramming Manual(MOS)65 00 H ardwa re Manua l(MOS)First Book of KIMProg ramming a Mic rocompu te r: 6502(Foster)

$ 6.95$ 45

$ 9.90$11.90$ 6.50$ 6.50$ 8.90$ 8.90

Ca l l1_ t t a s( all ta pe s g ua ra nt ee d)Prem ium quality, high outp ut lownoise in 5 screwho using w ith lab els :

C-10 10 /5.95 50 /25.0 0 10 0148.0 0C-30 10 /7.0 0 50 13 0.0 0 10 0/57.0 0

W R IT E F OR 6 50 2 A N D S ·1 () IJ P RO DU CT L IS T

115 E. StumpRo a dA B ComputersM o ntg om e r yv ille . P - A 1 8 9 3 6

(215) 699-8386

$98.00$74.95$49.95

INTRODUCES THE 6502 SERIES

L E A D E R INC O m pU TE R E DU CAT IO N

513.95

6502APPUCAnONS BOOK

PRO GRAmmiNG THE 6502~ Rodnay Zaks

320 PP. ret C202

6502 APPLICATIONSBOOKby Rodnay Zeks

510.95 275PP. ref 0302 512.95

AVAILABLE AT BOOKSTORES. COMPUTER. AND

ELECJRONIC SHOPS EVERYWHERE

82020 MIMo StreetBerkeley, CA94704

Tel 41 5 8 48 -8 233 Telex 336 311

N A M II:. .E P O S IT IO N _CQMPANy _

ADD~~ __

CITY S TAT E I Z I POcharge my: OVisa OM.C. OAmerlcan Express

0C202 00302 0G402Number'- --"xp. date _

Signature- D Send Free Catalogue

An introductory programming

text for Ihe 6502. Does not

require any prior programming

knowledge. From ari lhmetic

10 interrupt-driven input-output

techniques. It has been de-

signed as a progres sive, st ep

by step course, wilh exercises

in the texl designed to test the

reader at every s tep.

6502 GAmESByRodnay Zeks

retG402From Piano to tic tac toe, in-

c luding many popular games,

and how to program your own.

To be published.

Presents a series of practical

(hardware & software) applica-

t ions for any 6502 board.

Applications can be used as

expe riment s - or implemented

at minimal cost. A few ex-

amples: morse generator, elec-

tronic piano, digi tal dock,

home alarm systems, traffic

controller .... and morel

TO ORDER.yp...._,415s.8-8233, Visa. M.e.,Americon Express.

IIy.... 11: Include payment.

Ihtpp'''' ....... ' add 65 e per book4th dOH -al low.t weeks • or $I,SO

per book for U.P.S. Ove,...,. add$3.00per book.

, • • : i nCali forn ia odd tax.

Page 56: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 56/66

compaamicrosystems

224 S. E. 16th StreetP.O. Box 687

Ames, Iowa 50010Phone 515-232-8187

single board computers

C/B I

THE 6500 BASED SINGLE BOARD COMPUTERYOU HAVE BEEN LOOKING FOR

An industrial quality 6500 based single boardcomputer produced by the company knownfor quality 6500 hardware and software. CSB 1includes a 6502 processor, four ROM/EPROMsockets, 2K bytes RAM(2114), two PIA(6520)and one VIA(6522) chips. All addresses areswitch selectable and a single + 5 volt powersupply is needed. Board size is 6 by 9.75

inches. The gold plated edge connectoradheres to the SYSTEM 65 bus standard.Single quantity price is $595 with substantialquantity discounts available. Other CSB boardproducts are available or in design. Call ustoday for further information on our CSBfamily or any of our other 6500 supportproducts.

Page 57: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 57/66

Sym·1: Speak To Me

If you want you computer to carry on some snappydialog, you are a real dreamer. But, here are some tech-niques to get you started with limited speech for yourmicro.

In the February issue of KILOBAUD Icame across an interesting article byRobert Bishop. In this article the taperecorder input line was used to sample avoice signal and the tape recorder outputline was set high or low depending onthe sample. Hopefully the resultingsquare wave pattern contained enoughof the voice's original fundamental toreproduce an understandable signal. Aprimitive form of speech synthesis In-

deedbunlllis idea didStar:nhewheelsrolling in my-head-. -_. .-.

Since we are dealing with square wavesand not discrete samples at variousamplitudes, I thought the sampling fre-quency would need to be much higherthan the theoretical two times thereproduceable frequency. I wrote the ac-companying short program which reosuits in slightly over 40,000samples persecond. That's about the limit of theSYM·1and I figured that should do it forvoice. I used my stereo receiver to tur-ther help as it has reasonably goodamplifiers. I put my cassette deck onrecord-pause and plugged in a micro-

phone. The tape deck output went to theSYM for sampling on the SYM's normaltape input l ine. The SYM's tape outputline was connected to one of the taperecorder inputs on the stereo receiver.

At this point I began executing the pro-gram and listened to the fruits of mylabor - sour asthey were.The resultingsound reminded me of a small speakerdriven to distortion although it wasunderstandable. The recording level con-trol was critical. Remember the SYMsees either a "1" or a "0". The inputsignal must vary enough to trip the inputline. If the volume is too high then toomany 1'swil l be "seen." If the volume is

too low then nothing will be heardas theinput l ine will remain a zero. Whist lingacross (not into) the microphone pro-duced good results. Playing some of mymusic tapes also was interp~~ing. Onlythe foreground sounds were "repro-duced." The background sounds didn'thave enough volume to trip the logiclevel.

une 1979

Primit ive as this is, i t is good enough touse for computer - to-user communlca-t ions. However, this will require enor-mous amounts of memory which placesa damper on things. Thesampling rateofmy program would fill 5K of memory inabout 1 second. An option would be toreduce the sampling rate. I did this butthe results were very poor. Rememberthis method is using a square wave.At a10,000 samplefsecond rate too little in'

formation remained and harmonics fromthe square waves interferred. Changelocation '225 and '231 to hex 33 and seefor yourself. By changing location '234.you can vary the sampling rate. "Ed" willresult in 10,000samplefsecond. Try "do"and whistle into the microphone. You'llhear the unwanted harmonics soabundant in a square wave.

I had thought of plagerizing the system'stape recordfplayback routines In order tostore the square wave on tape instead ofusing memory. However, in the highspeed format I could only store about1500 bits per second (185 8 bitcharacters per second) which is far too

Jack Gieryic2041138thAve. N.W.Anrlover, MN 55303

low a sampling rate to be useful.Perhaps a floppy disk would havea highenough data transfer rate to be of someuse.This is food for thought.

Ifanyof you are still seriously interestedthen I would suggest an 8 bit analog-to-digital convertor to digitize the data. Thedata could then be sent through an 8 bitdigital·to· analog converter to reproducethe signal. Much lower sampling rates on

I

the order of 5,000 to 8,000 samptesrsec-ond could be used for voice. However,even at 5,0008 bit samples per secondyou would st il l consume 5K memory inone second.

The approach of recording all char-acteristics of speech for either recogni·tion or future reproduction deserves areassessment. Perhaps there is somekey remaining to be discovered whichwill enable the computer to use speechwith a very limited amount of data. Soft·ware may needa greater hardware assistinorder to accomplish what seems to bea difficult task. The near future may pro-vide the answer.

MICRO 13:57

Page 58: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 58/66

SYM SPEAK TO ME

BY JOHN G I ERY ICMAY 19 7 9PAGE ZERO EQUATE

0 2 3B MASK * $ 0 0 0 1SY M R EG IST ER E QUATE S

0 2 3B0 2 3B0 2 3B0 2 3B

VORBX*VDDRB*ORB *DDRB *

$AOOO V IA OUTPUT REG I S TER B$A0 0 2 V IA DATA D IRECT ION REG I STER$A4 0 2 6 5 3 2 OUTPUT REG I STER B$A4 0 3 6 5 3 2 DATA D IRECT ION REG I S TER

0 2 0 0 ORG $ 0 2 0 0

0 2 0 0 A 9 0 7 START LDA IM $ 0 7 SET UP MASK0 2 0 2 8 5 0 1 STA MASK0 2 0 4 A 9 0 0 LDA IM $ 0 0 SET DATA D IRECT ION FOR INPU0 2 0 6 8D 0 2 AD STA VDDRBIN V IA0 2 0 9 A9 B F LDA IM $BF SET DATA D IRECT ION FOR O

0 2 0B 8D 0 3 A 4 STA DDRB6 5 3 20 2 0 E A9 0 7 LDA IM $0 7TURN B I T ON - OUTPUT0 2 1 0 8D 0 2 A 4 STA ORB 6 5 3 2

0 2 1 3 AD 0 0 AD LOOPALDA VORBXSAMPLE V IA INPUT0 2 1 6 2 9 4 0 AND IM $4 00 2 1 8 FO OD BEQ LOOPBI F ZERO , GO CLEAR B I T0 2 1A AD 0 2 A4 LDA ORB I F NOT ZERO , S ET B I T0 2 1D 2 9 F 8 AND IM $ F 80 2 1 F 4 5 0 1 EOR MASK0 2 2 1 8D 0 2 A4 STA ORB OUTPUT0 2 2 4 4 C 1 3 0 2 JMP LOOPA

CHANGE ABOVE TO JMP DELAY TO CHANGE THESAMPLE RATE FROM 4 0 , 0 0 0 TO 1 0 , 0 0 0 CP SLOC AT ION 2 24= 3 3ALSO CHANGE LOCAT ION 2 3 1 .

0 2 2 7 AD 0 2 A 4 LOOPB0 2 2A 2 9 F e .0 2 2 C EA0 2 2D 8D 0 2 A40 2 3 0 4C 1 3 0 2

LDA ORBAND IM $ F 8NOPSTA ORBJMP LOOPA

CHANGE ABOVE TO JMP DELAY TG CHANGE THE

SAMPLE RATE FROM 4 0 , 0 0 0 TO 1 0 , 0 0 0 CPSLO CAT ION 2 31= 3 3AL SO CHANGE LOCAT ION 2 2 4 .

CLEAR B I T

FOR T IM INGOUTPUT

0 2 3 3 A2 ED0 2 3 5 E 80 2 3 6 DO FD0 2 3 8 4 C 1 3 0 2

DELA Y LDX IM $EDLOOPC INX

BNE LOOPCJMP LOOPA

9 6- M IC RO S ECOND D E LAY

MICRO 13:68 June 1979

Page 59: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 59/66

Exidy Sorcerer $895

Which of SOL-20

thesecomputers ....is for ~Ou? Bally Arcade

Heathkit H-8 $375

CREATIVE COMPUTING magazine is Num-ber 1 in hardware, software and systemevaluations. In-depth, thorough evaluationsgive you the facts before you buy. CreativeComputing was the first to review these nowpopular systems: Radio Shack TRS-80,Exidy Sorcerer, VideoBrain, Heath H-8,Bally Basic, OSI Challenger, and manyothers. More important, we also review

peripherals and software from independel'lts Radio Shack TRS-80as well as manufacturers. $599

$1600

$399

:~.=:., r: ! I.,1 .

Ohio Scientific C2-4P $598

And what are 3 ' OUgoingto do with it?

CREATIVE COMPUTING has long been Number 1 inapplications and software for micros, minis, and time-sharing systems for homes, schools and small businesses,Loads of applications every issue: text editing, graphics,communications, artificial intelligence, simulations, database and file systems, music synthesis, analog control.Complete programs with sampie runs. Programming

techniques: sort algorithms, file structures, shuffling, etc.Coverage of electronic and video games and otherrelated consumer electronics products, too.Just getting started? Then turn to our technology

tutorials, learning activities, short programs, andproblem solving pages, No-nonsense book reviews, too,Even some fiction and foolishness.

Subscriptions: 1 year $15, 3 years $40. Foreign,add $9/year surface postage, $26/year air, Order and

payment to: Creative Computing, attn: Ellen, P.O.Box 789-M, Morristown, NJ 07960, Visa or MasterCharge acceptable by mail or phone; call 800-631-81129 am to 5 pm EST (in NJ call 201-540-0445).

CREATIVE COMPUTING also publishes books, games,art prints, and T-shirts for the computer enthusiast. The

most popular book of computer games in the world,Basic Computer Games is a Creative Computing book-only $8.50 postpaid.

And now, Creative Computing also produces and mar-kets software for personal computers on tape cassetteand floppy disk.

If your dealer does not carry the full line of CreativeComputing products, write "catalog" on your order andwe'd be happy to send you one free,

cP6atlv6 computlndP. O. Box 789-M, Morristown, NJ 07960

Page 60: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 60/66

Writing For MICRO" you have information you wish to passon to the 6502 community, think ofMICRO first. Since MICRO is devotedsolely to 6502 material, your art icle willprobably be read by more people thanit would be in many of the "general pur-pose" national magazines_ And, MICROpays for articles. You'll never get rich,but you can get enough from an articleto buy that extra memory you want. Also,our policy is to give authors additionalpayments if the material is reprinted.For example, authors whose work ap-peared in the original six issues ofMICRO and were reprinted in "The BESTof MICRO Volume 1" are receivingdouble payment - so it can add up.WHAT TO SUBMIT - MICRO is onlyinterested in things which pertain to the6502 microprocessor. Since MICROtakes the 6502 seriously, it is less in-terested in games than in useful materialsuch as utility programs, tutorials, re-sources, interfacing techniques, and soforth. Complete "ready-to-Ioad-and-go"programs are preferred to "think-pieces". Look at what we have publishedin the past as a guide to what types ofarticles we prefer.TEXT - A" material should be typed,double-spaced on one side on white

paper. Your name and a page numbershould appear on each page. Try to ad-here as much as possible to the formatthat MICRO uses for publication - itsaves us a lot of work. Paragraphs arenot indented, sub-headings are center-ed, figures are referenced as Figure 1(2, 3, . __ n) and tables as Table I (H, "I,IV, ... N). You should suggest a tit le andmay write a brief summary, although thisis not necessary,

PROGRAM LISTINGS - A" listingsshould be printed directly from yourcomputer if possible, with a new blackribbon on plain white paper. If your list-ings are clean enough to print, then wedo not have to typeset them, decreasingthe chance for typos. Since line numbersused by your editor may be removed,please make a" references to your list-ings by address or PCcounter.DRAWINGS and SCHEMATICS - Agood drawing can add a lot of visual in-terest as well as information to your ar-t icle. We do not have any special talentsin this area, plus we may make mistakeswhen redrawing your work. So please, ifat a" possible, submit drawings in ink,ready for reproduction. Since most draw-ings will be reduced to fit into twocolumns - approximately four inches,

keep this size in mind when planningyour work.PERSONAL INFORMATION - Our read-ers would like to know something aboutthe authors. " you submit a short noteabout yourself - your computer experi-ence, talents, interests, plans - we willpublish this along with your article. Youhave done the work, why not enjoy thecredit!RETURN OF MANUSCRIPTS - " youwant your manuscript returned, just tell

us. We will supply the stamp and enve-lope - its the least we can do,PAYMENT - MICRO pays for all articleswhich we publish. You wi" be sent aManuscript Release Form prior to yourarticle being printed. By signing thisand returning it to us, you certi fy that thework you have submitted is yours to sell ,and convey all rights to the work toMICRO Ink, Inc. You will receive sixcopies of your articte.LETTERS, NOTES, ANNOUNCEMENTS,etc. - If you have short pieces of infor-mation that do not fit into the article for-mat, MICRO has a number of ways ofusing them. They may be submitted inalmost any form, even hand-written, andwill be used as the Editor sees fil. Thereis no payment for these submissions,but full credi t is given to the author.

KIM- BUSEXPANSION!AIMTM, V IMTM, (SYM)TM, K IMTM OWNERS(and any other KIMTMbus users) buy thebest 8K board available anywhere:

GRAND OPENING SPECIAL!

HOEBK RAM-S169! 3 for S465!Induslrl.~commerci.1 grade qu.llty: 100hour high t.mp burn-

in: low power: KIM bus compatibl. pin lor pin: super quali ty &r.l i.bll lty . t below 50100 prices (COMMERICALLY r.ted 50100boards cost 25-750/.mor.)_When you .xpand your syst.m, .xp.nd""Ith the bul optimized lor 8 bit CPU'S, the Commodore/MosTechnology 22144pin KIM bus, now supported by Synert.k, MTU,Rockwell Int.rn.t iOnal,Problem Sol_ Systems, HOE,the Comput-.rlst, RNB, .nd others!

KIM-l computer $1711.00: KIM.. Motherboard $119: power sup-ply lor KIM-l .iona-S45: enclOlurelor KIM-1 .Ione S29: HOEpro-totype board with regul.tor, heatslnk, switch eddr_ & decodinglogic Included $fi.!50: book "The Flr.t Book 01 KIM" $9_95: book"Progr.mmlng • Microcomputer: e!502"$8.95:SPECIAL PACKAGEDEAL: KIM-l, power .upply, BOTH books lI.ted .bove, ALL lor12081

HOE FILE ORIENTED DISK SYSTEM (FODS) FOR KIM BUSCOMPUTERSM.k. your KIM (or rel.tive) the be.t 8!502develop-ment .y.tem . " .n .b Ie.t .ny pri c •. Expand wi th HOE'. l ul l .Iz.floppy .y.tem with FODSlEdltor/Asaernbl.r. 2 pa... ... ... bl.r,po_'ul editor compatible with ARESCOIile . KIM bus interf.cecard: lut 8!502contrOller handles data tr.nller at maximum IBMlingle den.lty .peed lor excel lent rel l.bll lty: power supply lor •

drI"u: patches to JOhnson Computer/Mlcroeott BASIC.• 5 daydelivery. Slngl. drlve-$1995 dual drive S27!50 •ShIpping .xtr. unleas order prepaid with cashier'l check ALL

item ........ bIed, te.ted, guaranteed at le•• t 90days.

PlAINBMAN MlCADSVS11!MS [dill. 5C C arpcw ..... )P.D. "1712, Auburn, AI. 3&830: (205)745-77353803 ....... wi PartN.y, o,.IiIut(1..acJG.833-8724) ~1tIII U.s. AI.

Dealers lor 051, COMMODORE, COMt"U'vuLulrI.~ ALTOS

MICRO! 13:60

e A E WA M A S SO C IAT ESv .24000 Bessemer Street

Woodland Hills, cs. 91367

• Tarbell Quality

SHORTYC-10 CASSETTES

• "SCOTCH" brand high out·put/low noise "POSI·TRAK"back treated tape

• Spring loaded pressure pad

• 5 screw take·apart shell• Exclusive e,. label

Stock No_ EAC·10 $13_50/10

CASSETTE LABELS5626-6 Bank Fanfold5826-S Bank FanfoldCLB-R BI.nk Sheet5626-B Bank PackEA-EBEA Printed PackCLP-R Printed Sheet

MAILING LABELS4815-1 21fu15/16 F.nfold $4_40/10005615-1 31fu15/16 Fanlold 4.40/1000

VOLUME AND DEALER DISCOUNTS AVAILABLE

STOCK NO_ QUANTITY PRICE TOTAL

$26.00/20

6 Llne./lnchSUne./lnch1S/Sheet

55_9011005_90/1006,201 904_0011005_50/1007_501 90

EA Label1S/Sheet

Name cal.'Tax6% 1-----;Address L-----~

Clty State Zip _Exp. Dal8 Bank No .. _Card No ___Signature _PREPAID ORDERSSHIPPED POSTPAID

~o. 09

Page 61: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 61/66

Reading P et Cassettes Without a P etIf you have ever wanted to read a program from acassette written for one 6502 based microcomputer onanother type, here is an example which uses a SYM·1 toread a PET cassette. The concepts can be generalized towork with almost any combination of micros.

One of the basic problems in obtainingmicrocomputer software is not that itdoesn't exist but that it waswritten for amachine other than the one it is to beused on. Small programs can betyped inby hand if a hex list ing is available, butlarger programs aregenerally distributedon audio cassettes. By virtue of theirpopularity, theApple II and PEThavethelargest pools of published software oncassette, but that doesn't mean thatowners of less well establishedmicrocomputers like the SYM-1cannottake advantage of existing programswritten for these machines.

All 6502 based microcomputers exceptthe KIM use very simple cassette inter-

face hardware and let the processor doall the work of formatting, encoding anddecoding cassette data, This approachhas the dual advantages of reducingparts count and increasing flexibility and

it means that with suitable software,

users of any particular machine can readcassettes written for any other machine(Apple, PET,OSI,AIM, or SYM).This par-ticular program runs on the SYM-1andreads cassettes written by the PET.It isquite unsophisticated, and doesn't knowthe difference between various blocktypes such as Beginning of File, EndofFile, Program, and Data blocks, and itdoes not strip off countdown bytes orverify checksums. It does check byteparity and will flag anyerrors; it has beenmy experience that if there are no parityerrors, then the data is OK.

Becausethe task of converting softwarefrom one machine to another is non-trivial, it is assumed that only exper-ienced programmers will have occasionto use PETCAS,thus no attempt will bemadeto explain the program's operationor PETcassette format in detail; however

David P_Kemp1307Beltram CourtOdenton, MD 21113

one feature of the program deserves

somecomment --the tuning dispay. "anoscilloscope and a DIA converter areavailable, the display simplifies settingup the program and the recorder con-trols. With the program running and aPET cassette playing, the scope traceshould fall into three distinct levels cor-responding to the three possible t imeperiods between active transitions onthe tape. " the display is not wellclustered or the routfne will 'not work,try exchanging the instructions at loca-tions $6C and $66. (In PET cassettespolarity is significant and this modifica-tion effectively reversesthe audio signalpolarity).

Despite its small size, the programworks quite well --it was originally writ-ten to read a third generation analogdubbing of an 8K program, and it ac-complished that task in one passwithout an error. U

NOW AVAILABLE Basic SoftwareFor S O L-IIA and PET-BK

General Paek I

(Checkbook Balancer, Tic Tac Toe, MetricConversion)

GamePaek2·(children - educational)

$10.95 (Arithmetic God, Addition Dice, Distance =Rate XTime)

General Paek 2(Space Patrol, Biorhythm, Battlestar, One-Armed

Bandit)

Finanela) Paek I

(loans. Depreciation, Investments)

Flnanelal Paek 2(Mortgage & Loan Amortization, Future

Projections, RiskAnalysis)

Stattstles Paek I

(Mean & Deviation, Linear Correlations & Regression. All programs on high-quality cassette tape.Distribution. Contingency Table Analysis) 18.95

18.95 Tape Data Query(File Management System)

12.95

50.00

12.95 PCBOS -a Beal-Tlme OperatingSystem in Ill. KIMBAM

Assembly listing 24.95

12.95 Cassette tape with user's manualSchematic for relay control board

Ga.. ePaekl(Basketball, Object Removal, Bowling. Darts,

Gopher)

Send self-address, .stamped envelope forcomplete software catalogue.

Send check or money order to:

H. GELLER COMPUTER SYSTEMS

(New York residents add appl icable sales tax) Dept. MP.O. Box 350

~~~ ~= -= - = = . .~N~e~W~Y~0~rk~N~e:w~Y~0~rk~100~)40~====~~June 1979 MICRO \13:81

22.95

14.959.95

Page 62: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 62/66

PET CASSETTE READ ROUT INE FOR SYM- l

BY DAVE KEMPJANUARY 19 7 9

PETCAS READS A PET FORMAT CASSETTE RECORAND STORES THE DATA IN A BUFFER START ING$ 2 0 0 . TO RUN IT , TY PE :

.G 0

CONTROL I S RETURNED TO SUPERMON AFTER TF IRST COp y OF THE DATA HAS BEEN READ .LOCAT IONS ADH AND ADL PO INT TO THE NEXTFREE BUFFER lOCAT ION (LAST BYTE READ+ 1 ) .

0 0 7 5 ADL * $OOFO BUFFER PO INTER00 7 5 ADH * $OOF I0 0 7 5 TCNT * $ 0 0 F 2 GETB I T TEMPORARY00 7 5 TPAR * $ 0 0 F 3 PAR IT Y G EN ERATO R T EM POR ARY007 5 PECNT* . $ 0 0 F 4 PAR ITY ERROR COUNT

0 0 7 5 PAR*

$OOFEPAR ITY ERROR MARKERVALUE ARB IT RARY

0 0 7 5 TAPE * $AOOOCASSETTE INPUT PORT ( PB 6 )0 0 7 5 ' O IGANA* $AOO1 D IG I TAL TO ANALOG CONVER

00 0 0 ORG$ 0 0 0 0

PETCAS LDA IM $0 2 SET BUFFER ADDRESS TO0 0 0 A9 0 20 0 0 2 8 5 F l S TA ADH00 0 4 8 5 F4 STA PECNT0 0 0 6 A9 0 0 LDA IM $000 0 0 8 8 5 FO STA ADL

OOOA 2 0 2 F 0 0PETCAJ SR GBYTE GET A BYTEDODD 30 03 BMI PETX0 0OF 4C 0 0 0 0 JMP PETCAS LEADER NOT STABLE YET0 0 1 2 C6 F 4 PETX DEC PECNT BE SURE LEADER I S VAL00 1 4 DO F4 BNEPETCA0 01 6 2 0 2 F 0 0 PETCB J SR GBYTE GET BYTE0 01 9 3 0 FB BM I PETCB LOOP UNT IL END OF LEAD0 01B BO 0 4 PETCC BCSPETCDDATA VAL ID?0 0 1D A9 FE LDAIM PAR NO - PAR ITY ERROR0 01 F E 6 F 4 INC PECNT INCREMENT ERROR COUNT0 0 2 1 9 1 FO PETCD STA IY ADL SAVE IT IN BUFFER0 0 2 3 E 6 FO INC ADLADVANCE BUFFER PO INTER0 0 2 5 DO 02 BNE PETCE0 0 2 7 E 6 F l I NC ADH00 2 9 2 0 2 F 0 0 PETCE J SR GBYTE GET ANOTHER BYTE00 2C 1 0 ED BPL PETCC CONT INUE IF DATAOOZE 6 0 RTS E XI T I F- SH ORTS

GET A BYTE OF PET DATA

RETURN :ICRO 13:82 June 1979

Page 63: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 63/66

0 0 2 F AD 1 10 0 3 1 2 0 6 3 0 00 0 3 4 EO 4 00 0 3 6 BO 0 80 0 3 8 EO 2C

0 0 3A BO F30 0 3 C 8 80 0 3 0 m F 20 0 3 F 6 0

A = BYTEC = 0 I F PAR I TY ERRORN = 1 I F SHORTSX CLOBBERED , Y= 0

GBYTE LDY IM $ 1 1GBA J SR GETTR

CPX IM $ 4 0BC S GBBCPX IM $ 2C

BCS GBYTEDEYBPL GBARTS

S HO RT S C OU NTGET TRANS I T I ON T IMESTART B I T?YES - GO GET BYTESHORTS?

NO - S TART COUNT ING AGA INYES - DECREMENT COUNT

0 0 4 0 AO 0 9 GBB LDY IM $ 0 9B I T COUNT0 0 4 2 8 4 F 3 S TY T PAR IN I T I A L I Z EPAR I TY0 0 4 4 2 0 6 3 0 0 J SR GETTRGET OTHER HALFOF START B I T0 0 4 7 2 0 5 8 0 0GBC J SR GETB I T GET A DATA B I T0 0 4A 9 0 0 2 BCC GBD0 0 4C E 6 F 3 INC T PAR AD JU S T PA RI TY0 0 4 E 6A GBD RORA PACK I T0 0 4 F 8 8 DEY DONE?0 0 5 0 DO F5 BNE GBC NO0 0 5 2 2A ROLA YES - AD JU ST DATA0 0 5 3 4 9 F F EOR IM$F F0 0 5 5 4 6 F 3 LSR T PAR PUT PAR I TY IN C0 0 5 7 6 0 RT S

0 0 5 8 2 0 6 3 0 00 0 5B 8 6 F 20 0 5 0 2 0 6 3 0 00 0 6 0 E 4 F 20 0 6 2 6 0

GET A DATA B I T

RETURN :C = B I TX CLOBBERED , A& Y UN CH AN GE D

GETB I T J SRS TXJ SRCPXRTS

GETTR GET F IR S T TRANS I T I ONTCNT SAVE I TGET rR GET SECONT TRANS I T I ONTCNT GENERATE B I T I N C

GET A TRANS I T I ON PER IOD

RETURN :X = PER IODA & Y U NC HA NG ED

0 0 6 3 A 2 0 0 GETTRLDX IM $ 0 0 I NI T C OU NT ER

0 0 6 5 2 C 0 0 AOGETA B ITTAPE0 0 6 8 E 8 I NX I NC REME NT C OUNT ER0 0 6 9 7 0 FA BVS GETA LOOP WH IL E H IGH0 0 6B 2C 0 0 AOGETB B I T TAPE0 0 6 E E 8 INX0 0 6 F 5 0 FA BVC GETB LOOP WH IL E LOW.

0 0 7 1 8 E01 AO STX D IGANAOUTPUT TO D /A FORTUN ING0 0 7 4 6 0 RTS

June 1979 MICRO I13:63

Page 64: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 64/66

CONNECTICUT microCOMPUTER, Inc.

r::hL:Y

RS-232INTERFACE MODULE

rr::ht.::YGPI8 (lEEE-488)

INTERFACE MODULE

150POCONOROAD . BROOKfiELD, CONNECTICUT 06804

(203) 775·9659

~TRQMOD

TRS-80 INTERFACE

ETC.

@ J [R ][~.V~M.

SENSORS• TEMPERATURE• VELOCITY• PRESSURE~~=~NALOG

MANIFOLDMODULE

.db• pH• ACCELERATION• HUMIDITY• LIGHT LEVEL• FLUID LEVEL• ETC• ••

MANUAL AND

DISPLAY MODULE

~ : : : ~XPANDERMODULE

DAM SYSTEMS b",C IToCA C Ql pl . t t svst.. o f - a d u l t s t o l e t v o u r e o ~ u L . r l i s t e n

t o t h e r e . l w o r l d .

DAM SYSTEMS cOIT.ponen.s

AIM161 - Analo9 Input. Module16 &-bit an.10ll inl'uLs- 100 aicrosecaa d CG IM !I'Ii... U . . -

J slN ou~L - ..... irtS ... 1 I - l in owu..... ou~L P ll'Lfor cm t.ro1 IIId IN & -bUa.u..... inPULI'DI'Lfer dAa.

AIM162 - AnalaS In~ut. ModuleA s ... . plus: ........ i lt tUl 'lCY - JDld pl.ttd cm~LI -p il oL l il fl l. - l ll il ch S lI K 't .a b.l 1sLlrL. lllilbl' and r"PDlriUft.

POWl - Powe~ Module~1i1S I'DII!r fer _ AI I I 16lldilt.

ICON - Input .Connect.o~For I:IIUIfeLiJII_lOll illPuLsto U w A IH 16 -20Pin c:trd~ CC IIIIIIC tG r -101dlr _IlLs.

OCON - Out.put.Connect.o~For CIIIIIK'LimI tho AI I I 16L a I _ ..... - 20Pin c :t rd . .CG IJ II f( '\ or -5 0ldlr .. IlLs.

MANMOD1 - Mani~old Module1 1Mill .la of 1 lD I .S c: rw . ... ..a.l brri.. ,b'iK ferClllftf('\.int .iMUdls. PDlalLi-WS. wlLlllt SIII'Cft. , Ie .Eli.tuLII U w DIId fir 5 Old lr in t. P 11 I!I Iinto IIw AIII16.

ANAMANl - AnaloS Mani~old Module1 1MiI .1 _of I IDI . Clmtcl.s 1M SYSlEJ ISS EIB RS L aII wAIlU6l li ll lla l. I D!d lri nt -IIIISDI' cabllS .fiL .1Ui in. Pl_i nL aU w AII I14II' II w 1IIIIIIII1.

SENSORSS lD IC n f ar ~1Lurt. _surl, f!clll. IImdiw. 1 .. .. 1 .P H ,1 I I I . i . . . .lie.

COMPUTER INTERFACESFa r U. PET. KlIIol 1 I S - 4O .tLc. lilt in .11Cll III D.EJia1NLft I Iw II I Id 1 11 'IOldl ri . .. II' 1Nti ,1 C II I5 lr uc I. iC lh

PETMOD - PET Int.er~ace Module~_ IM Dm P ll'L s, 1M .... P ll'La n d .... 1M S' tSIEIISinl . l rhcl P ll'L . 5M 5 _ a n d I.R r ... II w PET 's P r in t edcil'ClliL ad A i I Ocelled 1Iw.~.

DAM SYSTEMS PRICE .LIST

KIMMOD - KIM Int.er~ace Module;1_ II1II_licaU ...cmnector Pll'L and .... 1M SYS lE J I S

i n L r r a Pll't.

$39.95

$179.00CABLE "AU - Int. erconnec t.Cables

tIinnIcU a.uLlr inlrflCll L aAII I16 . IWGlIS l. l IP I IN I IU .. Ie .TBA

$249.00 CABLE A24 - Int.e rconnect .Cable2 . I lld l CIl Ia iii III ilIlrfa _tor ...... 1 n d an d ;1\

.OCIII_iva lBlL ..th o oUw.

$19.95

$14.95HANDISl - Manual and Displa", Module

Conntrls bt~ th o A J II1 6 a n du. . owu L Ir inLlrflCll.A i l _ ~ er I : I I IPVl . I rcmtrDl of u. .AIII16. DiplMct.Ml AUIbtr aa d daLi .

GPIB MOD - GPIB (IEEE-488) Int.er~aceA i l _ lilt M Il smEllS IIIllES L abt used willi th o g>18 businslad III • cwvLlr's oIhr I IO I 'DI'Ls .

TBA.9.95

$9.95RS232 MOD- RS232 Int.er~ace Module

1\11_ II w M Il smEllS IIIllES L abt used wi III ;1\ RS - 2 J 2I'II'L II' LIrmIl.

TBA

$59.95XPANDR1 - Expander Module

A i l _ U J>La 1 28 & -b iL l1 li1 1 11i l l l ' V t sI I A I II 16IWIIKI L a

tit caantcl.III La _ MLtI.

TBA

TBADAM SYSTEMS set.s

TBAAIM161 St.art.erSet.

1JM:1udK . .. . A IH161. .. ..P III1 . .... lID !a n d ... . m.AIM162 St.art.erSet.

I nc lu dK . .. . A II I1 62 .. .. .POlio .. lID! a n d ... . D.$259.00

TBAPEl'SETla

In clu dK .... f 'E T II I) , . .. . CMI. .£AZ., II 1I I A I H1 6h .... P II I1a n d.... 1WIIIl.

$295.00

$49.95KIMSETle

!ll elu dK .. .. mill. CIII CM I.. £ ~ . I I1 II A lH 16 10 .... P II I1 I IId. . ..1W III l.$205.00

Page 65: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 65/66

APPLE I I® PROFESSIONALIETeXT EDITORE (PROoGRAMMA IMPROoVED EDITORIa two"'Ciimensional cursor-based editor

ad specifically fQliJl,sa with memory-)d and cursor-besec CRT's. It I s t otally

n ..,rent from tha usual Hna-based editors,hich ware originally designed for Teletypes,he key. of the Iystam Input keyboard arelgned specific ,PIE Editor functionmmands. Some of the features included ine PI E ,yltem ere: Blinking CurSor; Cursorovement up, down. right, left, plus tebs;haracter Inlert and delete; String searchrward. and backwerds;PeQe ser,oll lng;OTOo l ine number, plus top or bottom ofe: Llna Insart and delete enywhere on screen;ove and copy (single and multiple linesl;ppend and clear to end of line; Efficientemory usage. Tihe following commandsa avalleble In the PI E Text' Editor and eechexecuted by depreSSing the systems argu-ent key simulataneously With the commandey desired:LEFT] Move cursor one position to

the leftMove cursor one position tothe r ightMove 'cursor up one lineMove cursor down one lineHome cursor in lower leftleft hand cornerHome cursor in upper lefthand cornerMove up howard top of file)one "page"Move down (toward bottomof file) one "page"Move cursor left onehorizontal tabMove cursor right onehorizontal tab

TOo] Go to top of file (line' 11~1n [GOoTOo] Go to line 'n';j Go to bottom of file

(last line + 1 )Search backwards (up) Intofile for the next occurence ofthe string specified In the lastsearch command

AAG] t[-SCH] Search backwards for:strln.g 't'

Se.arch forwards (down] into thefile for the next occurence of thestring specified in the last s earchcommand

AR.GJ t[+SCH] Search forward for string 't'APP] Append -move cursor to lest

character of line +1Insert a blank l ine beforerethe current line

ARG] n[INS] Insert 'n' blank lines beforethe current li.ne

Delete, the cur rent line, savingit. i n the "push" buffer

AAGj n [DEL] Delete 'n ' lines and Save thefirst 20 in the "push" buffer

Delete the current line as longas it Is .blankSave current line in "push"buffer

ARG] n[PUSH) Save 'n' lines in the "push"buffer

POP] Copy the contents of the "push"buffer before the current line

CINS) Enable character insert modeCINS] [CINS) Turn off character insert modeBS] BackspaceGOB] Gobble - delete the current charac-

ter and pull remai nder of charactersto right of cursor left one position

X IT] Scroll all text off the screen andex it the editor

1 [HOoME] Home Line - scroll up tomove current line to topof screen

APP] [APP) Left justify cursor on currentline

AAG) (GOB] Clear to end of linepple PIE Cassette 16K $19.95

RGHT]

UP]DOWN]SHOM]

HOME)

PAG!

+PAG]

LTAB]

ATAB)

SCH]

+SCH]

NS]

DEL]

DBLK]

PUSH]

16K

32K

RS-80PI E Cassette

Apple PI E Disk

19.95

24.95

6502FORTH .. Z-80FORTH6800 FORTHFOoRTH is a unique threaded language that isIdeal ly sui ted for systems and applicationsprogramming on a, r nt cr o- pr oc es so r s vs te rn .The user may have the interactive FOoRTHCompiler/Interpreter system running stand-eione In 8K to 12K bytes of RAM, Thesystem also offers ,8 bullt-ln incrementalassembler and text editor. Since the FORTHlanguage is vocabulary based, the ussr maytailor the system to rasemble the needs andstructure of any specific appl ication.Programming in :FOoRTHconsis ts of definingnew words, which draw upon the existingvocabulary, and which in turn may be usedto define even mora complex applications.Rever se Polish Notation and LI FOostacksare used In the FOoRTH system to precessarithmetic expressions. Programs written inFOoRTH are compact and very fast.

SYSTEM FEATURES a . FACILITIESStandard Vocabulary with 200 wordsIncremental AssemblerStructured Programming ConstructsText EditorBlock 1/0 BuffersCassette Based System

User Defin ed Stac ksVariable Length Stacks

User Defined DictionaryLogic .a l Dictionary LimitError DetectionBuffered Input

CONFIGURATIONS

AppteFORTH Cassette 16KAppleFORTH Disk 32KPetFORTH Cassette 16KTRS.aOFORTH Cassette 16KSWTPCFORTH Caueue16K

$34.9549.9534.9534.9534.95

SOFTlNARE

ASM/65 EDITOR ASSEMBLERASM/65 is a powerful, 2 pass disk-basedassembler for the Apple II Computer System. ~It is a comp.ati~.le SUbset.~f the F.O.RTRAN_ cross- .assemblers which are available for the 6500family of mtcrc-processcrs. ASM/65 featuresmany powerful capabilities, which are under .direct control of the user. The PIE Text Editorco-resldes with the ASM/65 Assembler to forma comprehensive development tool for the

©sse.mbler la .nguage program~et . ~ol lowlng

0re some of the features available In theASM/65 Editor Assembler.

PIE Text Editor Command RepetoireDisk Based SystemDecimal. Hexadecimal, Octal, a . Binary

ConstantsASCII Literal Constants @ne to Six character long symbolsLocation counter addressin g "." _Addition a . Subtraction Operators in

Expressi onsHigh-Byte Sel.ection OperatorLow-Byte Selection OperatcrSource statements of the form:

f'abel] [opcode] [operand} ~;comment]

6 valid machine instruction mnemonicsAll valid addressing modesEquate DirectiveBYTE Directive to initialize memory

locationsWDR D Directive to initialize 16-bit wordsPAGE Directive' to contr-ol source listingSKIP Directive to control source listingOoPT Directive to set select optionsLINK Directive to chain multiple text filesCommentsSource J[sting wi.th object code and

source statementsSor ted symbol table listing

CONFIGURATIOoN

Apple 1 '1 48K/IOisk $69.95

'1aa .cnrt,U I

LISA INTERACTIVE ASSEMBLERLISA is, a totally new concept in assembly language programming, WhereaS all other assemblersuse a separate or co-resident text. editor to enter the assembly language program and then anassembler to assemble the source code, LISA is fully inter active and performs syntax/addressingmode checks as the source code is entered in. This is similar in operation to the Apple II IntegerBASIC Interpreter. All error messages that are displayed are in plain, easy to understand English,and not simply an Error Code, Commands in .LISA are structured as close as possible to thosein BASIC. Commands that are included are: LIST, D'ELE,TE, INSERT, F'R #0, IN#n, SAVE,LOoAD, APPEN D, ASM, and a special user·defineable key envisioned for use with "dumb" per-ipherals. LISA is DISK II based and wi l lassemble programs with a textfile too long to fit intothe Apple memory. Likewise, the code generated can also be stored on the Disk, hence freeingup memory for even larger source programs, Despite these Disk features, LISA is very fast; in factLISA is faster than most other commercially available assemblers for the, Apple II. Not only isLISA faster, but also, due to code compression techniques used LISA requires less memoryspace for the text file. A full source listing containing the object and source code are producedby LISA, in addition to the symbol table

Apple II 32K/Disk $34.95

PRDGRAIVIIVIAINTERNATI DNAL.INC.,3400 Wilshire Blvd.Los Angel'es, CA 9001'0

(213) 384-0579 • 384-1116- 384-1117Apple II is a registered trademark of Apple Computers, Inc. These professional products

are available at your local computer dealer.

Page 66: Micro 6502 Journal June 1979

8/3/2019 Micro 6502 Journal June 1979

http://slidepdf.com/reader/full/micro-6502-journal-june-1979 66/66

NEW HEALTH .- TERES T PROGRAMS ...

Vita Facti"by J p e a l < e a s y =

! I TRS_,80APPLE

• Heart Attacks'. Blood Pressure• Adolescence• Teenage Drinking & Drugs• Birth Control• Talking About Sex

and others 0011

Speakeasy Vital-acts programs coruain up-to-datefactual medical informal ion presented in layman'sterm about important a peels ofyour lifeand healt hneeds. By participating you gain:- improved knowl dge of medical sjtuation • con-

iribu'li,nglo an improved li,feslyle, better familycommunication and cooperation and better health.

- awareness and appreciation of modern lire'sire ful situations and how to cope wit h them.

- < I,betler under tanding 01 [amil or friends' heallhproblems.h i h d f h j f l i

Help yourself - your family - your friends 10 beIterhealth with the new Speakeasy Vitafacts Serieslearning program !

These professionally-prepared program include' anaudio cassette, a computer ca sette and a booklet: Theyare available Ihrough hundreds of computer storesworldwide at very rea enableprices. Plea e check withyour dealer or contact Speakeasy Vitaf acts.

DEAL RS; Please call us at the number below for the