Skip to main content

Full text of "Micro 6502 Journal Issue 13"

See other formats


/i 



san^aQ" 



The Magazine of the APPLE, KIM, PET 
and Other i^3(£)^ Systems 




IMO 13 



^oa^itB ^^^^ ^^i/oo 



PERFECT AIM 




ATTRACTIVE FUNCTIONAL PACKAGING 
FOR YOUR AIM-65 MICROCOMPUTER 

• Professional Appearance 

• Striking Grey and Black 
Color Combination 

• Protects Vital Components 



ENGINEERED SPECIFICALLY FOR 
THE ROCKWELL AIM-65 

• All Switches Accessible 

• Integral Reset Button 
Actuator 

• Easy Paper Tape Replacement 

EASILY ASSEMBLED 

• Absolutely No Alteration 
of AIM -65 Required 

• All Fasteners Provided 

• Goes Together in Minutes 



MADE OF HIGH IMPACT STRENGTH 
THERMOFORMED PLASTIC 

• KydexlOO* 

• Durable 

• Molded-ln Color 

• Non-Conductive 

AVAILABLE FROM STOCK 

• Allow Three to Four Weeks 
for Processing and Delivery 

• No COD'S Please 

• Dealer Inquiries Invited 



TO ORDER: 

NAME 

STREET 

CITY 



1. Fill in this Coupon (Print or Type Please) 

2. Attach Check or Money Order and Mail to: 



STATE- 



ZIP- 



SAE 1-1(8) 



Please Ship Prepaid _ 

@ $43.50 each 
California Residents Please Pay 

$46.33 (Includes Sales Tax) 



enclosures 
group 

753 bush street 

san francisco, California 94106 



•TM Rohm & Haas 



Patent Applied For 



» 



) saaiaasj \ 



^ 



June 1979 

Issue Number ThSrfeen 





Table of Contents 




1 Staff 






Harmonic Analysts for the Apple 




5 


1 






by Charles B. Putney 






1 Editor/Publisher 






Case of the Missing Tape Counter 




11 Robert M.Tripp 






by William F.Pytlik 
The Basic Morse Keyboard 




Business Manager 

Maggie E: Fisher 






by William L Taylor 










ASYM-phonyinStereo 




17 Circulation Manager 






by Phillip fyt/Rinard 




parol A.Stark 






Sorting with the APPLE II — Part 1 




"■■■ ■.21- ■ "- .:'^'"; 






by Gary A. Foote 




Distribution 

-Q Eileen M.Enos 






streamlining the C2-4P 

by James L.Cass 




^ Janet Santaguida 






6502 Information Resources Updated 




29 Micro-Systems Lah 






byWniiamR Dial 




James R.Witt, J r: 






The Color Gun for the Apple II 




31 ^ Stephens Allen 






byNeilD.Lipson 










ASK the Doctor- Part V 

Reading KIM Tapes on the AIM and SYM 




34^ 


Comptroller 

Donna M.Tripp 






by Robert M, Tripp 






Chief Gofer 






Computer-Determined Parameters for 




38 


Fred Davis 






Free-Radical Polymerization 












byL.S.Reich 






MICRO'- Is published monthly by: 






AIM 6522 Based Frequency Counter 




41 


MICflOlnk.lnc. 

34 Chelmsford Street 






by Marvin L- DeJong 






Chelmsford, Massachusetts 






KIM-TheTunesmith 




43 


617/256-5515 
Mailing address for all correspondence, 


subscriptions 




by Anthony R, Scarpellj 






and address changes is: 






MICROBES 




52 


MICRO 
P.O. Box 6502 






The MICRO Software Catalog: IX 




53 


Chelmsford, MA 01824 






by Mike Rowe 






Application to mail at second-class postage rates 
is pending at- Chelmsford, MA 01824. 




SYMI.SpeaktoMe 




57 


: Publication Number: COTR 395770 






byJackGieryic . 






Subscription In United Stales: 
$15.00 per year/12 issues. 






Reading PET Cassettes Without a PET 




61 


Entire contents copyright ?.■ 1979 by: 






By David P. Kemp 


i^^pgm^ 




- MICRO Ink. Inc. 


^^^ 






Advertiser' 


s Index 






AB Computers 


55 


Microspan 


27 




Compas Microsystems 


56 


MICRO Technology Unlimited 


17 




Computer Components 


20 


Optimal Technology, Inc. 


32 




Computer Forum 


1 


P.S, Software House 


55 




TheComputerist, Inc. 


47,49,51 


Plainsman Micro Systems 


60 




Computershop 


16 


Powersoft, Inc. 


4 




Connecticut microcomputers 


64 


Programma International 


IBC 




Creative Computing 


59 


Progressive Software 


33 




Dr. Daley 


10 


Pygmy Programming 


27 




Eliam Associates 


60 


RNB Enterprises 


37 




Enclosures Group 


IFC 


Softouch 


27 




H. Geller Computer Systems 


61 


Speakeasy 


BC 




Hudson Digltar Electronics 


2 


SYBEX 


5& 




MICRO 


35 


West Side Electronics 


27 




Microproducts 


9 






■- . "j 



\mm\ii(^\ 



POWERSOFT, INC, 

P. O. BOX 157 

PITMAN, NEW JERSEY 08071 

(609) 589-5500 



products for the 

APPLE n 



« 



ADDRESS FILE GENERATOR $19.95 

A professional piece of software which allows the user to create four different types of address files: a) Holiday File, b) Birthday File, 
c) Home Address File, and d) Commercial Address File. The program contains a menu of seven major commands: 1 ) Create a 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 have subordinate commands which 
adds to the flexability of this powerful software system. We doubt you could buy a better program for maintaining and printing address files. 
REQUIREMENTS: Disk II, Apple Printer Card, 32K of memory with Applesoft Rom Card or 48K of memory without Applesoft Rom Card. 



SUPER CHECKBOOK 



$19.95 



A 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 Checks or Deposits, 3) Sort by Check Number, 4) Sort by Code for Year, 5) Sort by 
Code 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.95 

This program uses the Apple It high resolution graphics capabilities to draw detailed graphs 
of mathematical functions which the user defines in Basic syntax. The graphs appear in a targe 
rectangle whose edges are X and Y scales (with values labeled 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 (change of scale), 
and sliding (translation). The user can alternate between the graphic display and a text display 
which lists the available commands and the more recent interactions between user and program. 
Expected users are engineers, mathematicians, and researchers in the natural and social sciences; 
in addition, 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 which 
complements the traditional, primarily symbolic orientation. REQUIREMENTS: 16K of 
memory with Applesoft Rom Card or 32K of memory without Applesoft Rom Card. -4 eee -2 ••• M cae t leei 4 IMfl 



■ VJ 


"yf: 


- 


\ / 

V / 

— 1 



GAMES 

Apple Casino $ 9.95 

Apple Derby 9.95 

Apple II Organ 19.95 

Cubik 9.95 

Radar Interceptor 9.95 

Rocket Pilot 9.95 

Saucer Invasion . , 9.95 

Space Maze 9.95 

Star War 9.95 

Swarms 14.95 

Wampus Hunt 9.95 

SYSTEMS SOFTWARE 

Memory Dump $ 7.45 

Program Unload 7.45 

File Editor 24.95 

Assembler 24.95 

(File Editor required for 
use with Assembler) 



APPLICATIONS 

Automotive Diagnosis $14.95 

Basic Statistics 9.95 

Electrical Engineering I . 9.95 

Statistics I 14.95 

Vector Analysis 9.95 

FINANCIAL 

Financial Wizard $ 9.95 

Financial Wizard II 9,95 

Financial Wizard III 9.95 

Financial Wizard IV 9.95 

(Programs recorded on cassette 
tape. Documentation included.) 



HARDWARE 

Light Pen $34.95 

(Includes Demo-Software) 



D- 



P /> 



w 



</ d 






Call or write for our free SOFTWARE & ACCESSORIES CA TALOG 



Apple I lit a reoittered 
trademark of Apple Computer, 



DEALER INQUIRIES INVITED 



Inc. 



jRaHVEnSOFT, INC. 

p. O, BOX 157 

PITMAN, NEW JERSEY 08071 

(609) 589-5500 



• Master Charoe and VISA 
orders accepted. 

• Include $1.00 for 
shipping and handling. 

• N«w Jersey residents add 
5% sales Tax. 

(Prices sab/ect to change.) 



Harmonic Analysis 
I For the Apple 



Fourier Analysis is a powerful tool in many fields, but 
the number of calculation is requires makes it very 
laborious to perform by hand. A program in Applesoft 
Floating Point BASIC lets the APPLE II do the work. 



Charles B. Putney 

1085 Unguowa Road 

Fairfield, CT 06430 



One of the most important tools of 
modem technology is the oscilloscope. 
They can be found everywhere from your 
local auto repair shop to the hospital 
operating room and by the thousands in 
laboratories around the world. The peo- 
ple that use them know that the shape of 
the squiggly line which appears on the 
scope 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 quite 
sophisticated (and expensive) equip- 
ment to automatically dissect the pic- 
ture and to spew out all sorts of 
• numerical data concerning same. This 
effortless analysis of wave forms is a 
fairly recent technical development. It 
was not always quite so easy. 

Before the advent of modern electronic 
computer technology, the analysis of a 
particular wave form was an all day or all 
week affair. First, one started with a 
graph of the function which was scaled 
to cycle every revolution of 360". This 
was divided into equal angular steps and 
through careful measurements a table of 
x,y coordinates for each step on the 
curve was developed. The curve shown 
in Figure 1 illustrates a representative 
plot of data which could have been col- 
lected from the vibrations of a gasoline 
engine, torque variations of a syn- 
chronous motor or some other physical 
phenomenon. 

The next step was to calculate the coeffi- 
cients of the terms of a Fourier series. 
This calculation is a repetitive 'number 
crunching' exercise and was best done 
by two or more people armed with 
mechanical calculators. The team ap- 
proach was advisable because, with the 
hundreds or even thousands of calcula- 
tions required, mistakes were inevitable. 
At this point, numbers were available for 
the design of counterbalance weights 

• for your engine, reshaping of poles of 
the synchronous motor, etc. 



The mathematical proof of the fact that 
any single valued periodic function, such 
as the one in Figure 1, can be defined by 
an Infinite series and the method for 
calculation of the coefficients for the 
terms of the series was developed by 
Jean Fourier, a French mathematician 
(1768-1837). The series which he in- 
vestigated and which is given his 
name is: 

Y = aO-K al(SinX) -^ bl(CosX) 
+ a2(Sin 2X) + b2(Cos 2X) 
+ a3(Sin 3X) + b3(Cos 3X) 
+ a4(Sin4X) + b4(Cos4X) 
-h a5(Sin 5X) + b5(Cos 5X) 
+ etc. 

It is easy to see that, if it is desired to 
carry a calculation for a Fourier series 
out to say the tenth harmonic, a lot of 
sines and cosines get into the action, in 
fact, ten of each for each point of the 
curve being investigated. The sheer 
magnitude of the pencil-pushing type 
calculation tasks that some of the 
mathematical geniuses of the past, such 
as 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 and 
most curves can be defined to sufficient 
accuracy by a Fourier series with a cut- 
off at this level. (One of my old text 
books describes a hydraulic penstock 
vibration problem involving the beat fre- 
quency between the 17th and 18th har- 
monics of the system!) The accompany- 
ing program, written in Applesoft 11 
Floating Point BASIC, calculates a 
listing of coefficients of each term to the 
fifth harmonic and continues to show a 
calculated plot of the input data curve 
and all five harmonics within a couple of 
minutes. Admittedly, this does not 
match the speed of a fast Fourier 
transform system, but it sure beats the 
old way. 

Harmonic analysis of the data listed for 
Figure 1 with this program yields the 
following information: 



1. The curve is defined by the equa- 
tion: 

Y = 4.008 -H 2.39 Sin(X) - 0.19Cos(X) 

- 0.49 Sin(2X) - 0.50 Cos(2X) 

- 0.13Sln(3X) + 0.12Cos(3X) 
-H 0.23 Sin(4X) - 0.08 Cos(4X) 

- 0.07Sin(5X) + 0.07Cos(5X) 

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

If this data and results had been 
developed with respect to say a vibration 
problem, it could probably be safely 
assumed that if the second harmonic 
vibration component were taken care of, 
the system would be satisfactory. On the 
other hand, it might be desired to pro- 
vide for a flexible mounting to absorb a 
deflection amounting to the difference 
between 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 subtracting 4 from the Y com- 
ponent of the input data. This will yield a 
graph balanced about the X axis as il- 
lustrated by the 'average line' in the 
figure. 

Directions for running the program are 
pretty well built into the listing. After the 
initial instruction page, the form of the X 
or angular component must be inputted. 
(DJor degrees or R for Radians followed 
by a RETURN) Then the data for each 
point of the curve being analyzed must 
be entered as X,Y (for example, Figure 1, 
Point 1 would be entered as 30,4.3 
RETURN) until all points are in the com- 
puter, then enter Done, Done RETURN. If 
a mistake is made while entering any of 
the data points, the program must be 
restarted. Use a Control C to get out and 
start over with a RUN. Note, that zero 
degree X and the 360' X are the same 
from the definition of a periodic wave, so 
one or the other of these points should 
be entered but not both of them. It is not 
necessary to input the data points in 
order and any 360** span may be used 
(for example - ISO" to -i- 180'). However, 
the plotted graph with this program will 
always come out starting at the zero 
position. 



June 1979 



M>CRO 13:5 



For those who don't have an APPLE, the 
program can be used as far as instruc- 
tion 1225 without missing output of the 
reai important resuits from the analysis, 
the term coefficients. While checking 
out this . program, I recalculated ex- 
amples from several old textbooks and 
without exception, I found at least one 
error in the answer listings in each one 
of them. Needless to say, this created 
big headaches for the students of that 
era. 



3LIST 

10 HOME : VTAB 5t HTAB 13: PRINT 
"HARMONIC ANALYSIS": PRINT 

20 PRINT " THIS PROGRAM CALCULAT 
ES COEFFICIENTS OF FOURIER S 
FRIES TO THE FIFTH HARMONIC" 

30 PRINT "OF PERIODIC FUNCTIONS 

F< Y )=F( X )" 
40 PRINT "FUNCTIONS MUST MEET TH 

IS criteria:" 

50 PRINT : PRINT " ( A >Y IS NO 

T INFINITE" 
60 PRINT " (B)THERE IS ONLY 

NE VALUE OF Y FOR EVERY VALU 

E OF X" 
70 PRINT " (C)Y HAS ONLY A FI 

NITE NUMBER OF MAXIMA OR 

MINIMA" 
100 PRINT 
110 PRINT "MAKE A TABLE OF XfY V 

ALUES PICKED FROM THE GRAPH 
FOR EACH SECTION" 
120 PRINT "EVEN IF THE FIRST AND 
LAST HALVES OF THEGRAPH ARE 
SYMETRICALf XfY VALUES FOR 

ONEFULL CYCLE MUST BE ENTERE 

D» 
122 PRINT "START DATA AT POINT # 

1 NOT POINT #0" 
125 PRINT " HIT ANY KEY AND R 

ETURN TO CONTINUE": INPUT Q* 

200 HOME : VTAB 2: PRINT "INPUT 
XfY VALUES OF POINTS ON GRAP 
H UNTIL ALL INPUTTED* A 
FTER LAST ENTRY TYPE 'DON 
EfDONE'" 



MICRO .13:6 



205 PRINT : PRINT "ARE X DATA PO 
INTS EQUAL STEPS DEGREES( D ) 
OR RADIANS(R)?" 

206 INPUT D*: IF D* = "D" THEN R 

= 1 

207 PRINT : PRINT " INPUT DATA A 
S XfY" 

210 INPUT X*fY« 

220 IF X* = "DONE" THEN 1000 

300 X = VAL (X*):Y = VAL ( Y$ ) 

301 REM CALCULATING SUMS OF COE 
FFICIENTS 

305 AO = Y + AO: IF R THEN X == ( X 

/ 360 ) * 6«28318 
310 FOR I = 1 TO 5 
320 A( I ) = Y * SIN ( I * X ) + A(I 
) 

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

) 
340 NEXT I 
350 N = N + 1 
360 IF T < ABS (Y) THEN T = ABS 

< Y) 
390 GOTO 210 
1000 AO = <A0 / N): REM CALCULAT 

ING COEFFICIENT AVERAGES 
1010 FOR I = 1 TO 5 
1020 A<I) = <A(I>/N)*2 
1030 B(I> = <B(I)/N)*2 
1040 NEXT I 
1100 HOME 
1110 PRINT "TERMS OF THE FOURIER 

SERIES are:" 

1120 PRINT : PRINT "TERM *1-(WIL 
L BE ZERO IF GRAPH IS" : PRINT 
"SYMMETRICAL)" 



• 



1121 PRINT 



fAO 



1122 PRINT "TERM *2" :H = i: GOSUB 
1200 
PRINT "TERM #3": GOSUB 1210 



1123 
1124 
1125 
1126 



PRINT "TERM *4" :H = 2: GOSUB 
1200 
PRINT "TERM *5" : GOSUB 1210 



PRINT "TERM *6" :H = 3: GOSUB 
1200 

1127 PRINT "TERM *7" : GOSUB 1210 

1128 PRINT "TERM #8" :H = 4: GOSUB 
1200 

1129 PRINT "TERM #9": GOSUB 1210 



• 



June 1979 



Tables 1 through IV list data points for 






Table 1 










various standard reference curves. It is 






Threei Point Triangular 






interesting to go through them to see the 








X' 


Y 






harmonic patterns 
pie, the triangular 


for each. 


For exam- 












wave is 


an all odd 








90 


1 






harmonic system. 


The sawtooth wave, 








4 A/\ 


, 






which is 


the basis for many electronic 








180 






music generators, 


is the sum of all har- 








270 


-1 






monies to infinity. 


^ 










360 









Table II 






Table III 








Table IV 






Triangular 






Sawtooth 








Square 






X- 


Y 






X* 


Y 








x« 


Y 


-160 


-3 






20 


8 








20 




-140 


-2 






40 


7 








40 




-120 


-1 






60 


6 








60 




-100 









80 


5 








80 




- 80 


1 






100 


4 








100 




- 60 


2 






120 


3 








120 




- 40 


3 






140 


2 








140 




- 20 


4 






160 


, 1 








160 







5 






180 











180 





20 


4 






200 


-1 








200 


- 1 


40 


3 






220 


-2 








220 


— 1 


60 


2 






240 


-3 








240 


— 1 


80 


1 






260 


-4 








260 


— 1 


100 









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 


, 








360 






Figure 1 








Ay€ 


X- 


Y 


Y 


30 


4^ 


0.3 


CO 


S.1 


1.1 


90 


63 


2.t 


110 


7.5 


3.3 


150 


5,Z 


U 


ISO 


3.S 


-0.5 


{?I0 


2.7 


-/.3 


2A0 


/.8 


-e.2 


ZIO 


/.9 


-?.l 


300 


2.7 


'/.3 


350 


2.7 


-/.3 


360 


3.5- 


-0.5 



June 1979 



MICRO 13:7 



1130 

1131 

1132 
1200 

1210 
1225 



PRINT "TERM #10" JH = 5t GOSUB 
1200 

PRINT "TERM *11": GOSUB 121 


GOTO 1250 

PRINT " "rA(H)J" * SIN( " 
JHr"X)"J RETURN 

PRINT " "fB<H)J" * C03( " 
»Hr"X)": RETURN 

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



1250 INPUT "DO YOU WANT A PLOT Y 



1260 
1290 



1300 



1301 
1310 
1320 
1321 
1322 
1323 
1330 
1335 

1340 



1350 
1355 
1360 
1390 
1500 
1510 

1520 

1530 

1540 

1550 

1580 



"fA* 
"N" 



OR N? 

IF A* = 
S = 70tH = 
NITIAL SCALE 

CONSTANT TO 



THEN 6010 

REM SETTING I 
AND CALCULATION 
ZERO 



PRINT : PRINT : PRINT "PLOT 
OF INPUT DATA CALCULATED TO 
FIFTH HARMONIC* Y 
AT 100= "jt: HGR 
HCOLOR= 3 

HPLOT Or 79 TO 279 » 79 
OrO TO 0»159 

S TO 5»79 - S 



HPLOT 
HPLOT 
HPLOT 
HPLOT 
FOR K 

X = K 

8531 



0r79 - 
0»79 + 
269f77 
= TO 
< ^75 i 



S TO 5f79 + S 
TO 269»81 
269 STEP 4 
360 ) * 6»233i 



Y = AO + A( 1 ) « 
( 1 ) * COS < X ) + 
< 2 * X ) + B( 2 ) * 



SIN ( 
A<2) 
COS 



X) 
(2 



S 
GOTO 



+ B 
SIN 
* X 

) + A(3) « SIN (3 * X) + B< 
3 ) * COS ( 3 * X ) + A( 4 ) * SIN 
< 4 * X ) + B( 4 > * COS ( 4 * X 
) + A(5) « SIN (5 * X> + B( 
5) # COS (5 * X) 
Y=(1/T)*Y* 

IF ABS <Y) > 79 

HPLOT Kf79 - Y 

NEXT K 

HCOLOR= 6 

PRINT } PRINT : PRINT 
T HARMONIC": GOSUB 1600 

PRINT : PRINT t PRINT "SECO 
ND HARMONIC": GOSUB 1600 

PRINT : PRINT : PRINT "THIR 
D HARMONIC": GOSUB 1600 

PRINT : PRINT : PRINT "FOUR 
TH HARMONIC": GOSUB 1600 

PRINT : PRINT : PRINT "FIFT 
H HARMONIC": GOSUB 1600 

GOTO 2000 



6000 



"FIRS 



1600 

1610 
1620 

1630 

1640 
1645 
1650 
1660 
1670 
2000 

2010 

2020 

2031 



2033 

2034 

2035 

2040 

2045 

2090 
2100 
2110 
2200 
2220 

2230 
2240 
2270 

2280 
2290 
3300 
6000 

6002 

6004 
6006 
6008 
6010 



H = H + It REM ROUTINE FOR 
PLOTTING HARMONICS 

FOR K = TO 269 STEP 4 
X = K / ( ,75 * 360 ) * 6,2831 
85 

Y = A( H ) * SIN < H * X ) + B( 
H) « COS (H * X) 
Y=(l/T)!|cY*S 

IF ABS (Y> > 79 THEN 6000 

HPLOT Kf79 - Y 

NEXT K 

RETURN 

HOME :H = i: REM SETTING U 
P COEFFICIENT TABLE 

VTAB 5: PRINT " 

COEFFICIENT TABLE" 

PRINT : PRINT : PRINT " 

SINES" »" COSINES" 

PRINT : PRINT "FIRST HARMON 
IC": GOSUB 2100 

PRINT : PRINT "SECOND HARMO 
NIC": GOSUB 2100 

PRINT : PRINT "THIRD HARMON 
IC": GOSUB 2100 

PRINT : PRINT "FOURTH HARMO 
NIC": GOSUB 2100 

PRINT : PRINT "FIFTH HARMON 
IC": GOSUB 2100 

PRINT : PRINT "CONSTANT = " 
»A0»" Y AT 100 = "JT 

PRINT : PRINT "HIT SPACE BA 
R FOR REVIEW" 
H = O: GOTO 2200 

PRINT A(H)fB(H) 
H = H + i: RETURN 

REM REVIEW ROUTINE 

IF PEEK < - 16384) < 127 THEN 
2220 

POKE - 16368r0 

POKE - 16303^0 

IF PEEK < - 16384 ) < 127 THEN 
2270 

POKE - 16368f0 

POKE - 16304f0 

GOTO 2220 

PRINT "PLOT IS OFF SCALE* T 
RYING AGAIN" i 

S = S - lO: REM SHORTEN VER 
TICAL SCALE 

FOR K = 1 TO 1000 

NEXT K 

GOTO 1300 

REM C.B. PUTNEY r 

FAIRFIELDfCONNECICUT 
VER 3/1/79 



• 



6020 END 



MICRO 13:8 



June 1979 



SUPERKIM 

byMICROPRODUCTS 




Here is a powerful microprocessor control 
system development tool and a complete 
microcomputer in one low-cost package. Ttie 
Superkim singleboard computer has more 
features, more interface and expansion 
capability with a tiigher quality design and 
construction than any other in its ctass. 

IHave you got a thousand hours tied up in 
software for you r*KIM-1 BASED control system 



and now your *K1M-1 is too small? The Super- 
kim is the economical next step for expansion 
into more RAM, user EPROM and prototype 
area on one modern, compact, high density, 
fully assembled and integrated board. The 
Superitim has more software available than 
any other singleboard computer since it is 
totally compatible with KIM-1 . 

The Superkim has a wide range of appeal to 
engineers, teachers and industry. 

* KIM-1 l« a product of MOS Technology. 



Applell EPROM 

Expand Your ROM Software 

Add capability to your system monitor or BASIC for business or other applications. Add 
commands to the operating system. New operating systems can be put into EPROM memory 
with our EPROM programmer and plugged directly into your APPLE II board with our 
EPROM socket adaptor. The MICR0PR0DUCT5 EPROM Programmer wilt program INTEL 
2716s, 2758s and other 5-volt replacements for 2716s. 

Add to or replace existing APPLE II ROM software with operating systems of your own de- 
sign. Other software systems similar to PASCAL, FORTH, LISP, APL, FORTRAN, COBOL, 
ALGOL, other BASIC'S, etc. may be incorporated into your APPLE II ROM space. 

The EPROM Programmer looks just like memory to the computer and can be configured to 
program memory locations from 8000 to FFFF for a total of 32K bytes. This means that the 
EPROMs can k>e used in computer applications other than the APPLE II, i.e. the MICRO- 
PRODUCTS Superkim, etc. This turns your APPLE II Into a very low cost powerful, software 
development system. 




FEATURES: 

• Fully assembled. 

• Completely self-contained 

• Textool Zero insertion force socket for 
EPROM 

• Onboard 25 volt power supply 

• Double sided plated through holes on 
fllserglass PC board 

• Gold plated edge connector 

• Fully socketed 

• Latest low-power Schottky IC's 

• Solder mask 



$99.95 



$445.00 



MICROPROOUCTS will cuatom program 
EPROMs with your program on request 



ADVANTAGES: 

• Put memory in two empty ROM slots (n 
APPLE I) 

• Replace memory in existing APPLE II ROM 
slots 

• Add new operating systems to APPLE II 

• Programs INTEL 2716 2K byte EPROMs, 
275B 1K byte EPROMs and other compatible 
5 volt EPROMs 

• Put peripheral drivers in permanent memory 

• Use APPLE It to program EPROMs for other 
computers 



micpoppoclLicts 

2107 ARTESIA BOULEVARD 

REDONDO BEACH, CA 90278 

(213) 374-1673 



Add a Printer to Your Apple II 

With our PC Board that interfaces with the highly popular Southwest Technical Products PR-40 Printer. 
Both our Printer Interface and PR-40 Printer are available at computer stores. 



CENTRONICS TOO! 




• 



Printer Interface 
Apple II to PR-40 

Interface Is completely assembled, tested and guaranteed. 

Including : Interconnecting cable, software stored on audio 
cassette, PC Board which plugs directly into your APPLE 11 

FEATURES: 

• Prints one line at a time when return key is 
pressed. 

• Ideal for writing programs, as you have a 
complete permanent record of all changes 
and deietions to your program. 

• While in Basic, using the list mode, printer 
wilt list ttw entire program without 
stopping as the screen scrolls up or>e line at 
a time. 

• Vou can refer to an earlier part of your 
program without the necessity of relisting it 
on tt)e screen. 

• Printer can be called from Basic to print 
entire contents of video screen. 

• When using assembly language mode, one line 
at a time wilt t>e printed in the same format 

as the video screen. 

$49.95 




SPECIFICATIONS: 
Interface hardware consists of: 

• an epoxy fiberglass PC Board 

• double-sided 

• plated through holes 

• silk screen printed legends 

• gold plated edge card connector. 

niicpopPoclucTfcs 

2107 ARTESIA BOULEVARD 

REDONDO BEACH. CA 90278 

(213) 374-1673 



2107 ARTESIA BOULEVARD / REDONDO BEACH / CALIFORNIA S0278 / (213) 374 1673 



MICROPRODUCTS/APPLE II 
PARALLEL INTERFACE BROCHURE 



The MICROPRODUCTS Parallel Oupcput card allows your Apple II* ronputer to 
coonunlcace vlth the outside world. 



Applications Include: 



Printer Interface 

Power controller 

Tone/Huslc generator 

Plotter Driver 

LED/LAMP Driver 

Apple Il/SuperkJm Communications interface 



Features: 




* 


8 bits output 


* 


15 ma output, current slnlc or source 




(Can drive L.E.D.s directly) 


* 


TTL or CMOS compatible 


* 


Will go in any slot on the Apple II* 


* 


Data available strobe 



General Information: 

Data can be transferred to an external device by a STA, STY or STX froto 
assembly language, or a POKE from BASIC. The 8 bits output can drive 2 
?-6eg«ent L.E.D. displays, relays, SCRs , Printer, or anything which requires 
up to B bits of data. 

Application notes and software to drive a Southwest Technical PR-40 printer 
Is available for a nominal S5.00 extra. 

Included with the Parallel Interface are Instructions on how to Interface to 
a Centronics ??9 printer and wiring diagrams for use as a power controller. 
Additional software and applications notes available. 

*APPLE II is a trademark of APPLE COMPUTER, INC. 



$44.95 



DR. DALEY'S 
SOFTWARE FOR THE PET 

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. 

pCT TRFK Q Like STARTREK, but has several UNIQUE features. For 
rt I I ntf\ o example, the unpredictable EXPERIMENTAL RAY, who ^ -y qi; 
knows what it will do $ 7 . 95 

BACKGAMMON l*'s you vs the pet with an exciting game of BACKGAM- ^ — -j« 

MON Jp f • wO 

lUI ACTCp MIMn Plays two simultaneous games, one where you guess ^ — -^- 
mno I tn miiiu p^-p,^ secret code, and another where PET guesses yours $ 7.95 

RENUMBER ^'" <'^^^'^^^'' V^^^ basic programs, including all jump 

statements. For a 6K source code requires less than 5 u^^ft ^^r- 
seconds $1Z- 95 

pil QT A BASIC coded PILOT interpreter. A second high level 
language for the PET. Simple to use, even a ten year old 
can learn to use PILOT quickly. With sample PILOT pro- ^ ^ 
grams and documentation $1 Z . 95 

rucpl^Dnni^ win balance your checkbook and save totals in 16 
categories on tape. Will produce end of month and year to 
date summaries. Categories can easily be changed to ^^n nc 
suit your own purposes $ I Z - 95 

lyiAII LISJ Keeps a mailing list and will sort the list into sub groups ^^n |%|. 
using up to three search parameters $ lZ.95 

All of our programs are available on tape or for the Compu-Think disk. We charge $5.00 for the disk 
and 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! 

M All LISJ The above program has been modified for disk files. Will 

be placed on a disk by itself which you can then use for ^ ^ ^ 
your mailing list $19.95 

pi ACU I We have just acquired the rights to distribute a linking 
loader for BASIC programs! This will allow you to link ex- 
clusively numbered BASIC subroutines in memory. No 
serious programmer should be without this useful pro- 0^^ nc 
gramming tool $1 Z . 95 

An ideal companion to the linking loader will be our library of useful subroutines which 

can be linked into your own program. Currently over 25 useful routines are included. 

These range from plotting utilities to a beautiful display of rolling dice. Write or call for ^k - -. -.- 

a list or order the set for only $49 - 95 



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



Charge your order to 
MC/VISA 




DR. DALEY, 425 Grove Avenue, Berrien Springs, IVIichigan 49103 



Phone (616) 471-5514 Sun. to Thurs. noon to 9 p.m. eastern time 



> 



Case of the Missing Tape Cou nter 

The lack of a tape counter on the PET cassette tape unit 
has led to hours of frustration. The technique presented 
here provides a fairly automatic method of locating your 
files on the PET cassette. 



William F. Pytlik 

6828 Payne 

Edwards, CA 93523 



The PET has an excellent file manage- 
ment system. Unfortunately, since the 
PET does not have a tape counter, ac- 
cess to any file or program other than 
the first requires either an uncanny 
"touch" to find a file by using FAST 
FORWARD or an infinite amount of pa- 
tience welting for the file management 
system to find the program at 1-7/8 
inches/second. The obvious solution is 
to use a large number of C-10 or C-5 
cassettes. Of course, this solution is 
costly and requires one to store a large 
number of tapes. 

Fortunately, the PET does have a real 
time clock and the ability to start and 
stop the cassette motor via BASIC POKE 
commands. These two capabilities, com- 
bined with the use of constant length 
files, allow ready access to any program 
or file on a user created tape. 

The use of constant length files implies 
that every file or program on any 
cassette has the same space allocated 
to it regardless of how long the actual 
program is. This means that some of the 
tape on the cassette will not actually be 
used, but the method is much cheaper to 
use than using C-5/C-10 cassettes for 
each program/data file. 

After experimenting, we found that a 
maximum FAST FORWARD time of ten 
seconds is adequate to store the largest 
program capable to be stored in the PET 
8K memory. Of course, this is at the 
beginning 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 be 
stored and accessed via this method. Ac- 
cess time to the last file on a C-90 
cassette is approximately two minutes. 

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

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

ENTER CASSETTE 1 OR 2 

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



will be listed for unused file locations 
like: 

PROGRAM 1 

PROGRAM 2 

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

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

READ OR CREATE PROGRAM/FILE - 

RORC 

The program will then ask which file you 
wish to read or write by displaying: 
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 RETURN 

WHEN READY 

(The program will skip the previous step 
if you ask for program/file number 1 
because the tape Is already In the cor- 
rect position). If you enter R to read a 
file/program, the program will advance 
the tape to the correct position, stop, 
and display: 

HIT STOP/EJECT AND LOAD AS 

USUAL 
At this point, you simply load the 
selected program In the usual manner. 



Similarly, if you entered C to create a 
new file/program, the tape will advance 
to the selected portion of the tape, stop, 
and display: 

HIT STOP/EJECT 

TAPE IS NOW READY TO SAVE NEW 

PROGRAM/FILE 

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

Since the length of a file allocation is 
determined by time in seconds (the 
number 10 in line 300 of the program), 
the user may change this number to 
accomodate any length file. Also, since 
each program occupies a unique well- 
defined location and the length allocated 
is for a maximum length file, there is no 
problem replacing one file/program with 
another. 

We use this method on all our tapes. We 
also use the program as a subroutine in 
programs requiring access to other files, 
i.e., a recipe program. The use of the PET 
cassette drives becomes simple, quick, 
and enjoyable, and presents a solution 
to the case of the missing tape counter 
mystery. 

1^ 




June 1979 



MICRO 13:11 



10 REM THIS PROGRAM ALLOWS THE PET USER TO 

20 REM ACCURATELY POSITION HIS CASSETTE FILES 

30 REM BY USING THE FAST FORWARD FUNCTION OF 

40 REM THE TAPE DRIVE. 

50 REM 

60 REM 

70 PRINT " *** PROGRAM / FILE LOCATOR ***" 

80 PRINT 

90 INPUT "ENTER CASSETTE 1 OR 2";CA 

100 READ X 

110 DIM C$(X) 

120 FOR I = 1 TO X 

130 READC$(I) 

140 PRINTC$(I) 

150 NEXT I 

160 PRINT: INPUT "READ OR CREATE PROGRAM / FILE — R OR C";R$ 

170 INPUT "WHICH PROGRAM / FILE --I.E. 1,2,...";WP 

180 IF WP = 1 THEN 240 

190 REM STATEMENTS 200 AND 210 INITIALIZE THE MOTOR OFF 

200 IF CA = 1 THEN POKE 59411,61 

210 IF CA r 2 THEN POKE 59456,223 

220 PRINT "PRESS F.FWD AND HIT RETURN WHEN READY" 

230 REM STATEMENT 240 WAITS FOR RETURN TO BE DEPRESSED 

240 GET A1$:IF Al$ = "" THEN 240 

250 REM STATEMENTS 260 AND 270 TURN ON SELECTED MOTOR 

260 IF CA = 1 THEN POKE 59411,53 

270 IF CA = 2 THEN POKE 59456,207 

280 T = TI 

290 REM STATEMENT 300 WAITS FOR TAPE TO ADVANCE TO SELECTED FILE 

300 IF TI<T+(10*60*(WP-1)) THEN 300 

310 REM STATEMENTS 320 AND 330 TURN THE MOTOR OFF 

320 IF CA = 1 THEN POKE 59411,61 

330 IF CA = 2 THEN POKE 59456,223 

340 PRINT 

350 IF R$ = "R" THEN PRINT "HIT STOP/EJECT AND LOAD AS USUAL" 

360 PRINT: IF R$ = "R" THEN 500 

370 IF R$ = "C" THEN PRINT "HIT STOP/EJECT" 

380 PRINT "TAPE IS NOW READY TO SAVE NEW PROGRAM/FILE" 

390 REM CHANGE NUMBER IN STATEMENT 500 TO CHANGE THE MAX 

400 REM NUMBER OF PROGRAMS PER CASSETTE 

410 REM CHANGE NAMES IN STATEMENTS 510 THRU 600 

420 REM TO YOUR PROGRAM NAMES 

500 DATA 10 

510 DATA "PROGRAM 1" 

520 DATA "PROGRAM 2" 

530 DATA "PROGRAM 3" 

540 DATA "PROGRAM 4" 

550 DATA "PROGRAM 5" 

560 DATA "PROGRAM 6" 

570 DATA "PROGRAM 7" 

580 DATA "PROGRAM 8" 

590 DATA "PROGRAM 9" 

600 DATA "PROGRAM 10" 

1000 END 

MICRO 13:12 JuMl079 



The Basic Morse Keyboard 



For the H AMs - here is a way to use your system to make 
an ASCII keyboard perform as a Morse keyboard. Im- 
plemented on an OSI system, the program is in BASIC 
and should be readily convertible to other systems. 



WlillamL Taylor 

246 Flora Road 

Laavittsburg, OH 44430 



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

Being an amateur radio operator and a 
computer hobbyist, I felt that the com- 
puter should aid the operator with his 
tasks either when operating the station 
or other activities. From this desire to 
have the computer as an assistant, I felt 
that one of the best uses for my com- 
puter was to aid me In sending and 
receiving of the Morse code. With this in 
mind I went to work developing a pro- 
gram that would allow me to use the 
ASCII keyboard as a "Morse Keyboard". 
The program and the interface informa- 
tion in this article will help other amateur 
radio operators, who own the OSI 
Challengers with a Model 500 CPU with 
the PIA port populated, get on the air 
with the "Morse Keyboard*'. 

First, an explanation of my system is in 
order. My computer system consists of 
the system boards sold by Ohio Scien- 
tific Instruments. I have the Model 500 
CPU with BASIC in ROM. The PIA port is 
populated with a 6820 PIA, and is ad- 
dressed at the standard location on the 
500 board. The address for the PIA is 
63232 decimal or F700 hex on the 500 
CPU board. The program was written to 
service the 6820 at this location. The 
BASIC program uses the B side of the 
6820 as the output and PBO is the 
specific port. PBO of the PIA is con- 
nected to a tone oscillator board to 
generate the sidetone and a relay driver 
on the board is used to drive a 12 volt 
relay that keys the transmitter. 

The "BASIC Morse Keyboard" program 
is written in Microsoft BASIC and 
Assembly Language. The Assembly por- 
tion of the program Is stored In DATA 
statements, and is entered into user 
memory with the READ and POKE func- 
tions of BASIC. On initialization, the 
DATA at line 1620 is READ and POKED 
into memory with the FOR NEXT loop at 
line 1605. This machine code store 
subroutine is called at line 15 at the 
beginning of the program. The machine 
code routine is stored at hex OCOO. This 



machine code routine calls up the 
system monitor to get the ASCII code 
from the system keyboard. When a key is 
struck on the keyboard the ASCII 
equivalent of the letter or number is 
placed in the accumulator of the 6502 
microprocessor. The ASCII character is 
then stored at hex OFOO where it will be 
available for the BASIC program to cap- 
ture it with a PEEK statement. This PEEK 
statement is located at line 125 of the 
BASIC program. 

The contents of hex OFOO will hold the 
present keyboard ASCII entry, and after 
being read with the PEEK statement the 
character will be stored in the A variable. 
The contents of variable A is now com- 
pared with the contents of a look up 
table to determine the offset to the 
Morse element table where the conver- 
sion to Morse elements are formed. The 
ASCII table starts at line 130. The Morse 
element table starts at line 1500. 

The Morse equivalent of the ASCII 
character is loaded into the string 
variable A$, and on return from the 
subroutine the program jumps to a 
subroutine at line 1000 where the 
elements of A$ are seperated into the 
dot-dash elements of Morse code. This 
seperation is done by loading each 
seperate element into D$, and if the ele- 
ment is a 1 then a dot is generated in a 
subroutine at line 1200 through line 
1220. If the element read into D$ is the 
numeral 3 then a jump to the subroutine 
at line 1300 through 1320 causes a dash 
to be generated. After each character 
has been separated and sent to the PIA 
port the program returns to the input 
statement line 122. At statement line 122 
a jump to tt)e machine code subroutine 
is executed with the USR function of 
BASIC. The machine code subroutine 
causes a jump to the system monitor 
and the program will loop until a key is 
depressed on the keyboard. 
The subroutine at line 1200 and 1300 
generate the Morse elements (dots and 
dashes). This is done by turning on and 
off PBO for a duration of time. For exam- 
ple if a 1 was decoded in the routine at 
1000 then PBO would be turned on (high) 
for the duration of time contained in the 



loop at line 1205. This loop (FOR J= 1 
TO X:NEXT J) is the dot length. The dot 
length time element is stored in variable 
X at line 106. When the loop has timed 
out then PBO will be brought low and a 
return executed. The next Morse ele- 
ment is identified and generated in 
either the subroutine at 1200 or 1300 
depending if It is a dot or a dash. The dot 
length, dash length, and the length be- 
tween characters are contained in 
variables at lines 102 through 109. The H 
variable at line 102 holds the information 
that identifies PBO and turns PBO on in 
the subroutines at 1200 and 1300. The R 
variable contents are used to turn PBO 
off. The variable at line 106 is the dot 
length. The variable at line 108 is the 
dash length. The variable at line 109 is 
the length between characters. This 
variable can be eliminated if desired. The 
variables X and R can be adjusted for any 
desired dot dash length. The routine at 
lines 10, 20 and 30 initialize the PIA. This 
initialization sets the B port as the out- 
put port. The value in variable G at 100 
identifies the initial location of the PIA. 

The object code subroutine for the pro- 
gram is stored at Hex OCOO. The object 
code contents are: 

OCOO 20 

0C01 ED 

0C02 FE 

0C03 8D 

0C04 00 

0C05 OF 

0C06 60 
The tone oscillator board is a straight 
forward construction project requiring 
few components. The schematic in 
Figure 1 shows the schematic for the 
tone and relay driver board and the com- 
ponents that will be needed to construct 
the board. Pref board and a wire wrap 
socket can be used for the construction 
of the board or you can etch a board if 
you feel that would be a more desirable 
method. A printed circuit t>oard layout 
was not included in this article because 
it was felt that the user could use any 
method that was thought best. The con- 
nections to the PIA port on the 500 CPU 
board can be any length of wire. I used 
ribbon wire and etched a small board 
that would mate with a Molex male 12 



June 1979 



MICRO 13:13 



pin connector such as the connectors on 
the 460 backplane board. This male plug 
connects to the 500 CPU board at the B 
side port connector on the 500 CPU 
board. The power for the Tone board is 
taken from the computer except the 12 
volt DC for the relay. This must be ob- 
tained from another source. Be sure that 
the external power source ground be 
connected to the tone board ground in 
order for the relay keying transistor to 
work correctly. 

A note of warning must be given at this 
point. The memory size must be set to 
3071 decimal when bringing up BASIC. 
This will be for the protection of the 
machine code routine that is stored 
above OCOO Hex. 

In conclusion, the program as written 
does not have any buffer so typing ahead 
is not possible. This leaves the program 
open for modifications, such as, install- 
ing the buffer. Also I have a version of 
the program that allows the operator to 
load ASCII into a memory zone and use 
this ASCII as preloaded message text. 
The program and the sidetone keyer 
works well on the OSI system used at my 
shack and I have had many pleasurable 
hours using the "Morse Keyboard" on 
CW. I wish you the same. Good luck. 



Flgun 1 



The author wishes to give 
particular recognition to 
the article entitled: 

"The Morse Master" 

which appeared in the 
January 1979 issue of 
73 Magazine, written by 
William A. Thornburg. 

The article provided the 
concepts upon which this 
program is based, and gave 
a program listing for the 
H8 microcomputer. 



Tone Oscillator and Driver Board 
Parts List 



1 



1 1N4001 Diode 

1 Pref board .100 by .100 hole centers 

1 555TiimerlC 

1 8 Pin wire wrap socket (or 14 pin) 

1 MF Disc capacitor 
1 50 MF Electrolytic capacitor 
3 IOKV2 Watt Resistors 
1 2N2222NPN Transistor 
1 8 0hmspeal<er 

12 Volt DC relay 

Male Molex 12 Pin plug KK156 



Radio Shack 276-1394 
Radio Shack 276-1723 



# 



Radio Shack 40-245 
Radio Shacl^ 275-003 



1 

1 

1 Wire wrap wire 32 Gauge (if used) 

1 Hand wire wrap tool (if used) 

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

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



o- 



Rl, 10 K Rl, lOK 



8 7 6 5 

> S55 

12 3 4 



O 



Cl, .1 /iF 



6Kf> 



I2VDC 



- 



^f 



+ „«. ZS^F JS» 



M 




IM4O0I 




R3, (OK ty^ 

L^VW — Tqi. 



2M2222 




® • 



MICRO 13:14 



June 1979 



» 



1 REM MORSE KEYBOARD FEB 1979 

2 PRINT" MORSE CODE KEYBOARD" 

3 PRINT:PRINT:PRINT:PRINT 

10 X=63232 

15 GOSUB 1600 

20 POKE X+1,0:P0KE X+3,0: P0KEX,O:P0KE X+2,255 

30 POKE X+1,04:P0KE X+3,04 

100 G=63232 

102 H=l 

104 R=0 

106 X=25 

108 T=100 

109 F=150 

110 POKE 11,0:P0KE 12,12 
122 X=USR(X) 

125 A=PEEK(38A0) 

130 IF A= 65 THEN GOSUB 1500 

131 IF A= ee THEN GOSUB 1501 

132 IF A= 67 THEN GOSUB 1502 

133 IF A= 68 THEN GOSUB 1503 

134 IF A= 69 THEN GOSUB 1504 

135 IF A= 70 THEN GOSUB 1505 

136 IF A= 71 THEN GOSUB 1506 

137 IF A= 72 THEN GOSUB 1507 

138 IF A= 73 THEN GOSUB 1508 

139 IF A= 74 THEN GOSUB 1509 

140 IF A= 75 THEN GOSUB 1510 

141 IF A= 76 THEN GOSUB 1511 

142 IF A= 77 THEN GOSUB 1512 

143 IF A= 78 THEN GOSUB 1513 

144 IF A= 79 THEN GOSUB 1514 

145 IF A= 80 THEN GOSUB 1515 

146 IF A= 81 THEN GOSUB 1516 

147 IF A= 82 THEN GOSUB 1517 

148 IF Ar 83 THEN GOSUB 1518 

149 IF A= 84 THEN GOSUB 1519 

150 IF A= 85 THEN GOSUB 1520 

151 IF A= 86 THEN GOSUB 1521 

152 IF A= 87 THEN GOSUB 1522 

153 IF Ar 88 THEN GOSUB 1523 

154 IF A= 89 THEN GOSUB 1524 
A= 90 THEN GOSUB 1525 
A= 48 THEN GOSUB 1526 
A= 49 THEN GOSUB 1527 



155 IF 

156 IF 

157 IF 

158 IF A= 50 THEN GOSUB 1528 

51 THEN GOSUB 1529 

52 THEN GOSUB 1530 

161 IF A= 53 THEN GOSUB 1531 

162 IF A= 54 THEN GOSUB 1532 

163 IF A= 55 THEN GOSUB 1533 

164 IF A= 56 THEN GOSUB 1534 
57 THEN GOSUB 1535 

46 THEN GOSUB 1536 

63 THEN GOSUB 1537 

64 THEN GOSUB 1538 

47 THEN GOSUB 1539 
170 IF A= 44 THEN GOSUB 1540 
172 GOSUB 1000 

175 FOR 1= 1 TO F : NEXT I 
180 FOR M= 1 TO G9: NEXT M 
190 GOTO 122 



159 IF 

160 IF 



165 IF 

166 IF 

167 IF 

168 IF 

169 IF 



June 1979 



1000- L= LEN (A$) 


1005 FOR 


1= 1 TO L 


1010 R$=MID$ (A$,I,1) 


1015 IF R$= "1" THEN GOSUB 1200 


1020 IF R$= "3" THEN GOSUB 1300 


1025 NEXT I 


1030 GOTO 1320 


1200 POKE 


: G+2,H 


1205 FOR 


J= 1 TO X: NEXT J 


1210 POKE 


: G+2,R 


1215 FOR 


J= 1 TO X: NEXT J 


1220 RETURN 


1300 POKE 


: G+2, H 


1305 FOR 


J= 1 TO X: NEXT J 


1310 POKE 


: G+2, R 


1315 FOR 


J= 1 TO X: NEXT 2 


1320 RETURN 


1500 A$= 


"13": RETURN 


1501 A$= 


"3111":RETURN 


1502 A$= 


"3131":RETURN 


1503 A$= 


"311" : RETURN 


1504 A$= 


"1" :RETURN 


1505 A$= 


"1131": RETURN 


1506 A$= 


"331" :RETURN 


1507 A$= 


"1111":RETURN 


1508 A$= 


"11" iRETURN 


1509 A$= 


"1333":RETURN 


1510 A$= 


"313" zRETURN 


1511 A$= 


"1311":RETURN 


1512 A$= 


"33" : RETURN 


1513 A$= 


"31" iRETURN 


1514 A$= 


"333" :RETURN 


1515 A$= 


"1331":RETURN 


1516 A$= 


"3313":RETURN 


1517 A$= 


"131" :RETURN 


1518 A$= 


"111" iRETURN 


1519 A$= 


"3" : RETURN 


1520 A$= 


"113" :RETURN 


1521 A$= 


"1113": RETURN 


1522 A$= 


"133" : RETURN 


1523 A$= 


"3113":RETURN 


1524 A$= 


"3133":RETURN 


1525 A$= 


"311" :RETURN 


1526 A$= 


"33333" : RETURN 


1527 A$= 


"13333" :RETURN 


1528 A$= 


"11333" iRETURN 


1529 A$= 


"11133" :RETURN 


1530 A$= 


"11113" :RETURN 


1531 A$= 


"11111" :RETURN 


1532 A$= 


"31111" :RETURN 


1533 A$= 


"33111" :RETURN 


1534 A$= 


"33311" :RETURN 


1535 A$= 


"33331" :RETURN 


1536 A$= 


"131313^':RETURN 


1537 A$= 


"113311" :RETURN 


1538 A$= 


"31113" :RETURN 


1539 A$= 


"31131" :RETURN 


1540 A$= 


"331133":RETURN 


1600 FOR 


R= 3072 TO 3078 


1605 READ Q: POKE R,Q: NEXT R 


1610 RETURN 


1620 DAT^ 


\ 32,237,254,141,0,15,96 




MICRO 13:15 



FOR A FLOPPY OISK DASEO 



'/; -uy. 



'^;i^,; 






?^S' 



:^^ 



tm 



'^J^^'^4^:- 















^'^"'>^^<^^<rf: 



C^/"' 



i%'^'^ 



:tm 





.-eys 



l/SA ASD MASTER' 
CHA RGE ORDERS A RE 
BOTH ACCEPTED, 



wl K IVIrl iP%7\JO! First floppy disk based computer 
for under $1000! Adramatic breakthrough in price and per- 
formance. Features OSI's ultra-fast BASIC-in-ROM, full graphics 
display 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 video 
monitor or TV through an RF converter, and be up and running. 
Can be expanded to 32K static RAM and a second mini-floppy. It also supports 
a printer, modem, real time clock, and AC remote interface, as well as OS-65D 

V3.0 development disk operating system. 



CDmPUTERSHDP 



288 Norfolk St. (Cor. Hampshire St.) 
Cambridge, Mass. 02139 
617-661-2670 



590 Commonwealth Ave. 
Boston, Mass. 02215 
617-247-0700 



Route 16B 

Union, N.H. 038^7 

603-473-2323 



• 



A SYM-phony in Stereo 



» 



All you Symmers who are frustrated because you can 
not 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! 



Phillip M. Rinard 

2019 Park Ave. 

Emporia, KS 66801 



I 



Excellent tune player progranns for com- 
puters abound, but sonne features of the 
SYM-1 make it easy to generate stereo 
music and may be of interest to SYM-1 
owners. Such a program also Illustrates 
some of the uses of the on-board UART's 
(a SY6532 and two SY6522's) and some 
of the SUPERMON monitor routines. The 
listing explains the procedures of the 
program, but a few comments here may 
be helpful. With no attempt at making 
use of the memory at the greatest effi- 
ciency, each stereo note consists of five 
bytes: the duration is given by the first 
byte, then two bytes give the frequency 
for each of the two stereo tones having 
that duration. For the program given, the 
duration is in multiples of about 0.01 
second and is timed by counting down in 
the 6532. The frequency bytes are placed 
into the latches of the 6522's for use in 
the timer 1, free-running mode. The 
6522's timers generate square-wave out- 
puts with a frequency based on the con- 
tents of the latches. The 6532 timer com- 
putes when the next 5 bytes should be 



read and new values placed in the 
latches. 

Two subroutines allow for repeating all 
or part of the tune. A duration byte of 
$FF causes a return to the beginning of 
the tune for a single repeat of the tune 
up to that point. Upon reading the $FF a 
second time, the repeat is ignored and 
the rest of the tune played. If the dura- 
tion is $00, the tune is over, but im- 
mediately begun again as if for the first 
time. The output port AA used by the 
6522 #3 is buffered and thus can drive a 
speaker after putting about a 200 Ohm 
resistor between two points of the 
rightmost buffer's PC holes. As shown 
on page 4-12 of the SYM Reference 
Manual, these are points 4 and the one 
between and below points C and 7. The A 
port can be buffered by one of the three 
remaining on-board buffers (or one of 
your own off the board). Place another 
200 Ohm resistor in another set of PC 
board holes and place the input signal 
from port A on the exposed wire of the 



on-board resistor immediately above the 
transistor. The outputs to both speakers 
are then available from port AA (see page 
4-1 1 of the SYM Reference Manual for ex- 
act pin numbers). 

As an illustration of the stereo player, a 
listing of data for the "Star Wars" music 
is given. The "notes" of zero frequency 
provide brief intervals of silence be- 
tween notes to more realistically im- 
mitate a musical instrument. This pro- 
gram and data fit into the IK of on-board 
memory provided from the factory. 
Sockets for 3K more memory are pres- 
ent, as is a socket for a third 6522. If 
more of this memory is used for extend- 
ed tunes, then additional programming 
is necessary similar to that in locations 
IB through 21 where "starting" ad- 
dresses are changed so that as the Y 
register increments up to 255 the proper 
note is retrieved. Obviously, an en- 
thusiast could expand on this type of 
program with the SYM-1 capabilities. ^ 



KIM/SYM/AIM ACCESSORIES BY MTU 




REAL GRAPHICS FROM OUR VISIBLE MEMORY 

Over the last year and a half we have delivered hundreds of our Visible 
Memory graphic display boards and customers are still finding novel uses 
for them. The Visible Memory is an 8K byte memory board that is directly 
compatible with the KIM/SYM/AIM computers and functions just like an 8K 
memory expansion. Its content however is also displayed on a standard 
video monitor as a 320 by 200 dot array with each dot corresponding to a bit 
in 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 programming 
the Visible Memory easy, Microsoft 9-digit BASIC users now have access 
to the graphics and text routines through our just released BASIC Patches 
Package. In fact, the images above were created entirely with SIMPLE 
BASIC programs. 

K-1008A VISIBLE MEMORY $240.00 
OTHER ITEMS 

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

PLEASE REQUEST OUR NEW, EXPANDED SPRING 1979 CATALOG 



16K LOW POWER MEMORY 

Do you want more memory for your 
KIM/SYM/AIM but don't have a 5 amp 
power supply or fan to cool it? Our 
16K low power dynamic RAM board is 
designed for these processors and 
draws a mere 200MA from 8 volts 
unregulated and 200MA max (75 MA 
typical) from + 16 volts unregulated. 
Our little K-1000 power supply can in 
fact run 64K of these boards plus a 
KIM easily. 

K-1016A16K RAM $340.00 

We now have available a multifunction 
system board for the KIM/SYM/AIM 
processors. It has a PROM capacity 
of 12K using the Industry standard 
2708 PROM or 14K using the readily 
available Tl 2716. Also included is a 
2708/2716 PROM programmer, 4 para- 
llel ports, and a bidirectional serial 
port. Low power: +8 at 350MA, + 16 
250MA. 

K.1012A PROM/10 $237.00 



MICRO TECHNOLOGY UNLIMITED. 841 Galaxy Way, Box 4596, Manchester, NH 03103 (603) 62M464 



June 1979 



MICRO 13:17 



SYM-1 STEREO TUNE PLAYER 

BY PHILLIP M. RINARD 
MAY 1979 



m 









MODIFIED BY MIKE ROWE 






D 
U 
















SUPERMON REFERENCES 








R 
A 


F 

c 


3 


F 
F 
E 


? 








ACCESS 


* 


$8B86 


ACCESS SUBROUTINE 






T 
I 



E 


^ 








OUTBYT 


* 


$82FA 


OUTPUT BYTE SUBROUTINE 




a 


a 








OUTCHR 


» 


$8A47 


OUTPUT CHARACTER 


TO DISPLAY 




A& 


i^ 


Tl 


1 A 








ACR 


» 


$AOOB 


AUXILIARY CONTROL 


REGISTER 




N 


ONl 


Tluv 








ACRX 


♦ 


$ACOB 


ACR DIFFERENT VIA 




E7D 


DS 


DO 


DO 


00 


DO 








lER 


* 


$AOOE 


INTERRUPT ENABLE 


REGISTER 


27S 


hO 


BC 


03 


DA 


OB 








lERX 


» 


$ACOE 


lER DIFFERENT VIA 




27A 


DS 


DO 


OD 


00 


OD 








TOL 


» 


$A006 


TIMER LATCH 




a7F 


3D 


FC 


DM 


F7 


01 








TOC 


» 


$A005 


COUNTER 




EflM 


DS 


DO 


DO 


00 


DO 








TOLX 


* 


$AC06 


TIMER LATCH 




asT 


D7 


ED DS 


DA 


OB 








rocx 


* 


$AC05 


COUNTER 




SflE 


DS 


DO 


DO 


00 


DO 








STIME 


* 


$A41E 


6532 TIMERS 




a^3 


D7 


A7 


Ob 


^c 


OD 








RTIME 


* 


$A404 






21fl 


DS 
D7 


DO 
77 


00 
07 


DO 
EE 


DO 
OE 


JOOO 








ORG 


$0000 






EAE 
2A7 


D7 
bD 


DO 
BC 


DO 
D3 


00 
DA 


DO 
DB 


0000 


00 




LOW 


= 


$00 


LOW POINTER 




EAC 


DS 


DO 


DO 


DO 


DO 


0001 


00 




HIGH 


= 


$00 


HIGH POINTER 




EBl 


3D 


FC 


OH 


F7 


01 


0002 


00 




REPEAT 


~ 


$00 


REPEAT COUNTER 




EBb 


DS 


DO 


DO 


OD 


DO 


















EBB 


D7 


ED OS 


DA 


DB 








TUNE TABLE 


POINTERS 






SCO 


DS 


DO 


OD 


DO 


00 


















ECS 


D7 


A7 


Ob 


MC 


OD 


0003 


00 




TUNES 


- 


$00 


OFFSET FOR FIRST 


TUNE 


ECA 


OS 


DO 


DO 


DO 


DO 


0004 


70 




FIRST 


~ 


$70 


FIRST TUNE LOW 




ECF 


D7 


77 


07 


EE 


OE 


0005 


02 






S 


$02 


FIRST TUNE HIGH 


0270 


EDM 


D7 


on 


DO 


00 


00 


0006 


70 




SECOND 


~ 


$2F 


SECOND LOW 




EDI 


tD 


BC 


03 


DA 


DB 


0007 03 






2 


$03 


SECOND HIGH 032F 




EDE 


DS 


DO 


DO 


DO 


00 


0008 


FF 




END 


^ 


$FF 


END OF TUNE TABLE 




EE3 
BEfl 
EED 


3D 
DS 
07 


FC 
DO 


DM 
DO 
DS 


F7 
DO 
El 


01 
DO 
OS, 








MAIN PROGRAM 






EFB 


DS 


DO 


no 


DO 


DO 


















EF7 


07 


ED OS 


El 07 


0200 








ORG 


$0200 






BFC 
301 


DS 
07 


DO 


no 
ns 


00 
El 


OD 
Ofl 


0200 


20 


86 8B 


MAIN 


3SR 


ACCESS 


ALLOW WRITING TO 


SYSTEM RAM 


3Dt 


DS 


DO 


GO 


DO 


DO 


0203 


A9 


CO 




LDAIM $C0 


SET ACR6,7 = 1 




30B 


bO 


A7 


Db 


F7 


D1 


0205 


8D 


OB AO 




STA 


ACR 


FOR TIME 1, FREE 


RUNNING 


310 


SO 


DO 


no 


00 00 


0208 


8D 


OB AC 




STA 


ACRX 


WITH OUTPUT ENABLED | 


31S 


n7 


FC 


04 


DO 


00 


0208 


A9 


7F 




LDAIM $7F 


DISABLE IRQ 




31A 


OS 


OD DO 


DO 


DO 


020D 


8D 


OE AO 




STA 


lER 


WITH 




31F 
32M 


07 
OS 


FC 
OD 


OH 
00 


00 
DO 


00 
00 


















3E1 


07 


F7 


01 


F7 01 


















32E 


FF 











• 



MICRO lans 



June 1979 



0210 
0213 
0215 
0217 
0219 
021B 
021D 
021F 
0221 
0222 
0223 
0225 
0227 
0229 
022B 
02 2D 
022F 
0231 
0233 
0235 
0237 
0239 
023B 
023E 
023F 
0240 
0242 
0245 
0248 
0249 
024B 
024E 
0251 
0252 
0254 
0257 
0258 
025A 
025D 
025F 
0262 
0264 
0267 
02 6A 
02 6C 
02 6D 
026F 
0270 
0272 
0274 
0276 



BD OE AC 
A9 00 
85 03 
A4 03 

04 

00 



REST 



Bl 
85 



C9 FF 
DO 01 
00 
C8 

Bl 04 
85 01 
A9 01 
85 02 
AO 00 
Bl 00 
FO E6 
C9 FF 
DO 06 
C6 02 
10 F2 
30 F2 
20 FA 
AA 
C8 

Bl 00 
20 FA 82 
8D 06 AO 
C8 

Bl 00 
20 FA 82 
8D 05 AO 
C8 

Bl 00 
8D 06 AC 
C8 

Bl 00 
8D 05 AC 
A9 77 
8D IE A4 
A9 01 
20 47 8A 
AD 04 A4 
10 F6 
CA 

DO EE 
C8 

DO BB 
E6 03 
E6 03 
4C 17 02 



OKAY 



RESET 
DUR 



82 OUTB 



START 
REFR 



STA 

LDAIM 

STA 

LDY 

LDAIY 

STA 

CMPIM 

BNE 

BRK 

INY 

LDAIY 

STA 

LDAIM 

STA 

LDYIM 

LDAIY 

BEQ 

CMPIM 

BNE 

DEC 

BPL 

BMI 

3SR 

TAX 

INY 

LDAIY 

3SR 

STA 

INY 

LDAIY 

JSR 

STA 

INY 

LDAIY 

STA 

INY 

LDAIY 

STA 

LDAIM 

STA 

LDAIM 

3SR 

LDA 

BPL 

DEX 

BNE 

INY 

BNE 

INC 

INC 

3MP 



lERX 

$00 

TUNES 

TUNES 

FIRST 

LOW 

$FF 

OKAY 



FIRST 

HIGH 

$01 

REPEAT 

$00 

LOW 

REST 

$FF 

OUTB 

REPEAT 

RESET 

DUR 

OUTBYT 



lER r 

INIT TUNE TABLE POINTER 

GET TUNE TABLE POINTER 
GET LOW ADDRESS 
FROM TABLE 
END OF TABLE ? 

ELSE, RETURN TO MONITOR 
BUMP POINTER 
GET HIGH 

INIT REPEAT INDEX 

START THE TUNE 

READ THE DURATION 

IF ZERO, RESTART THE TUNE 

IF DURATION = FF 

CHECK TO SEE IF REPEAT HAS 

TEST SECOND TIME THROUGH 

REPEAT UNTIL MINUS 

CONTINUE 

DISPLAY DURATION 

PLACE DURATION IN X 

INCREMENT DATA INDEX 
LOW READ THE LOWER PORTION OF 
OUTBYT FREQUENCY ONE, DISPLAY IT 
TOL AND STORE IT IN A LATCH 

INCREMENT THE DATA INDEX 
LOW READ THE HIGHER PORTION OF 
OUTBYT FREQ. ONE, DISPLAY IT 
TOC AND STORE IT IN A LATCH 

INCREMENT THE DATA INDEX 
LOW READ THE LOWER PORTION OF 
TOLX FREQ 2 AND STORE IT 

INCREMENT THE DATA INDEX 
LOW READ THE HIGHER PORTION OF 
TOCX FREQ 2 AND STORE IT 
$77 START THE 6532 TIMER 
STIME ON A 0.01 SECOND COUNT 
$01 REFRESH THE 
OUTCHR DISPLAY 
RTIME READ THE 6532 TIMER 
REFR AND WAIT FOR TIME OUT 

DECREMENT THE DURATION 
START RESTART TIMER IF NOT ZERO 

INCR. THE NOTE INDEX 
DUR 

TUNES BUMP TUNES POINTER 
TUNES TWICE 
REST 



D 
U 
R 
A 
T 
I 

N 

32F IS 

33M DS 

33T bO 

33E OS 

3M3 13 

3^fi 03 

3m> 13 

3SE 03 

357 13 

3SC 03 

3Id1 15 

3U= 03 

3tB 50 

37D 03 

375 Q:? 

37A 03 

37F 07 

3fiM 03 

3flT 07 

3aE ?0 

313 30 

3Tfl 03 

3=1]) bO 

3AE 03 

3A7 15 

3AC 03 

3B1 15 

3B(d 03 

3BB 10 

3C0 15 

3C5 03 

3CA OS 

3CF bO 

3DM 20 

3DT 07 

3DE 05 

3E3 07 

3E6 OS 

3ED 07 

3FB 00 



F 


F 


R 


R 


E 


E 


Q 


(3 



ONE 

F7 01 
00 00 
El Dfl 
00 00 
IE, 05 
00 00 
ED 05 
00 00 
A7 Ob 
00 00 
77 07 
DO 00 
77 07 
00 00 
A7 Ob 
DO DO 
ED 05 
00 00 
A7 Ob 
DO DO 
F7 01 
00 00 
El Dfl 
00 00 
^a 05 
00 00 
ED OS 
DO DO 
A7 Ob 
DO 00 
77 07 
DO 00 

FC o^ 

00 00 
F7 OT 
00 00 
F7 OT 
DO 00 
F7 OT 



TWO 

F7 OT 
00 DO 
CI 11 
00 DO 
EE OB 
DO DO 
DA OB 
DO DO 
^C OD 
00 00 
EE OE 
OD DO 
EE OE 
DO 00 
MC OD 
DO 00 
DA OB 
DO DO 
^C OD 
00 00 
F7 OT 
00 OD 
CI 11 
00 00 
1& OS 
00 OD 
ED OS 
00 00 
A7 Ob 
DO DO 
DE 01 
DO 00 
3F 01 
DO 00 
FC OH 
OD DO 
FC DM 
00 00 
FC DM 



Jun«1979 



MICRO ^3:19 



nppkz 



PET 



we have the Most complete Stock of apple and 

PET software in Southern California. 

(Send for our catalog — $1.00) 



16K RAM CHIP SET FOR APPLE II 

ONLY (Tested & Burned in) ^SS^^ 



Reference Books For apple and pet Owners 

Programming the 6502 9.95 

PET user Manual <New from commodore) 9.95 

First Book of KIM 8.95 

MOS Tech Programming Manual (6502) 12.00 

MOSTech Hardware Manual 12.00 



WORKSHOPS: Call for details. 

• PET— 3rcl Saturday of the Month 
• APPLE— 4th Saturday of the Month 

CLASSES: Apple Topics 

we offer a series of classes on Apple II to aquaint owners with some of the unique features and capabilities 

of their system. Topics covered are Apple Sounds, Low Res. Graphics, Hi Res. Graphics, Disl( Basics, and how to Use 

Your Reference Material, sessions are held every Thursday Night at 7:00 p.m. 



HARDWARE 



APPLE II HARDWARE: 

• upper & Lower Case Board 

Now you can display both upper and lower case characters on 
your video with the Apple ii. includes assembled circuit board 
and sample software $49.95 

• Programmer Aide S50.00 

PRINTER SPECIALS FOR APPLE AND PET 

• TRENDCOM 100 with interface for Apple or PET $450.00 



LIMITED QUANTITY 

Refurbished selectric typewriters serially interfaced for plug in 
to APPLE II $1000.00 

All orders must be prepaid. Delivery in 4 to 8 weeks ARO or full refund. 



• Anadex DP-8000 with tracter 

8" paper width and Apple interface $1050 

• Centronics 779-2 for Apple II 

With parallel interface $1245.00 

JOIN THE APPLE COMMUNICATION NETWORK 
(APPLE COM-NET) 

computer components of Orange county Is initiating a 
communication network for all APPLE OWNERS. We 
need the help of dedicated Apple users. Become a 
CHARTER MEMBER Of this APPLE TEAM by helping US set 
up this network. Contact Dave Smith or Dwain Graham 
714-891-2584. 

**COMPLETE COMMUNICATION HARDWARE** 
FOR YOUR APPLE ****S379.00**** 

See If YOU qualify for a cci of oc P/F Card 

and get great discounts on selected 

purchases for your Apple and PET. 



PET HARDWARE 

PET 2001-8 Computer standard PET with integral cassette 

and calculator type keyboard 8K bytes of memory 

(7167 net) $795.00 

PET 2001-16N computer pet with 16K bytes of memory 
and large keyboard with separate numeric pad and 
graphics on keys. External cassette optional. 
(15,359 net) $995.00 

PET 2001-16B Computer As above but has standard type- 
writer keyboard. No graphic keys /: . $995.00 

PET 2001-32N Computer identical to 2001-16N with 32K 

bytes of memory. (31,743 net) $1,195.00 

PET 2001 -32B Computer Identical to 2001 -32B with 32K 

bytes of memory. (31,743 net) $1,195.00 

PERIPHERALS 

PET 2021 Printer 80 column dot matrix electrostatic printer 
with full PET graphics capability $549.00 

PET 2022 Printer 80 column dot matrix printer with plain 

paper or forms handling tractor feed. Has full PET 

graphics $995.00 

PET 2025 Printer 80 column dot matrix printer. Plain 

paper printer with full PET graphics $849.00 

PET 2040 Dual Drive Mini Floppy Disk* Dual drive intelligent 

mini floppy system. 343K net user storage 

capacity $1,095.00 

PET 2041 single Drive Floppy Disk Single drive intelligent 
mini floppy 171. 5K net user storage $595.00 

PET External cassette Cassette player /recorder to use with 
PET 2001/8/16/32 $95.00 

PET user Manual 160 page expanded user manual covering 

all facets of user operation, porogramming and I/O for 

PET computers $9.95 



•Retrofit kit required for operation with PET 2001-8. 



WHY SHOULD YOU BUY FROM US? 

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

—Prices subject to change — 



COMPUTER COMPONENTS OF ORANGE COUNTY 

6791 Westminster Ave., Westminster, CA 92683 714-891-2584 

Hours: Tues-Fri 11:00 AM to 8:00 PM-Sat 10:00 AM to 5:00 PM (Closed Sun, Mon) 

Master Charge, 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 S10.00 for shipping, handling and 

insurance. California residents add 6^x Sales Tax. 



Sorting with ttie APPLE II 

Parti 



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 for 
implementing the Shell-Metzner sort 



Gary A. Foote 

127 Mt. Spring Road 

Tolland, CT 06084 



Whether you are maintaining complex 
data bases, compiling mailing lists, or 
simply keeping track of your checkbook, 
at some time you will need to sort 
records. There are a multitude of sorts 
available — from the agonizingly slow 
one in the APPLE CHECKBOOK pro- 
gram, through the relatively fast BASIC 
sort, to my exceedingly fast (by a factor 
of 200) machine language sort. What 
makes a sort fast, and which sort is the 
fastest? These are the questions I will 
cover in my series on exploring sorting 
with the APPLE II. 

Background 

There have been many magazine articles 
written on sorting. The ones I based my 
^ initial Investigation on were those in the 
" Nov-Dec 1976 issue of CREATIVE COM- 
PUTING covering the SHELL-METZNER, 
bubble, delayed replacement, and heap- 
sorts, and the JAN-FEB 1978 issue of the 
same magazine on the Butterfly-Hart 
sort. The first article found the Shell- 
Metzner and heapsorts to be a vast im- 
provement over the bubble and delayed 
replacement sorts. The second article 
found the Butterfly-Hart to be even 
faster. The Shell-Metzner and heapsort 
are replacement-type sorts; that is, the 
records are compared to one another 
and replace each other according to 
some unique algorhythm. They are rela- 
tively small in size and don't rely on 
much extra storage for their processing. 
The Butterfly-Hart is a linked list sort. A 
tree structure is built from the records 
and broken down into several smaller 
sorted lists. These lists are then merged 
to form the final result. This sort is much 
faster for large numbers of records, but 
is quite complex and requires extra 
storage to hold the lists and tree struc- 
ture. For more details on how these 
sorts operate, I leave you to refer to the 
original articles. 

I programmed each of these sorts in 
INTEGER BASIC and compared them by 
sorting various numbers of random ten 

^ character strings. Below were the 

^A results. 



Table I — Sorting in BASIC 

SORTED WORDS 



SORT 

SHELL-METZNER 

BUTTERFLY-HART 

HEAPSORT 



10 



100 



500 



1000 



1 


34 


268 


647 


2 


38 


266 


606 


1 


35 


261 


600 



(All sorting times in seconds) 



For further exploration, I decided to use 
the Shell-Metzner sort because It was 
easiest to program and most compact. 
Many things had to be taken into ac- 
count before Implementing this sort in 
INTEGER BASIC. Because of the limited 
string support in this BASIC, it is easier 
to store records to be sorted in memory 
between the upper end of the data 
variables and the lower end of the pro- 
gram area, accessing them with PEEK'S 
and POKE'S. At first, as I sorted these 
records, I exchanged the actual records 
in memory when necessary. This 
becomes very time consuming because 
for exchanging two 10 character records, 
you must move 30 bytes (10 to a work 
area, 10 from one record to the other, 
and 10 from the work area back to the 
other record). A much more elegant 
technique is to store the address of each 
record as a member of an array. When an 
exchange is necessary, you need only 
exchange the addresses in the array, a 
total move of 6 bytes (2 + 2 + 2) for any 
size record. When the sort is complete, 
the addresses of the sorted records can 
be found sequentially in the array. The 
first member of the array will point to the 
lowest sorted record, and the last 
member to the highest sorted one. The 
records can be read out in the proper 
order quite simply, and can easily be 
sorted in reverse order simply by reading 
the array backwards. The beauty of this 
method is that the records have never ac- 
tually moved and can be read in the 
original order as simply as the sorted 
order. This reduction alone increases the 



speed of the sort by a factor of three for 
a 100 record sort, and exponentially 
above that. 

My BASIC version is divided into several 
parts. The first part generates random 
character strings in memory, depending 
on the record size and count entered. 
This is for benchmark tests and can be 
replaced with your own I/O routine for 
your application. Line 140 actually puts 
the random characters in memory, so 
replacing this line with a REM after your 
first run allows you to test other sorting 
methods while using the same records. 
The second part merely initializes the 
memory pointer array and prints the un- 
sorted strings. This can also be included 
in your I/O routine. The third part is the 
actual SHELL-METZNER sort. The 
routine can be easily changed if you 
wish to sort numbers in an array instead 
of strings in memory. Finally, there is a 
routine to print the results, and a handy 
routine from CALL-APPLE for finding the 
address of a variable in the data area. 

SWEET-46 for Size 

Never being satisfied, I decided to con- 
tinue another step and try to program the 
sort routine in SWEET-16 (as all you 
APPLE people know, a 16 bit interpreter 
implemented in ROM). An excellent ar- 
ticle in the NOV 1977 issue of BYTE 
(or the BEST OF BYTE VOL 1) was my 
source for SWEET-16 information. 
SWEET-16 was 4 to 9 times faster than 
the BASIC sort, and very compact due 



June 1979 



MICRO 13:21 



to the powerful instruction set. But due 
to difficulty in impfementing, and be- 
cause the machine language routine was 
several orders of magnitude faster, I 
am not including this material. Don't 
feel bad. Because I know of no SWEET- 
16 assembler, writing this program was 
actually harder than the machine 
language version. 

Machine Language for Speed 

The machine language implementation 
of SHELL-METZNER was not difficult, 
because I was almost translating direct- 
ly from each BASIC statement Into 
equivalent functions in machine code. 
As you can see by the listing in Figure 2, 
I made extensive use of PAGE ZERO 
addressing, both to cut down on code 
and increase speed. I left in BASIC all 
the I/O routines and setup necessary 
to prepare the sort, since this is quite 
easy in BASIC and I already had the pro- 
gram written from the first problem. 
The actual sort algorhythm Is the only 
part I programmed in machine code. 
Thus we get the benefit of BASIC for I/O, 
printing, etc. in 1 % of the execution, and 
the machine code speed for the repeta- 
tive looping in 99% of the execution. 
Using this machine language sort is rel- 
atively easy. The BASIC routine in Figure 



3 sets up the variables needed by the 
sort and calls the machine language 
routine. It can be substituted for the sort 
routine in the BASIC version in Figure 1 
(lines 1000-1900). The sort routine itself 
(in Figure 2) is loaded at address 300- 
3C2. This routine is easily relocatable 
to any other address (say 800 if you are 
using 300 for another routine). All you 
need to do is load it where desired and 
change the last two instructions (2 JMP 
commands) to reflect your new location. 
You must, of course, change the CALL 
in your BASIC program also. 
Below is a comparison of my three dif- 
ferent implementations of the Shell- 
Metznersort. 



The maximum number of records you 
can sort is easily determined by taking 
the memory size between data high and 
program low and dividing it by the record 
size -I- 2 (the size of the array element 
needed to hold the pointer to the record). 
I find with a 32K machine running DOS, 

I have 18K free. More memory is avail- 
able if you want to lose DOS of course. 
Machine language routines may be more 
trouble to implement, but with an in- 
crease in speed over BASIC by a factor 
of 200, you cannot ignore them. In Part 

II I will continue my investigation by ex- 
ploring sorting APPLESOFT charac- 
ter strings with multiple keys. Until then, 
happy sorting! 



Table 11 — Comparison of Three Methods 

SORTED WORDS X WORD LENGTH 



METHOD 

BASIC 

SWEET-16 

MACHINE 



500X10 

268 

46 

1 



1000X10 

746 

158 

3 



3600 X 3 

4200 (70 m in) 

21 



(All sorting times in seconds) 



Figure 1 



10 

20 

30 

^0 

50 

60 

70 

BO 

90 

95 

100 

105 

110 

120 

130 

14-0 

150 

200 

205 

210 

220 

230 

2^0 

250 



PRINT 



REM ¥¥¥ii^¥¥iiii^ii^¥f^^¥¥¥¥r^¥¥¥¥¥i^f:¥¥ 

REM ¥ SHELL-METZNER SORT ¥ 

REM ¥ BY GARY FOOTE ♦= 

REM ¥¥¥¥¥¥^¥¥¥¥¥¥¥¥^¥¥¥¥^¥¥¥¥¥¥¥ 

CALL -936: PRINT : PRINT "SHELL-METZNER SORT": 

INPUT "ENTER RECORD COUNT AND LENGTH'S NUMf LEN 

DIM A$(255) f A(NUM) 

I::J^KsL=M^X::T2Z=LL^II=LM::HM = ADDRsW: REM SAVE SPACE FOR VARIABLES 

LM^ PEEK (20^^)1- PEEK ( 205) ♦=256 :HM= PEEK (202) ^ PEEK (203) ^^256 

REM 

REM ic^cfcic^cf: FILL MEMORY WITH DATA +:+:<cict:ic 

REM 

PRINT .' PRINT "CREATING RANDOM STRINGS" 

IF LMfLEN^cNUMCHM THEN ItfO 

PRINT "TOO MUCH DATA!!": END 

FOR X?l TO LEN^^NUM: poke LMfXf 

REM 

REM is4c<<i:*:|c INITIALIZE MEMORY POINTER 

REM 

A$ = "A$": G05UB tfOOO 

FOR X^l TO NUM:A(X)s(X'l)icLENfLMfl 

T::A(X) : 60SUB 3000 

NEXT X 

REM 



RND (26) fl93: NEXT X 



ARRAY l=4ct;<c+;t: 



MfCRO 13:22 



June 1979 



lOOO REM ¥¥¥ii¥¥ SORT ROUTINE *kltt:Hc 
1010 REM 

1100 print : print "starting sort** 
1200 N5NUm:m=n 

1300 M=M/2: IF M=0 THEN 1900 :K=N-M: J;l 
l«t0O I:J 

1500 l=h-m:ii3A(I) :ll2A(L) 

1600 FOR X=0 TO LEN-i:W5 PEEK (IlfX)- PEEK (LLfX): IF W<0 THEN IBOO: IF 
W>0 THEN 1700: NEXT X: GOTO iBOO 

1700 T"A(i) :a(I)3A(L) :a(L)3T:i=i-m: if i>si then 1500 

1800 J=Jfi: IF J>K THEN 1300: GOTO it^OO 

1900 PRINT : PRINT "ENDING SORT" 

1910 REM 

2000 REM tttticnc*: PRINT RESULTS *♦=«!«*:«= 

2005 REM 

2010 A$;"A$": GOSUB t^OOO 

2020 FOR Xsi TO NUM 

2030 TsA(X) : GOSUB 3000 

201^0 NEXT X 

2050 END 

2060 REM 

3000 REM *icnctc* STRING PRINT ROUTINE ««*♦:«'♦=»= 

3005 REM 

3010 FOR Z=0 TO LEN-1 

3020 POKE ADDRfZf PEEK (TfZ): REM ARRAY A$ 

3030 NEXT Z: POKE ADDRfZ»30 

30tfO PRINT X»A$ 

3050 RETURN 

3060 REM 

t^OOO REM ¥¥i^¥¥ FIND VARIABLE'S ADDRESS 

tt005 REM 

ifOlO ADDRS PEEK {7tf)f PEEK ( 75) *256-l :K= LEN(A$):Jp PEEK (20'f)f PEEK (205 

)*256-i:L;:0: IF ASCKrKjB^S" THEN ^020:KsK-l :L = 1 
q.020 FOR 1 = 1 TO K! IF ASC{A${I))« PEEK (ADDRfl) THEN it04-0: NEXT I 
1^030 IF PEEK (ADDRfI»-L)>l THEN tfOttO: ADDRsADDRfKfttl-L: RETURN 
ifO^O FOR 1 = 1 TO lOO: IF PEEK (IfADDR)>l THEN NEXT I : I=ADDRflH : ADDRs PEEK 

(I)f PEEK (Ifl)*256-1 
tf050 IF ADDRCJ THEN ^020: PRINT "VARIABLE "»A$>" NOT FOUND": END 



Figure 2 

1000 REM ***:♦:»'•: SORT ROUTINE ¥ift^if*^¥ 

LOlO REM 

1100 PRINT : PRINT "STARTING SORT" 

1200 A$:;"A": GOSUB ^000 

1300 POKE OtADDR MOD 256: POKE l»ADDR/256: REM STORE ARRAY ADDRESS 

lt<.00 POKE 2»LEN: rem store RECORD LENGTH (MUST BE i 256) 

1500 POKE tf»NUM MOD 256: POKE 5fNUM/256: POKE 6»NUM MOD 256: POKE 7»NUM< 

256: REM STORE NUMBER OF RECORDS 
1600 CALL 768: REM CALL SORT ROUTINE 
1700 PRINT : PRINT "ENDING SORT" 



June 1979 MICRO 13:23 



Figure 3 

1000 4t*.-.--5'-'---^"- = -'^--'-''"--"^'""^* 

1010 «= SHELL -ME TZNE.R SORT * 

1020 * Br GARY A. FOOTE ^ 

1030 * COPYRIGHT 1979 «= 

lOtfO <= COMMERCIAL RIGHTS RESERVED * 

1050 «= ,»„-.., ^,---^ -,,-,,--^ic 

1060 «» 

1070 ¥ VARIABLES AND CONSTANTS 

lOBO * 

1090 ¥ ALL VARIABLES ARE TWO BYTES. 

1100 ¥ THE LISTED NAME IS THE LOW ORDER BYTE. 

illO ¥ THE NAMEU IS THE HIGH ORDER BYTE. 

1120 ♦^ EX. I ' LOW ORDER BYTE 

1130 * Ifl = HIGH ORDER BYTE 

1140 if 

1150 ADRA .EQ $00 ARRAY A ADDRESS 

1160 LEN .EQ S02 RECORD LENGTH 

1170 N .EQ $0*+ NUM OF RECORDS 

llBO M .EQ $06 M 

1190 I .EQ $08 I (RECORD I) 

1200 L .EQ $0A L (RECORD L) 

1210 J .EQ $0C J 

125'0 K .EQ $0E K 

1230 PTRI .EQ $10 PTR TO ADDR OF A(I) 

1240 PTRL .EQ $12 PTR TO ADDR OF A(L) 

1250 ADRI .EQ $14 ADDR OF REC A(I) 

1260 ADRL .EQ $16 ADDR OF REC A(L) 

1270 ¥ 

12B0 * SORT ROUTINE 

1290 ¥ 

1300 .OR $300 

0300- 46 07 1310 SORT LSR Mfl M = M / 2 

0302<' 66 06 1320 ROR M 

0304- DO 05 1330 BNE SRTl IF M = 

0306- A5 07 1540 LDA Mfl 

030B- DO 01 1350 BNE SRTl THEN 

030A- 60 1360 RTS DONE! 

030B- 38 1370 SRTl SEC 

030C- A5 04 1380 LDA N K = N - M 

030E^ E5 06 1390 SBC M 

0310- 85 OE 1400 STA K 

0312»' A5 05 1410 LDA Nfl 

0314- E5 07 1420 SBC M4-1 

0316- 85 OF 1430 STA Kn 

0318- A9 01 1440 LDA ttl J = 1 

03lA» 85 OC 1450 STA J 

031C- A9 00 1460 LDA »0 

031E- 85 OD 1470 STA JH 

0320s A5 OC 1480 SRT2 LDA J I = J 

0322- 85 08 1490 STA I 

0324- A5 00 1500 LDA JH 

0326- 85 09 1510 STA Ifl 

MICRO 13:24 



June 1979 



t 



0328- 


IS 




1520 


SRT3 CLC 






0329 •» 


A5 


08 


1530 


UDA 


I 


L = I f M 


032Br 


65 


06 


15'^0 


ADC 


M 




032D- 


85 


OA 


1550 


STA 


L 




032F- 


A5 


09 


1560 


LDA 


in 




0331' 


65 


07 


1570 


ADC 


Mfl 




0333- 


85 


OB 


1580 


STA 


Ln 




0335» 


A5 


00 


1590 


LDA 


ADRA 


INITIALIZE PTRS 


0337p 


85 


10 


1600 


STA 


PTRI 


TO ARRAY A 


0339- 


85 


12 


.1610 


STA 


PTRL 


ADDRESS 


033B- 


A5 


01 


1620 


LDA 


ADRAM 




33D- 


85 


11 


1630 


STA 


PTRin 




33F- 


85 


13 


1640 


STA 


PTRLfl 




031H- 


AO 


02 


1650 


LDY 


nz 




03'*3- 


18 




1660 


SRT4 CLC 






03«*tf- 


A5 


10 


1670 


LDA 


PTRI 


PTR TO A(I) = 


3^6- 


65 


08 


1680 


ADC 


I 


ADDR ARRAY A f 


03tfB- 


85 


10 


1690 


STA 


PTRI 


2*1 


03tfA- 


A5 


11 


1700 


LDA 


PTRin 




03«*C- 


65 


09 


1710 


ADC 


in 




03'fE- 


85 


11 


1720 


STA 


PTRIfl 




350- 


18 




1730 


CLC 






OSSl"- 


A5 


12 


1740 


LDA 


PTRL 


PTR TO A(L) = 


0353- 


65 


OA 


1750 


ADC 


L 


ADDR ARRAY A f 


0355- 


85 


12 


1760 


STA 


PTRL 


2 * L 


0357- 


A5 


13 


1770 


LDA 


PTRLfl 




0359- 


65 


OB 


1780 


ADC 


Lfl 




035B- 


85 


13 


1790 


STA 


PTRLfl 




035D- 


88 




1800 


DEr 




DO 2 TIMES 


035E- 


DO 


E3 


1810 


BNE 


SRT4 


(PTR DISP IS 2 BYTES) 


0360? 


Bl 


10 


1820 


LDA 


(PTRDfY 


II 3 A(I) 


362- 


85 


m 


1830 


STA 


ADR I 




36**- 


Bl 


12 


1840 


LDA 


(PTRL)»Y 




0366- 


85 


16 


1850 


STA 


ADRL 




0368- 


C8 




1860 


INY 






0369- 


Bl 


10 


1870 


LDA 


(PTRI)»Y 


LL 5 A(L) 


036B- 


85 


15 


1880 


STA 


ADRIfl 




036D- 


Bl 


12 


1890 


LDA 


(PTRDfY 




036F- 


85 


17 


1900 


STA 


ADRLfl 




0371s 


88 




1910 


DEY 






0372- 


Bl 


1*^ 


1920 


SRT5 LDA 


(ADRDfY 


COMPARE ONE BYTE IN 


0374- 


Dl 


16 


1930 


CMP 


(ADRL)»Y 


RECORDS I ft L 


0376- 


90 


31 


1940 


BCC 


SRTB 


I < L 


0378- 


DO 


07 


1950 


BNE 


SRT6 


I > L 


037A- 


C8 




1960 


INY 




I s L 


037B- 


Ctt 


02 


1970 


CPY 


LEN 


END OF RECORD? 


037D- 


DO 


F3 


1980 


BNE 


SRT5 


NOf NEXT BYTE 


037F- 


FO 


28 


1990 


BEQ 


SRT8 


RECORDS EQUAL 


0381- 


AO 


00 


2000 


SRT6 LDY 


no 




0383- 


A5 


It* 


2010 


LDA 


ADR I 


A(I) <-> A(L) 


0385- 


91 


12 


2020 


STA 


(PTRL)»Y 




0387- 


A5 


16 


2030 


LDA 


ADRL 




0389- 


91 


10 


2040 


STA 


(PTRDfY 




38B- 


C8 




2050 


INY 






03BCt. 


A5 


15 


2060 


LDA 


ADRIfl 




Jum1979 












MICRO 



3BE 


- 91 12 




2070 




STA 


(PTRL) rf 








0390 


- A5 17 




2080 




LDA 


ADRLH 








392 


- 91 10 




2090 




STA 


(PTRI) ti 








0391^ 


- 38 




2100 




SEC 












0395 


- A5 08 




2110 




UDA 


I 




I 5 I - 


M 




397 


- E5 06 




2120 




SBC 


M 










399 


» 85 08 




2130 




STA 


I 










39B 


- A5 09 




211^0 




LDA 


Ifl 










39D 


- E5 07 




2150 




SBC 


MH 










39F 


- 85 09 




2160 




STA 


in 










03A1 


- 90 06 




2170 




BCC 


SRT8 










03 A3 


- DO 33 




2180 SRT7 


BNE 


SRT3 




IF I > 


THEN STR3 




03A5 


. A5 08 




2190 




LDA 


I 










03A7 


* DO FA 




2200 




BNE 


SRT7 










03A9 


- E6 OC 




2210 SRfB 


INC 


U 




J = J f 


1 




03AB 


- DO 02 




2220 




BNE 


SRT9 










03AD 


r E6 OD 




2230 




INC 


JH 










3AF 


- A5 OF 




22'^0 SRT9 


LDA 


KH 










03B1 


- C5 OD 




2250 




CMP 


JH 




IF J > 


K 




3B3 


• 90 OB 




2260 




BCC 


JMP2 




THEN SORT 




3B5 


- DO 06 




2270 




BNE 


JMPl 




ELSE SRTX 




3B7 


- A5 OE 




2280 




LDA 


K 










3B9 


- C5 OC 




2290 




CMP 


J 










3BB 


- 90 03 




2300 




BCC 


JMP2 










3BD 


- tfC 20 03 


2310 vIMPl 


JMP 


SRT2 




CHANGE 


IF RELOCATED 




03C0 


- itC 00 03 


2320 UMP2 


JMP 


SORT 




CHANGE 


IF RELOCATED 










2330 




.EN 












:$300.3C2 






















0300- t*6 


07 66 06 


DO 


05 A5 


07 














308? DO 


01 60 38 


A5 


0<+ E5 


06 














0310- 85 


OE A5 05 


E5 


07 85 


OF 














03l3r A9 


01 85 OC 


A9 


00 85 


OD 














320p A5 


OC 85 08 


A5 


OD 35 


09 














0328- IB 


A5 08 65 


06 


85 OA 


A5 


SYMBOL 


TABLE 






0330- 09 


65 07 85 


OB 


A5 00 


85 














0338- 10 


35 12 A5 


01 


85 11 


85 


ADR A 


0000 


LEN 


0002 N 


000t4- 


03^0- 13 


AO 02 18 


A5 


10 65 


08 


M 




0006 


I 


0008 L 


OOOA 


03tt8- 85 


10 A5 11 


65 


09 85 


11 


J 




oooc 


K 


OOOE PTRI 


0010 


0350- 18 


A5 12 65 


OA 


85 12 


A5 


PTRL 


0012 


ADR I 


OOlt^ ADRL 


0016 


0358- 13 


65 OB 85 


13 


88 DO 


E3 


SORT 


0300 


SRTl 


030B SRT2 


0320 


360= Bl 


10 85 If* 


Bl 


12 35 


16 


SRT3 


0328 


SRTt+ 


031^3 SRT5 


0372 


368- CB 


Bl 10 85 


15 


Bl 12 


85 


SRT6 


0381 


SRT7 


03 A3 SRTS 


03A9 


0370«' 17 


88 Bl m- 


Dl 


16 90 


31 


SRT9 


03AF 


JMPl 


03BD JMP2 


03C0 


378- DO 


7 C8 Cif 


02 


DO F3 


FO 














380- 23 


AO 00 A5 


H* 


91 12 


A5 














383- 16 


91 10 C8 


A5 


15 91 


12 














03909 A5 


17 91 10 


38 


A5 08 


E5 














398- 06 


35 03 A5 


09 


E5 07 


85 














3A0 3 09 


90 06 DO 


83 


A5 08 


DO 














03A8- FA 


E6 OC DO 


02 


E6 OD 


A5 














03B0- OF 


C5 OD 90 


OB 


DO 06 


A5. 














03B8- OE 


C5 OC 90 


03 


t^cjlojiK^ 


cM/H^€, 


IP Z^tJOCJ^TB^ 




03C0- «+C 


100 03}— ~ 




• 


















Jum 1979 


MICRO 13:26 























• 



AT LAST 

ENHANCE THE FULL CAPABILITIES OF YOUR DISK II 

SOFTOUCH ANOUNCES THE 

" DISC MANAGEMENT SYSTEM " 
EIGHT PROGRAMS ON DISK TO PROVIDE THE USER WITH A 
COMPLETE UNDERSTANDING OF THE DISK DRIVE COMMANDS 
PLUS A UTILITY PACKAGE TO INDEX AND CATAGORIZE ALL 
PROGRAMS WRITTEN FOR THE APPLE II COMPUTER. THE 
SYSTEM PROVIDES FULL SEARCH , EDITING AND DATA 
TRANSFER CAPABILITIES. 

A TWENTY- SIX PAGE BOOKLET PROVIDES DETAILED , 
EDUCATIONAL TECHNIQUES GIVING A THROUGH UNDERSTAND- 
ING OF ALL DOS COM^NDS. 

INCLUDED ARE SUCH TECHNIQUES AS: 

* INITIALIZATION OF TEXT FILES 

* WRITING ^ READING OF TEXT FILES 

* CREATING TEXT FILES 

* EDITING FILES 

* TRANSFERRING DATA TO OTHER DISKETTES 

* LISTING OF DATA FILES 

* SEARCHING DATA BY VARIOUS OPTIONS 

A DOCUMENTED LISTING PROVIDES LINE CHANGES FOR 
ADAPTING THE SYSTEM TO PREFORM NUMEROUS OTHER 
APPLICATIONS. 

THE BOOKLET IS WRITTEN IN A MANNER WHICH MAY BE USED 
BY THE NOVICE AS WELL AS THE EXPERIENCED PROGRAWER. 
DOZENS OF PROGRAhWING TECHNIQUES ARE SHOWN AND FULLY 
DOCUMENTED. ALSO INCLUDED SEPARATELY, IS A PROGRAMMERS 
AID GIVING QUICK REFERENCE TO INTEGER, APPLESOFT AND 
DOS COMMANDS WITH ILLUSTRATIVE EXAMPLES. 

SYSTEM REQUIREMENTS: DISK II S APPLESOFT TAPE OR ROM CARD 

PRICE $19.95 [PROCESSED 6 SHIPPED WITHIN 4 DAYSJ 

SEND CHECK OR MONEY ORDER TO: 



.V. 



SOFTOUCH 
P.O. BOX 511 
LEOMINSTER, MASS. 01453 



APPLE II OWNERS 

West Side Electronics introduces the 
APPLETIME^^, a Reol rime Clocit for the Apple 11 

The Appletime (Model APT-l) is a single peripheral 
board which plugs directly into any 1/0 slot on the 
Apple II, Timing is done completely in hardware (ie. 
NOT an interrupt driven clock). Thus, the Appletime 
continues to operate even when the computer is turned 
off. Our exclusive Three Way Power System keeps the 
clock running via its own AC supply, the computer's, 
or battery backup in case of power failure. Other 
features include 12/24 Hour selection, AC or crystal 
timebase, 50/60 Hz, and BCD or ASCII data format. 
Fully assembled and tested, with instructions and 

APT-l Real Time Clock $79.95 




ZZ-z:^ 



Pygmy 
Programming 

• APPLE SOFTWARE * 

1-^ 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 16k 
or larger system) 

APPLE-DMS 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! 



Proto-boord for Apple H. Over 1300 holes on 0.1 inch 

centers for designing your own circuits. 

APB-I Prototyping Board $16.95 



VERBATIM SV4 " DISKETTES $34.50 

Soft sector, In plastic file case. Box of 10 



s 



WEST SIDE ELECTRONICS 

P.O. Box 636 

CHATSWORTH,CA. 91311 

We pay all shipping in Confinenfal U.S. A 




Others add 10%; California residenfs add 6% fax. 



APPLE II SOFTWARE 

Tabular 4-Way Number Converter 

Integer BASIC (8K 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 Point 
Interface (2K l\4achine Code) $6.50 

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

MIcrospan Software 

2213A Lanier Drive 

Austin, TX 78758 

(Texas residents add 5% sales tax) 



streamlining tiie C2-4P 



Here are three modifications you can maice to your OSI 
C2-4P to raise its speed, increase the cassette 
throughput, and add reverse video to the display. 



James L. Cass 

19559 Tulsa Street 

Noi1hrfdge,CA91326 



I am concerned by the paucity of articles 
on OSI computers In MICRO and hope 
that this will reverse the trend. I feel that 
the Challenger 2-4P running speed and 
ease of modification more than offset its 
shortcomings. I will describe three modi- 
ficiatlons I have made, mainly, raising 
the CPU clock rate, raising the cassette 
data rate, and reversing the video 
presentation. 

Raising the CPU Clock Rate 

My computer is happily working with a 
clock frequency a little under 2 MHz 
(1.9648 actual, 1.96608 nominal) in place 
of half that, which Is the way it was de- 
livered. The CPU clock is taken from the 
video timing chain, which uses a crystal 
oscillator near 12 MHz. a divide by three, 
and then a series of binary dividers to 
form 15,360 and 60 Hz sync pulses. It 
was only necessary to move the CPU 
clock takeoff one stage higher in the 
timing chain. To do this, move the 
jumper wire coming from bus pin #18 off 
10 #E4 pin #13, and onto pin #14. If you 
intend to make this change, use a small, 
low power, preferably grounded solder- 
ing iron, as recommended for all 10 work. 
Another word of caution: make a long, 
thorough shakedown run of several 
operational programs looking for 
dropped bits from memory. I did this 
since I have two RAM chips marked 
"550" (presumably not fast enough to 
qualify as 450 nsec), 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 alt, running times cut in half. A 
machine language LIFE program up- 
dates a full screen of 1792 cells 14 times 
a second! 

Doubling the Bit Rate 

i successfully doubled the bit rate of my 
cassette interface from 300 to 600 baud, 
after speeding up my CPU. I naturally 
tried 1200 baud; while it seemed to read 
properly, the load program seemed to 
choke up on very long (64 to 71 charac- 
ter) lines sometimes and miss the OR 
and next line. The 555 10 oscillator fre- 
quency is doubled from 4800 to 9600 Hz 
by substitutiong a 0.01 mfd capacitor for 
the 0.022 and then adjusting the trimpot. 



A frequency counter Is a big help, if not 
essential. Since the tone frequencies 
should remain at 1200 and 2400 Hz, an 
extra divider is needed. The unused 
half of the 7474 already in the interface 
works nicely, or you can install a 74163 
in the convenient prototyping vacant 
space, and get several baud rates for 
printers and the like. Rate selection can 
be conveniently brought to a switch 
mounted to the left of the keyboard. 
Figure 1 shows the circuit using the 
7474. 

I have found "reversed" video to be 
much easier to view for extended 
periods. Also, the black "reversed" 
characters have less apparent intensity 
variation, that is, they look evener. The 
reversed video connection is indicated 
in the schematics, but there is no pro- 
vision made in the printed wiring, so that 
it is necessary to cut a printed con- 
ductor. The junction of R 11 and R 23 is 



FROM 
U13-555 
PIN 3 



moved from Pin 8 to Pins 9-10-11 of the 
)C at D4. I installed a switch near the 
keyboard with short, direct small wires, 
but find that I could have left the wiring 
at "reversed" with no loss. 

Conclusions 

Doubling the CPU clock rate and hence 
the speed of the 02-4P is quite easy to 
do. The main risk is that some 2114 
type RAM chips may be too slow. The 
data rate In the cassette interface can 
be doubled to 600 baud, but only with 
some effort and decrease in reliability; 
1200 baud does not work. Reversing the 
video to display black characters on 
white is relatively simple and the re- 
versed video format is preferred by 
everyone. Cassette speed selection and 
normal-reverse video are conveniently 
brought to switches installed near the 
keyboard. 

M 



TO 
7476 Ul 
PIN 16c6 



+5V 




TO 6850 
300 ACIA 
BIT 
RATE 
SWITCH 



7474 CIRCUIT 



Figure 1 



# 



MICRO 13:28 



June 1979 



6502 INFORMATION 
^ RESOURCES UPDATED 



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



William R. Dial 
438 Rosiyn Ave. 
Akron, OH 44320 



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



piled from this bibliography. At the top of the list are 
several publications which specialise in 6502-related 
subjects. An attempt has been made to give up-to-date 
addresses and subscription rates for the magazines 
cited. Subscription rates are for U.S. Other countries 
normally are higher. 



MICRO 

$15.00 per year 
MICRO 
P.O. Box 3 
S.Chelmsford, MA 01824 

6502 USER NOTES 

$13.00 per 6 issues 
Eric Rehnke 
P.O. Box 33093 
Royalton, OH 44133 

OHIO SCIENTIFIC — SMALL SYSTEMS JOURNAL 

$6.00 per year (6 issues) 
Ohio Scientific 
1333S.ChillicotheRd. 
Aurora, OH 44202 

PET GAZETTE 

Free bi-monthly (Contributions Accepted) 
Microcomputer Resource Center 
1929 Northport Drive, Room 6 
Madison, Wl 53704 

Robert Purser's REFERENCE LIST OF COMPUTER 
CASSETTES 

Nov. 1978 $2.00/Feb 1979 $4.00 
Robert Purser 
P.O. Box 466 
El Dorado, CA 95623 

THE PAPER (PET) 

$15.00 per year (10 issues) 
The PAPER 
P.O. Box 43 
Audubon, PA 19407 

THE CIDER PRESS (APPLE) 

Scot Kamins 

Box 4816 

San Francisco, CA 94101 



STEMS FROM APPLE 

Ken Hoggatt 

APPLE PORTLAND PROGRAM LIBRARY 

EXCHANGE 
9195 SW El Rose Court 
Tigard, OR 97223 

APPLE SEED 

Bill Hyde 

The Computer Shop 

6812 San Pedro 

San Antonio, TX 78216 

KILOBAUD/MICROCOMPUTING 

$18.00 per year 
Kilobaud Magazine 
Peterborough, 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. 
BoxE 

1263 El Cam i no Real 
Menio Park, CA 94025 

ON-LINE 

$3.75 per year (1 8 issues) 
D. H. Beetle 
24695 Santa Cruz Hwy 
Los Gatos, CA 95030 

RECREATIONAL COMPUTING 

(jormerly PEOPLE'S COMPUTERS) 
$10.00 per year (6 issues) 

People's Computer Co. 

1263 El Cam I no Real 

BoxE 

Menio Park, CA 94025 



June 1979 



MICRO 13:29 



INTERFACE AGE 

$18.00 per year 

McPheters, Wolfe & Jones 
16704 Marquardt Ave. 
Cerritos,CA 90701 

POPULAR ELECTRONICS 

$12.00 per year 
Popular Electronics 
One Park Ave, 
NewYork, NY 10016 

PERSONAL COMPUTING 

$14.00 per year 

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

73 MAGAZINE 

$15.00 per year 
73, Inc. 
Peterborough, NH 

CREATIVE COMPUTING 

$15.00 per year 
Creative Computing 
P.O.BOX789-M 
Morristown, NJ 07960 

SSSC INTERFACE 

Southern California Computer Soc. 

1702 Ashland 

Santa Monica, CA 90405 

EDN (Electronic Design News) 
$25.00 per year 

Cahners Publishing Co. 

270St. PaulSt. 

Denver, CO 80206 

RADIO ELECTRONICS 

$8.75 per year 
Gernsback Publications, Inc. 
200 Park Ave., South 
New York, NY 10003 

QST 

$12.00 per year 
American Radio Relay League 
225 Main St. 
Newington, CT06111 

IEEE Computer 

IEEE 

345 E. 47th St. 

New York, NY 10017 



POLYPHONY 

$4.00 per year 

PAIA Electronics, Inc. 
1020 W.Wilshire Blvd. 
Oklahoma City, OK 731 16 



RAINBOW (APPLE) 
$15.00 per year 

Rick Simpson and Terry Landereau, Editors 

P.O. Box 43 

Audubon, PA 19407 

PET USER NOTES 

$5.00 per year (6 or more issues) 
PET User Group 
P.O. Box 371 
Montgomeryville, PA 18936 

CONTACT — User Group Newsletter 
Gratis to Apple owners 

10260 Band ley Drive 

Cupertino, CA 95014 

(408)996-1010 

SOUTHEASTERN SOFTWARE NEWSLETTER 

(APPLE) 

10 Issues $10.00 

George McClelland 

Southeastern Software 

7270 Culpepper Drive 

New Orleans, LA 70126 



COMPUTER MUSIC JOURNAL 

$14.00 per year (6 issues) 
People's Computer Co. 
BoxE 

1010 Doyle St. 
Menio Park, CA 94025 

POPULAR COMPUTING 

$18.00 per year 
Popular Computing 
Box 272 
Calabasas,CA 91302 

MINI-MICROSYSTEMS 

$18.00 per year 

Modern Data Service 
5 Kane Industrial Drive 
Hudson, MA 01749 

DIGITAL DESIGN 

$20.00 per year 

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

ELECTRONIC DESIGN 

(26 issues per year) 
Hayden Publishing Co., Inc. 
50 Essex St 
Rochelte Park, NJ 07662 

CALLA.P.P.L.E. 

$10.00 per year (includes dues) 
Apple Puget Sound Program Library Exchange 
6708 39th Ave. SW 
Seattle, WA 98136 



MICRO 13;30 



June 1979 



The Color Gun for the Apple II 



» 



With some quite inexpensive hardware, you can turn 
your APPLE l\ into a color detector -- a device which will 
automatically determine the colors of any object. 



Neil D. Lipson 

29 S. New Ardmore Ave. 

BroomaH, PA 19008 



» 



Shortly after I developed my light pen for 
the Apple back in May, 1978, I began 
thinking about other devices that could 
be hooked up to the paddle inputs. One 
idea was making a "color gun" which 
when pointed at an object would tell 
you the color. The idea is similar to that 
of the operation of a television transmit- 
ter. Color is broken down into three main 
colors, which are red, blue, and yellow. 
Therefore by having three inputs into 
the Apple, into paddle 0, paddle 1, and 
paddle 2, we could in effect have a de- 
vice that would "see" the three color 
breakdown ratios of any object. By fur- 
ther analysing this ratio, we could see 
different shades of color and with high 
quality color filters, we could make an 
extremely accurate device which could 
even give the exact color temperature 
of the object. One of the Interesting as- 
pects of this device that sets It apart 
from any other color temperature. meter, 
is that you can calibrate it by pointing it 
at a piece of white paper to adjust for 
differences in the light source. There- 
fore, the color gun will work in any type 
of artificial lighting within certain para- 
meters (you could not use It under a red 
light for example). 

Building the Color Gun 

To start off with, buy three sensitive 
cadium sulphide photo cells (physically 
between 1/4 to 1/2 inch in diameter). If 
the cells are not equal in sensitivity, they 
can be equalized easily in software. This 
is illustrated in the listing. Merely point 
the gun at a white piece of paper (or at 
the light source Itself if its not too bright) 
during the calibration procedure. The 
construction of the gun is very simple. 
Mount the t hree cells in a tria ngl e about 
2" for each side on a piece of wood or 
other material. Then place three fllTers 
over the cells, with red on paddle (0) 
cell, blue on paddle (1) cell, and yellow 
on paddle (2) cell. The purer the filter, the 
better. Photographic filters are the best, 
and will give the best results. However, 
red, blue or yellow clear plastic will work 
satisfactorily in most situations. Note 
the use of the REM statements In the 
program. These are for slowing down the 
paddle readings just a hair in order to 
avoid having the readings "overlap". The 
wiring diagram is shown in Figure 1. 



June 1979 



Mount the entire setup in some type of 
barrel or cylinder about 4 Inches long, 
with the inside of the barrel painted 
white, and glue everything together and 
seal against light leaks. Plug it into the 
game paddle after the wiring is complete 
and you ready to go. For the pin numbers 
of 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 only 
recognize 6 colors, and when it isn't sure 
what the color is, it will give you two 
colors (one primary color and one sec- 
ondary). This should not happen if the 
colors are absolutely pure, but most 
colors are not, so expect this situation 
more often. Notice the correction al- 
gorithm in statement 70 in the program 
to correct for the blue cell. The cells that 
I used were somewhat more sensitive to 
blue than the other colors (which is com- 
mon of cadium sulfide). This was noticed 
when the color gun kept saying "orange" 
(the compliment of blue). The correction 



algorithm elimates most of this problem. 
If the gun acts strangely, run it again 
until it gests a good calibration. It some- 
times takes more than one run to get it 
working properly (usually because it is 
confused by a bright color nearby). 

By fine tuning the software, and using 
more exact ratios, you can determine 
many other colors. Given enough ratios 
to choose from, you can give the color 
temperature of the object (with high 
quality cells and filters). The typical 
photographic filters you can use are the 
yellow (K2), the red (25 or 25A) and the 
blue (47). These may be varied If desired 
to meet the spectral response of the 
particular cell you buy. You could even 
use different colors in the filters as long 
as you adjust the software accordingly. 
Buy the smallest filter you can (it only 
has to cover about 1/2 inch diameter), 
but make sure there is no light leak from 
the sides of the cells. If you follow these 
instructions, the gun will work perfectly 
the first time around. Have fun! 



Red 



Blue 



Yellow 




5V pdl'O' pdrr pdl'2' 

Figure! 

MICRO 13:31 



5 REM '0' 

6 REM '1' 

7 REM '2-' 



1 CALL -936 

2 VTAB 10: HTAB 10: PRINT "COLOR 

GUN BY NEIL D. LIPSON" 

3 HTAB 15: PRINT "COPYRIGHT 1979 

tt 

4 HTAB 12: PRINT "ALL RIGHTS RES 

ERVED": FOR I = 1 TO 2000: NEXT 
I 

RED 
BLUE 
YELLOW 
10 CALL - 936 
15 REM YELLOW, BLUE, RED 
20 PRINT : PRINT : PRINT : PRINT 

25 GOSUB 1000 

30 CALL - 936: PRINT : PRINT 

32 A = PDL (0) 

35 REM 

40 B = PDL (1) 

45 REM 

50 C = PDL (2) 

55 REM 

60 A = A * Al 

61 B = B * Bl 

62 C = C * CI 
70 B = B / 1.5 

100 PRINT "RED CELL = ";A 

110 PRINT "BLUE CELL = ";B 

115 PRINT "YELLOW CELL = ";C 

116 PRINT : PRINT 

117 PRINT "THE COLOR IS:": PRINT 

118 PRINT "*♦********♦********** 

121 IF C< B AND C< (A) THEN PRINT 
"YELLOW" 

123 IF A< B AND A<C THEN PRINT 
"RED" 

124 IF A > B AND A> C THEN PRINT 
"GREEN" 

125 IF B> A AND B> C THEN PRINT 
"ORANGE" 

126 IF C < A AND C > B THEN PRINT 
"PURPLE" 

129 IF B < C AND B< (A) THEN PRINT 
"BLUE" 

130 PRINT "***♦***************** 
II 

131 FOR X = 1 TO 2300: NEXT X 
140 GOTO 30 

200 END 



100 CALL - 936: PRINT 

1010 PRINT "POINT GUN AT A WHITE 

SHEET OF PAPER" 
1020 FOR I = 1 TO 1500: NEXT I 
1030 Al = PDL (0) 
1035 REM 

1040 Bl = PDL (1) 
1045 REM 
1050 CI = PDL (2) 

1055 PRINT "A1=";A1 

1056 PRINT "B1=";B1 

1057 PRINT "C1=";C1 
1060 Dl = Al * Bl * CI 
1070 Al = Dl / Al 
1080 Bl = Dl / Bl 
1090 CI = Dl / CI 

1100 PRINT "CORRECTION FACTOR FO 

R RED = ";A1 
1110 PRINT "CORRECTION FACTOR FO 

R BLUE= ";B1 
1120 PRINT "CORRECTION FACTOR FO 

R YELLOWr ";C1 
1125 FOR I = 1 TO 2000: NEXT I 
1130 RETURN 
10000 END 



tPBOm PROCRAHMER 




S«ftwm avdtaU* hr M, MOO, MM, 
SMS, Z-«0, »SOX MM-1, IM2. 

The EP-2A-79 will proflram th« 2704, 2708, 
TMS 2708, 2758, 2716, TMS 2516, TMS 2716, 
TAf\S 2532, and 2732. PROM type if selected by 
a personality module which plugs Into the front 
of the programmer. Power requirements are 1 15 
VAC, 50/60 HZ at 15 watts. It is supplied with a 
36-inch ribbon cable (14 pin plus) for connecting 
to microcomputer. Requires 1 % I/O ports. 
AMwnbled and t««t«d $145, Plus $15-25 for 
each pweenality medul*. SpMify toflwar*. 

OPTIMAL nCHNOLOCY, INC. 

Mm W««rf 127, EwlTfvn^ V«. 229U 
fktm t04-<73-Sa2 



MICRO 13:32 



June 1979 



Software: 



HARDWARE: 



PROGRESSIVE SOFTWARE 

Presents Software And Hardware For Your APPLE 



SALES FORECAST 

This program will give you the best forecast using the four most popular forecasting techniques, such as linear regression, 
log trend, power curve trend, and exponential smoothing. The program uses artificial Intelligence to make the decision on 
the best fit, and displays all results for manual opeatlon If desired. Written by Nell D. Lipson, requires idK memory. 

CURVE FIT 

Will talte any number of data points In any faslon, and give you the choice of having the computer choose the best 
curve fit, or you may choose yourself what type of fit you desire. The four given are log curve fit, exponential curve fit, 
least squares, and power curve fit. The results are then graphed. Written by Dave Qarson, requires 16K memory. 

CALENDAR 

This program will perform two functions: days between dates (any two dates) or a perpetual calendar. If the calendar. Is 
chosen, It will automatically give the successive months by merely hitting the return Itey. May be used with or without a 
printer. Written by Ed Hanley, requires leK memory. 

STARWARS 

The original and best starwars game, written by Bob Bishop. You firs upon the tie fighter after aligning the fighter in your 
crosshairs. This is a high resolution game in color that uses the paddies. Requires 16K memory. 

ROCKET PILOT 

This Is an exciting game where you are on a planet taking off with your rocket ship, trying to fly over a mountain. The 
simulation of the rocket blasters actually accelerates you up, and If you are not careful, you will run out of sky. The contour 
of the land changes each time you play the game. Written by Bob Bishop, requires IdK memory, 

SPACE MAZE 

This game puts you in a maze with a rockey ship, and you try to "steer" out of it with your paddles or joystick. It's a real 
challenge. It is done in high resolution graphics in color, done by Bob Bishop. Requires 16K memory. 

SAUCER INVASION 

This program was written by Bob Bishop. You are being invaded by a flying saucer and you can shoot at it with your 
missile and control the position with your paddle. Requires 16K memory. 

MISSILE-ANTI-MISSILE 

Misslle-Anti-Mlssile Is a high resolution game. The viewer will see a target appear on the screen, followed by s 3- 
dlmenstonal digital drawing of the United States. Then a small submarine appears. The submarine Is controlled by hostile 
forces (upon pressing the space bar) which launches a preemptive nuclear strike upon the United States(controlled by 
paddle No. 1). At the time that the missile Is fired from the submarine, the United States launches Its own antl-mlsstie 
(the anti-missile Is controlled by paddle No. 0). There are many levels of play depending upon the speed. Written by Dave 
Moteles and Nell Lipson. Requires 16K memory. 

MORSE CODE 

This program allows the user to learn morse code by the user typing In letters, words or sentences In english. Then the 
dots and dashes are plotted on the screen. At the same time sounds are generated to match the screen's output. Several 
transmission speed levels are available. Written by Ed Handley. Requires 16K memory. 

POLAR COORDINATE PLOT 

A high resolution graphics program which provides the user with 5 primary classic polar coordinate plots and a method by 
which the user can Insert his own equation. When the user's equation is Inserted into the program It will plot on a 
numbered grid and then Immediately after plotting, flash, in a table form, the data needed to construct such a plot on 
paper. The program takes l6Kof memory and ROM board. Written by Dave Moteles. 

UTILITY PAKl 

This Is a combination of 4 programs: (by VInce CorsettI) 
Integer to Applesoft Conversion • this program will convert any Integer basic program to an applesoft program. After you 
finished, you merely correct all of those syntax errors that occur with applesoft only. 
Disk Append • will append any two Integer programs from a disk into one program. 

Integer Basic Copy - allows you to copy an Integer basic program from one disk to another by merely hitting return. 
Useful when copying the same program many times. 

Update Applesoft • will correct Applesoft on the disk to eliminate the heading that always occurs when It Is initially run. 
Binary Copy ■ this program copies a binary file from one disk to another by merely hitting return. It automatically finds 
the length and starting addrese of the program for your convenience. 

BLOCKADE 

Two people try to block each other by buildings walls and blocking the other. An exciting game written In integer basic for 
16K. Written by Vince CorsettI. 

TABLE GENERATOR 

Is a program which forms shape tables with ease. Shape tables are formed from directional vectors and the program also 
adds other information such as starting address, length and position of aach shape. The table generator allows you to 
aave the ehape table in any usable locatioq In memory. It is an applesoft program. Written by Summary Summers. 
Price: $9.95 

All Programt. $9.95 EACH 

All Proorimt are 16K unlM« spMlfM. 



LIGHT PEN 

Includes 5 programs. Light Meter, which gives you reading of light every fractton of a second from to 588. The light graph 
will graph the value of light hitting the pen on the screen. The light pen will "draw" on the screen points which you have 
drawn and then connect them. It will also give the coordinates of the points If desired, drawn In lo-res. The fourth program 
will do the same except draw It In hl^-es. The fifth program Is a utility program that allows you to place any number of 
points on the screen for use In menu selection or In games, and when you touch this point, It will choose It. It is not 
confused by outside light, and uses artificial Intelligence. Only the hl-rss light pen requires 48K and ROM card. 
Written by Nell D. Lipson. 

Light P«n supporlAd liy 6 progrimt $34.95 

Send Check or M.O. to P.O. Box 273, Ply. Mtg., PA 19462 Programs Accepted for Publication-Highest Royalty Paid 

Poauge and Handling - Add $1 .00 for first Item then 50* for each add'l PA Residents Add 6% Sales Tax 



ASK the Doctor — Part V 

Reading KIM Tapes on the AIM and SYM 

The Doctor discusses some problems that arise in trying 
to ioact KIIVI format cassette tapes on the AilVI or SYIVI, 
and "with a littie help from his friends" presents a short 
routine to get by the SYM "2F" loading bug and a sub- 
routine which mimics the KIM SCANDS routine on the 
SYM. 



# 



Reading KIM Tapes with the AIM 

The AIM 65 has two speeds for reading 
the KIM format tapes. The normal KIM 
tape records at about 8 1/3 characters 
per second. Early In KIM history, Jim But- 
terfleld published "Hypertape", a pro- 
gram that permits KIM formats to be 
written at higher rates; 2 times, 3 times 
and even 6 times the normal KIM rate — 
and stil! be read by the regular KIM moni- 
tor and hardware with no changes! The 
AIM 65 people recognized the value of 
the higher speed KIM rates and made 
their monitor capable of loading either 1 
time or 3 times KIM tapes. (The full 6 
times would have been very nice, but t 
guess we can't have everything.) The 
AIM documentation is very vague about 
using these KIM formats. To use the KIM 
loader, you must first set a "user alter- 
able" RAM location A408 as follows: 

C7 for normal AIM format tapes 
5A for normal KIM format tapes 
5B for 3 times KIM format tapes 

On power up, C7 is automatically set, so 
that the AIM format is the default, as one 
would expect. The A408 location must 
be set by the user manually to the cor- 
rect KIM speed value before calling on 
the tape load or dump routines. This 
must be reset either manually or by a 
power up reset to return to the AIM 
format. If you do not have the correct 
value in A408 for what you are trying to 
do, it will not work and, in general, will 
not give you any i n dj cat ibnj hat It is not 
working. The KIM Loader/or Dumper Is 
invoked by specifying "K" as the I/O de- 
vice. 

Now thai you finally undei stand how to 
use the AIM to load a KIM tape, you set 
A408 to 5A for a regular KIM tape which 
has your favorite program and run the 
AIM Load specifying K for the input de- 
vice, the program identifier that you 
used when you recorded the tape as the 
file name, and the correct tape unit. You 
sit back and wait for the load to com- 
plete. But what's this! The AIM is sud- 
denly in some strange state! It may be 
saying "OUT = " which does not make 
sense, or even worse may be dumping 



reems of paper out of the printer! What 
happened? What happened was that 
your typical KIM program which uses 
all available memory on the KIM — lo- 
cations 0000 to 03FF — has found a 
small problem with the AIM KIM format 
load program. The problem is the 
STACK, The programmers who develop- 
ed the KIM monitor were super-smart in 
realizing that, given the very limited on- 
board memory of the KIM, users would 
often want to load ALL of the RAM, from 
0000 to 03FF, right over page zero and 
page one — stack alt. They made the 
KIM load and dump routines work with- 
out using page zero or page one in any 
way that would not interfere with data in 
those pages. You might want to examine 
this code sometime in the KIM monitor 
listings, as it is quite instructive. The 
AIM programmers were only smart about 
the KIM format — not super-smart. They 
gave the multiple speeds, but did not 
write the loader is such a way that it 
could load over the page one stack. So, 
the loader works fine until it hits the 
stack that is being used by the loader 
itself. Then, it SELF DESTRUCTS! It 
over-writes a return address in the stack 
and then returns to "never-never-land". 
Where it goes will depend on the byte 
of data that over-writes the stack. I do 
not know of any simple solution to this 
problem. You can, of course, divide your 
KIM program Into two portions: 0000 
to 01 FO (or there abouts — I think it 
bombs at about 01 FB but have not done 
any detailed testing), and 0200 and up. 
This assumes that you have access to a 
KIM. If not, my friend, I am afraid you 
have a real problem. 

Reading KIM Tapes with the SYM 

The SYM monitor bug which causes 
loading of KIM tapes to abort when it 
encounters a "2F" has been document- 
ed in previous columns, is "cured" by 
Skov's program, and is fixed In the new 
SYM SY1.1 version of the monitor. It 
will not be discussed here. With the "2F" 
bug fixed, the SYM still has probiems 
with reading KIM format tapes. The prob- 
lem is the same as discussed with the 
AIM above. It can NOT load over the end 
of the Dage one stack. The SYM has an 



Robert M.Trtpp, Ph.D. 

The Computerist, Inc. 

P.O. Box 3 

So. Chelm^sford, MA 01824 



additional, related problem. It can not 
read over the last two bytes in page one 
either. These two bytes are used by the 
load routine as the indirect pointer to the 
next location to be loaded. Once your 
KIM formatted tape hits them — Good- 
bye! So, we have here the same prob- 
lem, and the same solution. To load KIM 
tapes into a SYM, they must be loaded in 
three segments: 0000 to OOFD, 0100 to 
(about) 01 FC, and 0200 and up. I thought 
I had a great idea to get around this prob- 
lem. I dumped my KIM tapes with every- 
thing shifted up to start at 0200, with the 
intention of using a simple SYM Btock- 
move command to relocate them down 
to their proper addresses. That is, the 
KIM tape would be set to load from 0200 
to 05FF and then be moved down to 0000 
to 03FF. Good idea, right? Well, it may be 
a good idea, but It doesn't work. Block- 
move has the exact same problems as v 
the tape load: It uses the last two loca- ~ 
tions in page zero as well as subroutines 
which require access to the page 
one stack! 

AIM/SYM/KIM Tape Summary 

While there are obviously some prob- 
lems in using the KIM format tapes on 
the SYM and AIM, this format is the only 
one which is compatible between the 
three machines, and should be used as 
a common medium of exchange for pro- 
grams and data between them. To be 
"universal" the tapes should be written 
at the normal KIM speed and should 
start at location 0200 or above. I am sure 
that there will be SYM and AIM versions 
of Hypertape published soon, perhaps in 
MICRO. Maybe someone will even have 
the time to come up with a KIM LOAD 
program for the SYM and the AIM that 
can be tacked on the front of a tape to be 
exchanged — in normal speed — and 
which once loaded will permit the load- 
ing of KIM format programs and data 
into any address (except for those occu- 
pied by the loader itself which should 
be out-of-the-way somewhere), and at 
the higher speeds. Until then, keep the 
AIM and SYM loading problems in mind 
as you make plans to transfer your pro- 
grams and data from one of the ASK 
family members to another. A 

u W 



MICRO 13:34 



June 1979 



SYM "2F" BUG KILLER 



A Solution to the SYM "2P' Bug 







CODE 


IS COMPLETELY 










RELOCATABLE. 




ACCESS * 


$8B86 












LOADT * 


$8C78 


20 86 


8B 


START 


J5R 


ACCESS 


CHKT * 


$BE78 


20 78 


8C 




JSR 


LOADT 


CHAR * 


$OOFC 


BO 01 






BCS 


TWOF 






60 






RTS 




SUCCESSFUL LOAD 




A9 2F 




TWOF 


LDAIM 


$2F 


2F ERROR 




20 78 


8E 




JSR 


CHKT 






AO 00 






LDYIM 


$00 






91 FE 






STAIY 


$00FE 






E6 FE 






INC 


$00FE 


BUMP POINTERS 




DO 02 






BNE 


OKAY 






E6 FF 






INC 


$OOFF 


BUMP HIGH 




A5 FC 




OKAY 


LDA 


CHAR 






20 3F 


8D 




JSR 


$8D3F 






BO EA 






BCS 


TWOF 






60 






RTS 









The problem around SYM-1, with KIM- 
tape compatability, I solved, at first, by 
writing a small program, that controls 
the loading. When loading terminates 
because of a "2F" in the data stream, it 
can be assumed that it will result in a 
checksum error too. What the program 
does, is simply store the "2F" that was 
{he probable cause and then reenter the 
tape reading as though there had not 
been an error. 



Submitted by 

Jan Skov 

Majvaenget 7 

DK-6000 Kolding 

The Netherlands 




Pp Box 6502 
Chdimsford, Mass 01824 

"The BEST of MICRO Volume 1" contains all of the 
important material from the first six issues of MICRO 
in book form. " ! »■ 

"All of MICRO Volume 2" is all six issues of Volume 2, 
numbers 7 to 1 2, at a special reduced price for a limited 
time only. ^ 

Back Issues: 



Subscription: One Year = 12 Issues. Please circle 
the correct category and write the amount in the space 
provided. 



Surface: 

United States $15.00 

All Other Countries $18.00 

Air Mail: 

Central America $27.00 

Europe/So. America $33.00 

All Other Countries $39.00 

"BEST of MICRO Volume 1 " 

Surface % 7.0G 

Air Mail $10.00 



Issues 7-12: 

Issues 13 on: 

AH Payments must be in US dollars. Make checks 
payable to: MICRO, Foreign payments in International 
Money Order (or cash) only. 



"ALL of MICRO Volume 2" 
Surface $8.00 

Air Mail $12.00 

Surface @ $1.75 each _ 
' 'Air Mail @ $2.75 each ~ 
Surface @ $2.25 each _ 
■'Air Mail @ $3.25 each " 

TOTAL 



No 



No 



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



Address:. 



. State:. 



■ ZIP:. 



City: 

Country (if no US): 

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

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 MICRO 



SYM STATIC DISPLAY 

SYM REFERENCES 

ACCESS * $8B86 

SCAND * $8906 

SEGSM * $8C29 

DISBUF * $A63F 

COMPLETELY RELOCATABLE 



SYM Static Display 

This program is a utility for the SYM-1 
that I have found useful in adapting rou- 
tines for the Klfvt. It loads the DlSBUh 
fronn three locations, F5 to F7, corre- 
sponding to the three display locations, 
F9 and FB, used in the KIM monitor. It 
ends with a JMP SCAND, and thus can 
be used to replace a JSR SCANDS com- 
mand as used in a KIM routine. It gives 
a static display. 



20 86 


8B 


STATIC 


JSR 


ACCESS 


ENTER HERE UNLESS ACCESS 


AO 03 




ALTNTR 


LDYIM 


$03 


ALREADY SET. SET UP FOR 


B9 F4 


00 


MOVE 


LDAY 


$00F4 


3 NUMBERS. GET NUMBER INTO A 


4A 






LSRA 




SHIFT 


4A 






LSRA 




LEFT 


4A 






LSRA 




FOUR 


4A 






LSRA 




TIMES 


AA 






TAX 




PUT RESULT IN X 


98 






TYA 




Y HAS NUMBER INDEX 


OA 






ASLA 




MULTIPLY BY 2 


A8 






TAY 




PUT BACK INTO Y 


BD 29 


8C 




LDAX 


SEGSM 


GET CORRECT SEGMENT CODE 


99 3E 


A6 




STAY 


DISBUF 


-01 PUTINTO DISPLAY BUFFER 


98 






TYA 




GET INDEX BACK 


4A 






LSRA 




DIVIDE BY 2 


A8 






TAY 




PUT BACK 


B9 F4 


00 




LDAY 


$00F4 


NUMBER INOT A 


29 OF 






ANDIM $0F 


MASK 


AA 






TAX 




RESULT INTO X 


98 






TYA 




GET INDEX 


OA 






ASLA 




MULTIPLY BY 2 


A8 






TAY 




PUT BACK 


BD 29 


8C 




LDAX 


SEGSM 


GET SEGMENT CODE 


99 3F 


A6 




STAY 


DISBUF 


PUT INTO DISPLAY BUFFER 


88 






DEY 




DECREMENT INDEX 


88 






DEY 




TWICE 


FO 06 






BEQ 


EXIT 


IF HAVE LOADED 6 DIGITS, EXIT 


98 






TYA 




NOT DONE, GET INDEX 


4A 






LSRA 




DIVIDE INDEX BY 2 


AS 






TAY 




PUT BACK 


18 






CLC 




PREPARE TO GO TO MOVE 


90 D3 






BCC 


MOVE 


GO! 


4C 06 


89 


EXIT 


JMP 


SCAND 


LIGHT UP DISPLAY AND RETURN 



NOTES: 

F7 CORRESPONDS TO KIM POINTH AT FB 

F6 CORRESPONDS TO KIM POINTL AT FA 

F5 CORRESPONDS TO KIM INH AT F9 

Y KEEPS TRACK OF LOCATION IN DISBUF 

WHEN MULTIPLIED BY 2, 

AND LOCATION IN F5-F7 WHEN NOT. 



Submitted by 

Paul W. Zitzewitz 

Department of Natural Sciences 

University of Michigan — Dearborn 

4901 Evergreen Road 

Dearborn, Ml 48128 



MICRO 13:36 



June 1978 



SYM-1, 6502-BASED MICROCOMPUTER 

' FULLY-ASSEMBLED AND COMPLETELY INTEGRATED SYSTEM that's 

readyto-use 
' ALL LSI IC'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 advanced 

architectural features have made it one of the largest selling "micros" 

on the market today. 

THREE ONBOARD PROGRAMMABLE INTERVAL TIMERS available to 

the user, expandable to five on-board. 

4K BYTE^ROM RESIDENT MONITOR and Operating Programs. 

Single 5 Volt power supply is all that is required. 

IK 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 simplified user interface 

STANDARD INTERFACES INCLUDE: 

— Audio Cassette Recorder Interface with Remote Control (Two 
modes: 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-directional TTL Lines for user applications 

with expansion capability for added lines 

EXPANSION PORT FOR ADD-ON MODULES (51 I/O Lines Included in 

the basic system) 

SEPARATE POWER SUPPLY connector for easy disconnect of the d-c 

power 

AUDIBLE RESPONSE KEYPAD 




Synertek has enhanced KIM-1 * software as well as the hardware. The 
software has simplified the user interface. The basic SYM-1 system is 
programmed in machine language. Monitor status is easily accessible, 
and the monitor gives the keypad user the same full functional capabili- 
ty of the TTY user. The SYM-1 has everything the KIM-1* has to offer, 
plus so much more that we cannot begin to tell you here. So, tf you want 
to know more, the SYM-1 User Manual is available, separately. 
SYM-1 Complete w/manuals $269.00 

SYM-1 User Manual Only 7.00 

SYM-1 Expansion Kit 75.00 

Expansion includes 3K of 21 14 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-1 8K Basic ROM (Microsoft) $159.00 

*KTM.2 TV Interface Board 349.00 

*W'e do honor Synertek discount coupons 



QUALITY EXPANSION BOARDS DESIGNED SPECIFICALLY FOR KIM-1, SYM-I & AIM 65 

These 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 add 

onboard regulators for use with an unregulated power supply. But, because of unreliability, we do not recommend the use of onboard 

regulators. All I.C.'s are socketed for ease of maintenance. All hoards 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 full 

manufacturer'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 of 

less 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 after 

receipt, complete, in original condition, and in original shipping carton; we will give you a complete credit or refund less o $10.00 restocking 

charge per board. 

VAK-1 8-SLOT MOTHERBOARD 

This motherboard uses the KIM-4* bus structure. It provides eight (8) 
expansion board sockets with rigid card cage. Separate jacks for audio 
cassette, TTY and power supply are provided. Fully buffered bus. 
VAK-1 Motherboard $129.00 



VAK-2/4 16K STATIC RAM BOARD 

This board using 2114 RAMs is configured in two (2) separately 
addressable 8K blocks with individual write-protect switches. 

VAK-2 16K RAM Board with only $239.00 

8K of RAM ( '/t populated) 
VAK-3 Complete set of chips to $1 75.00 

expand above board to 16K 
VAK-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. All 

software is resident in on-board ROM, and has a zero-insertion socket. 

VAK-5 2708 EPROM Programmer $269.00 

VAK-6 EPROM BOARD 

This board will hold BK of 2708 
EPROMs. EPROMs not included. 
VAK-6 EPROM Board 



or 2758, or 16K of 2716 or 2516 
$129.00 



VAK-7 COMPLETE FLOPPY-DISK SYSTEM (May 79) 

VAK-8 PROTYPING BOARD 

This board allows you to create your own interfaces to plug into the 
motherboard. Etched circuitry is provided for regulators, address and 
data bus drivers; with a large area for either wire-wrapped or soldered 
IC circuitry. 

VAK-8 Protyping Board $49.00 



POWER SUPPLIES 

ALL POWER SUPPLIES are totally enclosed with grounded enclosures for safety, AC power cord, and carry a full 2-year warranty. 
FULL SYSTEM POWER SUPPLY 
This power supply will handle a microcomputer and up to 65K of our KIM-1 * Custom P.S. provides 5 VDC @ 1.2 Amps 

VAK-4 RAM. ADDITIONAL FEATURES ARE: Over voltage Protection on 5 and +12 VDC@.1 Amps 

KCP-1 Power Supply $41.50 



volts, fused, AC on/off switch. Equivalent to units selling for $225.00 or 

more. 

Provides +5 VDC @ 10 Amps & ±12 VDC @ 1 Amp 

VAK-EPS Power Supply $1 25.00 




SYM-1 Custom P.S. provides 5 VDC @ 1.4 Amps 
VCP-1 Power Supply 

*KIM is a product of MOS Technology 



$41.50 



ENTERPRISES 

INCORPORATED 



2967 W. Fairmount Avenue 
Phoenix AZ. 85017 
(602)265-7564 



H 





Computer-Determined Parameters for 
Free- Radical Polymerization 



Don't let the title scare you. If you are using your system 
for complex equation solving, the general techniques 
presented will be useful - even if the particular example 
is not your cup to tea. 



Dr. L.S. Reich 

3 Wessman Drive 

W. Orange, N J 07052 



During the formation of polymers by so- 
called free-radicals, the following 
lengthy and "sensitive" equation is gen- 
erally valid, 
W(R) = AZ^RP*-' + ((1-A)/2)Z^R(R-1)P«-=' 

(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 been 
previously attempted to solve eqn. (1) 
for the parameters, A and P, which are of 
theoretical and practical importance. 
Thus, approximate graphical procedures 
have been employed (Smith et al., J. 
Polym. Sci., Pt. A-2, 4, 365 (1966); J. 
Rhys. Chem., 72, 216 (1968); Ibid., 72, 
2933 (1968)) as well as more direct ap- 
proaches (Reich et at., J. Appl. Polym. 
Sci., 17, 3709 (1973)). The purpose of this 
article is to present a novel trial-and-er- 
ror computer program whereby para- 
meters A and P (or 7) can be readily ob- 
tained from eqn. (1). Although eqn. (1) 
applies to polymers, the solution of eqn. 
(1) involves mathematical procedures 
which are common to various scientific 
disciplines and the program presented 
should therefore be of general interest. 
Prior to running this program, W(R)-R 
data 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 be 
selected between .995-.999 (regardless 
of which value is chosen, the computer 
will search for the correct value in order 
to obtain final values of A and P). 

From eqn. (1), it can be readily JSften that 
a least squares treatmejit of the oaia 
(V = Al -t- A2X) where, Y = W(R)/(1-Pr 
RP"-' and X = (R-1)/p, will afford best 
values of intercept (Al) and slope (A2) 
where, A1 = A and A2 = (1-A)Z/2 (the 
least squares procedure is given in line 
#'s 75-120). Then (cf . line #140), 

Z = 2A2/(1-A1) (2) 

Under the conditions used, more than 
one solution for Z is possible. However, 
there can only be one unique physically 
real solution for A and for Z (or 1-P). The 
physically unreal solution for Z affords 

MICRO 13:38 



values or A > 1 (which is theoretic- 
ally impossible). By using line #163, 
when A > 1, PO is lowered in order to 
achieve conditions whereby a physically 
real value of A may be obtained. Other 
limitations that must be met are: P can- 
not be greater than unity (see line #150); 
Al 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 parameter 
values, the Initial value of P Is such that 
1-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 correlation 
coefficient (from the least squares cal- 
culation of Al and A2) are displayed 
(line #168), 

ABS(R)>.9 (3a) 

and,1-P> = ZorABS(1-P-Z)/Z< = 4E-04 

r3b^ 
Since eqn. (1) is sensitive to changes in 
data, i.e., small changes in data can re- 
sult In relatively large changes in A, 
there is a requirement that correlation 
coefficient (R) be above .9 (3a). Thus, 
even though (3b) Is satislfed, if (3a) is 
not, then the screen will display the 
statement that the data is not accurate 
enough (In order to afford reasonably 
significant values) (line #165). In (3b), the 
second term involving the absolute value 
may not apply sometimes, but Z-trial 
values will generally decrease faster 
than Z-calculated values to that 1-P < 
= Z halts further iterations and final 
parameter 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 zero 
value (line #'s 165, 1000). Insufficiently 
accurate data may also cause relatively 
large negative Al-values (#165) and end- 
less loops (iterations) to occur. After 200 
such iterations, the screen will display a 
statement that the data may not be ac- 
curate enough (to achieve closed para- 
meter values) (line #155). However, it is 
also possible that due to an unfortunate 
choice of a PO value in line #65, more 
than 200 iterations will be required prior 



to the display of final values. Hence, the 
additional statement in line #155 that 
another value of PO should be entered in 
line #65 (and another run attempted). If 
another run is made and a similar situa- 
tion arises then omitting W(R)-R data at 
low values of R and/or at very high 
values of R may afford closed parameter 
values (the former W(R)-R values general- 
ly lie along the steepest part of a 
distribution curve and are subject to er- 
rors in W(R) while the latter values lie 
along a relatively flat portion of the curve 
and are subject to errors in R). From the 
preceding, data in #200 must be derived 
from precise experimental techniques, 
which are available, e.g., gel permeation 
chromatography, due to eqn. (1) sensi- 
tivity to relatively small inaccuracies in ^^■ 
data (which are prone to occur at the tail ^^^ 
ends of a distribution curve). 

Prior to the display of final results, 
values of Z (trial) and Z (calcd.) will be 
compared in tabular form on the screen 
(line #'s 68, 155) in order to apprise the 
viewer 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 #'s 
190,500-520). 

Explanatory REM statements are to be 
found In line #'s 9, 64, 105, 130, 152, 158 
and ca. 3-3.5K bytes are required depend- 
ing upon the amount of data entered (the 
data is limited to 19 W(R)-R pairs). Apple- 
soft II Basic in ROM was employed and 
a run, as given in the Program Example 
section, required ca. 1 min. but this can 
vary considerably depending upon the 
accuracy of the data and the initial 
choice of the PO value (more iterations 
are necessary when the PO value is fur- 
ther away from the true P value). Finally, 
it may be noted that the parameter 
Values A and Z can be used to estimate 
various penlnent quantities, e.g.. the so- 
callea weignt-average degree of poly- 
merization of a polymer which is equal to 
(3-A)/Z. 






June 1979 



Program Listing 

5 PRINT "THIS PROGRAM ALLOWS THE PRECISE CALCULATION OF 
MOLECULAR WEIGHT DISTRIBUTION PARAMETERS, 'A' 4 '1-P', 
FOR FREE-RADICAL POLYMERIZATION. WEIGHT-FRACTION VS. 
DEGREE OF POLYMERIZATION (DP) DATA IS ENTERED IN LINE 
#200. "; 

6 PRINT "THE INITIAL VALUE OF 'P' (ARBITRARILY CHOSEN BETWEEN 
.995-. 999) IS ENTERED IN LINE 65. CA. 3-3. 5K BYTES ARE 
REQUIRED AND EXPLANATORY 'REM' STATEMENTS ARE IN LINE #'S 
9, 64, 105, 130, 152, 158.": STOP 

9 REM #'S 10-60 ALLOW THE FORMATION OF THE ARRAY W(J,K) FOR 
WT. -FRACTION VS. DP DATA IN LINE #200 

10 DIM W(20,2) 

20 FOR 3 = 1 TO 50 

30 FOR K = 1 TO 2: READ W(3,K) 

40 IF W(3,l) = THEN 60 

50 NEXT K,J 

60 3 = 3-1 

64 REM #65 LISTS THE INITIAL VALUE OF 'P' & #'S 70-100 ALLOW 
FOR A LEAST SQUARES TREATMENT OF THE DATA 

65 PO = .99745 

68 PRINT; PRINT"Z-VALUES (TRIAL)"; TAB (21); "Z-VALUES (CALCD.)": 

PRINT " "; TAB (21); " " 

70 P = PO 

75 FOR I = 1 TO 3 

80 Y = W(I,1)/(W(I,2)*^(W(I,2) -1)*(1~ P)*2): X = (W(I,2) -1)/P 

90 XY = XY + X*Y: XX = XX + X*X: SX r SX + X: SY = SY + Y: 

YY = YY + Y*Y 
100 NEXT 
105 REM IN #'S 110, 120 ARE GIVEN THE LEAST SQUARE SLOPE (A2), 

INTERCEPT (Al), & THE CORRELATION COEFF. (R) 
110 A2 = (3*XY - SX*SY)/(3*XX - (SX)*2): Al = (SY/3) - A2*(SX/3) 
120 R = (XY - 3*(SX/a)«(SY/J))/(SQR(XX - SX*(SX/3))*SQR(YY - SY* 

(SY/3))) 
130 REM #'S 140, 150 ALLOW THE CALCULATION OF Z AND THE ADJUSTMENT 

OF PO IF Z<0 
140 Z = 2*A2/(1 - Al) 
150 IF P>1 OR Z<0 THEN PO = PO- .00001: XX = 0: SX = 0: 

SY = 0: YY r 0: GOTO 70 
152 REM #155 INDICATES A POSSIBLE ENDLESS LOOP & #156 LOWERS THE 

INITIAL VALUE OF PO IN LINE #65 IF 1-P0<= Z 

155 PRINT 1-P; TAB(21); Z: PC = PC + 1: IF PO200 THEN PRINT: 
PRINT "TH^: PROGRAM IS GOING THRU AN ENDLESS LOOP? THE DATA 
MAY NOT BE ACCURATE ENOUGH! TRY ANOTHER VALUE OF PO IN #65 
& SEE IF THERE IS ANY CHANGE!": END 

156 IF 1-P0<Z OR Z<0 THEN PO = PO - .00001: XX = 0: XY = 0: YY = 0: 
SX = 0: SY = 0: GOTO 70 

158 REM #163 LOWERS PO VALUE IF AIM & #'S 160, 165, 168, 180 

ALLOW FOR THE CALCULATION OF FINAL VALUES OF 'A' & '1-P' SHILE 
#170 ACCOUNTS FOR VALUES OF AKO 
160 IF 1-P<=Z OR ABS(1-P-Z)/Z<= 4E-04 THEN A = Al 
163 IF AIM THEN PO = PO - .00001: XX = 0: XY = 0: YY = 0: SX = 0: 
SY = 0: GO TO 70 

June 1979 MICRO 13:39 



165 IF (ABS(R)<.9 OR AK-.05) AND (1-P<= Z OR ABS(1-P-Z)/Z<= 4E-04) 
THEN PRINT: PRINT "DATA IS NOT ACCURATE ENOUGH": END 

168 IF ABS(R)>.9 AND (1-P<= Z OR ABS(1-P-Z)/Z = 4E-04) THEN PRINT: 
PRINT "VALUES OF 'A' & 'l-P' = 'Vj : GOSUB 1000: PRINT A" AND 
"Z" ; AND, CORRELATION COEFFF. = "; : PRINT CC: GOTO 190 

170 IF AKO THEN 180 

180 P = P + .00001 : XX = 0: VY = 0: SX = 0: SY = 0: 
GOTO '75 

190 PRINT: PRINT " W(X),0BSD.";TAB(20); "W(X) ,CALCD.": 

200 DATA 7.45E-04,400, 7.62E-04,600,7.3E-04,700,4.41E-04, 
1200, 2. 9E -04, 1500, 1. 3E-04, 2000, 2. lE-05, 3000 

210 DATA 

500 FOR I = 1 TO 3 

510 W = (Al + A2*(W(I,2)-l)/P)*W(I,2)*P"(W(I,2)-l)*(l-P)-2 

520 PRINT TAB(4); W(I,1); TAB(20); INT(W*1E06 + .5)/lE06: 
NEXT2 EMD 

1000 IF A<0 AND A>-.05 THEN A = 0: Al = 

1010 A = INT(A*100 + .5)/100: Z = INT(Z*1E06 + .5)/lE06: 
CC = INT(R*1E04)/1E04 

1020 RETURN 



Prognm Example 



COMMAND: RUN 
COMMAND: CONT — 



> STATEMENTS 5, 6, and "BREAK IN 6" 
> 



W(R) vs. R data for the polymer, poly- 
styrene (from gel permeation chroma- 
tography techlques), was entered In line 
#200 and an arbitrary value of PO = 
.99745 In line #65. Then a run was carried 
out as follows, 



Z-VALUES (TRIAL) 

2.54999986E-03 
2.53999978E-03 
2.52999971E-03 
2.51999963E-03 
2.50999955E-03 
2.49999948E-03 
2.48999941E-03 
2.47999933E-03 



Z-VALUES (CALCD.) 

2.49794192E-03 
2.49536302E-03 
2.49275496E-03 
2.49012109E-03 
2.48747276E-03 
2.48481487E-03 
2.48216115E-03 
2.47951866E-03 



VALUES OF 'A' 4 'l-P' = .65 AND 2.48E-03; AND, 
CORRELATION COEFF. = .9999 



W(X),OBSD. 



W(X), CALCD. 



7.45E-04 

7. 62E-04 

7.3E-04 

4.41E-04 

2.9E-04 

1.3E-04 

2.1E-05 



7.53E-04 

7.6E-04 

7.24E-04 

4.4E-04 

2.9E-04 

1.3E-04 

2.1E-05 



MfCR0 13:40 



June 1979 



AIM 6522 Based Frequency Counter 



The AIM 65 obviously is going to find its way into the 
electronics laboratory. Here it is used as a frequency 
counter. 



Marvin L. De Jong 

Dept. of Math-Physics 

The School of the Ozarks 

Pt. Lookout, MO 65726 



The program listed performs as a six- 
digit frequency counter. It will count at 
least as fast as 450 kHz, perhaps faster. 
A simple interface circuit is shown in 
Figure 1. Although the signal to be 
measured could be connected directly to 
the PB6 pulse counting pin of the 6522, 1 
prefer not to connect strange and 
unknown signals directly to the com- 
puter. In any case, the signal pulses to 
be counted should really be shaped into 
the form of a square wave before they ap- 
pear at PB6. 

The counter uses timer T1 in a free-run- 
ning mode with 50,000 clock cycles be- 
tween settings of its interrupt flag. The 
timer T1 is not allowed to interrupt the 
6502, rather its interrupt capability is 
disabled and the flag is "watched" by 
reading the interrupt flag register, IFR. 
With $14 = 20»6 intervals of 50,000 clock 
cycles apiece, one gets a total interval of 
one second. $14 is located in $0000. The 
T1 timer is loaded with instructions 
starting at $0230. Note that the number I 
used is less than 50,000 because my AIM 
65 crystal is slow by 244 parts in one 
million cycles. You may wish to make ad- 
justments with this number also, de- 
pending on your system's clock frequen- 
cy. 

The frequency counterworks as follows. 
Timer T2 in its pulse counting mode is in- 
itially loaded with $FFFF = 65535. Once 
it is loaded, timer T1 is started and PBO 
is brought to logic O to allow the NAND 
gate to let pulses through. At the end of 
the timing interval, described in the 
preceding paragraph, the gate is closed, 
the timer T2 is read, the result is sub- 
tracted from $FFFF, this number is con- 
verted from HEX to BCD, and it is added 
to the display locations using the ADC 
instruction in the decimal mode. If, at 
any time the T2 timer counts through 
zero, an interrupt request (IRQ) occurs 
and the display registers are in- 
cremented by 65536 = $FFFF + 1,T2is 
reloaded with $FFFF, and counting con- 
tinues. At the end of one second, the 
total number of counts is displayed by 
the display subroutine, which, by the 
way, is identical to the 24-hour clock 
display routine in the February 1979 



issue of MICRO. It is a bit unfortunate 
that the 6522 designers did not allow the 
T2 timer to continue producing inter- 
rupts without reloading it, because in the 
time interval between the interrupt re- 
quest and the reloading of the T2 timer 
(starting at instruction $0296 in the inter- 
rupt routine), a few counts or pulses on 
PB6 might be missed. This would only be 
of concern at large counting rates. 

The HEX to BCD conversion routine 
starts at address $025D and ends at ad- 
dress $028E. The 16-bit number repre- 
senting the number of counts in timer T2 
is stored in locations $0010 and $001 1 . If 
$PQRS represents this number, then 
$PQRS = (P.4096.o) + (Q.256,o) + 
(R.16,o) + (S.I). 
If the calculation on the right-hand side 
of the above equation is done in the 
decimal mode, the $PQRS will be con- 
verted to BCD. In other words, 4096 is ad- 
ded to itself P times, 256 is added to 



itself Q times, 16 is added to itself R 
times, and 1 is added to itself S times, all 
in the decimal mode. These results are 
all added together, giving a BCD number. 
Better routines exist, I am sure, but this 
one isn't too slow. Note that P,Q,R, and 
S are each one nibble of the 16-bit 
number obtained from timer T2. (Has 
anyone yet suggested calling 16-bit 
numbers "gobbles," giving nibbles, 
bytes, and gobbles?) The table starting a 
$0300 must be loaded Into memory for 
the HEX to BCD conversion to work. 

The symbol table given may help you if 
you wish to modify the program or if you 
want to change it to run on a microcom- 
puter other than the AIM 65. Also, I 
would be interested in knowing an exact 
upper limit for the frequency at which it 
will operate and in any further im- 
provements to the rate at which it will 
count. Currently I do not have enough 
time to do this experimentation myself. 



Table I 
ADDRESS TABLE FOR THE AIM 65 FREQUENCY COUNTER 

$A000 = PBD(ORB) 

$A002 = PBDD (DDRB) 

$A004 = TIL-L(Read) 

$A005 = T1L-H 

$A006 = T1L-L (Write) 

$A008 = T2L-L 

$A009 = T2C-H 

$AOOB = ACR 

$AOOD = IFR 

$AOOE = lER 

$A404 = IRQL 

$A405 = IRQH 

$0000 = Count-to-twenty register 

$0001 = Display register, low-order byte 

$0002 = Display register, middle-order byte 

$0003 = Display register, high-order byte 

$0010 = PQ = Low-order byte of count from timer T2 

$0011 = RS = High-order byte of count from timer T2 

$0340 tiz Starting address of display subroutine 

$0295 = Starting address of IRQ routine 



June 1979 



MICRO 13:41 



0200 


fly 


LDH 


#95 


8202 


8D 


STfl 


H'-fkJ'H" 


8285 


HS 


LDh 


#02 


0207 


8D 


STfi 


fl405 


028fl 


R9 


LDfl 


#fl0 


020C 


8D 


STfi 


n 1= c- L-. 


02 0F 


fl9 


LDfl 


#01 


8211 


8D 


STH 


fly 08 


0214 


8D 


sjfl 


fl002 


8217 


h9 


LDfl 


#68 


82ly 


8D 


STH 


flS0B 


8210 


ft9 


LDfl 


#14 


021b 


85 


STfl 


00 


0220 


fi9 


LDfl 


#FF 


0222 


8D 


b i fl 


H008 


0225 


8D 


STH 


H089 


0228 


H9 


! Dfl 


#88 


022H 


85 


STfl 


81 


022C 


85 


STfl 


82 


02 2 E 


85 


STfl 


83 


0230 


fly 


LDfl 


#42 


y >;_;^ >; 


.— . .— . 

OU- 


STfi 


H00b 


8235 


fly 


LDfl 


#C3 


023r' 


"; r-. 


STfl 


H805 


023fl 


L' iL 


L-- 1_ '-■ 


H080 


023D 


flD 


LDfl 


fl084 


0^40 


CS 


DEC 


88 


0242 


•Z^ ■-■ 


- T T 


Hfl8rj 



^4/ ht) LL-'H y^ 
249 D0 BNE 023D 
24B EE INC R000 



02 4F 


fl9 


LDfl 


#FF 


fi?51 


ED 


SBC 


fi088 


8254 


85 


STfl 


10 


0256 


H9 


LDfl 


#FF 


0258 


ED 


SHC 


h809 


025B 


85 


STfl 


■i -1 


025D 


R2 


LDK 


#03 


025F 


flS 


LDfl 




8261 


29 


AND 


#0F 


826j: 


F8 


PP Q 


027F 


H?65 


flS 


TRY 





5268 h5 LDh 01 



KJcLOn ■' u- 



02SD 


85 


STfi 


01 


02SF 


fl5 


LDfl 


02 


0271 


7D 


ADC 


830 


0274 


85 


STfl 


02 


n '"-'. ~7 -•- 


fl5 


LDfl 


0_-- 


0278 


€3 


flDC 


#8t 



ki'dirc 


ay 


uhV 






027D 


D0 


BNE 


8266 


027F 


Cfl 


de:k 




0280 


30 


BMI 


028E 


0282 


fl0 


LL-=T 


#84 




46 


LSR 


11 


0286 


66 


RuR 


18 


0288 


88 


DEV 






D8 


BNE 


0284 


028B 


4C 


JMP 


025F 


028E 


D8 


CLD 




828F 


28 


JSR 


M <4i--1 


0?fl? 


A?. 


JMP 


821C 


8295 


48 


PHfl 




8296 


ft9 


LDfl 


#FF 


8298 


8D 


STfl 


fleey 


Hiiyt' 


F8 


SED 




8290 


18 






829D 


ft5 


1 dh 


81 


e29F 


69 


flDC 


#36 


02fll 


8.5 


STfl 


81 


02fl3 


flS 


LDfl 


82 


02fl5 


63- 


flDC 


#55 


02flf' 


85 


STfl 


H? 


82fl9 


fl5 


LDH 


83 


02HB 


63 


hDC 


#06 


02flD 


85 


STfl 


83 


02flr 


D8 


CLD 




y2Hy 


6b 


rLH 




82B1 


40 


DT T 
■: ■- ! i. 




PBO 






■ "^^_ 








^ 


< 









8 J 40 


fl5 


LDfl 


81 


8342 


85 


STfl 


84 


8344 


fl5 


LDfl 


02 


8346 


85 


STfl 


05 


0348 


h5 


LDfl 


8j: 


034fl 


85 


STfl 


86 


834C 


fl2 


LDM 


#13 


e34E 


8fl 


TXfl 




834F 


48 


PHfl 




0350 


fl0 


■ - . •: -; 


#84 


0352 


fi5 


LDH 


84 


0354 


29 


AND 


#0F 


0356 


18 


•r \ r 
=-• i_ =-• 




0357 


S3 


flDC 


#38 


8359 


fi9 


ORfl 


#80 


835B 


20 


JSR 


EF7 


835E 


46 


LSR 


86 


0360 


66 


ROR 


85 


8362 


f^.f.. 


RuR 


84 


8364 


88 


DEV 




8365 


[J0 


BNE 


835 


8i6i- 


68 


PLH 




0368 


flfl 


1 HX 




8369 


Cfl 


DEK 




S3feft 


h8 


CPx 


#0E 


836C 


B8 


PCS 


834 


036E 


68 


RTS 





Irl>=0380 96 tj6 16 01 

fcj 2- ri •-+ *-t Kj kJ w K) O v3 K) 




SIGNAL 



7400 



Figure 1 



Interface Circuit for the AIM 65 
Frequency Counter Using the 6522 VIA 



# 



# 



MICRO 13:42 



June 1979 



KIM — The Tunesmith 



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



Anthony T. Scarpelli 

RR1,Box426 

N.Windham, ME 04062 



Have you ever wanted to compose 
music, but knew nothing about how to 
go about doing it? Do you lack a musical 
instrument and have a tune going 
through your head and don't know what 
should go after the first few notes? Well 
here is a program for a basic KIM-1 that 
will help you compose a tune, and you 
don't even have to know how to read or 
write music. 

I have really never learned how to play a 
musical instrument, and I never have 
time to practice. Yet every once in a 
while I want to try out a few notes going 
on in my head, or I just want to see how a 
couple of notes sound together, to see if 
they have any effect on me. So what I did 
was to develop a program that uses a 
basic KIM-1 and the speaker circuit 
shown on page 57 of the KIM-1 User 
Manual that plays a tune I compose one 
note at a time. I use the keypad as data 
entry to place into the program notes of 
two octaves, including sharp notes, with 
four possible lengths and a rest or no 
note. I used the lettered keypads as well 
as the 9 which looks like a small G for all 
the notes which are seven in number, 
basically A B C D E F and G. 

Tunesmith Operation 

Once you start the program, you press 
one of the note letters. It will sound the 
appropriate note. If you want the sharp 
for that note, if it has one (B and E do 
not), press 5, To get the upper octave of 
the note you want you press 7, and if you 
want the upper octave sharp of the note, 
press 5 first, then 7. The keys 1, 2, 4,and 
8 will give you a whole note (1), a half 
note (2), a quarter note (4), and an eighth 
note (8). After you choose your note, you 
choose your length. If you don't want the 
note, start again, only this time the 
length is not automatically a half note as 
it would be when you first start out, 
you'll have to change it to what you 
want. 



Now that you have your nice note that 
sounds just right, press 3. This will save 
the note and place it in a tune table. To 
know that the note is indeed saved, the 
display will flash a SAVE. You have to 
hold the 3 key down until the SAVE is 
seen, though. Now the chosen note will 
be played and you can pick another note, 
or a rest which is 0. The procedure is the 
same for a possible 72 note tune. If you 
like your tune and want to write it down, 
press the + key. The display will show 
you the first note of the tune, and every 
time you hit the 3 key, the next will be 
displayed. If you want to start again, 
press the DA (Do Again) key. 

The Tunesmith Program 

We can go over the program now. Table I 
is a listing of the keypad numbers and 
what they represent. The main program 
starts at 0200 and initialization goes on 
to 021 A. From 021 C to 0228 we test the 
keypad and 022A to 022E we test for the 
first time through the program. This step 
eliminates any noise in the speaker while 
choosing the first note. 0230 to 0236 
gets the program to step through all the 
notes, and 0238 to 023D delays the pro- 
gram, not only to give you more time to 
choose a note, but also to put a space 
between the beginning and ending of the 
tune. 0242 to 0248 is for the beginning 
silence. 024A thru 0263 loads the note 
you have chosen into a temporary loca- 
tion. 0265 to 026E will jump to all the 
subroutines which we'll explain in a 
minute, 0271 thru 027B tests for the save 
key, which you press if you want that 
particular note. From 027B to 0283 we 
test for the DA key. 0285 to 028F will 
cause the program to jump to the routine 
which will allow us to see what notes we 
have so that they can be written down 
and saved for the 'Top Ten". 0295 to 
02A9 sets the save flag, resets the note 
counter, and because the program goes 
deep into the stack territory, resets the 
stack pointer to avoid trouble. 



The Get High subroutine is the first one 
we come to. From 0356 to 035E we test 
to 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 sharp 
note that is to go to the next octave. If it 
is, then from 0366 to 036A we'll load the 
high sharp note into the temporary loca- 
tion, otherwise from 036F to 0373 we'll 
load just the next octave note. The Get 
Sharp subroutine is similar and the Get 
Length subroutine is simple enough. 



The Play Tune subroutine is next. From 
0300 to 0306 we set up the first note, 
then we play it. This is the unsaved note 
we are trying out. Then we'll test for a 
save flag from 0313 to 0317, and test for 
a note or notes in the tunetable up to 
031 D. If there is one or more notes in the 
tunetable, from 031 F to 0330 we'll play 
them. If we had a save for the temporary 
note, we reset the save flag, store a rest 
so we don't hear the saved note twice, 
then load the note into the next position 
of the tuntable, and we'll also put our 
chosen length into the length table; atl 
this from 0333 to 0345. Since we saved 
the note, not only do we need some in- 
dication that it was saved, we also need 
to indicate that our finger is on the 3 
keypad long enough for the program to 
catch the keypad entry, so at 0347 we go 
to the subroutine that displays a big red 
"SAVE". At 034A we play all our notes 
again, and then go back to the main pro- 
gram to get another note, then back here 
again so we always hear our tune. 

In the Tone subroutine, at 02DD and 
02DF we set the ports to outputs; and at 
02E2 and E4 we start KIM's internal 
timer. We load the note frequency, and 
when it runs down we change the output 
to its other state, whatever it was. If you 
hook a speaker circuit on the port as In 
the KIM manual, a note will be produced 
as we repeat this procedure every time 
the timer times out at 02EF; and if we do 



§ 



June 1979 



MICRO 13:43 



this for a length of time determined by 
the note length at 02F9, we have just 
played a note in our tables or one we're 
testing out. 

Our Save subroutine starts at 03AA 
where we load a number for a particular 
time we want to keep the SAVE letters 
on. Next at 03AE and 03BO we set the 
direction registers and since we want 
only 4 digits lit we load the number 4 into 
the X register. When we store one of six 
numbers, from 09 to 13 into the location 
SBD(1742), one of the six digits will be 
lit, and then if we load a particular hex 
number representing a letter, number or 
other shape into another location 
SAD(1740), then the seven segment 
display will light. We also need some 
delay, because if we did not, the display 
would light and go out in a couple of 
microseconds, which few of us could 
see. All this is taken care of from 03B3 to 
03CC. And finally we want to end the 
tune after 72 notes so we will 
automatically go the the Display Notes 
routine from 03CE to 03D4. We want to 
keep count of how many notes we save 
so at 03D7 we increment the note count. 

If we have a nice little tune running 
through our circuits and we say to 
ourselves, "Hey, that's a catchy tune 
that might make the top 40,'* then we'll 
need some way of finding out what notes 
are in the tunetable so that we can write 
them down. The Display Notes routine 
does just that. What we want this sec- 
tion to do is to display a lettered note, to 
show that it is a sharp and/or a high note, 
and to show what its length is. We want 
it to stay on the display until we're ready 
for the next note and we need some in- 
dication that the note has changed when 
we do go to the next note. Finally we 
want the option of starting again. So 
here we go. 

From 0100 to 010A we test the counters 
to see if we've reached the end of our 
tune table, then we take our note and 
length and put them into a temporary 
location from 010D to 0115. From 01 17 to 
01 ID we check for a rest; if It isn't one 
then at 01 IF on we determine what note 
it is. What I did was to compare the 
unknown note to the note table and for 
every wrong comparison increment a 
count. We also have four groups of 7 
notes and to determine what group, I 
subtract a number until I get a carry flag. 
This then tells me the group and also the 
note. The group indicates whether the 
note is high, sharp, or high/sharp. We 
load the correct shape for the display on 
this information. If it was just a rest, at 
0180 we load a zero shape. At 01 8A to 
0198 we test for the length and then 
store the length shape. Up to 01 BC we 
display the shapes as before, only this 
time, as we go through a test for the next 
note, and "do again", we keep the 



MICRO 13:44 



0000 



0000 


FB 


0001 


DF 


0002 


C6 


0003 


BB 


0004 


A6 


0005 


93 


0006 


8A 


0007 


7B 


0008 


6D 


0009 


61 


OOOA 


5B 


OOOB 


51 


OOOC 


48 


OOOD 


43 


OOOE 


ED 


OOOF 


D2 


0010 


01 


0011 


BO 


0012 


9C 


0013 


01 


0014 


83 


0015 


74 


0016 


67 


0017 


01 


0018 


56 



TUNESMITH 

BY ANTHONY T. SCARPELLI 
MAY 1979 

MICRO NUMBER 13 

JUNE 1979 

COPYRIGHT (C) MAY 1979 BY 

THE C0MPUTERI5T, INC. 



KIM MONITOR REFERENCES 



PAD 


♦ 


$1700 


PADD 


* 


$1701 


TIMER 


■M- 


$1704 


TTIMER 


* 


$1707 


5TIMER 


* 


$170F 


SAD 


* 


$1740 


SADD 


♦ 


$1741 


SBD 


♦ 


$1742 


PBDD 


-N- 


$1743 


KEYIN 


* 


$1F40 


GETKEY 


* 


$1F6A 



DATA REGISTER 

DATA DIRECTION REGISTER 

SET TIMER 

TEST TIMER 

START TIMER 

SYSTEM DATA REGISTER A 

SYSTEM DATA DIRECTION A REG 

SYSTEM DATA REGISTER B 

SYSTEM DATA DIRECTION REG B 

KEYPAD INPUT 

GET KEYBOARD INPUT 



PAGE ZERO LOCATIONS 

ORG $0000 

LOW NOTE TABLE 

NOTE = $FB G 

= $DF A 

= $C6 B 

$BB C 

= $A6 D 

$93 E 

$8A F 

HIGH NOTE TABLE 

HINOTE = $7B G 

$6D A 

$61 B 

$5B C 

$51 D 

$48 E 

$43 F 

LOW SHARP NOTE TABLE 



SHPNOT = 



$ED 
$D2 
$01 
$B0 
$9C 
$01 
$83 



G SHARP, 
A SHARP, 
NO NOTE 
C SHARP, 
D SHARP, 
NO NOTE 
F SHARP, 



A FLAT 
B FLAT 



FLAT 
FLAT 



G FLAT 



HIGH SHARP NOTE TABLE 



HISHRP = $74 G SHARP, A FLAT 

$67 A SHARP, B FLAT 

$01 NO NOTE 

$56 C SHARP, D FLAT 



# 



June 1979 



» 



» 



0019 AC 




= 


$4C 


D SHARP, E FLAT 


OOIA 01 




= 


$01 


NO NOTE 


OOIB 3F 




= 


$3F 


F SHARP, G FLAT 


COIC 00 




- 


$00 


UNUSED 


OOID 00 




r 


$00 




OCIE 00 




= 


$00 




COIF 00 




= 


$00 




0020 02 


DELTIM 


~ 


$02 


DELAY TIME 


0021 00 


TIMED 


= 


$00 




0022 00 


TIMEC 


= 


$00 




0023 00 


SAVFLG 


= 


$00 


SAVE FLAG 


0024 00 


TLENTH 


- 


$00 


TEMP. LENGTH 


0025 00 


NOTPTR 


= 


$00 


NOTE POINTER 


0026 00 


KEYPTR 


r 


$00 


KEY POINTER 


0027 00 


TNOTE 


= 


$00 


TEMP NOTE 


0028 00 


HIFLG 


— 


$00 


HIGH FLAG 


0029 00 


SHPFLG 


= 


$00 


SHARP FLAG 


002A 00 


NOTNUM 


— 


$00 


NOTE NUMBER 


002B 00 


PRMNOT 


— 


$00 


PERMANENT NOTE 


002C 00 


FSTFLG 


- 


$00 


FIRST TIME FLAG 


002D 00 


PLENTH 


— 


$00 


PERM. LENGTH 


002E 00 


TNTNUM 


- 


$00 


TEMP. NOTE NUMBER 


002F 00 


NEXNOT 


= 


$00 


NEXT NOTE 


0030 00 


DELAYA 


r 


$00 


DELAY A 


0031 00 


DELAYB 


— 


$00 


DELAY B 


0032 00 


PNTPTR 


= 


$00 


PERM. NOTE POINTER 


0033 00 


DELAYC 


= 


$00 


DELAYC 


0034 00 


TTBPTR 


= 


$00 


TUNETABLE POINTER 


0035 00 


NTBPTR 


— 


$00 


NOTE TABLE POINTER 


0036 00 


NOTCNT 


= 


$00 


NOTCNT NOTE COUNT 


0037 00 


DNTCNT 


— 


$00 


DISPLAY NOTE COUNT 


0038 00 


TEMNOT 


= 


$00 


TEMP. NOTE 


0039 00 


TEMLEN 


= 


$00 


TEMP. LENGTH 


003A 00 


COUNT 


= 


$00 




003B 00 


DFOUR 


= 


$00 




003C 00 


DTHREE 


- 


$00 




003D 00 


DTWO 


= 


$00 




003E 00 


DONE 


= 


$00 




003F 00 


LNTPTR 


= 


$00 


LENGTH POINTER 




CONSTANTS 






0040 01 


KEYLNT 


_ 


$01 


(1) WHOLE NOTE 


0041 02 




— 


$02 


(2) HALF NOTE 


0042 04 




= 


$04 


(4) QUARTER NOTE 


0043 08 




r 


$08 


(8) EIGHTH NOTE 


0044 20 


LNTH 


= 


$20 


LENGTH 


0045 10 




= 


$10 




0046 08 




= 


$08 




0047 04 




— 


$04 




0048 86 


LNSHP 


~ 


$86 


(1) LENGTH SHAPE 


0049 DB 




- 


$DB 


(2) 


004A E6 




r 


$E6 


(4) 


004B FF 




= 


$FF 


(8) 


004C BD 


NTSHP 


— 


$BD 


(G) LETTER SHAPES 


0040 F7 




— 


$F7 


(A) 


004E FC 




= 


$FC 


(B) 


004F B9 




r 


$B9 


(C) 


0U50 DE 




= 


$DE 


(D) 


0051 F9 




= 


$F9 


(E) 


0052 Fl 




= 


$F1 


(F) 


0053 00 


LETNUM 


= 


$00 


LETTER NUMBER 



display lit. If we hit the 3 key we jump to 
a delay which blanks the display. This 
lets us know a new note has entered the 
circuits so that we can distinguish two 
or more same notes In a row. Finally we 
reset the stack pointer again and display 
the next note. If we want to start again at 
any time, we hit the DA key and off we go 
to the beginning again. By the way, the 
delay subroutine we go to is a good 
delay to get very long times. It uses the 
KIM-1's internal timer. 

So that's it. I know it is a long program, 
because of all the explanation, but I want 
as much understanding as possible, 
because of the possibilities it holds. The 
simple tone generation can be replaced 
with a D/A converter, an erase note mode 
can be implemented, a larger scale with 
more lengths and other variables can be 
developed, and so on. There Is no limit. 
But for a beginning, with a small com- 
puter, all you potential Bachs, here it is, 
go to it. 

M 



7a5/e / — Keypad Representations 

A = A note 

B = B note 

C = C note 

D = D note 

E = E note 

F = F note 

9 = G note 

= rest 

1 = whole note 

2 = 1/2 note 

4 = 1/4 note 
8 = 1/8 note 

5 = sharp 

7 = upper octave 

3 = save or display next note 
DA = Do Again 

+ = Display notes 



June 1979 



MICRO jl 3:45 




^ 0054 OF 

^ 0055 OD 

0056 OB 

0057 09 

0058 00 

0059 F9 
005A BE 
005B n 
005C ED 

005D 
005D 










mgm 



;(£;)^(S^(e)i 



0100 

0100 
0102 
0104 
0106 
0108 
01 OA 
01 OD 
01 OF 
0111 
0113 
0115 
0117 
0119 

one 

OllD 
OllF 
0121 
0123 
0124 
0127 
0128 
0129 
01 2B 
012D 
012F 
0131 
0133 
0135 
0137 

01 3A 
01 3B 
01 3C 
013E 
0140 
0141 
0143 
0144 
0146 
0148 
014A 
014C 
01 4E 
0150 



LETTER = 



TUNTBL * 
LNTTBL * 



$0F 
$0D 
$0B 
$09 

$00 
$F9 
$BE 
$F7 
$ED 

$0060 
$00A8 



LETTER SHAPES 



# 



TUNE TABLE 
LENGTH TABLE 



DISPLAY NOTE ROUTINE 
ORG $0100 



A9 01 
85 37 
A5 37 
C5 36 
DO 03 
4C El 01 
A6 37 
B5 60 
85 38 
B5 A8 
85 39 
A2 00 
A5 38 
C9 01 
FO 61 
D5 00 
FO 04 
E8 

4C 19 01 
38 
8A 

E9 07 
BO OD 
B5 4C 
85 3D 
A9 CO 
85 3E 
85 3C 
4C 8A 01 

38 
8A 

E9 OE 
BO 13 
8A 

E9 06 
AA 

B5 4C 
85 3D 
A9 F6 
85 3E 
A9 CO 
85 3C 
4C 8A 01 



BEGIN 



RPT 



DISNTS LDAIM 
STA 

NXTNOT LDA 
CMP 
BNE 
JMP 
LDX 
LDAZX 
STA 
LDAZX 
STA 
LDXIM 
LDA 
CMPIM 
BEQ 
CMPZX 
BEQ 
INX 
JMP 
SEC 
TXA 
SBCIM 
BCS 
LDAZX 
STA 
LDAIM 
STA 
STA 
JMP 

NXGRPA SEC 
TXA 



RESET DISPLAY NOTE COUNT 



$01 

DNTCNT 

DNTCNT TEST FOR END 

NOTCNT 

BEGIN 

DOAGNB 

DNTCNT STORE NOTE 

TUNTBL AND LENGTH 

TEMNOT 

LNTTBL 

TEMLEN 

$00 

TEMNOT 

$01 

DI5ZER 

NOTE 

SUB 



TEST FOR TEST 



TEST FOR NOTE 



• 



RPT 



SUB 



TEST FOR FIRST 
GROUP 



$07 

NXGRPA 

NTSHP 

DTWO 

$C0 

DONE 

DTHREE 

DISLEN 



STORE NOTE SHAPE 



TEST FOR SECOND 
GROUP 



SBCIM $0E 
BCS NXGRPB 
TXA 

SBCIM $06 
TAX 

LDAZX NTSHP 
STA DTWO 
LDAIM $F6 
STA DONE 
LDAIM $C0 
STA DTHRE£ 
JMP DISLEN 



STORE NOTE SHAPE 



STORE HI SHAPE 



• 



MICflO 13>46 



June 1979 



# 



0153 38 




NXGRPE 


J SEC TEST FOR THIRD 


015A 8A 






TXA GROUP 


0155 E9 15 






SBCIM $15 


|0157 BO 13 






BCS NXGRPC 


^0159 8A 






TXA 


015A E9 GD 






SBCIM $0D STORE NOTE SHAPE 


01 5C AA 






TAX 


G15D B5 4C 






LDAZX NTSHP 


015F 85 3D 






STA DTWO 


0161 A9 ED 






LDAIM $ED 


0163 85 3C 






STA DTHREE 


0165 A9 CO 






LDAIM $C0 


0167 85 3E 






STA DONE 


0169 4C 8A 


01 




JMP DISLEN 


016C 38 




NXGRPC 


SEC STORE NOTE SHAPE 


01 6D 8A 






TXA 


016E E9 15 






SBCIM $15 


0170 AA 






TAX 


0171 B5 4C 






LDAZX NTSHP 


0173 85 3D 






STA DTWO 


0175 A9 ED 






LDAIM $ED STORE SHARP SHAPE 


0177 85 3C 






STA DTHREE 


0179 A9 F6 






LDAIM $F6 


01 7B 85 3E 






STA DONE 


017D 4C 8A 


01 




JMP DISLEN 


0180 A9 BF 




DISZER 


LDAIM $BF STORE ZERO SHAPE 


0182 85 3D 






STA DTWO 


0184 A9 CO 






LDAIM $C0 


0186 85 3E 






STA DONE 


0188 85 3C 






STA DTHREE 


018A A2 00 




DI5LEN 


LDXIM $00 


.018C A5 39 




RPTB 


LDA TEMLEN TEST FOR LENGTH 


|018E D5 44 






CMPZX LNTH 


0190 FO 04 






BEQ GTSHP 


0192 E8 






INX 


0193 4C 8C 


01 




JMP RPTB 


0196 B5 48 




GTSHP 


LDAZX LNSHP STORE LENGTH SHAPE 


0198 85 3B 






STA DFOUR 


01 9A A9 80 




DIS 


LDAIM $80 LOAD DISPLAY 


01 9C 85 33 






STA DELAYC LIGHT TIME 


01 9E A9 7F 






LDAIM $7F SET DIRECTION REGISTER 


OlAO 8D 41 


17 




STA SADD 


D1A3 A2 04 




RPTC 


LDXIM $04 SET UP 4 LETTERS 


01A5 AO FF 




LITE 


LDYIM $FF AND DISPLAY 


01A7 B5 53 






LDAZX LETNUM LIGHT LETTERS 


01A9 8D 42 


17 




STA SBD 


OlAC B5 3A 






LDAZX COUNT 


OlAE 8D 40 


17 




STA SAD 


OlBl 88 




WAIT 


DEY DELAY 


01B2 DO FD 






BNE WAIT 


01B4 CA 






DEX GET NEXT LETTER 


01B5 10 EE 






BPL LITE 


01B7 A4 33 






LDYZ DELAYC DELAY 


01B9 88 






DEY 


OIBA 84 33 






STYZ DELAYC 


OIBC DO E5 






BNE RPTC 


OIBE 20 40 


IF 




J5R KEYIN TEST FOR NEXT NOTE 


OlCl 20 6A 


IF 




JSR GETKEY 


01C4 C9 03 






CMPIM $03 


01C6 FO OC 






BEQ NEXT 


01C8 20 40 


IF 




aSR KEYIN TEST FOR START AGAIN 


OICB 20 6A 


IF 




JSR GETKEY 


filCE C9 11 






CMPIM $11 \ 



Kaasa(*)a^ \^\m^ 



Cm 




AIM/SYM/KIM 
8K STATIC RAM pi°*. 
Sockets forSK Eprom 
6522 1/0 Port 

ON BOARD REGULATORS 

EPROM 
PROGRAMMER 



MEMORY PLUS: {94<{^ fully assembled and tested 



^a©3(^ [^IL^^ 



FOR 



AIM/SYM/KIM 




UPPER/lower case ASCir 

12a Additional User Programmable 

Characters; GRAPHICS- 

SYMBOLS-FOREIGN CHARACTERS 

Programmabla Screen Format up to 
80 CHARACTERS • 24 LINES 

KEYBOARD end LIGHT PEN Interfaces 

Up to 4K DISPLAY RAM 

ProWelon for 2K EPROM 

Provision to add 6502 for 

STAND-ALONE SYSTEM 

ASSEMBLED AND TESTED 

WITH 2K DISPLAY RAM 

VIDEO PLUS: $24500 



ADD UP TO RVE ADDITIONAL BOARDS AIM/SYM/KIM 

AUDIOHTY CONNECTIONS 
POWER TERMINALS 
APPLICATION CONNECTORS 

FULLY BUFFERED 
FULLY DECODED 
KIM-4 Bus Structure 



MOTHER PLUS: $8000 fully assembled and tested 




[pa©^(£) iPiL^^" 



FOR 



Same SIZE and SHAPE a* KtMfSYM 

ProfesHonal Quality 

Double Sided, PUted ttmmgh Hola 

TiM> Sen of COLO Plated Dual 22 Fingen 

DcMgncd for WIRE WRAP or 
SOLDER C 



ProvtMom for 40 14/1& pin lodiets 
4 24/40 pin toduH 
3 vohage rcfulaton 



AIM/SYM/KIM 




PROTOPLUS:$40«» 




Cf7/25C-3M9 



(g@li^PyTg[^D@1 



PO Box 5 
S Chelmsford. IDR OI824 






Juffw1979 



MICRO 13:47 




OlDO FO OF 






BEQ 


DOAGNB 


01D2 DO C6 






BNE 


DIS 


01D4 20 AC 


02 


NEXT 


JSR 


DELAY 


01D7 E6 37 






INC 


DNTCNT INCREMENT DISPLAY NO 


01D9 A2 FF 






LDXIM 


$FF COUNT. RESET STACK 


OlDB 9A 






TXS 


POINTER 


OlDC EA 






NOP 


PADDING 


OIDD EA 






NOP 




OlDE 4C 04 


01 




JMP 


NXTNOT 


OlEl A9 00 




DOAGNB 


LDAIM 


$00 


01E3 83 ^G 






STA 


NOTCNT 


0IE5 4C 00 


02 




JMP 


NUTUNE 


15 16 17 














MAIN PROGRAM 




0200 






ORG 


$0200 


0200 A9 00 




NUTUNE 


LDAIM 


$00 INITIALIZE TUNE 


0202 85 23 






STA 


SAVFLG 


0204 85 2A 






STA 


NOTNUM 


0206 85 2C 






STA 


FSTFLG 


0208 A9 01 






LDAIM 


$01 


020A 85 60 






STA 


TUN IB L 


020C 85 A 8 






STA 


LNTTBL 


020E 85 27 






STA 


TNOTE 


0210 A9 10 






LDAIM 


$10 


0212 85 24 






STA 


TLENTH 


0214 A9 06 




NUNOTE 


LDAIM 


$06 INITIALIZE NOTE 


0216 85 25 






STA 


NOTPTR 


0218 A9 OF 






LDAIM $0F 


021A 85 26 






STA 


KEYPTR 


021C 20 40 


IF 


PL AYE 


JSR 


KEYIN TEST KEYPAD FOR NOTE 


021F 20 6A 


IF 




JSR 


GETKEY 


0222 C5 26 






CMP 


KEYPTR 


0224 FO 2D 






BEQ 


GTNOTE 


0226 C9 00 






CMPIM 


$00 FOR REST 


0228 FO 20 






BEQ 


GTREST 


022A A5 2C 






LDA 


FSTFLG TEST FOR FIRST TIME 


i022C C9 00 






CMPIM 


$00 


022E FO 12 






BEQ 


NOPLAY 


0230 C6 26 






DEC 


KEYPTR SET UP FOR NEXT NOTE 


0232 C6 25 






DEC 


NOTPTR 


0234 10 02 






BPL 


DELYA 


0236 30 DC 






BMI 


NUNOTE 


0238 A6 30 




DELYA 


LDXZ 


DELAYA DELAY 


02 3A CA 






DEX 




023B 86 30 






STXZ 


DELAYA 


023D DO DD 






BNE 


PLAYB 


02 3F 4C 65 


02 




JMP 


SVNOTE 


0242 C6 26 




NOPLAY 


DEC 


KEYPTR SET UP FOR NEXT NOTE 


0244 C6 25 






DEC 


NOTPTR 


0246 10 D4 






BPL 


PLAYB 


0248 30 CA 






BMI 


NUNOTE 


024A A9 01 




GTRE5T 


LDAIM 


$01 LOAD REST 


024C 85 2C 






STA 


FSTFLG 


024E 85 27 






STA 


TNOTE 


0250 4C 65 


D2 




JMP 


SVNOTE 



# 



• 



MICRO 13:48 



June 1979 



0253 A9 01 


GTNOTE LDAIM $01 LOAD FIRST NOTE FLAG | 


0255 85 2C 




STA FSTFLG 


^57 A6 25 
•I59 A9 00 




LDXZ NOFPTR LOAD CHOSEN NOTE 




LDAIM $00 


025B 85 28 




STA HIFLG 


025D 85 29 




STA SHPFLG 


025F B5 00 




LDAZX NOTE 


0261 85 27 




STA TNOTE 


0263 86 32 




STXZ PNTPTR 


0265 20 56 03 


SVNOTE JSR GETHI GET HIGH NOTE | 


0268 20 86 03 




JSR GETSRP GET SHARP NOTE 


026B 20 DA 03 




JSR GTLNTH GET LENGTH 


026E 20 00 03 




JSR PLATUN PLAY NOTE 


0271 20 40 IF 




JSR KEYIN TEST TO SAVE NOTE 


0274 20 6A IF 




JSR GETKEY 


0277 C9 03 




CMPIM %{}:5 


0279 FO 16 




BEQ SAVE 


027B 20 40 IF 




JSR KEYIN TEST OFR START OVER 


027E 20 6A IF 




JSR GETKEY 


0281 C9 11 




CMPIM $11 DA = DO AGAIN 


0283 FO 13 




BEQ DOAGN 


0285 20 40 IF 




JSR KEYIN TEST FOR DIPSLAY NOTER 


0288 20 6A IF 




JSR GETKEY 


028B C9 12 




CMPIM $12 = + 


028D FO 15 




BEQ DNOTES 


028F DO 8B 




BNE PLAYB 


0291 A9 01 


SAVE 


LDAIM $01 SAVE NOTE 


0293 85 23 




STA SAVFLG 


0295 4C 14 02 




JMP NUNOTE 


0298 A9 00 


DOAGN 


LDAIM $00 RESET NOTE COUNTER 


029A 85 56 




STA NOTCNT 


fc9C A2 FF 




LDXIM $FF RESET STACK POINTER 


^9E 9A 




TXS 


02 9F EA 




NOP PADDING 


02A0 EA 




NOP 


02A1 4C 00 02 




JMP NUTUNE 


02A4 A2 FF 


DNOTES 


LDXIM $FF RESET STACK POINTER 


02A6 9A 




TXS 


02A7 EA 




NOP 


02A8 EA 




NOP 


02A9 4C 00 01 




JMP DISNTS JUMP TO DISPLAY NOTES 




DELAY SUBROUTINE 


02AC A5 20 


DELAY 


LDA DELTIM GET DELAY VALUE 


02AE 85 21 




STA TIMED 


02B0 A9 FF 


DELA 


LDAIM $FF LOAD TIMER 


02B2 8D 04 17 




STA TIMER 


02B5 2C 07 17 


TEST 


BIT TTIMER TEST TIMER 


02B8 10 FB 




BPL TEST BRANCH IF NOT RUN OUT 


02BA Z6 22 




DEC TIMEC REDUCE TIME VALUE 


02BC DO F2 




BNE DELA START AGAIN 


02BE Ce 21 




DEC TIMED REDUCE DELAY VALUE 


02C0 DO EE 




BNE DELA BRANCH IF NOT DNOE 


02C2 60 
02DD 




RTS 

ORG $02DD 


1 


TONE SUBROUTINE 1 





20 mA Current Loop TTY Interiace 

Audio Cusctte Interface 

15U»*rl/Olin« 

2 Interval Timeri 

1K+ RAM 1 
2K KIM Monitor ROM ; 

He. KeypAdfLED Diiplay 


or* 

The Origirul 6502 Svitem 












KIM-1: $18000 



The Ultimate Enclosure 
for the KIM-I 




ENCLOSURE PLUS 
for KIM: $30«> 



Protect* Your KlM-1 

Neat, Attractive, Profeuional 



Full Access to the Exfumion and 
Application Connectors 



Eiriuncec the LED Display with a Red leme 

Room for the KIM-1 attd One 
Additioful Board luch as 
MEMORY PLUS or VIDEO PLUS. 



20 Column Thennal Printer 
20 Character LED Display 



Rockwell Internationa) 

The Complete 6502 Syitem 




High Speed Audio Cassette 

Up to 4K RAM on board 



Up to 12K addiHonal ROM 
Versatile SK ROM Monitor 



AIM 65: S375(iO1KRAM-M20O04KRAM 



ENCLOSURE 

WITH BUILT IN 

POWER SUPPLY 

SPECIFICATIONS: 

INPUT: 11W220 VAC 50/60 Hz 

OUTPUT: + 5V ® SA 

+ 24Ve>1A 
QROUNOEO THREE-WIRE LINE CORD 
OWOFF SWITCH WITH PILOT UQHT 
Enctotura hat room for tfw AIM and ona 
addlUonal board: MEMORY PLUS or VIDEO PLUS 

AIM PLUS: $10000 AIM and AIM PLUS: $47500 





6f 7/256- J€49 



V 



(g(5)(i^[p)yTg(^0gT 



PO Box 3 
S Chelmsford. (DP OI824 




June 1979 



MICRO 13:49 




02DD A9 
02DF 8D 
02E2 A9 
02E4 8D 
02E7 A6 
02E9 CA 
02EA DO 
02EC EE 
02EF A9 
02ri 2C 
02F4 30 
02F6 4C 
02F9 C6 
02FB DO 
02FD 60 



17 



01 
01 
20 

OF 17 
2B 

FD 

00 17 
80 

07 17 
03 

E7 02 
2D 
E5 



0300 

0300 A5 
0302 85 
0304 A9 
0306 85 
0308 A5 
030A 85 
030C A5 
030E 85 
0310 20 
0313 A5 
0315 C9 
0317 FO 
0319 A5 
031B. C9 
03 ID FO 
031F A6 
0321 B5 
0323 85 
0325 B5 
0327 85 

0329 20 
032C E6 
032E C6 

0330 10 
0332 60 



2A 

2E 

00 

2F 

27 

2B 

24 

2D 

DD 02 

23 

01 

lA 

2A 

00 

13 

2F 

60 

2B 

A8 

2D 

DD 02 

2F 

2E 

ED 



TONE LDAIM 
STA 

SOUND LDAIM 
STA 

NOTEX LDXZ 

NWAIT DEX 
BNE 
INC 
LDAIM 
BIT 
BMI 
JMP 

TIMOUT DEC 
BNE 
RTS 



0333 A9 00 
0335 85 23 
0337 A9 01 
0339 85 27 
033B E6 2A 
033D A6 2A 
033F A5 2B 
0341 95 60 
0343 A5 24 
0345 95 A8 
0347 20 AA 03 
034A 4C 00 03 



0356 



$01 OPEN PORT 

PADD 

$20 START TIMER 

STIMER 

PRMNOT NOTE FREQUENCY 



TOGGLE OUTPUT 
TEST COUNTER 



NWAIT 

PAD 

$80 

TTIMER 

TIMOUT 

NOTEX 

PLENTH NOTE LENGTH 

SOUND 



PLAY TUNE SOBROUTINE 



ORG $0300 



PLATUN LDA 
STA 
LDAIM 
STA 
LDA 
STA 
LDA 
STA 
JSR 
LDA 
CMPIM 
BEQ 
LDA 
CMPIM 
BEQ 

PLAYC LDXZ 
LDAZX 
STA 
LDAZX 
STA 
JSR 
INC 
DEC 
BPL 

RETURN RTS 



NOTNUM 

TNTNUM 

$00 

NEXNOT 

TNOTE 

PRMNOT 

TLENTH 

PLENTH 

TONE 

SAVFLG 

$01 

SAVEX 

NOTNUM 

$00 

RETURN 

NEXNOT 

TUNTBL 

PRMNOT 

LNTTBL 

PLENTH 

TONE 

NEXNOT 

TNTNUM 

PLAYC 



SET UP FIRST NOTE 



PLAY NOTE 



TEST FOR SAVE 



TEST FOR NOTE 
(NOT REQUIRED) 

LOAD NEXT NOTE 



LOAD NEXT LENGTH 

PLAY NOTE 
SET UP FOR 
NEXT NOTE 



• 



SAVEX LDAIM $00 RESET SAVE FLAG 
STA SAVFLG 
LDAIM $01 NO PLAY 
STA TNOTE 

INC NOTNUM LOAD NOTE INTO 
LDXZ NOTNUM TUNETABLE 
LDA PRMNOT 
STAZX TUNTBL 

LDA TLENTH LOAD LENGTH 
STAZX LNTTBL INTO LENGTH TABLE 
3SR DISPLY 
3MP PLATUN 



ORG $0356 



• 



MICRO 13:50 



June 1979 



^556 20 40 




GET HIGH SUBROUTINE 




IF 


GETHI 


3SR 


KEYIN 


TEST FOR HIGH NOTE 


0359 20 6A 


IF 




3SR 


GETKEY 




035C C9 07 






CMPIM $07 




035E DO 15 






BNE 


RETRNB 




0360 A5 29 






LDA 


SHPFLG 


TEST SHARP NOTE 


0362 C9 00 






CMPIN 


1 $00 


(NOT REQUIRED) 


0364 FO 09 






BEQ 


LOADHI 




0366 A6 32 






LDXZ 


PNTPTR 


LOAD HIGH SHARP NOTE 


0368 B5 15 






LDAZ) 


: HISHRP 




036A 85 27 






STA 


TNOIE 




036C 4C 75 


03 




3MP 


RETRNB 


(COULD HAVE BEEN RTS) 


D36F A6 32 




LOADHI LDX 


PNTPTR 


LOAD HIGH NOTE 


0371 B5 07 






LDAZ> 


HINOTE 




0373 85 27 






STA 


TNOTE 




0375 60 




RETRNB RTS 






0386 






ORG 


$0386 








GET SHARP SUBROUTINE 


0386 20 40 


IF 


GETSRF 


' JSR 


KEYIN 


TEST FOR SHARP NOTE 


0389 20 6A 


IF 




3SR 


GETKEY 




038C C9 05 






CMPIM 


$05 




038E DO OA 






BNE 


RETRNC 




0390 A 9 01 






LDAIM 


$01 


LOAD SHARP FLAG 


0392 85 29 






STA 


SHPFLG 




0394 A6 32 






LDXZ 


PNTPTR 


LOAD SHARP NOTE 


0396 85 OE 






LDAZX 


SHPNOT 




^398 85 27 
^39A 60 






STA 


TNOTE 






RETRNC 


RTS 






03AA 






ORG 


$03AA 








DISPLAY SAVE 


SUBROUTINE 


03AA A 9 80 




DISPLY 


LDAIM 


$80 


LOAD DISPLAY 


03AC 85 33 






STA 


DELAYC 


LIGHT TIME 


03AE A9 7r 






LDAIM 


$7F 


SET DIRECTION REGISTER 


03B0 8D 41 


17 




STA 


SADD 




0383 A2 04 




REPEAT LDXIM $04 


SET UP 4 LETTERS 


03B5 AO FF 




LIGHT 


LDYIM 


^F 


AND DELAY 


03B7 85 53 






LDAZX 


LETNUM 


LIGHT LETTERS 


03B9 8D 42 


17 




STA 


SBD 




03BC 85 58 






LDAZX 


LETTER 




03BE 8D 40 


17 




STA 


SAD 




03C1 88 




WAITY 


DEY 




DELAY 


03C2 DO FD 






BNE 


WAITY 




03C4 CA 






DEX 




GET NEXT LETTER 


03C5 10 EE 






BPL 


LIGHT 




03C7 A4 :^:^ 






LDY 


DELAYC 


DELAY 


03C9 88 






DEY 






03CA 84 33 






STY 


DELAYC 




03CC DO Z5 






BNE 


REPEAT 




03CE A5 36 






LDA 


NOTCNT 


TEST FOR 72 NOTES 


03D0 C9 48 






CMPIM 


$48 


48 HEX = 72 DECIMAL 


03D2 DO 03 






BNE 


INCNOT 




03D4 4C 00 01 

i 




JMP 


DISNTS 


L 






All Include th« Following Fcalurci: 

ALL METAL HEAVY DUTV CASE 

ONK7FF SWITCH and riLOT LIGHT 

IISMOHz or 23W50HZ INf UT 

GROUNDED THREE-WIRE 
fOWERCORD 



POWER PLUS 5: -hSVatSA, ±12V a« 1A $75«» 
POWER PLUS SUPER 5: + 5V at 10A, ± 12V at 1 A $95«» 
POWER PLUS S/24: + SV at SA, + 24 at 2.SA, ± 12V at 1 A $95*» 






^ 


5X£)\>i!/35j ^ sia^iaa'" 




SPECIFICALLY DESIGNED FOR THE AIM 65 




Small Enough to Fit Imide th« Al M EndcHure ^^ ^^^^ 




Enoufh Power for the AIM «S Fully Loaded I^S^f^^^^B 




PkisanAddHkMultoard ^'^H^HB^K 
Worbon115VMOHzor230Vf50Ht W^^^lB^^^ 




Pf««tde»Rc|uhted+5VatSAand +24Vat1A ^^^^l^Lff^ 




«^w.,.^c«- POWER A PLUS: $5000 

ONK>FF Switch and Pilot Light 




^^ 


J 



ALL THE POWER A 
KIM-1/SYM-1 NEEDS 




POWER PLUS: $40<» 



ItinUM 
INPUT: 11 SVfiOHz 

OUTPUTS: Regulated + SV at 1.4A 
+ 12Val1.eA 
Unregublcd + SV up to 4.3A 
+ UVuptolJaA 

Will Power a XIM-1/SYM-1 and one 

Additional R^ard 

Such ac MEMORY PLUS or VIDEO 

PLUS 



SUPERSCOPEC-190 
by Marantz 

A High QiMlttY Cafac4t« Recorder 
wHh aH of the Featuret Requited 
for Mivooonipuler SyttcoB: 

VU MMcr Dtopbyi Recordiiv Lcvd 

lltV AC or <«VDC or SattcrY Opcrathm 

Tape Location Counter 

Thf«e R«cor«Bi« Method! 

VariaUe Sp*«l Control: ± »« SUPERSCOPE C-1 90*. $9000 

Remote Control Leawt Electronicf ON 





B17/23€'S€49 



(g(5)(M][p)(UITg[^0gT ir^ 



PO Box 3 
S Chelmsford, mfl OI894 




June 1979 



MICRO 13:51 






mmm 



^^M^^^^0^i 



"mmrnm 



^^^^^^ 



isii^tt 



fes%i 



!^1 












liilll] 



03D7 E6 


36 




INCNOr INC 


NOTCNT INCREASE NO 


03D9 60 






RTS 










GET LENGTH SUBROUTINE 


03DA A9 


03 




GTLNTH LDAIM 


$03 LOAD LENGTH 


03DC 85 


3F 




STA 


LNTPTR 


03DE 20 


AO 


IF 


KEYTST JSR 


KEYIN TEST KEYPAD 


03E1 20 


6A 


IF 


JSR 


GETKEY LENGTH 


03E4 A6 


3F 




LDXZ 


LNTPTR 


03E6 D5 


AO 




CMPZX 


KEYLNT 


03E8 FO 


05 




BEQ 


LODLNT 


03EA C6 


3F 




DEC 


LNTPTR 


03EC 10 


FO 




BPL 


KEYTST 


03EE 60 






RTS 




03Er B5 


AA 




LODLNT LDAZX 


LNTH LOAD LENGTH 


03F1 85 


2A 




STA 


TLENTH 


03F3 60 






RTS 





• 



SYMBOL 


TABLE 


2000 228E 










NOTE 


0000 


HINOTE 


0007 


SHPNOT 


OOOE 


HISHRP 


0015 


DELTIM 


0020 


TIMED 


0021 


TIMEC 


0022 


SAVFLG 


0023. 


TLENTH 


002A 


NOTPTR 


0025 


KEYPTR 


0026 


TNOTE 


0027 


HIFLG 


0028 


SHPFLG 


0029 


NOTNUM 


002A 


PRMNOT 


002B 


FSTFLG 


002C 


PLENTH 


002D 


TNTNUM 


002E 


NEXNOT 


002F 


DELAYA 


0030 


DELAYB 


0031 


PNTPTR 


0032 


DELAYC 


0033 


TTBPTR 


003A 


NTBPTR 


0035 


NOTCNT 


0036 


DNTCNT 


0037 


TEMNOT 


0038 


TEMLEN 


0039 


COUNT 


003A 


DFOUR 


003B 


DTHREE 


003C 


DTWO 


003D 


DONE 


003E 


LNTPTR 


003F 


KEYLNT 


OOAO 


LNTH 


OOAA 


LNSHP 


00A8 


NTSHP 


OOAC 


LETNUM 


0053 


LETTER 


0058 


TUNTBL 


0060 


LNTTBL 


00A8 


DISNTS 


0100 


NXTNOT 


01 OA 


BEGIN 


01 OD 


RPT 


0119 


SUB 


0127 


NXGRPA 


01 3A 


NXGRPB 


0153 


NXGRPC 


01 6C 


DISZER 


0180 


DISLEN 


01 8A 


RPTB 


018C 


GTSHP 


0196 


DIS 


01 9A 


RPTC 


01A3 


LITE 


01A5 


WAIT 


OlBl 


NEXT 


OlDA 


DOAGNB 


OlEl 


NUTUNE 


0200 


NUNOTE 


021A 


PLAYB 


021C 


DELYA 


0238 


NOPLAY 


02A2 


GTREST 


02 AA 


GTNOTE 


0253 


SVNOTE 


0265 


SAVE 


0291 


DOAGN 


0298 


DNOTES 


02AA 


DELAY 


02AC 


DEL A 


02B0 


TEST 


02B5 


TONE 


02DD 


SOUND 


02E2 


NOTEX 


02E7 


NWAIT 


02E9 


TIMOUT 


02F9 


PLATUN 


0300 


PLAYC 


031F 


RETURN 


0332 


SAVEX 


0333 


GETHI 


0356 


LOADHI 


036F 


RETRNB 


0375 


GETSRP 


0386 


RETRNC 


03 9A 


DISPLY 


03AA 


REPEAT 


03B3 


LIGHT 


03B5 


WAITY 


03C1 


INCNOT 


03D7 


GTLNTH 


03DA 


KEYTST 


03DE 


LODLNT 


03EF 


PAD 


1700 


PADD 


1701 


TIMER 


170 A 


TTIMER 


1707 


STIMER 


170F 


SAD 


17A0 


SADD 


17A1 


SBD 


17A2 


PBDD 


17A3 


KEYIN 


IFAO 


GETKEY 


1F6A 















m 



# 



MICRO 13:52 



June 1979 



THE MICRO SOFTWARE 
» CATALOG: IX 



Mike Rowe 

P.O. Box 64 

S. Chelmsford, MA 01824 



Name: MASTER CATALOG 
System: Apple II with disk 
Memory: 32K(min) 

Language: Applesoft II and machine language 
Hardware: Apple II, Disk II 

Description: MASTER CATALOG creates a single 
alphabetized file and listing of each diskette catalog 
entry by program name, volume number, and program 
type. MASTER CATALOG will help you locate your pro- 
grams. A machine language sort will speed the sort by 
program name or volume number. 
Copies: Just released 
Price: $8.00 

Includes: Cassette and instructions 
Author. Alan G. Hill 
Available from: 

Alan G.Hill 

12092 Deerhorn Dr. 

Cincinnati, Ohio 45240 

Name: BASIC OPTIMIZER 
System: Apple II 

Memory: 24K(min) Cassette version, 32K(min) Disk 
version 

Language: Interger Basic 
Hardware: STANDARD (DOS for Disk Version) 
Description: Restructures your basic program by 
eliminating all remarks, condensing code to long 
strings, eliminating unneeded line numbers and renam- 
ing numeric variables. In affect, the Optimizer creates a 
production 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 your 
program with alt the remarks you need; give your 
variables meaningful names. After the program is done, 
let the Optimizer create a fast efficient production 
version. 

Copies: Just released 

Price: $19.95 for Cassette Version. $25.95 for Disk Ver- 
sion. Texas residents add 5% sales tax 
Includes: Cassette Version: Cassette and Instructions. 
Disk Version: Diskette with sample program and 
instructions. 
Author: Bruce H. Bart>er 
Available from: 

Bruce H. Barber 

1 1 803 Rosewood Drive 

Houston, TX 77070 



Name: PET PILOT 

System: PET 

Memory: 8K 

Language: BASIC 

Hardware: Student use: no extra hardware. 

Teacher use: cassette #2 

Description: Full Pilot for PET, with full BASIC in C 

statements & programs to 80K characters. No more 

memory limitation on program size: you can write real 

courses in this PILOT. 

Copies: Release date 4-15-79, 5 test sites. 

Price: $12.(M) postpaid in US (prepaid orders only) 

Includes: Teacher's Manual Cassette, Reference Card, 

Licence for 1 machine. 

Order Info: Must be prepaid and include PET serial 

number. 

Author: Dave Gomberg + Martin Kamp 

Available from: 

Dave Gomberg -i- Martin Kamp 

7, Gateview Court 

San Francisco, CA94116 

Name: Series One 
System: PET 
Memory: 8K 

Language: Not Specified 

Hardware: Basic 8K PET or 18/32K Full-keyboard PET 
Description: Series One is a collection of 25 programs 
for the Commodore PET personal computer. For less 
than one collar each. Series One contains 16 games 
and 9 general programs. Games include Space Wars, 
Motorcycle Jump, Saucer Attack, Ping Pong, Bomb 
Squad, Crack the Safe, Bombs Away, Bite the Wall, 
Auto Race, Break Away, and six others. Other programs 
include Mortgage Loan, Perpetual Calendar, Elemen- 
tary Math, Savings Account, Clock, and more. Most pro- 
grams take full advantage of the graphics capability of 
the PET. 

Copies: Not Specified 
Price: $24.95 
Includes: Not Specified 
Author: Not Specified 
Available from: Local PET Dealers, or, 

ADP Systems 

95 West 100 South 

Logan, UT 84321 



June 1979 



MICRO 13:53 



Name: An 8080 Simulator for the 6502 — KIM-1 Version 
System: KIM-1 
Memory: 1K 

Language: Assembly language. 
Hardware: Unexpended KIM-1 and (optionally) 8 
switches, 1 resistor 

Description: Executes the full 8080 instruction set as 
though KIM were an 8080-based computer. Supports 
single-step, trace and run modes and allows monitoring 
and modification of all internal 8080 registers. User 
definable input and output ports, breakpoints and ac- 
cess to 6502 subroutines directly from 8080 programs. 
Up to 224 bytes of 8080 programming space available 
on an unexpanded KIM-1. Also simulates 8080 Inter- 
rupts. An excellent training aid for 8080 programming 
and 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. California 
residents 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 McCreary 
Available from: 

Dann McCreary 

BOX16435-M 

San Diego, California 921 16 

Name: Light Pen No. 4 

System: Apple 

Memory: 16K and ROM Board, and Light Pen 

Language: Apple II Soft 

Description: Program allows user to plot points on the 

screen in Low-Res, than converts the data to Hi-Res. 

Plot can be in colors. 

Price: $34.95 + $1.00 postage & handling (PA res. add 

6% sales tax) 

Includes: Light Pen and 4 other support programs 

Copies: 20 

Author: NeilD. Lipson 

Available from: 

Progressive Software 

P.O. Box 273 

Ply. Mtg., PA 19462 

Name: Morse Code 
System: Apple 
Memory: 16K 
Language: Integer Basic 

Description: Program allows user to learn morse code 
by typing English into computer and having morse code 
dots and dashes appear on the screen and hearing the 
beeps (audio) at the same time. Program has transmis- 
sion speed control. 
Copies: 10 
Price: $9.95 + $1.00 postage & handling (PA residents 

add 6% sales tax) 

Includes: Cassette with instructions 

Author: EdHanley 

Available from: 

Progressive Software 

P.O. Box 273 

Ply. Mtg., PA 19462 

MICRO 13:54 



Name:GRAFAX 

System: OSI Challenger IIP 

Memory: 4k (6k optional with buffer) 

Language: BASIC and machine language 

Hardware Required: Challenger ll(50X cpu,540 video 

with graphics rom, polled keyboard) 

Description: If you have OSI's rom graphics generator 

chip then you have been looking for GRAFAXI GRAFAX 

is designed to give you finger-tip control over the full 

OSI graphics capabilities. You no longer will need 

laborious poke list, BASIC string conversions, or 

machine language kludges just to get something on the 

screen. GRAFAX uses single key-stroke commands for 

cursor movement, character selection, 32/64 format, 

screen save/restore (optional, requires at least 2k ram 

beyond the basic 4k machine), and cassette save/load. 

GRAFAX is not an X-Y plotter, but rather a full screen 

imaging tool carefully devised to free your creative 

ability for drawing instead of programming. 

Copies: New, just released. 

Price: $10.00 + 1 .00 postage (USA) 

Includes: 300 baud cassette (BASIC/machine language 

source, sample screens), and documentation. 

Author: Mark Bass 

Available from: 

Mark Bass 

269 Jamison Drive 

Frankfort, Illinois 60423 



Name: Polar Coordinate Plot 
System: Apple 
Memory: 16K and ROM Board 
Language: Apple II Soft 

Description: A high resolution graphics program .which ^^ 
plots polar coordinate equations (4 classic equations ^p 
and user's own equation). After plot is completed, data 
(In cartisian and polar coordiante system) will appear on 
the screen in a summary table form so that the plot can 
be easily duplicated. 
Copies: 50 

Price: $9.95 + $1.00 postage and handling (PA 
residents add 6% sales tax) 
Includes: Cassette with instructions 
Author: T. David Moteles 
Available from: 

Progressive Software 

P.O. Box 273 

Ply. Mtg., PA 19462 

Name: DISC COPY 
System: Apple II 
Language: Applesoft II 
Hardware: Apple II, Disc II 

Description: For those Apple owners who have only 
one disc drive but would still like to copy discs that 
contain integer Basic and Applesoft programs, this 
two-part program is a must. It results in an automatic 
systenri that can copy a whole discs worth of programs. 
Price: $15 

Copies sold: Just released 
Author: Jules H. Glider 
Available from: 

Softsell Associates 

2022-79th Street ^ 

Brooklyn, NY 11214 ^ 

June 1979 



# 



MORE INNOVATIONS! 

FROM 

P.S. SOFTWARE HOUSE 

FORMERLY PETSHACK 

PET™ INTERFACES 

NEW! 

PET to CENTRONICS INTERFACE $9400 

PET to PARALLEL INTERFACE with 5V .8A power supply $74.95 

PET to 2nd CASSETTE INTERFACE $49.95 

PET™ SCHEMATICS 

FOR ONLY $24.95 YOU GET. 

24" X 30" schematic of the CPU l»ard, plus oversized schematics of the Video 
Monitor and Tape Recorder, plus complete Parts layout - all accurately and 
painstakingly drawn to the minutest detail. 

PET™ ROM ROUTINES 

FOR ONLY $19.95 YOU GET: 

Complete Disassemtjiy listings of all 7 ROMS, plus identified subroutine entry 

points; Video Monitor, Keytward routine, Tape Record and Playback routine, Real 

Time Clock, etc. To entice you we are also including our own Machine Language 

Monitor program for your PET using the keyboard and video display. 

You can have the Monitor program on cassette for only $9,95 extra. 

SOFTWARE: 

6502 DISASSEMBLER $12.95 

MAILING LIST - For personal or business applications. $9.95 

MACHINE LANGUAGE MONITOR - Write Machine Code. Save on tape $9.95 
BUDGET -NEW -Keep track of Bills and Checks. Update as needed $14.95 
STARTREK - All-time favorite written for the PET's special Graphics 



$7.95 



Send for our free SOFTWARE BROCHURE. Dealer inquiries welcome. 

P.S. SOFTWARE HOUSE 

P.O. Box 966 MIshawaka, IN 46544 



flft Tel: (219) 255-3408 



• 


"~" 


PFT ^prriAi ^ 






PET spccial;!.^,^^ ^^^ 

PET 16K $ 995 $ 860 
PET32K $1295 $1125 
PET 8K $ 795 $ 695 
PET 2040 Dual Disk $1295 $1125 
PET 2023 Printer (pressure feed) $ 849 S 750 
PET 2022 Printer (tractor feed) $ 995 $ 860 








KIM-1 $159 SYM-1 $229 
Memory Plus (for $ 199 
SEA-16 New 16K Static RAM ^Z $ 325 
Seawell Motherboard-4K RAM soace *'"> $ 99 






3M "Scotch" 8' disks «.. r 10/$31.00 
Verbatim 5" diskettes ^'*LC io/$28.50 






2114 L 450 ns 4K Static RAM $ 6.95 
2716 EPROM (5 volt) $ 45 
Programming the 6502 (Zaks) $ 9.90 
6502 Applications Book fZa/fsj $11.90 
6500 Programming Manual (MOS) $ 6.50 
6500 Hardware Manual (MOS) $ 6.50 
First Book of KIM $ 8.90 
Programming a Microcomputer:6502 CFos/erj $ 8.90 






Cassettes (all tapes guaranteed) 

Premium quality, high output lownoise in 5 screw 

housing with labels: 

C-10 10/5.95 50/25.00 100/48.00 
C-30 10/7.00 50/30.00 100/57.00 




• 


WRITE FOR 6502 AND S-100 PRODUCT LIST 




_ _ 115 E. Stump Road 
A B Computers Montgomeryvllle. pa isgse 

(215) 690-8386 





Q 



LEADER IN 
COmPUTER EDUCATION 



] 



INTRODUCES THE 6502 SERIES 




6502 
ftPPUCflTIONSBOOK 


M 




7- 


w 


MttaT ^s 


n 



PftOCRAmmiNC THE 6502 
"^RodnoyZaks 
320pp.refC202 S10.95 

An introductory programming 
text for the 6502. Does not 
require any prior programming 
knowledge. From arithmetic 
to interrupt-driven Input-output 
techniques. It hos been de- 
signed as a progressive, step 
by step course, with exercises 
in the text designed to test the 
reader at every step. 

6502 GflrriES 

ByRodnayZaks 

refG402 $13.95 

From Piano to tic tac toe, in- 
cluding many popular games, 
and how to program your own. 
To be published. 



6502 APPLICATIONS BOOK 
byRodnoyZaks 
275pp.refD302 $12.95 

Presents a series of practical 
(hardware & software) applica- 
tions for any 6502 board. 
Applications can be used as 
experiments - or implemented 
at minimal cost. A few ex- 
amples: morse generator, elec- 
tronic piano, digital clock, 
home alarm systems, traffic 
controller.... and morel 

TO ORDER 

■y phen*: 4t 5 848-8233, V^sa, M.C, 

Americon Exprsss. 
By iiMill: Include payment. 
Shipping charg^t: add 65C per book 

4th claw - allow 4 weeks - or $1 .50 

per book for U. P. S. Overseas odd 

$3.00 per book. 
T«x: in California odd tax. 



AVAILABLE AT BOOKSTORES, COMPUTER. AND 
ELECTRONIC SHOPS EVERYWHERE 

© 

2020Mitvia Street 

Berkeley, CA94704 

Tel 415 848-8233 Telex 336311 



istAAAE. 



^POSITION. 



COMPANY . 
ADDRESS_ 
CITY 



_STATE/ZIP 



Dchargomy: DVisa DM.C. D American Express 
DC202 DD302 00402 

Number Exp. date 

Signature ^ 

AAM D Send Free Cotok^ue 




microsystems 



224S.E. 16th Street 

P.O. Box 687 
Ames, Iowa 50010 
Phone 515-232-8187 



9 



single board computers 

c7b1 




THE 6500 BASED SINGLE BOARD COMPUTER 
YOU HAVE BEEN LOOKING FOR 



An industrial quality 6500 based single board 
computer produced by the company known 
for quality 6500 hardware and software. CSB 1 
includes a 6502 processor, four ROM/EPROM 
sockets, 2K bytes RAM(2114), two PIA(6520) 
and one VIA(6522) chips. All addresses are 
switch selectable and a single +5 volt power 
supply is needed. Board size is 6 by 9.75 



inches. The gold plated edge connector 
adheres to the SYSTEM 65 bus standard. 
Single quantity price is $595 with substantial 
quantity discounts available. Other CSB board 
products are available or in design. Call us 
today for further information on our CSB 
family or any of our other 6500 support 
products. 



§ 



Sym-1: Speak To Me 



If you want you computer to carry on some snappy 
dialog, you are a real dreamer. But, here are some tech- 
niques to get you started with limited speech for your 
micro. 



Jack Gieryjc 
20411 38th Ave. N.W. 
Andover, MN 55303 



I 



In the February issue of KILOBAUD I 
came across an interesting article by 
Robert Bishop. In this article the tape 
recorder input line was used to sannple a 
voice signal and the tape recorder output 
line was set high or low depending on 
the sample. Hopefully the resulting 
square wave pattern contained enough 
of the voice's original fundamental to 
reproduce an understandable signal. A 
primitive form of s peec h synthesis in- 
deed buV this idea did start the^ wheels 
rolling in my head. 

Since we are dealing with square waves 
and not discrete samples at various 
amplitudes, I thought the sampling fre- 
quency would need to be much higher 
than the theoretical two times the 
reproduceable frequency. I wrote the ac- 
companying short program which re- 
sults in slightly over 40,000 samples per 
second. That's about the limit of the 
SYM-1 and I figured that should do it for 
voice. I used my stereo receiver to fur- 
ther help as it has reasonably good 
amplifiers. I put my cassette deck on 
record-pause and plugged in a micro- 
phone. The tape deck output went to the 
SYM for sampling on the SYM's normal 
tape Input line. The SYM's tape output 
line was connected to one of the tape 
recorder inputs on the stereo receiver. 

At this point t began executing the pro- 
gram and listened to the fruits of my 
labor — sour as they were. The resulting 
sound reminded me of a small speaker 
driven to distortion although it was 
understandable. The recording level con- 
trol was critical. Remember the SYM 
sees either a "1" or a "0". The input 
signal must vary enough to trip the input 
line. If the volume is too high then too 
many 1's will be ''seen." If the volume is 
too low then nothing will be heard as the 
input line will remain a zero. Whistling 
across (not into) the microphone pro- 
duced good results. Playing some of my 
music tapes also was interp-'*ing. Only 
the foreground sounds were "repro- 
duced." The background sounds didn't 
have enough volume to trip the logic 
level. 



Primitive as this is, it is good enough to 
use for computer — to-user communica- 
tions. However, this will require enor- 
mous amounts of memory which places 
a damper on things. The sampling rate of 
my program would fill 5K of memory in 
about 1 second. An option would be to 
reduce the sampling rate. I did this but 
the results were very poor. Remember 
this method Is using a square wave. At a 
10,000 sample/second rate too little in- 
formation remained and harmonics from 
the square waves interf erred. Change 
location *225 and '231 to hex 33 and see 
for yourself. By changing location '234 
. you can vary the sampling rate. "Ed" will 
result in 10,000 sample/second. Try "do" 
and whistle into the microphone. You'll 
hear the unwanted harmonics so 
abundant in a square wave. 

I had thought of plagerizing the system's 
tape record/playback routines in order to 
store the square wave on tape instead of 
using memory. However, in the high 
speed format I could only store about 
1500 bits per second (185 8 bit 
characters per second) which is far too 




low a sampling rate to be useful. 
Perhaps a floppy disk would have a high 
enough data transfer rate to be of some 
use. This is food for thought. 

if any of you are still seriously interested 
then I would suggest an 8 bit analog-to- 
digital convertor to digitize the data. The 
data could then be sent through an 8 bit 
digital-to- analog converter to reproduce 
the signal. Much lower sampling rates on 
' the order of 5,000 to 8,000 samples/sec- 
ond could be used for voice. However, 
even at 5,000 8 bit samples per second 
you would still consume 5K memory in 
one second. 

The approach of recording all char- 
acteristics of speech for either recogni- 
tion or future reproduction deserves a 
reassessment. Perhaps there is some 
key remaining to be discovered which 
will enable the computer to use speech 
with a very limited amount of data. Soft- 
ware may need a greater hardware assist 
in order to accomplish what seems to be 
a difficult task. The near future may pro- 
vide the answer. 



^ 



^^^^ 



June 1979 



MICRO 13:57 



SYM SPEAK TO ME 



023B 



BY JOHN GIERYIC 
MAY 1979 

PAGE ZERO EQUATE 

MASK * $0001 
SYM REGISTER EQUATES 



• 



02 3B 
023B 
023B 
023B 

0200 

0200 A9 07 
0202 85 01 
0204 A 9 00 
0206 8D 02 AO 

0209 A9 BF 
020B 8D 03 A4 
020E A 9 07 

0210 80 02 A4 



VORBX * 

VDDRB * 

ORB * 

DDRB * 



$A000 VIA OUTPUT REGISTER B 

$A002 VIA DATA DIRECTION REGISTER B 

$A402 6532 OUTPUT REGISTER B 

$A403 6532 DATA DIRECTION REGISTER B 



ORG $0200 
START LDAIM $07 SET UP MASK 



STA MASK 
LDAIM $00 
STA VDDRB 
LDAIM $BF 
STA DDRB 
LDAIM $07 
STA ORB 



SET DATA DIRECTION FOR INPUT 

IN VIA 

SET DATA DIRECTION FOR OUTPUT 

6532 

TURN BIT ON - OUTPUT 

6532 



0213 AD 00 AO LOOPA LDA VORBX SAMPLE VIA INPUT 



0216 29 40 
0218 FO OD 
021A AD 02 A4 
021D 29 F8 
021F 45 01 
0221 8D 02 A4 
0224 4C 13 02 



ANDIM $40 



BEQ 
LDA 



LOOPB 
ORB 



ANDIM $F8 



EOR 
STA 
3MP 



MASK 

ORB 

LOOPA 



IF ZERO, GO CLEAR BIT 
IF NOT ZERO, SET BIT 



OUTPUT 



CHANGE ABOVE TO 3MP DELAY TO CHANGE THE 
SAMPLE RATE FROM 40,000 TO 10,000 CPS 
LOCATION 224 = 33 
ALSO CHANGE LOCATION 231. 



0227 AD 02 A4 
022A 29 F 8 
022C EA 
022D 8D 02 A4 
0230 4C 13 02 



LOOPB 



LDA ORB 

ANDIM $F8 

NOP 

STA ORB 

JMP LOOPA 



CLEAR BIT 

FOR TIMING 
OUTPUT 



CHANGE ABOVE TO JMP DELAY TD CHANGE THE 
SAMPLE RATE FROM 40,000 TO 10,000 CPS 
LOCATION 231 = 33 
ALSO CHANGE LOCATION 224. 



0233 A2 ED 

0235 E8 

0236 DO FD 
0238 4C 13 02 



DELAY 
LOOPC 



LDXIM $ED 

INX 

BNE LOOPC 

JMP LOOPA 



96 MICROSECOND DELAY 



MICRO 13:68 



June 1979 



s^^^M 



• 




$375 




Apple II 



$1195 




>Vhich of 

these 
computers 

is for yott? 



SOL-20 



$1600 




Exidy Sorcerer 



$895 



CREATIVE COMPUTING magazine is Num- 
ber 1 in hardware, software and system 
evaluations. In-depth, thorough evaluations 
give you the facts before you buy. Creative 
Computing was the first to review these now 
popular systems: Radio Shack TRS-80, 
Exidy Sorcerer, VideoBratn, Heath H-8, 
Bally Basic, OSt Challenger, and many 
others. More important, we also review 
peripherals and software from independents 
as well as manufacturers. 





Ohio Scientific C2-4P $598 



Radio Shacic TRS-80 



$599 



And wbat are you going 
to do with it? 



CREATIVE COMPUTING has long been Number 1 in 
applications and software for nnicros, minis, and time- 
sharing systems for homes, schools and small businesses. 
Loads of applications every issue: text editing, graphics, 
communications, artificial intelligence, simulations, data 
base and file systems, music synthesis, analog control. 
Complete programs with sample runs. Programming 
techniques: sort algorithms, file structures, shuffling, etc. 
Coverage of electronic and video games and other 
related consumer electronics products, too. 

Just getting started? Then turn to our technology 
tutorials, learning activities, short programs, and 
problem 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 Master 
Charge ac'ceptable by mail or phone; call 800-631-8112 
9 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 cassette 
and floppy disk. 

If your dealer does not carry the full line of Creative 
Computing products, write "catalog" on your order and 
we'd be happy to send you one free. 



GPeatlve computing 



p. 0. Box 7B9-M. Momstown. NJ 07960 



Writing For MICRO 



If you have information you wish to pass 
on to the 6602 connnnunlty, think of 
MICRO first. Since MICRO is devoted 
solely to 6602 nnaterial, your article will 
probably be read by more people than 
it would be in many of the "general pur- 
pose" national magazines. And, MICRO 
pays for articles. You'll never get rich, 
but you can get enough from an article 
to bOy that extra memory you want. Also, 
our policy is to give authors additional 
payments if the material is reprinted. 
For example, authors whose work ap- 
peared in the original six issues of 
MICRO and were reprinted in "The BEST 
of MICRO Volume 1" are receiving 
double payment — so it can add up. 
WHAT TO SUBMIT - MICRO is only 
interested in things which pertain to the 
6602 microprocessor. Since MICRO 
takes the 6602 seriously, it is less in- 
terested in games than in useful material 
such as utility programs, tutorials, re- 
sources, interfacing techniques, and so 
forth. Complete "ready-to-load-and-go" 
programs are preferred to "think- 
pieces". Look at what we have published 
in the past as a guide to what types of 
articles we prefer. 

TEXT — All material should be typed, 
double-spaced on one side on white 



paper. Your name and a page number 
should appear on each page. Try to ad- 
here as much as possible to the format 
that MICRO uses for publication — it 
saves us a lot of work. Paragraphs are 
not indented, sub-headings are center- 
ed, figures are referenced as Figure 1 
(2, 3, . . . n) and tables as Table I (II, III, 
IV, . . . N). You should suggest a title and 
may write a brief summary, although this 
is not necessary. 

PROGRAM LISTINGS - All listings 
should be printed directly from your 
computer if possible, with a new black 
ribbon on plain white paper. If your list- 
ings are clean enough to print, then we 
do not have to typeset them, decreasing 
the chance for typos. Since line numbers 
used by your editor may be removed, 
please make all references to your list- 
ings by address or PC counter. 
DRAWINGS and SCHEMATICS ~ A 
good drawing can add a lot of visual in- 
terest as well as information to your ar- 
ticle. We do not have any special talents 
in this area, plus we may make mistakes 
when redrawing your work. So please, if 
at all possible, submit drawings in ink, 
ready for reproduction. Since most draw- 
ings will be reduced to fit into two 
columns — approximately four inches, 



keep this size in mind when planning 
your work. 

PERSONAL INFORMATION — Our read- 
ers would like to know something about 
the authors. If you submit a short note 
about yourself — your computer experi- 
ence, talents, interests, plans — we will 
publish this along with your article. You 
have done the work, why not enjoy the 
credit! 

RETURN OF MANUSCRIPTS - If you 
want 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 articles 
which we publish. You will be sent a 
Manuscript Release Form prior to your 
article being printed. By signing this 
and returning it to us, you certify that the 
work you have submitted is yours to sell, 
and convey all rights to the work to 
MICRO Ink, Inc. You will receive six 
copies of your article. 
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 of 
using them. They may be submitted in 
almost any form, even hand-written, and 
will be used as the Editor sees fit. There 
Is no payment for these submissions, 
but full credit is given to the author. 



^ 



KIM BUS EXPANSION ! 

AIMT««, VIM™, (SYM)™, KIMT«« OWNERS 

(and any other KIM™ bus users) buy the 
best 8K board available anywhere: 

GRAND OPENING SPECIAL! 
HDE 8K RAM-$169! 3 for S465! 

Industrlal/commefcial grade quality: 100 hour high tamp burn- 
in: low powar: KIM bus compatibta pin for pin: supar quality & 
raliabiflty at below S-100 prices (COMMERrCALLY rated S-100 
boards cost 25-75% mora). When you expand your system, expand 
with the bus optimized for 8 bit CPU's, the Commodore/Mos 
Technology 22/44 pin KIM bus. now supported by Synertek, MTU, 
Rockwell International, Problem Solver Systems, HDE. the Comput- 
erist, RNB, and others! 

KIM-1 computer $179.00: KIM-4 Motherboard $119: power sup- 
ply for KIM-1 alone— $45: enclosure for KIM-1 alone $»: HDE pro- 
totype board with regulator, heatsink, switch address & decoding 
logic included $40.50: book "The First Book of KIM" S9.95: book 
'Programming a Microcomputer: 6502" $8.95: SPECIAL PACKAGE 
DEAL; KIM-1. power supply. BOTH books listed above, ALL for 



HDE FILE ORIENTED DISK SYSTEM (FODS) FOR KIM BUS 
COMPUTERS Make your KIM <or relative) the best 6602 develop- 
ment system available at any price. Expand with HDE's full size 
floppy system with FOOS/Edltor/Assembler. 2 pass assembler, 
powerful editor compatible with ARESCO files KIM bus interface 
card: fast 6602 controlter handles data transfer at maximum IBM 
single density speed for excellent reliability: power supply for 4 
drives: patches to Johnson Computer/Mlcrosott BASIC. 45 day 
delivery. Single drive— $1995 dual drive $2750 

Shipping extra unless order prepaid with cashier's check ALL 
items assembled, tested, guaranteed at least 90 days. 

PlAmBMAN MICRO SY8TBMS (dhr. 5C CorporMkm) 
PjXBmc 1712, Auburn, Al. 38830: (205J745-7735 
3803 Pappfell Pari cw w y, Opi l Mw 
[1-80O«33«7a4) Cotit i nen to l U.8. moant AL 

Dealers for OSI, COMMODORE, COMPUC OLOR . 

ALTOS 



'^ 



aiMMASSOCIATtS 



SHORTY 



MICRO' 13:60 



«,"^° ^LT'"^' ^i?fi, C-1 CASSETTES 

Woodland Hills, Ca. 91367 

• Tarbell Quality 

• "SCOTCH" brand high out- 
put/low noise "POSITRAK" 
bacic treated tape 

• Spring loaded pressure pad 

• 5 screw take-apart shell 

• Exclusive ^ label 

StoclcNo. EAC-10 

CASSETTE LABELS 

5626-6 Blank Fanfold 

5626-8 Blank Fanfold 

CLB-R Blank Sheet 

562 6-B Blank Pack 

EA-EBEA Printed Pack 

CLP-R Printed Sheet 

MAILING LABELS 

4815-1 2yaKl5/16 

5615-1 3Vax15/16 




$13.50/10 


$26.00/20 


i 6 Lines/Inch 


$5.90/100 


i 8 Lines/Inch 


5.90/100 


15/She«t 


6.20/ 90 




4.00/100 


EA Ubel 


5.50/100 


15/Sheet 


7.50/ 90 


Fanfold 


$4.40/1000 


Fanfold 


4.40/1000 



VOLUME AND DEALER DISCOUNTS AVAILABLE 



STOCK NO. 



QUANTITY 



PRICE 



Name 




Cal. Tax 6% 


Address 


City 




State 2 


Exp. Date 


Bank No. 




Card No. _ 






Signature 



TOTAL 



Zip 



rn 



PREPAID ORDERS SHIPPED POSTPAID 



D 
D 



June 1979 



Reading Pet Cassettes Without a Pet 



If you have ever wanted to read a program from a 
cassette written for one 6502 based microcomputer on 
another type, here is an example which uses a SYM-1 to 
read a PET cassette. The concepts can be generalized to 
work with almost any combination of micros. 



One of the basic problems in obtaining 
microcomputer software is not that it 
doesn't exist but that it was written for a 
machine other than the one it is to be 
used on. Small programs can be typed in 
by hand if a hex listing is available, but 
larger programs are generally distributed 
on audio cassettes. By virtue of their 
popularity, the Apple II and PET have the 
largest pools of published software on 
cassette, but that doesn't mean that 
owners of less well established 
microcomputers like the SYM-1 cannot 
take advantage of existing programs 
written for these machines. 

All 6502 based microcomputers except 
the KIM use very simple cassette inter- 
face hardware and let the processor do 
all the work of formatting, encoding and 
decoding cassette data. This approach 
has the dual advantages of reducing 
parts count and increasing flexibility and 



it means that with suitable software, 
users of any particular machine can read 
cassettes written for any other machine 
(Apple, PET, OSI, AIM, or SYM), This par- 
ticular program runs on the SYM-1 and 
reads cassettes written by the PET. It is 
quite unsophisticated, and doesn't know 
the difference between various block 
types such as Beginning of File, End of 
File, Program, and Data blocks, and it 
does not strip off countdown bytes or 
verify checksums. It does check byte 
parity and will flag any errors; it has been 
my experience that if there are no parity 
errors, then the data is OK. 

Because the task of converting software 
from one machine to another is non- 
trivial, it is assumed that only exper- 
ienced programmers will have occasion 
to use PETCAS, thus no attempt will be 
made to explain the program's operation 
or PET cassette format in detail; however 



David P. Kemp 
1307 Beltram Court 
Odenton,MD 21113 



one feature of the program deserves 
some comment -- the tuning dispay. If an 
oscilloscope and a D/A converter are 
available, the display simplifies setting 
up the program and the recorder con- 
trols. With the program running and a 
PET cassette playing, the scope trace 
should fall into three distinct levels cor- 
responding to the three possible time 
periods between active transitions on 
the tape. If the display is not well 
clustered or the routine will not work, 
try exchanging the instructions at loca- 
tions $6C and $66. (In PET cassettes 
polarity is significant and this modifica- 
tion effectively reverses the audio signal 
polarity). 

Despite its small size, the program 
works quite well - it was originally writ- 
ten to read a third generation analog 
dubbing of an 8K program, and it ac- 
complished that task in one pass 
without an error. fd 



NOW AVAILABLE Basic Software 

ForSOL-IIAandPET-8K 



General Pack 1 

(Checkbook Balancer, Tic Tac Toe, Metric 

Conversion) $10.95 

General Pack 2 

(Space Patrol, Biorhythm, Battlestar, One-Armed 

Bandit) 18.95 

Finaneial Pack 1 

(loans, Depreciation, Investments) 12.95 

Finaneial Paek 2 

(Mortgage & Loan Amortization, Future 

Projections, Risk Analysis) 12.95 

Statistics Pack I 

(Mean & Deviation, Linear Correlations & Regression, 
Distribution, Contingency Table Analysis) 18.95 

Game Paek 1 

(Basketball, Object Removal, Bowling, Darts, 

Gopher) 22.95 

(New York residents add applicable sales tax) 



Game Pack 2 - 

(children - educational) 
(Arithmetic Cod, Addition Dice, Distance = 
Rate X Time) 



12.95 



Tape Data Query 

(File Management System) 

PCROS - a Real-Time Operating 
System in IK KIM RAM 

Assembly listing 

Cassette tape with user's manual 
Schematic for relay control board 

All programs on high-quality cassette tape. 



50.00 



24.95 

14.95 
9.95 



June 1979 



Send self-address, stamped envelope for 

complete software catalogue. 
Send check or money order to: 

H. CELLER COMPUTER SYSTEMS 
Dept. M 
P.O. Box 350 
Jslevy^ork^e^oryw^) 



MICRO !13:61 



PET CASSETTE READ ROUTINE FOR SYM-1 



BY DAVE KEMP 
JANUARY 1979 

PETCAS READS A PET FORMAT CASSETTE RECORD 
AND STORES THE DATA IN A BUFFER STARTING AT 
$200. TO RUN IT, TYPE: 



.G 

CONTROL IS RETURfED TO SUPERMON AFTER THE 
FIRST COPY OF THE DATA HAS BEEN READ. 
LOCATIONS ADH AND ADL POINT TO THE NEXT 
FREE BUFFER 1.0CATI0N (LAST BYTE READ + 1). 



0075 




ADL 


* 


$00F0 


0075 




ADH 


* 


$00F1 


0075 




TCNT 


* 


$00F2 


0075 




TPAR 


* 


$00F3 


0075 




PECNT 


* 


$00F4 


0075 




PAR 


* 


$00FE 






VALUE 


ARBITRARY 


0075 




TAPE 


* 


$A000 


0075 




DIGANA 


* 


$A001 


0000 






ORG 


$0000 


0000 A9 


02 


PETCAS 


i LDAIM 


$02 


0002 85 


Fl 




STA 


ADH 


0004 85 


F4 




STA 


PECNT 


0006 A9 


00 




LDAIM 


$00 


0008 85 


FO 




STA 


ADL 


OOOA 20 


2F 00 


PETCA 


3SR 


GBYTE 


OOOD 30 


03 




8MI 


PETX 


OOOF 4C 


00 00 




aMP 


PETCAS 


0012 C6 


F4 


PETX 


DEC 


PECNT 


0014 DO 


F4 




BNE 


PETCA 


0016 20 


2F 00 


PETC8 


JSR 


GBYTE 


0019 30 


F8 




BMI 


PETCB 


0018 80 


04 


PETCC 


8CS 


PETCD 


OOID A9 


FE 




LDAIM 


PAR 


OOIF E6 


F4 




INC 


PECNT 


0021 91 


FO 


PETCD 


STAIY 


ADL 


0023 E6 


FO 




INC 


ADL 


0025 DO 


02 




BNE 


PETCE 


0027 E6 


Fl 




INC 


ADH 


0029 20 


2F 00 


PETCE 


JSR 


GBYTE 


002C 10 


ED 




BPL 


PETCC 


002E 60 






RTS 





BUFFER POINTER 

GETBIT TEMPORARY 

PARITY GENERATOR TEMPORARY 

PARITY ERROR COUNT 

PARITY ERROR MARKER 



CASSETTE INPUT PORT (PB6) 

DIGITAL TO ANALOG CONVERTER OUTPUT 



SET BUFFER ADDRESS TO $0200 



• 



GET A BYTE 

LEADER NOT STABLE YET 
BE SURE LEADER IS VALID 

GET BYTE 

LOOP UNTIL END OF LEADER 

DATA VALID ? 

NO - PARITY ERROR 

INCREMENT ERROR COUNT 

SAVE IT IN BUFFER 

ADVANCE BUFFER POINTER 



GET ANOTHER BYTE 
CONTINUE IF DATA 
EXIT IF SHORTS 



GET A BYTE OF PET DATA 



MICRO 13:62 



RETURN: 



Jun«1979 



A = BYTE 

C r IF PARITY ERROR 

N = 1 IF SHORTS 

X CLOBBERED, Y = 



002F AO 


11 




GBYTE 


LDYIM 


$11 


SHORTS COUNT 


0031 20 


63 


00 


GBA 


JSR 


GETTR 


GET TRANSITION TIME 


0034 EO 


40 






CPXIM 


$40 


START BIT ? 


0036 BO 


08 






BCS 


GBB 


YES - GO GET BYTE 


0038 EO 


2C 






CPXIM $2C 


SHORTS ? 


003A BO 


F3 






BCS 


GBYTE 


NO - START COUNTING AGAIN 


003C 88 








DEY 




YES - DECREMENT COUNT 


003D ID 


F2 






BPL 


GBA 




003F 60 








RTS 






0040 AO 


09 




GBB 


LDYIM $09 


BIT COUNT 


0042 84 


F3 






STY 


TPAR 


INITIALIZE PARITY 


0044 20 


63 


00 




JSR 


GETTR 


GET OTHER HALF OF START BIT 


0047 20 


58 


00 


GBC 


JSR 


GETBIT 


GET A DATA BIT 


004A 90 


02 






BCC 


GBD 




004C E6 


F3 






INC 


TPAR 


ADJUST PARITY 


004E 6A 






GBD 


RORA 




PACK IT 


004F 88 








DEY 




DONE ? 


0050 DO 


F5 






BNE 


GBC 


NO 


0052 2A 








ROLA 




YES - ADJUST DATA 


0053 49 


FF 






EORIM 


$FF 




0055 46 


F3 






LSR 


TPAR 


PUT PARITY IN C 


0057 60 








RTS 







GET A DATA BIT 



0058 20 63 00 
005B 86 F2 
005D 20 63 00 
0060 E4 F2 
0062 60 



RETURN: 
C = BIT 
X CLOBBERED, A & Y UNCHANGED 



GETBIT JSR 
STX 
JSR 
CPX 
RTS 



GETTR GET FIRST TRANSITION 

TCNT SAVE IT 

GETTR GET SECONT TRANSITION 

TCNT GENERATE BIT IN C 



GET A TRANSITION PERIOD 

RETURN: 
X = PERIOD 
A & Y UNCHANGED 



^ 



0063 A 2 00 
0065 2C 00 AO 

0068 E8 

0069 70 FA 

00 6B 2C 00 AO 
006E E8 
006F 50 FA 
0071 8E 01 AO 
0074 60 



GETTR LDXIM $00 INIT COUNTER 



GETA 



GETB 



BIT 
INX 
BVS 
BIT 
INX 
BVC 
STX 
RTS 



TAPE 

GETA 
TAPE 



INCREMENT COUNTER 
LOOP WHILE HIGH 



GETB LOOP WHILE LOW 

DIGANA OUTPUT TO D/A FOR TUNING 



Jurw 1979 



MICRO, 13:63 



c 



CONNECTICUT microCOMPUTER, Inc. 

150 POCONO ROAD - BROOKFJELD, CONNECTICUT 06804 
(203) 775-9659 



Djig 

lYI 



# 



r RS-232 "H 

L MOD J 




PET IMTERFACE / X^ 
KIMMOD \A-\ 



RS'232 
INTERFACE MODULE 




6PIB(IEEE-4e8) 
INTERFACE MODULE 







rt I I I I I I M 



TRS-80 INTERFACE 
ETC. 



MANUAL AND 
DISPLAY MODULE 



]^L.rrpp'] — L 




C 
ANAMANl^ ] 

Innnnn^ 



ANALOG 
MANIFOLD 
MODULE 



SENSORS 

• TEMPERATURE 

• VELOCITY 

• PRESSURE 

• db 

• pH 

• ACCELERATION 

• HUMIDITY 

• LIGHT LEVEL 

• FLUID LEVEL 

• ETC. . . 



DAM SYSTEMS by CmC 
A ccMPlett fiVftlff* of Mdults to let wour co«Puter listen 
to the rttl world* 



DAM SYSTEMS PRICE LIST 



DAM SYSTEMS comp-onents 



AIM161 - Analog Inp-ut Module 
U 8^il anslos inrais - 100 licrosectind conversion tlK - 
3 sUU oulwi - rmirM one 6-bii comiler oulnit port 
for control and one 8-bii cornier irmit nrt for diia» 

AIM1A2 - Analog Input Module 
te above plus* A^eeicr accuracy - dold plslcd contacts - 
nlot liriit - stdtch selectable start* enable and readv 
Mlarities. 

POUl - Power Module 
Supplies pouer for one AIHIA aodkile* 



ICON - InRut Connector 
For cooncctimi analog inputs to the AIH16 • 
cd* coRoector - solAr ewelets* 



20 Pin cvd 



OCON - Output Connector 

For cannectiiMt tic AUU& to a cooNler - 20 rin card cdft 
comector - soldr welett* 

MANMODl - Manifold Module 

Dm in Place of ICON. Screw lerunsl barrier strips for 
connecting JwstickSf PotentioHtcrst voltaiie soirees* etc* 
Eliiinitct the need for soldering* Plugs into the AfiUd. 

ANAMANl - Analofil Manifold Module 
(lie ia Place of ICON* Connects OM SrSTENS SENSORS to ti» 
AIHIA Hithout coldriftg - sensor cables Just plug in* Plugs 
into the AOlU or \im I 



SENSORS 

Smsots for tesMratirtf pressuref flow huiiditv* level i 
pHf ■otioni etc* 

COMPUTER INTERFACES 

For the PETf lOlff 11tS-60f etc. Use in place of XQN. 
EliuMlM the Mid for soldr ing or vKial construction* 

PETMOD - PET Interface Module 
CiVM Un IEEE PorUr one user port and one SMI SY5TEH5 
interface port. Saws veer and tear on the PET's printed 
circuit board* Also called tiw Vmm> 



*.t79«00 

*249.00 

*14»95 
♦9.95 

♦9.95 

♦59.95 

TEA 

TBA 



TBA 



♦49.95 



TBA 



♦19.95 



KIMMOD - KIM Interface Module ♦39. 9S 

Ciws one application connector port and one UAH SYSTEMS 
interface port. 

CABLE "A" - Interconnect Cables 
ConnecU coentfl' interface to AIH16f NANDISli XPMSRli 
etc* 

CABLE A24 - Interconnect Cable 
24 inch cable with intvface connectar on one end and an 
QCOf eouivalent on the other. 

MANDISl - Manual Qnt:i DisF-law Module TBh 

Connects bettwen the MHIA and the coenilv interface. 
Allows Hnval or coaputer control of the AIiU6. Displaw 
channel mabcr and data* 



GPIB MOD - GPIB < IEEE-488 ) Interface TBA 

Alloys the IM STSTEMS HQUES to be used uith the GPIE bus 
instead of a coepuler's other I/D ports* 

RS232 MOD - RS232 Interface Module TBA 

AlloHS the MH SYSTEMS HQOULES to be used irith an RS-232 
port or tiraunl. 

XPANDRl - Eyif^stVider Module TBA 

Allows UP to 128 9-bit analog inputs (9 AlftU Hodules) to 
be connected to one swtc»* 



DAM SYSTEMS sets 



AIM161 Starter Set 

IncludH one AIlUAlf one PWli one ICON and one KON, 

AIM162 Starter Set 

IncludK one Aim62f one PWlf one ICON and one OOM. 

PETSETla 

Includes one PETNSr one CABLE A24r one PmiU one POUl ( 



KIMSETla 

Includes one KSfOD* one CABLE A2*f one Aim^lf one POUl i 
oneNAMCBl* 



♦189.00 
♦259.00 
♦295.00 

♦2B5.00 



APPLE II® PROFESSIOIMAL SOFT\A/ARE CTZ 



PIE TEXT EDITOR 

PIE (PflOGRAMMA IMPROVED EDITOR) 
li 8 two-dimensional cursor-based editor 
(••^ad specif ically fotjise with memory- 

jd and cursor-basea CRT's. It is totally 
Qihtfrent from the usual line-based editors, 
which were originally designed for Teletypes. 
The keys of the sy item input keyboard are 
aiiigned specific PIE Editor function 
commands. Some of the features included in 
the PIE system are: Blinking Cursor; Cursor 
movement up, down, right, (eft, plus tabs; 
Character insert and delete; String search 
forwards and backwards; Page scrolling; 
GOTO line number, plus top or bottom of 
file; Line insert and delete anywhere on screen; 
Move and copy (single and multiple lines); 
Append and clear to end of line; Efficient 
memory usage. The following commands 
are available in the PI E Text Editor and each 
is executed by depressing the systems argu- 
ment key simulatanaousiy with the command 
key desired: 
[LEFT] Move cursor one position to 

the left 
[RGHT] Move cursor one position to 

the right 
[UP] Move cursor up one line 

[DOWN] Move cursor down one line 
[BHOM] Home cursor in lower left 

left hand corner 
[HOME] Home cursor in upper left 

hand corner 
I-PAG] Move up {toward top of file) 

one "page" 
[-f-PAG] Move down (toward bottom 

of file) one "page" 
[LTAB] Move cursor left one 

horizontal tab 
[RTAB] Move cursor right one 

horizontal tab 
IGgTO] Go to top of file (line 1 ) 

^jjnlGOTO] Go to line 'n' 
\ :] Go to bottom of file 

(last line + 1 } 
[-SCH] Search backwards (up) into 

file for the next occurence of 
the string specified in the last 
search command 
[ARG]t[-SCH] Search backwards for 

string 't' 
[4SCH1 Search forwards (down) into the 

file for the next occurence of the 
string specified in the fast search 
command 
[ARG] t[+SCH] Search forward for string 't' 
[APP] Append -move cursor to last 

character of line +1 
[INS] insert a blank line beforere 

the current line 
[ARG] n [INS] Insert 'n' blank lines before 

the current line 
[DEL] Delete the current line, saving 

it in the "push" buffer 
[ARG] niOEL] Delete 'n' lines and save the 
first 20 in the "push" buffer 
[DBLK] Delete the current line as long 

as it is blank 
[PUSH] Save 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 mode 

[CINS] [GINS] Turn off character insert mode 
[BS] Backspace 

[GOB] Gobble - delete the current charac- 

ter and pull remainder of characters 
to right of cursor left one position 
[EXIT] Scroll all text off the screen and 

exit the editor 
^Mifil [HOME] Home Una - scroll up to 
'^ move current line to top 

of screen 
[APP] [APP] Left justify cursor on current 

line 
[ARG] [GOB] Clear to end of line 
Apple PIE Cassette 16K $19.95 
TRS-80PIE Cassette 16K 19,95 



6502FORTH 
6800 FORTH 



Z-80FORTH 



FORTH is a unique threaded language that is 
ideally suited for systems and applications 
programming on a micro-processor system. 
The user may have the interactive FORTH 
Compiler/Interpreter system running stand- 
alone in 8K to 1 2K bytes of RAM. The 
system also offers a buift-in incremental 
assembler and text editor. Since the FORTH 
language is vocabulary based, the user may 
tailor the system to resemble the needs and 
structure of any specific application. 
Programming in FORTH consists of defining 
new words, which draw upon the existing 
vocabulary, and which in turn may be used 
to define even more complex applications. 
Reverse Polish Notation and LIFO stacks 
are used in the FORTH system to process 
arithmetic expressions. Programs written in 
FORTH are compact and very fast. 



SYSTEM FEATURES & FACILITIES 

Standard Vocabulary with 200 words 

Incremental Assembler 

Structured Programming Constructs 

Text Editor 

Block 1 /O Buffers 

Cassette Based System 

User Defined Stacks 

Variable Length Stacks 

User Defined Dictionary 

Logical Dictionary Limit 

Error Detection 

Buffered Input 



CONFIGURATIONS 

Apple FORTH Cassette 16K $34,95 

AppleFORTH Disk 32K 49.95 

Pet FORTH Cassette 16K 34.95 

TRS-80FORTH Cassette 16K 34.95 

SWTPC FORTH Cassette 16K 34.95 



ASM/65 EDITOR ASSEMBLER 

ASM/65 is a powerful, 2 pass disk-based 

assembler for the Apple 11 Computer System. 
It is a compatible subset of the FORTRAN cross- 
assemblers which are available for the 6500 
family of micro-processors. A$M/65 features 
many powerful capabilities, which are under 
direct control of the user. The PIE Text Editor 
co-resides with the ASM/65 Assembler to form 
a comprehensive development tool for the 
assembler language programmer. Following 
are some of the features available in the 
ASM/65 Editor Assembler, 

PIE Text Editor Command Rapetoira 

Disk Based System 

Decimal, Hexadecimal, Octal, & Binary 

Constants 
ASCII Literal Constants 
One to Six character long symbols 
Location counter addressing "*" 
Addition fit Subtraction Operators in 

Expressions 
High-Byte Selection Operator 
Low-Byte Selection Operator 
Source statements of the form: 

[label] [opcode] [operand] 

[;comment] 
56 valid machine instruction mnemonics 
All valid addressing modes 
Equate Directive 
BYTE Directive to initialize memory 

locations 
WORD Directive to initialize 16-bit words 
PAGE Directive to contrt)! source listing 
SKIP Directive to control source listing 
OPT Directive to set select options 
LINK Directive to chain multiple text files 
Comments 
Source listing with obiect code and 

source statements 
Sorted symbol table listing 



CONFIGURATION 



Apple It 



48K/Disk 



$69.95 



LISA INTERACTIVE ASSEMBLER 

LISA is 3 totally new concept in assembly language programming. Whereas all other assemblers 
use a separate or co-resident text editor to enter the assembly language program and then an 
assembler to assemble the source code, LISA is fully interactive and performs syntax/addressing 
mode checks as the source code is entered in. This is similar in operation to the Apple II Integer 
BASIC 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 those 
in BASIC. Commands that are included are: LIST, DELETE, INSERT, PR ^, 1N^, SAVE, 
LOAD, APPEND, ASM, and a special user-defineable key envisioned for use with "dumb" per- 
ipherals. LISA is DISK II based and will assemble programs with a textfile too long to fit into 
the Apple memory. Likewise, the code generated can also be stored on the Disk, hence freeing 
up memory for even larger source programs. Despite these Disk features, LISA is very fast; in fact 
LISA is faster than most other commercially available assemblers for the Apple IL Not only is 
LISA faster, but also, due to code compression techniques used LISA requires less memory 
space for the text file. A full source listing containing the object and source code are produced 
by LISA, in addition to the symbol table 
Apple II 32K/Disk $34.95 



Apple PIE Disk 



32K 24.95 



PROGRAMMA 
IIMTERIMATIONALJNC. 

3400 Wilshire Blvd. 
Los Angeles, CA 90010 

(213) 384-0579 • 384-1116 • 384-1117 

Apple 11 is a registered trademark of Apple Computers, Inc. These professional products 
are available at your local computer dealer. 



\i\ 







NEW HEALTH INTEREST PROGRAMS . . . 

VitaFocir by ^^eokeosy 



TRS~80 
APPLE 

and others soon 



• Heart Attacks 

• Blood Pressure 

• Adolescence 

• Teenage Drinking& Drugs 

• Birth Control 

• Talking About Sex 




For Everyone — 
YOUTH 
ADULTS 
PARENTS 

Speakeasy VitaFacts prosrams contain up-to-daie 
factual medical information presented in lavtnan's 
terms about important aspectsof your life and health 
needs. By participating you gain: 

— improved knowledge of medical situations, con- 
tributing to an improved lifestyle, better family 
communication and cooperation and belter health. 

— awareness and appreciation of modern life's 
stressful situations and how to cope with them. 

— a better understanding of family or friends' health 
problems. 

— a heightened sense of I he joy of learning. 



Help yourself — your family your friends to better 
health with the new Speakeasy VitaFacts Series 
learning programs! 

These professionally-prepared programs include an 
audio cassette, a computer cassette and a booklet . They 
are available through hundreds of computer stores 
worldwide at very reasonable prices. Please check with 
your dealer or contact Speakeasy VttaFacts. 



DEALERS: Please call us at the number below for the 
name of your distributor. 



MICROCOMPUTER-ASSISTED INSTRUCTION 
FOR HEALTHFUL LIVING! 

VitaFoct>"b, ^eokeosu "^ 

(613)258-3291 



Box 909 Kemptvtilc, Ontario, Canada KOG IJO 



J