Skip to main content

Full text of "Micro 6502 Journal Issue 20"

See other formats


' APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM A 
I ATARI SYM OSI A TARI AIM PET KIM APPLE SYM APPLE KIM 

KIM ATARI SYM OSI ATARI AIM C^t KTTi'' 

JSI SYM ATARI PET APPLE OSt AIM t*j ■/ 1 ■ ' 
5VM AIM APPLE KIM PET AIM ATA f 
<.IM PET APPLE AIM APPLE ATARI t 
\PPLE OSI KIM AIM SYM OSI PETATmF9mtm>t'^Rt 
MM APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM A 
I TARI SYM OSI ATARI AIM PET KIM APPLE SYM APPLE KIM 
a ET KIM ATARI SYM OSI ATARI AIM PEJ^M /r^iE A 

i *+1 

7ARI ( • J 

M PET APPLE AIMWPmMA^fti KIM^^L 

\PPLEOSI KIM AIM SYM OSI PET ATARI SYM OSI ATARI AIM 

\AIM APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM A 

{ATARI SYM OSI ATARI AIM PET KIM APPLE SYM APPLE KIM 





TARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM KIM Apt 
PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM 
KIM OSI PET SYM APPLE KIM PET Alh 
AIM PET KIM APPLE AIM APPLE AT 
KIM APPLE PET ATARI SYM OSI AT/ 
PET AIM A TARI OSI SYM A TARI PE7 
SYM PET OSI KIM ATARI APPLE AT. 
TARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM KIM API 
PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AW, 
ATARI KIM OSI PET KIM OSI PET SYM APPLE KIM PET Alh 
Rl 5WOSI ATARUUAU>EJ KWI APPLE AIM APPLE AT 

osi MiwmMAWMmWkMtJ\M atari sym osiat, 
t s IIAIiiilfiilfflnis/ symata ri pe i 

PET KIM APPLE AIM AIM SYM PET OSI KIM ATARI APPLE AT. 
TARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM KIM APF 

a LE OSI AIM KIM AI!>J 



Human Physiological Parameters 




LET YOUR 
MICRO HELP YOU 
GET INTO SHAPE 



[AIM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM KIM APPLE PET A TARI SYM OSI ATARI A 

tPET APPLE AIM APPLE ATARI KIM APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APR 

\E OSI KIM AIM SYM OSI PET ATARI SYM OSI ATARI AIM PET KIM APPLE AIM AIM SYM PET OSI KIM ATARI APPLE ATARI K 

APPLE ATARI KIM OSI PET SYM AtfLMKItLfWMM ^ttlJUf ATARMP&tfW^ 1 AIM KIM AIM KIM APPLE P 

<IMAVQtJb*Md$*TARtAIM l UTJfl41S^# #A WMl WMOSI pmt9&P%mYMAPPLEh&&MlAT/ 

>YM A TARI PET APPLE OSI AIM KIM AIM KIM APPLE PET ATARI SYM OSI A TARI AIM PET KIM APPLE AIM APPLE A TARI C 

J AIM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OS! AIM KIM AIM KIM APPLE PET ATARI SYM OSI ATARI A 

\PET APPLE AIM APPLE ATARI KIM APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APP 

\E OSI KIM AIM SYM OSI PET ATARI SYM OSI ATARI AIM PET KIM APPLE AIM AIM SYM PET OSI KIM ATARI APPLE ATARI j j 



softside 
software 

305 Riverside Dr " " •~-^--"""" -^^ 

tit 



305 Riverside Drive New York. N.Y. 10025 




program. 



1 GRAPHICS PAC 2 Quadruple your PET's graphic resolution. Why be 

New Version stuck with the PET's cumbersome 25 x 40 1000 point 

display. With Graphics Pac you can directly control 
(set and clear) 4000 points on screen. It's great for graphing, plotting, and gaming. Graphics 
Pac allows you to plot in any combination of two modes: 4 Quadrant graphing with (0,0) center 
screen, and Standard graphing with (0,0) plotted in the upper left hand corner. Complete docu- 
mentation shows how you can merge this useful routine with any of your own programs with- 
out retyping either one! All this on a high quality Microsette for only $9.95. 

2 ASSEMBLER 2001 A full featured assembler for your PET microcompu- 

ter that follows the standard set of 6502 mnemonics. 
Now you can take full advantage of the computing 
abilities of your PET. Store and load via tape, run through the SYS or USR functions. List and 

edit too with this powerful assembler. No other commercial PETassembler gives you all these 
features plus the ability to look at the PET'S secret Basic ROMs all in one program. This valu- 
able program is offered at $15.95 



3 BIKE An exciting new simulation that puts you in 

charge of a bicycle manufacturing empire. Juggle 
inflation, breakdowns, seasonal sales variations, 
inventory, workers, prices, machines, and ad campaigns to keep your enterprise in the 
black. Bike is dangerously addictive. Once you start a game you will not want to stop. To 
allow you to take short rest breaks. Bike lets you store the data from your game on a tape 
so you can continue where you left off next time you wish to play. Worth a million in fun, 
we'll offer BIKE at $9.95. 

4 Dynamic usage of the PET's graphics features 

when combined with the fun of the number 1 arcade 
game equals an action packed video spectacle for 
your computer. Bumpers, chutes, flippers, free balls, gates, a jackpot, and a little luck 
guarantee a great game for all. $9 95. 

Authors: Our royalties are unbeatable 



itttrkirk MUSICAL MADDNESS ttrkirtrk 
SPECIAL add an exciting new dimension to your PET computer 
with Soundware's soundsational music box 
and sonicsound software from Softside & Soundware 



SOUND 



& THE SQUNDWORKS -& 
The Soundware music box for your PET 
comes complete with controllable volume, 
an earphone jack, a demo tape with two 
programs, an instruction book, and a one 
year warranty, this sturdy unit is enclosed 
in an attractive plastic case. Notes tell 
how to program your own sound effects. 
All this during our musical madness for 
just 29.95 

WORD FUN: Speller: fun ways to practice 
spelling + Scramble + Flashcards 9.95 



& MUSICAL SOFTWARE & 
ACTION PACK: Breakthru + Target + 
Catterpillar: non stop graphic action 9.95 
PINBALL: a video action spectacle with 
real time flippers, chutes gates, bumpers, 

tags etc 9-95 

CLASSICS: Checkers + Backgammon 
Board +Fiano Player; checkers vs. com- 
puter or friend. Piano plays Minute Waltz 

9.95 
MUSIC MANIA: Try to repeat a growing 
sequence of tones. With graphics. Chal- 
lenge to the best ear 9.95 




Skylcs Electric Works 



The BASIC Programmer's Toolkit 

For PET Owners Who Want More Fun 
And Fewer Errors with Their Programming 

Here are Ten Comands you'll need, all on a single chip you can install, 
in a minute without tools, on any PET or PET system. 2 KB of ROM 
firmware on a single chip with a collection of machine language 
programs available to you from the time you turn on your PET to the 
time you shut it off. No tape to load or to interfere with any running 
programs. 



AUTO DELETE 
STEP OFF 



RENUMBER HELP TRACE 
APPEND DUMP FIND 



10 GOSUB 99 

15 PRINT I 

16 GOTO 10 
99 INPUT J 

100 IF J=0 THEN END 
200 l = SQP. JuRETURN 
READY 

RENUMBER 100.10 



100 GOSUB 130 
110 PRINT I 
120 GOTO 100 
130 INPUT . 
140 IF J = THEN END 
150 l = SQRIJi:RETURN 
READY. 



ON BY ZERO ERROR IN 500 





Can be placed in main board socket or with precision-engineered PCB 
connector to attach to data bus... depending on the model of your PET 
and additional memory systems. 

Now available to interface 

8N/8B, 16N/16B, 32N/32B PET... chip only $50.00* 

2001-8.. .chip and interface PCB 80.00* 
With Expandamen, PME 1 

R. C. Factor or Skyles Electric Works systems 80.00* 

With Computhink Disk System 85.00* 
With Commodore's Word Processor II, for original 2001-8 PETs 90.00* 

With Commodore's Word Processor II, for new PETs 72.50* 

With Skyles Macro TeA 50.00* 

'Shipping and handling, California sales tax where applicable must be added. See order 
form attached. 

'California residents: please add 6% or 6.5% sales lax as required 
VISA, MASTER CHARGE ORDERS CALL (800) 538-3083 (except California residents) 
CALIFORNIA ORDERS PLEASE CALL (408) 257-9140 




Skyles Electric Works 



10301 Stonydale Drive 
Cupertino, California 95014 
[408]735-7891 



16K MEMORY 




K-1016 

ADDRESSED AS CONTIGUOUS 16K 
STARTING AT ANY 8K BOUNDARY 
LOW POWER — 1.6 WATTS TOTAL 
K-1016A — $340 6 MONTH 
WARRANTY 



SYSTEM EXPANSION 




12 PROM SOCKETS — 2708/TMS 2716, 
USES THE POWER OF ONLY 1 PROM. 
32 BIDIRECTIONAL I/O LINES 
FULL RS-232 ASYNC SERIAL 
COMMUNICATIONS, 75-4800 BAUD 
PROM PROGRAMMER 
K-1012A — $295 



881 



EXlSWIISIiQil 



HIGH RESOLUTION 
GRAPHICS 




320 x 200 BIT MAPPED GRAPHICS 

8K RAM AVAILABLE FOR USE 

EACH POINT INDIVIDUALLY 

ADDRESSABLE 

K-1008A — $240, PET — $243 

(PLUS PET INTERFACE) 



MULTI-HARMONIC 
4 VOICE MUSIC 





K-1002-2 K-1002 

MODEL FOR ALL PETS MODEL FOR KIM, AIM, SYM 

• FORIER SYNTHESIZED WAVEFORMS 
— UP TO 16 HARMONICS 

• 4 VOICES PLAY SIMULTANEOUSLY 

• QUALITY D/A CONVERTER, 6 POLE 
FILTER AND AMPLIFIER 

• HARDWARE — $40-50, 
SOFTWARE — $20 









Sip 



fe*S*i 




m*m 



MesupniEawnHFua oOcumentA: 

CSfSfTHE HWVCTRY-V MANUALS MAY 
iWtY... • -•-■',,.■•.. . 



Micro Technology Unlimited 

p.o. Box A&aeMt&t^fy** ■ - r 

Manchester N.H. Q3tt»?."* W : ^X -\ "'■ 
603-627;i464 ;■:;'.' .;'...', Jii^M : ; :X-? ;:j 

Call Or Write For Our Pu\£ite&£aia^ 



mm 



1 i^JJ s;j u j 



January 1980 
Issue Number 20 



Table of Contents 

Tape Execute File • Create and Use 

by Alfen J. Lacy 
Why A piT.APRtE, 6502 BASIC Compiler? 

by Bruce M. Beach 
Human Physiological Parameters 

by. Dr. L. S. FJeich 
Lifetime of a Non-Renewable Resource 

by Marvin L IpeJong 
\ Editorial ~ Thejtbneiiness of the Microcomputer 
Sweetie Programming Using Macros '■' l 

i";:bi^FJ^rtfXa?VileV'ii>r. : - ■'''■■''*■/'■' 

$creeh;WrTte/R|e Routine ■ 
:' by fa^E^Etaxter '".- 
SYWt-*Tapeyer||ication 

by Jack. Gteruic *,'* ; 

Microbes ami Miscellanea ;' 
SymjSottabteSirter/Printerfor the AIM Assembler 

I Trig l^»C%i^ftware Catalogue: XVi . . ■■ ' 

i. ' >by|l^®f^>wer : , ,"-;■"" »'■ . j: ''■'•<. .;'"'i"- i ■-■•< 

SeafcrtrCha^eHi Applesoft ^ • ---M >■-''. • 

K / : &&^*rfij#ei»' ' , : " "", ; ■?. i- v i- • > ; ; 

SYM-t Staged Loading Technique for Segmented Programs 

j^'-b£^b^Afl»ek:,.,- '':;-i r:'- ' "U . : : : . ; 

6502 Bibliography: PartXVI f J 

by Vtflif^im R.fDiat 



5 

9 

15 

it; 

23 
25 

30 

35 

39 
43 

! 5i:l 

I'55'J 
59 
61 



mm 



Staff 

Edltm/Publisher 

Robert M.Tffpp ;'^'| 
Assistant Editors ., :] 

Mar^yKm^GurK^l./i 
Evelyn MiiH^&ft^ : '\ 
Business Martageir 

• Maflgi&'E'Efilfefe';''- 
Circulailort Managst- 

ProduetfonAssislant 

L Catherine f^and- 



For air iMK\a^o^t^>ndamMl'^*3r'''' 
! I jiiiiii ciii miliii'i il|ji.liinlt>'Wjti!li|ljiiiV.^i|ir<i fii A 
HKMW. Pkk liiTii "pliftMri iiro'i WiC'rfif*''' 

01824. c> ; H: ^' ^,f^?Jl^» |iC : 

i-iNiLincy;. ';, i- t" '! ;^v^w. "/■ 



Andromeda Compuff r Systems 

Apple Sttoppe 

Balcan 

Beta Computer Defies 

c&h Micro . ,,; 

Classified Ads ' 

COMPAS r 

The Computerfat, Infe. 

Computer World 

Connecticut micro$vnputers 

Excert t Inc. 

Galaxy ■■•'•'•'' 

H. Geller CornputerfSysterns 

Home Computers 

Hudson Digltat-Efetirohics 1 

Information Unttmii ad Software 

MICRO v.rr.->:- --.,... 

Micro-Music,' Inc. 



mmm 



Advertiser's Index 



Sh 



\ 



50 


i ; Micro Technology Unlimited ■ ^. ;: 


4"*#!^ : 2i!B*':- 


>j,yf ' S* 


'!. . ' Mighty Byte Computer, inc. , 


•"•"•' mv< s& 


58 


MuseSottware ' .*■..>"'> 


'"•' V *A :',"', BS 


37 


On-Line 


•J'..&f*s«^*<fe 


48 


i Perry Peripherals 


--*:■'*•/.. r- 54: 


22,37 


Powersoft, Inc. 


...-i?i-^ '4 


v 8 


Programma. International --■,•; 


•^■^••^.■•■if-BG 


%«'<•' 


Progressive Software '.-'.r^ " 


i>-. : -:.--• -5, ;^S3-: 


. 32 


Rainbow Computing, Inc. . ".':.. 


'. ''ViBC 


54 


Raygam, Inc. 


, <.j- ■- ";v--'3a" 


49 


RNB-Enterprises •■ . '.j, . 


:. ', -v'^' m 


54 


Shepardson Microsystems, Inc.; .:.;-.' 


i ^ < ■».. *, 3g 


40 


: Skyles Electric Works "'•• ; ; 


>>':■: i-V>-^JZ0. r 


52 


Softsfde Publications V ;i 


v'-. ^'^i ' s-.42 : 


34 •■■' 


Sofiside Software - ,*■ 


* .K-^rt -IPC- 


24 


Southwestern Data Systems - , «";;. 


^.«^i-ij^B: 


;$0 


i s:p,a.r.c: , * 


'^ "i'^V^SI''' 1 


t4 


. United Software of America 


••■ ;l; w v^5o. t 




._ ■.'':_•. "';'!. 1 "'*" *"■.'■*' •*" , ' '*>' ■;.'." "■'; i'c\ : vy 


*' : ' $$$•'*&'• ■''' '■*'■ 



Software for the Hpple II s£; 







SCORE =198 



SCORE =185 



DYNAMAZE— a dazzling new real-time game. You 
move in a rectangular game grid, drawing or erasing 
walls to reflect balls into your goal (or to deflect 
them from your opponent's goal). Every ball in 
your goal is worth 100 points, but you lose a point 
for each unit of elapsed time and another point for 
each time unit you are moving. Control the speed 
with a game paddle: play as fast as ice hockey or 
as slowly and carefully as chess. Back up and re- 
play any time you want to; it's a reversible game. 
By Don Stone. Integer Basic (plus machine lan- 
guage); 32 K; $9.95. 



ULTRA BLOCKADE- the standard against which 
other versions have to be compared. Enjoy Block- 
ade's superb combination of fast action (don't be 
the one who crashes) and strategy (the key is 
accessible open space— maximize yours while min- 
imizing your opponent's). Play against another 
person or the computer. New high resolution 
graphics lets you see how you filled in an area— or 
use reversibility to review a game in slow motion 
(or at top speed, if that's your style). This is a 
game that you won't soon get bored with! By 
Don Stone. Integer Basic (plus machine language); 
32 K; $9.95. 



What is a REVERSIBLE GAME? You can stop the play at any point, back up and then do an "instant 
replay", analyzing your strategy. Or back up and resume the game at an earlier point, trying out a different 
strategy. Reversibility makes learning a challenging new game more fun. And helps you become a skilled 
player sooner. 



WORLD OF ODYSSEY— a new adventure game utilizing the full power of Disk II, which enables the player 
to explore 353 rooms on 6 different levels full of dragons, dwarfs, ores, goblins, gold and jewels. Applesoft II 
48K; $19.95 includes diskette. 

PERQUACKEY— an exciting vocabulary game which pits the player against the clock. The object of the 
game is to form words from a group of 10 letters which the computer chooses at random. The words must 
be 3 to 10 characters in length with no more than 5 words of any particular length. Each player has only 
3 minutes per turn. The larger the words the higher the score. Applesoft II 16K; $9.95. 

APPLESHIP— is a naval game in which two players enter their ships in respective oceans. Players take turns 
trying to blast their opponent's ships out of the water. The first player to destroy their opponent's ships 
may win the game. A great low-res graphics game. Applesoft II 32K; $14.95. 



Available at your 
local computer store 

Call or write for our free 
SOFTWA RE CA TA L OG 

Apple II is a registered 

trademark of 
Apple Computer, Inc. 



DEALER INQUIRIES INVITED 



POWERSOFT, INC. 

P. O. BOX 157 

PITMAN, NEW JERSEY 08071 

(609) 589-5500 



Programs Available on Diskette 
at $5.00 Additional 



Check or Money Order 
Include $1.00 for 
shipping and handling 
C.O.D. ($1.00 add'tl. charge) 
Master Charge and VISA 
orders accepted 
New Jersey residents add 
5% sales tax 



Tape Execute File 
Create and Use 



Once upon a time, a computerist wanted to convert his 
integer BASIC programs to Applesoft BASIC. He read 
about a great technique - but it required a disk. He did 
not have a disk, but did have cassettes. Could the 
technique be modified for tape? And, what other 
changes would be required for the complete conver- 
sion? Some interesting things were discovered, and are 
reported here. 



Alien J. Lacy 

1921 Oglethorpe Avenue 

Albany, GA 31707 



For a long time, I had been trying to 
find a way to convert Integer programs 
to Applesoft. So it was with great in- 
terest that I read the How to Section ti- 
tled "Disk Magic;; in Contact 5. A short 
summary follows for those who didn't 
get Contact 5. It was a way to list the In- 
teger programs on to disk and then load 
it into Applesoft. This was done by pla- 
cing the following line in the program: 

PRINT"® OPEN X":POKE 33,33: 
PRINT"@WRITE 
X":LIST:PRINT" ©CLOSE X":END 

(Where ©means Control D) 

When this line is entered type "RUN" 
and press "RETURN". When the opera- 
tion is complete, enter Applesoft and EX- 
ECute the file. 

The only problem with this method 



is that I do not have a disk yet. 

I started to think about how this 
could be done with just a tape. During a 
normal "SAVE" both Integer and Ap- 
plesoft write the program to tape the 
way it is stored in memory, not the way it 
is listed. The program is stored as 
tokens; and since the tokens do not 
match, Applesoft cannot load Integer 
programs. 

So I wrote two routines which link 
into the input and output hooks CSW 
and KSW at $36-$39. (This article uses 
"$" to indicate a hexadecimal number.) 

The output routine gets each byte 
as the Apple outputs it and stores it in a 
buffer before the actual output. When 
the Apple outputs a carriage return, the 
routine writes the buffer to tape. This 
continues until the Apple outputs a car- 



riage return as the first character, the 
routine then resets the output hook. 

The buffer is 256 bytes long. This 
number was chosen because that is the 
length of the Apple's input buffer. Note 
the buffer is from $3F00 to $3FFF 
(decimal 16128 to 16383). This is 
because my Apple has 16K. For different 
memory sizes this can be changed. If 
you have an assembler, change the 
SAVE address to the values in table 1. If 
you do not have an assembler, change 
the locations shown in table 2. 

The input routine reads the tape 
records back into memory and passes 
the bytes through the input hooks. This 
continues until a record comes in which 
contains a carriage return as the first 
byte, the routine then gives control back 
to the keyboard. 



January, 1980 



MICRO — The 6502 Journal 



20:5 



MEMORY SIZE 

32 K 
48K 



SAVE ADDRESS 

$7F00 
$BF00 

Table I 



HIMEM 

32512 
—16640 



The first version used the tape write 
routine at $FECD, which writes a 10 se- 
cond header; therefore, the write took 
about 11 seconds, 10 for the header and 
1 for the data. However, I noticed that at 
$FECD the instruction is LDA #$40 
followed by JSR HEADR. Therefore 
when I want to write a record to tape, I 
load the accumulator with $20 and enter 
the monitor at $FECF. This causes the 
Apple to write a 5 second header, which 
means each record takes 6 seconds. 

To use: 

Load the routines into memory 

Enter Integer Basic 

Type "HIMEM:16128" 

Press "RETURN" 

Load the Program 

Type in the following line: 

POKE 33,33:CALL 769:LIST:END 
Type "RUN" 

Set the recorder in record mode 
Press "RETURN" 

The program will now list to tape 
and the TV. When this has finished, the 
prompt » will reappear. 

Now enter Applesoft 
Rewind the Tape 

Warning: Since the headers are only 5 
seconds long, you must set the tape as 
close to the beginning of the first one as 
you can. 

Type"HIMEM:16128" 

Press "RETURN" 

Type "CALL 772" 

Start the recorder in play mode 

Press "RETURN" 

The program will come into Ap- 
plesoft as if you had typed it in. When 
the Applesoft prompt Q) appears with 
just the cursor behind it, control is back 
at the keyboard. 



Now what you have to do is change 
the things which are different between 
Applesoft and Integer. This will have to 
be done whether you use the disk or 
tape. 

All "TAB" statements have to be chang- 
ed to 'HTAB" 

All computed "GOTO" and 'GOSUB" 
have to be changed to "ON" 
"GOTO" or "ON" "GOSUB". 

Example: 

Where N can vary from 1 to 4 
Integer 
GOTO 400 + N * 100 

Applesoft 

ON N GOTO 500,600,700,800 

All multi statement "IF"s will have to be 
broken into two lines because of dif- 
ference in the way Integer and Applesoft 
handle ifs. 

Example: 

100 IF A = B THEN A = A + 1:C = C + 1 

In Integer C always has one added 
to it, whether or not A equals B. This 
same line in Applesoft will cause C to 
have 1 added to it only if A equals B. So 
for the program to work like the Integer 
program, the line will have to be broken 
into two lines. 

100IFA = BTHEN A = A + 1 

101 C = C + 1 

The random number functions are 
different between Integer and Applesoft. 

Example: 

Integer 

A = RND(16) 



MEMORY SIZE $30C $322 



32K 
48 K 



$7F 
$BF 



$7E 
$BE 

Table II 



$34 D 

$7F 
$BF 



$369 HIMEM 



$7E 
$BE 



32512 
-16640 



Applesoft 

A = 16 * RND(1) 

In Integer either "#" or 'V' can be 
used to mean not equal, in Applesoft on- 
ly "&' can be used. 

Example: 

Integer 
IFA#BTHEN 10 

Applesoft 
IFAOBTHEN 10 



MOD" operation in Ap- 
have to calculate the 



There is no ' 
plesoft, so you 
modulus. 

Example: 

Integer 

B = A MOD C 



Applesoft 

B = A - INT(A/C) * C 

Variable names may have to be 
changed. In Integer all letters are signifi- 
cant; in Applesoft only the first 2 letters 
are significant. To Integer PAY1 and 
PAY2 are different; to Applesoft they are 
the same variable. 

Example: 

Integer 

PAY1 = PAY2 + PAY3 



Applesoft 
P1 = P2 + 



P3 



Another difference is the way str- 
ings are handled. In Integer "DIM A$(20)" 
means set up 1 string which can be up to 
20 characters long. To Applesoft, it 
means set up 20 strings each of which 
can be up to 255 characters long. So all 
string dims should be removed from the 
program. 

A/so to get specific characters out 
of a string, you have to use the MID$ 
function in Applesoft. 

Example: 

Integer 

B$ = A$(2,5) 

Applesoft 

B$ = MID$(A$,2,3) 

The last difference that I have found 
is that all variables should be converted 
to Applesoft integer variables. This is 
not always needed, a lot of programs 
will run without this being done. 



Example: 

Integer 
A = B 



Applesoft 
A% = B% 



20:6 



MICRO — The 6502 Journal 



January, 1980 











1000 


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










1010 


* 




* 










1020 


* 


TAPE EXECUTE FILE * 










1030 


* 




CREATE & USE * 










104 


* 




* 










1050 


* MAIN USE TO CONVEFT INTEGER * 










1060 


* PROGRAMS TO APPLESOFT II * 










1070 


* 




* 










1080 


* 




BY * 










1090 


* 




ALLEN J LACY * 










1100 


* 




AUGUST 1979 * 










1110 


* 




* 










1120 


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










1130 


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










1140 


* 




* 










1150 


* 256 BYTE BUFFER TO STORE TEXT * 










1160 


* FROM ADDRESS S3F00 TO S3FFF * 










1170 


* CHANGE 


FOR LARGER APPLE II * 










1180 


* 




* 










1190 


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










1200 


SAVE 


.EQ 


S3F00 










1210 


PT 


.EQ 


S300 










1220 


ttsw 


.EQ 


SFD1B 










1230 


WR 


.EQ 


SFECF 










1240 


RE 


• EQ 


SFEFD 










1250 


COUT 


• EQ 


5FDD0 










1260 


XSAV 


.EQ 


$47 










1270 




.OR 


S301 










1280 


* 














1-290 


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










1300 


* 




* 










1310 


* SET UP 


FOR OUTPUT OF FILE * 










1320 


* 




* 










1330 


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


0301- 


4C 


9E 


3/ 


1340 
1350 


STP 

* 


J MP 


SP 










1360 


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










1370 


* 




* 










1380 


* SET UP 


FOR INPUT OF FILE * 










1390 


* 




* 










1400 


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


0304- 


4C 


80 


03 


1400 
1420 


STK 

* 


J MP 


SK 










1430 


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










1440 


* 




* 










1450 


•SUBROUTINE TO SET TAPE POINTERS* 










1460 


* 




* 










1470 


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


0307- 


A9 


00 




1480 


SET 


LDA 


#SAVE 


0309- 


85 


3C 




1490 




ST A 


5 3C 


030Q- 


A9 


3F 




1500 




LDA 


/SAVE 


3 0D- 


85 


3D 




1510 




STA 


S3D 


030F- 


A9 


FF 




1520 




LDA 


#SAVE+255 


0311- 


85 


3E 




1530 




ST A 


S3E 


0313- 


A9 


3F 




1540 




LDA 


/SAVE+255 


0315- 


85 


3F 




1550 




ST A 


$3F 


0317- 


60 






1560 
1570 


* 


RTS 












1580 


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










1590 


* 




* 










1600 


* BYTE OUTPUT ROUTINE * 










1610 


* 




* 










1620 


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


0318- 


86 


47 




1630 


PPT 


srx 


XSAV STORE X PEG 


031A- 


EE 


00 


03 


1640 




INC 


PT 


031D- 


AE 


00 


03 


1650 




LDX 


PT 


0320- 


9D 


FF 


3E 


16 6 




ST A 


SAVE-l.X STORE BYTE 


0323- 


C9 


8D 




16 70 




CMP 


f$8D CP? 


0325- 


FO 


06 




1680 




3EQ 


CR 


0327- 


A6 


47 




1690 




LDX 


XSAV RESTORE X REG 


0329- 


20 


FO 


FD 


1700 




JSR 


COUT 


032C- 


60 






1710 




RTS 




032D- 


AD 


00 


03 


1720 


CR 


LDA 


PT 


0330- 


c? 


01 




1730 




CMP 


*1 


0332- 


FO 


15 




1740 




BEQ 


NPT 


0334- 


20 


07 


03 


1750 




JSR 


SET 


0337- 


A 9 


20 




1760 




LDA 


»$20 5 SEC HEADER 


33 9- 


20 


CF 


FE 


1770 




JSR 


WR WPITE TO TAPE 


033C- 


A6 


47 




1780 




LDX 


XSAV RESTORE XREG 


0335- 


A9 


8D 




1790 




LDA 


#$89 OUTPUT CR 


0340- 


20 


FO 


FD 


1800 




JSR 


COUT 


0343- 


A9 


00 




1810 




LDA 


*0 RESET PT 


0345- 


8D 


00 


03 


1320 




STA 


PT 


034 0- 


60 






18 3 




RTS 




0349- 


A9 


8D 




1840 


NPT 


LDA 


#$80 


034B- 


8D 


00 


3F 


1850 




STA 


PAVE 


034E- 


20 


07 


03 


1860 




JSR 


SET 


0351- 


A9 


20 




18 70 




LDA 


#$20 


0353- 


20 


CF 


FE 


1880 




JSR 


WR WPITE LAST PEC 


0356- 


A9 


FO 




1890 




LDA 


JCOUT RESET PRINT 



0358- 


85 


36 




1900 




ST A 


$36 




035A- 


A 9 


FD 




1910 




LDA 


/COOT 




035C- 


89 


37 




1920 




STA 


$37 




035E- 


60 






1930 
194 


* 


RTS 














1950 


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










1960 


* 






* 










1970 


* BYTE INPUT ROUTINE * 










1980 


* 






* 










1990 


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


035F- 


86 


47 




2000 


RED 


STX 


XSAV 


SAVE X REG 


0361- 


EE 


00 


03 


2010 




INC 


PT 




0364- 


AE 


00 


03 


20 20 




LDX 


PT 




036 7- 


3D 


FF 


3E 


2030 




LDA 


SAVE-l.X 


GET BYTE 


036A- 


C9 


8D 




2040 




C"P 


#$8D 


CR? 


036C- 


DO 


11 




2050 




BNE 


NCR 




036E- 


AD 


00 


03 


2060 




LDA 


PT 




0371- 


C9 


01 




2070 




CMP 


#1 




037 3- 


FO 


OD 




2080 




BEQ 


NKEY 




0375- 


20 


AC 


03 


2090 




JSR 


TR 




0378- 


A9 


00 




2100 




LDA 


to 




037A- 


8D 


00 


03 


2110 




STA 


PT 




037D- 


A9 


8D 




2120 


RCR 


LDA 


#$8D 


LOAD CR 


037F- 


A6 


47 




2130 


NCR 


LDX 


XSAV 


RESTORE X REG 


0381- 


60 






2140 




RTS 






0382- 


A9 


IB 




2150 


NKEY 


LDA 


IKSW 


GIVE CONTROL 


0384- 


85 


38 




2100 




STA 


$38 


TO KEYBOARD 


0386- 


A9 


FD 




2170 




LDA 


/KSW 




0388- 


85 


39 




2180 




STA 


$39 




038A- 


4C 


7D 


03 


2190 




JMP 


RCR 




038D- 


A9 


5F 




2200 


SK 


LDA 


#RED 


GIVE INPUT 


038F- 


85 


38 




2210 




STA 


$38 


CONTROL TO 


0391- 


A9 


03 




2220 




LDA 


/RED 


RED 


0393- 


85 


39 




22 30 




STA 


$39 




0395- 


20 


AC 


03 


2240 




JSP 


TR 


READ 1ST REC 


0398- 


A9 


00 




2250 




LDA 


#0 




039A- 


8D 


00 


03 


2260 




STA 


PT 




039D- 


60 






2270 




RTS 






039E- 


A9 


18 




2280 


SP 


LDA 


#PRT 


GIVE OUTPUT 


03A0- 


85 


36 




2290 




STA 


$36 


CONTROL TO 


03A2- 


A9 


03 




2300 




LDA 


/PRT 


PPT 


03A4- 


85 


37 




2310 




STA 


$37 




03A6- 


A9 


00 




2320 




LDA 


»0 




03A8- 


8D 


00 


03 


2 3 30 




STA 


PT 




03AQ- 


60 






2340 




RTS 






03AC- 


20 


07 


03 


2350 


TR 


JSR 


SET 




3AF- 


20 


FD 


FE 


236C 




JSP 


RE 




33 2- 


60 






2370 
2380 




RTS 

.EN 







Sterol 


^gcite^®^ 


JOURNAL OF APPLE APPLICATIONS Vol No. 


EDITED Br 
DAVID E. SMITH 


\ PUBLISHED Br CQMPUk 

\ ! Mutator* 



rou SOUGHT THE BEST! NOW LEARN TO USE IT) 

AT LAST! 

A magazln* d«vot«d to AppHemilonm as 
w«ll aa Taohnlqua far tha Appla Computai 

THE APPLE SHOPPE WILL TEACH YOU HOW TO 
DO ALL THOSE FANCY THINGS ON THE APPLE. 
LEARN HOW OTHERS ARE USING THEIR 
APPLES IN THE HOME, SCHOOLS AND BUSI- 
NESSES. 




I I YES I want to learn how to get the most out ol my Apple. Send me a one year 

subecriptlon. I enclose S12. 



ADDRESS: 
CITY 



D NO, I already Know It all, but send me a Ires sample ol next issue. 

Send ctiecx or money order to: Apple Shoppe, P.O. Box 701, Ptacentia. CA 92670 
or call (714) 99*0*41 





microsystems 



P.O. Box 687 

224 S.E. 16th Street 

Ames, Iowa 50010 



DPim 




DAIM is a complete disk operating system for the ROCKWELL INTERNATIONAL 
AIM 65. The DAIM system includes a controller board (with 3.3K operating system in 
EPROM) which plugs into the ROCKWELL expansion motherboard, packaged power 
supply capable of driving two 5 1/4 inch floppy drives and one or two disk drives 
mounted in a unique, smoked plastic enclosure. DAIM is completely compatible in 
both disk format and operating system functions with the SYSTEM 65. Commands 
are provided to load/save source and object files, initialize a disk, list a file, list a disk 
directory, rename files, delete and recover files and compress a disk to recover 
unused space. Everything is complete — plug it in and you're ready to go! DAIM 
provides the ideal way to turn your AIM 65 into a complete 6500 development 
system. Also pictured are CSB 20 (EPROM/RAM) and CSB 10 (EPROM programmer) 
which may be used in conjunction with the DAIM to provide enhanced functional 
capability. Base price of $850 includes controller board with all software in EPROM, 
power supply and one disk drive. Now you know why we say — 



There is nothing like a 

Dflim 



Phone 515-232-8187 



Why a PET, APPLE, 6502 BASIC 
Compiler? A Simple Explanation 



BASIC, on almost all 6502 microcomputers, is run with 
an Interpreter. A more efficient method of running 
BASIC is through a Compiler. This article discusses 
what a Compiler is, how it works, and discusses a 
BASIC Compiler currently under development. 



Bruce M. Beach 

Homing's Mills 

Ontario, LON 1JO 

Canada 



A group of Canadian PET users are 
developing a compiler for the PET that 
will also be usable on the APPLE or any 
6502 based computer. This may be a very 
significant step in regards to the 
usefulness of the PET. 

This article answers the questions 
indicated in its sub-headings. So as not 
to waste your, the reader's, time, you 
should just go to those sub-headings to 
which you do not know the answer. 

The Topics Being Covered are: 

1. What is a compiler? 

2. What is the difference between a com- 
piler and an interpreter? 

3. What is the difference between a 
direct compiler and a p-code compiler? 

4. Why would a BASIC compiler be so 
useful on a PET? 

5. What is the status of the CANPET 
BASIC compiler? 

What is a Compiler? 

A compiler is a computer program 
which takes a set of instructions, written 
according to some set of rules, and 
transforms it into a machine language 
computer program, a string of binary 
characters. This is the real machine 
language. Everything actually stored in 
the machine can be represented by a 
combination of 1 and digits. 



Early computers built in the I950's 
were programmed with strings of binary 
numbers and it was extremely difficult 
to tell where an error had been made in a 
long binary string as, 10111010110101. 
There are convenient methods of conver- 
ting binary numbers to other number 
bases such as octal, hexadecimal, or 
decimal. Thus programmers were able to 
use more recognizable numeric strings 
such as, 73 (Octal) or A2 (Hex) to repre- 
sent their Instruction Code. Operations 
performed by a computer (such as add, 
subtract, or move data from one location 
to another) have specific operation 
codes assigned to them. Some com- 
puters have as many as four hundred dif- 
ferent operations (op-codes) in their in- 
struction set. 

Because it was still easy for a pro- 
grammer to become confused about 
what the numbers represent, a still more 
simplified method of representing pro- 
grams was developed using what are 
called mnemonics (nuhh-monics). For 
example, the letters AD might be used 
for add, SB for subtract, and LDA for 
load register A. This method of writing 
programs is sometimes mistakenly call- 
ed machine language programming; in 
fact, together with symbolic addressing, 
it is Assembler Language Programming. 

A program has to be available that 
will recognize the mnemonics of the 
assembly language instructions, 
translate them into the appropriate op- 
codes, and allocate actual storage loca- 
tions for those Represented by the pro- 



grammer as symoolic names. Such a 
program is called an assembler. If such 
a program (an assembler) is not 
available and the operating instructions 
are written using only numeric code, the 
program is said to have been "hand 
assembled". 

More powerful assemblers keep 
track of address locations in programs 
and may provide various helpful debugg- 
ing aids. However, even the most power- 
ful assemblers still require an 
understanding of assembly language in 
order to use them; and more importantly 
still, the more powerful they are the 
more likely they are to be untranspor- 
table. That is to say they are unlikely to 
be able to move from one model of a 
machine to another because they usual- 
ly gain their "macropower" from 
features inherent in a particular 
machine. 

Because a great deal of skill and ef- 
fort is required to write a program in 
assembly language, new languages call- 
ed higher level languages were designed 
to make life easier. The first widely used 
such higher level language was FOR- 
TRAN (FOR-mula TRAN-slater) used 
mainly by the mathematically oriented. 
The FORTRAN compiler allowed the pro- 
grammer to express his problem in 
rather conventional looking 
mathematical notation and then took 
the program SEE BOX and converted it 
into assembly language instructions or 
directly into Machine Code. 



January, 1980 



MICRO — The 6502 Journal 



20:9 



Another high level language, 
COBOL (Common Business Oriented 
Language), was developed tor accoun- 
tants and the business community 
which allowed these professionals to ex- 
press their computer programs in ex- 
pressions easily learned by them. The 
COBOL compiler (a program written in 
machine language) took the user's pro- 
gram written in COBOL and compiled it 
into an executable machine language 
program. Other well known languages 
which require compilation are "C", 
FORTH and PASCAL. Compilers have 
been or are being developed for the PET 
for the languages "C", FORTH and 
PASCAL, but to date there has been no 
compiler for the full BASIC language. 
The following discussion will point out 
the usefulness of such a compiler and 
tell you when and where one will be 
available. 

What is the Difference Between 
a Compiler and an Interpreter? 

The code which a programmer 
writes in a higher level language is call- 
ed the source code and the output from 
the compiler, which processes that 
code, is called the object code. In the 
process of making the conversion a 
compiler may have to make several 
"passes", i.e., complete scans through 
the source code, so compilers are often 
distinguished as being single or multiple 
pass compilers. It usually takes a multi- 
ple pass compiler longer to compile than 
a single pass compiler but the multiple 
pass compiler might be preferable if, for 
example, the object code it generates is 
more efficient. 

In any case, once the compiler has 
completed its task the object code can 
be saved and used over and over again 
without recompiling. Interpreters, such 
as the BASIC Interpreter found in the 
PET and other popular micro-computers, 
do not work in this manner. They take 
the user's source program, written in the 
higher level language (the BASIC 
statements), and analyze (interpret) each 
statement one at a time to determine its 
equivalent machine code, and then ex- 
ecute this code. Moreover, and this is 
the chief drawback to interpreters, they 
do not save the object code. The next 
time that BASIC statement is executed 
the machine again has to interpret that 
line of code. For example, if there is a 
FOR.... NEXT loop in the program that 
contains six statements between the 
FOR and the NEXT and the loop is to be 
executed 100 times, then each of those 
six lines of code will be interpreted 
(translated) into machine language 100 
times. This results in a total of 600 
translations made by the interpreter, 
whereas the compiler would have made 
only six. In both cases, the machine 
code is performed 600 times; but in the 
interpretation, the analysis represents a 



significant overhead which is absent in 
the compiled version. 

Purists may object that this is a 
somewhat simplified explanation 
because, in fact, the interpreter stores 
token (numbers) for the BASIC 
keywords, and often jumps to predefin- 
ed specific runtime routines rather than 
assembling new code. However, in prin- 
cipal the interpreter works in this man- 
ner and for this reason interpreted pro- 
grams are 10 to 100 times slower in ex- 
ecution than compiled programs. 
Another factor which often slows down 
an interpreter is that it must repeatedly 
do much error checking that a compiler 
does only one time. 

The advantage of an interpreter, 
however, is that one need not wait for 
the compile to take place before execu- 
tion. So long as high speed in program 
execution itself is not needed, an inter- 
preted program may perform quite fast 
enough; and although there may be 
other reasons (some of which will be 
described later) that may make compila- 
tion desirable, it is apparent that an in- 
terpreter will reduce the time required 
for program development. 

There are advantages to an inter- 
preter besides convenience in program- 
ming. Source code requires much less 
memory than object code. A single con- 
cise BASIC statement such as: 

If X = (Y * L) / M THEN R = X + (M - L), 

expands through compilation into many 
machine language statements. Conse- 
quently a much longer program can be 
written in BASIC and stored in a small 
computer that interprets each line and 
"throws away" the object code im- 
mediately after it is used, than in a 
machine that has to store all the object 
code before execution begins. 

Incidentally, there are many high 
level languages that are not general pur- 
pose programming languages. RPG's 
(Report Program Generators), for exam- 
ple, are high level languages used to for- 
mat reports. There are also many DBM 
(Data Base Management) languages 
(such as ADABAS, MARK IV, etc.) that 
are used to access large files of data. On 
the surface these programs appear very 
similar to the languages processed by 
compilers as regards the syntactical 
rules they require for input. That is to 
say the user writes a "program" for his 
application that is in many ways like a 
computer program that he would write 
for a compiler. However, while these 
systems do what they are designed to do 
very well (i.e., access some particular 
data base), they are not general purpose 
languages and cannot be used efficient- 
ly for many purposes that a compiled 
language can. 



To summarize then, a compiler 
translates the source code into object 
code one time which is then used over 
and over again; whereas an interpreter, 
such as PET's BASIC, "throws away" 
the object code after each execution and 
then must re-translate again from the 
source before an instruction can be us- 
ed again. The advantage of using an in- 
terpreter is that it takes much less 
memory to store a whole program in 
source format rather than in object for- 
mat, and execution takes place im- 
mediately rather than waiting for a com- 
plete new re-compile after each program 
change. However, among its other ad- 
vantages, a compiled program can be 
executed at more than ten times the 
speed of an interpreter and this is often 
critical in certain applications. 

What is the Difference Between a Direct 
Compiler and a P-Code Compiler? 

A compiler then, takes the source 
language code of a particular high level 
language and translates it into object 
code-that is to say, into the machine 
language op-codes. Because a computer 
always automatically executes the next 
instruction following the one it is 
presently executing (unless there is a 
branch), it is much faster not to have any 
branches. However, code written 
without branches would usually require 
more memory than is available internally 
to the computer. Also, it would not take 
advantage of the "conditional" branch- 
ing or decision making power of the 
computer which is the essence of a pro- 
gram. 

Consequently, one of the major 
design decisions in designing a com- 
piler is the trade-off between using 
memory-consuming repeating code "in- 
line" to save branches and increase 
speed, or making time-consuming 
repeated branching to the same sub- 
routines in order to conserve memory. A 
JSR (Jump-to-Sub-Routine) requires the 
computer to save from the PC (Program 
Counter) the next address it would have 
executed in sequence, and load instead 
in the program counter the address of 
the sub-routine instruction. On RTS 
(Return from Sub-routine) the instruction 
address that was originally saved must 
then be restored to the PC. If there were 
only a few instructions in the sub- 
routine, there will be no saving of 
memory and time will be wasted in going 
to the sub-routine. The computer instead 
simply could have processed the next 
couple of instructions. However, if the 
sub-routine contains many instructions, 
memory will be saved by going there at 
the expense of a little time for making 
the branches. It all depends on the 
relative value of speed and memory in a 
particular system. 

A compiler designer soon finds that 



20:10 



MICRO — The 6502 Journal 



January, 1980 



certain large blocks of code are used 
repeatedly. Therefore, every time a 
source program requests a certain type 
of activity the compiler causes the ob- 
ject code to jump to the specified block 
of code that can handle that activity. 
Sometimes two activities are similar, 
although not identical; but if the code for 
each is very long and the differences are 
minor, it is frequently more efficient to 
generalize the code and then to 
distinguish between the differences of 
the activities within the block of code. 
Now again, there are some trade-offs 
most likely requiring some additional 
branches for each of the activities that 
would not be necessary if they had their 
own unique code. We are in fact "inter- 
preting" at execution time some of the 
code within the compiler-generated 
code. This then is not true object code 
for what was the source statement but is 
in a very limited -sense Pseudo Code 
(P-Code). 

While this type of approach is pre- 
sent to some extent in almost all com- 
pilers, some compilers make heavy use 
of this approach. The generalized code 
that will interpret the specific 
statements generated as object code by 
the compiler amounts to an "overhead" 
in both usage of memory and in execu- 
tion time. 

Some FORTH and PLM compilers 
currently available for the PET are so 
heavily dependent on these techniques 
that the resulting object code executes 
as little as 3 times as fast as the BASIC 
Interpreter. These same compilers re- 
quire several K overhead in memory for 
the specialized routines that conse- 
quently become a part of all programs, 
whether they are actually used or not. 
This can be very detrimental in some im- 
portant situations. 

It is possible to write a compiler 
that is resident in memory and interprets 
all of the code at execution time. In such 
a case we have come full circle and have 
what we started with-an interpreter. 
This is indeed why many of the so-called 
compilers perform little better than an 
interpreter. 

How, then, can one tell whether or 
not they have a "true" direct compiler or 
a largely P-code simulator? The answer 
is by benchmarking. Because there are 
different design philosophies behind dif- 
ferent compilers, one must take a com- 
piler and compare it to the other alter- 
natives (i.e., other compilers or the inter- 
preter). One does this by writing a test 
program with statements similar to the 
type they use in actual applications. 
Perhaps for one user there are lots of 
loops and string handling. Another user 
may particularly use math functions and 
arrays. The particular test program is 
then run using both products and the 
results are compared. Only in this way 



will you know which of the two products 
will perform better in terms of compile- 
time and/or execution-time. Other impor- 
tant considerations may be 
maintenance, direct access to the object 
code to allow modification, types of 
statements available, ease of operation, 
documentation, support, expected im- 
provement or obsolescence, etc. 

To summarize this section then, a 
"direct-compiler" uses relatively less 
pseudo-code and executes faster than 
straight P-code compulers. Performance 
can only be determined by benchmark- 
ing for specific applications. 

Why Would a Basic Compiler be So 
Useful on a PET? 

Aside from the considerable speed 
improvement that can be obtained from 
a well compiled program, are there any 
other advantages to using a BASIC com- 
piler? Most definitely, yes. However, 
before elaborating let us pursue the 
question of speed itself. For many ap- 
plications the PET's BASIC interpreter's 
speed is entirely adequate. It is in real 
time applications (such as process con- 
trol, where the PET is monitoring some 
other device attached to it through an in- 
terface such as the IEEE-488 Port, 
located on the back of the machine) that 
greater speed is needed. Since only the 
PET among popular personal micro- 
computers has the necessary IEEE Port 
for attaching many laboratory and 
technical devices, faster programs are 
also more significant to PET users. 

There are a number of S-100 bus ap- 
plications that could benefit from in- 
creased program speed and these can 
be implemented on the PET through 
available S-100 interface boards. Often 
only a few specific routines need the 
higher speed afforded by assembly 
language programming and this could 
be accomplished by writing those few 
routines in assembly language and do- 
ing a SYS call from the BASIC program 
to them. This latter approach, however, 
still requires that the programmer 
understand assembler language; 
whereas, by using a BASIC compiler, he 
needs only know BASIC. 

Where a BASIC compiler can really 
shine is in the development of 
marketable systems. There are now 
available for less than $300, systems 
that interface directly with the PET that 
can be used for burning PROMS (pro- 
grammable read only memories) and 
E-PROMS (ultra violet erasable proms). 
These chips will fit into socket holders 
inside the new 16K PETS, or the socket 
holders in the expansion boards on the 
old 8K PETS, and can hold a machine 
language program in readiness for a 
user, even when the computer is turned 
off-they are called non-volatile. 



This makes it convenient for users 
still to be able to use their computer in 
just the same way as any other PET user. 
But at the same time, they are able to 
step up to a PET that contains a PROM 
programmed for a specific task and im- 
mediately access the special program 
without having to wait for it to load from 
a tape or disk. In addition to making the 
computer easier for the user to use, this 
is also a very convenient way for the 
developer to distribute his program and 
makes copying of it much more difficult 
than if it were on tape. The producer's in- 
cremental cost of duplicating programs 
for distribution using PROMS should be 
well under $20 each. 

More importantly, we can go one 
step further and take a program that has 
been written on the PET in BASIC, com- 
piled, and stored in PROM and use that 
PROM along with a 6502 micro- 
processor to build up an entirely 
separate device that no longer involves 
the PET at all. In this way the PET has 
become a very powerful development 
tool for the garage or basement inventor 
that is comparable to similar develop- 
ment systems that have been used in in- 
dustry for the last several years but that 
have cost many thousands of dollars. A 
true BASIC direct compiler will therefore 
allow serious PET users to develop from 
PROMS, faster and more memory effi- 
cient object code while using the power 
of the present PET BASIC interpreter for 
rapid program development. 



What is the Status ol the CANPET 
BASIC Compiler? 

In June 1979 work was begun on a 
PET BASIC direct one-pass compiler. 
The language supported by this com- 
piler is intended to be identical with that 
supported by the PET BASIC interpreter 
with the exception of dynamic array 
declaration/allocation. 

The Co-ordinators of the project, 
Mr. Bruce Beach and Mr. Brian Beswick, 
have retained the service of a Toronto- 
based consulting firm with nearly 15 
years of software experience and exper- 
tise in compiler design. Assistance is 
also being given by interested and 
knowledgeable individuals in the Cana- 
dian PET community, such as Mr. Jim 
Butterfield. 

The first pre-releases of the com- 
piler should be available for use by the 
time this article appears in print. Initial 
users will be sought in a wide diversity 
of applications so that the compiler's 
performance can be critically evaluated. 
Any persons who feel they would like to 
participate in the early evaluation pro- 
cess are invited to contact the Author. 



January, 1980 



MICRO — The 6502 Journal 



20:11 



Article Summary 

A BASIC direct compiler that makes 
minimal use of P-code is being 
developed for the PET and APPLE or any 
6502 based computer by a private Cana- 
dian group. It is anticipated that the 
resulting object code will require more 
storage than the source BASIC provided 
to the interpreter but less than that 
generated by other presently available 
compilers. 

The chief advantage of the new 
compiler is that its resulting code 
should execute many times faster than 
the speed obtained by using the PET or 
APPLE'S BASIC interpreter. 

The new compiler in combination 
with the present powerful PET and AP- 
PLE BASIC interpreters should greatly 
facilitate the development of new 
systems that take advantage of the 
PET's and APPLE'S 6502 microprocessor 
and the PET's IEEE-488 Port com- 
patabilities. 



DO 300 1=1 ,N 

IF (CR(I) .EQ.O) GOTO 300 

IF (STRTSW(I) .EQ.O) GOTO 4 

CR(I)=0 
C CHECK IF INFORMATION COMING 

IF (STEP(I) .GT.6) GOTO 301 

BFPTR(I)=BFPTR(I)-1 
C YES INFORMATION 

TrSTEP(I) 

DO 300 J = 1 .BFPTR(I) 

INFOU.T, J)=BUFFER(I, J) 
300 CONTINUE 

STOP 

END 



Figure 1: Example of Fortran Routine 



07 



Serious users who would be willing 
to help benchmark and critically 
evaluate the performance of this new 



BASIC compiler are invited to contact 
the author, Mr. Bruce M. Beach, 
Homing's Mills, Ontario L0N 1J0, 



Canada, (519)925-6035, or Mr. J. Brian 
Beswick, 1755 Rathburn Road, Unit 45, 
Mississauga, Ontario L4W 2M8 
(416)624-5225. 



IF FEMALE GO TO WOMAN 

ELSE GO TO MAN. 
WOMAN. IF WEIGHT < MIN- FEMALE- WT (J) 

SUBTRACT WEIGHT FROM KIN-FEMALE-WT (J) GIVING LBS-U (NU) 

GO TO SKINNY. 

IF WEIGHT > MAX-FEMALE-WT (J) SUBTRACT MAX-FEMALE-WT (J) 

FROM WEIGHT GIVING LBS-OV (NOV) 

GO TO FAT. 

GO TO NORMAL. 
MAN. IF WEIGHT < MIN-MALE-WT (J) 




Figure 2; Example of Cobol Routine 




Bringing Music Home 




Being a spectator is great 
. . .but why not participate? 



• Sing along 

• Compose 

• Play 
\ \ • Learn from Specialists 



LET MICRO MUSIC TURN y6uR APPLE ][ ® INTO A FAMTCY MUSIC CENTER! 



VISIT THE APPLE DEALER NEAREST YOU AND ASK FOR A 
DEMONSTRATION OF MMI'S MICRO COMPOSER™ 
The MICRO COMPOSER LETS YOU— 

• Play up to 4 simultaneous voices 

• See all 4 voices at the same time you're hearing the music — a 
must for music editing! 

• Enter music notes by a fast, simple and well-tested coding 
system. 

• Program the pitch, rhythm, and timbre of the music. Tempo is 
varied by the Apple paddle. 

• Choose 7 different tone colors for each voice or create your 
own tone color. 

• Compose, edit, display, and play music through an interactive, 
command-driven language that's easy to learn. 

• Save your music on disk or cassette. 

• Hear quality music sound at low cost through the MICRO MUSIC 
DAC card. No amplifier needed! Designed for MMI by Hal 
Chamberlin and Micro Technology Unlimited. 

• Select from future MMI music instruction software to accompany 
the MICRO MUSIC DAC. 

Ask your local dealer for information on MMI products, or contact: 



The MICRO COMPOSER is an APPLE II® compatibile, low-cost 
music system designed by the folks at MMI. Our music software was 
designed by leading experts in music education. A simple step-by- 
step instruction manual leads you through entering, displaying, 
editing, and playing music with up to four voices — soprano, alto, 
tenor, and bass. You can change the sound of each voice to reed, 
brass, string, or organ sounds and you can even color your own music 
sounds! 




HAVE FUN! THE MICRO COMPOSER comes complete with on instruction manual, 
software disk or cassette — in either Integer or Applesoft ROM BASIC, and the MICRO 
MUSIC DAC music card. Just plug the MICRO MUSIC DAC into the APPLE extension slot 
and connect the audio cable to a speaker. 

Suggested retail price $220. 




VliCrO MUSiC InC 309 Beaufort, University Plaza, Normal, IL 61761 



APPLE II is a trademark of Apple Computer Inc 



Human Physiological 
Parameters 



One of the most common complaints about the home 
computer is that it does not really do much for the 
average consumer. After you balance your checkbook, 
then what? Here is a program, based on scientific data 
and studies, which calculates the proper weight for an 
individual as a function of height, body build, and sex. 
Written in Applesoft BASIC, it should be easily adapted 
to any other reasonable BASIC. 



Dr. L.S. Reich 

3 Wessman Drive 

West Orange, NJ 07052 



Introduction 

The focus of public interest in nutri- 
tion has changed markedly during the 
past decade. In the past, the emphasis 
was on eating more of everything. In- 
creasingly, the message is to eat less. 
The reason for the turnabout is that 
many foods are believed to be factors in 
causing or promoting such degenerative 
diseases as heart disease, diabetes, etc. 
Diet is also involved in an especially 
prevalent disease, obesity (excessive 
weight). 

Excessive weight is associated with 
cardiovascular and renal diseases, 
diabetes, degenerative arthritis, gout, 
etc. On the basis of life insurance 
statistics, the most nearly ideal weight 
to maintain throughout life is that which 
is proper at age 25 for one's height and 
body build. Thus, height-weight tables 



no longer indicate figures beyond ages 
of 25-30 years. A deviation of not more 
than 10 percent above or below the 
desirable weight for a given individual is 
not considered significant. The term 
overweight is applied to persons who are 
10-20 percent above desirable weight; 
obesity is applied to persons about 20 
percent or more overweight. Under- 
weight generally applies to those in- 
dividuals who are more than 10 percent 
below the established standards. Those 
who are more than 20 percent below 
such standards are considered to be 
seriously underweight. 

Height-weight tables provide only 
approximations on the degree of 
fatness. More accurate measures of 
body fatness include measurements of 
thickness of subcutaneous tissue at 
designated body locations using 
calipers or by determination of body 
density by means of underwater 



weighing. If has been estimated that 
about one-half of all men over 30 are at 
least 10 percent overweight and that 
one-quarter are obese. The incidence is 
higher for women, about 40 percent be- 
ing obese by the age of 40. 

Generally, the percent water in lean 
individuals is higher than in obese per- 
sons. The opposite is true in regard to 
body fat. The human body generally con- 
sists of 55-60 percent of body weight as 
water, about 17 percent as lipids (which 
includes fats), about 15 percent as pro- 
tein, and about 1 percent as carbohy- 
drates, about 5 percent of other 
materials. The total body water relative 
to body weight is usually lower in 
females than in males. Also, the 
predicted total body water has been 
found to be closely related to predicted 
surface area. Generally, the higher the 
weight-% of body water, the lower the 
weight- % of body fat. 



January, 1980 



MICRO — The 6502 Journal 



20:15 



PROGRAM LISTING 



The Program 

The program that follows indicates 
what a person should weigh based on 
height, body build and sex. The ideal 
weights given are generally for men and 
women of ages 25 and over. Besides 
ideal weights, this program estimates 
whether a person is obese, the percent 
that a person's weight is above the max- 
imum ideal weight, the weight-% of body 
fat and of body water, and the body sur- 
face area. These physiological para- 
meters are applicable to those over the 
age of 16. 



Obesity is estimated by a critical 
obesity index based upon Quetelet's in- 
dex (Ql). This critical index is reached 
when the individual's weight is about 18 
percent above the maximum ideal 
weight. Also, Ql is used to estimate body 
fat (BF). The BF via Ql is in good agree- 
ment with the value from weight-% 
water (BW) using the expression: 
100-137*BW (however, another expres- 
sion for BF is used in this program). 



In the program listing that follows, 
REM statements are to be found in line 
numbers 20, 96, 100, 132, 138, 143, 148, 
162, 200, and 490. Line numbers 500-600 
contain height-weight data for females 
only while numbers 750-860 contain 
height-weight data for males only. In line 
number 50, W$(J,K) denotes an array for 
heights and weights corresponding to 
small, medium, and large body frames. 
Line numbers 97-99 and 137 express the 
program limitations for females (must 
not have height below 5'0" or above 
5'10", and if body frame is small, 
physiological parameters will not be 
given); while, lines 197-199 and 237 ex- 
press the program limitations for males 
(must not have heights below 5'4" or 
above6'3", and if body frame is small, 
physiological parameters will not be 
given). Line numbers 133 and 233 deter- 
mine the percent that an individual's 
weight exceeds the maximum ideal 
weight and, numbers 145, 150-160, 245 
and 250-260 calculate Ql which is used 
to determine body fat and whether or not 
a person is obese. 

Line numbers 165, 170, 175, 265, 
270, 275 allow the estimation of body fat, 
body surface area, and body water both 
in men and women. Applesoft II BASIC 
in ROM was employed and the program 
required about 8.5K free bytes. (It may be 
noted here that a BASIC master com- 
mand list has been published ((flecrea- 
tional Computing, Sept-Oct, 1979)) 
which is applicable to SOL-20, PET 2001, 
APPLE II, and LEVEL II TRS-80 com- 
puters.) 



2 HOME 

3 PRINT "THIS PROGRAM TELLS YOU WHAT T0U SHOULD WEIGH BASED ON 
DATA ADAPTED FROM THE BOOK (WEIGHTS IN THIS BOOK WERE SUBTRACTED 
BY 3 TO GIVE WEIGHTS IN BED CLOTHING, WHICH WERE USED IN THIS 
PROGRAM), 'NORMAL & THERAPEUTIC NUTRITION' (13TH EDITION), »; 

4 PRINT "BY C.H. ROBINSON, 1972, P.848 (MACMILLAN). HEIGHT 
LIMITATIONS ARE, FOR WOMEN: 5-0 TO 5-10; FOR MEN: 5-4 TO 6-3 
(NO SHOES). IDEAL WEIGHTS GIVEN ARE FOR BED CLOTHING AND ARE 
FOR "; 

5 PRINT "MEN AND WOMEN OF AGES 25 AND OVER (FOR GIRLS 18-25, 
SUBTRACT 1 POUND FOR EACH YEAR UNDER 25)." 

6 PRINT "BESIDES IDEAL WEIGHTS, THIS PROGRAM ESTIMATES OBESITY, 
BODY FAT, BODY SURFACE AREA, AND TOTAL BODY WATER. THESE ARE 
APPLICABLE TO THOSE OVER THE AGE OF 16. GENERALLY, THE % TOTAL 
BODY WATER IS LOWER IN FEMALES THAN IN MALES. "; 

7 PRINT: PRINT: PRINT "PRESS 'CONT' TO CONTINUE!"; :PRINT: STOP: 
PRINT 

8 PRINT "FURTHER, THE * OF WATER IN LEAN PERSONS IS HIGHER THAN IN 
OBESE PERSONS. ABOUT 55-60* OF THE BODY WEIGHT IS WATER. A 
DEVIATION OF NOT MORE THAN 10* ABOVE OR BELOW THE DESIRABLE 
WEIGHT FOR AN INDIVIDUAL IS NOT "; 

9 PRINT "CONSIDERED SIGNIFICANT. THE TERM 'OVERWEIGHT' IS GENERALLY 
APPLIED TO PERSONS WHO ARE 10-20* ABOVE THE DESIRABLE WEIGHT. 
'OBESITY' IS APPLIED TO PERSONS WHO ARE ABOUT 20* OR MORE OVER- 
WEIGHT. "; 

10 PRINT "IN THIS PROGRAM, OBESITY IS DETERMINED BY A CRITICAL 
OBESITY INDEX BASED UPON 'QUETELET'S INDEX' (Ql). THIS 
CRITICAL INDEX IS REACHED WHEN THE PERSON'S WEIGHT IS ABOUT 
18* ABOVE THE MAXIMUM IDEAL WEIGHT. ALSO, Ql IS USED TO "; 

11 PRINT "ESTIMATE BODY FAT (BF). THE BF VIA Ql IS IN GOOD 
AGREEMENT WITH THE VALUE FROM TOTAL BODY WATER USING: *BF-100- 
(137* WT. WATER/BODY WT.).": PRINT: PRINT "PRESS 'CONT' TO 
CONTINUE!": STOP: PRINT 

12 PRINT "MORE REFERENCES: HUME & WEYERS, J. CLIN. PATH. , VOL. 21* , 
PP. 234-238 (1971); JAMES, (A DHSS/MRC REPORT) HER MAJESTY'S 
STATIONERY OFFICE, LONDON, 1976 (ISBN 11 450034 7). REMARKS 
ARE TO BE FOUND IN LINE #'S 20, 96, 100, 132, 1 38 , 143, 148, 162, 
200, 490." 



20:16 



MICRO — The 6502 Journal 



January, 1980 





















►a 








































z 


m 










g 










,-a 


O 
Eh 














g 










g 




g 












M 


c^ 










«i 


< 








X 
CO 


>h 




<=* 


>H 






X 












Eh 




Eh 




1 




z 


Eh 


CO 













w 


OO 






_ 


►J 






►J 






w 






M 




CK 




CK 




1 






z 


» 


• » 














•— 








ft 




CO 


w 









m 






Eh 




W 




g 




1 




Eh 


H 


=* 


- 




Eh 




X 


M 


■v 






X 


ft 




CK 


> 


■ ■ 




z 


g 






H 




> 






X 




< 


£ 




■ 




a 




1 








g 


< 




H 


M 


J- 




M 






CO 




O 




O 




w 




ft 


•«> 






C5 




1 


X 


a 










Eh 


Eh 


in 













a 



















pa 


X 


En 




M 




1 





a 









g 




X 


O 


(^ 




CO 










O 




O 




z 




X 


1 


►J 


a: 




w 




z 


X 












W 


O 




» 














CO 


m 


CO 


in 


M 




O 


pa 


a 




s 






M 









CO 


SS 






ft 


• 




a 


Eh 










^ 


VD 


►J 


VD 






s 


a 


> 


M 








Eh 


>^ 


5 






M 






z 


CO 


• 










CK 




.— 


< 


■ — 


X 






M 


w 




CK 




Z 


<j 








CO 




M 


s 


a 




t^ 


» 






pa 












Eh 






s 


Eh 


% 




3 




M 


y 








M 


6q 






■ 




X 






a 




s 





CK 





M 




ft 





O 






O 




CK 







~ 




x 


O 




Eh 








Eh 


►J 






Eh 




s 


Eh 


CO 







hi 


pa 


►J 




X 




ft 


CK 


< — 


•■' 




3 


O 




a 


« 


a 




W 


w 






pa 




< 


< 


O 


S 






3 


ft 


< 










3> 


>N 


^-* 




CK 






C5 


CO 






3> 


> 






a 






a 




C3 




z 


CO 


w 




Eh 




Z 


O 


EH 




ft 


• 




M 


w 


•• 




cy 


M 






s 




t= 




O 




O 









g 


o 




< 




W 


X 


a 


35 






O 




U 


►J 


^-N 




k 


Eh 













•• 


O 


■ • 






M 





M 




a 




W 




C5 


a 




CK 


a 




a 


X 


^"N 






U 






pa 


>H 


X 


— 


>H 


— 


>J 




Eh 


C-- 








Eh 




Eh 


g 




M 




O 






tA 




CO 


W 






Z 


►J 


— 


— 


z 


— 


< 




< 


(\J 


« 


a 










Cm 


pa 




O 






w 




» 




w 


ft 


w 




M 


g 









C3 


O 




z 




55 


o 




5fc 




a 


s 


M 






X 






w 


=« 


4A 




Eh 


CO 


CO 






g 


a 


g 


Z 


M 






c* 


X 


o 








ft 




CK 






CK 




Eh 




a 




O 


CK 


a 




CK 


M 


M 


M 


Eh 




x 




x 




W 




V 


■< 


• * 


u 




w 


W 




O 


CO 






Z 




pa 


Eh 


M 


s 


M 


Eh 


M 




CK 







r 




a: 




CO 







> 




CO 


Eh 




Z 


w 


©» 




w 









Eh 


O 


a 


a 


pa 


CK 




pa 


C^ 


08 






Eh 


Eh 


CO 


~m 


■ — 







3> 


< 




W 


►J 







ca 


CO 






pa 


h 


cu 


M 


CU 


l-H 


O 




Eh 


«— 




Eh 






33 






\ 






< 


a 









M 






a 


CO 







ft 




Q 




O 






B 




z 


z 




W 


a 


ft 


— 


^-N 


a 




O 








x 


X 




m. 


M 






CO 


•• 




•• 




pa 




A 


CO 


X 




CK 




z 

M 


M 
W 


M 





in 


g 




S 


>H 
O 




a 


1*. 


1j 






X 


z 







CK 


g 


S 


g 


s 


a 

Eh 




* 


4 


0, 




£ 


* 


^ 


\ 


+ 



pa 
a 




= 


s 






Pm 


< 
> 




" 


08 







'V 


• 


M 

CK 


< 

Eh 


M 
CK 


< 

Eh 


CK 




3 


, fc 


HB 


g 




w 

Eh 


►J 

< 




in 


* 


M 
CO 




g 


a 










+ 




in 


CO 




R 


CO 


ft 


1 


ft 


1 


pa 

g 




^ 


X 


CK 
O 




W 


w 




+ 


^-N 


Z 




M 







-a- 


CO 






-a- 


w 


ft 




<^ 


^ 


Z 


1 


Z 


1 






pa 


ft 


M 




Q 





» 


O 


CO 


O 




CK 






rij 


X 


<\J 




rij 


l_3 








g 


1 


g 


1 







m 


^ 




a 






M 


^"N 




CO 


O 




ft 


ss 






3 


*— 






3 


•« 




08 


X 


X 


s 






VD 


M 


CO 


0, 


tA 


tA 




*— 


•" 


\ 













08 


CK 


• 




t» 


X 










Eh 


H 


Eh 


po. 




(^ 


Eh 






tA 


tA 


V 


+ 


^-^ 





g 




• • 


M 






O 


^— s 






W 


CK 







08 




g 







pc 






O 


pq 


z 


■— 


(\J 


5 


ft 


CO 







Eh 


Eh 




O 


O 


^-N 




m 


Ph 


a 




VO 




O 


in 


z 


3 




oil 


S" 


s 


g 






X 


• •" 


to 


•— 


< 




Z 


< 




J" 


iJ 


•— 




j- 








to 




M 


• 


M 








ft 


<^ 


O 


08 


M 


* 


\ 


• 






M 


£ 




•— 


M 


* 




•— 


CK 






T 


H 


C^ 




ON 




t= 


Z 


in 


to 




En 


Eh 


tA 


X 


^ 


O 


^-N 


O 




CK 






be! 


•— 






O 


u 







^ 


rij 


X 


<\J 


X 





■-• 


VD 


pa 


pa 




Q 


tA 


X 


*» 


O 


CO 


O 




ft 





O 


CO 




» 




CO 


Ph 


H 




m 


A 


Eh 


/\ 


Eh 


X 


to 


*— 


CK 





«A 


O 


•— 


* 




1 


X 






&. 


OO 


» 


Z 


e* 


ON 


w 




^ 




*— 


X 


M 


M 




z 






< 


W 








-^ 


• 


^^ 




z 


S5 


*— 


=* 


M 


a 


m 


% 


O 




^-N 




pa 


M 


CO 


M 


CO 







to 


■ 


g 


■ 


•« 


CO 


a 


tO 




* 


z 




g 


M 








^^ 


IA 




W 


g 


a 


CO 


Ph 


cy 


a 


CS* 


3 


g 


M 


_ 


z 




•■> 


» 





O 


CO 


ft 








O 


M 


Eh 


to 


in 


M 


to 


• 










Eh 


* 


S 


t= 


3 


^ 


* 




X 


M 

X 


<? ;- s 


g 




Eh 


3 


Eh 
O 


a 

C3 




M 


j- 


fc> 


•« 


a 


* 


CK 




g 





e 





M 


< 


g 


s 


CO 


» 


+ 


fifl 






* 


^^ 


M 




•— 


z 


C3 


►J 


M 


X 


• 


hJ 


to 


Eh 


\ 


g 


6h 


< 


^ 


3 


3 


a< 


fc> 


08 


X 


S 


P5 


to 


5 


ft E- 


• Eh 


CK 




■ 









g 


*^f 


u 




M 


•a! 


s 










Eh 


M 







*^* 


ft 


M 


O 


n_ £ Z 


ft 




V 


M 


• • 


z 


J 


z 




Ph 


M 


to 


Ol 





rA 





• 4 


s 


►J 


z 


s 


«A 


* 


J 


M 


> 


^«* ~ 


4 M 




Eh 


Eh 


— 


M 




< 




M 


a 






►J 


Eh 


■ 


M 


■ 


M 


g 




a 


s 


e n 




W 


■ 


w O ■ 


Z 


Z 


&H 


Hi 


— 




• 


> 


■ 







t" 


■ 




CO 


^< 


Eh 


6h 


Eh 





X 


2 






X 


O 




&• f^ 


w 


M 




O 


O 


X 


s 


■ 




X 


M 


O 




X 


M 




M 




M 


M 


Z 


g 





ft 


ft 


to pa 


g 


X 


CO 


s £ 


: a 


« 


CK 


&N 


O 


O 


w 




B 


CK 


a 


g 


M 


g 


X 


Ph 


CK 


Ph 


CK 


CK 


O 


s 





M 


* 5 


M 


CO 


M S 


c C5 


Eh 


ft 


M 


■< 


PH 


CK 




a 


* 


cs* 


H 


M 


O 


M 


O 


ft 


O 








o 


o 


(\J 




rA 




j- 




vD 


C^- 






00 









rA 






m 


00 




* 




m 




O 




(^ 






<NJ 


"A 


tA 




K\ 




*A 




K\ 


IA 






tA 




-3/ 




-3- 






-a- 


J- 






in 




v£> 




v£> 

























CO 
CK 




s 






















9 




•< 
►J 






















X 












CO 














E> 








ft 




Eh 














Z 




(\J 


5 







a 


















■ 


•• 


Eh 




a 














O 




X 


*— V 


CO 




M 


CO 












Eh 




M 




s 

M 


Eh 

z 




08 


CK 












z 




X 


St 
Eh 


M 






ft 












a 






O 


CK 




Eh 














CK 




••> 


►J 


ft 




a 
cs 

M 


X 
O 

s 




















■ 




J fc 




pa 
a 












< 


J* 


^ 


a 


— ■ 






pa 












^-* 




X 




pa 




■ cc 


s 








O 




<\i 


a 


to 


a 


» 













CO 




■ 







Eh 


z 




ft 


< 












a 


z 


u 


M 


M 






►J 













M 


Jp 


* 


Eh 

Z 




X 

CK 


08 








§ 




^ 


f-> 


2 




O 












e 






CO 


ft 


CO 


O 




CK 

< 


X 












_ 


pa 

CK 


X 


z 


O 






s 








.— 




■ 


•< 





s 


Eh 




Z 

< 










1 

»-3 




pa 


g 


s 


s 


g 




CO 


g 








»-3 




| 





CK 


z 




M 














pa 


Eh 


s 


M 


O 






•■ 








Z 




ft 







^rf» 


O 




CO 


►J 








ca 




*^s 


^-N 


X 




" 




M 

a 


X 








Eh 




X 


CO 

pa 




g 


CO 




Eh 












pa 





^-N 





CO 




X 


CO 








O 




CO 


w 

CO 





M 


CK 




g 











CK 




CK 




T 


ft 




Eh 








pa 




3> 





m 




~ 














« 




O 


z 




CK 






• • 


C3 


O 






z 




X 




•» 


t= 


f-> 


g 


^-N 


Z 


•A 


J- 


^-N 


• 








• 


O 


Z 


m 


M 






« 






Eh 


g 


a 


X 


M 


M 


» 


O 


O 







^ — * 




CO 






CK 


CK 





z 


Eh 


Eh 


•"5 


v 




l-H 





pa 


X 


ft 


ft 


rA 


s 








» 


•^ 


;J 


M 




d 






*^> 


r— 


•— 


«ft 


•-3 






g 


— 


•• 


• • 


4A 


CO 


■ 


■ 


* 


^-» 


« 






< 


Eh 
Z 


Eh 

Z 


a 


g 


".) 


« 


O 


to 


X 


g 


CK 


g 


SB 
M 


M 


M 


X 


CK 


CK 


CK 


< 




M 


O 


M 


ft 


CK 


CK 


M 


O 


O 


O 


g 


ft 


g 


CK 


O 


a 




ft 


ft 


O 


O 


ft 


ft 


M 


ft 


X 


a< 


08 


•A 


J- 


O 




O 


O 


O 


O 


O 


O 




, 




•~ 


•~ 


(\J 




KN, 


J- 


m 


vD 


ts 


00 




00 





ON 



Eh 
O 
ft 

z 



rA 
00 



ft 



CK 
ft 



< 
> 
+ 



a 



> 

■ 

> 

Eh 



CK 
g 

CO 

Z 

o 

M 
Eh 

< 
Eh 
M 
X 
M 
►J 



CK 
C3 

s 

ft 

pa 

a 

Eh 

CO 
CO 

g 

ft 

X 

pa 

CN 

rA 



08 

on 
on 
I 

ON 



CO 

«o 

O Hi 

M 

3 g 

M 
►J 



X 

g 



to 

a 



CK 
O 
ft 

CO 

z 
o 



CO Eh 

pa •< 

►J Eh 

I 5 



CK 
ft 



Eh 
Z 



CK 
ft 



Eh 

O 
VD 

V 

> 

Eh 

O 

Z 



X 

s 

a 

s 

ft 

CO 
M 

a 

Eh 



Z 

a 

Eh 

CO 
CO 

pa 



CK 

O 

o 

X 

Q 
Z 

< 



a 
►j 



- x 



o 
00 



o 

Eh 
O 

a 



CK cs 
ft ft 



o « 

X Eh 

u 

CO o 

o — 

< I 



Eh 
Z 



O 



> 

Eh 

Q 
Z 

< 



V 

ft 
ft 



a 

Eh 
CK 

o 

X 



Eh CO 

Z M s 
M 

? ^ 3 

ft a o 

o M 

Z M Eh 



g S g g 



CK O 

§ g 
X M 

Q O 

z z 

o 
o 

J X 
5 CK 

to ft 
ft 
o 

X 

.J z 

z < 

o o 



Eh 

a 
a 

Eh m 

3 S 



CK 
ft 



CK 
ft 



O 
Cn- 



> 

a. 
o 

o 

NO 

V 

> 



►J 

< 
pa 

a 



u ck 

CO s 

E> O 

■a! X 
O 

a o 

Z X 



Eh 
O 



X 

< 

CK 
C5 
O 

CK 
ft 



^ M 



a 

Eh 



o 

J- 



o 

Eh 
O 

a 



mom 

CO ON On 



x 
►J 
z 
o 

CO 

pa 

< 
x 
pa 
ft 

CK 

o 

ft 



a 

Eh 



O 

Eh 



O 
O 



a 
a 



o 

A 

C5 

a 



B 

a 



o 

Q 



W 

o 

M 
CO 

S5 
O 

o 



CO 
CO 
V. 

o 
o 

CO 

<? g 

cu ^^ 



a. 



a 
a 

j- 
kn. 

(\J 



SB 

E-i 



P. 

SB 

g 
6-i 



Eh 



9 s 



vs l>- 
QI rvj 



a. 
a. 



CO 

w 



o 

Eh 

W 



CB 

W 
Eh 

< 

O 



SB 

o 



SB 
O 



i-3 

■a! 
55 
O 






-3- 

IA 
rvj 
o 



O 
M 

X 

> 
+ 



o 

OO — 

rvj 

o w 

o *<* 
ca Q 

M 

•• X 

£ ^^ 

- i-3 

» << 

O > 

■ 
o 

Eh IS 

O 
-3" 
rvj 



>A 
LA 

-3- 



O IA O 

VD 

O f\J O 

CO CO 

S3 § 1 



o 
o 



K 

a. 



w 

A 



Eh 



IA O 
J- IA 
r\J rvj 



cs o 



li 

o 

< 

Eh 

I 
I 

X 

w 



I" 

Eh 



CB 
Ch 

iE 

E3 

Eh 



IA 
VD 
rvj 



g 



I" 

Eh 



I" 
Eh 



: CO 

5 § 
55 O 



g B 3 

MHO 
CB O M 
Ch Eh 



CB 

o 

w 

33 
Eh 



I 
I 

X CB 



Eh 

Eh 

I" 
O 



CB 

O 
I" 



Ch 



a 



CB 

o • 

= CO 

B = 

g 8 



2 s 

Oh 



IA 
OJ 



O 

O 



o 
o 

8 



s 



CO 


A 

M 


CO 
Eh 


S 

o 


CO 


• 
o 


y — » 


B 


CB 


o 


W 


o 


1" 


SB 


T 


IA 


* 


«< 










O 


H 


• 


IA 




J 


Q 


J 


g 


M 


O" 




CO 


w 


<* 


s 


< 


EH 


• 


+ 


■ — 


o 


o 


5; 


o 


M 


<! 


■ — 




r> 


■a! 


M 




M 


CB 


J 


OO 


O 


o 


& 


Eh 


>A 


Eh 


a. 


O 


rvl 




o 


M 




M 




EH 


• 


• 




O 


CB 
O 


• 


CB 

O 


B 


2S 


■- 


£. 


•^f 


CO 




Eh 




o 


• 


N-^ 


• 


>H 


EH 


Eh 

M 


u 

Eh 


M 
Ch 


o 
o 


& 


g 


p3 


s 



B 

w 

Eh 



CO 



IA K\ 

• O 

OJ 



-3- 



i ? 



• 

= IA 

OO 

CB C>- 

O VD 



Eh 

S 

o 



I 

• 

00 

-3- 



CB 

H 
Eh 

<! 

O 

s 
s 

Eh 

CB 

O 

g 



o 

VD 



IA 
VD 
OJ 



O 



CB 



IA C>- 



CO O 

ca m 



o o 
> S 



9 2^ 



o 

* — » 
VD 

*r\ 
IA 

J- 



8 X 



B 
S 

CB 

w 

Eh 



O 

W 



CB 

9 
i 
i 

CB 
H 

Eh 

<! 
* 



O O 
00 CT> 

OJ -3" 



— LA 



I 

J- 

o 



o 



I 

IA 



< 
Eh 



On rA 

T 7 

tv- o 

o — 



i 

aj 
o 



I 

IA 
O 



ON ^ — 



<? 7 <V 

LT\ IA IA 






o o o 

O ~ CM 

IA IA LA 



1 



o 



CB 

s 



Eh 
O 

§ 

8 

SB 



-3 



i-3 

W 



Eh 
O 

LA W 



Eh 

< 
Eh 

>h 
O 

s 

CB 

C3 

o 



Ch 



CB 
Ch 



CB 

O 

o 

>H 



CB 
Ch 



CB 
Ch 



O 

o 



IA 

-3" 



1A 
OO 



O 
O 



CB 



CO 



o 
o 



<! 
O 



* 



■ >H 

o 

a a 



Eh 
Eh 



& 
CO 



p3 v. 



-3" 



8 

IA 

• 
-3" 



-3" 
fA 



EH 



<! 
O 



CB 
Ed 
Eh 

<! 

(" 
O 

s 
s 



I B 

OO H 
oo P« 






CB 

W 



EH 

i-3 



O 
00 



O 
£h 



Ch 



O 

s 



o 
o 
o 



* 
* 



o 

w 



* 



a = 

egg 

J is 

: I Ph 



CB 



CB 



Ch 
CO 



tc 

Eh 



a CB 

M p. 
X 

3 g 

> B 

+ Ch 

(M SB 

r g 

^ Eh 

y — » 

— -3" 

• VD 

*» >■ 

SB Eh 
^^ 

o S 

M ■«! 

X 



h3 

> 



V 

Eh 



a 



o 

OO 

o 

Eh 
O 

a 



55 
O 



g 

s 

8 

CB 
Eh 



CB 
Ch 



Ch 
CO 



K 
Eh 



VD 



a 



Eh — 



IA 

A 

> 
Eh 



■ 
Eh 



O 
oo 
<\J 

O 

s 



o 

B EH* 



O 

PS 

a 

e 

CB 

E 

o 



B Si 

B 3 



Eh 
O 

W 
CO 

s 
o 

EH 



IA 

r>- 
A 

> 
Eh 

CB 
O 

-3- 
VD 

V 

> 



g 



CB 

o 



O 



to 

Eh 



CO 

SB 

o 

M 
Eh 

Eh 



O 

-3" 
rvj 






a 

Eh 



»A 
C\J 



O 

Eh 



CB 
O 
Eh 



i-3 

a 



CB 
ta 
O 
in 



CB 
Ch 



B 

Ch 



fA 
fA 
M 






Eh « 
M 5r 



i-3 
W -* 
CB W 
<! a 

M 

D 

o s 
"J I 

I M 
■ X 



a 

V 

CO 
CO 



CB 

o 
o 

>H 



s 



Eh 



> 



O 
O 



CO 

1 

Ch 



B 






o LA 
oo o> 



ON 



o o o 

O — rvj 
rvj rvj rvj 



O 

fA 
rvj 



fA 
»A 
rvj 



*1 



a 
o 

ss 



Eh 
CO 



O 

Eh 



CO 

W 

o 

PC 
CO 

o 

as 



g o 

— UN 

CO 

o 

a a 

o w 

Eh ^ 



Eh 



r a 



S3 

C3 



a 
o 



M 

=3 



a 

SB 



l-H 



UN 



UN 



a 

9 
O 



o 

00 



D 

f\ 

I 

KN 
UN 

T 

ON 

r<N 






3 3 



8 



i 
i 
i 

X 
W 

g 



EH 



3 

O 
1-1 

Eh 

a 



CO 
SB 
O 



s 



co 



OO 
OO 



o 









< 



n % 


S 


a 


YOU J 
CONGI 


e 

g 


g 



CO 



o 



K 

o 



ON 



o 



B 

M 
OO 



o 



s 
s 

Eh 
« 

o 



o 

s 

• 
UN 
UN 

K 

9 
i 
■ 



£ 



a 
j 




3 



UN 



O 

o 



< 
W 

o 



o 



s 




EH 
M 


«< 




CO 


B 




a 


O 




o 


•7 
i 
r 




3 


r<N 




M 


<\i 




H 


7 


IS 


a 


o 


« 


o 




M 




— 


H 


a 


■ 




H 




1 
3 





o 
co 



g 



d s 



g 



E-i 
CO 



M 



Of 



00 



•a! 
O 



■* 



o 

■ < 



1=1 



CO 



s s 

& e 

o o 



e 



ON 
VO 



< 

o 



1-1 

►3 

KN 









o 

s 



CO £ 

-. s 

OO Eh 

o o 



9 
i 
i 

« 



a 



w 

CO 

SB 

g 



w 

CO 

as 



ONKNC"- — UNOUNC^ONKNCOKN?- — C^-OO^) — ^) — 
KNJ-J-UNUNVOVO — -3-UNUNV0V0C-- — —000N0NO 

_,— ,— »-,— .— .— I »— .— .— •—•— »— I I •— •— •— AJ 

iiriiiioi'i 111 ^)— i i i r 

OJvO O 4 OO l\l vfl UNAJ UNON-d-OOOJ UNvOUNO UNON 

(^J(^JlAKN^r^J-J■^KNKNKNJ-J-uN^---vo^-^-^- 
C^rvivoO-d-oorviUNvoO-d-ONKNC^vovorviC^rviC*- 

OJKNKNJ-J-J-UN — KNJ-J-J-UNUN--.-C , -C , -0000 

77T777T^7777T7t>-^*T*TT7 

KNC--^UNONKNC , -J-J-C , -^UNa\KN-HrUNUNON-HrON 
r- ^nj (VjrviKNKN — 'M'MKNI'NKN-tf'- ^-UNUNvOvO 

io^ob^f-^--Hrvboj-obf\i5^uNUNONj-obi\J 

i-MmnjKlK\4-^nlKllTilf\4-4'7'ririvOvON 

7777777un777777^un7777 

00 — UNONKNC--'-KNoO!-UNON!<NC 1 -J-J-ONKNC--' - 
0»-«-«-f\Jf\JKN— *-<\Joj(\iKNKN— — -H^UNUNV^ 

JNUNUNUNUNUNUNUNUNUNUNUNliNUNUNUNvOvi3^)vXJtS] 

< 

oooooaoooooooooooooo 

OOOOOOOOOOOOQOOOQOOQO 
KNJ-UNVOC--OOONOUNVOC , -OOONO — (ViNNJ-UNvXlO 
UNir\UNUNUNir\UNvi3C^C v -C^C^C v -o0O000000000o0»- 



8 



o 






O 
O 



CO 
CO 



I 

OO 
CO 
5s 



►3 



Eh 
CO 



O 
O 



O 

o 



o 

Eh 



O 



o 
o 



CO 
CO 

0. 









o 

SB 
M 
Q 
« 
O 



Kn : 



a s i a g 

B - O fl - 



O 

o 



January, 1980 



MICRO — The 6502 Journal 



20:19 




Skylcs Electric Works 



PET 2001-8 PET owners: 

Do You Want Your PET 

To Be a Word Processor, Too? 

Well, it can be. ..with Skyles Electric Works' new Word Processing PCB 
designed especially for the 2001-8. You'll need Commodore's new Disk 
Drive, of course. And you'll need an additional 8K of RAM memory. (We 
recommend the Skyles Memory Expansion System, of course.) 

Skyles then supplies the interfacing PCB on which you can put the 
Commodore Word Processor chip. Or, even better, you can buy from Skyles 
the PCB complete with Commodore's Word Processor in place. 

But wait: you can add the Toolkit at the same time; the Toolkit with the so 
important ten commands. Here's the lineup: 



The PCB, to accept the Word Processor only 
The PCB, to accept both Word Processor and Toolkit 
The PCB, to accept Word Processor; Toolkit tested and installed 
The PCB with the Word Processor tested and installed 
The PCB with both the Word Processor and Toolkit tested 
and installed. 



$ 30.00* 

40.00* 

90.00* 

140.00* 

190.00* 



From S.E. W. only: custom designed for your PET 2001-8 to interface with 
most memory expansion systems. Or, even better, with the 8KB Skyles 
Memory Expansion System. 



PET LOVERS SPECIAL: 
S.E.W. MEMORY EXPANSION SYSTEMS 

8KB Memory Expansion System $225 
16KB Memory Expansion System $425 
24KB Memory Expansion System $625 

SPECIAL PRICE WITH PURCHASE OF ANY WORD 
PROCESSOR OPTION ABOVE 

This offer Expires February 14, 1980 



2001-8 owners, you can now use your PET for word processing. Skyles 
Electric Works didn't forget you... 

'California residents: please add 6% or 6.5% sales tax as required 
VISA, MASTERCHARGE ORDERS CALL (800) 538-3083 (except California residents) 
CALIFORNIA ORDERS PLEASE CALL (408) 257-9140 




Skyles Electric Works 



10301 Stonydale Drive 
Cupertino, California 95014 
[408J735-7891 



Lifetime of a Non-Renewable 
Resource 



One of the great problems facing the world today is the 
conservation of resources, particularly those which can 
not be readily renewed. The simple program is a good 
model of an interactive BASIC simulation. 



Marvin L. DeJong 
Dept. of Math & Physics 
The School of the Ozark s 
Point Lookout, MO 25726 



Are you interested in doing something 
simple, serious, and of educational 
value with your computer? Estimating 
the lifetime of a non-renewable resource 
such as coal, oil, or natural gas is often 
a difficult calculation involving calculus 
and the use of exponential or 
logarithmic functions. The computer 
makes it short and super simple, as you 
will see. The results have serious impli- 
cations. An editorial in our local paper 
claimed that we have enough coal to last 
for centuries. This may or may not be 
true. Read on. 

Suppose there are R tons of coal still 
unmined. Also suppose that we use C 
tons of coal per year. At the end of one 
year we will have R - C tons left. The 
next year we subtract C tons again, and 
so on until our coal is gone. If we kept 
track of the number of subtractions, we 
would know how many years the coal 
would last. This is the lifetime of the 
resource. 

However, we must take into account 
that, typically, the production and con- 
sumption of resources increases over 
time. Our demand for electrical power, 
fuel oil, natural gas, and gasoline grows. 
The gross national product, or GNP, in- 
creases in a healthy (?) economy. 
Growth implies increases in the con- 
sumption of resources, and this must be 
taken into account when calculating the 
lifetime of a resource. 

Assume that consumption of a 
resource grows by G percent per year. If 
C tons of coal are consumed this year, 
then next year we will consume C tons of 
coal plus the increase, which is G/100 
multiplied times C. Anyone who has 
calculated interest compounded annual- 



ly knows how to do the arithmetic. A sim- 
ple example may help. If we use 500 
million tons of coal this year, and our 
growth rate in the consumption of coal 
is 10 per cent per year, then next year we 
will consume 500 million tons plus 10 per 
cent of 500 million tons. 



The calculation of the lifetime of a 
resource is much the same as outlined 
above, except that C increases by G per- 
cent each year if the growth factor is 
taken into account. A flowchart of the 
entire process is shown in Figure 1, and 



10 PRINT "THIS IS A PROGRAM TO CALCULATE HOW LONG A NON-RENEWABLE 
RESOURCE WILL LAST." 

20 PRINT "TYPE IN THE ESTIMATED RESERVES OF THE RESOURCE." 

30 PRINT "RESERVES-"; 

40 INPUT R 

50 PRINT "TTPE IN THE ANNUAL RATE AT WHICH THE RESOURCE IS CONSUMED." 

60 PRINT "CONSUMPTION RATE-"; 

70 INPUT C 

80 PRINT "TYPE IN THE ANNUAL PERCENT INCREASE IN THE CONSUMPTION RATE." 

90 PRINT "GROWTH RATE OF CONSUMPTION-" ; 

100 INPUT G 

110 G-G/100 

120 Y=0 

130 R-R-C 

140 C-C+C*G 

150 Y-Y+l 

160 IF R > THEN 130 

170 PRINT "YOUR RESOURCE WILL LAST"; Y; "YEARS." 

180 END 

Table 1: Resource Depletion Program 



January, 1980 



MICRO — The 6502 Journal 



20:21 



INPUT R. 
| RESERVES 



INPUT C. 
CONSUMPTION 




1-0 
YEARS 



R = R - C 

Subtract 

Consumption 

from Reserve 



C - C + C«G 

Increase 

Consume* ion 



I - I + 1 
Increment I 




Figure 1: Flowchart to calaulate 

the Lifetime of a Non-Renewable 

Resource 



the corresponding BASIC program is 
given here. There is only one 
approximation in the calculation. I 
assumed that the consumption changes 
abruptly at the end of a year, whereas it 
actually changes more or less con- 
tinuously throughout the year, much like 
interest compounded daily. The approxi- 
mation has little effect on the results. 
The error is usually less than a year or 
two. 

Next we need some data to put into 
the computer. This can be a bit tricky 
because companies that sell the 
resource tend to overestimate the 
reserves, while conservationists are pro- 
bably biased in the other direction. The 
truth is most likely somewhere in the 
middle. My data (and the inspiration for 
this project) came from an article by Pro- 
fessor Albert A. Bartlett in the 
September 1978 issue of the American 
Journal of Physics. The data, which I 
have taken the liberty to round off to one 
significant digit, appears in Table 1. 
Other references you might want to 
check are: Dr. M. King Hubbert, A 
National Fuels and Energy Policy Study, 
Serial 93—40 (92—75) Part I, U.S. GPO, 
Washington, D.C., 1973, $2.35; and Dr. M. 
King Hubbert, "Energy Resources of the 
Earth" in Scientific American, 
September 1971. 

Almost any computer should take the 
simple BASIC program given here. Mine 
ran on my Microsoft BASIC for the 
KIM-1. Since almost every step is il- 
lustrated in the flowchart, no further ex- 
planation of the program is necessary. 
Load it and type in the data as they are 
requested. When the last item is 
entered, hit RETURN and wait for the 
answer. 

Now experiment with the input data. 
Suppose the estimate of the reserve was 
half as large as it really is. How does this 
change the lifetime of the resource? 
Does doubling the reserve double the 
lifetime? Calculate the lifetime with a 
per cent growth rate; a 10 per cent 
growth rate. Get data on natural .gas, 
copper, or other non-renewable 
resources and run the program. What 
are the actual conditions under which 
coal will last for centuries? 



Resource 

U.S. Coal 
U.S. Oil 
World Oil 



Reserves 

500 billion tons 
lOObillion barrels 
2000 billion barrels 



Current Consumption Rate Growth 

0.7 billion tons per yr. 7% 

6 billion barrels per yr. 8% 

20 billion barrels per yr. 7% 



Table 2: Data on Reserves, Consumption & Growth of 2 Resources 



■■■ni 



^ 



ssasl 



immmmm 



^raf^ : ep«^iff|^^ia|iKt'; '-' 

'|m^^^^c^^.ir^t||rf'fefe^t^r; 
gram's "arid 'Tepc^^^^aa:r'S0!( 
^Tembefsftip $15.00. ■:': ', -^ ;"'" « 'W&d'i 
; -' A^'Gfeaussey, M;D , " „'*; ' 

Medical GomputerJo 

42 E. High Street ";"-..»; *'^1 
■ E«arnptom,CT 06424 > > 
? . • ' tefc (203f 26 . r ^^ii 

:•%*''■'* APPtE%bFTlMWES- ; >iy^! 
Optimization Library $20. ^ 

Structured BASIC ? " ; : "$25; ^ v 
iii^ \ - APPLESOFT GAMES" * " l 
FARES Lunar 'lander $12. (24K)i 

INTEGER BASIC GAMES . - 
2rDfayeV faster jiaze'. .,'■ ■ >'4p}0^ 
On disk or taro frofB: •.'•' <•* £ : ^ 
5 •'■/• SENSIBLE SOFTWARE ^ "t 
: .' T P.O;Box 2395 :-- : •^■ ; i 

,. Dearborn, Mi 48123 — , 

Weal" Tennis for DAPPLE It 16«C 
TEtE^TEHNtS: a sophisticated, tf&- 
dt© game tor two pfayersi S^de view 
game features scoring,- numerous 
serves, votteys, lobs, eta "Grefi&jr* 
based, ideal gift! $9.95; checks oftFy. 
* A2Devices 

1370-D Baflena Blvd. 

Alameda; CA 94501 ■• " 

tef. (415) 763-4064 

f. PET CONTEST!! $10.00 prize ■; 
Mach. L Othello— must beat 5 times 
'and doc. Multiply search by. D. 
Schaeefcter, $15.00 entry fee. ':, 

J.K. Johoson 

9304- Emory Grv. Rd- '...-.*''-■:■. ■.:■"'] 
."!..' ©atttershufft. MD 20760 • 
Challenger (25— Matches) A - f «W 
screen video graphics and sound 
game. Ptay your computer ora.ff$Bridt 
For OST C— 1P and C^2P:-speeifr 
system. 300— Baud' cassette "and 
BocumentaUortOrty $5.00 post paid. 

DW A Software .>■■•••. ..'■./■^iy'i 

'4G£Rallcrest 7 '■.■■■'■£'-' -\ 

Mid»and r Mi 48640 

iDGt Softwar&Curcor 2tback space 
and etear screen from, keyooat<d> for 
atf camp with DJC/W/M on bceafc 
iBas. Clwsa tfuu graphlcsKi $19#pV 
Word Process, (cassette) $9 ? 95;. 
Backgammon- $9.95; (3> cate'&ws~j 
fwcfc $*5.95,: Utility prog's, rrter^y 
maps, «tc Catalogue $1:00; " 
'<■' J. EndtefProgresslw Coroptrt^jg 
3336 ftvoRdate Ct WHndsoik^ ."J 
Ontario, Canadai, N9E1XBA;£v ?<:\ 

More- on page 37. 



The Loneliness of the Microcomputer 



While most of us would agree that the microcomputer is a 
pretty great device, it is not without potential problems. One of 
the possible drawbacks to the microcomputer which I have not 
seen discussed is that of its almost exclusive "one-on-one" 
utilization. Much has been said about this type of problem with 
television. Instead of getting together with friends, family or 
neighbors after dinner, how many people now just sit in front 
of the "boob tube"? How much human interaction has been 
given up in order to watch TV? 

Microcomputers seem to be used in a mode very similar to 
TV watching. One person interacts with the microcomputer. 
Other people are not required and, unless you are showing off 
your latest program, are generally not wanted! Hardly a 
socialable device. Think about the things you do with your 
micro. How marjy of them involve another human? Balancing 
your check book, playing chess or life, solving equations ... the 
list goes on. Most of the programs which have been listed in 
the Micro Software Catalog and many of the programs 
presented in articles have been of the single individual variety. 

Assuming you agree that it would be nice to make the micro 
more socialable, how can this be done? Some micro uses are 
inherently individual. You do not necessarily want a friend 



helping you balance your checkbook. Other areas can be 
modified to permit multi-individual use and interaction. The en- 
tire games area is open to the generation of games which 
several people play, not just one. In a multi-person game, the 
micro can be used to generate and maintain a very complex 
playing situation, can generate sophisticated environments 
and display them in a variety of forms, can be the score keeper 
and when necessary the arbiter, can inform and assist the 
players, can be a time keeper, and so forth. The micro is this 
type of game is not the opponent. I hope that we will see more 
games of this type in the near future. 

Other multi-person micro applications are starting to ap- 
pear. A number of systems are being set up which permit in- 
dividuals to communicate with one another through their 
micros. There should be other areas developed which permit 
the multi-person utilization of micros. I feel that it is important 
for every computerist to occasionally question how he is using 
his equipment, and to determine what the secondary effects of 
the uses may be. 



•j6L6t*-'*f- < 4*yf 



\, 




Subscription: One Year = 12 issues. Circle correct cate- 
gory and write amount in space provided. 

Surface: 

United States $15.00 



PO Box 6502 
Chelmsford, Mass 01824 

617-2S6-SS15 

"The BEST of MICRO Volume 1" contains all of the impor- 
tant material from the first six issues of MICRO in book 
form. 

"The BEST of MICRO Volume 2" contains all of the impor- 
tant material from the second six issues [#7 to 12] of 
MICRO in book form. 

Back Issues: 



All Other Countries 

Air Mall: 

Central America 
Europe/So. America 
All Other Countries 

"BEST of MICRO Volume 1" 
Surface 
Air Mail 

"BEST of MICRO Volume 1" 
Surface 
Air Mail 



$18.00 

$27.00 
$33.00 
$39.00 

$7.00 
$10.00 



$9.00 
$13.00 



Issues 7 to 12: 
Issues 13 on: . 



No. 



No. 



All payments must be in US dollars. 

Make checks payable to: MICRO TOTAL 

Foreign payments in International Money Order or cash. 

If you are a subscriber, attach label or write subscription number here: 

Name: 

Address: 



Surface @ $1.75 each 
Air Mail ®$2.75 each 
Surface @ $2.25 each 
Air Mail @ $3.25 each 



State: 



City: 

Country (if not U.S.): 

Help MICRO bring you the info you want by completing this short questionnaire. 
Microcomputers Owned/Planning to Buy: AIM SYM KIM PET APPLE OSI Other: . . . 
Peripherals Owned/Planning to Buy: Memory Disk Video Printer Terminal Other: . . 

Microcomputer Usage: Educational Business Personal Control Games Other 

Languages Used: Assembler BASIC FORTH PASCAL Other: 

Your comments and suggestions on MICRO: 



Zip: 



EASYWRITER? the 1st true Word Processor for the Apple!' 



Are you looking for the best Word 
Processor for your Apple? Well we are 
so sure you'll choose EasyWriter that 
we've prepared this ad to help you 
make your decision EASY. Check out 
these powerful features: 

• Incremental spacing to support your 
Qume, Diablo, or Spinwriter 

• Character oriented (No line numbers 
to deal with) 

• Menu selectable routines for all 
known printers and interfaces 

• Word wrap around on screen for 
continual text entry 

• Our own new high speed DOS 
(Twice as fast as Apple's) 

• Of course full editing, disk, and 
printer commands 

• Subscripting, Superscripting, and 
MORE MORE MORE . . . 

The straight facts make EasyWriter the 
only logical choice. By the same people 
who brought you WHATSIT Available 
at your local computer store or our new 
California office! 



793 Vincente 
Berkeley, CA 94707 
(415) 525-4046 



It Isn't Software Until it Works! 



'EasyWriter 

EasyWriter is a TM of Cap'n Software 
*Dr. Memory 

Dr. Memory is a TM of Muse 
'Big Edit 

Big Edit is a TM of Gravey, Martin & Sampson, Inc. 
'Apple Pie 

Apple Pie is a TM of Programma International, Inc. 
'Super-Text 

Super-Text is a TM of Muse 
Apple 

Apple is a TM of Apple Computers, Inc. 
Whatsit 

Whatsit is a TM of Computer Headware 




Incremental Spacing 



Character Oriented Screen 



Printer Interface Routines 



Word Wrap Around 



Editing Commands 



High Speed Disk 



50 Pages of Text per Disk 



Subscripting & Superscripting 



Your Choice 



X 



X 



X 



X 



X 



X 



X 



X 



X 



X 



X 



X 



X 



X 



X 



ORDER 
FORM 



Information 
Unlimited 
Software 




146 N. Broad Street 
Griffith, IN 46319 
(219) 924-3522 



CUT ALONG DOTTED LINE 










Name: 


Company: 


Address: 


City: 


State: 




Zip: 


1 would like more information on: 


ITEM 


QUANTITY 


PRICE 


TOTAL 


Easy Writer (EZ 2) 




$ 99.95 




Whatsit Model A-l (Apple) 




125.00 




Whatsit Model CP-2 (CP/M) 




150.00 




Whatsit Model NS-3 (N Star) 




100.00 




Whatsit Manual 




25.00 




EasyWriter Manual 




30.00 




Subtotal 






$ 


CA Residents add 6% sales tax 






$ 


Shipping & Handling 






$ 


2.50 


GRAND TOTAL 






$ 


Master Charge or Visa Number 



Sweet-16 Programming 
Using Macros 



Some very useful information is presented about 
Macros in general, the APPLE II Sweet-16 Interpreter, 
and how to use them together. 



Richard C. Vile, Jr. 

3467 Yellowstone Drive 

Ann Arbor, Ml 48105 



The history of computer program- 
ming is replete with stories of the 
development of new tools. Assemblers 
were designed with the purpose of reliev- 
ing the programmer of the tedium of pro- 
gramming in binary machine language. 
Over the course of the past twenty years, 
various features have been added to 
assembly languages to further ease the 
pain. Prime among these inventions has 
been the macro capability available in 
many assemblers. Macros provide 
means for extending the expressive 
capabilities of assembly language. 
Another software tool developed in re- 
cent years is the virtual machine. A vir- 
tual machine is emulated, imitated or in- 
terpreted by a program. It provides 
capabilities not directly available in the 
hardware of the real machine on which it 
is simulated. This article discusses the 
combined application of macro 
assembly and virtual machine inter- 
pretation on the APPLE II personal com- 
puter system. 

Macro Assemblers 

Macro assemblers extend the 
capabilities of ordinary assemblers by 
providing ways to abbreviate commonly 
used sequences of instructions. Often a 
programmer will use sequences of in- 
structions that have identical opcodes 
and addressing modes, but differ only in 
the memory locations referred to. Con- 
sider the following: 



INC LOC1L 
BNE =+5 
INC LOC1H 



and 

INC LOC2L 
BNE =+5 
INC LOC2H 

where the symbol ' =' is used to refer to 
the location of the instruction being 
assembled. These two sequences both 
have the same purpose: to cause the 16 
bit quantity stored in two consecutive 
memory locations to be increased by 
one. For this example we have assumed 
that the locations are not in page zero 
and are directly addressed. A macro 
assembler will allow these sequences to 
be abbreviated using a new symbol, 
chosen by the programmer. The symbol 
must be formally declared in a Macro 
Definition, before it is used. Such a 
definition is shown below using the 
notation of the ASM/TED assembler of 
Carl Moser: 

! ! ! I N C D .MD (WHERE) 
INC WHERE 
BNE = +5 
INC WHERE+1 
.ME 

The symbol WHERE does not represent 
a specific memory location, but poten- 
tially many different memory locations. 



It is called, in assembler terminology, a 
formal or dummy parameter. Even 
though our example has only one formal 
parameter, macros in general may have 
many. The three exclamation marks 
preceding the name INCD indicate to the 
assembler that the label INCD is the 
name of a macro. '.MD' stands for Macro 
Definition and '.ME' stands for Macro 
End. The sequence of instructions bet- 
ween .MD and .ME is called the body of 
the macro. Once a macro definition is 
written into a program, the macro may 
subsequently be called by using its 
name in an instruction, as if it were an 
opcode. More sophisticated macro 
assemblers allow macros to appear in 
any field of an instruction, rather than 
just the opcode field. When a macro is 
called, the programmer is obligated to 
supply actual parameters to replace the 
dummy parameters used in the defini- 
tion. In the example given above, when 
INCD is called, it must be accompanied 
by the label associated with an actual 
memory location used by the program: 



INCD (COUNT) 

The actual parameter is substituted for 
all occurrences of the dummy parameter 
in the macro body and the instructions 
in the macro body are assembled direct- 
ly into the program at the point of the 
macro call. This is known as "expan- 
ding" the call: 



January, 1980 



MICRO — The 6502 Journal 



20:25 



INC COUNT 
BNE =+5 
INC COUNT+1 

Another way of thinking about 
macros is to view them as small 
subroutines which are inserted directly 
into a program instead of being called. 
When a short sequence of instructions 
is commonly repeated, it may be 
cheaper to make a macro out of it than 
to make it into a subroutine. Part of the 
reason for this is that it costs extra in- 
structions to pass parameters to a. 
subroutine, especially on a micro such 
as the 6502, which has a limited number 
of registers. In this example, particular- 
ly, the difference is significant. In order 
to convert the INCD macro into a 
subroutine, we would need to figure out 
a way to pass the address of the first 
byte to be incremented. For example: 

L D A "Low byte of address of 

COUNT" 
L D X "High byte of address 

of COUNT" 
JSR INCD 



INCD 



S T A CL Page Zero Loc 
STX CH Next Page Zero Loc 
LD Y #00 Assuming Y 
i available- otherwise 

;' TAY-PHA first. 

(CL),Y 

= +6 



I N C 
BNE 
INY 
I N C 
RTS 



(CL),Y 



This is surprisingly more complicated 
than the macro, which is why you pro- 
bably never thought of making it into a 
subroutine before. In general, if a 
subroutine is short and if it involves 
manipulating addresses of parameters, 
then it may be worth converting to a 
macro. 

Assemblers vary widely in the 
richness of features supported. One of 
the more desirable features to use in 
conjunction with the macro capability is 
that of conditional assembly. This 
enables a program to define instruction 
sequences and, in particular, macros, 
with much more flexibility. We shall see 
this in action when we discuss the 
Sweet-16 macros later. Conditional 
assembly directives allow the program- 
mer to control the actions taken by the 
assembler. 

Macros can be used to generate ar- 
bitrary bit patterns into the stream of ob- 
ject code produced by the assembly of a 
program. There may be subtle reasons 
for wishing to do this. One of those 
reasons forms the meat of our principal 
example: the bit patterns so generated 



may form interpretive code which can, 
via the macro capability, be interspersed 
with ordinary machine code. By using 
macros to generate the interpretive 
code, the programmer is freed from the 
odious task of hand assembly — a task 
which could discourage him from using 
the interpretive code in the first place. 

Sweet-16 

The 6502 microprocessor provides 
no direct capability for handling 16 bit 
quantities. In particular, the machine 
has no internal 16 bit registers, save for 
the PC. Thus, when it becomes neces- 
sary to do 16 bit arithmetic, or to 
manipulate pointers or 16 bit addresses, 
the programmer is forced to write in- 
struction sequences to simulate the re- 
quired operations. The APPLE II firm- 
ware contains a subroutine known as 
the SWEET-16 "dream machine," which 
does just that. It operates in an inter- 
pretive mode, taking the sequence of 
bytes following the instruction which 
calls it as virtual or interpretive code. 
Here's how it works. 

When a JSR (Jump to Subfloutine) 
instruction is executed by the 6502 pro- 
cessor, the value of the program 
counter, which in that case will be the 
address of the last byte of the JSR in- 
struction, is saved on the 6502 stack as 
two consecutive bytes. When a RTS 



"V* — »^r > nr - 



(fleAirn from Subroutine) instruction is 
executed within the called subroutine, 
that address increased by one will be 
restored from the stack to the PC, to 
enable the 6502 to continue executing 
instructions following the JSR instruc- 
tion. (See Figure 1.) The fact that the 
"return" address is saved on the stack 
means that the called subroutine can, in 
fact, find out where it was called from. 
More than that, it can use the return ad- 
dress and the indirect addressing mode 
of the 6502 to actually retrieve the se- 
quence of bytes following the calling in- 
struction. That is precisely what the 
Sweet-16 subroutine does. 

The Sweet-16 interpreter takes ad- 
vantage of the fact that the return ad- 
dress is at the top of the 6502 stack. It 
pops the two bytes from the stack and 
transfers them to a pair of page zero 
locations which it then uses as an in- 
direct address to locate the sequence of 
interpretive instructions following the 
JSR which called it. 

Thus the return address of the 
Sweet-i6 subroutine becomes the ad- 
dress of the first instruction to be ex- 
ecuted by the Sweet-16 machine. As the 
Sweet-16 machine executes instruc- 
tions, it updates this address to point to 
the next virtual instruction to be ex- 
ecuted. When the Sweet-16 interpreter 
finds an interpretive instruction 



Scallin 



calling instruction 

PC <■- (PC+1) 

PC H f-(PC+2) 



(PC)-* 




subroutine 
body 



PUSH<- (PC) 



PC T 



PC, 



Stack after 




CALL 



Stack before 



Figure 1: 6502 Subroutine Call and Return 



20:26 



MICRO — The 6502 Journal 



January, 1980 



"return," it restores the address of that 
instruction to the stack and executes a 
real 6502 FITS. This causes the pro- 
cessor to continue execution of the 
machine code following. Thus, Sweet-16 
code and real 6502 code may be mixed 
together in sequence, with Sweet-16 be- 
ing called by a JSR instruction 
preceding each "chunk" of Sweet-16 
code. 

The Sweet-16 processor contains 16 
registers, each simulated by two page 
zero locations. Register 15 doubles as 
the Sweet-16 program counter. As ex- 
plained above, the actions of the various 
Sweet-16 instructions cause the con- 
tents of the virtual PC to be updated. The 
cycle of execution of the Sweet-16 
machine is: 
1. Fetch Opcode LDY #00 

LDA (R15),Y 



2. Execute Opcode 



Transfer con- 
trol to the ap- 
propriate sec- 
tion of 
Sweet-16. 



Op Mnemonic Arguments 



3. Repeat at 1 . or Return to caller (if inter- 
pretive opcode was "return". 

The following table briefly sum- 
marizes the opcodes which the Sweet-16 
machine provides. The mnemonics used 
in the table are those chosen for the 
macro implementation discussed below. 
Further details and some examples may 
be found in the November 1977 issue of 
BYTE magazine. 

The Macros: How They Work 

Listing 1. shows the Sweet-16 
macros as defined for the Carl Moser 
ASM/TED macro assembler. The macros 
fall into two groups: the register and the 
non-register opcodes. The register op- 
codes are all assembled to values with a 
non-zero ($1 to $F) high nibble: e.g. 
LD@(R12) — $4C. The non-register op- 
codes all have a value in the high nib- 
ble of the opcode byte. Most of the non- 
register opcodes have a second byte 
which indicates a relative branch 

Effect 



displacement value, in the style of the 
6502 itself. The most interesting part of 
the set of macro definitions involves the 
calculation of this displacement. Since 
the concept of relative branch displace- 
ment is common to all the branching 
operations, a separate macro is defined 
which is used to calculate the displace- 
ment. This macro then gets called in the 
body of each branching opcode to pro- 
vide the desired value: 



HIRELBR 



.MD (LOC) 
I F P =— LOC 
. BY LOC— = — 1 

I FM =— LOC 
. BY =-LOC + 1 



.ME 



! ! ! B R .MD (WHERE) 
.BY 1 

RELBR (WHERE) 
.ME 



In 
2n 
3n 
4n 

5n 
6n 

7n 

8n 

9n 



An 
Bn 
Cn 



Dn 



SETR 
LD 
ST 
LD@ 

ST@ 
LDD@ 

STD@ 

POP@ 

STP? 



ADD 
SUB 
POPDS 



CPR 



En 


INCR 


Fn 


DECR 


00 


RTN 


01 


BR 


02 


BNC 


03 


BC 


04 


BP 


05 


BM 


06 


BZ 


07 


BNZ 


08 


BM1 


09 


BNM1 


0A 


BX 


0B 


RS 


OC 


BS 



(Rn,Constant) 
(Rn) 
(Rn) 
(Rn) 

(Rn) 
(Rn) 

(Rn) 

(Rn) 

(Rn) 



(Rn) 
(Rn) 
(Rn) 



(Rn) 



(Rn) 
(Rn) 

(addr) 



(addr) 
(addr) 
(addr) 
(addr) 
(addr) 
(addr) 
(addr) 
(addr) 



(addr) 



Rn <- Constant 

R0 -i- Rn 

Rn -i- R0 

High byte of R0 *■ 

Low byte of R0 +■ (Rn) 

(Rn) i- Low byte of R0 

R0 L <- (Rn) ; Rn <- Rn+1;R0„ *■ (Rn) 

(Rn)<- R0 T ;Rn -i- Rn+1; (Rn) <- R0„ 

L H 

Rn -i- Rn-1;R0 <- (Rn);R0„ *■ 
L H 

Rn -i- Rn-1; (Rn) *■ R0 T ; Rn +■ Rn-1; 
(Rn) - R0 H L 

R0 <- R0 + Rn 
R0 * R0 - Rn 



ROj, <- (Rn) 

Set branch conditions as a 
result of R0 - Rn. Store 
result into R13. 
Rn +■ Rn + 1 
Rn i- Rn - 1 
Return to caller 
Relative branch to addr. 
(Note: Argument is assembled 
as displacement. Source 
argument is absolute.) 
Branch if No Carry 
Branch if Carry 
Branch if prior result Plus 
Branch if prior result Minus 
Branch if prior result Zero 
Branch if prior result Non Zero 
Branch if prior result = -1 
Branch if prior result f -1 
Execute 6502 Break instruction 
Return from Sweet-16 subroutine 
Branch to Sweet-16 subroutine, 
addr must be in the range 
allowable for a relative branch. 
Return address is stored in a 
pseudo-stack whose address is 
contained in R12. 



Table 1: Sweet— 16 Instruction Set Summary 



The RELBR macro uses the condi- 
tional assembly features of the macro 
assembler. Let us examine it line by line: 

!!!RELBR .MD (LOC) 

This line indicates to the assembler 
that a Macro Definition is being in- 
itiated. The name by which the macro 
may subsequently be called is RELBR 
and the argument which must be sup- 
plied when it is called is represented by 
the dummy symbol LOC. When the 
macro is expanded by a call, the actual 
argument which is supplied in the call 
will be substituted for each occurrence 
of 'LOC in the body of the definition. 

I FP =— LOC 

This line contains one of the condi- 
tional assembly operations or directives 
of the assembler: IFP. The assembler is 
directed to evaluate the expression con- 
tained in the remainder of the line; in 
this case " = — LOC". If the result is a 
positive number (the mnemonic stands 
for IF Positive), then the assembler will 
assemble all instructions following the 
current line until it encounters a line 
containing ***, which indicates the end 
of the scope of the IFP directive. If the 
expression evaluates to a negative 
number or zero, then the assembler will 
ignore all instructions following the cur- 
rent line until the matching ***. 

The expression ' = — LOC is com- 
puted by subtracting the value of the ac- 
tual parameter substituted for LOC in 
the call from the value of the 
assembler's location counter, 
represented in ASM/TED by the 



January, 1980 



MICRO — The 6502 Journal 



20:27 



character ' = '. The location counter 
represents the address of the instruc- 
tion being assembled. 

BY LOC— = — 1 

The directive .BY instructs the 
assembler to evaluate the expression 
following and to assemble a single Byte 
of code from the resulting value. The ex- 
pression LOC— = —1 computes a value 
which is the distance from the symbol 
referenced by 'LOC to the current loca- 
tion in the object code. This value is con- 
verted by the expression to a negative 
number and adjusted by 1 to account for 
the fact that the current byte of object 
has not yet been emitted by the 
assembler. Note that there is a bug in 
the definition: if the value LOC— = —1 is 
less than —128 then an erroneous value 
will be assembled. This means that the 
user of the macro set is responsible for 
avoiding relative branches that are out 
of range. Note also that the values com- 
puted by expressions are in 16 bit, twos 
complement representation. If such a 
value is assembled using a .BY directive, 
the assembler will use the least signifi- 
cant 8 bits (low byte) of the result. 



This line marks the end of the scope 
of the IFP conditional assembly direc- 
tive used earlier. 



IFM =— LOC 

This line has the same intention as the 
IFP line, except that it tests the result of 
the expression ' = —LOC for a negative 
or Minus value. It then does or does not 
assemble the instructions following the 
IFM line and up to the matching ***, 
depending on the outcome of the evalua- 
tion. 



.BY 



:^LOC+1 



These instructions are analogous to 
the corresponding instructions follow- 
ing the IFP directive. The reason for us- 
ing both an IFP and an IFM directive is 
that the label or location referenced by 
the dummy argument 'LOC may turn out 
to be either ahead of (minus result for 
= — LOC) or behind (positive result for 
= — LOC) the instruction which invokes 
the RELBR macro. 

The remainder of the macro defini- 
tions are simple and straightforward. A 
couple of points to note are: 

.Defining @SW16 as JSR SW16 
makes the macro @SW16 
looklike a "new" assemble! 
directive. It says: 
Please switch to Sweet-16 



.Arithmetic may be performed 
on dummy arguments: 

!!!LD .MD (REG) 

.BY $20 +REG 

.ME 

This fact is crucial to the success of the 
macros. 

Sample Sweet-16 Program 

The following program allows the 
second text page of APPLE II memory to 
be copied into the first text page. The 
assembled code is shown to the left. 



45 


MOVE 


LD@ (5) 


56 




ST@ (6) 


24 




LD (4) 


D5 




CPR (5) 


04 




BP (MOVE) 


FA 






00 




RTN 



20 89 


F6 


@SW16 


15 




SETR (5 $800) 


00 08 






14 




SETR (4 $BFF) 


FF 0B 






16 




SETR (6 $400) 


00 04 







Sweet-16 can also be used more 
conveniently with this set of macros. 
They make the assembly source easier 
to read, and remove the burden of hand 
assembly from the Sweet-16 program- 
mer. 

The reader is urged to learn more 
about the macro capabilities of 
assemblers and the labor-saving uses to 
which they may be applied. 



Listing 1. 



0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 
0023 
0024 
0025 
0026 
0027 
0028 
0029 
0030 
0031 
0032 
0033 
0034 
0035 



R0 

Rl 

R2 

R3 

R4 

RS 

R6 

R7 

R8 

R9 

R10 

Rll 

R12 

R13 

R14 

R15 

! ! !SETR 



! ! »LD 
! ! 1ST 
! ! ! LD@ 
! ! !ST@ 
! ! ! LDD@ 



♦ he 





♦ DE 


1 


*he 


'J) 


♦ DE 


3 


♦ DE 


4 


♦ DE 


5 


♦ DE 


6 


♦ DE 


7 


♦ DE 


8 


♦ DE 


9 


♦ DE 


10 


♦ DE 


11 


♦ DE 


12 


♦ DE 


13 


♦ DE 


14 


♦ DE 


15 


♦ ES 




♦ MD 


< REG ADDR ) 


♦ BY 


S10+REG 


♦ SE 


ADDR 


♦ ME 




♦ MD 


(REG) 


♦ BY 


*20+REG 


♦ ME 




♦ MD 


(REG) 


♦ BY 


*30+REG 


♦ ME 




♦ MD 


(REG) 


♦ BY 


$40-t-REG 


♦ ME 




♦ MD 


(REG) 


♦ BY 


*50+REG 


♦ ME 




♦ MD 


(REG) 



20:28 



MICRO — The 6502 Journal 



January, 1980 



0036 
0037 
0038 
0039 
0040 
0041 
0042 
0043 
0044 
0045 
0046 
0047 
0048 
0049 
0050 
0051 
0052 
0053 
0054 
0055 
0056 
0057 
0058 
0059 
0060 
0061 
0062 
0063 
0064 
0065 
0066 
0067 
0068 
0069 
0070 
0071 
0072 
0073 
0074 
0075 
0076 
0077 
0078 
0079 
0080 
0081 
0082 
0083 
0084 
0085 
0086 
0087 
0088 
0089 
0090 



! ! ! STD@ 
! ! !POP@ 
! ! ISTPe 
! ! ! ADD 
! ! !SUB 
! ! IPOPDt? 
! ! !CPR 
! ! i I NCR 
! ! IDECR 
! ! !RTN 
! ! ! RELBR 



H ! BR 



! ! !BNC 



M !BC 



! ! IBP 



♦BY $60+REG 

.ME 

.MD (REG) 

.BY S70+REG 

.ME 

.MD ( REG) 

.BY *80+REG 

.ME 

.MD (REG) 

.BY *90+REG 

.ME 

.MD (REG) 

.BY *A0+REG 

.ME 

.MD (REG ) 

.BY $B0+REG 

.ME 

.MD (REG) 

.BY *C0+REG 

.ME 

.MD (REG) 

.BY $D0+REG 

.ME 

.MD (REG) 

.BY $E0 + REG 

.ME 

.MD (REG) 

.BY *F0+REG 

.ME 

♦ MD 

.BY 00 
.ME 

.MD (LOO 

IFP =-L0C 

.BY LQC-=-l 

##* 

IFM 

.BY 

*#* 

.ME 

.MD (WHERE) 

♦ BY 1 

RELBR (WHERE) 

.ME 

.MD (WHERE) 

♦ BY 2 

RELBR (WHERE) 

.ME 

.MD (WHERE ) 

.BY 3 

RELBR (WHERE) 

.ME 

♦MD (WHERE) 

.BY 4 

RELBR (WHERE) 



=-L0C 
=-L0C+l 



0091 




.ME 


0092 ! 


! »BM 


.MD (WHERE) 


0093 




.BY 5 


0094 




RELBR (WHERE) 


0095 




.ME 


0096 ! 


! !BZ 


.MD (WHERE) 


0097 




.BY 6 


0098 




RELBR (WHERE) 


0099 




.ME 


0100 ! 


! !BNZ 


.MD (WHERE) 


0101 




.BY 7 


0102 




RELBR ( WHERE ) 


0103 




.ME 


0104 ! 


! !BM1 


.MD (WHERE) 


0105 




.BY 8 


0106 




RELBR (WHERE) 


0107 




.ME 


0108 ! 


! IBNM1 


.MD (WHERE) 


0109 




.BY 9 


0110 




RELBR ( WHERE ) 


0111 




.ME 


0112 ! 


! !BRK 


.MD 


0113 




.BY *A 


0114 




.ME 


0115 ! 


! ! RS 


.MD 


0116 




.BY *B 


0117 




.ME 


0118 ! 


! !BS 


♦MD (WHERE) 


0119 




.BY $C 


0120 




RELBR (WHERE) 


0121 




.ME 


0122 ! 


! IGSW16 


.MD 


0123 




JSR *F689 


0124 




.ME 


0999 




♦ EN 



LABEL FILE: I / = EXTERNAL 1 



/R0=0000 

/R3=0003 

/R6=0006 

/R9=0009 

/R12*000C 

/R15=000F 

//0000f0200f0200 



/Rl=0001 

/R4=0004 

/R7=0007 

/R10=000A 

/R13=000D 

/R2=0002 

/R5=0005 

/R8=0008 

/Rll=0OOB 

/R14=0OOE 



January, 1980 



MICRO — The 6502 Journal 



20:29 



Screen Write/File Routine 



Here is a routine, both useful and instructive, which 
makes it simple to Edit the Apple Screen and Save the 
Screen Image on Disk. 



B.E. Baxter 

6761 King's Harbor Drive 

Rancho Palos Verdes, CA 90274 



The screen write/file routine is a 
simple 73-byte device to take control 
away from the monitor and write directly 
to the screen. All of the escape editing 
capabilities are supported, so that it is 
very easy to enter and modify up to and 
including 21 lines of text. It is equally 
easy to then save the screen image to 
disk after completion of text entry. 

The source code is straightforward 
and makes liberal use of monitor 
routines. Upon entry the cursor is homed 
and placed on line 1 (not zero). The block 
labeled KEY continually polls the key- 
board and outputs characters through 
COUT (VIDOUT [$FBFD] could also be 
used if printer services are not wanted). 
The limited editing facilities of the 
monitor are invoked by typing (escape) 
followed by one of the command char- 
acters. Keyboard entry of (control) Q is 
used to exit the routine and return to 
BASIC via $3D0. Automatic exit is also 
obtained at line 22. Upon exit, the bell 
will sound and the BASIC prompt char- 
acter will appear with the file para- 
meters displayed at the end of the line. 
At this point the file must be saved using 
the command, (BSAVE File name) 
A$0400, LS03CF (RETURN). The paren- 
thetical expressions must be typed by 
the user; that is, type BSAVE file name, 



then trace over the remainder of the line 
with the right arrow to place it into the 
keyboard buffer and at the end of the 
line press RETURN. Although I do not 
find it necessary, a monitor MOVE to 
page 2 could be set up and inserted at 
line 225 of the source listing. This would 
provide back-up in case the BSAVE com- 
mand is messed up. The object code is 
assembled at $0350 and is $49 bytes 
long. 



In summary, the usage commands 



are: 



Entry to Routine 




From BASIC 


Call 848 


From Monitor 


$0350G 


Exit to BASIC Mode 


User 


(Control) Q 


Automatic 


Line 22 


Edit Screen (See 


APPLE Ref. Materials) 


(Escape) 


@: Home cursor 




(Clear text) 




A: Advance cursor 




B: Backspace cur- 




sor 




C: Move cursor 




down 1 line 



D: Move cursor up 
1 line 

E: Clear from cur- 
sor to end of line 
F: Clear from cur- 
sor to end of screen 

Save Screen Image 

[BSAVE file name]A$0400,L$03CF[CR< 
[ ] = typed by user 



Of course it doesn't make much 
sense to idly write to the screen without 
some useful purpose. I use the routine to 
create instruction and documentation 
files. These files are especially valuable 
for object code utilities by providing 
ready access to usage and entry point 
information. Once the file has been 
created, it can be handled just like any 
other file. BLOADing (file name) will im- 
mediately display its contents on the 
screen without requiring any otherwise 
useful memory. Instruction/print 
statements in BASIC programs can 
therefore be eliminated; to be replaced 
by deferred execution BLOAD disk com- 
mands for a very efficient use of main 
memory. 



20:30 



MICRO — The 6502 Journal 



January, 1980 



0100: 
0110: 
0120: 
0130: 
0140: 
0150: 
0160: 
0170: 
0180: 
0190: 
0200: 
0210: 
0220: 
0230: 
0240: 
0250: 
0260: 
0270: 
0280: 
0290: 
0300: 
0310: 
0320: 
0330: 
0340: 
0350: 
0360: 
0370: 
0380: 
0390: 
0400: 
0410: 
0420: 
0430: 
0440: 
0450: 
0460: 
0470: 
0480: 
0490: 
0500: 
0510: 
0520: 
0530: 
0540: 
0550: 
0560: 
0570: 
0580: 
0590: 
0600: 
0610: 
0620: 
0630: 
ID= 



0350 
0350 
0350 
0350 
0350 
0350 
0350 
0350 
0350 

0350 20 58 FC 
0353 20 8E FD 



0356 20 35 FD KEY 
0359 C9 91 
035B F0 OC 
035D A6 25 
035F EO 16 
0361 FO 06 
0363 20 ED FD 
0366 4C 56 03 



0369 
036B 
036D 
0370 
0373 
0375 
0377 
0379 
037B 



A9 
85 
20 
20 
A9 
85 
A9 
85 
AO 



16 
25 
5B 

3A 
E4 
09 
07 
OA 
00 



FB 
FF 



038A AO 

038B CI 

038C A4 

038D BO 

038E B4 

038F BO 

0390 BO 

0391 AC 

0392 CC 

0393 A4 

0394 BO 

0395 B3 

0396 C3 

0397 C6 

0398 AO 



COUT 
HOME 

CV * 

TABV * 

RDCHAR * 

CROUT * 

BELL * 

POS * 



ORG 

* 

* 



QUIT 



037D B9 8A 03 OUT 

0380 91 09 

0382 C8 

0383 CO OF 
0385 DO F6 
0387 20 DO 03 



DATA 



JSR 
JSR 



$0350 
$FDED 
$FC58 
$0025 
$FB5B 
$FD35 
$FD8E 
$FF3A 
$0009 

HOME 
CROUT 




JSR RDCHAF 
CMPIM $91 
BEQ QUIT 
LDXZ CV 
CPXIM $16 
BEQ QUIT 
JSR COUT 
JMP KEY 



LDAIM 

STAZ 

JSR 

JSR 

LDAIM 

STA 

LDAIM 

STA 

LDYIM 



$16 

CV 

TABV 

BELL 

$E4 

POS 

$07 

POS 

$00 



LDAY DATA 
STAIY PCS 
INY 

CPYIM $0F 
BNE OUT 
JSR $03D0 

$A0 
$C1 
$A4 
$B0 
$B4 
$B0 
$B0 
$AC 

$CC 
$A4 
$B0 
$B3 
$C3 
$C6 
$A0 



+01 



A 
$ 

4 


j 

L 
$ 



C 
F 



NIBBLE is an unusual new Newsletter 
for Apple II Owners. Each Issue will 
follow a major theme. . . such as: 

* DATA BASE MANAGEMENT 

* PROGRAMS FOR THE HOME 

* TEXT PROCESSING 

* COMPUTING FOR KIDS 

* SMALL BUSINESS JOBS 

* GAMES AND GRAPHICS 

* PRACTICAL PASCAL 

* etc. 

Significant programs will be in each 
issue, surrounded by articles which 
show how to USE the programming 
ideas in your OWN programs. 

Examples of Upcoming Articles. . . 

* Building a Numeric Keypad. 

* Home Credit Card Management. 

* LO RES Shape Writing. 

* Arcade Shooting Gallery Game. 

* Random #'s in Assy. Language. 

* HI RES Weaving Design. 

And many many more. NIBBLE will 
literally "Nibble Away" at the myster- 
ies of the Apple II to help Beginning 
and Advanced Programmers, Small 
Businessmen, and the Whole Family 
enjoy and USE the Apple MORE! 

It costs a paltry $15. 00 for 8 Issues! 
It will invite and publish user ideas 
and programs. DON'T WAIT! Send 
your check or money order right now, 
to receive the January issue! Mail to: 

S.P.A.R. C. 
P.O. Box 325 
Lincoln, Mass. 01773 

Software Publishing And Research Co. 




ULTIMATE JOYSTICK FOR THE APPLE II 

$49.95 



The Apple Joystick is a quality crafted dynamic 
interactive I/O device engineered specifically for the 
apple computer. The stick comes completely wired 
for oaddles & 1 and switches 0, 1 & 2. Among the 
excellent features of the stick are auto-centering, which 
positions the stick in the center of its range whenever 
the handle is released, and positive action switches 
with tactile feel and audible feedback. 

The stick assembly itself is a precision molded unit 
originally designed for the ultimate in smooth linear 
proportional control required for international 
radio-control model competition. 

The heart of the stick centers around two cermet 
resistive elements with bifurcated wiper contacts, which 
provide the smooth continuous change in resistance 
not found in wire-wound elements. 

As an added bonus, all game I/O connections are 
brought out and terminated in the cabinet. This feature 
facilitates modification and/or implementation of all 
game I/O functions, such as, (example: annunciators, 
sound, paddles 2 and 3). Using Gesu's double I/O 
extender cable and two joysticks (one modified for 
paddles 2 and 3) two player joystick games can be 
implemented. 

Normally no adjustment is required upon installation 
of the stick in your Apple computer. However, if it should 
become necessary to adjust the centering, mechanical 
adjustment tabs are provided inside the stick cabinet. 

Refer to the Apple II reference manual for directions 
on how to install the stick in your computer. 



GAME I/O EXTENDER 
CABLES single $10.00 

DOUBLE $16.00 

The single model consists of one foot of cable, 
one 16-pin male and one 16-pin female connector. 
The extender plugs into the game I/O and the female 
end if secured to the outside of the cabinet with the 
double-backed mounting tape provided. Installed in 
this fashion the extender eliminates the necessity of 
opening the apple computer to install or remove the 
stick or any other game device. 

The double model is exactly the same as the 
single model with the addition of a second 16-pin 
female connector. This extender has the same advan- 
tages as the single extender plus allowing two sticks 
or game I/O devices to be installed simultaneously. 
Note: When two games I/O devices are installed simul- 
taneously make sure no conflicts exist betwen paddle 
assignments. Only one device should be assigned to 
each paddle. 



ComputerWorld 

6791 WESTMINSTER AVENUE 
WESTMINSTER, CA 92683 
(714) 891-2587 TELEX 182274 



JOIN 

RAYGAMCO 

NOW. 




Become a 
member of 
RAYGAMCO 
Computer 

Discount Club. ____ .„„, 

AND MORE 

BIG SAVINGS ON EVERY ITEM!_ 



SAVE 

20% 




By being a RAYGAMCO Member you receive substantial discounts on every item you 
purchase, including all hardware, software, accessories, even books and paper! You 
will also receive a monthly newsletter with all the latest available for your particular 
computer system, and much, much more — exclusive to RAYGAMCO Members only! 

All the famous brand names, including: 
APPLE Alpha Micro Soroc Lear Siegler 

ATARI Alpha Pro Hazeltine Shugart 

EXIDY/Sorcerer Cromemco Sektor Texas Instruments 
Kim/Commodore Xerox PET 

SAVE 20% AND MORE 



Here's how to join. 

Fill out the information, and mail. That's all there is to it. Nothing to buy. 
^ I want to be a RAYGAMCO Computer Discount Club Member. Please send my 
"J RAYGAMCO Membership card to: 

Name 



Address 
City 



. State 



.Zip. 



Computer (Brand Name) 

I would like information on (please specify system, part, accessory, book, program, etc.) 



WE HONOR VISA, MASTERCHARGE, BANKAMERICARD. 

Store Hours: Sat 10-6, Sun 12-4, Tu-Fri 11-8 



TOLL FREE, EXCEPT CA 

800-854-6455 



RAYGAM, INC. 



6791 WESTMINSTER AVENUE WESTMINSTER, CA 92683 
TELEX 182274 (714) 891-2587 




BOX 120 

ALLAMUCHY, N.J. 07820 

201-362-6574 



HUDSON DIGITAL ELECTRONICS INC. 

THE HDE DISK SYSTEM. 

HERE'S WHAT ONE USER HAS TO SAY . 

REPRINTED BY PERMISSION FROM THE 6502 USER NOTES - ISSUE NO. 14 



PRODUCT REVIEW of the HDE DISC SYS- 
TEM by the editor. 

A number of you have asked for details 
about the HDE full size disc system. 

The system is based around the SYKES 8" 
drive with the 6502 based intelligentcontrol- 
ler. 

This drive is soft sectored, IBM compatible, 
and single density which lets you store about 
a quarter megabyte of data on a disc. 

The system software, called FODS (File Ori- 
ented Disc System), manages sequential files 
on the disc much the same way files are writ- 
ten on magnetic tape - one after another. 
When a file is deleted, from a sequentially 
managed file system, the space that the file 
occupied is not immediately reallocated, as in 
some disc operating systems. As it turns out, 
this can be an advantage as well as a disad- 
vantage since deleted files on the FODS sys- 
tem can be recovered after the file has'been 
deleted. (This has saved my sanity more than 
once!) Of course when you want to recover 
some of the disc space taken up by a number 
of these deleted files, you can simply re-pack 
or compress the disc and all the active files 
will be shifted down until there are no deleted 
files hanging around using up space. 

FODS has this ability to repack a disc. 

When saving and loading in FODS you work 
with named hies, not track and sector data or 
I.D. bytes. This makes life a lot easier. I've 
seen some disc systems where you have to 
specify track and sector info and/or I.D. bytes. 
Whal a pain that can be! 

If you | ust want to save a source file tempor- 
arily, you can do that on what's known as 
"scratch-pads" There are two of these on a 
disc, "scratch-pad A" and "scratch-pad B". 
each of these temporary disc filescanholdup 
to 1 6 K or if "B" is not used. "A'" can hold one 
file uo to 32 K in length. The only files that can 
be temporarily saved on scratch pad are fifes 
that have been built using the system text 
editor 

Being a dyed in the wool assembly lan- 
guage programmer. I really appreciate the 
FODS text editor' This line oriented editor is 
upwards compatible with the MOS/ARESCO 
editor but includes about everything you 
could ask for in a line editor. There is a fuil and 
semi-automatic tine numbering feature, lines 
can be edited while they are being entered or 
recalled and edited later, strings can be lo- 
cated and substituted, the tine numbers can 
be resequenced. the file size can be found, 
the hex address of a line can be known and 
comments can be appended to an assembly 
file after it has been found correct. Oops! I 



forgot to say lines can also be moved around 
and deleted. This isn't the complete list cf 
FODS editor commands, just the ones that 
immediately come to mind. 

Another very powerful feature of the sys- 
tem is the ability to actually execute a file con- 
taining a string of commands. For example, 
the newsletter mailing list is now being stored 
on disc. When I want to make labels, I would 
normally have to load each letter file and run 
the labels printing program. But with FODS, I 
can build up a "JOB" file of commands and 
execute it. 

The job fife in turn calls each lettered label 
file in and runs the label printer automatical- 
ly. The way computers are supposed to oper- 
ate right 9 

Here's a listing of the job file I use to print 
mailing labels: 
:LIS PRTLBL 

0005 LOD A:RUN %LABELLOD BJMP.EOOO: 
LOD CJMP.EOOO: 

0010 LOD D:JMP.E000:LOD E:JMP.E000: 
LOD F:JMPE000: 

0015 LOD G:JMP.E000:LOD HJMP.EOOO: 
LOD IJMP.EOOO: 

0020 LOD JJMP E000:LOD K:JMP E000" 
LOD LJMP E000 

0025 LOD M:JMP.E000:LOD MC: JMP.E000: 
LOD N:JMP.E000: 

0030 LOD O:JMP.E000:LOD P:JMP .E000: 
LOD R:JMP.E000" 

0035 LOD S:JMP.E000-LOD T:JMP .E000: 
LOD VJMP.E000: 

0035 LOD S:JMP.E000.LOD T.JMP E000: 
LOD VJMP.EOOO: 

0040 LOD W:JMP.E000 LOD XY2: JMP.E000 
0045 LOD EXCH:JMP.E000:LOD COMP: 
JMP.E000: 

Remember the MOS/ARESCO assembler I 
reviewed several issues ago 7 Well HDE went 
and fixed up all the problem areas that I 
mentioned in the review and then took it 
several steps further. The HDE assembler is 
an honest to goodness two-pass assembler 
which can assemble anywhere in memory us- 
ing multiple source files from the disc. The as- 
sembler is an optional part of the system. 

If you're the kind of person (as I am) who 
enjoys having the ability to customize, modi- 
fy, and expand everything you own - you'll 
enjoy the system expansion abilities FODS 
has to offer. Adding a new command is as 
simple as writing the program, giving it a 
unique three letter name and saving if to disc 
Whenever you type those three letters the 
system will first go through its own command 
table, see that its not there and then go out 



and read the disc directory to see if it can find 
it. If it's on the disc it will read it m and execute 
it. Simple right 9 I've added several commands 
to my system and REALLY appreciate having 
this ability. Some of the things I've added 
include a disassembler, an expanded ver- 
sion of XIM (the extended machine language 
monitor from Pyramid Data), Hy pert ape, and a 
number of system utilities which make life 
easier. By the way, toget back to the system, 
all you need to do is execute a BRK instruc- 
tion. 

HDE also provides a piece of software that 
lets you interface Microsoft 9 digit BASIC to 
their disc system. The software allows you to 
load the BASIC interpreter itself from disc as 
well as saving and loading BASIC Programs to 
and from the disc. This particular version of 
the software doesn't allow for saving BASIC 
data but HDE mentioned that this ability may 
be possible with a future version. 

The first thing I do with a new piece of soft- 
ware after I get used to using it is try to blow it 
up. I did manage to find a weak spot or two in 
the very first version of FODS (a pre-release 
version) but the later, release version has 
been very tight. 

The standard software that is included with 
the system consists of the disc driver soft- 
ware, the system text editor and the BASIC 
software interface. Several command exten- 
sions may also be included. All the necessary 
stuff like a power supply, the KIM-4 interface 
card, and all cables and connectors are in- 
cluded, ft took me about 45 minutes to get 
things up and running the first time I put the 
system together. 

Admittedly, a dual full size disc system from 
HDE is probably beyond the means of most 
hobbyists but if you or your company is look- 
ing for a dynamite 6502 development sys- 
rem, I would recommend this one. I've used 
the Rockwell System 65 while I was at MOS 
and fee! that dollar for dollar, feature for 
feature, the HDE system comes out on top 
The only place the HDE system falls short 
when stacked up next to the System 65 is in 
the area of packaging. At this point, there is no 
cabinet forthediscdrivesavailablefrom HDE. 

So far. I've got nothing but good things to 
say about HDE and their products Everything 
I've received from them has been industrial 
quality. That includes their documentation 
and product support. I'm very impressed with 
what I've seen from this company so far and 
quite enthusiastic over what my KIM has 
become since acquiring the disc system and 
its associated software. 

ERIC 



THANK YOU MR. REHNKE! 

HDE PRODUCTS - BUILT TO BE USED WITH CONFIDENCE 
AVAILABLE DIRECT OR FROM THESE FINE DEALERS: 



JOHNSON COMPUTER 

Box 523 

Medina. Ohio 44256 

216-725-4560 



ARESCO 

P.O. Box 43 

Audubon, Pa 19407 

215-631-9052 



PLAINSMAN MICROSYSTEMS 

Box 1712 

Auburn. Ala. 36830 

80C-633-8724 



LONE STAR ELECTRONICS 

Box 488 

Manchaca. Texas /8652 

612-282-3570 



PERRY PERIPHERALS 

P.O. Box 924 

Miller Place. N.Y. 1 1764 

516-744-6462 



SYM-1 Tape Verification 



One of the problems with using audio cassettes on any 
system is knowing whether or not the data has been 
recorded properly. By the time you find the data did not 
get recorded properly, it is usually too late to do any- 
thing about it. Here is a technique and program to verify 
the tape dump on a SYM-1. 



Jack Gieryic 

2041 138th Avenue, N.W. 

Andover, MN 55303 



Do any of you other SYMMERS ever 
wonder if your tape save has executed 
successfully? This "problem" began to 
haunt me more and more as my tape 
library grew. A fair amount of time would 
be lost if the data on my tape was in er- 
ror. It is possible (even though remotely) 
two bits could be in error such that they 
would "cancel" each other out in the 
checksum verification at the end of tape 
read. With all this floating through my 
mind I decided to write the following 
tape verification program. 

After executing a tape save (high 
speed format only) this program will 
read the data back and compare it byte 
for byte, to the data in the memory which 
you just saved. This program needs no 
external information (parameters) from 
the user. The beginning and ending ad- 
dresses of the data in memory is ex- 
tracted from the tape. At the end, the 
checksum is also verified. All the user 
need do is rewind the tape after a high 
speed format save, execute this program 
and then start the tape unit in the read 
mode. 

The program is relocatable to any 
point in the memory. No alterations are 
necessary. This makes it easy to move 
the program into any area of memory via 
the MOV command. Just remember to 
avoid placing any part of the program 
near the top of page one or within the 
data you just saved on tape. Please note 
that this program is compatible with 
monitor version SY1.0. 



0010: 




0020: 




0030: 




0040: 




0050: 




0060: 


0200 


0070: 




0080: 




0090: 




0100: 


0200 


0110: 


0200 


0120: 


0200 


0130: 


0200 


0140: 


0200 


0150: 


0200 


0160: 


0200 


0170: 


0200 


0180: 


0200 


0190: 




0200: 




0210: 




0220: 


0200 


0230: 


0200 


0240: 




0250: 




0260: 




0270: 


0200 


0280: 


0200 


0290: 


0200 


0300: 


0200 


0310: 


0200 


0320: 


0200 


0330: 


0200 


0340: 


0200 


0350: 


0200 


0360: 


0200 



SYM - 1 TAPE VERIFICATION 
BY JACK GIERYIC 
JULY, 1979 

ORG $0200 

MONITOR SUBROUTINES 



ACCESS * 


$8B86 


CHKT * 


$8E78 


M0NITR * 


$8000 


0UTBYT * 


$82FA 


RDBYTH * 


$8DE2 


RDBYTX * 


$8E28 


RDCHTX * 


$8DDE 


START * 


$8DB6 


SYNC * 


$8D82 


CONSTANTS 




CLKC0N * 


$1F 


SYN * 


$16 


MONITOR STORAGE 


BUFADH * 


$00FF 


BUFADL * 


$00FE 


CHKH * 


$A637 


CHKL * 


$A636 


DDR IN * 


$A002 


DISBUF * 


$A640 


EAH * 


$A64B 


EAL * 


$864A 


LATCHL * 


$A004 


MODE * 


$00FD 



January, 1980 



MICRO — The 6502 Journal 



20:35 



Messages 

If the tape agrees with the data in 
memory and the checksum is correct 
then the message "good" appears on 
the LED's. If the checksum is in error 
(even though the data compared correct- 
ly) then the message "CSUM" appears 
on the LED's. If any data is in error then 
the address of the first compare error 
appears on the LED's and the program 
terminates without checking the re- 
mainder of the data on tape. 

Programming Hints 

I'd like to pass along a few sugges- 
tions to you SYMMERS just getting into 
programming. Begin your program's 
(code) at location '200 (page two). Do not 
put anything (code, preset constants) in- 
to page one. Any constants you need in 
page zero should be initialized by your 
program. Do not set constants in page 
zero and then store them on tape along 
with your code. Do not use spare system 
RAM for code, constants, or temporary 
data storage. Begin all tape saves at 
location '20CT. Avoid saving page one on 
tape. I urge you to follow these sugges- 
tions as it will make your programmi 
tasks just a bit easier. 



I 



Advertiser's lnf< ifmatloit *:*S 
MICRO offers to its ac \{ertfsers; a\. 
Selective readership - jpime<2at65Qj2 
based computers only jVi 
not get lost among t ipse for xothir 
types of machines. |: ... % ; 

Effective advertising - A- Most of Our 
advertisers repeat eve y month. . : ■; 
Relatively inexpensive rates — Sirtee 
part of MICRO'S Reason 'foV 
publishing is to promol ethe65©2,Qur 
advertising rates are k spt low^ In the 
past six months our circulation has 
increased 50 percent to it our advertis- 
ing rates have stayed lie same. \V' 
Quality printing— Incli ides two-color 
advertising regularly; t tfee- and- four- 
color ads are available ' - 
Regular monthly publti ration. 
Short lead time — approximately 
four weeks from advert i?ing deadline 
to delivery date. |- 
Dealer Circulation — dyer half of our 
circulation is through stores. Your.ad 
can be seen while customers are still 
deciding and buying. : k 
Multiple Exposure — S nee MICRO is 
kept by readers for later reference, 
your ad is seen over ar d over.' 

To receive our Media K t, please coiy 

tac,: MICRO •'•' T 

P.O. Box 6502 ; 
Chelmsford, M\. 01824 ' 



20:36 



0370: 


0200 






VIAACR 


* 


$A00B 




0380: 


0200 






VIAPCR 


* 


$A00C 




0390: 
















0400: 


0200 


20 86 


8B 


BEGIN 


3SR 


ACCESS 




0410: 


0203 


A0 80 






LDYIM 


$80 


SET MODE = HIGH SPEED 


0420: 


0205 


20 B6 


8D 




3SR 


START 


INITALIZE 


0430: 


020e 


AD 02 


A0 




LDA 


DDR IN 


SET INPUT PORT 


0440: 


020B 


29 BF 






ANDIM 


$BF 




0450: 


020D 


8D 02 


A0 




STA 


DDR IN 




0460: 


0210 


A9 00 






LDAIM 


$00 




0470: 


0212 


8D 0B 


A0 




STA 


VIAACR 




0480: 


0215 


A9 IF 






LDAIM 


CLKCCN 


SET UP CLOCK 


0490: 


0217 


8D 04 


A0 




STA 


LATCHL 


STORE IN L0 LATCH 


0500: 


02 1A 


20 82 


8D 


L0ADA 


0SR 


SYNC 


GET IN SYNC 


0510: 


021D 


20 DE 


8D 


LOADB 


3SR 


RDCHTX 


READ CHARACTER 


0520: 


0220 


C9 2A 






CMPIM 


$2A 


IF NOT START OF DATA 


0530: 


0222 


F0 06 






BEQ 




L0ADC 


0540: 


0224 


C9 16 






CMPIM 


SYN 


THEN IF NOT IN SYNC 


0550: 


0226 


DO F2 






BNE 


L0ADA 


THEN RESTART SYNC SEARCH 


0560: 


0228 


F0 F3 






BEQ 


LOADB 


ELSE KEEP LOOKING FOR * 


0570: 














ELSE START OF DATA 


0580: 
















0590: 


022A 


A5 FD 




L0ADC 


LDA 


MODE 


CLEAR NOT IN SYNC BIT 


0600: 


022C 


29 BF 






ANDIM 


$BF 




0610: 


022E 


85 FD 






STA 


MODE 




0620: 


0230 


20 '28 


8E 




0SR 


RDBYTX 


READ PAST ID 


0630: 


0233 


20 28 


8E 




0SR 


RDBYTX 


GET SAL FROM TAPE 


0640: 


0236 


20 78 


8E 




3SR 


CHKT 


ADD TO CHECKSUM 


0650: 


0239 


85 FE 






STA 


BUFADL 


SAVE 


0660: 


02 3B 


20 26 


8E 




GSR 


RDBYTX 


GET EAL FROM TAPE 


0670: 


023E 


20 78 


8E 




0SR 


CHKT 


ADD TO CHECKSUM 


0680: 


0241 


85 FF 






STA 


BUFADH 


SAVE 


0690: 


0243 


20 28 


8E 




0SR 


RDBYTX 


GET EAL FROM TAPE 


0700: 


0246 


20 78 


8E 




0SR 


CHKT 


ADD TO CHECKSUM 


0710: 


0249 


8D 4A 


86 




STA 


EAL 


SAVE 


0720: 


02 4C 


20 28 


8E 




0SR 


RDBYTX 


GET EAH FROM TAPE 


0730: 


024F 


20 78 


8E 




DSR 


CHKT 


ADD TO CHECKSUM 


0740: 


0252 


8D 4B 


A6 




STA 


EAH 


SAVE 


0750: 
















0760: 


0255 


20 E2 


8D 


L0ADD 


0SR 


RDBYTH 


GET NEW BYTE 


0770: 


0258 


A6 FE 






LDX 


BUFADL 


IF NCT END - OF - DATA +0L 


0780: 


025A 


EC 4A 


86 




CPX 


EAL 




0790: 


02 5D 


DO 07 






BNE 


L0ADE 




0800: 


02 5F 


A6 FF 






LDX 


BUFADH 




0810: 


0261 


EC 4B 


A6 




CPX 


EAH 




0820: 


0264 


F0 11 






BEG 


L0ADF 




0830: 
















0840: 


0266 


20 7e 


8E 


L0ADE 


0SR 


CHKT 


THEN UPDATE CHECKSUM 


0850: 


0269 


A0 00 






LDYIM 


$00 


IF BAD COMPARE 


0860: 


026B 


Dl FE 






CMPIY 


BUFADL 




0870: 


026D 


DO 3D 






BNE 


L0ADG 


THEN ISSUE ERROR MESSAGE 


0880: 


026F 


E6 FE 






INC 


BUFADL 


ELSE INC CDMPARE ADDRESS 


0890: 


0271 


DO E2 






BNE 


L0ADD 




0900: 


0273 


E6 FF 






INC 


BUFADH 




0910: 


0275 


DO DE 






BNE 


L0ADD 


LOOP 


0920: 












ELSE CHECK FOR / CHARACTER 


0930: 


0277 


C9 2F 




LDADF 


CMPIM 


$2F 


IF NOT / 


0940: 


0279 


DO 43 






BNE 


L0ADH 


THEN ERROR 


0950: 


027B 


20 28 


8E 




0SR 


RDBYTX 


ELSE IF CHECKSUM IS GOOD 


0960: 


027E 


CD 36 


A6 




CMP 


CHKL 




0970: 


0281 


DO 3B 






BNE 


L0ADH 




0980: 


0283 


20 28 


8E 




0SR 


RDBYTX 




0990: 


0286 


CD 37 


A6 




CMP 


CHKH 




1000: 


0289 


DO 33 






BNE 


L0ADH 




1010: 












THEN 


EXIT OK 


1020: 


028B 


A2 CC 






LDXIM 


$CC 


STOP TAPE 


1030: 


028D 


8E 0C 


A0 




STX 


VIAPCR 




1040: 


0290 


A9 6F 






LDAIM 


$6F 


ISSUE OK MESSAGE 




MICRO — The 6502 Journal 




January, 1980 



1050: 


0292 


8D 


41 


A6 


STA 


DISBUF 


+01 "GOOD" / 


A 


1060: 


0295 


A9 


5C 




LDA1M 


$5C 






1070: 


0297 


8D 


42 


A6 


STA 


DISBUF 


+02 




1080: 


029A 


A9 


5C 




LDA1M 


$5C 






1090: 


02 9C 


6D 


43 


A6 


STA 


DISBUF 


+03 




1100: 


02 9F 


A9 


5E 




LDA1M 


$5E 






1110: 


02A1 


8D 


44 


A6 


STA 


DISBUF 


+04 




1120: 


02A4 


A9 


00 




LDAIM 


$00 






1130: 


02A6 


8D 


45 


A6 


STA 


DISBUF 


+05 




1140: 


02A9 


4C 


00 


80 


OMP 


MONITR 






1150: 


















1160: 


02AC 


A5 


FF 


LOADG LDA 


BUFADH 


DISPLAY COMPARE ERROR MESSAGE 




1170: 


02AE 


20 


FA 


82 


OSR 


OUTBYT 


ADDRESS 




1180: 


02B1 


A5 


FE 




LDA 


BUFADL 






1190: 


02B3 


20 


FA 


82 


JSR 


OUTBYT 






1200: 


02B6 


A9 


00 




LDAIM 


$00 






1210: 


02B8 


8D 


41 


A6 


STA 


DISBUF 


+01 




1220: 
1230: 
1240: 


02BB 


4C 


00 


80 


JMP 


MONITR 


EXIT TO MONITOR 




02BE 


A9 


39 


LOADH LDA1M 


$39 


CHECKSUM ERROR MESSAGE 




1250: 


02C0 


8D 


42 


A6 


STA 


DISBUF 


+02 


i 


1260: 


02C3 


A9 


6D 




LDAIM 


$6D 




% 


1270: 


02C5 


8D 


43 


A6 


STA 


DISBUF 


+03 


1 


1280: 


02C8 


A9 


3E 




LDAIM 


$3E 






1290: 


02CA 


8D 


44 


A6 


STA 


DISBUF 


+04 




1300: 


02CD 


A9 


37 




LDAIM 


$37 






1310: 


02CF 


8D 


45 


A6 


STA 


DISBUF 


+05 


1 


1320: 


02D2 


A9 


00 




LDAIM 


$00 




i 


1330: 


02D4 


8D 


46 


A6 


STA 


DISBUF 


+06 


1 


1340: 


02D7 


4C 


00 


80 


OMP 


MONITR 


EXIT TO MONITOR 


1 


1350: 
ID = 



















Classified Ads 

Superboard and C— 1P Users: Sub 
Commander; Life; OSI 500 Race; WWI 
Battle (tank vs. blimp for 2); all with 
FULL documentation, $8.95 each> 
$27.95 for all. Ask about music 
systems software for live perfor- 
mance. 

Soundsmith Software Studio 
308 4th Street 
Pacific Grove, CA 93950 
Omni Plotting Package on disk for 
APPLE Computers with Applesoft on 
ROM. Disk and manual— $24.00. 
Axe Software International 
237 Star Rte. 
Santa Barbara, CA 93105 
BASIC program manual has 96 pages 
of step-by-step instructions for OSI 
Challenger IP and Superboard II 
owners. Order "Getting Started with 
Your C1P" from 
TIS 

Box 92I, Dept. M 
Los Alamos, NM 87544 
Price: $5.95 plus $1 postage and 
handling 

ADVERTISE IN MICRO 
A classified ad may be run for 
$10.00 per month. Ad should not 
exceed 6 lines, one per person (or 
company). Must relate to 6502 in- 
dustry, must be prepaid. Ad 
deadline: 25th of month. 



KIM/SYM/AIM-65-32K EXPANDABLE RAM 

DYNAMIC RAM WITH ON BOARDTRANSPARANT REFRESH 
THAT IS COMPATIBLE WITH KIM/ SYM/AIM-65 
AND OTHER 6502 BASED MICROCOMPUTERS. 




ASSEMBLED/ 
TESTED 



tWITH 32K RAM J4I9JM 
WITH 16K flAM S349JM 
WITHOUT RAM CHIPS J279JM 

HARD TO GET PARTS ONLY (NO RAM CHIPS) , $109.00 
BARE BOARD AND MANUAL 149.00 



- PLUG COMPATIBLE WITH KIM/SYM/AIM-65. 
MAY BECONNECTEDT0PETUSINGADAPTOR 
CABLE. SS44-E BUS E0GE CONNECTOR. 

- USES *5V ONLY (SUPPLIE0 FROM HOST 
COMPUTER BUS). 4 WATTS MAXIMUM. 

- BOARD ADDRESSABLE IN 4K BYTE BLOCKS 
WHICH CAN BE INDEPENDENTLY PLACED ON 
4K BYTE BOUNDARIES ANYWHERE IN A 64K 
BYTE ADDRESS SPACE. 

. ASSEMBLED AND TESTED BOARDS ARE 
GUARANTEED FDR ONE YEAR, AND 
PURCHASE PRICE IS FULLY REFUNDABLE IF 
BOARD IS RETURNED UNDAMAGED WITHIN 
14 0AYS. 

r BUS BUFFERED WITH 1 LS TTL LOAD. 

r 200NSEC4116RAMS. 

- FULL DOCUMENTATION 



I PET INTERFACE KIT M9.00 

CONNECTS THE ABOVE 32K EXPANDABLE RAM TO A 4K OR 8K PET. 
CONTAINS EXPANSION INTERFACE CABLE BOARD STANDOFFS. 
POWER SUPPLY MODIFICATION KIT ANO COMPLETE INSTRUCTIONS. 



6502. 64K BYTE RAM AND CONTROLLER SET 

MAKE'WK BYTE MEMORY FOR YOUR 6800 OR 
6502. THIS CHIP SET INCLUDES: 

* 32M5K4116-3 16KX1.200NSECRAMS. 

* 1 MCJ480 MEMORY CONTROLLER. 

* I MC3242A MEMORY ADDRESS 
MULTIPLEXER AND COUNTER. 

* DATA AND APPLICATION SHEETS. PARTS 
TESTED AND GUARANTEED. 

J325.00 PER SET 



I6KXI DYNAMIC RAM 
THE MK4116-3 IS A 16,384 BIT HIGH SPEED 
NMDS, DYNAMIC RAM. THEY ARE EQUIVALENT 
TO THE MOSTEK, TEXAS INSTRUMENTS, OR 
MOTOROLA 41 16-3 

» 200 NSEC ACCESS TIME, 375 NSEC CYCLE 
TIME. 

* 16 PIN TTL COMPATIBLE. 

. BURNED IN AND FULLY TESTED 

* PARTS REPLACEMENT GUARANTEED FOR 
ONE YEAR 

18.50 EACH IN QUANTITIES OF 8 



ALL ASSEMBLED BOARDS AND MEM- 
ORY CHIPS CARRY A FULL ONE YEAR 
REPLACEMENT WAflANTY. 



Announcing... 

OPTIMIZED SYSTEMS SOFTWARE 
UPGRADE YOUR APPLE II ® WITH A NEW SYSTEMS SOFTWARE PACKAGE 

• Unified Operating System 

• Disk File Manager 

• Commercial Basic 

• Editor/Assembler/Debugger 

• Data Base Manager 

Optimized Systems Software does not use Apple DOS®. OSS is a unified and complete systems software 
package with its own Operating System and File Manager. The Operating System, the File Manager and 
the Basic combined use only slightly more RAM than Apple DOS® alone. Requires 48K Apple II® with 
Disk II. 



Operating System 

• Byte and Block I/O 

• Simple User Interface 

• Simple Device Interface 

(create your own) 



File Manager 

• Open, Read, Write, Delete, Lock, etc. 

• Random Access via Note & Point 

• File Names of Primary. Ext type 



Basic 


Ei 


ditor/ Assembler/Debugger 


• Nine Digit Precision DECIMAL Roating Point 


• 


Line Editor 


• 32 K Byte Strings 




(Edits Basic programs, too) 


• Variable Names to 256 significant characters 


• 


Mini Assembler 


• I/O Interface Statements 


• 


Maxi Assembler 


(no PRINT "control-D...") 


• 


Disassembler 




• 


Step, Trace, etc. 


Available NOW at Special Introductory Prices 






• Operating System + File Manager 




$24.95 


• Operating System + File Manager + Basic 




$49.95 


• Operating System + File Manager + ASM 




$49.95 


• Operating System + Rle Manager + Basic + 


ASM 


$89.95 


• Operating System + Data Base Manager 




(2nd Q) 



Order today. Add $2.00 for shipping & handling. California residents add 6% sales tax. Visa/Mastercharge 
welcome. Personal checks require 2 weeks to clear. 

Note: Apple II®, Apple DOS® are trademarks of Apple Computer, Inc. 

Optimized Systems Software 
Shepardson Microsystems, Inc. 
20823 Stevens Creek Blvd., Bldg. C4-H 
Cupertino, CA 95014 
(408) 257-9900 



Microbes and Miscellanea 



"\ 



R. M. Mottola from Boston, MA writes: 

It has been brought to my attention that my Screen 
Dump Software (14:27) will not work with a printer that 
can handle more than 40 columns. To correct this, 
please make the following changes: 

580 NEXT:PRINT"":REM Null $ 

585 NEXT: NEXT 

These changes will provide the carriage return that 40 
column printers add automatically. 

I'd also like to thank William Luebbert for his APPLE II 
memory map. It is the most valuable article I've read fn a 
long time. 



Jack Gieryic of Amdover, MN found a disturbing bit of in- 
formation in the July 1979 issue of MICRO, Nicholas 
Vritis' article "The First Book of KIM— on a SYM": 

Mr. Vrtis recommended a hardware modification to 
remove the jumper enabling system RAM write project, 
jumper MM-45. His alternative to this modification is to 
insert a JSR ACCESS in order to remove the write pro- 
tect. 

I strongly urge all SYM owners to use the JSR AC- 
CESS to free up system RAM prior to code which writes 
into system RAM and, if possible, the JSR NACCES after 
your code to once again write protect system RAM. Do 
not remove jumper MM-45. 

I have two reasons for urging avoidance of the hard- 
ware change. First, your program may contain a bug: 
elsewhere which inadvertantly writes into some or all of 
system RAM. Permanently removing the write protect 
feature will make this bug more difficult to trace. In- 
stead of "missing data" in some buffer or variable (a 
problem relatively easy to "see" and figure out) you may 
have memory alterations which could be impossible to 
view as a critical element of system RAM was 
destroyed. 

The second reason looks to the future a bit. If 
Synertek ever does add a disk option to the SYM, I 
wouldn't be surprised if critical information relating to 
the disk driver were located in the- system RAM. If so, a 
bug which alters this memory could also cause your 
disk data to be destroyed. This supposition does 
assume quite a bit but is not outside the realm of 
possibility. 



Philip L. Bryan suggests that in the article of Robert 
Carlson's, "Baudot Teletype Driver", in the Sept. issue, 
the op-code for RORA should be 6A, not 68. 



Robert A. Peck of Sunnyvale, GA says: 

I tried the SYMphony in Stereo program in June 1979 
MICRO, and ran into some difficulties which I have fixed 
for my machine, and I wanted to let you know about the 
problems. 

Problem A: Program goes from 0200-0278, data area 
overlaps— 0270-03F2. Actions: Begin data area at 279, 
GO TO 3FB change 0004 to 79, 0005 to 38. 

Problem B: Data for the starting tune addresses is 
picked up from the wrong locations. At 0219 and 0223. 
the instruction "B1 04" is used. This will pick up the data 
byted stored in locations 4 &. 5, add the Y register con- 
tents, and use this as the effective address of the data 
to be loaded into location 0, then location 1. After execu- 
tion, location zero contains "05" and location one will 
contain the contents of location 2F02. This combination 
XX05 does not match the starting address of the note 
table. Actions: Change 021 A to "1D". change 0224 to 
'■10", store "04" at 0010. and store -00" at 0011. 

Problem C: Second half of tune (part 2 of table) never 
starts, always stays within first part. Action: Change in- 
struction at 0239 to read: 

0239 30 37 BMI 0272 GO TO BUMP. 

Problem D: On completion of the tune, it goes back 
and repeats the second half only— on completion of a 
tune, any repeat should repeat the ENTIRE tune. Action: 
Change 0230 to "E2". 

It works fine with these changes. 



George Shim of Williamstown, MA has this idea: 

If you have updated your SYM— 1 with the new 
monitor, MON 1.1, then John Gieryic's SYM— 1 Tape 
Directory, (8:35) needs changing. 

Change From To 



0206 


B6 


A9 


021 B 


82 


52 


021 E 


DE 


E1 


0231 


28 


26 


0236 


28 


26 


023B 


28 


26 


0204 


E2 


E5 


0245 


E2 


E5 


02BC 


0B 


06 



Then it works fine. 



More MICROBES on following page... 







I From LeRoy Moyer of Charlottsvitle, VA: 


OD, A9, 00, 6A, 
65, 00, 85, 0C, 
A2, 08, A0, 00, 


MICRO contains many articles which I enjoy, par- 


ticularly those that deal with machine language 


B1, 0C, 91, OE, 


routines. In the November issue the Applesoft 


E6, OE, DO, 02, 


. Renumbering program was a very useful addition. One 


E6, OF, 18, A5, 


modification that 1 made to the program that other 


OD, 69, 04, 85, 


readers may be interested in is to include a 


OD, CA, DO, EC, 




EE, CO,83,A5, 


CMP #BC 


00, C5, 07, DO, 


BEQ $6020 


06, A5, 01,05, 




08, FO, 10, E6, 


This is put in the vicinity of $6GF7to 6D01 and will then 


00, A5»00,C9, 


also do the LIST function. 


28, DO, C3.A9, 




00, 85, 00, E6, 


■*■■' 


01, DO, BB, 68, 


Bob Bishop of Mountain View, CA has corrections for 


AS, 68, AA, 60. 


his article, "APPLE II Hires Picture Compression" 




(18:17): 


E.D. Morris of Midland, Ml informs us that: 


On page 23, under listing 2, there should be at 0CC0: 






The article "Tokens" which appeared in the August 


AO, 00, 84, 03, 


issue of MICRO was actually co-authored by myself and 


A2, 40, 86, 04. 


Al Adams, 407 Roltcrest, Midland, Ml 48640. 


98,91,03, C8, 




D0,FB, E6,04, 




CA, DO, F6, 60. 


And Elsa Lewis from Chapel Hill, NC wonders about our 


Also in Listing 3 at 1280 Hexidecimai it should read: 


illustrations... 


8A, 48, 98, 48, 


The article on writing for MICRO (17:59) had some 


A5, 10. 8D, C1 


practical ideas. However, the one thing I found out of 


83, A9, C2, 85, 


line was the etches! Maybe the person depicted should 


OE, A9, 83, 8$ 


have been using a microcomputer, printer, and word pro- 


OF, A9.00. 8D, 


cessor to compose the article. Would anybody owning a 


CO, 83, 85, 00, 


micro still be plunking away at a typewriter? 


85, 01, A5, 01, 




4A. 09, 60,85. 


J 



T.D.Q. 

TAPE DATA QUERY 

THE IDEAL SOLUTION FOR PERSONAL AND 
VERY-SMALL BUSINESS DATA MANAGEMENT 



PET-8K 



TRS-80-LVL II 



* COMPLETE CASSETTE FILE MANAGEMENT SYSTEM 

— ENGLISH-LIKE COMMAND LANGUAGE 

— REPORT GENERATOR 

— UTILITY PACKAGE 

— NO PROGRAMMING KNOWLEDGE REQUIRED 

— REQUIRES 2 CASSETTE RECORDERS 

* T.D.Q. APPLICATION CASEBOOK 

— COMPLETE DIRECTIONS TO MICRO-COMPUTERIZE: 

• INVENTORY CONTROL • CUSTOMER DIRECTORY 

• ACCOUNTS RECEIVABLE • APPOINTMENT SCHEDULING 

• ORDER PROCESSING • VENDOR MASTER FILE 

• LABEL PRINTING • PAYROLL JOURNAL 

• CHECK PRINTING • CHECKBOOK JOURNAL 

• INVOICE PRINTING ©TELEPHONE BOOK 

• RENT COLLECTION 

** SPECIAL YEAR-END SALE PRICE — $100.00** — INCLUDES" 

CASEBOOK; 2 CASSETTES; 3 USER'S MANUALS & REF. CARDS 

ORDERS MUST BE RECEIVED BY JAN. 31, 1980 

SEND CHECK OR MONEY-ORDER TO: 

H. GELLER COMPUTER SYSTEMS 

DEPT. M 

P.O.BOX 350 

NEW YORK, N.Y. 10040 

(N.Y. RESIDENTS ADD SALES TAX) 



AIM 65 




AIM 65 is fully assembled, tested and warranted. With the 
addition of a low cost, readily available power supply, it's 
ready to start working for you. 

AIM 65 features onboard thermal printer and 
alphanumeric display, and a terminal-style keyboard. It 
has an addressing capability up to 65K bytes, and comes 
with a user-dedicated 1K or 4K RAM. Two installed 4K 
ROMS hold a powerful Advanced Interface Monitor 
program, and three spare sockets are included to expand 
on-board ROM or PROM up to 20K bytes. 

An Application Connector provides for attaching a TTY 
and one or two audio cassette recorders, and gives exter- 
nal access to the user-dedicated general purpose I/O lines. 

Also included as standard are a comprehensive AIM 65 
User's Manual, a handy pocket reference card, an R6500 
Hardware Manual, an R6500 Programming Manual and an 
AIM 65 schematic. 

AIM 65 is packaged on two compact modules. The 
circuit module is 12 inches wide and 10 inches long, the 
keyboard module is 12 inches wide and 4 inches long. 
They are connected by a detachable cable. 

THERMAL PRINTER 

Most desired feature on low-cost microcomputer systems . . . 

• Wide 20-column printout 

• Versatile 5x7 dot matrix format 

• Complete 64-character ASCII alphanumeric format 

• Fast 120 lines per minute 

• Quite thermal operation 

• Proven reliability 

FULL-SIZE ALPHANUMERIC KEYBOARD 

Provides compatibility with system terminals . . . 

• Standard 54 key, terminal-style layout 

• 26 alphabetic characters 

• 10 numeric characters 

• 22 special characters 

• 9 control functions 

• 3 user-defined functions 

TRUE ALPHANUMERIC DISPLAY 

Provides legible and lengthy display . . . 

• 20 characters wide 

• 16-segment characters 

• High contrast monolithic characters 

• Complete 64-character ASCII alphanumeric format 



BY ROCKWELL INTERNATIONAL 



PROVEN R6500 MICROCOMPUTER SYSTEM DEVICES 

Reliable, high performance NMOS technology . . . 

• R6502 Central Processing Unit (CPU), operating at 1 
MHz. Has 65K address capability, 13 addressing modes 
and true index capability. Simple but powerful 56 
instructions. 

• Read/Write Memory, using R2114 Static RAM devices. 
Available in 1K byte and 4K byte versions. 

• 8K Monitor Program Memory, using R2332 Static ROM 
devices. Has sockets to accept additional 2332 ROM or 
2532 PROM devices, to expand on-board Program 
memory up to 20K bytes. 

• R6532 RAM-Input/Output-Timer (RIOT) combination 
device. Multipurpose circuit for AIM 65 Monitor functions. 

• Two R6522 Versatile Interface Adapter (VIA) devices, 
which support AIM 65 and user functions. Each VIA has 
two parallel and one serial 8-bit, bidirectional I/O ports, 
two 2-bit peripheral handshake control lines and two 
fully-programmable 16-bit interval timer/event counters. 

BUILT-IN EXPANSION CAPABILITY 

• 44-Pin Application Connector for peripheral add-ons 

• 44-Pin Expansion Connector has full system bus 

• Both connectors are KIM-1 compatible 

TTY AND AUDIO CASSETTE INTERFACES 

Standard interface to low-cost peripherals . . . 

• 20 ma. current loop TTY interface 

• Interface for two audio cassette recorders 

• Two audio cassette formats: ASCII KIM-1 compatible 
and binary, blocked file assembler compatible 

ROM RESIDENT ADVANCED INTERACTIVE MONITOR 

Advanced features found only on larger systems . . . 
Monitor-generated prompts 
Single keystroke commands 
Address independent data entry 
Debug aids 
Error messages 
Option and user interface linkage 

ADVANCED INTERACTIVE MONITOR COMMANDS 

Major Function Entry 
Instruction Entry and Disassembly 
Display/Alter Registers and Memory 
Manipulate Breakpoints 
Control Instruction/Trace 
Control Peripheral Devices 
Call User-Defined Functions 
Comprehensive Text Editor 

LOW COST PLUG-IN ROM OPTIONS 

4K Assembler— symbolic, two-pass $79.00 
8K BASIC Interpreter $99.00 

POWER SUPPLY SPECIFICATIONS 

+ 5 VDC ± 5% regulated @ 2.0 amps (max) 
+ 24 VDC ±15% unregulated @ 2.5 amps (peak) 
0.5 amps average 



PRICE: $369.00 (-ikram) 

Plus $4.00 UPS (shipped in U.S. must give street address), 
$10 parcel post to APO's, FPO's, Alaska, Hawaii, Canada, 
$25 air mail to all other countries 

We manufacture a complete line of high quality expansion 
boards. Use reader service card to be added to our mailing 
list, or U.S. residents send $1.00 (International send $3.00 
U.S.) for airmail delivery of our complete catalog. 




ENTERPRISES 

INCORPORATED 



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








Introducing AppleSeed, our 
newest publication to whet 
your Apple* appetite! 

We invite you to subscribe to AppleSeed - the 
magazine that is to the Apple II* what SoftSide is to 
the TRS-80**. It offers the newest in software pro- 
gramming hints and ideas tailored especially for 
your computer. AppleSeed features challenging pro- 
grams for both the do-it-yourselfer and the in- 
dividual interested in pre-packaged programs and 
games . . . your own preview of the best available on 
the market today. A typical slice of AppleSeed con- 
sists of one major (new 16K) commercial level pro- 
gram (completely listed for your keying pleasure), 
accompanied by two or three applications for prac- 
tical use or fun, supplemented by informative ar- 
ticles to polish your Apple*,. Get right to the core of 
your Apple* needs and order AppleSeed today! 12 
issues, 1 year, $15.00. AppleSeed is the newest 
member of . . . 



_5off5i3e. 

PUBLICATIONS 

6 South Street, Mllford, NH 03055 
(603) 673-5144 



*A registered trademark of Apple Computers. **A registered trademark of Radio Shack and Tandy Corp. 



20:42 



MICRO — The 6502 Journal 



January, 1980 



Symbol Table Sorter/Printer 
for the AIM Assembler 



Some information about the AIM Assembler, a program 
to print the Symbol Table - sorted alphabetically or 
numerically, and some other useful stuff. 



Mel Evans 
ERIM, P.O. Box 8618 
Ann Arbor, Ml 48107 



) 



When the first Rockwell AIM showed 
up at the local computer store, mouths 
started watering. For a KIM user, to see 
an AIM is to want one. It is hard to resist 
that fine keyboard and display, the 
clever little printer, and sockets for 
Monitor, RAM, Assembler, and BASIC; or 
for 2716 EPROM with your own stuff on 
it. I've been running KIM with a Memory 
Plus board (8K RAM, 8K EPROM, 2716 
programmer, and a 6522 VIA), mounted 
with power supply and I/O board in an at- 
tache case for portable use. This rig 
hasaccumulated a half-dozen 2716's full 
of KIM software, and I intend to continue 
working on KIM applications. Since AfM 
provides the same VIA, I bought one with 
the justification that it would help me 
develop more and better KIM software. If 
you write it and debug it on AIM, and 
move it over to KIM, you're done, right? 

Well, yes. After a bit of learning about 
conversion from one memory map to 
another, it really does work that way. 
The mnemonic insert mode ("I" com- 
mand) is a joy to use. There are no more 
op-code lookups and branch calcula- 
tions and there are fewer typos. And the 
disassembler ("K" command) lets you 
check your work faster and more ac- 
curately. But for clean, patch-free object 
code, the assembler is the best of all. 
Six-character variable names! No line- 
number hassle! Six-character labels, 
such as "JMP NEXT," or "BEQ 
OUTCHR." And for easy transfer of ob- 
ject code from AIM to KIM, it's the 
assembler that really does it. It makes 
the writing of relocatable code almost 
automatic. 



The AIM assembler lacks one feature; 
there is no command for printing the 
symbol table after an assembly. So here 
is a little program that fits on Page Zero 
and does just that. After assembling any 
program, load this one and start at 10. It 
prints two listings of the assembly sym- 
bol table; one sorted alphabetically by 
symbol name, and the other sorted 
numerically by symbol address. The first 
list is helpful when going through the 
assembly listing. The second is even 
more helpful when reading the output of 
the disassembler; it lets you know right 
away that the cryptic "JSR E9BC," for 
example, is a jump to subroutine 
OUTALL 



The source (assembly-language) ver- 
sion of the sort/print program is shown 
in Figure 1. The assembly listing, with 
absolute addresses, is shown in Figure 
2. A disassembler listing is not shown; if 
you can't assemble this one, you don't 
need it! 

The sorting algorithm is plain brute- 
force; it is desigbed to conserve memory 
space, not sorting time. But even so, it 
takes much less time to sort a list than it 
does to print it. The only tricky feature of 
the program is in its allocation of zero- 
page memory; in loading, it carefully 
avoids wiping out the six bytes that 
remember symbol-table size and loca- 
tion, because it will need them to know 
where to work when you hit "Go." 

Figure 3 shows, as an example, the 
use of the assembled program on its 



own symbol table. Notice that you don't 
have to find and enter the location and 
size of the symbol table; the program 
finds these from the zero-page bytes 
that it conserved while loading. 

One note of caution in case you don't 
read the following section. When you 
assemble this source program, don't 
direct the object code to memory. Direct 
it to tape. Then load it and start at 10. 

AIM-to-KIM Software Conversion 

The following assumes that you have 
more space in AIM RAM than you will 
need for KIM memory. It works well with 
a 4K AIM, and even better with 8K. 

The idea is to use AIM for both 
assembly and running of the program 
during the debug phase. In the process 
of editing source, assembling, and runn- 
ing (and re-editing, re-assembling, re- 
running, re-editing, etc., etc.), much time 
can be saved by not having to load 
source from tape, dump object to tape, 
and reload object from tape for the next 
run. (If you have disc, this may be less of 
a problem. I wouldn't know.) So, build 
your source with the editor (the very 
good editor), assemble from memory, 
and direct object to memory — to any 
available memory, not necessarily where 
it will go in KIM. It will be easy to move 
later if you follow one rule: don't use fix- 
ed addresses except where really 
necessary. 

Look at Figure 1 again. Observe that 
the only fixed addresses used are those 



January, 1980 



MICRO — The 6502 Journal 



20:43 



of the six zero-page bytes containing 
symbol-table location and size (STLO 
through NSYMHI), the four Monitor 
subroutines needed for printing (CLR 
through CRCK), the start of the scratch- 
pad block (• =$00), and the start of the 
main program (• =$10). All other ad- 
dressing is either relative 
( • = * + 1 , • = • + 4) or by label (JSR 
SORT, JMP COMPAR, BNE SWAP), with 
absolute addresses and branch offsets 
assigned during assembly. Therefore, 
this whole program could be moved to 
KIM by simply changing the scratchpad 
start to any convenient spot in KIM zero- 
page, changing the program start to any 
appropriate spot in KIM RAM, and re- 
assembling, with object-output to tape 
in KIM format. 

That last phrase, "output to tape in 
KIM format," is where we hit the first 
snag. The AIM User's Manual says the 
assembler will do this, but the manual is 
wrong. If you try OUT-OBJ = K, the poor 
thing locks up in a trance, and the only 
recovery is RESET. (If you would like an 
explanation from Rockwell on why this 
happens, call Dave Sawtelle, AIM Ap- 
plications, 714-632-0975. This number is 
worth writing down; AIM Applications is 
a very competent and helpful group.) 

So how do you output object to tape in 
KIM format? You have your choice of 
two ways. The simple way is to output 
object to tape in AIM format, load this 
back into AIM, and then DUMP it to tape 
in KIM format. This works fine, but it is 
slow. The faster way, if you have room in 
AIM RAM, is to send object to memory 
and then DUMP in KIM format. Before 
you do either, read on, or you may hit the 
second snag. 

The above sort/print is a bad example 
of KIM-convertible code, for two 
reasons. The first is obvious; consider- 
ing its function, KIM couldn't do 
anything with it. The second illustrates 
some further precautions. 

The AIM editor and assembler use the 
top third (and some of the bottom) of 
Page Zero, and several pieces of Page 
One are used by tape I/O and monitor. 
Furthermore, you can't (yet) trust the 
momory map, in the User's Manual. 
Rockwell is diligently fixing the 
mistakes and has already issued Revi- 
sion 1, but it is still too new to be totally 
reliable. For example, look at the equate 
list in Fig. 1 again. Notice those zero- 
page addresses for STLO through 
NSYMHI? Does the memory map tell you 
they are used by the assembler? No, it 
doesn't. STLO, STHI, NSYMLO, and 
NSYMHI are mentioned in the chapter 
on the assembler (Section 5.2). I found 
ENLO and ENHI by accident! 

In order to assemble to memory and 
run, try to avoid putting either program 
or data on either Page Zero or Page One, 



unless you want to discover, by trial and 
error, the undocumented portions of the 
memory map. It's okay to assign zero- 
page variables, but don't use the 
assembler to initialize them with data. 
The data may not survive the assembly. 

Now, how about a program destined 
for Page Zero, such as the sorter/printer 
above? The final version (as listed 
above) must be assembled with object- 
output to tape, and can then be safely 
loaded and run. But during debug, the 
assemble-to-memory-and-run cycle can 
still be used by moving program and 
data to higher memory. For example, 
just before YTAB, change "* = * +1" 
to "• =$200" (to move data to Page 2); 
and before START, change "* =$10" to 
"* =$300" (to move the program to 
Page 3). This changes some addressing 
modes from zero-page to absolute, but 
the assembler takes it in stride. Now 
assemble to memory and run. After it all 
works, move data and program down to 
Page Zero, and assemble to tape. 

What if you need to use Page One? 
The push-down stack at the top of Page 
One is the same in AIM as in KIM, so 
there is no problem there. (Simply allow 
a bit more room for the deeper-pushing 
AIM monitor.) The AIM memory map 
shows eleven Page One bytes (106-107, 
115-11D) used by tape I/O, and eight 
bytes (168-16F) used by the monitor. The 
tape I/O bytes can be handled like Page 
Zero bytes; i.e., avoid until assembling to 
tape. The eight monitor bytes should 
probably be permanently avoided; load 
them into KIM by hand after everything 
else is transferred. And as an extra 
precaution, check all of Page One for 
wipeouts before running in KIM. 

Please do not let all these cautions 
scare you off. It really is fast and easy 
after a little practice. Most programs 
grow during debug, and much of the 
above only applies if your program has 
grown to the point where you are 
cramped for memory space. 

Fig. 4 shows how simple it is when 
there is plenty of room. This is a general- 
purpose "move block" program that will 
go anywhere in memory (RAM or ROM), 
and it will move any size block from 
anywhere to anywhere. The assembly 
listing (Fig. 5) shows that it occupies 24 
HEX bytes of memory, and uses six 
bytes of zero-page. Before moving it to 
KIM, change that "• =$00" to the start 
of the six-byte block you want it to use in 
KIM. Don't bother to change the 
" • = $200" starting address; after you 
have it in KIM, you can use the program 
to move itself to wherever you want to 
keep it. I keep two copies on tape, one 
that loads to zero-page and one to the 
top of RAM, plus one more in EPROM 
With another copy in AIM, it can be used 
for general memory transfer in either 



direction; move blocks to $200-3FF, 
dump to tape, load to $200-3FF in the 
other machine, and move to wherever. 

If all you want is the block-move code, 
Fig. 6 gives a disassembler listing and a 
hex dump. It can be put anywhere, but 
this version needs the bottom six bytes 
of zero-page for "From", "End", and 
"To". 



Figure 1: Source Listing, 
Sorter/Printer 



, I*'-; 



CNTLO 

*=*+!' 

CNTHI 

fiDLO 
*=*+! 

ftDHI 

VI 
*=++! 

V2 

VL1M 
*=++± 

VTAB 

;VTAB DATA 

. DBV $0088.- *0S0E 

iMAIN PROGRAM 
; JUMP OVER 8B, 0C 



20:44 



MICRO — The 6502 Journal 



January, 1980 



i <T0 $10 :> 


LDH >:RDLCD, V 


STR RDLO 


*s*10 


LDV VI 


LDR STHI 


STfiRT 


STR CADLQ).. V 


STR RDHI 


.; SORT BV NfiME 


PLR 


RTS 


LDh #6 


LDV V2 




STR VLIM 


STR <flDL0),V 


INCfiDR C 


LDX #8 


INC VI 


LDfi RDLO 


JSR SORT 


INC V2 


RDC #8 


i SORT BV ADDRESS 


LDfi VI 


~i | r~j ri ^.' |_ :_j 


LDR #S 


CMP #8 


BCC : ^h-4 


STR VLIM 


BNE SNPi 


t f j r h D H I 


LDX #2. 


NMLINE JSR INCfiDR 


LDfi RDHI 


JSR SDRT 


BNE SRT2 


CMP E N fi I 


BRK 




BNE INfiX 


BRK 




L_ !_•' n n !_•' L_ U 




~ £, i ■ 


i ' !m :— :— f-j i : i 


■ C ■ I D ="* ! ~' 1 ■ T 7 » : ^ :"" 


■ p. .-. .-. i : -j- : .-. 


7 ■ ! :~ : ._. : ~ t r* 


— ' ■-" i-" J •- _■ •_• 1 iML. _• 




* .in,-, ft i _= 


SORT LDH NSVMlO 




Li H h : L D i : < 



i'< i i_U 



r-p 
.3P. i 



;r SETflD 



J 



JMH COMPfiR 


PRNTi JSR CLR 


* = :* + 4 


j_DV ij4 


,-. ,-. -, J~. .-. p. ]— .—.'!.- t- ... 


— — " -. .-.- . _ - 


.• L-Ui'irrlKc LririK. W/ 


r K i H L D H « '?■ 4 y 






.: L-UriKhbr. UHHK. IN 


•J bK UU * HLL 


»jryr - ■_=£■ 


r-. r-i : 


l 11— I i i i_ j. i -t i_ . 


!_.' £ T 


IF H- : CB.. NEXT LINE 


f^WP p&i .Q 






i r rl ./ & .-. i w ri P . 


LDV #3 


.; IF R=B, NEXT CHRR. 


PRNT2 LDR <RDLU), V 


COMPRR LDV VI 


JSR OUlRLL 


LDR <HDLG).-. V 


INV 


i r-. i j i ■ -- 




Lnr ', nL-'Lu, 1 .-- V 


BNE PRNT2 




LDfl #$26 


BNE SNRP 


JSR OUTRLL 


INC VI 


r.rii:T —.- ; r-. r, .■• rt r-. i rt \ i i 

rr.iiij- L y rt ■-. r! i.-' i_ u .•• > t 


INC V2 


JSR NUNR 


LDR VI 


INV 


CMP VLIM 


CPV #8 


BNE CQMPfiR 


BNE PRNT2 


SWAP LDR #y 


JSR CRCK 


STR VI 


JSR INCfiDR 


LDR #8 


BMI PRNTi 


STR V2 


BEQ PRNTi 


SwPi LDV Yi 


JSR GAP 


LDR <RDLO).. V 


RTS 


PHR 




LDV V2 


SETfiDR LDR STLO 



GPi JSR CLF 
LDfl #$28 
JSR OUTRLL 

DEX 

BNE GPi 
LfibT K i b 

. END 



Fig. 2; Assembly Listing, 
Sorter/Printer 

SPSVM 



SORT £ PRINT_SVM1 

RIM ASSEMBLY 
EQUATE LIST 
==0080 STL0=J3R 

==0000 ENL0=*3C 
==0000 ENHI=*3D 
==0800 NSVML0=*8C 
==0808 NSVMHI=?8B 

j 

==0800 CLR=$EB44 



January, 1980 



MICRO — The 6502 Journal 



20:45 



==0006 0UTALL=$E9Bi 
==0009 NUMA=$EA46 
==0000 CR€K=$EA24- 



i SUBROUTINES 



==0888 

==8080 
==0880 



-=0081 

==8881 
==8882 

==0002 

»=0003 
a=0002 

==8884 
==8884 

==8885 
==8885 

==8886 
==8806 

a=0087 



*=*ee 

CNTLO 

*=-A+i 
CNTHI 

*=*+l 
ADLO 

*=*+i 
flDHI 



*=*+l 



u l 



V2 

+=*-*- ± 
VLIM 

*=*+! 
VTRB 

>ATfl 



:•.• *e 



tjbtfb 




: MAIN 


rRUliKflri 


.; JUMP 


OVER 8B 


}. '.. j !_i 


$18) 


== 888B 






*=$±0 


— — rV *J i Kl 


START 


. r- .-" r : -r 


BY NAME 


fjQQg 


LDfl #6 



ft^S*; CTS Mi TM 

w w w w — ■ i » i i b. 4. I : 

fiit30 LUK *U 

i!0£:4yy JbK iUK s 

. i— r, —,— r, s i i- r-. r-. ri r- — ,- 

.< ji-ur. i dt hl'Lt.c -■: 
A983 LDfl #3 
8586 STR VLIM 
A232 LDK #2 
282488 JSR SORT 

88 BRK 

88 BRK 



ft ft - .< 

— Citii.4 

A58C 
S588 
A58B 
8501 
==0020 



LDfl NSVMLO 
STA CNTLO 
LDfl NSVMHI 
STA CNTHI 
SRT1 

28CC88 JSR SETflDR 

==882F SRT2 

B587 LDfl VTAB.. X 

8584 STfl VI 

8585 LDfl VTflB+1 
8585 STfl V2 
jJUMP OVER 3A-3D 
4C3E88 JMP COMPflR 
==883fl 

*s*-«-4 

; COMPARE CHfiR. W/ 
; CORRESP. CHAR. 
; NEXT LINE. 
; IF- fl<B, NEXT LI 



IN 
NE 
IF fl=B.. NEXT CHAR. 



IF fl>B, SWAP. 



==883E 

A484 

B182 

A485 

D182 

9838 

D08A 

E684 

E605 



COMPAR 



LDV 
LDA 
LDV 
CMP 
BCX 
BNE 
INC 
INC 



VI 

(flDLO) 

V2 

(flDLO) 

NXLINE 

SWAP 

VI 



> T 



==884 


z. 




R584 




LDA VI 


C536 




CMP VLIM 


DSER 




BNh COMPflR 


==885 


4 


bWrir 



n y 13 m 

8584 
A 9 8 8 
8585 



rint't 

B182 

43 

A485 

B182 

A484 

9182 

bo 

A485 

==88? 

9182 

E684 



LUH 3b 



LDA (ADLO). 
PHA 

: T: I ! i :' - _ i 

i_L-' T Til 

LDA (ADLO). 

STfl (ADLO) 

PLfl 

LDV V2 

STA (ADLO) 

INC VI 



E685 INC V2 
A584 LDA VI 
C988 CMP #8 
D8E4 BNE SI4P1 
==0873 NXLINE 
28D588 JSR INCADR 
D0B2 BNE SRT2 
i DECREMENT 
■■ LOOP COUNT 



A588 


LDR CNTLO 


E981 


SBC #1 


3588 


Si A CNTLO 


B832 


BCS *+4 


C681 


DEC CNTHI 


==8838 




A581 


LDA CNTHI 


D882 


BNE ++4 


A580 


LDA CNTLO 


D09C 


BNE SRT1 


.; PRINT 


SORTED LIST 


20CC00 


JSR SETADR 


20EB88 


JSR GAP 


==8096 


PRNT1 


2044EB 


JSR CLR 


A0O4 


LDV #4 


==003g 


PR1A 


A928 


1 r-. ft ii .+. --. ,-j 

i- j.-' n -it * i. >j 


20BCE9 


JSR OUTALL 


83 


DEV 


D0FS 


BNE PRlfl 


A000 


LDV #0 


==88A5 


PRNT2 


B182 


LDA (ADLO), 


28BCE9 


JSR OUTALL 


C8 


I NY 


C38S 


CPV #6 


D8F6 


BNE PRNT2 


A928 


LDA #$28 


20BCE9 


JSR OUTALL 


==00B4 


PRNT3 


Ti A ft ■" 
O -i. C £- 


1 fiP >;' ft Pi ! fj ') . 


2846EA 


JSR NUMA 


C8 


INV 


0088 


rpy |jQ 


D8F6 


BNE PRNTi 


2824EA 

W T'i ^ Ci Ci 


J Id H C R L K 


la. V *.- -.' — ' w 

==80r:4 




38D8 


BMI PRNTi 


F0CE 


BEG PRNTi 


20EBO8 


JSR GAP 


60 


R j b 



==Mi 



;p - p!5p 



20:46 



MICRO — The 6502 Journal 



January, 1980 



A53A 


IDA stlo 


S5@2 


bTfi flDLO 


A52E 


LDfl STHI 


3583 


STA ADHI 


68 


r"s^ r - 


==03D5 


INCADR 


18 


L- i_ L- 


A582 


LDA flDLO 


6383 


ADC #8 


3582 


Sift HDLO 


9882 


BCC *+4 


E683 


INC HDHI 


A503 


LDfl HDHI 


C53D 


CMP ENHI 


D884 


BNE INAX 


==88Eb 




R582 


LDA flDLO 


C52C 


CMP ENLO 


==88Efl 


INFIX 


68 


RTS 


==88EE 


GAP 


0282 


LDX #3 


««00ED 


GPI 


2044E6 


JSR CLR 


fi920 


LDfl #$26 


20BCE9 


JSP. OUTflLL 


2024EA 


JSR CRCK 


CA 


DEX 




BNE GPI 


==88F8 


LAST 


68 


K i S 




END 


ERROR: 


5= 8888 



Fig. 3: Example Run showing 
Dual Sort 

0>=i9 



J 



£ 


r-. ; ■ t 
i-'ni 


886 


ADLO 


808 


t 


LH 


EB4 


t. 


NTHI 


080 


c 




008 


?_ 


fihiPQD 


883 


L 


KCK 


EA2 


ENHi 


y is S 


ENLO 


802 


January, 1 


980 





GAP 


06EB 


SETADR 


80 CC 


GPi 


08ED 


INC AD R 


88D5 


IN AX 


08EA 


IN AX 


00EA 


INCADR 


0QD5 


GAP 


00EB 


LAST 


8SFB 


GPi 


88ED 


NSVMHI 


060B 


LAST 


0OFB 


NSVMLO 


000C 


OUTflLL 


E3BC 


NUHfl 


EA46 


CRCK 


EA24 


NXLINE 


0678 


NUMfl 


EA46 


OUTflLL 


E9BC 


CLR 


EB44 


PR! A 


889B 






PRNTi 


8696 






PRNT2 


00A5 






PRNT2 


00B4 


Fig. 4: Source Listing, 


SETADR 


88CC 


Block— Move 


Program 


SORT 


8S24 


.; uui-v 




SRTi 


002C 






SRT2 


0B2F 


.' L U r i L b H N V 


~ b i il h 


START 


0810 


.; BLOCK OF 




STHI 


803B 


; TO HNVPLA 


CE IN 


STLO 


083A 






SWAP 


0854 


.; BEFORE RUN 


NING.. 


SWP1 


085 C 


.; PUT START 


OF 


Vi 


0884 


.■ Bluuk in 


"FROM" 


V2 


0685 


C f j r ; f; p d i 


C K IN 


VLIM 


0886 


i "END". AN 


D FIRS 


VTAB 


0007 


; DESTINATI 

jj t r, h 

:• U 


ON IN 


CNTLO 


8800 


. r-.iiijTr j t r- 


_ 


r-iiTiiT 

(.-ft i Hi 


8801 


*=$86 




ADLO 


8082 


FRLO 




phi-iT 


8003 










*=*+! 




VI 


8804 


FRHI 




Vi! 


8085 


*=*+!, 




i L i M 


6006 


ENLO 




VTAB 


8807 


* = * + i 




f J •" v M U T 

M.' > ill I i 


000B 


ENHI 




ij C S^i fci '. i* 










sfbaL 


*s* + l 




—.: r^ rr s 


0818 


TOLO 




— : L.' I", t 


yy^4 


* = * + ! 




SRTi 


082C 


-r i*i ;_i t 




SRT2 


802F 


,i 




b i LU 


i~ n ":• d 


.; MAIN PROOF 


AM 


STHI 


883B 


:fc=-|286 




ENLO 


jjljj^. 


START 




hNHI 


y 8 j >L- ! 


; INCREMENT 


"END" 


_ i i pi ^ pi hr 


80 3 E 


INC ENLO 




SWAP " 


8854 


BNE *+4' 




SWPi 


805C 


INC ENHI 




NXLINE 


8078 


LDV #8 




PRNTi 


0096 


MOVE 




P P 1 H 


88 9 B 


LDA (FRLO).- 


; i 

T 




80fl5 


STA <TOLO>,- 


M 


PRNT2 


08B4 


.; INCREMENT 


"FROM" 



MICRO — The 6502 Journal 



20:47 



INC FRLO 
BNE *+4 
INC FRHI 
i INCREMENT "TO" 
INC TOLO 
BNE *+4 
INC TOHI 
; CHECK IF DONE 
SEC 

LDH FRLO 
SBC ENLO 
LDh FRHI 
SBC ENHI 
BCC HOVE 
;fiLL DONE 
BRK 
LAST 
BRK 
END 



Fig. 5: Assembly Listing, 
Block— Move Program 



. i • i • rj • ' 



.; BLOCK OF MEMORY 
.; TO hNVPLhCE IN RfiM 



. ; biirUKc riUNNiNli^ 

; PUT START OF 

; BLOCK IN "FROM", 

i END GF BLOCK IN 

iir-ii-,}! Q'fir-. rinTT 

z.U'J .= ■ nfiy rikji 



; " TO " . 
;EQUHTE LIST 

==0006 

* = $88 

==8008 FRLO 
= = y y y 8 

==8081 FRHI 
==8081 

==8882 ENLO 
-=8882 

==8883 ENHI 
==8883 

==8884 TOLO 



Tfci 



==8884 
==8885 TOHI 












tmzz 



ntM 






"IT 






ES88 




INU 


hRLU 


D882 




our 


++4 


E681 




Tii" 


rr.rii 


.; INCREf 


1ENT 


"TO" 


ES84 




INC 


TOLO 


D882 




BNE 


•r-rn 


E68d 




T '. i r- 


TOHI 


==82: 


O 






.; CHECK 


IF E 


'ONE 






» — *— •■"* 

bet 




H588 




LDH 


FRLO 


E582 




**■ r*t i*v 


ENLO 


H581 




LDh 


hRHI 


E583 




SBH 


ENHI 


98E5 




BCC 


MOVE 


; fiLL 


Tj 


ONE 




88 




BRK 




==82 




LfiST 


88 




r-nr 




ERR 


OR 


S= 8888 



Fig. 6: Block— Move, Disassembled 
and Hex Dump 






y^yb R8 ldv #88 

8288 Bi LDfi (00), 

!/} *"/ {A ^ *"*• ; ~ C' * • !~ I~J ~ j .1 ■"" 1 



8214 D8 BNb 821S 
0216 ES INC 85 

y 2 i 1 3 R ^ ■ ^ ft h 






'li-t 



021r E5 SBC 83 

y £- ± ii. ^* y fc> L- L- y ii l^ b 

0223 80 BRK 

8224 88 BRK 



"M"; = 



K! i, £i £! 


Efc 


82 


DO 


k1 i! 


BtOt 


ilb 


83 


fly 


08 


828S 


T" .4 

DJ. 


08 


91 


y4 


828C 


E6 


88 


D8 


82 


y i i y 


Cb 


81 


T-.~ 


84 


8214 


D8 


y2 


b =3 


85 


821S 


.» C 1 


fl5 


8 


E5 


821C 


82 


H5 


fil 


E5 


8228 


83 


38 


E5 


88 


8224 


88 


45 


4D 


4F 



KEYBOARD EXPAMW fm APPLE [I* 

Ctl Hlere iiaoyMtt th« tiaeaforeatlon o< tha ApFLl II 

late a eeeplete upper end lower eaaa tritii. RBYBOAa.fi 
■irMOOB, a haidveta-aef tvera eodlfleatloa o( tha 
hPrLS It, aetoally allowe the ibUt kiyi to b« aaad 



The hardware shanf a la a ««t-«lfi aodl fleet Ion with 
e*« aeldar aol«t. The aeftwara la a 1/4B tianaparent 



Cap aad Ihlft L<»k« and •• Ia*«ra« tadi dlaplay optic 
laoladed. Coapaklela «lt« aathoda dlaplaylaf AtCII 
aa«A •• riran'i (.at and Ippla'a «ontilbutad II ■■■ 
C»IACTII OKRIhATOB. lotallf eeepatlbla tilth DO* , 

allevlnt aaa of O/t 1m HIT tllaa, FklMT and UK atat< 
■toll, DOS rila naaaa, aad Isatedlaia »eda. 



■DOB 



110.00 



TDTMGI 130.00 

CenUlM KtnOftJD HMOOI aad H nmsn UIIC proaiaa callarf 
TUTVaCt, «klch ■** put e< AffUPOfT. tha flrat eoaaHtielally 
arail«U« ptodMt which allswed aonal ■«• of tlM mPPU II aalft 
taya. Kaeantlr iarla«d. Slvaa llMltad 'paaja-ptocaaalrta ' cap- 
abllltlaai allowa an try, adltlaa, acerata en dlac, and prlntlna 
|Mlna yoic awn pilntar dfl«K]i o* a 'typed pea*' (H Una* o/ 
■■ ckatactara). aequirM 341 nag ayatM. 

Otmi AVULMLC KMX.T H«0 

Coeeleta word proeaaaoc lncludlna mMW BXPMnxn and a full 
aciaen ad Iter, wa aie uhlMf a loaf tlea to dewalop thla packaqa 
bacj— "a wane Uh fllat word procasaor to aaa ttm atillt taya to 
ba hetii pewetful and aaey to eea. mMW B^MroORa, TtnTACCa, 
aad ArviCHirTa aey ba ratwned tec eiadlt toward Ouptu:. 

BBAL-T1MB CtOOl AVAJLULI KJUU.T 19H tot 15. 00 

J eh aa it lea and aoltwate for aaclally Interlacing APVLT II to • 
laai-tlaw clock walna apprea. H15.0O In paita and Uia Giim I/O. 

'APfLK la a reflatared Trail «■■"* ei kppla Conputar Inc. 
Full dociiBinti tloa lacludadt aoftwara pro*ldad an dlac 
taacapt tor Clock) . Our product a n« copy rlahtadi wl th 
all rlqhta reaerved. Ordara, acceapanlad by cirtldtd 
check or never ordar , ahotild ba aaa t toi 



CJH nicio 

P.O Box 249 

Cliftopi P«««. M 12065 



20:48 



MICRO — The 6502 Journal 



January, 1980 



Aiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiw 

EXCERT, INCORPORATED 

1 • • • AIM ■ 65 • • • I 



A SPECIAL NOTE TO OUR CUSTOMERS 

* Thanks to you we have moved to larger quarters. 

* We have also expanded our product offerings and 
deleted others. 

* Hopefully, we have served your needs and will do so 
again. 

* We believe a customer is not an interruption of our 
work, but the purpose of it. 

Let Us Serve You Again! 
Thanks, 
Laurie Root 
Vice President 



P/N QTY 1 • 9 

A65-1 AIM-65 w/1 K RAM $375 

A65-4 AIM-65 w/4K RAM $450 

A65-A Assembler ROM $85 

A65-B BASIC ROM $100 

Special - A65-4AB 

AIM-65 w/4K RAM, Assembler & BASIC ROMs . $595 

Spare Parts (When Available) 

A65-P Printer $40 

A65-D Complete Display Board $65 

w/Exchange of Old Board $40 

A65-K Keyboard $40 



P/N QTY 1 • 9 

Power Supplies 

PRS3 + 5V at 3A, + 24V at 1 A 

w/mtg hardware, cord, etc $65 

PRS4 + 5V at 2A, + 24V at .5A 

w/mtg hardware, cord, etc $50 

From The Enclosures Group 

ENC1 AIM-65 case w/space for PRS3/PRS4 . $45 
ENCL1A AIM-65 case w/space for PRS3/PRS4 

and one expansion board $49 

Cases with Power Supplies 

ENC3 ENC1 W/PRS3 mounted inside $115 

ENC3A ENC1A W/PRS3 mounted inside $119 

ENC4 ENC1 W/PRS4 mounted inside $100 

ENC4A ENC1AW/PRS4 mounted inside $104 

From The Computerist, Inc. 

MCP1 Mother Plus™ Dual 44 pin mother card 
takes MEB1, V1B1, PTC1, fully buffered, 
5 expansion slots underneath the AIM $80 

MEB1 Memory Plus™ 8K Ram, 8K Prom sockets, 
6522 I/O chip and programmer for 5V 
EPROMS with cables $200 

PTC1 Proto Plus™ Prototype card same size 

as KIM-1, MEB1, V1B1 $40 

V1B1 Video Plus™ board with 128 char, 128 user 
char, up to 4K display RAM, light pen and 
ASCII keyboard interfaces w/cables $245 



■ Systems 

■ We specialize in assembled and tested systems 
| made from the above items. Normally, the price 

| will be the total of the items, plus $ 5.00 for 

; shipping, insurance and handling. Please call or write 

i for exact prices or if questions arise. 



P/N QTY 1 - 9 

From Seawell Marketing, Inc. 

MEP2 Little Buffered Mother™ Single 44 pin 

(KIM-4 style) mother card takes MEB2.PGR2, 
PTC2 and PI02. Has on board 5V regulator for 
AIM-65, 4 expansion slots. Routes A&E 

signals to duplicates on sides $139 

with 4K RAM $189 

MEB2 SEA 16™ 16K static RAM board takes 2114L 
with regulators and address switches 

Blank $125 

8K $225 

16K $325 

PGR2 Prommer™ Programmer for 5V EPROMS 
with ROM firmware, regulators, 4 textool 
sockets, up to 8 EPROMS simultanously, can 
execute after programming $245 

PI02 Parallel I/O board with 4-6522's $260 

PTC2 Proto/Blank™ Prototype card that 

fits MCP2 $39 

PTC2A Proto/Pop™ with regulator, decoders, 

switches $99 

From Beta Computer 

MEB3 32K Dynamic Memory Card w/on board DC to 

DC converters (5V only .8Amax) $419 

with 16K $349 

with OK $279 

Miscellaneous 

TPT2 Approved Thermal Paper Tape 

5/165' rolls $10 

MEM6 6/2114 RAM Chips $45 



s Higher quantities quoted upon request. 

5 COD's accepted. 

s Add $5.00 for shipping, insurance and handling. 

a Minnesota residents add 4 % sales tax. 



Mail Check or Money Order To: 

EXCERT, INC. 

P.O. Box 8600 

White Bear Lake, MN 55110 

(612)426-4114 



.niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiMiiiiiiii^iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii* 




GREAT 
PET 

SOFTWARE 

"Precise, humanized, well documented an excellent 
value" are the applauds now being given to United 
Software's line of software. These are sophisticated 
programs designed to meet the most stringent needs of 
individuals and business professionals. Every package 
is fully documented and includes easy to understand 
operator instructions. 

DATABASE MANAGEMENT SYSTEM - A comprehensive, interactive 
system like those run on mainframes! Six modules comprising 42K of 
programming allow you to; create, edit, delete, display, print, sort, 
merge, etc., etc. - databases of up to 10,000 records. Printer routines 
automatically generate reports and labels on demand. 60 pages of 
concise documentation are included. Requirements - 16-32K PET and 
2040 Dual Disk (printer optional). . . .Cost $125 

ACCOUNTS RECEIVABLE/PAYABLE - A complete, yet simple to use 
accounting system designed with the small businessman in mind. The 
United Software system generates and tracks purchase orders and 
invoices all the way through posting "controlled" accounts payable and 
accounts receivable subsystems. 

Keyed Random Access file methods makes data access almost 
instantaneous. The low-cost solution for the first time computer user 
with up to 500 active accounts. Requirements - 32K PET, Dual Disk, any 
80-column printer. . . .Cost $175 

CASH RECEIPTS & DISBURSEMENTS - Makes it a breeze to track all 
outgoing payments made by any type of business operation. Checks 
are tracked by number and categorized by type of expense. Sorting, 
summary, and audit trails make it easy to post to general ledger. This 
system also categorizes incoming receipts. Uses KRAM file access 

method. Requirements - 32K PET, Dual Disk (printer optional) Cost 

$99.95 

KRAM - Keyed Random Access Method - The new, ultra-fast access 
method for the PET Disk, provides keyed retrieval/storage of data, in 
either direct or sequential mode, by either full or partial key values. 
Written by United Software in 6502 machine code, and designed with 
the PET inmind.it exploits all the benefits of the PET Disk, allowing full 
optimization of your system. Eliminates the need for "Sort" routines! 
KRAM provides flexibility never seen on a micro before. KRAM is 
modeled after a very powerful access method used on large-scale IBM 
Virtual Storage mainframes. So "KRAM" all you can into your PET - it 
will love you for it. . . .Cost $79.95 

(Sublicenses available to software houses.) 



PROGRAMS FOR 
ENTERTAINMENT 

Space Intruders 
("Best Game of 1979") ..$19.95 

Jury/Hostage 12.50 

Kentucky Derby/Roulette 9.95 

Alien I.Q./Tank 9.95 

Tunnelvision/Maze Chase 14.95 

Submarine Attack 9.95 

Battle of Midway 7.95 

Laser Tank Battle 9.95 

Swarm 14.95 

Look for the RED-WHITE-BLUE United Software Display at 
your local computer dealer, or send check or moneyorder, 
plus $1.00 shipping to: 

UNITED SOFTWARE OF AMERICA 



Super Startrek 14.95 

PET Music Box 29.95 

UNITED SOFTWARE 
PROGRAMS FOR BUSINESS 

Checkbook $15.95 

Mortgage 15.95 

Finance 12.95 

Bonds 12.95 

Stock Analyzer 22.95 

Stock Options 24.95 

6502 Macro Assembler . . . 49.95 



750 Third Ave. 

New York, N.Y. 10017 



Dealer inquiries invited 



APPLE II SOFTWARE 



CURSOR PILOT 



gives any Apple li game-paddle control of the video cursor. Activate 
by touching 'ESC, then edit or copy with game-paddle. Supports 
normal keyboard controls, is transparent to your programs. 



$595 



DATA HANDLER 



data base management system. Supports infinite data bases on the 
Apple If disk drive. Structure data to meet your own needs, up to 255 
fields per entry. Advanced data processing allows searching and math 
to generate reports, extensions, and ledgers. Use for inventory, checks, 
phone numbers, stocks, lab data., etc. Requires 32K & a disk drive. 

on diskette with manual . . . $49^ 



TYPESETTER 




a complete HI-RES graphics character generator and editing system. 
Allows colors, scaling, upper/lower case, inverse, and can HPLOT 
letters to any point on the screen. Outputs through regular PRINT 
statements. Use it to label graphs, create ad displays, or print lower 
case. System includes 35 utility programs and character sets. When 
ordering, specify if for disk or POM Applesoft. Needs 32K with ROM, 
48K with disk. 



on diskette with manual . 



$2495 



HIRES UTILITY PACK 

Why sweat over HI-RES graphics? Shape Generator lets you build 
graphic shapes with game paddles, see them at all scales, colors, and 
rotations. Save them to disk, and Shape Adder puts up to 255 shapes 
together into a table. Utility Subroutines let you position without 
plotting, find your last plot, and look at the screen to see if a point is 
on. Requires 16K with Applesoft ROM. 

on diskette . . . $ | Q$5 



AVAILABLE AT YOUR LOCAL DEALER, OR CALL DIRECTLY AT: 



ANDROMEDA COMPUTER SYSTEMS s 



Visa and Maslercharge gladly accepted. 
Apple II and Applesoft are trade marks of the Apple Computer Company, Inc. 



RECYCLE(D) 
COMPUTERS 

BUY tf SELL ^r SWAP 
Hardware & Software 

NEW PRODUCT ANNOUNCEMENTS 
32 pageg or mort 

Mailed 1st Class every 3 Weeks 
lyr. (18 issues) # $3.75 



O BOX191'" 
GREENSBORO, nC 27410 
(9lS) 852-1462 



ON LINE 



reeve I • u**d compuran 



©abe |5eetle,$ui)ltSf)er <£stabltSf)et> 1975 

24695 Santa Cruz Hwy.. Los Gatos, CA 95030 

TH£ BEST WAY TO DETERMINE IF ON_UNE CAN BE OF VALUE TO YOU IS TO TRY A .... 

rasa aaGaptLB mm 



The MICRO Software 
Catalogue: XVI 



Name: 

System: 

Memory: 

Language 

Hardware: 



IRR 

PET 

16K 

BASIC 

PET(8K) with Cassette 



Copies: 


Just Released 


Price: 


$18.95 


Includes: 


Cassette and 




tions 


Author: 


D.J. Romain 


Available from: 



powers, strengths, and modes of attack, 
and they become increasingly 
dangerous in battle as lower levels are 
reached. As the secrets of the dungeon 
are uncovered by your force, a color cod- 
ed map is generated until you find your 
way safely out with your treasures. 

Copies: Many 

Price: $12.50 cassette, $15.00 

disk. 

(WA residents add 5.3 

percent sales tax) 
Author: Robert C. Clardy 

Available: Synergistic Software 

5221 • 120th Ave. S.E. 

Bellevue, WA 98006 

(206) 641-1917 



Name: Paper Tiger Graphics 

Software 

System: APPLE II OR APPLE II 

PLUS 

Memory. 32K 

Language: Integer Basic or Ap- 
plesoft 

Hardware: APPLE II, Disk II, and IDS 
440G Printer 

Description: The paper tiger graphics 
software is a set of programs which 
allow printing of anything that can be 
displayed on the Apple II high resolution 
pages. Any picture, graph, text, or 
diagram which is displayed can be sav- 
ed and dumped to the printer. Serial ver- 
sions of the printing programs are listed 
on the diskette. The names of the pro- 
grams indicate which language is used 
to execute the program. Pictures can be 
expanded to twice the size and can be 



Name: 


Data Handler 


System: 


APPLE II or APPLE II Plus 


Memory: 


32K with ROM — 48K 




without 


Language: 


APPLESOFT II 



Description: IRR is designed to provide 
the potential real estate investor with a 
detailed breakdown of the projected an- 
nual cash flows for the first four years of 
ownership based on 19 input datum. The 
second portion of the program provides 
the projected cash proceeds from the 
sale, broken down by its various com- 
ponents and tax considerations. The 
third portion of the program provides the 
partitioning of the Internal Rate of 
Return into the three components: Cash 
Flow, Tax Shelter, and Cash Proceeds 
from the sale. It then indicates the pre- 
sent value of each component, the 
percentage of the total return, and the 
partitioning of the total Internal Rate of 
Return into the three components. An 
excellent tool to evaluate prospective 
real estate purchases. 



Instruc- 



D. J. Romain, P.E. 
405 Reflection Road 
Apple Valley, MN 55I24 

Name: DUNGEON CAMPAIGN 

System: APPLE II 

Memory: 16K (32K for disk version) 

Language: Integer BASIC 

Description: Dungeon Campaign is a 
game of high adventure wherein the 
player directs an expeditionary force as 
it ventures into an underground 
labyrinth. The catacombs are filled with 
treasures and hazards, poisonous 
vapors and evil necromancers, stairways 
and pitfalls, sorcerous devices and in in- 
credible assortment of monstrous in- 
habitants. 

The dungeon's monsters may pursue 
or wait in ambush. They have a variety of 

Software Catalog Note 

Do you have a software package you want publicized? Our Software Catalogue is a good opportunity to receive some free 
advertisement.. This regular feature of MICRO is provided both as a service to our readers and as a service to the 6502 industry which 
is working hard to develop new and better software products for the 6502 based system. There is no charge for listings in this 
catalog. All that is required is that material for the listing be submitted in the listing format. All info should be included. We reserve 
the right to edit and/or reject any submission. Some of the submissions are too long. We might not edit the description the same 
way you would, so please, be brief and specific. 



Description: The Data Handler is a data 
base management system. It can sup- 
port up to 255 fields/entry. Disk based, it 
can support infinite data base sizes. Pro- 
grams allow formatting, editing, sorting, 
searching, and data processing. Can be 
used for checkbooks, inventory, stocks, 
etc. Includes sample files and manual. 

Copies: 10 

Price: $49.95 on diskette. 

N.C. residents add 4 per- 
cent sales tax. 

Author: Joe Budge 

Available: Andromeda Computer 
Systems 
P.O. Box 19144 
Greensboro.N.C. 27410 
(919) 852-1482 



Name: Cursor Pilot 

System: APPLE II or APPLE II Plus 

Memory: Any Size 

Language: Machine 

Description: The cursor pilot gives game 
paddle control of the video cursor. Ac- 
tivate by pressing escape, then edit or 
copy with the game-paddles. All stan- 
dard keyboard cursor controls function 
normally. Transparent to Basic pro- 
grams. Relocatable program works on 
any APPLE II with or without disk. 



inverted to 


give a black on white or a 


Copies: 


Just Released 


white on black picture. 


Price: 


$5.95 on cassette 








NC residents add 4 per- 


Price: 


$34.95 




cent sales tax 


Includes: 


One diskette plus user 


Authors: 


Joe Budge and Jeff 




pamphlet 




Schmoyer 


Author: 


David K. Hudson 


Available: 


Andromeda Computer 


Available: 


Local Apple Dealers or 




Systems 




Computer Station 




P.O. Box 19144 




12 Crossroads Plaza 




Greensboro, NC 27410 




Granite City, IL 62040 




(919)852-1482 



January, 1980 



MICRO — The 6502 Journal 



20:51 



fccommodore 



ariliiaiX. 



340 K Dual Drive 



80 Column 
Dot Matrix Printer 




CBM 2040 
$1295 00 



2001 ■ 32N $1295 00 



PRINTERCOM 

2022 $995 00 

2023 $849 00 



2001 - 8N 

2001 - 16B 

2001 - 16N 

2001 - 32B 

16/32K Diagnostic Kit 
Audio Amplifier PET 



$795 00 

$995 00 

$995 00 

$1295 00 

$225 00 
$29 95 



PET to IEEE Cable 
IEEE to IEEE Cable 
C2N CASSETTE 

8K Diagnostic Kit 

DISKETTES: 

DYSAN [Business Quality] 

Verbatim 



N DENOTES GRAPHICS ON LARGE KEYBOARD 
B DENOTES NO GRAPHICS ON LARGE KEYBOARD 



$39 95 
$49 95 
$95°° 
$30 00 

5/$24 50 
10/31 95 



BUSINESS SOFTWARE 

OSBORNE — CMS 



General Ledger Disk $295°° 

Accounts Payable Disk $195°° 
Accounts Receivable Disk $195°° 
Word Processor 16/32K Disk $99°° 



Inventory Control Disk $195°° 
[Available 12-1-79] 

Mailing List Disk $95°° 

Payroll Disk $295°° 
[Available 1-15-80] 

Word Processor Tape $24 95 



CBM — MIS 



General Ledger Disk 
Accounts Receivable Disk 
Accounts Payable Disk 
Payroll Disk 



$120°° 
$120°° 
$120°° 
$120°° 



Inventory Disk 
Job Cost/Bid Disk 
Customer Information 
[Mailing List] Disk 



$120°° 
$120°° 

$120°° 



CBM — MIS Complete 7 Module Set $795°° 

All 16N/16B Upgrade to 32K $31 00 

Ship computer and check to: 

HDCTIE COmPUTERS 

1775 E. Tropicana 
(Liberace Plaza) 
Las Vegas, NV 89109 
702/736 ■ 6363 



FREE Software 
LAS VEGAS series with any PET 
computer purchase or upgrade 
to 32K, valued at $200°° or 
more, including other software. 



PROGRESSIVE SOFTWARE 



Presents 
Software and Hardware for your APPLE 



SALES FORECAST provides the best forecast using the four 
most popular forecasting techniques: linear regression, log 
trend, power curve trend, and exponential smoothing. Neil D. 
Lipson's program uses artificial intelligence to determine the 
best fit and displays all results for manual intervention. $9.95 

CURVE FIT accepts any number of data points, distributed in 
any fassion, and fits a curve to the set of points using log 
curve fit, exponential curve fit, least squares, or a power curve 
fit. It will compute the best fit or employ a specific type of fit, 
and display a graph of the result. By Dave Garson. $9.95 

UTILITY PACK 1 combines four versatile programs by Vince 
Corsetti, for any memory configuration. 

• Integer to Applesoft conversion: Encounter only those 
syntax errors unique to Applesoft after using this program 
to convert any Integer BASIC source. 

• Disk Append: Merge any two Integer BASIC sources into a 
single program on disk. 

• Integer BASIC copy: Replicate an Integer BASIC program 
from one disk to another, as often as required, with a 
single keystroke. 

• Applesoft Update: Modify Applesoft on the disk to elimin- 
ate the heading always produced when it is first run. 

• Binary Copy: Automatically determines the length and 
starting address of a program while copying its binary file 
from one disk to another in response to a single key- 
stroke. $9.95 

MISSILE-ANTI-MISSILE display a target, missile, anti-missile, 
a submarine and map of the U.S. on the screen. A hostile sub- 
marine appears and launches a pre-emptive nuclear attack 
controlled by paddle 1. As soon as the hostile missile is fired, 
the U.S. launches its anti-missile controlled by paddle 0. Dave 
Moteles' program offers high resolution and many levels of 
play. $9.95 

TOUCH TYPING TUTOR teaches typing. Indicates speed and 
errors made. Finger Bldrs, Gen. Typing, Basic Language and 
User Supplied. Diskette. Written by Wm. A. Massena. $19.95 

APPLE MENU COOKBOOK index-accessed data 
storage/retrieval program. Recipes stored, unlimited lines per 
entry. Easy editing. Formulated after N.Y. Times Cookbook. 
Other useful features included. 
Written by Wm. Merlino, M.D. $19.95 

MAILING LIST PROGRAM maintains complete record of name, 
address, phone no., mailing labels accommodates parallel 
card or built-in printer driver, easy data entry. 
Diskette. 32K. $19.95 



BLOCKADE lets two players compete by building walls to 
obstruct each other. An exciting game written in Integer 
BASIC by Vince Corsetti. $9.95 

TABLE GENERATOR forms shape tables with ease from direc- 
tional vectors and adds additional information such as star- 
ting address, length and position of each shape. Murray Sum- 
mers' Applesoft program will save the shape table anywhere in 
usable memory. $9.95 

OTHELLO may be played by one or two players and is similar 
to chess in strategy. Once a piece has been played, its color 
may be reversed many times, and there are also sudden 
reverses of luck. You can win with a single move. Vince Corset- 
ti's program does all the work of keeping board details and 
flipping pieces. $9.95 

SINGLE DRIVE COPY is a special utility program, written by 
Vince Corsetti in Integer BASIC, that will copy a diskette using 
only one drive. It is supplied on tape and should be loaded onto 
a diskette. It automatically adjusts for APPLE memory size 
and should be used with DOS 3.2. $19.95 



SAUCER INVASION 
SPACE MAZE 
STARWARS 

ROCKET PILOT Written by Bob Bishop Each $9.95 



SAUCER INVASION lets you defend the empire by shooting 
down a flying saucer. You control your position with the pad- 
dle while firing your missile at the invader. Written by Bob 
Bishop. $9.95 

HARDWARE 

LIGHT PEN with seven supporting routines. The light meter 
takes intensity readings every fraction of a second from to 
588. The light graph generates a display of light intensity on 
the screen. The light pen connects points that have been 
drawn on the screen, in low or high resolution, and displays 
their coordinates. A special utility displays any number of 
points on the screen, for use in menu selection or games, and 
selects a point when the light pen touches it. The package in- 
cludes a light pen calculator and light pen TIC TAC TOE. Neil 
D. Lipson's programs use artificial intelligence and are not 
confused by outside light. The hi-res light pen, only, requires 
48K and ROM card. $34.95 



J 



POSTAGE AND HANDLING 
Please add $1.25 for the first item 
and $.75 for each additional item. 

Programs accepted for publication 
Highest royalty paid 

U.S. and foreign dealer and distributor inquiries invited 
All programs require 16K memory unless specified 



TO ORDER 

Send check or money order to: 

P.O. Box 273 

Plymouth Meeting, PA 19462 

PA residents add 6% sales tax. 



' V T' wyg^.r^^y r ^w v-w w wvr -^ n 3-c vt i-L J>* vtx ><■>•!: X.JO* 



fc£M o ,. 




CO 



-^-<J 



* COMP^^ 



APPLE KIM AIM65 



INEXPENSIVE CONTROL SOLUTION FOR 

HOME SECURITY • ENERGY CONSERVATION 

GREENHOUSES • ENVIRONMENTAL CONTROL 

INDUSTRIAL CONTROL • LABORATORIES 

CmC's^DAC system now includes an interface-to the BSR X-10 remote 
control modules. These low-cost modules allow control over lamps, 
motors and appliances. With the CmC X-10 interface your computer can 
control 256 separate devices. Lamps can be turned on or off, dimmed or 
brightened. Alarms, kitchen appliances, hi-fis, TVs, motors, pumps, 
heaters and more can be put under your computer's control. 

Direct plug-in and software for most computers. 

Circle the reader service number, call or write for our latest catalog. 



CONNECTICUT microCOMPUTER, Inc. 

ISO POCONO ROAD 

BROOKFIELD, CONNECTICUT 06804 

TEL: (203) 775-9659 TWX: 710-456-0052 



m u 



.3g*g.«: 



••••*•••••••*• ••••*••••• * 

: KIMSI ; 

* floppy : 

\ DISKS— J 

* 



* 
* 



PERRY PERIPHERALS HAS 

THE HDE MINIFLOPPY TO KIMSI 

ADAPTER 



♦ MINIFLOPPY S-100 ADAPTER: $15 

*• FODS and TED Diskette 

*• FODS and TED User Manuals 

*• Complete Construction Information 

* 

♦OPTIONS: 

*• FODS Bootstrap in EPROM (1st Qtr'80) 

«• HDE Assembler (ASM) $75 

*• HDE Text Output Processor (TOPS) $1 35 

* 

* 
* 



(N.Y. 



State residents, add 7% Sales Tax) 

Place your order with: 
PERRY PERIPHERALS 

P.O. Box 924 

Miller Place, N.Y. 11764 

(516)744-6462 

Your "Long Island' HDE Distributor 



* 

* 
* 
* 
* 
* 
* 
* 
* 

* 
* 
* 

* 



STOCK MARKET ANALYSIS PROGRAM 
DJI WEEKLY AVERAGE 1897-1980 



ANA1 (ANALYSIS 1) is a set of BASIC Programs which enables the user to 
perform analyses on the Dow Jones Industrial weekly average data. From 6 
months to 5 years of user selected DJI data can be plotted on Ihe entire screen 
in one of 5 colors using Apples' High Resolution capabilities. The DJI data can 
be transformed into different colored graphic representations called transforms. 
They are: user specified moving averages; a least squares linear fit (best straight 
line); filters for time, magnitude, or percentage changes; and user created rela- 
tionships between the DJI data, a transform, or a constant using *,-,xV operators. 
Colored lines can be drawn between graphic points. Graphic data values or 
their dates of occurrence can be displayed in text on the screen. Any graph or 
text can be outputted to a users printer. The Grid Scale is automatically sel to 
the range of the graphs or can be user changed. As many colored graphs as 
wanted can be plotted on the screen and cleared at any time. The user can code 
routines to operate on the DJI/transform data or create his own disk file data 
base. ANA1 commands can be used with his routines or dala base. An Update 
program allows the user to easily update the DJI file with current DJI weekly 
data. 

The ANA1 two letter user commands are: CA = Calculate, no graph. CG = Clear 
Graphs, leave Grids. CK = Checking out program, known data. CO = Color of next 
graph (red, green, violet, white, blue). CS = Clear Screen DL = Draw Line between 
points. Fl = Filter data for time, magnitude, or percent change. FU = Data, trans- 
form, or constant Function with v,x,/ operator. GD = Graphic mode, display 
all Graph Data on screen. GR = Graph data to screen. GS = Set Grid Scale. HE = Help, 
summary of any commands usage. LD = Load Data from disk file Irom inputted 
date to memory. LG = Leave Graphs, automatic Grid rescaling. LO = Look, select 
a range ol the LD data and GR; All commands can now be used on this range. 
LS = Least squares linear fit of the data. MA = Moving Average of the data. NS = 
No Scale, next graph on screen does not use Grid Scale. NT = No Trace. PR = User 
implimented Printer routine. TD = Text mode, display Text Data on screen. Tl = 
Time number to date or vice versa. TR = Trace. TS = Text Stop for number ol lines 
outputted to screen when in TD. U1/U2 = User 1/2 implimented routines. VD = 
Values of Data outputted in text. VG = Values of Grid; low/high/delta. VT = Values 
of Transform outputted in text. 



APPLE® II. 48 K. APPLESOFT 
ROM CARD, DISK II DOS 3.2 
ANA1 DISK & MANUAL . . . $49.95 
(CA residents add 6% sales tax) 



GALAXY 
DEPT. MM 
P.O. 80X 22072 
SAN DIEGO. CA 92122 



«yy M MMl^t«H XXsOOZKtS : 



PET Word Processor 




This program permits composing and printing letters, 
flyers, advertisements, manuscripts, etc., using the 
COMMODORE PET and a printer. 

Printing directives include line length, line spacing, 
left margin, centering and skip. Edit commands allow 
you to insert lines, delete lines, move lines and 
paragraphs, change strings, save files onto and load 
files from cassette (can be modified for disk), move up, 
move down, print and type. 

Added features for the 16/32K version include string 
search for editing, keyboard entry during printing for 
letter salutations, justification, multiple printing and 
more. 

A thirty page instruction manual is included. 

The CmC Word Processor Program for the 8K PET is 
$29.50. The 16/32K version is $39.50. 

Order direct or contact your local computer store. 

VISA AND M/C ACCEPTED — SEND ACCOUNT NUMBER. EXPIRATION DATE AND SIGN ORDER. 
ADO t1 PER ORDER FOR SHIPPING A HANDLING — FOREIGN ORDERS ADD 10% FOR AIR POSTAGE 

CONNECTICUT microCOMPUTER, Inc. 

ISO POCONO ROAD 

BROOKFIELD, CONNECTICUT 06804 

TEL: (203) 775-9659 TWX: 710-456-0052 



y«M.M ^Vf^lTMM.MWM>t»t^JMMJ». KUKVKXJt: 



Search/Change in Applesoft 



It is often useful to be able to search a file for a par- 
ticular string and then to change the string for a new 
one. This paper presents a Search/Change capability for 
Applesoft. 



J.D. Childress 
5108 Springlake Way 
Baltimore, MD 21212 



J 



A program to produce a cross- 
reference table for all the variables in a 
program under development is a useful 
tool; such a table enables one to deter- 
mine whether and where a variable label 
has been used. Unfortunately, a 
variable's cross-reference program in 
BASIC is not available in the literature 
although the development of one was 
recently reported by William and Alice 
Englander, Nybbles: BASIC Cross- 
Reference Table Generator, Byte, v4, 
4:190 (April 79). About as useful in pro- 
gram development though not as neat 
for complete documentation purposes is 
the FIND program of Jim Butterfield, In- 
side PET BASIC, MICRO, 8:39, 
(December78-January 79). Butterfield's 
paper inspired the present SEARCH/- 
FIND program, one that does the same 
function as Butterfield's but also, allows 
one to change the found item (within 
limits). 

SEARCH/CHANGE is about seven 
times as long (1.5 Kbytes) as 
Butterfield's FIND and runs at about half 
the speed. It takes about 2.5 minutes to 
search 8.5 Kbytes. On the plus side, the 
extra length and sacrifice in speed buys 

1. the option not to search or 
only to search strings, 

2. the option to have listed the 
lines that contain the sought 
item, and 

3. the option to replace the 
sought item by anything of equal 
length. 



Because of the limitation on length in 
the CHANGE function, this feature is not 
really a general purpose program editing 
tool. Nevertheless, it is quite useful in 
dressing up variable labels or changing, 
say, a real variable to an integer variable. 



Demonstration 

To do a search/change, the 
SEARCH/CHANGE program must be ap- 
pended to the program to be searched. 
Either use the merge feature of the 3.2 
DOS renumbering program or the 
machine language APPEND program 
and proceedure given by Chuck 
Carpenter, Renumber Applesoft, MICRO 
12:45 (May 79). Once the programs are 
wed, enter the search item as line 1 and 
the change item, if any, as line 2. Then a 
RUN 63000 starts the works. 

To demonstrate the workings of 
SEARCH/CHANGE, we use the rather 
nonsensical program listed in Figure 1. 
We enter the search item DOG as line 1 
and run 63000. The print-out of this run is 
given in Fig. 2. Every appearance of the 
three consecutive letters D O G is listed. 
Had we asked for the lines to be listed, a 
given line would have been listed only 
once. 

We can search for anything; Fig. 
3(a) shows the result of a search for 
equal signs. However, we do have to be 
careful of Applesoft's reserved words. 



Figure 3(b) shows what happens if we try 
to search for CAT. Applesoft recognizes 
the reserved word AT in CAT. This makes 
clear the need of having the program list 
for verification the search and change 
items. 

The reserved word problem is a 
relatively minor nuisance. A little in- 
genuity can get us around it. In the CAT 
case, we could search for CA; if that 
gave too many other items, we could 
then search for TS and only consider the 
lines that appear in both lists. 

The CHANGE function, as well as 
the line listing feature, is demonstrated 
in Fig. 4. Again caution is wise. What if 
we had already used the DGS label in our 
program? There would be no way later 
that we could separate the old DGS from 
the new DGS. If in doubt in changing a 
label, first make a search to see if the 
new label is already being used. 

In changing the variable label from 
DOG to DGS, we did not want to change 
the word DOG inside strings, hence did 
not search strings. The capability of not 
searching strings or only searching str- 
ings provides all the flexibility we ever 
need. 

We note that we can only change an 
item to one equal in length (as AP- 
PLESOFT sees the length). Extra length 
in the change item entered as line 2 is ig- 
nored. If the replacement is shorter than 



January, 1980 



MICRO — The 6502 Journal 



20:55 



the search item, things go awry. The 
result is a muddle, correctable in general 
only by a start over from scratch. 

Design 

A few comments on the design of 
the SEARCH/CHANGE program are of- 
fered here in lieu of remark statements 
in the program itself. 

First the program identifies the 
search item, FOR loop lines 
63040-63070. Then it identifies the 
change item, if any, FOR loop line 63110 
and preceeding line. The search is car- 
ried out by FOR loop lines 63130-63170. 
To get the best operating speed, we 
close the FOR loop within a single line 
(line 63130) if no byte of significance is 
found. Even so, the testing for up to 
three conditions takes time. If one of 
these conditions is not met, then the 
following lines either pass to subroutine 
line 63300 to complete the item iden- 
tification test and make the item change 
(if one. is entered), or set the string's 
search flag, or strart the search of the 
next program line, whichever is in- 
dicated. Line 63120 determines that the 
search is over when line 62999 isreached 
and passes to output. The routine lines 
63220-63290 accomplish the line listing 
feature. Note that the search for the 
LIST command is backwards from the 
end of the program (we know that the 
one we want is the last one). Also note 
that the line number has to be poked in 
so that there should always be five digits 
following LIST. After use of the program, 
the actual number that appears here 
when line 63270 is listed is the last 
number poked in. There should be 
leading zeros if that number had less 
than five digits. The Applesoft inter- 
preter preserves these leading zeros 
whereas the 3.2 DOS renumbring pro- 
gram does not. If you want to renumber 
SEARCH/CHANGE, remember to check 
this line and, if you want to, change the 
62999 in line 63120. 



Figure 1: Listing of Demonstra- 
tion Program 

10 FflU I ■ 1 TO 5 

20 "PINT "POGS ANP CATS FIC.HT. 

"; : NFXT : PRINT : PRINT 
30 INPUT "CIVF TH* NWMRFR "F CM 

S ";CT«: PRINT 
liO INPUT 'T-IVF THE NtlMBFP OF DUO 

s ";nnr: print 
50 if cts - o ANn nnn » o thfn fn?i 

60 PPINT : PP1NT "THF PRORARLF W 

INNF" IN A CAT-nnn FlfiHT": PRINT 
"WITH ";nr)G;" nOfiS ANO ";CT« 
;" CATS WPUL" 9F" 

70 if non • n then print "••••• 

TATS ": ENO 

80 IF CT« - THFN P°I»T " 

DORS*****": FNP 
RP IF RNP (1) ♦ CTS / nnc > .* THF" 
PPINT ".....CATS.....": FNr 

100 PRINT "♦♦♦♦♦r>OOS«««««": FNP 



Fig. 2: SEARCH Demonstration 

)1 DOG 

)RUN 63000 

1 DOG 

PLEASE VERIFY IF THE COMPUTER TAKES 

THIS A? YOU INTENDED. DO YOU WANT 

TO C0HT I Nil F (YES OP NO)? YES 

DO YOU WANT TO SFAP.CH |NS|nF STPINGS 

(YFS OR NO)? YES 

DO YOU WANT TO SFARCH STRINGS ONLY 

(YFS OR NO)? NO 

THE ITEM 

1 DOG 

IS FOUND IN THE FOLLOWING LINES: 



20 
50 
60 
90 



1*0 
60 
70 

inn 



uo 

60 
80 



PO YOU WANT THESE LINFS LISTFO (YES OR NO)' NO 



Fig. 3: Other SEARCH Demonstrations 

(a) Search for equal signs 

THE ITEM 



IS FOUND IN THE FOLLOWING LINES: 



10 
70 



50 
80 



50 



DO YOU WANT THESE LINES LISTED (YES OR NO)? NO 
(b) Attempt to search for CAT 

)1 CAT 
)RUN 63000 

1 C AT 

PLEASE VERIFY IF THE COMPUTER TAKES 

THIS AS YOU INTENDED. DO YOU WANT 

TO CONTINUE (YES OR NO)? YES 

DO YOU WANT TO SEARCH INSIDE STRINGS 

(YES OR NO)? YES 

DO YOU WANT TO SEARCH STRINGS ONLY 

(YES OR NO)? NO 

THE ITEM 
1 CAT 

IS FOUND IN THE FOLLOWING LI*'*S: 
NONE. 



20:56 



MICRO — The 6502 Journal 



January, 1980 



Fig. 4: CHANGE Demonstration 

)RUM 63000 

1 DOG 

2 OGS 

PLEASE VERIFY IF THE COMPUT" TAKFS 

THIS AS YOU INTENPEP. PP YOU WANT 

TO CONTINUE (YFS OR NO)? YES 

00 YOU WANT TO SEARCH INSIDE STRINGS 

(YFS OP NO)? MO 

DO YOU WANT TO SFAPCH ST^'OS "MLY 

(YFS OR NO)? NO 



THE ITFM 

1 DOC 

IS FOUND IN THE FOLLOWING LMES: 



(tO 
70 



50 
90 



RO 



J 



DO YOU WANT THESF LINES LISTED (YES OR NO)? 
YES 
THERP WILL BE A WAIT AFTE" EACH LI*'F 
UNTIL YOU HIT RETURN T" CONTINUE. 



UO INPUT "PIVE THE M1WRFR 0^ OOP 
S ";PGS: PPI W T 

50 IF CTS = n AND 00^ = THFN fMP 

60 PRINT : °RINT "THF PROBAPL^ '•' 

INNER |M A CAT-POO F I PHI-" : pp|mt 
"WITH ";POS;" OOOS ANn ";CTS 
;" CAT*; WOULD RE" 

70 IF PCS = THEN PRINT "***** 
CATS*****": FNP 

90 IF RMD (1) * CTS / DOS > .5 THEN 
PPIMT "*****CAT^*****": FNn 



Fig. 5: Listing of SEARCH/CHANGE Program 

62999 END 

63000 DIM SFEK(100),NT(100),L(10 
0):START - 256 * PEEK (10U) 

♦ PEFK ( 103 ) : FIN I ■ 25F * 
PEEK (106) + PEEK (105) 
63010 IF 256 * PEEK (STAPT ♦ 3) 

+ PEEK (START + 2) < > 1 THEN 
PRINT "YOU MUST ENTER YOUR 
SEARCH ITEM AS LINE": PRINT 
"1 BEFORE YOU RUN 63000.": ENn 

63020 LIST P,2: PRINT "PLEASE VE 
RIEY IF THE COMPUTER TAKES": 
PRINT "THIS AS YOU INTENnEp 
. DO YOU WANT": INPUT "TO CO 
NTINUE (YES OR NO)? » ; Y$: IF 
Y$ < > "YES" THEN END 



63030 PRINT "00 YOU WANT TO SFAR 

CH INSIDE STRINGS": INPUT "( 

YES OR NO)? ";YY<;: PRINT "DO 
YOU WANT TO SEARCH STRINGS 

ONLY": INPUT "(YES OR NO)? " 

;YZ$: IF YZ< = "YES" THEN SO 
■ 1:YY$ - "NO" 
630U0 FOR I ■ TO 255 
63050 SEEK(I) * PEEK (STAPT + U + 

I) 
63060 IF SEEK(I) = THEN N - I - 

1: GOTO 63080 
63070 NEXT 

63080 M - START + N ♦ F 
63090 CH - 0: IF 256 * PEEK (M + 

3) ♦ PEEK (M + 2) < > 2 THEN 

CH - 1: GOTO 63120 
63100 IF N ■ THEN NT(0) =■ PEEK 

(M ♦ U): GOTO 63120 
63110 FOR I = TO N:NT(I) - PEEK 

(M + k * I): NEXT 
63120 LM - 256 * PEEK (m + 3) + 
PEEK (M + 2): IF LM > * 62 

999 THEN 6318P 
63130 FOR I ■ M ♦ k TO M + 255: IF 
PEEK ( I ) < > AND PEEK ( 

I) < > SEEK(O) AND PEEK (I 

) < > 3U THEN NEXT 
63U0 IF PEEK (I) - 3U AND YY$ - 
"NO" THEN SQ - SQ ♦ 1: I F SO 

- 2 THEN SO - 

63150 IF PEEK (I) - SEEK(O) AND 
SQ < > 1 THEN GOSUB 63300 

63160 IF PEEK (I) - THEN M - 
I ♦ 1: GOTO 63120 

63170 NEXT 

63180 HOME : PRINT : PRINT : PRINT 
"THE ITEM": PRINT " "; : LIST 
1: PRINT "IS FOUND IN THE FO 
LLOWING LINES:": PRINT : IF 
L(l) - THEN PRINT " 
NONE.": END 

63190 FOR I * 1 TO K: PRINT L(l) 
,: NEXT : PRINT 

63200 PRINT : INPUT " DO YOU W\N 
T THESE LINES LISTED (YES OR 
NO)? ";Y$: IF Y$ - "NO" THEN 
END 

63210 PRINT : PRINT "THERE WILL 

BE A WAIT AFTER EACH LINE": PRINT 
"UNTIL YOU HIT RETURN TO CON 
TINUE.": PRINT 

63220 FOR I - 1 TO 1000:W * FINI 

- 2 - I: IF PEEK (W) - 188 
THEN 632U0 

63230 NEXT 

6321*0 FOR I - 1 TO K: IF L(l ) - 

L(l - 1) THEN 63290 
63250 L$ « "0000" + STR$ (L(l)): 

L$ - RIGHTJ (L$,5) 
63260 FOR J - 1 TO 5: POKF W ♦ J 



January, 1980 



MICRO — The 6502 Journal 



20:57 



,U8 + VAL ( Min$ (L$,J,1)): 
NEXT 
63270 LIST 123U5: INPUT "";Y$ 
63280 IF K < 2 THEN ENP 
63290 NEXT : END 
63300 IF N - THEN K - K + 1:L( 

K) - LM: IF CH - THEN POKE 

l,NT(0): RETURN 
63310 IF N ■ THEN RETURN 
63320 FOR J - 1 TO N: IF PEEK ( 

I + J) < > SEEK(J) THEN RETURN 

63330 NEXT 

633U0 K ■ K ♦ 1:L(K) - LM 

63350 IF CH < > T"EN RETURN 

63360 FOR J ■ TO N: POKE I + J 

,NT(J): NEXT 
63370 RETURN 



Applc-Doc 

By Roger Wagner 

An Aid to the Development 
and Documentation of Applesoft Programs 

This 3 program set is a must to anyone writing or using programs 
in Applesoft! It not only provides valuable info, on each of your 
programs, but allows you to change any element throughout the 
listing almost as easily as you would change a single line!! 

With Apple-Doc you can produce a list of every variable in your 
program and the lines each is used on, each line called by a GOTO, 
GOSUB, etc., in fact, every occurance of almost anything! 

You can rename variables, change constants and referenced line 
#"s, or do local or global replacement editing on your listing. 

In fact, we guarantee that after purchase, if you don't feel 
APPLE-DOC is one of the most valuable programs in your library 
we will even refund your money! (Upon return of product.) 

Unheard of? Yes! But that's how good APPLE-DOC really is! 

That's not all!! Send for free info, or visit your nearest Apple 
dealer. 

Only $19.95 Please specify diskette or tape. 

(Calif, residents add 6% Sales Tax) 

Available from your local computer store or: 

Southwestern Data Systems 
P.O. Box 582-M 
Santee, CA 92071 
(714) 562-3670 

(Dealer inquiries invited) 



BACLAN would like to know if you 

WANT TO PROCESS DATA 
ON YOUR APPLE? 

• if so you should be looking for 
efficient tools to assist with data 
entry, (i.e. building files) and file 
handling (i.e. scanning, sorting, 
printing and copying files). 

and 

• if you are also looking for economy, 
we think you will be pleasantly 
surprised by the low price of the 

BACLAN FILE HELPER 



available at your Apple Computer Dealer 
in both Applesoft and Integer Basic versions 



d 



BACLAN 



(301)997-9610 



P.O. Box 36 



Columbia, MD. 21045 



MIGHTY BYTE IS HERE 


PROGRAM— APPLE II 


COMPANY 


MFQ 
LIST 


Bowling League Secretary 


Mighty Byte 


24.95 


Lisa Interactive Assembler (Req 48K & Disk) 


Programma Int. 


34.9S 


Master Catalog (Req 32K 4 Disk) 


Programma Int. 


29.95 


Apple Pie *Ver 1.0 (Req 32K 4 Disk) 


Programma Int. 


24.95 


Dr. Memory (Req 32K 4 Disk) 


Muse Co. 


49.95 


Disk Magic (Req 32K & Disk) 


Programma Int. 


24.95 


Format *Ver 1.0 (Req Disk) 


Programma Int. 


24.95 


3-D Animation 


Programma Int. 


24.95 


Super Dungeon (Req 48K 4 Disk) 


Programma Int. 


24.95 


U-Draw 


Muse Co. 


17.95 


U-Draw II (Req 32K) 


Muse Co. 


39.95 


Three Mile Island (Req 48K) 


Muse Co. 


39.95 


Escape 


Muse Co. 


12.95 


Tank War 


Muse Co. 


12.95 


Phasor Zap 


Programma Int. 


15.95 


3-D Ducking 


Programma Int. 


15.95 


Strato Laser 


Programma Int. 


15.95 


Depth Charge 


Programma Int. 


15.95 


Super Othello 


Programma Int. 


15.95 


Canter Downs 


Programma Int. 


15.95 


Super Star Wars 


Programma Int. 


15.95 


Many many more programs available. 






Hardware Section 






Centronics 730 Printer 




995.00 


Heuristics H200 Speechllnk 




259.00 


Comprint 912 Printer (Parallel) 




660.00 


Comprint 912 Printer (Serial) 




695.00 


Heath WH-14 Printer 




895.00 


Vinyl loose-leaf Diskette Pages (Pack of 10) 




8.50 


Visa & Mastercharge accepted 






To Introduce you to MIGHTY BYTE take H 1)% 


oft any order. 




MIGHTY BYTE COMPUTER INC. 




P.O.Box 213 






HO-HOKUS, N.J. 07423 




(201)4454256 







SYM-1 Staged Loading 
Technique for Segmented 
Programs 



The SYM cassette tape I/O can not load continuously 
from 0000 on. The end of page zero and the end of page 
one can not be directly loaded. A program and technique 
are presented which simply get around this situation. 



Robert A. Peck 

P.O. Box 2231 

Sunnyvale, CA 94087 



The basic SYM-1 comes equipped 
with IK of user RAM, most of which can 
be used for program material. This RAM, 
however, because of usage by the 
system monitor, is not contained in a 
continuous block. 

Specifically, the area from roughly 
01 D1 to 01 FF is used as a stack area. 
Any data or return addresses pushed on- 
to the stack during program (or monitor 
routine) execution will erase and replace 
any program material which one might 
attempt to store in these locations. 

Likewise the SYM manual indicates 
that the page zero locations from OOFO 
to OOFF are used occasionally by the 
monitor program. 

Using the SYM tape dump routines, 
we are able to dump a continuous block 
0000 to 03FF to the tape but it is not 
possible to reload this block in the same 
manner because of the monitor usage of 
the areas specified above. 

In order to make as full use of the 
memory space as possible then, we 
must segment. the programs, storing one 
segment in the area from 0000 to 00EF, 
another from 0100 to 01CF and the third 
from 0200 to 03FF (or higher if additional 
memory is installed). 



To store the complete program on 
tape, we must store the segments in- 
dependently, since that is the only way 
we can properly retrieve them. Just as an 
example, let's say that the first segment 
has an ID byte of "02", covering 
0000-00EF, the second segment an ID 
byte of "03" (0100-01CF) and third an ID 
of "04", (extending from 0200 to the end 
of the program). 

Then to reload the program from 
tape, we must issue three sets of com- 
mands, specifically: Load 02 (CR), Load 
03 (CR), Load 04 (CR). We must wait for 
the tape load in between entries. Then 
we must issue the command which 
starts the program. If the start location 
is 0200, we must enter: Go 200 (CR). 

It would be much simpler if we were 
able to enter all of the commands at 
once and have the machine load all the 
segments in the right places and then to 
auto-jump to the start of the program on 
completion of the load. 

Well there is an easy way to set this 
up with the SYM-I. A 16-byte program 
entered by the user into any 16 con- 
secutive locations will act as the initial 
loader program. This is shown in Figure 
One. 



This program would load a program 
with an ID equal to "01". Because we did 
a jump to the tape load routine rather 
than a "JSR", an interesting thing hap- 
pens. When the tape load routine is done 
it executes an "RTS", a return from 
subroutine. This causes the last two 
bytes pushed onto the stack to be pulled 
back off and loaded into the program 
counter. 

Therefore when we complete the 
load of program "01", we will execute a 
jump to location 0200 because this is the 
two byte address we pushed onto the 
stack before the tape load routine was 
ordered. Program "01" is, in this case, in- 
tended to be loaded into loctions 
0200-02I0 and is shown in Figure Two, 
described below. 

This program will load the segment 
"02" into locations 0-CI, then "03" into 
locations 100-1C1, and finally segment 
"04" into locations 0200-03FF. Note that 
program segment "04" writes over the 
area where program "01" was loaded. 
However, since we were under control of 
the monitor program at the time, it did 
not matter at all. Besides this, once the 
third segment is fully loaded, we no 
longer need the loader program in 
memory. 



January, 1980 



MICRO — The 6502 Journal 



20:59 



After the load, we execute the RTS 
in the tape loader routine. Since we did 
not jump to it as a subroutine for the 
load of the last segment, all it does is to 
pull 0200 off the stack and uses this as 
the location of the next instruction to ex- 
ecute. 

Therefore by loading those initial 16 
bytes in the first program described, we 
cause the machine to load program 1 
which began automatically to load in 
turn programs 2, 3, and 4. Then it began 
the execution of our loaded segmented 
program at location 0200. 



The only cautionary note in using 
this type of sequenced loading is to be 
certain that the load control segment is 
located in the area of memory which is 
overlayed last by the final program seg- 
ment to be loaded (04 in this case). 
Otherwise you will erase the loader 
before the entire group of segments is 
brought in. 

The 16-byte setup program you will 
note is fully relocatable, and could even- 
tually be linked as a part of your monitor 
routines. However to make it more 
general in that case, the instructions 



now specified at 020B could be, for ex- 
ample, A5 EE, or reference any other 
zero page location so that the ID byte 
could be preloaded there by the user and 
retrieved by this routine for use later. 
This also assumes that the user has 
committed this routine to ROM. 

This sequenced loading technique 
has other uses as well, but that is 
another subject and may be the subject 
of a future article. 



Figure 1: The Bootstrap Program 
(Load and start Segment Loader) 



0200 


20 


86 


88 


JSR 


ACCESS 


0203 


A9 


00 




LDA 


#$00 


0205 


48 






PHA 




0206 


A9 


02 




LDA 


#$02 


20 8 


48 






PHA 




0209 


AO 


00 




LOY 


#$00 


020B 


A9 


01 




LDA 


#$01 


0200 


4C 


78 


ac 


JMP 


LOAOT 



;UNPROT£CT SYSTEM RAM 
;STACK LO BYTE OF 
;PROGRAM 01 START ADDR. 
;STACK HI BYTE OF 
;PROGRAW 01 START AODR. 
;TAPE MODE (80 IF HI SP0« 
;PROGRAM ID SEARCHEO 
;LOAD PROGRAM 01. 



Figure 2: The Segment Loader Program: 
Loads segments 02, 03, ]4 then starts execution at location 0200. 



0200 


20 


86 


€B 


JSR 


ACCESS 


;UNPRC'TECT SYSTEM 


RAM 


0203 


A9 


00 




LOA 


#$00 


;STACK LO BYTE OF 


PROGRAM 


0205 


48 






PHA 




JSTART ADDRESS 




0206 


A9 


02 




LDA 


#$02 


;STACK HI BYTE OF 


PRCGR/M 


0208 


48 






PHA 




;START ADDRESS 




0209 


AO 


00 




LDY 


#$00 


;kim mode <so for 


HI SPC.) 


020B 


A9 


02 




LDA 


#$02 


; PROGRAM ID 02 




020D 


20 


78 


ec 


JSR 


LOADT 


;JSR TO TAPE LOAD 


SUEROUTINE 


0210 


AO 


00 




LOY 


#$00 


;tape mcde 




0212 


A9 


03 




LDA 


#$03 


;id 03 




021 4 


20 


78 


ac 


JSR 


LOADT 


;JSR TO TAPE LOAD 




021 7 


AO 


00 




LOY 


#$00 


;tape mode 




0219 


A9 


04 




LDA 


#$04 


; ID 04 




021 B 


4C 


78 


8C 


JMP 


LOADT 


;tape lcad *jump* 


. BEGINS 














;prograh at 0200 when load done 





Missing MICRO Information? 



MICRO is devoted exclusively to the 6502. In addi- 
tion, it is aimed at useful, reference type material, 
not just "fun and games". Each month MICRO 
publishes application notes, hardware and soft- 
ware tutorials, a continuing bibliography, soft- 
ware catalog, and so forth. Since MICRO contains 
lots of reference material and many useful pro- 
grams, most readers want to get the entire collec- 
tion of MICRO. MICRO grew very rapidly, and it 
very quickly became impracticle to reprint back 
issues for new subscribers. In order to make the 
older material available, two collections of 
reprints have been published. 



A limited number of back issues are still available 
for number 7 through current. 



The BEST of MICRO Volume 1 contains all of the 
significant material from the first six issues of 
MICRO, covering October/November 1977 through 
August/September 1978. This book form is 176 
pages long, plus five removeable reference cards. 
The material is organized by microcomputer and 
almost every article is included. Only the ads have 
been omitted. Surface . . . $7.00 

Air Mail . . . $10.00 

The BEST of MICRO Volume 2 covers the second 
six issues, from October/November 1978 through 
May 1979. Organized by microcomputer, this 
volume is 224 pages. Surface . . . $9.00 

Air Mail . . . $13.00 

Use the convenient Order Form on Page 23 to 
place your order. 



6502 Bibliography: Part XVI 



j 



514. Call — Apple 2, No. 5 (June 1979) 

Kotinoff, Jeff, "LORES Color Picture", pg. 19 
Two color programs for the Apple II. 

Garson, Dave, "Programmer's Aid Notes", pg. 19 

How to use the XDRAW command omitted from the pro- 
grammer's aid ROM. Two other DEMO progrms using the 
PA ROM of the Apple. 

Golding, Val J., "Book Review", pg. 20 
"The Apple II Monitor Peeled" is a very good book by 
William E. Dougherty, 46 pp $9.95 available from the 
author at 14349 San Jose St., Los Angeles, CA 91345 

Aldrich, Darrell, "Scrunch", pg. 21 

Discussion and listing of Neil Konzen's program 
SCRUNCH 

Golding, Val J., "Constructing a Menu", pgs. 25-26 
Details of how to put a menu in your program. 

Aldrich, Darrell, "Zero Page Usage by Monitor", pg. 27 
A list for Apple Users. 

Lewellen, Tom K., "Integral Data/Parallel Card Fix", pg. 28 
Modification of the card solved the problems on the Ap- 
ple. 

Paymar, Dan, "Prime Factors", pg. 28 

A program is listed to compute the prime factors of a 

given number on the Apple. 
Aldrich, Darrell, "The Apple Doctor", pg. 30 

All about the ASCII character set on the Apple. 

Smith, Ken, "HEX/DEC Conversion Program", pg. 30 

Convenient Utility Program. 
Ray, R.E., "Fireworks", pg. 31 

Two graphics programs. 

Garson, David B., "MOD Function", pg.3l 

A routine to simulate the "MOD" function in Integer 
Basic. 

515. Contact No. 5 (June, 1979) 

Anon, "Out of the Mist", pgs. 4-6 
Subroutine calls for the Apple, Peeks and Pokes 

Anon, "Color Killer Mod for Early Apples", pg. 6 

How to modify Apples with serial numbers below 6000. 

Anon, "Shifting Programs from Integer to Applesoft", pg. 6 
Routine to automatically shift programs. 

516. Interface Age 4, Issue 4 (April 1979) 

Nabers, Steve, "6502 Comprehensive Memory Test 
Program", pgs. 140-145. 

Memory diagnositc set-up for 6502 and implemented on 

KIM-1. 



517. The Computing Teacher 6 No. 4 (May 1979) 

Harder, Monty J., "Bargraph— A Program for the PET 
Microcomputer," pgs. 45-46. 

A simple program for bargraphs — written for ease of 

adaptation into other programs. 

518. The Target, (Jan/Feb 1979) 

Anon, "Binary Indication of the Status Register," pg. 2. 
A program for the AIM to print labels for each bit and 
display the bit in binary. 

Anon, "Bits and Pieces," pg. 3. 

Gives info on loading sync characters from tape and lists 
seven subroutines not included on the AIM Summary 
Card. 

Anon, "A Program Idea — Soft Memory Expansion," pg. 3 
How to get better utilization of your AIM memory. 

Anon, "A Pseudo Waveform," pg. 5 
An AIM program to generate a pseudo waveform. 

Anon, "Some of the Printer and Display Routines 
Explained," pg. 4. 

This article supplements the AIM manual in explaining 

routines. 

Anon, "Disassembly to the User VIA," pg. 5 
The program for the AIM gives a quick indication of pro- 
grams in memory. 

519. The Target (May/June 1979) 

Anon, "Symbol Generator," pg. 2. 
A symbol generator for the AIM which produces symbols 
which are user definable. 

Anon, "Enhanced Disassembly to the User VIA," pg. 4. 
An extension of the program published earlier. For the 
Aim. 

Anon, "Sound Generators," pg. 5. 
A description of several sound generators for the AIM. 

Riley, Ron, "B.A.P.", pg. 6. 
Expand the input/output for the AIM. 

Anon, "Poor or Lazy Man's Regulator," pg. 6. 
A simple regulator for the AIM. 

Riley, Ron, "AIM 65 Physical Connections," pg. 7. 
Connections for the Display and Printer. 

520. Interface Age 4, No. 7 (July I979) 

Kirschenbaum, Jack, "Need a System Cabinet? Build it!" 
Build a cabinet to transport your Apple microcomputer. 

521. The Target (Mar/Apr 1979) 

Anon, "AIM 65 Poster," pg. 2. 
A program to print a large poster with the AIM. 



January, 1980 



MICRO -- The 6502 Journal 



20:61 



Anon, "Software Design— Slow Step," pg. 4 

Development of a program for slow stepping the AIM. 

Roland, Don, "AIM 65 Monitor Subroutines," pg. 9. 
A numerical listing of the subroutines. 

Riley, R.J., "Regulator Circuits," pg. 9. 
Several useful regulators are described. 

Anon, "Using Existing Software," pg. 10-11. 
Adapting KIM and other software for the AIM. 

Anon, "Lunar Landing Patch," pg. 11. 

Modification of this popular program for the AIM 65. 

522. Byte 4, No.7 (July 1979) 

Smith, Stephen B., "Graphic Input of Weather Data", 
pg. 16-30 

Uses an OSI computer and a BIT Pad. 

Bishop, Robert J., "Apple Kaleidoscope," pgs. 52-53. 
A fast moving color display for the Apple. 

523. Creative Computing 5, No. 7 (July 1979) 

Chatterjee, Rabin, "Picking at 'Peeking and Poking'," pg. 12 
Corrections for a previous article (February 1979) 

Petry, Jerry, "Memory Transplants Updated, "pg. 10 
Comments on memory for the PET and TRS-80. 

Friedman, SI, "Diagnostic Program for Your PET.. .from 
Com-modore," pg. 32-33. 
Discussion of the use of several diagnostic routines. 

Kuska, Henry A., "Educational Use of the OSI 1P," pg. 40 
Discusses use of a tutor program. 

Milewski, Richard A., "Apple Cart," pg. 116-117. 
3-D Graphics on the Apple. 

Yob, Gregory, "Personal Electronic Transactions," pg. 
118-122. 
Discusses floating point routines and screen gymnastics. 

524. Abacus Newsletter 1 Issue 6 (June 1979) 

Anon, "Disc Space Summary," pg. 2 

Program for showing sectors available. For the Apple. 

Anon, "Strings and Things," pg. 3. 

A routine to concatenate the file name on the end of the 
file commands, a routine to find what the first and last 
records of the file are, etc. For Apple. 

Anon, "Create Exec Files, It's Easy...", pg. 5. 
Program with two examples to help. For Apple. 

Anon, "X-Y Plotter," pg. 6. 
Apple program to plot curves. 

Anon, Password Program," pg. 7. 
How to secure your Apple programs. 

Anon, "Now You Can Have Lower Case Characters Too," pg. 
7 
Short program for lower case. 

McCann, Michael J., "How About a (Basic) Disassembler," 

pg. 8-9. 
This program will literally take apart a BASIC program and 
convert it to machine language. For PET or APPLE II. 

Wilkerson, David, "Lower-Caseing It On The Apple II," pg. 
10-11. 
Lower case with Integer Basic. 

Bishop, Robert J., "Apple Speaks.-.Softly," pg. 12-13. 
An inexpensive talking Apple II. 

Crossman, Craig, "The Micromodem II," pg. 14. 
All about this interesting Modem and the special features 
it provides for the Apple. 

Wine, Hal, "Applesoft Stop-List," pg. 15-16. 
A short machine language program convenient to use. 



525. Recreational Computing 8, No. I,lss.40 (July/Aug 1979) 

Fisher, Ted. "Checkmate in Five," pg. 5 
Amaze your friends! Beat Peter Jenning's Microchess 1.5 
in five moves! 

Lindsay, Len, "How to Fool Around With Your PET,"pg. 
24-26. 

A bouncing ball program with tutorial value. 

Saal, Harry, "SPOT— The Society of PET Owners and 

Trainers," pg. 54-55. 

New Commodore products for the PET, BASIC Program- 
mer's Toolkit, some common basic programs (on tape). 

526. Apple Peelings 1, No. 1 (July 1979) 

Anon, "Disk of the Month, July, 1979," pg. 3 

The July DOM includes B/BSTAT a version of BINADR 
which works with either 3.1 or 3.2 DOS. Apple Peelings is a 
new newsletter from the Apple Core of San Francisco and 
will alternate on every other month with the CIDER 
PRESS. 

527. Kilobaud Microcomputing No. 32 (August 1979). 

Lindsay, Len, "PET Pourri," pg. 6-7,12. 
New PET ROMs are not compatible with the old ROMs. 
Discussion of Skyles new PAL printer, the programmable 
character generator, automatic line numberer program, 
etc. 

Ascolillo, Carol and Schwartz, Nancy, "Cover Up," pg. 26-37. 
Home decoration software for the PET. 

Brown, A.W., "Apple Ciphers," pg. 90-92 
The role of the Apple in the development of a medical- 
office package. 

Lloyd, Kenny, "Taking AIM," pg. 102-104. 
Discussion of the Rockwell International 6502-based AIM 
65. 

Hayek Tom, "PET Wrap-up," pg. 110-112. 
Haul out the wire-wrap tool and relieve the memory 
crunch in your PET. 

Badgett, J. Tom, "Visit to OSI," pg. 118-123. 
All you ever wanted to know about OSI. 

528. MICRO No. 14, July 1979. 

Carlson, Lt. Robert, USN, "A Baudot Teletype Driver for the 
Apple,", pg. 5. 
Use an expensive Baudot teletype with your Apple. 

Abrahamson, Robert, "Structured BASIC Editor and Pre- 
processor," pg. 7-14. 
A versatile preprocessor for the OSI Challenger, makes it 
possible to enter, list, modify and resequence BASIC pro- 
grams. 

Hertzfeld, Andy, "Intercepting DOS Errors from Integer 

BASIC," pg. 17-18. 
Integer Basic programs can trap errors from DOS, 
diagnose problems, and take remedial action with no in- 
tervention from the operator. 

Evans, Melville and Larrowe, Vernon, "AIM Your Spouse 
Toward Success at the Supermarket," pg. 19-20. 
A grocery list generator. For the AIM. 

Christensen, Alan K., "Boolean Equations Reduced on the 

PET," pg. 23-26. 
This Basic program trains the PET to perform computer- 
aided logic design. 

Mottola, R. M., "Screen Dump to Printer for the APPLE II," 

pg. 27-28. 
With this program, print a screen full of information on 
your printer after you have reviewed it on the screen. 

Taylor, William L., "OSI Memory Test in Basic," pg. 29. 
Find that hidden bug in the many K's of Ram. 



20:62 



MICRO — The 6502 Journal 



January, 1980 




STANDARD FEATURES 

• single key cursor control 

• automatic word overflow 

• character, word and line insertion 

• forward and backward scrolling 

• automatic on screen tabbing 

• single key for entering "the" 

• auto paragraph indentation 

• character, word and line deletion 

• ditto key 

• multiple text windows 

• block copy, save and delete 

• advanced file handling 

• global (multi-file) search and replace 

• on screen math and column totals 

• column decimal alignment 

• chapter relative page numbering 

• complete printer tab control 

• line centering 

• superscripting and subscripting 

• two color printing 

• underscoring and boldface 

• user defined special functions 



The 

Professional 
Word 
Processor 



for the Apple II 



MUSE. 

THE LEADER IN QUALITY SOFTWARE 



FAST EDITING 

Super-Text was designed by a professional writer 
for simple, efficient operation. A full floating 
cursor and multiple text screens facilitate editing 
one section of text while referencing another. 
Super-Text's advanced features actually make it 
easier to operate, allowing you to concentrate on 
writing rather than remembering complicated 
key sequences. 

FLOATING POINT CALCULATOR 

A built in 15 digit calculator performs on-screen 
calculations, column totals and verifies numeric 
data in statistical documents. 



ADVANCED FILE HANDLING 

Single key file manipulation and complete block 
operations allow the user to quickly piece together 
stored paragraphs and phrases. Text files are 
listed in a directory with a corresponding index 
for fast and accurate text retrieval. 

PRINTER CONTROLS 

Super-Text is compatible with any printer that 
interfaces with an Apple. Print single or multiple 
copies of your text files or link files and they will 
be automatically printed in the specified order. 
User defined control characters can activate most 
special printer functions. 



EXCLUSIVE AUTOLINK 

Easily link an unlimited number of on-line files 
on one disk or from disk to disk. Autolink allows 
you to search or print all on-line files with a single 
command. Typical files of items that can be stored 
in this way include personnel files, prospect files, 
maintenance records, training records and 
medical histories. 



MODULAR DESIGN 

This is a modularly designed system with the 
flexibility for meeting your future word processing 
needs. The first add-on module will be a form 
letter generator for matching mailing lists with 
Super-Text form letters. The form letter module 
will be available in the first quarter of 1980. 



SUPER-TEXT, requires 48K ($99.95) 

Available TODAY at Computer Stores 

nationwide. Dealer inquiries welcome. For more 

information write: 



MUSE SOFTWARE 330 N.Charles Street . Baltimore, MD 21201 (301)659-7212 




tmmms^^m^^^^^^^^0M^. 



HIGH RESOLUTION GRAPHICS 

LOOK TO MTU. WE SUPPORT HIGH RESOLUTION GRAPHICS ON: 

PET — AIM — KIM — SYM 




MTU HIGH RESOLUTION GRAPHICS 



Micro Technology Unlimited 

P.O. Box 4596, 841 Galaxy Way 
Manchester, N.H. 03108 
603-627-1464 

Call Or Write For Our Full Line Catalog 



J/ NOW PRESENTING... "\* 






Apple software 

\Jqt your Entertainment * Business * Education 

Star Attractions: 



FILEMASTER 2 programs: FORMAT & RETRIEVAL comprise 
a powerful data file manager. Great for everything from phone lists 
to legal abstracts. Needs 32K. Design your own data structure. Up 
to 500 characters per record. Up to 15 searchable fields in any com- 
bination. On Disk. $34.95 

SPACE Multi-faceted simulation of life in interstellar society. You 
and opponents must make life & death decisions. Keeps track of 
your progress from one game to next. Needs 48K and Applesoft 

ROM. Disk $29.95 

Pot O'Gold I or our All New Pot 0' Gold II A collection of 49 pro- 
grams for 16K Apple. Everything from Logic to action games. Only 
a buck a game. Specify I or II. Price each: Tape $49 .... Disk $54 

ADVENTURE Fight off pirates and vicious dwarfs. 700 travel op- 
tions, 140 locations, 64 objects. Needs ROM & 48K. Disk. . $29.95 

16K CASSETTE INVENTORY Use item number, description, 
stock amount, reorder amount, restock date, cost & sell price. Holds 
up to 140 items. Tape $35 

32K DISK INVENTORY: Use stock numbers description, vendor, 
record of purchase and sales date, amount on hand, cost & sell price, 

total value. Holds up to 300 items. Disk $40 

With Parts Explosion: Disk $50 

32K DATA BASE Cross file for phone lists, bibliographies, recipes. 
Run up to 9 lines of 40 columns each. Search by item anywhere. 
Disk $20 

24K HI-RES LIFE SIMULATION Conway's equations on 296x180 
screen. A mathematical simulation to demo population growth with 
birth, death and survival as factors. Tape $10 

18K CIRCUIT LOGIC DEVELOPMENT AID Evaluate circuits of 
up to 255 gates, including AND, OR, NOR, NAND, XOR, XNOR 
and INVERTER. Tape $10 

16K MORSE CODE TRAINER Learn Morse Code, and transmit or 
receive over radio. Tape $10 

16K DEVIL'S DUNGEON: Adventure through dark passages where 
monsters, demons, poisonous gas, dropoffs threaten ... all to disco- 
ver fantastic treasures. Comes with instruction book. Tape ... $10 

16K PACIFICA: Discover the floating island and rescue the beauti- 
ful princess. To win you must recover the enchanted crown, but you 
face the threat of magic spells and demons. Tape $9.95 

Don't see what you've been looking for, here? 
Then write for our FREE SOFTWARE CATALOG. 
We're saving one just for you! 

To order, add $2 shipping. California residents add 6% 
sales tax. Sorry, we can not ship to P.O. Boxes. VISA/ 
MASTERCHARGE and BANKAMERICARD Welcomed! 



RAINBOW'S CASINO 9 gambling games: Roulette, Blackjack, 
Craps, Horserace, and a few originals that Vegas hasn't heard about. 
Needs 16K. Tape $29.95 

16K SPACE WAR: You in your space capsule battle against the 
computer's saucer . . . in hi-res graphics. Tape $12 

16K MEMORY VERIFY Diagnostic routine to check range of mem- 
ory. Indicates faulty addresses, data in memory cell, and faulty data. 
Tape $5 

16K APPLEODION Music synthesis composes original Irish jigs. 
Enter your own music and save on tape or disk. Includes 3 Bach 
fugues. Tape $10 

16K APPLEVISION Demo for Hi-Res graphics and music. 

Tape $10 

32K COMPU-READ 5 programs to teach you speed reading, in 
stages. Includes synonym and antonym identification. You control 
your rate of speed, or keep up with the computer's pace. 
Disk $24.95 

48K PERCEPTION I, II, III random shapes and sizes must be 
matched. In III, you control format and display time and get 
weighted scores. Needs ROM. Each Disk $24.95 

32K STORY TELLER Use your bizarre imagination and input key 
words for fantastic and funny tales. Never the same story twice. 
Tape $12.95 

32K WAR/RESCUE Engage in 10 battles with your infantry against 
the Apple robots. Calculate Apple's strategy and win more battles 
than the computer. Tape $12.95 

24K POLAR PLOT Plot polar equations in Hi-Res Graphics. 

Tape $10 

32K SHAPE SCALER Utility to generate and animate Hi-Res 
graphic shapes. Simple routine provided to inspect position of 
shapes, and specify precise X/Y coordinates and scale. Needs ROM. 
Disk $13.95 

32K ZINTAR/PROPHET Great party game. Under control of the 
mighty Zintar's edict you take a very special trip to the world of 
Krintar. Heightened visual graphics. Needs ROM. Disk .... $16.95 

APPLE MONITOR PEELED Everything you wanted to know about 
the Apple Monitor but couldn't figure out. User-written manual in 
plain English clears your confusion. Only $9.95 




COMPUTING INC. 



Garden Plaza Shopping Center, Dept. 11 A 

9719 Reseda Blvd., Northridge, Ca 91324 

Telephone: (213) 349-5560 



NEW APPLE II SOFTWAR 




STUM CYCLE 



S15.95 




PERPETUAL CALENDAR S 9.95 




14 BALLOONS S15.95 




PEG JUMP 




BASEBALL 



SI 5.96 





LORES HYPERPAK S 6.95 




APPLE ALLEY 



S 6.95 




S1G.95 




GUIDED MISSILE 



S15.95 



All orders must include 3% postage and hand- 
ling with a minimum of $1.00. California resi- 
dents include 6% sales tax. 
VISA MASTERCHARGE 



Apple II is a trademark of Apple Computers, Inc. 



PROGFIAMMA 
INTERNATIONAL, Inc. 
3400 Wilsh ire Blvd. 
Los Angeles. CA 90010 

(2131 384-0579 

384-1116 
384 I I i 7 




DEATH RACE 



$15.96 





MOUSE HOLE 




6.95 




APPLE INVADER 



$ 1 5 96 




BREAKTHRU 



S 9.95 





L7 





Ct 

s 

fl) 

T 
CD 

D 

T 



10 

1 

3 
u 



a 

c 


ct 

fl! 



BOXING 



S 9.95 



Dealer Inquiries Invited 



STAR VOYAGER 



SI 5.95