(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Children's Library | Biodiversity Heritage Library | Additional Collections
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "Compute! Magazine Issue 006"

For The PET 



Feed Your PET 
Some APPLESOFT 



COMPUTE! 



oo 

September/ 
October, 1980 
I Issue 6 



The Journal for Progressive Computing 



■'?. 



uie Keiource Magazine For Apple, Atari, ui id Cormnodore 



Teaching Basic 
Academic Sl(ills- 
Can Micros Malce 
A Difference? 



Mixing Atari 
Graphics Modes 



Thesus Versus 
The Minotaur- 
PASCAL Visits 
Ancient Greece 



RS-232 
Communications 



TelePET 




tw\ 



VtOf 

^ W ^ Sofv 



dP^^ 



"WordPro is the most sophisticated Word 
Processing Software paclcage available for the 
Commodore Computer line." 



Solve Your Paperwork Problem . . . 
Let WordPro Software Do The Work 

Using standard typing methoas, hundreus of valuable hours are spent 
erasing, revising, and retyping letters and documents as you work 
towards a final draft copy. Ttie second, third, or fourtti drafts take just 
as long to type as the first! 

With WordPro word processing software you can transform your 
Commodore computer Into a "state of the art" word processing 
machine with sophisticated word processing features at an affordable 
price. 

There are four versions of WordPro, ranging from the simple to the 
sophisticated- WordPro 1 on cassette will give computerenthustasts a 
full range of text editing capabilities with cassette file storage. WordPro 
2 is disk based and a flows fast and easy file handling and manipulation. 
WordPro 3 was designed for professionals and contains the many 
features required in a business environment such as global search and 
replace, headers, <ooters, decimal tabulation, repaglnation, merging 
capabilities, and much, mucfi more. WordPro 4 is our best. WordPro 4 
runs on the new Commodore 8032, 80-column display computer, 
WordPro 4 has all the features of WordPro 3, plus additional features 
usually found only on the most sophisticated and expensive word 
processing equipment. 

WordPro Is a new breed of word processing software. Powerful, 
sophisticated, and easy to use, WordPro was field-tested by dozens of 
attorneys and commercial customers during 1979. WordPro is now 
installed and is saving its owners valuable time and money in hundreds 
of offices natlonv/ide. 

WordPro was designed with the user In mind. WordPro's unique 
"STATUS LINE" constantly Interacts with the user by displaying the 
status of the system. Editing, storing documents, recalling letters, even 
the most sophisticated comands, are accomplished by a few, easy to 
remember, keystrokes. 

You may find tfiat Word Pro alone is reason enough to own a computer. 
WordPro can be found at most Commodore dealers worldwide. Call us 
for the number of the dealer nearest you. If you cannot locate a 
stocking WordPro dealer you may place an order with Professional 
Software via check or VISA/fvtasterCharge. 




Actual Photograph of WordPro on CBM Model 8032 

The many features of WordPro 1 - 4: 

WordPro 1 - Cassette based • Status line • Text Editing . 
Insert/Delete • Screen Scroll Auto Repeat • String Search • 
Erase Functions • Link Files • Margin Controls • Tab 
Functions • Justification • Page Length 

WordPro 2- Most WordPro 1 Functions Plus + Dlsk Based* 
Paragraph Indent* Centering" TextTransfer* Hyphenation 
• Appending • Margin Release • Variable Blocks (Form 
Letters) • Multiple Copies • Automatic Disk Commands • 
Complete Disk File Handling 

WordPro 3 - Commercial Disk Version for 40 Columns • 
WordPro 2 Functions Plus + Global Functions (Search/ 
Replace/Copy) • Merging Disk File Linkage* 1 or 1 2 Pitch • 
Repaglnation • Duplicate Lines • Auto Delete Word/Sen- 
tence/Range • Numeric Mode • Underlining • Continuous 
Print • Headers/Footers • Auto Page Numbering • Pro- 
portional Justification • Forced Paging • Non-Print Com- 
ments • BASIC Language File Compatibility 




WordPro 4 - Commercial Disk Version for 80 Columns • 
WordPro 3 Functions Plus -f Displays and Formats Text to 
Screen for Review 

WordPro 1 — For 8K RAM units. Requires C2N 
Peripheral/integrated cassette drive - $29.95 

WordPro 2 — For 16K RAM units with 40 column 
screen. Requires 2040 disk drive - $99.95 

WordPro 3 — For 32K RAM units with 40 column 
screen. Requires 2040 disk drive- $199.95 

WordPro 4 — For Model 8032 with 80 column screen. 
Requires 2040 or 8050 disk drive - $299.95 

All four versions of WordPro are written in 6502 machine code. 

Professional Software Inc. 

166 Crescent Rd., Needham, MA 02194 
(617) 444-5224 

'WordPro Dealer Inquires Invited* 

WordPro was developed by Sieve Punlerot Pro-Micro Software Ltd., and Is marketed eicluslvely by 

Professional Software Inc. 

WordPro Is a registered trademark o( Prolessionai Sollware Inc. CBM is a registered trademark ol 
Commodore Business Machines. 





T T 



ft 



LV 



I 




ow you can add high 
resolution graphics 
to your Commodore PET 
computer. The MTU 
K-1008-6 GRAPHIC INTERFACE 
can be used with either old, new, 
or business PET computers. It Is 
simple to use, and fits Inside the 
PET for protection. 

The GRAPHIGINTERFACE gives you easy con- 
trol over each dot In a matrix which is 320 wide by 
200 high for a total of 64,000 dots. Because each 
dot can be controlled, either graphic images, text 
lines, or any mixture of the two can be displayed. 
Since each dot is controlled from software you can 
even design your own special character font or graphic 
Image set (logic, chemical, architectural). 

INTERFACE TO ALL PETS - With separate connector boards 
for each style PET (K-1007-2 for OLD PETS, K-1007-3 for NEW). 
The K-1008-6 can be used with either. 

THREE TYPES OF VIDEO ■ You can select either normal PET 
, video, graphic video, or the COMBINED Image of both video sig- 
nals simultaneously! 

, 8K RAIVI MEMORY EXPANSION - The graphic matrix requires 8K 
RAM which Is supplied onboard. This memory can be used for 
program or data storage when not being used for graphics (or see 
your program in binary on the display!). 

FLEXIBLY ADDRESSED ROM SOCKETS - Five ROM sockets are included 
on the board. They can be set at the same or different addresses, with you 
controlling which sockets are enabled at any time through software control. 
You also choose the sockets to be enabled when the PET is turned on. 

EXTERNAL EXPANSION - This board also creates the KIM memory expansion 
bus supported by all MTU products. This allows Insertion into our K-1005-P 
card file for expansion up to 4 other boards outside the PET case. 

LIGHT PEN - The board has been designed to work with an optional light 
pen which MTU will be announcing soon. 

SOFTWARE INTERFACED TO BASIC - MTU also has available machine lan- 
guage software to allow you to plot points, draw lines, and display char- 
acters at high speed. 

Call or write for our full line catalog of products. 

MICRO TECHNOLOGY UNLIMITED 

P.O. Box 12106 

2806 Hillsborough Street 

Raleigh, N.C. 27605 

(603) 627-1464 



m 



Micro Technology Unlimited 

■ P.O. Box 12106 
2806 Hillsborough Street 
RalBigh, N.C. 27605 

As ot June 1,1960 



COMPUTE! 



Septombef /October, 1980. Issue 6 



Professional Business Software 

For The Commodore 32K Microcomputer System 
With 2040 Dual Drive Disk & 2022 Tractor Feed Printer 




General Ledger 



Accounts Payable 



Accounts Receivable 



Payroll 



• Holds Up To 300 Accounis, 

• Accepts Up To 3000 
Transactions Per Monlli, 

• Casli Disbursements Journal, 
Cash Receipts Journal, and 
Petty Cash Journal for 
simplified data entry. 

• fvlaintains Account Balances 
For Present fvlonth. Present 
Quarler, Present Year. Ttiree 
Previous Quarters, And 
Previous Year. 

• Complete Financial Reports 
Including Trial Balance, 
Balance Sheet, Profit & Loss 
Statement, Cash Receipts 
Journal, Cash Disbursements 
Journal, Petty Cash Journal 
and more. 

• Accepts Postings From 
External Sources Such As 
Accounts Payable, Accounts 
Receivable, Payroll, 

Etc $295.00 



■ Interactive Data Entry With 
Verified Input And Complete 
Operator Prompting. 

Automatic Application Of 
Credit And Debit Memos. 

Maintains Complete Purchase 
Records For Up To 200 
Vendors. 

Invoice File Accepts Up To 
400 Invoices. 

Random Access File 
Organization Allows Fast 
Individual Record Updating 

Multiple Reports Provide A 
Complete Audit Trail. 

Check Printing With Full 
Invoice Detail. 
Full Invoice Aging 

Automatic Posting To 
General Ledger . . .$195.00 



• Maintains Invoice File For Up 
To 300 Invoices. 

• Accomodates Full Or Partial 
Invoice Payments 

• Customer File Maintains 
Purchase Information For Up 
To 1000 Customers, 

• Allows For Automatic 
Progress Billing. 

• Provides For Credit And Debit 
Memos As Well As Invoices 

• Prints Individualized 
Customer Statements. 

• Interactive Data Entry With 
FullQperator Prompting 

• Complete Data Input 
Verification And Formating. 

• Automatic Posting To 
General Ledger $195.00 



• Maintains Monthly. Quarterly, 
And Yearly Cumulative Totals 
For Each Employee. 

• Payroll Check Printing With 
Full Deduction And Pay Detail 

• Sixteen Different Reports 
Including W2 And 941 

• Interactive Data Entry With 
Easy Correction Of Entry 
Errors. 

• Automatic Data Verification 

• Complete Job Costing Option 
With Cumulative Totals And 
Overhead Calculations. 

• Random Access File 
Organization For Fast 
Updating Of Individual 
Records 

• Automatic Posting To 
General Ledger. . ,.5350.00 



Structured around the time tested and reliability proven 
series of business software systems developed by Osbome 
and Associates, these programs have been designed to fill 
the need of a comprehensive accounting package for the 
new Commodore PET micro computer system. Each program 
can either stand alone, or be integrated with the others in a 
total software system. 

Designed with the first time user in mind, these programs 
lead the operator through step by step, verified data entry. It 
is impossible to crash' a program due to operator error or 
invalid data input. Design consistency has been maintained 
from program to program to greatly increase operator 
familiarity and confidence. 

Documentation, normally a problem for small systems 
users, is provided by the comprehensive series of Osborne 



and Associates user manuals These three manuals together 
total over 800 pages of detailed step by step instructions 
written at three levels for DP Department Managers, Data 
Entry Operators, and Programmers. You don't have to worry 
about getting 'promises' instead of documentation because 
the documentation was written before the programs 
were developed. A second set of manuals details any 
changes required during conversion. Each program 
provided on disk with complete documentation Packaged 
in a handsome three ring binder with pockets and twelve 
monthly dividers for convenient storage of reports. 

See your nearest Commodore dealer for a demonstra- 
tion of this outstanding business software system. 



CMS Software Systems 

5115 MENEFEE DRIVE • DALLAS. TX 75227 . 214-3810690 



September /October, 1980. Issue 6 



COMPUTE! 




Page 



Table of Contents September/October 1980. Volume 

The Editor's Notes Robert Lock, 4 

Reader's Feedback Robert Lock and Readers, 6 

Computers and Society David D, T|-iornburg and Bet^ J Burr, lO 

Teaching Basic Academic Skills 

Can Micros Make A Difference? . . Tory Esbensen ond Doug Hed, 18 

Basically Useful BASIC Marvin L. DeJong and Robert Lock, 22 

RS232 Communications Michael E. Day, 26 

Solving Equations With A Computer Marvin L. DeJong, 32 

Computers and The Handicapped 

Susan Semoncik ond the Delmaiva Computer Club. 41 

Let Your PET Play Politics With HAT IN THE RING- 

A Presidential Election Gome , Tory Esbensen, 42 

The First Annual Programming 

Contest (of Herkimer, NY) E.Q. Carr, 46 

Al Baker's Programming Hints; 

Apple and Atari A: Baker, 52 

Fun With the 6502: 

Atari Software Reviews Len Lindsay 56 

The Apple Gazette , 59 

Randomize for The APPLE II Sherm Ostrowsky 59 

Screendump Jeff Schmoyer, 60 

Thesus Versus The Minotaur: 

PASCAL Visits Ancient Greece Joseph H, Budge. 64 

Some Routines from Applesoft Basic; 

Applesoft Memory Map (Page O) Jim Butterfield, 68 

The Atari Gazette 71 

Designing Your Own Atari Graphics Modes Craig Potchett, 71 

What To Do If You Don't Have Joysticks Stephen Schulman, 75 

Screen Print From Machine 

Language On The Atari Larry Isaacs, 76 

Graphics of Polar Functions Henrique Veludo, 80 

Reading The ATARI Keyboard On The Fly James L Bruun, 81 

The PET Gazette 82 

User's Report: Waterloo Structured 

BASIC For The PET FT. Spencer. 82 

TelePET Jim Butterfield, 86 

Word Pro Converter Robert W. Baker, 89 

Multitasking On Your PET? Quadra-PET Charles Bronnon, 90 

Oops! A Crucial Update to DISK ID CHANGER Rene W. Poirier, 92 

Variable-Field-Length Random 

Access Files On The 2040 Disk Drive Peter Spencer, 94 

Flexible GET for the PET Elizobeth Deal, 98 

ROM-antic Thoughts Jim Butterfield, lOO 

Converting ASCII Files to PET BASIC Harvey B. Herman, 102 

Compactor Robert W, Baker, 104 

A Few Entry Points: Original/Upgrade/4,0 Rom , . . .Jim Butterfield, llO 

Feed Your PET Some APPLESOFT G. A. Campbell, 112 

CAPUTEI Robert Lock, 120 

Advertiser's Index 120 



1. issue 6 




Page 86 



COMPUTE. The Journal for Progressive Compuling is publistii-ii six litiies each year by .Sniiill Sysiein Services. Inc., P.O. Bii.\ .iinfi, 
Greensboro, .\'C 27-(0:i USA. Pboiie: (919) 275-98U9. Edilorial Olfices arc located at 200 Kasl Bcsicinor .^%t., Greensboro. NC 27401. 
Domestic Subscriptions: 12 issues, $16.00. SencJ subscription orders or change of adtlress (P.O. Form 3579) to Circulation Dept., COMPUTE. 
Magazine, P.O. Box 5406, Greensboro, NC 27403. Controlled circulation postage paid at Greensboro, NC 27403, Entire contents copyright © 1980 by Small 
System Services, Inc. Al! righl.s reserved. ISSN 0194-337X. 



COMPUTfl 



September/ October, 1980. Issue 6 



Robert C. Lock, Publisher/Editor 
Joretta Klepfer, Associate Editor 
Carol Holmquist Lock, Circulation Manager 
J. Gory Dean, Art Direction/Production 
Assistance 

COMPUTE receives continuing editorial 
assistance from the following persons: 
Harvey Herman, University of North Caro- 
lina at Greensboro 
Jim Butterfield, Toronto, Canada 
Larry Isaacs, Raleigh, NC 
The following writers contribute on a regu- 
lar basis as Contributing Editors: 
Al Baker, 2327 S. Westminster, Wheaton, IL 
60187 

Gene Beals, 115 E. Stump Road, Mont- 
gomeryville, PA 18936 
Len Lindsay, 1929 Northport Drive #6, 
Madison, Wl 53704 

Roy O'Brien, P.O. Box 426, Beaumont, CA 
92223 

Subscription Information (12 Issue Year): 
COMPUTi. Circulation Dept. 
P.O. Box 5406 
Greensboro, NC 27403 USA 

U.S. S16.00 

Canada SIS.OO (U.S. funds) 

Europe: Surface Subscription, S20.00 (U.S. funds) if 

ordered direct, or available in local currency 

from the following distributors: 

United Kingdom 

Contact L. P. Enterprises, 

8-11 Cambridge House 

Cambridge Road 

Barking, Essex 

England IGl 18NT 
Germany, 
Switzerfand, 
Austria 
Contact Ing. W. Hofacker GMBH 

8 (Vlunctien 75 

Posttacti 437 

West Germany 
Canadian Retail Dealers stiould contact: 
Micron Distributing 
409 Queen Street West 
Toronto, Ontorio (VI5V 2A5 
(416) 363-6058 

Auttiors of monuscripts warrant that oil materials submitted to 
COMPUTE are origina! materials with full ownership rights resident 
in said authors. Bv submitting articles to COt^lPUTE, authors 
acknowledge that such materials, upon acceo'once for 
publication, become the exclusive property of Small System Ser- 
vices. Inc. Programs developed and submitted by authors remain 
their sole property, with the exception that COMPUTE, reserves 
the right to reprint the materiat as originally published in COM- 
PUTE., in future publications. Unsolicited materials not accepted 
for publication in COMPUTE will be returned If author provides a 
self-addressed, stamped envelope Program listings should be 
provided In printed form (new ribbon) as well as machine 
readable form Articles should be furnished as typed copy (up- 
per and lower cose, please) with double spacing Eoch page of 
your oiticle should beer the title of the article, dote ond name of 
the author. 

COMPUTE, assumes no liability for errors in articles or odver- 
tlsements. Opinions expressed by authors are not necessarily 
those of COMPUTE, 

PET is Q trademark of Commodore Business Machines. Inc. 
Apple IS a trademark of Apple Computer Company. 
Atari is o trademark of Atorl. Inc, 



The Editor's 
Notes 



Robert Lock, Publisher/Editor 

Atari Marches On But 
Where Is Southern California? 

It appears that the Atari machines have really picked 
up in sales. Southern California notwithstanding, the 
feedback I'm getting is that dealers ranging from the 
bigger mail order houses to the local corner store are 
seeing a great deal of buying interest in the hardware. 
Now I'm talking about US sales only, in as much as 
Atari's not really cranked up yet outside the US. 
And it honestly looks as if there's movement. Cer- 
tainly makes the dealers happy, and COMPUTE 
also for that matter, in as much as we've been sup- 
porting the Atari since our beginning. It appears that 
the upsurge in buying began in mid to late June, and 
hasn't let up. Okay, so why all this ballyhoo from 
here? I'm setting the stage for some comments on 
Southern California: 

The Background 

Southern California, as we all know, has long been a 
focal point for the state of the art in small computing 
activity. There's much activity elsewhere of course, 
but Southern California has been active in develop- 
ing what I would describe as a more advanced 
market. If you look at the number of major firms 
based out there you'll see a bit of what I mean. 

The Apple Phenomena 

This area enjoys an extremely active Apple market. 
In the LA area for example there must be dozens of 
dealers who are first and foremost Apple dealers. 
It appears that some of the dealers have ab- 
solutely refused to carry the Atari, even to the point 
of occasionally calling it bad names and describing it 
in perjorative terms. And with an area of such 
tremendous Apple loyalty, that seems understan- 
dable. But on with the story. 

The Feedback Cycle 

Given the nature of the small computer market, all 
of us who are involved in any way with the activity 
of marketing a productr or service to users and 
buyers of these small computers rely on various 
means of marketplace feedback to develop and main- 
tain marketing plans. 

From here, I rely on numerous inputs, including 
those from dealers and subscribers all over the US. 
I've run into several advertisers in the last few weeks 
who have traditionally relied on their dealer contacts 
in that area to provide some portion of their planning 
feedback. In each of these cases, both advertisers had 



September /October. 1980. Issue 6 



COMPUTEI 



the clear and imminent opinion that the Atari 
machine was struggling, being clobbered by the Ap- 
ple, etc., etc., and so on. Now mind you, this isn't 
the immediate concern. Everyone expects a new 
market (e.g. software or hardware for Atari) to be 
slow going at first. Their concern was the future of 
the machine, and by all tried and tested, locally 
valid, channels of feedback it appeared that Atari 
was in fact looking at a long up-hill struggle. 

But all of this was totally inconsistent with my 
feedback. Not only were dealers all over the country 
telling me the machines were really starting to move, 
but our Atari subscriber base has been growing at a 
faster and faster rate. Clearly somebody's buying the 
machines, and if it wasn't the forefront, the 
vanguard, of Southern California, then who was it? 

Aha! 

What I finally decided, and I welcome some com- 
ment, is that Atari is selling to the market they've 
said all along they wanted to sell to. The (frequently) 
non-technical, new consumer of computing equip- 
ment. That's the market the machines are designed 
for and targeted at. The hobbyist market hotbed, 
Southern California with users with different needs, 
and dealers with different expectations, is not supply- 
ing good feedback on that market because Atari's 
successfully reaching the one they're aimed at. I 
think we may, after all, be achieving a new genera- 
tion in consumer computing. Q 



You May Be Expiring... 

or 

Renewing Your Subscription 

To COMPUTE! 

If you're an early COMPUTE! subscriber, your 
subscription may be running out. If your mailing 
label bears the code "11/80" or "12/80" then Issue 
#7, the November/December issue, is your last one. 

Don't Miss An issue 

Renew now by sending us your check or money 
order for your 1980 suiascription. Please follow these 
simple guidelines. Mail your renewal check to COM- 
PUTE! P.O. Box 5406, Greensboro, NC 27403 
USA. Mark the envelope "Attention: Subscription 
Renewal". Include your current mailing label. If 
you've thrown your envelope away, please make sure 
that you include your name and address (especially 
your address) the same way you've been receiving 
the magazine. Check the new price schedule and in- 
clude a check, money order or Master Charge/Visa 
number with your renewal. 



COMPUTE! 




Monthly 

First Montliiy 
issue is 
January, 1981 

We're going monthly, by popular de- 
mand, and expanding the scope of 
COMPUTE! We're adding a special 
Gazette for Ohio Scientific machine 
owners, and a Gazette for the Single- 
Board AIM, KIM and SYM Owners. 
We'll maintain the same high quality, 
the same resourceful standards, that 
have taken our paid circulation from less 
than 2,000 at the beginning of this 
year (Issue 2) to over llOOO for this 
issue (Issue 6)! 

New Pricing 
(COMPUTErs 
Still A Bargain) 

A one-year (twelve issue) subscription 
to COMPUTE! is now $16.00 in the US, 
Canadian subscriptions ore now $18.00 
(in US funds), Surface moll subscriptions, 
to everywhere else in the world, are 
now $20,00 in US funds. 

See The Reader's 

Feedback 

In This Issue 

for More 
information 



COMPUTEI 



Sopfember/Ocfobef.lMO. Issue 6 



The Readei's 
Feedback 



Robert Lock, 
Publisher/Editor, and Readers 



In case you missed it in the Editor's Notes, we're go- 
ing monthly. Check there for a full timetable and in- 
formation on keeping your subscription current. 

Votes for Best Article in Issue 5 indicate that 
lots of readers like the current range of material in 
COMPUTE. Jim Butterfield took the honors with 
Mixing Basic and Machine Language. Second place 
went to Plotting Wiih the 2022, closely followed by 
How to Program in BASIC with the Subroutine 
Power of FORTRAN and Assembly Language Pro- 
gramming with UCSD PASCAL. 

And now for the rest of the feedback ... 

Author Note 

A Commodore user makes this request: 

You should indicate on all machine language listings the 

ROM version... 

I agree. You should also indicate what machine 
you're using, e.g. keyboard, etc. We're already hav- 
ing review problems trying to keep machine con- 
figurations matched up with software design, so 
when you send software for review, please indicate 
what it will run on. 

One More Auttior Plea 

Please present machine language programs with fluent ex- 
planations. If one now uses "BASIC" to program, how 
would one enter this program into PET using machine 
language? Please do not be afraid to offend us with simple 
explanations. 

On Merging Our Two 
Magazines 

What happened to Nuts and Volts.'' 

Include OSI in COMPUTE. My C2-4PMF has more in 
common with the Apple or PET than with a SYM... 
First of all, Nuts and Volts moved to compute II 
when we established that single- board computer 
magazine. Secondly, I admit that compute II wasn't 
necessarily the place for OSI machines. 

Our ability to go monthly has in part been 
defined by the merger of our two magazines. We an- 
nounced in the August/September issue of compute 

II that we were merging the two magazines effective 



with the November/December issue of COMPUTE. 
In that issue, you'll find the return of the Single- 
Board Computer Gazette (covering the 6502 based 
KIM, SYM, and AIM systems), and the addition of 
an OSI Gazette. You OSI owners will in part deter- 
mine the stability of the OSI Gazette by your sub- 
missions, so get writing! 

Issue 7 of COMPUTE! (November/December) 
will be one united issue again, and in January you'll 
receive the first monthly issue of COMPUTE! 

And Coming Next Issue 
(Ouch! Groan!) 

I learned my lesson last time. Please understand that 
one of the advantages of waiting 'till the last minute 
to write my columns is keeping you as current as 
possible on "coming attractions". The disadvantage 
is that I got carried away in my enthusiasm last time 
round. Looking back, I must have said "And next 
issue we'll have..." 10 times in the first three pages. 
I blew it. I hereby officially announce that you 
should read such comments on my pan as "And in a 
future issue we'll have...". That way if my en- 
thusiasm gets ahead of our collective abilities here 
you won't be disappointed. 

In a future issue, we'll have those promised 
business reviews. I am very pleased to report that 
over 50 business users have signed up lo review pro- 
fessional software. What we're trying to do is get 
things rolling so that reviews will be the balanced 
opinion of several reviewers rather than the hasty 
overview of one. I apologize for my over enthusiastic 
promises last time. 

On The Quality of COMPUTE! 

I was fascinated to see that the most prevalent com- 
ment regarding our going monthly was "Yes, do it, 
but only if you can maintain your current quality. " We 
pride ourselves on the quality of COMPUTE!, both 
in editorial quality and physical quality. That's been 
our goal since we started the magazine in the Fall of 
1979, and we're committed to maintaining that 
quality. As always, keep me posted on our progress. 

R.C.L. © 



September/Ocfober, 1930. Issue 6 



COMPUTEI 



.^^ 
"^^ 














»□ PAVWIENI EN'-'- • 

I • handling co^siRotR .^,, • 

\;D CHECK UM^ Q^,5^ 
\tD WASTER CHAR^:"^ 



• ExpHolion Dale- 

iriirnum cteuv 

• Name tpri'^'l 
•signatuie 

• Addiess 



• __Stale.- — j^^Q^s 






GET THE 

MOST OUT OF YOUR 

6502-BASED COMPUTER. 

Sanris has three books written especially for the popular 6502-based 
microcomputers like the APPLE, PET. ATARI, OSI, SYM, AIM and KIM. If you 
own a 6502-based computer — or are thinking about buying one— let 
Sams help you get the most out of it. We make graphics, programming, 
interfacing and software design simple. 

■ PROGRAMMING & INTERFACING THE 6502. WITH EXPERIMENTS, 

By Marvin De Jong. The more you know about programming and inter- 
facing, the more performance you can get out of your microcomputer. 
This hands-on guide to 6502 presents 80 carefully graded experiments 
to help you get the most out of your AIM, KIM or SYM. NO. 21651. $ 1 3.95 

■ 6502 SOFTWARE DESIGN 

Leo Scanlon— a leading computer expert— simplifies software design. 
Takes you from fundamentals into more complex topics. Get more ver- 
satility out of your computer by learning to program it yourself, IN- 
CLUDES 89 TEST PROGRAMS! NO. 21656. $ 1 0.50 

■ COMPUTER GRAPHICS PRIMER 

Mitchell Woife— one of the most popular computer authors— brings 
computer graphics into sharp focus. Shows you how to use a 6502- 
based computer to create complex drawings, plans, maps and 
schematics on a video screen. NO. 21650. $ 1 2.95 













Sams 

BOOKS 



COMPUTEI 



September /October, 1980- issue 6 




NEECO PROUDLY ANNOUNCES OUR 

you, conp,.,e source NEW ONE YEAR WARRANTY 

ON ALL CBM COMPUTERS! 



for all CBM Hardware 
and Software Products" 



"All CBM Computers purchased between June 15th and Sept, 15th 
will gutomoHcolly carry a full one year NEECO warranty" 



The 8032 CBM Computer is now available! 

^ commodore 







CBM^" 8000 SERIES BUSINESS COMPUTERS 

The new Commodore 8000 series computers offer a wide screen 
display to show you upto80-character lines of intormation. Text 
editing and report formatting are faster and easier with the new 
wide-screen display. The 8000 series also provides a resident 
Operating System with expanded functional capabilities. You 
can use BASIC on the 8000 computers in both interactive and 
program modes, with expanded commands and functions for 
arithmetic, editing, and disk file management. The CBfvl 8000 
series computers are ideally suited for the computing needs of 
the business marketplace. 

CBM™ 8050 DUAL DRIVE FLOPPY DISK 

The CBM 8050 Dual Drive Floppy Disk is an enhanced version of 
the intelligent CBf*/1 2040 Disk Drive. The CBf^ 8050 has all of the 
features of the CBf^ 2040, and provides more powerful software 
capabilities, as well as nearly one megabyte of online storage 
capacity The CBM 8050 supplies relative record files and 
automatic diskette initialization. It can copy all the tiles from one 
diskette to another without copying unused space. The CBfvl 
8050 also offers improved error recovery and the ability to 
append to sequential files. 



CBM 

40DaN 

4016N 

40169 

4032N 

4032B 

8016 

B032 

2023 

2022 



PRODUCT DESCRIPTION PRICE 

3K RAM-Graphics Keybaar(l-40 col. S 795.00 

16KN RAM-Graphics Keyboard-40 col S 995.00 

16K RAM-Business Ke/board-40 col. S 995 00 

32K RAM-Graphics Keyboard-40 col $1295.00 

32K RAM-Business Keyboard-40 col S1295.0Q 

16K RAM-BD Col-4.1 0,'S $1495.00 

32K RAM-BO Col. -4.1 0,'S $1795.00 

Fnclion Feed Printer $ 695.00 

Tractor Feed Printer $ 795.00 



NOTE: 

All current CBM 
production 
computert/dltlu 
now contain 
operating tyatem 
4.1/DOS 2.1 



HARDWARE SPECIFICATIONS 

Dual Drives 

Two microprocessors 

974K Bytes storage on two 

5.25" diskettes (single sided] 
Tracks 70 
Sectors 17-21 
Soft sector format 
I EEE-488 interface 
Combination power (green) and 

error (red) indicator lights 
Drive Activity indicator lights 
Disk Operating System Firmware 

{12K ROf^) 
Disk Bu ffer (4K RAf^) 
CBM 



FIRMWARE 

DOS version 2.1 
Sequential file manipulation 
Sequential user tiles 
Relative record files 
Append to sequential files 
Improved error recovery 
Automatic diskette initialization 
Automatic directory search 
Command parser for syntax 

validation 
Program load and save 



2040 

4040 

B05Q 

C2N Cassette 

CBM lolEEE 

lEEElo IEEE 

6010 

2 DOS 

4 OO/S 



PRODUCT DESCRIPTION 

Dual Floppy-343K-DOS 1 
Dual Floppy-343K-DOS2 
Dual Floppy-974K-DOS?0 
Exlernal Cassette Drive 
CBM to 1st IEEE Periphera 
CBM to 2nd IEEE Peripheral 
IEEE 300 Baud Modem 
DOS Upgrade tor 2040 
0/S Upgrade lor 40 Column 



PRICE 

$1295,00 
S129S00 
$1695,00 
$ 9SD0 
$ 39 95 
J 4995 
$ 395.00 
$ 50,00 
$ 100.00 



"Asterisks indicate tall delivery— all others are immediately available. 



SPECIAL OFFER ON CBM COMPATIBLE BUSINESS SOFTWARE! 

Purchasing software has always been difficult due to the "you buy it - you own it" attitude of most 
vendors. We at NEECO, recognize this problem and can now, on all of the Software Packages listed, offer 
a full 30 day refund policy to NEECO's customers. Now you can purchase with confidence. Buy it - try it; 
if the program package is not suitable for any reason, send It back to us within 30 days and we will refund 
the full purchase price— less shipping charges! 



SOFTWARE 


APPLICATION 


REQUIRES 


AUTHOR 


AVAILABILITY 


PBICE 


Word Pro 1 


Word Processing 


BK * cassette 


Pro Micro 


Immediate 


S 29 95 


Word Pro II 




lOK • 2O40 




" 


99 95 


Word Pro 111 




32K • 2040 




'■ 


199 95 


Word Pro IV 




8032 • 2040/8050 




" 


29995 


BPI Integrated G/L 


Business 


32K/8032 ■ 2040 


BPI 


■* 


360.00 


BPI Inventory 




" 




■' 


T.B.A 


BPI Payroll 


" 


•• 


" 


" 


" 


BPI Enhanced A/H 


•* 


" 


" 


■* 


'" 


CMS G/L 


" 


" 


CMS Soltware 


" 


295 00 


CMS A/R 


" 


" 




•■ 


195.00 


CMS A/P 




" 




" 


195 00 


CMS Customer Mai! List 








" 


195 00 


CMS Payroll 










35000 


BMB Database 


Alf Business 


32K/6032 • 2050,8050 


SMB 


August/Sept 


295 00 



"WDrdprocessing Software requires output printer We recommend the NEC Spinwriter (S2995) for letter quality 

"PET IS a registered trademark of Commodore Business Mactimes Small Keyboard PETS require a ROM Retrofit Kit 

Multi-Cluster IS available m Canada Irom SMB Compu Scierkce, P O BOX 121. Wilton, Onlano, L9T2V3 

All prices and specilicaiions are suDjecl to ctiange without notice 



NEECO 

679 HIGHLAND AVE. 
NEEDHAM, MA 02194 



NEW ENGLAND ELECTRONICS CO., INC. 

"NEW ENGLAND'S Largest 

Computer Showroom" 



(617) 449-1760 

MASTERCHARGE OR VISA ACCEPTED 
TELEX NUMBER 9510ZT, NEECO 
MON-FRI, 9:00-5:30 



September /October. 19SO. Issue 6 



COMPUTE! 



-PACKARD PLOTTER for CDM SYSTEMS 




THE 7225 A 

GRAPHICS PLOTTER WITH 

PERSONALITY MODULE 

$os^f\i\ 00 



$75.00 
$85.00 



The Hewlett-Packard 7225A is a compact and efficient 
graphics plotter that provides a cost effective solution to 
the need for professional hard-copy graphics. With the 
7225A, publication quality graphics can be drawn with 
clean and visually continuous ink lines. 
The HP 7225A can be user-adapted to a wide range of 
systems. By changing a "plug-in" unit, called a Personality 
Module, ttie 7225A will provide the appropriate interface, 
language, and graphics capabilities for a variety of desktop 
computers, computer systems, personal computers, ter- 
minals and intelligent instrument systems. This interface 
flexibility makes the 7225A the ideal plotter for many 
present and future configurations. 



Interconnect Cables 

2 meters (6.6 ft} 
4 meters {13.1 ft) 



OPTIONS: 
Opt. 007 (15 pads of 8V> x 11 In. paper, 

assortment of pens, pen hotder 
Opt. 010 (vinyl carrying case) 
4-Color Pen Pack (Red, Blue, Green, Black) 
Plotter Paper (100 sheets 8V2 x 11 In. grid) 
Plotter/Printer ROM Handbook 



$ 75.00 
$125.00 
$ 6.00 
$ 7.00 
$ 10.00 



ORIGINAL 8K PET 2001* OWNERS TAKE 



The following peripherals and accessories are IN STOCK AT NEECO: 
1. AXIOM PRINTER 




• Complete PET graphics 

• Plug compatible 

• Electrostatic paper 

• 40 or 80 columns 



$349.00 



2. 16or24KEXPANDAMEM 




INTERNAL MEMORY 
EXPANSION UNIT 



Plug compatible 
Dynamic low heat memory 
Proven reliability 
No adaptor needed 



16K-«299.00 
24K-«379.00 



.^ 



3. FULL SIZE KEYBOARD 




• Complete PET graphics 

• Separate keypad 

• Plug compatible 

• With cover 



$99.95 



■aK-2001 with original keyboard and built-in cassette 



NEECO 



679 HIGHIJVND AVE. 
NEEDHAM, MA 02194 



NEW ENGLAND ELECTRONICS CO., INC. 

"NEW ENGLAND'S Largest 

Computer Siiowroom" 



(617) 449-1760 

MASTERCHARGE OR VISA ACCEPTED 

TELEX NUMBER 951021. NEECO 

MON-FRI. 9:00-5:30. E.S.T. 



lO 



COMPUTEl 



September/October, 1980. issue 6 



Computers 
And Society 

David D. Thornburg and BetfyJ. Burr 

Innovision 

P,0, Box 1317 

Los Altos, CA 94022 

This month we want to bring you up to date on two 
shows we attended. One of us (BB) attended the 
American Society for Training and Development na- 
tional convention in Anaheim, and the other (DT) 
attended the summer International Consumer Elec- 
tronics Show (CES) in Chicago. Both of these shows 
had many small computer systems on display. By 
looking at these products at trade shows and conven- 
tions, we get to see developments before they become 
available at the corner computer store. We were suf- 
ficiently excited by what we saw to want to share our 
perspectives with you. 

The following report presents Betty's view of the 
ASTD convention: 

Does anyone remember CAI? The darling child of 
the late 60's and early 70's, computer assisted in- 
struction has been struggling for its life for the past 
decade. Suffering from high costs as school budgets 
became increasingly tight, CAI never quite Justified 
its existence or fulfilled the promises of early 
dreamers. In the latter part of the 70's the big guns 
in CAI turned to the adult education market and 
aimed at big business and industrial training. (Train- 
ing is that skills-increasing activity engaged upon by 
people within a business or industry. Adult education 
may cover some of the same subjects, but it is con- 
ducted in a school or university.) Control Data Cor- 
poration took its successful Plato-for-schools and 
created Plato-for-induslry. Boeing's Computer Ser- 
vices division offered training in all computer related 
subjects. 

The applications still seemed limited. The CAI 
offered by these companies required either that the 
learner go to a centrally-located learning center to 
use a time-sharing terminal, or install such a ter- 
minal at company facilities. In my opinion, CAI, 
with all its promises, was just limping along. 

A few months ago, I found out that CAI is in- 
deed alive and well, and living in the personal com- 
puter industry. General applications in industrial 
training may be as close as tomorrow. 

At the end of April I attended the national con- 
vention of the American Society for Training and 
Development, held in Anaheim, California. Among 
the more than 700 vendors of training hardware and 
software were several who displayed very exciting 
uses of personal computers in training for business 



and industry. 

I am excited about what I saw because I wear at 
least two hats in this world. I am a computer en- 
thusiast who has spent over three years in a research 
center watching people playing with C.'M and playing 
with it myself. I am also a training director who is 
concerned with helping people learn and retain 
knowledge in the most efficient way. Until my April 
trip, I did not believe that the computer was efficient 
or cost effective. I may now be wrong. 

What follows in this column is a brief descrip- 
tion of what I saw and some caveats. I should point 
out that what I saw is not all that is available in the 
world for CAI for industry. Some vendors may not 
have attended this convention. I may have walked 
right by others. To all left out, my apologies. Write 
to me at Innovision and I'll be glad to take a look at 
your product and include it in a later column. 

Let's start with a look at some of the hardware, 
because there was more of that than software. (One 
of the major problems I see with the use of com- 
puters in business training is that canned programs 
are not widely available.) 

One of the exciting applications of the 
microprocessor was created by Videodetics 
(Anaheim, California). They have harnessed the 
technology by marrying it to videotape to create pro- 
grammable video tape. Providing automatic search- 
out and playback of specific sections of tape, the 
controller-indexor system creates an interactive learn- 
ing situation. The lesson creator programs in a series 
of questions, the answers to which lead the learner 
down various videotape paths. The learner is either 
praised or corrected (or both), as the lesson pro- 
gresses. The unit makes possible such activities as 
reciprocating multiple-choice tests, reinforcement of 
correct responses, and remediation of incorrect 
choices. 

With this product trainers can upgrade video- 
tape equipment (if compatible) to allow learner con- 
trol for a very low cost (between $550 and $700). 
The company is currently polishing a random access 
version of the controller, which should lend even 
greater flexibility to the system. The developers point 
out that the unit has also been used very successfully 
in point-of-purchasc sales presentations, so it may 
serve a dual function in some businesses. In addi- 
tion, the videotape visual display has the advantage 
of interest and color over the standard monochrome 
CRT normally associated with the CAI environment. 

Recognizing the value of the videotape medium 
when compared to CRT only, Comco Creative In- 
dustries has interfaced an Apple (obtained from Bell 
and Howell) with a 3/4 inch video cassette to present 
an answer to the problem of boredom without loss of 
the advantages of conventional CAI. The box which 
accomplishes the jumping and linking of tape and 
computer units will cost, I am told, something 
around $1000. 



Judge this cliaracter generator for yourself • 




Regular PET Graphics 



HAL GRAPHICS 



rN6^ 






^^ 



rfli 



^< 



!G> 






>■ 



p.*^ 



^^'^^ 



"^i-^ 



^^^ 



^" 



"^^--^ 



Compare the two Snoopys and 
you'll begin to see why the new 
HAL PCG 6500 is attracting so 
much attention. It's the program- 
mable character generator for your 
PET that gives sharp, detailed 
graphics. 

Important features include: 

• Storage for 64 new characters 

• BuUt in CB2 sound amplifier that produces all 
tones in the human hearing range 

• PCG Manual and demo program 

• Interface to PET/CBM with 24 pin character gen- 
erator ROMS, ( If your PET uses 28 pin ROMS, 
Conversion Kits are available for £45. lb simplify 
ordering, please indicate memory BAM *S114 
or '6550.) 

The HAL PCG 6500 is available exclusively at 
Systems Formulate ,,. 



Only $200 



P'iIeSS shippings' handling} 

Add S45 for £8 pin Conversion Kit 



■^/Jl 



MIPIiOT: tlie riglit plotter at the right price 

Designed for straight forward interface to any 
microcomputer that outputs the ASCII code, 
MIPLOT can even be used by operators with no 
plotter experience. 

• Incorporates preprogrammed "InteUigent" functions 
required for prodiicixig graphs and dravjln^s 

• Solid and bi-oken line types can be speolTled 

• Huilt in character generator for letters, numbers and 
symbols 

• Characters can be enlarged and rotated to four 
orientations 

• Special printer mode outputs character data as is 

• Uses commonly available hard fiber-tip pens 

• Maximujn plot speed approximately 2 inches per 
second 

• Built in self-test mode 




MIPLOT by Watanabe Corporation 



Only $1,200 

at SystemsFormulate Ctfrporation 

( plus shipping & handling ) 



vS- 






ADGOM Light Pen (with soimd) . . . Only ^3498 



Unlike many light pens, the ADCOM interfaces 
with PET thi'ough the second cassette port rather 
than the parallel port The result? Sound! 



(plus SS shipping £P handling ) 

• Flea4y to plug in, no assembly neoessait^f. 

• Faster than many other light, pens designed for PET. 

• Built-in sensitivity control- 

• Machine language and demo program included for ease 
of programming. 



Expand with the finest in micro peripherals, systems and software from Systems Formulate, 

Call today for more information or to place your phone order: (415) 326-9100 

We honor Master Charge, Visa, check or money order. 

( California residents add 6.5% tax) 



SYSTEMS FORMULATE CORPORATION 

39 Town fifCountiy Village •Palo Alto, Callfomla 94301 a. 



12 



COMPUTEI 



September/October. 1960. Issued 



The Bell and Howell system (designed around 
their version of the Apple II) comes with their own 
variety of PILOT (Mark-PILOT) as the CAI 
language. It contains both authority and presentation 
systems. Authors may use color graphics and anima- 
tion with this system. Representatives at the conven- 
tion were talking about a price of between $5,000 
and $7,000 for the whole package. 

The advantege of this system over the interactive 
video tape lies precisely in the greater variety of 
teaching techniques possible with the computer pro- 
grams. While the system does require the instructor 
to spend some development time on-line with the 
lesson, it may be no more than that required for 
development of in-house training materials. But all 
such efforts are very time consuming. I remember a 
figure of 40 hours development time for each one 
hour of student program given to me several years 
ago by the Plato people at the University of Illinois. 

Is this effort cost effective? Paper programs also 
take many hours, but the equipment is cheaper. I 
believe, however, that the potential impact upon the 
learner may be great enough to warrant the addi- 
tional costs. Also, with this new generation of CAI 
equipment, costs are plummeting and the machines 
are becoming mu!ti-purpo.se. After all, if you're go- 
ing to have a personal computer in your home or of- 
fice, you might as well use it to learn something. 

While the personal computer based CAI units 



such as the Cameo .system arc the logical competitors 
to the Plato and Boeing time-shared learning 
systems, other, more powerful, stand-alone systems 
are also being offered. One interesting-looking unit 
was shown by Regency Carroll of Champaign, Il- 
linois (the home of Plato). It's language, USE, allows 
judging, help sequence branching, selective erase, 
and animation. They do not, I believe, have a video 
tape interface. My recollection of their .system is that 
it is considerably more expensive than the Cameo 
system, albeit more powerful. While the developers 
may claim an apples and oranges comparison, I 
believe that training people will go for the lower end 
machines because of the lower initial costs, especially 
if they are able to interface these systems with ex- 
isting video tape equipment. 

With all of the systems I saw, however, I felt the 
same frustration, .^fter spending two years as a one- 
person training department, I know the enormous 
value of canned programs. I would much rather buy 
something than spend the time developing it in- 
house. So I look for quality programs. My .search 
through the convention exhibit hall for quality pro- 
grams for the computer systems led to very little. I 
found only one company. Educational Programming 
System, of St. Louis, who offered CompuCilourse pro- 
grams. These combine text and automated activities 
such as using the computer to set up an actual 
budget in a budgeting course. Their diskettes will be 



Intelligent, fast 
11x17 Graphic 
Plotting ^^ 

for the 

Commodore 

PET7CBM® 

Com- plications™ C102 X-Y Plotter Adapter 




Increases plotting speed by a 
factor of 2 to 5 
Provides printed program or 
data listings 

Uses print statements - no 
assembly programming 
Compatible with all IEEE-488 
(1978) controllers 
Industrial-quality constiuctfon, 
72-hour bum-in 
Complete graphic software 
package availaUle 



Low cost, intelligent, hl^h speed graphic, hardcopy for the Commodore 
PET®/CBM®is now a reality, The combination of the Corn-plications™ CI 02 
Interface Adapter and the Watanabe "MIPLOr" intelligent plotter gives the 
Commodore computer sophisticated plotting capabilities. Programming is 

accomplished with BASIC .i . . 

language PRINT statements. I 



not assembly language. Axis 
generation! character rota- 
tion, vector generation and 
other functions are proce- 
dures built into the plotter. 
Call for a deaier package . 



^ 



PET« and CBM* fire fegistered tractemaflts 

of Commodore Business M^Jihlnes. Inc. 

F.I. ELECTRONICS 

968 Piner Road 
Santa Rosa, Ca 95401 
Telephone: 707-527-0410 
Telex: 33-7769 



September /October, 1980- Issue 6 



COMPUTE! 



T3 



available for the Apple II or II + and for the 
TRS-80, and will be sold in retail stores in October. 
Their first available program will be in Personal 
Financial Planning, costing $95. Other titles they 
plan include: Managing Corporate Cash; Long 
Range Planning; Advertising: Strategy and Design; 
Writing for Successful Management; and How to 
Build Memory Skills. 

These subjects are included in the curriculum 
for many companies. It will be interesting to see 
whether other software suppliers jump on the band- 
wagon to prepare materials for industrial-placed per- 
sonal computers. Right now it seems to be a wide 
open field. Only the manufacturers of the computers 
themselves and a few software companies have pro- 
vided any learning programs. Atari and SRA have 
agreed to develop software for schools, pre-school 
throiigh university. But specific "training" programs 
are yet to come. I believe that if the personal com- 
puter is to make an impact on the world of business 
and industrial training, software developments must 
keep up with hardware developments. I'm hoping 
that they will. CAI will really have come of age then. 

While educational and industrial applications for 
personal computers are growing at a rapid pace, we 
have yet to see the true "home computer" market 
open up. Most people who have computers in their 
homes use them for business applications, or as a 
hobby. The Consumer Electronics show is an in- 



teresting showcase of technology for the home. The 
presence of personal computers at this show indicates 
a feeling that someday soon the true consumer 
market for computers will become a reality. It is 
worthwhile for computer vendors to plan for this 
market, since, once the market develops, personal 
computer sales might rival those of color televisions. 
With the view of someone looking at incipient com- 
puter sales of several million units a year, let's look 
at Dave's perspectives on the CES: 

The June CES is the second of two international 
consumer electronics shows presented in the United 
States every year. While exhibited products included 
almost any entertainment item which uses silicon, it 
is interesting to see how this show is becoming a 
showcase for Personal Computers. Since the birth of 
the "appliance grade" personal computer in 1977, 
attendees of these consumer electronics extravaganzas 
have had to include computers in the list of products 
which are capturing the hearts and minds, if not the 
pocketbooks, of a growing fraction of consumers all 
over the world. 

While the time has not yet arrived for the com- 
puter to be considered a common household ap- 
pliance, the incipient emergence of several well sup- 
ported information utilities suggests that it will not be 
long before computer sales exceed 1 ,000,000 units 
per year, and the long-awaited emergence of "home" 
computing becomes a generally accepted phenomenon. 



Letter 

Quality 

Word 

Processing 

for tlie 

PET7CBM« 

Corn-plications" C101 Printer Adapter 




m^ Designed specifically for NEC 

^ 5530P Spinwriter 

H^ Fuily compatible with all 

™ "Word- Pro" software 

1^^ Drives any Centronics- 

" compatible (parallel) printer 



^^ penpherais 

B^ Uses print statements— 

^ no assembly programs 

ra^ Industn'al quali^^ construction, 

™ 72-hour bum-in 



Word-processing is the fastest growing segment of the micro-computer 
market. Small businesses, sales organizations, la\*yers. physicians, 
publishers and a myriad of other potential users are prospects for 
Commodore PET®/CBM® computers and NEC "Spinwrlters" with the new 
Corn-plications™ CIO! printer 

aHantpr The ClQl is manu- I I pet® and CBM» are registered trademaiks 

aaapter. ine «_IUI is manu | ^^^^ of commodore Business M<.chir.es. inc. 

F.I.ELECTROHICS 

968 Finer Road 



electronics company to 
industrial quality standards. 
Can your customers afford 
anything less? Call or send 
for a dealer package today. 



Santa Rosa, Ca 95401 
Telephone: 707-527-0410 
Telex: 33-7769 



w 



COMPUTEI 



September/October, 1980. Issue 6 



As in past shows, Texas Instruments continued 
to stress the versatility of their 99/4 computer in ap- 
plications including speech output and connections to 
the Source and MicroNet information utilities. 
However, TI apparently has not received the market 
acceptance they had hoped for, and it will be in- 
teresting to sec how effective they are at surviving in 
an industry which has seen several fine products 
withdrawn from the market. According to several 
cottage industry people interviewed at the show, a 
major frustration with the TI computer arises from 
the lack of a way to generate and call machine 
language subroutines from BASIC. From a human 
factors point of view, I found it distressing to see 
lower-case characters properly displayed on the 
screen (from a Source data base) while there is no 
provision for the entry of lower-case letters from the 
computer keyboard. 

The APF Imagination Machine remained un- 
changed in the past year, with their emphasis being 
placed on peri[)lierals on marketing schemes. 
While many of the characteristics of this 6800-based 
computer arc quite nice (single keystroke BASIC 
keywords, excellent keyboard feel, etc.), the ex- 
cessively large size of the computer combined with an 
indistinct display makes this computer less appealing 
than it might otherwise be. 

Ohio Scientific presently provides one of the 
widest product lines available, ranging from a small 
personal computer to a conventionally packaged 
minicomputer. The 6502-based C-IP and C-IP/MF 
computers have been given a new plastic housing in 
apparent preparation for tiieir presence in Mon- 
tgomery Wards' stores all over the country. At a lit- 
de over $1000, the C-IP/MF is probably the lowest 
price computer with a floppy disk. 

At the other extreme in cost, the HP-85 desk-top 
computer with built-in 5" CRT was well displayed 
by Hewlett-Packard in a booth which, to my eyes, 
was sparsely attended. It may be that the CES is the 
wrong place to show a 13250 computer whose 
features seem not too far removed from those of com- 
puters selling for thousands of dollars less. 

The Compucolor disk-based computer system 
from Intelligent Systems Corp. has perhaps suffered 
from styling problems - especially when compared to 
the more expensive Intecolor computers also 
manufactured by ISC. However, through the 
miracles of modern packaging, the Compucolor com- 
puter has been given a face lift and no%v looks amaz- 
ingly like its larger brother. 

As in the past shows, the Atari 400 and 800 
computers continue to draw large crowds. The use of 
dedicated display and sound processors serves to ex- 
tend the power of the 6502B microprocessor to give 
these computers the finest color and sound capability 
shown at the CES. While much of the Atari display 
was devoted to their ability to connect to home infor- 
mation utilities and to play very sophisticated 



animated games, they did introduce a light-pen at- 
tachment and also demonstrated some educational 
software developed for Atari by SRA, a division of 
IBM. 

Among the several new computers introduced at 
the June CES, one of the most interesting entries 
was the Sinclair ZX-80. This Z-80-based computer 
(which weighs only slightly more than its instruction 
manual (320 g vs. 250 g)) contains a full typewriter- 
like ki-yboard (membrane type), 1 KB ol' RAM and a 
4 KB BASIC. Keywords are entered with single 
keystrokes, and the syntax of each line entry is con- 
tinuously monitored. It is almost impossible to get 
the computer to accept a syntactically invalid line of 
code. The ZX-80 connects to the UHF input on a 
black and white TV and displays 24 lines of 32 
characters. As an indicator ol' the attention paid to 
low-cost design, conversion of the ZX-80 from the 
European PAL to the U.S. NTSC TU standard is 
accoiTipltshed by the addition of a single diode. Since 
power (9 V DC) is jirovidcd from an outboard plug- 
mounted power supply, the ZX-80 can l)c used 
almost anywhere. Rather than sell this product 
through stores, the initial Sinclair marketing plan is 
to sell the ZX-80 from England, fully assembled, for 
S199. Presently, the ZX-80 (Mily supports an integer 
BASIC, but an 8 KB floating point BASIC is in 
development. Since external RAM can be added to 
bring the computer to 16 KB, the ZX-80 may create 
a totally new market. Since new markets appear to 
be Mr. Sinclair's forte, this product bears watching. 

An even smaller computer was introduced by 
Panasonic: the HHC hand held computer. The cen- 
tral unit (which will retail for about $400) is about 
the size of the Craig translator. This unit contains a 
6502 microprocessor, 1 KB of RAM and slots for up 
to four ROM cartridges. In addition to pre- 
programmed functions (information terminal, 
language translator, etc.), ROM packs will be 
available for languages such as FORTH and EASIC. 
The main unit contains a full complement of keys 
(although with the wrong spacing for ca.sy typing) 
and has a liquid crystal one line display (24 
characters, upper and lower case dot matrix). The 
addition of myriad peripherals. Among the 
peripherals demonstrated at the show, I saw the TV 
adaptor which buffers and displays a screen full of 
information in color. A small printer, a 
modem/acoustic coupler, and RAM expansion units 
were also shown. RAM units contain their own bat- 
tery backup thus allowing users to create their own 
"firmware" for this sytem. While the main unit is 
nicely packaged, the expanded system has an "Erec- 
tor Set" quality to it that detracts from its overall ap- 
pearance. Nonetheless, the emergence of this product 
along with the Sinclair ZX-80 shows that there is still 
room lor experimentation in the personal computer 
market. 

Commodore's exhibit stressed their watches and 



September/October, 1980. Issue 6 



COMPUTE! 



15 



calculators, with one 80-t;olumn CBM computer on 
display. Hidden behind a smoked plastic screen, 
however, was the Commodore VIC - an as-yet ex- 
perimental computer designed to connect to a color 
TV. If VIC becomes a product soon (and I hope that 
it will), this compact 6502-based machine is certain 
to capture the hearts of thousands of users. Sized on- 
ly slightly larger than the Sinclair computer {and us- 
ing the "old" PET keyboard), VIC is designed to 
sell, with 4 KB of RAM, in the $400 range. If it uses 
nearly the same BASIC used in the rest of the CBM 
world, strong cottage industry support is virtually 
guaranteed in advance. Through products of this 
type, Commodore is retaining their commitment to 
the low-end market while broadening their product 
line to compete with machines such as the IBM 5120. 

In June of 1979, Casio showed their versatility 
as a company by introducing the Casiotone profes- 
sional music synthesizer. This departure from their 
traditional watches and calculators vvas followed this 
year by the introduction of the FX-9000P, an 
8080A-ba.sed computer whose packaging closely 
resembles that of the HP-85. A crisp built-in high 
resolution 5" CRT display (32 characters by 16 
lines, 256 by 128 pixels) is capable of mixed text and 
graphics applications. When this computer comes to 
market early next year, it is expected to retail for 
$900 with a ROM BASIC. The built-in 8 KB RAM 
can be supplemented with plug-in modules. The user 
can choose between 16 KB dynamic RAM cartridges 
or 4 KB RAM cartridges with battery back-up. As 
with the Panasonic entry, programs can be written 
into removable RAM cartridges and treated like 
ROM-based firmware. A tape cassette interface is 
available along with a real-time clock with calendar 
and alarm. Several parallel and serial interfaces are 
available to allow connection to printers, disk drives 
and modems. In other words, the FX-9000P is a 
serious small computer priced to sell by the 
thousands. The physical resemblance of this com- 
puter to the HP-85 is striking. At a $2600 price ad- 
vantage over the HP entry, the Casio FX-9000P was 
the recipient of much well deserved attention. 

While the Mattel Intellivision has been show^n 
with a full keyboard attachment for more than a 
year, there has been much speculation regarding the 
reasons this portion of the product has not been in- 
troduced commercially. Early plans were to not make 
the Intellivision user programmable. As of the June 
CES, a new philosophy is apparent. The Intellivision 
keyboard unit (designed to retail for $500) will con- 
tain a 6502 microprocessor with 16 KB of RAM and 
running what appears to be a full extended Microsoft 
BASIC. Since the display portion of this product 
(housed in the video game unit) contains a 16-bit GI 
computer and the "Teleview" information utility 
chip set, this new product may leverage its way into 
a broad share of the market. 

Several companies who have personal computers 



ACCOUNTING 

SOFTWARE 

FOR YOUR 

APPLE 

GENERAL LEDGER 
If you are a business person who is looking for ultimate 
performance, take a look at this outstanding General Ledger 
package from Small Business Computer Systems. 

Our package features six digit account numbers, plus thirty- 
one character account names. We have ten levels of subtotals, 
giving you a more detailed income statement and balance 
sheet with up to nine departments. Either cash or accrual 
accounting methods may be used. The cash journal allows a 
thirty-three character transaction description and automatical- 
ly calculates the proper offsetting entrj-. You may print the 
balance sheet and income statement for the current month, 
quarter, or any of the previous three quarters. Also, this 
year's or last year's total are included on the income 
statement, depending on the current month. 

There is virtually no limit on entries, since you may process 
them as often as you Like. Two thousand (1,000 from G/L. 
1,000 from any e.xternal source) can be processed in one session. 

ACCOUNTS RECEIVABLE 
Sound business management requires you to keep up-to-date 

reports regarding the status of your accounts receivable. 

Now, from the same company that revolutionized accounting 
on the .'\pple II computer, with their conversion of the 
Osborne/McGraw-Hill Geleran Ledger program, you may now 
obtain the Accounts Receivable package you have been 
waiting for. 

Our package allows you to assign your own alphanumeric 
customer code up to sbc characters. Dale of the last activity, 
as well as amounts billed this year and last year are 
maintained. This Accounts Receivable system maintains six 
digit invoice numbers, si.x digit job numbers, invoice amount, 
shipping charges, sales tax (automatically calculated), total 
payments as well as progress billing information. You may 
enter an invoice at any time; before it's ready for billing, after 
you have biUed it, and even after it's paid. This package also 
prints reports which list the invoices you have not billed yet, 
open items paid items, and an aging analysis of open items. 

In the final analysis making your bookkeeping easier is 
what our software is all about. With our General Ledger 
package you can format your own balance sheet and income 
statement. Department financial statements may be formated 
diferently. You have complete freedom to place titles and 
headings where you want them, skip lines or pages between 
accounts and generate subtotals and totals throughout the 
reports — up to ten levels if you need them, Accounts 
Receivable is designed to provide you with complete up-to-date 
information. The program will print customer statements as 
well as post invoice amounts to any of the accounts 
maintained by our General Ledger package. These packages 
will supporl any printer/interface combination. General Ledger 
requires one hundred ten columns, Accounts Receivable 
requires one hundred thirty columns. 
Suggested Retail: 

Individuallv SI80.00 

Together S330.00 

Available from your local Apple Dealer or contact SBCS 

SMALL BUSINESS COMPUTER SYSTEMS 

4140 Greenwood 

Lincoln, Nebraska 68504 

(402) 467-1878 



16 



COMPUTE! 



September/October. 1980. Issue 6 



on the marketplace chose to not display their wares 
at the CES. Vor example, since Radio Shack com- 
puters arc not available for sale through non-Radi 
Shack stores, they do not display their wares at the 
CES. 

Apple Compute)-, however, has used the CES as 
a showcase for their products. 'I'his June, Apf.! 
relied on full page advertisements in the trade 
dailies, and did not ha\-e an exhibit on the floor. One 
could conjecture that the recent introduction oi the 
S4,000 + Apple III at the National Computer Con- 
ference (NCC) was considered lo be adequate ex- 
posure, especially since this new product is probably 
not geared towards the type of markets addressed by 
the majority of the buyers who attended the CES. 
Judging from their advertising, however, it is clear 
that Apple is planning to maintain their strong posi- 
tion in the $1,000 personal computer marketplace. 

The E.xidy Sorcerer was not on display either, 
although this was probably due in part to the for- 
thcoming acquisition of this product line by another 
company. 

Another computer which was not displayed was 
the Sharp PC-1211 hand held computer. This $200 
CMOS com]>utcr has a com[)lete keyboard and 24 
character liquid crystal display. While the ]n-oduct is 
available in Ja[)an and Europe, it is rumored that 
Sharp has elected to not introduce this product in the 
U.S., but to wait until a later version is ready, 
perhaps by next year. Since the Sharp PC-1211 sup- 



ports a serial I/O port, an attachment is available for 
storing data and programs on a con\'eniional tape 
cassette. Unlike Panasonic, howe\er, Sharp is ap- 
paretilly not ready to introduce the conummications 
and ])rinter options which are probably very impor- 
laiU selling points foi" these machines. 1 have received 
one of these cotiiputers from Japan and ha\'e found it 
to be very nice to opei'ate, both from a liardwarc and 
software point of view. The resident BASIC is well 
designed for scientific calculations, although string 
o])ei-ations are c]uile limited, It will be interesting to 
see il another vendoi' ]iicks this [)rodiul uj) as a 
pri\-aie label item, thus gaining inctnoe for Sharp 
without forcing their hand too early. 

What message, if any, can one glean from all 
this infoi'tiiation? For one thing we know that com- 
puter manufacturers ha\'e a long way to go before 
their products will appeal to the average consumer. 
The trends towards simpler and easier to use com- 
puters are evident. Cknnnumications (in the form oi 
connections to information utilities such as the 
Sotu'ce and MicroNet) are perceived as ijcing of 
paramount importance to consumers, and the 
development of high quality software is becoming 
more evident. It may lake a year or so, but before 
the end of this decade, the |>ersonal comj:>uter revc)lu- 
tion will ccjine home. You, as a personal computer 
enthusiast, have a head start on what promises lo be 
a most exciting future, ^ 



Computer House Div. 

Announces 

Programing Tools 

For the Commodore/Disk 

"SCREEN DUMP/REPEAT" - $35.00 

In Machine Language, Dumps anything on CRT 
to Printer. Repeat Simulates Repeat on 8032 for 
8K, 16K & 32K #200T 

"VARI-PRINT" - $25.00 
Prints a Listing of all variables and every line 
number where each occurs, 

"DOCU-PRINT" - $20.00 
Similar to Screen Dump except in Basic for use 
within your own program, 

"FET/RECOVER" - $65.00 
File Editing Tool; Examine Data Files, Fix 
Destroyecj Pointers, Sectors may be reacJ, 
Modified, Displayed or Written — Also Files may 
be Re-chained. 

"SUPER RAM" - $20.00 
Diagnostic Routine Checks Every Possible RAM 
Address on 8K, 16K & 32K CBM Computers. 
Available on Diskette right now 

"SCRUNCH" - $36.00 

For Apple II or Apple II Plus. Compacts Basic 
Programs up to 20%. 



Programs for Commodore / Apple 

"Legal Accounting" $1200.00 

"A/R, A/P, JobEst. & Job Cost 310.00 

"Political Party Mailing List" 150.00 

ENGINEERING & MACHINE SHOP 

"Machine Part Quoting" $280.00 

"Trig a- Circle Tangent" 70.00 

"Bolt Circle" 25.00 

"Spur Gears" 35.00 

"Beams; Stress & Deflection" 145.00 

"Tank Thickness" 

For Filament Winding 85.00 

All 6 for only $495.00 



And many others coming soon — including 
Report Gen. for Commodore — Ask for Catalog 
mo- €2. 

COMPUTER HOUSE DIV. 

1407 Clinton Road 

Jackson, Michigan 49202 

Phone: (517) 782-2132 



September /October, 1980- Issue 6 



COMPUTEI 



Twice the capacity of anything available. 

NEW! 2 MEGABYTE DISK DRIVE 
FOR COMMODORE CBM/PET. 



I 




Now you can quickly, easi ly a nd eco nomically 
expand the capacity, capability and versa- 
tility ot your Commodore CBM/Pet computer 

Just wlthi the addition of our all new, 
exceptionally fast (5,000 bytes per second — 
including verify) dual head, quad density 
disk drive. 

Its 2 megabyte unformatted capacity is over 
twice the size of any Commodore compatible 
drive from any manufacturer. 

This on-line drive includes DOS operating 
system plus 17 additional BASIC commands 
and random or indexed sequential access. 

It's completely plug compatible with the 
dynamic RAM Pet. Backed by comprehensive 
90 day lactory warranty. 500k and 1.0 
megabyte on-line drives are also available. 

Make your Pet twice as good. Return the 
order blank today! 



Immediate Delivery, 
Order Today! 



COMPUTHINK 



965 v; Maude Sunnyvale. CA 94086 (408) 245-4033 

Please send me the following 

Pel Drive □ 2.C Mb ® S2495 D i Mb 'S S1695 D 500k & S1295 

□ TRS-80 500k Disk Drive @ S1295 

D Name ol nearest Computhink dealer 

Total enclosed: S 



Check or Money Order only Calil Res add 6% lax 
Freight pre-paid m continental US 

Dealer Inquines Invited 

Name 

Address 

City 



. State. 



Zip_ 



COMPUTEI 



September /October, 1980. Issue 6 



Teaching Basic Academic SIciils 

Can Micros Make A Difference? 



Tory Esbensen, Coordinator of Elementary Curriculum ond Instruction 
Doug Hed, Supervisor of Media Services, Edina Public Schools, Edino, 



In, 55435 



As microcomputers become more visible in scliooi sel- 
lings, lliey may be increasingly asked lo pfeseni 
liieir teaching credentials. This report is a preliminary 
attempt to respond to that likely development. 

In the fall of 1979, the Iowa Tests of Basic 
Skills were given to ail of ihe ;ird and 5th graders in 
the Edina Public Schools. Students who scored poorly 
on these tests in capitalization, punctuation, and 
usage, were singled out to take advantage of micro- 
computer [programs written for the PET in these 
academic areas by MICRO-ED, INC. (Box 24156, 
Minneapolis, Minnesota, 55424). 

Ahhough every elementary school in the Edina 
system uses microcomputers, and although micro- 
computer programs are readily available to any class- 
room teacher wishing to employ them, for the purpose 
of this i)roject special instructional arrangements were 
made with student support centers that had been 
established in four of our elementary schools. Brielly, 
in those schools where support centers existed, 3rd and 
5th grade students who scored in the bottom C[uaiiile 
of the Iowa Tests in capitalization, punctuation, and 
usage, were targeted to receive additional insti'uclion 
from microcomputers. This selection procedure was 
based on local norms which arc higher than national 
norms. 

It is im]5ortant to emphasize that no atlem[)t was 
made to handle this as a pure research project. 
No students were used as a control group. In the 
four schools in which the project was formally 
carried out, we tried to provide microcomjjuter 
instruction to every student who seemed to need 
it. In (hose schools which had no support centers, 
microcomputers were also used b\' indi\'idual teachers 
to provide additional instruction to students. No 
attempt was made to restrict this in any way. 

Above all, great care was taken to avoid giving 
any impression that microcomputers are somehow 
preferable to other modes of instruction. In our 
opinion, it is important to have micros viewed as 
the instructional allies of teachers, not as competitors. 

Therefore, what this report will ]>rovide is infor- 
niaiion concerning what happened to a group of 
students when microcomputers were used to play a 
major role in furnishing certain kinds of remedial 
instruction. No comparison with other instructional 
practices or results is intended or implied. 

We shall begin by considering a group ol 59 
fifth grade students who scored the lowest in the 
Iowa Tests in the area of English usage. In the fall 
of 1979, based on national norms, the median score 



for this group placed it at the -'57th pei'centile lor a 
grade equivalent score of 4.4. 

When this group was re-tested in the spring of 
1980, its median score for English usage placed it 
at the 58th percentile for a grade equivalent score 
(jf 6.4. Academically, this group of students gained a 
total of 20 months over a period of 7 months. 

Next we shall look at a gi'oup oi' 67 lifih gi-ade 
students who scored the lowest in the Iowa Tests 
in the area of punctuation. In the fall of 1979, based 
on national norms, the median score for this group 
placed it at the 36th percetuile for a giade ecjui\aleni 
score of 4.5. 

When this group was re-tested in the spring of 
1980, its median score for punctuation |:)laced it at the 
62nd percentile for a gi-ade equivalent score of 6.5. 
Acadeniically, this grou]3 of students also gained a 
total of 20 months over a period of 7 months. 

Then we shall consider a group of 73 fifth 
grade students who scored the lowest in the Iowa 
Tests in the area of capitalization. In [lu- fall of 1979, 
based on national norms, the median score for tliis 
group placed it at the 35th jx'rcentile for a grade 
equi%-alent score of 4.5. 

When this group was re-tested in the spring of 
1980, its median score for capitalization placed it at the 
70th percentile ior a grade equivalent score of 7,0. 
Academically, this gixnip of siLidenis gained a total 
of 25 months o\'er a period of 7 months. 

Now we shall consider a group of 4.'i third grade 
students who scored (he lowest in the Iowa Tests 
in the area of capitalization. In ihe fall of 1979, 
based on national norms, (he median scoi'e lor this 
group placed it at (he 25th percentile for a grade 
equivalent score of 2.4. 

When this group was re-U:sted in the spring of 
1980, its median score for capitalization [jlaced ii a( 
the 59th percentile for a grade equi\'alen[ score of 4.2. 
Academically, this group of students gained a total 
of 18 months over a period of 7 montlis. 

Ne.xt we shall look at a group of 35 third 
grade students who scored the lowest in (he Iowa Test 
in the area of English usage. In the fall of 1979, 
based on national norms, the median score for this 
group placed it at the 33rd percentile for a grade 
equivalent score of 2.4. 

When this group was re-tested in the spring of 
1980, its median score for English usage placed it 
at the 72nd percentile for a grade equivalent score of 
5.1 . Academically, this group of students gained a total 
of 27 months o\'er a period of 7 months. 



September /October, 1980, Issue 6 



COMPUTE! 



P 




Skylcs Electric Works 




QYour students are gathering around the several PET computers in your 
^ classroom. And they all are hungry for hands-on turns at the keyboards. 
Some students are just beginning to understand computers; others are 
so advanced they can help you clean up the programs at the end of the period. 
How do you set up a job queue, how do you keep the beginners from crashing a 
program, how do you let the advanced students have full access? And how do you 
preserve your sanity while all this is going on? 

A. With the Regent. 
Q. What is the Regent? 

It The ultimate in classroom multiple PET systems. A 

surprisingly inexpensive, simple, effective way to have 
students at all levels of computer capability v^ork and learn 
on a system with up to 15 PETs while the instructor has 
complete control and receives individual progress reports. 

Up to 15 PETs, one dual disk drive and as many as five 
printers can interface with the Regent, and do all those good things we promised, it's designed to operate with 
8K, 16K, 3ZK PET/CBM models and with the Commodore disk drives and new DOS, 

Five levels of user privilege, from the Systems Level, 
through Levels One and Two, Student: Levels One and 
Two, Operator, From only the use of system commands 
to complete control for the exclusive use of the 
instructor 

There's complete system protection against the novice 
user crashing the program; the instructor has total 
control over, and receives reports concerning, usage of 
all PETs, 

A complete set of explanations for all user commands 
is stored on the disk for instant access by all users. 
And a printout of the record of all usage of Regent is 
available at the instructors command. 

The Regent includes a systems disk with 100,000-plus 
bytes for program storage, a ROM program module, 
together with a Proctor and a SUB-it . . . and complete 
instructor and student user manuals. 

Q. SUB-it? Proctor? What are they? 

Jl The SUB-it is a single ROM chip (on an interface 
* board in the case of the original 2001-8 models) 
that allows up to 15 PETs to be connected to a 
common disk via the standard PET-IEEE cables. The 
Commodore 2040. 2050 or 8050 dual disks and a 
printer may be used. 

(The SUB-it has no system software or hardware to 
supervise access to the IEEE bus. The system is thus 
unprotected from user-created problems. Any user- 
even a rank novice — has full access to all commands 



and to the disk and bus. This situation can. of course 
be corrected partially by the Proctor, completely by the 
Regent.) 

The SUB-it prevents inadvertant disruption when one 
unit in a system is loading and another is being used. 

The Proctor takes charge of the bus and resolves 
multiple user conflicts. Each student can load down 
from the same disk but cannot inadvertently load to or 
wipe out the disk. Good for computer aided instruction 
and for library applications, offering hundreds of 
programs to beginning computer users. 

A combination of hardware and software protects the 
disk from unexpected erasures and settles IEEE bus 
usage conflicts. Only the instructor or a delegate can 
send programs to the disk. Yet all the PETs in the 
system have access to all disk programs. Available for 
all PET/CBM models. SUB-it and PET intercontrol 
module and DLW (down-loading software) are included. 

Q. How expensive are these classroom 
miracles? 

ft We think the word is inexpensive. The Regent 
**• system is SZ50 for the first PET; SI 50 for each 
additional PET in the system. The SUB-it is S40. (Add 
an interface board at S22.50 if the PET is an original 
2001-8.) And the Proctor is $95. 

There are cables available, too: 1 meter at $40 each: 
2 meten $60 each; 4 meter. $90 each. 




Phone or write for information. We'll be delighted to answer any questions 
and to send you the complete information package. 



Skylcs Electric Works 



231 E South Whisman Road 
Mountain View, CA 94041 
(415) 965-1735 



20 



COMPUTE! 



September/October. 1980. Issue 6 



Finally, we shall report on a group of 39 third 
grade students who scored the lowest in the Iowa 
Tests in the area of punctuation. In the fall of 
1979, based on national norms, the median score 
for this group placed it at the 20th percentile for 
a grade equivalent score ol 2.2. 

When this group was re-tested in the spring 
of 1980, its median score for punctuation placed 
it at the 80th percentile for a grade equivalent 
score of 5.3. Academically, this group of students 
gained a total of 31 months over a period of 7 
months. 

Inasmuch as our elementary student support 
centers played such a central role in the shaping 
of this microcomputer instructional project, i( would 
seem appropriate to explain something about the 
operation of these centers. 

During the 1979-80 school year, our Concord, 
Cornelia, Creek Valley, and Wooddale elementary 
schools housed student support centers. By the fall 
of 1980, all of t)ur elementary schools will have 
them. Here is how these centers function: 

Each one is super\ised by a paraprolessional, and 
instruction there is not necessarily remedial in 
nature. Students are scheduled into the center accord- 
ing to specific instructional needs as delermined by 
their classroom teachers. A student may begin work- 
in the center at any time during the year, and con- 
tinue unlil a designated sequence of lessons has been 
completed. 

Different kinds ol instructional material.s iind 
equipment {kits, tape recorders, etc.) are available 
in the center. Nevertheless, the microcomputer has 
been the major engine of instruction. It is not hard 
to understand why. 

Unlike many otiier machines, the microcomputer 
is not a special function device. The typical piece 
of hardware is dedicated to perform a specific 
function. Thus, a motion picture projector shows films, 
a record player plays records, and so on. Not so 
with the com()uter, Sometimes called a "smart"' 
machine, this so]jhisticated device needs only to be 
told what to do in order to carry out a broad range 
of tasks. It can help manage a business enterprise, 
assist doctors in diagnosing illnesses, and play a 
strong game of chess. As our present study shows, 
it can help students learn effeciivelv. 

What sets the microcomputer apart from its more 
ponderous ancestors? The expression compuler-on-a- 
chip tells the story. The ability of modern teclmology 
to miniaturize its creations means that something small 
can nevertheless be incredibly powerful. A microcom- 
puter such as the PET weighs only about forty pounds, 
uses no more energy than a 150-watt light bulb, 
and can be plugged into an ordinary electrical 
outlet as you would a radio or phonograph. Although 
it costs no tnore than a good television set, its ver- 
satility, for all practical purposes, is limited only 
by the skill and imagination of those who know how to 



use it. Within the field of education, its capabilities 
are only just beginning to be explored. 

What do students think of the microcomputer? 
Our student support center personnel arc unanimous 
in their verdict: The students love it! Indeed, 
never was remedial instruction sought with such 
eagerness as when it was offered by way of the 
microcomputer. 

Teachers, too, for the most part, have been 
supportive of this mode of instruction - increasingly 
so as time has gone on. Several have commented 
favorably on the tangible benefits they have observed 
as a result of their students having worked with micros. 

Although parents have not been queried formally 
as to their views cin the matter, a number of them 
have voluntarily expressed their enthusiasm for the 
use of microcomputers as an additional aid to learning. 

So where do we go from here? Let us tentatively 
offer these concluding thoughts: 

The education establishment (of which we arc 
bona fide membei-s) will take most kindly to micro- 
computers when these wcmderful instruments are 
seen as supplemental to other forms of instruction, 
not as replacements lor them, lliis means that 
manufacturers and publishers alike would be well 
advised to ])romoie micros as being |3articularly 
useful to teachers in the areas of remediation, 
enrichincnt, special education, and lionieboinKl 
instruction. Itnplic-ation: Any comprehensive and 
rclati\'ely expcnsi\'c arrangement rccjuiring lull- 
scale classroom pai'iicij>ation may be a difficult 
package to sell to educators. 

Mastery learning, including competency-based 
teaching and testing, may very well be an idea 
whose time is ra|)tdly coming if, indeed, it is not 
already here. Implication: It is possible that as 
school peo]>le gencralb' begin to grasp some f)f the 
implications tjif microcomputers for education, it 
will be seen tht micros may be fundatnental lo the 
successful a]>])lica(i()n of mastery learning on a broad 
scale. 

No one, of course, can clearly foresee what i.s 
going to happen. But all of us who are impressed 
by the mighty potential of the microcomj^uter would 
do well not to repeat the mindless optimism of the 
1960's when (do you remember?) teaching machines 
first fjlossomed. In those tialcytjn days, equipment 
vendors rushed to market with hardware that needed 
only programs in order to teach anything. Teachers, 
it was cheerfully assumed, would quickly fill tins 
need by creating instructional hearts for tin wootlsmcn. 
Alas, this did not happen. Implication: We should 
carefully avoid making this mistake again. 
Finally, this observation: 

A famous etiiicaior once said, "Matlam, we 
guarantee results - or we return the boy!" 

In our dawning new age of customer-oriented 
education, what is more likely to be returned now 
is the machine. © 



Septembef /October. 1980- Issue 6 



COMPUTtI 



23 



Basic In A Nutshell 



Nome: Step- By-Step 
Vendor: Program Design, Inc., 11 
Idar Court, Greenwich CT 06830 
Price: S49.95 

Purpose: Teaches how to program 
Q TRS-80 using BASiC 
Documentation; Outstanding 
Loading; OK- Levei 6, not criticai 
trnplementatlon: This is a case of 
a BASIC program that teaches BA- 
SIC programming, It starts out with 
the assumption that the student 
only knows how to turn the TRS-80 
on. Three cassette tapes are 
mounted in the cover of a loose- 
leaf notebook that also contains 
supplementary information frames. 
The course is divided into ten two- 
part lessons. From a simple PRINT 
"HI" through arrays and graphics to 
complex programs, all of the Level 
II commands and statements are 
exercised. 

The instruction method consists of 
explanation, example, trial and 
testing. Commands and state- 
ments are presented and ex- 
plained, examples are shown both 
on the screen and in the notebook, 
and then the student is presented 
with some problems to solve using 
the BASIC elements under discus- 
sion. If an incorrect answer is given. 



tv/o more tries are allowed, and 
then the correct answer is dis- 
played. Each lesson ends with a 
test that is administered and 
scored by the computer. The results 
are then entered into the student's 
progress chart, More comprehen- 
sive examinations are given at the 
end of Lesson 5 and at the end of 
the course. 

Suitability: This is the kind of edu- 
cational programming that per- 
sonal computing needs more of. 
The student (my teenage son) 
learned much more quickly than I 
could have taught him, and at his 
own pace. However, this course 
isn't just for youngsters but for any- 
one whio wants to be able to pro- 
gram effectively using the BASIC 
language. In a household where 
there isn't anyone to do the teach- 
ing, this course would be espe- 
cially useful. I'd like to see a similar 
course for assembly-language 
programming. 

Other software available from 
the same vendor: IQ Builders (four 
different kinds). Memory Builder 
and Story Builder. 

Reprinted with permission: 

80 Microcomputing, February 1980 



■i 



Step by Step also available for Apple II and Pet Apple II version also available on disks for $59.95. 
Available at Computerland and other fine computer dealers. Or, use the coupon below. 



Program Design, Inc. 11 Idar Court Greenwich, Conn. 06830 203-661-8799 



ORDER FORM 



QuantitY 



Title 

STEP BY STEP 



Computer 



Price 



Please send me a list of dealers in my area n 
Check or m.o. enclosed D 



BankAmericard/VISA #- 
Mastercharge # 



MC 4 digits over name . 
EX date Phone 



Name: 

Address:. 
City; 



Shipping 5% . 
CT resident add 7% . 

TOTAL . 



State & Zip: . 



' Foreign orders: U.S. funds 
Add SIO. 



24 



COMPUTEI 



September/October, 1980. Issue 6 





TM 



THE ELECTRONIC COLUMNAR FAD 

A Problem Solving Computer Software Program 

Colupad™ is a unique computer tool which allows you to create, 
store, selectively retrieve and perform math operations upon data 
and then generate reports using that data. Colupad™ can best be 
visualized as the typical columnar accounting pad found in most 
offices. Powerful, but simple to use, Colupad™ has such features as: 

• 24 columns and 40 rows for data manipulation 

• Space for row and column descriptions 

• Ability to store 24 constants per page 

• Ability to reference decimal places for each 
column 

• Ability to perform math functions on one 
column and store in another 

• Ability to add, subtract, multiply, etc.. one 
column to another and then place resulting 
data in a different column 

• Print a whole page, selective columns or rows 

• Save whole pages to disk 
Retrieve whole pages, selective rows, or 
columns from disk 

• Plus much, much, more 



— — . : = = = = = — — ■ : — -^=r 

T— ^ ~~~~ ~ . — — Zl~ — "^3" 

: — zi~ ~I -ZIZ — ^^Z 



One page of the pad, the worksheet, is in computer memory. The pad consists of 
worksheets stored on disk and linked by name. Pad size is only limited to diskette 
capacity. 

If you find yourself spending hours (or days) copying, adding, subtracting, or 
whatever one column by another or just compiling data on a columnar pad then 
Colupad™ can save you time, and in your business time is money. 

Colupad™ requires a 32K PET, Disk, and printer. - S150.00. 

TO PLACE YOUR ORDER CALL (919) 362^200 or (919) 362-5671 
LOOK FOR MORE PROBLEM-SOLVING SOFTWARE FROM 

Etceterii Internatiohiil 



Software Marketing 
Division of 



DEALER INQUIRIES INVITED 



ELECTRONIC TECHNOLOGY CORPORATION 

P.O.BoxG-OldNC42 
Apex, North Carolina 27502 
919-362^200 



ATTENTfON PROGRAMMERS AND INVENTORS 

WE ARE INTERESTED IN SOFTWARE AND HARDWARE APPLICATIONS TO MANUFACTURE, 
ANDMARKET — IFYOU HAVE SUCH APPLICATION GIVE US A CAU.. 



Serious Ixpanslon 
lor the AIJIII-65 



0^?f^^ _. 



^■^^>. 



Ht^N^^> 



,^.^ 



'v'***' ^ 



^ 



■^- 



,^ 



-L 




Introducing Memory-Mate*, the AIM-65 expansion 
board that lets you spend your time on application 
solutions, not hardware hassles. Add Memory-Mate 
to your AIM-65 and make quick work of development 
and process control projects. 

In its primary function, the Memory-Mate board pro- 
vides 16-48K of RAM expansion assignable in 4K 
blocks anywhere in the system. Memory-Mate's pari- 
ty check circuitry insures system RAM integrity (in- 
cluding aim's 4K on-board RAM) for high reliability 
applicotions. The programmable write protect feature 
eases software development chores. This compact 
board, which fits directly beneath the AIM, also in- 
cludes four programmable I/O ports, a tone 
generator for audible warnings, and sockets for 4K of 
PROM. 



I/O intensive applications are occommodated with 
Memory-Mate's STD BUS interface option. Use off- 
the-shelf STD BUS cards to solve your biggest I/O 
problems. 

The Memory-Mate with 16K RAM is priced at $475, 
with 1 6K expansion chip sets (including parity chip) 
costing $100 each. With 48-hour active burn-in and 
warranty for a full year, you won't have to worry 
about reliability either. 

First of the complete AIM-Mate* series, Memory- 
Mate will be joined shortly by the Video-Mate*, 
Floppy-Mote* and the AIM-Mate case. For further in- 
formation on the entire AIM-Mate series, write 
'Attn: AIM-Mate Series' at the address below. 

*TM Forethought Products 



Forethought Products 



87070 Dukhobar Rd., Eugene, OR 97402 
(503)485-8575 



so- 
3? 

" 2 

9 ■* 

Si 

<£> (D 

-t <D 
C fi) 

Offl 

If (/> 



O 
0) 



O 



26 



COMPUTEI 



Septembsf/October. 1980. Issue 6 



RS232 COMMUNICATIONS 



Michael E. Day 
2590 DeBok Road 
West Linn, OR 97068 

As more computer equipment is purchased by tiie 
small systems user, connecting this equipment together 
becomes a bigger problem, particularly when the 
equipment is made by different manufacturers. 

One of the more common methods of connecting 
data communications equipment together is by way of 
the RS232 standard. However, even this has been 
cause for confusion, as there are various levels of 
iinplementation within the standard. 

The purpose of this article is to provide sufficient 
information concerning the RS232 standard to allow 
proper implementation at the desired level. 

The minimum level of RS232 consists of: 

Pin 2 TXD (Transmitted Data -OUT-) 
Pin 3 RSD (Received Data -IN-) 
Pin 7 Logic Grnd 

The 2nd level consists of the minimum level plus: 
Pin 6 DSR (Data Set Ready) 
Pin 8 DCD (Data Carrier Detect) 
Pin 20 DTR (Data Terminal Ready) 

The 3rd level consists of the other two levels plus: 
Pin 4 RTS (Request to Send) 
Pin 5 CTS (Clear to Send) 
Pin 22 RI (Ring Indicator) 

Pin 1 Protective Ground should be used at all levels; 
however, it is not required for proper operation. 

Level 1 is normally used with equipment tied 
directly to each other, such as a terminal tied directly 
to a computer. Level 2 is normally used where some 
degree of handshaking is required, and is often found 
on accoustic couplers. The third level is used where 
a more detailed control of the information flow is 
required. This level will usually be found with auto 
answer modems. 

This is a generalization of what will be en- 
countered by the small systems user, and in no way 
implies that all equi[5ment will follow these rules. 
Some equipment will need other special signals, or 
not use all of the signals within a specific level. 
Synchronous transmission will normally require addi- 
tional special lines and will be described in detail 
later. 

There have been three standards of RS232 
produced--A, B, & C. RS232A is obsolete, and equip- 
ment using this standard is almost non-existent. 
RS232B is also obsolete; however, there is .still some 
old equipment around that uses this standard. 
RS232B is basically the same as RS232C except that 
the Transmit Data and Receive Data signal levels 



are inverted; that is, a marking condition is a positive 
level rather than a negative level. 

The following is a description of the full RS232C 
standard. It is not required that all signals be pro- 
vided, and it may be implemented in part or in full. 

Each data set has a standard 25-pin connector 
(Cinch or Cannon chassis-mount, female iy]>e 
DB-25S). The table below has the pin number, the 
circuit mnemonic, and description for each signal 
in the RS232-C interface. Una.ssigned pin may have a 
different function in each type of data set, so check 
the technical manual lor pin assignments for each 
data set. 
Pin Number Mnemonic Description 



1 


AA 


I'rmetiivi.- Ground 


2 


BA 


Triinsmiiicf! Data 


3 


BB 


R(.'cfi\cd Data 


4 


CA 


Rt-qucst to Send 


5 


CB 


Clcai- to .Send 


6 


CC 


Data Set Ready 


7 


AB 


Signal Ground (Coiiirnoii Rcnirn) 


8 


CF 


Received Line Signal Delrcliii- 


9 


~ 


(Re.served for Data -Set 'rcslin)>) 


10 


- 


(Reserved for Data Set Testing) 


11 




Unassigned 


12 


SCF 


Sec. Ree'd. Line Sii;. Detector 


13 


SCB 


See. Clear to Send 


14 


SBA 


Serondary Transmitieil Data 


15 


DB 


'I'ransniission Signal Lllenieni 
Timing (DCE Source) 


16 


SBB 


Secondary Rt-ce!\'ed Data 


17 


DD 


Receiver Signal liteiiient Tiniinq 
(DCE Source) 


18 




Unassirncd 


19 


SCA 


Secondary Request lu Sesitl 


20 


CD 


Data Terminal Ready 


21 


CG 


Signal Quality Detector 


22 


CE 


Ring Indicator 


23 


CH/Cl 


Data Signal Rale Selector 
(D'lTVDCE Sinircc) 


24 


DA 


Transniit Signal Element riniitig 
(DTE Source) 


25 




Unassigned 



For timing and control interchange signals, the func- 
tion will be ON when the voltage is more positive 
than plus three volts and OFF when the voltage is 
more negative than minus three volts. The table 
bclov\- illustrates the signal function voltage relation- 
sliips. 

INTERCHANGE V OLTAGE 



Binary State 
.Sitinal Condition 
Font tion 



NEGATIVE 

-3 to -25 

1 

Marking 

OFF 



POSITIVE 

+ 3 to + 25 

(1 

.Spacing 
O.N 



September /October, 1980. Issue 6 



COMPUTEI 



27 



HAYDEN SOFTWARE . . . 



New! 

DATA MANAGER: A Data Base 

Management System and Mailing List 

(Lutus) Do what the big machines do with your 
Apple II! This all-machine language program 
stores up to %,(KX) alphanumeric characters 
on just one floppy disk. Powerful cursor-based 
editor facilitates easy information alteration in 
the data base. Program permits the user to sort 
on any key and subfiles on any .search. Retrieve 
data in any combination of categories from up 
to 32,000 characters within one-half .second. 
Choose between screen display or .serial print- 
out (via the game paddle connector). Ideal for 
mailing lists, data banks, index files, or any 
other facts, files, or statistics that arc begging 
to be organized, tf 04909. Apple II Disk Version. 
$49. 95. ^ 

New! 

APPLE™ ASSEMBLY 

LANGUAGE DEVELOPMENT SYSTEM 

(Lutus) Enter the world of machine language 
programming with this brand new. winning. 
utility program. This very capable Assembler/ 
Editor/Formatter allows you to write and 
modify your language programs quickly and 
easily. Features a cunsor-based editor, local and 
global labels, and disk-based macros which per- 
mit you to incorpe:)rate frequently used sub- 
routines into any program. Formprint program 
lets you print a formatted listing of source and 
object files. m)4609. Apple II Disk Ver.sioii. 
$39.95. 



\\ ailable at your local computer store! 

Hayden Book 
Company, Inc. 

50 Essex Street, Rochelle Park, NJ 07662 



or Call Toll Free, 24 hours a day. 
(1-800-827-3777. ext. 302)' 

TO CHARGE YOUR ORDER TO 
Master Charge or Visa' 
tvlinimum order is $ 10 00; 
Customer pays postage and handling. 
From Missourr call 
1-800-892-7655, ext. 302, 



New! 

MICROCOMPUTER CIRCUIT 

ANALYSIS PROGRAM 

(Savon) Minimize your time calculating the 
frequency response of a circuit with this new 
program. MCAP performs a linear voltage, 
impedence, or transfer impedence analysis of 
an electronic circuit. Enter the circuit des- 
cription in a systematic nodal notation and the 
program then calculates, lists and plots the 
circuit's frequency response. MCAP readily 
analyzes circuits with up to 15 nodes — larger 
circuits can be divided into subsections for 
individual analysis. And. the circuits analyzed 
can contain any or all of the six types of com- 
ponents: resistors, capacitors, inductors, bi- 
polar transistors. FETs, and Op-Amps. Educa- 
tors in particular will find this a strong 
applications program for circuit analysis, 
n()4504. Apple l): m)450I. PET: each Cassette 
S24.95. 




TVS^SSVJ-^^JjD""-.' 



For those who prefer their 
ready-to-run programs 



WELL DONE! 



28 



COMPUTEI 



September/October, 1980. Issue 6 



The figure below illustrates a 2-\vire, poitn-io-point, 
hall" duplex, and a telephone leased line whieh is 
alwavs a\-ailable to (he customer. 



Computir 



^ Data Set 



^ Data Sfl 



^ Ttrminal 



Assume that the computer needs to transmit a message 
to the terminal. The eom]}titei''s software brings up 
the ''data terminal ready line" lo its data set. 
ITthc data set is "ON" it will return "Data 
Set Ready" (interlock it) to the computer. When the 
computer wants to transmit, it raises the "request 
to send" level which tells the data set to turn on the 
carrier wa%'e. The carrier wave is sen! Irom the 
computer's data set over the telephone cii'cuit to the 
terminal's data set. The terminal's data set, upon 
detecting the carrier, will raise the "Receiv'ed Line 
Signal Detector" level to inrorm the terminal, in 
eilecl, (hat a message is about to be received. After 
a fixed delay time (strappabie in some data sets) 
and after raising "Request ToSend," the computer's 
data set will return. "Gleai- To Send." The computer 
Ujjon reeei\-ing tiie "Clear To Send" signal, can 
now start transmitting the message, as marks and 
spaces, on the "Transmitted Data" line to its data 
set. The data set con\erts (he digital signals into 
frecjuency or phase-- shifted signals for transmission 
over the leased line to the lerniinai's data set. 

Most data sets contain a clamp c ii-cuit which 
clamps the "Received Data" line. "Recei\ed l,ine 
Signal Detector" le\'el is not generated until after 
the cari'ier is detected. The clani]) delay masks out 
all the possible noise on tile line which occurs during 
the switching from either transmit to receive or 
rccei\'e to transmit. 

If this was a synchronous operation, the clocking or 
synchronization of each bit would be done by the 
computer's data set. ,So that the tomputer knows 
when each bit must be piaceti on the "Trans- 
mitted Data" line, the tiata set sends clock to the 
computer on the "Transmission Signal Element 
Timing" line. This clock will be coincident with 
the leading adge of eadi data bit on the "Trans- 
mitted Data" line. 

At the terminal end of the system, the computer's 
data set turns on its carrier; the terniinal's data 
set detects it and sends "C'arrier Detected" lc\'el 
to the tei'niinais. Se\'eral milliseconds later (length 
detei'inined b\' the "(Hear To Sent!" delay in the 
transmitting data set), the first tnessage bits arri\-e 
and are converted to a digital signal, \vhich is 
passed from the data set (o the lerminal on (he 
"Recei\ed Data " line. In ssiichronous operation, 
clocking ioi" the data is generated b\' the recei\ing 
data set and is passed to the terminal on the 
"Recei\'er Signal Element Timing: line in order that 
the terminal can correctK' clock (he bi(s into its 



buffer or memory as they arrive. The clock pulse is 
timed to occur at the center of the data bit on the 
"Received Data" line. 

The following is a list of the definitions tjf the RS232-C 
signals which are listed in order of pin number. To 
simplify the definitions, the transmitter of the message 
will be identified as the "transmitting terminal" 
and the receiver as the "receiving terminal." 
PROTECTIVE GROUND PIN 1: This ground is 
electrically connected to the equipment frame. It may 
be connected to external grounds, as required. 

TRANSMITTED DATA PIN 2: This signal is 
generated by the transmitting terminal and is trans- 
ferred to the local transmitting data set for trans- 
mission of data to the receiving terminal. The 
transmitting terminal will hold "I'ransmiltcd Data" 
in marking condition during the intervals between 
characters or words, and at all times when no data 
are being transmitted. 

In all systems, the transmitting terminal will not 
transmit data unless an ON condition is present on all 
of the following four signals: 

1 . Rccjucst To Send 

2. Clear to Send 

3. Data Set Ready 

4. Data Terminal Ready 

RECEIVED DATA PIN 3: This signal is generated 
by the receiving data set in response to data signals 
received from transmitting terminal via the trans- 
mitting data set. "Received Data" will be held in the 
binary one (marking) condition at all times when 
"Received Line Signal Detector" is in the OFF 
condition. This is called clamping the line. 

On a half-duplex channel, "Received Data" 
signal will be held in the binary one (marking) 
condition when "Request To Send" is in the ON 
condition and for a brief interval following the ON 
to OFF transition of "Request To Send" signal to 
allow for the completion of transmission and the 
decay of line reflections. This is called sc|uelch. 

REQUEST TO SEND PIN 4: This signal is used 
to condition the data set for data transmission. On 
simplex channels or duplex channels, the ON 
condition maintains the data set in the transmit 
mode. The OFF condition maintains the data se( in 
a non-transmit mode. 

On a half-duplex channel, the ON condition 
maintains the data set in the transmit mode and in- 
hibits the received mode. The OFF condition main- 
tains the data set in the receive mode. 

A transition from OFF to On instructs the ciata 
set to enter the transmit state which turns on the 
carrier. The data set responds by taking such action 
as may be necessary and indicates completion of 
sucli actions by turning ON "Clear To Send," 
thereby indicating to the terminal that data may be 
transferred on the interchange signal "7'ransmitted 
Data." 



September/OctoCwr. 1980- Issued 



COMPUTE! 



79 



A transition from ON to OFF instiucts tin: data 
set to complete the transmission of all data which 
was previously transferred on the interchange signal 
"Transmitted Data" and then assumes a non- 
transit mode or a receive mode, as appropriate. The 
data set responds to this instruction by turning OFF 
"Clear To Send" when it is prepared to again respond 
to a subsequent ON condition "Request To Send." 

When "Rec|uest To Send" is turned OFF, it 
will not be turned ON again until circuit "Clear 
To Send" has been turned OFF by the data set. 

An ON condition is required on "Request To 
Send" as well as on "Clear To Send," "Data 
Set Ready" and, where implemented, "Data Termi- 
nal Ready" wlienevcr the transmitting terminal trans- 
fer data on the interchange signal "Transmitteti 
Data." 

It is permissible to turn "Request To Send" 
ON at any time when "Clear To Send" is OFF, 
regardless of the condition of any other inter- 
change circuit . 

CLEAR TO SEND PIN 5: A signal generated by 
the data set to indicate whether or not the data 
set is ready to transmit data. 

The "Clear To Send" ON condition together 
with the ON condition of interchange signals "Re- 
quest To Send," "Data Set Ready" and, where 
implemented, "Data Terminal Ready" will be trans- 
mitted to the communication. 



The OFF condition is an indication to the trans- 
mitting terminal that it should not transfer data 
across the interface on interchange "Transmitted 
Data." 

The ON condition of "Clear To Send" is a 
response to the occurrence of a simultaneous ON 
condition on "Data Set Ready" and "Request To 
Send" delayed as may be apprtjpriate to the data set 
lor establishing a data communication channel to a 
remote terminal (including the removal of the MARK 
HOLD clamps from (he received data interchange 
circuit of the remote data set). 

Where "Request To Send" is not implemented in 
the data set with transmitting capability, "Request 
To Send" shall be assumed to be in the ON condition 
at all times and "Clear To Send" will respond 
accordingly. 

DATA SET READY PIN 6: This signal is used 
to indicate the status of the local data set. The ON 
condition of this signal is presented to indicate 
SECONDARY RECEIVED DATA PIN 16: This 
circuit is equi\'alcnt to "Received Data" 
except that it is used to receive data on the secon- 
dary channel. 

W^hen the secondary channel is useable only lor 
circuit assurance or to interrupt the How of data in 
the primary channel, "Secondary Received Data" 
is normally not provided. See interchange "Secondary 
Received Line Signal Detector." 



"SuperBus" 
will haul it all! 




For PET/CBM users. Schools, 
banks, laboratories and 
businesses can greatly multiply 
their capabilities at an 
unbelievably low cost . 



M 18 Computers can share disk drives, 
printers or other devices on the IEEE bus. 

U Includes RS-232 and terminal programs. 
(Hardware will soon be available for 
approximately $50.) 

M Auto-boot. You can even Initialize disks and 
run "Hello" program. 

U Modify your basic commands for restricted 
access (better security). 

m RUN/STOP key. Disabled, or 
modified to "Return to menu. " 

■ Chain disk programs automatically. 

U Auto clear. 

M All keys repeat (adjustable). 

K Low cost. 2 ROM and 1 disk set 
(one set required $ itf ^k JET 00 
for each computer). m 5r ^r 

MasterCard, VISA and C.O.D. orders 
accepted. 15-day return privileges. Specify 
N or B keyboard. Dealer inquiries invited. 



H 



mi^.(515) 292-7634 
2330 Lincoln Way, Ames, Iowa 50010 



LIMITATIONS WHILE ON THE SUP£RBUS: 71 THE CASSETTES CANNOT BE WRITTEN TO. 2) ONLY THE SECOND CASSETTE CAN BE READ FROM 
3) ONLY ONE USER CAN BE USING THE SYSTEM RESOURCES AT ONE TIME. BUT ANY NUMBER CAN BE WAITING. 



30 



COMPUTEI 



September /October, 1980. Issue 6 



RECEIVER SIGNAL ELEMENTTIMINGPIN 17: 

Signals ot^ this circuit arc used to provide the 
terminal with received signal element timing inlor- 
mation. The transition from ON to OFF condition 
shall normally indicate the center of each signal 
clement "Received Data." Timing information on 
"Receiver Signal Element Timing" shall be provided 
at all times when circuit "Received Line Signal 
Detector," is in the ON condition. It may, but 
need not, be present following the ON to OFF 
transition of "Received Line Signal Detector." 

UNASSIGNED PIN 18; This pm may be used by 
the manufacturer for any purpose desired. 

SECONDARY REQUEST TO SEND PIN 19: 

This signal is equivalent to "Request To Send" 
except that it requests the establishment of the 
secondary channel instead of requesting the establish- 
ment of the primary data channel. 

Where the secondary channel is used as a back- 
ward channel, the ON condition of "Request To 
Send" will disable "Secondary Request To Send" 
and it will not be possible to condition the 
secondary channel transmitting data set to transmit 
during any time interval when the primary channel 
transmitting data set is so conditioned. Where 
system considerations dictate that one or the 
other of the two channels be in transmit mode at 
all times but never simultaneously, this can be 
accomplished by permanently applying an ON condi- 
tion to "Scconclary Request To Send" and controlling 
both the primary and secondary channels, in 
complementary fashion, by means of "Request To 
Send." Alternatively, in this case, "Secondary 
Clear To Send" need not be implemented in the 
interface. 

When the secondary channel is useable only for 
circuit assurance or to interrupt the flow of 
data in the primary data channel, "Secondary 
Request To Send" will .serve to turn ON the 
secondary channel carrier. The OFF condition of 
"Secondary Request To Send" will turn OFF the 
secondary channel carrier and thereby signal an in- 
terrupt condition at the remote end of the communica- 
tion channel. 

DATA TERMINAL READY PIN 20: This signal 
is used to control switching of the data set to the 
communication channel. The ON condition prepares 
the data set to be connected to the communication 
channel. 

SIGNAL QUALITY DETECTOR PIN 21: Signals 
on this circuit are used to indicate whether or not 
there is a high probability of an error in the received 
data. 

As ON condition is maintaiiietl whenever there 
is no reason to believe that an error has occurred. 

An OFF condition indicates that there is a high 
probabjility of an error. It may. in some 
instances, be used to call automatically for the 



retransmission of the pre\^iously iransmiiied data 
signal. Preferably the response of this circuit shall 
be such as to permit identification of individual 
questionable signal elements on "Received 
Data." 

RING INDICATOR (CE) PIN 22: Tlu ON condi- 
tion of this signal indicates that a ringing signal 
is being received on the communication channel. 

DATA SIGNAL RATE SELECTOR PIN 23: 

Signals on this circuit are used to select beiween 
the two data signaling rates in the case of dual 
rate synchronous data sets or the two ranges of 
data signaling rates in the case of dual range 
non-synchronous data sets. 

An ON condition shall select the higher tlata 
signaling rate or range of rates. 

The rate of timing signals, if included in the 
interface, shall be controlled by this circuit as may 
be appropriate. 

TRANSMIT SIGNAL ELEMENT PIN 24: Signals 
on this circuit are used to pro\ide the transmitting 
data set with signal element timing informatioii. 

The ON to OFF transition shall nominally indi- 
cate the center of each signal element on "Trans- 
mitted Data." W^hen "'Fransmit Signal Element 
1 iming" is implemented in the data set, the data 
set shall normally provide liming information on 
"Transmit Signal Element Timing" whenever the 
data set is in a power on condition. It is jjcrmissible 
for the data set to withhold timing inforniaiion on 
this signal for short [)eriods provided "Rec|uest To 
S e n d ' ' i s i n t h t: O I' F c o n d i t i o n . 

UNASSIGNED PIN 25: This pin may be used by 
the manufacturer for any [nirposc desired. 

Although the "FIA" i>ublishes an interface standard, 
some data set manufacturers do not conlorm to the 
standard in all cases. CHECK the specifications on 
each data set to deteririine which signals are on each 
pin. ' <0 



D £t R 2nd-Cassette System 



FEATURES; 

• Sanyo Recorder M2544A, 

• Digital Counter. 

• Compatible with EASTERN HOUSE 
Software's High Speed Cassette 
Routines — Loads 8K In 38 seconds. 

• Includes Interface Module and all Plugs 
& Cables. 

• $83.00 Check or r\/lonev Order. 

Add S3. 00 for Shipping and Handling. 
Canada (U.S. Fundsl. $6.00 S & H. fvlich.. 
4% Tax. Charge Card Customers add 5%. 




CREATIVE SYSTEMS 
P.O.BOX402C 

ST. CLAIR SHORES, Ml 48080 



YES! 

You Can Have 

Your PET"" And 

Counter Too. 

313-771-1392 

DEALERS WRITE 



September /October, 1980. Issue 6 



COMPUTEI 



INTRODUCING 

THE NEW IMPROVED 

BUSINESS ENHANCEMENTS 
COMPUSERVICE BUSINESS 

SOFTWARE 

FOR 

COMMODORE 

AND 



Micro Mini Computer World Inc. is an execlu 

sive distributor for the BUSINESS SOFT- . T^TIT T^ 

WARE developed by Business Enhance- j\ " |-^ | ^\(\ 



ments Compuservice of Escondido 
Cahfornia. 

If you are selling or using the 



B.E.C. VALUE ADDED 

BENEFITS • Total commit- 
ment to the development of excellent 
y^^-^1» /TT^T TfTTT^T^ business software for the 
f,llJYr|__[-' 1) J_ Jjj JK COMMODORE and APPLE com- 
puter systems. 



COMMODORE BUSINESS MACH- C YCT^"C^"|Vf C • At reasonable rates Micro Mini 



INESor the APPLE computer systems, 
then you should provide yourself and your 
customers with the MOST COST EFFECTIVE and 
COMPREHENSIVE business software for a busi- 
ness computer system. 

CURRENT B.E.C. SOFTWARE 

• General Ledger-Master File 1000 Accounts 
and Journal File 4400 Entries 

• Accounts Receivable-Master File 1170 
Accounts and Invoice File 1430 Entries 

• Accounts Payable-Master File 1170 and 
Invoice File 1430 Entries 

• Payroll"440 Employees 

• Job Costing-1100 Items Per Disk 

• Inventory-1100 Items Per Disk 

• Mail List/Customer Information-1000 

Entries Per Disk 
Above figures apply to CBM 2001 computer 

system with 32 K CPU and 2040 dual disk. 

With the new CBM 8050 Megabyte disk the 

volumes will be increased significantly. 

B.E.C. SOFTWARE FEATURES: 

• Complete and total documentation 

• Step by step walk through on every pro- 
gram operation, with examples 

• Each package is MENU driven and uses 
dynamic load and overlay once the initial 
menu is loaded. 

• Examples are provided for all reports and 
other printed forms. All forms are available 

from New England Business Services Inc. (NEBS(. 

• All input/output operations use random access 

• Sorts are machine language sorts 

• Programs are interactive with the General 
Ledger and update the GL automatically. 



Computer World Inc. will provide 
software modifications to meet customer require 
ments. (CallMMCWI for further information) 
• EXTENDED WARRANTY which entitles 
users to any enhancements to accounting 
software during the year of coverage. 
(Cost is $100 per year) 

Dealers and Interested Parties may obtain a 
copy of the B.E.C. software documentation for 

S25. If after review you are not interested, 
send the documentation back, in re-saleable 
condition, for a full refund or apply the 
$25 toward your first software purchase. 

The NEW B.E.C. BUSINESS SOFTWARE 
requires a special ROM chip for proper 
operation. 

Suggested Retail Prices are: 

1. Rom chip $70 (required on any software 
package) 

2. Individual software package S150 

3. All seven software packages $995 (save 
$55) 

DEALER INQUIRIES ARE INVITED 




micro 
mini 



COMPUTER WORLD Inc. 




7-1 ROBINWOOD AVE. COLUMBUS, OHIO 43213 
(614) 235-5813 (614) 235-6058 



32 



COMPUTEI 



September /October. 1980. Issue 6 



Solving 
Equations With 
A Computer 



Marvin L. De Jong 

Department of Mathematics-Physics 

The School of the Ozorks 

Pt, Lookout, MO 65726 

INTRODUCTION 

There is a large body of knowledge, known as 
"Numerical Analysis," that is used to solve pro- 
blems that would be cither too difficult or too iiiefil- 
cient to solve with either hand calculations or an 
electronic calculator. The problems generally attack- 
ed with numerical analysis tcchniciucs recjuire cither 
a computer or a programmable electronic calculator. 
The purpose of thi.s article is (o show how a few 
techniques from numerical analysis can be u.scd to 
solve difficult equations. These techniques do not re- 
quire any extraordinary mathematical skills; a first 
course in high-school algebra will suffice. 

Tc) begin, we will assume you can solve equations 
ol' the type, 

2x + 5 = -5 (1) 

This type of equation is solved using the rules: 
RULE (1) The same number (or algebraic expression) 
can be added or subtracted from both sides of an 
equation. 

RULE (2) Both sides of an equation can be multi- 
plied or di\'ided by any non-zero number (or algebraic 
expression). 

Thus, in Equation (1), we would first subtract 
five from both sides oi' the equation and next both 
sides of the equation would be divided by two, giving 
X = -4 as the answer. Anv equation of the form 

Ax + B = C (2) 

iias a solution x = (C - H)/A, which is very easy 
to program in BASIC or FORTRAN. The program 
in Listing 1 does this. Lifting 1. Program to solve a 
linear equation. 

10 INPUT A, B, C 

20 X = (C ■ B)/A 
30 PRINT X 
40 END 

Clearly in this case the problem could just as well 
have been done with pencil and paper. We are inter- 
ested in more difficult ])roblenis, but RULES (1) 
and (2) above describe how equations may be modified 
to get the unknown "x" by itself on one side oi the 
equation, and we will need these rules in what follows. 



(3) 
(4) 

(5) 



To these rules we add a third, namely 

RULE (3) In certain cases both sides of an 
equation may be operated on by the same function 
and the results arc still ccjual. 

To illusiraie, if x'^ = 9, then wv may operate on 
both sides of this equation wiih the square root func- 
tion (SQR in BASIC) to get x = 3. Note that this 
technicjue misses the answer x = -3, but it illustrated 
the fact that taking the square root of both sides of 
an equation (usually) yields a valid result. Likewise, 
one can take the logarithm (LOG in BASIC) of both 
sides of an equation provided we are dealing with 
positive numbers, and we can take the exponential 
junction (KXP in BASIC) of both sides of an equa- 
tion, using RULE (3). 

The type of equations that are of interest in the 
present context can best be illustrated by some ex- 
amples. How would you solve for x in the following 
equations: 

\^ = cos{x) 

e^ - 4x = 

Iog{x) - cos(x) = 

These so-called non-linear equations cannot be 
solved by a simple application of the rules given so 
far. In fact, you may be disappointed to know that 
no single technique will solve all possible non-linear 
equations. Many people like mathematics because it 
seems to follow simple, hard-and-fast rules that lead 
to answers that are either right or wrong. On the 
contrary, mathematics requires creativity and the 
ability to view a problem from many angles. Further- 
more, more often than not, the answers are only ap- 
proximately correct rather than absolutely correct. In 
any case, let us examine two techniques that may be 
used to solve these difficult looking ecjuations. 

The Method Of Successive Substitutions 

The method of successive substitutions is one of the 
simplest techniques tised to solve these equations. It 
comes with no guarantee that it wqll work, but because 
it is simple it is frequently worth trying. 

The first step is to take the ecjuation to be solved 
and using the three rules given in the Introduction, 
put the equation in a form w^ith x on the left-hand 
side and everything else on the right-hand side of the 
ec|uation. For example, the equation x"^ = cos(x). 
Equation (3) above, becomes either x = (cos(x))/x or 
X = V cos (x). It is typical to find several possible 
lorms. This step is usually described in textbooks by 
telling you to put your ecitiation in the form 

X = f(x) (6) 

In our example, f(x) is either cos(x)/x or \Jcos(x) 
de[jen ding on whether we arc using x = (cos(x))/x or 
x = Ncos(x). In any case, the equation is modified 
so that X is all by itself on one side of the equation 
and everything else is on the other side. 

The second step is to guess at a \'alue ol x that 
will satisfy the equation. This is an important step 



September/OctoDer. 1"?80 Issue 6 



COMPUTE! 



33 



Iji'iaiKsc u iiKiv tii'liTniine llic suftt'ss ol liif iiicthod. 
ir you cannot make a reasonable guess by inspection 
of the equation or from some other source of infor- 
mation, then you can always have your computer 
prim a table of x and f(x) to sec where they are 
(ahnosi) equal. For example, if you arc trying to 
soKe x~ = cos(x) and you have completed the first 
step by transforming the equation to x = N|cos(x), 
then use your conipuier to make a table of x and 
\|cos{x). A few simple slaiemenls will sul'fice, as 
Listing 2 indicates. Be sure to be available to break 
the program because it has an infinite loop. The 
numbers in Table 1 were obtained with the program. 

Listing 2. Program to compare x with f(x) for x = 
Mcos(x). 

10 X = 

20 FX = SQR(COS(X)) 

30 PRINT X. FX 

40 X = X + . 1 

50 GO TO 20 



Table 1. 



X SQR(COS(X)) 



Output of the 


(1.0 

(1.1 


1.00 
.99 


program in 


((.2 


.98 


Listing 2. 


0.3 


.97 




(».-! 


AK) 




0..5 


.93 




0.6 


.90 




0.7 


.87 




0.8 


.83 




0.9 


.78 




1.0 


.73 



The values of ■SQ,R(COS(X)) in Table 1 have been 
truncated to two decimal places. Note in particular 
that at X = 0.8 the function f(x) = SQR(COS(X)) 
is 0.83 which is larger than X, while at X = 0.9 the 
functitm is .78 whitli is .smaller than X. Thus, 
somewhere in between 0.9 and 0.8 (he function will 
be equal to X, and the equation x = f(x) will be 
satisfied, giving us the answer. Thus, a good initial 
guess at a solution is either 0.8 or 0.9; either one will 
do. 

The next step in solving the equation by the 
method of successive substitutions is to iterate. What 
this means is that we substitute our gues.s into f(x), 
getting a new value for x. If we call our first guess 
Xq then our next guess is obtained from the equation 

XI = f(xo) (6) 

and successive guesses (or appro.ximations) are ob- 
tained Irom the following equations: 
x2 = f(xi), 

X3 = f(x2), 
elf. All of this is handled in the program in Listing 3. 
Study this program to see how the process is done. 

Listing 3. Program to iterate x = \jco.s(x). 

10 X = O.H 

20 FX = SQR(COS(X)) 

30 PRINT FX 

40 X = FX 

50 GO TO 20 



The lesults obtained from running llu: ])rogram in 
Listing 3 are given in Table 2. After three iterations 
(three times through ihc infinite loop) the answer (with 
a starting guess of 0.8 radians) is correct to two 
decimal places. After 15 times through the loop the 
answer is correct to six decimal [)laces, namely 
0.824L'52. Obviously one could build an "end" 
t:ondition into the program. Suppose you want an 
answer correct to six decimal places. Inserting the 
statements: 

35 IF ABS(X - FX) <. 000001 THEN 60 

60 END 

would do the trick. 

To illustrate the ])roblems you can have, try solv- 
ing the same ecjuation using the form x = 
(cos(x))/x. Simply replace statement 20 in Listing 3 
with 

20 FX = (COS(X))/X 
and run the prograrn. Remember, this is the same 
equation that we are solving, but with a starting 
value of 0.8 radians you obtain the results given in 
Table 3. In this case, the answers do not get closer 
and closer to a solution, but the process diverges. 
Your luck has run oui, but you were warned that the 
method does not always work. A way to tell if the 
method is going to work is available, but its explana- 
tion is beyond the scope of this article. Consult the 
leierence at the end of this article. 



Tabic 2. Result.s obtained 


Tabic 3. Iteration results 


with the form 


from X = 


x = \|cos(x). 


(cos(x))/x 


O.H = .siardiii^ value 


0.8 = .starting value 


O.H34(iii9ri89 


0.870883387 


0.8iy3947,'')l 


0.7396,52.527 


0.826234fi9(i 


0.9987159% 


0.823194739 


0.542078343 


0.824.n49.Tl9 


1. 5802850 ] 


0.823946477 


-6.0«432O32E-O3 


O.H2421.''iO,i2 


-166.543742 


0.82409.")4f)7 


5.999784H9E-03 


0.824148719 


166,669642 


0.824125007 




0.824135566 




0.824130864 




0.8241329.58 




0.824132025 




0.824132440 




0.824132255 





One other illustration should suffice before we move 
to another technique. Consider Equation (4). It is 
not in the form x = f(x), but if we use RULE (1) 
and add 4x to both sides we get 4x = 3^. Using 
RULE (2) we divide both sides of the equation by 
four to get our required form, namely x = (e^)/4. 
Replace statement 20 in Listing 3 with FX = 
EXP(X)/4 and pick a starting value of say X = 0. 
In 15 iterations you will have found a solution good 
to six decimal places; X = 0.3574029 (the trailing 9 
may be uncertain). However, the flush of success 



34 



COMPUTEI 



September/October, 19BO. Issue 6 



may drain from your rosy cheeks when you rciilizc 
that this equation has two answers, and the method 
oi" successive substitutions will not work to find tlie 
other answer. 

How do we know that llic equation has two 
answers? If you write a short program to print the 
value of e^ -4x for some values of x, you obtain the 
results in Table 4. Note that the function e-^ - 4x is 
positive at x = 0.2 while it is negati\e at x = 0.4. 
That means that somewhere between 0.2 and 0.4 the 
function c'^ - 4x went through zero, and at that point 
the equation was satisfied. That is tlic answer wc 
found above, namely x = 0.3574029. Note also that 
at X = 2 the function is ncgati\'e, while at x = 2.2 the 
function is positive, indicating that another answer is 
to be found between 2.0 and 2.2. Try to find this 
answer with successive substitutions. 

Table 4. The value 

of c^ -4x versus x. 



X 


EXP(X) - 4*X 


(Ktt 


1.00 


0.2 


0.42 


0.4 


-0.11 


0.6 


-0.58 


O.H 


-0.97 


1.0 


-1.28 


1.2 


•1.45 


1.4 


-!.54 


1.6 


-1.44 


l.H 


- 1 . 1 .=i 


2,(> 


-0.61 


2.2 


0.22 


2.4 


1.42 



The Method Of Interval Halving 

The failure of the method of successive substitutions 
to converge to an answer in certain situations is 
reason enough to look for another method. The 
method of interval halving is particularly attractive 
because you are (almost) guaranteed that it will find 
an answer if you know that the answer lies between 
two numbers. Refer again to our problem of finding 
the solution to the equation e^ -4x = and Table 4. 
Table 4 indicates that one answer is between 0.2 and 
0.4 and anotlier answer is between 2.0 and 2.2, 
because the function r*" -4x charges sign on these intervals. 
The first step in the interval halving method is to put 
the equation to be solved in the form 

f(x) = (7) 

and to find two vakics of x (call them x^ and x]^, L 
and R for left and right) such ihai the hnuiion f(x) is 
positive for one of these values of x and it is negative 
for the other. 

Suppose we deal with our example, e-^ - 4x =0. 
It already is in the form f(x) = 0. Furthermore, let 
us concentrate for the nioincni on the soluii()n that 
we could not find with the method of successive 
substitutions. That solution we know to be between x 
= 2.0 and x = 2.2. Thus, xl = 2.0 and xr = 2.2 



The second step is to try a value of x half-way 
between x^ and xj^. This is where the name "inter- 
val haKing" originates. This value of x, call it x]\/f 
(M for middle) is given by the sitnple expression, 

"M = ('tL + MlV2 (8) 

Ntnv comes the ti-icky \ydr{. Supp(jse f|^ is the value 
of the function when x]^ is substituted (plugged in) 
into f(x), and suppose fjyj is the value of the function 
when \^\ is plugged into the function f(x). If the 
product (I'l • fjvl) 's positive, then xfvl lit'S to the left 
of the answer just like xl- We know this because the 
product can only be positive if fL and fjyi have 
the same sign. In this case, we replace xi with a new 
value, namely xj^. On the other hand, if the product 
(I'l ■ 'm) '^ negative, then fL and f^ have opposite 
signs, and x]y| is to the right of the answer. In that 
case we replace xj^ with xjyj, giving a new value for 
xj^. In either case, we have bracketed the answer in 
an interval half as wide as the interval we started 
with. 

Repeating this process allows us to bracket the 
answer in as small an interval as we wish, with the 
answer as accurate as we wish. Each time we 
calculate a new xy[ we must test the sign of the pro- 
duct (I'l - t'lvi) tc «'^' if ^M 's 10 the righi or left of 
the answer. li" the answer was originally known lo be 
in an interval of width w, where w is the difference 
between our first xj^ and xj^, then alter n iterations 
or repetitions of the interval halving process, the cr- 
roi' in the answer is w/2", Thus, after 10 iterations 
the crior in the answei- is about 1/1000 of the 
original uncertainty in the answer. 

A program to solve the equation e^ - 4x = 
with the method of interval halving is given in 
Listing 4. With little modification, this [)r(jgram can 
be used for other equations as well. The viiriables in 
the program in Listing 4 are closely related to our 
previous discussion, so no further explanation will be 
gi\'en. I expect that most people can understand 
BASIC about as well as algebra. Table 5 shows the 
answers we obtain for both of the solutions to this 
equation. A total of 20 iterations are done in the pro- 
gram, giving an error oi" less than 0.00000096 if the 
distance between the original x]^ and xj.^ were less 
than one. The roundol'f error in many machines will 
exceed this. 
Listing 4, Interval halving used to solve c'^ ' 4x. = 0. 

1(1 INPUT XL, XR 
20 l'(.)R I = 1 TO 20 
■M) XM = (XL + XR)/2 
411 FL = F,XP(XL) -4*XL 
.^)(l KM = t:XP(XM) = 4*XM 
60 ir FL'F.VKO THEN 90 
70 XR = XM 

ao (;() TO 100 

90 XR .; XM 
100 PRINT XM 
no NKX'F I 

Are there any practical applications of these techni- 
f[ues (oi- ordinary citizerns? The answer is yes. Sup- 



September/October, 1960. Issue 6 



COMPUTEl 



m 



Hard Working Software for PET/CBM® Mioros 



MATRIC " 

MATRIC expands Commodore BASIC 
with fourteen new commands for hand- 
ling arrays. 

Display a matrix on the screen and 
change its values. Transfer data between 
matrices or fill a matrix i/uith a constant. 
Transpose. Transfer diagonals between 
matrices, or from a matrix to a vector, or 
from a vector to a matrix, or fill a diago- 
nal uvith a constant. Do vector or matrix 
addition, subtraction, multiplication; 
elementwise multiplication, division, 
squares, and square roots. Inversion. 
Determinant. Eigenvalues and eigen- 
vectors of a square, symmetric matrix. 

Algebraic style syntax, checks for con- 
formability, extended error messages, 

The 5K machine language program 
comes on tape or disk witti a 32-page 
manual. Specify size and ROM set of 
your machine. Price: S125. 



PRO-GRESS^ 



This multiple regression program reads 
data from tapes or CBM disk. Concaten- 
ates files. Selects records. Deletes cases 
with missing data. Transforms variables. 
Generates new variables. Allows key- 
board input of means, standard devia- 
tions, correlations. Names variabies. 

Provides means, standard deviations, cor- 
relations; R, R-square, F, degrees of free- 
dom; constant and coefficients, betas. 
Student's t's. Output to screen, or to 
ASCII or CBM printer. 

Analy2es 10 predictors in 8K; 25 in 16K; 
45in33K.Nolimiton number of records. 
Approximate timing: li minute per TOO 
records with one predictor; 30 minutes 
per 100 records with 45 predictors. 

You get two programs and a manual. 
Program I has elaborated instructions, 
requires 16K or 32i<. Program il has 
abbreviated instructions, runs in 8K or 
more. Cassette tape: S45. Disk: S50. 



TEXTCASTir 



A word processor for 8K and larger 
machines, old or new ROMs. All in 
machine language. 

Edit with tapes or disks in any combina- 
tion. Produces ASCII files that can be 
used by other programs. 

Unfinished words at the end of a line 
leap to the next line while you type. 
Powerful screen editor with full contro 
over visible cursor. Repeat action on all 
keys and commands. 

Use printer in typewriter mode. Prints 
files with centering (enhance on PET 
printer), underlining (reverse on PET 
printer), right justification, page num- 
bers at top or bottom. Set left margin 
and line length. Transmits all NEC Spin- 
writer^ characters and commands. 

You get old and new ROM versions of 
the program, and revised manual. On 
tape: $75; on diskette, SSO. 



Order your WorkerWare from: 

COGNITIVE PRODUCTS,® P.O. Box 2592, Chapel Hill, NO 27514 



COMPUTE! 
HAS MOVED 



Our New Telephone Number is 
919 275-9809 

We Are Now Located At 

200 East Bessemer Avenue, 
Greensboro, NC 27401 

Our Mailing Address is Unchanged 
P.O. Box 5406 
Greensboro, NC 27403 



36 



COMPUTEI 



September/October, 1960. Issue 6 



pose you are paying on a loan whose balance is BAL, 
using equal monihly payments called PMT, and you 
have N payments yet to make. What is the 
equivalent simple interest rate, called the APR, ol' 
your loan? The equation relating these quantities is 
BAL = PMT((1 -(1 +I)-N)/I) (9) 



Tabic 5. Results 

XL = 0.3, XR = 

XM 
0.35 

0.375 

0.3625 

0.35625 

0.359375 

0.3578125 

0.3.^)7(13125 

0.3.''>7421875 

0.357226563 

0.357324219 

0.357373047 

0.357397461 

0.3r!74l)966fi 

U.3,'")7403565 

0.357400513 

0.357402039 

0.357402802 

0.357403183 

0.357402993 

0.357402iW7 



of the program in Listing 4, 
0.4 XL = 2.0. XR = 2.2 

XM 

2.1 

2.15 

2.175 

2.1625 

2.15625 

2.153125 

2.1546875 

2,15390625 

2.15351563 

2.15332032 

2.15322266 

2.15327149 

2.15329.590 

2.15328369 

2.15328980 

2,15329285 

2,15329132 

2,15329209 

2.1.5329247 

2.15329228 



Note that in Equation (9), I is the monthly interest 
rate, and it must be multiplied by 1200 to convert it 
to an annual rate rx])rcssed in a percent lorm. In 
any case, I challenge you to solve Equation (9) by 
straightforward, direct techniques. Refer to the 
July/August issue of COMPUTE, for a solution of this 
ec[ua(ion by interval hahing. 

I would like to conclude this article by saying 
that you liave only seen the tip of the iceberg as far 
as numerical analysis is concerned. One of the best 
elementary texts on this subject is Peter A. Stark's 
INTRODUCTION TO NUIVIERICAL 
METHODS, Macmillian, 1970. Note that many 
techniques require a knowledge of calculus. You may 
warn to check your librars' for textbooks on the sub- 
ject. One last plea: if you arc a high school student 
who is planning a career in computer science, please 
gel all of the courses in mathematics that your .school 
oITers, Although you do not ha\e to be a 
mathematical genius to work in the computer iield, 
every tool in the old toolbag will be helpful. 



Appendix A. 

Tlic iiieihod of succes.sive substitutions is guaranteed to 
converge to an an.svvei- if 

lF'('')ljl<I 

v\ln-i'(- .V i.'^ :my luiniht-i" in llvr iiiirrval bftwren the 
first guess and the aii.swer. 



Appendix B. 

Tlif inetliud of interval halving will not wiirk in ilie 
somewhat unusual case of a double root t;i a poKiionisa) 
equation. i"or e.xaniple, ita laetor of a polynotiiial <-(|uaiion 
is 

(x - 1)2 = x2 - 2x + 1 = 0) 

then the solution at .\ = I taiuiol be Inuiul with interval 
liaKiug. 

Appendix C. 

One 1)1 llie most |jo|)ular iterative leetniii|nes is known 

as Newton's method or the Newton-Raphson meihoil. It 

was not mentioiU'd lieie l>e(aiise il requires a kimwledgi- 

of ealenlus. The iterative lonnula is: 

xi + 1 = x; - F(x)7Fl(ii) 

where it is assumetl thai the et|uatioii is iiiitially in the 

form F(x) = 0, 



PET and APPLE II Users 
PASCAL 

ABACUS Software makes available its version of TINY PASCAL for 
the users of two of the most popular personal computers. 

TINY PASCAL is a subset of the standard PASCAL as defined by 
iensen and Wirth. It includes the structured programming 
features: IF-THEN-ELSE. REPEAT-UNTIL, FOR TO'DOWN TO-DO, 
WHILE-DO, CASE-OF-ELSE, FUNC and PROC. Now you can learn the 
language that is slated to become the successor to BASIC. 

TINY PASCAL is a complete package that allows you to create, 
compile and execute progams written in the PASCAL language. 
You can save source and object code on diskette or cassette (PET 
version only). Comprehensive user's manual included. The manual 
can be examined for $10 {refundable with software order). 

REQUIREfvlENTS 

PET 16K/32K New ROf/S cassette $40 

PET 16K/32KNewR0f^Stiiskette $35 

Apple II 32K Applesoft ROM w/DOS $35 

Apple II 48K Applesoft RAIVlw/DOS $35 

TINY PASCAL User's Manual $10 

6502 Interpreter Listing $20 

FREE postage m U.S. and CANADA 
All orders prepaid or COD 



master charge 



V/SA* 




ABACUS SOFTWARE 

P. 0. Box 7211 

Grand Rapids, Michigan 



49510 



Septsmbef /October. 19SO. Issue 6 



COMPUTE! 



37 



An Introduction to Small Business 
Software for the PET*. H. 

Can DR. DALEY's offer a better 
Mailing List Maintenance System? 



You've seen lliciii all! Every soflwarc sup- 
plier offers li mailing lisl system of some 
son or anolhcr. Each of lliem has some ad- 
vaniages and sonii; disadvaniages over the 
oiliers. 

So when DR. DALEY's decided lo offer 
a mailing lisl wc fell ihal il had lo offer 
some olher advantages over all of ihe 
oihers. Wc have offered — and sold 
some — mailing list systems before, but 
these offer few ihitigs that makes them 
imiqiie. 

SKRIOUS BLSINKSS 

When you wish to purchase a software 
system for any business purpose you need 
to give it serious and thorough considera- 
tion. What do you wish to accomplish with 
the software? What are your needs? How 
can a computer assist you in filling these 
needs? We have a.skcd these questions 
numerous limes to people who do mailings 
with lists in the si/c range of 500 lo 15,000 
names. The result was unanimous: every- 
one has different information needs. This, 
of course, means that everyone who buys a 
mailing list system, or any other business 
software, must find a program that comes 
closest to his needs. This is a time consum- 
ing, expensive task. We've talked vviih 
businessmen who have become frustrated 
with this process and are ready to throw in 
the towel. Another option is to hire a pro- 
grammer to write the software for you or to 
write your own. This can cost more than the 
cost of the computer. 

The last option is to find prepackaged 
software which each individual user can 
easily configure to his own needs. This 
would allow each business to custonii/c its 
own computer mainlained mailing list files 
to, as closely as is possible, parallel the cur- 
rent mailing list operation. Until now, this 
option has been virtually impossible to 
fulfill, from any software publisher. 

I.MI'l.KMKNIATlON 

Our coniputeri/ed mailing lisl system is 
designeti to be easy for you. the user, lo be 
able to easily configure your files to contain 
information in much the same way as you 
currently are doing. This means less of ihe 
pain and anguish that frequenlly accom- 
panies computeri/ation. 

During the programming the author was 
in frequent contact wilh potential end 
users. The main thought during the 
development phase was to make the opera- 
tion easy to understand, yet powerful 
enough to handle the job. Ciive the user as 
many options as is feasible, with the flex- 
ibility to make the greatest possible use of 
ihc file information, f'inally, be sure that 



the capacity of the system is sufficient to 
allow most any business to make use of it. 
The final version will allow records of 
117 USABLE characters in length with a 
maximum of 15 fields wilhin each record. It 
also allows reasonably large capacity with 
multiple diskette (maximum of 100 dis- 
kelles on a 32K PET or CBM) files and up 
to 1340 records per diskette. 

WHAT ABOUT .SORTING? 

We hear this question trost frequently 
from you. This is because sorting is the 
operation that divides the MAILING LIST 
system from any mailing lisl system. Why 
sorting? Well it is the way that the user can 
do such things as selective mailings to 
groups with common characlcristics, This 
could include regional mailings, mailings lo 
customers of a particular product, mailings 
to purchasers or to prospective customers, 
etc., e(c. Or you might wish to make any 
possible combination of these categories. 

Try to do this on mosl ordinary mailing 
lisl programs. You simply can't do il wilh 
mosl of ihe offerings on the market today. 

Thi.s sorting is done by a "wild card" 
type of sort. This means that you can 
specify the contents of any poriion of a 
field for a match and the computer will take 
any match for the rest of Ihe field. This type 
of son is best illustrated wiih the following 
examples; 

A son key can be; "R^l 
Matches with l-ORT#l 
and T4R32I 
and <'/(i/R@31 
Our system allows this type of sorting using 
up to three fields wilhin each record. Thus 
you should be able to retrieve almost any 
conceivable subset of the files. 

File organization is done using two of the 
fields as sort keys. This again is user select- 
able. You could, for example, specify that 
you wish the file to be in ZIP CODE se- 
quence or in alphabetical sequence and ail 
records within the file will be sequenced 
with I hat field. There is also a second sort 
field which is used to sequence the file 
where the first field is the same. 

WHAT ABOUT LABELS? 

We hear this one almost as often as the 



Charge to 

your 

MC/VISA 




master charge 



sorting. Well, here this is up to you. You 
can, at the lime you print labels, choose the 
layout of the labels, you can also choose the 
number of labels per line. If you wish to 
have a four line address and printed four 
records wide you can do it. 

WHAT ABOUT KUITING? 

Editing is accomplished at several points 
in the program. These are at the lime of en- 
try, before saving the records to the file and 
from the disk file. You can easily modify 
any record at any of these points. 

This does not really cover all of the 
operations on the files. Space simply does 
not allow a more complete description of 
the user oriented approach of the program. 

Wc asked the question: Can we offer a 
better mailing list system? You bet we can! 
It's here now. 

HARDWARK RKQUIREMENTS 

At present this requires a Commodore 
PET or CBM computer with a dual disk 
drive and a printer. It is set up to work with 
the Commodore printer or with most any 
other printer. Watch for these programs to 
be introduced for use with other types of 
popular microcomputers. The APPLE II 
version will be available about June I, 1980. 
Watch for it! 

ORDERING 

,\\ ihe present lime many Commodore 
dealers do not carry our software. Thus you 
will most likely need to either persuade 
them to order for you or calling us directly 
at (616) 471-5514 anytime between noon 
and 9 p.m. Eastern time Sunday through 
Thursday. For only S99.95 plus four per- 
cent tax in the slate of Michigan, you get 
this powerful, field tested, fully docu- 
mented program packaged in a convenient 
three-ringed binder. 

INVENTORY 

We must add this note. There is too litilc 
space to allow us to describe Ihc INVEN- 
TORY system adequately here. 1 1 offers ihc 
same flexibility as docs tlie MAILING LIST 
described above, but we can't tell you much 
more. Write or call for details. It also is 
priced at S99.95. 




DR. DALEY'S Software 

425 Grove Ave., Berrien Sprinj;.s, Ml 49103 

Phone (6t6) 471-5514 
Sun.-Thurs. noon to 9 p.m.. Eastern Time 



►Watch for it on the APPLE II. 




Train Your PET® 

-thMICRO-ED 

instructional tapes 



All programs 
work with anv 
8K PET, old or 
new. PET is 
the registered 
trademark for 
Commodore 
Business 
Machines, 
Santa Clara, 
CA. 



MICRO-ED has educational software for the PET 
microcomputer. We specialize in programs with 
these features: 




•They have been written by profes- 
sional educators. Our main author is 
Thoruald Esbensen, named in 1980 as 
one of North America's top school ex- 
ecutives by Executive Educator 
magazine, 

•Our tapes are independent 
modules, each one a complete 
lesson in itself. 



•Every instructional lesson ends with a sum- 
mary of student performance. 

•Our programs are attractive and motivating to 
students. 

•We will gladly replace any tape that fails to load 
or run properly. 



Unless otherwise specified, each tape can be 
purchased for *7.95 



MUSIC (these tapes use sound) 

•MU-l Lines and Spaces of the Treble 
Clef 
(elementary) 

Hiyher. Same, Lower 
(elementarv> 



>MU-2 
•MU-3 



Matching Rhytlims 
(elementary) 



REFERENCE SKILLS 

•RS-l Dictionary Guide Words 
(elementary) 

•RS-2 Library Terms 
(elementary) 

•RS-3 Making an Outline 
(elementary) 

•RS-4 Putting Fiction Books in 
Alphabetical Order 
(elemeniary) 



VOCABULARY 

VO-l Synonym Series 

(high school and adult) 

3 tapes S21.00 

VO-2 Vocabulary Series 

(upper elemeniary and high 

school) 

24 tapes S168.0D 

VO-3 Antonym Machine 

(elementary) 
VO-4 Homonym Machine 

(t'lenientarv) 



You may wish to order tapes by the MICRODOZEN. Any twelve S7.95 tapes can be 

purchased for $84.00. 



Also from 



MATHEMATICS 

•MA-l Malh Bid (elementary) 

•MA-2 Count 'I'm (kinderyarten and first 
grade) 

•MA-3 Slory Problems in Addition and 
Subtraction 

{elementary) 

•MA-4 What Number is Missing? 

(kindergarten and first grade) 

•MA-5 Target Math 

(elementary) 

• MA-6 Adding with Objects 
(primary grades) 

•MA-7 Subtracting with Objects 
(primary grades) 

•MA-8 Working with Basic Addition 
Facts 
(primary grades) 



SPELLING 

•SP-l Guess That Word 

(elementary and up) 
•SP-2 Level A 

(second grade) 

7 tapes ~ S49.95 

•SP-3 Level B 

(third grade) 

7 tapes S49.95 

•SP-4 Level C 

(fourth grade) 

7 tapes S49.95 

•SP-5 Level D 

(fifth grade) 

7 tapes S49.95 

•SP-6 Level F. 

(sixth grade) 

7 tapes S49.95 

• SP-7 Compound Words 

(eleiTienlary) 

• SP-8 Hard and Soft C 

(elementary) 

•SP-9 Hard and Soft G 

(elementary) 

•SP-IO Dropping the Final E 

(elementary) 

PUNCTUATION 

•PlJ-l Run-on Sentences 

(elementary) 
•PU-2 The Apostrophe 

(elementary and up) 
•PU-3 End Punctuation 

(elementary) 



USAGE 

•US-l Usage Boners 

(elemenlarv and up) 

15 tapes. S99.00 




•MA-9 Working with Basic 

Multiplication Facts 

(elementary) 
•MA- 10 Adding or Subtracting Two- 

and Three-place Numbers in 

Colimins 

(elementary) 
•MA-11 Math Shootout 

(elementary) 
•MA-12 Bar Graph (elementary) 

•MA-13 Which Number Comes Next? 
(uses a 3G Light Pen) 
(first grade) 



WORD DEMONS 

•WD-l To/Too.Two 
(elementary) 

•WD-2 There/Their/They're 

(elementary) 
•WD-3 Its/It's -Your/You're 

(elementary) 
•WD-4 Sit Set 

(elementary) 
•WD-5 Lay, Lie 

(elementary) 



GRAMMAR 

•GR-l Agreement of Subject and Verb 

(elementary and up) 
•GR-2 The Noun 

(elementary and up) 
•GR-3 The Verb 

(elementary and up) 

•GR-4 The Adverb 

(elementary and up) 
•GR-5 The Adjective 

(elementary and up) 



OTHER 

•OT-l Trail West 

(elementary through adult) 
•OT-2 Direction and Distance 

(primary grades) 
•OT-3 Haiku 

(elementary and up) 
•OT-4 Pet Counselor 

(adult) 



MICRO-ED 



•MA- 14 Locomotive 

(uses a 3G Light Pen) 
(kindergarten and first grade) 

• MA-15 Math symbols: Greater Than, Less 
Than 
(elementary) 

•MA- 1 6 Math symbols: Greater Than, Less 
Than 

(uses a 3G Light Pen) 
(elementary) 

•MA-17 Addition with Carry 
(by Don Ross) 
(elementary) 
$20.00 

•MA-18 123 Digit Multiplication 

(by Don Ross) 

(elementary) 

S20.00 

•MA-19 Long Division 
(by Don Ross) 
(elementary) 
S20.00 



READING 

• RE-l Tachistoscope 

(elementary) 
•RF:-2 Reading Racer One 

(elementary) 
•RE-3 Matching Capital Letters 

(pre-school and kindergarten) 
•RE-4 Matching Capital Letters 

(uses a 3G Light Pen) 

(pre-school and kindergarten) 
•RE-5 Which Letter Comes Next? 

(primary grades) 
•RE-6 Which Letter Comes Next? 

(uses a 3G Light Pen) 

(primary grades) 
•RE-7 Matching Words 

(kindergarten and first grade) 
•RE-8 Matching Words 

(uses a 3G Light Pen) 

(kindergarten and first grade) 
•RE-9 Identifying Complete 

Sentences 

(elementary) 
•RE-10 Make a Sentence 

(uses sound) 

(first grade) 



•OT-5 Clock 

(primary grades) 
•OT-6 U.S. Time Zones 

(elementary and up) 
•OT-7 Stales and Capitals 

(elementary and up) 
•OT-8 Answer Box 

(teacher in-service) 
•OT-9 Hat in the Ring 

(A Presidential Election Game) 

(elementary and up) $9.95 



Send for free catalogue: 

MICRO-ED, Inc. • P.O. Box 24156 • Minneapolis, MN 55424 



40 



COMPUTE! 



September/October, 1980. Issue 6 



Computers 

CinCI I n© Susan Semancik 

Handicapped 



Updates to Issue #5's 
Computers And The Handicapped 
Column: 

Programs 2 and 3, written for the use of the 
Prestodigitizer Board with the handicapped, have 
been updated so that they will both run on either 
Old or New ROM PET Computers, In addition, 
they have both been expanded to allow punctuation 
to be entered, to allow the user to stop the programs 
without turning the computer off, to allow a space to 
be entered in order to separate letters or words in the 
messages appearing on the PET's screen, to allow in- 
dividual letters to be deleted, and to allow the clear- 
ing of the entire screen - all from codes entered from 
the Prestodigitizer Board! 

The last four modifications each required 
specialized codes to be developed in both Braille and 
Morse Code. Since program 3 uses only Level I 
Braille capital letters and punctuation, the four 
necessary codes were taken from Level II Braille and 
should pose no contradictions in this usage. They are 
illustrated below: 



STOP 



SPACE DELETE CLEAR 



The changes to program 3 are described below: 
The directions in Lines 1-8 reflect the above 
mentioned changes. 

1 REM ••• PROGRAM 3 - DIGITIZER BRAILLE •*• 

2 REM 

3 REM WILL ACCEPT LETTERS, COMMA, PERIOD, 
AND QUESTION MARK. 

4 REM USE REGIONS 1-6 FOR THE BRAILLE CELL 
INPUTS; REGION 7 TO END AN INPUT 

5 REM FOR A SPACE, USE DOT 6 

6 REM TO DELETE A CHARACTER, USE DOT 4 

7 REM TO CLEAR THE SCREEN, USE 4 & 5 

8 REM TO STOP THE PROGRAM, USE 4,5, & 6 

Lines 9, 300, and 310 arc necessary to determine 
the proper zero page locations for either an Old or 
New ROM PET. 

9 P = PEEK(50003):Q = P' I60:L = 200'P + 6 

300 POKEQ,161;POKEQ+ l,3:POKEL,221:POKEL + 1,3 
310 POKE863.L:POKE909,Q 

Line 80 enters the end of the assembly language 
program into memory, storing the ASCII value in 
memory location 922 just before the character is 
printed. 



80 DATA192, 0,16,3, 76, 63, 3, 177,0, 141, 154, 3,32, 210,255, 

96,-1 

The disassembled listing would then be changed as 

follows: 

910: STA 922 
JSR 65490 
RTS 

By returning to the BASIC program after printing, 
line 410 will check to see if location 922 contains a 
96, which will end the program. Since 96 repre- 
sents a shifted space, this will not affect the appearance 
of what has been printed on the screen. 

400 PRINT"" 

410 SYS(826):IFPEEK(922)7,<96THEN410 

420 END 

Lines 130 and 140 contain the ASCII of space, 

delete, clear, and shifted space in the appropriate 

locations. 

130 DATA0,65, 20,67.44, 66, 73, 70,0, 69, 147, 68,0,72, 74, 71, 

0,75,0,77,76,83,80,0 

140 DATA79. 0,78, 0,82, 84, 8 1.32.0. 0,0. 0,0, 0,0.0, 0,96, 0,46, 

0,87,0,0,85,0,88,63,86 

The four new necessary Morse codes were taken 
from specialized vowels that would not ordinarily 
be used in this type of communication program. 
They are listed as follows: 
STOP SPACE DELETE CLEAR 

The changes to program 2 are described below: 

The directions in Lines 1-8 reflect the above mentioned 

changes. 

1 REM ••• PROGRAM 2 - DIGITIZER MORSE **• 

2 REM 

3 REM WILL ACCEPT LETTERS, COMMA. PERIOD, 
AND QUESTION MARK, 

4 REM USE REGION 1 TO INPUT A DOT; REGION 2 
FOR A DASH, REGION 7 TO END INPUT 

5 REM FOR A SPACE, USE .... 

6 REM TO DELETE A CHARACTER, USE ..- 

7 REM TO CLEAR THE SCREEN, USE .-.- 

8 REM TO STOP THE PROGRAM, USE -. 

Lines 9 and 130 are necessary to determine the proper 
zero page locations for either an Old or New ROM 
PET. 

9 P = PEEK(50003):Q = P* 160 

130 POKE5254,4:POKE5255,5:POKEQ,I36:POKEQ+ 1,19: 
POKE917,Q:POKE937,Q 

Lines 60-80 enter the end of the assembly language 
program into memory, with the look-up table pointing 
to the character with the lowest ASCII value used, 
which is 20 for the Delete key. 

60 DATA76, 76, 3, 169, 20, 141, 216,3, 160,0, 174, 215.3, 177 ,0, 

205,215,3,240,12,200,200 

70 DATA238,216,3,192,0,240.17,76,145,3,200.177,0,205, 

213,3.208,237 

80 DATA173, 216,3, 32, 210, 255, 96,-1 

This changes the disassembled listing: 
906: LDA# 20 

Since location 984 is keeping track of the ASCII 
value of the character pointed to in the table, it 



September/October. 1980. Issue 6 



COMPUTf) 



m 



needs to be increased everytime the pointer moves up 

in the table. Also, adding more table values affects 
the table limit to be checked. 

925: INC 984 
CPY#0 
BEQ + 17 

Since the ASCII values have kept up with the pointer, 
adding is no longer needed. The ASCII value of the 
character is placed in the accumulator for printing. 

943: LDA 984 
JSR 65490 
RTS 

By returning to the BASIC program after printing, 
Line 140 will check to see if location 984 contains 
a 96, which will end the program. Since 96 
represents a shifted space, the appearance of the screen 
has not been affected. 

135 PRINT" "; 

140 SYS(826): IFPEEK(984)7«96THEN 140 

150 END 

Lines 110 and Vl'i insure all the unused table 
values will be set to zero. 

110 READOP:lFOP = -ITHEN123 

123 FORI =5000TO5255:POKEI,0;NEXTI 

Lines 125 and 126 set the alphabetic characters in 

the proper place in this expanded table. 

125 I =5090 

126 READOPiIFOP = -1THEN128 

Lines 128-130 set the punctuation characters 
and the four special characters in the proper table 
locations. 

128 POKE5000,4:POKE5001,3:POKE5024,5:POKE5025,4: 
POKE5048,6:POKE5049,51 

129 POKE5052,6:POKE5053,21:POKE5086,6:POKE5087, 
12:POKE5152,4:POKE5153,14 

These programs were also tried out at the Marine 
Science Center's Communication's Workshop for the 
handicapped. The blind students in particular were 
excited about the digitizer pad and were able lo com- 
municate to the deaf through messages entered on 
the PET's screen. Using these programs in conjunc- 
tion with some other equipment we've been ex- 
perimenting with gave us some fascinating results 
that we hope to be able to share with vou in the next 
issue of COMPUTE! ' tf=* 



The Delmarva Computer Club 

P.O. Box 36 

Wallops Island, VA 23337 



PET ■ APPLE - KIM - TRS - 80 
Computer Interfacing 



PET • Bidirectional Serial and Parallel inleriace. (SADI) $295.00 

Microprocessor based. Talk to another computer and a printer al the same time- 
Transfer programs between PETs. 32 character buffer. RS 232 in and out- Cen- 

Ironies compatible. Much more. Packed with leatures- 
PET ■ RS232 .^ddre5Sable Prmler interface (ADA 1400) 5179.00 

Complete with cables, case and power supply- Cassette with programs included. 
PET ■ Cetilronics or NEC 5530P SPINWRITER (ADA 1600| 5 129,00 

Complete with case, cables and connectors. Three position switch for up 

per/lower case, reverse case and upper case only. Works with WORDPRO and 

BASIC. 
PET Word Processor. On tape - 539.50. On disk ■ 49.50 

Compose and print letters, flyers, ads. n^anuscripts. etc. (Jses disk or tape. 30 

page manual included. 
Analog to Dicital Conversion Systems 

16 inputs ■ a bits to 5 volts - SO usc-cond conversion lime. Read temperature. 

light leveis. voltages, etc. Cabling, power supplies, sohware included. 
PET. APPLE. TRS-aO $295.00 

KIM. AIM65, SVM 5285.00 

Clock. Calendar. Bemole Conlrolier (Super XIO) for your computer. $295.00 

Transmits to ail the BSR X 10 remote control modules (up to 255 devices). 

Stores sequences ol control commands that can be initiated by lime or an ex. 

ternal even such as a switch closure. Maintains a month, date, day of week, and 

year calendar. Slays on when your computet is off. Complete with cable and 

connectors. PET, APPLE. TRS-80 (specify). 
RS-232 lo current loop adopter (ADA 400). S29.50 

Two circuits - I each direction. Run an RS232 device off a computer's lelelype 

port or vice versa. Optoisolated. 
All ou; products arc assembled and tested with a 30 day money back guarantee. 120 
day limited warranty, VISA, Mastercard or check. Add $3,00 S&H. Foreign orders add 
10%. Mention this magazine and deduct 3%. 



Gonnecticut 
microcomputer, Inc. 

34 Del Mar Drive, BrookfieltJ. CT 06804 
203 775-4595 TWX: 710 456-0052 




DISK DRIVE WOES? PRINTER INTERACTION? 

MEMORY LOSS? ERRATIC OPERATION? 

DON'T BLAME THE SOFTWARE! 




ISO-1 




ISO 2 



Power Line Spikes. Surges & Hash could be the ciilprit! 
Floppies, printers, memorv & processor often interact' 
Our unique ISOLATORS eiiminate equipment interaction 
AND curb damaging Power Line Spikes, Surges and Hash. 
•ISOLATOR USD 1A) 3 filter isolated S-prong sockets; 
integral Surge/Spike Suppression; 1875 W Maximum load, 

1 KW load any socket $56.95 

'ISOLATOR (ISO-21 2 filter isolated 3-pronB socket banks; 

{6 sockets total); JntB^ai Spike/Surge Suppression; 

1875 W Max load, 1 KW either bank $56.95 

•SUPER ISOLATOR (ISa3). similar to ISO TA 

except double fillering & Suppression .... S85.95 
•ISOLATOR IISO-41, similar to ISO 1 A except 

unit has 6 individuallv filtered sockets .... $96.95 
•ISOLATOR (ISO-51, similar to (SO 2 except 

unit has 3 socket hanks. 9 sockets total . . . $79.95 
•CIRCUIT BREAKER, any model (addCB) Add S 7.00 
•CKT BRKR/SWITCH/PILOTany model 

(-CBS) Add $14.00 

PHONE ORDERS 1-617-655-1532 ""g" 

^S^ Electronic Specialists, Inc. ^^ 



171 South Main Sireel. Natick. Mass. 01760 



Dept. C 



42 



COMPUTEI 



September/October, 1980. Issue 6 



Let Your Pet Play Politics with 

HAT IN THE RING 

A Presidential Election Game 



Thorwald Esbensen 

Here is a timely social studies game that readers of 
COMPUTE have permission to copy for their own 
personal use. The proi^ram will run on any 8K PET, 
old or new. 

HAT IN THE RING is a two-player exercise 
designed to acquaint students with some of the 
political considerations involved in running a 
presidential campaign. Each player assumes the role 
of a presidential candidate - one for the Republicans, 
the other for the Democrats. Throughout the exer- 
cise, each candidate makes decisions intended to 
result in a successful campaign. 

At the outset, each candidate has 9 units of 
priority resources that can be assigned as needed in 
order to bolster the campaign in any of the states. 
The overall campaign ends after each candidate has 
made, in alternating turns, 10 decisions. 

Within each state, the outcome of the campaign 
hinges upon four factors: 

- Media Exposure 

- Personal Campaigning 

- Domestic Issues 

- International Issues 

Although the weight of these four factors is randomly 
determined by the computer, the probabilities are 
that Media Exposure and Domestic Issues will prove 
to be substantially more powerful in their impact 
than will the factors of Personal Campaigning and 
International Issues. The political situation in each 
state keeps changing as the game progresses. 

As the campaign begins, the computer randomly 
chooses the candidate who will have the first turn. 
The computer may be commanded to do one of six 
things: 

1. Raise funds (increase resources). 

2. List the states in which the Republican can- 
didate leads. 

3. List the states in which the Democratic candi- 
date leads. 

4. List the current probable electoral count for 
each candidate. 

5. List each candidate's remaining resources. 

6. Get ready to display the political situaiton in 
state. 

The 9 resource units that each candidate has at the 
beginning of the game are the maximum allowed. So 



there is no point in asking the computer to raise 
more funds (resources) until some of these units have 
been used up. However, when the computer does try 
to raise funds, it will yield a result of from to 3 ad- 
ditional resource units. 

Let us say that the candidate chooses Command 
Number 6. The computer now asks the candidate for 
the name of a state, and then displays the political 
situation in that state. The number immediately 
following the name of a state represents the number 
of electoral votes that the state can cast for a 
presidential candidate. The candidate with the 
highest total of political points in a state (the combin- 
ed points for Media Exposure, Personal Campaign- 
ing, Domestic Issues, and International Issues) will 
win all of that state's electoral votes at the end of the 
game. 

The candidate can affect the political situation in 
any state by committing some resource units to that 
state. When resources are committed, they have a 
multiplier effect on the category to which they are 
committed. For example, if the strength of Media 
Exposure is a given state is 15, and if 3 resource 
units are then committed to that category in this 
state, the new Media Exposure strengtii in the state 
bectjmes 15 x 3, or 45. If a candidate commits more 
resources than the candidate has, this blunder 
automatically results in the election of the opponent. 

The fifty states, plus the District of Columbia 
(abbreviated D.C.), have 538 electoral votes in all. 
At the end of the game, the candidate with a majori- 
ty of these electoral votes (270 or more) wins the 
game. 

Readers who do not wish to spend their time co- 
pying the following program listing may spend $9.95 
for a copy of the program tape itself from MICRO- 
Ed, Inc., P.O.Box 24156, Minneapolis, Minnesota, 
55424, 

9 POKE59468,12 

10 PRINT"[^+'>^l^^^»»»»»»»^T►COPYRIGHT 1980": 

-nPRIKT"^t»»»»»»>rMICRO-EDf , IMC. " 

12 PRINT"^^»»»»»»»>»P.O, BOX 24156" 

13 PRIKT"^»»»>»»»HIMNEAPOLIS, t-lINNESOTA -. 

^55424" 
30 NM=INT(RND{TI) *2) +1 : IFNM=1THENK1$="REPU 

-iBLICAM" :N2S= "DEMOCRATIC" 
40 IFNM=2THENN15="DEM0CRATIC" : N2 ?= "REPOBLI 

nCAN" 
60 SP$=" -1 

II 

— I 

80 DIMST$(52) ,EL%(51) ,P%(51) ,PP%(51) , 
-M%(51) ,HH%(51) ,D%(51) ,DD%(51) 



September/October, 1980. Issue 6 



COMPUTEI 



4S 



85 DIMT%(S1) ,TT%(51) ,I%(51) ,II%(51) :R=9: 

-.RR=9 :FORZ = 1TO2000 : NEXTZ :TU = 1 
100 PRINT"a^J'iJ't" 

102 pRiNT"x:>^^**************************** 

103 print"j:»»»* o#p -, 

-. 0#P * 

104 PRINT"r»»* $L$: $ - HAT IN THE RING -. 

-.- $L$:$ * 

105 PRINT"r>»* 

* 

106 PRINT"r»»>* A PRESIDENTIAL ELECTION ^ 

-.GAME * 

107 PRINT"i»>»* 

* 
10 6 pRiMT"r^^^ *********** ***************** 

110 PRINT"i:ti»»>READ PRINTED INSTRUCTIONS - 

-.FIRST. " 
120 GOSUB19000 
130 F0RZ=1T051:READSTS(Z) , EL% (Z) : NEXTZ : 

-.READM$,P$,D$,IS 
150 PRINT"fir'ttiii»»»PREPARING POLITICAL -, 

-.SITUATION" 
200 F0RZ=1T051:M%=INT(RND{TI) *10)+1 
207 M%(Z)=M%(Z)+M% 
210 P% = INT(RND(TI) *5)-l-l 
212 P%{Z)=P%(Z)+P% 
220 D%=INT(RND(TI)*10)+1 
222 D%(Z)=D%{Z)+D% 
225 I%=INTCRND{TI) *5)+l 
227 I%(Z)=I%(Z)+I% 
235 MM%=1NT{RND(TI) *10)+1 
237 MM%{Z)=MM% (Z)+MM% 
240 PP%=INT(RND(TI) *5)+l 
242 PP%(Z)=PP%(Z)+PP% 
245 DD%=INT(RND(TI) *10}+1 
247 DD% (Z)=DD%{Z)+DD% 
250 II%=INT(RND[TI)*5)+1 
252 II%(Z)=II%(Z)+II% 
26 T% (Z)=M%{Z)+P% (Z)+D%{Z)+I% (Z) 
26 5 TT% (Z)=HH% (Z)+PP% {Z)+DD% (Z)+II% (Z) : 

^NEXTZ 
280 K=0:T1=0:T2=0 

285 IFY1+Y2=20THENTU=10:GOTO4000 
290 IFC=2THENC=0 

300 C=C+l:IFC=lTHENPRINT"fij:";Nl$:Yl=Yl+l 
310 IFC=2THENPRINT"fii:";N2$:Y2=Y2+l 
315 TN=TN+1: IFTN=3THENTU=TU+1 :TN=1 
320 PRINT"iCANDIDATE'S TURN NO.";TU: 

-.PRINT"i: (CHOOSE NUMBER BELOW)" 
325 PRINT " EEEEEEEEEEEEEEEEEEEEEEEEEEE ": 

-iPRINT"xlr RAISE FUNDS (INCREASE -. 

-.RESOURCES) " 
335 PRlNT"\^x2r LIST THE STATES IN WHICH -. 

-.THE" : PRINT "li-^", • Nl S; " CANDIDATE -. 

-.LEADS. " 
340 PRINT"\^r3f LIST THE STATES IN WHICH -. 

-.THE":PRINT"i^»»";N2$; " CANDIDATE -. 

-.LEADS. " 
345 PRINT"tj:4c LIST CURRENT ELECTORAL -. 

^COUNT FOR":PRINT"i»»EACH CANDIDATE," 
350 PRINT"^j:Sf LIST CANDIDATES' REMAINING ^ 

-.RESOURCES. " 
355 PRINT"'^r6r GET READY TO DISPLAY -. 

-.SITUATION" :PRINT"^>»FOR A CERTAIN -. 

-.STATE. " 
357 GETGS; IFGS<>""THEN357 
360 GETG5: IFVAL(G$) <iORVAL{G5) >6THEN360 
365 IFG$="1"THEN1000 
370 IFG$="2"THEN2000 
375 IFG?="3"THEN3000 
380 IFG5="4"THEN4000 
385 IFG$="5"THEN5000 
390 IFGS="6"THEN6000 



You can count on 

Pet Professor 

to help Increase 
teaching effectiveness 




It reteaches the 4 basic arith- 
metic operations step-by-step. 

PET PROFESSOR includes 7 1 programs that 
reteach the four fundamental arithmetic opera- 
tions for wfioie nunjbers, fractions and decimals 
by providing more tfian just practice drills. Each 
program includes a complete tutorial sequence 
that takes a problem apart, then leads the student 
step-by-step through solving it. 

Each program covers a single objective to 
allovi' the teacher to select the skill to be rein- 
forced. It states the objective, supplies vocabulary, 
displays an example, then leads the student step- 
by-step through other examples. When the 
student is ready, a quiz requiring writing is given, 
then scored by the computer. Every program has 
been carefully selected. All problems were written 
by teachers and tested in classrooms. 

Use PET PROFESSOR to supplement class- 
room instruction in individualized or traditional 
programs. Available for PET 200 ! Series. Will 
run within 8K on any PET. 

■ Whole numbers — 26 programs @ S 1 90.00 

■ Fractions — 24 programs @ $ 140.00 

■ Decimals — 2 1 programs @ $ 1 25.00 

Buy all 3 for S399. 00. Save $56.00! 

Send S5.00 for more inlo. scimplu tcific & shipping 
(deducted Irom total purchase). 

List of otfier educationdl programs available on request. 

Melad Associates, Inc. 

P.O. Box 159.MilltQwn. H.J. 08850 • (201)828-3682 



44 



COMPUTEJ 



September /October, 1980. Issue 6 



1000 PRINT "fi":NR= INT (RND{TI) *4) 

1017 IFC=1THENR1=R:R=R+NR 

1020 IFC=2THENR2=RR;RR=RR+NR 

1030 IFR>9THENR=9:NR=R-R1 

1035 IFRR>9THENRR=9:NR=RR-R2 

1040 PRINT"i:Tt^^^kiINCREASE IN YOUR RESOURCE - 

-.UNITS: r";NR 
1060 GOSUB19000:GOTO150 
2000 PRINT "fi", • Nl ?; " CANDIDATE LEADS:t": 

-.F0RZ = 1T051 
2020 IFT%(Z) >TT%(Z)THENPRINT"£";ST$(Z) ;EL% 

-.(Z) :CT=CT+1 
2030 IFCT=20THENGOSUB19000:CT=0:PRINT"fi" 
2040 NEXTZ 

2050 CT=0:GOSUB19000:GOTO150 
3000 PRINT"fi";N25;" CANDIDATE LEADS:t": 

-iF0RZ = lT051 
3020 IFT%(Z) <TT%{Z)THENPRINT"i";ST?(Z) ; EL% 

-.(Z) :CT=CT+1 
3030 IFCT=20THENGOSUB19000:CT=0:PRINT"fi" 
3040 NEXTZ 

3050 CT=0:GOSUB19000:GOTO150 
4000 PRINT"fi":F0RZ=lT051 
4020 IFT%(Z) >TT% (Z)THENT1=T1+EL% (Z) 
4025 IFT%(Z) <TT%(Z)THENT2=T2+EL% (Z) 
4030 NEXTZ 

4032 IFY1+Y2O20THEN4040 
4035 IFTU=10ANDTl>T2THENPRINT"Fi'i'^^i:";Nl$,- "> 

-.CANDIDATE WINS !! " : END 
4037 IFTU=10ANDTl<T2THENPRINT"RtT^r";N2$;"> 

-.CANDIDATE WINS!!":END 
4040 PRINT"rT^";Nl$:PRINT"tCURRENT -. 

-^ELECTORAL COUNT :"; Tl 
4050 PRINT"i.iJ'i^'|";N2$:PRINT"+CURRENT -. 

-^ELECTORAL COUNT : " ; T2 
4060 PRINT"^^" :GOSUB19000 :GOTO150 
5000 PRINT"fi^)■";Nl$;" RESOURCES: "; R: 

-iPRINT"^^";N2$; " RESOURCES: " ; RR 
5010 PRINT"^^":GOSUB19000;GOTO150 
6000 PRINT"fiWHICH STATE DO YOU WANT"; 
6020 INPUT"»1««<";ST$ 
6030 IFST$="2"THEN6000 
6040 K=K+1 

6050 IFST$(K)=ST$THEN6070 
6060 IFK>51THENK=0:PRINT"'^^NO SUCH STATE. - 

-.TRY AGAIN. l^^^":GOTO6020 
6065 GOTO6040 
6070 PRINT"fi" 
60 80 PRINT"t";Nl$ 
6085 PRINT"^^SITUATION IN" 
6090 PRINT"i:^^";ST$;EL%(K) 
6100 PRINT " EEEEEEEEEEEEEEEEE 
6110 PRINTM?;M% (K) : PRINT"'^ " ; P$; P% (K) : 

-PRINT"^";D5;D%{K) :PRINT"i" ; 1$; 1% ( K) 
6120 TP$="iT^Tj'TOTAL POINTS " 
6125 PRINTTP$;"f ";T%{K) 
6170 PRINT"ii":PRINTTAB(20) ;"r";N2$: 

-.PRINTTAB(20) ;"^^SITUATION IN": 

-.PRINTTAB(20) ; 
6190 PRINT"j:^^";ST$;EL%(K) 
6195 PRINTTAB(20) ; 
6200 PRINT "EEEEEEEEEEEEEEEEE 
6205 PRINTTAB(20) ;MS;MM%(K) 
6210 PRINTTAB(20) ; "^" ; P5; PP% (K) 
6220 PRINTTAB(20) ; "^" ;Q$;DD% {K) 
6230 PRINTTAB{20} ; "^k" ; 1$; 11% (K) 
6232 PRINTTAB{20} f 
623 5 PRINTTP$;"f ";TT%(K) 

6300 pL$="llt^^^^■^^'^'J'^^i^^+^^^^H+++" 

6305 PRINTPL$ 

6310 PRINT "WILL YOU COMMIT RESOURCES? -. 

-.(rYf OR xNf ) " 
6320 GETG$: IFG$<>"Y"ANDG$<>"N"THEN6320 



6330 
6335 
6350 

6360 

6365 
6370 

6380 
6400 
6410 
6420 
6430 
6450 
6500 
6510 
6520 
6530 
6550 
6700 
6710 
6720 
6730 
6750 
7000 

7010 

7020 
7030 
7050 

7060 
7070 
7080 

7090 

7100 



7110 

7120 
7130 
7140 
7150 
7160 
7170 
7180 
7190 

7200 

7205 



IFG$="N"THEN150 

PRINTPL$:PRINTSPS 

PRINTPL$:PRINT"TO WHICH CATEGORY? -. 

-i(i:M»P»D>fOR jilr) " 
GETCS: IFC?<>"M"ANDC5<>"P"ANDC?<>"D"AN 

-.DC$<>"I"THEN6360 
PRINTPLS:PRINTSP$ 
PRINTPL$:PRINT"HOW MANY? (rlf TO -i 

-rS f ) " 
GETRS: IFVAL(R$) <1THEN6380 
IFC=1THENR=R-VAL{R$) 
IFR<0THEN8000 
IFC=2THENRR=RR-VAL (R$) 
IFRR<0THEN8500 
IFC=2THEN6700 

IFC$="M"THENM%{K)=M% (K) *VAL(R$) 
IFC$="P"THENP%{K)=PI (K) *VAL{R5) 
IFC$="D"THEND%(K)=D%{K) *VAL{R$) 
IFC$="I"THENI% (K)=I%{K) *VAL(R$) 
GOTO15 

IFC$="M"THENMM% (K)=MM%{K) *VAL{R$) 
IFC$="P"THENPP% (K)=PP%(K) *VAL{R$) 
IFC$="D"THENDD% (K)=DD%(K) *VAL{R$) 
IFC5="I"THENII% (K)=II% (K) *VAL{R$) 
GOTO150 
DATA ALABAMA, 9 , ALASKA, 3 .ARIZONA, 6 , 

-.ARKANSAS, 6 
DATA CALIFORNIA, 45, COLORADO, 7, 

-.CONNECTICUT, 8 
DATA DELAWARE, 3, D.C. ,3 
DATA FLOR IDA , 1 7 , G EORG I A , 1 2 , HAWAI 1 , 4 
DATA IDAHO, 4 , ILLINOIS , 26 , INDIANA, 13 , 

-n IOWA, 8 
DATA KANSAS, 7, KENTUCKY, 9 
DATA LOUISIANA, 10 
DATA MAINE , 4 , MARYLAND, 10 , MASSACHUSETT 

-.3,14, MICHIGAN, 21, MINNESOTA, 10 
DATA MISSOURI, 12, MISSISSIPPI, 7, 

-.MONTANA, 4 
DATA NEBRASKA, 5, NEVADA, 3, NEW -. 

-.HAMPSHIRE, 4, NEW JERSEY, 17 , NEW -. 

-nMEXIC0,4 
DATA NEW YORK, 41, NORTH CAROLINA, 13, 

-.NORTH DAKOTA, 3 
DATA OHIO, 25, OKLAHOMA, 8, OREGON, 6 
DATA PENNSYLVANIA, 27 
DATA RHODE ISLAND, 4 

DATA SOUTH CAROLINA, 8 , SOUTH DAKOTA, 4 
DATA TENNESSEE, 10, TEXAS, 26 
DATA UTAH, 4 

DATA VIRGINIA, 12, VERMONT, 3 
DATA WASHINGTON, 9, WEST VIRGINIA, 6, 

-.WISCONSIN, 11, WYOMING, 3 
DATA "i.McEDIAi^<4<-«-^EXP0SURE " , 

-."rPf ERSONAL^^^^^-^^^^CAMPAIGNING . . " 
DATA "x.Df OMESTIC'^<<<-^<«<ISSUES 



7210 DATA "rlfNTERNATIONAL^<<<<-^<-^<-f-^««IS 

-.SUES " 

8000 PRINT '■fij:^/'^^h»>»SORRY. YOU HAVE -. 

^OVER-COMMITTED YOUR" 
8010 PRINT"j:^RESOURCES. THE ";N2$;" -, 

^CANDIDATE WINS" 
8020 PRINT"^'^>»»»»»»»»>iEND»OF»GAHE" : END 
8500 PRINT "Rx^^l^•t»>SORRY. YOU HAVE -. 

^OVER-COMMITTED YOUR" 
8510 PRINT"x^(-RESOURCES. THE "?N15;" -. 

-.CANDIDATE WINS" 
8520 PRINT "ly^l^^^^^^^^^^xEND^OF^GAME" : END 
19000 PRINT "i^»>-^»PRESS xSPACE>BARf TO -. 

-.CONTINUE" 
19010 GETG$:IFG$<>" "THEN19010 
19020 RETURN 6 



Septembof /October, 1980. Issue 6 



COMPUTEI 



45 




.^mmodore 



R^T 



PLEXI — VUE ^ 

SOLAR SCREEN 

DRAMATIC IMPROVEMENT? 
YOU BE THE JUDGE! 



\ \ 



SOLAR SCREEN 

We urge you lo read this and consider our PLEXI- 
VUE High Contrast SOLAR SCREEN. You will 
see it is a small price to pay for a big improvement! 
Someconsider it as an Rx for tired eyes! As you will 
see from our offers, you can even get one FREE! 
CONTRAST ENHANCEMENT 
IS IT FOR YOU? 
We have all experienced (he eyestrain acquired 
from silting in front of thecomputer for too many 
hours playing games or working. That is now a 
thingof ihepastdueto recent dcvctopmcnts inthe 
area of CONTR.4ST ENHANCEMENT. First, 
the construction of most home computers is such 
that generally the CRT screens are of a phosphor 
light gray in color, which makes it difficult to 
distinguish between the white letters and gray 
background. The former method was to turn the 
CRT brightness up which increased cotitrast but 
also increased GL.^RE. This is where the 
eyestrain comes in. What you need is something 
that will INCREASE the CONTRAST while 
DECREASING the GLARE. Several productson 
ihe market will accomplish this but to different 
degrees of success and a drastic difference in cost, 
as you will see. 

OUR PRODUCT 

We produce the PLEXI-VUE High Contrast 
SOLAR Screen from General Electric I.E.XAN 
which is unbreakable. It is neutral in color and will 
work with all phosphor screens including green. 
This SOL.iVR LEXAN is a sixteenth of an inch 
thick and mounts to your computer within a 
minute after you receive it. You do not need tools 
of any kind, you just strip off the masking from 
ihe foam adhesive and apply the unit lo the front 
of the compnler! Then you arc ready to enjoy the 
DRAMATIC difference in viewing WHITE let- 
ters on a BLACK screen. Or if you have a GREEN 
phosphor screen you will see GREEN letters con- 
trasted against BLACK as you do on the expensive 
W.ANG and IBM computers! You will also notice 
thai long periods of activity at the computer will 
not bring on the resultant eyestrain that normally 
accompanies GLARE. You've been driving into 
the sun and noticed the difference when you put 
on a pair of polarizing sunglasses; this is the kind 
of change you will see by installing PLEXI-VUE! 



SATISFIED USERS! 

We have been producing and selling the PLEXI- 
VUE for about a year and a half and have quite a 
following among users. We have sold to a large 
number of Colleges, Universities, Schools, 
Lawyers, C.P.A.'s, Doctors, Hospitals and 
Laboratories. We know they are pleased because 
they immediately re-order more PLEXl-VUEs for 
other computers. Testimonials from users range 
from, ".A.MAZING!" to ". . . really like it, enter 
my order for another!" Don't take our word for 
ii, ask somebody who owns one! 

THE COMPETITION 
The SUN-FLEX Optical Filter at S20.00 for the 
smallest version, consists of a fine screening 
material with a plastic border. It increases con- 
trast but creates a moire effect on the screen if 
your program has animation. It will also bother 
you if you have any degree of astigmatism. You 
can blow through the fine screening material, and 
have to be very careful not to damage it. 
The POLAROID CP-70 Polarization Filter also 
increases contrast and decreases glare. It costs 
from S26.00 for a formed plastic filter or from 
$68.00 for laminated glass versions. Brackets are 
provided for mounting. 

The GLARE-GUARD by Optical Coating 
Laboratory sells for $95 for certain computers only. 
It is a very high quality circular polarization material 
laminated between two pieces of reflection cancelling 
coated glass. It's thick and heavy, and requires 
special mounting. Used in some expensive terminals. 
Materia! can be purchased for custom fabrication for 
small computers. As with the SUN-FLEX ANT) 
POLAROID versions the screens look "added on" 
due to the way they are mounted. 

SOME OTHER COMPANIES PRODUCE A 
MYLARFILMTHATYOU WETANDAPPLY 
TOTHECRTTO DARKEN THE SCREEN. WE 
WILL NOT MENTION THEM ANY FUR- 
THER THAN TO SAY THEY AREA RIP-OFF! 

DRAWBACKS 
We, like other manufacturers of contrast enhance- 
nient devices do not recommend their use if you in- 
tend to use a light pen. Since the screens cut 
GLARE, they also reduce light intensity which is 
needed by the photocell in the pen. Our screen 
works with some pens, but we would rather caution 
you than disappoint you after you purchased it. 



FREE TRIAL OFFER 

We urge you to test the PLEXI-VUE Screen now. 
Order one for our 30-day no obligation trial. See 
the dramatic difference It makes on your com- 
puter. See how much easier it is to read text with 
the higher contrast, and how much more you en- 
joy your computer. Your friends will notice the 
new appearance as the above photos show. We 
can make this offer because we have a QUALITY 
PRODUCT, at a REASONABLE PRICE that we 
feel will meet with yourapproval,ifyouwillGIVc 
IT A TRY! 

After you have used it, decide if you want to keep 
it. If you do you'll own the most affordable con- 
trast enhancement device on the market. I f for any 
reason you're not completely satisfied, simply 
return your screen with-in 30 days for a prompt 
and courteous refund. You can't lose! 
To order your PLEXI-VUE for our free trial, 
simply send your personal check or money order 
for S14.95 -I- SI.OO Shipping. We accept 
MASTERCHARGE or VISA! Give ACCOUNT 
NUMBER, INTERBANK NUMBER, EXPIRA- 
TION DATE, AND SIGN your order. Give 
Model Number needed from CHART: 

PXI = PETs/CBMs with METAL CRT Cases. 
PX2 = PETs/CBMs with PLASTIC CRT Cases. 

PX3 = NEW 80 Character CRT CBMs. 

• * FREE PLEXI-VUE! •* 
Order a SOFTPAC- 1 at the Regular price of S34.95 
4- SI .00 Shipping and we'll GIVE you the PLEXI- 
VUE FREE! The 30 day TRIAL OFFER applies !0 
both! (You must return BOTH for a refund.) 
SOFTPAC- 1 contains 17 programs on DISC or 
TAPE (SPECIFY) in a Notebook with Back-up 
copies, printed instructions & program listings! 
GAMES W/SOUND too! 

ORDER FROM: 



COMPETITIVE 

SOFTWARE 

21650 Maple Glen Drive 
Edwardsburg, MI 49112 



46 



COMPUTEI 



Septemtier/October, 1980. Issue 6 



THE FIRST 

ANNUAL 

COMPUTER 

PROGRAMMING 

CONTEST 

(of Herkimer, NY) 

E. Q. Carr 

Plonetarium Director 
Herkimer BOCES Planetarium 
Herkimer, NY 13350 

They came from 40 miles away. Some brought then" 
own PET's wiih large keyboards because lliey 
wanted no part ol' our little keyboards. The lone A}j- 
ple 11 arrived and fortunately we had planned a se- 
cond one for them. These kids were confident, a big 
short of cocky, quite determined and planned to win 
a timed problem solving contest. Three-and-a-half 
hours later they left, confident, determined to win 
the next contest, perhaps in college. 

And during that time, the 31 contestants did 
warm-up exercises, engaged in a two problem con- 
test, polished off 90 hamburgers, listened en- 
thusiastically to lectures on Fortran and a slide 
slunvn on the history ol" digital coniputi'r technology, 
received their prizes and visited a rninimicrocom- 
puter faire set up by local computer vendors. The ac- 
tual lime schedule appears in I able 1. 

Why Programming Contests 

I do not know of research which indicates the mind 
increases its power and capacity by competition. It is 
obvious however, that a system of proper instruction 
and training with competition produces desiiable 
results. The programs for the athletically apt are a 
paradigm worthy of imitating. Athletics [produces 
very little in the export market to aid in the balance 
of pt>ytnenis however. But computer technology and 
software ha.s iticonie value to the cotnury in terms of 
billions of dollars over a long ]>eriod of lime. 

Moreover, discipline, challenge and association 
with peers n a competition is a tool for self- 
calibration. Then, there is the exhilaration of stret- 
ching to the limit of one's inherent capabifilies. In a 
contest, the kids grow in stature and sell-esteem, and 
that's ob\'i()us from even a cursory obsei'\'ation. 

The practice and training for competition is, of 
course, tiie most \aluable part of it all. All tlie basics 



must be in (ilace, technicjues studied and revie\\ed. 
some of the simple algorithms FOR-NFjX'I' Ioo])s, 
IF-THEN, logic statements AND, OR, NOT must 
be ready tools, used without hesitation. 

Organization 

The idea of a contest appealed to the e.Kperienced 
computer teachers in our areas who responded to a 
phone call sampling 15 schools known to have 

microconipuiers, or terminals accessing a mainframe. 
A mailing ioi' organization went out three months 
before the expected contest date. Six teachers and 
two community college students attended that first 
meeting. They were the nucleus for sample problems 
demonstrating the potential skill of contestants. A 
member of this group decided there should be prizes 
for the witmers and undertook getting conii'ibutions. 
The college students offered to generate a range cjf 
problems for the contest. The residue ofiasks con- 
sisted of the [)hysii-al facilities, speakers, publicity, 
registration, the mini-faire organization, cor- 
resiJondence, rtrlreshments, contest rules, judging, 
selecting a fmal date, arranging computers and con- 
tacting sup]jliers for literature. 

Of course, we had two monlhs for all thai. 

Registration 

With a date selected, a Saturday in A|)ril. thei-e was 
a hope that there would be no student e\'ents in con- 
flict. It pro\'ed an unfortunate choice, Wt- lost a 
number of local schools' contestants to a irack meet. 
Which may demonstrate something about the nature 
of a number of kids in\-olvcd. They are also athletes. 
Within a week, all but 2 teams had sent the registra- 
tion forms, and the fma! jjre-contest registcatitin was 
32 sttidents. 

Sudden Death 

The committee agreed that contestants would be paired 
as teams. There were se\x'ral reasons, bui fundamen- 
tally, the purpose was to assure that the ttiaxinunn 




September /October. 1980. issue 6 



COMPUTEI 




PET and the 

IEEE 488 Bus 

(GPIB) 

by E. Fishier and 
C. W. Jensen 



Ttiis is ttre only complete gjids available on 
interfacing PET to GPIB. Learn how to program 
the PET interlace to control power supplies, 
signal sources, sigt>al analyzers and other 
instruments. It's full Of practical infomiation. as 
one of its authors assisted in th« original design 
of the PET GPIB interface. 

*3T-4 $15.00 



NEW PET 
edition 




Some Common 
BASIC Programs 

by L. Poole, W. Borchers. 
C. Donahue 



76 Programs you can use even if you don't 
know BASIC- This book gives you a variety of 
math power including personal finance, taxes 
and statistics as well as other programs you'll 
want like Recipe Cost and Check Writer, All 
programs can be run on a PET or CBM with SK 
or more. 

#40-3 $12,50 




PET owners can purchase the programs ready- 
tn-run on cassette or disk. Use the book as a 
manual for operating instructions and 
programming options. 

Disk *33-0 $22.50 
Cassette *25-X $1500 

Practical BASIC Programs 

ed Lon Poole 

These are 40 easy to use programs that 
each do something useful. 

Income averaging, checkbooit reconciliation, 
statistics, factorials, temperature conversion 
and musical transposition are just a few. it offers 
a wealth of practical computing power. Includes 
wnte-ups, program notes and instructional 
examples to help you realize the potential uses 
of each program. 

*3B-1 $15.00 

6502 

Assembly Language 

Programming 

by L. Leventhaf 

Increase the capabilities and performance of 
PET land other 6502-based computers! by 
learning to program in assembly language. 

#27-6 $12.50 



Neysf for your PET 



from 



^^OSBORNE/McGraw-Hill 



PET Personal Computer Guide 

by C. Donahue and J. Enger 

Everything you always wanted to know about 
PET/CBM computers . . . 
but don't. 

This booic is a step-by- 
step guide to the PET 
computer. 

Assuming no prior 
knowledge of 
computers this 
PET guide contains 
a wealth of 
information 
that you'll need 
in training your 
PET to perform. 




#30-6 $15.00 



BQtk, t;*li"llB^D'i>( 


Pfe« 


QuariiiTy 


Amourti 


27-E 6502 Aisfntj-vljinBuagePrDgramming 


tlJM 






J0*6 P( T pEFioi^ai ComfiuK!' Gu de 


515 00 






31 J f>£Tjnj|t>citEE4e6lCPi6)6ui 


S'^tJO 






iO 3 SO'i^f;Jimrn,:n BASIC ProgrflriiiPEI CBW wJ Ihkj*' 


iWbO 






; 5 X io-n? Co^T'Qo ftASlC P-ag-arr-s P£ T C^MtK 


SibM 






33-0 SanTnC&fTimo-.eAS!C P>ogrsfT«PET D^tfc 


5J2bO 






3B 1 Pibci.cai BASiC Programs 


Sit 00 








#i.i(i>M.Btos.(iiv>ii Ian 

5h.f:p,ng 
m\ Amouil ErxlDied 











^_y630l 



OSBORNE/McG raw-Hill 
'630 Bancroft Way, Dept. G3 
Berkeley, California 94710 
(415) 548-2805 • TWX 910-366-7277 

Name 



V06 



Address.. 

Cly: 

State: 



■ S04Gr»rBiMk'l[ncUi«:n(nftUS lAJUn 3-4 

■ ST ^0«*cnf«taagni<'nuiJ 



Phano:. 



ilnll 



48 



COMPUTET 



September/October, 1980. Issue 6 



numbt-r ol' teams possiljk- compk-tf the problems, 
and to [)criiiit more students to participate. It was 
expected that the less confident studcius would be 
supported and decide to enter. 

The sudden death aspects of a sint,de problem 
contest prom])ted a two problem contest based on a 
winning team with (he minimuni acctinuilaled solu- 
tion time. Students were cautioned that wliile the 
contest was a timed power test, it was the llrst cor- 
rect solution that drew a lime mark. Incorrect 
answers meant a ma.ximinn time, that is, 20 minutes 
allotted to each problem. 

The Mini-Microfaire 

All four of otu- local computer stores airreed to par- 
ticipate. So (.lid four local colleges and (wo large com- 
puter manufacturers' representatives. One of the 
vendors volunteered to contribute to the prizes. 
There was no charge for vetidors. 

How the Contest Worked 

About a third of the contestants arrived earlv, as did 
all the Faire vendors who participated, 'i'wo vendors 
and two college representatives failed to show 
however. The half hour "warm-up" pei'iod at the 
start is more correctly a "sei-tip period". Si ill. it was 
interesting to see kids set tt|j their own exercises on 
the machines. One brought a memory test tape and 
nearly created a panic when he elaborated it woLild 
take 15 minutes to fully check the machine's 
memory, and how sorry he was no one else could be 
sure their computer was working. Another set up 
beautiful graphics of animated rain clouds that 
moved across the screen. Each team was moving in 
different and original patterns that reinforced con- 
fidence. This alone was an exciting phase of the con- 
test for an observer. 

One of the teachers had taken on the task of 
Contest Commissioner whose function was to run the 
actual programming contest. He distributed the test 
problems, face down to each of the 15 computer sta- 
tions and on a signal, the student hit RETURN, 
starting the PET's internal clock. He supervised the 
master clock and acted as the referee of referees. 

Referees were the teachers and sponsors of the 
contestants. They responded to the students who in- 
dicated they had solved the contest problem. 
Referees determined whether a solution within the 
question statement and rules had actually been 
achieved. 

Analysis of Contest Problem Results 
The first problem was selected to have a .solution in 
approximately 12 single statement lines for an 
average student and a solution time of 5 minutes. 
The second problem was judged to be of greater dif- 
ficulty. The questions, possible solution and re- 
quirements are given in Table II. The scoring times 
are plotted in Table III for each problem. I believe 
the data indicates a wide range in student skills. 



There may be other implications as well, but the 
paucity of data precludes generalizations. 

The problems however met several contest 
design goals that included maintaining student con- 
fidence by permitting every student to complete the 
first problem. The first problem assumed fast 
students would complete the problem in 5 minutes or 
less. The second problem was designed ftjr approx- 
imately a 10 minute solution time. These goals were 
met. 

Reprise 

The contest was an exciting event for students, ven- 
dors and teachers alike. The lessons we learned will 
make it a better contest for the kids. Indeed the Con- 
test Committee is already at work! 




FtKSl ANNUAL COMPUTER PROGRAM,WING C0NIE5T 
(of Hrrtimer, NYl 



CONTEST RULES (1980) 



A maximum af twcify (20) feams cnn be (iccomrr.odaled on a Finl Registered, f irsl 
Served Boiis. A mu^Imuni of three (3) reomi, but to accommodnl* iKe greatest 
number iif scttook we moy limit o iciiocl to two (j?) tctimi, 

A Team conjish of two (2) memben. Each learn will be gi^en 1/.0 (2) problemj 10 
solve. The winning teom will have the lowejt occumulnferf lotnl tinie to problem 
solution. 

Solutions will be checked by Referees with data entry en spenrnte lircj. Please 
use 1 ine numbers spoced by tens oF units (10, 20, 30 ....), 

Contcjfarstj will lioi/e thirty (30) minutei beginniiirj at 10 a,m , io' (nnviliorizotion 
with the PET 2001s, 



A. IMPUI 
8. READ 

C. DATA 

D. REM 

E. LET 



NO OTHER COM^AANDS WILL BE ALLOWED 



d to the following list 


J BA 


SIC srotements, comr 


lands. 


t,tc. 


F . DIM 

G. PRINT 
H. GOTO 

1. IF ... THEN 
J. FOR ... NEXT 


K. 
L. 
M. 
N. 
0. 


CN 

ON ... GCIC 

GCSUB 

RETURN 

END 


P. 

Q 
R. 
S. 


Tl, TIS 
AND 
OR 
NOT 



ft. When you ^lave reached a ^alurion ond have checked it carrfull^, print "'le statement 
PRINT TIS, hil RETURN and call c Rtf^Fee^ 
Rcflembof, once you've h!t RETURN, you con no loinger chongt- lie D'ogr im, 

7 . Sc^y^oU qti: cocoumged lo use local canltsfj to select iKeir feomi . 



September/October, 1980. Issue 6 



COMPUTH 



49 



PROBLEM »1 



THE FOLLOWING SCHEDULE OF LICENSE FEES IS PROPOSED TO PERSUADE PEOPLE 
TO SAVE GASOLINE 8Y LJSING SMALLER ENGINES IN CARS. 



HORSEPOWER 


Lie 


:NSEFEE 


Up lo 20 HP 





More ihun 20 HP, bul 40 HP or k-ss 




50 


More fhan 40 HP, bul 60 HP or l«s 




200 


More thon 60 HP, bjf 80 HP or leis 




800 


More than 80 HP 


SIO 


000 


THE SOLUTION SHOULD BEGIN; 







1. Prompt an inpul of AUTO HP? 

2. Print on oulpul such tji THE LICENSE FEE IS S50 

3. Return to the orlglnol prompt. 



PROBLEM '2 

WRITE A PROGRAM THAT WILL TAKE THE COOROINATES OF TV,'C POINTS IN A PLANE, 
COMPUTE THS DISTANCE BETWEEN THEM, GIVE THE COORDINATES OF THE MIDPOINT 
AND THE SLOPE OF THE LINE SEGMENT. THE PROGRAM SHOULD USE THE COORDINAIES 
DESIGNATIONS SHOWN. 

DEFINITIONS FOR LINE OF COORDINATES XI, Yt, X2. Y2 ARE; 

DISTANCE J [«I-X2) . lyUVl] 

MIDPOINT ! X XI • X2 , y ^ VI > Y2 



SLOPE 



M 



Y1-Y2 
X1-X2 



WHERE XI 



X2 



(flHEH XI » X2, SLOPE IS UNDEFINED) 

1. Ui«oREAD Xr, Yl, X2, Y2 loiiorl. 
Leave lin« 500 ond 600 For referee doto. 

2. The Program ihould prim oul: 

DISTANCE = 
MIDPOINT - 
SLOPE (0, ' M, Undefmed) 



A POSSIBLE SOLUTION 

3 PRlNI-r 

It IdPUI'lHPUI *urO HORSE PDUER'IP 

15 IF n-20 THEN 300 

30 IF P<=<0 THEH 300 

10 IF K = 40 THEN 100 

50 IF P<sBO THEW 500 

40 IF OaO THE« iOO 

200 F=0 

310 GOTD I0«0 

300 f=50 

JIO COTD lOOO 

400 F=200 

<I0 GOTO 1000 

500 F=BOO 

510 0010 tOOO 

too I-'I0090 

1000 PRlKI'irCEKSE FEE IS f";F 

1010 0[U1:1F *l = '--IHEn 1010 

1020 COIO ] 



2. Use Data Linej lor at lensl 3 coordinate sett 
contoining an Undefined Slope, o Zero Slope 
ond a Negotive Slope. 



A POSSIBLE SOLUTION 
U )tEAP11,1l,JC3,t2 

JO LET i)=u(ii-i3i ;>ni-iJr3H- 

30 PRlHT-LllSIlUCE ''W 
(0 LET J.IIl. 131/2 
SO lEI tsirl'ljl/? 

40 PRi«fflittoi«in = -:iri='i' 

?0 IFIt.S; IHEK lis 



so LEI r 
fO PRUrSLOPE 
100 G010IO 
no PRIMTII'I 
120 OOtOlO 
500 liaU3,5,'. 
600 HIfll.4 



3i>:i!i-i2i 

SIOFI IS KOr HEFIMED" 

6, -3,5, 1,5,-3,4, -3,-8 

I 



SOLUTION REO IIREMENTS: 



1. Linej 30, 60ond ?0<ji Heir 
equivalents ore required 

?, Referee must Inicrt Ootf) Lines 
500 ond 600 to get omwers 



Solution RequirL-ments: 



Equivcilent of Lines 10, 1000, and 1020 ire required. 
The ei^uivolent of Line 3 Is □ lie breaLer, 
R*'tum tc Line to from 1020 is acceptable. 




<y} 



C5 ^ 

tJ ■ U I 



PR0GRA,V.M1NG ('OWTEST 
PESULTS 

TfSl PBObLEM*! 

AV6 7,70 1 V7 Mifi. 



'//// A , 

'//Aim^y.iPZ^', 



3 4 5 t, 7 ft 

SJLUTIOM 




9 to M 



m 



'.y ■:_y- 



5 - 



cD Q 1 



I 



.v\ I MUTES 
^ESTPQGbLEM*? 



— > I - '/-' 



Z. 



^ 



'A 



iVG 12.19^ 2.25 Mii-i 



w.m.. .. .n^.-.^j^ 



SOLUTION TIME -Ml^xJUTES 



TA5LE H 



so 



COMPUTEI 



September /October, 1980. Issued 




THE STAR MODEM 

From Livermore Data Systems 
<^<^ IEEE 488 MODEM 

SALES 

RS232 MODEM 

SALE $139 



The STAR modem from Livermore represents a 
signllicant breakthrough in ihe development of 
acoustic modems. The small, lightweight case 
houses a high-performance modem that competes 
with the highest quality standard-sized couplers 
available. Yet. because of its costs effective design. 
the STAR has become the price/performance leader 
in the industry. 

CIRCUITRY 

The switchable, four-section t)andpass filter provides 
the user with excellent oul-of-band rejection to 
assure accurate processing of the received car- 
rier, even at signal levels o! less than -^7 dSm. 
Further, the proven soft limiter and phase lock 
loop discriminator yields data that is essentially 
Jitter free. 

The oscilfator is built using highly stable, state- 
variable circuitry that delivers a nearly harmonic 
free, phase coherent sine wave to the telephone 
network, assuring compatibility with all other 
103 type modems. Becauseolthepurenessof the 
sine wave, the STAR modem exceeds even the 
stringent harmonic requirements ol all CCITT 
countries. 



CARRIER DETECT 

To assure accurate teleprocessing connections, 
the carrier detect circuitry prevents the modem 
from attempting to operate when excessive noise 
would produce errors or cause marginal operatjon. 
Tne circuitry also has a special amplitude sensor 
that prevents chatter when the received signal 
fades. 

EXCLUSIVE ACOUSTIC CHAMBERS 

TTie exclusive triple seal of Livermore's new flat 
mounted cups locks the handset into the acoustic 
chamber yielding superior acoustic isolation and 
mechanical cushioning. Designed to adapt to most 
common handsets used throughout the world (also 
fits GTE handsets), the STAR offers the utmost in 
flexibifily and transmission reliability. 

SELF TEST 

The self test feature on the STAR allows the user to 
verify tola! operation of the acoustic modem by 
using the terminal in the full duplex mode. No need 
for remote assistance in diagnosing terminal or 
roodem products 



Utilizing the experience gained from building high 
quality couplers for over twelve years Livermore 
has designed a coupler superior to any it its class for 
cost efficiency m industrial, commercial, txjsiness or 
home situations. You can see why we call it the 
STAR! 

SPECIFICATIONS 

Data flale, to 300 baud. 

Compjllbllity. Bell 103 and 113; CCITT. 
Transmit Frequencies.' Originate - 1070 Hz/Space, 
1270 Hz/Mark: Answer - 2025 Hz/Space 2225 

flecelrt FreijuBrhcle!.* Originate - 2025 Hz/Space, 

2225 Hz/Mark. Answer - 1070 Hz/Space 1270 

Hz/Mark 

Frequency Stability, ±0,3 percent. 

Receiver SensitWIty. -50 dBm ON. -53 d8m OFF. 

Transmit Le«l. -15 dBm, 

Modulallon. Frequency shift keyed (FSKi. 

Carrier DeEetl Delay, 1 .2 seconds OfJ: 120 msec OFF. 

EIA TemilMl Interface. Compatible with RS 232 

specifications 

Interlace. IEEE 488. 

Optional Interlaces. 20 ma; 

•Inleniatlonal (CCITTl frequencies available. 

Switclies, Origmate/Off/Answer. Full Duplex/Test/ 
Half Duplex. 

Indicators. Transmit Data, Receive Data, Carrier 
Ready, TesL 

EniirenmentaL Ambient operating temperature 5'C. 
to 50 C Relative humidity 10 to 90 percent (non- 
condensing). 

Power Supplied by 24 VAC/150 MA UUCSA listed 
wall-mount transformer Input 115 VAC, 2 5 watts 
(220 VAC. 50 Hz adaptor available on request) 
Dimensions. 10" x 4" x 2" 
Wel[hL 1.7 lbs. (2.2 lbs. shipping weight including 
AC adaptor ) 
Wamnty. Two years on parts and labor. 



650? 
5502A 
6520 PIA 
6522VIA 



Ms 10 tt 695 SO '- 
840 10 9- 795 50 '■ 
515 10 (^ 490 50 <^ 
690 10 :i 6 50 50 -^ 



6532 7 90 10 a 
2114-L450 
2n4-L300 
2716 EPROM 
4116-200 ns RAI^ 
6550 RAM (PET 8Ki 
S-100 Wite Wrap 



740 50 ^ 

4 65 20 li 

5 95 ?0 " 
2100 5 ^ 

7 00 

265 



6 55 100 ^■ 
735 too t 
445 100 ' 
610 100 1 
700 100 = 

4 35 100 ': 

5 45 100 •: 
1900 10 = 



Solder Tail 



690 
415 

5 70 

6 60 
4 !5 
510 

17 00 
6 25 

12 70 
215 



CASSETTES— AGFA PE-611 PREIVIIUM 

Higti oijlput low noise 5 scruw timjsiiig laliels 

C-IO 10/5B5 50/2500 100,'4800 

C-20 10/545 50,'2950 100'5700 

C-30 10/730 50,'34 00 100,'66O0 

All Other lengirjs available Write fof price list 



J|l ATARI BOO SPECIAL S799 
ATARI A" ^^^" Modules 20"'.i OFF 

DISKS 

[wnle loF qLJantity pnctiSl 




SCOTCH (3MI 8- 


10/310 50/285 100/2 75 


SCOTCH I3MI 5- 


10/315 50/295 100 '2 85 


Maxell 5' 


10,/365 50/340 100/3 15 


l^axell 8" Double Dens 


10,'4 1Q 50/395 1O0/3B0 


Vertiatim 5" 


10/240 50/235 100/2 30 


BASF 5 ■ 


10,'2 45 20/2 35 100/230 


BASF 8' 


10/2.50 20/2 45 100/235 


Diskette Storage Pages 


10 lor 395 


Disk Library Cases 


8- -2 85 5" -215 



Commodore CBM- 
PET SPECIALS 

-Up lo S235 free 
yS^ me'chandise 
Oh^ with purchase ol one ot 
<C loliowiny CBM-PET 




terns ^jj^^ 


^^■^^^ 




FREE 


8032 32K-80 coUiriin CRl 


SI 795 235 


8016 16K-80 colunin CRT 


1495 205 


8050 Dudl 3isk Drive-950000 tjyies 


1695 220 


CBM Modem-IEEE Interlace 


395 50 


CBM Voice Synlfjesizer 


395 50 


8fJ lull Si^e giaphics keytxjard 


795 100 


1 6 K Ful 1 Siie Grapfiics or Business Keyboa rd 


995 145 


32K Full Size Graphics or Business Keyboard 


1295 205 


2040 Dun! Disk Drive-343,000 byles 


1295 205 


2022 Tractor Feed Printer 


795 100 


2023 Pressure Feed Printer 


695 90 


C2^J External Cassette Deck 


95 12 


Used PETs llimiied guanliltesi 


Call 


•••• EDUCATIONAL DISCOUNTS — • 


Buy 2 computers, get 1 FREE 


VISICALC loi PET iCBM/Personal Software) 


S128 


CBM Assembler/Editor (diski 


89 


CBM General Ledger A'P A/R NEW 


270 


CBM Full Size Giaphics Keytxiard 


S 74 


WwOPiD l-lor 8K PET 


25 


WordPro IT 16 or 32K. 2040 Printer 


72 


WordPro III-32K, 2040. Piintei 


178 


WordPro IV lor 8032 


268 


PASCAL Compiler for PET 


75 


Programmers Toolkit-PET ROM tJlilities 


S 44 90 


PET Sp.icemaker Switcfi 


?2 90 


Dust Couei lor PEl 


7 90 


IEEE-Parallel Printer Interface for PET 


7900 


IEEE-RS232 Punter Interlace lot PET 


149 00 



11 5 E. Stump Road 
Montgomeryville, PA 18936 



215-699-5826 A B Computers 



Centtunics 737 Proportional Spacing Printer J800 

NEC SDin'A/tiier-parallel 2450 



SVM-l S209 witti4KRAM 

SYM BAS 1 BASIC in ROM 

SVM RAE-I? Assembler in ROM 

MOf 1000 Synpdek Development Sysleiii 

taM-2'80 Synenek Video Board 

KIM-1 iijdd S34 lor BOwer supplyi 

Seawell Moltier boara-4 K RAM 

Seawell I6K Static RAM-KIM SVM AIM 

S-100 Static RAM kit SALE 

Leede> Video 1 00 1 2 Monitor 

Zenitti ^19 Terminal (laclory ,tsm) 



S 238 



1345 
349 

159 
195 
320 
198 
129 
770 



KL-4M Foot Voice Music Board for PET S34 90 

Visible Muse Monitor (4 Voicei for PET 2990 

SPECIAL— KL-4M witl' Visible Music Monitor 5990 

MICROTHELLO foi PET by Michael Riley S9 95 
Mactiinp l.inguage version— you cant win at Level 5 

RAPE R MATE 60 Command P E T Word Processor S29 95 
fyli-leatuied version by Micbael fiiley 



ii 



A P Products 15% OFF 



All Book and Software Prices are Discounted 

PET Personal Computer Gtiide (Osbornej S12 75 

PET ariil ttie IEEE-488 Bus iOsborne) 12 75 

6502 Assembly Language lOsbornel 945 

Programming the 6502 (Zaksi 1045 

ii502 Applications Book iZaksl 1045 

PiKjiairiminQ a Microcnrnpiiter 050? 7 75 

6502 Software Bookbook (Scclbi) 9 45 



WRITE FOR CATALOG 1 

Add SI .25 per order for sliipping. We pay balance 
of UPS surface charges on all prepaid orders. I 



September /October, 1980. Issue 6 




COMPUTE) 



51 



FOUR PART HARMONY FOR THE PET 



A-B Conipiiters iHirioiiiices a comljination syslem consisting ol itic 
KL-4M DAC Board and Ihe VisiIjIc Music Monitor for Commodore PET- 
CBM conipiiters TIte package enatjies PET nstis to easily create and 
play musical compositions ol up to '\ parts 

The KL-4M Board includes an 8-l)it Digital lo Analog Converter, a low 
pass filter to eliminate liigli frequency computer generated liiss, and an 
on-lMard audio amplitier. An RCA-typo lack is also included for quick 
altactimeni of yout spcakei Amplification ol tlie 6522 CB2 generated 
single note sound is incorporated as well, so tfial no additional hardware 
(otfier Itian a speaker) is required. Connection is made via tlie parallel 
and cassette ports Both pons aie extended with diiplrcale connectors 
(with keyA-aysi so I/O capabilities are not reduced in any way. Board 
orientation is parallel to ttie back of Itie PET so additional laljle space is 
not required. Ttie KL-4(^1 is compatible with any of the 4 part music 
monitors, tor whictr a number of precodcd songs are available 

The Visible Music fvlomtor is intended to Support 4-part barmnny 
syslenissuchasttieKL-4rul Visible Music Monitor is wmtcnontirelyiri 
6502 macbine language VMM provides an easy way to erilei 4-parl 
music IliE usDi can see ttie notes on the screen as tliey are entered and 
can make changes boih with the insert and tfelele keys and Ijy using 
cursor up and down to move" notes on the screen Oilier leatures 
include record changer' mode to load successive songs without 
inlervention user definable keytroard, and entry ol whole notes thinugb 
64ths including doited and If iplel notes Additionally you can specify or 
change tempo set key signature, and transpose af any nine Wave form 
modification makes it possidle to create new mstiumenl sounds Voices 
can switch from one instrument toanolher or gang up on one instrument 
during the course of the song Music can be played either with note 
display (useful tor debugging songsi or with no display 



PAPER-MATE 
GO COMMAND 

WORD 
PROCESSOR 



r r I 



KL-4M Music Board & Visfte Music Monitor Prooram 



S59.90 



KM MM PASCAL for PET 

A subset ot standard Pascal (Jensen. Wirth) for PET 
Includes following standard identifiers; 
Types: INTEGER, BOOLEAN, CHAR, TEXT 
Procedures; RESET, READ, READLN. 
REWRITE, WRITE, WRITELN 

[ ] ( I or (* ^'1 ',= >,', ' 

div, mod, or, and, not . if , Itien, else, case, of, 
repeat, until, whiile, do, for, to, downto, begin, 
end, const, var, array, function, procedure. 

Sequential I/O supported (both disk and tape) 

Extensions: 
Memorv can be rnanipulated as an array (MEIVl) 
% sign allows hiex values in literals and I/O 

Floating Point available in 4tti quarter 1980 

(nominal upgrade charge) 

Included in package: 

- Machine Language Pascal Source Editor 
-Machine Language Compiler (generates P-Code) 

- P-Code to machine language translator (pro- 
duces optimized machine language object code 
—not just a P-Code interpreter). 

-P-Code Interpreter (for debugging and learning) 

- Run-time package 

- User Manual 

- Sample programs 

Versions available for ROfvIs 2.0 (cassette only), 
3.0, 4.0. Requires 16K minimum. 

KMM PASCAL on tape or disk 

(with User IVIanual) $75 

User Manual Only $15 



115 E. Stump Road 
Montgomeryville, PA 18936 



Paper-Mate is a full-leatured word processor 
for S29 00 by Mich.ael f^iley Papei-Mate incoi- 
iwiates 60 commands to give you lull screen 
editing with graphics lor all 16k or 32K PETs, all 
printers and disk or tape drives II also includes 
most leatures ol the CBM WnidPro III. plus many 
additional features 

For wilting text. Paper-Mate has a definable 
keyboard so you can use either Business oi 
Graphics rnachines Shift lock on letters only, or 
use kcylioaid shift lock All l<evs re[)eal 

Papei-ftflatc text editing includes floating cur- 
sot, scroll up 01 down, page lon;vard or back, and 
repealing msiKl and delete keys Text Block 
tiandling ricliides transfer, delete, flfipend save 
load and inserl 

All loimattingcnrnmands areinitjedded in text 
lor complete control Commands include margin 
contiol and release, column ad|ust 9 tab settings 
variable line s[)acing, lustify text, center text and 
auto print 'orm letter (variable block) Files can ty 
linked so that one command prints an entire 
manuscript Auto page, page hearfers, page 
numbers pause at end of page, <ind Irypttenation 
pauses are included 

Unlike most word processors PET graphics as 
well as text can tie used Paper-Male can send 
any ASC 1 1 code over any secondary address to 
any printer 

Paper-iyiale works on 16K or 32K PEIswilh 

any ROiyi cassette or disk and CBf^ or nun- 

CBM printers An 8K version is m the planning 

To order Papor-tvlate siiecify niachirie and 

ROM type 

SZ9.95 



On Tape iwiih rnanual) 
On Disk {■mi^ niantiall 
M;!nij,-il SeiiaratP 



S3Z.95 
S 1.00 



EARL FOR PET 

Edilor Assembler and Relocalor/Unker 
Disk File Based for PET 

Editor can edit files larger than memory. 

Assembler features: 

- 2 Pass Assembler 

- Generates Relocatable Object Code 
-Uses standard MOS Technology 

mnemonics 

- Disk file input 

- Listing output to screen or printer 
Relocator/Linker capabilities: 

- Relocates assembler output to desired 
memory location 

- Resolves symbols declared external in 
assembly 

- Links multiple object programs as one 
memory load 

EARL for PET (with User Manual) . . S65 
User fvlanuai Only $15 



BET YOU CANT BEAT IT! 
HICROTHELLO 

by Mike Riley 

Tfiere are live levels of play in this PET 
machine language prograin Level four is for 
experts only and is designed for tournament 
level play So far no one has been Me to l)eat 
level tour Level five lakes several minutes to 
rnove and is used tor exhaustive analysis of 
specific moves 

There are several features to help in the 
analysis of a game Any position on the board 
can 1)6 recalled and replayed Both the level ol 
difficully and Itic position of the pieces can be 
changed at any lime Vou can play against the 
machine, against anoltier person, or watch 
Ihe machine play itself You and the machine 
can swrtch sides during the game Moves are 
selected with the cursor rather than by 
coordinates For all PETS S9.95 



TUNNEL VISION & 
KATAND MOUSE 

NOW IN MACHINE LANGUAGE 

By Riley and Levinson 

Tltis program was so popular that several 
other versions have appeared on the inarket. 
In order to keep ahead of the competition, the 
program has been re-wntten in machine 
language lor last graphics 

Tfie program includes two excellent maze 
games In Tunnel Vrsion, you view the maze 
from inside in perspeclive If you gel lost, the 
program provides a map showing yair trail In 
Kat and Mouse, you must find your way 
through the maze before the hungry Kat finds 
you Each maze has only one solution, and 
eachisiinigue For all PETS S7.95 



ATARI Computer Systems 

BASE UNITS SAtE 

400 Computer Sysiem ! 419 

800 Computer System iwilh 16K RAM) 300 
ACCESSORIES 

8K RAM Memory Module 95 

I6K RAM Memory Module 155 

CX70 Light Pen 59 

CX30-04 Paddle Conlroller Pair 16 

CX-IO-O^ Joystick Controller Pair 16 

CX8I I/O Data Corfl (5 feet) \2 



FEniPHER/ILS 

410 Program Recorder 

Disk Drive 

815 Dual Disk Drive I Double Densityl 

820 Printer (40 Column Impact) 

822 Thermal Printer (40 Column) 

825 Printer (80 Column Impact) 

830 Acoustic Modem 

650 Interlace Modjie 

PEftSONAL INTEREST AND DEVELOPMENT 

CX4101 Invitation to Programming t (tape) 

CXL4007 Music Composer (carlnOge) 

ENTERTAINMENT 

CXL4004 Basketball (canridgcl uses Joysticks 

CXL4009 Computer Chess (cartridge) ■ Joystick 

CX4t 1 1 Space Invaders Itape) uses Joysticks 

CXL401 1 Star Raiders (cartridge) - Joystick 

CXL4005 Super Breakout uses Paddles 

CXL4010 3-D Tic-Tac-Toe (cartridge) - Joysticks 

CXL4005 Video Easel (canndgel uses Joysticks 

PnaGRAMMING LANGUAGES 

CXL4003 Assemtjier Editor (cartridge) 

E0UI;ATION-TiI>[ & Ttich'- Cnamwin 

(4 lapes per course, use with CXL4001) 

CXL4001 Education System Master (cartndge) 

CX6001 bS History 

CX6002 U S Government 

CXB003 Supen/isory Skills 

CX6004 World History (Western) 

CX6005 Basic Sociology 

CX6006 Counseling Procedures 

CX6007 Principles of Accounting 

CX600B Physics 

Cxeoog Great Classics 

CX6010 Business Communications 

CX6011 Basic Psychology 

CX6012 Effective Wriung 

CX6014 Principles Of Economics 

CX6015 Spelling 



69 
539 
1195 
399 
358 
795 
159 
ITS 

IS 
48 

32 
32 
15 
48 
32 
32 
32 



20 
24 
24 
24 
24 
24 
24 
24 
24 
24 
24 
24 
24 
24 
24 



215-699-5826 



A B Computers 



WRITE FOR COMPLETE CATALOG 

Add $1 .25 per order for shipping. We pay tjatance 
oJ UPS surface charges on alt prepaid orders. 



COMPUTEI 



September/October. 1980, Issue 6 



Al Baker's 
Programming 
Hints: 
APPLE and 
ATARI 

More on tAenu 
Selection 

The Apple is a programmer's computer. It has many 
strengths and few weaknesses. However, using its 
strengths often requires the very best from a pro- 
grammer. This issue we are going to explore effective 
use of the Apple's paddle controllers in menu selec- 
tion. Next issue we'll continue this exploration with 
an even more powerful application of the paddles. 
But we're getting ahead of ourselves. 

Last Issue: 
Atari 

I left the Atari readers with a problem last time: con- 
dense the number selection routine as much as possi- 
ble and use it in a program. If you'd like to share 
your solution with the rest of us, send me a listing. 
My solution is in Listing 1 . The program is the old 
favorite "Guessing Game". 

The routine is condensed into lines 1000 to 
1050. I made a few changes in it to accomodate the 
game. The main change was to remove the setup of 
the variable "A". The rest of the program is the 
standard number guessing program. Lines 7 through 
23 initialize the variables, including "A", and lines 
30 through 80 pick out a random number and ask 
the player to guess it. 

Line 90 calls the joystick number selection 
routine. If the player makes a correct guess, then 
lines 200 to 220 tell him so and loop back for another 
game. Otherwise lines 117 to 140 give him a Bronx 
cheer, tell him how he was wrong, and loop back for 
another guess. 



REM 
REM 
REM 
REM 
REM 

ft=ie 



GUESS R mSER 



ST LiP THE .JJYSTICK DATA 



10 LOtJ=l 

20 HIGH=2y 

21 X=17 

22 Y=12 

23 F1AYEF:=1 

27 ¥m 

28 REM FtAV THE t^AT^ 

29 REM 

;K LiRAF'HICS 2 

40 F-Cr^ITIOH 2.-5 

50 ? "I m im\-¥.mz of a \iM£R eeticeh" 

60 ? LOJ;" Pt€ ^HIQ^;^ "; 

70 ? "Vmi IS YOJF: GLESS^" 

80 QJESS= I m<. Rf I>; y ::'*20 )+ 1 

82 F£ri 

84 REM GEl J)£ PLAYER'S AMSICR 

8b REM 

90 GOSUB 1000 

100 FiJSITIOH 14.. 20 

110 IF A=OJESS T^€H 200 

112 REM 

114 REM Vm-^ GLESS 

116 REM 

117 SOUND 0,200.10.15 

118 FCf; 1=1 TO 50^NE>:T I 

119 SOJm 0.0,0,0 

120 IF A<aJESS THEH ? "TR't' HIGHER" 
130 IF A>Q^SS THEH ? "TRY LOICR " 
140 fflTO 90 

170 REM 

180 F-EM COR'RECT i3JESS 

190 REM 

200 ? "YiU ODT IT" 

210 FOR 1=1 TO 500: NEXT I 

220 QUO 30 

960 REM 

970 FEM JOYSTICK HU-BER SELECT 

980 FEM (D I BUSSED LAST ISSUE) 

990 REM 

1000 ?W£ 752.. 1 

1010 F-aSITICW X/t':? A;" "j ^FOR '5m=0 TO 

1 5 : SOUND ; 1 00-A , 10 , IS-S^d ■■ hEXT SHJ 

1020 IF O;TICK(PLAYEF:-i;>=ll>t(A>L0W> THE 

H A=A-MjOTO 1010 

1030 IF ( ST ICK( PLAYER- 1>=7Mh<HIGH> THE 

H ft=A-t-l=G0TO 1910 

1040 IF STRIG<F1AYER-1) THEN 1&20 

165.0 RETLiRW 

Ttie Apple Paddle 

The Apple hand controller has two inputs: a paddle 
and a button. The combination is called '"the 
paddle". We arc going to use the paddle (o make 
menu selections in programs which do not otherwise 
use the Apple keyboard. If one or more phiycrs are 
playing a game which exclusively uses the paddles for 
game inputs, it is poor design to force them to use 



September/October. W80. Issue 6 



COMPUTE! 



53 





/'' n(m»HX" 



^^^^^i 



g a;T:T:taaaj ^iyLT-. 



$819 



APPLE 



MICROSOFT ADVENTURE 

The original of ADVENTURE written for 
Ihe DEC-10 systems is now avaiiabie 
for tfie APPLE. Expiore Coiossal Cave 
for treasures whilie avoiding tiie 
clangers tiidden withiin its many 
passages. 130 different rooms. 15 
treasures, and characters ranging from 
heipfui to deadly await you wittiin the 
cave. Be carefui where you step, and 
also who's behind you! 
32K disk machine language $29.95 

ANDROID NIM 

by Leo Christopherson 
The game thai made Leo 
Christopherson famous is now 
available for the APPLE! The improved 
graphics and color of the APPLE mal<e 
the game even better. Try to be the last 
one to shoot the androids on the 
screen, if you do, you win! Also 
includes realistic sound effects. 
24K cassette machine language. .S14.95 

MAGIC PAINT BRUSH 

Hi-Res graphics package plus! Draw 
Hi-Res pictures using all APPLE'S 
colors. Connect any points on screen, 
nil areas, plot, rotate, and scale shape, 
or 'paint' with a set of 9 brushes. Also 
comes with Shape Table Designer and 
2 demo programs. Slot Machine and 
Applesoft Invaders. 
32K disk AppiesoH-ROM $29.95 

THREE-D 

You don't have to be an engineer or 
scientist to have high resolution 
graphics for your computer! This 
program permits rotation, scaling, 
shift, distortion, and combination of 
three dimensional graphics on the 
screen. MP Software. 
48K disk Applesoft-ROM $29.95 



16K $895 
32K$1195 

ATARI* 

STAR RAIDERS 

The best! A ROM cartridge holds the 
game. A fast-paced full-color, space 
battle in which you must defeat the 
enemy Zyion ships while protecting 
your home bases. Real-time action and 
effects make this game the best space 
game available. Sixty levels of rating 
from Garbage Scow 4th Class to 
Commander make for continuously 
exciting play. 
ROM cartridge $59.95 

3D GRAPHICS 

by Tim Hayes 

High quality graphics program for the 
ATARI computer allows you to rotate, 
distort, shrink, and combine three 
dimension graphic projections on the 
screen. With the high resolution 
abilities of the ATARI, one of the finest 
graphics packages available anywhere! 
16K cassette $29.95 

WALL STREET CHALLENGE 6402 

A computer simulation of the Stock 
Exchange is easy to play and always 
challenging. Invest in stocks, and try to 
make it big! 

8K and 16K version on one cassette 
$19.95 

ALL STAR BASEBALL 6401 

Two players face each other, one at 
batand the other pitcher and outfield. 
Innings, balls, strikes, and a variety of 
plays make for an exciting game. 
Joysticks are optional. 
8K and 16K versions on one casselte. 
$19.95 



$499 



PET* 

STARFLEET ORION 

Command a starfleet! 2 player game 

system includes rule book, battle 

manual, control sheets. Two programs. 

22 space ship types and 12 play tested 

scenarios. 

8K cassette $19.95 

RESCUE AT RIGEL 

Search Ihe moon base and rescue 
Delilah Rookh Irom the High Tollah. 
Automatic Simulations. 
24K cassette $19.95 

MORLOC'S TOWER 

Match wits with the evil wizard and try 
to defeat him! Automated Simulations. 
32K cassette $14.95 

TIME TREK 

by Brad Templeton from Personal 
Software. Real time action. Star Trek 
type game with sound effects. There 
are no 'turns'. The action continues 
whether you move or not. You and the 
Klingons can move, steer, and fire at 
the same time. 
8K cassette $14.95 



This is only a very smalt sample of 
our product line. For a complete 
selection, send $1 for our catalog 
of tiardware, software, and 
publications and receive a $2 
credit toward your first order. 



APPLE. ATARI, and P£T jrc (cjcJemjfk! of 
Apple Computer Co , Warner Communkatiom, 
ind Commodore, respectively 



mhC^Ott^^^i^ tXDnSnffC 6 SOUTH ST., MILFORD, NH 03055 

To order: Call Toll-Free 1-800-258-1790 onNHc.u 673-5144) 

rhe ioilwire Ctchinge & Hirditdf (D:v ol KobitjiHe & Si>rn. fnJefpriii-v Ini ;, iaIlSidp PiihlnjiMn^ 




54 



COMPUTE! 



September/October, 1980. issue 6 



the keyboard when making menu or other choices 
between or during games. Let's avoid the keyboard. 

Listing 2 is a sample program that uses paddle 
to make a menu selection. It puts up a list of five 
selections. Turn the paddle until the selection you 
want is highlighted and push the button. That selec- 
tion is yours. Push the button again to make another 
selection. This sounds simple enough and, for the 
user, it is. 

For the programmer the problem is anything but 
simple. There are several problems that must be 
solved. First, the paddle must "feel" right. This 
means that it must have fluidly -- no jerkiness. Also, 
pushing the button must feel like an "event" similar 
to pressing a keyboard key. The button was designed 
to feel like a continuous "state" where holding it 
down creates a continuous input until released. 

The Program 

Lines 60 to 90 initialize the sample program and 
define the five selections on the menu. Lines 100 to 
106 clear the screen and bypass the user's input. 
This is done to get the menu on the screen to start 
with. PR contains the menu item pointed to by the 
paddle. The menu display routine on lines 220 
through 280 print the five selections. The menu entry 
that matches PR is shown in inverse video. 

Now let's sturdy closely the input routine on 
lines 140 to 185. Line 145 picks up the value from 
paddle and converts it into a number between 
and 5*50-1. This is done so that line 150 will always 
assign a value to the variable PA between 1 and 5. If 
line 145 allowed values of PA greater than 249 then 
line 150 would let PA equal as much as 6, a menu 
item which doesn't exist. 

Now the program checks the status of the button 
in line 160. If PEEK(-16287) is greater than 127 then 
the button is pressed and the user has made his 
choice. Otherwise the program checks to see if the 
new value from the paddle is unchanged. As long as 
PA equals PR the program will continue to monitor 
the paddle and button by looping back to line 145. If 
they are not the same, the user has moved the pad- 
dle. The program sounds the bell in line 184 and 
BEGINS to change the menu display to match the 
new paddle position. 

If line 185 was PR = PA then rapid changes of 
the paddle would create jerky changes in the display. 
Spinning the paddle from left to right might cause 
the menu to change from a highlighted first selection 
to a highlighted fifth selection, for example. This 
doesn't feel right to the user, especially the non- 
programmer. He usually thinks there is almost a 
mechanical linkage between what he does and what 
happens on the screen. Having a smooth paddle mo- 
tion create jerky screen changes violates this sense 
and feels wrong. 

Instead of setting PR equal to PA, line 185 
moves PR closer to the value of PA. If PA is bigger 



than PR, then it adds 1 to PR. If PA is less than PR 
than it subtracts one from PR. Finally, lines 220 to 
280 reprint the menu and go back for more user in- 
put. 



10 
20 
30 
40 
50 
60 
70 

80 

90 

100 

105 
106 
110 
120 
130 
140 
145 

150 
160 

170 
180 
184 
185 
190 
200 
210 
220 
230 
240 
250 
260 
270 
280 
290 
300 



THE OPTIONS 
5; READ 0P$( I ): NEXT 



DETECT 



REM PADDLE MENU SELECT 

REM 

REM 

REM 

REM DEFINE 

DIM 0P$<5 ) 

FOR I = 1 TO 

I 
DATA THE MAGICIANfTHE 

IVEfTHE SOLDIER 
DATA THE COWBOY, THE POLITICI 

AN 
PR = 

CALL 

GOTO 

REM 

REM 

REM 

CALL 
PA = 

PA = 
PA = 
BU = 

IF BU 



- 936 

220 

WAIT FOR PADDLE HOVE 



- 936 
PDL (0); IF PA :: 
249 

INT (PA / 50) + 
PEEK ( - 16287) 

> 127 THEN 320 



!49 THEN 



= PR THEN 145 
CHR$ (7)f 



+ SGN (PA - PR ) 



IF PA ■- 
PRINT 
PR = PR 
REM 

REM DISPLAY MENU 
REM 

FOR I = 1 TO 5 
IF PR = I THEN 
HTAB lO: VTAB J 
PRINT 0P*( I ) 
NORMAL 
NEXT I 
GOTO 145 
REM 
REM SELECTION HAS BEEN MADE 



INVERSE 
+ 2*1 



310 REM 

320 CALL - 926 

330 VTAB 5 

340 PRINT CHR* (7)5 "YOU SELECTE 
D " ;0P*< PA) 

341 REM 

342 REM UAIT FOR BUTTON TO BE R 
ELEASED 

344 BU = PEEK ( - 16287 ) 

345 IF BU > 127 THEN 344 

346 REM 

347 REM WAIT FOR BUTTON TO CONT 
INUE 



September /October. 1980. Issues 



COMPUTEI 



55 



348 


REM 


350 


VTAEi 15 


360 


PRINT "PRESS BUTTON 




NUE"; 


370 


BU = PEEK < - 16287) 


380 


IF BU < 128 THEN 370 


385 


CALL - 736 


386 


PRINT CHR* (7)f 


390 


REM 


400 


REM WAIT FOR BUTTON 




ELEASED 


410 


REM 


420 


BU = PEEK < - 16287) 


430 


IF BU > 127 THEN 420 


440 


GOTO 100 



TO CONTI 



TO BE R 



The remainder of the program handles the 
user's menu choice. Lines 320 to 340 display the 
choice and lines 344 and 345 wait for him to release 
the button. Remember that he pressed the button to 
make the selection. The program shouldn't reread 
the button until the user has let it go. Once the but- 
ton is released, lines 350 and 386 request that the 
user press the button, wait for the button press, and 
sound the bell. Then lines 420 to 440 wait for the 
button to be released before going back to the menu. 

Conclusion 

We've explored one use of the Apple paddle. Next 
time we are going to simulate a joystick for such 
games as Space Invaders. The actual arcade game 
uses a joystick to control sun motion. Most Apple 
versions treat the paddle as direct input to position 
the sun. This tends to frustrate Space Invader fans 
who are used to the real thing. 

Here is your problem for next time. How can 
you simulate a two way joystick (left<-center- > 
right) with the Apple paddle without needing to 
know at any time how far the paddle is from its 
center position? ^ 




JcippiG computer 

* Authorized Dealer 

FULL SELECTION OF APPLE 
COMPUTERS AND ACCESSORIES. 

IN 
CANADA 




For Personal - Business - Educational ap- 
plications and more, there's only one place 
to come for all your APPLE needs. 

OFF THE SHELF DELIVERY. 



HOUSE dF COmPUTERS inc. 

368 EGLfNTON AVE. W, (al Avenue Hd I 
TORONTO. ONTARIO M5N 1A2 

{416)482-433b 
C R A E 

A fast co-resident Applesoft editor for Applesoft program- 
mers. Now perform global changes & finds to anytfiing in 
your Applesoft program. Quote (copy) a range of lines from 
one part of your program to another, A fully optimized stop- 
list command that lists your program to the screen with no 
spaces added and forty columns wide. Append Applesoft 
programs on disk to program in memory. Formatted 
memory dump to aid debugging. Powerful renumber is five 
times faster than most available renumber routines. Auto 
fine numbering. CRAE need be loaded only once and 
changes your Applesoft program right in memory. 48K 
Apple II or Plus & Applesoft ROM & disk. 

MOAT 

MCAT is a binary program which creates a master catalog 
report. The first list is sorted by file names and the second 
by volume number with sectors used indicated, provisions 
for duplicate volume numbers. 600 file names capacity on 
4BK system. 200 for a 32K system. 

S I N B A D 

Hires adventure-like game using over 100 pictures. Re- 
quires 48 K Applesoft ROM, Disk. 

CRAEon DiskWith 16 Page Manual $19.95 

MCAT on Disk With 10 Page Manual S14.95 

CRAE And MCAT On One Disk With Manuals $29.95 

SINBADon Disk $17.95 

CRAE/MCAT Manuals Include Instructions For Making A 
Backup Copy. 

SEE YOUR LOCAL DEALER OR SEND CHECKS TO 

HIGHLANDS COMPUTER SERVICES 

14422 S.E. 132nd 

Renton, Washington 98055 

(206) 228-6691 

Washington residents add 5.3% sales tax. Applesoft and Apple 
registered trademarks of Apple computers Inc. 



56 



COMPUTEI 



September/October, 1980. Issue 6 



Fun With the 

6502 

Atari Sofhvare 

Reviews 

Atari 3 Dimensional 
Graphics 

Len Lindsay 

Sebrees Computing (456 Granite Ave., Monrovia, 
CA) is marketing a sophisticated software package 
that will help you create your own three dimensional 
pictures on your Atari screen, and even have them 
moving in any direction you would like. The soft- 
ware package costs $29.95 plus $1.50 postage and 
handling. 

I have referred to this software as a package, 
rather than as a program, because you receive four 
separate programs on the tape. Along with the tape 
comes a manual explaining how to use the programs 
and how they work. The last pages of the manual 
contain complete listings of each of the programs. 

I received a preliminary version of 3D Com- 
puter Graphics for the ATARI, and was impressed. 
For example, the first program mixes all three types 
of TEXT MODES on the screen at one time which 
is very interesting. The final version will use more 
colors in Graphics mode 8 than the default maximum 
set by BASIC. 

The programs allow you to set up the three 
dimensional coordinates of any object you wish 
drawn on the screen (using X, Y, Z axes). It takes 
quite some time to figure out all the coordinates and 
enter them into the program. (This is a serious pro- 
gram; plan on spending some time with it.) Once 
you have all the coordinates entered, you can have 
the object drawn on your screen. This sounds 
simplistic, but you can vary the place that you are 
viewing the object from; vary the field of view; and 
"vary" the viewing position you are looking at the 
object from. And you can draw the object, or erase it, 
all under program control. Thus you can actually 
create a three dimensional animated scene. 

The final manual will have a complete chapter 
on examples. The last program on the tape is an ex- 
ample of animation all ready to RUN. You can 
watch an animated SPACE SHUTTLE. A plastic 
model of the Space Shuttle was used along with 
graph paper to identify its outline coordinates. 



If you are set for some serious fun with your 
ATARI, and have the time to enter coordinates of 
your object into the program's data base, then you 
should enjoy this package. 

The Video Easel 
Cartridge 
from Atari 

This is one of ATARI 's plug-in cartridges. It is an 
amazing cartridge, showing off some of the ATARFs 
amazing capabilities. It uses joysticks to control 
many of its functions. The more you use it the more 
things you find you can do. 

Painting (demo mode) 

There are 6 different dynamic paintings preset for 
your instant use. Simply hit P (for Painting), then 
hit a number 1 - 6 for the painting number, then hit 
RETURN and the painting begins. My favorite 
paintings are numbers 1, 3, and 6. You can switch 
from one painting to another at any time. The screen 
is not cleared when you transfer unless you want it to 
clear. To clear the screen, hit C (for Clear) and 
RETURN. The paintings are constantly changing, 
creating beautiful displays. And it is FAST. You can 
even control the speed if you wish. Simply use 
joystick #1. Push it forward and the painting speeds 
up. Pull it back and it slows down. Slow it down to a 
snails pace and watch how the video magic is per- 
formed (it is extremely interesting). You can control 
colors used with joystick #2. Push it forward or right 
or left to change the color registers. Hold the RED 
button down at the same time and you change the 
luminance levels. 

Drawing 

Now for the exciting news. You can create your own 
custom dynamic painting sets. It is very simple and 
provides a great sense of accomplishment and 
satisfaction. 

Hit D (for Draw) and RETURN and you are in 
the DRAW "set-up" mode. Use joystick #1 to set up 
the master pattern. Your master pattern can both 
DRAW and ERASE lines. To set up a DRAW hold 
the RED button down as you move a small dot 
around the screen with your joystick (leaving a trail). 
To erase, don't hold the RED button down. When 
you are ready simply hit S (for Start) and RETURN 
and ZAP, the computer starts drawing your pattern 
over and over rapidly filling the screen with your ins- 
tant masterpiece. You can control the speed and col- 
ors as for PAINTING mentioned above. 

This DRAW mode can easily be used for trivial 
fun. But, it can just as easily be used for some 
serious fun. However, to create some well-designed, 
thoughtful, dynamic paintings, you will have to 
spend some time experimenting. See if you can 



September /October, 1980. Issue 6 



COMPUTEJ 



57 



PET ATARI APPLE SYM 



INTRODUCING OCT DADDIT OR 

ROM Kt 1 KADDl 1 CASSETTE 

The PET RABBIT contains high-speed cassette 
routines, auto-repeat key feature, memory test, decimal 
to hex. hex to decimal, and other features. Coexists 
with the BASIC PROGRAMMERS TOOLKIT. Works 
with 2.0 ROMS (New) and new style cassette deck. 

Cassette versions configured for S1800, S3000. $3800. 

S7000, and S7800. 

Cassette and manual — $29.95 

ROM version configured to plug into P.O. board at 

$A000. 

ROM and manual — S49,95 

FREE ROM RABBIT with purchase of 8K PET and tape 

deck. 

SPECIAL — ROM RABBIT and cassette deck — only 

5134,95 


EHS IS NOW A 
COMMODORE DEALER 

EHS offers a number of software products for PET. 
ATARI, APPLE, and other 6502computers. Now we sell 
CBM hardware. If you're in the market for PET 
products, be sure to look for our FREE software offers, 

CBM PRODUCT DESCRIPTION PRICE 

2001-eKN 8K RAM-Graptiics Keyboard S 795,00 
2001-32KN 32K RAM-Graphics Keyboard $1295.00 
2001-32KB 32K RAM-Business Keyboard S1295.00 
8032 32K RAfs/l-30 Col,-4,0O/S 51795,00 
2023 Friction Feed Printer S 695,00 
2022 Tractor Feed Printer S 795 00 
2040 Dual Floppy-343K-DOS 1.0 51295,00 
2050 Dual Floppy-343K-DOS 2 51295,00 
8050 Dual Floppy-974K-DOS 2,0 51695,00 
C2N Cassette External Cassette Drive S 95.00 
CBM to IEEE CBM to 1st IEEE Peripheral S 39,95 
FEE to IEEE CBM to 2nd IEEE Peripheral S 49,95 
8010 IEEE 300 Baud Modem S 395 00 
2,0 DOS DOS Upgrade for 2040 S 50,00 
4.0 O/S O/S Upgrade for 40 Column S 100,00 

EDUCATIONAL DISCOUNTS 

BUY 2— GET 1 FREE 


MACRO ASSEMBLER 

AND 

TEXT EDITOR 

Macro and conditiona! assembly, string search and 
replace, 10 char./label, AUTO line numbering, MOVE, 
COPY, DELETE, NUMBER, and much more. 20+ 
commands, and 20+ pseudo ops, 

PET cassette version (ASSM/TED) — $49,95 

PET disk version (MAE) — $169,95 

ATARI cassette version with machine language 

monitor — 553,95 

FREE ASSM/TED and ROM RABBIT with purchase of 

32K PET and cassette deck. 

FREE MAE with purchase of 32K PET and disk drive. 


TRAP 65 

TRAP 65 prevents the 6502 from executing unimple- 
mented instructions. Have you ever had yoursystem to 
crash on a bad upcode?This isa real machine language 
debugging tool and time saver. Also useful forteaching 
trap vectoring and extension of instruction set in 
schools. 3'.^ X 4'',i printed circuit board which plugs into 
6502 socket of any PET. APPLE, SYM, Only $149.95 


TINY-C FOR PET 

An adaptation of the TINY-C interpretersold byTiny-C 
Assoc, Useful for learning a modern structured 
programming language. Diskette — 545,00, Owners 
manual — 540,00 

FREE MAE and TINY-C with purchase of 32K PET, 
disk drive, and printer. 


ATARI M.L MONITOR 

Load and save binary data on cassette. Display and 
change 6502 registers. 

Monitor uses the screen editing capabilities of the 
ATARI to allow easy use. Cassette and manual — $9.95 
(specify memory size), 

ATARI MEMORY TEST 

When you purchase a new ATARI or add on new RAM 
modules, you need to be sure that the memory is working 
properly, (Remember, you only have a short guarantee 
on your memory!) Cassette and manual — 54,95 


COMPILERS 

Graphics Drawing Compiler for PET and SYM, Works 
with Macro ASSM/TED, The GDC is composed of a 
number of macros which emulate a high-level graphics 
drawing language. In addition to the macros, GDC 
provides some very useful enhancements to the 
ASSM/TED, Manual and Cassette — $29,95 

Music and Sound Composer for PET, Works with 
Macro ASSM/TED The MSC is composed of a number 
of macros which emulate a high-level computer music 
language. In addition to the macros, MSC provides 
some very useful enhancements to the ASSM/TED 
Manual and Cassette — $29.95 


APPLE PRODUCTS 

Macro ASSM/TED ~ includes manual, on cassette — 
549 95, on disk - $55,95 

Apple MAE — similar to PET MAE, A powerful 
assembly development system on diskette, (Requires 
license agreement) — $169.95 

PIG PEN — 100°b ML, word processor for use with 
Apple ASSM,'TED, Fast text formatting, vertical and 
horizontal margins, right and left justification, center- 
ing, titles, foots, shapes, etc Manual and source 
included, on cassette — 540.00, on diskette — $45 00 

Apple Mail List System. Provides sorting on zip code or 
last name. Approximately 1000 names/diskette 
Manual and Diskette — 534.95 


I/O KIT 

PET I/O Experimenters Kit. Allows easy accessto IEEE 
or user port for the construction of external circuits 
Kit - 539 95 


EASTERN HOUSE SOFTWARE 

3239 Linda Drive, Winston-Salem, N.C, 27106 
Ph, Orders — 9-4 EST (919) 924-2889 or 748-8446 
Send SASE for free catalog 


ORDERING TERfVIS 

Send check or money order in U.S. dollars Add 2% for 
postage for CBM orders. Overseas software orders add 
55.00, All software mailed free in USA and Canada, 
Purchase orders acceptable. 



58 



COMPUTH 



September/October. 1980, issue 6 



figure out just what the computer does when it 
duplicates your pattern. You may find that the 
screen fills up too fast, and then looks like garbage. 
AHA. Your master pattern should include some 
ERASE lines, to help keep the screen from filling up. 
There are other tricks to creating long-lasting 
dynamic art, but I won't spoil your fun by telling 
you what they are. 

Quad Drawing 

If you like DRAWing, you will have four times the 
fun with QUAD DRAWing. This divides the screen 
into four quadrants, focusing on the center. Now you 
draw in all four quadrants at once (symmetrically of 
course). This is a fast way to create interesting 
designs. 

Who and Why 

Children as young as 6 years old can control the 
VIDEO EASEL. It will encourage experimenting 
and exploration, as well as allow creative play and 
aid visual thinking. It can be used at very simple 
levels, but can be much more sophisticated for use by 
high school students. It was with more sophisticated 
use in mind that LIFE was included. 

Life 

This is a population simulation. Although it is refer- 
red to as the game of LIFE, there really are no op- 
ponents or winning strategies. A whole article could 
be devoted just to explaining the significance of this 
famous "game", in fact many such articles already 
have been published. A partial bibliography is in- 
cluded with the VIDEO EASEL manual. There is 
even a newsletter dealing with this computer simula- 
tion. It basically deals with a population of "cells" 
that you set up. Once you START it, it follows set 
rules: 

1) Law of Survival - each cell with 2 or 3 neighbor 
cells survives to the next generation. Each cell with 4 
or more neighbors will die from "overcrowding". 
Each cell with one or less neighbors will doe from 
"isolation". 

2) Law of Birth - each empty space with exacdy 3 
neighbors will create a new cell for the next genera- 
tion. 

ATARI'S LIFE is very fast, and has many fancy 
"extras" built in to make it easier to use for fun and 
recreation. You can put the cells on the screen one at 
a time if you wish, but that takes time. So ATARI 
gives you several options to put many cells up at one 
time. 

a) BIG X - puts an X on the screen 

b) LINE - puts lines (horizontal or vertical) on the 
screen of any length 

c) DIAGONAL - puts diagonal lines on the screen 

d) IBEAM - puts a large I on the screen 

Each of the above can be used with the others. Once 
you have the screen set up with all your "cells" you 
simply hit S (for Start) and watch the generations go 



by. Some very interesting patterns are created. For 
more advanced use, you can automatically put 
GLIDERS and FACTORIES on the screen. Fac- 
tories create Gliders. They both are fully explained 
in the manual. 

Final Remarks 

Video Easel may appear to be simply a glorified 
drawing program, but it is much more. I am very 
satisfied with it, and my daughter enjoys it as well, 
even though she is only three years old. In several 
years it should prove thought provoking for her. It 
can be used successfully in grade schools (for the pat- 
terns and drawing) and in high schools (for the game 
of LIFE simulation). Q 



CATALOGS 

D Software. Lists 400 pro- 
grams on 70 tapes and 
disks. For education, recre- 
ation, and personal use. 

D Books. Lists 100 books, 
games, records, prints, etc. 
for educational and per- 
sonal users of small compu- 
ters. 

D Peripherals. (ALF music 
synthesizer and Versa- 
Writer for the Apple II). 

Send 3 15« stamps for 
either catalog or 5 for both. 
Or send $2.00 for a sample 
issue of Creative Computing 
and both catalogs. 

GPeafcive 

GOIttputiRg 

DEPT. CPJG 

P.O. Box 789-M 

Morrislown, NJ 07960 



September /Octobef, 19BO. Issue a 



COMPUTE! 



59 




Randomize 
For The 
Apple II 

Sherm Ostrowsky 
291 Salisbury Avenue 
Goleta, CA 93017 



When you play games on your Apple II, do things 
start looking fanmiliar after a while? Does the game 
get boring because you know just what is going to 
happen next, even though the random number 
generator in the program is supposed to snake each 
event uaexpecied? There is a simple, one-line state- 
ment in BASIC '.vhich can retnedy this proljlcm; you 
can use it in your own programs, or even insert it in- 
to connnercial programs after loading them. 

The problem arises because the random 
numbers generated by the RND(l) function are part 
of a pseudo-random sequence which is always the 
same wlienever you turn on the computer. You can 
select a different [;seudo-random sequence by first 
enieiing a seed, S, and using a siatemeiK like: 

X = RND{-S) 
before any ^'i tlie calls to RND(l). But this sequence. 
too. will al->vavs be the same very time y-.iu run yovir 
prtjgram wiih iiu- same seed. What is really needed is 
a \v;iy to generaie a starting .'•red ■.vhici; is fiilTeretu 
e'.cry tinie vou run the program, i-.nd •-vhich is 
unknown to you. 

Some versions of BASIC have a command 
("'RANDOMIZE") which docs just this. Apple 
B.N.SIC and APPiJ-'SOFT. unfortunately, do not 
have tliis cominaiid. A method which has been used 
by many Apple programmers to get around this dif- 



Ticulty is to ask for a starting seed from the user at 
the beginning of the program run, e.g., 

10 INPUT "SEED: ";S : X = RND(-S) 
This will indeed start a different sequence of random 
numbers for that run, but it has some undesirable 
features. It may not be compatible whh the ambience 
of the game ("Welcome to the space world of the 
twenty-third century' please enter a seed."). The 
user may not know enough about computers to 
understand what is wanted. And in any case, it is 
best if the seed is not known to the user, so each 
game can come as a complete surprise. 

A somewhat more sophisticated approach, which 
I have seen used in at least one elegant program, 
uses a sequence such as 

20 PRINT"HIT ANY KEY WHEN READY 

TO PROCEED"; 

30 X = RND(l): X = PEEK(-16384): 

IF X -: 128 GOTO 30 
This does the job; while waiting for the key to be 
pressed, the repeated calls to RND place the system 
at an unknown and unpredictable location in the 
random number sequence. It is, however, not 
necessary to program this so directly, because the 
Apple monitor has a built-in routine which does the 
same thing. 

The Apple's pseudo-RANDOMIZE function 
works as follows: whenever the cursor is blinking at 
you while awaiting some kind of input, a little 
machine-language loop is rapidly and repeatedly in- 
crementing a two-bvte irifeecr stored at decimm loca- 
tions 78 (low byte) and 79 (high byte). No matter 
hov/ fast you respond by typing some input, this loop 
will have gone around so many times that the 
number stored in those locations will be quite ran- 
dom and unknown. Now, in order to get your pro- 
gram into the computer, it must obviously have been 
necessary either to type it in or read it in from tape 
or disl:; either way, the blinking cursor must have 
appeared lor you, even if only to av/ait the LOAD 
comrn.'.iid. Ther>:fore, thete will always be a random 
number waiting there lo he your seed. 

\ simple way to use this pscudo-R.ANDOMIZE 
function is just to put the following statement near 
the beginning of your program: 

10 X = RND(-rEEK(78) - 256 • PEEK(79)) 
Therealter, any uses of f<ND(l) will gel numbers out 
of a completely unpredictable sequence of random 
numbers. © 



60 



COMPUTEI 



September/October, 1980, issue 6 



SCREENDUMP 

Jeff Schmoyer 

Screcndump is a machine language utility program 
which prints the contents of an Apple II text screen 
to any printer. It is executed by pressing a control-Z 
on the keyboard in response to any input. Its uses 
include printing the catalog without having to 
specifically start the printer, getting a hardcopy prin- 
tout of instructions from programs, and selectively 
preserving information on the screen. Screendump 
will run on any size Apple II computer with or 
without a disk drive. It will work from Applesoft, In- 
teger BASIC, or the Monitor. 

Throughout this article control characters are 
printed in the format control-Z. This means press the 
Control key, and while holding it down, type Z or 
whatever other character is requested. Control 
characters are not displayed on the Apple's screen. 
All the addresses shown with dollar signs ($) in front 
are hexadecimal addresses. 

When activated, Screendump replaces the 
system's standard character input hooks with its own. 
Normally when the computer wants a character, it 
goes to the Monitor keyboard input routine which 
waits for one to be typed and then passes it on. 
When Screendump is on, the computer goes to it for 
a character. It then checks to see if the character 
typed was a control-Z. If not, it passes it on just like 
the normal routine. If the character was a control-Z, 
it prints out the screen. 

To accomodate different types of printers and 
interfaces, Screendump has its own output hooks at 
$2FE and $2FF. These should be set to the address 
of the printer driver routine which prints one 
character. On each of Apples' and most other 
manufacturers printer cards resides a ROM contain- 
ing a printer driver routine to make the card work. 
After a PR#1 (if the card is in slot 1) is executed, the 
computer jumps to that driver whenever it wants to 
print a character. It does this by setting the systems 
output hooks to the appropriate driver address. For 
an Apple parallel card in slot 1 this address is $C102. 
If a different card is to be used, this address may be 
discovered through the following procedure. 
Go to the Monitor by pressing Reset on a standard 
Apple II or by CALL -151 on an Apple II Plus or an 
Apple II containing a Language System. 
Type control-P control-K and Return to disconnect 

the DOS. 

Type the slot number that the printer card is in 

followed by a control-? and Return. For slot 1 this 
would be 1 control-P Return. 

Type 36.37 Return. This will display the printer ad- 
dress in reverse order. For $C102 it would show 

36:02 CI. 

These need to be placed in Screendump in reverse 

order also. For $C102, $2FE should get $02 and 

$2FF should get $C1. 



One other change is required for systems without 
disk drives. The value at locations $2B7 needs to be 
changed from $4C to $60. 

To use Screendump from the Monitor type 2AFG 
and Return or from either BASIC type CALL 687 
and Return. Now any time control-Z is pressed, the 
current screen will be printed. Screendump may be 
used anytime up to the next Reset or IN# command. 

To save Screendump to tape, from the Monitor 
type 2AF,2FFW. To save it to disk type BSAVE 
SCREENDUMP, A$2AF,L$51. To reload it from 
tape, go to the Monitor and type 2AF.2FFR. To 
reload it from disk enter BLOAD SCREENDUMP 
or alternatively BRUN SCREENDUMP, The latter 
would both load Screendump and acti\'ate it. 

Some printer cards, such as Apples' parallel 
card, need to be initialized before they can be used. 
This initialization must be done each time the com- 
puter is turned on, or with some cards, each time 
Reset is pressed. For a parallel card in slot 1 the se- 
quence would be 

PR#1 

control-I 40N control-l K 

PR#0. 

After Screendump is activated, througli the execution 
of a CALL 687 or one of the other previously 
described turn-on procedures, it may be utilized by 
typing a control-Z in response to any input. For ex- 
ample if the catalog is being displayed and the com- 
puter is waiting for any key to be pressed before 
showing more, control-Z can be entered and what is 
on the screen will be printed. The catalog will not 
advance until some other key is pressed. As another 
example, assume you are playing your favorite 
adventure game and it is waiting for you to enter a 
command. Typing control-Z will print llie current 
screenful of information describing your whereabouts 
for future reference. 

In some cases the control-Z character may need 
to be used by other programs or devices such as the 
Micromodem II, for their own purposes. If Screen- 
dump is active, it will never let a control-Z go 
through he system. To make a different use of 
control-Z, Screendump may be deactivated through 
an IN#0 or Reset, or the Screendump execution 
character can be changed to something other than a 
control-Z. This is accomplished from Applesoft by 
typing POKE 702,CHR$("newchar"). The 
character in quotes, newchar, may be any character 
the system is not using for something else. For exam- 
ple, an A would not be a good character to use since 
everytime an A was typed the printer would start. 

The operation of Screendump is as follows. 
SDINIT is the startup routine. It takes SCREEN- 
DUMPs address and puts it in the input hooks so 
that Screendump is called to get each character. If a 
disk is being used, the DOS is jumped to, passing 
the input address information along to it. 

As previously outlined, when the system wants a 



Seplember/October, 1980. Issue 6 



COMPUTEI 



61 




"^ffi 



►a* 



.cx^ 









s^:^<o^ 



\<^^ 



A^ 



\p 






<^°>^o<^' 



\0^ 



»e 



ss 



«>' 



■ o' 



*-' 



.-f>S°>'^' 



f\e'^..«&^<xO^ 






:!^' 



;Y-^^ 



.^^^ 



^^ 



ay 



.«^v" 



.^^.e^ 



\0^ 



K^O 



,-^ 






'1^. 




^^ 



o 






JSN 




62 



COMPUTE! 



September /October, 1980. Issue 6 



character it goes to SCREENDUMP which hi turn 
looks to the Monitor routine KEYIN for a character. 
It then checks to see if the character entered was a 
control-Z. If not, it returns the character to the 
caller, your adventure program or whatever. 

DUMPIT is the routine that actually prints the 
screen. First it saves the CPU registers and the cur- 
rent screen pointers. This is so that when it is finish- 
ed, the cursor position and other information will still 
be intact. 

Next it zeros the X register which will serve as 
the screen line counter. The Y register will contain 
the character position on that line. The X register 
(the line) is then transferred to the accumulator (the 
A register) and the Monitor routine GBASCALC is 
called. This routine translates the line number in the 
accumulator into the actual location of where that 



line starts in computer memory. 

The forty characters for that line arc now 
printed followed by a carriage return. The routine 
then goes to the next line and so on until it has done 
24 lines. 

After it finishes the screen, it restores the saved 
screen pointers and registers. Finally it goes to get a 
new character. It does this instead of passing the 
control-Z on to the system and causing a probable 
SYNTAX ERROR. 

Screendump resides in memory at the end of the 
keyboard buffer area. These locations are generally 
not used by other programs but if a very long line is 
typed in, over 170 characters, Screendump will be 
destroyed. If it was active at the time of destruction, 
the computer will stop or do strange things. Hit 
Reset to recover. 



iflSM 

0000; 

0000: 

0000; 

0000: 

0000: 

0000: 

0000: 

0000; 

0000; 

0000: 

0000! 

0000; 

0000! 

0000: 

0000; 

0000: 

0000: 

OOOOi 

0000; 

000 Dt 

02RF ! 

02flF! 

02fiF: 

02fiF! 

02flF: 

02fiF: 

C!2f»F: 

i32Bl! 

02B3 ; 

0285 : 

0287 ; 

028ri: 

02Bfl: 

C2ER I 

02BR: 

028fl ; 

02Ba : 

0280 : 

02BF : 

02C1; 



fi9 
85 

85 



SR 
38 

02 

39 



03 



20 
C9 

FO 

60 



IB 
01 



FD 



SCREENDUHP 



1 
2 
3 

4 
5 

6 

7 , 

8 ; 

9 KSUL 

10 KSWH 

11 DOSSET 

12 CH 

13 GBfiSL 

14 GBfl.SH 

15 GBRSCRLC 

16 PRINT 

17 RDKEY 
IS KEYIN 

19 CR 

20 ; 
21 
22 



DUMP SCREEN TO PRINTER WHEHEUER 
CONTROL-Z IS PRESSED. 



BY JEFF SCHHOYER 



EQU *38 
EQU KSIJL+I 
EQU f3Efi 
EQU $24 
EQU *26 
EQU GBflSL+l 
EQU $FS47 
EQU *C102 
EQU $FDOC 
EQU *FD1B 
EQU $8D 

ORG $2aF 
OB.T i?2FlF 



iO 



CHAR IN HOOKS 

DOS SET HOOK ROUTINE 
CUR-SOR HORIZONTAL 
BASE LINE RDDRESS 

CALCULATE BASE ADDRESS ROUTINE 
PRINTER CARD CHAR OUT RDDRESS 
MONITOR IN 
GET ONE PRESS 
CARRIAGE RETURN 



..:,...-: - ...^ -,..:iiT HOOKS 

TO POINT TO OUR ROUTINE, 

SDINIT LDA SSCREENDLIMP 
STfl KStJL 

LDA ^?SCREENDUf1P''2; 
STA KSWH 
JHf DOSSET 



26 

28 
29 
30 

ol 

ZZ ; GET A CHAR FROfI THE KEYBOARD 

34 .: AND CHECK FOR CONTROL-Z. 

35 ; IF NOT THEN RETURN CHAR TO CALLER. 



nOUE SCREENDUHP 



HOOKS TO DOS 



36 ; 

37 SCREENDUMP 
3:3 

39 
40 



J3R KEYIN 
CMP S*9R 
BEQ DUMPIT 
RT9 



GET A CHAR 

IS IT A CT.RL-Z? 

YES DUMP SCREEN 

NO.. SEND BACK CHARACTER 



September/October. I960. 1 


ssue6 




COMPUTEI 


6J 


02C2: 




41 ; 








02C2 : 




42 ; SAUE C 


URRENT POINTERS RND 




02C21 




43 ; PRINT 


THE SCREEN. 




02C2 : 




44 ; 








CI2C2: 8fi 




45 DUMPIT 




TXfl 


SflUE REGS 


02C3: 48 




46 




PHfl 




02C4; 98 




47 




TYfl 




02C5: 43 




48 




PHfi 




02C6: flS 26 




49 




LDFl GBflSL 


SflUE CURRENT SCREEN POINTERS 


02CSi 48 




50 




PHfi 




02C9! fl5 27 




51 




LDfi 6BRSH 




02CB! 48 




52 




PHfl 




02CC: fl5 24 




53 




LDfl CH 




02CE: 48 




54 




PHfl 




rj2CF: fl2 00 




55 




LDX #0 


LINE COUNTER 


02D1 ; 86 24 




56 




STX CH 


ZERO CURSOR HORIZONTAL 


02D3; RO 00 




57 NEXTLIHE 




LDY #0 


COLUMN COUNTER 


02D5; Sf\ 




53 




lXf\ 


fl GETS LINE 


02D6; 20 47 


F8 


59 




JSR GBflSCflLC 


TRflHSLflTE IT 


02D9i Bl 26 




60 HEXTCHFIR 




LDfl C GBflSL )/■(' 


GET ft CHAR 

• 


C12DB: 20 FD 


02 


61 




JSR PR INTONE 


OUT WITH IT 


02DE: C8 




62 




I NY 


MOUE TO NEXT CHflR 


02DF! CO 28 




63 




CPY #40 


LINE DONE? 


02El! DO F6 




64 




BNE NEXTCHflR 


NO 


02E3; Fi9 8D 




65 




LDR #CR 




02E5; 20 FD 


02 


66 




JSR PR INTONE 




02E8; E8 




67 




I NX 


NEXT LINE 


02E9! EO 18 




68 




CPK #24 


ALL DONE? 


02EB: DO £6 




69 




BME NEXTLIHE 


NO 


02ED! 68 




70 




PLfl 


PUT OLD LINE STUFF BACK 


02EE: 35 24 




71 




STfl CH 




02F01 68 




72 




PLfl 




02F1: 35 27 




73 




STfl GBflSH 




02F3: 63 




74 




PLfl 




02F4i 85 26 




75 




STfl GBflSL 




02F6: 68 




76 




PLfl 




02F7: FI8 




77 




TflY 


RESTORE REGS 


02F3; 68 




78 




PLfl 




02F9: fifi 




79 




TAX 




02Ffi! 4C OC 


FD 


80 




JflP RDKEY 


GET NEW KEYPRESS 


02FDi 




31 ; 








02FC:' ! 




82 .: JUMP 


TO 


flCTUflL PRINTER DRIUER 


02FDi 




83 ; CHRRRCTER OUTPUT ROUTINE. 




02FDi 




34 ; 








02FD! 4C 02 


CI 


85 PR INTONE 




JMP PRINT 





ERRORS IN THIS flSSEMBLY 



c 



64 



COMPUTEI 



September/October, 1980, Issue 6 



Thesus Versus 
The Minotaur: 

PASCAL Visits 
Ancient Greece 

Joseph H, Budge 2507 Elderwood Lane 
Burlington, NC 27215 

In ancient Crete there was a monster called the 
Minotaur who lived in an impossible maze, the 
Labyrinth. The Minotaur was a magical creature, 
half-man and half-bull. Once a year he demanded a 
human sacrifice. In return for the sacrifice he would 
protect the rest of the citizens from the evils of their 
enemies and nature. Appropriately enough, this was 
called the Minoan civilization. As time went on, the 
Minoans grew tired of the yearly sacrifices. After all, 
it was a drain on the population. Not only that, but 
people forgot how valuable their protection was. 
Eventually, the Minoans actually had to force people 
to sacrifice themselves. Imagine that! The victim 
would be thrown into the labyrinth, get lost, and 
eventually bump into Minotaur, with predictable 
consequences. 

One day your basic Greek Hero type showed 
up, a dude named Theseus. Since it was sacrifice 
day, the Minoans grabbed Theseus and threw him in 
the Labyrinth. Being a Greek Hero and all, Theseus 
had his trusty battle-ax and a ball of string. He un- 
wound the string until he found the Minotaur, slew 
the beast, and then followed his string back out. 
Through the marvels of modern science we are able 
to take you back in time to the very time and place 
of this epic event. Theseus is just stepping off his 
boat . . . 

Suddenly a Minoan guard on the city wall 
challenges him: "Who goes there?" 

"Tis I, Theseus, son of fair Hebride and mighty 
warrior, I come in peace." 

Well, before he knows what's happening, a pla- 
toon of soldiers emerges from the city, grabs 
Theseus, and drags him off to the King's Palace. 
The King, of course, is delighted to see Theseus. So 
delighted, in fact, that he pulls out all the stops and 
orders a State Banquet be prepared in the field right 
out in front of the Labyrinth. But once dinner is 
ready, the platoon shows up again while the Great 
High Priest Mumbo-Jumbo explains the fate that has 
befallen Theseus: he's about to become bull fodder. 
Our Hero mutters the ancient Greek equivalent of 
"Sure, no sweat, baby!" before he grabs his pack 
and marches off through the great front doors of the 
Labyrinth. This is what he does: 



Original maze: * # * 

* . . 

* * « 
^ * . 

* ♦ . 

* * * 



* * ♦ * 



* * * 



Figure 1; The Labyrinth 

pt'iiotl = passiigL'way 

star = wall 

M = Minoiaur 

TIk-scus is a jt-rk. TIil- Mii«uaiir lives. 

Here is where he went; ******** 
*.*.** + + 
* . . * M * + # 
)*.«#** + * 
*** + + + * + 
** + **** + + 
4 + *** + + *# 
** + «t*** + 
***♦** + + + 



Figure 2: Labyrinth after the first search 
plusscs indicate where Theseus checked. 

Theseus comes out of the maze, squinting in the 

sunlight. A roar from the angry crowd washes over 

him. The High Priest explains that the Minotaur 

must be either slain or fed. To emphasize hi.s point, 

the Minotaur gives a big roar from inside the 

labyrinth! This sends the crowd scattering and leaves 

Our Hero quavering in his sandals. Mustering up his 

courage, once more he enters the labyrinth. While he 

wasn't looking, the Minotaur moved some of the 

walls around, so now he's just as lost as the first time 

he went in. Here's what happens this time: 

Oriijinal maze; >!<**,**♦***** 

* 



* * 



* * 



Figure 3: The re-arranged Labyrinth. 



Theseus has slain the Minot.i^uf 
Here is where he went.! 



* 
* 
+ 
* 
+ 
* 

T * * , 
T U * 



******* 



* + 

* + 



Kisure A, Theseus' trail omI, cif the- I at'yrin' 

Well, the Minoans are just delighted! They make 
Theseus a Prince of the Realm, heap rewards on him, 
and throw a huge party in his honor. Many of the 
guests want to know how he did it, but I'heseus 
keeps on saying "Aw, shucks, it vvas nothing..". 
Finally the King comes over; he's dying of curiosity 
too. So Theseus stoops over and draws the following 
program in the sand: 



September/October, 1980. Issue 6 



COMPUTE) 



65 



THEORY OF OPERATION 

This is a maze scaixh program writ- 
ten in Standard Pascal for the Apple 
II. It docs not use any of the special 
Fiiscal f'uneiions unique to UCSD 
Pascal, ihcreforc it should be por- 
table to other Pascal machines. 

The lalDyrinth is read into an ar- 
ray, the size of vvhich is set by the 
constants M & N. In the array a '*' 
indicates wall, a ',' indicates 
passageway, a ' -f ' means we've 
been on that passage before, and 'M' 
means Minotaur. The labyrinth is 
placed in an ana)' surrounded by a 
circle of spaces and a circular wall. 
By placing Theseus inside this circle 
ol' sentinels, he can search out the 
entrance to the maze in the same 
way as he searches the maze. The 
search itself is straightforward. At 
any given square Tiieseus looks 
north, and then on around the com- 
pass. He takes the first available 
passageway that he hasn't taken 
before. If there's no passage, he 
back's up until he finds one or gets 
back to his starting point. Theseus 
himself is merely a stackpoitUer. He 
points to the end of his string, which 
is really the stored information on 
the status of each point he has 
traversed. To advance, a new node is 
pushed onto the stack, while retreat 
is performed by a pop. When the 
stack is empty, Theseus is back out- 
side the maze. If Theseus fituls the 
Minotaur he will slay him (M 
becomes W), and leave his string 
behind (a trail of 'T's). 



program maze; 



const 



type 



m = 9; 
ml = 10; 
m2 = 11 ; 
n = 12; 
nl = 13; 
n2 = 14; 



(* rows in maze *) 

{* rows -(■ 1 * ) 

( * rows + 2 * ) 

(* columns in maze 

(* columns + 1 * ) 

(* columns + 2 *) 



east , 



direction ; 
: stackptr 

. n2] of char; 



stackptr = "thissqaare; 
direction = (north, northeast 

southeast, south, southwes 
west, northwest); 
thissquare = record 

row : integer; 
column : integer; 
looking 
string : 
end ; 
map = array [-1 . .iti2 , -1 . 
vitality = {alive, dead ) ; 
validmove = -1..1; 

index = array [north .. northwest] of val 
table = record 

hmove : index; 
vinove : index 
end; 
markers = set of char; 



maze : map; 
Theseus : stacHptr; 
Minotaur : vitality; 
compass ; table; 
done : boolean; 



(* pointer to stack nodes *) 



t , 



(* legal directions *) 
(* one stack node *) 
(* row in maze * ) 
(* column in maze *) 

(* direction looking here *) 
(* pointer to next node *) 



( * Theseus ' s world *) 
(* states of existence *) 
(* a range for indexing *) 
idmove; 
{* array of indexes *) 



(* used for input testing *) 



(* the labyrinth *) 

(* top of stack = Our Hero *) 

(* how's the beast feeling? *) 

(* look-up table of moves *) 

(* flag for exit display *} 



procedure A.RRAYSTART (var maze:map; var compass : table ) ; 



integer ; 
integer ; 
direction; 



(* iteration variables *) 



begin 



"' is put ill. The array is larger 
than the maze will be. The extra 
room, two scjuares on all sitles, are 
the sentinels which are used to 
search for entrances. The compass 
is initialized as a look-up for moving 
in an indicated clireclion. 



(* initialize the labyrinth *) 
for i := -1 to m2 do 
begin 

for j := -1 to n2 do 
begin 

maze[ i , j ] : = ' . ' ; 

if ( i=-l ) or (j=-n or 



(* set to dots *) 
i=m2) or (j=n2) then raazefi,}] := '*' 
(* sets walls to '*' *) 



end 



end; 



(* now set the compass *) 
with compass do 
begin 

for d := north to northwest do 
begin 

if (d=east) or (d=west) then vmovefd] := 
else if (d>east) and (d<west) then vmovefd] := 1 
else vmovefd] := -l; 

if {d=north) or (d=south) then hmove[d] := 
else if (d<south) then hmovefd] := 1 
else hmovefd] := -1 
end 
end 
end ; 



66 



COMPUTEI 



September/October, 19BO. Issue 6 



procedure PRINTMAZE (maze:map); 

var i : integer; 
j : integer; 

begin 

for i := 1 to m do 
begin 

for j := 1 to n do write {maze[i,j], 
writeln 
end 
end ; 



(* iteration variables *) 

Printmaze sicps through ihe two- 
dinii'iisinnal array conisiiiiuig ihf 
nia/f and prints out its contents. In 
iiorninl operation the sentinels arc 
omitted, but that may be changed by 
placing the appropriate values into 
the for-loops. 



procedure ElEADMAZE (var mazermap); 
var 



integer; 
integer ; 
char; 



legals : markers; 

begin 

legals := ['*','. ','M']; 
for i ;= 1 to m do 
begin 

for j := 1 to n do 
begin 

read ( x) ; 

if X in legals then maze Ci,j] 
else maze [i , j ] : = ' . ' 
end ; 
readln 
end 
end ; 



(* iteration variables *) 

(* scratch for input *) 
(* set of legal inputs *) 



(* what's allowed on input *) 

Readniaze is llie general input 
routine which gels the maze from the 
keyboard. This particular version 
shows the dclicicncics ol Standard 
Pascal, No siring hadling is allowed, 
therefore the data must be read in 
one character at a linie. The lack of 
siring handling also makes elegant 
user protnpting difficult. If the maze 
is not found in the proper format (eg 
m lines of n chars) then ihe program 
will terminate with a run-time error. 
Erroneous characters in the data will 
be turned into passageways ('."). 



This procedure Pop's a node ofl the 
stack. In effect this moves Theseus 
back one square. If underllow, then 
procedure returns with no change, it 
jusi prints an error (he's at end of 
the trail... 



procedure POP'(var Theseus : stackptr) ; 
var p : stackptr; 



(* scratch pointer *) 



begin 

if Theseus = nil then writeln ('UNDERFLOW ON STACK') 
else 
begin 

p := Theseus ; 

Theseus := Theseus' , string ; 
dispose (p) 
end 
end r 



procedure PUSHON (var Theseus : stackptr ; var mazejtrtap; compass : table ) ; 
var p ; stackptr; (* scratch pointer *} 



do 



begin 

new ( p) r 
with Theseus" 
begin 

p'.row := 
p* .column 
end ; 
p* . looking := north; 
p*. string := Theseus; 
Theseus := p; 

maze [Theseus' . row, Theseus 
end; 



row + compass .vmove [looking]; 

:= column + compass .hmove [looking]; 



.column] := ' + ' 



Procedure PUSHtJN [Wishes 
Thcseus's current location onto the 
stack, saving his current coordinates 
and the direction he was looking. 
Then it moves Our Hero onto the 
next stiuare in the direction he was 
looking and set's thai lo a ' + ' in the 
maze (dro])s a pebble) before rel inn- 
ing to the calling roiiliiic. 



September/October, 1980. Issue 6 



COMPUTEI 



67 



procedure SEARCH (var Theseus : stackptr ; vat maze:map; var minotaur: vitality ; 
compass : table) ; 



tr : integer; 
tc : integer; 
seewhat : char; 
legals : markers; 



Proceduri- Search h.is ThcsL-us look 
around liim to sec what's there. 
Depending on what he finds, he llieii 
takes a])proprlate action. If he finds 
an illegal eharactCi' he will gel eon- 
lu.sed and jro hack uiil to the en- 
trance lor instructions. Otherwise he 
starts looking north and takes the 
first passageway he finds. II he llnds 
the Minotaur he will, of course, 
fight. But il he finds no unexplored 
passage and no Minotaur, then he 
figure's he's ai a dead-end and 
retreats. Once the search for this par- 
ticular square is over, the pnicedure 
returns to its caller. 



'M' 



]; 



do 



beg in 

legals := [ '» 
with Theseus' 
beg in 

tr := coiiipriss . vmove [looking] + row; 
tc := compass.hmovG [looking] + column; 
end ; 
seewhat := maze [tr,tc]; 
if seewhat in legals then 
begin 

if seewhat = '+' then seewhat := '*'; 



( * temp row * ) 

(* temp column *) 

(* what he finds * ) 

(* what he's allowed to see *) 



(* what he may see 



(* figure where he's *} 
(* looking *) 



(* aha, he sees it! *) 



where he's been is same *) 
as a wall: can't go there *) 



case seewhat of 

'*': if Theseus". looking = northwest then POP (Theseus) 
else Theseus" . looking ;= succ (Theseus" . looking) ; 
(* that was a wall or someplace he's been before *) 



PUSHON (Theseus , maze .compass) ; (* 



•M' 



begin 



begin 

minotaur := dead; 
maze [tr,tc] := 'W 
end 
end 
end 
else 
begin 

writeln ('What is that?'); 
POP (Theseus) 
end 
end ; 



(■ 



a passage! * ) 
fight the Minotaur ! 
it keels over ... * ) 



(* Initialize *) 
done := false; 
ARRAYSTART (maze , compass } ; 
new (Theseus ) ; 
with Theseus" do 
begin 

row : = ; 

column := -1 ; 

looking := east; 

string := nil 
end ; 
PUSHOtJ (Theseus, maze, compass) 
READI^IAZE (maze); 
writeln; 

writeln ('Original maze: '); 
PRINTMAZE (maze); 



(* start out, 1st push moves to 0,0 *) 



Here's the main program. 



(* now go chase Minotaurs *) 

repeat 
begin 
if Minotaur = dead then with Theseus" do 
begin 

if (row<:l) or (row>m) or (column<i) or {column>n) then 

done := true ; 
if not done then 
begin 

maze [row, column] := 'T' (* leave string *) 

end ; 
POP (Theseus) 
end 
else SEARCH (Theseus, maze, Minotaur, compass) 
end 
until Theseus ". string = nil; 
writeln ; 

if Minotaur = dead then writeln ('Theseus has slain the Minotaur'} 
else writeln ('Theseus is a jerk. The Minotaur lives.'); 
writeln ('Here is where he went:'); 
writeln ; 

PRINTMAZE (maze) 
end . 



68 



COMPUTEI 



September/October. 1980, Issue 6 



Some routines 
from Applesoft 

PQSIC Jim Butterfield, Toronto 

Routines were identified by examining specific 
memory dumps. There may well be other versions of 
Basic; the user is urged to exercise caution. 

The addresses given identify the start of the area 
in which the described routine lies. This may not be 
the proper program entry point or calling address. 

DISK ROM Description 

0800 DOOO Action addresses for primary 

keywords 
0880 D080 Action addresses for functions 
08B2 D0B2 Hierarchy and action addresses for 

operators 
08D0 DODO Table of Basic keywords 
0A60 D260 Basic messages, mostly error messages 
OB65 D365 Search the stack for FOR or GOSUB 

activ ity 
OB93 D393 Open up space in memory 
0BD6 D3D6 Test: stack too deep? 
0BE3 D3E3 Check available memory 
OCIO D410 Send canned error message, then: 
0C3C D43C Warm start; wait for Basic command 
0C5C DiJSC Handle new Basic line input 
ODOF D50F Rebuild chaining of Basic lines 
0D2E D52E Receive line from keyboard 
0D59 D559 Crunch keywords into Basic tokens 
0E1A D51A Search Basic for given line number 
0E49 D6149 Perform NEW 
0E6A D66A Perform CLEAR 

OE99 D697 Reset Basic execution to start 
0EA7 D6A5 Perform LIST 
OF68 D766 Perform FOR 
102A D828 Execute Basic statement 
104B D849 Perform RESTORE 
1070 D86E Perform STOP or END 
1098 D896 Perform CONT 
10B2 D8B0 Perform SAVE 
10CB D8C9 Perform LOAD 
1114 D912 Perform RUN 
1123 D921 Perform GOSUB 
1140 D93E Perform GOTO 
116D D96B Perform RETURN/POP, then: 
1197 D995 Perform DATA: skip statement 
1 1 A5 D9A3 Scan for next Basic statement 
HAS D9A6 Scan for next Basic line 
IICB D9C9 Perform IF, and perhaps: 
11DE D9DC Perform REM: skip line 
11EE D9ED Perform ON 
120E DAOC Input fixed-point number 
1248 DA46 Perform LET 
12D1 DACF Perform PRINT 
133D DB3A Print string from memory 
135A DB57 Print single format character 
1374 DB71 Handle bad input data 
13A3 DBAO Perform GET 
13B5 DBB2 Perform INPUT 
13E5 DBE2 Perform READ 
14E2 DCDF Canned Input error messages 
14FC DCF9 Perform NEXT 
1558 DD55 Check type mismatch 
157E DD7B Evaluate expression 

1635 DEB2 Evaluate expression within parentheses 
I6BB DEB8 Check parenthesis, comma 



16CC 


DEC9 


16D8 


DED5 


1713 


DF10 


1752 


DF4F 


1768 


DF65 


17D0 


DFCD 


17DC 


DFD6 


17E6 


DFE3 


18E6 


EOED 


18FB 


E102 


1917 


E11E 


1AD7 


E2DE 


lAEB 


E2F2 


1AF8 


E2FF 


1AFF 


E306 


IBOC 


E313 


1B3A 


E3J41 


1B4D 


E354 


1BBE 


E3C5 


1BCC 


E3D5 


1BDE 


E3E7 


1C49 


E452 


1C7B 


E484 


1D8E 


E597 


1DCB 


E5D4 


1DF4 


E5FD 


1E2C 


E635 


1E3D 


E646 


1E51 


E65A 


1E7D 


E686 


1E88 


E69I 


1EB0 


E6B9 


1ECD 


E6D6 


1ED3 


E6DC 


1EDC 


E6E5 


1EEC 


E6F5 


1EFE 


E707 


1F3D 


E746 


1F49 


E752 


1F5B 


E764 


1F72 


E77B 


1F7B 


E784 


1F97 


E7A0 


1F9E 


E7A7 


1FB0 


E7B9 


2095 


E89E 


20CC 


E8D5 


20D1 


E8DA 


210A 


E913 


2138 


E9t1 


2179 


E982 


21DA 


E9E3 


2205 


EAOE 


2222 


EA2B 


2230 


EA39 


2247 


EA50 


224C 


EA55 


2257 


EA60 


225D 


EA66 


22F0 


EAF9 


2315 


EB1E 


234A 


EB53 


235A 


EB63 


2369 


EB72 


2379 


EB82 


2387 


EB90 


23A6 


EBAF 


23A9 


EBB2 


23E9 


EBF2 


241A 


EC23 


2441 


EC4A 


24CC 


ECD5 


2501 


EDOA 


2510 


EDI9 


2517 


ED20 


252B 


ED34 


265B 


EE64 



Syntax error exit 

Setup for variables 

Set up function references 

Perform OR, AND 

Perform comparisons 

Perform PDL 

Perform DIM 

Get variable name, location 

Setup array pointer 

Evaluate integer expression 

Find or make array 

Perform FRE, and: 

Convert fixed- to-floating 

Perform POS 

Check not Direct 

Perform DEF 

Check FNx syntax 

Evaluate FNx 

Perform STR$ 

Do string vector 

Scan, set up string 

Build descriptor 

Garbage collection 

Concatenate 

Store string 

Discard unwanted string 

Clean descriptor stack 

Perform CHR$ 

Perform LEFT$ 

Perform RIGHT$ 

Perform MID$ 

Pull string data 

Perform LEN 

Switch string to numeric 

Perform ASC 

Get byte parameter 

Perform VAL 

Get two parameters for POKE or WAIT 

Convert floating-to-fixed 

Perform PEEK 

Perform POKE 

Perform WAIT 

Add 0.5 

Perform subtraction 

Perform addition 

Complement accum#1 

Overflow exit 

Multiply-a-byte 

Constants 

Perform LOG 

Perform multiplication 

Unpack memory into accum#2 

Test & adjust accumulators 

Handle overflow and underflow 

Multiply by 10 

10 in floating binary 

Divide by 10 

Perform divide-by 

Perform divide-into 

Unpack memory into accum#l 

Pack accum/M into memory 

Hove accum/f2 to /M 

Hove accum/fl to #2 

Round accum//l 

Get accum/n sign 

Perform SGN 

Perform ABS 

Compare acoum/M to memory 

Floating-to- fixed 

Perform INT 

Convert string to floating-point 

Get new ASCII digit 

Constants 

Print IN, then: 

Print Basic line if 

Convert floating-point to ASCII 

Constants 



September /October. 1980, Issued 



COMPUTIl 



69 



2684 EESD Perform SQR 

268E EEg? Perform power function 

26C7 EEDO Perform negation 

26D2 EEDB Constants 

2700 EF09 Perform EXP 

2753 EF5C Series evaluation 

279D EFA6 RND constants 

27A5 EFAE Perform RND 

27E1 EFEA Perform COS 

27E8 EFF1 Perform SIN 

2831 F03A Perform TAN 

285D F066 Constants 

2895 F09E Perform ATM 

28C5 FOCE Constants 

2902 F10B CHRGET sub for zero page 

29IF F128 Basic cold start 

29DC F1D5 Perform CALL 

29E5 FTDE Perform IN# 

29EC F1E5 Perform PR// 

2A2C F225 Perform PLOT 

2A39 F232 Perform HLIN 

2A48 F241 Perform VLIN 

2A56 F24F Perform COLOR= 

2A5D F256 Perform VTAB 



Applesoft 

memory 

map 

(Page O) 



2A6g F262 Perform SPEED= 

2A74 F26D Perform TRACE, NOTRACE 

2A7A F273 Perform NORMAL, INVERSE 

2A87 F280 Perform FLASH 

2A8D F286 Perform HIMEM: 

2AAD F2A6 Perform LOMEH: 

2AD2 F2CB Perform ONERR: 

2B1F F318 Perform RESUME 

2B38 F331 Perform DEL 

2B8C F3gO Perform GR 

2B95 F399 Perform TEXT 

2B9B F39F Perform STORE 

2BB8 F3BC Perform RECALL 

2BD4 F3D8 Perform HGR2, HGR 

2C0D FMll Varous graphics subroutines 

2EE5 F6E9 Perform HCOLOR= 

2EFA F6FE Perform HPLOT 

2F1A F721 Perform ROT= 

2F20 F727 Perform SCALE= 

2F62 F769 Perform DRAW 

2F68 F76F Perform XDRAW 

2F6E F775 Perform SHLOAD 

2FE0 F7E7 Perform HTAB 



Hex 

GOOD 

OOOE 

OOOF 

0010 

0011 

0012 

0013 

0014 

0015 

0016 

0024 

0050- 

0052- 

0055- 

005E- 

0062- 

0067- 

0069- 

006B- 

006D 

006F- 

0071- 

0073 

0075 

0077 

0079 

007B 

007D 

007F 

OOSl- 

0083- 

0085- 

0087- 

0090- 

0093- 

009D 

009E- 

00A2 

O0A3 

00A4 

00A5- 

OOAB 

OOAC 

OOAD- 

OOBl- 

00B7 

00B8- 

oocg- 

0200- 



0051 
005^4 
005D 
0061 
0066 
0058 
006A 
006C 
006E 
0070 
0072 
0074 
0076 
007 8 
007A 
007c 
007 E 
0080 
0082 
0084 
0086 
OO8F 
0092 
009c 

00A1 



OOAA 



OOAE 
00C8 

0OB9 
OOCD 
02FF 



Decimal 
13 
14 
15 

16 

17 

18 

19 

20 

21 

22 

36 

80-81 

82-84 

85-93 

94-97 

98-102 
103-104 
105-103 
107-108 
109-110 
111-112 
113-114 
115-116 
117-118 
119-120 
121-122 
123-124 
125-126 
127-128 
129-130 
131-132 
133-134 
135-143 
144-146 
147-156 
157 

158-161 
1§2 
163 
164 

165-170 
171 
172 

173-174 
177-200 
183 

184-185 
201-205 
512-767 



Description 

Search character 

Scan-between-quotes flag 

Input buffer pointer; // of subscripts 

Defa ult DIM flag 

Type: FF=string, 00=numeric 

Type: 80=integer, O0=floating point 

Flag: DATA scan; LIST quote; memory 

Subscript flag; FNX flag 

0=INPUT; $40=GET; $98=SEAD 

Comparison Evaluation flag 

Position on print line 

Integer value (for GOTO etc) 

Pointers for descriptor stack 

Descriptor stack(temp strings) 

Utility pointer area 

Product area for multiplication 

Pointer: Start-of-Basic 

Pointer: Start-of-Variables 

Pointer: Start-of- Arrays 

Pointer: End-of-Array s 

Pointer: String-storage( moving down) 

Utility string pointer 

Pointer: Limit-of-memory 

Current Basic line number 

Previous Basic line number 

Pointer: Basic statement for CONT 

Current DATA line number 

Current DATA address 

Input vector 

Current variable name 

Current variable address 

Variable pointer for FOR/NEXT 

Work area, pointers, etc 

Jump vector for functions 

Misc numeric work area 

Accural/ 1 : Exponent 

Accumi/l: Mantissa 

Accum// 1 : Sign 

Series evaluation constant pointer 

Accum//1 hi-ordeer (overflow) 

Aocurai'/2: Exponent, etc. 

Sign comparison, Acc#1 vs #2 

Accum//1 lo-order (rounding) 

Series pointer 

CHRGET subroutine; get Basic char 

Sub entry: get prev character 

Basic pointer (within subrtn) 

Random number seed. 

Input buffer 



70 



COMPUTEI 



September/October. 1980, Issue 6 



Exciting, entertaining software for the Apple II and Apple II Plus' 




If yoj liked 'Invaders , you II love ASTEROIDS IN SPACE by Bruce Wallace, Your space ship is traveling in the riiiddleol a shower of asteroids Blast the .isleroids 
with lasers, but beware — big asteroids fragment into small asteroids' The Apple game paddles allow you to rotate your space ship, lire its laser gun and give it 
thrust to propel it through endless space. Erom time to time you will encoynter an alien space ship whose mission is todestroy you. so you'd belter destroy it hrst' 
High resolution graphics and sound effects add to the arcade-litie excitement that this program generates. Runs on any Apple II with at least 32K and one 
i^isk drive. On diskette - $19.95 




FRACAS'" by Stuart Smith. A fantastic adventure game like no other 
— up to eight players can participate m FRACAS at the same time 
Jonrney in the land of FAROPH, searching for hidden treasure while 
warding off all sorts of unfriendly and dangerous creatures like the 
Ten Foot Spider and the Headless Horseman You and your friends 
can compete with each other or you can |oin forces and gang up on 
the monsters Your location is presented graphically and sound 
effects enliven the battles. Save your adventure on diskette or 
cassette and continue it at some other lime Requires at least 32K 
of RAI^ Cassette: S19.95 Diskette: $24.95 



BATTLESHIP COMMANDER'" hy Erik Kilk and Matthew Jew A game 
of strategy. You and the computer each start out hy positioning five 
ships of different sizes on a ten by ten grid Then the shooting starts 
Pface your vofleys skillfully — a comfiination of logic and luck are 
required to beat the computer. Cartoons show the shipssinkmgand 
announce the winner Sound effects and ffashing fights also add to 
the enjoyment of the game Requires at least 32K of RAfVI 
Cassette: SM.95 Diskette $19.95 











FASTGAMMON'" by Bob Christiansen, 
Sound, hi res cofor. and cartoons fiave 
hefped maked this the most popufar 
backgammon-playing game for the 
Apple fl But don't lettheseentertiiining 
features fool you - FASTGAMMON 
plays serious backgammon. Requires at 
least 2^\{ of RAM 
Cassette S19.95 Diskette $24.95 




' AptJle II' 5ntl AddIp 11 Plu^ 
Irnrifmarh Ql Apple Compurff 



QUTiLrry softw7ir€ 

6660 Reseda Blvd., Suite 105, Reseda, CA 91335 

WHERETO GET IT: Call usal(213| 3'1'1 6599 lor the name of the Quality Soltware dealer nearest you II necessary, you 
may order directly From us MasterCharge and Visa cardholders may place orders by telephone and we will derluci $1 
from orders over $19 to compensate lor phone charges. Or mail your order lothe address atiove. Caliloima residents add 
6' sates tax SHIPPING CHARGES' Within North America orders must include S 1 50 for first class shipping and handling. 
Outside North America the charge lor airmail shipping and handling is $5 00 — payabie in US currency 



September/ October. 1980. Issue 6 



COMPUTH 




Designing 
Your Own 
Atari Graphics 
IVIodes 



Craig Patchett 
Program Design, Inc. 
11 Idor Court 
Greenwich, CT 06830 



The graphics modes that Atari supplies with their 
400 antj 800 computers are nice, but what if you 
want a httie more? For example, how about a large- 
type heading, with a smaller-type sub-heading below 
it, all over a graphics display? Terrific, you say, but 
you're not an Atari engineer? Don't worry about a 
thing. With this article, a little concentration, and 
some time in front of the keyboard, you'll have Atari 
graphics modes performing at the snap of your 
fingers. 

First, a simple explanation of what we'll be do- 
ing. In a series of memory locations deep inside your 
Atari rests a special list of numbers that tell the com- 
puter which graphics mode it's in. Each time you 
change graphics modes, this list also changes. But 
wait a minute. Why a list of numbers instead of just 
one? Because there is one number for each graphics 
row on the screen. For example, in graphics mode 
2 -F 16 (no text window) there are twelve graphics 
rows, so there would be twelve numbers in the list. 
For graphics mode 7 + 16, there would be ninety six 
rows, or ninety six numbers. The table labeled 



Modes and Screen Formats in your Atari BASIC 
reference manual shows the number of rows in each 
graphics mode. We'll be referring to it again later. 

As I said before, when you change graphics 
modes, using the GRAPHICS command, the list 
changes. It may become longer or shorter, depending 
on the mode, and the numbers in it will change. But 
the numbers will all be the same. Obviously, since 
they stand for the graphics mode of each row on the 
screen, if half of them were one number and the 
other half another, then half of the screen would be 
one mode and the other half another. This is not 
how Atari BASIC was designed. It is, however, what 
we want. So what we're going to be doing is chang- 
ing the numbers in the list to make the screen behave 
the way we want it to. Let's take a look at exactly 
how it's done. 

How Much of Each Mode Should I Have? 
The first thing we have to do is figure out exactly 
how we want the screen to look. Let's take the exam- 
ple from the beginning of the article-a large-type 
heading (mode 2), with a smaller-type sub-heading 
below it (mode 1), all over a graphics display (mode 
3). Unfortunately, we can't just decide to have, for 
instance, four rows of mode 2, two rows of mode 1, 
nd nine rows of mode 3. There's a simple rule we 
have to follow in deciding how many rows of each 
mode we're going to have. 

You may already know that your television pic- 
ture is made up of hundreds of little lines going 
across the screen from top to bottom (if you don't 
you know now!) If you look closely at the screen, you 
can probably see them. These lines are formed by a 
single beam of light that scans the screen very quick- 
ly (sixty times a second) to make the picture, so we'll 
call them scan lines. The part of the screen that your 
Atari lets you use for graphics has 192 of these lines. 

Each graphics row is a certain number of scan 
lines "high". In mode 1, for example, each row is 
eight scan lines high. If you look at the Table of 
Modes and Screen Formats that I mentioned 
before, you'll see that there are twenty-four rows in 
mode 1 (remember, we're only interested in "full 
screen"). Surprise! Twenty-four rows, each eight 
scan lines high, means 8 x 24 = 192 scan lines in 
all. To figm-e out how many scan lines high the rows 
in other modes are, just look at the table and divide 



72 



COMPUTEI 



September/Ocfober. 1980. Issue 6 



192 by the number of rows in a full screen. 

The reason we need to know all this is because 
we must make our new mode so that it has a total of 
192 scan lines. No more, no less. This means you 
have to do a little bit of juggling around with the dif- 
ferent modes you want to use, but it's really not all 
that difficult. I'll demonstrate with our example. 
Let's suppose we need three rows of mode 2 and two 
rows of mode 1. All we need to do is figure out how 
many rows of mode 3 we should have to make a total 
of 192 scan lines. We look at the table and figure out 
that in mode 2, each row is sixteen (192 scan lines/12 
rows) scan lines high. Since we want three rows of 
mode 2, that makes fourty-eight scan lines so far. 
Similarly, we want two rows of mode 1, which uses 
eight (192 scan lines/24 rows) scan lines for each 
row. So that makes another sixteen scan lines, or 
sixty-four all together, which leaves us 192 - 64 = 
128 scan lines still left over. We'll use these for mode 
3. We look at the table again and see that mode 3 
uses eight scan lines for each row also, so how many 
rows do we need? 128 leftover scan lines/8 scan lines 
per row' of mode 3 = 16 rows of mode 3. 

So now we know that our graphics mode is going 
to have three rows of mode 2, two rows of mode 1, 
and sixteen rows of mode 3. Let's tell the computer. 

How Do I Tell The Computer? 

We have to start by putting the Atari in a graphics 
mode it understands. Of course, we can't use just 
any mode, but this time the rule is a lot easier. Out 
of the modes you're going to be using, take the one 
that uses the most memory (look at the table under 
"HAM required"). In our example, mode 1 uses the 
most memory, so the first line in our program is: 
10 GRAPHICS 1 

The next step is to find out where the list of numbers 
begins. Since it isn't always in exactly the same 
place, we must PEEK into the computer's memory 
at two locations that tell us where it is. Since we'll 
need to use the number that tells us where the list 
begins later, we'll give it a name: 

20 BEGIN = PEEK(500) + PEEK(561)*256 + 4 

This line will always be the same no matter what 
modes you are going to be mixing. 

The third step can be ignored if the mode you 
want at the top of the screen is the same as the one 
that uses the most memory. If not, as in our example 
(mode 2 is at the top of the screen, mode 1 uses the 
most memory), then we have to change the number 
in the memory location right before the beginning of 
the list. The table below shows what number to use 
for the mode at the top of the screen. 

MODE 012345678 
NUMBER 66 70 71 72 73 74 75 77 79 

So, Ibr our example, we would need: 

25 POKE BEGIN-1.71 



Remember, only do this step if the first graphics row- 
is not the same mode as the one that uses the most 
memory. 

Now we just have to go down the list and 
change the numbers that need to be changed. The 
numbers for the graphics mode with the most 
memory are already correct, since we start in that 
mode. Therefore, all we have to change are the other 
numbers. In our example, that would be the 
numbers for mode 2 and mode 3. To make the 
necessary changes, we simply POKE BEGIN + row 
number with the correct number for the mode we 
want in that row. What are the correct numbers? 
Just subtract sixty-four from the numbers in the table 
I gave above. That would mean, for example, seven 
for mode 2, and eight for mode 3. So we have: 

30 POKE BEGIN + 2,7:POKE BEGIN + 3,7 
which takes care of mode 2. Note that we didn't 
POKE BEGIN -I- 1. This was automatically taken 
care of when we POKEd BEGIN-1 in line 25. 
Remember that we also don't have to worry about 
the numbers for mode 1, since they are already cor- 
rect. Therefore, all that's left is to change the 
numbers for mode 3. Since we want sixteen rows of 
mode 3, which means changing sixteen numbers, 
we'll use a FOR/NEXT loop to make life easier: 

40 FOR ROW = 6 TO 21:P0KE BEGIN + ROW, 

8:NEXT ROW 

Now the list has the correct mode numbers in it. 
There's still one more thing we must do. Since there 
may be a fewer number of rows now than there were 
in the mode we told the computer to start with, we 
have to tell the computer where the new end of the 
list is. We do this by POKEing the nuniber sixty-five 
into the row number right after the last one we used. 
This tells the Atari to go back to the beginning of the 
list. We also tell it where the beginning is. For our 
example: 

50 POKE BEGIN + 22,65:POKE BEGIN -i- 23, 
PEEK(5 60):POKE BEGIN + 24, PEEK(561) 

And now we're done. Note that the only changes 
that you would need to tnake in line 50 when design- 
ing your own modes is in the numbers 22, 23, and 
24. These are just the three row numbers after the 
last one you use on the screen. 
How Often Do I Have To Do All This? 
This whole procedure must be repeated whenever 
you watu to use a specially designed graphics mode. 
You can't skip any of the steps except for the third 
one, and then only under the condition I already 
described. 

So Now What Do I Do? 

The last thing I'm going to cover, brieih-, in this ar- 
ticle is how to print and draw in your new mod(\ 
This (jnly applies if the row you want to jjrint or plot 
on is within the normal range for whatever mode it 
is. In simpler terms, if we had put the si.xteen rows 



September/OcJober, 1980. issue 6 



COMPUTE! 



73 



The ATARI® Tutorial 



CDI^PJTER Calligraphy! 



1 



FONTEDIT 
FONTEDIT 



Well, not really! But with the FONTEDIT program in IRIDIS #2 

you can design your own character sets (or fonts) for the 
ATARI. For example, you can create a Russian alphabet, or 
APL characters, or even special-purpose graphics symbols. 
These special fonfs can be saved on disk or tape for later use 
by your programs. FONTEDIT is a friendly, easy-to-use 
program; just grab a joystick and start designing. 



With our KNOTWORK program, you can design patterns of 
CeWlc interlace, (a technique used by 7th century Irish monks 
to illuminate manuscripts). After you have produced a pretty 
pattern on the screen of your ATARI, you can save itondiskor 
tape. As you might expect, KNOTWORK uses custom graphics 
characters that were created with FONTEDIT. 




FONTEDIT and KNOTWORK are available now in IRIDIS #2, the second of our ATARI tutorial program packages. 
You get a C-30 cassette or an ATARI diskette with our excellent programs ready to load into your ATARI. Best of all, 
IRIDIS #2 comes with a 48-page User's Guide, which gives clear instructions on how to use the programs. The 
Guide also provides detailed, line-by-line descriptions of how the programs work. (IRIDIS programs are written to 
be studied as well as used.) Our Hacker's Delight column explains many important PEEK and POKE locations in 
your ATARI. 

The User's Guide also includes Novice Notes for the absolute beginner. We don't talk down to you, but we do 
remember how it feels to be awash in a sea of bytes and bits and other technical jargon. If you are new to 
programming, IRIDIS is one of the easiest ways you can learn how to get the most out of your ATARI. If you are an 
old hand, you'll be delighted by the technical excellence of our programs. (We are the people who have published 
CURSOR for the Commodore PET since July, 1978.) 

ATARI is a trademark of ATARI, Inc. 



Published By: 




Box 550 

Gole'a CA 93017 

805-96; -0905 

Dealer Inquiries Invited 



ORDER FORM 

IRIDIS #2 - Fontedll and Knotwork 

D SI 5.95 Cassette D $18.95 Disk 

IRIDIS #1 - Clock, Zap, Logo, Polygons 

D S9.95 Cassette D $12.95 Disk 



Name . 
City 



_State. 



-Zip. 



D Visa D MC Card No. 
Expires 



.Signature. 



IRIDIS requires 16k for cassette. 24k for disk. 



74 



COMPUTEI 



September /October, 1980. issue 6 



of mode 3 at the top of the screen, and mode 2 at the 
bottom, then mode 2 would have been in rows 19,20, 
and 21. But mode 2 usually only has twelve rows, so 
if you tried to print on line 19 you would get an er- 
ror message. Now, there is a way around this, but 
it's somewhat complicated so I'm going to leave it 
for a future article. For now, however, you can use 
the following rules as long as you stay within the 
normal range of the mode you're working with. 

The first thing you have to do is POKE location 
eighty-seven with the number of the graphics mode 
for the row you want to PRINT or PLOT in. Next, 
POSITION the cursor and PRINT, or PLOT and 
DRAWTO. When you tell the Atari to POSITION 
X,Y or PLOT X,Y, the X value is still the number 
of spaces in from the left that you want to go. The Y 
value is still the number of rows down from the top 
that you want to go, but you may have to experi- 
ment with different values to get it exactly where you 
want it. Just make sure that you remember to POKE 
87 with the mode number you're going to PRINT or 
PLOT in. 

To help you understand what I just said, and to 
show off the example mode we've been working on, 
try entering these lines, as well as the other ones that 
arc included throughout the article. When you've 
entered them in, just RUN the program, and BREAK 
it when you're done. Notice that the commands for col- 
ors are the same in the new mode; that is, you can still 
print different color letters and use the COLOR com- 
mand for graphics points, etcetera. The one difficulty 
that might ari.se is when you mix mode with other 
modes. Since mode has a different background color 
(blue) than the other modes (black) you will have to use 
the SETCOLOR command to make the mode rows 
invisible. Otherwise, you should have no problems 
whatsoever, 

€Q SETCOLOR 4.4.2^REi1 BACKGROUm 
70 POKE S7.. 2: POSITION b.O^PRINT #6; "THIS 
IS^^POSITICW .3. IMPRINT #b;"GRHpHICS fiOu 
E"^ POSIT ICH 8.2^ PRINT Sb; "Ti'iO" 

89 POKE y?.. IMPOSITION b..3^PRINT #bj "this 
i5"^pijSITI0f-l l;4 = PRIrn" #-t;.;"Hr-aphic5 mod 

e one" 

90 POKE S7. 3= COLOR S^FOR LINE=1 TO 3=PL0 
T 15.LIh£:i5+3MDRHWTn 22..LIW£;i:5+3MhE<T LI 
f-E^PLOT 22.. i3M0RHi'jTn 22 ..23 

leO GOTO ICfrT^REn KEEP GRAPHICS ON SCREEN 

Look Ma, New Modes! 

That's all there is to making your own graphics niodes 
on your Atari computer. The easiest way to make sense 
of everything I've covered here is to experiment. Start 
off by changing the example program and watching 
what happens, and then try designing your own 
modes. Just a little praruce and in no time you'll be an 
expert. Above all, have fun doing it; after all, the Atari 
works for you, not the other way around. 



SOFTWARE FOR THE 

ATARI®400/800 



Quality Software' offers important software to 
owners of ATARI 400 aryd 800 computers. All 
programs are on cassette. 

ASSEMBLER by Gary J. Shannon Create your own 6502 machine 
language programs with this easy-to-use in- RAM editor/assembler Requires 
16K or more of RAM to operate. Look at all the features you get for less than 
$25! 

• Insert delete, edit source code lines 

• Save source code on cassette 

• Save object code (any part of memory) on tape 

• Print out assemblies 

• View and modify memory 

■ Pseudo Ops: 0RG,08J,EQU,HEX,ASC,OADS.EWD 

• Printer and video control (P0N,POF,V0N,VOR 

• All 6502 mnemonics plus BLT.BGE 

• Commenting allowed 

• Error checking 

• Documentation includes notes on interfacing 

machine language to BASIC 

• Price —$24.95 



6S02 DISASSEMBLER by Bob f^ierce This neat BK BASIC program 
allows you to disassemble machine code and print out the disassembled 
listing. If you have more than 8K of memory programs in RAM can be 
disassembled. Operating System ROM and the BASIC ROM can be 
disassembled on any size ATARI, Also works as an ASCI! interpreter, 
translating machine code into ASCII characters $11,95 



FASTGAMMON~ 

by Bob Christiansea The most popular 
backgammon-playing program for per- 
sonal computers is now available for 
the Atari This is the best-playing 
version so far and includes the option 
to enter your own dice rolls. Set the 
display £peed to your liking— play fast 
or slow. Beginners find.it easy to learn 

backgammon by playing against the computer, and even very good players 
will find it a challenge to beat FASTGAMMON. Includes 12 pages of 
instructions that include the rules of the game. Written in machine language. 
Requires only 8 K of RAM. $19.95 



QUTILiry SOFTW7IR6 

6660 [Reseda Blvd . Suite 105. Reseda. CA 91335 
Telephone 24 his. 7 days a week (213) 344-6599 



WHERE TO GET IT: Ask your nearest Atari dealer to see Quslil/ Softwsies Alan 
programs, 0,r, if you prefer, you may order directly Irom us [vlasterCharge and 
Visa cardholders may telephone tne,ir orders and we will deduct SI Irom orders 
over $19 lo compensate lor phone charges Or mail your order lo the address 
abow, California residents add 6'. sales tax Shippmi: Cftar.i'es Within North 
America orders must include $1,50 for first class shippinj; and handling Out- 
side North America Ihe charge for airmail shipping and handling is $5.00. 
payable in US. currency 





AIARI, StARLlOO anil AIARI800 ri,ivi 
CnmnunicfllfCin*; Company 



tiiVn tr.i<1h'rii,irl.H.|| [-^ Afarj f*.<T 



.irnnf.ijt.^/ '^v^lpms i Wnrnpr 



September/October, 1980. Issued 



COMPUTEI 



75 



What To Do 
If You 

Don't Have 
Joysticks 



Steven Schulman 



Use of joysticks with the ATARI computer can add 
excitement to your programs. But what do you do if 
you don't have joysticks yet and aren't ready to buy 
them? Are you out of luck? Do you have to type in 
numbers to select from a menu of answers? Does it 
mean you can't use games like IRIDIS' ZAP or the 
latest from your computing magazines? No! There's 
another way. 

In amongst the bits and bytes that make up the 
memory of your ATARI, any time you press a key 
on your keyboard the value of the 764th word 
changes. By taking a peek at what number is there 
you can find out which key it was. Listing I shows 
you how to find out what the value will be when any 
key is pressed. Try running it and pressing different 
keys, shifted and unshifted, reverse video, etc. When 
you finish use the break key to stop the program. 

"How does this help solve my problem of not 
having joysticks?" you may ask. To see this you 
have to know what happens when you use the 
joysticks. If your program has a line I = STICK(l), 
the value of I will be one of 9 possible values depen- 
ding on the position of the joystick when that line is 
reached. The values will be 



10.. 



11- 



14 



•15- 



13 



where the value of I = 15 means that the joystick is 
in the upright position. In addition, J = STRIG(l) 
will have a value J = if the fire button is pressed 



and a value of J = I if the fire button is not pressed. 

Returning to what we know about the value of 
the last key pressed, we found that the values for the 
arrows were: 

= 14 = 7 
= 15 = 6 

and the values for the shifted arrows were 

Shift = 78 Shift = 71 
Shift = 79 Shift = 70 

Finally, the value for the space bar is 33. 

We can therefore have the same results as we 
would get from using a joystick by using the arrows, 
shift arrows and space bar. The shift bar will be our 
firing button, the arrows will be the obvious up, 
down, left and right, and the shift up will be to the 
upper left, the shift down will be to the upper right, 
the shift left will be to the lower left, and the shift 
right will be to the lower right. Any other key or no 
key at all being pressed is equal to the Joysticks being 
in an upright position. 

The routine in listing II will play the part of a 
joystick. After calling the subroutine the value of 1 
will be the same as would have been returned by I 
= STICK{1) and the value of J will be the same as 
what would have been returned by J = STRIG(l). 
When you do buy your joysticks, simply replace the 
subroutine call and remove the subroutine from your 
program. Happy computing! 
Listing I 

100 I = PEEK (764) 

110 ? "I=";I : REM PRINT THE VALUE OF THE KEY 

PRESSED 

120 POKE 764,255 : REM TELL THE COMPUTER 

THAT NO KEY WAS PRESSED 

130 FOR PAUSE = 1 to 500 : NEXT PAUSE : REM 

SLOW DOWN THE MACHINE SO YOU CAN READ 

THE RESULTS 

140 GOTO 100 

Listing II 

100 JOYSTICK = 

SUBROUTINE 

no GOSUB JOYSTICK 

120 ?"THE 'JOYSTICK 



1000 : REM LOCATION OF 



REM CHECK THE 'JOYSTICK' 
HAS VALUE = ";I 



130 ?"THE 'FIRE BUTl^ON' HAS VALUE = ";J 

140 FOR PAUSE = ! TO 500 : NEXT PAUSE 

1.50 GOTO 110 

1000 REM JOYSTICK SUBROUTINE 

1010 I = PEEK (764) 

1020 J = 1 

1030 POKE 764, 255 



1040 IF I = 14 THEN I 


- 14 


; RETURN 


1050 IF I = 79 THEN I 


- 6 ; 


RETURN 


1060 IF I = 7 THEN I = 


= 7; RETURN 


1070 IF I = 70 THEN I 


= 5 : 


RETURN 


1080 IF I = 15 THEN I 


= 13 


; RETURN 


1090 IF I = 71 THEN I 


= 9 : 


RETURN 


1100 IF 1 = 6 THEN I = 


= 11 : 


RETURN 


1110 IF I = 78 THEN I 


= 10 


: RETURN 


1120 IF I = 33 THEN 1 


= 15 


: J = : RETURN 


REM FIRE BUTTON 






1130 I = 15 : RETURN 







76 



COMPUTEI 



September/October, 1980. Issue 6 



Screen Print 
From Machine 
Language On 
Tlie Atari 



Larry Isaacs 



If you are doing machine language programming on 
the ATARI, it can be very advantageous to know 
where some of the operating system subroutines can 
be found. I can provide you with only one at this 
time, but it's one of the handier ones. This is the out- 
put subroutine for the Editor device. It accepts the 
full ATASCII character set, printing the displayable 
character on the screen, or executing the control 
characters. To use the routine, simply load the 
character into the accumulator and execute a JSR 
SF6A4 instruction. The only other fact needed is that 
the X and Y registers aren't preserved by this 
subroutine. 

To illustrate the use of this subroutine, the 
DUMP program is provided. This program also il- 
lustrates one way of using machine language whh 
BASIC. The program asks for starting and ending 
addresses, which should be given in hex. Then the 
requested memory is dumped on the screen by a 
machine language program executed by the USR 
command. 

Naturally, before the machine language can be 
executed, it must be placed in memory. This is done 
by the BASIC subroutine in statements 10200-10430. 
This subroutine loads machine code found in DATA 
statements, which begin at line 20000 in this pro- 
gram. The farst thing the subroutine does is read the 
number of bytes in the machine language program. 
It then dimensions DYM$ to length 1 and an array 
called STORAGE of sufficient size to hold the 
machine code. 

The subroutine then starts reading the data as 
strings and POKEing the appropriate code. If the 
string read doesn't start with a special character 



{ 



tt S » ( ( ♦ t > 



", or "! ") then the string is 



assumed to be two hex characters which are stored in 
the next available byte. If the string begins with a 
".", then the string is assumed to be a comment and 
is ignored. If it begins with an "*", the subroutine 
assumes the rest of the string is four hex characters 
which form a two byte address. This address is 



POKE'd low byte first, then the high byte. If the str- 
ing begins with a " + ", the rest of the string is 
assumed to be four hex characters which form a two 
byte displacement from the beginning location of the 
code. This displacement is added to the beginning 
location of the code to ibrm a tvvo byte address. This 
address is also POKE'd low byte first, followed by 
high byte. If the first character is an " = ", then the 
rest of the string is assumed to be a displacement as 
with "♦". However, once the address is computed, 
the current poke location plus one is subtracted from 
this address to form a one byte displacement which is 
POKE'd into the next location. Finally, if the first 
character of the string is an "!", the subroutine stops 
loading machine code. The rest of the string is 
assumed to be a two byte displacement as with the 
"*", and the computed address is checked with the 
current poke location to see if it matches. If they 
don't match, it's likely that you've miscounted some 
bytes and that some of the displacements given by 
strings starting with the "*" or " =" character are 
in error. 

This may seem somewhat complicated, but it real- 
ly makes it fairly simple to write relocatable code. This 
relocability is necessary because you don't know where 
the code will be loaded until the program is running. 
Relative addresses used by branch instructions may be 
given as a hex byte or as an " = " followed by the 
displacement from the beginning of the program. In- 
ternal absolute addresses should be given with a " H- " 
followed by the displacement. And finally, external ad- 
dresses can be specified by giving two hex bytes, or by 
an "*" followed by the address. 

Once the code is loaded, ADR{DMY$) gives the 
first location. This also happens to be the entry point of 
the machine language dump program. Now the dump 
routine can be executed by calling for the USR func- 
tion to be executed with ADR(DMY$) as its address. 
This is done on line 80 of the BASIC program. 

It is important to note that the dump routine can 
only be executed while the BASIC program is running. 
Trying to execute it by a direct command will not work 
because the direct command gets inserted in between 
the end of the program and where the machine code 
has been poked. This will cause the machine code to be 
mo\ed; and since it contained some internal absolute 
addressing, it will not execute properly any more. If the 
code contains no internal absolute addressing, it can be 
executed by a direct command. 

The machine code is fairly simple, so you should 
be able to understand what it is doing. Upon entry, the 
machine code first checks to see if the right number of 
parameters are present. If not, the parameters are pull- 
ed off the stack and the program returns to BASIC. If 
the correct number (2) i.s present, the machine code will 
dump the requested memory, printing 8 bytes per line. 
Hopefully you will find some of the techniques us- 
ed in this program u.seful, as well as the program itself. 



ATARI 800^ 

16- K Memory 

Expansion 

Board 

$179.95 \ 

• Plugs directly into the memory i 
expansion slot in your Atari ^ 

• Fully compatible with cun-ent 
hardware 

• Backed by a one-year 
warranty 

• Inquire at your local Atari > 
Dealer for this and other J 
fine JACC, Inc. 
products 




JACC, Inc; 

(Just Another Computer Company) 

543 West Golf Road 

Arlington Heights, IL 60005 

Dealer/Distributor Inquiries Invited 

Dealer Line: 312-364-6268 

On the west coast contact Micro Distribution, Inc. 

2612 Croddy Way, Santa Anna, CA 92704 714-641-0205 



Atari is a trademark of Atari, inc. 



7S 



COMPUTE! 



September/October. 19BO. Issue 6 



1 DIM Sft$(4)..EA$(4> 

10 GOSUB 10260 

20 F-RIh^T "I^firr STAf^:TING RDDRESS".: 

25 IH^IT SA* 

36 F'RINT "K^FUT EtOIM] ADOFESS".: 

35 imJl tPf$ 

40 l-WRD-|=&H$ MIB^BUB 161Q0 

50 SA=HWDRD 

60 i-ai!$=EH$ m7>jje: lyiee 

70 EA=hMjRD 

80 DUmV=USR< ADR( DriYI ) . SA . Eh ) 

90 GOTO 20 

180W0 F£M iJiPUTE NEYTE FR0i1 hEKf- 

10018 I=rGOSUB 1004y:beYTE=y*lt 

1002*0 I=2^QJSLIE: 1094Q^NBVTE=NBYTE+::-- 

10030 F.£TL1RH 

10040 X=ASC( HEX*( l,l-> )-hSK "5" ) 

10050 IF "0"<=!€X$(M) AUG HEX*(I.-I)<=" 

9" T}€H RETURW 

10060 IF "A"<4€Xf(I.. I ) ftUD HEX*<: I . I )<=" 

F" J}Bi X=X-7^ RETURN 

10070 STOP ^REM ERROR 

18180 REfl iJJtPUTE maw FROM UQRDf 

10110 HEX*=WJF'D$( 1.2)^ GOSUB 1 8030 : fl.|ORD= 

NB"t'TE*256 

101 20 HEX*=WuRD$i:: 3.4)^ QJSUB 1 mm ■■ tWORn= 

^w:lRD+^eYTE 

10130 RETURN 

102-00 F£t1 FiJT T^€ CODE 

10210 RfAD H--mi \UmR OF BYTES 

10220 Did CrX£$( 40 ) > HEX*'' 2 ). IWRuK 4 >. DHY 

$< 1>; STORAGE'-.: t'l-b+l) 

10230 F'C=HOR(OfTT'l-> 

10240 F£AD iJjCEf 

10245 IF CLCe*(Ll)="." THEN GOTO 10240 

10250 IF CCC£*( 1.1 ■'=">;" THEN GOTO ly30fi 

18260 IF OiX£$(l..l ::'="+" THEN GJTO 19310 

18265 IF uOOEf( LI :■="=" THEN GOTO 18350 

10270 IF CUDE$(L1)="!" THEN GOTO 10410 

18280 HEX$=COOEI( 1.2)^ GOSUB 10900 

102"?0 F1>:E FO..hJeYTE^PC=F'C+lM:uTO 1S240 

10300 I'iiJRCtf-CCCiEl-'; 2 . 5 :> ■■ QKUB 1 9 1 00 ■ GriT:' 

ia320 

103 1 HjRi:!$=CODE*( 2 .. 5 ' ■ GOSUB 1 y 1 60 ^ NwORD 

=nrjRD+AOF:( Drrfi ;■ 

10320 t€YTE= IHT( NW0F:0/256 ) 

10330 POKE PC,-f-^U0RD-HBYTE:^^25b 

10340 PC=PC+l:y:iTO Ui290 

10350 W0RD*=C0DE*(2.5>:G0SUB lOlOO 

10360 NBYTE=hDR( DMY* '+r)WORO-( F'i:+ 1 ■ 

10370 IF HEYTE>127 THEM STOP 

10380 IF ffJYTE';-123 THEh^ STOP 

10390 IF NEYTE<0 WB\ ■^BYTE=NBYTE+256 

10400 GOTO 10290 

1 04 1 UiJF:D:$=rODE-|( 2.5)^ GOSUB 1 1 OO 

10420 IF HWORn=pr-HCR(DNYt:;i THEN RETURN 

10430 STOP ^REh ERROR 

2'W080 DATA 13.- 



29010 DATA 


0600 . 4C , +0030 


.Jtf' START 


20020 kEM 


IKPNTR 




28030 CiATA 


.■0yO3:Efc...D4.. . 


I HO Fi'TR 


26648 DATA 


.906o.. D0..=66O9. 


.t?E ei 


20050 DATA 


.>5>:v,Efc*.D5. . 


I HO PtlTR+l 


20ObU FEh ■ 


ii 




26670 DATA 


6809.. 60. . 


RTS 


20080 Rt.M PRBVTE 




2'9090 DATA 


.680A.48. . 


F-HA 


29100 DATA 




LSR A 


20116 DATA 


i^i"!".' A/, 

.-J-jbL .■ th... . 


LSR H 


20120 DATA 


.0660,. 4h. . 


LSR H 


201^:6 UATA 


.006E.4A. . 


LSR H 


20140 UATA 


yyOF.. 28.. +06115. 


.JSR PRNYBLE 


291jO DATA 


.3912.65. . 


FtA 


29160 DATA 


t>Ji3.29.0F> . 


AND M0F 


29170 REM F 


-•RrfrBLE 




26190 DATA 


.0015; 09. Oh.. . 


CMF' tt$yft 


26190 DATA 


0017..30.=v>JlB. 


.Bt1I &2 


26200 DATA 


.0019/65.06., . 


ADC #$06 


20210 REM i: 


12 




20220 DATA 


.691B.b3.30.. . 


ADC «30 


29230 DATA 


.001D..23.:^:Fe>A4.. 


,JSR OUTCHR 


29240 DATA 


.&32O.60-. . 


RTS 


20250 REh TSTPHTR 




20260 DATA 


.i3fi2i.3S. . 


ao 


29270 DhTA 


.6922. AD.. +9-320-. 


.LD-H EA 


20-230 [tftTA 


.0025.E5..D4. . 


SBC RKTR 


26290 DATA 


.iSi27.hO.+002E. 


.LDA EA+1 


26300 DATA 


.9fi2H.Ej.Dj. , 


SBC P^ITF:+1 


20310 DATA 


.6y2O.F.0. . 


RTS 


20320 RErl E 


!h 




20330 DATA 


.K12D..09.S0. . 


.I'iDRD 


20340 REM L 


;OIJMT 




28350 DATA 


.^2F.. 06.. . 


. BtTE 


20360 F£f1 :: 


iTART 




2-0370 DATA 


. t-Si30. 63. . 


FIA 


20380 DATA 


.0031. F0. =0009. 


.BEQ 21 


20398 DATA 


.00.33.09.02.. 


cm #$02 


20400 DATA 


.0035.F9.=003E. 


.BEQ CONTIWE 


iWlO DATA 


.6037. AA. . 


TAX 


20420 F:Eh e 


3 




2'043O DATA 


.0038.63. . 


PLA 


20440 DATA 


.tW39..63. . 


FIA 


29456 [lATA 


.003 A. Oh. . 


DEX 


26460 DATA 


.603B.. D6.=6038.. 


.EtE 1^3 


201465 [sATA 


.'6030.69. . 


RTS 


2*0470 REn 


orrrinE 




2'0480 DATA 


.6fi3E.6y. , 


PLA 


20490 DATA 


.t30.3F.85.D5. , 


STA PNTR+1 


20500 DATA 


.6£i41.b3. . 


FIA 


26510 DATA 


.0042.b-5.D4. . 


STA F-HTR 


26520 DATA 


.6044.68. . 


FIA 


2ff530 DATA 


,0045.8O.+002E.. 


.STA EA+1 


28540 DATA 


.*J4S.bS. . 


FtA 


20550 DATA 


.Ki49. SO. +1*320. 


.STA Eh 


2'9560 F:Eh DIIP 




20570 DATA 


.604C.A'9.9B. . 


LDA #EOL 



Sepfember/October, 1980. issued 



COMPUTEI 



79 



205S0 


DATA 


004E 


20.4F6A4. 


JoR 


LriJTCHF: 


28590 


DATh 


.©51 


A9.24.. . 


IDA 


rt 


20600 


DATA 


0053 


20..:*:F6A4.= 


...SSR 


OUTCHF; 


26610 


tsATA 


0056. 


H5.D5. . 


LDA 


PtTTR+l 


2yb'i'U 


DATA 


8053. 


28..+000A.. 


■m 


F'RE''/TE 


20630 


DATA 


0y5B. 


Aj.D4. . 


LDA 


PHTR 


2'6640 


DATA 


0050. 


^vj^+uyGA.. 


.JSR 


F'REYTE 


2'6650 


DATA 


9060. 


h9.20,. . 


LDA 


#' 


28660 


DATA 


t>J62. 


20.:*:F6A4.. 


M. 


CtUTCHR 


2'0670 


DATA 


0065 , 


A3.0S. . 


LDA 


#$&3 


2'66Se 


DATA 


tJ067. 


8D.. +002F,. 


STA 


i::afHT 


2'y696 


m\ U 


JOP 








2'y7Gy 


DATA 


&36A, 


Ay ..20; . 


LDA 


tt' 


20710 


DATA 


806C. 


20/s'Ft+i4.. 


.m 


OiJTCHF: 


20720 


DATA 


0i^i6F. 


H0,00.. . 


LD'i' 


#$00 


26730 


DATA 


iSi71 


B1..D4.. . 


LDA 


(FtrrR)Y 


29740 


DATA 


0073. 


20, +000 A., 


JSR 


F'RBYTE 


20758 


U-ATA 


m76, 


20..+bBa3. 


■JSR 


IfCPKTR 


20760 


DATA 


0079. 


CE.+002F. 


KG 


IJOLWT 


20770 DATA 


0S7i::. 


DO ,,=01.369.. 


Br€ 


LOOP' 


20780 


DATA 


0a7E. 


20.. +0021,. 


Ji;R 


TSTPHTR 


20790 


DATA 


GS&L 


ly,.=004t;.. 


Efl 


DLir-p 


2Wciyy 


DATA 


0033. 


A'5..9E;.. . 


LDA 


#EOL 


20810 


DATA 


'®55j 


2y::^^FbH4; 


.j;r 


DUTCHR: 


201:;^ y 


UATA 


0033 . 


60.. . 


RTS 




20c:30 


DATA 


0039 









COMPUTE needs you! Let us know 
who! interesting opplicotions 
you're coming up with for your 
Atari. 



Star Fleet to All 



VVho'.s the turren! riianip of Star RaicitTs? Sfiuj 
ill your l>est score, couiincnis arui [jhnint; .stnitr- 
gios to C:OMPL'TK, P.O. H<,x 5406, Grccn.shoro. 
NC 27403. 
Attn: "'Atari Gazette" 



Announcina 




software " 

fronn the 

Quttiors of 

An Invitation to Programming 



exciting games 

and educational programs 

for kids, 

teenagers 

and 

adults 

featuring sound 

and color graphics, 

available on 

guaronteed-to-load 

cassettes 

at fine 

computer dealers in your 

area or, 

v\/rite us directly for 

descriptive materials 



< 




Program Design, Inc. 

Department CA 

11 idar Court 

Greenwicti. CT 06830 

203-661-8799 



so 



COMPUTEl 



September/October, 1980, issue 6 



Graphics Of 
Polar Functions 

Henrique Veludo 
353 West 56th Str. #116 
NYC NY 10019 

This program will plot polar functions such as roses, 
spirals, polygons, on the high resolution screen of the 
ATARI 800, with input from the programmer. The 
general equations for converting the polar coor- 
dinates to rectangular coordinates are as follows: 



sinO = S 

r 




X,Y 



X = rcosO 



y = rsinO 



First the program will display a function menu (line 
100), then ask the user to input which function to 
display, together with its parameters, INCR(ement) 
and SC{ale). The INCR(ement) is the interval in 
degrees that the computer uses to "increment" the 
angle T from to 360 . One must decide whether 
the speed of execution or accuracy in plotting is 
preferable. A small INCR(emenl), e.g. 0.1, will 
draw a very accurate graph very slowly. A larger IN- 
CR(ement), e.g. 5.0, will draw much faster and less 
accurately. An INCR of 1.0 is a good compromise. 
The SC(ale) is included to allow the graph to fill 
most of the screen. Without it, some functions will 
appear too small, others will be too large to plot. A 
SC(ate) between 10 and 100 should do for most func- 
tions. Lines 220 to 226 check for a input that might 
confuse the program and display an error message. 
Line 230 asks if the x-y axes arc to be displayed and 
lines 390-395 display them. Lines 300-370 will select 
random colors and intensities {with enough separa- 
tion to be visible). Lines 400-690 contain the calcula- 
tion and plotting routines for x,y. In line 410 the 
variable U is included for use with the spiral function 
and dictates how many revolutions the spiral will 
have; it can be changed at line 222. Line 420 con- 
verts degrees to radians (in this context the program 
seems to work better with radians but it could be 
converted to degrees, with the DEG function, and 
changing the values of the functions). Line 430 will 
direct the program to the proper function chosen in 
the input. Lines 610-620 calculate the x,y coor- 



dinates. Line 630 will check for an out-of-range cur- 
sor, stop the drawing, and avoid an error message. 
Line 670 will activate the buzzer to signal that the 
plotting is over. Lines 680-690 wait for a key to be 
pressed to clear the screen and return to the menu. If 
the buzzer sounds without anything being plotted, it 
means that the function is too large to plot. 
(Decrease the SC(ale) value to continue.) I chose to 
use random-selected colors. They could be chosen by 
the user in an input statement as well (where you in- 
put the parameters after the menu display). 

Here are some values for the functions that work 
beautifully: 

R = Q:SC = 4:INCR=60 

R = 2(I-SIN(Q)):SC = 20 

R »= COS(2 SIN(6 (Q))):SC = 90 

R = SIN(COS(IOO Q))iSC = 90 

R = COS(2 SIN(2 QJ);SC = 90 

R = I:INCR = 45:SC = 60 polygon 

R = 2(I+COS((i)):SC = 20 

R = SIN(3(Q)):SC = 80 

R = SlN(4COS(2Q}):SC = 90 

R = COS{3SIN(Q)):SC = 90 

R = COS(SIN(IOO Q)):SC = 90 

R = I:INCR = I20:SC = 80 triangle 

10 REM PROi^KIhM to PLOT POLAR FUHCTIOHS 
20 REI1 BY he*; I QUE UEUJDO FOF; ATrF:I :-J00 
80 DIM mil)' 

90 ■■^■' ") " 

ise'pOSITICW 7A^l "(J:APrtE; iJF FiJLAR FLIC 

TIOTB" 

110 F*OSITIl>^ 2.3 ^'T- "FWCTIOH riBIJ^"=? 



120 ? " 
It 


1 >R=B*Q 


SPIRAL 


130 ? " 


2>R=A:>'(l+CCiS(Q)) 


CAPXUO 


ID" 






140 ? " 


3>R=A:*(1-SI^^<Q>>" 




150 ■"• " 


4>R=A:^;SIN(B|:Q> 


RGEE" 


160 ■ " 


z:^:^t\:iro(Bmy' 




170 ^- " 


b>R=C0S(A*SIH(B*Q;O" 




180 •"■ " 


7)R=SIH';A*C0SCB*Q);'" 




190 7 " 

H" 

200 ? =? 


s:.-R-A 


POLVGO 


:? "IHPUT:":^ 




210 ■■•■ "FUCTIOM ft>A..B,.IMCR./5C,"; 


: II-FIIT 



H..A..B.. If€R..:K 

220 IF H=0 T1€H H=l 

2'22 IF H=l im\ U=4 

224 IF R=0 im\ A=l 

226 IF B=0 THEH B=l 

230 ■■' ^? ^-^ "DO YOU I'iAHT T>E X-Y Al^^ES DI 

SFtAVED'^ 

240 I^PIJT m-l¥ A$(1..1)="V" Th€N W=l 

300 OXuR ^GR-AF-HICS 24 

310 I=IHT(R^£i(l>:n5> 

320 Ll=Ihn(Rtl](l>^S>*2 

330 L2=INT(R'H&;i>*8>*2 



Sepfember/October. 1980. Issued 



COMPUTEI 



340 IF ABS(L1-L2K4 THB-i 329 



35y SETC: 
360 ■EETC: 
370 S£TC; 



ClOR 4.LL1 
0L!3F^ 2.. LLl 
fJlfJR. 1..I..L2 



389 IF WOl T^€t■^ 419 ^FS1 —OISFIAY Al'^.ES? 

33ei FOR: I=M TO 319 STEP 4=PL0T l,96-\-E:AJ 

I 

395 FOR I=S TO 191 STEP 3^FtuT lb8,l=HEX 
T I 

400 FB-1 FtOTTIHG ilftLCULrtTIffli 

410 FiJF: T=0 TO 2mm STEF- l\Ck 

420 iM/S? , 3 

438 m H iJjTij 510 .. 528 .. 530 ,. 540 . 556 . 5bW . 57 

0.550 

500 Ffi1 ECHJRTIONS FOR R 

510 F?=B*Q^QJTO 610 

520 R^=ft:i^.(l+CiJKQ;') = GuTO 618 

530 F*=At.( l-S I \K Q ) > = GOTO 618 

540 F:=A:^::SIf*::B:C!) = GOTO 619 

558 F:=)H*i:ui;'.: B-^Q ^ QjTO 618 

56.0 F:=CLi3(A:^(SIH(Ei:|cQ>)M^T0 618 

578 R-SIH<A-CuS(EtQ>) = KiTu 618 

5S0 R:=A-QjTO 618 

600 R£M PLOTTIH: X.Y 

610 X=INT((R*DJS(Q>>*SC) 

620 Y= I NT( < R*S I W: Q ) ')tSC ) 

630 IF rBS(X»159 OR f^(V)>95 im\ 678 

640 IF T=M THEN FIOT 16&+X.%-Y 

650 CftAWTO ib0+K.-96-Y 

660 f-e;T T 

670 FOR: 1=1 TO 75^ POKE 53279,. 8 ^iCXT I 

675 I'^j 

6S0 I>1 ■■ ijF€H #1 , 4. 0, "K = " ^ GET #L X : aOSE 

*1 

690 FUT #6. 125: GOTO % © 



Reading the 
ATARI 

Keyboard on 
the fly 

James L. Bruun 

For most programs the normal method of using the 
INPUT statement to get keyboard characters into a 
program is perfecdy satisfactory. There are times, 
however, when we need to get a keystroke without 
stopping the program to wait for a key to be struck. 

The ATARI computer has all the features need- 
ed to enable the programmer to check the keyboard 



without waiting for an INPUT statement to get the 
character. Memory location 764 retains a key code 
for the last key pressed. Further, when the RUN 
command is executed, that ceil is set to 255 to in- 
dicate that no key has been pressed. During the run- 
ning of a program, that location can be POKEd with 
a 255 to indicate that we've checked it since the last 
key was pressed. 

The following program illustrates the use of 
these features in a subroutine. First, initialize an I/O 
buffer and string variable. 

10 OPEN #1,4,0, "K:" 
20 DIM CHAR$(1) 

Then build the subroutine. Always precede your 
block of subroutines with an END statement to pre- 
vent accidental execution. 

30 PRINT "(ESC) (CLEAR)" 

40 POKE 752,1 

50 GOSUB 5000 

60 IF CHAR = THEN 50 

70 POSITION 5,5 

80 PRINT "CHARACTER = (";CHAR$;") 

90 GOTO 50 

Most programs that would need this feature would 
perhaps be doing complex things if the keystroke has 
not occurred, but in this one we have chosen to 'do 
nothing' until a key is pressed. Q 




PRESCHOOL FUN 

{16K BASIC) This readiness program 

has two parts with several individual nnod- 

ules. Part one reinforces color, shape and 

number recognition. Part two has units on 

upper and lower case letters and directions. Mo 

reading required. Full color graphics and sound. 

cass. SI 5.00 

MATH FACTS - LEVEL 1 

''(16K BASIC) First in a series of self-paced instructional 
programs for elementary' school children. The program auto- 
' matically advances to the next unit when the child has mastered 
80^ of the work generated by the computer. The previous unit 
will be reviewed if the child cannot master 50% of the work in a 
particular uniL Concepts covered are: numbers, number place- 
ment and number words ( 1 -20), addition and subtraction (visual 
and abstract). (Grades K-2) cass. $15.00 

CRIBBAGE 

(24K BASIC) Play cribbage with the computer at two different 
levels. As a beginner, the computer will point out your errs without 
penalizing you. But watch out! At the intermediate level, the 
computer will peg your points if you don'L cass. $15.00 

CASIMO I 

(16K BASIC) Try your luck at the Lucky Lady . . . Play 
BLACKJACK . . . The computer will be the dealer foryou and your 
friends ( 1 -4 players). You can split and double your hand as you 
attempt to break the house. OR hit it big on the SLOT MACHINE. 
Two programs on one tape cass. SI 5.00 

•ATARI is a trademark of Atari, Inc. 
. , » ■ < 



1KH.E.S.I.S. 

PO, Box 147 

Garden Cily. Ml 48135 

or call (31 3)595-4722 for CO.D. 



Please add SI. 50 for shipping 
Mich, residents add 4% tax 
WRITE for FREE FLYER 
DEALER INGORES \S'ELCClME 



S2 



COMPUTE! 



September/October, I960, issue 6 




User's Report: 

Waterloo 
Structured 
Basic 
for the PET 

p. I. spencer 
7 Brightside Drive 
West Hill, Ontario 
Canada MIE 3Y8 

Waterloo Structured Basic comes in the form of an 
EPROM which sits al address hex 9000. After 
SYS'ing to 9*4096, you have all of standard PET 
basic, plus the following statements: IF (without 
THEN or GO'I O), ELSE, ENDIF, ELSEIF, IF- 
THEN-QUIT, LOOP, ENDLOOP, WHILE, UN- 
TIL, PROC, ENDPROC, and CALL. You also can 
insert as many blanks as you wish at the beginning 
of each basic line. 

The EPROM chip comes with a serial number, 
complete instructions for installation, a 161 page 
manual aimed at beginners to structured programm- 
ing, and a purchaser's registration carcL Future up- 
dates to the chip are said to be free to registered pur- 
chasers, provided the chip is returned for rebui-ning. 
The list price for this package is stated to be $150, 
with substantial discounts for educational institutions 
and bulk orders from users' clubs. For example, I 
purchased mine as part of a group of about iwenty at 
the Toronto PET Users' Club for $6L50. 

The idea behind the Waterloo structured ap- 
proach is apparently that a program should be 
readable to someone else, or to the programmer 
himself after one or two years. To aid comprehen- 
sion, you arc supposed to indent freely, any use of 
GOTO's hither and thither. 

After installing my chip and reading the instruc- 
tion manual, I sat down to redo a routine that I had 
written in standard PET Basic the week befoic (see 
figures 1 and 2). The subroutine is one for a general 
file management program I have. 

The file management program itself allows inc 
to create a file, with the number of fields per file 
record set at startup. For example, I ha\e a house 



in\-entory with the fields set as description, rc]jlace- 
ment value, date, and insurance category. Another 
file is a class list with the fields as student name, 
marks for N tests, and average mark, where N is 
generally different for each different class. Numeric 
fields are stored as strings (saves space) until calcula- 
tions, if any, need to be done. 

The subroutine shown in figures 1 and 2 allows 
me to change output format to the printer, .so that 
the file can be printed as a table without my having 
to stop the program and manually change the printer 
formatting line each time I want to print a different 
file table. There are probably better ways to do this 
than the one shown here, but this method illustrates 
the difference between Waterloo and standard basic 
quite nicely. 

Figure 1, the standard basic version, is not im- 
comprehcnsible, but neither does it go out of its way 
to be clear. However, it does have the advantage of 
being only 528 bytes long, whereas the Waterloo 
version is 831 bytes long. The Waterloo version, 
however, looks nicer and probably will be con- 
siderably csicr to understand six monih.s down (he 
road . 

The first, and most important, disadvantage of 
Waterloo basic that I ran into in writing the code in 
figure 2 is that when Waterloo Basic is enabled, you 
can't use Basic Aid, Brett Butler's Trace, or Pro- 
gramirier's Toolkit. I missed the convenience of be- 
ing able to race the cursor around the screen at high 
speed, being able to trace execution to find bugs, be- 
ing able to renumber when there was no space bet- 
ween lines and I had to add a line, and having the 
next available line number automatically appear on 
the screen. 

Since figure 2 gives the same results as figure 1 , 
it presumably luust be a correct, if pcrhajjs not par- 
ticularly elegant, use of Waterloo basic. Lines 60()() 
to 6380 are the Waterloo equivalent of GOSUB- 
RETURN, the difference being that a procedure can 
have a name, the name may be as long as you wish, 
and thus can be much more informali\c. 

Lines 6090 lo 6130 illustrate the use of ihe IF- 
ELSE-ENDIF construction. I found it c[uite difficult 
to break out of the IF-THEN GOTO hahii. 1 had 
become so used lo this in the two years I have had a 
PET that ii had become almost automaiic. 

The WHILE-ENDI.OOP construction in lines 
6190 to 6230 is handy, as the WHILE condition is 
evaluated first, unlike the standard FOR-NEXT con- 
struction, which goes through the loop once 
regardless of what value the inde.x variable has. 



September /October. 1930, Issue 6 



COMPUTE' 



83 



The Basic Switch 



Attention "Old" PerOwners: 

Not sure about the ROM Retrofit Kit 
from Commodore? 

Now you con use both sets of Commo- 
dore ROMs and others as weli. 
The Basic Switch allows switch selec- 
tion of either ROM set (your original set 
or your retrofit set) from Commodore. 
Plus, Model 15-A includes an additional 
zero insertion force socket allowing easy 
use of ROMs like the BASIC Programmer's 
Toolkit,., concurrently. 
(Model 15-A The Basic Switch plus ,. 
includes expanded cable 
assembly and zero insertion 
force socket. Your 15th ROM 
simply plugs in „. enabled 
while either ROM set is selec- 
ted. Socket 15 may be re- 
addressed by the user for 
additional flexibility. 
The Basic Switch is sold in assembled 
form only. All models are designed for 
easy attachment to your Pet with a con- 
venient coble assembly. No soldering or 
drilling is required. The Basic Switch 
mates with a coble assembly at your 
primary board, and does not use the 
physical connectors of any Pet ports. 
Model 15-A allows you to use the BASIC 
Programmer's Toolkit without the need 
for the additional S25.00 board or tying 
up your ports, And since we've designed 
the 15th socket to be reoddressobie, to 
take advantage of available ROM soft- 
ware. 

Price Schedule: Effective June 1, 1980 

Model 
15-A-24 
15-A-28 
$129.95 



The Basic Switch: 
With Installed ROM 

Retrofit Kit from 
Commodore: 

With BASIC 
Programmer's Toolkit* 



$214,95 



$179.95 



Model 15-A-24 or 28 with installed ROM 

Retrofit and Basic Programmer's 
Toolkit: $259.95 

Model 15-A-24 or 28 with installed ROM 
Retrofit and both BASIC Programmer's 
Toolkits: §304.95 

1. "Old Pets were shipped with 24 or 28 
pin ROMs. You must check which you 
have, and specify at time of order. 

2. *The BASIC Programmer's Toolkit is 
available in versions for "Old" Pets 
and retrofitted Pets. Order both from 
us with The Basic Switch and save 
the $25.00 Board cost plus an addi- 
tional $10.00. At the "package" 
price, you end up with both versions 
of the BASIC Programmer's Toolkit for 
$90.00. 

3. The Basic Switch line carries a 
repair/replacement warranty, F.O.B. 
South Bend, IN. This warranty does not 
cover any ROMs, but does cover all 
materials and workmanship in The 
Basic Switch and harness assembly. 

4. Ordering Information: We do not ship 
CO.D. Please include payment with 
order, or wait for your local dealer 
to carry The Basic Switch line. Visa/ 
Master Charge accepted. For mail 
order enclose address, name,account 
number, and expiration date. Dealer 
inquiries invited. 

marketed by: 

COMPUTER CENTER OF SOUTH BEND 

51591 U.S. 31 North 

South Bend, Indiana 46637 

(219) 277-4655 



Indiana residents add a% soles ta« All orders add S2.50 stiipping. 
Warning Removal and insertion of ROMs is o precise task. We encourage users lo 
seek professional assistorx:e for Installation We ossume no responsi- 
bilitv tor damage caused during insertion or removol. 

PGt™is a trademark of COmmodore Business Machines, 
Inc. of Santo Clara, Calif. Ttie BASIC Programmer's Toolkit 
is a product of Palo Alto IC's, A Division of Nestar Systems, 
Inc. Delivery times may vary subject to avoilobilitv of various 
ROMs, etc. Prices and specifications subject to ctiange witti- 
out notice. 



84 



COMPUTEI 



September/October. 1980. Issue 6 



Lines 6270 and 6280 toulcl prubably huvc been 
integrated as one, but I liked the syninietry with Hnc 
6220. The IF-THEN-QUI'I' construction i's much 
more convenient than the stantlarti IF-THEN-set in- 
dex variable fo maximum anti GOTO NEXT that 
iriiisi be u.sed lo keep the stack clean. The sliori cut 
in lines 6120 and 6160 of figure 1 is not [jaiticularly 
reconi mended, as sooner or later it will probably 
cause an POUT OF MEMORY ERROR because of 
stack problems. 

Lines 6040, 6330, and 6340 took some advance 
thinking, as I fmd it much easier to let it all happen 
at the end as an INPUT S2$: IF S2$ "Y" THEN 
6050 eonstrurtion, especially when in Waterloo basic 
I faced the [jrospcct of having (n go back and change 
(he identation of most of what had been written. In 
fact it was this that first decided tne io sit down and 
write out tiie Waterloo code before hacking away at 
the keyboard, a blessing in disguise, as the code in 
figure 2 woiked with much less debugging that that 
in figure 1, which WAS comjjosed at the keyboard. 

In summary, I would recommetnl Waterloo 
basic if you usually write programs longer than 4K, 
if your friends call your efforts patholcjgically com- 
plicad'd. or if you have already l:)een trained in struc- 
ttu'ed iM'ogianitning. On the other hand, I would nc)! 
recommend it if you are addicted to machine 
language utilities such as Toolkit, Trace, or Basic 
Aid, or if you ha\'e less than 16K of RAM (struc- 
tured programming ti^ades .s]>ace for readability). 
Anolher consideration is that if Waterloo basic gains 
the same acceptance as their WATFCJR and Wj\T" 
FIV did with Fortran, it may not be long before it 
becomes the industry standarcl, in which case you 
will HAVE to ha\'e it unless you ]:>lan to use tjnly 
your own programs. 



Figure 2: Waterloo Basic Coding 

IiVt;R:.;ir fofMhTTES' 



Figure 1: Standard Basic Coding 

i S U E- c* 6 Z^ 
£0 STiJP 

SO0O FS-IHT"ati'T't'RMIi:: FOSMHTTiHO!! 
PF'ET£f i-ENCER" 

seto iwpMT"HOH MflHv COLUMNS" :cl:; 

501'0 SX'I""" ECO;i>=-l 

SoSij F0RI = 1T0CL"; 

5540 PF:INT":(j;:OLUMM" .: I .: * INPUT"Tu STRCT 

hiT SPaCE".:5C:f:i:) 
6dm I.4PUT"HHri ENIi flT sPRCE";ECa' 
5055 IFSC(IK=CECa-i:) + l )THEM SRIliT 

"dtCiT pNSr.IELE**TRV RCfilN" HOTaSO'Se 
€-06& '<€':T\ 

€&3ii FOR.T = lTOCLr-; 

5 1 90 I P .T= 1 hHDSC a J =! THEH6 1 50 

5110 POP I =KTO ': SC ( .T > - 1 .") 

6120 m=m-y' " i;=K+t -iFioviOTi^Ef'iSi^j 

€140 NEXT I 

5150 FOPL=bC ■; .T ) TOEC < J > 

5160 lJf=l-;r+"H" : K=K+1 - IF-=>S-0THENt;iS5 

5 ISO ue;;tl 
6130 he'.;t.i 

5195 PRItJT":«]S::i;iLUMH FORtlHT IS" 

5200 PRIHTWf 

5210 INPUT "*K""; 32* 

5220 ]FS2*:::>"V"THEH60?e 

S23-& OPEt 1:3 .4.2: rr j hj^'^ , [.)s ■ CLOZE ? 

5240 RETURN 
RERDV. 



10 CULL 

20 STOP 

£000 PROC IiVHRtllC FOSMPTTt- 

5010 PPIHT"SriVf-;fiMIC FOPMPTTINo 

5020 IHPUT"l-iOM NRNV lOLUMNi:" :l 

501:0 ii:t="" ■EC(:oi=-i 

5040 I'lHILE -521: :: "V" 
5050 1=1 



iPE 



-■EiJCEP' 



505O JJHILE I ;=CL'; 

5070 -■PIWT"ti;:OLUKH". I- I-ipUT"Tn ;,TqK-T -. 

50-30 T f.ipiJT " HHIi EWIi ST ;P'Ri::F'' .EC'II ;■ 

50?0 IF SC ( I > ■•;= ( E C ■: I - 1 :■ + 1 ' 

5130 --PINT" jJirjT POS;IB^E*:*TRV nuRi'4" 

5110 ELSE 

5120 1=1+1 

5130 END IF 

5140 EHIiLOOP 

5150 l.Js="" 

5150 1=1 

5170 K=l 

51:50 LOOP 

5130 WHILE (>-:5Ca,' SHNIi -;/£::>: 1-1 :■ "■ 

5200 lJt=l.Jj-+" ■' 

5210 -:=f''+l 

5220 IF f:>:30 TnEK OUIT 

523ti ENHLOOP 

5249 WHILE h:;-=3C'I> 

5250 l.J*=lJ|:+"fl" 
5268 K=K+1 

527ti IF S':-:E0 THE.'; OUIT 

62:50 LiNTi._ I : EC. I ) 

5230 1=1+1 

5300 IP i:C-L'; THEf; yUIT 

5310 ENDLOGP 

5315 PRIHT":!!!:J:0LUMN FCiPMRT I;." 

6320 priht m 

53:30 INPUT" SSJi:!" ' V. '!''": ;:2i 

6340 FUDLOOP 

5350 0PEH3.4,2 

5350 PPINT#:3.. 

5370 Close 3 

5;-::3fi F^^fT^'-'PCj": 



:;Phi. 



Wf 




PET/CBM SOFTWARE 
SPECIAL - BUY 2, GET 1 FREE! 

Below Hems are S7.95 each, any three lor S15.90 
— WE PAY POSTAGE — 

NEW! JOYSTICK CONNECTION KITcontains all parts and mstrucl 
connect an ATARI joystick (SiO at Sears) to your PET. 

SPACED-OUT JOYSTICK GAMES W/CB2 SOUND Galact 
Race 

OTHER SOFTWARE: 

Billboard - Display messages in one-inch scrolling letters on screen 

Letter Squares - Tiie-sliding alphabet puzzle 

Hangman - Animated with the PETs excellent graphics. 

Card Sharks - Card gahie inspired by Ihe TV show. 
High Rollers - Dice game similarly prompied 



Target 



onsto 
Space 



I 



r r Li i^F' ;dFirQ:dt.ii_: y 



n rflPGEnT RVE FRuVIDEMlE-F;! i:i;:9ijp:^ 



Orders shipped within one week when payed by mpney order or cashier s chpct* 

R I residents ,idri 6"" tax 



Personal check?i Jtllow 5-7 weeks 



September /Octobef.l980. Issue* 



COMPUTE! 



85 



OMEGA 

SALES 
CO. 



"WHOLESALE COMPOTER PRICES" 
DIRECT TO THE PUBLIC 

12 Meeting St., Cumberland, R.l. 02864 



LUil 



TRS-80 
Model II • S330O 



i I 



Apple II 
16K- S'lO'ig 




IMTERTEC SUPERBRAIM 

32K RA-A S2449 00 

64K RAM ^2649.00 




Epson TX-80 - ^745 



PRODUCT SPECIAL 

OF THE MONTH!! mm 



I 



iiiiiiimifunH'mm\\mmm\\\\\\%wi 



A\\.--y.mm 



ATARI 




Atari 800 
$749.00 



NEC Spinwriter 
55I0-5W0 S2449 




Soroc 1 20 ■ 5699 






Products are 
NOW 

IN 
STOCK 

AT 

nMEGA 

Sales 

Co. 






CALL TOLL FREE FOR OMEGA'S PRICE! 



ilMEGA OFFERS THE BEST DELIVERY AND PRICE ON: 
APPLE . ATARI • TRS'80 MODEL 11 • INTERTEC • 
T.l. 810 • HEWLE7T-PACKARD-85 • SOROC • 
COMMODORE • INEC • QGME • CEMTROMICS 



aMEGA 
TOLL FREEiS 



OMEGA selis only factory fresh, top quality mercfiandise to our customers. 

IIMEGA will try to matcfi any current advertised price with similar purchase conditions. 

Before you buy anywhere else ■ be sure to call (IMEGA Sales Co. 

1-401-722-1027 or 



I- 800-556-7587 



TIM EGA ships via GPS, truck, or air. COD's, VISA, Mastercharge accepted. 
"A member in good standing of the better business bureau." 



V/SA 



COMPUTEI 



September/October, 1960. issue 6 



TelePET 

Jim Butterfield, Toronto 

This is the age of computers talking to other com- 
puters. There's no reason why your PET can't join 
in the conversation, too. New communications inter- 
faces for the PET are being announced fairly often 
these days. What's involved in the hookup? 

Most commercial offerings give you the whole 
package to enable you to hook up and be "on the 
air" fairly quickly. But since their technical ap- 
proaches are different, it's worth while to look at 
what a communications interface needs to do. 

Interface elements 

There arc several problems that need to be addressed 
in order to hook your PET to a telephone line. Star- 
ting at the telephone end, they are: 

1. The telephone company gets annoyed if you wire 
things directly to the telephone line, unless they are 
"approved" devices. The small user should also 
worry about the dangers to his PET: some hefty 
voltages can come from the telephone exchange. 

The easiest solution to this is an acoustic 
coupler. You fit your telephone handsel into one of 
these, and it arranges to make noises into the 
transmitter and to listen to the earpiece with a 
microphone. No electrical connection - sound power 
does the whole job. 

2. The telephone system was designed to carry voice, 
or sounds in a certain frequency range. The PET 
signal needs to be changed to an audible signal in 
order to be transmitted; at the other end, the sound 
frequencies need to be changed back into bits - the 
ones and zero that the PET needs. 

This problem is solved by a device called a 
Modem. A Modem consists of two parts: a 
modulator, which changes bits to tone frequencies for 
sending; and a demodulator, which changes the tones 
back to bits. 

3. You can normally send and/or receive only one 
bit at a time. PET handles eight bits at a time. 
Something has to take the eight bits from the PET 
(the "parallel" signal, since eight bits come out 
together) and fire them off one bit at a time (creating 
a "serial" signal, with one bit after the other). In the 
other direction, you must collect the eight bits, one 

at a time, pack them together and deliver them to 
the PET as a parallel eight-bit byte. 

Tied into this problem of parallel-to-serial con- 
version is a related job. Much of the time PET will 
have nothing to send. We must distinguish between 
an idle connection, where nothing is being sent, and 
an active connection which has a character under 
way. 

This last task is usually effected by a signal call- 
ed a start bit. The start bit is sent before the PET's 
information bits; it says, "here comes a character". 



If you don't use a start bit, you know that the line is 
idle. 

All of the above tasks can be performed in 
machine-language programs, or in a rather clever 
chip called a UART. Either way, you must arrange 
to send a start bit, then the eight data bits, one at a 
time, and then a brief pause (sometimes called a stop 
bit) before you start the next character. Coming the 
other way, the receiving PET mu.st wait for a start 
bit and then collect the eight data bits into a single 
byte. 

4. If you're communicating with a non-PET at the 
distant end, the other computer will probably want 
to receive a standard code called ASCII, and will 
send that code back to you. PET does not store 
characters in ASCII format, so that a little transla- 
tion will be needed in both directions. 

PET has characters that don't exist in ASCII. 
For example, most of the PET graphic characters 
don't have any corresponding ASCII characters. 
You'll ha\'c to give them up. 

There are a few ASCII characters that don't 
have any counterpart in the PET. Most of these are 
called control characters. You'll probably need a few 
of these for a good communications interface. Most 
commercial packages make them available with a 
two-key coinbination from the PET. For example, 
the keys Reverse, semicolon often generate the 
character known as ESC or Escape in ASCII; this 
character usually tells the distant computer to stop 
whatever it's doing and wait for a new command 
from you. It's a very handy character to know when 
the distant computer has started to send out a 
massive amount of data which you realize you really 
don't want. 

5. The physical connection at the PET is either the 
IEEE-488 bus or the Parallel User Port. If it's the 
IEEE-488 bus, the connected device will have to 
obey the protocols - recognizing when it's selected, 
receiving and delivering characters to the bus, etc. 

If it's the Parallel User Port, PET will need to 
contain a machine language program which is called 
by the user's program any time it is desired to 
receive or send. 

The IEEE-488 bus is simple to use - a normal 
PRINT# command will send data - but since the bus 
is shared with other devices, careful design is needed, 
Tracing the Flow 

Let's put the above together and track a character 
from the PET to the line, and vice-versa. 

1. PET decides to send a character. If the interface is 
via the IEEE bus, PET might simply issue the com- 
mand PRINT#7, "A"; or if the interface is via the 
parallel user port, the program might say, SYS 
30456, "A" There are many possible variations. 

2. The character- in this case, the letter A which is 
represented in PET text mode as hexadecimal Cl 
-must be translated to true ASCII. This might be 



Sepfember/Ocfober, 1980. Issue 6 



COMPUTE! 



87 




Skyles Electric Works 



**If you could own only one peripheral 
for your PET, it should be this. It opens 
the whole world to your PET.' 



»♦ 





The Cat: Switches for mode selection and 
operation. LEDs display unit status. 
Acoustic self-test is standard. Compact 
powerpack plugs directly into wall socket. 

Now S325.00* connplete with membership 
in The Source*, Skyles six-foot 
cable/interface to the PET user port, 
together with Skyles cassette program in 
machine language and in BASIC. 
(If bought separately: $180.00, modem; 
$80.00, cable/interface and program; 
$100.00, membership in Tlie Source') 

The Cat and D-Cat have been specially prepared by Skyles for interfacing to the PET 
user port (not to the IEEE port) and with a special cassette program, allowing 
communication 

. . .from modem to disk and disk to modem 

. . .from modem to terminal; read on screen, save on disk 

. . .from disk to printer through IEEE 

. . .from disk to screen 

The D-Cat: FCC-approved for handset jack 
connection with any modular phone, 
either single or multi-line. No need for 
adapters. Can fit under phone; installs in 
seconds. Mode switch to monitor voice or 
data transmission. Special "hold" func- 
tion; complete self-test, Power pack plugs 
directly into wall socket. 

Now S350.00* complete with membership 
in The Source", Skyles six-foot 
cable/interface to the user port and 
Skyles cassette program in machine 
language and in BASIC. 

(If bought separately: $210.00, the modem: 
$80.00, cable/interface and program: 
$100.00. membership in The Source') 

*What About the Source? 

Sometimes called "The Information Utility," it's a telecomputing network that gives 
you, through your Cat or D-Cat modem, thousands of programs and data bases and 
allows you to communicate with other users interactively and through electronic mail. 

•California residents please add 6% or 6,5°o sales tax as reqwrea 
VISA, MASTERCHARGE ORDERS CALL (800) 538-3083 (except California residents) 
CALIFORNIA ORDERS PLEASE CALL (408) 257-9140 




Skyles Electric Works 



231 E South Whisman Road 
Mountain View, CA 94041 
(415)965-1735 . 



86 



COMPUTEI 



September/October. 1980. issue 6 



done in either program or in hardware; in cither 
case, the result is hexadecimal 41. 

3. The parallel to serial translation now takes place. 
Once again, this may be done within a program or 
by hardware (a UART chip). A start bit is generated 
ibllowed by the eight bits of data; each is sent at the 
appropriate time. 

4. Each bit, as it is generated, is translated by the 
modem into an appropriate tone frequency. One fre- 
quency represents a zero bit, another represents a 
one bit. 

5. The tones generated by the modem are fed into a 
small speaker which is very close to the telephone 
handset transmitter. The sound from the speaker is 
picked up by the telephone and sent to the line. It's 
on the way... 

At the receiving end: 

6. The telephone earpiece has been making a whin- 
ing sound from the tone received from the line. The 
sound is picked up by a small microphone close to 
the earpiece. 

7. The signal reaches the modem which examines the 
tone and classifies it as either a logic zero or a logic 
one. It passes along the logic state - zero or one - to 
the serial to parallel translator. 

8. The serial to parallel translator waits patiently for 
a start bit (logic zero) to be received. When it sees 
this, it carefully collects the eight data bits at (he 
apropriate times. This might be done either in a pro- 
gram or in hardware (again, with a UART). 

9. The eight-bit character might be placed into a buf- 
fer or might just be held for pickup by the PET. In 
either case, the received character will need to be 
translated from ASCII into PET format. 

The Modem/Acoustic Coupler 
The modem and acoustic coupler are invariably 
packaged together. Speeds up to 30 characters per se- 
cond are generally available; lower speeds will work, 
but the highest rate of 30 cps is a virtual standard 
now. 

The Commodore interface packages everything 
into the modem/coupler case; IEEE bus interface, 
UART, the whole thing. Other suppliers use stan- 
dard commercially available modem/couplers and 
supply extra hardware and/or programs to complete 
the interface. 

The commercially available modems use an in- 
terface known as RS-232. It's nice to have this inter- 
face available, since you cannect other things besides 
modems to it. Various types of terminals, both video 
or hard copy, will hook up with no problems. 
Parallel/Serial interfaces and Buffering 
It's economical and flexible to use a program to do 
your parallel/serial interface, and buffering can be 
provided quite easily. It does take up memory space, 
however, and it can keep the PET rather busy: bits 
move in and out at a rate of one every three 



milliseconds or so. Your interlace from Basic will be 
rather more tricky, too: PRINT# or GET# won't 
make the connection too easily. 

Hardware costs more, but helps with some of 
these problems. You may not be liberated from the 
need lor special piograms, though. The mighty 
UART chip can only catch or send one character at 
a time. Unless you have buffering, PET will have to 
wait before the next character can be sent or received. 

The GPIB bus 

The IEEE-48B bus is ideal for sending or receiving 
characters from Basic. As always, however, there's a 
catch or two. If the device you're sending to is busy 
and can't catch the character you want to send it, it 
will probably hang up the bus so that everything 
stops until it's ready. The same thing may happen if 
you try to INPUT or GET a character or value that 
hasn't arrived yet; you'll either time out or wait. 

This isn't new. Many devices hold up the IEEE 
bus - the printer and the disk do it, for example. But 
with a communications interface, wailing time 
becomes a serious problem. You might lose a 
character if the bus is hung up waiting for something 
else to happen. It becomes more important to use the 
bus in a more sophisticated way. 
Looking them Over 

All of the above problems have been solved in a 
variety ol" ways by the various suppliers. A 
remarkable amount of ingenuity has been called into 
play, and the user has considerable choice. 

Check out the units available to see which ones 
fit your style. Hovv much of the package is hardware, 
and how much software? How easily can you inter- 
face with your own Basic programs? Can you attach 
devices olher than a modem? Does the unit contain 
buffering'^ How is (he translation to and from ASCII 
accomplished? Can you abandon ASCII if you 
choose and send directly from PET to PET, for 
graphics or program transfer? Hf)W much memory 
will you need in the PET? Will you need disk? And, 
of course, how mucli money will it all cost? 

There's no single answer. Find out what suits you. 

Communications interfaces are here. You'll see 
more of them used in the PET comnumity. One of 
these days, you'll be tempted to join the network. © 



September/Ocfober. I960, issue 6 



COMPUTE! 



89 



Word Pro 
Converter 

Robert W. Baker, BAKER ENTERPRISES, 
15 Windsor Drive, Atoo, NJ 08004 

An ever increasing number of programs make use oi' 
Commodore's Word Pro program with its excellent 
editing facilities to generate files for their own use. 
However, disk files created by Word Pro 3 are not 
fully compatible with those created or used by Word 
pro 4 on the 8016/8032. 

If you create any files on a 2001 series 
PET/CBM using Word Pro 3, you will have to do 
some editing to be able to use the same file on an 
8016/8032 CBM with its 80 column screen. This sim- 
ple utility program will eliminate the boring task of 
editing the file, and do all the necessary changes for 
you automatically. It will run on either a 2001 
PET/CBM or an 8016/8032 CBM; using a 2040 
disk. Remember, though, that the 2040 disk must 
have the DOS 2.0 ROMs if you are using an 
8016/8032 CBM. 

The Word Pro Converter program is very 
straight forward in operation and no fancy frills or 
options are included. The file to be converted must 
be on the diskette in Drive #0. The new file created 
will be written on the diskette on Drive #1 with the 
same name. If the file all ready exists on Drive #1, it 
will be deleted first. The only input to the program is 
the name of the file to be converted. It should be 
very simple to add an output file name option along 
with drive number selections if desired. During pro- 
gram execution, any disk error will be displayed and 
terminate the program. 

In theory, the program simply copies the file 
bytc-by-byte while counting characters and looking 
for a RETURN within each original 40 character 
line. Straight text that continues over several 40 
character lines is copied as-is, creating new 80 
character lines. If a RETURN is detected in any 
line, an extra 40 spaces are added at the end of the 
line whenever required to make the line 80 characters 
long. 

Mies stored by Word Pro 3 contain 40 
characters per display line regardless of content. 
Thus, if you have a single FP command on a line, 
there is a 37 byie overhead with Word Pro 3. Word 
pro 4, on the other hand, stores 80 characters per 
display line regardless of content. The same FP com- 
mand in Word Pro 4 will then have a 77 byte 
overhead! While Word Pro 4 has its advantages with 
the 80 column screen, the disk files created will be 
generally bigger than those created by Word Pro 3 
for the same text. This is especially true when there 
are a large number of formatting commands or blank 
lines. 



Program Variables 

E input ll)f status, fi-l = end-af'-fik- 

N Scharacicrs in input file line, 40 max 

P #char;K:U-rs in output flic line, HO max. 

R RETURN t:harai:tLM- Hag; = tio I = yes 

BS cliaracUT (l)ytc) bi-iii^ lujjii-ii 

100 REM ****************************** 

110 REM 

120 REM SIMPLE UTILITY PROGRAM 

130 REM TO CONVERT DISK FILES 

140 REM CREATED BY WORD PRO III 

150 REM FOR LOADING BY WORD PRO IV 

160 REM 

170 REM 

180 REM 

190 REM BY: ROBERT v;. BAKER 

200 REM 

210 REM BAKER ENTERPRISES 

220 REM 15 WINDSOR DR., ATCO, NJ 08004 

23 REM 

240 REM ****************************** 

250 : 
260 : 
270 PRINT"fi WORD PRO CONVE- 

-.R T E R 
2B0 PRINT"^}-iTHE FILE TO BE CONVERTED MUST 

-.BE ON 
290 PRXNT"ON THE DISKETTE IN DRIVE #0^^ 
300 PRINT"THE NEW FILE GENERATED WILL BE - 

-.WRITTEN 
310 PRINT"ON THE DISKETTE IN DRIVE #1, 
320 PRINT"WITH THE SAME FILE NAME.ii 
330 INPUT"FILE NAME ,<«" -.Fl^ 
340 IF FI5=". " THEN 330 
350 PRINT"^t-i.CONVERTING FILE, PLEASE -. 

-.WAIT. . . 
360 OPEN 15,8,15 
370 OPEN 5,8,8,"0: "-HFI$+",P,R" 
380 GOSUB 560 
390 PRINT#15, "S1:"+FI$ 
400 OPEN 6,8,9,"1:"-HFI$+",P,W" 
410 GOSUB 560 
420 GETS5,aS,B$:G0SUB 560 
430 PRINT#6,AS;B$; :GOSUB 560 
440 P=0 
450 N=0:R=0 

460 GET#5,B$:E=ST:G0SUB 560 
470 PRINT#6,B$; :GOSUB 560 
480 P=P-Hl:IF P=80 THEN P=0 
490 IF E=64 THEN PRINT"^t'xDONE M!^^": 

-.GOTO 610 
500 N=N+1 

510 IF ASC(B$)=31 THEN R=l 
520 IF N<40 THEN 460 
530 IF R=0 OR P=0 THEN 450 
540 FOR N=l TO 40: PRINTft6," ";GOSUB 560: 

-.NEXT 
550 GOTO 440 

560 INPUT#15,EN,EM$,ET$,ES$ 
570 IF EN=0 THEN RETURN 
580 PRINT"^yILDISK ERROR !!!* 
590 PRINT EN;EM$,ET$,ES5 
600 PRINT"^OPERATION ABORTED! 
610 CLOSE 5: CLOSE 6: CLOSE 15 
READY. 



90 



COMPUTEI 



Sepfember/October. 1980. issue 6 



Multitasking On 
Your PET? 

QUADRA-PET 

Charles Brannon 

QUADRA-PET is a machine language program that 
lets you paniiion the memory oC an upgrade ROM 
PET or CBM into lour 8K bloeks. Each block is an 
independent program workspace. Programs existing 
in each 8K partition can be selected and then used 
and modified without affecting any of the other pro- 
grams. You can jump lo any other of the |jrograms 
at any time. 

After initialization with SYS 926, PET displays 
the question: 

WHICH PET? 1 1-4] 
Perhaps Mary, an avid computer-games buff, types 
in "1" and loads STARTREK. She plays it ior a 
while and then leaves to eat lunch. Meanwhile, Bob 
goes to the PET, sees that someone is using PET #1 , 
and switches lo PET #2 to write a business program. 
After nearly "perfecting" it, he leaves to see what 
Mary is up to. Now the kids come in, and after 
arguing for a half-hour agree to share the PET, one 
using PET #3 and the other PET #4. Fortunately for 
Bob and Mary, nothing the kids do can harm their 
programs. 

How To Use QUADRA-PET 

1. Load or type in one of the \-crsions of QUADRA- 
PET. (Basic or hex) 

2. Enter NEW 

3. SYS 926 to initialize. 

4. PET will respond with WHICH PET? (1-4) 

5. Select the one you wish to use. 

6. Beiorc loading or typing in a program for the first 
time, type in NEW. 

7. To select another PET, SYS 826 and follow instruc- 
tions 4-7. 

Now comes the fun part -- how does it work? Many 
memory locations in zero-page (0-256) are pointers 
QUADRA-PET works with three of those pointers. 

On power-up, PET determines the end ol' 
memory by writing a character to every memory 
location and then reading it back. PET then in- 
crements a memory location until a I'ailure in reading 
that character occurs. This indicates that the v.nd ol 
available memory has been reached. Physical!)-, this 
pointer is at location 52 decimal. (S34). The second 
pointer is at the start of memoi'y, stored in location 
41. Originally, this points to the actual start of user 
memory, 1024. The last pointer is tlie end of text 
pointer. As you write your program it changes. 

QUADRA-PET partitions the memory by 
changing these pointers to point to successively 



higher memory locations, depending on whidi PET 
is in use. Since the end of text pointer changes, it 
must be sa\'ed before we move to a new PET and 
restored on return. QUADRA-PET, as it is in 
machine language, does all the.se things .seemingly in- 
stantaneously. 



HOW TO SAVE A PROGRAM PRODUCED 
WITH QUADRA-PET: 

1. S^'S 1024 lo Ko t<> till- .Miiriitd]-. 

2. Knirr: .M (KI2B ()(I2B arid typr Rl-:il"Ri\. 

3. 'I'liii will tjct a (lispl.i)- SI )i lift hi tig like; 

.: (1028 1)1 114 3E 04 

4. We will use only the first Ibui" byii'S. Wrju.- dnwn ilu- 

llr.st pair iii reverse order on pa()ei', lor L-.\;uii|ile: 

OKU 

I)n ilie same with the .■ieioiul pair. (e.g. (I4:il:) 

:>. Kiiut: .s •■i'roc; N.'WII-r'.Ol.XXXx'.Y^'VV 

uliere "PROG NAMK" is the name ol' your [jrosfram. 
XXXX is the first number you wrote down, and YYY"i' 
is the .second. For example, to .save the example prugraiu 
whieli we \vill call "PE'l" #1, vuiJ would enler: .S 
■■PH'l" i^l", 01.0401,0431". 

ti. Pre.ss RE'I'URN and press ])lay and reeord tn save 
your program. 

7. To load this saved program into a space prepared bv 

QL-.\DR.A-I'KT, just .SYS 1024 and enter .1. ■■PROG 
.\','\ME-" where '■PRtX; X.AME'' is the n.ime of your 
proi^iam. 



HOW TO LOAD A PRE-EXISTING PROGRAM 
INTO A SPACE PREPARED BY QUADRA-PET: 

I eiiuki tell yini how to do iliis on the old RO.\l I'l: 1' 
but quite fraiikly, 1 ean't find the memory loiaiinjis lor 
this procedure in the nevv PI''T. .All \'o(i PET experts ■- 
HELP! 

II you can fitjure i( out, please send iji the proeeduie 
lo COMPUTE. 



A little imagination will create tnanv uses lor 
QUADRA-PET. 

For education, it is the perfect way to keep four 
students' programs in the PET at the same time. 
Each j>rogram can be worked on and modified in anv 
way without affecting any other of the programs. 

In business, four different business programs can 
exist simultaneously in PET's memory, ready to u.se. 
For the small penalty of loading the programs into 
the program workspaces at the start of the day, all 
four are within reach of a carriage return -- faster 
than any disk dri\-e. 

Machine language programmers can lill partitions 
with useful routines, leaving one or more partitions 
for BASIC. QUADRA-PET itself is .short and easily 
relocatable. 

I would be interested to find out what novel and 
useful applications for QUADRA- PET yon can think 
up! 

Happy QUADRA-PETing! 
References 

(':BM User Manual 2001-32, ['lr.st Editioii. Commodore Busine.ss 
Marhine.s, inc., Palo .Alto, CA (1979) 



September /October, 1980. issue 6 



COMPUTil 



91 



Havfry li. I Iciniati, "Vlfiiiiii y I'.iriiiinii nlHA-SIC VVorksjj.Ku", 
COMPUTE, ijjj. 18-20 (,)an.,'F(.-lj. 19(i(l) 

Jim Buin-rllckl, "PET in Tr'aiisttion (mciiiiiry map) COMPUTE, 
p]>. 68-7(1 (Kill. 1979) 

REM*********** ********************** 



REM 

REM*********** 
REM: BY CHARLES 



QUADRA P 
******** 

BRANNON 
TO 941 



ET 
************** 



06/07/80 



FOR I = 826 
20 READ A 
30 POKE I, A 
40 NEXT 
50 SYS926 
60 END 

1000 DATA174,126,3,165,4 
1010 DATA43,157,135,3,16 
1020 DATA28, 202, 32,228,2 
1030 DATA201,5,176,245,1 
1040 DATA169,1,133,40,18 
1050 DATA189,131,3,133,4 
1060 DATA43, 169, 0,133, 52 
1070 DATA53,32,119,197,9 
1080 DATA96,3,3,3,3,4,2, 
1090 DATA32, 64, 96,128, 87 
1100 DATA32,B0,69,84,63, 
1110 DATA52, 41, 0,169, 0,1 
1120 DATAD,64,141,0,96,7 
READY. 



2,157,131,3,165 

9,143,160,3,32 

55,41,15,240,249 

70,202,142,126,3 

9,127,3,133,41 

2,189,135,3,133 

,189,139,3,133 

6,0,4,32,64 

64,96 

,72,73,67,72 

32,40,49,45 

41,0,32,141 

6,58,3 



Whyls fcURSQ RjSoGood? 

Maybe It's because we've always had tiigh standards. Be- 
ginning with our first issue in July. 1978, we ve published some 100 
programs for the Commodore PET m our first 20 issues, plus 20 
animated graphic Front Cover " programs Each program has 
been extensively edited by Glen Fisher, our Editorial Director. The 
result is obvious: Cursor programs reflect professional stan- 
dards We're proud of every program we publish. 

But there's something else, too. 

It's imagination. Our subscribers continue to be delighted 
with the new, fresh programming ideas that Cursor provides. 
Some of the best graphic animations for the Pet have appeared in 
Cursor. Teachers love us! They use Cursor as an example of 
what can be done on a PET. with some skill and imagination. 

Finally, there's ser^/ice. Orders for single issues are almost 
always shipped within 24 hours. New subscriptions are pro- 
cessed v;ilh[n five working days. Should you get one of our rare 
defective tapes, just return it (or an immediate replacement. And 
of course you can cancel your subscription at any time and we'll 
gladly refund all remaining issues. 

Cursor: Quality Imagination Service. 

For only S4.95 you can buy a sample issue and judge for 
yourself. Or send S27 for a six-issue subscription. You'll get six 
C-30 cassettes, each with five programs and a Front Cover ready 
to LOAD and RUN on your PET. With each issue you also gel our 
Cursor Notes, a lively commentary on the industry, as well as 
documentation for the programs. 



3 Sample issue of Cursor — S4.95 (CA. Res. add 6% tax) 
D 6 issues for S27.00 (U.S. & Canada) 



V. 



Pu«,s.odBy The Code 
Works 



Box 550 

Goleta. CA. 93017 

Phone 805-967-0905 



THE FLOPPY DISK ALTERNATIVE •U3„ie„a.,3„„,3„, 

• 500K storage per drive 



PET/BETA-1 




FLEXIBLE DATA MANAGEfMENT . . . MICRO-PROCESSOR 
CONTROLLED BETA-1 UNIVERSAL TAPE DRIVE BY MECA* . . , 
PERIPHERAL DEVICE WITH COMPLETE SOFTWARE SUPPORT 

ED Loads and javei at 4800 baud. Seeks ai IOO'Vsh; 

RAGE Eacri BETA.! drive slores 525,000 bytes or 126 named programs or 

liles on a single cassette. Expands to four drives-two megabyles 

24 commands, 27 effor message*, 2 uWf.deiined commands-tuilv 
compatible with PET BASIC. Resides in only 4K-abt)reviatecl 2< 
version, bootstrap loader, ail romable 

Named files, directories, program chaining and merging, sequentiai and 
random access files, field and record definitions, and more . . . 



OPERATING 
SYSTEM 



FILE 
CONTROL 



• complete hardware and 
software system 

Meca's digital tape provides the 
features of disl( plus gives you 
more storage and costs less. 

LOAD AND SAVE AT HIGH SPEED 

Eliminate those piles of cassettes cluttering up your life. Organ- 
ized on a singJe cassette, yovjr present colleciiGn of programs be- 
comes 3 nametJ program library. You load and save any program 
in seconds, instead of minutes. In addition to fast, convenient, 
reliable program storage, huge amounts of textual and numeric 
data can be accessed quickly and easily. With up to two mega- 
bytes on line, programs for mailing Ifsts and business records are 
practical. 

This is a complete system. Just plug it in and go. Additional soft- 
ware is available. 

BETA 1 DRIVE, PET/BETA,! OPERATING SYSTEM, IVIANUAL , . , S525,Q0" 

ADDITIONAL BETA-1 SLAVE DRIVES 310.00 

MANUAL lapplicable tei purctiase) , , , , . 10. OO 



s^o-P'tiju^j"^ -^or* 



ta..! 1 



1903 Rio Grand* 

RuftiriiTtxiis 

78785 



1-512-477-2207 



P.O. Box e«3 

nuitinjTtxu 
787 J 2 



92 



COMPUTEI 



September/October, 1980. Issue 6 



OOPS! 
A Crucial 
Update to 
Disk ID 
Changer, 
Issue #5, 
COMPUTE 



Rene W, Poirier 

DISK ID CHANGER was intended to change the 
ID on diskettes to prevent having diskettes with 
duplicate ID characters. Information has surfaced to 
the effect that ID Changer does not accompHsh its 
goal. Though it successfully changes the characters 
on Track 18 Sector O, those characters are purely 
cosmetic and for display in the directory only. The 
actual ID characters are deeply imprinted on each of 
the sectors of the diskette. 

The bulletin mentioned in the previous article 
did not specify the DOS to which it was referring. It 
now appears that the actual reference was to the new 
DOS which auto-initializes a diskette when it 
recognizes a change in the sector ID characters. In 
this case, swapping diskettes with identical ID 
characters will fool the new DOS and it will not 
auto-initialize and create a new Block Availability 
Map. 

This can cause real problems. DISK ID 
CHANGER, though intended to prevent this, fails to 
do so. In fact, it tan compound the problem, since 
the true ID is lost to the user. 

Thanks to Jim Buttcrfield for bringing this error 
to my attention and directing me onto a course 
toward a solution. The program, ID CORRECTOR 
checks the diskette for the actual, or original, ID 
characters inprinted on the sectors, and compares 
those characters to the cosmetic characters on Track 
18 Sector 0. If they match properly, it so informs 
you. If they do not, it can replace the erroneous ID 
with the actual characters, returning the changed 
diskette to its original configuration. If use of the ID 
CORRECTOR on drive is desired, change the 
variable DV in line 7. 



This will not solve the original problem of more 
that one disk having identical original ID characters, 
such as backup diskettes. Care will have to be taken 
when using these diskettes. It would seem advisable 
to include forced initialization commands in pro- 
grams to force crcatifjn of a new BAVI when disket- 
tes are changed. The real solution to the problems 
would lie in a command to duplicate, but with a 
change in ID characters on the copy diskette, but 
alas 

The portion of DISK ID CHANGER for chang- 
ing the name on a diskette for library naming pur- 
poses is valid and safe. To prevent accidental use of 
the portion which changes ID characters, I have in- 
cluded another version called DISK NAMFl 
CHANGER which will alter only the ID NAME of a 
diskette. It appeared easier to build a new program 
than to try to extract the appropriate sections from 
DISK ID CHANGER. 

1 REM *** DISK ID CORRECTOR 

2 REM *** BY RENE W POIRIER 

3 REM *** BERLIN, N.H. 

4 : 

5 REM *** WITH THE HELP OF JIM BUTTERFIELD 

_, *** 

6 : 

7 DV=1:REM SET DRIVE NUMBER (1/0) 



10 OPEN9,0,0:OPEN15,a,15 

20 PK=PEEK(59468) :POKE5946a,12 

30 MD$="]i":FORI = lTO20:MDS = MDS+"i^":NEXT 



40 F0RI=1T039:BLS=BLS+' 



:NEXT 



50 P0$="Bv^v^ ID CHECKER/CORRECTOR 

60 RE$= "PRESS jLRETURNr TO CONTINUE 

99 GOTO1000 

100 1NPUTS15,ER:IFER=0THENRETURN 
110 INPUT#15,ER,EMS,ET$,ESS 

120 PRINTMD$"rDISK ERROR! r#"ER" "EM 5" -^ 

-,"ET$", "ES5 
130 END 
200 INPUT#9,QS:PRINT:Q1$ = LEFT$(Q5,1) : 

-.RETURN 
300 CL0SE15 : POKES 94 68 , PK : PRINT"Fi " : END 
1000 PRINTP0$:PRINT"'^PLACE DISKETTE TO BE 

-tCHECKED in DRIVE" DV "^^" 
1010 PRINTRE$:GOSUB200 
1020 ADS="":ID$="" 

1030 PRINT#15, "I"+STR$(DV) :GOSUB100 
1040 OPEN2,8,2,"#0":GOSUB100 
1050 PRINT#15 , "Ul : 2 " ; DV; " , 1 8 , " : GOSUB100 
1060 FORJ=33T034 
1070 PRINT#15, "M-R";CHR${J) ;CHR$(16) : 

-.GET#15,ZS 
1080 AD$=AD$^-Z?:NEXTJ 
10 90 PRINT#15,"B-P:2,162":GET#2,AS,A1S: 

-.ID$=A$+A1$ 
1100 PRINT"^^ACTUAL ID RECORDED ON -. 

-.SECTORS IS: "AD$ 
1110 PRINT"^FILE ID IS: "ID$ 
1120 IFAD$<>ID?THEN1200 
1130 PRINT"tJ'>»>»»»»»x.THIS disk is OK! 
1140 CL0SE2 
1150 PRINTMDSBL$:PRINTBL$MDS"D0 YOU WISH - 

-.TO CHECK " 
1160 PR1NT"AN0THER DISKETTE? (Y/N) x";: 

-.GOSUB200 
1170 IFQ1$="Y"THEN1000 
1180 IFQ1$<>"N"THEN1150 



September /October. 1980. issues 



COMPUTEI 



93 



1190 GOTO300 

1200 PRINT "^i■^J'ACTUAL ID AND FILE ID DO NOT -. 

-.MATCH ! 
1210 PRINTMDS"SHALL I PROCEED TO CORRECT? -. 

-.(y/N) r";:GOSUB200 
1220 IFQ1$<>"Y"THEN1140 
1230 PRINTMD5BL$MD$"BE PATIENT... 
12 40 PRINTttlB,"B-P:2,162":GOSUBl00 

1250 print#2,ad$; :gosub100 
1260 print#15, "u2:2";dv; " , 1 8, " :gosub100 
1270 print#15 , "i"+str$(dv) :cl0se2 
1280 printmdSblS"B"md5"checking disk 
1290 printleft$(md$,8) ; 

1300 GOTO1020 



1 

2 

3 

4 

5 

6 

7 

1 

20 

30 

40 

50 

60 

70 



REH 
REM 
REM 



*** 



DISK NAME 
BY RENE v; 
BERLIN, N 



CHANGER 
, POIRIER 
,H. 03570 



,8,15 



iNEXT 



OPEN9,0,0:OPEN15 
PK=PEEK(59468) :POKE59468,12 
MDS="jbi":FORI = lTO20:MDS = HD$+"'J' 
F0RI=1T039:BL$=BL$+" ":NEXT 

DISK NAME CHANGER 
rRETURNf TO CONTINUE 
OF RANGE, TOO LONG 
EM$(A) :F0RI=1T0A;READEM$(I) 



P0$="fit^ 
RE5= "PRESS 
DATA 2, OUT 
80 READ A:DIM 
-,NEXT 

99 GOTO1000 

100 INPUT#15,ER;IFER=0THENRETURN 
110 INPUT#15,ER,EH$,ETS,ES$ 

120 PRINTMD$"i:DISK ERROR ! r #"ER" "EM$" 

-,"ET$", "ES$ 
130 END 
200 INPUT#9,Q$:PRINT:Q1$=LEFT$(Q$,1) : 

-.RETURN 
300 CL0SE2 : CL0SE15 ; POKE5 94 68, PK: PRINT"fi" : 

-.END 

4 00 PRINTLEFT$(MD$,MD)BL$:PRINTBL$ 
410 PRINTLEFT$(MD$,MD) ;: RETURN 

500 MD=21:GOSUB400 

510 print"j:UNacceptable entry — "EMS (EM) 

520 PRINTRE$:GOSUB200:GOSUB400 

5 30 RETURN 

1000 F=0:PRINTP0$ 

1005 PRINT"iJ'ON WHICH DRIVE SHALL WE -. 

-.PERFORM 
1010 PRINT"THE CHANGES? (0/1) r" ,- : GOSUB200 
1020 DV=VAL(QS) :IFDV<0ORDV>1THENEM=1: 

-.GOSUB500:GOTO1000 
1030 IFDV=0ANDQ1$<>"0"THENEM=1:GOSUB50S: 

^GOTO1000 
1040 PRINTP0$:PR1NT'4PLACE DISKETTE IN -. 

-.DRIVE"DV"'^" 
1050 PRINTRE$:GOSUB200 
1060 PRINT#15,"I"+STR$(DV) :GOSUB100 
1070 OPEN2,8,2,"#":PRINT#15,"Ul:2";DV;", 

^18,0":GOSUB100 
10 80 PRINT#15,"B-P:2,144":GOSUB100:DK$="" 
10 90 F0RI=1T016:GET#2,A$:DN5=DN$+A$:NEXT 
1100 MD=10:GOSUB400:IF F THENRETURN 
1110 PRINT"THE PRESENT DISK NAME IS: 
1120 PRINTTAB{5)CHR$(34}DN$CHR$(34) 
1130 MD=13:GOSUB400 
1140 PRINT"DO YOU WISH TO CHANGE IT? -. 

-n(Y/N) r";:GOSUB200 
1150 IFQ1$="N"THEN1350 



1160 IFQ1S<>"Y"THEN1130 

1170 MD=16:GOSUB400 

1180 PRINT"ENTER NEVl DISK NAME" : PRINT"LIMI 

-.T TO 16 CHARACTERS Ji" 
1190 GOSUB200 : IFLEN(QS) >16THENEH=2: 

".GOSUB500 :HD=18:GOSUB400 :GOTO1190 
1200 NDN?=LEFT5(Q$+BL$,16) 
1210 MD=21;GOSUB400 
1220 PRINT"SHALL I SEND j:"NDN5 
1230 PRINT"TO THE DISKETTE ON DRIVE"DV"? -. 

-.(Y/N) x.";:GOSUB200 
1240 IFQ1$="Y"THEN1270 
1250 IFQ15="N"THENGOSUB400 :HD=18 :GOSUB400 : 

^GOTO117 
1260 GOTO1210 

1270 MD=21:GOSUB400:PRINT"BE PATIENT... 
1280 PRINT#15,"B-P:2,144":GOSUB100 
1290 PRINT#2,NDN$; :GOSUB100 
1300 PRINT#15, "U2;2";DV;",18,0":GOSUB100 
1310 PRINT#15,"I"+STRS(DV) :GOSUB100 : CL0SE2 
1320 F=1:PRINTP0S:GOSUB1060:F=0 
1330 PRINT"THE NEW DISK ID IS: 
1340 PRINTCHR${34)DN$CHR$(34) 
1350 CLOSE2:MD=21:GOSUB400:PRINT"DO YOU -. 

-.WISH TO DO 
1360 PRINT"ANOTHER DISKETTE? (Y/N) f " ; : 

-.GOSUB200 
1370 IFQ1S="Y"THEN1040 

1380 IFQ1$="N"THEN300 ^ 

1390 GOTO1350 ^ 



CBM Profiler 

For 

PET/CBM-16/32K 

Profiler watches all your clients, distributors 
or customers important to your firm. Prints 3 
reports, labels & sorts in 20 fields maintain- 
ing 1100 profiles per diskette. 

Only $99.95 

Includes diskette, manual & source code. 



inTERmnunTPiin up\1P\ 



2321 East Mulberry #8 
Ft. Collins, CO 80524 



303-221-2059 



94 



COMPUTE! 



September /October, 1930. Issue 6 



Variable- Field- 
Length 
Random 
Access Files 
On The 2040 
Disk Drive 

Peter Spencer, 
7 Brightside Drive, 
West Hill, Ontario, 
Co node MIE 3Y8 

Do you have voluminous file storage needs, but hate 
to see a large fraction of each disk eaten up by the 
empty space that seems to be an inherent feature of 
most random access programs? 

This program shows how to write variable field 
length random access files on the 2040 disk drive. 
The density of packing is truly amazing. Compare it 
to the density achieved by any fixed field length pro- 
gram you have, including the lengthy relative record 
program in the 2040 User's Manual. 

The writing to disk is done in lines 41 to 77, 
and the retrieval from disk is in lines 82 to 106. The 
rest of the program is a dri\x'r routine patched on 
from a longer program of mine. 

For this sample program, I have used the line 
number as the key for each field. You can easily use 
some other key, and have more than one field per 
key. In that case, you must change the output to the 
key file (lines 71-77) so that it contains the number of 
keys used, each key, the number of fields for that key 
(if variable), and the track, sector, and buffer 
pointers for each field within that key. Lines 88-95 
would have to be siinilarly changed. 

Yes, you read the above correctly, you can even 
have a variable number of fields per key! Such a 
variable field number, variable field length program 
can be of considerable use if you want to store 
abstracts, test questions, criterion-referenced test 
questions (using the criterion or instructional objec- 
tive code "number" as the key), or parts inventory 
(you could use the machine name as the key, and 
each part as a field, with subfields for cost, price, 
onhand, backordered, and so forth). 

The driver routine I have used can be con- 
siderably shorter if you wish to use regular input 



rather than the bullet-proof and hyphenation-proof 
form provided in lines 118-133. There, a line- 
overrun on input from the keyboard (detected in line 
125) results in the entire word being removed to the 
next consecutive line (accomplished in lines 128-133 
and 119). 

1 CLR 

2 PRINT "fixV ART ABLE FIELD LENGTH FILES ON -i 

-iTHE 2040f ^^PETER SPENCER" 

3 GOSUB108:HK=0:LL=80 

4 D1HPA{300) :DIMTA(300) :DIMSA(300) 

5 NLS=1 :D=0:F=0:X=0:Y=0:T=0 

6 SP$=" 



:DIHA$(300) :OPEN15,8, 



40 



44 



7 MS=CHRS(13) 

8 S5="":Z$="":IN$= 

-■15 

9 REM: PROGRAM ENTRY 

10 PRINT"fij:SfTART NEW FILE, OR rWrORK ON -, 

-.OLD FILE? "; 

11 GOSUB33 

12 PRINT"NAME OF FILE " ; :G0SUB119 : 

-.A$(1) = IN$ 

13 IFSS="S"THENGOT022 

14 GOT083 

15 REM: SHOW FILE ENTRIES 

16 F0RK=1T0NLSSTEP15:F=K:D=K+14 

17 F0RI=FT0D:PRINTI;TAB(6) ;A5(I} :NEXTI 

18 PRINT"h";SP$;SP$;SP$ 

19 PRINT-'iirSrCROLL NEXT 15 LINES, OR -. 

-.^EfXIT? "; :GOSUB33:IFSS="E"THENK = NLS 

20 PRINT "MH " ; : NEXTK 

21 REM; SHOW MENU 

22 PRINT"fi";SP$;SP$;SP$ 

23 PRINT"iii:RfEAD IN, xOrUTPUT, xTi:-YPE, " ; 

24 PRINT"rSfCROLL, " ,- 

25 PRINT"x.ErXIT?";:GOSUB33 

26 IFS$="E"THEN79 

27 IFS$="T"GOTO110 

28 IFS$="O"G0TO42 
IFS$="R"G0TO83 
IFSS= "S"THENPRINT"fii^ii'ii-" ; 

31 GOT022 

32 REM: GET UTILITY 

33 GETS$:IFS$=""THEN33 

34 PRINTS$; RETURN 

35 REM: READ ERROR CHANNEL 

36 INPUT#15,BN5,EM?,ET$,ES$ 

37 IFEN5="00"THENRETURN 
3 8 PRINT"ERROR ON DISK" 
39 PRINTEM5;EN$,BT$,BS$ 



29 
30 



:G0T016 



;END 



CL0SE6 : CL0SE7 : CL0SE15 ; 

41 REM: OUTPUT ROUTINE 

42 IFMKO0THEN46 

43 PRINT"INSERT DISK IN LEFT DRIVE & TYPE -. 
-.GO"; :GOSUB33 

PRINT#15, "II" 

45 OPEN6,8,6,"#":GOSUB35 

46 PRINT"THERE ARE" ; NLS; "ENTRIES" :MK=1 

47 PRINT"STORE FROM " ; :G0SUB119 : X=VAL ( IN$ ) 

-.:PRINT"TO "; 

48 G0SUB119:Y=VAL(INS) 

49 I = X 

50 REM: ALLOCATE 1 BLOCK 

51 T=1:S=0 

52 PRINT*15, "B-A";1;T;S 

53 INPUT#15,EN$,EM$,ET$,ES$ 

54 1FEN5="00"THEN57 

55 IFEN?="65"THENT=VAL(ET5) ;S=VAL{ES$) : 

^GOT05 2 

56 G0T038 

57 BP=1 



September /October. 1980, Issue 6 



COMPUTE! 



95 



Computer 
Supplies for 

Small 
Computer 

Systems 




Our full line of supplies includes: 
Dikeites (-3M, basQ 
Diskette retrieval dexices 
BPI Business Packatje for the Ctininiodore 
Tractor Primer Pijper 
Tractor Printer Labels 

Printer Riljbuns for NEC. Commodore and Xyinec 
Dust Covers 
Adapters 
Uncrashcrs 
Computer Desks 
NEC Spin writers 
Print Tliimble.s 
Xymec luiellit^ent Prinici-s 
"New Dealer" Kits 



Zeigler 

Electronic 

Products 



DEALERS: 

We no ii.niicr m.irkrt COMMOI'JORE 
[:qiji|iiTU'[il, (Irrry ZviyM'r is with 
Ciinimi^Jorfl hul Lmmir .md I h^ivt- tJu- 
cumputLT iiifiplifi-s ytni ntrd tu -.uppurt 
Ct^mmndun- Syslt-m S.i!fs. 



Give us a call: 

Trudie Zeigler 

or 

Cnnnie Ritlt'nInTry 

(■KM) 2&9\S^^ or 280-22t>5 

3061 CAI.UMHT KH. 

DECATUR, GEORGIA, 33034 



MICRO 

COMPaTER 

INDUSTRIES, 

LTD. 

INVENTORY CONTROL WITH 

POINT OF SALE 

FOR CBM AND PET 32K 

DISK VERSION [INCLUDES: Storage of 
2500 items per diskette, Accounts 
Receivable, Writes Purchase Orders, 
Invoices, Summaries, Post Income and 
will Sort by 10 fields. 

$100.00 

INVENTORY CONTROL 8K 

CASSETTE VERSION INCLUDES: 
Purchase Order program and Printing 
functions. 

$ 39.00 

GENERAL LEDGER 

DISK VERSION INCLUDES: The total 
functions of the Inventory Control pro- 
grams plus; Accounts Payable, Notes 
Payable, Purchases, Expenses, it also 
issues complete Reports, Statements 
and Summaries. 

$350.00 

Instruction Manual $10.00 refundable 
with purchase. 



MICRO COMPUTER 
INDUSTRIES, LTD. 

1520 East Mulberry Suite 240 

Fort Collins, Colorado 80524 

1-303-221-1955 



COPYRIGHT 1980 



96 



COMPUTEI 



Septembef /October. 1980 issue 6 



58 PRINT#15, "B-P: "6;BP:GOSUB35 

59 PRINT#6,A5(I) ;M5; :GOSUB35 : PRINTI ; A$ ( I) ; 

-.T;S;BP 

60 PA(I)=BP:TA{I)=T:SA(I)=S 

61 BP=BP+LEN(A$(I) )+l 

62 IF(LEN{A$(I+1)}+1+BP) >255THEN6 7 

63 1=1+1 

64 IFI<=yTHEN58 

65 PRINTSIS, "U2: "6 ; 1 ; T; S :GOSUB35 

66 CLOSE6;GOT072 

67 PRINTtflS , "U2 : "6 ; 1 ; T; S :GOSUB35 

68 1=1+1 

69 IFI<=YTHEN50 

70 CL0SE6 

71 REM: OUTPUT KEY FILE, OVERVffllTING OLD 

-iKEY FILE IF NECESSARY 

7 2 0PEN7 , a , 7 , " @1 ; "+LEFT? ( A? ( 1 ) +SP$ , 

-.10)+".KEY01,S,W":GOSUB35 

73 PRINT#7,NLS;M5; :GOSUB35 

74 F0RI=1T0NLS 

75 PRINT(t7,TA(l) ;MS;SA(I) ;H$;PA(I) ;M$; : 

-iGOSUB35 

76 NEXTI 

77 CLOSE7:GOSUB35 

78 REM: EXIT PROGRAM 

79 PRINT"SHUT DOWN?" ; :GOSUB33 
30 IFS5="N"GOT022 

81 CL0SE6:CL0SE7:CL0SE15:END 

82 REM: 

83 PRINT"j:READ keys and file from DISK" 

84 IFMKO0THEN87 

85 PRINT"INSERT DISK IN LEFT DRIVE & TYPE ■ 

-.GO"; :G0SUB3 3 

86 PRltJT#15, "I1":MK=1 

87 0PEN7 , 8 , 7 , "1 : "+LEFTS CA$ { 1 ) +SP$ , 

^10)+".KEY01,S,R":GOSUB35 

88 INPUT#7,NLS:RS=ST:GOSUB35 

89 PRINT"^NLS=";NLS 

90 PRINT" # TR SE BP" 

91 F0RI=1T0NLS 

92 INPUT#7,TA(I) , SA ( I ) , PA ( I) : RS=ST :G0SUB35 

93 PRINTI;TA{I) ;SA(I) ;PA(I) 

94 NEXTI 

95 CLOSE7:GOSUB108 

96 REM: READ FILE 

97 OPEN6,8,6,"#":GOSUB35 

98 F0RI=1T0NLS 

99 PRINT#15 , "Ul: "6;1;TA(I) ;SA(I) :GOSUB35 

100 PRINT#15,"B-P:"6;PA(I) 

101 GOSUB35 

102 INPUT#6,A$(I) :GOSUB35 

103 IFTA(I)=0THEN106 

104 PRINTI;AS(I) 

105 NEXTI 

106 CLOSE6:GOSUB108 

107 GOT022 

108 FORI=1TO1000 :NEXTI:RETURN:REM: 

-, DELAY LOOP 

109 REM: TYPE ROUTINE 

110 PRINT"LENGTH OF LINE (MAXIMUM=80) "; : 

->Z9$="a0":GOSUB119:LL=VAL{IN$) 

111 PRIKT"fixTyPE NEW LINES" ; CHR$ (13 );" (TYP 

-.E 'STOP' TO STOP) ) ":PRINTSP? 

112 D=NLS: IFD>=5THENF=D-4 :G0SUB135 :G0T0114 

113 F=1:G0SUB135 

114 PRINTNLS+1;CHR$(13) ; "T";TAB(4) 

115 G0SUB119 : IFIN$="ST0P"THEN22 

116 A${NLS+1)=IN$ 

117 NLS=NLS+1:G0T0111 

118 REM: BULLET-PROOF INPUT 

119 IN$="":IFZ9$<>""THENPRINT"? ";Z95;: 

^POKEl 6 7,0:IN$=Z95:Z95="": GOTOl 21 

120 PRINT"? ";:POKE167,0 

121 GETZS:IFZS=""THEN121 



122 IFZ$=CHR$(13}THENPRINT" ":P0KE167,1: 

-.RETURN 

123 IFZ$=CHR${20)THENONSGN(LEN{IN5) ) +1G0T0 

-.121,127 

124 PRINTZ$; :IN$=1NS+ZS 

125 IFLEN ( IN?) >LLTHENG0SUB128: PRINT" ": 

-.P0KE167,1 :RETURN 

126 G0T0121 

127 PRINTZ$j:IN$=MIDS{IN$,l,LEN(IN$)-l) : 

^G0T0121 

128 F0RZ9=LEN(IN5)T01STEP-1 

129 IFMID5(INS,Z9,1)<>" "THBN133 

130 Z9$=RIGHT$(IN$,LEN(IN$)-Z9) 

131 IN$=LEFTS(IN5,Z9-1) 

132 Z9=l 

133 NEXTZ9:RETURN 

134 REM: SCREEN DISPLAY 

135 F0RI=FT0D: PRINTI, -TAB (6) ;AS{I) ; NEXTI: 

-.RETURN 
READY . © 



ATTENTIOIV 

COMMODORE 

DISK OWNERS 



Never sort another disk file! 

^'ilh Creative Software's ISAM file hanclting routiite, your files 
are atways maintained in sorted order. 2K bytes of assembly 
language !iubrotilines allow you to: 

• CREATE a new ISAM file 

• OPEN anexislinc file 

• READ kev and data froni file 

• WRITE key and data to file 

• READNEXT key and data from file 

• DELETE kev and data from file 

• CLOSE file ' 

• SUPPORTS up to 5 open ISAM files aimiiltaneoiisly 

Available for 16K or 32K CBM <-iimpiiters and 2Q40 di^k units 

899.95 + S2.50 shipping 

Soon to be avaltHble for (3M 80lf> unit 80:!2 .ompiitfrs with BOSO disk 
driie. Manual available separalt^l) fur {i5.Q0 



Creative Software 



P.O. BOX 4030, MOUNTAIN VIEW, CA 94040 



Sepfembef / October, 1980, issued 




Q^ commodore 



SOLID GOLD SOFTWARE® 

DES's own— 2 years preparation! Wriling, 

testing and updating to be sure our software 

deserves this iable. 

• FULL ACCT. PACKAGE S1600.00 

ACC/SYS GA 104 (32K) 9 DISKS 

For accounlants <i small businesses 
(Sold locally only for non—lo give customer full suppuri) 

• LAWYERS Package #1 {32K) Disk. .. SI 200.00 

63 Allorneys. 5200 clienls (200 matters ea) 
Prelim & Final Siaiemenis. Aging. Mgmt Rpts 

• CHEMISTRY PROFILE 1 16K) S350.00 

A blood analysis program that yields a diagnosis 

based on 29 blood tests (high-normal-low) 

• MLS(32K mm.) Disk SI200.00 

(Property avail, sold, by city A zone, mg'ml 
analyst rpts. buyer & seller rpis. etc.) 

"GOLD PLATED SOFTWARE^" 

SPORTS 

• HOCKEY #1 (D.sk) S2y.95 

Compiler for hockey statistics— excellent for leam and 

league managers. (When tested on a 17 learn league 
S.A VED 20 hours a week of record keeping) 

• BASEBALL #1 (see Hockey) i.Diiii) S29.95 

BUSINESS 

• MAILING LIST LO 116K min.) ... $29.95 

Maintains file and prinUiut 

• MAILING LIST 2.0 (I6K min.) $49,95 

More powerful plus file merging 

• SUPER L1ST(8K mm.) SI 9.95 

(Advanced listing features) 

• CALENDAR (8K mm.) SI9.95 

(Perpetual calendar with printout) 

• PHONE MAIL SYSTEM ( IhK mm.). . . . $49.95 
CBM Prmter ( Word processing plus phone book) 

EDUCATIONAL 

• FLASH CARDS ( 16K mm.l $24.95 

,\iulii "user input" guiz great study aid 

• MATHEMATICS (8K mm.) $7.95 ea 

A) Add Bj Subt C) Multi D) Div 

• ■■BRANDrSSP[;LLINGBEE"|KKmm), .. $9.95 

(SLPFRB Aid Pre-Schoul ■ 2nd) 

• VISUAL PERCEPTION (KK mm| S7.95 

Shapes cf Sizes 

• CONSONANT BLENDS iRK mm) S7,95 

2 letter sound combinations 

• COUNTING I to 9(8K mm) $7.95 

\'mial tutorial 

GAMES 

• MAY 1941 {8K mm ) S24.95 

Simulated tracking & sinking of the Bismarck 

• SIMON(8Kmml S7.95 

Duplicates the numbers d. sounds selected 

• GUESS?? l.SK mm i 57.45 

Full graphic sound. gue-iMng game 

■^ "The Finest Software Crew in the ii'orld"-^ 

Mike Richler Numi & Brad llun-.ciim S> EKa\ess 

i>aMiJ Schuan/ Donna SchlicpLT Bi>b Johnson 

Dave LunJbcrt. Mural Kalin\ apirak llcnn KKika 



SUPPLIES 



(WE PLjVN, with our PRJCES.TO corner the MARKET)' 
DISKETTES (FLOPPIES) 

BASF (5'.." & 8") S2-90 ea. 

MEMOREX (5'/-" & 8") 2.90 ea. 

WABASH (8") 2.65 ea. 

DYSAN (5'." &. 8") ''.90 ea. 

CASSETTES (Digital & Audio) 

BASF (C30- .90e; C60-$1.20: 

C90 - $1.50; C120- SL75) 

KEYLINE (Digital Only) S5.75 

RIBBONS 
CENTRONICS 

101 & 301 $6.15 

TALLY (2100 & 2200) $3.95 

DIABLO 

Hy Type I $4.00 & up 

Hy Type 11 $5.00 & up 

TELETYPE #2. #13 (use on CBM) $2.95 

QUME S.^ 95 

PRINTRONICS $10.25 

DEC LA30 . S4.25 / LA 1 80 $5.25 

PRINTER PAPER ( -^ us for case prices) 

9'^ X 1 l( perfs to 8h x I 1 1 500 shts $7.95 

14'« X II 500 shts S9-95 

Your Complete 

Computer Center 

-SEND FOR DESCRIPTIVE BROCHURES- 
ALL AVAILABLE ENGLISH/ARABIC 



D DATA EQUIPMENT SUPPLY CORP. 
S 8315 Firestone Blvd., Downey, CA 90241 
(213) 923-9361 



PAYMENT (rati! Residents add ft'*.. Sales Tax) 

n CHECK # 

G VISA 

D MASTERCHARGE Exp. Date 

Acct. # 

Name 

Address 

City . 

State Zip 



98 



COMPUTEl 



September/October, 1980. Issue 6 



Flexible GET 
for the Pet 

Elizabeth Deal 
Malvern, Pa. 

This article describes a few ways to achieve a flexible 
GET routine that includes a flickering cursor, possi- 
ble use of cursor keys other than left or delete and 
disabling of the Pet's quote mode, which is useful in 
several other applications. 

The conceptual problem of substituting GET for 
INPUT has been solved by Pet users, most recently 
by Mr. Bruey (Compute #3) and Mr. Greenbcrg 
(Compute #4). It is a good idea to read those two ar- 
ticles before using GET. It is essential to use input 
edit routines for any math application as outlined by 
Mr. Bruey. 

The program presented here is a simple one. 
REM lines describe how to expand it for a more 
complex use. It uses cursor left to make corrections 
and it permits all ASCII characters that are printable 
to be in a string in a non-graphic form. The program 
does not use the delete key, for it can disturb infor- 
mation already on the screen. Which other cursor 
keys are permitted to work and which, if any, are 
permitted to become part of a string depend on ap- 
plication. In some situations it may be desirable to 
permit the return key and cursor down to become 
part of a string — for instance in a multi-line input 
or in input in a tabular form. Those decisions are 
put around line 360. The instructions in REM lines 
show how to avoid passing the beginning of a string 
with the cursor going back or up and how to signal 
the end of input by a return key at the logical end of 
the string. 

The program uses several pointers that the Pet 
updates with each PRINT for its own use. These 
pointers locate the cursor on the screen. The pointers 
are in locations 196-198 in the new Pet. Line 760 of 
the program shows an untested conversion for the old 
Pet. It is by use of the values of these pointers that 
we keep the cursor within desired limits. Comparison 
of the starting position, GS, with the current posi- 
tion, GP, can be performed in various ways depend- 
ing on what sort of input one needs. 

The same pointer is u.sed to flicker the cursor 
during the time the Pet is waiting for input. Lines 
390 and 400 show how it is done. (Line 400 shows 
an additional poke, more about it later). EXCLU- 
SIVE-OR operation on the contents of the position 
under the cursor with 128 done twice performs the 
necessary reversals. In case you provide no prompts 
to the user, a harmless PRINT"" is in this routine 
to flash the first position before the first character 
comes in. The advantage of using a method similar 
to the one Pet uses becomes obvious when one per- 



mits cursor controls to enter the strings. In such 
situation cursor-left, for instance, will ride over the 
string, Hashing each character it encounters. 

At this point we are about even with the IN- 
PUT statement. GET can do what INPUT can do. 
We are a bit better off in thai we can go up and 
down with our fake cursor. We will be much better 
off when we disable Pet's quote mode with 
POKE205,0. Pet keeps track of an open quote in 
location 205, and causes several graphic characters to 
be primed when you want to qtiote something in 
reverse or use cursor keys. Pet also makes it very dif- 
ficult to quote a quote. POKE 205,0 solves the.sc 
problems. There is one restriction, however. The 
string must be printed on the screen one character at 
a time, as in line 290. It also must be input from 
tape using a GET# statement (sec lines 670-700). 
Printing a string one character at a time solves 
another string work problem-that of strings contain- 
ing comma or colon. At this point a string can con- 
tain anything, which INPUT cannot match. 

POKE 205,0 and printing one character ai a 
time are valuable tools in applications other than 
GET. For example, one can have a very decent 
screen image save and prim ijack rouiiiu' ihal 
duplicates every character in [lie least amount of tape 
or disk space. 

170 REM ===INIT FOR GET ROUTINE======= 

180 GX=255:G0=0:G1=1:G2=40:G7=128:G8=25 6: 

-.G4 = 196:G5=197:G6 = 1S8:GQ=205 
190 GH=19:GL=GH+G7:GD=17:GT=GD+G7:GE=29: 

-.GV=GE+G7:GU=20:GM=GU+G7 
20 GR=13 :G=0 :GA=0 :GS=0 :GP=0 :GF=0 
210 REM ===MAIN PRG-ILLUSTRATION====== 

220 PRINT"TyPE 'XX' TO QUIT OR A STRING + -. 

-.RETURN": PRINT: PRINT" FOR IM.STANCE" 
230 E$ = CHR$(34)+"j:RVS_IN QUOTESf " + CHR5 (34 ) 

-.+CHRS(44)+" COLON"+CHR$(58)-H" COMMA" 
240 E$ = E$-1-CHR5C44)+" QU0TE"-(-CHRS(34)-F"**": 

-.F0RJ=1T0LEN{ES) : PRINTHID5 ( ES , J, 1 } ; 
250 POKE205,0;NEXT:PRINT 
260 : 

270 L=GX:GOSUB310:IFGG$="XX"THENEND 
280 LL=LEN(GG$) :IFLL>LTHENPRINT:PRINT"T00 ^ 

^LONG":GOTO2 70 
290 PRINT:F0RJ=1T0LL;PRINTHID5(GGS, J,l) ; : 

nPOKE205, 0: NEXT: PRINT: PRINT :G0T02 7 
300 REM ====GET R0UTINE============== 

310 GG$="": PRINT""; : GOSUB390 : GS=GP 
320 GETG$: IFG$=""THENGOSUB390:GOTO320 
330 GA=ASC(G5) : IFGA=GRANDGP>GSG0T03 60 
340 IFGA=GHORGA=GD0RGA=GL0R (GA=GT) ORGA=GEO 

-.RGA=GUORGA=GMORGA=GRGOTO32 
350 GP=GP-G1* (- (GA=GV) ) : IFGP<GSGOTO320 
360 PRINTG?; : IFGA=GVTHENGG?=LEFT$ (GGS, 

-.GP-GS) :GOTO320 
370 GG? = GG$-HG$:GOTO320 
380 RETURN 
390 GP=PEEK(G4)+G8*PEEK(G5)+PEEK(G6) : 

^GOSUB400:GOSUB400:POKEGQ,G0: RETURN 
400 GF=PEEK(GP) :POKEGP, (G70RGF) AND(N0T(G7A 

-.NDGF) ) : RETURN 
410 REM=============================== 

420 REM 

430 REM 1. FLASHING CURSOR AND DISABLE 

440 REM OF QUOTE MODE IS IN THE LAST 



September/October, !980. issue 6 



COMPUTEI 



99 



450 


REM 


460 


REM 


470 


REM 


480 


REM 


490 


REM 


500 


REM 


510 


REM 


520 


REM 


530 


REM 


540 


REM 


550 


REM 


560 


REM 


570 


REM 


580 


REM 


590 


REM 


600 


REM 


610 


REM 


620 


REM 


630 


REM 


640 


REM 


650 


REM 


660 


REM 


670 


REM 


683 


REM 


690 


REM 


700 


REM 


710 


REM 


720 


REM 


730 


REM 


740 


REM 


750 


REM 


760 


REM 


770 


REM 


780 


REM 



2 LINES OF THE GET ROUTINE. 

2. CURSOR LEFT CAN BE USED TO 
MAKE CORRECTIONS IN INPUT 

3. ALL OTHER CURSOR KEYS ARE 
DISABLED , BUT THE ROUTINE 
CAN BE CUSTOMIZED TO USE 
ANY DESIRED CURSOR KEYS LIS- 
TED IN THE INIT SECTION 
GS = STARTING CURSOR POS 
GP = PRESENT CURSOR POS 

4. FOR CURSOR LEFT OR DELETE: 
STAY IN GET LOOP IF GP-KGS 

5. FOR CURSOR UP: STAY IN GET 
LOOP IF GP-40<GS 
CURSOR MUST COME DOWN TO THE 
LAST CHARACTER ON THE LAST 
LINE IF IT WAS ABOVE IT, OR 
SOME INFO WILL BE LOST 

6. YOU MAY USE QUOTES, RVS , 
COMMA, COLON WHERE ALPHABE- 
TIC INFO IS PERMITTED 

7. TO TAPE:PRINT#FF,GG$ 
FROM TAPE: 
2 GET#FF,V$: CHECK STATUS: 
4 PRINT V$; :POKE205,0:GOTO2 

8. FOR OLD ROMS+SMALL KEYBOARD 
SUBSTITUTE THESE VALUES IN 
THE 1ST LINE (NOT TESTED !) 

G4=22 4:G5=225:G6=226:GQ=234 




New 24S-page book Includes all the lormer TtS workbooks 
except "PET Graphics." Provides Information lor botti ROMs and 
a comprehensive index. Only $14.95. 



Also IrQm TI5 
WB-3 PET Graphics 



S4.95 



SoMware products on cassette or floppy disk with complete Instruction 
manual. Eacfi $24.95 (cassette). S29.95 {diskette!. 

SW-1 MAIL B mailing list system 

SW-2 CHECKBOOK record 

SW-3 ACCOUNTS keep track Qt wtio owes you how much 

SW-4 MEDIT create and maintain date files 

SW-5 CALENDAR appointments, meetings al-a-glance 

TIS 

P.O. Box 921, Dept. C 

Los Alamos, NM 87544 

PET and CBM are trademarks ot Commodore Business Macriines 



Add S2 |S5 lorelgn orders) 
shipping end handling 



SPECIAL INTRODUCTION 
ONLY 9 9.95 

FOR THE FiNtST =«PJ1LLEL !NT='J=ACING Ei.i,«HT F'A TAZ RE'/CsK* 
'me "^.I-L.-C IS A vE.=t/ ■:a'*»L£TE :HTE^e*cE. It :flr*€s in 4n attractive :a3e iro 

MOUNTS aiRECTL-r "3 -Vt ::«=UTE3. THUS ELl.>ltNATIHG THE NEEO =08 E:<THi 5?*C£ IS ThE 
BACK =0" 30<ES JND ■'Viil '1LE3 OF II.IE. YOUS STSTEfl CAN l:OK '^0FE33L3?i»L, "nE 
P.I.E.-C HAS COHPLiTE IDCaESS jELECTASILITY OF CEVICS lunBtSS 'J THROUGH 30. ^ND, 
-HEflE'S NO NEED TO 31 SiSacj^BLE ^3L;ft "J^ilT TO CHANGE THE ADDPESS; : T' S AS SIMPLE 
AS SETTING THE ]1P 3MIT:h. ThIS SELECTABILiTf ALLOMS 33TH YCUB LET^C^-'iaALirf 
apiNTE^ i*ilZ SpI'*WR:T=P. ETC.; a^D 'ClJ? ^SAPHICS PPINTE^ n SE CSN.SECTED AT THE 
3A.1E T;ME but •isa St'ABATELT BV 401>RE53lMa cACH '17H A -IlfPEaENT jeytCE!*. 
NOH THAT'S SEAL EFFICI E-IC^i ! 

The P.I.E.-C JiLi. CONVERT Non-sTANDAia ^T ■;;;e3 to true ASCII :0DE, It :an 3E 

SWITCHED LN OR CUT OF SERVICE AS :i|taS3, ":» ;«TAt;CE. Ir "CUS SOFTuARI SCE? "HE 
CONVERSION, ,UST 5H1TCH THE CONVERTER 3'F. !F ''SU 'IEE3 THE C3NVS3S;CN =Cfl 
PRISTING rSan 3aS1C, JUST SWITCH IT 3N, 

CuR I1TERFACE 'ROVIOES 'XTENEICN OF THE !EEI-^88 'CRT C» THE rl'/dn. VCU WN'T 
.VEED TO 8UY ':3TH£S CABLES BECAUSE OUR ItTE-R^ACE JSE3 THE SAME "ABO iXi TYPE AS 

THS COKPUTES. Thus the caelE =ro.h ^e =L3ppt oi5c to i-he 'ET/CSH -ill «« cofi- 

NECT ISTO THE INTERFACE, 

The P,I.£.*C is :nterco.nnecte3 i^i'h, and ^wesss sr, the ^rinte^ 'jsi-ig a 5' data 

CABLE SUPPLIED ^ITH Tut INTESFACE. 'h!S "EAN THAT -HERE IS NO =CWER SUPPLV 

NECtsSARV AS -(ITH SERIAL INTERFACES, 'hE -^^v 13 3UPPI.IED 3H ^LN^ 15 OF TrTE CC.N- 

NECTOR JSED ST ALL TRiJE CENTBONICS StanCABD iNTE^iFACSJ 'RI.ITERS. 'hIS INCL-JOES 

THE LENTBGNICS 779, ■'I, Ar^D HANY 5THE'*S I.NCLUOING 'HE ^NADEX *RIHTERS, 

1'JR INTERFACE SOES BEYOND THE Ce.VTRONIC'S COHPATIBi LITr . 'hEREFOPE, IT JILL 

OPERATE THE rNDERSON- JacOBSON US"! AN3 THE "pAfES "IGER" Bf I.-ITESRAL 3aTA 

SrSTE.HS, [n FACT, IT 4ILL O^ilVE ANY 5 ARALLE',-IN?"JT '"WINTER THAT ij3£3 I OATA BITS 

ANO 2 HANCSHAKING LINES. 

[f rgu ARE INTERESTED IN THE "OST INTERFACE FOR 'OUR hokey. -HIM »LACE YOUR OfiDEB 

"ODAY. Our INTRODUCTORY =R|CE FOR T>IE ?.!,E.-C INTt'FACE «3n't LAST -CHG. 10, 

con'- delay . . . YOU "^AY HAVE TO SAY THE LIST fi^ICE OF SI19.jS. 

■'lease SPECIF^ ^OUB ?ET/C3f1 tvpe 'new or CLD ^CMs/ and the brand A^^D "ODEL :F THE 

printer flu <ill be jsino. '4€ attach the correct corinectob on the cable. 
All orders "ust 3e prersio or lCD cash, Aj3d s5 ^or shipping and handling. 

."jVRYLAND residents ado 31 SALES TAX. 

Le.hData Products. P.O. Box 103Q, Colu.hbia. ,1d. IlCa 
Phone f301) ?I0-;2S7 

•^*/C3» *r» :rj4«-virK) of ta^wotie't lui-'nati ^.i^^^i^^i 



*^ = ^Ro^M^emfiifl PET Products 

from 

OPTHHI2EO DATA SYSTEMS I 

-SOFTWARE ~ 

(Prices include Shipping) 

• WORD PROCESSOR (PS-001) $16.95 

Makes documents a snap 

• MAILING LIST (PS-002) $16.95 

Throw away your address book 

• SPACE EATER {PS-003) $7.95 

Gobbles spaces in BASIC programs 

• CATALOG (PS-004} $16.95 

File stamp/coin collections 

• SATELLITE TRACKER (PS-005) .$24.95 

Tracks OSCAR Ham Satellite 

• MORSE CODE KEYER (PS-006) . . S14.95 

Sends code for real or practice 

-HARDWARE - 

{'Shipping SI .50 per order) 

• 2114 RAM ADAPTER 

Replaces up to 8-6550s w/2114s ISee COMPUTE #5, 
p. 811 

PHB^OI Bare PC8 S8.95* 

PHK-001 Kit S13.95* 

(PCB Si Parts for two 2114 sockets onlyl 

PH-001 Assembled S24.95* 

(Assembled Kit with one 2114 IC) 

PH -00 IS Assembled $22.95* 

(Assembled with eight 2114 sockets ) 
WRITE FOR DETAILS - NOW! 
OPTIMIZED DATA SYSTEMS 
P.O. Box 595, Placentia, CA 92670 
^^ iPET i5a trademark! ol Commodore Bu^ine^s MacHinps) 



lOO 



COMPUTE) 



Sepfember /October. 1980. Issue 6 



ROM-antic 
thoughts 

Jim Butterfield, Toronto 



Here comes another ROM sen or two I'roin Commo- 
dore, and once again the user will need lo take the 
decision: should he upgrade? 

It's a tough question. If he does, it will cost 
money, and some of his programs may cease to work 
until they liave been modified. If he doesn't, he'll 
be left behind and won't have access to some of the 
new goodies. 

Basic programs will, as always, remain compati- 
ble, so long as they don't bristle with obscure 
PEEKs and POKEs. Machine language itself doesn't 
change, but programs which use routines built into 
the ROMs will need changing since the routines will 
have moved to new locations. Some commercial 
machine language programs will survive transfer to 
new ROMs, but many won't. 

A more subtle problem creeps in. As the machine 
is enhanced, programs will start to use the new 
built-in features, and users may find themselves having 
to retro-convert these so that they will run on older 
systems. A command sucii as DOPEN is convenient 
and compact, but users who haven't con\'erted up will 
have to translate this to the appropriate OPEN 1,8,3 ... 
command. New disk features will be particularly 
noticeable for this. New systems, for example, won't 
need to initialize disk and will offer very simple disk 
error checking; older systems will need to add extra 
coding to do these. Some new disk features such as 
APPEND or Relative files have no counterpart on the 
old systems. 

Some terminology 

Commodore arc currently referring to ROM sets by 

means of a numbering scheme. They translate 

roughly as follows: 

Basic 1.0 Original ROM, as fitted in (he early 4K 
and 8K PETS. Not good for disk I/O; 
arrays limited to 256 elements; cassette tape 
files a little awkward. 

Basic 2.0 Upgrade ROM, fitted on more recent 

machines. Garbage collection still a problem. 
Keyboard/disk interface rather clumsy. 
Built-in Machine Language Monitor. Line- 
feed output to IEEE a minor problem. 

Basic 4.0 New ROM, currently being released. Disk 
commands built into Basic. Garbage collec- 
tion fast, and I^inefecd problem eliminated. 
Uses more ROM space. Available for both 



40- and 80-cnliiniii machines, but not foi- 
original PET 8K hardware. 

Basic 5.0 Business ROM, not yet released. Rumoured 
to ha\'e many Basic enhancements, including 
high-precision decimal aridiineiic. 

Basic 2.0 and 4.0 have alternate versions for the two 

types of keyboard — graphics or business. 

Disk systems: 

Dos 1.0 Original 2040 disk system. INITIALIZE 
command needed; RENAMl-l sometimes 
doesn't work. 

DOS 2.0 New system, currently being released. 

INITIALIZE not needed but allowed. Rela- 
tive files and APPEND command imple- 
mented. Fast BAC;KUP command. Can be 
retrofitted to early 2040 units. The new 
8050 disk system will have characteristics 
similar to DOS 2.0. 

Printer ROM systems ha\'en't settled down yet. 
There are two systems a\'ailable, but both have minor 
problems; a third is rumoured. 

Upgrading: the Options 

User.s who still have Basic 1.0 should upgrade, at least 
to Basic 2.0. There are too many good diings 
available. 

The original 8K machines cannot be readily up- 
graded beyond Basic 2.0; their hardware won't support 
Basic 4.0. 

It's not necessary to upgrade both Basic and DOS 
ROMs at the same time, but it's probably a good 
idea. Basic 4.0 and DOS 2.0 work harmoiiiousl)- 
together. 

Switch to Basic 4.0 if you need any of the 
following: 

—to be up to date with the latest software; 

"to eliminate garbage collection delays; 

--to allow inexperienced users to use the disk 
with more natural, English-like commands. 

Switch to DOS 2,0 if you want to take advantage 
of the new APPEND feature or the powerful relative 
file structure. 

Summary 

If you still have original ROMs (the ones ihai say*** 
COMMODORE BASIC *** upon power-up), plan to 
upgrade. 

It's your option as to whether you want to switch 
to Basic 4.0 and DOS 2.0. If you like the new 
features, go ahead. But you'll still have a good, 
serviceable system if you stay with u[)grade ROM 
(Basic 2,0), 

Upgrading the disk file can be treated as a 
separate question. The original unit is excellent for 
program saving and loading. But if you plan to do a 
lot of work with data files, the new features of 
DOS 2.0 can look very attractive. 

It's your choice, © 



September /October. 1980- Issue 6 



COMPUTEI 



lOl 



PET. AIM .SYM KIM OWNER S 

|p[naisK!| 



'Tired of waiting for your cassette? 
"Want versatile, inexpensive expansion? 
'Want IBM floppy disk compatibility? 



THE IBM COMPATIBLE FLOPPY DISK 
SYSTEM WITH 51/4" or 8" DRIVES 



'Want professional, sophisticated file handling? 
"Want consistant, rehable operation? 
'Want simple, easy-to-use disk syntax? 



CRS/PDOS 



A NEW SOPHISTICATED DISK 
OPERATING SYSTEM — 

'Wanf a compatible disk-based Editor/Assembler? 



CRS/ASM 



NEW PET OWNERS 

PEDISK IS AVAILABLE FOR NEW PETS TOO! 



AIM, SYM, KIM OWNERS 

PEDISK ADAPTOR IS NOW AVAILABLE! 



PEDISK PACKAGE 1 $799.95 

5" DISK SYSTEM, CASE AND POWER SUPPLY 

PEDISK PACKAGE 2 $895.00 

5" DISK SYSTEM, SlOO CARD CAGE, CASE AND POWER SUPPLY 

PEDISK PACKAGE 2A $495.00 

ADDITIONAL 5" DISK DRIVE, CASE AND POWER SUPPLY 

PEDISK PACKAGE 4 $1495.00 

6" DISK SYSTEM, SlOO CARD CAGE, CASE AND POWEH-SUPPLY 



EXSIOO DISK CONTROLLER BOARD $49.95 

BARE BOARD 

EXSIOO DISK CONTROLLER KIT $225.00 

AIM, SYM, KIM ADAPTOR KIT $25.00 

CRS/PDOS SOFTWARE SYSTEM $75.00 

SPECIFY OLD OR NEW ROMS, MEMORY SIZE 8K, 16K, 32K 

CRS/ASM EDITOR/ASSEMBLER $150.00 

SOFTWARE AVAILABLE ONLY FOR EXSIOO, PEDISK OWNERS 



*NEED MORE ROM ROOM? 

Toolkit and Word Pro II occupy the same rom space 
in your PET! No problem for Spacemaker. Simply 
install both in the Spacemaker and switch back and 
forth. Add User I/O and you can switch under soft- 



SPACEMAKER $29.00 

USER I/O $12.95 

CABLE ASSEMBLY AND SOFTWARE ON COMMODORE OH 
PEDISK DISK 

ROM DRIVER $39.00 

PORT CONTROL BOARD WITH SOFTWARE LISTING 

ROM I/O $9.95 

ROM DRIVER SOFTWARE O.M COMMODORE OR PEDISK DISK. 
SEE YOUR LOCAL DEALER OR CONTACT: 



The Spacemaker 



ware control from the user port. User port occupied- 
then get Romdriver, a built-in switch control port. 
Spacemaker can grow as your switching problems do. 
Don't get caught behind in the ROM RACE. 



MICROTECH 

P.O. Box 102 

Langhorne, PA 19047 

215-757-0284 



PEDISK, Spacemaker is a trademark of CGRS Microtech 
Pet, Kim is a trademark of Commodore 
Aim is a trademark ol Rockwell 
SYM is a trademark of Synertek 
Toolkit is a trademark of Palo Alto KS. 



102 



COMPUTEI 



September/ OctDber,1980, Issue 6 



Converting 
ASCII Files to 
PET BASIC 

Harvey B. Herman 

Chemistry Deportment 

University of North Carolina at 

Greensboro 

Greensboro, North Carol ino 27412 

Recently I have been experimenting wiiii a program 
(not discussed here) which makes PET into a ter- 
minal (CompuMart T/C 2001 terminal option) which 
can communicale with remote computers. Normally, 
the characters that are received by the PET, when 
acting as a terminal, are displayed on the screen. I 
modified the program to optionally save the 
characters (ASCII Code) to a reserved area in high 
memory (approximately decimal 8192 and above). 
Obviously, this program required memory in this 
area and will need to be modified for an unexpanded 
8K PET. The question one might ask is, "What can 
I do with an ASCII file in high memory?". This ar- 
ticle is intended to answer that question. 

Commodore's PET is not the first computer I 
have worked with and I suspect the same may be 
true for many readers. I have spent many hours 
developing BASIC programs on remote computers 
for use with my research and in my teaching. It 
would be advantageous if I could also use these pro- 
grams (suitably modified) on the PET. I have no 
strong desire to retype all these programs again. If I 
could convert the ASCII file of a program listing 
made by a terminal program into a PET BASIC pro- 
gram it would save immense amounts of work. Any 
minor changes could then be done with the screen 
editor. 

The program called ASCII shown in the figure, 
converts ASCII files in high memory into BASIC 
programs. It is intended for use with expanded PETs 
with "old" ROMs. The POKE locations in state- 
ment number 63290, 525-527-528, need to be chang- 
ed to 158-623-624 for "new" ROMs. The program 
uses the dynamic keyboard idea of Mike Lauder (see 
Best of PET Gazette). It writes two lines on the 
screen and puts two carriage returns in the keystroke 
buffer. The first line is a BASIC statement taken 
from part of a program listing saved in high memory 
by the terminal program. The second line is an im- 
mediate mode statement which restores a memory 
position counter and jumps back into the main pro- 
gram again. It is necessary to remember the current 
position in high memory because all variables were 



set to zero after the previous step. This is true 
whenever a new BASIC statement is added to a pro- 
gram, as in this case. All the new BASIC statements 
are added to the front of the main program which 
was purposely written with very large statement 
numbers. At the conclusion of this program, the 
statements belonging to the ASCII program can be 
deleted by hand or with The Programmer's BASIC 
Toolkit. 

The ASCII program can be used to do a minor 
amount of editing "on the fly". Some of my original 
programs were done on a computer which uses '#' 
instead of '<>' and I included a conversion in 
statement 63180. Also '[' and ']' were used in place 
of '(' and ')', in .some places and this conversion is 
done in statements 63160 and 63170. I also removed 
'7 (bel character) from the programs. Besides giving 
a syntax error later when run on a PET program, 
the inclusion of '7 occasionally caused lines to be 
over 80 characters long. This stopped the ASCII pro- 
gram with a syntax error which then had !o be 
manually restarted. All these programmed editing 
changes saved a lot of manual editing later. 

The end of my ASCII files is signified by the 
ASCII character 4, otherwise the program might 
continue indefinitely, adding unwanted BASIC 
statements, or garbage. This check is done in state- 
ment 63200. It should reach this point and stop if 
each line begins with a number, is less than 80 
characters long, and the counter in statement 63070 
is positioned to the beginning of the ASC^II listing in 
high memory. Conversion to PET syntax, if re- 
quired, would begin here. 

I have used the ASCII program to convert very 
large ASCII files to PET programs. The same pro- 
gram should be useful when I acquire CP/M ASCII 
files on 5-1/4" diskettes. The disk and operating 
system which I am using (PEDISK and Wilserv Soft- 
ware) can read CP/M files, and the ASCII program 
discussed here, will convert them to PET BASIC 
programs. 



63000 REM PROGRAM CONVERTS AN ASCII FILE -. 

-iIN 
63010 REM HIGH MEMORY TO A PET BASIC t 

-.PROGRAM 
63020 REM HIGH MEMORY BEGINS AT ?2017(8215 

T DEC) 
63030 REM 

6 3040 REM HARVEY B. HERMAN 
6305 REM 

63060 REM I IS MEMORY COUNTER 
63070 1=8215 

630 80 REM THROW AWAY FIRST LINE 
63090 A=PEEK(I) : IFA<>13THENI=l4l :GOTO63090 
63100 PRINT"fiij'iJ'^'" 
63110 1=1+1 

63120 REM NEXT CHARACTER FROM ON lllGB 
63130 A=PEEK(I) 

63140 REM REPLACE [ & 1 WITH ( & ) 
63150 REM REPLACE # WITH <> 



September/October. 1980. Issue 6 



COMPUTE! 



103 



63160 IF A=91 THEN A=40 

63170 IF A=93 THEN A=41 

63180 IF A=35 THEN PRINT"<> " ; :GOTO63110 

63190 REM CHAR $04 AT END OF FILE 

63200 IF A=4 THEN STOP 

63210 REM THROW AWAY '7 

63220 IF A=39 THEN IF PEEK(I+1)=55 THEN -. 

-.I = I+1:G0T0 63110 
63230 REM PRINT BASIC LINE ON SCREEN. -. 

^AFTER CR 
63240 REM PRINT NECESSARY VARIABLES AND -. 

-.PUT CR 
63250 REM IN KEYSTROKE BUFFER. END PROGRAM 
63260 REM INCORPORATE LINE AND BEGIN AGAIN 
63270 PRINT CHR${A} ; 
63280 IF A=13 THEN PRINT" I=" ; I ; " : GOTO63100 

63290 IF A=13 THEN POKE 527 , 13 : POKE528 , 13 : 

-.POKE 525, 2: END 
63300 GOTO63110 O 



commodore 

Your Commodore Dealer 
in CANADA 

We stock the full line of 
PET and CBM products and accessories. 

OFF THE SHELF DELIVERY 

SOFTWARE — HARDWARE — SERVICE 

Best Book Selection In Town 

BEST BOOK SELECTION IN TOWN 

Dust Covers: Pet Cover $1 1 .95 

Floppy Cover 9.95 

Printer Cover (old) 9.95 

Printer Cover (new) 9.95 

Trade-in Your Old PET For 
The Latests Models 

HDLJSE dF CnmPUTEPiS inc. 

368 EGLINTON AVE. W/. (at Avenue Rd ) 
TORONTO, ONTARIO M5N 1A2 

(416)482-4336 



IEEE~488 BUS 

SYSTEM BUILDING BLOCKS 

For Commodore PET/CBM and other computers. 




TNW-1000 Serial Interface: S129 
TNW-2000 Serial Interface: $229 



,-riarin"i mpur ano outpuf 



TNW-232D Dual Serial Interface: $369 



i^-^'j,i: ccnt'o' mes 



TN W-1 03 Teleptione Modem: $389 



■.j>i}t 3ijta ritril Us.? *'lfi DAA 



^ ^N,^Tri JL f A DC P'l'ERM; A p-ugrarr ih^Tlums your PET .nioalerminal 

W^Jr i W/^Ilt ^^^'^ ^''^ TNW-20nn, TMW-2320. or TNW 103) 

SWAP: Allows Storage oi up to 8 programs m PET 



PLUS WosI popular consputf^rs 

di5ks. printers etc 

""^^^^ C()HF'<JH.MH1.V 



memo'v at once Run shem in any order 
PAN: A saptiisticated electronic man orogram 
luse with TNW. 1031 

Write or call tor inlormstlon today; 

TNW Corporation 
33S1 Hancock Street 
San Diego CA 92110 



(714) 225-1040 



NEW!! 
Programs for Commodore's PET 

Business Research $50 

Moke better decisions with this 
high power MBA bosinesi tool. 16k. 



Home &5mall Business 



$15-$40 



• Addresser •Inventory 

• Shopper •Dinner's On! 

Each has o built-in printer option. 

• Gomes & S imulations $l5ea. 

• Fur Trapper "High Seas 

• Mansion! •Pentogon! •Museum! 

• Education Pack 

High School ionnpler with 
geometry, algebra ichemistry. 



Send for full co to I og I 



$15 




HARRY H. BRILEY 

P.O. Box 2913 
Livermore, CA 94550 

(415) 455-9 139 



104 



COMPUTEI 



September/October, 1980 Issue 6 



Compactor 



Robert W. Baker, 
Baker Enterprises, 
15 Windsor Drive, 
Atco, NJ 08004 

This program is the result of s<.-\Tial days of ex- 
perimenting with BASIC prot;-r;un siiaKturcs and tiir 
2040 disi<. In short, the program will read a BASIC 
program that was saved on disk and create a new, 
compacted copy. The program will cielete all 
REMarks, umiec:essar\' spaces, and leading colons. 
Much ol tliis is similar lo other utility programs cur- 
rently available. However, this program goes one 
step further. It combines program lines whene\'ei' 
possible to eliminate the link, liiu* number, and line- 
end-flag o\-erheads normally associated u'iih i-ach 
line. It will make a program as small as possible, and 
most likely faster running. 

While treating this program, I came across a 
few tindociimenieci "quirks'" ol Conniiociore B.'\SIf". 
Since many peo|)le are currently e.xjjerimeming with 
the capabilities of having programs "write" pro- 
grams on disk, this informaiioii may be of interest: 

Zero Length Lines: 

Normally, it is impossible to create a zero Icngili 
line using the screen editor (jn the PET. By 
zero lengtli line, I mean a line with a link, line 
number, and end-of-line flag; but no BASICS 
commands or tc.xt. If you were to type just a 
line mimber using the screen etlitt)r, you would 
actually delete a line instead of entering a zero 
length line. However, when writing a BASIC 
program on disk as a data file there is nothing 
sto])]3ing you from entering a zero length line. 
But if you want the ]>rogram to run. you cannot 
have any zero length lines in tin- [jiogram. 
BASIC cannot link the program lines correctly 
whenever there is a zero length line in the 
program. 

Long Lines: 

At the other extreme, you caimot create a BASIC 
line that is longer than 255 bytes. Again, using 
the PET screen editor you ccntid not create such 
a line. You are normally limited to a maximum 
of 78 bytes due to the line wrapping charaeter- 
istics and at least a one digit line number. When 
writing a BASIC program on disk as a data 
file, be careful not to create a line greater 
than 2,55 bytes. Otherwise the program will 
usually no( load rrc)m the disk. If it does load, 
the jirogram will be totally destroyed and 
unuseable. 



Printing Long Lines: 

Here's a cjttick connnent on the C'ommodore 
printers. If you list a prtjgram that contains 
lines longer than 80 characters, the printed 
listing may be incorrect. It afipears that the ])rinter 
occasionally switches out of listing mode and iiuo 
print mode when a line exceeds 80 eharat:ters. 
At the start oi' the next line everything is 
ok again. 

Program Description 

When ruiming the COMPACTOR program, the 
B.A.SIC program to be compacted must be on the 
diskette inserted iii dri\-e #0. The new cotnpacied 
version will be written on (he diskette in drive #1 with 
the same filename, but with a "/(;" suffix. The 
j^rogram will read the program (o be i (impacted as 
a sequential disk data file, and the file will be 
read twice. 

The hrst jjass checks for line numbers witliin the 
siibject ]>rogram that are the targets of: CJOTO, 
GOSUB, or IE...THEN..(line#j staiements. When 
a target line number is found, it is sa\-ed in matrix 
TL if not all ready sa\Tcl. A check is also made lor 
multiple target lines in ON..C;OTO and ON.. 
GOSUB staiements. Each target line will be dis|)l;!\etl 
on the PET screen in the order Ibund. This helps 
gi\-e some indication of the scanning progress since 
it can fje rather slow. 

During the st'cond pass, each line is copied, 
deleted, or coin]>acied as apjjropriate. The line 
number will l.)e displayed as each line is proeesseti 
to let you know how the program is progressing. 
The rules followed by the COMPACTCm arc as 
follows: 

Any leading colons and/or spaces on a line are 
deleted. 

A line that ha.s only REMarks is deleted if it is 
not a target line. The remark will be replaced \\itli 
a single colon il the line is a l;u"gel line and must 
f)e retained. This tnay produce a leading colon if 
the next line is not a target line and is combined 
with this line. The line cannot be reduced to a zero 
length line since B.ASIC eamiot link a jjrogram 
correctly with a zero length line, as mentioncci 
earlier. 

If any line contains an IF...'I'HI'',N or GOTO state- 
ment, another line cannot be combined with this 
line. Any line combined after these BASIC commanils 
would ne\er be executed, thus the program would 
not I'lmction pi'operly. 

An\' spaces within a line, not enclosed in c^ucTtes, 
are deleted. 

Any Rl'.Marks at the end of a BASIC: line are 
deleted to the end of the line. 

Anything within cpiotes is t;o))ied, tmiouihed. If an 
ending C(Uote is missing from tin.' line, one is 



PET SOFTWARE 

LAS VEGAS CASINO SERIES: 

These four programs were developed both as a tutorial tor those planning to visit a Casino and wanting to learn to play correctly, and as a 
means for the serious gambler to develop and thoroughly test a gambling 'system' under actual Casino conditions. All betting odds and 
options available in the Casino of the MGM Grand Hotel in Las Vegas have been incorporated into these programs. Full screen graphics 
have been used to show the cards being dealt, the Roulette Whieel spinning, and the Dice being thrown in order to increase realism and 
heighten enjoyment. 

1. Casino Blackjack: 

For 1 to 5 players plus the dealer. Keeps track of winnings or losses for each player plus number of hands 
won, lost, and tied and the number of times the dealer and each player has busted. Play with 1, 2, or 4 
decks. Change decks or reshuffle at any time. Split pairs. Double Down, or place an Insurance bet. 
Full Casino rules and many other options S ^95 

2. Casino Roulette: 

Bet on one number, two numbers, odd, even, black, etc. Watch the numbers come up as the wheel spins. 

Twelve ways to bet $ 7.95 

3. Casino Baccarat: 

James Bond's favorite game. Two games in on. Casino style and Blackjack style. Includes special 

features to help in developing a winning 'system' S 7.95 

4. Casino Craps: 

Bel the Dice to Pass or Fall Off. Bet the Hardway or Press with Double Odds. 

Ten ways to bet ^ ^-^^ 

5. Casino Package: 

All four Casino Programs above S24.95 

STRATEGIC GAMES: 

6. Backgammon: 

Play Backgammon against your PET. Excellent graphics and doubling option 

make for a fast and exciting game 5 9-9^ 

7. SP(*) INTRUDEIIS: (WITH SOUND) 

Written by COMMODORE-JAPAN. Performs exactly like the popular video arcade version being played all 

over the country. Machine language graphics and sound provide hours of entertainment $ 9.95 

Please specify which ROM set your PET has. 

8. Checkers: 

Play against the PET. PET plays a good, fast game according to International Checker Rules. Excellent 
graphics show the board and all checkers. Watch your PET move his man around the board. Clock shows 
elapsed time for each move ■ ^ ^-95 

9. Qubic-4: 

This is three dimensional Tic-Tac-Toe played on four, 4x4 boards. PET plays a fast exciting game 

choosing one of three strategies for each game S 7.95 

10. Go Moku: 

Ancient Chinese board game played on a 9 x 9 board. Get 5 men in a row before your PET. A different 

strategy for each game S 7.95 

11. Olhelio: 

English game known as Reversi. Try to capture the PET'S men before he captures yours. Play against the 

PET or against your friends. Fast and fun S 7.95 

12. Cribbage: 

An Excellent version of this favorite card game. All cards are shown using PET'S excellent graphics. 

The PET plays a cool logical game difficult to beat even for the best players $ 7.95 

13. Game Package: 

Any six of the above programs $34.95 

GUARANTEE: All programs are guaranteed to be free from errors and to load on any PET. Any defective tapes will be replaced free 
of charge. 



master charge 

THE INTEBBtHK C1«D 



VISA' 



Order From: CMS SOFTWARE, 5115 Menefee Drive, Dallas, TX 75277 



I wft "^yv*- .f^ 



106 



COMPUTE! 



September /October, 1980. issue 6 



atlclrci i( atiollit-r line could be combined wiih this 
line. Tiicrcfbrc, if a line docs not contain an IF.. 
THEN or GOTO statement, an ending quote is 
added. 

When a colon i.s ibund within a BASIC line and 
not within quotes, the next non-space character is 
checked before copying the colon. If a RKMark follows 
the colon, ihe colon and the rest of the line is 
deleted. Other%vise, the colon is copied and processing 
continues as normal. 

At the end of each BASIC: line, a check is made 
to see if the ne.xt line can be combined with this 
litic. If there were no IF... THEN or GOTO 
commands, and the ne.xt line is not a target line, 
the lines arc combined. When comijining lines, the 
line and line number are (hscarcled, a colon is 
written, and the next line is processed as part of 
the previous line. 

If the next line cannot be combined with die current 
Hne, the end of line ilag is copied along with a 
dummy link and the next line number. A dummy 
link is used to avoid excessi\'e processing and working 
buffers necessary with calculating program links. 
Besides, the links are automatically corrected by PE'F 
BASIC with the RUN or CLR commands. As a 
standard operating procedure, the newly created pro- 
gram outptuted by COMPACl'OR should be loaded 
and re-linked, then re-saved onto disk. The 
program can be re-linked by issuing a CLR command 
after being loaded. 

As mentioned previously, a BASIC pi-ogram hne 
cannot exceed 255 bytes in length. If it does, the 
program may not load from disk or it may be 
totally unuseable. To ])rotect against this, ihe 
COMPACTOR ]irogram slops combining lines if 
more llian 170 bytes have been written in a sitigle 
BASIC line. Since any tiormal line cannot exceed 
78 bytes in length, this shoulcl insure than no 
program generated lines are longer tiian ihc 
maximum length. 

As an example of what this iirogram will do, 
I includetl a listing of a compacted versitni of the 
COMPACFOR program itself. Since this program 
has many RKiVIarks, compacting sa\'es ovei" 3000 
bytes for about a 50% saving in memory space. 
On most |>rogranis the sa\'ings will be imich smaller, 
depending on the programming style. A side benefit, 
howe\'cr, is the increase in the operating speed o( 
compacted programs. 1 should warn, though, th;U tlie 
compacting [orocess can be rathei' slow, ( iotnpaci ing 
of the COMPACFOR program (a 6K progiam \viib 
all the RE.VIarks) takes about 16 minutes. But all 
\'oii ha\e lo tlo is start it off and thi'ii go get a 
cup of coffee while the PF/F does the worki .And 
you oiiK' have to rim ii once lor atiy gi\eti 
program! 

For those too l(i:y to type n/ tiir fiiof^rtn/i. I'll In- lia/ipy 
to finnuh' oipirs on Iti/ir at S~ rach. 



10 

20 

30 

40 

50 

60 

70 

80 

90 

100 

110 

120 

130 

140 

150 

160 

170 

180 

190 

200 

210 

220 

230 

240 

250 

260 

270 

280 

290 

300 

310 

320 

330 

340 

350 

360 

370 

380 

390 

400 

410 

420 

430 

440 

450 

460 

470 

480 

490 

500 

510 

520 

530 

540 

550 

560 

570 

580 

590 

600 

610 

620 

630 

640 

650 

660 

670 

680 

690 

700 

710 

720 

730 

740 



REM *************************** 

REM * COMPACTOR * 

REM * * 

REM * BY: ROBERT BAKER * 

REM * * 

REM * BAKER ENTERPRISES * 

REM * 15 WINDSOR DR. * 

REM * ATCO, N.J. 08004 * 

RE[^ ***************************** 

CLR : DIM TL(1000} 

g£[^ **************** 

REM READY DISK FILES 
REM **************** 

PRINT"fi"SPC(15) "J:COMPACTOR^^l|' 
PRINT" xINPUTf FILE IN nDRIVE #0^ 
PRINT"i:OUTPUTf FILE IN rDRIVE #l^^f 
INPUT"j:INPUT file NAMEr";FL$ 
PRINT"fiSCANNING FILE 

PRINT" FOR TARGET LINES -^^ 

OPEN 15,8,15 : GOSUB 2370 
OPEN 5,8,5,"0:"-HFL$+",P,R" 

REM *************************** 
REM READ LOAD ADR, LINK & LINE# 
REM *************************** 

GOSUB 2370 : GOSUB 2310 

GOSUB 2310 : IF V+V1=0 THEN 790 

GOSUB 2310 : LN=Vl+ {256*V) 

figHj ***************************** 

REM SCAN BASIC LINES 

REM FOR GOTO, GOSUB £, THEN TOKENS 

REM ***************************** 

GOSUB 2330 

IF V=0 THEN 310 

IF V=137 OR V=141 THEN 480 

IF V0167 THEN 390 

figm **************** 

REM GET TARGET LINE* 
REM **************** 

LT=0 

GOSUB 2330 : IF V=32 THEN 490 

IF V<48 OR V>57 THEN 580 

LT=(10*LT)+VAL(C$) 

GOSUB 2330 : GOTO 500 

REM ************************ 
REM CHECK IF ALL READY FOUND 
REM ************************ 

FOR X=0 TO N 

IF TL(X)=LT THEN 710 

NEXT X 

TL(N)=LT : N=N+1 

PRINT LT, 

IF N<1000 THEN 710 

PRINT "Tf->TOO MANY TARGET LINES! 

GOTO 2430 

j^g^] *************************** 

REM CHECK FOR ' ON. , . GOTO/GOSUB' 
j^EH^ *************************** 

IF V=44 THEN 480 
IF V032 THEN 400 
GOSUB 2330 : GOTO 710 



September /Oclobef, 1960. Issue 6 



COMPUTEI 



107 



750 

760 

770 

780 

790 

800 

810 

820 

830 

840 

850 

860 

87 

880 

890 

900 

910 

920 

930 

940 

950 

960 

970 

980 

990 

1000 

1010 

1020 

1030 

1040 

1050 

1060 

1070 

1080 

1090 

1100 

1110 

1120 

1130 

1140 

1150 

1160 

1170 

1180 

1190 

1200 

1210 

1220 

1230 

1240 

1250 

1260 

1270 

12B0 

1290 

1300 

1310 

1320 

1330 

1340 

1350 

1360 

1370 

1380 

1390 

1400 

1410 

1420 

1430 

1440 

1450 

1460 

1470 

1480 



RFM ***************** 
REM SORT TARGET LINES 
REM ***************** 

IF N<2 THEN 900 

FOR X=0 TO N-1 

FOR Y=0 TO N-2 

IF TL(y) < TL(X) THEN 840 

V=TL(Y) : TL(Y)=TL(X) : TL(X}=V 

NEXT y,x 

^^fj[ ********************* 
REM GET READY FOR COMPACT 



REM 



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



PRINT "BCOMPACTING LINES... 

CLOSE 5 

OPEN 5,8,5,"0:"+FL$+",P,R" 

GOSUB 2370 

F0S = LEFT$(FL$,14)+VC" 

PRINTttl5,"Sl:"+F0$ 

OPEN 6,8,6,"1:"+F0$+",P,W" 

GOSUB 2370 

REM ************** 
REM COPY LOAD ADR 
REM ************** 



.H 



GOSUB 2310 
PRINT#6,CHR$(V1) ; 
PRINT#6,CHR$(V) ; 



R=0 



REM *********************** 
REM COPY LINK & LINE NUMBER 
REM *********************** 

GOSUB 2310 : Kl=Vl : K2=V 

F=0 : IF V+V1=0 THEN 2230 

GOSUB 2310 : Ll=Vl : L2=V 

LN=L1+(256*L2) : PRINT LN, 

GOSUB 2330 

IF V=32 OR V=58 THEN 1150 

IF V=0 THEN 1200 

IF V<> 143 THEN 1240 

GOSUB 2330 : IF V>0 THEN 1190 

F=l : FOR X=0 TO N 

IF TL(X)<LN THEN NEXT X 

IF TL(X)=LN THEN 1240 

GOTO 1110 

PRINT#6,CHRS(K1) ;CHR${K2) ; 

PRINT#6,CHRS(L1) ;CHR5{L2) ; : 

IF F THEN PRINT#6,":"; : R=5 

F=0 : GOTO 1360 



R=4 



REM ************************** 

REH **** sChN BASIC LINE *** 

REM **** & COMPACT PROGRAM *** 
j^Ef,] ************************** 



R=R+1 



PRINT#6,C?; 
GOSUB 2330 
IF V=137 THEN F=l 
IF V=139 OR V=167 
IF V=0 THEN 1820 
IF V=32 THEN 1350 



THEN F=l 



j^gjj ******************** 
REM 'REM' TOKEN - 
REM DISCARD REST OF LINE 
REM ******************** 

IF V0143 THEN 1550 

GOSUB 2330 : IF V>0 THEN 1470 

GOTO 182 



1490 

1500 

1510 

1520 

1530 

1540 

1550 

1560 

1570 

1580 

1590 

1600 

1610 

1620 

1630 

1640 

1650 

1660 

1670 

1680 

1690 

1700 

1710 

1720 

1730 

1740 

1750 

1760 

1770 

1780 

1790 

1800 

1810 

1820 

1830 

1840 

1850 

1860 

1870 

1880 

1890 

1900 

1910 

1920 

1930 

1940 

1950 

1960 

1970 

1980 

1990 

2000 

2010 

2020 

2030 

2040 

2050 

2060 

2070 

2080 

2090 

2100 

2110 

2120 

2130 

2140 

2150 

2160 

2170 

2180 

2190 

2200 

2210 

2220 



REM ************************** 
REM QUOTE - 

REM COPY TILL NEXT OR LINE END 
REM ************************** 

IF V034 THEN 1690 

PRINT#6,C$; : R=R+1 

GOSUB 2330 

IF V=34 THEN 1340 

IF V>0 THEN 1560 

IF F THEN V=0 : GOTO 1050 

PRINT#6,CHR$(34) ; : R=R+1 

GOTO 1820 



REM 



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



REM IF COLON - CHK NEXT CHAR 

REM ELSE COPY CHAR 

REM ************************ 

IF V058 THEN 1340 

GOSUB 2330 

IF V=32 OR V=58 THEN 1700 

IF V=143 THEN 1470 

IF V=0 THEN 1820 

PRINT#6,":"; : R=R+1 

GOTO 1360 

REM **************************** 

REM END OF LINE - 

REM CAN WE COMPACT THESE LINES ? 

J^£[^ **************************** 

IF F OR {R>170} THEN V=0:GOTO 105C 

GOSUB 2310 

IF V+V1=0 THEN 2230 

GOSUB 2310 : LN=Vl+ (256*V) 

Ll=Vl : L2=V : PRINT LN , 

REM ************************ 
REM CHK IF LINE# IS A TARGET 
REM ************************ 

FOR X=0 TO N 

IF TL{X)<LN THEN NEXT X 

IF TL{X)=LN THEN 2110 

REM ******************** 
REM NOT USED - 
REM DISCARD LINK & LINE# 
REM ******************** 

GOSUB 2330 : IF V=143 THEN 1470 

IF V=32 OR V=58 THEN 2010 

IF V=0 THEN 1830 

PRINT#6,":"; : R=R+1 : GOTO 1360 

j^gfi] **************************** 

REM LINEf NEEDED - 

REM WRITE LINE END, LINK & LINES 



REM 



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



PRINT#6,CHR${0) ;CHR$(1) ;CHR$(1) ; 

PRINT#6,CHR$(L1) ;CHR$(L2) ; : R=4 

GOSUB 2330 

IF V=32 OR V=58 THEN 2130 

IF V=0 OR V=143 THEN PRINT#6 , " : " ; 

F=0 : GOTO 1360 

J^£f^ ******************** 

REM END OF COMPACT - 
REM WRITE END OF PROGRAM 
fjEf^ ******************** 



lOB 



COMPUTEI 



Septomb9t/October,19aO. Issued 



2230 
2240 
2250 
2260 
2270 
2280 
2290 
2300 
2310 
2320 
2330 
2340 
2350 
2360 
2370 
2380 
2390 
2400 
2410 
2420 
2430 
READY 



PRINT#6,CHR$(0) ;CHR$(0) ;CHR$(0) ; 
PRINT "fixDONE^^^^" 
GOTO 2430 

REM ************************* 
REM ***** SUBROUTINES ***** 
REM ************************* 

GOSUB 2330 : Vl=V 

GET#5,C$ : GOSUB 2370 

IF C$="" THEN V=0 : RETURN 

V=ASC(CS) : RETURN 

INPUT#15 , EN , EM? , ET, ES 
IF EN=0 THEN RETURN 

PRINT : PRINT"tttxDISK ERROR'^ 
PRINT EN;EMS;ET;ES 

CLOSE 5 : CLOSE 6 : CLOSE 15 



110 CLRrDIMTL (1000) : PRINT"fi "SPG (15) "rCOMPA 
-.CTOR^^^": PRINT" rlNPUTr FILE IN -. 
-.JlDRIVE #01^" :PRINT"x.OUTPUTf FILE IN - 
-.XDRIVE #l^\k": INPUT" 
XINPUT FILE NAMEr";FLS:PRINT"BSCANNING -, 

-.FILE": PRINT" FOR TARGET LINES 

230 OPEN15,8,15:GOSUB2370:OPEN5,8,5,"0: 

-n"+FL$+",P,R":GOSUB2370:GOSUB2310 
310 GOSUB2310:IFV+V1=0THEN790 
320 GOSUB2310:LN=V1+(256*V) 
390 GOSUB2330 
400 IFV=0THEN310 
410 IFV=137ORV=141THEN480 
420 IFVO167THEN390 
480 LT=0 

490 GOSUB2330:IFV=32THEN490 
500 IFV<48ORV>57THEN580 

510 LT=(10*LT)+VAL(CS) :GQSUB2330 :GOTO500 
580 FORX=0TON:IFTL{X)=LTTHEN710 
6 00 NEXTX:TL(N)=LT:N=N+1 :PRINTLT, : 

-.IFN<1000THEN710 
640 PRINT "^)■^^T00 MANY TARGET LINES!": 

-nGOTO2430 
710 IFV=44THEN480 
720 IFVO32THEN400 
730 GOSUB2330:GOTO710 
790 IFN<2THEN900 
800 PORX=0TON-l:FORY=0TON-2; 

-.HEN840 
830 V=TL(Y) :TL(Y)=TL{X) :TL(X)^ 
840 NEXTY,X 
900 PRINT"RCOMPACTING LINES tih":CL0SE5: 

-iOPEN5,8,5, "0: "+FLS4 " , P,R" :GOSUB2370 ; 

-.FO$ = LEFTS (FL? , 14) + "/C" :PRINT#15 , "SI : 

-."+FO$:OPEN6r8 
,6,"1: "+FO$+",P,W":GOSUB2370:GOSUB2310: 

-.PRINT#6,CHR5(V1) ; 
1050 PRINTS6,CHRS(V) ; :R=0 
1110 GOSUB2310 :K1=V1 :K2=V:F=0 : IFV+V1=0THEN 

-,2230 
1130 GOSUB2310:L1=V1:L2=V:LN=L1+(256*L2) : 

-.PRINTLN, 
1150 GOSUB2330 : IFV=32ORV=58THEN1150 
1170 IFV=0THEN1200 
1180 IFVO143THEN1240 
1190 GOSUB2330:IFV>0THEN1190 



IFTL(Y)<TL(X)T 



= V 



1200 

1220 
1230 
1240 



1270 
1340 
1350 
1360 
1370 
1380 
1390 
1460 
1470 
1480 
1550 
1560 

1590 

1600 
1610 
1690 
1700 
1720 
1730 
1740 
1820 
1830 
1850 



1940 
2010 
2020 

2030 
2040 
2110 

2130 
2150 
2160 
2230 

2310 
2330 

2350 
2370 



F=l : FORX=0TDN: IFTL (X) <LNTHENNEXTX 

IFTL(X)=LNTHEN1240 

GOTO1110 

PRINT#6,CHRS(K1) ;CHR$(K2) ; :PRINT#6, 

•nCHR$(Ll) ;CHRS(L2) ; : R=4 : IFFTHENPRINT# 

->6,":"; :R=5 
F=0:GOTO1360 
PRINT#6,CS; :R=R+1 
GOSUB2330 
IFV=137THENF=1 
IFV=1390RV=16 7THENF=1 
IFV=0THEN1820 
IFV=32THEN1350 
IFVO143THEN1550 
GOSUB2330:IFV>0THEN1470 
GOTO1820 
IFVO34THEN1690 
PRINT#6 , C$; :R=R+1 :GOSUB2330 : IFV=34THE 

-.N1340 
IFV>0THEN1560 
IFFTHENV=0 :GOTO10 5 
PRINT#6,CHR$ (34) ; :R=R+1 :GOTO1820 
IFVO58THEN1340 

GOSUB2330 : IFV=32ORV=58THEN1700 
IFV=143THEN1470 
IFV=0THEN1820 

PRINT#6, ":"; :R=R+1 :GOTO1360 
1FFOR(R>170)THENV=0:GOTO1050 
GOSUB2310 : IFV+V1=0THEN2230 
GOSUB2310:LN=V1+(256*V) :Ll=Vl:L2=V: 

-.PRINTLN, :FORX=0TON:IFTL{X) <LNTHENNEX 

-.TX 
IFTL(X)=LNTHEN2110 
GOSUB2330 :IFV=143THEN1470 
IFV=32ORV=58THEN2010 
IFV=0THEN1830 

PRINT#6,":"; :R=R+1 :GOTO1360 
PRINT#6,CHR$(0) ;CHR$(1) ,-CHRS(l) ; : 

^PRINT#6,CHR$(L1) ;CHR$(L2) ; :R=4 
GOSUB2330 : IFV=32ORV=58THEN2130 
IFV=0ORV=14 3THENPRINT#6, " : " ; 
F=0:GOTO1360 
PRINT#6,CHR${0) ;CHR?(0) ;CHR?(0) ; : 

-.PRINT "fixDONE.t'^^ " : G0T02 430 
GOSUB2330:V1=V 
GET#5,C?:GOSUB2370:IFCS=""THENV=0: 

-.RETURN 
V=ASC(C$) rRETURN 
INPUT#15 , EN, EM$, ET, ES : IFEN=0THENRETUR 

-.N 



2400 PRINT :PRINT"i^iixDISK ERRORS"; 

-iPRINTEN; EM$ ; ET; ES 
2430 CLOSES :CLOSE6:CLOSE15 
READY. 



SepSamber/October, 1980. Issue 6 



COMPUTE! 



109 



BLACKJACK ANALYZER 

PUT PET TO WORK 

PLAYS 100,000 games in 24 minutes. 
Find the most advantageous method. 



User defines plaver method by simple kevboard entfy including 
when to hit and double on soft and hard hands, split pairs and 
take insurance Then run simulator and see resulting gain or 
loss in 24 minutes run time. 

Uses 4 Decks. Full casino rules Countless permutations. 

-OR - 
Switch to visual play and watch vour system in real time. 
BK Specify old or new ROM. 6502 ML 
Cassette Tape $12 00 

COUNTING TUTOR 

Play Blackjack and win by keeping track of high and low cards. 

Program displays count on request if you lose track. A real time 

simulator. 

BK. Specify old or new ROM. 6502 ML 

Cassette tape - . - $6.00 



Maico 

54 Hesbeth Court 
Toronto, CANADA 
M4A 1M6 



Oops! Our address 
was misspelled in 
the last issue. If 
your letter was 
returned, please try 
again. 



■fr BUSINESS ii EXPERIMENTAL -b EDUCATIONAL 
■& TELECOMPUTING -i.- PERSONAL -,': RENTALS 




r »icro systems by 



SPECIALIZING IN 

Commodore Business Machines 

PRODUCTS BY 
CmC, NOVATION, TNW CORP.. BIZCOMP, MICRO, CENTURY 
RESEARCH, TAB, POWR PROTECTR, Systems, BASE 2, 
OSBORN, Eaton, SOURCE, MACTRONICS, MicfoNet, Skyles, 
KILOBAUD, Dr. DALEY'S, INSTANT SOFTWARE, ASCRO, MICRO 
SOFTWARE SYSTEMS, COMPUTER FORUM, COMPETITATIVE 
SOFTWARE, HAYDEN.ATARLNEECO.COMPUTE&COMPUTE II, 
DYSAN, CREATIVE COMPUTING, LIVERMORE RESEARCH, 
ROBOTICS AGE, SYBEX, KNIGHT ENTERPRISES. 
Another Last Minute News Note: Commodore has announced that 
the three (or two educational otter is on again. 

Send For Our Free Catalog 

Mail Orders To: 

PETTED 

P. O. BOX 21851 
Milwaukee, Wisconsin 53221 

PETTED micro systems 

is located across from the SURFiN' TURFskale board park. 

Highway 1-894 & Hwy 36 4265 W. Loomis Rd 

Milwaukee, Wisconsin 

VOICE (414) 282-4181 & P8BS (414) 282-81 1 8 



WS4' 



10047,101 



master charge 



WJ 



■fr Vendors Display Your Products With Us. 



S }.1i 



S 9-9S 
S 9.« 



ELCOMP 

3^ Boohs 

Cue inif f i«djn| of Ihi ComrnHlort PET 

hghi ttiapleii eiplorng PLI hniwitt induCf^ repji' and nlerlacnKiri 

ItiiiniJlioi Progfammm,; Incks arid schenalici 

Oidfi No. ISO 11] 00 

n Micr«uM BASIC Setetence Hinuil 

Hulhsiilal.vf Peteience mariuil foi (he ori|irvjl Micrcjiotl 4K and i¥. BASIC 

jpvflocwd lor AJtair jnd later ciOTnpulffs mciudifi^ PH IRS 80 anJ OSI 

OSl onn^?l; pieaie take nolt' 

Otdti ha. ISI I ^-^^ 

iiftnm Handbook lor 8^02 and UO? 

iS 44 Card MdnjaD DtiCnhe^ dll of Itie i b t 6 M4 pm S J4 urijMnU 

HAW fiOM dig 10 MtJU.AioD fPROMPfag tK W-Ih schemaJni dii<l 

lunci ds^criptiijn^ A muii \ot twefy KiM S¥M and, AIM o*ner 

Ordf r No. 152 1 9^^ 

MicrKomputer Upplicition Notes 

Rppnniol (nieli moir imporlan! apflliCiTrfm not»s, including ^^08 80Ei} 

8?^b B^IjI chipv Verr newsiirir Ipr iht h^rdivare buH 

Otdtt No. I&3 S 9.9S 

Cofnplei Sound Gtne ration 

Htw if,\sfi apfilica^jon!, msniFil lor ihp \txii li^tiument^ SN litiJi 

Coriplex Sound (ieneiator Cutuil bOjrd available IJ8 95) 

Qidei No. 1S4 % B9^ 

Small Buiintsb Piogrimi 

ComplEle ptogijmi br Ihg bwimesi uiei Hai1ifi£ lisl. Ini^eiloiv IniroiC" 

Writinj and much more irUOduttion into Bu^inesi, AppltaliQni Ma"; 

liil.flR^ 

OfAti No 1% tl* W 

TheFirslBoo^ofOhioScicnlilic, V«l.l 

Contjini an Hniiadjciion la pe'ionai :Dmpute(s and describes tfif Utira 

Scieniific L^ne Coniair^ ejipiaraiGTy diagrams bloc)^. hook up eipar 

iion IncU htnts and raany inleieslirg hslmgv Hatdnare and solhnaFe ir 

lormslian noi pTeviausi> available in one cofnpacl soiree 192 pagei 

Ofdcf No 1S7 i 7.9S 

The First Book 4fI Ohio Scienlilic. Vo^. II 

VqI II Corlain^ tiif itaiuable mloTmaiion about Ohio Scwnliftc microcom 

puin sy^!(m'^ Inti^duMiOn Id OS bbO and OSS^ U neEwprVing antf di) 

titbuEid piocF^smg: ^yLiern^ speci1ic3l»on^ tiusmeLv applicalwn^ .hafd 

md ^^iTwaic binh and lip^ 

Order No. LSI 

Mailing List Prsiram for C^alleneer CI t? iK 

Order Ht> 2044 ftrsanal Version 

Ofder Ha 2005 - Business Version 

Qitio kienlific ttpansion Information 

CmndftMtjn .gt CIP (CiiseUe) !□ b2iZ6 dispJa^ Deiailed sitp tii 

^iruLjiQn^ foi doubling ihe CIP i^tftC and diiplai ^j;e' 

Ordf r Mo 1105 

Importsfit Solt«are lor CBM 16K.12K 

Mq'^T power lul fditDi'AiLerribler lor Commodore CSM 16 3ZK on casseTIf 

Ver) tasi (dilQi dfviJei screen into 3 pan^ Scrolling tetl wmdow 2i 

d»reti tammaids 19 serial cammand^, itatu^ and error mesiages Ai 

sfmbfei can be slafTefl dnectly tiom ihp ediiot di Irom ihe TIM monitor 

Iian\lalei ,n Ihrcp pasiei tl an t-irpr i^ encountered auItJmdl^c relurm {•} 

ili^ ^iJilur Cd'.serie wilti DiMO 

Order Na. J27« t69 00 

AnCffTIOHAPfLEUStR^ 

Sanif iv J'bD«e t&j Aopl.e It in Apple IJ plu^ 

Order No. JSOO H^m 

MO HI AHA I makes Machine Lanimge Protramminf easf! 

Ir ?k^iy Commodofe CBM rhgre n j ^paie ROM iockei waiimg !u< il> 

MOMlANA 1 lne new f^QN^AMA I Mathine Language Momlof m ROM 

Otte*% mgrf jier guidance and detiug^irg aid^ [tian anj nihei mnniliir 

available loflsy ll is indivpen^ablie \d< anyonjr niendmg lo \3Vt tjll jd 

vantage ot ihu computeib tfature^ Ir^cs liflk disassemble dump relo 

cale line avsembfr and muci itiyie I^f'i^ ccnimand luicfiori ^a% de 

mand pnnlDut option Prce includes eileniive manwl 

Ofde: No. 2001 S9S0Q 

JANA Monitor an cas»tte lor ihe PtI 

Simi3F to MO^JANA 1 ..er) pu*'^"itul 

Driver No. 7002 \2^ qo 

ELCOMP PUBLISHING Inc. 

3873-L SchaelGf Ave Cluno CA 9i 7iO f7t4| 691 -U W 

Please iend rrie (lie book:, ^Qiiwjre mditaled beion 

□ t enOose I ._._ send posrpani 

^ Send COD (i^eitta! 

ttiariemji D VISA Lj Mavtetciiai£e 

Acri No __ ,„ 

I'ti'i date , _ Signatutp . ... _ 

Bwk No Book Ho SolTftaie No 



rj I tear su6stMpt*n!t-KC0MPNf*J»llei J9 aO 

^■"Tie .. Pfigni* 

AjSdrevs . . . , 

City Siaie ^p 

CA adtf 6^ sMfi lai We alvj jf:fp; f yin.chetSi An ordi-f, nur-.td^ uSA 



i,[-p ,1 



$l?.00 



no 



COMPUTEI 



September/October, 1980. Issue 6 



A few entry 
points, original/ 
upgrade/ 
4.0 ROIVI 



DBIB 



DB55 



CD7F 



Jim Butterfield 



Entry points seen in various programmer's machine 
language programs. Tiie user is cautioned to check out 
the various routines carefully for proper setup before 
calling, registers used, etc. 

ORIG UPGR 4.0 DESCRIPTION 

C357 C355 B3CD ?OUT OF MEMORY 

C359 C357 B3CF Send B;isic error message 

C38B C389 B3FF Warm start, Basie 

C3AC C3AB B41F CfLinrh & Insert line 

C430 C439 B4AD Fix chaining & READY. 

C433 C442 B4B6 Fix chainitig 

C48D C495 B4ffl Cnmch tokens 

C522 C52C B5A3 Find line in Ba.sic 

C553 C.55D B5D4 Do NEW 

C567 C572 B5E9 Reset Basic and do CLR 

C56A C575 B5EC Do CLR 

C59A C5A7 B622 Reset Basic to start 

C6B5 C6C4 B74A Continue Basic execution 

C863 C873 • B8F6 Get fi.xed-point number 

Froni Basic. 
C9CE C9DE BADB Send Return. LF ii" in 

screen mode 
Send Return, Linefeed 
Print .string 

Print precomputed siring 
Print "?" 
Print character 
Check for comma 
Check for specific character 
'SYNTAX ERROR' 
Find ll-]>t variable, given 
name 
D079 D069 C2B9 Bump Variable Address 

by 2 
D0A7 D09A C2EA Float to Fixed conversion 

D278 D26D C4BC Fi.xed to Float conversion 

D679 D67B C8D7 Get byte to X reg 

DtiaD D68F C8EB Evaluate String 

D6C4 D6C6 0921 Get two parameters 

D73C D773 C99D Add (from memory) 

D8FD D934 CB5E Multiply by memory 

location 
D9B4 D9EE CC18 .Multiply by ten 

DA74 DAAE CCD8 Unpack' memory variable 

to Aecum #1 
DAA9 DAE3 CDOD Copy Ace #1 to (X,Y) 

location 



C9D2 


C9E2 


BADF 


CA27 


CAIC 


BBID 


CA2D 


CA22 


BB23 


CA47 


CA43 


BB44 


CA49 


CA45 


BB46 


CEU 


CDF8 


BEF5 


CE13 


CDFA 


BEF7 


CEIC 


CE03 


BFOO 


CFD7 


CFC9 


C187 



DC9F 


DCD9 


CF83 


DCA9 


DCE3 


CF8D 


DCAF 


DCE9 


CF93 


E3EA 


E3D8 


E202 


na 


E775 


D722 


na 


E7A7 


D754 


na 


E7B6 


D7G3 


E7DE 


F156 


F185 


F0B6 


F0B6 


F0D2 


FOBA 


FOBA 


F0D5 


F12C 


FI28 


F143 


E7DE 


FI56 


F1S5 


F167 


FI6F 


F19E 


F17A 


F17F 


F1B6 


F17E 


F183 


FIB9 


F187 


F18C 


FICO 


F2C8 


F2.A9 


F2DD 


F2CD 


F2AE 


F2E2 


F32A 


F301 


F333 


F33F 


F315 


F349 


na 


F322 


F356 


F3DB 


F3E6 


F425 


F3E5 


F3EF 


F42E 


F3FF 


F40A 


F449 


F411 


F4ID 


F45C 


F43F 


F447 


F48r) 


F462 


F466 


F4A5 


F495 


F494 


F4D3 


F504 


F4FD 


F53C 


F52A 


F521 


F560 


F52D 


F524 


F563 


F579 


F56E 


F5AD 


F57B 


F570 


F5AF 


F5AE 


F5A6 


F5E5 


F64D 


F63C 


F67B 


F667 


F656 


F695 


F67D 


F66C 


F6AB 


F6E6 


F6F0 


F72F 


F78B 


F770 


F7AF 



F7DC 



F913 



F7BC 



F8E6 



F7DF 



F83B 


F812 


F857 


F85E 


F835 


F87A 


F87F 


F855 


F89A 


F88A 


F85E 


F8A3 


F8B9 


F886 


F8CB 


F8C1 


F88E 


F8D3 



F92B 



FBDC 


FB76 


FBBB 


FDIB 


FC9B 


FCEO 


FFC6 


FFC6 


FFC6 


FFC9 


FFC9 


FFC9 


FFCC 


FFCC 


FFCC 


FFCF 


FFCF 


FFCF 


FFD2 


FFD2 


FFD2 


FFE4 


FFE4 


FFE4 



Completion of Fixed to 

Float conversion 

Print fi.xeil-point value 

Print floating-point value 

Convert number to -ASCII 

string 

Print a character 

Output byte as 2 hex digits 

Input 2 hex digits to A 

Input I hex digit to A 

Print system message 

Send 'talk" to IF'.F.E 

Send 'listen" to IEEE 

Send Second;u-y Address 

Send canned message 

Send character to IEEE 

Send 'untalk' 

Send 'uniisten' 

Inputc from IFF'E 

Close logical llle 

Close logical file in A 

Check for Stop key 

Send message if Direct 

mode 

LOAD subroutine 

?LOAD HRROR 

Print READY & reset Basic 

to start 

Print SEARCHING. . . 

Print file name 

Get LOAD/SAVE type 

parameters 

Open lEF.E channel for 

output. 

F'ind spei iflt tape header 

block 

Get siring 

Open logical I'lle from input 

parameti'i's 

Open logical file 

?FILE NOT FOUND, 

clear I/O 

Send error message 

Find any tape header block 

Gel poiniers for tape 

LOAD 

Set tape buffer start address 

Set cassette buffer poinler.s 

Close IKI'^E channel 

Set input device from 

logical file number 

Set output device 

from LFN. 

PRESS PLAY..; wait 

Sense lajie switch 

Read tape to buffer 

Read tape 

Write tape irom buffer 

Write tape, leader length 

in A 

Wail for I/O complete 

or Slop key 

Reset tape I/O pointer 

Set interrupt vector 

Set input {levice 

Set output device 

Re.store defanli I/O devices 

Input charai ler 

Output character 

Get character © 



September/October, 1980. Issued 



COMPUTEI 



PET' MACHINE LANGUAGE GUIDE 




Contents include sections on: 

• Input and output routines. 

• fixed point, floating point, 
and Ascii number conversion. 

•Clocks and timers. 

• Built-in arithmetic functions. 
•Programming hints and sugges- 
tions. 

•Many sample programs. 

While supply lasts: 

Guides forOtd ROMS 

only 55,00 inc. postage 

New ROMS order below 



If you are interested in or are already into machine language 
programming on the PET, then this invaluable guide is for 
you. More than 30 of the PET's built-in routines are fully 
detailed so that the reader can immediately piit them to good 
use. 

Available for S6.95 -*- .75 postage. Michigan residents please 
include 4% state sales tax. VISA and Mastercharge cards 
accepted • give card number and expiration date. Quantity 
discounts are available. 

[fffMfiriS] ABACUS SOFTWARE 



inliiiin 



P. 0. Box 7211 

Grand Rapids, Michigan 



49510 



PET/cBM UNC RASHER" 

WHAT IS IT? — UNCRASHER- is a two button device that 
allows PET/CBM users to regain control of a cursor that's 
been lost due to programming errors. BASIC programs 
may be recovered. Machine language programs in the 
second cassette buffer are not disturbed either, 

WHICH PETs/CBMs? — UNCRASHER" is for all PET/CBM 
computers ihst use the "NEW ' Version 2 ROMs. (Older 
model PETs should use the ITS NEW-CURSOR",) 

DOES IT WORK? — You bet'n See the detailed review of 
the types of crashes and the concept of recovery in the 
first issue of Compute. 

INSTALLATION — Simple, completely illustrated instruc- 
tions using only a Phillips screwdriver ensure installation 
in minutes. No soldering or modificaitons to the computer. 

OPERATION — Jusi follow the simple steps — push the 
buttons and reset the stock pointer — antf PRESTO , . . 
recoveryi 

And all tilts fiappens without powering ttie PET/CBM down and up 

WHY UNCRASHER"? — No first class computer such as 
the PET/CBM should bewithout this capability. Whether 
your fancy be programming, business, education, or hobby, 
hobby, UNCRASHER" saves you time by uncroshing your 
slip-ups. 

AVAILABILITY — Now m better computer stores, or order 
direct from ITS. marie by the people who brought you 
NEW-CURSOR". 

INTERNATIONAL TECHNICAL SYSTEfVIS INC. 

P,0, BOX 264 WOOOBRIDGE, VIRGINIA 22194 

CUSTOMER SERVICES -- , _ ^ 

■M^ RICHMOND. VIRGINIA |804| 262-9709 ^^KQ^. 

HIM $14.95 



Specializing in 
peripherals and software 
for the PET 

We offer the following 

new products 

• 

Tull IEEE-488 Bus Acoustic MODEM . . . S395.00 
*Full IEEE-488 Bus to Centronics or NEC Spin- 
writer Interface COM-PLICATIONS Model ClOl 

$225.00 

'Full IEEE-488 Bus to Watanabe Graphics Plotter 
Interface COM-PLICATIONS Model C 102 S295.00 
"Watanabe MIPLOT Intelligent Graphics Plotter 

Watanabe Model WX4671 $1200.00 

'VIEW-PLOT I Graphics Software packages: Runs 
on the PET connected to the Watanabe MIPLOT 
Plotter via the IEEE-488 Bus Interface Adaptor. 
C102 Graphics Package (No computer skills 

needed to use) $65.00 

Subroutines Package (16 Subroutines) .$95.00 

Combination of Both Packages $145.00 

'PET Computer Desk, designed for PET computer, 
disk and printer $395.00 



*ALL COMMODORE COMPUTERS, 
PERIPHERALS AND SOFTWARE 



We will shortly announce the 
following new products: 

"C301 PET to DIABLO Printer Interface 

•C302 PET to QUME Printer Interface 

•C231 Full IEEE-488 Bus to RS232C Uni-directional 

Interface 

•C232 Full IEEE-488 Bus to RS232C Bi-directional 

Interface 

ECX Co. offers lechnical support and fast in-house maintenance and service 
for all llie prcidiicts we sell. We know how lo repair Conntiindorc equipment' 
EXC Co. is ownt-d and operdtcd by COMPLICATIONS. INC., a design and 
dfuelopmi'nt corporation. Call us: wt' talk technical' ALL COM-PLICA- 
TIONS !NC products are manufaclurt'd to industrial qualiti/ standards. If you 
need to know more about the IEEE 488 Bus read our just published 
Osborne McGraw Hill new book. "The PET and The IEEE-488 (GPIB) 
Bus", authored by tlie presideni o( COM-f-'LlCATIONS, INC.: available from 
ECX Co. for $18.0(1 (includes lax and shippiny). 

P.S. All of our IF,i-;E-48S Bus interfaces meet ALL of the IEEE-488 Bus perfor- 
mance requirements! 



ECX Co. 

1372 N. Main Street #6 

Walnut Creek, CA 94596 

(415) 944-9277 

Northern California's Fastest-Growing 
Exclusive Commodore Computer Dealer 



112 



COMPUTEI 



September/October, 1980. Issue 6 



Feed Your PET 

^ ^ G. A. Campbell 

3iftil^^ 36 Doubletree Road 
w^^i I iv^ willowdole, Ontario M2J 324 

APPLESOFT 

Wc all know that there is no such thing as compatibility 
in iho world of personal computurs. For example, the 
APPLE and the PET store programs on tape quite 
differently- However, by using the program in Listing 
1, you can load programs from ati APPLE directly 
into a PET. To be more specific, you can load 
APPLESOFT programs (cassette or ROM versions) 
into an upgrade-ROM PET. Conversion to original- 
ROM PET'S is trivial. 

Structure of an APPLESOFT tape 

One of the things which make the process fairly easy is 
the simple way APPLE's save programs. A bit is 
stored as one full cycle on tape. A short cycle is a zero- 
bit, one about twice as long is a one-bit, and leader is 
slightly longer again. A byte is simply made up of 
eight bits, unlike (he PET, which has a start-bit and 
a parity-bit. The high-order bit comes first, 

A program is stored as two blocks. The first is a 
length block. It contains four bytes: 

low-order half of program length 
high-order half of program length 
fi.xcd hexadecimal '55' 
checksum of the above. 

The checksum is formed by beginning with hexa- 
decimal 'FF', then doing an exclusive-or on each 
byte of the block. 

The second block contains the exact image ol' the 
program as it resides in memory. It is suffixed by two 
bytes, the second of which is a checksum formed the 
same way as for the length block. These two bytes are 
not counted in the program length. 

Each block is preceded on tape by about ten 
seconds of leader (long bits) and one zero-bit, and 
followed by some tape which is effectively blank. 

The other thing which makes the task easy is that 
both Applesoft' and pet basic were written by 
Microsoft, and thus programs have exactly the same 
format in memory. 
The APPLESOFT Loader 

The program in listing 1 has many comments to 
point out the subtleties of how it operates. The major 
functions arc: 

Initialize everything upon entry so the program 

can be rerun if there is an error. 

Time the cycles passing the head on the cassette. 

Throw away the first 'bit'. 

Wait for the 'start-bit'. 



Make bytes out of the following bits. 

Do the checksum on the length block, and set up 

to read the actual program. 

Convert the statemi-nt pointers if the program 

was cassette APPLESOFT. 

Translate the BASIC] tokens. 

Convert the statement pointer.s fi-om beginning at 
hexadecimal 0801 to hexadecimal 0501. 
Move the program down from 0801 to 0501. 
(The code to do this is at the start of the program, 
since part of the loader is overlaid.) 
Memory Requirements 

The loader reads programs into the same location as 
ROM-based APPLESOFT. This is hexadecimal 0801, 
which is just above the screen on an APPLE. However, 
by the lime the process is completed, the program has 
shuffled down to 0401. Thus, on an 8K PET you 
can load 6K of program text. Ignoring memory 
differences due to conversion, you ha\'e an additional 
IK available for variables. APPLESOFT is also 
available as a loadable program (as opposed to ROM), 
in which case the APPLEl requires 1 IK more than the 
PEl' to hold the same program. 
Program Operation 
The steps to load an APPLESOFT progiam are: 

From BASIC, load the 'APPLESOFT LOADER'. 
Type RUN, but don't press RETURN. 
Position the APPLE tape at (he beginning of the 
tone for the progiam you want. For the first 
program on a tape, just do a rewind. Otherwise, 
you will need an audio cassette-player. The 
person who provided the APPLE tape should be 
able to show you how to position a tape, since 
they do it all the time. 
Press PLAY and wail 3 to 9 seconds. 
Press RETURN. 

There are several possible results. The good one is 
that the PET displays 'OK' and 'READY.'. Stop 
the tape and type (zero) and RETURN. This 
deletes line zero, which is the last remnants of the 
loader, this is safe even if the APPLE program has a 
line zero, since only the first one is deleted. The 
APPLE program is now available for any rcquii-ed 
conversion. (See below) 

About half the time, a question-mark will print. 
This is followed by a 'BRK', which puts you in 
the machine-language monitor on the upgrade-ROM 
PET. Type 'X' to return to BASIC and try again. 
There was a checksum error on the length block. 
The error was possibly caused by the tape being 
positioned incorrectly. If you obtain the question- 
mark a couple of times, try changing ihc '3E' 
(decimal 62) which is stored at hexadecimal E811 
by the routine named 'INIT' to '3C' (decimal 60). 
The APPLE is not consistent on whether a cycle 
is 'low-high' or 'high-low'. Since the loader only 



September /Oclober, 1980. Issue 6 



COMPUTE! 



113 




Skyles Electric Works 



Presenting the Skyles MacroTeA 



Text Editor 



Fast . . . Fast Assembler Enhanced Monitor 



To hfilp you \.vriTe your program, MacroTeA urclutles a 
powerful text editor with 34 command lunctmns: 



Biiefly. the pseudo-ops are: 



• BA 



CoTirr 
code i 



aFid^ ihc aisefnbier to begm placing asiembled 
■heie ind'cared 



AUTO 
NUMBER 
FORMAT 

COPY 

MOVE 

DELETE 
CLEAR 
PRINT 

PUT 

GET 

DUPLICATE 



HARD 
ASSEMBLE 



Number! lifies Julonaticallv 
AutomariCflltv renumbers liriEi 
Outpuls lout lif« ^^1 eajylOiead column! 
CoiLiit'i inw at (jroup o'r imei lo a new 



SYMBOLS 
SET 



MANUSCRIPT 



^ or cjrfiup ol lines lo a new 



• LC 

• CT 

• OS 

• OC 

• MC 

■ se 

• DS 

• BY 

■ SI 

• D£ 

• Dl 

• EN 

• EJ 



Jocation 

Delete; a line or group o' lines 

Clears the ii-Kt liU; 

PimU fl fine or qioun nf lirlel to 
Trie P£T icreeri 

Sav^i a line Or group ol lines of texi on 

the Taiii; [or (Jisc) 

Loadt a prpviouslv saved Sine or group of Unei 

of lexl Irom Uif tape ior &\^c\ 

Cotiici ti.'«1 file morlLtlcs From one lape 
rycorilL'i ro Ihs; alhet. Stopi on wecHiC 
modules fo ailonv changes befo't' 't is liupli 
caied This command makes an unhmired 
length program liext lile) practical 

PrinllQUl lEJiI Mtori Drmier 

Assembles lexl ^ile with or wilhoui a lisimg 

Assemblv rriav be specified tor the obieci cod? 

Iprogram) iti b-? recorded or placed in RAiM 

memory 

Ooot second paw of assemblv- AnoHii'i 

Command thai ma^es unlimiied If-n^ih ivm 

files (source codBl praciical. 

Runs {execoiesl a pftwiousiv assemtjlpd 
program 

Prints out trie syfTibol labie Mabel Mel 

Gives complete contiol of the si?e and location 
of the te«i ttip. (lource tilel, label file (svmbol 
table) and cdocaubi*" bulfer, 

Gives comnleie acceis lo the eleven DOS 

corrifrvands, 

PUT GET NEW INITIALIZE 

DIRECTORY COPY DUPLICATE 

SCRATCH VALIDATE RENAME 

ERROR REPORT 

Offers unbc'iBvably powertul searcl^i and replace 
capabilrly Many large computer assemblers 
lack this sDRtiiStiCSHOn 

SearclWfS text file for defined ttrmgS, OpMOrkallv 

prints ihem and counts ihem; i.e.. this command The conditional as^cmhly pseudo Ops are: 

Counts riurriber d Characters in text file 



Commaiiiji ihi- iiMernbler to continue asspmbiv (jnless 
certatn strdo^js fi-rO'S occur All er'nil flfe prmlfd Out 

CoTimands the as4«mblcr to sian hst.ng source lient 
filej hom itiis oomi on 

Connn-iands the ass«rYlhlCr to Stop list SOufce [l«K1 File) 
irorri this [)(:>m m the program. 

Commancls the assembler to continue that source 

program (tent die) on tape. 

Commands the assernble* lo store the objeci code m 

fTiennO'V 

Commands ihe assembler to not sto'e obiect cod* m 

rtieTIO'V 

Commands The assembler lo store ob|eC1 Code 3t toca 

tion dtifereni from the locatton irt wh^ch n isajnemhlmg 

object code 

Commands the assembler to store an external address 

Commands the assembler to set aside a block of storage 

Commands thu assembler lo store data 

Commands the assembler to store an internal addiess 

Commands the aSitmblei to calculate an external label 
expression 

Commands the assembler to calculale an iniemal label 
expression 

inlarmi the assembler mat tbu is (he end ol the 
program. 



mands 1 he assembler to eiecl to top of page On 
printer copy. 
SET A directive noi a ps^udD-op. directs itie assemblers to 
(leceFine the value ol a label. 



Macro Assembler 

The macro p&ei.idoops include 

MD This It a macro beginning mstruelion riefinitinn 

ME This IS end ot a macro ifhStfuction definition 

EC Do not OUIpUi macro-ganigrated code m ^ourC^ 

listing 
ES Do output macro-generated code in source 

listing, 

Conditional Assembler 



Eliminates lini; numbers oi^ PRINT and HARD 
command, ^^a'^:es MacroTea a true and power- 
ful Text Editor 

Breaks to the Moni'oi! portion ot WactoTea. 
A return to Text Ednor without loss of ivxt 
IS possible 

Improves or tailori MacroTea's Text Editor 
to user's needs, "Do-M-vourseil"' command 



lEQ M the label expression is equal to 'Ero, 

assemble this block of source code Itext file), 
INE II the label expression is not equal to 'ero, 

assemble this block oi sourc*^ cod* Itoxt file] 
IPL If the label expression is posiliwe, assemble this 

block ol sourcs Code. 
IMI If the label expressjon is negative, assemble 

[hjt blocle of source code. 
*•• This IS the end ol a block of source code. 



. . . By having 16 powerful cormnands 

A Automatic MacroTeA cold start from Monitor. 

Z Automatic MacroTeA warm start Irom Monnor 

F Loads ffom tape obieci cocte program 

S Saves to tape ob:eCl code bfilrt-eon locations 

specified 
D Disassembles object code back to souice listing. 

M Displays m meinorv object code starting a| selected 

location The normal PET screen «dii ntay be used 

to change the object code. 
R Dispiavs in regisser. Contents may becfiartged tfsing 

PET screen edit capabilities. 
H Hunts memory for a partiCLrlar ^fOup ol object 

COries 
W Allows you to walk through the program one step 

at a ttme 
B Breakpoint to OCCtir att«j- specified number of 

passes past specified address. 
Q Start on specified gddresj. Quit il STOP key or 

breakpoint occurs. 

T Transfers a program or part qF a program from one 

memory aiBa la another 
G Go" Runs machine language program starting at 

selected location. 
X E-iis back to BASIC 

I Oisplay memofy and decoded ASCII characters. 

P Pack Unin memory wuh specified byte 

What are the other 
unique features of the 
MacroTeA? 

• Labels up lo 10 characters in length 

• SOdifferentsymboi^ to choose from for each character 

• ID" (Jif fereni labels possible 

• Create executable object code in memorv or 
store on tape 

• Text editor may be used for composing letters, 
manuscripts, etc. 

• Text mav be loaded and stored from tape or disc 

• Powerful two-cassette duplicaior funeiion 

■ Strir>9 search capabililv 

• Macros may be nested 32 d&ep 

• 25 Assembler psuedo-ops 

• 5 Conditional assembler psuedo-ops 

■ 40 Error codes to pinpoint probiems 
« 16 Error codes related to MacrOi 

« Warm-start button 

• Enhar^ced monitor with 16 commands 



...a completely solid state firmware system ...all in ROM and RAM. No 
tapes to load. The system is available from the time you turn on your PET to 
the time you shut it off. 

15 chips on a single high quality printed circuit board; interfaces with PET's 
parallel address and data bus or with Skyles Memory Adapter. A 
comprehensive 170 page manual is included 

Truly, there is simply no other system of this magnitude at anywhere near 
this price. $395.00* 

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




231 E South Whisman Road 
Mountain View, CA 94041 
(415) 965-1735 



114 



COMPUTEI 



Sepfsmber/October, 1980. Issue 6 



notices one ii-ansition per cycle, catching the wrong 
one gives it half of that bit, and half of this bit. 
Garble is the result. Fortunately, the program block 
always seems to be consistent with the length block. 
The time spent establi.shing which way to go is 
slight, since the length block ends abotit II seconds 
in to the ta])e. 

You may get the message 'TOO BIG' immediate- 
ly after reading the length block, which means the 
program won't fit into available memory. 

The worst result is that the PET displays 'BAD'. 
This means that there was a checksum error on the 
program block. It is necessary to reload the loader, 
and perhaps to reset the PET. I didn't see this 
result until I had succeeded in loading about 30 
APPLE programs. The APPLE tends to like tapes 
which are a httle 'quieter' than PET tapes, so you 
might try getting a louder copy of the program. 
Now the Fun Begins 

Unfortunately, cassette tape format is not the only 
difference between the PET and the APPLE. After 
deleting line 0, you have a program loaded. You can 
list it, change it, or save it. But will it run? The 
answer is maybe. It can hapjicn. But some programs 
will be hopeless. The APPLE has a \'ery fancy graphics 
system, and APPLESOFT supports it. All the graphics 
commands are translated into CMD (which the 
APPLE doesn't have). If there are any of these in the 
program you just loaded, you may have big trouble. 
Perhaps the person who gave you the APPLE tape can 
help you convert it, but it may not be worth the 
effort. 

There arc several other BASIC commands on the 
APPLE which are not available on the PET. The 
loader translates most of these into VERIFY, which 
is not supported by the APPLE. There are a few 
.-^PPLE commands which are very easy to con\'ert to 
the PET. The loader does 'phony' translations on 
these. And finally, there arc commands which trans- 
late exactly, but do not give the same result. The 
worst part of trying to correct these differences is 
that a line of BASIC can be 239 characters long on 
the APPLE, versus 80 on the PET. The longer lines 
will run just fine, but can not easily be changed 
using the PET screen editor. Thus you have to split 
this type of line into multiple lines. 

The whole process will be greatly helped if you 
have an extended BASIC which includes the 
commands FIND and RENUMBER. This allows you 
to FIND commands which could cause problems, and 
split program lines without concern about smearing 
existing lines. 

Space does not permit a complete tutorial on 
converting APPLESOFT programs. However, ignor- 
ing graphics, here arc some suggestions: 

Commands with no PET equivalent 

DEL - To delete program lines; unlikely to be im- 
bedded in a program, since it also stops execution. 



TRACE 

NOTRACE - Usage obvious. Not needed in a working 
program. 

POP - Cancel a GOSUB. This is an atrocious 
technique. 

HIMEM - Set top of memory. Could be replaced 
with POKE'S but is unlikely to be in a ]>ure BASIC 
program which doesn't use graphics. 
LOMEM - Set bottom of memory. Within a program 
it will probably cause the program to fail (even on 
the APPLE). 

ONERR 

RESUME - Replace with programmed editing. 

SPEED = - Sets display rate. Replace with delay 

loops in key locations if necessary. 

& - Does a jump to a machine-language routine 

which the user must establish. Not pan of normal 

BASIC programs. 

NORMAL 

FLASH 

IN"V^ERSE - Adjusts the video mode for subsequent 

PRINT statements. The equivalent to INVERSE is 

specified within the text on the PET. 

Commands with phony translation 

TEXT/CONT - TEXT sets the 'text window' to 
be the whole screen. CONT has no function within a 
program, so it is substituted. A program with multiple 
TEXT statements probably changes the size of the 
'text window' with POKE statements in order to 
print headings once, and then change what appears 
under them with PRINT statements. 
HTAB/NEW - NEW has no function within a pro- 
gram except to make it commit suicide. HTAB 
is like TAB, but does not appear in a PRINT 
statement. HTABn can be directly convened to 
PRINTTAB(n-l); although it can very often be moved 
into an adjacent PRINT statement. 
HOME/OPEN - OPEN is not supported by APPLE- 
SOFT. HOME clears the 'text window', so it can 
usually be replaced with PRINT"clr". 
VTAB/CLOSE - CLOSE is not supported by APPLE- 
SOFT. VTABri positions the cursor on line 'n'. Pro- 
grams which use VTAB usually have lots of them, 
so at the start of the program define a string, for 
example DN$, containing a 'HOME' character 
followed by 24 'DOWN's. Then replace VTABn 
with PRINT LEFT5(DN$,n); 
STORE/SAVE 

RECALL/LOAD - It is assumed that you won't be 
converting programs with LOAD or SAVl'^ in them. 
STORE and RECALL are used to dump matrices 
out to tape and read them back. Convert by putting 
in the appropriate OPEN, PRINT#, CLOSE or 
OPEN, INPUT#, CLOSE loops. 
Commands which may give different results 
PR#/PRINT# - Used to do I-O to devices other 
than the screen and keyboard. Definitely not equiva- 
lent. 



September/October. 1980. Issue 6 



COMPUTEI 



H5 



CALL/SYS - Used to invoke a machine-language 

program. Almost certainly will require change. Note 

that CALL, WAIT, PEEK, and POKE on the 

APPLE may specify negative numbers. The addre-ss 

used will be 65536 minus the amount specified. 

This convention is a carryover from integer-BASIC, 

and has no ec[uivalent on the PET. The most popular 

CALL'S on the APPLE are: 

-936 - clear the text window. Replace by printing a 

screen-clear. 

-958 - clear the text window from the current [jrint 

position. More difficult to rephice. 

-868 - clear from the current print position to the 

end of the line. 

WAIT - Wail for an external event. Will require 
rework, since it references an actual memory location. 
POKE - Sets a specific memory location to a particu- 
lar \'alue. Usually will require substantial rework. 
PEEK - Returns the value stored in a specific memory 
location. Will also require rework. 
USR - Another way to invoke a machine-language 
routine. 

RND - On the APPLE, RND(O) repeales the pre- 
vious RND, unlike the PET, where it generates 
a truly random number. 

GET - On the APPLE, this waits for a key to be 
pressed. On the PET, a null siring is returned if no 
key has been pressed. To convert, make sure it is on 
a line by itself, and add a test like this: nnnn GET 
A$: IF AS = "" THEN nnnn 

In the APPLE program there may be a PEEK at loca- 
tion -16384 to see if a key is being pressed which 
can be combined with the GET. 
= - (Horrors. If you can't trust ' =', what can 
you trust!) If the result of a comparison is used as a 
number, it will give a different result. For example, 
N = A = B sets N to a value depending on 
whether A equals B. On the APPLE, an equal con- 
dition gives a value of 1, on the PET, equal gives 
-1. 

ASC - Usually ASC of a letter is 64 greater on the 
APPLE than on the PET. 

LIST - Terminates program execution on the PET, 
but not on the APPLE. 

INPUT - APPLESOFT allows INPUT of a null 
string. You may encounter programs which invite 
you to 'PRESS RETURN TO'CONTINUE'. On 
the PET, of course, you will obtain the 'READY.' 
prompt and you are out oi the program. Change the 
prompt to 'PRESS A KEY TO CONTINUE '1 and 
replace the INPUT with a GEl". 

- INPUT generates a question-mark prompt on the 
PET but not on the APPLE. 

BELL - (Jn the APPLE, you can make the speaker 
beep by printing a control-G. No character appeal's 
on the screen. On the PET it prints as a reverse-G. 
TAB - Use one position less on the PET. 



PRINT - There are a number of detail differences. 
For example, tab-fields (invoked with commas) are 
10 characters wide on the PET versus a sequence 
of 16,16,8,16,16,8. . . on the APPLE. A number 
is preceded by a space and followed by a skip on 
the PET, but not on the APPLE. 
The Bottom Line 

Docs it work? It sure does! As long as you avoid 
graphics, you can have a program up and running 
in short order. I was able to load one Adventure- 
style game and have it completely running in less 
than half an hour. It sure beat keying in 16K of 
program text. 

Many thanks must go to Keith Falkncr of 
Toronto, who provided the description of what 
an APPLE tape looks like, many tapes to test with, 
and access to the manuals describing APPLESOFT. 

Program Availability 

If you wish to obtain the program on tape, please 
write me. Enclose $10, and I will send you the 
loader in Upgrade-ROM and Original-ROM ver- 
sions, as well as the source in a format suitable 
for Carl Moscr's ASSM/TED. For 32K PETS, this 
will be the whole program, for 16K there is no 
room for comments. 



0400- 
0403- 
0406- 
0409- 
040C- 
04OF- 



00 
00 
31 
36 
00 
03 



0D 04 
00 9E 
30 35 
3A 80 
00 00 



0005 
0010 
0020 
0030 
0040 
0050 
0060 
0070 
0080 
0090 
0100 
0110 
0120 
0130 
0140 
0150 

0160 
0170 
C180 
0190 
0200 
0210 
0220 
0230 
0240 
0250 
0260 
0270 
0280 
0290 
0300 
0310 
0320 
0330 
0340 
0350 
0360 
0370 

0383 

0390 

0400 
0410 
0420 
0430 
0440 
0450 



.LS 

APPLESOFT LOADER 

FOR USE OK THE COMMODORE PET/CBM 

COPYRIGHT (C) 1980 
GORD CAMPBELL 
36 DOUBLETREE ROAD 
WILLOWDALE, ONTARIO 
K2J 3Z4 

TO ASSEMBLE USING CARL MOSER'E 
ASSM/TED, REQUIRES 'SET' COMMAND 
AND A 32K MACHINE, SINCE THE SOURCE 
(INCLUDING COMMENTS) IS TOO LARGE 
TO FIT 

INTO DEFAULT AREA, AND OBJECT 
GOES INTO THE DEFAULT TEXT AREA. 

WHERE .DE 1 

USED FOR STORE INDIRECT 
THE ONLY PART OF PAGE ZERO 
WHICH IS SMEARED. IT DOESN'T 
HATTER, BECAUSE THE 'USR' 
VECTOR SHOULD BE SET UP BY 
ANY PROGRAM WHICH USES IT. 

PGMEN .DE S2A 

BASIC 'END OF PROGRAM' 

CHANGE THIS TO 57C AND YOU 
ARE CONVERTED TO ORIGINAL ROM. 

PRINT .DE $FFD2 
PRINT ROUTINE 

.BA $0400 
.OS 
HERE IS A BASIC PROGRAM. 

.BY $0D 4 S9E 

-BY '1056: ' $80 

.BY 



IT READS '0 SYS1056:END' 



VARIABLES — 



0410- 
0413- 



00 
00 



00 00 0460 LENGTH 



.BY 00 00 00 00 



116 



COMPUTE! 



September /October, 1980. Issue 6 



0414- 00 00 
0416- B0 00 

0418- 00 

0419- 00 

041A- 00 



041B- 42 41 44 
041E- 4F 4B 



0420- 4C 50 04 



0423- 
0425- 
0427- 
0429- 
042B- 
042D- 
042F- 
0431- 
0433- 
0435- 
0437- 
0439- 
043B- 
043D- 
043F- 
0441- 
0443- 
0445- 
0447- 
0448- 
044A- 
044C- 
044E- 



A9 08 
85 02 
A9 05 
85 2B 
AO 00 
84 01 
84 2A 
Bl 01 
91 2A 
E6 2A 
D0 02 
E6 2B 
A5 2 A 
C5 2C 
D0 07 
A5 2B 
C5 2D 
D0 01 
6B 

E6 fli 
D0 E5 
E6 02 
D0 El 



0450- A9 04 
0452- 8D 14 04 
0455- 8D 17 04 

0458- A9 10 
045A- 8D 16 04 
045D- A9 00 
045P- 8D 15 04 
0462- 8D 19 04 
0465- 8D lA 04 
0468- 78 

0459- AD 10 E8 

046C- A9 3E 
046E- 8D 11 Ee 



0470 
0480 
0490 
0500 
0510 
0520 
0530 
0540 
0550 
0560 
0570 
0580 
0590 
0600 
0610 
0620 
0630 
0640 
0650 
0660 
0670 
0680 
0690 
0700 
0710 
0720 
0730 
0740 
0750 
0760 
0770 
0780 
0790 
0800 
0810 
0820 
0830 
0840 
0850 
0860 
0870 
0880 
0890 
0900 
0910 
0920 
0930 
0940 
0950 
0960 
0970 
0980 
0990 
1000 
1010 
1020 
1030 
1040 
1050 
1060 
1070 
1080 
1090 
1100 
1110 
1120 
1130 
1140 
1150 
1160 
1170 
1180 
1190 
1200 
1210 
1220 
1230 
124D 
1250 
1260 
1270 
1280 
1290 
1300 
1310 
1320 
1330 
1340 
1350 
1350 



; APPLESOFT 'LENGTH' BLOCK 

; IS STORED HERE 

STLEN .SI 

; LENGTH OF CURRENT BLOCK 

STLOC .SI 

; WHERE IT GOES 

CHAR .BY 

; CURRENT CHARACTER 

MODE .BY 

; WHICH ACTIVITY NOW: 

- SYNCHRONIZING 

1 - LEADER 

2 - DATA 
BLOCK .BY 
; WHICH BLOCK: 

- LENGTH BLOCK 

1 - PROGRAM BLOCK 
BAD .BY 'BAD' 
OK .BY 'OK' 

CHECKSUM MESSAGES 

*** ENTRY POINT *** 

KUST BE AT S0420 

FOR THE 'BASIC PROGRAM 

JHP INIT 
SKIP PAST CODE WHICH MOVES 
THE PROGRAM DOWN FROM $0801 
TO ?05O1. THIS CODE IS NEEDED 
BECAUSE V/HEN LIKE ZERO (THE 
PHONY BASIC PROGRAM) IS DELETED 
'END OF PROGRAM' ETC ARE ONLY 
ADJUSTED BY ONE PAGE HAXIHUH. 

t^OVE PROGRAM DOWN 3 PAGES 



MOVE 



HOVLP 



HOVOK 



ItnVHERE 



LDA #8 

STA *WHERE+1 
LDA S5 

STA *PGHEN+1 
LDY #0 
STY *WHERE 
STY * PGM EN 
LDA (WHERE) ,Y 
STA (PGHEN),Y 
INC *PGMEN 
BNE MOVOK 
INC *PGHEM+1 
LDA *PGHEN 
CMP *PGHEN+2 
BNE INWMERE 
LDA *PGMEK+1 
CMP *PGHEN+3 
BNE INWHERE 
RTS ; FINISHED 
INC *WHERE 
BNE MOVLP 
INC *WHERE+1 
BNE MOVLP 
** ALWAYS GOES ** 

INITIALIZATION 

SET UP POINTERS ETC ON ENTRY 
SO IF WE HAD A BAD LOAD, V7E 
CAN TRY AGAIN BY ENTERING 'RUN' 

INIT LDA #4 

STA STLEN 

STA STLOC+1 

LDA SS10 

STA STLOC 

LDA *0 

STA STLEN+1 

STA MODE 

STA BLOCK 

SEI 
; DISABLE INTERRUPTS 

LDA 5E810 
; CLEAR 652 

LDA #S3E 

STA SESll 
MAKE 6520 RESPOND TO 
LOW TO HIGH TRANSITION 

FOR SOME TAPES THE '3E' 

ABOVE MUST READ '3C' 

(IE. HIGH TO LOW TRANSITION) 



0471- 


AD 


16 


04 


1370 


LDA STLOC 


0474- 


85 


01 




1380 


STA *WHERE 


0476- 


AD 


17 


04 


1390 


LDA STLOC+1 


0479- 


85 


02 




1400 
1410 
1420 
1430 


STA *WHERE+1 
; END OF INITIALIZATION 


047B- 


A0 


08 




1440 


INITY LDY #8 


047D- 


A2 


00 




1450 


INITX LDX #0 


047F- 


E8 






1460 
1470 
1480 


COUNT INX 

; COUNT HOW MANY TlfiEE 

; THROUGH THE LOOP 


0480- 


2C 


11 


E8 


1490 
1500 


BIT ?E811 
; HAVE WE A TRANSITION YET? 


0483- 


10 


FA 




151E 
1520 


BPL COUI.'T 
; BRANCH BACK IF NOT YET 


0485- 


AD 


10 


£8 


1530 
1540 


LDA $Eai0 
; RESET THE 6520 


0488- 


AD 


19 


04 


1550 
1560 


LDA MODE 
; WHAT WERE WE DOING? 


048B- 


FO 


2C 




1570 


BEQ STARTUP 


048D- 


C9 


01 




1580 


CMP *1 


048F- 


F0 


2D 




1590 
1600 


BEQ STARTBIT 
; REAL DATA NOW 


0491- 


E0 


40 




1610 


CPX #S40 


0493- 


30 


03 




1620 


BMI ZERODIT 


0495- 


38 






1630 


SEC 


0496- 


BO 


01 




1640 
1650 


BCS SETBIT 
; ** ALWAYS GOES ** 


0498- 


18 






1660 
1670 
1680 


ZEROBIT CLC 

; THE CARRY BIT NOV) INDICATES 

; WHETHER WE GOT A ZERO OR ONE 


0499- 


2E 


18 


04 


1690 
1700 


SETBIT ROL CHAR 

r ROTATE IT INTO THE CEiARACTER 


049C- 


88 






1710 
1720 


DEY 
; FINISHED THIS CHARACTER? 


049D- 


DO 


DE 




1730 


BNE INITX ; NO 


049F- 


AD 


18 


04 


1740 


LDA CHAR 


04A2- 


91 


01 




1750 
1760 


STA {WHERE) ,Y 
; STORE THE CHARACTER 


04A4- 


CE 


14 


04 


1770 
1780 


DEC STLEN 
; REDUCE CHARACTER COUNT 


04A7- 


DO 


08 




1790 


BNE HEXTCHAR 


04A9- 


AD 


15 


04 


1800 
1810 


LDA STLEN+1 
; FINISHED TEilS BLOCK? 


04AC- 


F0 


19 




1820 


BEQ FIN'MODE 


04AE- 


CE 


15 


04 


1830 


DEC ETLEH+1 


04B1- 


E6 


01 




1840 
1850 


NEXTCHAR INC *WHERE 

; INCREMENT DATA POINTER 


04B3- 


D0 


C6 




1860 


BNE INITY 


04B5- 


E6 


02 




1870 


IKC *WHERE+1 


04B7- 


DO 


C2 




1880 
1890 


BNE INITY 
; ** ALWAYS GOES ** 


04B9- 


EE 


19 


04 


1900 
1910 


STARTUP IKC MODE 

; THROW AWAY FIRST TRANSITION 


04BC- 


DO 


BF 




1920 
1930 


BNE INITX 
; ** ALWAYS GOES '* 


04BE- 


E0 


40 




1940 
1950 


STARTBIT CPX S54C 
; IS IT A START BIT? 


04CO- 


10 


BB 




I960 


BPL INITX r NO 


04C2- 


EE 


19 


04 


1970 


INC MODE 


04C5- 


D0 


B6 




1980 
1990 


BNE INITX 
; ** ALWAYS GOES ** 


04C7- 


AD 


lA 


04 


2000 
2010 
2020 


PINMODE LDA BLOCK 

; WE JUST LOADED A BLOCK. 

; WHICH ONE WAS IT? 


04CA- 


DO 


62 




2030 


BNE LOADED 


04CC- 


A9 


FF 




2040 


LDA tSFF 


04CE- 


4D 


10 


04 


2050 
2060 


EOR LENGTH 
; CHECKSUM ON LENGTFI BLOCK 


0401- 


4D 


11 


04 


2070 


EOR LENGTH+1 


04D4- 


4D 


12 


04 


2080 


EOR LENGTH+2 


0407- 


CD 


13 


04 


2G90 


CMP LENGTH+3 


04OA- 


F0 


07 




2100 


BEQ NEXTBLK 


4DC- 


A9 


3F 




2110 
2120 
2130 


LDA #?3F 
; BAD LOAD; PRINT QUESTION MARK 
; AND QUIT WITH A 'BREAK' 


04DE- 


20 


D2 


FP 


2140 


JSR PRINT 


04E1- 


58 






2150 
2160 


CLI 

; QUIT NOW 


04E2- 


00 






2170 


BRK 


04E3- 


AD 


10 


04 


2130 
2190 


NEXTBLK LDA LENGTH 

; INITIALIZATION FOR PROGRAM LOAD 


a4E6- 


60 


14 


04 


2200 


STA STLEN 


04E9- 


AD 


11 


04 


2210 


LDA LENGTH+1 


04EC- 


8D 


15 


04 


2220 


STA STLEN+1 


04EF- 


EE 


14 


04 


2230 
2240 
2250 
2260 


INC STLEN 
; LOAD CHECKSUM TOO 
; MUST GO Tl'JO BYTES PAST 
; THE END OF THE ACTUAL PROGRAM 



Sepfembor /October, 19BO. Issue 6 



COMPUTE) 



11? 







2270 ; 






0591- 


85 02 




3170 




STA *BHERE+1 


04F2- 


D0 03 


2280 




BNE LENl 


0593- 


AD 02 


38 


3180 




LDA S0802 


04F4- 


EE 15 04 


2290 




INC STLEN+1 


0596- 


C9 08 




3190 




CMP *$08 


04F7- 


EE 14 04 


2300 LENl 


INC STLEN 


0598- 


F0 16 




3200 




BEO TRANS 


04FA- 


DO 03 


2310 




BNE LENOK 


059A- 


A0 01 




3210 CASSLP 


LDY #1 


04FC- 


EE 15 D4 


2320 




INC STLEN+1 








3220 


- IT'S CASSETTE APPLESOFT 


04FF- 


A9 8 


2330 LENOK 


LDA #508 








3230 


- ORIGINAL 


ADDRESS WAS $3001 






2340 ; 






059C- 


Bl 01 




3240 




LDA (WHERE ),Y 






2350 ; 


ALWAYS 


LOAD AT S0801 


059E- 


F0 EB 




3250 




BEQ CASSREL 






2360 ; 


IF IT'S 


CASSETTE APPLESOFT 








3260 


; ON THE SECOND PASS, IT LOOKS 






2370 ; 


CONVERT 


IT LATER 








3270 


; LIKE ROM 


APPLESOFT 






2380 ; 






05A0- 


38 




3280 




SEC 


0501- 


85 02 


2390 




STA *WHERE+1 


05A1- 


E9 28 




3290 




SBC #528 


0503- 


A9 01 


2400 




LDA tsei 


05A3- 


91 01 




3300 




ETA (WHERE),Y 


0505- 


85 01 


2410 




STA *WEiERE 


05A5- 


AA 




3310 




TAX 


0507- 


A5 35 


2420 




LDA *PGMEN+11 


05A6- 


88 




3320 




DEY 


05B9- 


CD IS 04 


2430 




CMP STLEN+1 


05A7- 


Bl 01 




3330 




LDA (WHERE) ,Y 


050C- 


DO 13 


2440 




BNE DIFFPAGE 


05A9- 


85 01 




3340 




STA *WHERE 






2450 ; 


CiiECKIKG ON V/HETEIER THERE IS 


05AB- 


36 02 




3350 




STX *WHERE+1 






2460 ; 


ENOUGH 


HEMORV, 


05AD- 


4C 9A 


05 


3360 




JHP CASSLP 


050E- 


AD 14 04 


2470 




LDA STLEN 


05B0- 


A0 00 




3370 


TRANS 


LDY #0 


0511- 


C5 3 4 


2480 




CMP *PGMEN+10 


05B2- 


Bl 01 




3380 




LDA (WHERE) ,Y 


0513- 


90 0E 


2490 




BCC tIEMOK 


05B4- 


AA 




3390 




TAX 


0515- 


A2 06 


2500 MEMBAD 


LDX #6 


05B5- 


D0 08 




3400 




BNE NOTEN 


0517- 


BD 5F 06 


2510 MEMCHR 


LDA TOOBIG,X 


05B7- 


C8 




3410 




INY 


051A- 


2 D2 FF 


2520 




JSR PRINT 








3420 


; LAST LINE OF TOKENS DONE? 


051D- 


CA 


2530 




DEX 


05B8- 


Bl 01 




3430 




LDA (WHERE), Y 


051E- 


10 F7 


2540 




BPL MEMCHR 


05BA- 


D0 3 




3440 




BNE NOTEN 






2550 ; 


MESSAGE 


DISPLAYED: QUIT NOW 


05BC- 


4C 12 


06 


3450 




JMP TOKDONE 


0520- 


60 


2560 




RTS 


05BF- 


A0 01 




3460 


NOTEN 


LDY #1 


0521- 


90 F2 


2570 DIFFPAGE 


BCC MEMBAD 


05C1- 


Bl 01 




3470 




LDA (KHERE),Y 


0523- 


A9 


25 80 MEMOK 


LDA #?00 


05C3- 


BE 16 


04 


3480 




STX STLOC 


0525- 


BD 19 04 


259B 




STA MODE 








3490 


; SET END 


OF CURRENT LINE 


052B- 


EE lA 04 


2600 




INC BLOCK 


05C6- 


BD 17 


04 


3500 




STA STLOC+1 


052B- 


4C 7B 04 


2610 




JHP INITY 


E5C9- 


A0 04 




3510 




LDY #4 


052E- 


58 


2 620 LOADED 


CLI 


05CB- 


E6 01 




3520 


TOTXT 


INC *WHERE 






2630 ; 


ALLOW INTERRUPTS NOW 








3530 


; STEP PAST POINTER 


052F- 


A5 01 


2640 




LDA *W[iERE 








3540 


; AND LINE 


NUMBER 






2650 ; 


SET HIGK 


ADDRESS 


5CD- 


D0 02 




3550 




BNE WHOK 


0531- 


8D 16 04 


2660 




STA STLOC 


B5CF- 


E6 02 




3560 




INC *WHERE+1 


0534- 


A5 2 


2670 




LDA *WHERE+1 


05D1- 


88 




3570 


WHOK 


DEY 


0536- 


8D 17 04 


2680 




STA STLOC+1 


05D2- 


DO F7 




3580 




BNE TOTXT 






2690 ; 


INITIALIZATION FOR CHECKSUM 


05D4- 


Bl 01 




3590 


TRLOOP 


LDA (WHERE) ,Y 






2700 , 


AND PROGRAM LINKAGE 


05D6- 


C9 22 




3600 




CMP #$22 






2710 , 












3610 


; IS IT A 


QUOTE? 


0539- 


A9 08 


2720 




LDA »8 


05DS- 


DO OF 




3620 




BNE NOQ 


053B- 


85 02 


2730 




STA *WHERE+1 


05DA- 


AD 19 


04 


3630 




LDA MODE 


053D- 


A9 05 


2740 




LDA OS 


05DD- 


F0 5 




3640 




BEQ MODEON 


053F- 


80 02 04 


2750 




STA 50402 


05DF- 


CE 19 


04 


3650 




DEC MODE 


0542- 


A9 01 


2760 




LDA til 


05E2- 


F0 12 




366S 




BEQ NXTCHAR 


0544- 


85 01 


2770 




STA *WHERE 








3670 


; ** ALWAYS GOES ** 


0546- 


8D 01 04 


2780 




STA S04D1 


05E4- 


EE 19 


04 


3680 


MODEON 


INC MODE 


0549- 


BD 19 04 


2790 




STA MODE 


05E7- 


DO OD 




3690 




BNE NXTCHAR 






2800 


NOW USE 


'MODE- AS QUOTE-MODE FLAG 








3700 


; ** ALVJAYS GOES ** 






2810 


VALUES 


ARE: 


05E9- 


AE 19 


04 


3710 


NOQ 


LDX MODE 






2820 


- CURRENTLY INSIDE QUOTES 


05EC- 


F0 OS 




3720 




BEQ NXTCHAR 






2830 


1 - NOT IN QUOTES 








3730 


; BRANCH 


[F WE ARE IN QUOTES 






2840 






05EE- 


AA 




3740 




TAX 


054C- 


Ag FF 


2850 




LDA *5FF 


5EF- 


10 05 




3750 




BPL NXTCHAR 


054E- 


A0 00 


2860 




LDY 80 








3760 


; ONLY TRANSLATE TOKENS 


0550- 


51 01 


2870 C 


;hkloop 


EOR (WHERE) , Y 


05F1- 


BD 00 


07 


3770 




LDA S0700,X 






2880 


CHECKSUM CALCULATION 








3780 


; TRANSLATE FROM TABLE 


0552- 


E6 01 


2890 




INC 'WHERE 


05F4- 


91 01 




3790 




STA (WHERE),Y 


0554- 


D0 02 


2900 




BNE CHKEND 


05F6- 


E6 01 




3800 


NXTCHAR 


INC *WHERE 


0556- 


E6 02 


2910 




INC *WHERE+1 


05F8- 


D0 02 




381B 




BNE WHEOK 


0558- 


A6 01 


2920 ( 


:hkend 


LDX *WHERE 


05FA- 


E6 02 




3820 




INC *WHERE+1 


055A- 


EC 16 04 


2930 




CPX STLOC 


05FC- 


A5 01 




3830 


WHEOK 


LDA *WHERE 


055D- 


DO Fl 


2940 




BNE CHKLOOP 


05FE- 


CD 16 


04 


3840 




CMP STLOC 


055F- 


A6 02 


2950 




LDX *WHERE+1 








3850 


; HAVE WE 


FINISHED THIS LINE? 


0561- 


EC 17 04 


2960 




CPX STLOC+1 


0601- 


DO Dl 




3860 




BNE TRLOOP 


0564- 


D0 EA 


2970 




BNE CHKLOOP 


0603- 


A5 2 




3870 




LDA *WHERE+1 


0566- 


Dl 01 


2980 




CMP (WHERE) ,Y 


0605- 


CD 17 


04 


3880 




CMP STLOC+1 


0568- 


F0 15 


2990 




BEQ CHKOK 


0608- 


D0 CA 




3890 




BNE TRLOOP 


056A- 


AD IB 04 


3000 




LDA BAD 


060A- 


A9 01 




3900 




LDA #1 






3010 


• PRINT 


BAD' 


060C- 


8D 19 


04 


3910 




STA MODE 


056D- 


20 D2 FF 


3020 




JSR PRINT 








3920 


r RESET QUOTE MODE FLAG 


0570- 


AD IC 134 


3030 




LDA BAD+1 


060F- 


4C B0 


05 


3930 




JMP TRANS 


0573- 


20 02 FF 


3040 




JSR PRINT 








3940 


, 




0576- 


AD ID 04 


3050 




LDA BAD+2 








3950 


; FINISHED TOKEN TRANSLATION 


057y- 


20 02 FF 


3060 




JSR PRINT 


0612- 


EE 16 


04 


3960 


TOKDONE 


INC STLOC 






3070 


■ DO THE 


REST ANYWAY 








3970 


; INCLUDE 


THE '00 00' (END OF 


057C- 


4C 8B 05 


3080 




JHP CASSREL 








3980 


; PROGRAM 


IN THE LENGTH 


057F- 


AD IE 04 


3090 ( 


:hkok 


LDA OK 








3990 










3100 


• PRINT 


OK' 


0615- 


D0 03 




4000 


' 


BNE HORLOC 


0582- 


20 D2 FF 


3110 




JSR PRINT 


0617- 


EE 17 


04 


4010 




INC STLOC+1 


0585- 


AD IF 04 


3120 




LDA OK+1 


061A- 


EE 16 


04 


4020 


MOHLOC 


INC STLOC 


0588- 


20 02 FF 


3130 




JSR PRINT 


061D- 


D0 3 




4030 




BNE LOCDON 


058B- 


A9 01 


3140 ( 


;assrel 


LDA n 


061F- 


EE 17 


04 


4040 




INC STLOC+1 


058D- 


85 01 


3150 




STA *WHERE 


0622- 


AD 16 


04 


4050 


LOCDON 


LDA STLOC 


058F- 


A9 08 


3160 




LDA #8 


0625- 


85 2C 




4060 




STA *PGHEN+2 



118 



COMPUTEI 



September/October. 1980. Issuei 



0627 

0629 

062C- 38 

062D- 

062F- 

0631- 



85 2E 
AD 17 04 



E9 03 



2D 
2F 



B633- 
0635- 
0637- 
0639- 
063B- 
0630- 
063F- 
0642- 
0643- 
0645- 
0647- 
064A- 
064B- 
064D- 
064F- 
0652- 
0654- 
0657- 
0659- 
065C- 
065F- 
0662- 
0665- 



A9 01 
85 01 
A9 08 
85 02 
A0 0G 
Bl 0i 
80 14 04 
C8 

Bl 01 
F0 15 
8D IS 04 
38 

E9 03 
91 01 
AO 14 04 
85 01 
AD 15 04 
85 02 
4C 3B 06 
4C 23 04 
47 49 42 
20 4F 4F 
54 



0780- 


80 


0781- 


81 


0782- 


82 


0783- 


83 


0784- 


85 


0785- 


95 


0786- 


86 


0787- 


87 


0788- 


9D 


0789- 


9 A 


078A- 


98 


078B- 


84 


078C- 


9E 


0780- 


9D 


078E- 


9D 


078F- 


9D 


0790- 


9D 


0791- 


9D 


0792- 


90 


0793- 


90 


0794- 


90 


0795- 


90 


0796- 


A3 


0797- 


9F 


0798- 


90 


0799- 


90 


79A- 


90 


079B- 


95 


079C- 


95 


079D- 


95 


079E- 


95 


079F- 


95 


07A0- 


9D 


07A1- 


95 


07A2- 


A0 


07A3- 


95 


07A4- 


95 


07A5- 


95 


07A6- 


95 


07A7- 


93 


07A8- 


94 


07A9- 


95 


07AA- 


88 


07An- 


89 


a7AC- 


CA 


07AD- 


ec 


B7AE- 


cc 


H7AF- 


95 


O7D0- 


CD 


07ni- 


GK 



4070 
4080 
4090 
4100 
4110 
4120 
4130 
4140 
4150 
4160 
4170 
4180 
4190 
4200 
4210 
4220 
4230 
4240 
4250 
4250 
4270 
4280 
4290 
4300 
4310 
4320 
4330 
4340 
4350 
4360 
4370 



STA *PGMEH+4 

LDA ETLOC+1 

SEC 

SBC #$D3 

STA *PGMEN+3 

STA *PGMEN+5 

SET UP PROGRAM LINKS FOR 
MOVE FROM 50 801 TO SOS 01 



4380 
4390 
4400 
4410 
4420 
4430 
4440 
4450 
4460 
4470 
4480 
4490 
4500 
4510 
4520 
4530 
4540 
4550 
4560 
4570 
4580 
4590 
4600 
4610 
4620 
4630 
4640 
4650 
4660 
4670 
4680 
4690 
4700 
4710 
4720 
4730 
4740 
4750 
4760 
4770 
4780 
4790 
4800 
4810 
4820 
4830 
4840 
4850 
4860 
4870 
4880 
4890 
4900 
4910 
4920 
493B 
4940 



RELLP 



RELDONE 
TOOBIG 



LDA 
STA 
LOA 
STA 
LDY 
LDA 
STA 
INY 
LDA 
BEQ 
STA 
SEC 
SBC 
STA 
LDA 
STA 
LDA 
STA 
JMP 
JKP 
.BY 



«1 

*WHERE 

#8 

*WHERE+1 

#0 

(WEI ERE) ,Y 

STLEN 

(WHERE) ,Y 

RELDONE 
STLEN+1 



(WHERE) ,y 

STLEN 

*VJHERE 

STLEN+1 

*WHERE+1 

RELLP 

MOVE 

'GIB OCT" 



MESSAGE 'TOO BIG' REVERSED 
•BA S0780 

**** TOKEN TRANSLATION TABLE *** 

(SEE FOOTNOTES BELOW) 



.BY 580 
.BY 581 
.BY 582 
.BY S83 
.BY S85 
.BY 595 
-BY 586 
.BY 587 
.BY 59D 
.SY $9A 
.BY 598 
.BY S84 
.BY $9E 
-BY ?9D 
.BY $9D 
.BY 59D 
.BY 59D 
.BY 59D 
.BY 59D 
.BY S9D 
.BY 59D 
•BY 59D 
•BY 5A3 
.BY S9P 
.BY $9D 
.BY 59D 
.BY 590 
.BY 595 
.BY 595 
,BY $95 
.BY S95 
.BY $95 
.BY $9D 
.BY S95 
.BY 5A0 
.BY 595 
.BY S95 
.BY 595 
.BY 595 
.BY S93 
.BY 594 
.BY 595 
.BY 588 
.BY 589 
.BY S8A 
.BY 5BB 
.BY S8C 
.BY 595 
.BY SSD 
.BY S8E 



** 






END 

FOE 

NEXT 

DATA 

INPUT 

*DEL 

DIM 

READ 

*GR 

*TEXT/CONT 

PRS/PRIMT# 

IN«/1NPUT# 

CALL/SYS 

*PLOT 

*HLIN 

*VLIN 

*HGR2 

*HGR 

*HC0LOR= 

*HPLOT 

* DRAW 

*XDRAW 

*HTAB/NEW 

*HOME/OPEN 

*ROT= 

*SCAL£-. 

*SHLOAD 

*TRAC£ 

*NGTRACE 

'NORMAL 

*IKVERSE 

*FLASH 

* COLOR = 

*POP 

*VTAB/CLOSE ** 

*HIHEn 

*LOHEM 

*ONERR 

*RESUKB 

*RECALL/LOAD ** 

*STORE/SAVE ** 

*SPEED= 

LET 

GOTO 

RUN 

IF 

RESTORE 

*& 

GOSUB 

RETURN 



07B2- 

07B3- 

B7B4- 

07B5- 

07B6- 

07B7- 

07B8- 

07B9- 

7BA- 

7BB- 

07BC- 

07BD- 

07BE- 

07BF- 

07C0- 

07C1- 

07C2- 

07C3- 

07C4- 

07C5- 

07C6- 

07C7- 

07C8- 

07C9- 

07CA- 

07CB- 

07CC- 

07CO- 

07CE- 

07CF- 

07DO- 

0701- 

07D2- 

07D3- 

07D4- 

07D5- 

07D6- 

07D7- 

07D8- 

07D9- 

07DA- 

07OB- 

07OC- 

07DD- 

07DE- 

07DF- 

07E0- 

07E1- 

07E2- 

07B3- 

07E4- 

07E5- 

07E6- 

07E7- 

07E8- 

07E9- 

07 EA- 



SE 

90 

91 

92 

93 

94 

96 

97 

99 

9A 

9B 

9C 

Al 

A2 

A3 

A4 

A5 

A6 

A7 

90 

A8 

A9 

AA 

AB 

AC 

AD 

AE 

AF 

BO 

Bl 

B2 

B3 

84 

35 

B6 

B7 

B8 

90 

90 

B9 

BA 

BE 

BC 

BD 

BE 

BF 

ce 

CI 
C2 
C3 
C4 
C5 
C6 
C7 
C8 
C9 
CA 



07EB- 8F 8F 8F 

07EE- 8F 8F 8F 

07F1- 8F 8F 8F 

07F4- 8F 8F 8F 

07F7- 8F 8P 8F 

07FA- 8F SF 8F 

07FD- 8F 8F 8F 



0800- 00 00 00 



4950 

4960 

4970 

4980 

4990 

5000 

5010 

5020 

5030 

5040 

5050 

5060 

5070 

5080 

5090 

5100 

5110 

5120 

5130 

5140 

51S0 

5160 

5170 

5180 

5190 

5200 

5210 

5220 

5230 

5240 

5250 

5260 

5270 

5280 

5290 

5300 

5310 

5320 

5330 

5340 

5350 

5360 

5370 

5380 

5390 

5400 

5410 

5420 

5430 

5440 

5450 

5460 

5470 

5480 

5490 

5500 

5510 

5520 

5530 

5540 

5550 

5560 

5570 

5580 

5590 
5600 
5610 
5620 
5630 
5640 
5650 
5660 
5670 
5680 
5690 
5700 
5710 
5720 
5730 
5740 
5750 
5760 
5770 
5760 
5790 
6800 



.BY 53F 
.BY 590 
.BY $91 
.BY $92 
.BY 593 
.BY S94 
.BY 596 
.BY $97 
.BY $99 
.BY $9A 
.BY $9B 
.BY S9C 
.BY SAl 
•BY 5A2 
-BY $A3 
.BY $A4 
.BY SAS 
.BY SA6 
.BY $A7 
.BY S9D 
.BY $A8 
.BY $A9 
.BY $AA 
-BY $AB 
.BY 5AC 
.BY SAD 
.BY 5AE 
.BY SAP 
.BY $B0 
.BY 5B1 
.BY 5B2 
.BY 5B3 
.BY SB4 
.BY $B5 
.BY $B6 
.BY 5B7 
.BY 5B8 
•BY 59D 
.BY S9D 
-BY SB9 
.BY $BA 
.BY 5BB 
.BY $BC 
.BY $BD 
.BY $BE 
.BY 5BF 
.BY $C0 
.BY $C1 
.BY 5C2 
.BY $C3 
.BY 5C4 
.BY 5C5 
.BY SC6 
.BY SC7 
.BY 5C8 
.BY SC9 
.BY SCA 



REM 

STOP 

ON 

WAIT * 

LOAD 

SAVE 

DEP 

POKE * 

PRINT 

CONT 

LIST 

CLEAR 

GET 

^3EW 

TAB( * 

TO 

FN 

SPC( 

THEN 

*AT 

NOT 

STEP 



* (TIMES) 

/ 

" (EXPONENTIATION) 

AND 

OR 

> 

< 

EGN 

INT 

ABS 

USR * 

FRE 

*SCRN( 

*PDL 

PCS 

SQR 

RND * 

LOG 

EXP 

COS 

SIN 

TAN 

ATN 

PEEK * 

LEN 

STR5 

VAL 

ASC 

CURS 

LEFT$ 

RIGHTS 

KIDS 



REMAINDER NOT IMPLEMENTED 
SUBSTITUTE 'REM' 

.BY S8F 58F 58P 53F S8F S8F 

.BY 58F $8F S8F S8F S8F 58F 

.BY S8F $8F $8F SSF S8F S8F 

.BY 58F SSF 58F 

COMMANDS WHICH ARE PRECEEDED BY 
AN ASTERISK ABOVE ARE NOT 
IMPLEMENTED ON THE PET. THE ONES 
WHICH DEPEND ON APPLE HARDWARE 
(GRAPHICS AND PDLJ ARE TRANSLATED 
INTO 'CMD', THE OTHERS INTO 
'VERIFY' 

COMMANDS WITH AN ASTERISK TO 
THE RIGHT KAY TRANSLATE BADLY. 

COMMANDS WITH TWO ASTERISKS ARE 
PHONY TRANSLATIONS FOR MANUAL 
CONVERSION. 

SEE ARTICLE FOR DETAILS. 

END OF PHONY BASIC PROGRAM 
.BY 
.EN 



September /October, 1980. Issue 6 



COMPUTE! 



119 



APPLESOFT LOADER - TAPE CONTENTS 

File 1. "AFP LOAD SOURCE" 

- The source for the pnigi'am in the (brnuii used by 
Carl Moser's ASSKf/'I'KD. 

- Ri-c)iiires a 'SET' coiiiiuaHd due to si/.c. 

- SET $4-100 S(>l'"I-'l'' will lca\'e some rouiii. 

File 2. "APP LOAD SOURCE" - secoml mpy 
FILE 3. "APP LOAD OBJ" 

- The object program. 

- Can be LOADed and SAVEd fruni BASIC;, (ie. doesn't 
recitiire inachinc-laiigiiage monitor) 

• The cassette must be mining before yoti lype RUN. 

File 4. "APP LOAD OBJ" - second copy 

File 5. "APP LOAD IMAGE " 

- Memory-image of source program saved using machine- 
Uinguage monitor 

- Resides in S4100 to S6!!(I0 

- Allow.s PRINT and ASSE.MBLE to function with disk 
version of ASSM/'i'El). (1 think that's all that %vill 
work). Use the following sequence ol commands: 
SYS 4 ; - get into machine-language monitor 

.L "APP LOAD IMAGE" (load the source) 

(load ASSM/TED) 

.G 2000 - invoke the assembler 

SET S4100 S6800 

HARD SET 

ASSEMBLE 

File G. "APP LOAD IMAGE" - second copy 



OTHER NEW PRODUCTS: 
-Screen formatting /editing 
-Printer drivers for NEC,TI-810, 
and other ASCII printers 



aUHLITV PWOOCTS F» PfT/l»1 CCrtHJTERS 



SOFTUflfiE BT nlC»0 SOFTIBRE SVSTOIS 



01 • 

at • 

Sli • 
Sk • 

Jlk • 
6k 

Ok 

Sk • 



Chr\ur-cKfck 

e;iii>l Clock 
Billboard 
Soriaol kit I 
nH^-E«frlor»r 

S«#»-PlM 



B«l*nc» Checkbook tHitt CbMt* 
Ej*1»ftd«J •^•tK, iri* function* 
B'M colojlat^r, cflrti^tr.non* 

n«1^. rinan^lal- 4ll '•Hi ntKl' 
rUlK. flft*nct- fW> n#lric conv 
flttrsctwo. bi*. 12^24-hOHf 
■ti«t* %\UMrt' dl*^ln C"b«t") 

fidd ullllTm le ^t/^r proaran 
5t« ^OM -•our rmran l« *T OPfd 
'Jorijblf diciionjf-f. cr***-r»f 
Cfi*to ^»liorri< irtt r**ctvon* 



PrKf 

• 9.9! 
I 9.« 

• 9,95 
I 9.95 
•19.9! 
r29.9! 
i 5.95 
tl9.?S 
H9,95 
I 9.9S 
tl9.95 
I 3.95 



For prffarow* (wrksd wMh *. pU**f If •?! f-* U«r»iOn 1 (B*tlC 2 0> or 
U»rtion3 <&*%ie 3.0> ROft. Unit for kmailabllltv of prrtrinl for 
Ufriion 3 (Roiic 4.0) RW> and 60 column dl»rl«<<«. KSS Ditk rr-o^r»A^ 
as^fell^lt toon. nor* ar» on I K» W** • yrito for l»l»*i ll«t 



(iCCESSOB'i INTiRFflCE t)£UlC£S 

fill in!tr**c»» *rp «*t^l«l, 1r»1»d. *nd w*r*nit«d. Ho 

loftwart It ct^«irfd. liwrU 'lu* »n and w»». Hjm *»tl*flld 
cuiTonori know I hjr (mr loMfr *ric« •^•jnDtlHf ^ualll*' 

TU-£SC Ini«fl«C» PETtBn lo CinirOOlO. «C. K^ntC, or olk.r 

Induilr^ standard Porallvl rrvntor*. Siwrl* *lua in til 
to*i*uttr ««J mn(*r ... no t&fiiMro rMuirtd. y*rkk «ilk 

dllk. oih*p ]£££ drJl^M allachod. 1129. 9S 

TLI-t5H InltrUca PET/CW to IIS-23J <«rial> ►nnln't. luch ai 

th» popular Htathkit H-U. 1200 tkaud (olkor r*1#* auailobU 

«n r*-Sur*t)- Ho*of1yart rt^sisrtd. Powar rack incUd«d 

t?9.95 

TIMKJE Uid*o Exranmn for PET^CBH allowa plu*-COrtntcUon of 

feiir cop^p^iTar to an tiftornal uidro monitor ar Tu conwarttr 
Uni^p connocton alltv attachworl 0* Olt^tr c«fi 1 rt - 

faripkortlt \j\t contact rKt#ft*10rtf, *^.9S 

TU-HOM Inltrtac* TR&-90 lo K-232 priftttrt »UCK a* th» Hoat^klt 
H-14. Plu« into printar. Radio SKack turan^ion inttrfaco. 
Ho *oftuar» rt^uirtd. allow* prinltr 10 rtin It i ta najtl^iA 
op«*nl. Hothin* alt* to tut' •69.96 



Virsinia Micro Systems 

1408 Idabo Stiial. Woodbilllga. VliglitU 22191 
I7<I}1494-I0S7 



UlSft.-flC 

un add 4'.! 

Oaalar 

in4m rtM 

I (Kit tad 




DISON 
OMPUTER 



YOUR COMMUNICATING PET 

Your PET can now become an intelligent ternninah send and receive Word Pro files and 
programs. Your PETcan communicate with mainframes and other PETs. The PET can com- 
municate simultaneously with another PET, or you can transmit entire files. This package 
can be incorporated into your programs, used for business applications or two player games. 
Works on new PETs with 40 or 80 column screens and comes with demonstration programs. 
Price: $195.00 

Features include: 

-Full and half duplex, also local echo. 
-Supports odd, even and mark parity. 
-CRC, error checking for PET to PET files. 



\ 



J^ 

P^-6 



'& %t 



1825 MONROE STREET, MADISON, Wl 53711 (608)255-5552 



ip 






120 



COMPUTII 



September/October, 1980. Issue 6 



Capute 

Wherein we 
acknowledge recent 
goofs. . . 

This poge brought to you by Robert Lock, 
Editor/Publisher or^d our (sometimes hostile) 
but always active reoders. 



Corrections for Larry's Atari Article on In- 
put/Output 

Here are some corrections to my article in the 
July/August COMPUTE on Input/Output on tiie 
ATARI. First of all, the listings are numbered incor- 
rectly. Listings 1 through 3 arc numbered ok. Listing 
7 should be Listing 4. And, Listings 4 through 6 
should be Listings 5 through 7, respectively. 

In the text concerning the XI09 and XI05 
commands, references arc made to an EOF 
character. These should be EOL characters instead. 
Also in this section, just under Listing 5, the 
paragraph on the XI05 command makes com- 
parisons to the PRINT command several times. 
These comparisions should be to the INPUT com- 
mand instead. Thanks to the folks at Iridis for poin- 
ting out these last corrections. © 



Program Listings for COMPUTE 

Cursor control characters will appear in source listings 
as shown below: 

h=HOME , fi=CLEAR SCREEN 
^=DOWN CURSOR , T=UP CURSOR 
>=RIGHT CURSOR, <=LEFT CURSOR 
i=REVERSE , r=REVERSE OFF 

Graphics (i.e. shifted) characters will appear as the 
unshifted alphanumeric character with an underline. 
This does not apply to the cursor control characters. 
The Spinwriter thimble doesn't have a backarrow 
symbol, so a "~" is used instead. 

The "~i" is used to indicate the beginning of a 
continuation line. It is also used to indicate the end 
of a line which ends with a space. This prevents any 
spaces from being hidden. © 



Advertiser's Index 

AB Computers SO, 51 

Abacus Software 36, 111 

Andromeda Computer Systems 61 

Harry H. Briley 103 

Cognitive Products 35 

Commodore BC 

Competitive Software 45 

Compute 35 

Computer Center of South Bend 83 

Computer House Div 16 

Computhink 17 

Connecticut Microcomputer 41 

CMS Software Systems 2, 105 

Creative Computing 58 

Creative Software 97 

Cursor 91 

Cyberio, Inc 29 

Data Equipment Supply Co 97 

D & R Creative Systems 36 

Dr. Daley's Software 37 

Eastern House Software 57 

ECXCo Ill 

Elcomp Books 109 

Electronic Specialists, Inc 41 

ETC Corporation 24 

F.I. Electronics 12. 13 

Forethiought Products 25 

FFS 91 

Hayden Publishiing 27 

Highlands Computer Services 55 

House of Computers, Inc 55, 103 

Intermountain Data 93 

International Technical Services, Inc Ill 

IRIDIS 73 

JACC, Inc 77 

Lemdato Products 99 

Madison Computer 119 

Maico 109 

Melad Associates 43 

Micro Computer Industries, Ltd 95 

Micro Technology Unlimited 1, IBC, DMC 

Micro-Ed, Inc 38, 39, DMC 

Micro-Mini Computer World 31 

Microtech lOl 

Microphys Programs 21. 22 

NEECO 8,9 

Omega Computer Products 85 

Optimized Data 99 

Osborne & Associates 47 

Petted 109 

Professional Software IFC 

Program Design, Inc 23, 79 

Programmofics 84 

Quality Software 70, 74 

Howard Sams & Co 7 

Sawyer Software 21 

Skyles Electric Works 19, 87, 113, DMC 

Small Business Computer Systems 15 

The Software Exchange 53 

Systems Formulate Corp 11 

TIS 99 

T.H.E.S.I.S 81 

TNW Corporation 103 

Virginia Micro Systems 119 

Zeigier Electronic Products 95 



COMPUTE. 

TM 

The Journal For Progressive Computing. 



My computer is: PIT APPLE ATARI OSI SYM KIM 

AIM Other (Specify) 



□ Pleose enter my 1 year (12 issue) subscription to COMPUTE. 
D New subscription 
D Renewal subscription 

$16.00 (U.S, Mail Order Subscription) 

$18. OO U.S, Funds (Canadian Subscription) 



My Name, Address: 



Charge my Visa MC 

Number Expires / __ 

COMPUTE and compule II ate publicolions ol Smoll Svslem Servrces. Inc . 900-902 Spiing Garden SI . 
GteervsDoio, NC 27-103 919 272 4867 



COMPUTE. 

The Journal For Progressive Computing. 



My computer Is: PET APPLE ATARI OSI SYM KIM 

AIM Other (Specify) 



D Please enter my 1 yeor (12 issue) subscription to COMPUTE 
n New subscription 
n Renewal subscription 

S16.00 (U.S. Mail Order Subscription) 

$18.00 U.S. Funds (Canadian Subscription) 



My Name, Address: 



Charge my Visa MC 

Number Expires / _ 

COMPuIE oria compute ii aie puDlicaiions of Small System Setvces. inc.. 9O0-9O2 Sprmg Garden St 
Greensboro N C 27403 919-272 4B07 



The Editor's Feedback: 

My computer is PET/CBM ATARI APPLE OTHER 

My applicatior^ is (check all that apply): 

Home/Personal Business Educational 

Industrial Other 

Comments: 



Content: 

Best Article This Issue (page *, title) 



I'd like to see more 
articles in COMPUTE. 
I'd like to see fewer . 
articles in COMPUTE, 
Other suggestions: 



Place 

Stamp 

Here 



COMPUTE./compute II 

Post Office Box 5406 
Greensboro, NC 27403 



Place 

Stamp 

Here 



COMPUTE./compute II 

Post Office Box 5406 
Greensboro, NC 27403 



Place 

Stamp 

Here 



COMPUTE./compute II 

Post Office Box 5406 
Greensboro, NC 27403 



Dear Micro Technology Unlimited: 

Please rush me the Fall 1979 catalog of 6502 expansion and 
application products. 

I have the following computerfs): 

Old PET New PET AIM-65 KIM-1 SYM-1 

Thank you for expediting. 

Sincerely, 



NAME: . 
STREET: 



C(TY/STATE/ZIP: 



COMPUTE 80 



Dear MICRO-ED: 

I would like further information on 

your educational programs 



Name 



Address 



City State Zip 




Skylcs Electric Works 

YES, I WANT MORE INFORMATtON ABOUT: 

PET PERIPHERALS . 

□ 8, 16, 24 K bytes of PET Memory Expansion Systems ■! 

n Full sized PET Keyboard with numeric pad - 

D PAL-40 (40 column], PAL-80 (80 column) PET Printers 

PET PROGRAMMING AIDS 

D BASIC PROGRAiyMERS TOOLKIT 
n MacroTeA 6502 Software Development System 
Name 



Address. 



City/State/Zip. 



D Please send name of local Skyles Electric Works dealer. 



P!ace Postage 
Stamp Here 



Micro Technology Unlimited 

P.O. Box 12106 
2806 Hillsborough St. 
Raleigh, NC 27605 



PLACE 

STAMP 
HERE 



V. 



"^ 



J 



MICRO-ED, INC. 
P.O. 60x24156 
Minneapolis, MN 55424 



NO POSTAGE 

NECESSARY 

IF MAILED 

IN THE 

UNITED STATES 



BUSINESS REPLY MAIL 

First Class Permit No. 503 Cupertino, CA 



Postage will be paid by addressee: 

Skyles Electric Works 
10301 Stonydale Drive 
P. 0. Box 574 
Cupertino, CA 95015 






AI3* 



J to sunny '^" ^torners, ^*^ 
^°''''o?pod^^''- "first euer" dealer 



^^ 



Micro Technology Unlimited 

P.O. Box 12106 
2806 Hillsborough Street 
Raleigh, N.C. 27605 
919 833-1458 



/ 



TheGfeat 
American Solution 

Macliine. 



More tban 50,000 
studentSt teachers and 
administrators solve 
problems with this 
reliable Commodore 
computer. 

You're looking at the 
Number One computer in 
education today. 

In fact, you've probably 
already used it. 

The Commodore. 

You know it teaches. 
Guides. Challenges, 
Analyzes. OrganizeSr— 
Simplifies. 



But did you know it has 
capabilities that are far 
beyond its price range? 

You can accomplish tasks 
with The Commodore at a 
price/performance ratio that 
leads the field. 

You can also count on 
The Commodore showing up 
for class every day. 

It's a remarkably sophis- 
ticated, remarkably reliable 
machine. Around 
the world in 

at" 




schools — and businesses 
too — there are more 
than 100,000 Commodore 
computers now at work. 

If you sense a snag in the 
flow of knowledge in your 
classes, we think you should 
challenge The Commodore. 

Compare it against any 
computer in — or above — its 
field. 

See if it won't raise the 
level of interest and accom- 
plishment among your 
students. 

And simplify the com- 
plex in your administrative 
duties. 

All at a price that makes 
it stand alone. 

For the name of your 
nearest authorized Commo- 
dore dealer, just write to: 
Commodore Business 
Machines, Inc., 3330 Scott 
Blvd., Santa Clara, CA 95051 

Call now toll-free. Ask for operator 973: 

800-824-7888 

(In CaJif., 800 852 7777) 

(In Ala^a and Hawaii. 800-824-7919) 

Qk commodore