Skip to main content

Full text of "Analog Computing Magazine Issue 60 (APAC System and DOS-CD)"

See other formats


THE x^l iVl/^CSJV 



OR J\TARI COfVtPUTER OVITNERS 




U.S.A. $3.50 
CANADA $4.75 



INCLUDING 

Video 
Game 
Digest 



ISSUE 60 



MAY 1988 



DOS-CD: 

Double your disc 
capacity! 




.«. .rw 



'AmM^ 



BESX 



f 



a 



^noT* P«P 



uVar 



programs 



available. 



over 



88 



^M.OG Coxnput 




space 






G^.w-- space 







GAMES 2 

Retrofire 
Roundup 
L/vewire 

Avalanche 






,6e<^' 



,toOX9 







GRAPHICS 

Sketch Pad 

Graphic Violence! 

Multicolor Screen Generator 

Moving Missiles in BASIC 

Stars 3-D 

Bar Chart Subroutine 

Solid States 

Scredit 

Graph E's 

P/M Creator/Animator 



\CeV 



Ct^^t>oovO^^ 








5/cVo, 




So.!''*/?? 
^/?e £? ^^a/o. 




VISA 



V^^^^^fCoa^"' 



To order, send $9.95 per disk 

^ (plus $2.50 per order shipping and handling) 
NO CODs ACCEPTED 

to: 



N. 



P.O. BOX 16927 
HOLLYWOOD, CA 91615 




PEMFIk.E3K3 



CONTENTS 




FEATURES 



Quick 

Screen Earl Davidson 15 

An easy and fast way to design and 
display your own custom screens. 

The MAC/65 De-Tokenizer 

Cliarles Bacliand 27 

Convert your tol<enized MAC/65 flies 
into standard text. 

Money 

Pouch Chuck Rosko 34 

Teach ctiildren tiow to count money 
witti tfiis entertaining program. 



Needlework 

Design Regena ST 39 

Design needleworl< projects on your 

computer screen. 

DOS CD. .Angelo Giambra 45 
Wtiy settie for 64 fiies on your disl< 
wtien you can fiave 128? 

Busy Buddy Express 

Matthew J.W. Ratcliff 54 

Keep impatient BBSs on-line 
automatically. 



Binary Load Pictures 

Charles F. Johnson 57 

Display your computer artworl< directly 
from DOS. 

Cloudhopper. .Greg Knauss 60 
Tfiis game written in Action! will keep 
you hoppin'. 

APAC 

System . . . .Thomas Taniba 64 

Add a new grapfilcs mode to your 

Atari. 

Dealin' 

Demo Eric Huffman 72 

An easy subroutine for drawing card 

game graphiics. 

Bits & Pieces 
. .Dr Lee S., Brilliant, M.D. 79 
Part 2 continues witti Atari Zuccfiini. 



REVIEWS 



MicroMod Turbobase (Micromiser 
Software) Steve Panak 31 

Breakers (Broderbund Software) 
Steve Panak 33 

Video Joyce Worley, Arnie 

Game Digest . . . Katz and Bill Kunkel 
Ttie History of Video Games, Part 11 . . . 83 

Panak strikes! Steve Panak 86 

Ttiis montti Steve reviews Charge at Chick- 
amauga (SSI) and Triple Pack (Access 
Software). 



Working with the Atari ST 
(Sunshine Books) John W. Little ST 



89 



COLUMNS 



Editorial Clayton Walnum 4 

Reader Comment 7 

8-bit News 13 

M/L Editor Clayton Walnum 26 



Database Delphi 77 

Boot Camp Karl E. Wiegers 92 

Index to Advertisers 97 



ANALOG Computing (ISSN 0744-9917) Is published monthly by L.F.P., Inc., 9171 Wilshlre Blvd., Suite 300, Beverly Hills, CA 90210. © 1988 L.F.P., Inc. | 
Return postage must accompany all manuscripts, drawings photos, disks, etc.. If they are to be returned, and no responsibility can be assumed for unsolicit- 
ed materials All rights reserved on entire contents; nothing may be reproduced In whole or In part without written permission from the publisher. U.S. sub- 
scrlptlon: $28 for one year (12 issues), $52 for two years (24 issues), $76 for three years (36 Issues). Foreign subscription: Add $7 per year^ Single copy 
$3 50 (add $1 for postage). Change of address: six weeks advance notice, and both old and new addresses are needed. POSTMASTER: Send change 
of address to: ANALOG Computing Magazine, P.O. Box 16927, North Hollywood, CA 91615. Second-class postage paid at Beverly Hills, CA, and additional | 
mailing offices. ^^_^^^^^.^^^^^^^^^_ 



Editorial 



Picture this: 

A man (or a woman, if you like) is flip- 
ping through the newspaper when an ad- 
vertisement from the local computer shop 
catches his eye. Dazzling graphics! the ad 
screams. Play arcade quality games in 
your own living room! A great entertain- 
ment value for the whole family! 

The old zip and zap glimmers in his 
eye, and he leans forward, reads more 
carefully, so as not to miss anything im- 
portant. He's been thinking about buying 
a computer. He wants one — wants one 
badly. But he needs a worthwhile reason, 
any worthwhile reason. 

Not games, though. Games are frivo- 
lous. Games are time wasters. Games are 
something you play late Saturday night, 
when it's dark, when no one is looking. 
(He arrives at these conclusions as he 
drools over the screen shots of Flight 
Simulator II.] 

He continues reading, a man on a 
quest, searching for anything that will al- 
low him to lighten his wallet's green bur- 
den, guiltlessly. And then, like a message 
from the gods, he finds it. 

Advanced spreadsheet and word 
processing capabilities! 

"Yes!" the man shrieks, as he tumbles 
into his car and heads for the shop. "I can 
work at home!" 

Sound familiar? Yeah, I thought it 
might. More computer purchases have 
been rationalized in this way than there 
are leaves on the ground during a New 
England October. But did you really buy 
that computer so you could spend your 
weeknights and weekends slaving over a 
spreadsheet? (Maybe a couple of you did; 
stay away from my parties.] 



Let's be completely honest with each 
other. What does your computer spend 
most of its time doing? Playing games, 
right? Come on, say it. We're all friends 
here. 

Games, games, games. 

Didn't that feel good? Aren't you glad 
we got this all out in the open? 

There's nothing to be ashamed of. 
Games are good, a great way to get the 
family together some evening, just to share 
a few houi-s of joystick jockeying. 

But somewhere along the line, enter- 
tainment software got a bad name, be- 
came the black sheep in the software 
catalog. 

Does it make sense to you? I can't fig- 
ure it out. 

But I do have a theory. 

I'll bet that somewhere, tucked away in 
one of those huge glass skyscrapers you 
see in every city's skyline, there's a group 
of executives (you know; those people 
who wear Gucci shoes and drive BMWs) 
who came up with an idea: Convince peo- 
ple that entertainment software is a bane 
to modern society and productivity soft- 
ware is the best thing since hot fudge sun- 
daes and — presto! — you've got a crew 
who'll not only put in their time at work, 
but get a httle extra in at home too! 

Call me paranoid, if you hke, but some- 
times I wonder. 

Luckily, you and I know better. That's 
one of the reasons you read ANALOG 
Computing. You know that, when it 
comes to games, no one can keep up with 
us. And, as Greg Knauss's "Cloudhopper" 
proves, this month is no exception. Ar- 
cade quality software tucked neatly into 
the pages of a magazine. What a bargain! 



And we haven't forgotten the younger 
members of your family. "Money Pouch" 
by Chuck Rosko is a charming coin count- 
ing game that will keep the younger chil- 
dren entertained, while it sneaks in a little 
education on the side. 

When there's a lull in the fun, don't for- 
get to check out Charles F. Johnson's un- 
usual and useful utility found with the 
article "Binary Load Pictures." Now you 
can take those Micro Illustrator or Micro 
Painter picture files and convert them to 
a binary form that can be loaded and 
viewed directly from DOS, enabling you 
to share your masterpieces with friends 
who may not have the necessary software 
to view them otherwise. 

Or how about Matt Ratcliff 's interest- 
ing "Busy Buddy Express"? The next time 
you get distracted for a minute or two 
from your local BBS, you don't need to 
fear the dreaded Time-out Syndrome. 
"Busy Buddy" will help keep that BBS oc- 
cupied until you get back to it. 

For you assembly language program- 
mers, we've got Charles Bachand's 
"MAC/65 Detokenizer," which will take 
tokenized MAC/65 files and convert them 
back to text form. (Charlie spent many an 
hour laboriously working his way through 
tokenized files, decoding their secrets 
byte by byte. It was a horrible thing to 
watch.] If you've got an assembler other 
than MAC/65, you'll find this program in- 
valuable. 

And, of course, there's more — much 
more. 

But you don't need me to tell you that. 
Place your fingers at the edges of this page 
and give it a little flick. It's time for the 
fun to begin. 



Clayton Walnum 
Technical Editor 
ANALOG Computing 



PAGE 4 / MAY 1988 



ANALOG COMPUTING 



American Techna- Vision 



For Orders Only - 1-800-551-9995 
CA. Orders / Information 415-352-3787 



"Providing 8 Bit support with one of the Worlds 
largest inventories of Atari replacement parts" 

• No surcharge for VISA/I^asterCard 

• Your card is not charged until we ship 



800 4 PIECE BOARD SET 

Includes Main Board, Power Supply 
Assembly, CPU Module and 10K 
Revision B Operating System Module. 
All boards are new, tested and complete 
with all components. $ /^ q 50 



1050 MECHANISM 

Factory fresh TANDON mechs. 
make difficult repairs a snap. Units 
are complete with Head, Stepper, 
Spindle motor etc. Just plug in, no 
difficult alignments or adjustments 



required. 



547 



50 



2400 BAUD MODEM 

Mitak Hayes compatible. Auto dial, 
autoanswer. 0-300/1200/2400 baud 
Internal speaker. Auto baud rate and 
format adjustment. Touch tone and 
pulse dialing. Auto busy redial. 
Works with All Atari's «, , _ _ r.c I 
8 bit requires interface. !p n (^ 09 1> 
STCebiesoldsefieratefy. \\JZ/ I 



POWER PACKS 

Exact replacement transformer 
for 800/400, 1050, 810, 1200XL, 
850 and 1020 units. Replaces 
older "weaker" units. Atari part 
#C017945. J 5Q 



400 3 PIECE BOARD SET 

Includes Main Board, Power Supply 
Assembly and CPU Module. All 
boards are new, tested and complete 
with all components, a. j .** en 



JOYSTICK 



Wote with aJ At£8i Computers 
ORIGINAL STYLE $yOO 



ATARIWRITER 
CARTRIDGE 

Popular cartridge version turns 
any 8 bit Atari into a powerful 
word processor. Written by 
Atari. Disk drive supported but 
not required. it/~k/-\95 

For ^Atari's except Sr ■*' V M 



600XL 64K UPGRADE 

Easy to install internal 
modification allows you to hook 
up a disk drive and run all 
800XL software. Kit includes all 

garts and detailed instructions, 
oldering required to install 3 
jumpers. $0095 



800 10K "B" O.S. Module 

Older 800 units need the revision "B" 
Operatino system to run newer 
software. Type the following peek in 
BASIC to see which revision you 
have. PRINT PEEK(58383). , 



If the result is 56 order nowl 



$g50 



PILOT PROGRAMMING 
LANGUAGE PACKAGE 

Includes PILOT cart, with "Turtle 
Graphics", Pilot Primer and Student 
Rtot manuds. PILOT is an excellent 
learning or teaching tod. ^ . ____ 1 

'"*"■■■■"■"'"""■" ibiV^^'JI 



Wote witi sllAlafs 
except ST. 



PADDLE CONTROLLERS 

(Pair). Required for numerous 8 bit 
programs and applications. Use 
these to add two changeable 
variables to your BASIC or 
machine language programs. 

$050 



SERIAL I/O CABLE 

High quality 13 pin cable 
used to connect 8 bit Atari's 
to disk drives, interfaces, etc. 

$ C95 
New low price yj 



800/400 MODULES 

NEW PARTS COMPLETE WITH IC'S 

■ 800 Main Board 

I f. /^ 50 -800/400 CPU with GTIA 

'*VJ • 800 10K"B"O.S. Module 

^/ • 400 Main Board 

r-Ar»u • 800 Power Supply Board 

tAUn . 400 Power Supply Board 

16K Ram Module $14.50 
INTEGRATED CIRCUITS 

• CPU CO14806 

• POKEY C012294 

<t .J Crt • PIA C014795 

>P^yU.GTIA CO14805 

Hi • AI^IC C012296 

' • CPU CO10745 

PArW 'PIA CO10750 

C^^rl . QpL) C014377 

• DELAY CO60472 

MORE IC'S 

CO60302 XL BASIC ROM . $13.50 

1050 O.S. ROM $13.50 

2793 1050 FDC $19.50 

CO10444 2600 TIA $4.50 

1771 810 FDC $10.00 

1050 5713 STEP DRIVER . . $5.25 



REPAIR MANUALS 
SAMS Service Manuals for the 
folbwing units contain schematics, 
parts lislngs, labelled photographs 
showing the location of 
checkpoints and morel A special 
section gives oscilloscope and 
logic probe readings allowing you 
to narrow the malfunction down to 
a specific chip or transistor I 
800. 800XL, 130XE, 400, 1025 

and 1050 $19.50 each 

520ST Service Manual. $37.50 

MISC. HARDWARE 

1050 Track Sensor . . . $6.50 
1050 Stepper Motor . . . $14.50 

1030 Power Pack $9.50 

Fastchip for 800/400 . . $15.50 

Atari Joystick $7.00 

850 or PR Modem Cable $14.50 
850 or PR Printer Cable $12.50 

P:R: Connection $59.95 

Printer Interface $39.95 

I/O 13 Pin PC mount . . . $4.50 

I/O 13 Pin Plug Kit $4.50 

ST 6' Drive Cable ... . $14.00 
820 Printer Mechanics. .. $9.50 
Joystick Extension Cable. $5.00 

E PROM Eraser $34.95 

810 Door Latch Assy. . . $15.00 

Serial I/O Cable $5.95 

1027 Transformer CALL 

ICD Multi I/O CALL 

810 Tandon Drive Mech. $49.95 



GORF SPACE GAME 

Well done cart. vers, of famous 
arcarde gerne. 800/400 only. $4.00 

COMPUTER BOOKS 

Inside Atari Basic $5.00 

Atari Basic Ref. manual. $5.00 
Assembly L»iguage Guide $19.95 
XE Users Hanctxjok ... . $17.95 
XL Users Handbook ... . $17.95 
Advanced Programming $19.50 

ATARI 850 INTERFACE 

Bare PC Board with parts list and 
crystal allows you to build your 
own serial/parallel interface for 
attEching modems and printers to 
all 8 bit Atari computers. . . $7.50 
Bae Bowd & all plug in IC's $3950 

ATARI XM301 MODEM 

Direct connect 300 Baud modem 
works with all 8 bit Atari's. No 
seperale interface required. $44.95 

P:R: CONNECTION 

Serial & Parallel interface allows 
you to attach standard modems 
and printers. For all 8 bit. (1200XL 
requires modification). . . $59.95 

BASIC CARTRIDGE 

Basic Rev. "A" Cart, works with 
all Atari Computers except ST. 
800XL Owners Notel Use this 
cartridge while programming to 
eliminate the severe errors in the 
built in "B" Basic $10.00 



ADDITIONAL SOFTWARE 
Pec- Man cartridge .... $4.00 
Deluxe Invaders Cart . $4.00 
Journey to the Ranets . $4.00 
Edt/Asm cart, w/o man.$10.00 

Q'bert cartridge $10.00 

Donkey Kong cart. .. . $5.00 
Eastern Front Cart. $5.00 

Springer Cart $5.00 

Hard Hal Ma=k disk . . $5.00 
D-BugchilAraredisk. $5.00 
Home filing manager . . $7.50 
Musicad Pilot Ed. Disk $5.00 
Big Math Attack Dsk . . . $5.00 

Pathfinder disk $5.00 

O.S.S. Action Cart. . . $57.50 
O.S.S. Mac-65 Cart. . $57.50 
O.S.S. Basic XE Ca-t. $57.50 
O.S.S. Basic XL Cart. $47.50 

SERVICE RATES 

Flat Servkse Rates laelow 
include Pails & Labxx, 60 
Day Warranty. 
800 Computer .... $39.50 

850 Interlace $39.50 

810 Disk Drive .... $69 50 
1050 Disk Drive . . . $75.00 
800 Keyboard only. $25,00 
Include $7.00 return 
shipping and insurance. 
Include $4.00 shipping for 
800 keyboard repair only. 



tVr-j.' ■ I 



CALL TOLL FREE 
1-800-551-9995 

IN CALIF. OR OUTSIDE U.S. 
CALL 415-352-3787 



AMERICAN TECHNA-VISION 

(Formerly American T.V.) 
Mail Order: 15338 Inverness St., San Leandro, Ca. 94579 
Repair Center: 2098 Pike Ave., San Leandro, Ca. 94577 
Terms: NO MINIMUM ORDER. We accept money orders, personal checks or 
C.O.D.s. VISA, Master/Card okay. Credit cards restricted to orders over $20.00. 
No personal checks on C.O.D. - Shipping: $4.00 shipping and handling on orders 
under $150.00. Add $2.25 for C.O.D. orders. In Canada total $6.00 for shipping and 
handling. Foreign shipping extra. Calif, residents include 7% sales tax. All items 
guaranteed 30 days from date of delivery. No refunds or exchanges. 

Pricw iubj«ct 10 ch»>ae w»xxjl noloe StrxJ 3ASEfa*»«pfic«tarAIBril*»r«g 1r«d«n«k d Al«i Ctjp 



Circle #101 on reader service card. 



ANALOG 

COMPUTING 

STAFF 

Publisher 

LEE H. PAPPAS 

Executive Editor 

CLAYTON WALNUM 

Art Director 

KATHY WIESNER 

Managing Editor 

DEAN BRIERLY 

East Coast Editor 

ARTHUR LEYENBERGER 

Midwest Editor 

MATTHEW J. W. RATCLIFF 

West Coast Editor 

CHARLES F. JOHNSON 

Contributing Editors 

LEE S. BRILLIANT, M.D.; MICHAEL 

BANKS; ANDY EDDY; STEVE PANAK 

KARL E. WIEGERS 

Entertainment Editors 

ARNIE KATZ; BILL KUNKEL; 

JOYCE WORLEY 

Copy Chief 

KATRINA VEIT 

Copy Editors 

ANNE DENBOK 
SARA BELLUM 

TYPOGRAPHERS 

KLARISSA CURTIS; JUDY 

VILLANUEVA; DAVID BUCHANAN 

Contributers 

CHARLES BACHAND; EARL 

DAVIDSON; ANGELO GIAMBRA; 

ERIC HUFFMAN; GREG KNAUSS; 

JOHN W. LITTLE; REGINA; 

CHUCK ROSCO; THOMAS TANIBA 

Production Director 

DONNA HAHNER 

Production Assistant 

STEVE HOPKINS 

National Advertising Director 

JE PUBLISHERS REPRESENTATIVE 

(213) 467-2266 

(For regional numbers, see map) 

Advertising Production Director 

JANICE ROSENBLUM 

Subscriptions Director 

IRENE GRADSTEIN 
Vice-President-Sales 

JAMES GUSTAFSON 

U.S. newsstand distribution by 
Eastern News Distributors, Inc., 
1130 Cleveland Rd., Sandusky OH 44870 

ANALOG Computing magazine 
(A.N.A.L.O.G. 400/800 Magazine Corp.) 
is in no way affiliated with Atari. 
Atari is a trademark of Atari Corp. 



WHERE TO WRITE 

Editor, ANALOG Computing, 9171 Wilshire Blvd., Suite 300, Beverly Hills, CA 90210 

Correspondence regarding subscriptions, including problems and changes of address, should 
be sent to: ANALOG Computing, P.O. Box 16927, North Hollywood, CA 91615, or call 
1-818-760-8983. 

Correspondence concerning a regular column should be sent to our editorial address, with the 
name of the column included in the address. 

We cannot reply to all letters in these pages, so if you would like an answer, please enclose 
a self-addressed, stamped envelope. 

An incorrectly addressed letter can be delayed as long as two weeks before reaching the proper 
destination. 



ADVERTISING SALES 




advertising iimleriuls to:' 

Janiiir Rosciiblum — Ailvcrlisiti^Produclion 

ANALOG Compuling 

9171 Wilshin; Blvd.. Suile 300. Beverly Hilts. CA 90210. 



PERMISSIONS 

No portion of this magazine may be 
reproduced in any form without written 
permission from the publisher. Many pro- 
grams are copyrighted and not public 
domain. 

Due, however, to many requests from 
Ataii club libraries and bulletin-boai-d sys- 
tems, our new policy allows club libraries 
or individually run BBSs to make certain 
programs from ANALOG Computing 
available during the montli printed on that 
issue's cover. For example, softwaie from 
the July issue can be made available July 1 , 

This does not apply to programs which 
specifically state that they are not public 
domain and, thus, are not for public 
distribution. 

In addition, any programs used must 
state that they are taken from ANALOG 
Computing magazine. For further infor- 
mation, contact ANALOG Computuig at 
(213) 8.58-7100 Ext. 163. 



SUBSCRIPTIONS 

ANALOG Computing, P.O. Box 
16927, North Hollywood, CA 91615, 
(818) 760-8983. Payable in U.S. funds 
only. U.S.: $28-one year, $54-two years, 
$76-three years. Foreign: Add $7 per 
year. For disk subscriptions, see the cards 
at the back of this issue. 



AUTHORS 

When submitting articles and programs, 
both program listings and text should be 
provided in printed and magnetic form, 
if possible. Typed or printed text copy is 
mandatory, and should be in upper- and 
lowercase, with double spacing. If a sub- 
mission is to be returned, please send a 
self-addressed, stamped envelope. 

In addition, any programs used must 
state tliat they are taken from ANALOG 
Computing, For further information, write 
to ANALOG Compuling. P,0, Box 
1413-MO. Manchester, CT 06040-1413 



Reader coimnent 



Plaudits. . . 

Thank you for including my program, 
Creative Process, among your "Four Star 
Software Picks." I felt proud that I have 
somehow contributed to the Atari com- 
munity. The honor meant even more 
when I realized that Ian Chadwick had 
picked Creative Process. His book. Map- 
ping the Atari, is the best reference for 
Atari computers that I've used, and Mr. 
Chadwick is one of the people I respect 
most in the Atari world. With your selec- 
tions of CP and RAMbrandt, both from 
the Antic Catalog, you have risen above 
the rivalry expected of competing pub- 
lishers. 

Cheers for bringing back memories of 
some good software, and for making the 
future seem a bit brighter for Atari's 8-bit 
line. A computer with the quality software 
you highlighted will not become obsolete 
simply because newer systems are 
available! 

Sincerely, 

Dave Thorson 

Phoenix, AZ 

An avid reader for 48 issues 

. . .and more plaudits 

I want to thank you and your staff, as 
well as Alan Click and John Faber of A- 
BUG (the Atari Boston Users' Group of the 
Boston Computer Society) and all the 
others who helped make the Northeast 
Atari Fair at the Worcester, MA Centrum 
such a success. 

I spent several hours there on Saturday, 
and was greatly impressed by the crowds 
[which I presume were evident on Sun- 
day as well), by the corporate presence. 



and by the enthusiasm shown by Fair 
staff, visitors and boothholders alike. The 
displays and demonstrations of both hard- 
ware and software were exciting and well 
presented, and I was pleased to note that 
8-bit Ataris still have a place in the 
scheme of things. 

The show made me proud to be an 
Atarian, and confirmed my belief that 
those who look down on Atari don't know 
what they are missing, and are uncon- 
sciously manifesting "sour grapes." 

Atari-ally yours. 

Miss Dorothy Nash 

Dover, NH 

A difference of opinion 

This letter is in response to an article 
in issue 58 of ANALOG Computing, en- 
titled "Artificial Intelligence." I think the 
author. Dr. Ron Schaefer, has the wrong 
idea of what artificial intelligence really 
is. 

I think the title for his article should 
have been something along the lines of 
"Deductive Reasoning" or "Question and 
Answer." His program follows a series of 
questions that have a yes or no answer un- 
til the questions come to an end and a re- 
sult can be given to the user. The user has 
to make and answer his own questions. 
This program, in my opinion, does not 
display artificial intelligence. 

Artificial intelligence can be described 
in terms of human intelligence. Artificial 
intelligence is something done by a com- 
puter that would be considered intelligent 
if a hmnan did it. For example, if it's cold 
in your house, you turn up the thermostat. 
It would be considered artificially intelli- 



gent for a computer to decide that it's cold, 
discover a solution, and carry out that 
procedure without being told specifically 
how or when to do it. 

A truly intelligent program — one that 
would work similarly to Dr. Schaefer's 
program — should be able to form ques- 
tions on its own, based on information 
that it needs and information that it al- 
ready has. Then it should decide what it 
needs do with the results, and how to 
continue after that. 

One example of artificial intelligence is 
a spelling checker. A normal spelling 
checker takes each word and compares it 
with its dictionary. While this method 
catches most errors, it doesn't work well 
if you have a word that's spelled right, but 
in the wrong context. (Example: "Go two 
the store.") An intelligent computer would 
see that this doesn't make sense and re- 
port an error. A "stupid" computer, on the 
other hand, would only see the word as 
being spelled correctly. 

I do not want your readers to get the im- 
pression that Dr. Schaefer's program is an 
example of artificial intelligence. It's very 
hard — if not impossible — to write a pro- 
gram that exhibits intelligence on a com- 
puter like the Atari 520ST, in a language 
such as BASIC, or even higher level lan- 
guages like C or Pascal. I think his pro- 
gram has some application (such as 
identification of certain objects, using 
descriptions as questions], but the title is 
an exaggeration of its capabilities. 

Sincerely, 

David Martin 

Columbia Station, OH 



ANALOG COMPUTING 



MAY 1988 / PAGE 7 



SOUTHERN SOFTWARE 

205-956-0986 

24 HOUR PHONE 

CALL OR WRITE FOR FREE CATALOG 

ALL 8 BIT AND ST SOFTWARE IN STOCK 

CALL FOR PRICES AND LATEST TITLES 

SOFTWARE IN STOCK FOR OTHER COMPUTERS 

PRICES LISTED FOR MAIL ORDER ONLY - ADO 10% ON PHONE ORDERS 



ST COHPUTERS 


CALL 


CHlPtWNK 


29.95 


80 COL CARD 


79.95 


1050 DISK DRIVE 


239.95 


ATARI KRITER PLUS 


39.95 


COMPULSIVE COPIER 


29.95 


1050 VIHAPPI INST 399.95 


BASIC CARmiDOE 


19.95 


COPY II ST 


29.95 


130 «E 


139.95 


BASIC IE 


49.95 


IM-301 MODEM 


49.95 


«f551 DISK DRIVE 


189.95 


BASIC XL 


39.95 


SI-212 MODEM 


89.95 


520 DISK DRIVES 


CALL 


SUPER ABCHIVER 


59.95 


Srt4804 PRINTER 


169.95 


850 IKTERfACE 


109.95 


BIT WRITER 


69.95 


1027 PRINTER 


124.95 


SK OHNIHOM 


59.95 


DOS 2.5 U/NANUAL 


9.95 


IDH121 LQ PRINTER 199.95 


ACCESSORIES 


CALL 


XL/XE POWER SUPPLY 27.95 


ATARI LAB ST KIT 


49.95 


APE FACE 


49.95 


1027 INK ROLLER 


4.97 


JOY STICK 


6.95 


AVATEI 1?00 


79.95 


HAPPY ARCHIVER 


34.95 


LOGIKHRON CLOa 


39.95 


AVAIEJ ?400 


179.95 


1/0 CO."!! 


13.95 


NARK WILLIAMS C 


124.95 


CHIP/ARCHIVER 810 


69.95 


I/O CORD 10 FT 


19.95 


MEGAMAI C 


139.95 


PRO BURNER 


179.95 


MAC/65 


64.95 


MOOULA-2 


69.97 


EZ RAH 520 


169.95 


MAC/65 TOOL KIT 


27.95 


P.R. CONNECTION 


59.95 


HAPPY 1050 ENHANC 


119.95 


ACTION 


64.95 


WARP SPEED DOS IL 


24.95 


HAPPY 810 ENHANCE 


104.95 


ACTION TOOL KIT 


27.95 


PC BOARD DESIGNER 


169.95 


HAPPY CONTROIER 


39.95 


BASIC XL TOOL KIT 


27.95 


PROLOG 


69.95 


HARD DISK DRIVES 


CALL 


BASIC IE TOa KIT 


27.95 


PUBLISH PARTNER 


119.95 


ICD HIO 1 HEG 


299.95 


PERSONAL PASCAL 


74.95 


SOUND DIGITIZER 


119. 9li 




199.95 


SPARTADOS TOOL KIT 24.95 




X£ ADAPTER FOR WO 19.95 


ST HOST ADAPTER 


99.95 


FOR ALL PRINTERS 


CALL 


POWER SUPPLIES 


CALL 
CALL 


SPARTS DOS CART 
OHNIVIEW XL/IE 


69.95 
36.95 






PRINTERS 


• ATARI REPAIR PRICES . 


PRINTER CONNECT. 


39.95 


NEWELL 256K 


34.95 


ITEMS NOT LISTED 




R-TIME CARTRIDGE 


49.95 


OMNINON 400/800 


44.95 


1050 DISK DRIVE 




RAMBO XL UPGRADE 


29.95 


ST COPY 


29.95 


130 IE 




256K CHIP SET 


49.95 


NUMERIC KEYPAD 


39.95 


65 IE 


49.95 


RAMROD XL 


39.95 


TOP DOS 1.5 PLUS 


29.95 


520 DISK DRIVE 


89.95 




69.95 


PRINT/MODEM CABLE 


13.95 


520 ST 


139.95 


U.S. DOUBLER 


29.95 


RAMCHARGER 


139.95 


650 IHTERFACE 


49.95 


UPRINT INTERFACE 


59.95 


RAMCARO FOR 800 


129.95 


ATARI PRINTER 


69.95 


XL/XE BOS 


49.95 


SMART LIW MODEM 


189.95 


IL/IE/150 POW SUP 


12.95 



PRICES SUBJECT TO CHANGE WITHOUT NOTICE 

ADO $5 FOR SHIPPINQ AND INSURANCE MOST ORDERS SHIPPED SAME 

DAY . FOREIGN ORDERS WELCOME WITH SUFFICIENT POSTAGE 

INCLUDED. ALABAMA RESIDENTS ADO 7% SALES TAX . ADD 6% FOR 

VISA. ADO $5 FOR AIRMAL ADO $15 FOR OVERNIGHT SHIPMENT 

ALLOW THREE WEEKS FOR PERSONAL CHECKS 

SOUTHERN SOFTWARE 

1879 RUFFNER ROAD BIRMINGHAM, AL 35210 



Circle #102 on reader service card. 




Gear up Your Disk Drive For Big Savings! 
Save $14 Off Thie Cover Price. 

SUBSCRIBE TO 



rCOMPUTING] 



□ 1 Year $28 Save $14 

MCEYY 

D 1 Year with Disk $105 

DCEYY 

Name 

Address 

city State Zip 

Make ctiecks payable to: L.F.P. Inc. Allow 4-6 

weeks for delivery. 



n Payment Enclosed D Bill Me 

D Chiarge My D Visa D MC 

** . Exp 

Signature 

FOREIGN-Add $7 per year 

MONEY BACK if not deligfited 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



n Reader comment continued 



Nobody's perfect 

And speaking of "Artificial Intelligence" 
. . . Looks like ive goofed. We inadvertent- 
ly omitted the last portion of Listing 1 
from that program. Our apologies to the 
author and our readers. The following 
lines should be added to the end of List- 
ing 1 (page 74]: 

2880 linef 489,158,158,158 

:linef 158,158,158,98 

2898 linef 155,87,412,87:1 

inef 412,87,412,153 

2188 linef 412,153,155,153 

: linef 155,153,155,87 

2118 gotoxy 28, ie!?"Enter 

the new answer" 

2128 case(rule,2]=flen:fle 

n=f len*l 

2148 case(flen,l)=e:case(f 

len,2)=-l 

2218 a=flen:b=2:gosub INLI 

NES 

2228 clearw 2:return 

NFL update 

In issue 57 of ANALOG was an excel- 
lent program called "NFL Game Analyz- 
er." I read in the Listing and ran the 
program about two hours after the maga- 
zine showed up in my mailbox. 

When viewing option 4 (the only non- 
entry option that works in preseason), I 
noticed a slight discrepancy in the ratings 
shown from those listed on page 8. (Not 
that I needed the printed Usting to tell that 
the St. Louis Cardinals shouldn't be list- 
ed at number 1.) After about an hour of 
gazing blankly at the code (it was 2:30 
a.m.), I realized that the problem lies in 
the data in Listing 2. It seems that the 
rates for the Detroit Lions are left com- 
pletely out of the Usting, and three strange 
rates are tacked on to the end of the code. 
In order to rectify the problem. Lines 80 
and 140 of Listing 2 should be changed 
to the following: 

80 DATA 100.0,188.8,188.4, 

103.7,111.1,187.4,181.1,98 

.3,99.7,98.1,93.1,95.6,96. 

7,87.1,91.6,185.2,98.8,182 

.3 

140 DATA 102.5,95.4,99.2,1 

07.0,97.5,102.2 

After the lines are changed, Listing 2 
must be run again to put the correct rates 
on file. This will, however, destroy the 
previous rates. If you have already entered 
the scores for the preseason, you must 
erase SCORES.DAT from the disk and 
reenter them for the program to be com- 
pletely accurate. Don't panic if you don't 
have the scores, though. The only thing 
that can happen is that the predictions for 



the first part of the season might be a lit- 
tle bit off. 

Despite this rather annoying glitch, this 
program is well done and will surely get 
a whole load of use. My hat's off to Mr. 
Genson for creating a program that every 
football fan can appreciate. 

Sincerely, 

Keven Mizera 

Johnson City, NY 

Stay tuned for 
the exciting conclusion 

I've been a reader of ANALOG for a few 
years and have always enjoyed the maga- 
zine. Many programs, "Multicopy" in par- 
ticular, have made my relationship with 
my 130XE a happy one. 

The length of a program has never been 
of great concern to me. I may be a bit de- 
mented, but the longer it takes to type in 
a program, the more enjoyment I derive 
from seeing the finished product. It was 
then with great chagrin that I found the 
listings for "Troll War 11" (issue 57) came 
in two parts. I've always hated install- 
ments, series or anything of the sort. I 
would have preferred to see all of the data 
printed in one issue. Then I could make 
the choice as to how long I wanted to 
spend typing it in. Now I have to wait for 
part II. 

In the past, ANALOG has published 
other lengthy programs, such as "Treas- 
ures of Barboz" (480 lines). The length of 
a program does not daunt Atari addicts 
like myself. 

You did want readers' opinions, so you 
have mine. 

Thank you for a great magazine. 
Donald Zelaya 

Thank you for your comments. Unfor- 
tunately, there's more involved in print- 
ing a long listing like "Troll War 11" than 
whether or not a person would want to 
type it in one sitting. Believe it or not, put- 
ting together a magazine like ANALOG 
Computing is a delicate operation, and in 
order to keep the magazine's balance, we 
only have a certain number of pages we 
can allot to any particular program. When 
one article or program takes up more 
room than it should, something else gets 
bumped out, making some other reader 
unhappy. We thought splitting a long list- 
ing like "Troll War 11" was a good com- 
promise. — Ed- 



MOVING?] 

DON'T MISS 
A SINGLE ISSUE 

Let us know your new 
address right away. Attach 
an old mailing label in 
the space provided below 
and print your new 
address where indicated. 



o 
o 

(0 
OQ 

3 
(0 



$ 



o 
m 

< 



u 

3 
O 

< 
X 



§ 



c 
g 

'c/5 

c 



o 



0) 
g 



g 

O 

o 
n 

CO 

o 

X 

o 
n 

B 



5 

o 

Q 
CO 

CD -rj 
^ Q) 

<^^ 
_ d E 



Q- o S 

CL CO ^ 

CO O 

0) CO 



^ (D en 

" g- ^ 
CD 2 -c 

CD Q- 1: 
IE 

O CO 

c _^ _ 

CD p .F 
<" 5 ~ 

CO P Q) 

-5^ ^ CD 

Q_ 



CD 



CD 



CO 

'jz 



o 



(D 



o 

CD 



C 3 

O (n 
■.^ c 

■520 

^ -S «* 

c/3 CD 



to "? 
> CO 

Q ^ 

c "o 

O -D 

cr CO 



(D 

E 
m 

D 



CD 
CO 
O 



g 



CO 

LU 



o 

X 



X 

O 
d 

CL 

A 

c 
ts 

3 

a 
E 
o 
u 



CO 




r 


(9 



C_ 


CD 


_l 


f) 




< 


fO 


c 


Z 


CO 

CD 

CO 


F 


< 


CO 


>^ 


n 





CO 


1- 



Q. Q- 



c3 □ □ □ □ 



Q. 

N 



W 



0) 

E 

CO 



T3 
< 

0) 

55 o 









HI 

















w 




en 




X 




f- 




z 




m 




w 




UJ 


111 

EC 
111 

X 


Q 
Q 
< 


-1 
111 

m 


Q 

d 


3 


1- 


I 


cc 


U 




t 


K 


z 








I 













z 




m 












m 




3 




U- 







J 



ANALOG COMPUTING 



MAY 1988 / PAGE 9 



c 



Since 1981 



Lyco Computer 

Marketing & Consultants 



Lyco Means Total Service, 



Monitors 



AATARI 



A ATARI Sr 




Mark "Mac" Bowser, Sales Manager 

I would personally like to thank all of our past customers (or helping to ' 
make Lyco Computer one of the largest mall order companies and a 
leader In the Industry. Also, I would like lo extend my personal invilalion lo 
all computer enlhusiasts who have not experienced the services thai we pro- 
vide. Please caii our trained sales stall al our toil-free number to inquire 
about our diverse product line and weekly specials. 

First and foremost our philosophy Is to keep abreast of the changing 
market so thai we can provide you with not only lactory-fresh merchandise 
but also the newest models ollered by the manulaclurers al Ihe absolute best 
possible prices. We oiler the widest selection of computer hardware, software 
and accessories. 

Feel free to call Lyco if you want to know more about a particular item. I 

can't stress enough that our toll-free number is not just for orders. Many 
companies have a loll-free number lor ordering, but if you just want to ask a 
question about a product, you have to make a toll call. Not at Lyco. Our 
trained sales staff is knowledgeable about all the products we stock and is 
happy lo answer any questions you may have. We wiii do our best lo make 
sure that Ihe product you select will fit your applicalion. We also have Satur- 
day hours — one more reason lo call us lor all your computer needs. 

Once you've placed your order with Lyco, we don't forget about you. 

Our friendly, professional customer service representatives will lind answers 
lo your questions about the status of an order, warranties, product availabili- 
ty, or prices. 

Lyco Computtr ilocks a mulllmilion dollar Inventory of factory-fresh 
(narchandlBi. Chances are wo have exactly what you wanl righl in our ware- 
house. And that means you'll got It last, in fad, orders are normally shipped 
wllhin 24 hours. Free shipping on prepaid orders over $50, and there Is no 
deposit required on C.O.D. orders. Air Irolghl or UPS Blue/fled Label shipping 
i< available, loo. And all products carry the lull manufacturers' warranllss. 

I can't see why anyone would shop anywhere else. Selection from our huge 
in-stock inventory, besl price, service that can't be beat— we've got II all here 
at Lyco Computer. 

TO ORDER, CALL TOLL-FREE: 1-800-233-8760 
New PA Wats: 1-800-233-8760 

Outside Continental US Call: 1-717-494-1030 

Hours: 9AM to 8PM, Mon. - Thurs. 
9AM to 6PM, Friday — 10AM to 6PM, Saturday 

BFor Customer Service, call 1-717-494-1670, 
9AM to 5PM, Mon. - Fri. 
Or write: Lyco Computer, Inc. 
P.O. Box 5088, Jersey Shore, PA 17740 

Risk-Free Policy; • fuil manufacturers' warranties • no sates lax outside F 

• prices show 4% cash discount; add 4% lor credit cards • APO, PPG 
international: add $5 plus 3% lor priority • 4-week clearance on persoriai c 

• we check tor credit card Ihelt • compalabilily not guaranteed • return 
authorization required • price/availabilily subject to change • Prepaid 
orders under $50 in con.. U.S. add $3.00. 



Thornton: 

230 Amber TTtJ12" $79.95 

4120 CGA $225.95 

4160 CGA $259.95 

4460 EGA $319.95 

4375 UltraScan $389.95 

GB too EGA Card $129.95 

GB 200 Super Card $219.95 

'Quantnim Llmttad 

THC3MSONO 

4120 Monitor 

• 14" RGBI/videc 
composite/analog 

• Compatibie with \BU 
and Commodore 

• RGB data cable lt^ O O C 9 5 
included q)^^0 

Blue Chip: 

BCM 12" Green TTL $64.95 

BCM 12" Amber TTL $eg 95 

NEC: 

Multisync II $599 

Save $210 over N EC Multisync 

with Thomson4375 UltraScan 

$389.95 



Modems 



Avatex: 

1200e $69.95 

1200i PC Card $69.95 

1200hc Modem $89.95 

2400 $179.95 

2400i PC Card $169.95 

hiayes: 

Smartmodem 300 $149.95 

Smartmodem 1200 $285.95 

Smartmodem 2400 $425.95 

Smarteam 

1200 Baud Modem 




Hayes CompaUU* 



1-800-233-8760 



Access: 

Triple Pack $11.95 

Leader Board Pack $14.95 

Actlvlslon: 

Hitch Hikers $13.95 

Music Studio $19.95 

Brodarbund: 

Print Shop $25.49 

Print Shop Compan $22.95 

Graphic Lib. I, II, III $13.49 

Bank SL Writer $27.95 

Electronic Arts: 

Pinball Con Set $8.95 

Lords of Conquest $8.95 

Starileet I $32.95 

Chess Master 2000 $25.95 

Music Con Set $8.95 

Super Boulderdash $8.95 

One on One $8.95 

Firebird: 

The Pawn $22.95 

Microleague: 

Microleag. Baseball $22.95 

General Manager $16.95 

Stat Disk $13.95 

MicroDrose: 

Conflict in Vietnam . 
F-15 Strike Eagle ... 
Kennedy Approach . 

Silent Service 

Top Gunner 



Strategic Simulations: 

Battle of Antetiem 

Battlecruiser 

Nam 

Phantasie 

Wargame Construe 

Warship 

Wizards Crown 

Subiogic: 

Flight Simulator II 

Night Mission Pinbali . 
Scenery #1-#6 ea. .. 
Scenery #7 



. $22.95 
. $19.95 
. $13.95 
. $19.95 
. $13.95 

$28.95 
$33.95 
$22.95 
$22.95 
$16.95 
$33.95 
$22.95 

$31.49 
$18.95 
$12.95 
$14.95 



MIcroleague: 

Microleague Baseball . 

General Manager 

Wrestling 

Microprose: 

Silent Service 

F-15 Strike Eagle 

Gunship 

Strategic Simulations 

Phantasie 

Phantasie II 

Road War 2000 

Colonial Conquest 

Subloaic: 

Flight Simulator li 

Scenery Disk 

TImeworks: 

Wordwriter ST 

Partner ST 

Data Manager ST 

Unison World: 

Art Gallery 1 or 2 

Print Master 

Fonts & Borders 

Music Studio 

Bureaucracy 

Electronic Arts: 

Arctic Fox 

Empire 

Starfleet I 

Chess Master 2000 

Gridiron 

Epyx: 

Sub Battle Simulator . 

World Games 

Wrestling 

Winter Games 



Firebird: 

Pawn 

Starglider 

Golden Path 

Guild of Thieves . 
Tracker 



$33.95 
$16.95 
$25.95 

$22.95 
$24.95 
$28.95 

... $22.95 
.. $22.95 
.. $22.95 
.. $22.95 

.. $31.49 
.. $14.95 

.. $44.95 
.. $39.95 
.. $44.95 

.. $14.95 
.. $19.95 
.. $17.95 
.. $27.95 
.. $22.95 

.. $25.95 
.. $32.95 
,. $32.95 
,. $25.95 
. $32.95 

. $22.95 
. $22.95 
. $22.95 
. $11:95 

. $25.95 
. $25.95 
. $25.95 
. $25.95 
. $25.95 



AATARI ^M Joysticks 



Access: 

Leader Board $22.95 

Tournament #1 $11.95 

10th Frame $22.95 

Actlvlslon; 

Champion. Baseball .... $22.95 

Champion. Basketball . $22.95 

Championship Golf $New 

GFL Football .... 



Tac 3 $9.95 

Tac2 $10.95 

Tac 5 $12.95 

Tac 1 + IBM/AP $26.95 

Economy S6.W 

Silk Stick $6.95 

Black Max $10.95 

Boss $11.99 



$22.95 3-Way $19 



A 




.IL 




icroa ic 1 ■ I «i 

• 144 cps Draft 

• 36 cps NLQ 

• EZ Operation Front 
Panel Control 

95 

$174? 



NL-lOw/oCart $174.95 

NX-1000 $165.95 

NX-1000C $179.95 

NX-1000 Color $225.95 

NX-1000C Color $229.95 

NX-15 3309.95 

ND-10 $265.95 

ND-15 $379.95 

NR-10 $339.95 

NR-15 $425.95 

NB-15 24 Pin $699.95 

NB24-10 24 Pin $425.95 

NB24-15 24 Pin $579.95 

BROTHER 

M1109 $195 

M1409 $299 

M1509 $335 

M1709 $475 

Twinwriter 6 Dot & Daisy $899 

M1724L $599 

HR20 $339 

HR40 $569 

HR60 $709.95 



AATARI" 

520 ST Computer 



Built-in 

Drive 

Thomson 

4120 

Monitor 



NX-1000 SP^^"'^' 

• 1 00 nns draft 



Panasonic 



$769 



95 



1 GO cps draft 
20 cps NLQ 



240CPS/12 Character 

Mode 

Push Feed Tractor 

NLQ Mode 48 CPS 



1092i 




$319 




PRINTERS 



SEIKOSHA 

SP 180Ai $129.96 

SP 180VC $129.95 

SP 1000VC $139.95 

SP 1000AP $169.95 

SP 1200VC $155.95 

SP 1200Ai $165.95 

SP 1200AS RS232 $165.95 

SL BOAi $299.95 

MP1300Ai $269.95 

MP5300Ai $399.95 

MP5420Ai $879.95 

SP Series Ribbon $7.95 

SK3000 Ai $339.95 

SK3005 Ai $419.95 

SPB 10 SCALL 

SL 130Ai $599.95 



Toshiba 

321SL $489 

341 SL $659 

P351 Model II $899 

351 SX400 cps $1019 



EPSON* 

LX800 $1 79.95 

FX86E $279.95 

FX286E $424.95 

EX800 $399.95 

EX1000 $469.95 

LQ500 $309.95 

LQ1000 w/tractor $549.95 

LQ2500 SSI 9.95 

GQ3500 $LOW 

LQ850 $489.95 

LQ1050 $659.95 

♦citizen 

120 D $169.95 

180 D $189.95 

MSP-10 $259.95 

MSP-40 $309,95 

MSP-15 $349.95 

MSP-50 $399.95 

MSP-45 $459.95 

MSP-55 $539.95 

Premiere 35 $499.95 

Tribute 224 $649.95 



Panasonic 

10801 Model II $179.95 

1091 i Model II $199.95 

10921 $319.95 

1592 $409.95 

1595 $459.95 

3131 $299.95 

3151 $479.95 

KXP 4450 Laser $CALL 

1524 24 Pin $559.95 

Fax Partner $589.95 

OKIQAJA 

OI<imate 20 $119 

Okimate 20 w/cart $179.95 

120 $189.95 

180 $219.95 

182+ $225.96 

183 $249.95 

192+ $309.95 

193+ $449.95 

292 w/interface $449.95 

293 w/interlace $585.95 

294 w/lnterface $819.95 

393 $955.95 




AATARI AATARI 



AATARI 

1040 ST 
Color System 



$975 



95 




HARDWARE 

520 ST FM Mono $675.95 

520 ST FM Color $819.95 

1040 ST Mono $789.96 

1040 ST Color $975.95 

130XE Computer $135.95 

SX551 Drive SCALL 

SF 314 Disk Drive $219.95 

Indus GT Atari Drive $175.95 

SHD 204 20 MEG Drive $679.95 

XM301 Modem $42.95 

SX212 Modem $89.95 

GTS 100 (3.5" DSDD ST) $195.95 



Attention Educational 
Institutions: 

If you are not currently 

using our educational 

service program, please 

call our representatives 

for details. 



520 ST-FM 

Monochrome 

System 




Internal 
drive 

included 



AATARI 

1040 

Monochrome 

System 




Circle #104 on reader service card. 



Unlock your 




COMPLETE POCKET 
PROGRAMMING AID 

ONLY $7.95 ea. 



ERROR CODES 
INTERNAL CODES 
PEEK & POKE LOCATIONS 
MACHINE LANGUAGE AIDS 
GRAPHIC MODE SPECIFICATIONS 
BASIC COMMANDS WITH ABBREVIATIONS 

ANALOG COMPUTING 



It rt1 MAGAZ NE FOR ATARI COMPUTER OWMFRK 



[COMPUTING] 

P^O^ Box 16927 
N. Hollywood, CA 91615 



YES! 



Name 



Address 
City 



State 



Zip 



Please send me 



ANALOG 



Computing Pocket Reference Cards 

I am enclosing $7.95 per copy. 

D CASH D CHECK D CHARGE 



Card # 



Exp. date 
Signature 



REGULAR FEATURE 




8-bit ne^vs! 



THE KEY TO WRITE PROTECTION 

DisKey from CroResearch provides a quick 
and handy alternative to adhesive-backed 
write protect tabs. Designed to fit most 
5V4-inch disk drives, DisKey not only write 
protects your data when inserted into the left 
side of the disk drive opening, but it also pro- 
vides a highly visible indicator as well— and 
only one DisKey is needed for each computer 
system. 

With a suggested retail price of $1.69, the DisKey protection system is available from 
CroResearch, 100 Meadow Court, RO. Box 129, Lyons, CO 80540 — (303) 823-5088. 

CIRCLE #130 ON READER SERVICE CARD 




DROPPING IN ON MICRODAFT 

People looking for a Defender-hke game to 
help get rid of frustrations after a long day 
at the office should check into Dropzone from 
Microdaft. Player controls include smart 
bombs and a cloaking device to make you in- 
visible to the enemy craft (if only for a short 
time). 




With its outstanding graphics and an 
arcade-style title screen that has high score 
readout, aJl that seems to be missing from this 
game— which retails for $24.95— is a coin 
slot. 

For more information about Dropzone, con- 
tact Microdaft, 19 Harbor Drive, Lake Hopat- 
cong, NJ 07849 — (201) 663-0202. 

CIRCLE #131 ON READER SERVICE CARD 



RE-MEMORY'ING THE GOOD OLD 800 

Those of us who are still in love with our 
Atari 800 computers, but haven't seen any- 
thing in the way of memory upgrades in some 
years, will want to look into Magna Systems. 
This company produces three different ver- 
sions of their Ramcharger memory boards 
that up your computer's RAM capacity by 
256K ($149.95), 512K ($199.95) and a mind 
boggling IMEG ($299.95). 

Also included is a specially configured ver- 
sion of MYDOS (version 4.3a) that supports 
the memory board as a giant RAMdisk, 
simulating a floppy with 2,000, 4,000 or 8,000 
free single-density sectors. 

Magna Systems is located at 147-05 San- 
ford Ave., Suite 4E, Flushing, NY 11355 — 
(718) 939-0908. 

CIRCLE #132 ON HEADER SERVICE CARD 



FALLING IN WITH FLIGHT SIMULATOR 

subLOGIC has just released Scenery Disk 

n for its Flight Simulator program, featuring 
highly detailed views of Detroit, Pittsburgh 
and Niagara Falls. You can actually fly below 
the rim of the Niagara River canyon right up 
to the Falls! (Oh, Stewardess! Why am I per- 
spiring?) 




Scenery Disk II also introduces a new de- 
fault ground pattern that simulates fields and 
other areas of varying color on the ground be- 
low, thus eliminating the monotony of flying 
between cities. The new ground pattern also 
improves the user's perspective and makes 
the scenery much more interesting to look at. 

Scenery Disk II hsts for $24.95 and is avail- 
able from subLOGIC Corp. , 713 Edgebrook 
Drive, Champaign, IL 61820 — (217) 359- 
8482. 

CIRCLE #133 ON READER SERVICE CARD 



ACCESS DATA ON IBM PC DISKS WITH YOUR 8-BIT 



Atari 1050 disk drive owners who have in- 
stalled an enhancement board from HAPPY 
Computers can now share data with an IBM 
PC (or compatible) by using version 71 of 
I-iAPPY's Warp Speed Software. The HAPPY- 
equipped 1050 is automatically reprogram- 
med to handle the different sector sizes and 
file structures of the PC disk. A built-in text 
feature allows automatic bi- 



conversion 



directional translation between ASCII used 
on the PC and ATASCII used on the Atari. 
Version 71 can be acquired for $10 by previ- 
ous owners of the enhancement hardware, 
whereas first-time users can buy the hardware 
and software for $99.95 from HAPPY Com- 
puters, Inc., P.O. Box 1268, Morgan Hill, CA 
95037 — (408) 779-3830. 

CIRCLE #134 ON READER SERVICE CARD 



ANALOG COMPUTING 



MAY 1988 / PAGE 13 




'Your wife is back in the hotel room playing with your new computer... ' 



48K Disk 



UTILITY 



Q 



Quick Screen 



A fast and hassle-free technique 
to produce instant screen displays 



by Earl Davidson 



Can Atari BASIC produce instant screen displays with- 
out complicated page flipping? Yes! Quick Screen provides 
the setup and an easy-to-use routine to include in youi BA- 
SIC programs. Your screens will "pop" onto your monitor 
instantly. 

The Quick Screen Maker program lets you create up to 
ten graphic screens using the full screen editor. You can 
include borders, graphics characters or inverse characters, 
and once the screens are created, you can save them to a 
disk file. Write your BASIC program around the skeleton 
program. Quick Screen — which contains routines to load 
the screen file from disk — and display any screen instant- 
ly with a simple GOSUB USEMENU statement. BASIC can 
now handle your screens almost as fast as machine language 
— with none of the hassle! 

Typing in the programs 
There are three program listings. Listing 1 is a program 
that creates the screen file for Quick Screen Maker. Type 
it in using "Basic Editor 11" and save it to disk as QS- 
MENU.BAS. Run Listing 1. A file named QSMENU.PGE 
will be created on drive 1. This is simply a data file that 
will be used by Quick Screen Maker. 

Listing 2 should be typed in using "Basic Editor II." Save 
it to disk as SQUEEZE. BAS before running it. Run the pro- 
gram and a file named SQUEEZE.DAT will be created on 
drive 1. This file will be used with Listing 3 below. 

Listing 3 will be used to prepare two programs. First type 
in the following lines from Listing 3: 

Line 

Line 120 

Line 150 

Lines 10000 to 10070 

Line 10140 



Now type ENTER "D:SQUEEZE.DAT" and Lines 10080 
through 10120 will be added to your program. At this point, 
list the program to disk as QS.LST. This program, called 
Quick Screen, will be used when writing your ovwi BA- 
SIC programs. 

With Quick Screen still in memory, type in the remain- 
ing lines of Listing 3 to create Quick Screen Maker. List 
the program to disk as QSMAKER.LST. Listing these two 
programs to disk is necessary so that the variable tables will 
not be written to disk with the program. Saving the pro- 
grams at this point will save variables used by "Basic Edi- 
tor II." Now type NEW. Enter QSMAKER.LST and save it 
to disk as QSMAKER.BAS. Now rim the program. 

Using Quicl( Screen lUlalcer 

Quick Screen Maker uses nine screens to present menus, 
allow user input, and to display help information. The 
screens provide most of the instructions necessary to use 
the program. 

Before choosing main menu options through 9, you 
should view the help screen. Press H from the main menu. 
The help screen contains the commands used while in the 
edit mode. Note that all editing commands are SHIFT-CTRL 
fimctions: This means you must press and hold the SHIFT 
and CTRL keys while pressing the appropriate key. You 
should try to study the editing functions available. When 
in the edit mode, the help screen is available by hitting 
SHIFT-CTRL-H. 

The screens used by Quick Screen Maker were original- 
ly designed with graphic-character borders, boxes, and so 
on. In order to shorten Listing 1, these have been removed 
from most screens. You may dress them up yom-self, and 
become familar with the program, by loading (main menu 
option "L") the QSMENU.PGE file and using Quick Screen 
Maker to modify the screens. Do not insert or delete any 
screens while modifying the QSMENU.PGE file. From the 



ANALOG COMPUTING 



MAY 1988 / PAGE 15 



^ Quick Screen 



continued 



main menu, press a number from to 9 to view and edit 
a screen. 

When editing a screen, press SHIFT-CTRL-n (where n 
is a number from 0-9) to draw one of nine borders available 
around it. Press SHIFT-CTRL-T to toggle the cursor on and 
off, and SHIFT-CTRL-R to "record" the screen. (This does 
not save the file to disk.) Press SHIFT-CTRL-Q to return to 
the main menu. Save the file to disk (main menu option 
"S") as QSMENU.PGE. Run Quick Screen Maker again to 
see the results of your creativity. 

Using Quick Screen 

Quick Screen is the short program you created from List- 
ing 3. Whenever you begin a new BASIC program you 
should enter QS.LST then write your program around it. 
Line should not be renumbered — it must be the first line 
in your program. All other lines can be renumbered. (Don't 
forget to change any references to the line numbers you 
change.) Change the value assigned to the variable NUM- 
PAGES in Line 10050 to the number of screens in your file, 
and change the filename in Line 10140 to the filename con- 
taining your screens. You should place a line immediately 
following Line 10140 with the statement GOTO 200 (or 
whatever line your main program will start with). All your 
own program lines should go between Line 150 and Line 
10000. 



Save $14 Off 
The Cover Price 

ANALOG 



□ 1 Year $28.00 Save $14! 

MCEYY 

D 1 Year with Disk $105.00 

DCEYY 

FOREIGN: Add $7 Per Year 
iVloney Bacl< if Not Delighted! 

n Payment Enclosed D Bill Me 
n Charge IVIy D Visa D (VIC 
# Exp. _ 

Signature 
Name 



City 



State 



Zip 



Make Checks Payable to: L.F.P. Inc. Allow 4-6 

weeks for delivery of first Issue. 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



To display a screen you need a statement to identify the 
screen to be used: MENUNO=l will call the second screen 
in the file. (Screen zero is the first.) Then a GOSUB to the 
routine USEMENU will display the screen instantly. You 
may then print to the screen as usual. 

A program explanation 

The following explanation will refer to Listing 3: Quick 
Screen and Quick Screen Maker. 

Line — The screen-handling techniques used by Quick 
Screen utilize a string as screen memory. However, instead 
of relocating screen memory, a string is modified by chang- 
ing values in the variable value table. Although any string 
could be modified, the easiest method is to modify the first 
string in the table. The first string is always the first vari- 
able encoimtered by the system when a program is entered 
from disk or the keyboard and may be a constant, array or 
string. 

Using Line to dimension SCREENS insures that it will 
be the first variable in the variable value table. Note that 
SCREENS is dimensioned to a length of one character and 
assigned a value of " ". Control is then passed to the in- 
itialization routine starting at Line 10000. 

Line 10020 — VVTP is set to the value in locations 134 
and 135, which contain a pointer to the address of the vari- 
able value table. This table contains eight bytes of informa- 
tion about each variable. Byte 1 is the variable type. 
SCREENS has been established as the first variable, and 
VVTP is the address of the first byte in the table. Therefore, 
VVTP is the location of the byte which identifies the type 
of variable SCREENS will be. On page 67 of The Atari BA- 
SIC Source Book (COMPUTE! Publications) the different 
types of variables and their type codes are listed. Type 131 
($83) is defined as "a dimensioned string with an absolute 
address pointer." Poking location VVTP with a value of 131 
changes the variable type of the first variable, which is 
SCREENS. 

Line 10030 — The second byte in the variable value ta- 
ble is the variable number, which we do not change. The 
third and fourth bytes (VVTP + 2 and VVTP + 3) contain 
the address of the start of the string space or data. POKE 
these locations with the address of screen memory, as found 
in locations 88 and 89. 

Line 10040 — The fifth and sixth bytes (VVTP + 4 and 
VVTP + 5) contain the actual length of the string. SCREENS 
was dimensioned to a length of one byte. However, chang- 
ing these bytes to 192 and 3, respectively, changes the length 
of SCREENS to 960 bytes (192 + 3 * 256) which is the length 
of the graphics screen memory. 

The seventh and eighth bytes (VVTP + 6 and VVTP + 7) 
contain the dimensioned length of SCREENS. This is 
changed from one to 960 bytes also. 

At this point, SCREENS occupies the same memory that 
has been allocated by BASIC as screen memory. BASIC will 
not move SCREENS around, even if you insert or delete BA- 
SIC lines. If your program needs to relocate screen memo- 
ry for some reason, you should insert your routine to do 
so be/ore Line 10020. Lines 10020 to 10040 will then posi- 
tion SCREENS over screen memory, no matter where you 
locate it. 



PAGE 16 /MAY 1988 



ANALOG COMPUTING 



SCREENS, as modified above, is the key to Quick Screen 
and Quick Screen Maker. If a change is made to SCREENS, 
then the display on the monitor changes instantly. All string- 
handling fimctions of Atari BASIC may now be executed 
directly on screen memory. 

Line'lOOSO — USEMENU is assigned a value of 130, which 
represents a line number for a routine to be explained later. 
MENUPAGES=N10 specifies that MENUS may contain up 
to ten screens. MENUL is set to the value of MENUPAGES 
* 960. 

When using Quick Screen in your ovra program, you 
should assign MENUPAGES with the number of screens 
you'll be using. This takes care of dimensioning MENUS to 
the correct length and allows the correct number of bytes 
to be read from your PGE file by SQUEEZES. 

Line 10060 — MENUS is dimensioned to a length of 
MENUL and filled with zeros. 

Lines 10070-10120 — SQUEEZES is created and the only 
machine language routine in Quick Screen is set up. This 
routine reads a disk file containing previously designed 
screens and stores them in MENUS. More on this later. 

Line 10140 — Charmel 1 is opened to read the file 
DiQSMENU.PGE, which contains the screens for Quick 
Screen Maker. The routine in SQUEEZES is called by USR. 

Line 10150 — The USR call to SQUEEZES will return a 
value to the variable A. If the value of A is 1, 3 or 136, then 
the file was read properly If not, the error number is print- 
ed by Line 10160 and execution is stopped. 

MENUNQ is set to so that the the first screen in MENUS 
can be displayed by the routine named USEMENU at Line 
130. 

Line 150 — To display the chosen portion of MENUS, the 
cursor is turned off with the PQKE 752,1- SCREENS is set 
equal to a portion of MENUS as follows: 

SCREEN$=MENU$(1+MENUN0 * 960,960+MENUNO * 960) 

or, in this case: 

SCREEN$=MENU$(1,960) 

Remember, MENUNQ was set to at this point. 

The screen display has been changed to the first page of 
MENUS. The routine at Line 120 is called. 

Line 120 — Several locations are maintained by the oper- 
ating system to handle the cursor. Since the screen has been 
changed, these locations must also be changed. Locations 
94 and 95 (OLDADR) contain the actual address of the cur- 
sor. A PEEK into the value at this location returns the screen 
code for the character at the cursor location. Poking this 
value into location 193 (QLDCHR) allows the operating sys- 
tem to properly replace the correct character when the cur- 
sor is moved. 

The following is an explanation of significant portions 
of Quick Screen Maker. You may use portions of this in your 
own BASIC programs. 

Line 11060 — PAGES is dimensioned to 9,600 bytes (ten 
screens) and filled with zeros. PAGES will be used to hold 
your screens as you create and edit them. It may be saved 
and loaded from disk. 

The main routine at Line 400 is called by Line 11130. 

Line 400 — The main routine begins by setting MENU- 
NO to 1 and displaying the main menu. Do not renumber 



Lines 427 through 486, as they are accessed by the GQTQ 
in Line 420, based on the value of the key pressed for the 
menu choice. This method is faster and more memory effi- 
cient than several IF statements, but it does result in strange 
line numbering. 

Line 70 — The GKEY routine, beginning at Line 70, is 
used when creating or editing a screen. The variable A is 
set to the value of location 764. If A is 255, then no key has 
been pressed and Line 70 is executed again. If A is less than 
200, Line 90 is executed. If A is 200 or greater, but not 255, 
then a SHIFT-CTRL function is being called. 

In order to allow all graphics characters to be entered on 
the screen, it was necessary to use the SHIFT-CTRL- 
KEY combination method to allow functions to be execut- 
ed. Location 764 contains the internal hardware value, or 
keyboard internal code, of the last key pressed. This is not 
the ATASCII or screen code. The ANALOG Computing 
Pocket Reference Card contains a complete list of the codes 
returned by PEEK(764). 

Be careful to notice the change in the value when a key 
is pressed, as all key combinations do not change the val- 
ue in location 764. For instance, pressing SHIFT and CTRL 
and any of the following characters will not change the val- 
ue: 1, Z, X, C, V, B, J, K, L, ;, +, or *. 

Line 80 — Holding the SHIFT and CTRL keys and press- 
ing another key (except those listed above) produces a code 
above 200 in location 764. This code is used as a line num- 
ber for the GQTQ statement in Line 80. If the line is not 
found, the TRAP in Line 70 causes the key press to be 
ignored. 

Line 130 — When editing a screen, the string SCREENS 
holds the screen memory as described above. When you 
press SHIFT-CTRL-R to record the screen, SCREENS is cop- 
ied to the appropriate portion of PAGES, as determined by 
MENUNQ. The BEEP routine confirms the success of the 
operation. 

Line 140 — This line is used to display a portion of 
PAGES, as determined by MENUNQ, upon entering the edit 
mode from the main menu. The BEEP routine is used here 
also. Note that this line is functionally equivalent to Line 
150 (discussed above), except PAGES is used instead of 
MENUS. 

Line 160 — This is the BEEP routine which sounds the 
tone to confirm the successful completion of a fimction or 
operation. 

Lines 205-255 — These lines execute the various fimc- 
tions available while editing a screen. They are accessed 
by Line 80 based on the value of A. These lines should not 
be renumbered. 

Lines 900-1230 — These lines contain three routines al- 
lowing a screen to be copied, inserted, or deleted to or from 
PAGES. After getting input about which screen to change, 
each routine uses normal string manipulation techniques 
to modify PAGES. 

The Squeeze routine 

This machine language routine is used for two reasons: 

speed when reading and writing to or from the disk, and 

to conserve disk space. When a set of pages (PAGES) is saved 

to disk without being squeezed, or compacted, the disk file 



ANALOG COMPUTING 



MAY 1988 / PAGE 17 



UTILITY 




M/L Editor 



For use in machine language entry. 



by Clayton Walnum 



M/L Editor provides an easy method to en- 
ter our machine language listings. It won't al- 
low you to skip lines or enter bad data. For 
convenience, you may enter listings in mul- 
tiple sittings. When you're through typing a 
listing with M/L Editor, you'll have a com- 
plete, runnable object file on your disk. 

There is one hitch: it's for disk users only. 

My apologies to those with cassette systems. 

Listing 1 is M/L Editor's BASIC listing. 

Type it in and, when it's free of typos, save 

a copy to disk, then run it. 

On a first run, you'll be asked if you're 
starting a new listing or continuing from a 
previously saved point. Press S to start, or 
C to continue. 

You'll then be asked for a filename. If you're 
starting a new listing, type in the filename 
you want to save the program under, then 
press RETURN. If there's already a file by that 
name on the disk, you'll be asked if you wish 
to delete it. Press Y to delete the file, or N 
to enter a new filename. 

If you're continuing a file, type in the name 
you gave the file when you started it. If the 
program can't find the file, you'll get an er- 
ror message and be prompted for another file- 
name. Otherwise, M/L Editor will calculate 
where you left off, then go on to the data en- 
try screen. 

Each machine language program in ANA- 
LOG Computing is represented by a list of 
BASIC data statements. Every line contains 
16 bytes, plus a checksum. Only the numbers 
following the word DATA need be con- 
sidered. 

M/L Editor will display, at the top of the 
screen, the number of the hne you're current- 
ly working on. As you go through the line, 
you'll be prompted for each entry. Simply 
type the number and press RETURN. If you 
press RETURN without a number, the default 
is the last value entered. 
■ This feature provides a quick way to type 
in lines with repetitions of the same number. 
As an added convenience, the editor will not 
respond to the letter keys (except Q, for 
"quit"). You must either enter a number or 
press RETURN. 



When you finish a line, M/L Editor will 
compare the entries' checksum with the 
magazine's checksum. If they match, the 
screen will clear, and you may go on to the 
next line. 

If the checksums don't match, you'll hear 
a buzzing sound. The screen will turn red, 
and the cursor will be placed back at the first 
byte of data. Compare the magazine listing 
byte by byte with your entries. If a number's 
correct, press RETURN. 

If you find an error, make the correction. 
When all data's valid, the screen will return 
to grey, and you'll be allowed to begin the 
next line. 

Make sure you leave your disk in the drive 
while typing. The data is saved continuously. 

You may stop at any time (except when you 
have a red screen) by entering the letter Q for 
byte #1. The file will be closed, and the pro- 
gram will return you to BASIC. When you've 
completed a file, exit M/L Editor in the same 
way. 

When you've finished typing a program, 
the file you've created will be ready to run. 
In most cases, it should be loaded from DOS 
via the L option. Some programs may have 
special loading instructions; be sure to check 
the program's article. 

If you want the program to rmi automati- 
cally when you boot the disk, simply name 
the file AUTORUN.SYS (make sure you have 
DOS on the disk). 

That's M/L Editor. Use it in good health. H 



The two-letter checksum code preced- 
ing the line numbers here is not a part 
of the BASIC program. For further in- 
formation, see the "BASIC Editor n," in 
issue 47. 



Listing 1. 
BASIC Usting. 



AZ IB DIM BFIie],ll»(4l,A*(ll,B$(l),F«ClS> 

.FISCISI 
LP 11 DIM M0D»C4J 
BK 2B LINE-leoeiRETRN=lSSlBACKSP=lZSICHK5 

UH=eiEDIT=e 
GO 38 GOSUB 450: POSITION IB.BI? "Start or 
Qontlnue? "iiGOSUB seeiT CHR$IA> 



ZG 46 POSITION IB, BIT "FILENAME") I INPUT F 

«1P0KE 752, lIT " " 
FE SB IF LEN(F$]<3 THEN POSITION 28,101? 

" "I GOTO 48 
NF 68 IF F$C1,2J <>"»!" THEN F1S="»I"|F1*C 

3>rF$iG0Ta 80 
KL 70 F1$=F$ 

TM SB IF CHRSCO)="S" THEN 128 
FD »0 TRAP 430I0PEN ti2,4,S,Fl$ITRAP 118 
HQ 108 FOR K=l TO IBIGET tt2,AlNEKT XILINE 

=LINE'>18|G0T0 108 
HH IIB CLOSE tt2IOPEN n2,9,B,Fl$IG0T0 178 
UT 120 TRAP leOlOPEN t)2,4,B,Fl$IG0SUB 448 
IP05ITI0N 10,1017 "FILE ALREADY EXISTS 
I M'lPOKE 752,0 
ZU 130 POSITION 10,121? "ERASE ITT "I1G05 

UB 5801P0KE 752,11? CHR$(AI 
«H 148 IF CHR$tAJ="N" OR CHR$CAl="n" THEM 

CLOSE n2IGaTa 3B 
OG 158 IF CHRSCA)<>"V" AND CHR$CA]<>"u" T 

HEN 138 
BH 160 CLOSE l>2:0PEN »2,B,B,F1$ 
IE 170 GOSUB 4581P0S1TI0N 18,11? " l . ' li l'B i l . 'B 

HEQ! ";LIMElCHK5UM=0 
GH 180 L1=31F0R K=l TO 16IP0SITI0N 13H(X< 

10)tl2iKX>5J,X+21P0KE 752,01? "BYTE «" 

)X] JIGOSUB 310 

KH ISB IF EDIT AND L=8 THEN BVTE^BF CXI I GO 

TO 210 
FY 200 BYTE=VAL(N$} 
OZ 201 MOD$=N$ 

BU 210 POSITION 22,X+2!? BYTE;" " 
VZ 220 BF(X)=BYTE:CHKSUH::CHKSUH4^ByTE»XlIF 

CHKSUM>5J5J THEN CHKSUH=CHKSUM-lBe88 
MS 238 NEXT XlCHKSUH=CHKSUHtLINE:IF CHKSU 

M>S33J THEN CHKSUMzCHKSUH-lOBOS 
IC 248 POSITION 12,Xt2IP0KE 752, 8lT "CHEC 

KSUMI ") |L1=4|G0SUB 318 
EH 250 IF EDIT AND L=B THEN 270 
OM 268 C=gftL(N*) 

5Y 270 POSITION Z2,X+2l? Cl" " 
IL 288 IF CzCHKSUM THEN 300 
DI 2S0 GOSUB 440:EDIT=1iCHKSUM=0:G0T0 180 
LH 300 FOR X=l TO 161PUT t<Z,BF(X> INEXT XI 

LINE=LINE^18IEDIT=eiG0T0 178 
FV 318 L=0 
KZ 320 GOSUB 500 1 IF CA=ASCI"Q") OR A=ASCC 

"q"n AND X=l AND NOT EDIT THEN 428 
PO 338 IF AORETRN AND AOBACKSP AND CA<4 

B OR A>57> THEN 320 
DK 331 IF A=RETRN AND N$="" THEN N$=HOD$ 
TD 335 IF A=RETRN AND L=8 AND X>1 THEN 35 


JR 148 IF ((A:rRETRN AND NOT EOITI OR A=B 

ACK5PI AND L=0 THEN 320 
DM 358 IF A=RETRN THEN POKE 752,11? " "IR 

ETURN 
GG 368 IF AOBACKSP THEN 480 
SA 378 IF L>1 THEN N$=N$C1,L-1) IGOTO 390 
AS 388 NS="" 

RE 358 ? CHR$CBACKSP})IL=L-1IG0T0 328 
BB 408 L=L+llIF L>L1 THEN A=RETRNlG0T0 35 


MX 418 N$(L]=CHR$CA) I? CHR$CA) J IGOTO 328 
KN 428 GRAPHICS OlEND 
YT 430 GOSUB 448IP0SITI0N 1B,1BI? "NO SUC 

H FILE1"IF0R X=l TO lOBOiNEXT XICLOSE 

tIZIGOTO 30 
FD 448 POKE 7ie,48IS0UND 0,100, 12, 81 FOR X 

=1 TO SBINEXT XISOUND 0, 8, 8, I RETURN 
MY 458 GRAPHICS 231P0KE 16,112|P0KE B3774 

,112IP0KE 559,0lP0KE 710,4 
XR 460 DL=PEEKC5Ee)t256MPEEKC5611'l'4IP0KE 

DL-l,70lP0KE DL+2,6' 
HH 478 FOR X=3 TO 39 STEP 2IP0KE DLtX,2lN 

EXT XlFOR X=4 TO 40 STEP 2IP0KE DLix.e 

INEXT X 
ZH 480 POKE DL'f41,65IP0KE DLt42, PEEK CBEOl 

IPOKE DL+43,PEEKt5611 IPOKE 8^,8 
AC 498 POSITION 2,01? "anilog Hi editor"! 

POKE S59,34IRETURN 
"Z »»B^JPEN Jll,4,e,"Kl"ICET iil.AlCLOSE HI 



PAGE 18 / MAY 1988 



ANALOG COMPUTING 




Quick Screen 



continued 



will be 77 sectors long. In the squeezed format the file 
length will vary with each set of pages. 

The squeeze routine looks for repeating characters, and 
counts the number of repetitions. For example, suppose the 
routine finds a series of 320 spaces (eight blank lines). Only 
four characters are written to the disk: 27, 0, 64, 1. The 27 
is the escape character which is used as a flag to indicate 
the compression. The is the space character internal 
screen code that is to be repeated. The 64 and 1 represent 
320, in least significant/most significant order (64+1*256), 
which is the number of times to repeat the space. When the 
file is read from disk, the routine looks for the escape 
character flag and repeats the next character the number 
of times necessary before reading the next byte from disk. 
The routine will read files that are not squeezed without 
modification because it does not encounter the escape 
character. 

The routine is accessed by a USR call in the BASIC pro- 
gram. Several parameters must be passed to the routine. The 
first parameter is the address of SQUEEZES. Next is the 
chaimel number to be used. Third is the name of the string 
that is to hold the file being read from disk, or that holds 
the file to be written to disk. Fourth is the number of bytes 
to read. Finally, a 1 is passed if the file is to be read from 
disk, or a is passed if the file is to be written to disk. 



Programming hints 

Quick Screen Maker uses all three character codes in the 
Atari operating system. ATASCII is used for all printing to 
the screen and normal character input. The internal screen 
code is used for all direct modifications to SCREENS. The 
internal keyboard code is used by the routine at Line 50 
to detect the SHIFT-CTRL-KEY combinations. Be careful 
to use the correct code in the appropriate places of your 
program. 

If you get strange results during initialization of your pro- 
gram you may have a variable in the variable value table be- 
fore SCREENS. Try Usting your program to disk, type NEW, 
and enter the program back into memory. 

Try Quick Screen the next time you write a program. It 
gives a more professional look and feel to your BASIC pro- 
grams. H 

EarJ R. Davidson has been an avid Atari enthusiast /or 
many years and is president of the Atari Users' Group of 
Albany, GA. As one of the owners of SoSoft, he wrote the 
user's manual for InSyst/, a small business inventory pro- 
gram for 8-bit Ataris. 

(Listing starts on next page) 



A COMPUTER SOFTWARE SERVICES 
RO. BOX 17660, ROCHESTER, N.Y. 14617 
ATA PI" PHONE (716) 467-9326 

'^"^'^' THE 

$69.95 "SUPER ARCHIVER"!® 

(for ATARI 1050 drives] 

The new SUPER ARCHIVER, obsoletes all copying devices currently available 
for the ATAR1 1050! It eliminates the need tor Patches, PDB files. Computer 
Hardware, etc Copies are exact duplicates of originals ond will run on any 
drive- without exaggeration, the SUPER ARCHIVER is the most powerful 
PROGRAt^f^lNG/COPYING device available for the 1050! Installation consists 
ol a plug-in chip and 6 simple solder connections. Softwares included. 
Features are: 



DEALER/DISTRIBUTOR/USER GROUP Discounts available call for into 
Phone Orders - MASTER CARD, VISA 
Mail - Money Orders, Check 




"ULTRA SPEED PLUS!" 



A 

ATARI" 

$69.95 



$69.95 

Imagine a universal XUXE Operating System so easy to use that anyone can operate 
it instantly yet so versatile and powerful that every Hacker, Programer and Ramdisk 
owner will wonder how they ever got olong without W Ultra Speed Plus puts 
unbelievable speed and convenience at your fingertips. Use ANY DOS to place 
on ULTRA SPEED format on your disks, boot any drive (1-9) upon power-up format 
your RAf\/IDiSK in Double Density activate a built-in 400/800 OS for software com- 
patibility, plus dozens of other features to numerous to mention! Below are just a 
FEW features you'll find in the amazing OS: 



• TRUE DOUBLE DENSITY 

• ULTRA-SPEED read/write 

• FULLY AUTOMATIC COPYING 
. SUPPORTS EXTRA MEI^ORY 

• SCREEN DUrt^P to printer 

• TOGGLE HEX/DEC DISPLAY 

• SECTOR or TRACK TRACING 

• AUTOMATIC DIAGNOSTICS 

• DISPLAYS HIDDEN PROTECTION 
. ADJUSTABLE/CUSTOM SKEWING 

• AUTOMATIC SPEED 
COMPENSATION 

• AUTOMATIC/PROGRAMMABLE 
PHANTOM SECTOR MAKER 



• ARCHIVER/HAPPY ARCHIVER 
COMPATIBLE 

• BUILT-IN EDITOR-reads, writes, 
displays upto 35 sectors/track 
(short) 

• BUILT-IN CUSTOM FORMATTER - upto 
40 sectors/track 

• BUILT-IN DISASSEMBLER 

• BUILT-IN MAPPER - upto 42 sectors/ 
track 

• DISPLAYS/COPIES Double Density 
HEADERS 

. AUTOMATIC FORMAT LENGTH 

CORRECTION 
. SIMPLE INSTALLATION 



ULTRA Speed S10 lor 
most modified drives 
' ULTRA Speed is foggleoble 
' Boot directly from RAMDISK 
' Special timer circuils not re- 
quired for 1 or 2 f^eg upgrades 
I Background colors adjustable 
, Reverse use of OPTION key 
■ Cold-slorl without memory 

loss 
. Built in floppy disk configura- 
tion editor [t-9j 



• Built in RAf^flDISK configurd- 
tion editor (1-9) 

• RAMDISK exoctty duplicdtes 
floppy drive so sector copy- 
ing ond sector editing dre 
now possible 

• Built In MINI Sector Copier 

• Toggle SCREEN OFF tor up to 
40% increase of processing 
speed 

• Toggle Internal BASIC 



• rtom resident disk toader 
program (MACH 10 menu) 

. DOUBLE DENSITY RAMDISK 
copobie 

• Entire MEMORY tesi that pin- 
points defective RAM chip 

• Boot any drive [1-9) upon 
power-up or cold-start 

• Supports memory upgrades 
up to TWO MEGABYTES 

• THREE Operating Systems in 
one IXL/XE, 400/800, ULTRA 
SPEED PLUS) 



The SUPER ARCHIVER is so POWERFUL that the only programs we know of that 
cant be copied ore the newer ELECTRONIC ARTS and SYNFILE/SYNCALC (34 

FULL sectors/track), if you want it ALL buy the "BIT-WRITER"! also. . . .then 

you'll be able to copy even these programs! 



$79.95 



THE SUPER ARCHIVER 

$79.95 "BIT-WRITER"! 

The Super Archiver "B1T-WRITER"I is capable of duplicating even the 
"uncopyable" EA and SYN series which employ 34 FULL sectors/track. "BIT- 
WRITER'M is capable of reproducing these and FUTURE protection schemes 
of non physically damaged disks. PLUG-IN circuit board and 4 simple solder 
connections. The SUPER ARCHIVER with "BIT-WRITER'^I is the ultimate PRO- 
GRAMMING/COPYING device for Atari 1050's EXACT DUPLICATES of originals 
ore made! Copies run on ANY drive. 



$29.95 RAMDISK "WRITE-PROTECTOR!" $29.95 

Hackers, Programers, or BBS users. . . if you own a RAMDISK (memory upgrades for 
your XL or XE computer), think about this: Every disk drive ever manufactured has 
WRITE-PROTECT capabilities. . .except your RAMDISK, Without it, your valuable stored 
data/program lie naked, awaiting that one mistake that will wipe out hours, maybe 
weeks of precious programming efforts. End the fears of accidental formatting or 
overwriting by installing our universal RAMDISK "Write-Protector!" Works on oi! memory 
upgrades up to 2 megabytes. Simple installation. Only S29.95. 



<<XF551 ENHANCER! 



!" 



$29.95 



$29.95 

The XF551 Atari drive is a tine product with one major flaw. . . it writes to side TWO 
of your floppy disks BACKWARDS. This causes read/write incompatibility problems 
with all other single sided drives made for Atari such as Indus, Trak, Rono, Ftercom, 
Astra Atari 1050, Atari 810, etc Add the XF551 ENHANCER to the new XF551 drive 
and your problems are overt This device will restore 100% compatibility between 
oil drives while retaining all of the original design qualities of Atoris' super new drive 
The XF551 ENHANCER is a MUST tor all XF551 owners, installation is simple Only S29.95. 



Circle #103 on reader service card. 



ANALOG COMPUTING 



MAY 1988 / PAGE 19 



The two-letter checksum code preceding the line 
numbers here is not a part of the BASIC program. 
For further information, see the "BASIC Editor II," 
in issue 47. 



Listing 1 
BASIC Usting 



Q5MEMU MftKER by Earl Davidson 



KD le REM 

GC 26 REM Creates the file Q5NENU.PGE 

MP 3e REM to be used With 

LL 48 REM Quick Screen Maker 

MC 58 ? CHR$C125J:? "CREATING Q5NENU.PGE" 

:? :? "PLEASE WftIT" 
AJ 68 RESTORE 

ZH 78 OPEN ttl,8,e,"D:QSNENU.PGE" 
KJ 88 TRAP 188 

CM 98 READ DAT: PUT ttl, DAT: GOTO 98 
CZ 188 CLOSE t»l:IF PEEK (1951 =6 THEM ' "DO 

ME":? :? :emd 
LD 118 ? "ERROR ";PEEK tl95) ; " AT LIME ":P 

EEK tl86 J +256»PEEK tl87J : EMD 
OL 1008 DATA 27,128,38,8,188,173,128,27,8 

^38^8,128,128,8,72,27,128,4,8,8,128,12 

JY iei8'DATA 128,8,72,27,128,4,8,8,128,27 
,8,5,8,27,128,5,8,8,27,128,5,8,8,128,1 
28 

FY 1828 DATA 8,128,74,8,8,128,8,128,74,28 
2*74^8,128,8,128,74,8,8,128,8,128,74,2 

YJ 1838 DATA 8,128,74,8,8,128,8,128,74,27 
'?4l'?ii22i^28,8,128,128,128,194,128,8 
, 128, 128, 74 

KA 1848 DATA 282,74,128,8,128,128,128,194 
28'fi;22^f?i^fli''''''^'«'^^«'"«'^'»'«'^ 

^"^ ^^l^J'*'^'* 282,128,8,128,128,8,128,128, 
ii®{^l'?il'®'^2®'^28,128,8,282,212,8,i 
28,128,128,74,212,8 

°" i?5^»'^5I^ 27,128,4,8,212,8,27,128,4,8, 
212^8, 27, 128, 4, 8, 212, 8, 128, 128, 27^8; 38 

^^ i®h,'*2I'*»i?^'^^'^'«^'2fli'76,281,89,28 

t2i??fi!ii?hlM^'"'^«^'^^'"'^«^'" 

"" f®?f SJTA 8,89,283,79,283,27,89,4,8,28 
h^?i^2^i"'"^'®'"'8^'89'2fl3, 89127,1 
28, 12, 8, 27 

OY 1898 DATA 8,38,8,128,128,27,8,15,8,112 

^^ 4i^,S''I'>^I^'85,85,79,79,8,79,85,79,85 
,85^73,8,79,8,8,85,85,79,85,85,79,85,8 

'*'* ^ii^,5'*T5.85'85,79,85,85,79,79,8,79,85 
,85,27,128,4,8,89,89,8,89,89,8,89,217, 

"** i^^f 52^5 75,217,73,76,8,8,89,8,76,89, 
8,76,89,8,89,89,8,8,89,8,8,281,79,89,2 

■"■^ ^k^ft S'^TA 128,6,8,89,89,8,89,89,8,89,2 
i7,e,89,8,217,213,89,8,8,213;213,89,89 

^■^ 45®,E'*IS 281,287,76,283,85,8,283,85,8 
^1^^75,89,27,128,6,8,89,89,71,89,89,8, 

"° i^i^^E^I'* 89,73,217,8,89,8,8,79,8,89,8 
P^ ?{fi"'$!'g'85,89,8,8,89,8,8 89 8 89 
" T^li g?TA 27,128,4,8,213,213,76,213,21 

^^ kHf^^^l^ 213,213,76,76,8,76,213,213,7 
l'li^iF2'Z5'^^'®'^^'2i3,213,128,128,2 
7,78,38,8,27,128 



"•^ i^S®,?^^'* 4*8,89,98,121,8,37,97,114,18 
8,8,36,97,118,185,188,115,111,118,8,97 
,118,188,8,42 

WT 1198 DATA 111,184,118,8,47,97,187,188, 

i28;2"efie;r'"^''*'^'"'"''^'®'"^' 

EM 1288 DATA 35,111,112,121,114,185,183,1 

ifil^!ilS?2?''''''^''"'"'"'"'«'"' 

MC 1218 DATA 8,38,8,128,128,27,8,13,8,48, 

ii4*i81, 115, 115, 8, 97, 118, 121, 8, 187,181 

^** f228'DAfA'8,128,128,27,8,38,8,27,128,4 

^,8, 27, 8, 53, 8, 66, 177, 181, 169, 163, 171,1 

28, 179, 163, 178 
VP 1238 DATA 155,165,174,86,27,8,187,8,66 

,173,161,169,174,128,128,173,165,174,1 

81,86,27,8,98,8,144 
ED 1248 DATA 141,153,8,37,188,185,116,15, 

i^A^i^'^^^'"''^^S'^8^'^5,54,185,181,ll 

9,8,97,8,51,99,114 
GX 1258 DATA 181,181,118,27,8,12,8,163,8, 

?i?^{H^Ai^^"^'®'"'®'5i*99,114,lBl, 

MM 1268 DATA 24,8,164,8,8,36,181,188,181, 
^^S'i2^A®{!I'®'^^'''''^^*'^^^'^81,118,2 

XT 1278 DATA 8,8,48,181,188,112,27,8,33,8 
,169, 8, 8, 41, 118, 115, 181, 114, 116, 8, 9710 

VT 1288 DATA 181,181,118,27,8,22,8,172,8, 
8,44,111,97,188,8,182,114,111,189,8136 
,185,115,187,27 

RK 1298 DATA 8,23,8,177,8,8,49,117,185,11 
8,27,8, 33, 8, 179, 8, 8, 51, 97, 118, 181, 8, 11 

AR 1388 DATA 36,185,115,167,8,13,8,99,111 
{i®2'fi?'^^*'^^^'^JL5'^i5,161,188,27,6, 
12,6,181,8,8,53 

EY 1318 DATA 118,99,111,189,112,114,181,1 
15,115,101,188,8,51,97,118,181,8,116,1 
11,8,36,185,115,187,27 

"^ i^^^^?'*IS 8,12,6,182,8,8,54,185,181,11 
l'?ii^{||'fiT'^®^'^"'^^®'^^S'27,e,24, 

PE 1338 DATA 8,36,47,51,27,8,162,8,37,116 
^118' 181, 114, 8, 99, 184, 111, 185, 99, 181, 2 

^"^ il5®lS§^5«i^5' 238, 244, 229, 242, 128, 166, 

i?i;i5?f^?!sfSf2^?S'"^'"^'"*'"'«"» 

io, 41, 44, 37 
PY 1368 DATA 14,48,39,37,27,8,26,8,36,18, 
26^57,47,53,58,38,41,44,37,14,48,39,37 

PU 1378 DATA 183,8,36,185,115,187,8,36,18 
Sjllf ,181, 99, 116, 111, 114, 121, 26, 8, 161, 
118,116,161,114,6,180 , , , X, 

"■^ i^?® '>5I''„^?5,115,167,8,186,114,185,11 

V«^{r{5'i!'2'^^®'^^^'"5'98'181,il4 
, W, o, 17, 13, 24, 9 

"" ^i'L'*^!'*,?''^® ' 88' ®' <8' ^^*' 181, 115, 115 
'?A?®{52'?2£^^2'"'S^'*8,38,8,116,lil,8 

"'* i*SI S*T2 "8,8,116,111,8,45,97,185,11 

i;f7^!itl;?fS'''"'"''"''"'«'^^'i'^ 

"^i^^^5§:^7S?!ii??46^:l^if^i?hl?JsJf!d 

„„ ?'i75, 174, 128, 171, 165, 185, 179, 86 

*^^ ^fl! ?5I« 27,8,47,6,66,168,239,236,228 

iT^?4P?^i^?i^^''^^8, 186, 128, 134, 128,1 

63,175,174,188,178,175,172 
^^ i*l®,55TS.^28,225,238,228,128,248,242, 

229,243,243,128,235,229,249,86,27 8,44 

,6,66,168,86,46,161,168 



PAGE 20 / MAY 1988 



ANALOG COMPUTING 




Quick Screen 



continued 



: 1440 DflTft 112,0,13,9,189,185,115,112,1 

08,97,121,8,116,184,105,115,8,115,99,1 

14,181,181,118,27,8 
> 1458 DflTft 11,8,66,173,86,45,97,114,183 

,105,118,8,13,8,116,111,103,103,108,10 

1,0,8,0,16,0 
( 1460 DftTft 111,114,0,18,0,9,27,0,11,0,6 

6,177,86,49,117,105,116,0,116,111,0,45 

,97,105,110 
; 1478 DATA 8,45,181,110,117,0,8,50,101, 

99,111,114,100,101,108,31,9,27,8,8,8,6 

6,178,86,58 
i 1480 DATA 101,99,111,114,100,0,115,99, 

114,101,101,110,0,116,111,0,50,33,45,0 

.8.46.47.52.0 




^^ Pf?,"^?!? ff'<6, 51, 37, 50, 52, 0,105, 102, 
V?h^Hl4^'27'0*9, 0,119, 105, 115, 104 
, If , llD, 111, 8 

"" ^?72 ?5Tft 44,101,116,97,105,110,0,105 
Jri^jil'^'^'®'^^'^'^^*'^65,172,165,180, 
165,128,161,128,179,163 ' ' ' ' 

UU 1980 DflTft 178,165,165,174,27,0,178,0,3 

9'9!i?itilitSSiti2s?0"^' "^' "^' «' i^^' 

LL 1990 DflTfl 110,117,109,98,101,114,0,8,1 

o, 164, 165, 172 
KC 2000 DflTft 165,180,165,164,86,26,63,27, 

S, 0, 115, 99 
HM 2020 DflTft 114,101,101,110,115,0,110,11 

103,101,114,27,0,6,0 
UJ 2030 DflTft 116,104,97,110,0,116,104,101 

MW 2040 DflTft 105,108,108,0,98,181,27,0,9, 

?ii?9ntiiitilit?Si^««'«'"i'^^«'"':«: 

'^^ ??i®, S?^?„f^^'®' 188' m* 119,101,114,0, 

"!0??^;i?i;iSI;S&l"'^«*'"^'^i^'"'« 

^'* ?2®?„?'*T'* 97,110,100,0,105,115,0,117,1 

, 14, Zf,v, 231 
MT 2080 DflTft 7 



Listing 2 
BASIC listing 

uu 12 SiH creates BftSIC lines to assign 
MM so REM a Hachine language routine to 
KY 40 REM a STRING froM DftTfl stateMents 
5U 50 DIM WORKS tl28J 
KU 60 DIM DESTFN$(151 ;DESTFN$="D:SQUFEZE. 

DftT":REM NAME OF FILE TO BE CREATED 
KH 70 DIM DEST$C2e} :DEST$="SQUEEZE$":REM 

NAME OF STRING TO BE CREATED 
■>!- 80 BEGLIM=10080:REM FIRST LIME NUMBER 

^^ V^tItI-IuIII^ INCREMENT LINE NUMBERS B 
T I nX3 NUnBER 

"' iyl s'T^'lE^SiN^I-f?"*""''' "CHECKING D 

^^ ii^L^S? llhJ^ 387: READ DAT : CHKSUMrCHK 

3un+DAT!NEKT I 
JQ 120 IF CHKSUM052443 THEN ? "ERROR IN 

DATA STATEMENTS...":? "CANNOT CREATE S 

TRING":STOP 
PD 130 ? "DATA STATEMENTS OK!":? "CREATIN 

G "JDESTS:? 

"■"• ^i^ RESTORE :TRAP 220 : SL=1 : OPEN «1,8,0 
I DE5TFNS 

°^ 150 work$=str|cbeglinj : works CLEHCWORKS 

J t" = works tLEN tWORKS) +1J =DESTS ; WOR 

KStLENf WORKS) +1J="C" i^t^i^-NUK 

LL 160 WORKS CLEM tWORKS) +1) rSTRS tSLJ : WORKS 

,"-^2^^""^*' *^' ="* ='■ = "ORIf* tLEN CWORKSJ +1 

) =CHRS C34 J : LL=LEN CWORKSI 
MB 170 READ DAT : WORKS CLL+IJ =CHRS CDATJ 
^^ 180 SL=SL+l:LL=LL+l:IF LL<113 THEN GOT 

U X r 

GA 190 WORKS CLL+IJ rCHRS C34) :LL=LL+1 
"■* ?°®u^2? l-i ^° ■-■-!? CHRSC27J;W0RKStI,I 
);:NEXT I:? ;? «1;W0RKS:REM print LINE 



PAGE 22 / MAY 1988 



TO SCREEN AND DISK 
JQ 210 BEGLIN=BEGLIN+INC:G0T0 150 
IP 220 IF PEEKC195J06 THEN ? "ERROR ":PE 
Ej[g«195);JJpAT LINE "; PEEK (186) +256»PEEK 

FP 230 WORKS tLL+l)=CHRSf 34) :LL=LL+1 

MA 240 FOR 1=1 TO LL:? CHRS (27) ; WORKS CI. I 

);:NEKT I:? »l; WORKS: close »i "'"'"^'^ 
"-•^ llU^'l '>E5TFNS;" now contains the BA 

SIC":? "lines to create ":DESTS 
^•' ^S^..Z,i' "^'' "s* ";DESTS;" it Must be" 
u., !? "£lMensioned to a length of ";5L-i 
"■^ lllJi i'...'^" include the lines in ";DE 

STFNS:? "m your progran type:":' 

P« rI^sJ," ^"^^ ■■;CHRS(34);DESTFMS;CH 

OJ 290 END 

^^ ^|?5®J''IS.^?*4?2^'^'^^^'®'^^^'212,133 

,213,96,201,4,240,8,170,104,104,202,20 
o, Z51 

^^ ^?li®,g5TA 240,237,104,104,10,10,10,10 

i«^?Ai®fi4"'2®*'"*'^"'203-104,133,2 
DO, 104, 133 

■■^ i^lll S?!** 207,104,104,208,91,165,207, 
^42l®i21®'"'^^8'«'i^7'203,133,215,230 

^^ i^fHlJ^%l% 2,2^0,204,198,207,165,207,2 
2H?^?il®^'^'^^®'208'165,203,72,165,2O 
*, r£i 165 

^^ ^2240 DATA 207,72,165,208,72,169,0,133 
,210,169,1,133,209,165,207,5,208,240,3 

7 J XOo 



Save $14 Off 
The Cover Price 

ANALOG 



□ 1 Year $28.00 Save $14! 

MCEYY 

□ 1 Year with Disk $105.00 

DCEYY 

FOREIGN: Add $7 Per Year 
Money Back If Not Delighted! 

D Payment Enclosed D Bill Me 
n Charge My U Visa D MC 
* Exp. 



Signature 



Name 



City State Zip 

Mal<e Checks Payable to: L.F.P. Inc. Allow/ 4-6 

weeks for delivery of first issue. 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



ANALOG COMPUTING 




Quick Screen 



continued 



EU 19258 DATA 9,177,283,197,215,288,31,23 
8,283,288,2,238,284,238,289,288,2,238, 

5G 18268 DftTft 287,165,287,281,255,288,2,1 
98,288,56,176,217,248,92,176,165,288,9 

yft 18278' DftTft 288,6,165,289,281,4,144,33, 
184, 184, 184, 184, 165, 289, 133, 216, 165, 21 

133 2X7 
DA ie288'DATA 169,27,133,214,169,214,157, 

68,3,169,8,157,69,3,169,4,157,72,3,288 
LJ 18298 DATA 27,184,133,288,184,133,287, 

184,133,284,184,133,283,169,1,157,72,3 

RX 18388 DATA 157,68,3,169,8,157,69,3,169 
,8,157,73,3,169,11,157,66,3,32,86 

UJ 18318 DATA 228,48,3,56,176,164,132,212 
,169,8,133,213,96,168,1,165,287,5,288, 

248 
DQ 19328 DATA 38,169,215,157,68,3,169,8,1 

57,69,3,169,7,157,66,3,169,1,157,72 
ZQ 18338 DATA 3,169,8,157,73,3,32,86,228, 

16,7,132,212,169,8,133,213,96,168,8 
LG 19348 DATA 165,215,281,27,249,21,145,2 

83,238,283,288,2,238,284,198,287,165,2 

DJ 18358 DATA 288,2,198,288,56,176,182,16 
9,8,157,73,3,169,3,157,72,3,169,215,15 

01 18368 DATA 68,3,169,8,157,69,3,169,7,1 
57,66,3,32,86,228,48,198,165,216,5 

JK 18378 DATA 217,248,41,165,287,5,288,24 
8,35,168,8,165,215,145,283,238,283,288 

TT 18388 DftTft 284,198,216,165,216,281,255 
,288,2,198,217,198,287,165,287,281,255 

GX 18398 DftTft 288,56,176,289,56,176,174 

• Listing 3 

BASIC listing 

LE 8 GRAPHICS 8 : DIM SCREENS tlJ : SCREEMS="" 

[GOTO 1 8888 _™,™„™ 

DA 18 REM 

PO 28 REM 

HF 38 REM 

MJ 48 REM 

TV 58 REM 

DF 68 REM 

MS 78 ?RAp'iEKE?rA'?PEEKCN764J:P0KE 99,88:1 
F A=H255 THEM GOTO GKEY 

£;! 11 J^T"iil!K?:m=?SRS«VJ:POKE 763,H2 
1I:IF KY=27 AND ESCFLG THEM POKE 674, M 

EK 188 -» KVS: ! E5 CFLG=8*1*KV= 27 ;GOTO GKEY 
JM ill REM Eteim^P^^^„ 

YF S^^KE M93,PEEKtPEEKCM94J+PEEKtM95)» 
N256J:? PHjgiUPg;;RE TURM 

H^ ill ?^Se?!^S»M968,M968+PAGEM0»M 
96eJ=5CREJEM$iG05UB BEEP:RETURM 

II ill poke'^1K?Fscreem5=page^cmi*pagem 

0«M968,M968+PAGEM0»M96e>!GQ5UB RCH ! GOS 
UB BEEP; RETURN 

II HI ?'ol?E=l^^.SCREEM5=MEMU^CMl*MEMU 
M0«M96e,M968+MEMUM0KM968J:G0SUB RCH:RE 
TURM 

ME til fE5 ^.5 TO MS STEP -8.75:S0UMD 
S8,M18.M12.I:MEXT I:RETURM 



QUICK SCREEN 
COPYRIGHT CO 1986 by 
Earl Davidson 
and John Oakley 



TlIlTll 



DISPLAY HELP PAGE 



KZ 178 GOSUB RCH: MENUS fNl+M9»N96e,N968+N9 
iN968J=SCREEN$:MENUN0=N3:G0SUB USEMENU 

HE i88^MENUN0=H9:G0SUB USEMENU: POKE 752, C 
;GOSUB R CH ; GOTO .9J-KEV ______ _. , 

JE 199 REM n\ti m r A v ii umw d v \ i i >u aa^ . 

DX 285 A=PEEKtN93J :POKE M93, A+H128«tn^NlZ 
8)-N128«CA>N127J:? RTS;:G0T0 CLKEY 

SE 286 A=PEEKCN93J:UP=CPEEKCM94J+PEEKCM95 
)»N256>-N48*tUP-SAUMSC>M48J [POKE UP, A: 

^ UPS: :GOTO CLKEY 
ZS 287 A=PEEKCN93J :DWN=CPEEKCN94J+PEEKCN9 
5J»N256J+N48»CDMN-SAUM5C<921J :P0KE DMN 

,A:? DHS;!G0T0 CLKEY _ „ 

HX 216 TL=2l7:TR=287:BL=75:BR=213:H=149:U 

=153:G0T0 BORDER .. ^^„ „ 

DE 218 TL=N128:TR=TL:BL=TL:BR=TL!H=168:V= 

H;GOTO BORDER 
y V 2i9 TL=84 : TR=TL : BLrTL : BR=TL : H=28 : U=H : G 

MH 221 TL=7l?TR=79:BL=75:BH=76:H=18:g=124 

:GOTO BORDER _,„ „ 

SK 222 TL=289:TR=197:H=146:g=252!BL=218:B 

R=195:G0T0 BORDER „ ^^ „ .„ „_,<,. 
JD 223 TL=81!TR=692BL=98:BH=67:H=18:W=124 

LS 229^LM=Ne+CN2»tLM=N8>):P0KE N82,LM:? C 

R$:UPS; :G0T0 CLKEY 
BB 232 GOSUB CAPPAGE:G0T0 CLKEY „ „ „ ^ 
PO 237 C=N8+PEEKCN752J=N8:P0KE N752,C:? D 

nS:UPS; :G0T0 CLKEY 
UQ 239 POKE M764,N255: GOTO MAIN 
lU 248 TL=N3:TR=TL!BL=TL:BR=TL!H=35:U-H!G 

EH 242 ?L=h"tR=TL!BL=TL:BR=TL:H=32:U=H!G 

Y5 2I3 tC?N1B:TR=TL:BL=TL:BR=TL:H=42:V=H: 

YN 235°TL=138 ■ TR=TL : BL=TL : BR=TL : H=17e : V=H 

KT 246^A=PEEk"93J : LF= CPEEK CN94J +PEEK CN95 
)iN256J-Hl»CLF-SAUMSC>N8 AND PEEK I85)< 
>N81:P0KE LF,A:? LTS;:G0T0 CLKEY 

PC 247 A=PEEK tN93 J : RT= CPEEK CN94 J +PEEK CN95 
jiN256J+Hl»CRT-SAUMSC<958 AND PEEKC85) 
<>39):P0KE RT,ft:? RTS;:G0T0 CLKEY 

ML 255 rnTn ri KEY! REM S/C/ft not ava ilable 

IP ill REM fri^g.riaHiM.iiHHaij H;ti „^, „ 

OJ 388 POKE 694, N8: POKE 7e2,N64:GET ttN2,K 

y:kys=chrsckyj : return 

k^P lii SS^KrftN^^?;P=l!Y=59 THEN KY=58:KYS 

~chrS cky) 

Oft 338 IF KY=N155 THEN RETURN 

l^E Itl ¥r K?>« SllD"K?<i9 OR KY>N64 ftMD K 

Y<91 THEM IF CHM0<16 THEN ? KYSj:MORK$ 

rrHNO CHNO) =KYS : CHM0=CHN0+N1 : GOTO N328 

ru siS IF KYOie ftHD KY0126 AND KY0254 

^^ IhI KYOise AnS KY043 THEN ? CHRS C253 

IIF 378*^IF°LENCH0RKSJ>N1 THEM M0RKS=M0RKSC 
"■^ N1?CLENCM0RKSJ-H1J1:CHM0=CHN0-Nl:? CHR 

PD yri'F'6Sr=Nf tSeN H0RKS= CHN0=N1 : ? 

CHRS C126J;: GOTO H328 
FD 398 ? CHRSC253JJJG0T0 N328 
YM 399 REM [lOOEElIIillQ 



POSITION 26,21:? ■'_'■; LTS; : GOSUB AHYK.? 

MT iia IF KY>47 AND KY<58 THEN PAGEMO=KY- 
nil: TRAP GKEY: POSITION N8,N8: GOSUB USE 
PAGE:GOTO N58 

UX 428 GOTO 48e+KY 

ML 427 ? DNS: DOS 

KQ 467 GOTO 1880 



ANALOG COMPUTING 



MAY 1988 / PAGE 23 



5AUE PAGES TO DISK 



LP 468 GOTO 1286 

LF 472 MENUN0=N3:G0SUB USEHENU : GOSUB ANYK 

:GOTO MAIN 
KR 473 GOTO 1188 

MY 476 FUNC=1:MENUN0=N2:G0SUB 888 : GOTO 68 

8 
QC 481 POKE H752,N8:? CHR$tl25):? :» :» : 

? "GOTO HAIN";UP$;UP$;UP$:STOP 
UW 483 FUNC=8:HENUN0=:N2:G0SUB 888 : GOTO 58 

8 

EA 485 FUNC=N2;HENUN0=M2:G0SUB 888: GOTO 5 

50 
LY 486 GOTO 138 8 

GL 499 REM ^ 

MP see TRAP 538 

GZ 518 CLOSE »N1:0PEN ttMl, 8, H8, FILENAMES: 

«=U|Rj"»R CSQUEEZES J , Nl ', ADR CPAGES J , LIh i 

BX 528 CLOSE ttNl : IF A=H1 THEH GOSUB BEEP: 

GOTO MAIN 
BR 538 POSITION N3,N23: GOSUB N1588: GOSUB 

ANYK:G0SUB 888:G0T0 588 
MZ 558 TRAP 538 

"" ^S®«SV°S^^?S^""'^'* »Hi'M8,Ne, FILENAMES 
:? ttNl; PAGES; 

PP 578 CLOS E ttN l: GOSUB BEEP: GOTO MAIN 
GY 599 REM I BiM > ■ J= T ri J--J B J .M ! | i ;i jh ' i 
NA 688 TRAP 638 ■^— "'— 'Tin 

LH 618 CLOSE ttNl:OPEN ttNl, N4, N8, FILENAMES 

iS^I^I?,"B?,"2"^"^*' ' "i' ft^R cpages?7len 

CPAGES} , Nl} : POKE 195, A 
DB 628 CLOSE ttNl:IF A=N1 OR A=N3 THEN GOS 

UB BEEP: GOTO MAIN 
DZ 638 POSITION N3,N23: GOSUB N15e8: GOSUB 

ANYK :G0SUB8ee: GOTO 688 
TX 699 REM liMiMJfl 

FR 788 GOSUB RCH : POKE N752, Nl : SCREENS CNl, 
N1J=CHRSCTLJ: COLOR H:Pl6t Nl,Ne:DRAWT6 
38 f N8 

KC 710 SCREENS fN48, N40) rCHRS CTRJ : COLOR U: 
^k?^„22i^ ' DRAWTO 39, 22 : SCREENS tN960, N9 
681 =CHRS CBRJ : COLOR H:PLOT 38,23 
*"' 2«. P^Si^J" »'0.N23;SCREENSt921,921J=CHR 
^R l4f4A9£'-22-"A'''-''T Ne,22:DRAwfo Ne,Nl 
SB 730 POKE 752,C:G0SUB RCH:? RTS;:Gofo C 

JH 799 REM Hi*« J«J7; i ;Mr r il l fc* TTTal 
ON 808 MENUN0=N2: GOSUB USEMENU : POSITION N 
12+N1,N3:IF FUNC=N1 THEN ? " HiMMi-Ti lsa 
EBa3";G0T0 838 ' ^ ' " **' *" " 

PB 818 IF FUNC=Ne THEN ? "^SMMEM^Sm" 
ftW 820 IF FUNC=N2 THEN P05ITIQNN7 M3 !^ " 



UNCOMPRESSED SAUE TO DISK 



"^ -WORKS^^^^"" 18, N6: GOSUB 318 : FILENAMES 
RB 848 IF FILENAMES="" THEH GOTO MAIN 
XQ 858 IF LEH {FILENAMES) =N1 THEH GOSUB 14 
00: GOTO 808 

ZQ 868 RETURN 

GE 899 REM IHJi«. ' n i! IJfH>Mii ! H- r : TiI??-] 

MM 900 GOSUB ANYK: IF KY=N155 THEN GOTO MA 

SJ 918 IF KY<N48 OR KV>57 OR KY=SOU THEN 
? KYS;CHRSC253J;CHRSC126);:G0T0 988 

FG 928 KV=K V-N48:? KYS ;: RETURN 

SN 999 REM Irfil -XMAA ;U J T ■ ! l iH i * WTra 

ZO leee MENUN0=N5:G0SUB USEMENUlPOSTTTnil 

N3,N9:? ' UAtJr ^ — " " 

LT$; :G0SUB 900 

wz leie sou=KY 

IZ 1020 POSITIO N N3.11:? " fa^caia 
LiJ:B.^JJJJJ1IB»;LT$; : GOSUB 900 



Enter SOURCE screen 



Enter destihati 



QL 1030 DES=KY 
ZU 1048 PAGES CNl+DESKN96e, N96O+DES»N960] = 
PAGES CN1+S0U*H960, H960 + SOUKH96ej : GOSUB 
BEEP; GOT O MAIN 
SB 1699 REM N:MJ!>«.-TH!lJJ. 'B r I i ir¥iITra 
NQ 1166 MENUN0=N6: GOSUB USEMENU : POSITION 



Nie, 11; GOSUB 968 
ZJ 1118 S0U=KY;DES=8;PN0=N1+8»N968 
MI 1128 IF DES>=SOU THEN PAGES (PN0+N968, P 

N0+1919J =PAGES (PNO, PNO + 959) : DES=DES-H1 

:PN0=PN0-N96e:G0T0 1128 
HA 1138 ? CHRSC125) ;PAGEN0=S0U:G0SUB CAPP 

age; GOTO MAIN 

BP 1199 REM [>»i^i*.-til!lalj:B;MIIT?:Ta 

NV 1286 MENUN0=7: GOSUB USEMENU: POSITION 2 

7,N16:G0SUB 968 
UH 1216 S0U=KY:DES=S0U;PN0=Nl+S0UKN96e 
HC 1226 IF DES<N9 THEN PAGES CPNO, PNO+959) 

=PAGES (PN0+N968, PN0+1919J : DES=DES+N1 : P 

N0=PN0+N966:G0T0 1226 
JX 1236 ? CHRSC125) ;PAGEN0=N9: GOSUB CAPPA 

GE;G0T0 MAIN 

P. fill 2^tl L'><=<!«'ii»=<^rn 

HJ 1308 C=Nl:FOR PAGEN0=N8 TO H9;? CHRSCl 

251:P0SITI0N 16, N4:? "SCREEN ";PAGENO; 

FOR HAIT=N1 TO N58 : NEXT WAIT 
CC 1318 GOSUB USEPAGE;G0SUB ANYK:IF KY=N1 

55 THEN POP :GOTO MAIN 
YK 1328 NEXT PAGENO : C=N e :GOTO MAIN 
MV 1399 REN l >>M!aa<; l <itlT l ;l'a i f I i llggITra 
ZX 1488 POKE N752,N1:MENUN0=N4: GOSUB USEM 

ENU : AS=CHRS CASC CMORKS (Nl, Nil 1 +N1281 : PO 

SITION 28, Nl:? AS;;TRAP 1476 
RL 1416 FILENAMES="Dl:».»";FILENAMESCN2,N 

21=M0RKS 

■-^ i*?2.£'-°^^ ttNl: OPEN ttNl, N6, NO, FILENAME 
S:TRAP 1468:P0KE N82, N2 :I=N1 : POSITION 
N2 N5 

JI 1438 INPUT ttNl,HORKS:? WORKS; CHRS C311 ; 

CHRSC31); ;INPUT ttNl, WORKS:? WORKS:l=I+ 

Nl:IF I<17 THEN GOTO 1436 
HC 1448 POSITION N6,22:? "WKMMSMKI^ 

^EEnDSSHi"; : GOSUB anyk : gosub "seme 



NU;P05ITI0H 28, Nl;? AS;:I=N1 
NN 1458 position N2,N5:G0TO 1438 
EL 1468 IF PEEK tl951 =136 THEN POSITI ON N6 

GOSUB ANYK : RETURI* «i«iiiiil l^wm , 
UC 1478 POSITION N2, 22: GOSUB NISOS : GOSUB 

ANYK: GOTO MAIN 
LF 1499 RE M N!J;lil;»!l*W:THd 
IP 1588 ? " dJilJilil -'VPFFVf I qsi ■ III 

; PEEK C1861+256»PEEK C187J ; : RETURN 
MC 9999 REM •" 



QUICK SCREEN SETUP 



IJ 16868 Nl=N6=Ne:N2=Nl+Nl:N3=N2+Nl:N4=N2 
+N2 ; N5=N3+N2 ; H6=N5+N1 ; N7=N6+N1 : N18=N5+ 
H5 : N93=93 : N94=N93+H1 : N95=N94+N1 

CB 16616 N166=N95+N5:N256=256:N968=968:N9 
6ee=N966«N16 

UN 18828 UUTP=PEEKC134}tPEEK(1351«N256;P0 

UL 16036 POKE UUTP+N2, PEEK C881 : POKE VUTP+ 

n3/ PEEK C89) 
QR 16048 POKE VUTP+N4, 192 : POKE UUTP+N5,N3 

:P0KE UUTP+N6,192:P0KE UgTP+H7,N3 
XM 10050 USEMENU=150;RCH=12e;MENUPAGES=Nl 

6 : MENUL=MENUPAGES»N960 
AY 10860 DIM MENUS CMENULl, UPS CNll, DNS CNll 

: MEHUS=CHRS (01 : MENUS (MENULl =MEHU$ : MENU 

S (N2) =MEMUS : UPSrCHRS (281 : DHS=CHRS (29) 
FU 10070 DIM 5QUEEZES(3871 
TG 10079 REM LINES 10080 TO 10120 are CPe 

tlU !'^,.h^^If'"^ 2. Type: ENTER "D;S0U 
^EZE.LST". Then type: LIST loesa iai7n 
TR 10129 REM U ii4:v m:r J rm m± i i }:m >iiAm 

NP ^ ^^ff J!!^. -?.^?. t A '.^Q ^ -^ ^ ^ ° ** N18+N1,N6:? 



READING QSMENU.PGE 



CU 16146 CLOSE ttNl;OPEN ttNl, N4, N6, "D : QSME 

nii '*Slu,'.?=l!?? "■>■* SQUEEZES) , Nl , ADR (MEN 
U$l ,MENUL,N11 

BE 10158 CLOSE ttNl:IF A=N1 OR A=N3 OR A=l 
36 THEN MENUNO=N0: GOSUB USEMENU: GOTO 1 
1008 

SmSEIMi 



KH 1016 ? " MiliM; 
[1^33": STOP 



l!m!l=U:M".fl.-' 



PAGE 24 /MAY 1988 



ANALOG COMPUTING 




Quick Screen 



continued 



INITIALIZATION 



FM 11088 N 8 = N 4 + nV: N 9= N 1 8- N i :N12=N18 + N2;N2 

3=N12+N18+N1 
LV 11810 N32=N8»H4:H33=N32+Nl:N48=N12»N4: 

N5e=N48+N2 : N48=N58-Nie : N64=N32+N32 : N82 

=82 
NI 11028 M96=M95+Nl:N127=N95+H32:N128=H12 

7+Nl : N155=M188+N50+N5 : N255=N155+N10e 
XU 11838 N32e=N155»N2+Nie:N752=752!N764=M 

752+N12 : N38e=N100»N3 : H980=N300»N3 : N910 

=N900+N1O 
NK 11848 N752=752:ll764=N752+H12!N1588=158 

8 
ZK 11058 SftUMSC=PEEKC88J+PEEKC89J»H256 
KU 11868 DIM PftGE$CN9608J :PftGES=CHR|C8J :P 

AGE$ (N9688) =PAGE$ : PAGE$ CN2) =PAGE$ 
KM 11878 POKE 738,Nl!P0KE 729,24:P0KE 789 

,14:P0KE 718,N0:POKE 712, N2 
LE 11088 GKEY=78:ANYK=N388:CLKEY=118;CAPP 

AGE=138!USEPAGE=148:BEEP=160:OFF=480e8 

: LM=N2 : MAIN=48e : B0RDER=788 
AI 11890 CLOSE ttN2:0PEN «N2, N4, N8, "K ! " : PO 

WF N82 LM 
CC 11188 DIM KYSCNIJ, FILENAMES tl5J, AS tNlJ 

, MORKS CN256) , ERRS t36 J , LTS tNl) , RTS CNIJ , 

crs cnu 

XO 11110 LTS=CHRSt38J :HTS=CHRSt31J :CRS=CH 

VK 11128 UPS=CHRSC28) :DNS=CHRSt29) !LTS=CH 

RS130) ■.RTS=CHRSt31J ! CRS = CHRS C155J 
UY 11130 G05UB ANYK:GOTO MAIN 



BOOT UP TO 
BIG SAVINGS 

SUBSCRIBE 



n 1 Year $28 

n 1 Ypar with Disk 


Save $14 

MCEYY 
$105 




Name 




Address 



City State Zip 

Make cinecks payable to: L.F.P. Inc. Allow 4-6 

weeks for delivery. 

n Payment Enclosed n Bill Me 

n Charge My D Visa D MC 

# Exp 



Signature 

FOREIGN— Add $7 per year 

IVIONEY BACK il not deligtited 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



ULTIMATE 
STORAGE 

Here's the perfect way to organize your ANALOG 
Computing library— sturdy custom-made binders 
and files in deep blue leatherette with embossed 
silver lettering. Silver labels are included to index 
by volume and year One binder or a box-style file 
is all you'll need to accommodate 12 issues (1 year) 
of ANALOG Computing— all the games, pro 
grams, tutorials and utilities that you want handy 




The ANALOG Computing binder opens flat for 
easy reading and reference. They're economically 
priced at only $9.95 each— 3 binders for $27.95 
or 6 binders for $52.95. 

Tlie ANALOG Computing file is attractive and 
compact, holding 12 issues for easy access. Files 
are available for only $7.95 each— 3 files for $21 .95 
or 6 files for $39.95. 

Add $1.00 per case/binder for postage and haridling. 
Outside U.S., add $2.50 per case/binder — U.S. funds only. 

I enclose my check or money order in the amount 

of $ ■ 

Send me; ANALOG Computing files 

ANALOG Computing binders 

PLEASE PRINT. 



Name: . 



Address: (No P.O. Boxes) 



City: . 



state: 



. Zip Code: 



Send your order to: 

Jesse Jones Industries 

DEPT. ACOM 499 East Erie Ave., Philadelphia, PA 19134 
Call Toll Free 1-800-972-5858 - 7 days, 24 hours 



I VISA 



Charge orders only minimum $15,00 

PA residents, add 6% sales tax 

Satisfaction guaranteed or money refunded. 



ANALOG COMPUTING 



MAY 1988 / PAGE 25 



Issues 




All back 
issues 
are priced 
at $4.00 each. 



Send your check or money order to 
ANALOG Computing Back Issues, 

P.O. Box 16927 

N. Hollywood, CA 91615 




Back issues on 5V4-inch disk 

$12.95 each, plus $3.00 shipping and handling. 
Issues 35 and up are available in this format. 



ISSUE 30 • Loan Shark • Z-Plotter • BASIC Burger • ANALOG TCS Guide 

• Boulder Bombers 

ISSUE 31 • Unicheck • R.O.T.O. • Lunar Patrol • ATASCII Animation • Lazer Type 

• Atari Clock • Personal Planning Calendar 

ISSUE 32 • Supereversion • DOS III to DOS 2 conversion • Color the Shapes 

• Home-made Translator • Cosmic Defender • 520ST 

ISSUE 33 • An Intro to MIDI • Note Master • Syntron • BASIC Bug Exterminator 

• Assemble Some Sound • C.COM • Mince (ST) 

ISSUE 34 • Dragon's Breath • Multiple Choice Vocabulary Quiz • Elevator Repairman 

• Assemble Some Sound Part 2 

ISSUE 35 (also on disk) • Hide and Seek • Printers Revisited • Bonk • Turtle 1020 • G: 

ISSUE 36 Cafeo on disk) • Sneak Attack • Maze War • Nightshade • Solid Gold 
Input Routine • Rafferty Run 

ISSUE 37 (also on disk) • Speedski • Index to ANALOG Computing (15-36) • Master 
Disk Directory • Halley Hunter • Bank Sviiilching lor the 130XE 

ISSUE 38 (also on disk) t Color Alignment Generator • Incomingi • DLI Maker • Air 
Hockey • ST Color Palette 

ISSUE 39 (also on disk) » Super Pong • Unicheck (updated) • C-Manship Part 1 

• Program Helper • Adventurous Programming Part 1 • ST Software Guide 

ISSUE 40 (also on disk) • Clash of Kings • Micro-Mail • Koala Slideshov» Program 

• Adventurous Programming Part 2 • Mouser 

ISSUE 44 • RAMcopy! • The 8-Bit Parallel Interface • Arm your Atari • Blasti 

• D:CHECK in Action! * STLog 4 

ISSUE 45 • Stencil Graphics • Roll 'Em! • RAM DOS XL • LBASIC 

• Using BASIC XL's Hidden Memory • ST-Log 5 

ISSUE 46 • Magic Spell •Moonlord • Soft Touch •La Machine • June CES 

• Launch Code • ST-Log 6 

ISSUE 47 • DLIs: A minute to learn • Deathzone • BASIC Editor !l • 

• The ANALOG Database • DiskFiie • ST-Log 7 

ISSUE 48 • M-Windows • Cosmic Glob • DLIs - Part 2 • Modem Chess 

• Status Report • ST-Log 8 

ISSUE 49 • The Atari 8-bit Gift Guide • Brickworks • TechPop 

• Fortune-Wheel • Smiles and other facial wrinkles • STLog 9 

ISSUE SO • Krazy Katerpillars • Atari Picture Storage Techniques • Trails in Actioni 

• Scroll-It • Screen Scroller 

Issues 12, 14, 15, 16, 17, 18, 19. 20, 21 and 22 are also still available 






48K Cassette or Disk 



UTILITY 



o 



The MAC/65 
De-Tokenizer 



Convert your tokenized MAC/65 
files into plain ol' English 



by Charles Bachand 



MAC/65 is an outstanding 6502 macro assembler for the 
Atari 8-bit computer from Optimized Systems Software, Inc. 
Our staff, and most of our regular contributors, use it when- 
ever they do any assembly language programming. The car- 
tridge contains one of the fastest assemblers on the market 
today, and the tokenized source-code files that it generates 
can save quite a bit of disk space. We highly recommend 
MAC/65 to anyone doing 6502 machine language software 
development. 

However, (you knew that this was coming, didn't you?) 
the Catch-22 with MAC/65 is that the file format used to 
save code is not compatible with anything; if you want to 
use MAC/65 files, you need MAC/65. Or, at least until now, 
you did. The MAC/65 De-Tokenizer presented here will free 
you from this requirement. 

The De-Tokenizer is a small Atari BASIC program that 
will convert a tokenized MAC/65 file back into readable 
English — or at least what passes for English from some of 
the programmers I know. 

How The MAC/65 De-Tokenizer works 

To understand the internal workings of The De-Tokenizer 
program, one must understand the rules by which MAC/65 
compresses its files. There are actually two parts to a 
MAC/65 tokenized file. The first four bytes comprise the file 
header, which is broken into two parts. 



Byte 



FE FE XX XX 



Byte count (low-byte/high-byte) 
MAC/65 file identifier bytes 



Bytes 1 and 2 each have the value of 254 (or $FE in hex 
notation.) If, when you try to load a file, MAC/65 sees some- 
thing other than a 254 in these positions, it knows that the 
file is the wrong format and the editor will display a File 
Type Error #23. 

Now, assuming that the load process gets you past this 
check, MAC/65 reads in the next 2 bytes (3 and 4), which 
specify the number of bytes of actual tokenized data that 
the file contains. This is a 16-bit value which is stored in 
the classic "low-byte/high-byte" format. Adding 4 — the 
number of bytes we've just read — to this number, will give 
us the total number of bytes in the file. 

Once we get past these first 4 bytes, we begin to encoun- 
ter the tokenized data — the place where all the real fun be- 
gins. 

Getting on the token express 

Atari BASIC is tokenized. This means that the program- 
mers of this language devised a scheme to compress the 



ANALOG COMPUTING 



MAY 1988 / PAGE 27 




De-Tokenizer continued 



data, in order to reduce memory usage and to increase the 
execution speed of its programs. A similar savings is also 
realized when storing tokenized programs out to cassette 
or disk. 

This concept of file tokenization has been carried over 
into the design of OSS's MAC/65 as illustrated in the fol- 
lowing example: 

Hex data 

OA 00 OC 84 4C 4F 4F 50 51 05 00 06 

14 00 04 2C 

IE 00 07 4F3E 08 OA 

28 00 07 50 05 00 06 

32 00 09 21 84 4C 4F4F 50 



ASCII values of the four characters T, E, S and T. String 
tokens are always greater than 128 in value. 

If the value of the token is less than 128, then it's either 
a MAC/65 assembler directive or a 6502 instruction. Table 
1 shows the allowed token substitution values. 



Assembly listing 

10 LOOP LDA $0600 
20 CLC 

30 ADC -10 

40 STA $0600 

50 JMP LOOP 



What do the five lines of assembly code and the five lines 
of hex data in the above example have in common? They 
happen to be one and the same as far as MAC/65 is con- 
cerned! The listing takes 78 bytes as text, but only 39 bytes 
to store it in the computer's memory or out to a disk file. 
In this example alone, we've cut our storage requirements 
in half, and this degree of savings is not an uncommon oc- 
currence when using MAC/65. 

One line at a time 

Just as every MAC/65 file has a file header, so does every 
tokenized line in the file have a 3-byte line header associated 
with it. For instance, the first three bytes in Line 10 from 
our example above are $0A, $00 and $0C in hex. This is 
further broken dovm as follows: 

OA 00 OC 84 4C 4F 4F 50 51 05 00 OS 

\ / I \ Token data / 

|~ Line length 

Line number { low-byte/high-byte) 

The first two bytes represent the line number— again in 
the standard low-byte/high-byte format. It's easy enough to 
convert these two bytes back to a number that can be print- 
ed by multiplying the value of the second byte by 256 and 
adding the value of the first byte to it. Using our example, 
we have $00 (or decimal), multipHed by 256, giving us 
(so it's not an exceptionally exciting example) and then 
adding $0A (or 10 decimal) to it, which finally gives us a 
line number of 10. Wasn't that easy? 

The third byte in the line tells us the number of bytes 
of tokenized data associated with that line. This count also 
includes the two line number bytes and the count byte. Our 
example of $0C (12 decimal) in this position signifies that 
the line contains 9 bytes of data, plus the 3 bytes of header 
data, giving us a total of 12 bytes. 

A tolcen for your thoughts 

Now that we're finally past all this header stuff, we get 
to look at what you've all come here to see — namely 
MAC/65 tokens. 

An assembly source statement line is in the form: 
[label] [ (6502 instruction) or (assembly directive) ] [comment] 

A string of characters, such as a label or a string in quotes, 
is identified by a token made up of the string's character 
count, with the high bit set, followed by the ASCII values 
of the string. So, if we have a 4-character string like "TEST" 
it will have a token of 132 ($84) or 128 + 4, followed by the 



Token Replacement 

0* "ERROR -" 

I ".IF" 

2 ".ELSE" 

3 ".ENDIF" 

4 ".MACRO". 

5 ".ENDM" 

6 ".TITLE" 

7* " " 

8 ".PAGE" 

9 ".WORD" 

10 ".ERROR" 

II ".BYTE" 

12 ".SBYTE" 

13 ".DBYTE" 

14 ".END" 

15 ".OPT" 

16 ".TAB" 

17 ".INCLUDE" 

18 ".DS" 

19 ".ORG" 

20 ".EQU" 

21 "BRA" 

22 "TRB" 

23 "TSB" 

24 ".FLOAT" 

25 ".CBYTE" 

26 ";" 

27 ".LOCAL' 

28 ".SET" 

29 "*=" 

30 " = " 

31 ". = " 

( * = see text) 



32 "JSR" 

33 "JMP" 

34 "DEC" 

35 "INC" 

36 "LDX" 

37 "LDY" 

38 "STX" 

39 "STY" 

40 "CPX" 

41 "CRY" 

42 "BIT" 

43 "BRK" 

44 "CLC" 

45 "CLD" 

46 "CLI" 

47 "CLV" 

48 "DEX" 

49 "DEY" 

50 "INX" 

51 "INY" 

52 "NOP" 

53 "PHA" 

54 "PHP" 

55 "PLA" 

56 "PLP" 

57 "RTI" 

58 "RTS" 

59 "SEC" 

60 "SED" 

61 "SEI" 

62 "TAX" 

63 "TAY" 



64 "TSX" 

65 "TXA" 

66 "TXS" 

67 "TYA" 

68 "BCC" 

69 "BCS" 

70 "BED" 

71 "BMI" 

72 "BNE" 

73 "BPL' 

74 "BVC" 

75 "BVS" 

76 "ORA" 

77 "AND" 

78 "EOR" 

79 "ADC" 

80 "STA" 

81 "LDA" 

82 "CMP" 

83 "SBC" 

84 "ASL- 

85 "ROL' 

86 "LSR" 

87 "ROR" 

88* . . .Comment line 

89 "STZ" 

90 "DEA" 

91 "INA' 

92 "PHX" 

93 "PHY" 

94 "PLX" 

95 "PLY" 



Table 1 

Looks simple, doesn't it? If a token value is 33, then it is 
a 6502 "JMP" instruction. If the value is 17, it's a MAC/65 
".INCLUDE" directive. 

Of course, there are exceptions. A line that could not be 
tokenized properly, due to an error in syntax, has a as its 
token byte. A comment line— one that does not contain any 
label or instructions— has a token value of 88. The rest of 
the line in both cases is stored as pure ASCII text. 

If the token has a value of 7, then the label following it 
identifies the name of a macro that is to be called at this 
point in an assembly. Macro names are usually indented 
more than the regular mnemonics, so we output a few ex- 
tra spaces before printing the macro name. 

Now, once we get past the initial label and instruc- 
tion/directive phase of the tokenization process, we encoun- 
ter a second set of tokens for the MAC/65 operands which 
are listed in Table 2. These are the ones that we'll be using 
until we reach the end of the tokenized line. 

If we bump into a token that is greater than 128, it is a 
label and it follows the same rules we outlined previously 
in handling labels. All the other operand tokens— those 
with values less than 128— are handled with a simple sub- 
stitution for their corresponding text values. The exceptions 
are for the tokens with values of 5, 6, 7, 8, 10 and 59. 



PAGE 28 / MAY 1988 



ANALOG COMPUTING 



56 .. 

57. . 

58. . 
59* 

61 . 

62 . . 

63 . 
64. . 
65 . . 
69 . 



",Y" 
",X" 
.")■' 



"#" 
"A" 
.T 



Token Replacement 

5* "$" 28 ">" 

6* "$" 29 "<" 

7* 30 "-" 

8* 31 ■'[" 

10* 32 "1" 

11 "%$" 36 "!" 

12 "%" 37 "A" 

13 "*" 39 "\" 

18 " + " 47 ".REF" 

19 "-" 48 ".DEF" jQ ..Qgj„ 

20 "*" 49 ".NOT" j^ "ERR" 

21 "/" 50 ".AND" 72 "EJECT" 

22 "&" 51 ".OR" 73 "LIST" 

24 " = " 52 "<" 74 "XREF" 

25 "< = " 53 ">" 75 "MUST" 

26 ">=" 54 ",X)" 76 "CLIST" 

27 "<>" 55 "),Y" 77 "NUM" 



."NO" 



(* 



see text) 



Table 2 

Token 5 is used for word-length hex constants and is fol- 
lowed by two bytes containing the value of the constant in 
low-byte/high-byte format. For example, a hex constant like 
$0600 is tokenized as the three bytes 5, and 6. 

Token 6 is very similar to 5, but is used for 1-byte-long 
hex constants. A value like $80 would tokenize as the two 
bytes 6 and 128. 

Tokens 7 and 8 are used for word and byte decimal con- 
stants and follow the same structure as the hex constant 
tokens 5 and 6. Thus, a decimal word constant like 256 
stores as 7, 0, 1, while a byte-sized constant like 255 ends 
up as 8, 255. 

Token 10 defines a character constant, which in MAC/65 
is an apostrophe, followed by any displayable character. 
Thus, a reference to the ATASCII value of the capital letter 
A would appear in MAC/65 as A and be stored as 10, 65. 

That just leaves us with the value of 59, which signifies 
the begirming of the comment field, to round off our odd- 
ball token list. All the bytes that follow the token, up to the 
end of the line, are part of the comment field and are out- 
put as ATASCII text. 

How the MAC/65 De-Tokenizer works— really! 

Sorry about suckering you into reading about MAC/65 
tokenization methods with that false "How the program 
works" title near the begirming of the article, but you might 
have skipped over some wonderful pieces of information. 
I promise, the following paragraphs do in fact describe how 
the program works. Honest! 

The De-Tokenizer is a bare-bones utiUty program. All you 
need do to make it run is supply it with the names of the 
MAC/65 file and the text file or device that you want the 
output sent to. If you're not sure of the name of the MAC/65 
file, just hit RETURN and the program will hst the direc- 
tory of the disk in drive 1. 

The program takes several seconds to initialize, and in 
that time, it reads a hst of strings, representing the MAC/65 
tokens, from DATA statements into the array TOKEN$. It 
also reads the corresponding decimal values of the tokens, 
which are used as indexes in building two arrays that hold 



the indexes for the starting (Array TS] and ending locations 
(Array TE) of each substring in the TOKEN$ array. Once 
initialized, it's a simple matter to print out the ATASCII value 
of any known token. 

For example, to print out the text for token 11 — the 
".BYTE" directive — we could type the following line: 
PRIHT TOKEHSCTStllJ,TECllJJ 

This, of course, will give us only one possible string, but 
it is easily modified by replacing the two nimieric constants 
with variables. This was done in Line 1320 of the BASIC 
program to print out the token associated with the contents 
of the numeric variable A. 

You might have noticed in Line 1390 that the routine used 
above to print out a token has a value of 128 added to the 
indexes, and, of course, there must be a very good reason 
for this. If you take a look at Tables 1 and 2 , you'll see that 
quite a few of the token values used are common to both 
tables. MAC/65 doesn't mind this at all, since internally it 
uses two tables for doing substitutions. The De-Tokenizer 
program could have also used two sets of tables, but it was 
more to our advantage to employ only one. 

If you remember from my little MAC/65 tutorial (the one 
I tricked you into reading), the token for a label is 128, plus 
the number of characters in the label, leaving all other tokens 
with a value less than 128. Hmm ... If we leave the num- 
bering of the instruction/directive tokens (Table 1} alone, and 
offset the numbering of the operand tokens (Table 2) by ad- 
ding 128 to them, then they'll all fit into a 256-entry table. 
Yeah, yeah, that's the ticket! Then, to print an operand, we 
look at the second half of the look-up table (tokens 128-255), 
by adding 128 to the token value — just hke the one being 
done in Line 1390. 

Taking up space with source code 

I wanted the output from The MAC/65 De-Tokenizer to 
be usable by owners of Atari's Assembler/Editor cartridge, 
so I elected not to try to convert the directives to those used 
by otlier 8-bit assemblers (hke SynAssembler or Atari's Mac- 
ro Assembler). It's up to the programmer to check for any 
incompatibility in this area. 

The program does not output text in nice neat columns 
(remember, I told you this was a bare-bones program!), be- 
cause it is largely a waste of precious disk space to do so. 
Most assembler programs won't care anyway, but if it bothers 
you that much, I'll be happy to let you modify my code. 

Well, that's about it. I hope you're able to make as much 
use out of The MAC/65 De-Tokenizer as I had fun writing 
it (intense sarcasm here), fl 

Charlie would like to thank Matthew J.W. Ratcliff, a 
heavy-duty proponent of MAC/65, for his aid in the testing 
of this program. 



The two-letter checksum code preceding the line 
numbers here is not a part of the BASIC program. 
For further Information, see the "BASIC Editor II," 
in issue 47. 



(Listing starts on next page] 



ANALOG COMPUTING 



MAY 1988 / PAGE 29 



U De-Tokenizer continued 



Listing 1 
BASIC listing 



TQ 1868 REM MaC/65 TOKEN CONVERTER 

LE 1818 REN CO 1987 ANALOG COMPUTING 

WL 1828 REM HRITTEN BY CHARLES BACHAND 

IF 1838 REM 

GC 1848 DIM TSC255),TE(255},HEXC151 

IQ 1858 DIM A$C4e), TOKENS 15881 

TE 1868 GOSUB 1470 : G05UB 1668 

OT 1878 TRAP 1878:? !? "RETURN for direct 

ory or nane of":? "MSS^^EM file"; 
PO 1888 INPUT A$:IF A$="" THEN GOSUB 1748 

:G0T0 1878 
EL 1898 OPEN ni,A,B,tt$ 
KA 1188 GET »1,A:GET »1,B 
HZ 1118 IF A=254 AND A=B THEN 1138 
BD 1128 ? "QNOt a MAC/'65 File!":GOTO 1878 
KJ 1138 GET ttl,A:GET ttl,B 
PO 1148 ? :? "File length = ";A+B»256+4 
WT 1158 TRAP 1158:? ;? "RETURN for direct 

ory or nane of":? " BiHHJUB file"; 
NO 1168 INPUT AS: IF A$="" THEN GOSUB 1748 

:GOTO 1158 
GX 1178 OPEN t}2,8,8,A$ 
IH 1188 REM 

BJ 1198 REM PROCESS A LINE 
lA 1288 REM 
OZ 1218 TRAP 1448 

YM 1228 GET ttl,A:GET ni,B:GET ttl,L 
LZ 1238 L=L-3: PRINT tt2;A+B«256;" "; 
50 1248 GET »1, A : L=L-1: IF A<>88 THEN 1278 
MN 1258 FOR B=l TO L:GET ttl,A:PUT tt2,A 
m 1268 NEXT B: PRINT tt2:G0T0 1228 
MS 1278 IF A<128 THEM 1328 
BR 1288 FOR 1=129 TO A : GET ttl.A 
NZ 1298 PUT «2,A:L=L-l!NEXT I 
OJ 1388 IF L=8 THEN ? tt2:G0T0 1228 
XE 1318 GET ttl,A!L=L-l 

FX 1328 ? »2;" ";T0KEN$CTSCA},TE(A1);" "; 
XI 1338 IF A=8 THEN 1258 
OW 1348 IF L=8 THEN ? n2:G0T0 1228 
XQ 1358 GET »1,A:L=L-1 

HB 1368 IF A>128 THEN C=A:FOR B=129 TO C: 
GET ttl,A:PUT tt2,A:L=L-l:NEXT B:GOTO 13 
48 
BG 1378 IF A=7 THEN GET ttl,A:GET »1,B:? tt 

2;A+B»256; ;L=L-2:G0T0 1348 
TL 1388 IF A=8 THEN GET ttl,A:? »2;A;:LrL- 

IrGOTO 1348 

KD 1398 ? tt2; TOKENS CTS(A+128),TECA1^128I J ; 

:IF A=6 THEN GET ttl,A:GOSUB 1688 : L=L-1 

:GOTO 1348 

XP 1488 IF A=5 THEN GET ttl,B:GET ttl,A:L=L 

-2: GOSUB 1688 :A=B: GOSUB 1688: GOTO 1348 

MH 1418 IF A=59 THEN FOR B=l TO L : GET ttl, 

A: PUT tt2,A:NEXT B:? tt2:G0T0 1228 
DI 1428 IF A=ie THEN GET ttl. A: PUT tt2,A:L = 

L-1 
QP 1438 GOTO 1348 

LL 1448 A=PEEKC195) :IF A=136 THEN 1878 
MY 1458 ? "QERROR tt";A;" AT LINE ";PEEKtl 

86J +PEEK C187J »256 : STOP 
IH 1468 REN 
IL 1478 REM SET-UP TOKEN TABLES 

JC 1488 REM 

PY 1498 ? :? "EEIHSi TOKEN CONVERTER" 
KO 1588 ? :? "Initializing arrays, "; 
IL 1518 ? "please wait...":c=l 
MF 1528 READ TOKEN, A$: IF TOKENO-1 THEN G 

OSUB 1688: GOTO 1528 
JN 1538 T0KEN=185:A$=",X": GOSUB 1688 
JX 1548 T0KEN=184:A$=",Y": GOSUB 1688 

GC 1558 T0KEN=7:A$= GOSUB 1608 

RT 1568 T0KEN=189:AS=",": GOSUB 1688 

QX 1578 T0KEN=193;A$=CHR$C34) : GOSUB 1688 



SJ 1588 T0KEN=182:A$=", XI": GOSUB 1688 

MD 1598 T0KEN=183:AS="J,Y" 

GQ 1688 TSCTOKEN}=C: TOKENS CO =A$ 

MM 1618 TECTOKEN)=LEN (TOKENS) 

QM 1628 C=LENCTOKENS)+l: RETURN 

IR 1638 REM 

JP 1648 REM HEX C8NVERSI0N 

IX 1658 REM 

SD 1668 FOR A=8 TO 15:READ AS 

VG 1678 HEX CA)=ASC CAS} : NEXT A: RETURN 

ML 1688 C=INTCA/16J :B=A-C»16 

CZ 1698 PUT tt2,HEXCC) iPUT tt2,HEXCBl 

AN 1708 RETURN 

IN 1718 REM 

FS 1728 REM READ DISK DIRECTORY 

IT 1738 REM 

UC 1748 OPEN tt3,6,8,"D:».«":TRAP 1755 

QV 1758 INPUT tt3,AS:? AS: GOTO 1758 

FY 1755 CLOSE tt3: RETURN 

JC 1768 REM 

MC 1778 REM 

JI 1788 REN 

HP 1798 DATA 

OG 1888 DATA 

EL 1818 DATA 

KT 1828 DATA 

MS 1838 DATA 

LL 1848 DATA 

YQ 1858 DATA 

00 1868 DATA 

MM 1878 DATA 

LK 1888 DATA 

TP 1898 DATA 

HY 1988 DATA 

SY 1918 DATA 

KT 1928 DATA 

LC 1938 DATA 

IR 1948 DATA 

SU 1958 DATA 

QR 1968 DATA 

IV 1978 DATA 

TL 1988 DATA 

HG 1998 DATA 

PJ 2888 DATA 

C5 2818 DATA 

IV 2828 DATA 

AU 2838 DATA 

YP 2848 DATA 

YK 2058 DATA 

UG 2868 DATA 

PZ 2878 DATA 

GN 2888 DATA 

FU 2898 DATA 

NJ 2188 DATA 

MT 2118 DATA 

XA 2128 DATA 

HO 2138 DATA 

YO 2148 DATA 

YN 2158 DATA 

BR 2168 DATA 

SX 2178 DATA 

AY 2188 DATA 

CM 2198 DATA 

KR 2288 DATA 

EV 2218 END 



35, 
32, 
86, 
54, 
87, 
61, 
62, 
66, 
21, 
93, 
22, 
1 A 

28, .EQU,11, .BYTE, 12, . SBYTE 
25, .CBYTE,13, .DBYTE,9, . MORD 
18, .DS,2, .ELSE, 3, .ENDIF 
18, .ERROR, 24, .FLOAT 
1, .IF, 17, .INCLUDE, 27, .LOCAL 
15, .OPT, 8, .PAGE, 28, .SET 
8, ERROR - ,4, .MACR0,5, .ENDM 
6, .TITLE, 31, .=,16, .TAB 
198,tt,187, ,134,S,133,S 
188, <,181, >,138, ',159, C 
168, 3, 146, +,149,/, 148, » 
167, \, 158, &, 164, !,165,A 




xr7, .UK ,J.7r,HU ,Ztl 

LIST, 178, .AND ,199 
ERR, 177, .NOT ,288 
EJECT, 176, .DEF , 19« 
8BJ,175, .REF ,2e3,MLI5T 
284, CLIST, 285, NUM. 282, XREF 
192, C,186,),139,>:S,141,» 
191,A,148,X,-1,XXX 
8,1,2,3,4,5,6,7,8,9 
A,B,C,D,E,F 



PAGE 30 / MAY 1988 



ANALOG COMPUTING 



REVIEW 






MICROMOD Turbobase 



MICROMISER SOFTWARE 
1635-A Holden Avenue 
Orlando, FL 32809 
1-800-451-4944 
48K Disk $159.95 

by Steve Panak 

It's not often that companies send me 
their software, just begging to have it 
evaluated — especially small companies. 
(Perhaps I have somewhat of a bad repu- 
tation. I prefer to think I'm simply a very 
demanding consumer.) But such is the 
case here. What's more, the package came 
with a challenge; It demanded to be evalu- 
ated, not against other Atari software, but 
against PC/MS/DOS software. Well, so be 
it. 

Surprisingly enough, MICROMOD Tur- 
bobase stacks up pretty well against its 
competition. It proclaims to be not just 
a database, but a fully integrated software 
package. It further boasts the largest and 
most efficient storage capacity of any 
Atari program, thus removing the need for 
disk swapping during normal operation 
(although you will have to switch disks 
when moving to a different module). 

To accomplish these miracles, howev- 
er, the program is very difficult to use. So 
difficult to use, in fact, that I foimd it a 
nearly insurmountable burden just to test 
its most basic features — and I am no nov- 
ice. I use a number of PC/MS/DOS appli- 
cations, and have never seen a program 
this hard to learn. It is closer in its degree 
of difficulty to learning a new language. 
But test it I did, mainly by stepping 
through the program's tutorial. 

At the core of the program is a power- 
ful database. What really threw me is that 
it seems to be structured — at least as far 



as the user is concerned — much different- 
ly than other DBs I've used. (Other DBs 
are menu driven to a much greater extent.) 
In MICROMOD, there are no simple 
prompts requesting the user to initialize 
new fields, no screens in which to enter 
new records. 

But once I started in, I found the pro- 
gram stored information quite efficient- 
ly. Upon booting the package, you find 
yourself at the main menu, where you 
may begin entering records. The most im- 
portant file is the NAJvIES file. It contains 
the names, addresses and phone numbers 
of all your contacts. Each is identified by 
a unique keyword, or abbreviated name, 
typically four letters in length. To enter 
these records, simply type PUT, then the 
keyword. At the succeeding prompts 
you'll enter the full name, address and 
phone number. 

Once this file is complete, its informa- 
tion is used in the many other files of the 
program, saving storage space and auto- 
matically filling in information. Invoic- 
ing, Inventory and payroll functions are 
all supported in the "Dated Records" pro- 
gram, which is basically a standard data- 
base manager. As you produce invoices, 
item descriptions can be automatically 
printed from other files, such as invento- 
ry. The payroll fimction will support all 
standard deductions, as well as print the 
checks for you. 

Numerous reporting features are in- 
cluded, so that you can view your infor- 
mation in any manner you wish. Foiu: 



simple preset formats are available, and 
you can create and store additional report 
formats containing any of the fields in 
your database. A general ledger feature 
keeps track of your financial data, and a 
simple word processor helps you get your 
message across. 

The program is supplied on three 
double-sided disks, which are not copy 
protected. After about 30 days, you will 
be prompted to enter an authorization 
code, which can be obtained from Micro- 
Miser. The program continues to work for 
about thirty days after you supply this 
prompt, so no lapse in service should 
occur. 

For those interested in statistics, the 
program capacities are quite large, con- 
sidering they operate on these machines. 
Depending on whether you have a single- 
or double-sided disk drive, you can store 
5,000-10,000 general ledger entries, 1,500- 
3,000 addresses, 700-1,400 invoices, and 
up to 4,000 inventory items. While this 
might not be sufficient capacity for Gener- 
al Motors, it will satisfy most small busi- 
ness needs. 

The manual is the largest I've ever seen 
for any Atari program. In fact, it's one of 
the largest manuals I've ever seen for any 
software. At over 400 pages — and weigh- 
ing a couple of pounds — it is a lot to read 
through and lug around. Fortunately, a 
"cookbook" is provided to help the new 
user become familiar with the main fea- 
tures and commands. Indexing is not too 
bad, although it is still rather hard to find 



ANALOG COMPUTING 



MAY 1988 / PAGE 31 



E3 Review continued 



the answers to most questions without 
reading quite a bit. On-line help is nonex- 
istent, although the on-screen menus and 
prompts are sometimes useful. Customer 
support is good — only a phone call away 
— and updates crop up more often than 
any other program on the market. 

The problem here is not the software, 
but the hardware it's designed to run on. 
Currently, PCs are the fastest and most 
popular business computers. I would find 
it very hard indeed to recommend that a 
small business use an Atari over a PC. The 
Atari just doesn't have a lot of memory, 
and expanding the memory on one is 
hard — and expensive. 

The Atari is a great home computer. It 
plays games very well, and offers rudi- 
mentary word processing and database 
functions. But this program is simply too 
complex to store recipes or a Christmas 
card mailing list. Of course, if you're 
thinking of running a business through an 
Atari, and desire a powerful database pro- 
gram, MICROMOD is yom- best choice; 
and if you want an integrated package, it's 
your only choice. Just be prepared to 
spend a lot of time learning to use it. H 

Steve Panak is a Trust Attorney and a 
free-lance writer living in northeastern 
Ohio. He holds a B.S. in B.A. and a j.D. 
He currently oversees computer opera- 
tions in his department, where he de- 
velops software to teach complex legal 
concepts. In his spare time, he enjoys 
computer games. 



We Want 
Letters 

The fate of Video Game Digest, 
ANALOG Computing's magazine- 
within-a-magazine, is in your hands. 
If you want a monthly video game 
magazine, with reviews, news and 
insights into the fast-changing world 
of cartridge games, write and tell us 
so. 

We'd like to hear from readers on 
every aspect of video gaming, and 
want to know what you'd like to see 
in Video Game Digest. 



ULTIMATE 
STORAGE 

Here s the perfect way to organize your ANALOG Computing library- 
sturdy, custom-made binders and files in deep blue leatherette with em- 
bossed silver lettering. Silver labels are included to index by volume and 
year. One binder or a box-style file is all you'll need to accommodate 
12 issues (1 year) of ANALOG Computing— all the games, programs, 
tutorials and utilities that you want handv. 




Tlie ANALOG Computing binder opens flat for easy reading and refer- 
ence. They're economically pnced at only $9.95 each~3 binders for 
$27.95 or 6 binders for $52.95. 

The ANALOG Computing file is attractive and compact, holding 12 
issues for easy access. Files are available for only $7.95 each— 3 files 
for $21.95 or 6 files for $39.95. 

Add $1.00 per case/binder for postage and handling. 
Outside U.S., add $2.50 per case/binder — U.S. funds only. 



i enclose my check or money order in the amount of $_ 

Send me: ANALOG Computing files 

ANALOG Computing binders. 



PLEASE PRINT. 



Name: 



Address: (No P.O. Boxes) . 
City: . 



state: . 



. Zip Code: 



Send your order to: 



Jesse Jones Industries 

DEPT. ACOM, 499 East Erie Ave,, Philadelphia, PA 19134 
Call Toll Free 1-800-972-5858 — 7 days, 24 hours 

Charge orders only, minimum $15.00 

PA residents, add 6% sales tax 

Satisfaction guaranteed or money refunded. 



PAGE 32 / MAY 1988 



ANALOG COMPUTING 



ST REVIEW 



w 



4 



Breakers 



by Rod Smith, Joe Vierra and William Mataga 

BRODERBUND SOFTWARE, INC. 

17 Paul Drive 

San Rafael, CA 94903 

All resolutions $44.95 



by Steve Panak 



If you've followed my rantings and rav- 
ings over the past few years, you proba- 
bly know that my favorite type of game 
is interactive fiction. This could be due 
to my love of the written word, although 
others, less compassionate than myself, 
would attribute this affection (or is it an 
affliction?) to some depraved side of my 
nature. Regardless of the cause, I still love 
getting into the story. 

Breakers from Broderbund is just the 
game I've been waiting for. A new entry 
into the ever-growing interactive fiction 
market, this game also defines new stan- 
dards for ease of use. Although program 
design is a major consideration in any 
piece of software, the most important as- 
pect of these games is the story. And in 
this department. Breakers doesn't dis- 
appoint. 

The term Breakers refers to the galac- 
tic outcasts inhabiting the Nimbus Colo- 
ny and the planet Borg below. These are 
the riffraff, criminals whose major occu- 
pation is smuggling. Their wares: slaves 
and narcotics. Although Borg is a mining 
planet, little ore has left the planet in 
years. The two leaders of the Breakers— 
both former Federation agents— have had 
a falling out, and are struggling for con- 
trol of the operation. Rumor has it that an- 
other Federation agent has appeared on 
the scene. The main question is whether 
you feel up to the task ahead. 



From this point, as in all works of inter- 
active fiction, you're in control. Breakers 
features an advanced parser that under- 
stands over 1200 words, in both simple 
and complex sentences. You can easily 
converse with other characters, as well as 
move through rooms and examine ob- 
jects. The Breakers universe unfolds in 
front of you, with events happen- 
ing regardless of how you react. Special 
commands allow you to control the speed 
at which time passes or to save your po- 
sition in the novel (the BOOKMARK 
command). 

My favorite feature of this game is the 
fact that it doesn't take over the display. 
It leaves the desktop, with all its acces- 
sories intact, then adds a few of its own 
options. In playing text adventures, typi- 
cally all your time is spent hunched over 
the keyboard typing in commands. In this 
game, however, pull-down menus free you 
from having to type and retype the most 
often used commands, allowing you to 
click on them instead. And you can easi- 
ly add to these commands, and modify 
them throughout the game as your needs 
change. But, despite excellent program 
design, there is a major flaw. 

Although I was able to issue commands 
rapidly using the various menus, all 
seemed for naught when I had to wait a 
lengthy amount of time for the response 
to most of my commands. The ST has over 
500K, right? The disk, a max of 360? 
Then what's the problem? Most of the text 



should be able to reside in memory, allow- 
ing instant response. Aside from the fre- 
quent disk accesses, the program itself 
seemed to run slowly, sitting and think- 
ing after each sentence input. 

The documentation is good: a nice 
booklet, seventy pages in length, that pro- 
vides background story, a partial list of 
commands, room for notes, and pages of 
nice illustrations. A separate reference 
card holds machine-specific instructions. 
The entire package was well thought out 
and put together. The prose rivals any 
similar game on the market, with vivid 
descriptions and lively characters. 

Despite a few shortcomings. Breakers 
breaks new ground in software, especial- 
ly in interactive fiction. Its story line is 
interesting, its characters engaging, and 
its puzzles challenging. Take a break from 
rim-of-the-mill software; break away with 
Breakers, fl 

Steve Ponok is a Trust Attorney and a 
free-lance writer living in northeastern 
Ohio. He holds a B.S. and a J.D. He cur- 
rently oversees computer operations in his 
department, where he develops software 
to teach complex legal concepts. In his 
spare time, he enjoys computer games. 



ANALOG COMPUTING 



MAY 1988 / PAGE 33 



48K Cassette or Disk 



EDUCATIONAL GAME 



^^ 




Money 



Pouch 



A coin counting game to heip 

your cliiidren polisii their matliematical sicills 



by Chuck Rosko 



Money Pouch is a one-player educational game to help 
children become familiar with the concept of money. The 
game begins when Kiki, a baby kangaroo, is captured by 
the zookeeper. Kandy, Kiki's mother, must pay the zookeeper 
in order to free her baby This is done by knocking out the 
correct combination of coins (peimies, nickles, dimes, quart- 
ers and half-dollars) to pay the zookeeper's fee. 
Options 

After booting up, in the upper left corner of the screen 
you'll see a 25 displayed. This is the greatest amount of mon- 
ey the zookeeper can ask for. If you choose 25, the zookeep- 
er's price can vary from 1 cent to 25 cents. Changing this 
range can be accomplished by pressing the OPTION key. 
There are four different ranges to choose from. 

You'll also see the word EASY displayed. This is the dif- 
ficulty level, or how much time Kandy has to pay the fee. 
There are three difficulty levels, with EASY giving you the 
longest amount of time. Press SELECT to change the level 
and press the START key to begin playing. 

Playing Money Pouch 

Displayed at the top of the screen are your current score, 
the zookeeper's price and the bonus clock. Below these are 
five columns, each containing a different coin. Below the 
colimins are five buckets, each labeled with the value of one 
of the coins. The order of the buckets is chosen randomly 
at the beginning of each round. Next to them is the waste 
bucket labeled 3. You have three chances to rescue Kiki. 
Underneath the waste bucket is Kandy's money total. You 
can use an unlimited number of coins. 



Your goal is to free Kiki as quickly as possible. There's 
a bonus clock located in the upper right corner of the screen. 
This clock decreases in increments of 5 during each prob- 
lem. The rate at which it decreases depends upon the dif- 
ficulty level you've chosen. If the clock reaches zero, you'll 
lose one hfe. Once the zookeeper is paid, the points cur- 
rently in the bonus clock are added to your score. There- 
fore, you'll earn more points if you use fewer coins and as 
little time as possible. The clock is reset to 50 for each new 
problem. 

Your joystick moves Kandy left or right. To knock out a 
coin, push your joystick forward (north]. The coin will then 
roll back and forth along the ramp above the buckets. (You 
can only knock out one coin at a time.) Now you must drop 
the coin into the bucket that matches the monetary value 
of that coin ( i.e., nickle in "05" ). 

Press the trigger button when the coin is over the cor- 
rect bucket. If the correct coin is chosen, it will be added 
to Kandy's total. When Kandy's total exactly matches the 
zookeeper's fee, Kiki will be released. If you drop a coin 
in the wrong bucket, the bonus clock will decrease by 5 
and the coin will pop back up so you can try again. Be 
careful— you'll lose a lot of time by trying buckets randomly. 

If you don't want to use a coin that you've knocked out, 
drop it in the waste bucket. This way the coin will be ig- 
nored, and not added to your total. If your total exceeds the 
zookeeper's price, you'll lose one life. H 

Chuck Rosko is a microbiologist from Pittsburgh, Penn- 
sylvania. His interests include his wife and son, hockey and 
writing educational programs. 

(Listing starts on next page) 



PAGE 34 / MAY 1988 



ANALOG COMPUTING 



^^ Money Pouch continued 



The two-letter checksum code preceding the line 
numbers here is not a part of the BASIC program. 
For further information, see the "BASIC Editor II," 
in issue 47. 



Listing 1 
BASIC listing 



MN e REM KKlCXMXXlCKXlCXKXKlCKltKKXKXMKXlClCKM 

ZA 1 REM » » 

HK 2 REM » MONEY POUCH CO 1987 » 

NS Z REM * BY CHUCK ROSKO * 

MI> 4 REM * FOR ANALOG « 

ZE 5 REM » * 

WT 6 REM XXXXKXXXKMXXXXXXXXXXXXKXXXKXXM 

ZJ 29 GRAPHICS 17:DIM XD C15) , AAS t3GJ , BBS ( 
30 J , ZZ$ C32J , TT$ C57J , PRS t5B J , COLS tl5 J , D 
EKC4) 

JE 21 FOR X=5 TO 15 ! KD CXJ =3 : NEXT X:XDt7J= 
l:XDCll)=2:DEKC0J=l;DEKtl)=5:DEKI2J=ie 
!DEKC3J=25;DEKC4J=5B 

UM 22 XDC14)=4:JJ=0:KK=l:LL=2:NN=3:XZ=28B 
! PT=23B : TP=29210 : XYZ=235 : ZL=1B : 0=6 : ST= 
16:PZA=218:P0KE 559,JJ!G0T0 19888 

UU 20B SOUND JJ| 298, 11, NN : GOSUB 246:RETUR 

LD 285 POSITION Q,28:? tt6;" ": POSIT 
ION Q,21:? tt6;" -rPOSITION Q,22: 
? »6;" " 

FN 286 POSITION 0,22!? tt6;" "rRETUR 

^ 

CB 219 SOUND JJ, 0, ZL, 14 : SOUND KK,8,ZL,14: 

GOSUB 246: RETURN 
JG 215 FOR Z=14 TO JJ STEP -l! SOUND JJ,Z» 

13,ZL,Z:NEXT Z:RETURH 
TC 228 FOR Z=7 TO 14 : SOUND JJ, 48»Z/HN, 14- 

Z,14-Z!HEXT ZIRETURN 
CG 238 A=USRCADR(TT$J, PAUSE) tRETURN 
QC 235 FOR D=KK TO ZL:SOUND JJ,ZL»D, ZL,ZL 

-D:NEXT D: RETURN 
GC 248 TIME=LEUEL-INTCtPEEKt291+256»PEEKt 

19J)/68):IF TIME<=JJ THEN 258 
ZV 245 RETURN 
UN 246 SOUND JJ, JJ, JJ, JJ : SOUND KK,JJ,JJ,J 

J: RETURN 
HN 258 BNS=BNS-5:P0SITI0H ST,KK!? «6;" " 

:POSITION ST,KK:? tt6;BNS:IF BNS=JJ THE 

N 4888 
TJ 255 POKE 19,JJ:P0KE 2e,JJ:G0SUB XYZlGO 

SUB XYZ:RETURN 
JM 268 POKE 19,JJ:P0KE 28, JJ 
ZF 388 COR=INTCRNDCJJJ*LIMITJ+KK!lF C0R=1 

99 THEN POSITION 9,KK:? tt6; "1 . 88" : GOTO 
338 
UW 318 POSITION 9,KK:? «6;"8"!lF COR<ZL T 

HEN POSITION 11, KK:? «6; "O" : POSITION 1 

2,KK:? «6;C0R:G0T0 338 
NC 328 POSITION 11, KK:? tt6;C0R 
IP 338 X1=64:F0R KQ=1 TO 16 : A=USR (MOVE, JJ 

, PMB, BOD CJJ) , HI, 62-KQ, KQJ : A = USR (MOUE, K 

K,PMB,TAILCJJJ,Xl-8,62-KQ,KQ) 
HK 332 NEXT KQ:Y1=46 

FF 1888 JzSTICKCJJ) :G0SUB 248;G0SUB XZ 
BD 1881 IF TIME=5 THEN POSITION Q,21:? UB 

...HELP " 
HK 1982 IF TIME=NH THEN POSITION Q,21:? » 

6;" 
AU 1838 PAUSE=ZL:0N XD C J} GOTO 1850,1199, 

1150,1298 
LX 1850 Xl=Xl+12iIF Xl>168 THEN Xl=168 : GO 

TO 1088 
PM 1968 Yl=Yl-8:A=USRtM0UE,KK,PMB,TAILCJJ 

),X1-8,Y1,ST) !A=USRCMOUE,JJ,PMB,BODCJJ 

), XI, VI, ST) :GOSUB 215 



NF 1978 Yl=Yl+8:Xl=Xl+12:A=USRtM0UE,KK,PM 
B,TAILCJJ),X1-8,Y1,ST) : A=USR (MOVE, JJ,P 
MB,B0DCJJ},X1,Y1,ST) :GOTO 1988 
UB 1188 X1=X1-12:IF XK64 THEN X1=64:G0T0 

1888 
UJ 1118 Y1=Y1-8:A=USR (MOVE, KK, PMB, TAIL (KK 
) ,X1+8,Y1,ST) :A=USR(MOyE, JJ,PMB,BODCKK 
),X1,Y1,ST) :GOSUB 215 
UG 1129 Yl=Yl+8 : X1=X1-12 : A=USR (MOUE, KK, PM 
B, TAIL (KK) , Xl+8 , Yl , ST) : A=USR (MOUE, J J , P 
MB,B0D(KK),X1,Y1,ST) :GOTO 1988 
PK 1158 A=USR (MOUE, KK, PMB, TAIL (JJ),X1-8,Y 
1,ST) :A=USR(M0UE,JJ,PMB,B0D(JJ),X1,Y1, 
ST) :GOTO 1880 
LS 1288 POKE 786, 72: IF Xl=64 THEN COIN=KK 

: RESTORE 1291: GOTO 1238 
DK 1295 POKE 786,14:IF Xl=88 THEN C0IN=5 : 

RESTORE 1292: GOTO 1238 
MI 1218 IF Xl=112 THEN COIN=ZL : RESTORE 12 

93: GOTO 1238 
FX 1215 IF Xl=136 THEN C0IH=25 zRESTORE 12 

94: GOTO 1238 
BG 1228 IF Xl=16e THEN C0IH=5e ; RESTORE 12 

95 
YP 1238 FOR Yl=46 TO 26 STEP -4 : A=USR (MOU 
E, KK, PMB, TAIL (JJ) , Xl-8, Yl, ST) : A=USR (MO 
UE,JJ,PMB,B0D(JJ),X1,Y1,ST) ^„„,.„ 
SF 1248 SOUND JJ, Y1«NN,ZL, 4 : NEXT Yl : GOSUB 
228: FOR Yl=26 TO 46 STEP 4:A=USR(M0UE 
,KK, PMB, TAIL(JJ), Xl-8, Yi,ST) 
IC 1258 A=USR(M0UE,JJ,PMB,B0D(JJ),X1,Y1,S 
T):S0UND JJ,Y1»3,ZL,4:NEXT Y1:G0SUB 24 
6 : Yl=46 : X2=Xl+8 : C= J J 
DA 1268 FOR Y2=38 TO 63 STEP NN : A=USR (MOU 
E,LL,PMB,BALL(C),X2,Y2,Q):C=C+KK:IF C> 
MM THEN C~JJ 
NX 1278 NEXT Y2: GOSUB PZA : Y2=63 : PAUSE=5 
DH 1289 READ X2,C:IF X2=-l THEN GOSUB 218 

•GOTO 1386 
ON 1298 A=USR(M0UE,2,PMB,BALL(C),X2,Y2,Q) 

: GOSUB PT: GOSUB XZ : GOTO 1288 
RD 1291 DATA 89,1,88,2,96,3 
KC 1292 DATA 184,8,112,1,129,2 
XB 1293 DATA 128,3,136,9,144,1 
ZU 1294 DATA 152,2,169,3,168,8 
SB 1295 DATA 176,1,184,2,192,3,-1,-1 
XS 1398 A=USH(M0UE,LL,PMB,BALL(NN),192,71 

,Q): GOSUB PZA: RESTORE 2079 
DX 2999 IF STRIG(JJ)=JJ THEN 2199 
HZ 2929 IF X2=176 THEN POSITION Q,21:? tt6 
; "HURRY" : A=USR (MOUE, NN, PMB, BAB, 76, 98, 1 
1) :GOTO 2848 
CK 2839 IF X2=89 THEN POSITION Q,21:? tt6; 
" ":A=U5H(M0UE,NN,PMB,BAB,68,98,11 

GM 2949 READ X2,C:IF X2=-l THEN RESTORE 2 
979: GOTO 2040 

BH 2069 A=USH(M0UE,LL,PMB,BALL(C),X2,71,Q 
) :PAUSE=5:G0SUB PT:GOSUB XZ:IF X2=56 
R X2=192 THEN GOSUB PZA: GOSUB 248 

OM 2065 GOTO 2088 

UA 2878 DATA 184,2,176,1,168,8,168,3,152, 
2,144,1,136,8,128,3,128,2,112,1,184,8, 
96,3,88,2,88,1,72,8,64,3,56,2 

YG 2889 DATA 64,3,72,9,88,1,88,2,96,3,184 
,8,112,1,128,2,128,3,136,8,144,1,152,2 
,168,3,168,8,176,1,184,2,192,3,-1,-1 

NG 2199 IF X2=64 THEN BKT=DEK (JJ) : GOTO 21 

SM 2119 IF X2=88 THEN BKT=DEK (KK) : GOTO 21 

70 
CM 2128 IF X2=112 THEN BKT=DEK (LL) :GOTO 2 

KH 2136 IF X2=136 THEN BKT=DEK (NN) : GOTO 2 

i7fl 
UU 2148 IF X2=166 THEN BKT=DEK (4) : GOTO 21 

70 
JG 2156 IF X2=184 THEN BKT=8:G0T0 2178 



ANALOG COMPUTING 



MAY 1988 / PAGE 35 



OU 2160 GOTO 2828 

HI 2178 POKE 623,4:C0L0R 168 : PLOT 1X2/81- 
6,15: flrUSR tMOWE, LL, PMB, BftLL CCJ , X2, 82, Q 

JN 2188 GOSUB PZA ; PAUSE=ie8 : IF BKT=COIN T 

JS 2198 IF BKT=8 THEM 2238 

YO 2218 POSITIOM 0,28!? tt6 ! " mJTTg l" ! POSTTT 

OH 0^21:? »6;"[atnaj3": POSITION 0,22:? 

tt6;"CliE": GOSUB PT:G0SUB 258 
DM 2228 ft=USR(M0VE,LL,PMB,BALLCCJ,X2,75,Q 

):G0SUB PZA:C0L0R 134:PL0T tX2/8)-6,i5 

:P0KE 623,KK:G0SUB 2e5:G0T0 2888 
RE 2238 POSITION Q,21:? tt6;"0H MOM'MGOSUB 
PT:COLOR 134:PL0T 17,15:P0KE 623,KK:G 

HI 2248 ft=U5RtM0UE,LL,PMB,BftLLCC),28,75,Q 
1: GOSUB 248: GOTO 1888 

TD 2388 COL$ (11, 111 ="a":PAUSE=3e: GOSUB PT 

!COLStll,llJ="y" 
WR 2385 POSITION Q,2l!? tt6;"0H BOY ":fl=US 

RCMOUE,LL,PMB, BALL CCl, 28,75,01 !FOR Z=G 

ES TO GES+C0IN:D0L=INTCZ/ie81 
PQ 2318 POSITION 15,28:? tt6; DOL : CENT=Z- CD 

OLKlOei 
5K 2311 IF CENT<ZL THEM POSITIOM 17,28:? 

«6;"e"!PeSITI0N 18,28:? «6;CENT:G0Te 2 

338 
UQ 2328 POSITIOM 17,20:? tt6;CEMT 
JP 2338 GOSUB PZA:NEXT Z:POSITIOM 0,21:' 

«6;" ": COLOR 134: PLOT {X2/81-6,i5 

:P0KE 623,KK:GES=GES+C0IN 
UR 2335 IF GES=C0R THEN 6888 
SU 2348 IF GES>COR THEM 4888 
MK 2358 GOTO 1888 
RC 4888 A=USRCMOUE,LL,PMB, BALL (01, 26,78,0 

l:COLOR 134:PL0T (X2/81-6,15 
EP 4885 GOSUB 285: POSITION 0,21:? tl6;"BYE 
BYE": POKE 623, KK: FOR Vl=46 TO 150 STE 
P 8 
AM 4886 A=U5R (MOVE, KK,PMB, TAIL (JJ1,X1-8,Y 

UT 4818 A=USR(M0U>E,JJ,PMB,B0D(JJ1,X1,Y1,S 

Tl:SOUMD JJ,V1,ZL,4:NEXT Yl : GOSUB 228; 

R00=R00-1: COLOR le+ROO : PLOT 17,17 
PL 4828 PAUSE=3ee: GOSUB 285:IF ROO=JJ THE 

N 5088 
N" 48 48 I F BNS=JJ THEM POSITION 0,28 : ? tt6 

;"iiilll": POSITION 0,21:? l»6;"QECl": POSIT 

ION 0,22:? tt6;"[il!i]": GOSUB PT:GOTO 4090 
II 4858 POSITION 0,28:? «6; "total" : POSITI 

°Jln^x2l:? »6;"iini]": POSITION 0,22:? tt6j 

"ffiOai" ! GOSUB PT 
LB 4898 POSITIOM 0,28:? tt6;"TRY "! POSIT 

ION 0,21:? tt6; "AGAIN": POSITION 0,22:? 

tt6; "MOMMY": GOSUB PT 
AD 4188 GOSUB 285:P0SITI0N ST,KK:? tt6;"58 

":POSITIOM 15,28:? tt6;"8.8e":BNS=58:P0 

KE 19,JJ:P0KE 19,JJ:P0KE 28,JJ:GES=e 
PH 4181 GOTO 338 
DD 5880 PAUSE=288:G0SUB PT : POSITIOM 5,13: 

? tt6;"GAME 0UER":G0SUB PT:C0L0R 160 : P 

LOT 8,l:DRAMT0 19,1:PL0T 8,2 
SS 5881 DRAHTO 19,2 
TQ 5010 GOTO 29018 
IT 6888 PAUSE=188: GOSUB PT : M=JJ : PAUSE=20 : 

POSITIOM 0,28!? tt6; "MOMMY": POSITION 0, 

22:? »6;"DID IT": FOR Z=KK TO 7 
DG 6818 C0L$(4,4]=CHR$(184-ie4KMl :C0L$(12 

,121=C0L$(4,41 :SOUND JJ, 81+M)f40, ZL, ZL : 

GOSUB PT;M=-l*M+l:NEXT Z: GOSUB 246 
YX 6028 GOSUB 2e5:GES=JJ : POSITION 0,19;' 

»6;"KIKI";F0R D=KK TO : A=USR (MOVE, jj, 

PMB, BOD (KKl , 128, 94-MK8, STl 
OL 6838 A=USR (MOVE, KK,PMB, TAIL (KKl, 136, 94 

-M»8,ST1 :M=-l»M+l! GOSUB 215:G0SUB PT:M 

EXT D 



US 6048 POSITION 0,19:? tt6; "MOMMY" : FOR D= 

1 TO 6:A=USR(M0yE,NN,PMB,BAB,112,98-IW 

0,111 :GOSUB 215;G0SUB PT:M=-1«M+1 
ZD 6188 NEXT D : POSITION 0,19:? »6;" 

":SC=5C+BN5:IF 509995 THEM POSITIOM K 

K,KK:? tt6;"0 " 
PW 6118 POSITION KK,KK:? tt6;SC;G0SUB XYZ; 

BNS=5e; POSITION ST,KK:? «6; "58" : POSITI 

ON 15,28:? tt6;"8.88" 
JM 6128 M=JJ:PAUSE=38:F0R Z=KK TO ZL:COLO 

R 126+M!PL0T 9,19 
GA 6140 GOSUB PT:M=-1KM+1 :NEXT Z:PAUSE=28 

8:G0SUB PT:C0L0R 16e:PL0T 9,19 
IH 6158 POSITION 0,28;? tt6; "11 LL" : PBSITIO 

M 0,21:? tt6; "SAVE": POSITION 0,22:? »6; 

KX 6208 A=USR(M0UE,MM,PMB,BAB,68,98,111 :P 

AUSE=388: GOSUB PT:GOSUB 285 !PAUSE=ie8 ; 

GOSUB PT:G0T0 268 
VT 19888 REM _AsseMbl!/ code 
LI 19818 RESTORE 19815:F0R 1=1 TO 32 : READ 

A ; ZZ$ (II =CHR$ (Al : NEXT I 
DC 19815 DATA 184,184,133,284,184,133,283 

,184,133,286,184,133,285,162,4,168,8 
RH 19828 DATA 177,283,145,285,136 288^249 

,238,284,238,286,282,288,248,96 
HC 19838 POKE 186, PEEK (1061 -5 : GRAPHICS 17 

: START= (PEEK (1861 +11«256 : POKE 752, 1 
GP 19835 A=USR (ADR (ZZSl, 57344, STARTl :A=US 

R(ADR(ZZ$1, 57344, START+5121 :RESTORE 25 

888 
CO 19848 FOR X=8 TO 584 STEP 8: FOR Y=e TO 
7:READ Z:POKE X+Y+START, Z ; NEXT Y!MEXT 

FI 19845 GRAPHICS 17:P0KE 756, PEEK (1861 +1 

:GOTO 25858 
■"^ 2^2^2^'>**Tft 0,8,8,8,8,8,8,8,68,126,251, 

253,253,251,126,68,8,182,182,182,8,8,8 

IX 25882 DATA 4,4,4,4,4,4,4,4,32,32,32,32 

,32,32,32,32,8,8,8,8,8,255,8,8 
AL 25084 DATA 8,8,255,8,8,8,8,8,8,8,8,8,8 

,7,4,4,4,4,7,8,8,8,8,8 
LM 25886 DATA 8,0,0,8,8,224,32,32,32,32,2 

24,8,8,8,8,8,32,32,32,32,32,63,8,8 
MD 25888 DATA 4,4,4,4,4,252,8,8,8,8,255,7 

3,146,255,8,8,8,8,8,8,8,24,24,8 
ZI 25818 DATA 7,7,7,7,7,7,7,7,127,99,99,9 

9,99,99,127,8,56,24,24,24,62,62,62,8 
OK 25812 DATA 127,3,3,127,96,96,127,8,126 

,6,6,127,7,7,127,8,112,112,112,112,119 

,127,7,8 

CK 25814 DATA 127,96,96,127,3,3,127,8,124 
,188,96,127,99,99,127,8,127,3,3,31,24, 

NG 25ei6'DATA 62,54,54,127,119,119,127,8, 

2i^;li&!l§i?^5^''''''''^"'"''"^'^^^' 

MH 25818 DATA 255,255,255,8,8,8,8,8,231,2 
31, 231, 231, 231, 231, 231, 23i;231, 231, 231 
,8,8,8,8,8 

NO 25828 DATA 224,224,224,224,224,224,224 
,224,8,36,126,188,126,38,126,36,8,8,12 
6,184,184,126,8,8 

IR 25022 DATA 63,51,51,127,115,115,115,8, 

iil;9if9l?i9t!27tr'"''""'''"''"^' 

SA 25824 DATA 126,182,182,119,119,119,127 
,8,127,96,96,127,112,112,127,8,127,96, 
96,127,112,112,112,8 ' 

JD 25026 DATA 127,99,96,111,183,183,127,8 
,115,115,115,127,115,115,115,8,127,28, 
28,28,28,28,127,8 

"^ l^H% ^SI''-^^, 12, 12, 14, 14, 118, 126, 8, 10 
2,102,108,127,183,183,183,8,48,48,48,1 
12,112,112,126,8 

'*'- ^l^^ft^^^^'* ^03, 127, 127, 119, 183, 183, 183 
,8,103,119,127,111,183,183,183,8,127,9 



PAGE 36 / MAY 1988 



ANALOG COMPUTING 



^^ Money Pouch continued 



9,99,193,103,193,127,9 
ZM 25932 Dflffl 127,99,99,127,112,112,112,9 

,127,99,99,193,193,193,127,7,126,192,1 

92,127,119,119,119,9 _^ ^ ^^ „ 

GL 25034 DftTft 127,96,127,3,115,115,127,9, 

127,28,28,28,28,28,28,9,103,193,193,19 

KU 25936'DflTft 193,193,193,193,111,62,28,9 

, 193, 193, 193, 111, 127, 127, 193, 9, 115, 115 

,115,62,103,193,103,0 
FZ 25038 DflTft 103,103,103,127,28,28,28,0, 

224,224,224,0,0,0,9,9,7,7,7,9,9,0,0,0 
LR 25040 DflTft 36,36,36,36,36,36,36,36,0,6 

0,60,12,24,0,0,9,192,231,255,255,126,6 

KC 25942 DflTft 9,35,126,126,69^4,9^9 
UM 25059 TT$ tl) =''hh[3:>gUU^C^ 

E5 25970 TT$ (46) =''SI3jy[lHji/Tltl*'' 

CM 26035 RESTORE 26036:FOR X=l TO ISlREAD 

Z:C0L$(K,X)=CHRSCZJ!NEXT K 
OE 26036 DftTfl 140,90,27,104,0,88,182,73,1 

5,0,129,194,200,90,0 
GN 26040 RESTORE 26041: FOR X=l TO 46: READ 

Z:PRSCX,X)=CHRSCZ):HEXT X „ „ ,„ 
CB 26041 DftTfl 72,138,72,152,72,162,0,173, 

11,212,291,7,249,3,174,214,89,169,9,18 

9,223,89,153,22,298,232,299 
JZ 26942 DflTft 192,5,298,244,142,214,89,19 

4,168,194,179,194,64,9,15,2,3,4,5 
PP 26959 PzftDRtPRSJ :PHI=INTtP/'256) :PL0=(P 

-PHI»255J :C=flDRCCOLSl : CHI=IHT CC/256) :C 

L0=CC-CHI»256J 
LT 26060 PR$t21,21)=CHRStCL0) :PR$I22,22)= 

CHR$ CCHI) : PXHirlKT t CP+41) /256) : PXLO= (P 

+41)-CPXHI»256J ^ ^,,^ ^^, 

PE 26070 PRS(ST,STJ=CHRStPXLOJ !PRSC17,171 



=CHRS (PXHI) : PRS C33, 33) =CHRS CPXLO) : PRS C 

34,34)=CHRSCPXHI) ^ ^ 

KB 26080 POKE 512, PLO: POKE 513, PHI: POKE 5 

4286,192 
KE 26090 DL=PEEK (560) +256*PEEK C561) : POKE 

DL, 112+128: POKE DL+7, 134: POKE DL+20,13 

UY 28000 REM KMKKKKXK PM ROUTINE «***» 
GF 28010 DIM PMMOUS(10O),BflLL(4),TftIL(MM) 
, BOD (MN) , BODOS (ST) , BODlS (ST) , TftILO$ (ST 
) , TfllLlS (ST) , BflB$ (11) , BflB (11) 
SM 28015 DIM BflLLOS (Q) , BflLLi$ (0) , BflLL2S(Q 
),BALL3$(Q] :MOUE=flDR(PMMOUS) :BOD(JJ)=ft 
DR(BOD0S) :BOD(KK)=flDR(BODl$) 
LU 28017 TflIL(JJ)=flDR(TflIL0S) :TflIL(KK)=ftD 

R (TftILl$) : BALL (J J) =flDR (BALL0$) 

PJ 28019 BftLL(KK)=ftDR(BflLLlS) :BALL(LL)=ftD 

R(BflLL2$) :BflLL(MM)=ADH(BftLL3$) :BflB=flDR 

(BflB$) :REST0RE 28030 . . „ 

GR 28020 FOR X=l TO lOOlREAD Z:PMMOU$(X,X 

)=CHR$(Z) :HEXT X:G0T0 28100 
GQ 28030 DATA 216,104,104,104,133,213,104 
,24,105,2,133,206,104,133,205,104,133, 
204,104,133,203,104,104,133,208 
YH 28035 DATA 104,104,133,209,104,104,24, 
101,209,133,207,166,213,240,16,165,205 
,24,105,128,133,205,165,206,105 
HB 28040 DATA 0,133,206,202,208,248,160,0 
,162,0,196,209,144,19,196,207,176,15,1 
32,212,138,168,177,203,164 
GY 28045 DATA 212,145,205,232,169,0,240,4 
,169,0,145,205,200,192,128,208,224,166 
■ ?i:t. 165 .288 .157. 0.2 08, 96 
NP 28100 BOD0S="CBpfiilSGCnLEHagt8"!TAIL0$= 

JjA":TAILlS = "0e-^ -f-TTTT^jT-.l 

KT 28105 BAB$="p\ 



|*-:[illf ":BALL0S="<vn3v 



ATARI USERS' GROUPS 



Northwest Phoenix Atari Conneotion (NWPAC) 
SouthEast Vallet Atari Connection (SEVAC) 

P.O. Box 36364, Phoenix, AZ 85067 

Meetings; BBS; newsletter; Nibbles & Bytes 

President (NWPAC) - Steve Marshall 

President (SEVAC) - Tim Barr 
Pasadena Area Local Atari Computer Enthusiasts (PALACE) 

RO. Box 1771, Arcadia, CA 91006 

Meetings; BBS; newsletter 
San Diego Atari Computer Enthusiasts (SDACE) 

PC. Box 203076, San Diego, CA 92120 

Meetings; BBS; newsletter; The I/O Connector 

President - David Delgadillo 
New Orleans Atari Users' Group (NOAUG) 

RO. Box 73236, Metairie, LA 70033 

Meetings; newsletter; President - Dave Porter 
Twin Cities Atari Interest Group (TAIG) 

RO. Sox 26128, Minneapolis, MN 55426 

Meetings; newsletter 
South Jersey Atan Computer Enthusiasts (SJACE) 

1548-A Cedar St., Ft. Dix, NJ 08640 

Meetings; newsletter; ConnectI 
Brooklyn Atari Society for Information 
and Communication (BASIC) 

c/o Peter J. Fazio, 2724 East 23rd St., Brooklyn, NY 11235 

Meetings; BBS; newsletter; Dateline Atari 

President - Peter Fazio 

ATTENTION USERS' GROUPS 

if you would like your organization to be listed here, send information (and newsletter, if appropriate) to ANALOG Computing 
Group Listing LFP Inc 9171 Wilshire Blvd.. Suite 300, Beverly Hills, Calif. 90210. ANALOG Computing is not responsible for errors in copy 



Atari Computer Enthusiasts of Syracuse 

c/o Vernon W. Smith, 101 Clarke St., Syracuse, NY 13210 
Meetings; newsletter; President - Ken Benson 

Tri-County Atari Users' Club (TCAUC) 

4 Circle Dr., New Breman, OH 45869 

Meetings; newsletter 

8-Bit President - Alan Dock (419) 629-2438 

ST SIG President ■ Pamela Rice Hahn (419) 394-7588 

Rushmore Atari Computer Enthusiasts (RACE) 

3711 Canyon Lake Dr. #202, Rapid City, SD 57702 
Meetings; newsletter; Race-Tracks 
President - Joe Moews (605) 348-6331 

Peninsula Atari Computer Enthusiasts (PACE) 

c/o Joe Cullen, 834 Churchhill Terrace, Hampton, VA 23666 
Meetings; newsletter; President ■ Jeff Cleveland 

Seattle-Puget Sound Atari Computer Enthusiasts (SPACE) 
RO. Box 110576, Tacoma, WA 98411-0576 
Meetings; BBS; newsletter; President - Scott McGowen 

The Toronto Atari Federation 

5334 Yonge St., Toronto, Ontario, Canada M2N 6M2 

Manitoba Atari Computer Club (MACC) 
c/o Rick Singbeil, 483 Ferry Road 
Winnipeg, Manitoba, Canada R3J 1W5 
Meetings; newsletter; President - Bruce Campbell. 



ANALOG COMPUTING 



MAY 1988 / PAGE 37 



LZ9="<fnii <" 
BM 28286 PMBASE=INTC (PEEK C145) +NN] /4]»4 : P 

OKE 54279, PMBASE:PMB=PMBASEK256: POKE 5 

59, 46: POKE 53277, MH: POKE 623, KK 
IX 28210 POKE 704, 28: POKE 705, 28: POKE 707 

I 28 
SM 29010 POSITIOM JJ,NN:? tt6;" XJ XJ XJ 
X) XJ ■■:■■ S $ $ h $ ■■;■■ i 

P$»n$ttd$ltq$tth$ ■■ 
YU 29020 POSITIOM JJ,«:? tt6:" tteSttiSttiStt 

uS»aS •■:•■ ttnSttc5tt«SttalttlS ■■;■■ Un 

MF 29030 POSITIOM JJ,9:? tt6:" ttySttlStt S« 
t$tteS •■;■■ tt $tte$tt $tteltt $ ";"'X, 
+# *, +,r+, *Y.y.i" ' 

DP 29040 POSITION JJ,12:? tt6:"tt 
$.. . nj, 1 

S" 

&&&&&&&&*";"/ :;<::<:;<::<::<■•■>■■• "/RH 
KH 29070 POSITI OM JJ. 18:? It6 ; " E; ; = ; ; = :; = ! 

; =^; =; ; ; z-^^g^gi fea^fe^.'-; ■'■* 

SE 29075 color" 134: PLOT LL,15:PL0T 5,15:P 
LOT 8,15:PL0T 11,15:PL0T 14,15:PL0T 17 
,15:C0L0R 147:PL0T 17,17 

UG 29080 POSITIOM J J, 21 : ? «6:"!I] H 

Ta^aas" ;■'[:] s total "j-n^ 



S";"lt 



RL 29090 COLOR 161:PL0T MM,4:C0L0R 129:PL 
OT 6,4:PL0T 9,4:PL0T 12,4:PL0T 15,4:A= 
USR(M0VE,MM,PMB,BflB,60,98,ll) 

SD 29200 POSITIOM JJ,JJ:? tt6;"25e MOne 
y pouch ":P0SITI0M jj.kk:? tt6:"[SBa»: 
limit=25:sc=jj:ges=jj:coim=jj ^^ 

EP 29205 BMS=50:K0=JJ:LEU=JJ:LEVEL=15:CM= 

JJ:H00=MN:REST0RE 29340 
TJ 29210 READ D,B:IF D=-l THEM RESTORE 29 

340: GOTO TP 
XU 292 20 IF D=-2 THEM POSITIOM Q,KK:? tt6: 
■^■^GOTO TP 



CJ 2 9230 ^'^^=~^_'" j|^'' POSITIOM Q,KK;? tt6; 

"■^ M^iA-iEmRs:f-^HEM POSITIOM 0,KK:? tt6; 
■■[J!]ilijK|:lia|1986" : GOTO TP 

"^ ^lll^ ^^ PEEK {53279) =Q THEM GOSUB 246: 
GOTO 29280 

SI 29255 IF PEEKC53279)=5 THEM GOSUB 246: 

GOTO 29330 
JM 29260 IF PEEK 153279) =MM THEM GOSUB 246 

:GOTO 29310 
UK 29270 SOUMD JJ, D, ZL,ZL : SOUMD KK,D+1,ZL 

, ZL:A=USR (ADR CTT9), B) : GOSUB 246: GOTO T 

HZ 2928 POSITION JJ,JJ;? tt6: "score rnfl 
33M ";" ? . 50 " 

KI 29290 COLOR 7 : PLOT 15, JJ: COLOR 5: PLOT 

16, JJ: PLOT 17, JJ: COLOR 9: PLOT 18,JJ:C0 
u^ t22„i'£'-°T 18,KK:C0L0R MN:PL0T 15, KK 
YE 29300 COLOR Q:PLOT 17, LL: PLOT ST,LL:CC 

TP 29302 POSITION JJ,17:? tt6;"/ < < < 
< '^FOR Z=JJ TO 4 

"" P?5^»^L'>^^^'=^ THEN POSITIOM KK+Z»M 

N,17:? tt6;"[IZ]":G0T0 29308 
"^^ P?2*-^'' ">EK(Z)=5 THEN POSITIOM KK+Z«M 

N,17:? tt6;"0E"!GOTO 29308 
^^ 22^?5 V '>EK(Z)=10 THEN POSITION KK+Z* 

NN,17:? »6;"EB":G0T0 29308 
^^ 52^?5 i''«?^K^'=25 THEN POSITION KK+Z« 

HN,17:? tt6;"^":G0T0 29308 
"" 22^?^ ^^ DEK(Z)=50 THEN POSITION KK+Z» 

NN,17:? »6;"a3":G0TO 29308 



PD 29308 GOSUB XYZ;NEXT Z : GOTO 260 

lY 29310 LIMIT=LIMIT+25:IF LIHITMOO THEN 

L1MIT=25: POSITION JJ,JJ;? ttOj" 
TL 29320 POSITION JJ,JJ:? ttO; LIMIT: "G" : PA) 

USE=20: GOSUB PT: GOSUB XYZ:GOTO fp 
JY 29330 LEU=LEV+KK:IF LEU>LL THEN LEV=JJ 
VU 29331 GOTO 29332+LEU 
UK 29332 LEUELrlS: POSITION JJ,KK:? tt6;"a3 

aul":PAUSE=20: GOSUB PT: GOSUB XYZ:GOTO T 

P 

NF 29333 LEVEL=ZL : POSITION JJ,KK:? tt6;"[Iin 
13 ";PAUSE=20: GOSUB PT: GOSUB XYZ : GOTO T 
P 

QC 29334 LEUEL=5: POSITION JJ,KK:? tt6 ; "\rT^ 

[a":PAU5E=20: GOSUB PT:GOSUB XYZ:Gofo TP 
OC 29340 DATA 121,30,121,10,121,10,121,30 

,121,10,121,10,96,30,81,10,81,10,96,10 

,96,10,121,30,-2,-2 
WU 29350 DATA 108,30,108,10,108,10,108,30 

,108,10,108,10,128,30,108,10,108,10,12 

8,10,162,30,-3,-3 

HL 29360 DATA 121,10,121,10,121,10,121,10 
,121,30,121,10,121,10,96,30,81,10,81,1 
0,96,10,96,10,121,30,-4,-4 

PY 29370 DATA 108,30,108,10,108,10,162,10 
,162,10,162,30,121,75,-1,-1 

RE 30080 GOTO 30 



BOOT UP TO 
BIG SAVINGS 

SUBSCRIBE 

□ 1 Year $28 Save $14 

MCEYY 

n 1 Year with Disk $105 

DCEYY 



Name 



Address 



City State Zip 

Make checks payable to: L.F.P. Inc. Allow 4-6 
weeks for delivery. 

D Payment Enclosed D Bill Me 

D Charge My D Visa D MC 

* ^ Exp 



Signature 

FOREIGN-Add $7 per year 

MONEY BACK if not delighted 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



PAGE 38 / MAY 1988 



ANALOG COMPUTING 



ST HOME APPLICATION 



y/ 



Brings creative impulses 
to the screen with ease 



Needlework 
Design 



by Regena 



Needlework Design is a set of programs written in low 
resolution ST BASIC. You can use these programs to de- 
sign a needlework project, make changes on the screen, 
then handcraft the end result. 

Included are three types of needlework designing sec- 
tions. The Cross Stitch portion shows a grid on-screen; you 
use the mouse to place colored dots on the grid. After your 
pattern is complete, it may be printed out. The Doily pat- 
tern is similar to the Cross Stitch, except you design in only 
one color, with the design "reflected" on the four quadrants 
of the screen so the pattern is symmetrical. Quilt Squares 
lets you put together a patchwork quilt design. The basic 
pattern is then repeated so you can see how several squares 
would look together. 

You can nm the programs separately, or RUN NEEDLE 
(Listing 1) to get a menu screen, which will then chain to 
the program chosen. 

Needlework Design (Listing 1) is a short main menu pro- 
gram. The full output window is used. The screen clears, 
and the title and three choices are printed. Lines 150-170 
detect which key the user must press to make the choice 
(either a 1, 2 or 3.) The CHAIN command is used to load 
and run one of the three programs, entitled XSTITCH, 
DOILY and QUILT. 

Cross Stitch 
Cross Stitch (Listing 2, XSTITCH) is a graphics program 
to design counted cross stitch, needlepoint, or lace net darn- 
ing. After the title and instruction screen clears, a grid ap- 
pears. Use the mouse to move the mouse arrow to a square, 
then press the left mouse button to place a dot of color. You 
may change colors by positioning the mouse and pressing 
the right mouse button. Repeatedly pressing the right but- 

ANALOG COMPUTING 



ton will display all the colors. The left mouse button con- 
tinues to draw in that color. At any time, you can press a 
SHIFT key to print the design. Different colors are repre- 
sented by different letters of the alphabet. 

Line 30 DIMensions the array D to keep track of what's 
in each grid position on the screen. Lines 40-180 clear the 
screen and print the title and instructions. Lines 190-210 
initialize the D array. Lines 220-240 wait for the xiser to press 
the Fl function key to clear the instructions and start de- 
signing. 

Line 250 clears the screen. Line 260 defines the draw- 
ing color to be light gray, then Lines 270-320 draw the grid 
on the screen using FOR-NEXT loops. Line 330 defines the 
starting color (red). 

Lines 340-430 detect the mouse control. KB will equal 
1 or 2 if the SHIFT key is pressed. MB will equal if a 
mouse button is not pressed. Lines 390-410 change the 
mouse color when the right mouse button is pressed. The 
color number is incremented by 1 each time the button is 
pressed. After color nimiber 15, the color number starts with 
again. 

Lines 420-450 determine the position of the mouse ar- 
row if a mouse button is pressed. MX and MY are the coor- 
dinates. The arrow must be on the grid and cannot point 
to a line. Lines 460-490 define AA and BB for a row and 
colvram number in using the D array The D array keeps track 
of the color number placed in the square. A and B are used 
as the center coordinates of the square chosen, and PCIR- 
CLE A,B,2 draws the colored dot in the square. 

Line 500 branches back to Line 360 to detect the next 
action with the mouse or keyboard. 

Lines 510-580 contain the printing process when a SHIFT 
key is pressed. Line 560 checks each D element in order. 
If the color number is 0, a space is printed. If there's a color 
number in D, that munber is added to 64 to get an ASCII 

MAY 1988 / PAGE 39 



^Needlework 



continued 



character number, which will print an alphabetic charac- 
ter. Each letter of the alphabet represents a different color 
in the design. Line 590 branches back to detecting the 
mouse after printing is completed. 

Doily 
DOILY (Listing 3) is similar to the Cross Stitch program, 
but uses only one color. A cross stitch doily is usually sewn 
in only one color and is symmetric in four quadrants (some- 
times eight sections). This style is also appropriate for lace 
net darning. As you use the left mouse button to place dots 
on the grid, other dots are automatically drawn on the oth- 
er quadrants, reflected on the center axes. 

To erase a dot, simply position the mouse arrow on the 
dot and press the left button. The color drawn alternates 
between red and white. If you press the left mouse button 
on an empty square, a red dot will be drawn; if you press 
the button on a red dot, the dot will disappear. 

Use the right mouse button to get a hard copy of the de- 
sign. After the printing process you will have the same de- 
sign to continue working on. 

Line 30 DIMensions the D array to keep track of dot lo- 
cations. Lines 40-150 clear the screen and print the title 
and instructions. Lines 160-180 initialize the D array All 
positions are to start with. When a dot of color is placed, 
that D element becomes a 1. Lines 190-210 wait for the user 
to press the Fl fxmction key to start designing. 

Line 220 clears the screen. Line 230 defines the draw- 
ing color to be gray, and Lines 240-290 draw the grid. Lines 
300-320 change the color and draw the center X- and Y- 
axis for reflection. Line 330 defines the drawing color as 
red. 

Lines 340-420 detect the mouse control. Line 380 causes 
a branch to the printing routine if the right mouse button 
is pressed. MX and MY are the coordinates when the left 
mouse button is pressed. The mouse arrow must be on the 
grid and must not point to a line. Lines 430-470 place the 
dot on the grid. AA and BB use MX and MY to determine 
integer grid positions for the D array A and B determine 
the center of the square so PCIRCLE A,B,2 can draw the 
dot. Line 450 uses the SGN function (sign) with the ABS 
fimction (absolute value) to switch the D element value of 
C between and 1 or 1 and 0. Line 460 then redefines D 
and the color. 

Lines 480-530 draw the dots in the other quadrants, us- 
ing coordinates A, B, A2 and B2. The corresponding D ele- 
ments also need to be redefined. Line 540 branches back 
to the mouse detection. 

Lines 550-620 contain the printing procedure for a hard 
copy. The D element will contain 1 if there's a dot and 
if there isn't. The printer will print an X for a dot and a 
space for no dot. Line 630 branches back to the mouse de- 
tection so design can continue. 

Quilt Squares 

Quilt Squares (Listing 4, QUILT) lets you design a patch- 
work quilt on-screen before actually sewing all the little 
squares and triangles together. After you design one basic 
square, consisting of four small squares by four small 
squares, that pattern is repeated on the screen so you can 
see how several patterns will look together. 



First choose three colors from the sixteen available. If you 
prefer a quilt with only two colors, simply choose one of 
the colors twice. After you press the Fl key to begin, the 
screen clears and the possible design squares are shown at 
the right side of the screen. The square may be all one col- 
or or any combination of triangles of two colors. 

A larger basic set of 4x4 squares is shown on the left side 
of the screen. The squares are originally outlined in gray. 
As each one is highlighted in black, move the mouse ar- 
row to one of the small designs and press the left mouse 
button. That pattern will then appear on the larger square. 
Continue the process for all sixteen squares. 

After all sixteen squares have been designed, the com- 
puter will surround that original basic square with the quilt 
pattern repeated with three patterns by three patterns. You 
will now be able to see how your design will look as a 
larger patchwork quilt. 

Now you can make changes. The original sixteen squares 
will be highlighted in black, one at a time. If you want to 
keep the square as is, press the right mouse button and it 
won't change. If you wish to change the pattern of one 
square, go to the small design squares and select a pattern 
with the left mouse button. The pattern selected will ap- 
pear in the original basic pattern, then the computer will 
change the other eight corresponding squares in the repeat- 
ed patterns. The sixteen original squares will continue to 
be highlighted one at a time if you want to keep making 
changes. You may keep the quilt on the screen as you actu- 
ally cut and sew your real patchwork quilt, or press CTRL- 
C to stop the program. 

Lines 30-40 DIMension variables used as arrays. C() is 
the three color numbers chosen. S$() is the patterns for the 
small design squares at the right side of the screen. TOP() 
and BOT() are the top and bottom colors for the triangles 
within the design squares. The variables starting with Q 
are used for the 4x4 basic design squares on the left side 
of the screen. QP$() is the pattern style, QT() is the top color 
and QB() is the bottom color. The Q variables are used when 
the pattern is repeated across the screen. 

Lines 50-80 define a full window, clear the screen and 
print the title. Lines 90-260 receive the user's choices for 
three colors. INP(2) is used to detect a key press for a color 
number. If the color desired is color niunber 1, press 1 then 
RETURN; otherwise, you may press the color number with- 
out the return key The color numbers are stored as C(l) 
C(2) and C(3). 

Lines 270-320 print some instructions. Line 330 uses 
GOSUB SETUP to define the design patterns. Lines 340-350 
wait for the function key Fl to be pressed to begin. 

Line 360 clears the screen. Line 370 defines the draw- 
ing color to be light gray and Lines 380-440 draw the small 
squares for all the possible design squares. Lines 450-490 
then draw diagonal Unes in those squares consisting of two 
triangles. Lines 500-640 use the subroutine START to col- 
or in the squares. The data statements consist of X- and Y- 
coordinates for the fill commands using the three colors. 
Line 650 redefines the color as light gray, then Lines 
660-710 draw the main 4x4 square. Lines 720-870 are nest- 
ed FOR-NEXT loops to design each of these sixteen squares. 



PAGE 40 / MAY 1988 



ANALOG COMPUTING 



The squares are defined by ROW and CLM, which vary from 
1 to 4. 

Line 740 determines graphic coordinates XI and Yl, de- 
pending on ROW and CLM. Lines 750-760 then outhne that 
"box" in black. Line 770 calls the subroutine to check the 
mouse. Line 780 determines if this is the first design phase 
or the changing phase. Line 790 calls the subroutine to color 
in the square, depending on the design chosen. Line 800 
also checks which design phase; if the pattern already cov- 
ers the screen, the subroutine REPEAT is called to change 
the corresponding eight squares in the repeated patterns. 
Line 810 changes the color back to gray to outline the box 
and Line 820 goes to the next box. 

After the sixteen squares have been designed, Lines 830- 
870 repeat these sixteen squares across the screen in three 
main pattern blocks across and three main pattern blocks 
down, so you can see nine patterns together. 

Lines 880-940 print the instructions for changing pattern 
squares by selecting a design pattern with the left mouse 
button or pressing the right mouse button for no change. 
GOTOXY is used to place the printing without messing up 
the quilt pattern on the screen. The variable FLAG is set 
to to start the program, but now becomes 1 for the chang- 
ing phase. Line 950 then branches to Line 720 to use the 
same programming lines in designing the sixteen squares. 
Lines 960-1160 are the subroutine SQUARE, which is 
used to color in a larger square, depending on the small de- 
sign square chosen. Lines 970-1030 erase a square during 
the "change" phase of designing. Dark gray is used to fill 
in the square and get rid of all previously drawn diagonal 
lines. 

Line 1040 determines the pattern PAT$ of the particular 
square. F means the square is all one color. RL is a square 
of two triangles with the diagonal drawn from top right to 
bottom left. LR is a square of two triangles with the diagonal 
drawn from top left to bottom right. Line 1050 defines the 
top color T and the bottom color B. Lines 1060-1150 draw 
the appropriate diagonals, if necessary, and fill the colors. 
Line 1160 is RETURN. 

Lines 1170-1360 are the subroutuie CHECK, which checks 
the mouse control. Line 1200 determines if a mouse but- 
ton is pressed. Line 1210 returns if you are in the changing 
design phase and the right mouse button is pressed to in- 
dicate no change. Line 1220 determines the coordinates of 
the arrow point when the left mouse button is pressed in 
the changing phase, or either button is pressed in the first 
design phase. The coordinates are MX and MY. 

Lines 1230-1300 check the arrow position. The arrow 
point must be on or in a design square for the computer 
to respond. These lines make sure the arrow point is not 
in a white space aroimd the small design square. If MX and 
MY are valid. Lines 1310 and 1320 determine integer coor- 
dinates YY and XX, indicating which row and colmnn the 
design square is in. Lines 1330-1360 use YY and XX to de- 
termine the pattern style and colors, then return to the main 
program. 

Lines 1370-1520 are the SETUP subroutine. Line 1380 de- 
fines FLAG=0 for the first time through designing the six- 
teen squares. Lines 1390-1430 define the pattern styles, F, 



RL and LR, for the small design squares in five rows and 
three coliunns. Lines 1440-1510 define the top and bottom 
colors for each possible design square. Line 1520 returns 
to the main program. 

Lines 1530-1570 are the subroutine START, which is used 
to fill in the colors of the small design squares. 

Lines 1580-1630 are the subroutine BOX, which is used 
to outline a square in gray, dark gray or black. 

Lines 1640-1710 are the subroutine REPEAT, which is 
used to repeat the basic sixteen-square pattern in three rows 
and three colmnns. Line 1720 ends the program. B 

Regena got her first home computer (a Tl-99/4] for Christ- 
mas in 1980. Ideas for the hundreds of BASIC programs she's 
had published (for various computers) come jrom her six 
children. A regular columnist in COMPUTE!, her latest book 
is Elementary ST BASIC, from COMPUTE! Publications, 
Inc. 



Listing 1 

ST BASIC listing 
le REM NEEDLEMORK DESIGN 
20 REM BV REGENA 
38 FULLM 2:CLEARM 2 
48 GOTOXV 8,2 

58 PRINT "** NEEDLEMORK DESIGN »»" 
68 PRINT:PRINT 
78 PRINT TAB CO) J "CHOOSE:" 
88 PRINT 

98 PRINT TABtO);"! CROSS STITCH" 
180 PRINT 

118 PRINT TAB(8);"2 DOILY" 
128 PRINT 

138 PRINT TAB(8)i"3 QUILT SQUARES" 
140 PRIHT:PRINT:PRIHT 
158 K=INP(2) 

168 IF K<49 OR K>51 THEN 150 
170 ON K-48 GOTO 180,288,228 
188 PRINT "CR8SS STITCH" 
198 CHAIN "XSTITCH" 
288 PRINT "DOILV" 
210 CHAIN "DOILV" 
228 PRINT "QUILT SQUARES" 
238 CHAIN "QUILT" 
248 END 
• 

ST CHECKSUM DATA 

18 data 269, 11, 516, 630, 284, 116, 

169, 175, 187, 148, 2417 

118 data 252, 146, 494, 956, 386, 28 
9, 70, 81, 335, 189, 3838 

210 data 26, 211, 47, 789, 1073 
« 

Listing 2 

ST BASIC listing 

18 REM CRBSS STITCH 

28 REM BV REGENA 

38 DIM DC73, 41) 

40 FULLU 2:CLEARM 2 

58 G8T0XV 0,0 

60 PRINT TABtl0);"»» CROSS STITCH **" 

70 PRIHT:PRINT 

88 PRINT " Draw by noving the nouse" 

98 PRINT " to the desired square then" 



ANALOG COMPUTING 



MAY 1988 / PAGE 41 



^Needlework continued 



180 PRIHT " pressing the LEFT nouse bu 

tton." 

118 PRIHT 

128 PRINT " Change colors by pressing" 

138 PRINT " the RIGHT nouse button." 

148 PRINT.-PRINT 

158 PRINT " To print the design on a p 

rinter, " 

168 PRINT " press the SHIFT key." 

178 PRINT:PRINT 

188 PRINT " Press Control-C to stop." 

198 FOR X=8 TO 73:F0R V=8 TO 41 

280 DCX, vi=e 

218 NEXT V:NEXT X 

228 PRINT:PRINT 

230 PRINT " Press Fl to start." 

248 R=INPC2):IF R0187 THEN 248 

250 CLEARU 2 

268 COLOR 1,1,8,1,1 

270 FOR X=4 TO 296 STEP 4 

288 LIHEF X, 8, X, 168 

298 NEXT X 

388 FOR V=4 TO 168 STEP 4 

318 LINEF B,V,296,V 

328 NEXT V 

338 C=2! COLOR 1, C, C, 1, 1 

348 AttrGB 

358 G2=PEEK(Att+12) 

368 GEMSVS(79) 

378 KB=PEEKCG2+8)!IF KB=1 OR KB=2 THEN 

520 
388 MB=PEEKtG2+6):IF MB=8 THEN 368 
398 IF MB=1 THEN 420 
488 C=C+1:IF C=16 THEN C=B 
418 COLOR 1, C, C, 1,1 
420 MX=PEEK(G2+2) :MV=PEEKtG2+4)-21 
430 IF MX>295 OR MV>1G8 THEN 360 
440 A=MX/4!B=MV/4 

450 IF IHT(A)=A OR IMT(B)=B THEN 360 
460 rtA=INT(A}:BB=INT(B} 
470 A=AA«4+2:B=BB«4+2 
480 DCAA, BB)=C 
490 PCIRCLE A,B,2 
500 GOTO 360 
518 REM PRINTING 
520 WIDTH LPRINT 75 
530 LPRINT 
540 FOR V=e TO 48 
550 FOR X=0 TO 72 

568 IF DCX,V)=0 THEN LPRINT " "; ELSE 
LPRINT CHR$CD(X,V)+64); 
570 NEXT XiLPRIHT " " 
580 NEXT V 
590 GOTO 368 
600 END 



ST CHECKSUM DATA 



f^o'^^Sfi. mu ^^' ^^^' 518, 604, 588, 
118, 915, 352, 441, 4721 

c^^®o^?*^„i*^«, ^^5' 557, 54, 581, 8, 
63, 972, 685, 310, 3428 

210 data 366, 50, 848, 589, 383, 43, 

997, 283, 322, 978, 4763 



510 data 78, 428, 308, 995, 9, 417, 
689, 327, 438, 785, 4458 

• 

Listing 3 
ST BASIC listing 
18 REM DOILV 
28 REM BV REGENA 
38 DIM D 173, 41) 
40 FULLM 2!CLEARM 2 
58 GOTOXV e, 8 

60 PRINT TABfl8Jj"»» DOILV *»" 
78 PRINT:PRINT 

on dSIHJ '.'. ■>''3",by noving the nouse" 
iaa nkrl-r ..*" the desired square then" 
100 PRINT pressing the LEFT nouse bu 
tton . 

118 PRIHT:PRIHT 

128 PRINT " To print the design on a p 
rinter, " "^ 

138 PRINT " press the RIGHT nouse butt 
on . 

148 PRINTrPRINT 

^c2 tUH '1 f*"" Control-C to stop." 

168 FOR X=8 TO 73: FOR V=8 TO 41 

178 D(X,V)=8 

188 NEXT V:NEXT X 

190 PRINT:PRINT!PRINT 

288 PRINT " Press Fl to start." 

lii inzi'V'' '''''' ^"" ''' 

238 COLOR 1,1,8,1,1 

248 FOR X=4 TO 296 STEP 4 

258 LIHEF X, 6, X, 168 

268 NEXT X 

278 FOR V=4 TO 168 STEP 4 

288 LINEF 0, V, 296, V 

290 NEXT V 

300 COLOR 1,1,6,1,1 

318 LINEF 8,84,296,84 

328 LIHEF 148,8,148,168 

338 COLOR 1,2 2 1,1 

348 AJt=GB 

358 G2=PEEKCAtt+12) 

368 GEMSVS(79) 

To2 '?i=PPKf"*":IF MB=8 THEN 368 

380 IF MB=2 THEH 560 

390 MX=PEEKCG2+2) :MV=PEEKtG2+4J-21 

ill ii^TAnixr'"' '''' ''' 
ill iiAiv^.]it,%\v.r=' ^"" ''' 

440 A=AAk4+2:B=BB«4+2 

450 C=ABSCSGNtD(AA,BB))-l) 

460 DtAA,BB)=C: COLOR 1, C*2, C»2 

470 PCIRCLE A,B,2 

480 AA2=73-AA:BB2=41-BB 

490 A2=AA2«4+2:B2=BB2k4+2 

508 PCIRCLE A2,B2,2 

518 PCIRCLE A, 82, 2 

528 PCIRCLE A2, B, 2 

538 D CAA2, BBl =C : D (AA, BB2) =C : D tAA2, BB2) 

540 GOTO 360 

558 REM PRINTIHG 

568 WIDTH LPRINT 75 

578 LPRINT 

588 FOR V=e TO 40 

590 FOR X=0 TO 72 

600 IF D(X,V)=1 THEN LPRINT "X"J ELSE 



PAGE 42 / MAY 1988 



ANALOG COMPUTING 



LPRIHT " "; 

618 HEXT XiLPRINT " " 

628 HEXT V 

638 GOTO 368 

648 END 

• 

ST CHECKSUM DATA 

18 data 532, 11, 617, 518, 684, 583, 

118, 915, 352, 441, 4691 

118 data 45, 572, 831, 54, 963, 596, 

329, 385, 971, 831, 5577 

218 data 577, 374, 34, 988, 194, 313 
, 989, 224, 324, 25, 4842 

318 data 292, 589, 32, 1, 37, 728, 7 
, 346, 59, 718, 2721 

418 data 128, 232, 814, 388, 955, 51 
1, 184, 623, 692, 269, 4628 

518 data 132, 163, 628, 415, 98, 432 
, 328, 7, 21, 927, 3127 

618 data 673, 311, 414, 797, 2195 

• 

Listing 4 
ST BASIC listing 

18 REN QUILT 

28 REM BV REGENA 

38 DIM Ct3),SSt5,3),T0PC5,3),B0T£5,3J 

48 DIM QPSt4,4),QTt4,4),QBC4,4) 

58 FULLM 2:CLEARU 2 

68 GOTOXV 8,8 

78 PRINT TftBtl8);"»» QUILT «*" 

88 PRINT:PRINT 

98 PRINT "Choose colors:" 

188 FOR T=l TO 3 

118 PRINT:PRINT "COLOR";T 

120 PRINTiPRINT " 8=White" 

130 FOR CC=1 TO 15 

146 COLOR CC:PRINT STR$CCC}J 

158 NEXT CCiPRINT 

160 COLOR 1 

170 K1=INP(2) 

180 IF KK48 OR Kl>57 THEN 178 

190 IF Kl>49 THEN C(T)=K1-48!G0T0 248 

200 K=INPC2J 

210 IF K=13 THEN CCT)=K1-48!G0T0 240 

220 IF K<48 OR K>53 THEN 266 

238 CCT)=18»(Kl-48)+K-48 

248 PRINT:PRINT " COLOR HUMBER";C(T) 

250 PRINT:PRINT 

268 NEXT T 

270 PRINT:PRINT:PRINT 

280 PRINT "Choose pattern for square b 

9" 

290 PRINT "moving nouse arrow to desir 

ed" 

300 PRINT "snail pattern and pressing" 

310 PRINT "the left nouse button." 

320 PRINT:PRINT:PRINT 

330 GOSUB SETUP 

340 PRINT "Press Fl to start." 

350 K=IHPC2J:IF K0187 THEN 358 

368 CLEARM 2 

370 COLOR 1,8,8,1,1 

380 FOR A=248 TO 288 STEP 26 

398 FOR B=18 TO 96 STEP 28 

400 LINEF A,B, A+10, B 

410 LINEF A, B,A, B+IO 

420 LINEF A+10, B, A+18,B+18 



438 LINEF A, B+18, A+18, B+18 

448 NEXT B, A 

450 FOR A=240 TO 280 STEP 20 

468 FOR B=30 TO 76 STEP 48 

478 LINEF A, B+18, A+IS, B 

488 LINEF A, B+26, A+16, B+3B 

498 NEXT B,A 

568 COLOR 1,C(11, ceil, 1,1 

518 RESTORE 528: GOSUB START 

528 DATA 282,12,282,32,268,38 

536 DATA 248,38,242,58,262,58 

548 DATA 288,52,282,72,288,92 

558 COLOR 1,C(2],CC2) 

566 RESTORE 578: GOSUB START 

576 DATA 262,12,262,32,288,38 

586 DATA 268,52,282,58,248,78 

596 DATA 262,72,268,92,242,98 

660 COLOR 1, C(31,C(3) 

610 RESTORE 626:G0SUB START 

620 DATA 242,12,242,32,248,52 

638 DATA 242,72,268,78,288,78 

646 DATA 248,92,262,98,282,98 

658 COLOR 1,8,8 

668 FOR A=56 TO 112 STEP 14 

670 LINEF 64, A, 128, A 

680 NEXT A 

690 FOR A=64 TO 128 STEP 16 

700 LINEF A, 56, A, 112 

710 NEXT A 

720 FOR R0M=1 TO 4 

730 FOR CLM=1 TO 4 

740 X1=48+16»CLM:V1=42+14»R0M 

758 BX=X1!BV=V1 

768 COLOR 1,1,1: GOSUB BOX 

778 GOSUB CHECK 

788 IF FLAG=1 AND NB=2 THEN 818 

798 GOSUB SQUARE 

888 IF FLAG=1 AND MB=1 THEN GOSUB REPE 

AT 

818 COLOR 1,8, 8: GOSUB BOX 

828 NEXT CLM,ROU 

830 IF FLAGrl THEN 880 

848 FOR R0M=1 TO 4: FOR CLM=1 TO 4 

856 X1=48+16kCLM:V1=42+14»R0M 

866 GOSUB REPEAT 

870 NEXT CLM,ROM 

888 REM CHANGE 

898 GOTOXV 22, 12:?"SELECT WITH" 

986 GOTOXV 22,13:?"LEFT BUTTON" 

918 GOTOXV 22, 14:?"0R FOR NO" 

920 GOTOXV 22,15:?"CHANGE PRESS" 

930 GOTOXV 22,16:?"RIGHT BUTTON" 

948 FLAG=1 

958 GOTO 728 

966 square: 

978 IF FLAG=e THEN 1848 

986 COLOR 1,9, 9: GOSUB BOX 

998 LINEF BX, BV, BX+16, BV+14 

1666 LINEF BX+16, BV, BX, BV+14 

1618 FILL BX+2, BV+5:FILL BX+14, BV+6 

1626 FILL BX+5,BV+2:FILL BX+5, BY+12 

1836 COLOR 1,8, 8: GOSUB BOX 

1040 PAT$=QP$CR0M,CLN1 

1058 T=QT tROM, CLMJ : B=QB (ROM, CLMJ 

1060 IF PATS<>"F" THEN 1098 

1070 COLOR 1,T,T:FILL BX+2, BV+2 

1080 GOTO 1160 

1090 COLOR 1,8,8 

1106 IF PAT$<>"RL" THEN 1138 

1116 LINEF BX+16, BV,BX, BV+14 



ANALOG COMPUTING 



MAY 1988 / PAGE 43 



^Needlework 



continued 



1120 GOTO 1148 

1130 LINEF BX,BV,BX+1G,BV+14 

1140 COLOR 1,T, TsFILL BX+5, BV+2 

1150 COLOR 1, B, BiFILL BX+5, BV+12 

1160 RETURN 

1170 CHECK' 

1180 Hlt=GB!G2=PEEKCMtt+12J 

1190 GEMSVS(79) 

1200 MB=PEEKCG2+6):IF MB=0 THEK 1190 

1210 IF FLAG=1 AND MB=2 THEN RETURN 

1220 MX=PEEK(G2+2J :MV=PEEK (62+4) -21 

1230 IF MX<240 OR MX>290 THEN 1198 

1240 IF MVaO OR HV>100 THEN 1190 

1250 IF MX>250 AND MX<260 THEN 1190 

1260 IF MX>270 AND MX<280 THEN 1190 

1270 IF MV>20 AND MV<30 THEN 1190 

1280 IF MV>40 AND MV<50 THEN 1190 

1290 IF MV>60 AND HV<70 THEN 1190 

1300 IF MV>80 AND MV<90 THEN 1190 

1310 VV=IHTt(MX-220)/20) 

1320 XX=IHTt(MV+10)/20) 

1330 PAT$=S$ CXX, VV) : QP$ tROM, CLM) =PATS 

1340 OTtROW, CLM)=TOPtXX, VV) 

1350 QB CROW, CLM) =BOTtXX,VV) 

1360 RETURN 

1370 SETUP: 

1380 FLAGrO 

1390 RESTORE 1400 

1400 DATA F,F,F,RL,RL,RL,LR,LR,LR 

1410 DATA RL,RL,RL,LR,LR,LR 

1420 FOR X=l TO 5:F0R V=l TO 3 

1430 READ S$(X, V):NEXT V, X 

1440 FOR X=l TO 5 

1450 TOP (X, 1) rC £3) : TOP (X, 2) =C 12) : TOP (X 

,3)=C(1) 

1460 NEXT V 

1470 BOT tl, 1) =C 13) : BOT tl, 2) =C C2) : BOT tl 

;3)=C(1) 

1480 B0T(2,l)=Ctl) :B0TC2, 2)=Ctl) :B0TC2 

,3)=CC2) 

1490 B0TC3,1)=CC1) :B0TC3, 2)=CC1) :B0TC3 

,3)=CI2) 

1560 BOT C4, 1) =C (2) : BOT (4, 2) =C C3) : BOT 14 

,3)=C(3) 

1510 BOT (5, 1) =C 12) : BOT C5, 2) =C (3) : BOT [5 

,3)=C£3) 

1520 RETURN 

1530 START: 

1540 FOR T=l TO 9 

1550 READ X, V:FILL X, V 

1560 NEXT T 

1570 RETURN 

1580 BOX: 

1590 LINEF BX,BV,BX+16,BV 

1600 LINEF BX+16, BV, BX+16,BV+14 

1610 LINEF BX, BV, BX, BV+14 

1620 LINEF BX, BV+14, BX+16, BV+14 

1630 RETURN 

1640 REPEAT: 

1650 FOR XX=Xl-64 TO Xl+64 STEP 64 

1660 FOR VV=Vl-56 TO Vl+56 STEP 56 

1670 BX=XX!BV=VV 

1680 COLOR 1, 8, 8:G0SUB BOX 

1690 GOSUB SQUARE 

1700 NEXT VV, XX 

1710 RETURN 

1720 END 



ST CHECKSUM DATA 

^f? ''fJt i^2, 11, 13, 364, 520, 606, 
614, 120, 5, 827, 3652 

110 data 236, 555, 4, 554, 412, 334, 

480, 499, 308, 373, 3755 

210 data 273, 198, 486, 731, 59, 305 
, 967, 780, 356, 260, 4489 

310 data 478, 954, 31, 228, 556, 388 
, 62, 77, 46, 293, 3113 

410 data 300, 869, 861, 464, 70, 43, 

588, 881, 479, 597, 5152 

510 data 636, 84, 89, 110, 239, 666, 

95, 132, 123, 230, 2404 

610 data 640, 52, 133, 124, 685, 983 
, 311, 281, 8, 274, 3491 

J.h° ^ftl^ .262, 67, 19, 432, 943, 81, 
917, 583, 151, 4, 3459 

810 data 89, 163, 511, 835, 437, 144 
, 178, 790, 823, 910, 4888 

^i^L"*^??. '*??£. ^21, 47, 170, 422, 477 
, G46, 115, 177, 179, 3596 

1010 data 133, 208, 191, 687, 127, 9 
78, 748, 562, 744, 242, 4620 

1110 data 183, 555, 185, 757, 816, 4 
46, 301, 765, 806, 147, 4961 

1210 data 344, 178, 988, 649, 935, 9 
42, 774, 781, 788, 788, 7159 

1318 data 783, 634, 622, 685, 564, 4 
52, 390, 253, 29, 93! 4345 

1410 data 410, 528, 232, 38, 266, 39 
5, 950, 958, 957, 965, 5675 

1510 data 972, 454, 370, 37, 779, 38 
3, 459, 51, 921, 483, 4909 

1610 data 912, 481, 458, 473, 176, 1 
97, 64, 214, 236, 927, 4138 

1710 data 459, 934, 1393 



WHAT IS 

ST-CHECK? 



Most ST BASIC program listings in this magazine 
are followed by a table of numbers appearing as data 
statements, called "ST CHECKSUM DATA." These 
numbers are to be used in conjunction with ST-Check 
(which appeared in ANALOG Computing issue 41). 

ST-Check, written by Clayton Walnum, is designed 
to find and correct typing errors when readers are en- 
tering programs from the magazine. For those read- 
ers who would like copies of the article, you may send 
for back issue 41 of ANALOG Computing for $4.00. 



ANALOG COMPUTING 

P.O. Box 625, Holmes, PA 19045 



PAGE 44 /MAY 1988 



ANALOG COMPUTING 



48K Disk 



Double your disk capacity 



UTILITY 



Q 




■It 



OS CD 



by Angelo Giambra 



I was really excited when I purchased my new Astra 2001 
disk drive. The first thing I did was begin to convert all my 
disks to double-density format, figuring I'd cut my disk us- 
age in half. 

Imagine my surprise when, while creating my very first 
double-density disk, I got an obscure disk error: Error 169.' 
I checked to see if I had run out of room on the disk. No, 
I still had over 200 sectors left. As a last resort (naturally), 
I consulted the manual. Error 169 translation: Disk Direc- 
tory Full. 

Of course! You can only put 64 files on a disk. I'd never 
gotten this error before because it's practically impossible 
to get 64 files on a single-density disk, unless you have a 
lot of really small files. 

128 vs. 256 

Something seemed wrong here. Having written several 
utilities which modified DOS, I was pretty famihar with 
the File Management System (FMS). I knew that the 64-file 
limit was imposed because of the way the directory was im- 
plemented. The directory consists of eight disk sectors, be- 
ginning at sector 361. Each directory entry uses 16 bytes 
(see Figure 1), so in a 128-byte sector you can fit eight en- 
tries. Eight sectors times eight entries makes 64 files. Fine. 

But double-density disks use 256-byte sectors. Wasn't it 
reasonable to assume that the 256-byte directory sectors on 
a double-density disk could fit 16 entries, hence 128 files 
per disk? 



16 BYTES 



16 BYTES 



CONTROL 
INFORMATION 


FILENAME 1 




FILENAME 2 




FILENAME 3 




FILENAME 4 




FILENAME 5 




FILENAME 6 




FILENAME 7 




FILENAME 8 





FILENAME 1 




FILENAME 2 




FILENAME 3 




FILENAME 4 




FILENAME 5 




FILENAME 6 




FILENAME 7 




FILENAME 8 


128 UNUSED BYTES 



128 BYTE SECTOR 



256 BYTE SECTOR 



Figure 1 

Wrong! Neither DOSXL, nor SMARTDOS, take advantage 
of the extra room in the directory. Believe it or not, on a 
double-density disk, half of every directory sector is unused. 
The FMS treats these sectors as if they were still single 
density. 

The solution 

Well, I decided, it was time for DOS CD (Capacity Dou- 
bler). There are several versions described in this article, 
depending on which DOS you use (DOSXL or SMARTDOS). 
I'll describe each one and tell you how to implement it. 



ANALOG COMPUTING 



MAY 1988 / PAGE 45 




DOS CD 



continued 



The program in Listing 1 will modify DOSXL so that 
double-density disks will be capable of storing 128 files. The 
64-file limit will still be in effect when using single-density 
disks; the modified FMS will sense whether you're writ- 
ing to a single- or double-density disk and adjust its direc- 
tory handling accordingly. 

First, key in the program and save it. Now insert a new 
disk into any drive and run the program. The program will 
prompt: WHICH DRIVE? Key in the drive number you want 
DOS CD installed in. After the program asks you to verify 
the drive number, a warning will appear that the disk is 
about to be formatted. If everything is okay, press the START 
key. The disk will be formatted and DOS CD will be writ- 
ten out. 

At this point, you will be running under DOS CD. It isn't 
necessary to reboot from the disk. You will now be able to 
store 128 files on this disk and any other disk you have for- 
matted using DOS CD. 

DOSXL.SYS 

If you own one of OSS's supercartridges (BASIC XL, 
ACTION, MAC/65), you may be using a special version of 
DOSXL called DOSXL.SYS. This version of DOSXL moves 
itself up into the area of memory "rmderneath" the cartridge 
and frees up about 3 to 5K of memory. If you normally boot 
from a disk containing DOSXL.SYS when using your su- 
percartridge, you may use the program in Listing 2 to ere- 



BOOT UP TO 
BIG SAVINGS 

SUBSCRIBE 

D 1 Year $28 Save $14 

MCEYY 

n 1 Year with Disk $105 

DCEYY 

Name 

Address 

city State Zip 

Make checks payable to: L.F.P. inc. Aliow 4-6 

weeks for deiivery. 

n Payment Enciosed D Bili IVle 

D Charge My D Visa D MC 

# Exp 

Signature 

FOREIGN— Add $7 per year 

MONEY BACK if not deligtnted 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



ate an AUTORUN.SYS file on the same disk. This file, when 
booted, will modify DOSXL.SYS to allow it to access 128 
files. 

(Note: If you put the AUTORUN.SYS file on a disk with 
DOSXL.SYS, you must never boot from that disk without 
a supercartridge in place. If you attempt to do so, the disk 
will not boot.) 

SMARTDOS 

Since SMARTDOS is based on the same FMS as DOSXL, 
it suffers from the same limitations of DOSXL. (It's not so 
smart after all!) No problem! Key in the program in Listing 
3. Insert a disk containing SMARTDOS in drive 1 and rim 
the program. It will create a file called SMARTDOS.ARl. 
(Note that your version of SMARTDOS must be configured 
to run *.AR1 upon booting.) If you have not modified the 
default options, you're all set. See your instruction manu- 
al if you're unsure about the configuration. 

After creating the SMARTDOS.ARl file, turn your sys- 
tem off and boot from this disk. Voila! SMARTER DOS. 

(Note: Save at least one copy of SMARTDOS on a disk 
with no SMARTDOS.ARl file on it. Never use the Make Sys- 
tem Files option after booting from modified SMARTDOS.) 
If you want to create another disk with the modified 
SMARTDOS, follow this procedure: 

First, boot from the disk containing only SMARTDOS (no 
SMARTDOS.ARl). Choose the Make System Files option to 
create a new copy of SMARTDOS on another disk. Finally, 
copy SMARTDOS.ARl to the new disk. 

Also, the modification for SMARTDOS uses a small por- 
tion of page six— addresses $6CB to $6FR Never run any 
software which writes over these addresses while running 
under modified SMARTDOS. 

Compatibility 

Which brings us to compatibility. If you boot from DOS 
CD, you'll be able to read all your single-density disks just 
fine. And you'll be able to write to them with no problem 
either. This is because DOS CD senses the density and treats 
single-density disks the same as regular DOS does. 

But if you do a directory on your standard double-density 
disks, DOS CD will show only the first eight files. And those 
are the only files you'll be able to access. Why? Because 
a directory command causes FMS to search the directory 
sectors and print the filenames it finds there. FMS knows 
when it reaches the last entry in the directory because in- 
stead of a filename, it finds a binary zero in the status byte. 

DOS CD begins searching the directory and prints the first 
eight files, then goes into the formerly unused second half 
of the directory sectors and finds— you guessed it — binary 
zeroes. So it stops. 

Conversion 

You may want to convert your present double-density 
disks so that DOS CD can access the remaining files. Once 
these disks are converted, DOS CD will also be able to store 
128 files on these disks as well. But now you'll be in an 
opposite situation. Standard DOS will only be able to ac- 
cess the first eight files on a converted disk. Unlike DOS 
CD, standard DOS will be able to see all the files on the 
disk, but if you try to access anything beyond the first eight. 



PAGE 46 / MAY 1988 



ANALOG COMPUTING 



you'll get an Error 164 (or System Error in DOSXL). I'll ex- 
plain why later. 

When you run the program in Listing 4, it will create a 
machine language file on your disk called CONVERT. Be- 
fore running CONVERT, I strongly recommend that you 
back up any disks you want to convert. If you made a mis- 
take when typing in the program, you could really mess 
up your disks, and I don't want a lot of nasty mail! 

Okay, all backed up? Let's proceed. Load the convert pro- 
gram using DOSXL's LOAD command. The screen will clear 
and you'll see the message: PRESS START. 

Insert the disk you wish to convert in the drive designat- 
ed as 1 and press START. As the conversion progresses, 
you'll see the name of each file the CONVERT program ac- 
cesses. Following is an explanation of what's going on. 
The hows and whys 
All files on your disk are assigned a file nmnber by the 
FMS when they are written to disk. This number simply 
corresponds to their position in the directory. The first file 
is assigned file number 0, the tenth file is file number 9, 
and so on. 

Normally, the ninth file falls in the second directory sec- 
tor since there are only eight entries per sector. In DOS CD, 
the ninth file falls into the second half of the first sector. 
The first file in the second directory, sector, therefore, should 
be assigned file number 15. 

The CONVERT utiUty reads each data sector of every file 
on your disk and reassigns a new file niunber based on the 
above. 

Then, it does the following. If there were files in the first 
half of the current directory sector, CONVERT changes the 
eight status bytes in the second half of the directory to hex 
$80 and rewrites the directory sector. Why? Because hex 
$80 is the Deleted File status. This tricks DOS CD into think- 
ing this is an entry for a file that has since been deleted. 
When you issue a directory command, deleted files are sim- 
ply passed over, but the directory search is continued. 

As you add files to the converted disk, DOS CD will use 
these directory positions to catalog the new files. That's how 
you'll get the extra 64 files on your converted disks. 

Which explains why standard DOS gets an error when 
trying to access anything but the first eight files on a con- 
verted disk. Standard DOS computes what the file nmnber 
should be for each file it accesses and compares it to what 
is actually written on each data sector. The computation is 
based on eight per directory sector, so a mismatch occurs 
when it encoimters 16 entries per sector. 
A challenge 
It is possible to design even another version of DOS CD — 
one which will work on the XL machines which use the 
DOSXL. XL version of DOSXL. SYS. Like supercartridge 
DOSXL. SYS, this version boots up into the area above BA- 
SIC and frees up RAIvl in low memory. I wasn't able to im- 
plement this version of DOS CD since my version of 
DOSXL. SYS hangs the system whenever I try to use it on 
my XL. Either I have a bad copy, or there's a bug in this 
version. I'll leave the conversion to any hackers out there 
who want to accept a challenge. 



If you store a lot of little files on disk, you're really going 
to like DOS CD. You'll be able to get yomr money's worth 
out of every disk! H 

AngeJo Giambra is a specialist in Systems Software for 
General Electric in Largo, Florida. He has been an avid hob- 
byist since he bought his first 800 four years ago. He en- 
joys writing machine language utilities and extensions to 
the OS and DOS. 



The two-letter checksum code preceding the line 
numbers here is not a part of the BASIC program. 
For further information, see the "BASIC Editor n," 
in issue 47. 



Gear Up 
Your Disk Drive 
For Big Savings! 

Save $14 Off 
The Cover Price 

ANALOG 



D 1 Year $28.00 Save $14! 

MCEYY 

D 1 Year with Disk $105.00 

DCEYY 

FOREIGN: Add $7 Per Year 
Money Back If Not Deligtited! 

n Payment Enclosed D Bill Me 
D Charge My D Visa D MC 
# Exp, _ 

Signature 
Name 

City State zip 

Make Checks Payable to: L.F.P. Inc. Allow 4-6 

weeks for delivery of first issue. 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



ANALOG COMPUTING 



MAY 1988 / PAGE 47 



3 DOS CD 



continued 



Listing 1 
BASIC listing 

ZM 10 REH KKICKKMICKKICKKMK 

KP 20 REH * W 

LK 38 REN * DOS CD « 

NP 40 REM » by K 

QP 50 REN * a. GIANBRA * 

KT 60 REN * H 

ZS 70 REN KICMKKKKXKKKMXK 

BF 80 REN 

MR 90 DIN I(41,AKS$C1],FN$C6},DS$(10) 

YH 100 FN$="D" 

YX 110 IC0J=5377 

KF 120 I {11=2952 

YL 130 I (2) =2458 

ZH 140 1(31=3873 

NX ISO IC4}=3480 

KX 160 TRAP 210 

OR 170 READ ft! IF A=-l THEH IX=IX+1 : X=0 : GO 

TO 170 
KH 180 POKE ICIX)+X,A 
XQ 190 X=X+1 
OG 200 GOTO 170 
ZF 210 GRAPHICS 18 
IK 220 POSITION 1,3 
DO 230 ? tt6; "ENTER DRIVE NUNBER" 
PJ 240 OPEN ttl,4,0,'>K:" 
NA 250 GET »1,CH 
MQ 260 UNIT=UAL(CHR$(CHn 
TB 270 FN$(2}=CHR5(CH) 
LU 280 POSITION 3,6 

AC 290 ? «6; "DRIVE NUMBER ";CHRStCHJ 
LV 300 POSITION 3,7 
CD 310 ? tt6;"C0RRECT? tY/NJ " 
My 320 GET ttl.CH 
JN 330 IF CHRlCCHJ<>"Y" THEN CLOSE ttl : GOT 

210 
LH 340 CLOSE ttl 
ZO 350 GRAPHICS 18 
KX 360 POSITI ON 5,3 

UR 370 ? tt6;"CSarHIF]" 

LF 380 POSITI ON 3,5 

PW 390 ? tt6 ; " PKH»rtlM.T3 " 

LU 400 POSITI ON 4,6 

Qi 410 ? ubfinxEans" 

NU 420 FOR 1=1 TO 5 

EY 430 SOUND 0,100,12,8 

NO 440 POKE 711,72 

IK 450 FOR X=l TO 100:NEXT X 

NA 460 SOUND 0,0,0,0 

QS 470 POKE 711,68 

IQ 480 FOR X=l TO lOO : NEXT X 

GM 490 NEXT I 

RN 500 ? «6:? tt6; "PLEASE PRESS aEEH" 

NI 510 IF PEEKC53279J06 THEM 510^ 

KB 520 FN$C3)= 

ZM 530 GRAPHICS 18 

KJ 540 POSITION 3,4 

AN 550 ? tt6;"F0RNATTING ";FNS 

QU 560 DS$=FN$ 

GB 570 DS$C3)=":D0S.SYS" 

CM 580 FN$C41 ="«.«" 

IB 590 XIO 254,ttl,0,0,FN$ 

JO 600 POSITION 2,4 

OT 610 ? tt6; "INSTALLING EEB [B" 

XN 620 POKE 7424,49 

CZ 630 OPEN ttl,8,0,DS5 

DV 640 DATA 172,254,18,136,240,6,160,240, 

^?!a^1^ 208 , 4 , 160 , 112, 169, 16, 141 , 58, 15 

,140,45,15,169,255 

SE 650 DATA 141,2,19,76,38,15,32,41,21,17 

I' Zi^?4i^^' 2^^' ^'^^'^38' ''*''''», 74, 74, 16 
o, 96, 172 

NR 660 DATA 254,18,136,208,2,41,127,141,5 
, 19, 96, -1 



JK 670 DATA 32,41,21,185,215,7,72,172,254 
,18,136,240,1,74,32,43,21,141,6,19,104 

,10,10,10 

UA 680 DATA 10,32,48,21,76,110,16,-1 

KX 690 DATA 32,31,21,-1 

BH 700 DATA 76,1,21,-1 

EA 710 DATA 208,-1 

• 

Listing 2 
BASIC listing 

JA 10 REM KICKKKICICMICKKXKKII 

HY 20 REM » DOS CD FOR » 

OT 30 REM » DOSXL.SYS » 

LI 40 REN » BY « 

SB 50 REH * A. GIANBRA * 

JF 60 REN KMMMKKKKKKKKKKll 

RU 80 DIM DAT$(96),HEXC22} IFOR X=0 TO 22! 

READ N : HEX CX}=N: NEXT X : LINE=220 : RESTOR 

„„ l^Hfti^'^^'' 160:? "HCHECKING DATA" 

QK 90 TOTAL=0:LINE=LINE+10; POSITION 2,2:' 

«l.''-?IIii"Ai^;'*^ = ''"'> '>'»T$:IF LENIDAtIjO 
7D THEN 210 

TO 100 DATLIN=PEEKtl83J+PEEKC184J»256:IF 

DATLINOLINE THEN ? "LINE ";LINE:" MIS 

SING!":END 
JP 110 FOR X=l TO LEN(DAT$}-1 STEP 2:D1=A 

SC CDAT$ CX, XJ ) -48 : D2=ASC CDAT$ CX+1 , X+IJ J 

-48 : BYTE=HEX CD1)*16+HEX f D2J 
ZS 120 IF PASS=2 THEN PUT ttl, BYTE: NEXT X: 

READ CHKSUM:G0T0 90 
DH 130 T0TAL=T0TAL+HEX(D1}+HEXCD2) :NEXT X 
GB 140 READ CHKSUH:IF TOTAL=CHKSUM THEN 9 

NN 150 GOTO 220 

JN 160 IF PEEK (1951 <>6 AND PEEK(195J<>5 T 

°^ i^2„i^,f!'*^^=^ THEM ? "HDATA STATNEMT5 
SS^SF'^I^i.T '' "INSERT DISK CONTAINING 
DOSHL.SYS":? "THEN PRESS AMY KEY" 

GO 180 IF PEEK (764) =255 THEN 180 

DL 190 IF PAS5=0 THEM OPEN ttl, 8, 0, "Dl : AUT 
DRUM . SYS" : PAS5=2 : LINE=220 : RESTORE 220 
TRAP 200:? "^CREATING FILE": GOTO 90 

HY 200 CLOSE ttl: END 

JL 210 IF LEN(DATS)=48 AND LINE=260 THEM 
TRAP 170:GOTO 100 

MI 220 ? "BAD DATA: LINE "; LINE: END 

UJ 230 DATA FFFFO9OA430AAC25AF88FOOeAOFOA 
99ODOO4A07OA91O8D5CAB8C4FABA9FF8D29AF4 
C48AB2O310AAD2EAF9900OA6O8A4A,714 

CG 240 DATA 4A4A4AA860AC25AF88DOO2297F8D2 
CAF6OAAA7C8A72031OAB9OOOA48AC25AF88FOO 
14A2033OA8D2DAF680A0AOA0A2e38,628 

KO 250 DATA eA4C90ACBAA5BCA52027eA43AB45A 
B4CO90ABAA9BAA9D044OAe4OA2eOOOOA9528DE 
702A90A8DE8e26eA50C8D450AA50D,623 

KU 260 DATA 8D468AA94485eCA90A850D60E702E 
8O252OAEe02E18252eA,268 



Listing 3 
BASIC listing 

JA 10 REH KKKKKKKKKKKKKKK 

HY 20 REN » DOS CD FOR * 

NC 30 REN » SMARTDOS » 

LI 40 REM » BY » 

SB 50 REN » A. GIANBRA * 

JF 60 REN KKKXKKlCKXXKMKMlt 

^^ 2«„'>?I'*,?'i'2'3,4,5,6,7,8,9,O,O,0,0,O, 
0,0,10,11,12,13,14,15 

RU 80 DIN DAT$(96),HEX(22} :FOR X=0 TO 22: 
READ N:HEX(XI=N:NEXT X;LINE=220 : RESTOR 
E 220: TRAP 160:? "((CHECKING DATA" 



PAGE 48 / MAY 1988 



ANALOG COMPUTING 



QK 99 TOTAL=B:LIME=LIME+ie! POSITION 2,2:? 
■•LIKE:"; LINE :REftD DftTS:IF LEHtDftTSjO 

AC THFM 71fl 

TO 180 DftTLIH=PEEKC183J+PEEKtl84)»256:IF 
DftTLIHOLIME THEM ? "LIME ";LIME;" MIS 

JP 110 FOR X=i TO LEMtDftTSJ-1 STEP 2:Dl=ft 
SCtDftT$fK,XJ3-48:D2=ftSCtDftTS(X+l,X+in 
-48:BYTE=HEX(Dl)»16+HEXtD2J 

ZS 120 IF PftSS=2 THEM PUT «1,BYTE:MEXT X: 
READ CHKSUM:GDT0 90 

DH 130 T0TftL=T0TflL+HEXtDlJ+HEXCD2J :MEXT X 

GB 140 REftD CHKSUM:IF TOTftL=CHKSUM THEM 9 

jH iio £"pEiKtl95><>6 AMD PEEICC195J05 T 

VL 170 iF^PftSS=0 THEM ? "RDftTfl STflTMEMTS 
CORRECT":? :? "INSERT DISK COHTfllNIMG 
SMftRTDOS":? "THEM PRESS fiMY KEY" 

GO 180 IF PEEK C764J =255 THEM 180 

TY 190 IF PftSS=8 THEM OPEM «1, 8, 0,"D1 : SMfl 
HTDOS.flRl":PftSS=2:LINE=220: RESTORE 220 
:TRflP 208:? "ISCREftTIMG FILE": GOTO 90 

HY 200 CLOSE ttl : END 

GU 210 IF LEMtDftTSJ=46 AMD LIME=258 THEM 
TRAP 170:GOTO 108 

MI 228 ? "BAD DATA: LIME "; LIME: END 

OT 230 DATA FFFFC506FF86ACFE1288F006A0F8A 
99OD004A87eA9188D3A8F8C2DOFA9FF8D02134 
C260F20EDO6AD071399BCO6688A4A,685 

ON 248 DATA 4A4A4AA860ACFE1288DO02297F8D0 
51360880BA60B2eED0eB9BC8648ACFE1288F0O 
14A20EF868DO613680A0A0AeA20F4,ei3 

EB 258 DATA 864C6E109A899C0920E306218F238 
F4CC506980D98eDD8,276 



Listing 4 
BASIC listing 

JA 18 REM MKKICMMXmCKKMKlCM 

TY 20 REM « DOSCD FILE » 

OY 30 REM « CONVERTER * 

LI 40 REM » BY » 

SB 50 REM » A. GIAMBRA * 

JF 60 REM KKMKKXKMXKKMKXK 

EC 70 DATA 0,1,2,3,4*5,6,7,8,9,0,0,8,8,0, 
0,0,10,11,12,13,14,15 

RU 80 DIM DATSC96J,HEXC22> :FOR X=0 TO 22: 
READ N : HEX (X)=N: NEXT X : LINE=220 : RESTDR 
E 220:TRAP 160:? "HCHECKIMG DATA" 

QK 90 TOTAL=0:LIME=LINE+1O: POSITION 2,2:? 

"LIME:";line:read datS:if lencdatsjO 

96 THEN 210 
TO 108 DATLIN=PEEKC183)+PEEKtl84J»256:IF 

DATLINOLINE THEN ? "LINE ";LINE;" MIS 

SIMG!":END 
JP 110 FOR X=l TO LENCDATSl-1 STEP 2:D1=A 

SC tDAT$ CX, XJ J -48 : D2=A5C CDATS (X+1, X+IJ ) 

-48 : BYTE=HEX CD1JK16+HEX CD2J 
ZS 120 IF PAS5=2 THEN PUT «1,BYTE:NEXT X: 

READ CHKSUM:GDTO 90 
DH 130 T0TAL=T0TAL+HEXCD1J+HEXCD2) :NEXT X 
GB 140 READ CHKSUM:IF T0TAL=CHKSUM THEN 9 


MM 150 GOTO 220 ^^ ^ 

JW 160 IF PEEKC195J06 AND PEEKC195J05 T 

HEN 210 
RT 170 IF PASS=8 THEN ? "HDATA STATMENTS 

CORRECT":? :? "PRESS ANY KEY" 
GO 180 IF PEEK C7B4) =255 THEN 188 
ZW 190 IF PASS=0 THEN OPEN ttl,8, O, "Dl ; CON 

WERT . OBJ" : PAS5=2 : LINE=220 ; RESTORE 220 : 

TRAP 200:? "ISCREATING FILE": GOTO 90 
HY 200 CLOSE ttl:END 
KL 210 IF LENtDATSJ=84 AND LINE=368 THEN 

TRAP 178: GOTO 180 



MI 228 ? "BAD DATA: LINE "; LINE: END 

NX 238 DATA FFFF884537454449534B2e434F4E5 
6455253494F4E5554494C49545958524553532 
8D3D4C1D2D4E3EFEEF6E5F2F3E9EF,665 

UC 248 DATA EE28E9EE282eF0F2EFE7F2E5F3F33 
9453B45533A483C473748A210A9399D4403A94 
59D4503A9839D42e3A9889D4A83A9,633 

KM 258 DATA e29D4B032856E4A9828554A9e3855 
5A9OO8556A9Oe9D4403A9459D45O3A98F9D488 
3A9ee9D49e328CE48A9879D4883A9,568 

FM 268 DATA eF9D4403A94S9D4503A9O385S4A98 
685552OCE48A90B9D4803A9169D44e3A9459D4 
583A9858554A984855528CE48AD1F,601 

CD 270 DATA D0C9e6DeF9A9028554A9e38555A92 
19D44e3A9459D4503A90F9D48O328CE48A9838 
554A9058555A9309D44e3A9459D45,598 

DH 288 DATA 03A9e89D480320CE48A96985B3A90 
185B4A90O85BO85B285BD2e9148A5B38DeA03A 
5B48D0BO3A93C8D84e3A9458D05O3,593 

RH 290 DATA A952Ae4e8D02O38C030320BO48A9O 
085BAA4B2B93C452C3B45DOOBC90eD08CA9889 
93C45D8384833498585BA20D748E6,565 

10 300 DATA BD18A5B2691OB0e485B290D9A5BAF 
03FA90085BA85B2209148A5B38D0A03A5B48DO 
B03A93C8DO403A9458DO503A957A0,609 

10 310 DATA 8e8D02038C03O32OBO4818E6B3DOB 
2E6B4E6B0A5B0C9O89O034C8E484CFC476C0A0 
OA9O38D3845A9O18Deie3A931A00F,564 

GD 320 DATA 8D00e38C06O3A9OlA0808D09038C0 
8036O2059E41018CE38453013AD0203C952D0e 
4A240DOO2A28e8EO3034CBe4860A9,466 

GG 330 DATA eB9D42e32056E460A210984818694 
19D44O3A945698O9D45O3A90B9D4803A905855 
4A90485552OCE4868A8C8C8C8B93C,586 

SP 340 DATA 4585B5C8B93C4585B6209148A5B58 
D0A03A5B68DOB03A93C8DO4e3A9468D0583A95 
2A8408D02038Ce30320B048A5BD0A,574 

GB 350 DATA eA85B7AD3934497E4947290348e5B 
78D39472O9148A5B58D0AO3A5B68D0BO3A93C8 
De403A9468D05O3A957A08e8D0283,585 

UO 360 DATA 8CO3032eB048A90e85B785B86885B 
6Fee2E6B7AD3A4785B5F002E6B7A5B7F8034C0 
8496OE002E1O23C47, 516 

Listing 5 
Assembly listing 

.OPT NO LIST 

; KXMXXXKMKKXKKMKXK 
•K * 

;» DOS CD » 

;» by » 

}* A. GiaMbra * 
;» « 

; KXKXKKXKKKMKMKKICK 



;DOS EQUATES 

DRUTYP = S12FE 

BRANCH = $eF3A 

LENGTH = S8F2D 

CURFCB = $1301 

DHOLES = S1302 

CDIRD = S1305 

CDIRS = S1306 

SFNUM = $1307 

DOSTAB = $07D7 

ENTRDOS = S0F26 

RDDIR = $106E 



FIXDIR 



«= $1501 

LDY DRUTYP 

DEY 

BEQ SNGLE 

LDY «$F0 

LDA tt$98 

BNE EXITA 



;l=SINGLE 2=D0UBLE 
;BPL OR BCC 
;8 OR 16 ENTRIES 
; CURRENT FCB 
;DIRECTORY HOLE 
;DIR DISPLACEMENT 
;DIR SECTOR Cl-8) 
;FILE NUMBER 
;DOS TABLE 
;RE-ENRTY POINT 
;READ DIRECTORY 



;GET DRIVE TYPE 

;SIMGLE DENSITY? 

;YEP 

;16 ENTRIES 

;BCC 



ANALOG COMPUTING 



MAY 1988 / PAGE 49 



O DOS CD 



continued 



SNGLE 





LDY «$78 


;8 ENTRIES 


;DOS EQUATES 






LDA nSLB 


;BPL 








EXZTA 






DRUTYP 


- 


$AF25 




STA BRAHCH 


; MODIFY BRANCH 


BRANCH 


~ 


$AB5C 




STY LENGTH 


; MODIFY LENGTH 


LENGTH 


~ 


$AB4F 




LDA »SFF 


; BECAUSE ME 


CURFCB 


— 


$AF28 




STA DHOLES 


; DESTROYED THIS 


DHOLES 


^ 


$AF29 




JMP ENTRDOS 


;NOH GET BACK 


CDIRD 


— 


$AF2C 


SflVESECT 






CDIRS 


- 


$AF2D 




JSR SHIFT 




5FNUM 


— 


$AF2E 




LDA SFNUH 


;GET file NUMBER 


ENTRDOS 


- 


$AB48 




STA DOSTAB, 


Y ;SAUE IT 


RDDIR 


- 


$AC9a 




RTS 


;GET BACK 


DOSINI 


- 


$ec 


SHIFT 


TKA 




LOMEM 
; 


= 


$82E7 




LSR A 






w= 


$0A8e 


SHI 






DOSTAB 


»= 


»+9 




LSR A 


;MAKE IT AN INDEK 


FIXDIR 








LSR A 


;INTO OUR TABLE 




LDY 


DRUTYP 




LSR A 






DEY 






TAY 






BEQ 


SNGLE 




RTS 






LDY 


USF0 


MASK 








LDA 


tt$9e 




LDY DRUTYP 


; DRIVE TYPE 




BNE 


EXITA 




DEY 


; SINGLE? 


SNGLE 








BNE DOUBLE 






LDY 


»$7e 


DOUBLE 


AND tt$7F 


;MASK HIGH BIT 


EXITA 


LDA 


ttSie 




STA CDIRD 


;G0T DISPLACEMENT 




STA 


BRANCH 




RTS 






STY 


LENGTH 



1=SINGLE 2=D0UBLE 
BPL OR BCC 
8 OR 16 ENTRIES 
CURRENT FCB 
DIRECTORY HOLE 
DIR DISPLACEMENT 
DIR SECTOR C1-8J 
FILE NUMBER 
RE-ENRTY POINT 
READ DIRECTORY 
DOS VECTOR 
LOM MEMORY 



J GET DRIVE TYPE 

; SINGLE DENSITY? 

;YEP 

;16 ENTRIES 

JBCC 



ME MUST REPLACE THE RRDIR 
ROUTINE HITH OUR OHN 
THIS ROUTINE FIGURES OUT 
THE DIRECTORY SECTOR AND 
DISPLACEMENT USING THE 
FILE NUMBER 



SAVESECT 



;8 ENTRIES 
;BPL 



; MODIFY BRANCH 

_.. _ ; MODIFY LENGTH 

LDA «$FF ; BECAUSE ME 
STA DHOLES ;DESTROYED THIS 
JMP ENTRDOS ;NOM GET BACK 

JSR SHIFT 

LDA SFNUM ; GET FILE NUMBER 

STA DOSTAB, Y ;SAVE IT 

RTS ;GET BACK 



»= 


$6688 




SHIFT 








JSR 


SHIFT 


;GET TABLE INDEX 




TXA 






LDA 


DOSTAB, 


Y ;LOAD FILE NO. 




LSR 


A 




PHA 




J SAVE IT 


SHI 








LDY 


DRUTYP 


J GET DRIVE TYPE 




LSR 


A 


;MAKE IT AN INDEX 


DEY 




; SINGLE DENSITY? 




LSR 


A 


J INTO OUR TABLE 


BEQ 


SING 


;YEP? 




LSR 


A 




LSR 


A 


; SHIFT RIGHT 




TAY 






SING 








RTS 






JSR 


SHI 


; SHIFT 3 TIMES 


MASK 








STA 


CDIRS 


;GOT SECTOR 




LDY 


DRVTYP 


; CHECK DRIVE TYPE 


PLA 




; RESTORE NUMBER 




DEY 




; SINGLE DRIVE? 


ASL 


A 


; SHIFT LEFT 




BNE 


DOUBLE 




ASL 


A 


;FOUR TIMES 




AND 


tt$7F 


;MASK HIGH BIT 


ASL 


A 


;T0 EQUAL 


DOUBLE 








ASL 


A 


; DISPLACEMENT 




STA 


CDIRD 


;got displacement 


JSR 


MASK 


;CHECK DRIVE TYPE 




RTS 






JMP 


RDDIR 


;G0 TO DOS 


5VE 




« 




*= 


$e99A 












JSR 


SAVESECT ;INTERCEPT DOS 


;HE MUST 


REPLACE THE 


RRDIR 


«= 


$8F21 




; ROUTINE 


HITH OUR DMN 


JMP 


FIXDIR 


; DITTO 


;thi5 routine figures out 


»= 


$eD98 




;THE DIRECTORY SECTOR AND 


.BYTE $08 


; CHANGE BPL TO BNE 


; displacement 


' USING 


THE 


A 






jFILE NUMBER 






w 








«z 


$A7AA 






Listing 


6 




JSR 


SHIFT 


;GET TABLE INDEX 


Assembly listing 




LDA 


DOSTAB, 


Y ;load file no. 










PHA 




;5AVE IT 


.OPT 


NO LIST 




LDY 
DEY 


DRVTYP 


;get drive type 
; single density? 
;yep? 


J* » 






BEQ 


SING 


J* DOSXL.SYS 


» 






LSR 


A 


; SHIFT RIGHT 


;» CONVERSION » 




SING 








;* by 


W 






JSR 


SHI 


; SHIFT 3 TIMES 


;* A. GiaHbra « 






STA 


CDIRS 


;G0T SECTOR 


J* 


« 






PLA 
ASL 


A 


; RESTORE NUMBER 
; SHIFT LEFT 

ANALOG COMPUTING 


PAGE 50 / MAY 1988 











ASL A ;FOUR TIMES 

ASL A ;T0 EQUAL 

ASL A ; DISPLACEMENT 

J5R MASK ;GET DISPLACEMENT 

JMP RDDIR ;G0 TO DOS 
«= $A5BA 

J5R SAUESECT ; INTERCEPT DOS 
»= $AB43 

JMP FIXDIR ; DITTO 
«= $A9BA 

.BYTE $De ; CHANGE BPL TO BNE 
»= SWE 



SAUESECT 



SHIFT 



SHI 



ADDR 
RESET 



INIT 



JSR $00 



; INITIALIZE DOS 



LDA tt <INIT ; REESTABLISH 
STA LOMEM ; LOW MEMORY 
LDA tt >INIT 
STA LOMEM+i 
RTS 

LDA DOSINI ; POINT OUR VECTOR 

STA ADDR+1 ;T0 DOS INIT CODE 

LDA DOSINI+1 

STA ADDR+2 

LDA » <ADDR ; POINT DOS INIT 

STA DOSINI J TO OUR CODE 

LDA tt >ADDR 

STA DOSINI+1 

RTS 

*= S02E7 

.MORD INIT 
*= $02Ee 

.MORD INIT 



MASK 



DOUBLE 



JSR 
LDA 
STA 
RTS 

TXA 
LSR 

LSR 
LSR 
LSR 
TAY 
RTS 

LDY 
DEY 
BNE 
AND 

STA 
RTS 



SHIFT 
SFNUM i 
D05TftB,Y 



A 
A 
A 



DRUTYP 

DOUBLE 
«S7F 

CDIRD 



GET FILE NUMBER 
;SAUE IT 



[MAKE IT AN INDEX 
ilNTO OUR TABLE 



; DRIVE TYPE 
; SINGLE? 

;MASK HIGH BIT 

;GOT DISPLACEMENT 







Listing 


7 






Assembly listing 




.OPT 


NO LIST 




; 5MARTD0S MODIFICATION 


; bV 








} A. GiaHbra 




!DOS MODIFICATIONS* 




DRUTYP 


^nnn'^'- 


$12FE 


;l=5INGLE 2=D0UBLE 


BRANCH 


- 


S0F3A 


;BPL OR BCC 


LENGTH 


— 


$0F2D 


;8 OR 16 ENTRIES 


CURFCB 


- 


51301 


; CURRENT FCB 


DHOLES 


- 


$1302 


;DIRECTORY HOLE 


CDIRD 


- 


S1305 


JDIR DISPLACEMENT 


CDIRS 


- 


51306 


;DIR SECTOR C1-8J 


SFNUM 


— 


51307 


;FILE NUMBER 


ENTRDOS 


- 


S0F26 


;RE-ENRTY POINT 


RDDIR 


— 


5ie6E 


;READ DIRECTORY 


* 


»= 


5e6BC 




DOSTAB 


K= 


»+9 




FIXDIR 










LDY 


DRUTYP 


;GET DRIVE TYPE 




DEY 




; SINGLE DENSITY? 




BEQ 


SNGLE 


J YEP 




LDY 


ttSFO 


;16 ENTRIES 




LDA 


tt590 


;BCC 




BNE 


EXITA 




SNGLE 










LDY 


tt570 


;8 ENTRIES 




LDA 


tt5ie 


;BPL 


EXITA 










STA 


BRANCH 


; MODIFY BRANCH 




STY 


LENGTH 


{MODIFY LENGTH 




LDA 


tt5FF 


{BECAUSE ME 




STA 


DHOLES 


{DESTROYED THIS 




JMP 


ENTRDOS 


{NOM GET BACK 


ANALOG COMPUTING 





{ME MUST REPLACE THE RRDIR 
{ROUTINE MITH OUR OMN 
■THIS ROUTINE FIGURES OUT 
{THE DIRECTORY SECTOR ftND 
■DISPLACEMENT USING THE 
{FILE NUMBER 



«= 50688 

JSR SHIFT 

LDA DOSTAB, Y 

PHA 

LDY DRVTYP 

DEY 

BEQ SING 

LSR A 



SING 



JSR 

STA 

PLA 

ASL 

ASL 

ASL 

ASL 

JSR 

JMP 

¥t= 

JSR 

«= 

JMP 



SHI 
CDIRS 

A 

A 

A 

A 

MASK 

RDDIR 

5e99A 

SAVE5ECT 

S0F21 

FIXDIR 



GET TABLE INDEX 

{LOAD FILE NO. 

SAVE IT 

GET DRIVE TYPE 

SINGLE DENSITY? 

YEP? 

SHIFT RIGHT 

SHIFT 3 TIMES 
GOT SECTOR 
RESTORE NUMBER 
SHIFT LEFT 
FOUR TIMES 
TO EQUAL 
DISPLACEMENT 
GET DISPLACEMENT 
GO TO DOS 

{INTERCEPT DOS 

{DITTO 



.BYTE 5De {CHANGE BPL TO BNE 

Listing 8 
Assembly listing 

.OPT NO LIST 

MKKIOCKICKKKKKMKIIKMK 
» DISK « 

* CONVERSION * 
» by » 

* A. GIAMBRA * 



{DEVICE HANDLER 
{DEVICE NUMBER 
{I/O COMMAND 
{I/O STATUS 
{BUFFER ADDRESS 
{DH PUT ROUTINE 



{OS EQUATES 






«= 


50340 


lOCB 






ICHID 


W= 


»+l 


ICDNO 


*= 


«+l 


ICCOM 


»= 


»+l 


ICSTA 


«= 


«+l 


ICBADR 


»= 


»+2 


ICPUT 


«= 


»+2 



MAY 1988 / PAGE 51 




DOS CD 



continued 



ICBLEN 


w= 


»+2 


;BUFFER 


LENGTH 


ICAUXl 


»= 


»+l 


;auxiliary byte 


ICAUX2 


«= 


*+i 


;aux 2 




»= 


$8388 


;SIO ADDRESSES 


DDEUIC 


»r 


»+l 


; DEVICE 


DUNIT 


»r 


»+l 


;UNIT NO. 


DCONND 


»= 


»+l 


J COMMAND 


DSTflTS 


»= 


»+l 


; STATUS 


DBUFLO 


»= 


»+2 


; BUFFER ADDRESS 


DTIMLO 


»= 


»+l 


; TIMEOUT UALUE 


DUNU5E 


«= 


»+l 


;NOT USED 


DBYTLO 


»= 


*+2 


; NUMBER OF BYTES 


DAUXl 


*= 


»+2 


;AUXILIARY BYTES 


CIO 


~ 


$E456 


;0S I/O ROUTINE 


SIO 


~ 


SE459 


; SERIAL I/O 


DR 


~ 


$52 


;READ A SECTOR 


DM 


~ 


$57 


;MRITE A SECTOR 


DPN 


= 


$83 


;OPEN COMMAND 


OUTPUT 


= 


$88 


;OPEN DIRECTION 


PUT 


~ 


$eB 


;PUT CHARACTERS 


C0N50L 


r 


$D81F 


;STAHT KEY 


D05UEC 


~ 


$eA 


;dos vector 


SECTORS 


~ 


$68 


; SECTOR COUNTER 


INDEX 


~ 


$B2 


;hork index 


SN 


= 


$B3 


; SECTOR NUMBER 


DSEC 


r 


$B5 


;data sector 


TEMP 


^ 


$B7 


;MORK AREA 


FLAG 


~ 


$BA 


;NORK FLAG 


DOCNO 


^ 


$BD 


;FILE NUMBER 


ROMCRS 


z 


$54 


; CURSOR ROM 


COLORS 


= 


$55 


; CURSOR COLUMN 


i 


»r 


$4588 




START 


.BYTE "DISK 


CONUERSION" 


STARTl 


.BYTE "UTILITY" 


START2 
MSG 


.BYTE "PRESS WrVlrf" 


.BYTE " 


conuersioniin 


" 


MSGl 


.BY 


TE " 


progressU^H 




RETRY 


»+l 








SCREEN 


.BYTE "S:" 




MASK 


.BYTE $40 




DIR 


; 




DIRECTORY BUFFER 




»= 


»+256 




DATA 


i 




DATA BUFFER 




«r 


»+256 






■MACRO DSKIO 






JSR 


SETUP 


;SET UP REGISTERS 




LDA 


y.i. 






5TA 
LDA 
5TA 


DAUXl 

X2 

DAUXl+1 


;SET SECTOR ADDR 








LDA 


tt <y.z 






5TA 


DBUFLO 


; BUFFER ADDRESS 




LDA 


It >>C3 






STA 


DBUFLO+l 






LDA 


ny.4 






■ 


IF X4=DR 






LDY tt$4e 






, 1 


ELSE 






LDY tt$8e 






.ENDIF 






STA 


DCOMND 


; STORE COMMAND 




STY 


DSTATS 


; STORE DIRECTION 




JSR 


DOIO 






.ENDM 




BEGIN 










LDX 


tt$ie 


.-CHANNEL 1 




LDA 


tt <SCREEN J SET POINTER TO 




STA 


ICBADR,X 


; DEVICE NAME 




LDA 


» >SCREEN 




STA 


ICBADR+1 


,x 




LDA 


nOPN 


;OPEN COMMAND 




STA 


ICCON,X 






LDA 


ttOUTPUT 


JOPEN DIRECTION 




STA 


ICAUXl, X 






LDA 


tt2 


; GRAPHICS 2 




STA 


ICAUX2,X 






JSR 


CIO 


;D0 I/O 


PAGE 52 /MAY 1983 







; POSITION CURSOR 



MAIT 



LDA tt2 

STA ROMCRS 

LDA tt3 

STA COLORS 

LDA tS8 

STA COLCRS+1 

LDA tt <START ; POINT TO 15T 

STA ICBADR,X ; MESSAGE LINE 

LDA » >5TART 

STA ICBADR+l.X 

LDA tt <15 ; MESSAGE LENGTH 

STA ICBLEN, X 

LDA tt8 

STA ICBLEN+1,X 

JSR PRINT ; PRINT IT 

LDA tt <7 ; MESSAGE LENGTH 

STA ICBLEN, X 

LDA tt <START1 ; POINT TO 2ND 

STA ICBADR,X ;LINE OF MESSAGE 

LDA tt >START1 

STA ICBADR+1, X 

LDA tt3 ; POSITION CURSOR 

STA ROMCRS 

LDA tt6 

STA COLORS 

JSR PRINT ; PRINT IT 

LDA tt <11 ; MESSAGE LENGTH 

STA ICBLEN, X 

LDA tt <START2 ; POINT TO LINE 

STA ICBADR,X ;3 OF MESSAGE 

LDA tt >START2 

STA ICBADR+1, X 



LDA ttS 
STA ROMCRS 
LDA tt4 
STA COLCRS 
JSR PRINT 



; POSITION CURSOR 



; PRINT IT 



; start pressed? 

;no, hang around 
;position cursor 



; POINT TO MESSAGE 



LDA CONSOL 

CMP tte 

BNE MAIT 

LDA tt2 

STA ROMCRS 

LDA tt3 

STA COLCRS 

LDA n <MSG , 

STA ICBADR,X 

LDA tt >MSG 

STA ICBADR+1, X 

LDA tt <15 ;SET LENGTH 

STA ICBLEN, X 

JSR PRXHT ; PRINT IT 

LDA tt3 J POSITION CURSOR 

STA ROMCRS 

LDA tt5 

STA COLCRS 

LDA tt <MSG1 ; POINT TO NEXT 

STA ICBADR,X ; MESSAGE LINE 

LDA tt >MSG1 

STA ICBADR+1, X 

LDA tt <8 J SET LENGTH 

STA ICBLEN, X 

JSR PRINT ; PRINT IT 

LDA tt <361 ; POINT TO 15T 

?I? 1"^ ; DIRECTORY SECTOR 
LDA tt >361 
STA SH+1 
LDA tt8 

sta sectors 

sta index 

sta docno 
readsect 
;read directory sector 

DSKIO 5N,SN+1,DIR,DR 
LDA tt8 ;ZERO THE FLAG 
STA FLAG 
EXAMINE 

LDY INDEX ;PNT TO STAT BYTE 



ANALOG COMPUTING 



;INIT MORK AREAS 



DOFIX 
DONEXT 



LDA DIR,Y 
BIT HASK 
BNE DOFIX 

CMP ne 

BNE DONEXT 
LDA tt$8e 
STft DIB,Y 
BNE DONEXT 

STA FLAG 
JSB FIXIT 



;FILE IN USE? 
; YES, GO READ IT 
;STATUS ZERO? 
;M0, SKIP IT 
; DELETED FLAG 



;MAKE FLAG NON-O 
;G0 READ FILE 



INC DOCND ;INC FILE NO. 



; POINT TO NEXT 
; STATUS BYTE 
;DONE? 
;NOPE 



RESET 

;REMRITE 
RSI 

RS2 



CLC 

LDA INDEX 

ADC tt$ie 

BCS RESET 
STA INDEX 
BCC EXAMINE 

LDA FLAG ; ANYTHING IN DIR? 
BEQ FINISHED ;N0, DONE! 
LDA tte ;ZERO THE FLAG 
STA FLAG ;AND THE INDEX 
STA INDEX 
THE SECTOR 
DSKIO SN,SN+1,DIR,DM 



; POINT TO NEXT 

; DIRECTORY SECTOR 



RDSECT 

FINISHED 

SETUP 



CLC 

INC SN 
BNE RS2 
INC SN+1 

INC SECTORS ;INC SECTOR COUNT 
LDA SECTORS 

CMP its ;8 SECTORS READ? 
BCC RDSECT JN0,KEEP GOING 
JMP FINISHED 

JMP READSECT 

JMP (DOSUECl ;G0 TO DOS 



FIXIT 

LDX tt$ie ; CHANNEL 1 

TYA 

PHA ;SAUE V 

CLC ;PNT TO FILENAME 

ADC It <DIR+5 

STA ICBADR.X 

LDA n >DIR 

ADC na 

STA ICBADR+1,X 

LDA tt <11 ;SET NAME LENGTH 

STA ICBLEN,X 

LDA US ; POSITION CURSOR 

STA ROMCRS 

LDA »4 

STA COLCRS 

JSR PRINT 

PLA 

TAY 

INY 

INY 

INY 

LDA DIR,Y 

STA DSEC 

INY 

LDA DIR,Y 

STA DSEC+1 
READDATA 
;READ A DATA SECTOR 

DSKIO DSEC, D5EC+1, DATA, DR 

LDA DOCNO ;GET FILE NO. 

ASL A ;LEFT JUSTIFY IT 

ASL A 

STA TEMP ;SAUE IT 

LDA DATA+253 ;GET OLD FILE NO. 

AND ttSeZ ;MASK OFF SECTOR 

PHA ;HIGH BITSSSAUE IT 

ORA TEMP ; COMBINE MITH FILE NO 

STA DATA+253 J STORE IT 
;HRITE DATA SECTOR 

DSKIO DSEC, DSEC+1, DATA, DM 



; PRINT FILE NAME 

; RESTORE Y 
;ADD 3 TO Y 



;GET BEGINNING 
; SECTOR 



;SET RETRY COUNT 
;DRIUE 1 



J SET DEVICE NO. 
;SET TIMEOUT VALUE 



DOIO 



LDA »Z 

STA RETRY 

LDA ttl 

STA DUNIT 

LDA tt$3i 

LDY ttJ.5 

STA DDEVIC 

STY DTIMLO 

LDA ttl 

LDY tte 

STA DBYTLO+1 ;READ A 256 

STY DBYTLO ; BYTE SECTOR 

RTS 



;CALL SIO 
;MAS IT GOOD? 
;N0,DEC RETRY 
;N0 MORE RETRIES 
;GET COMMAND 
;HAS IT A READ 
;N0 
;READ DIRECTION 



N3 



N4 



LDA ttO 

STA TEMP 

STA TCMP+1 

PLA 

STA D5EC+1 

BEQ N3 

INC TEMP 



;ZERO TEMP 



;GET SECTOR HIGH 
; STORE IT 
;MAS IT ZERO? 
J NO 



LDA DATA+254 ; GET SECTOR LO 
STA DSEC ;NEXT DATA SECTOR 
BEQ N4 ;MAS IT ZERO? 
INC TEMP 





JSR 


SIO 




BPL 


XIT 




DEC 


RETRY 




BMI 


XIT 




LDA 


DCOMND 




CMP 


ttDR 




BNE 


Bi 




LDX 


tt$4B 




BNE 


B2 


Bl 








LDX 


tt$8B 


B2 








5TX 


DSTATS 




JMP 


DOIO 


XIT 


RTS 




PRINT 







EXIT 



LDA TEMP 
BEQ EXIT 
JMP READDATA 

RTS 

«= $e2Ee 

.MDRD BEGIN 
.END 



;DATA SEC VALID? 
;NO,END OF FILE 



; WRITE DIRECTION 
; RESET STATUS 



LDA ttPUT ;PUT BYTES 

STA ICCOM,X ; STORE IN COMMAND 

JSR CIO ;D0 I/O 

RTS 



ANALOG COMPUTING 



MAY 1988 / PAGE 53 




UTILITY 



48K Disk 



Busy Buddy 
Express 



Put your BBS on hold 
when you need a break 



by Matthew J.W. Ratcliff 



When it comes to telecomputing, I spend a lot of time 
on the modem. It can be more than a little frustrating when 
I'm interrupted while on-line and get timed out. Most bulle- 
tin boards have an automatic timing feature; if you don't 
enter something within a minute or so, you're logged off. 
This prevents the BBS from getting tied up all night, in the 
event someone forgets to log off. Off course, it also tends 
to prevent users from taking a brief intermission while stay- 
ing on line. What's really needed is a way to put the BBS 
"on hold." 

I've caught myself typing SPACE and BACKSPACE many 
times, to prevent that timeout while reading a long mes- 
sage. I suppose I could biiy a $300 programmable toy robot 
and train it to smack these two keys intermittently while I 
raid the fridge. Instead, I've created a more cost-effective 
"BBS space, backspace, intermittent typing hold on line 
imit" called Busy Buddy Express. 

To create your copy of Busy Buddy Express, type Listing 
1 using the "M/L Editor." Busy Buddy is a binary load file 
that hooks into the Atari's VBI (Vertical Blank Interrupt] vec- 
tor. Once loaded, a title screen is displayed, along with a 
brief reminder of how the program functions, and control 
is then returned to DOS. Busy Buddy is a tiny program— 

PAGE 54 / MAY 1988 



less than 128 bytes of memory it resides in the cassette buff- 
er [$400-47F)— and is safe from most terminal program's 
special routines that generally reside in page 6 ($600-$6FF]. 

After performing a binary load from DOS, you can then 
load Express 3.0, by Keith Ledbetter. There are lots of oth- 
er terminal programs available for your Atari, but Busy Bud- 
dy may not work with all of them. I talked to Keith about 
version 3.0, which is now available in both 850 and 1030 
versions, and he assured me that he "steals" the VBI vector 
"legally." Many terminal programs employ VBI routines for 
clocks and other things, which simply hook in their own 
vectors and exit to the operating system when Complete. Ex- 
press 3.0 checks the current vector (which will be that for 
Busy Buddy), saves it as the exit vector, then hooks in its 
own. 

Try Busy Buddy with other terminal programs. At the very 
worst, it won't work. If it doesn't, get Express 3.0. It's the 
best, in my opinion, and can be downloaded for free (it's 
a "share-ware" program) from many local BBSs and is in 
the teleconmiunications database on Delphi. The latest and 
greatest version of Express is always available for download- 
ing from ICD's own BBS at 815-968-2229. 

If you're on-line and need a break, simply press CTRL- 
SHIFT-INSERT (press the CONTROL and SHIFT buttons, 
then hit the insert, or greater than key). This will engage 

ANALOG COMPUTING 



Busy Buddy, and remind you that it's on by displaying an 
inverse letter B (for Busy) near the top left of your screen. 
Once every 3.5 seconds (approximately) a SPACE or BACK- 
SPACE character is alternately poked into the keyboard in- 
put register. The terminal program takes caie of the rest, 
thinking you had typed those keys yourself. In case you 
should forget that Busy Buddy is keeping you connected, 
it will automatically cancel itself after 15 minutes. (This can 
be a real lifesaver if you forget you're on hold while con- 
nected long distance.) Note that Busy Buddy fools the ter- 
minal program, but not the operating system. Your computer's 
Attract Mode is not disabled by Bud. 

To disengage Busy Buddy, simply press CTRL-SHIFT- 
CLEAR. An inverse letter C (for Canceled) will be displayed 
near the top left of the screen. 

You may wish to automatically install Busy Buddy every 
time you rim Express, but I wasn't successful in appending 
one file to the other, so both would automatically load and 
run. If you use SpartaDOS or DOS XL, you can create a 
batch file (such as STARTURBAT for Sparta, which is 
equivalent to an AUTORUN.SYS but can rim multiple com- 
mand files) to get the job done: BUSYBUD EXPRESS. You 
don't need to include the RS232 conraiand, since Express 
automatically boots the 850 (or 1030) handler itself. 

I tested Busy Buddy with Amodem Plus version 6.2, but 
it didn't work. I didn't test it with any other terminal soft- 
ware, because those are the only 8-bit terminal programs 
I've ever used regularly. If Busy Buddy doesn't work with 
your terminal software, I highly recommend Express 3.0. 
The price is right and you'll be hard put to find a more full- 
featured terminal program for the 8-bit Atari. 

The next time you find you're in a marathon FOREM BBS 
message entry session and nature calls, simply call upon 
Busy Buddy Express to keep you on-line. It's a sure cure 
for those BBS timeout blues! H 




Listing 1 
M/L Editor data 



leee DftTfl 255,255,0,64,251, 64,173,36, 2 

.141,9,4,173,37,2,141,1688 

iei8 DflTfl 1,4,169:6,168,4,166,28,228,2 

8,248,252,141,36,2,148,6219 

1828 DftTfl 37,2,169,33,141,3,4,169,211, 

141,2,4,169,8,141,4,1558 

1838 Dflffl 4;i78,169;il,141,66,3,173,22 

,65,141,72,3,142,73,3,864 

1848 DftTfl 169,72,141,68,3,169,64,141,6 

9,3,32,86,228,96,125,127,4983 

1058 DflTfl 168,194,245,243,249,168,194, 

245,228,228,249,168,197,248,248,242,13 

1868 DflTfl 229,243,243,168,155,127,66,8 

9,32,77,97,116,42,82,97,116,4377 

1878 DftTfl 32,45,32,182,114,111,189,32, 

65,78,65,76,79,71,155,155,3769 

1888 DflTfl 88,114,181,115,115,32,67,84, 

82,76,45,83,72,73,78,84,1488 

1898 DflTfl 45,73,78,83,69,82,84,32,116, 

111,32,181,118,97,98,188,3232 

1188 DflTfl 181,155,32,32,32,32,32,32,67 

.84,82,76,45,83,72,73,9819 

ill8 DflTfl 78;84;45;67,76,69,65,82,32,3 

2,116,111,32,188,185,115,2183 

1128 DflTfl 97,98,168,181,155,87,184,181 

,118,32,97,99,116,185,118,181,4983 

il3e Dflffl 44,32,66,117,115,121,32,66,1 

17,188,32,119,185,188,188,32,2799 

1148 DflTfl 97, 117, 116, 111, JS, 155, 116, IB 

5, 189, 191, 111, 117, 116, 32, 97, 182, 4729 

li58 DflTfl l"."f'"fj22{49, 53,32,189, 

185,118,117,116,181,115,155,116,5425 

1168 Dflffl 111,32,252,64,22,65,112,114, 



1888 

1818 

1828 

1838 

1848 

1858 

1868 

1878 

1888 

1898 

1188 

1118 

1128 

1138 

1148 

1158 

1168 

1178 

1188 

1198 

1288 

1218 

1228 

1238 

1248 

1258 

1268 

1278 

1288 

1298 

1388 

1318 

1328 

1338 

1348 

1358 

1368 

1378 

1388 

1398 

1488 

1418 

1428 

1438 

1448 

1458 

1460 

1478 

1480 

1490 

1588 

1510 

1528 

1538 

1548 

1558 

1560 

1570 

1580 

1598 

1595 

1600 



Listing 2 
Assembly listing 

WSflUEttD : BUSYBUD . M65 
*flSM,t»-,»D : BUSYBUD . COM 

.OPT OBJ 
« Busy Buddy XE by Mat«Rat 
» CtPl-Shft-> BUSY ON 
» Ctrl-5hft-< BUSY OFF 

FOURSEC = 211 ;flCTUflLLY 3.5 SEC 
; 3.5 SECONDS « 256 CMftXTIMEJ 

• EQUALS flBOUT 15 MINUTES 
JIFFY = 514 
BUSYON = 247 
BUSYOFF = 246 
UUBLKD = $0224 

CH = S02FC ^ 

SPACE = 33 ;INTERNflL CODE 
BS = 52 

SflUMSC = S58 ; screen ptr 

* Operating systen equates: 
CIO = SE456 
ICCOM = $8342 



ICBflL 
ICBAH 
ICBLL 
ICBLH 
ICflXl 
ICflX2 



S8344 
S8345 
$8348 
S8349 
S834A 
$834B 



PUTBIN = $8B 
W 

.ORG $4000 
INIT LDA UUBLKD J 
STA UEXIT 1 
LDA UUBLKD+1 
STA MEXIT+1 i 
n <STflRT 
n >STflRT 



install 
Busy Buddy 
; Express 
UBI routine 



LDA 
LDY 

LDX JIFFY 
HOLD CPX JIFFY ; 
BEQ HOLD ; 
STA UUBLKD ; 
STY UUBLKD+1 
LDA ttSPACE ; 
STA BACKUP ; 
LDA ttFOURSEC 
STA TIMER ; 
LDA ttO ; 
STA BUSYCTL ; 
TAX 

LDA ttPUTBIN ; 
STA ICCOM ; 
LDA LEN 
STA ICBLL 
STX ICBLH 
LDA tt <TITLE 
STA ICBAL 
LDA » >TITLE 
STA ICBAH 
JSR CIO 
RT5 ; Bacfc TO pua 

TITLE .BYTE "n^wksmmniBiiBr' 

.BYTE "^i",155 

.BYTE "TBY Mat»Rat - froH AN" 



sync up so 
a UBI won't 
crash the 

; installation 
procedure 
iniz variables 

; dela tiner 
of 3.5 seconds 
Busy control 
OFF for now 

print title 
screen 



Back to DOS 



ANALOG COMPUTING 



MAY 1988 / PAGE 55 



1605 
1610 
1615 
1620 
1625 
1630 
1635 
1640 
1645 
1650 
1655 
1668 
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 



LEN 
* 



■AL0G'M55,155 

■Press CTRL-SHIFT-INSE" 

■RT to enable", 155 

■ CTRL-SHIFT-CLEft" 

■R to disable", 155 

■Mhen active. Busy Bud" 

'Will auto-", 155 

■tineout after 15 Hinu" 

'tes" 155 

■ to pr event Mfl-BELL E" 

■IMgai!",155,155 



.BYTE 
.BYTE 
.BYTE 
.BYTE 
.BYTE 
.BYTE 
.BYTE 
.BYTE 
.BYTE 
.BYTE 

.BYTE 

.BYTE »-TITLE 



Busy Buddy UBI code 

installed. 

Actual prograM appears 

below. 



.ORG $0400 
UEXIT .MORD 
TIMER .BYTE 
BACKUP .BYTE 
BU5YCTL .BYTE 
MAXTIM .BYTE 
START PHP 
PHA 

LDA BUSYCTL 
BNE TIMIT 
TESTON LDA CH 

CHP ttBUSYON 
BNE EXIT 
INC BUSYCTL 

LDA no 

STA MAXTIM 
JSR BPR 
EXIT PLA 
PLP 



WBI exit vector 
3.5 Sec tiner 
Space or BS 
control fig 
15 Min tiHer 
UBI starts here 
save all stats 
and regs 

ON 

Busy on request? 

No, no change 
OFF, TURN IT ON 

256»3.5 = 15Nin 

Show ON Char Q 

Restore stats 

and reg ft exit 



1928 JMP CUEXIT) 

1930 TIMIT LDA CH 

1940 CMP ttBUSYOFF 

1950 BNE TIMl 

1960 CANCEL LDA ttO 

1970 STA BUSYCTL 

1980 JSR BPR 

1990 JMP EXIT 

2000 TIMl DEC TIMER 

2010 BNE EXIT 

2020 DEC MAXTIM 

2030 BEQ CANCEL 

2040 LDA ttFDURSEC 

2050 STA TIMER 

2060 LDA BACKUP 

2070 STA CH 

2080 CMP ttBS 

2090 BEQ PUTSP 

2100 LDA ttBS 

2110 STA BACKUP 

2120 JMP EXIT 

2130 PUTSP LDA ttSPACE 

2140 STA BACKUP 

2150 JMP EXIT 

2160 BPR TYA 

2170 PHA 

2180 LDY tt48 

2190 LDA tt67-32+128 

2200 SEC ; of display 

2210 SBC BUSYCTL ; by poking 

2220 STA CSAUM5C},V 

2230 PLA ; to screen RAM 

2250 RTS 

2260 .ORG S02E8 ; iniz addr 

2270 .WORD INIT ; for LOAD 

2288 .END 



Busy on 
; turn it off? 
No, tine it out 
yes, toggle ctl 

show Clear stat 

15 Hinute tine 
liNit? 

yes, cancel 
; NO, reset 
the tiHer 
Send the SPACE 
or BS character 
and set BACKUP 
variable for 
next tiMe. 



Show a Q or 
Q] status char 
near top left 



Get something 



Extra I 



An Atari 8-bit Extra 

from ANALOG Computing 

It's a book of some of the best 
articles and software listings 
submitted to ANALOG 
Computing— things we 

just couldn't fit in the 
monthly magazine 
pages. 

Owners of Atari 8-bit 
computers will find 
the Extra a must. 
It gives you games, 
tutorials, utilities, 
applications, and 
more— material 
you'll want 
to keep. 




$8.95 

PLUS $1.50 FOR 

POSTAGE AND 

HANDLING 



When you're looking 
for the best in Atari- 
tutorials, games, reviews 
and programs— look for 
ANALOG Computing. 

We're the magazine that 

always gives you something 

Extra. 



Don^t miss it! 



PAGE 56 /MAY 1988 



ANALOG COMPUTING 




Binary Load 
Pictures 



A utility to convert 
pictures to binary load files 



UTILITY 



48K Disk 



by Charles F. Johnson 



When you want to share a picture file with a friend you 
always have to make sure that he or she has the correct pro- 
gram to load and display the picture. If you operate a BBS, 
you've probably had to deal with lots of questions about how 
to load a certain picture file. Finally, there's a program to 
resolve these problems. Binary Load Pictures (BLP, for 
short) will take a Micro Painter or Micro Illustrator picture 
file and convert it into a binary file that can be loaded with 
any DOS. (Anyone owning a disk drive has some kind of 
DOS.) 

This program will handle either Micro Illustrator or 
Micro Painter files. It asks which type of picture you're con- 
verting, and then asks for the picture's filename and a new 
filename for the converted binary file. Type in the names 
with the D: drive specifier. (Remember to give different 
names so your original file remains intact.) I suggest using 
a filename extension of .OBJ for the converted file (this is 
an informal standard extension for a DOS binary load file). 
After you've entered the two filenames, sit back and let BLP 
go to work. In a short time, the binary file will be created 
using the filename you specified. 

When you load this file from the DOS menu, the picture 
will be displayed. Then a short machine language routine 



waits for you to press a key. When you do, you'll be returned 
to DOS. That's all there is to it! 

BLP can be used by machine language programmers to 
add a custom title screen to an already existing binary load 
program. Just use the DOS copy with append function, with 
your object filename as the source and the converted pic- 
ture filename as destination. Next time you load this com- 
poimd file, the title screen you've created with Micro 
Illustrator or Micro Painter will appear. After a keypress, 
the rest of the program file should load and run. The bi- 
nary load picture file itself can also be named AUTO- 
RUN.SYS, for a title screen every time you boot up. 

Listing 1 is MAKBIN.BAS, the BASIC program that con- 
verts the pictxires. Listing 2 is the MAC/65 assembly lan- 
guage source code for the short program that handles 
displaying the picture. You don't have to type in Listing 2 
to use MAKBIN.BAS — it's included for readers interested 
in 6502 assembly language. Take care when typing in the 
BASIC listing, and always save a copy of it before trying 
to run it. Have fim! H 



The two-letter checksum code preceding the line 
numbers here is not a part of the BASIC program. 
For further information, see the "BASIC Editor II," 
in issue 47. 



ANALOG COMPUTING 



MAY 1988 / PAGE 57 



Listing 1 
BASIC lisUng 

XO 18 GRAPHICS 8:? :? "Just a sec..." 

KT 28 DIM K$ CI), TEMPS C15J, IMS CIS), OUTS as 

) , BUFS C768e> , HEADERS C7J , H2S C7J , COL C4 J 
YI 38 DIM POKES C25J,GH7PLUS$C77J,IHITSC36 

AT 48 HEADERS=" irTtf| t»p. 

FU S8 RESTORE S8 : FOR 1=8 TO 4: READ BYTE:C 

0LCIJ=BYTE:MEXT I:DATA 48,282,148,12,8 
MH 68 I0=ADRC"hhh!2LUE]") :BUFS="r':BUFSC768 

81 =BUF$ : BUFS C2} =BUFS : BUF=ADR (BUFSJ 
RI 78 RESTORE 538 : FOR 1=1 TO 25 : READ BYTE 

;LET POKES CII =CHRS CBYTE} : NEXT I 
MJ 88 LET POKE=ADRCPOKESl 
PC 98 RESTORE 558 : FOR 1=1 TO 77 : READ BYTE 

: GR7PLUSS CII =CHRS CBYTE} : NEXT I 
DR 188 GR7PLUS=ADRCGR7PLUSS) 
IS 118 RESTORE 688:F0R 1=1 TO 36 : READ BYT 

E : INITS CI} =CHRS CBYTE} : NEXT I 
XN 128 INIT=ADRCINITS} 
ME 138 RESTORE 638! FOR 1=8 TO 237 : READ BY 

TElPOKE 1536+1, BYTE:NEXT I 
ZP 148 CLOSE tt3:0PEN tt3, 4, 8, " K ! " 
AW 158 GRAPHICS 8! ? :? " ■ iIi l' L ' iJ!>a JliH ll i M ^ 

U'B=H.'M;VMAiM";? : ? "by Charies > . J 

ohnson" 
VI 168 ? :? "Mhich type of file do you wa 

nt":? "to convert?":? ;? "Q-Koala S-M 

icroPainter >"; 
BK 178 GET tt3, K ! KS=CHRS CK} : IF KS<>"1" AND 

KS<>"2" THEN 178 
PX 188 ? KS:K0ALA=CK$="1"} 
YF 190 ? :? "Input Filenane >"j!lNPUT ttl6 

XN 191 IF LENCINS}<3 THEN 195 

WM 192 IF INSC2,2}="!" OR INSC3,3}= TH 

EN 288 



ZZ 19S TEHP$=IN$:IN$="Dl:":INSC4}=TEMPS 
HN 288 ? :? "Output Filenane >";!IHPUT »1 

6;0UTS 
QD 281 IF LENC0UTSX3 THEN 285 
FX 282 IF 0UTSC2,2}="!" OR OUTS C3,3}=" !" 

THEN 218 
BC 285 TEMPS=OUTS:OUTS="Dl:":0UTSC4)=TEMP 

YY 218 IF INS=0UTS THEN ? !? "INPUT AND 

UTPUT NAMES MUST DIFFER !": GOTO 198 
QO 228 OPEN ttl, 4, 0, INS : IF KOALA THEN GOSU 

B 368: GOTO 248 
VG 238 GOSUB 478 

lY 248 CLOSE ttl : OPEN tt2,8,8,0UTS 
YC 258 RESTORE 748: FOR 1=1 TO 284: READ BY 

TE:PUT tt2, BYTE: NEXT I 
ZO 268 0=USRtP0KE,866,ll,868,SCREEN,872,7 

688} :0=U5RCI0,32} 
JC 278 PUT tt2,248:PUT tt2,6 
LI 288 PUT 112,244: PUT tt2,6 
SU 298 FOR 1=8 TO 4:PUT tt2, COL CI} : NEXT 1 
GF 388 PUT 112,224: PUT tt2,2 
GU 318 PUT tt2,225:PUT tt2,2 
PY 328 PUT 112, 8: PUT »2,96 
XM 338 CLOSE HI: CLOSE 112 
JC 348 GRAPHICS 8:? :? "Conversion conple 

te.":? :END 

NL 358 REM ■ tiM >■ MiH g:» !»i> i rTTT^ 

SB 368 FOR 1=1 TO 7 : GET ttl, BYTE :H2S CI} =CH 

RS CBYTE} :NEXT I 
ZG 378 IF H2SOHEADERS THEN ? :? "ERROR! 

- ";IHS;" is not":? "a Koala picture f 

ile.":? :POP :END 
XQ 388 GOSUB 518: GET ttl, TYPE: FOR 1=1 TO 5 

:GET ttl, BYTE: NEXT I 
YM 398 FOR 1=8 TO 4 ! GET ttl, BYTE : POKE 788* 



Gear up Your Disk Drive For Big Savings! 
Save $14 Off Tlie Cover Price. 

SUBSCRIBE TO 



[COMPUTING] 



□ 1 Year $28 Save $14 

MCEYY 

D 1 Year with Disk $105 

DCEYY 



Name 



Address 



City State Zip 

Mal<e cinecks payable to: L.F.P. inc. Aiiow4-6 
weeks for delivery. 



D Payment Enclosed D Bill Me 

D Charge My D Visa D MC 

ft Exp 

Signature 

FOREIGN— Add $7 per year 

Iv^ONEY BACK if not deiigfited 

Analog 

P.O. Box 16927 

N. Hollywood, CA 91615 



PAGE 58 / MAY 1988 



ANALOG COMPUTING 



I,BVTE!COL(IJ=BYTE:MEJ{T I 
PQ 4ee FOR 1=1 TO 9:GET ttl, BYTE : NEXT I 
ME 418 POKE 858, 7: IF TYPE THEN Q=USRCPOKE 

,852,BUF} iGOTO 438 
DM 428 Q=USRCP0KE,852,SCREEK1 
ON 438 Q=USR (POKE, 856, 7688) :Q=USR CIO, 16} : 

CLOSE »! 
LX 448 IF TYPE THEN Q=U5R UNIT, BUF, TYPEJ 

ZK 458 RETURN 

UU 468 REM ■Iir;T!UH!iii J:n:iia!M Jtmn:!^ 
CX 478 GOSUB 518 : Q=USR CPOKE, 850, 7, 852, SCR 

EEN, 856, 7688} : Q=USR (10, 16) 
MF 488 GET ttl, BYTE : COL (4) =BYTE ! POKE 712, B 

YTE:FOR 1=8 TO 2: GET ttl, BYTE : COL (I) =BY 

TE:POKE 788+1, BYTE! NEXT I 

ZS 498 RETURN 

HN 588 REM ■.iaMii!Mrt:r;ia;»in.-Mii:».-in:<;<j:a 
RH 518 GRAPHICS 24 :Q=USR (GR7PLUS) : SCREEN= 

PEEK(88) -t-256»PEEK(89) ! RETURN 
ZA 528 REM ■>«#•■ Jil; Maii:f!iiiii«i:iM 
YZ 538 DATA 184,74,178,168,8,184,133,255, 

184,133,254,184,248,4,208,145,254,136, 

184,145, 254,282,288.237,96 

RU 548 REH ■T-Vf^ JilfM'rt'fcJJNlfcMililnai:!* 

ES 558 DATA 184,173,48,2,24,185,3,133,283 

,173,49,2,185,8,133,284,168,8,177,283, 

281,79,288,21 
SG 568 DATA 169,78,145,283,165,283,24,185 

,2,133,283,165,284,185,8,133,284,169,8 

,248,15,281,15,288 
ER 578 DATA 6,169,14,145,283,288,5,281,65 

,208,1,96,165,283,24,185,1,133,283,165 

,284,185,8,133 

JY 588 DATA 284.169,8,248,197 

ET 598 REM ■>T;li^»Jil!»i:>*a!MHH:i^ 

YG 688 DATA 184,184,133,284,184,133,283,1 

84,168,184,133,214,165,88,133,285,133, 

215,133,217,165,89,133,286 
KU 618 DATA 133,216,24,105,38,133,218,132 

,288,76,846 

UO 628 REM ■ ff;! t-M Jil ;■ !I:W :m^ 

NT 638 DATA 132,213,132,207,177,283,8,32, 

118,6,48,24,42,38,287,74,133,212,208,1 

4,177,283,133,213 
FK 648 DATA 32,110,6,177,283,133,212,32,1 

18,6,165,287,248,34,177,283,32,118,6,1 

45,285,166,214,224 
GS 650 DATA 2,288,6,32,215,6,76,68,6,32,1 

17, 6, 198, 212, 288, 238, 165, 213, 248, 188, 1 

98,213,16,222 
CL 668 DATA 177,283,133,289,32,118,6,165, 

269,145,285,166,214,224,2,288,6,32,215 

,6,76,98,6,32 
DK 678 DATA 117,6,198,212,288,233,165,213 

,248,158,198,213,16,225,238,283,288,2, 

238,284,96,24,165,285 
KN 688 DATA 185,80,133,285,144,2,238,286, 

165,285,197,217,288,42,165,286,197,218 

,208,36,165,288,288,33 
MY 698 DATA 238,288,24,165,215,185,48,133 

,205,165,216,105,8,133,286,24,165,217, 

185,48,133,217,144,2 
NB 780 DATA 238,218,238,215,288,2,238,216 

,95,198,288,165,215,133,285,133,217,16 

5,216,133,206,24,105,30 
BF 718 DATA 133,218,24,165,88,185,40,178, 

165,89,185,8,228,285,288,224,197,286,2 

88,228,184,184,96,238 
QQ 720 DATA 285,288,2,238,286,165,88,197, 

205,208,205,165,89,24,105,30,197,206,2 

08,196,2 48,238 

ZR 738 REM ■ >ri #;» Jil :» Ml -J:! :> MH M * < 1 =■ 
EN 748 DATA 255,255,8,96,67,96,162,4,189, 

195,2,157,245,6,189,248,6,157,196,2,28 

2,16,241,173 
LO 750 DATA 48,2,72,173,49,2,72,169,80,14 

1,48,2,169,96,141,49,2,169,255,141,252 
2 205 252 
DT 760 DATA 2,240,251,141,252,2,162,4,189 

,245,6,157,196,2,202,16,247,184,141,49 

,2,104,141,48 
MF 770 DATA 2,96,88,96,25,97,112,112,112, 

78,88,97,14,14,14,14,14,14,14,14,14,14 

,14,14 
OZ 780 DATA 14,14,14,14,14,14,14,14,14,14 

,14,14,14,14,14,14,14,14,14,14,14,14,1 

4,14 



PB 798 DATA 

,14,14,14 

4,14 
DK 888 DATA 

,14,14,14 

4,14 
TK 818 DATA 

,8,112,14 

4,14 
00 820 DATA 

,14,14,14 

4,14 
OQ 838 DATA 

,14,14,14 

4,14 
OS 848 DATA 

,14,14,14 

4,14 
UN 858 DATA 

,14,14,14 



14,14,14,14,14,14,14,14 
,14,14,14,14,14,14,14,14 

14,14,14,14,14,14,14,14, 
,14,14,14,14,14,14,14,14 

14,14,14,14,14,14,14,14, 
,14,14,14,14,14,14,14,14 

14,14,14,14,14,14,14,14, 
i, 14, 14, 14, 14, 14, 14, 14, 14 

14,14,14,14,14,14,14,14, 
14,14,14,14,14,14,14,14 

14,14,14,14,14,14,14,14, 
,14,14,14,14,14,14,14,14 

14,14,14,14,14,14,14,14,14,14 
,65,88,96,88,97,79,127 

Listing 2 
Assembly listing 



14,14 
,14,1 

14,14 
14,1 

14,78 
,14,1 

14,14 
,14,1 

14,14 
14,1 

14,14 
,14,1 



1800 




.OPT NO EJECT 


1010 






1020 




ROUTINE FOR MAKBIN.BAS 


1030 






1040 




By Charles F. Johnson 


1058 






1868 




Equates 


1878 






1880 


SDLSTL = S8238 


1890 


SDLSTH = S8231 


1100 


C0L0R8 = $82C4 


1110 


CH = S82FC 


1120 


1 




1130 


DLADDR = $6858 


1140 


1 




1150 




«= S86F8 


1160 


PICCOL .DS 5 


1170 


COLSAU .DS 5 


1180 


f 




1190 




«= $6888 


1200 




LDX tt4 


1210 


COLORS 


1220 




LDA COLORe,X ; Save current 


1230 




5TA COLSAU,X ;colors 


1240 




LDA PICCOL, X jcopy colors 


1250 




STA COLORO,X ; f roH page six 


1260 




DEX 


1270 




BPL COLORS 


1280 


/ 




1290 




LDA SDLSTL ; Save address 


1300 




PHA ;of display list 


1310 




LDA SDLSTH 


1320 




PHA 


1330 


; 




1340 




LDA tt <DLADDR ; Install our 


1358 




STA SDLSTL ;display list 


1360 




LDA tt >DLADDR 


1370 




STA SDLSTH 


1380 


# 




1398 




LDA tt$FF ;Clear key buffe 


1488 




STA CH 


1418 


j 




1428 


MAIT 


1430 




CMP CH ;Mait for 


1440 




BEQ MAIT ; keypress 


1450 


■ 




1460 




STA CH J Cancel keypress 


1478 




LDX tt4 


1488 


RE5C0L 


1498 




LDA COLSAU,X ;RestDre colors 


1500 




STA C0L0R8,X 


1510 




DEX 


1528 




BPL RESCOL 


1538 


t 




1548 




PLA ; Restore 


1558 




STA SDLSTH ;display list 


1568 




PLA 


1578 




STA SDLSTL 


1588 


i 




1598 




RTS ; Return 


1600 


J 




1610 




.OPT NO LIST 



ANALOG COMPUTING 



MAY 1988 / PAGE 59 



^^ 



GAME 



48K Cassette or Disk 



Cloudhopper 



Fly the friendly skies — sort of. 



by Greg Knauss 



When the volcano erupted in your sleepy little town, 
it caused quite a stir — as any volcano in one of those square 
midwe stern states v\rould. 

For weeks, the Knocks Volcano (as it came to be known) 
spat forth soot and molten rock. Fortunately, for some odd 
reason that we'll not get into here, the clouds that overhang 
the volcano absorbed the volcanic gook, thus saving the 
lower half of your town. 

Several banks of clouds still pass peacefully over the now 
calmed volcano, but at their heart presently lies hardened 
rock. (Hey, you want reality, read Newsweek.) 

Feeling adverturesome one day, you grabbed your faith- 
ful pogostick and invented the exhilirating art of cJoudhop- 
ping. You went out one day when the fog was lying low and 
just climbed up. A few tentative hops and you were off. . . 

Cloudhopping took the world by storm. Sports IJJustrat- 
ed ran a cover story. Readers Digest did a lengthy feature. 
The National Enquirer explained how you are actually an 
alien. Unfortunately, anyone else who tried this new thrill 
seemed to, er, die. The air currents that control the hard- 
ened clouds are very unpredicatable and the volcano is ea- 
ger to swallow those who misnavigate them. 

You've even invented a special suit to protect yourself if 
you should make such a silly mistake. The full-body jump- 
suit will protect against two such slips, and each time it's 
exposed to the super-heat of the volcano it changes color 
to remind you how many dives you've taken: purple for 
none, blue for one, and green for two. (For those of you with 
a black-and-white reality, the suit gets Ughter the more worn 
through it is.) 

Then one day, while touching up your tan, you notice 
large red balloons hovering over the volcano. Tied to each 
was something . . . bricks . . .yellow. Gold! Someone must be 
stealing the gold from Fort BCnox and tying it to balloons! 

Suddenly, a black helicopter shoots between the clouds 
and snags a balloon. The crooks are trying to collect the 
loot! 



You rush inside and grab your pogostick. You must res- 
cue the gold for the United States. Or at least for yourself. . . 

How to type 
(in three easy paragraphs) 

Intrigued, or perhaps greedy? Stick the Action! cartridge 
in your computer, and type in Listing 1, using D:CHECK 
in Action! (issue 44) to check your work. I apologize for the 
long data lists in the program, but, hey, I don't have to type 
them in . . . 

Save it.' Not after you rim it, not after you get a snack, 
now! Save it as "D:CLOUDHORACT" on disk, or with the 
original name "C:" for cassette. 

Now that Cloudhopper is saved (right?), go to the moni- 
tor, compile and run it. 

How not to die 

The game starts with a brazen title screen, for all to see. 

Large, puffy cloud banks float peacefully back and forth. 
It is a pleasantly pastoral scene— except for the evil black 
helicopter and the hot lick of flames. SELECT will decrease 
the cloud density, and speed them and the helicopter up. 
Continued presses (five, for you picky people) will continue 
this process to an extreme whereupon the whole mess will 
return to the start. In technical talk, these are called "levels." 

Once the thrill of flipping through all the levels has worn 
off, you can — wonder of wonders! — start the game. Can you 
guess how? That's right, press START! (Or use the trigger.) 

You begin the game at the bottom of the screen, content- 
edly bobbing on a lower, middle cloud. 

Suddenly a helicopter streaks by, only a few feet above 
your head. It banks, turns and heads for a second assault — 
this time on target! 

A press on the trigger or a desperate push on the joystick 
will boimce your pogostick high enough to reach the next 
bank. Whether there are supporting clouds there or not is 
a different matter. 

Left or right pushes on the stick, combined with a but- 
ton press or upwardly diagonal shoves, will send your fig- 
ure rocketing off at an angle. 

The bottom- most layer of clouds is protected from the un- 
steady gusts of wind that rebound the other banks by the 



PAGE 60 / MAY 1988 



ANALOG COMPUTING 



lip of the volcano. This gives you a rather handy resting 
place, provided the 'copter doesn't draw a bead on you. 
However, below these nicely placed clouds lies the searing 
heat of the volcano; a slight slip w^ill send you into it. 

In case you're wondering what the helicopter does aside 
from look menacing, here are the instructions concerning 
that. . .The helicopter, when it touches you, will push you 
in the direction it is traveling. This is at the very least an- 
noying and at the very most, deadly. 

Now we get to the good stuff: the gold! To grab a brick 
of gold, just touch the balloon onto which it is fastened. 
The balloon will pop and the reward is yours. 

Concerning points, the closer the balloon is to the flames, 
the more points it is worth. Point value also increases in 
higher levels. 

You will not always be able to grab a balloon by just touch- 
ing it though; sometimes your eyes will be, in the immor- 
tal words of Pink Floyd, "obscured by clouds," and it will 
require more than one wild stab to bvirst it. 

When all the balloons are collected from the sky, you 
rocket out the top of the screen and, like magic, more 
appear. 

In the unfortunate event of a dip in the volcano, press 
the trigger to bounce back onto the screen. 

An oddity of nature should probably be mentioned here. 
After a while (1,000 points) of this silly bouncing, your 
jumpsuit will collect enough soot to act as an extra layer 
of insulation. This turns your suit black and gives you an- 
other chance to barbecue yourself. 

After the last of the protecting cloth is burned from your 
body (when you take the plunge in a green suit), a press 
on the joystick button will return you to the title screen. 

The SPACE BAR toggles the pause feature during play. 

The end 

So, valiant Cloudhopper, art thou prepared for thy so- 
journ above the very fires of hell? Gold be there. . .Go and 
conquer — 'tis thine destiny. H 

Listing 1 
Action! listing 



CLOUDHOPPER 

by Greg Knauss 

Copyright 1988 by ANALOG COMputing 

CHECKSUM DATA 

[18 D4 B3 2E 68 84 47 59 

71 18 IB 42 6A 87 2F A5 

43 14 66 25 C6 F3 5E 4D 

B6 7D 89 AC 89 8E D3 91 

EE 91 86 SF 15 B6 73 E9 

IB 3C D3 B4 01 7B 6E 54 

97 68 B8 CO 93 69 93 C7 

31 1 

BYTE ST=t03,PM,Y,UP,K,5,P,00M5,ES, 

LIUES, CHX= tiej , CHY= 1483 , FG 
BYTE ARRAY CSPD C4J , CK t4J , CCMT t4J 
INT X1,CX1=[1] 
INT ARRAY CDIR C4] 
CARD 5C,J,I,CH,DRB,SCN,5CR=[e3 

PROC DLI5TC) 

[112 112 68 00444 68 80 68 80 

44 68 80 68 8044 68 00 68 80 

44 68 80 68 0044 68 004 

69 8 70 8 2 2 7 7 65 DLISTl 

RETURN 



PROC PLRUBIC) 

[162 3 189 244 6 240 89 56 221 248 6 

248 83 141 254 6 186 141 255 6 142 

253 6 24 169 189 253 6 24 109 252 
6 133 284 133 206 189 248 6 133 283 

173 254 6 133 285 189 248 6 178 232 
46 255 6 144 16 168 177 283 145 285 
169 8 145 283 136 282 288 244 76 87 
6 168 8 177 283 145 205 169 145 
203 200 282 288 244 174 253 6 173 

254 6 157 240 6 189 236 6 248 48 133 

283 24 138 141 253 6 189 235 6 133 

284 24 173 253 6 109 252 6 133 286 
189 248 6 133 205 189 248 6 170 160 
177 203 145 205 200 202 288 248 

174 253 6 169 157 236 6 202 48 3 
76 2 6 76 98 228 01 

RETURN 

PROC UBINITC} 

[169 7 162 6 160 32 92 228 961 

RETURN 

PROC CHSTOREC) 
[8 0008000 
8 1 21 170 8 
8 1 85 85 169 10 
5 85 85 85 106 170 
85 85 85 85 149 169 10 
85 85 85 89 85 178 170 
8 85 85 85 186 178 168 
85 85 149 170 
8 8 98 168 128 
3 3 15 15 15 63 252 255 

192 195 287 243 243 243 255 
8 8 3 287 243 243 255 255 

48 248 240 252 252 252 255 255 
15 63 255 255 255 255 63 15 
192 240 252 252 252 252 240 192 

1 1 1 1 15 15 15 8 

255 195 185 181 173 157 195 255 
255 247 247 247 247 247 247 255 
255 195 253 195 191 191 195 255 
255 195 253 227 253 253 195 255 
255 187 187 193 251 251 251 255 
255 195 191 195 253 253 195 255 
255 195 191 131 189 189 195 255 
255 129 253 251 247 247 247 255 
255 195 189 195 189 189 195 255 
255 195 189 193 253 253 195 255 
8 8 8 8 192 192 192 

255 255 255 255 255 255 255 255 
240 204 240 204 204 248 
204 204 204 48 48 48 8 
8 68 192 192 284 284 60 
252 284 252 248 284 284 
252 192 240 192 192 252 
204 204 240 204 204 204 
204 252 252 252 252 204 
48 284 252 284 284 284 8 
8 284 284 284 284 284 252 8 
8 252 192 252 12 12 252 
255 193 191 195 253 253 131 255 
255 193 191 191 191 191 193 255 
255 195 189 189 189 189 195 255 
255 131 189 189 131 167 185 255 
255 129 191 143 191 191 129 255 
255 255 231 231 255 231 231 255 
255 255 255 255 255 255 255 85 
253 253 253 253 253 253 253 253 
253 253 253 253 253 253 253 85 
253 253 253 253 253 244 288 64 
64 288 244 253 253 253 253 253 
255 255 255 255 127 31 7 1 
3 15 63 255 255 255 255 255 
253 255 255 255 127 31 7 1 
8 64 288 244 253 255 255 85 
64 288 80] 
RETURN 

PROC GUYCLOTHESCl 

[56 60 e e 36 126 255 90 126 60 60 60 



ANALOG COMPUTING 



MAY 1988 / PAGE 61 



^ Cloudhopper 



continued 



126 126 24 8 

28 60 e 8 36 126 255 98 126 68 68 68 

126 126 24 81 

RETURN 

PROC GUVFACECJ 

Ce 48 68 24 8 8 129 126 24 24 24 24 

126 24 8 

20 60 24 129 126 24 24 24 24 

126 24 0] 

RETURN 

PROC COPTER C) 

E240 16 56 77 143 222 124 48 

30 16 56 77 143 222 124 48 

15 8 28 178 241 123 62 12 

120 8 28 178 241 123 62 121 

RETURN 

PROC CLOUDS C) 



[5 6 


7 


6 


7 


6 


5 


4 


5 


6 


7 


8 











1 


2 


3 


4 5 


6 


5 


6 


7 


8 


8 











1 


2 


3 


4 


5 


6 


7 


6 7 


8 








1 


2 


3 


4 


5 


4 


5 


6 


7 


6 


7 


2 


8 


1 2 


3 


7 


8 


8 


8 


8 


1 


2 


3 


2 


3 


4 


5 


6 


7 


6 


7 8 


1 


8 


8 


8 


8 


8 


1 


2 


3 


7 


8 








1 


2 


3 


4 5 


4 


3 


4 


5 


6 


7 


6 


7 


8 














1 


2 


3 


4 5 


6 


7 


8 


8 


8 


8 


1 


2 


3 


4 


5 













001234565678888012 
345780000123454567 
800008128808123454 
678888800001234567 
818008880181237800 
000001234565456780 
000001234565 

000001234678000001 







8000000123678000 
3454565678000001 

3454780000 

2 3 4 6 7 8 

7 



8 8 12 
8 8 1 



8888881236 
123456567 



18 12 
8 8 18 



000012780000000000 
180000000001780000 



12 3 4 
12 3 6 7 8 1 



6 7 
2 7 



818000000 



280000000 
888888812 
123567888 



880000000000123456 



5 6 7 8 



12 8 8 



567800888888888001 

278000000000000123 

456545678000000000 

000000000001234545 

678127800000000000 

00000000000000000 

123454567800 







oooooooeoooooooooo 
oooooooeeooooooooe 

000008881234345676 
765456788800000000 
000008880000000000 
000000000000000000 
00000000000 03 

PROC SETCLOUDSCJ 
FOR J=l TO 120 DO 
S=PEEK CCLOUDS+ J+ST«120) 
P0KECJ+SC+160,S} 
POKECJ+SC+640,5] OD 
FOR J=l TO 120 DO 
S=PEEK CCLOUDSI^ J+ CST+ll «1201 
P0KECJ+SC+488,S} 
P0KECJ4^SC4^888,S} OD 
FOR J=l TO 48 DO 
SrPEEK CCLOUDS+ J+ST«1281 
P0KECSC+11284^J,5) 
I=RANDC4)+9 P0KEC5C+1320+J.I) 
IF 1=9 THEN 1=13 FI 



P0KECSC+1288+J,I-1} OD 
RETURN 

PROC RNDCLDC) 

CSPD CIJ =RAND (3) +9-5T*2 

RETURN 

PROC HOUECLDSC) 

FOR 1=0 TO 3 DO 

CCNTtI)==+l 

MHILE CCNTCI)>CSPDCI) DO 

IF CXCI)=77 THEN CDIRCI)=-1 RNDCLDC) 

FI 
IF CX(Il=e THEN CDIRCIJ=1 RNDCLDC} FI 
CXCI}==+CDIRCI) 

POKEC CDLIST+I»8+9 , SC+CX CIJ +I«24O+160) 
CCNTCII=1 
OD OD 
RETURN 

PROC BALLOONS C) 

P=0 

FOR 1=5 TO 35 DO 

P=RANDC4) 

IF P=0 THEN J=l FI 

IF P=l THEN J=7 FI 

IF P=2 THEN J=13 FI 

IF P=3 THEN J=19 FI 

POSITION CI, J} PRINT C"- . 4^«^4^m") 

I==+5 OD 

RETURN 

PROC PAUSE C} 

SNORSTC) POKE C764, 255) 

MHILE PEEKC764}<>33 DO OD 

POKE C764, 255) 

RETURN 

PROC PRNTSCRC) 

POKEC C88,SCN) 

POSITION C12,0) PRINTCCSCR] 

P0KECC88,SC} 

RETURN 

PROC BURNC) 

POKE CDLIST+45, SC+32«40+l) 

P=l IF CH1=1 THEN P=17 FI 

P0KEC1775,P) 

FOR 1=1 TO 300 DO OD 

POKE CDLIST+45, SC+33K40+1) 

P=9 IF CX1=1 THEN P=25 FI 

P0KEC1775,P) 

FOR 1=1 TO 300 DO OD 

RETURN 

PROC CHMOUEC) 

CHX==+CX1»C CST/2) *1) 

IF CHH<3 OR CHX>252 THEN CX1=-CX1 

CHY=RANDC5)«32+40 FI 

P0KEC53251,CHX) POKE C1783, CHYI 

IF CHX<X THEN SOUND CI, 190+ CCHX MOD 4) 

»20,14, CCHX-XJ/17-3J FI 
IF CHX>X THEN SOUND CI, 190+ CCHX MOD 4] 

»20,14, CX-CHXJ/17-3J FI 
RETURN 

PROC BLOOGACl 

SOUNDCO, 0,0,0) 

1=3 J=CX-50)/4-l 

DO 

P=LOCATECJ,I) 

I==+l IF 1=24 THEN 1=0 J==+l FI 

UNTIL P=45 OD 

SOUNDCO, 50, 10, 10) 

POSITION CJ,I-1) PRINTC" +++* ") 

00NS==+1 IF 00NS=6 THEN ES=1 FI 

SCR==+10+I»CST+1) PRNTSCRC) 

UP=16 SOUND CO, 0,0,0) 

RETURN 

PROC POSC) 

P0KEC53248,X) P0KEC53249, X) 



PAGE 62 / MAY 1988 



ANALOG COMPUTING 



POKEC53250,X) 
POKEC1780,V) POKE 11781, YJ 
P0KEC1782,Y*16J 

RETURN 

PROC SETUP C) 

GRAPHICS Cei POKE (559, 8) POKE (82, 81 

P0KE(752,1} P0KE(82,8I 
SCN=PEEKC (88 J SC= (PECK (106) -16) «256 
P0KEC(DLI5T+3,SC) 
POKEC (DLI5T+9, SC+4»48*1) 
POKEC (OLIST+12, 5C+7»48+l) 
POKEC (DLI5T+17, SC+ie»4e+lJ 
POKEC (DLIST+28, SC+13»48+1) 
POKEC (DLIST+25 , SC+16»4e+lJ 
POKEC CDLI5T+28,5C+19»40+1) 
POKEC (DLI5T+33, SC+22»4e+lJ 
POKEC (DLI5T+36, SC+25»40+lJ 
POKEC (DLI5T+41,SC+28»48+lJ 
POKEC tDLIST+45,5C+32»48+l) 
J=PEEKC{88) P0KEC(DLIST+48,JJ 
P0KEC(56e,DLI5TJ 
MOUEBLOCK (1536 , PLRUBI, 168) 
PM=PEEK(186>-32 DRB=PM*256+1 
ZERO (DRB+1824, 1824) P0KE(623,36) 
POKE (1788, PM+4) 
POKE (53277, 3) POKE (54279, PM) 
POKE (1771, PM) 
P0KE(1784,16) P0KE(1785,16) 

P0KE(1786,1) P0KE(1787,8) 
P0KE(1772,17) P0KE(1773,17) 

P0KE(1774,1) P0KE(1775,1) 
POKE (53259, 3) 
MOUEBLOCK (ORB, GUVFACE, 32) 
MOUEBLOCK (DRB+256 , GUYCLOTHES, 32) 
FOR 1=8 TO 256 DO POKE (DRB+I+512, 24) 

OD 
MOUEBLOCK (DRB+256»3, COPTER, 32) 

P0KE(784,30) P0KE(785,84) P0KE(7e6,15) 

P0KE(7e7,2) POKE(708,15) P0KE(789,8) 

POKE (718, 52) POKE (711, 42) 

POKE (712, 7»i6) 

POSITION (0,8) 

PRIMTEC 

PRINT ("H, 

CH=(PEEK(106)-24)«256 

MOUEBLOCK (CH, CHSTORE, 512) 

POKE (756, CH/256) 

ST=8 

FOR 1=8 TO 4 DO 

CDIR(I)=1 

CSPD (I) =RAND (3) +18-ST»2 

CX(I)=RAND(78)-i^l 

CCNT(I)=1 OD 
ZERO (50,2888) SETCLOUDSO 
RETURN 

PROC TITLEO 

P0KE(53278,e) P0KE(77,8) P0KEC(88,SC) 
POSITION (8, 7) 
PRINTE 
f" RLN M RLP M M ;LP") 

(•■ M M N M M M H M") 

PRINTE 

(•• QLN LLN QLO QLO LLD") 

POSITION (8, 13) 
PRINTE 

C" M M RLP )jP ;;P ;LN ;;P") 

PRINTE 

{" ;LM M H ;L0 ;L0 ;N ;;0") 

PRTMTE 

(" N N OLD N N LLN N5TU") 

POSITION (14j:20)___^^^ 

PRINT C'^BSZ^EEiaill"} 

PRNTSCRO SETCLOUDSO MOUECLDS () 
P0KE(559,62) X=128 Y=169 POSO 
DO 

MOUECLDSO BURNO CHMOUEO 
IF PEEK (53279) =5 THEM ST==+1 
IF 5T=5 THEM 5T=8 FI SETCLOUDSO 



JJiiJFGnIJKj;;;jiJjj 



FOR 1=8 TO 3 DO RNDCLDO OD FI 
UNTIL PEEK (53279) =6 OR STRIG(8)=0 OD 

P0KE(764,255) 

ZERO (5C+7«48, 128) 

ZERO (SC+13»48, 128) 

ZER0(SC+28»48,48) 

SCR=8 LIVE5=3 UP=8 Kl=8 00NS=8 FG=8 

POKEC (88, SCN) ___ 

POSITION (12, 8) PRINT (■'8Hm") 

P0KEC(88,SC) 

RETURN 

PROC MAINO 

DO 

SETUP O TITLEO 

BALLOONS () 

WHILE LIUE5>0 DO 

Xl=8 X=12e 

DO 

ES=0 

HHILE ES=e DO 

POKE (77, 8) HOUECLDSO 

S=STICK(8) 

P=PCEK (53254) 

IF S=7 THEN POKE (1772,1) POKE (1773,1) 

FI 
IF S=ll THEN POKE (1772, 17) 

POKE (1773, 17) FI 
IF P=l OR P=2 THEM 

IF S=7 THEN Xl=l FI 

IF S=ll THEN Xl=-1 FI FI 
IF PEEK (53263) =3 THEM X1=CX1 FI 
IF X>288 THEM Xl=-1 X==-l FI 
IF X<58 THEM Xl=l X==+l FI 
K==+X1 
IF UP=8 THEN SOUND(8,8,8,0) FI 

y==+i 

IF UP=0 AND (P=l OR P=2) THEN UP=5 

Xl=8 

IF 5=14 OR 5=10 OR 5=6 OR 5TRIG(0)=0 
THEN UP=25 FI 

IF S=ie OR 5=11 THEN Xl=-1 FI 

IF S=6 OR 5=7 THEN Xl=l FI FI 
IF Y<5 THEM UP=B FI 
IF UP=8 AND (P=l OR P=2) THEN 

UP=5 FI 
IF UP>8 THEN UP==-1 Y==-2 

S0UND(8,UP»5+5e,18,4) FI 
IF UP>5 THEN Y==-l FI 
POSO 
IF PEEK(53252)=4 AND Y<18e 

THEN BLOOGAO FI 
POKE (53278, 8) 
IF Y=188 AND UP=0 THEN ES=2 

FOR J=181 TO 248 DO MOUECLDSO Y==+l 

X==+X1 POSO CHMDUEO BURNO OD FI 
BURNO CHMOUEO 

IF PEEK (764) =33 THEN PAUSE O FI 
IF SCR>999 AND FG=8 THEN FG=PEEK(785) 

POKE (785, 2) LIUES==+1 FI 
OD 
IF 0DNS=6 THEM FOR J=4 TO Y/3 DO Y==-3 

POSO BURNO CHMOUEO MOUECLDSO 

SOUND(8,Y+58,10,4) OD 

SNDRSTO X=128 V=l UP=0 Xl=8 POSO 

ST==+1 IF ST=5 THEM ST=3 FI 

SETCLOUDSO BALLOONS O 00NS=8 FI 
UNTIL ES=2 OD 
P=PEEK(785) 
IF P=84 THEM S=118 FI 
IF P=118 THEN 5=184 FI 
POKE (785, 5) 

IF FG>1 THEN POKE (785, FG) FG=1 FI 
LIUES==-1 
Y=248 UP=40 

HHILE 5TRIG(8)=1 DO MOUECLDSO BURNO 
CHMOUEO 
P0KE(764,255) 
OD 

X=8 POSO 
OD 
OD 



ANALOG COMPUTING 



MAY 1988 / PAGE 63 



* 



GRAPHICS 



48K Disk 



The APAC 
System 



The "Any Point, Any Color" system 
that gives you access to an 80 by 
96 graphics mode with 256 colors 



by Thomas Tanida 



How would you like a graphics mode with 80 by 96 reso- 
lution? "Big deal," you say, since one doesn't even need an 
ST for that. How about if I said you could get this and the 
ability to put any of 256 colors anywhere on the screen, 
without resorting to display list interrupts or such tricks, 
in just 8K of memory? You can do this from your Atari 8-bit, 
just by using a fimction as simple as a BASIC PLOT state- 
ment. 

The wonder behind all of this is something I call the 
APAC System, meaning "Any Point, Any Color." It gives you 
access to an 80 by 96 graphics mode with 256 colors. Just 
a single USR statement from BASIC (or a JSR from machine 
language), and this special graphics mode is set up. A few 
more USRs and you'll be doing PLOTs and DRAWTOs with 
hardly any effort. 

Listing 1 is the object code for APAC. Type it in using 
the ANALOG M/L Editor (found elsewhere in this issue). 
After saving the object code to disk, you may load it from 
DOS as a binary file, or you may rename it AUTORUN.SYS 
and boot the disk containing it. It will install itself begin- 
ning at location 8960 ($2300) and move the OS MEMLO 
pointers up to protect itself. It is also RESET-proof. 

Listing 2 (the longer BASIC program) is an Atari BASIC 
demonstration program for the APAC System. Type this pro- 
gram in and save it to disk. Run it, provided APAC has been 
loaded, and let it go for a few minutes. Press START to exit, 
OPTION to clear the screen. Then type in Listing 3, save 
it, and run it for another demonstration. You'll be impress- 
ed. For best effects, turn up the brightness and color levels 
of your television or monitor. 



Listing 4 is a machine language kaleidoscope demonstra- 
tion program. To use it, enter it using M/L Editor. From 
DOS, load the demo as a binary file and run at $6000. You 
must have APAC loaded in for the demo to work, since it 
accesses APAC. While the kaleidoscope demo nms, you may 
press the SPACE BAR to pause, ESCAPE to exit, or START 
to clear the screen. 

Warning: If you type DOS from BASIC, any program you 
have in memory will be erased. Always save your program 
to disk before entering DOS. Also, if you are using Atari 
DOS 2. OS, you should create a MEM.SAV file if you want 
to keep APAC in memory, or load APAC from the DOS menu 
upon leaving DOS. APAC is erased when DUP.SYS is loaded. 

Listings 5 and 6 are the MAC/65 source code for the APAC 
System and the kaleidoscope demo, respectively, and are 
included only for those people interested in assembly lan- 
guage programming. 

How to use APAC with your own programs 

With BASIC: Examine Line 30000 of either BASIC 
demonstration program. This reveals the following lo- 
cations: 

8960 — The PLOT routine 
8963 — The DRAWTO routine 
8966 — The EXIT APAC routine 
8969 — The INIT APAC routine 

INITAPAC — Usage: Q = USR(8969). This turns 
on the APAC graphics mode. 

EXIT APAC — Usage: Q = USR(8966). This re- 
stores a Graphics screen. This call to the APAC 
System is necessary to disable APAC because it re- 



PAGE 64 / MAY 1988 



ANALOG COMPUTING 



stores certain OS interrupt pointers. For more on 
this, see "How it works," below. 

PLOT — Usage: Q = USR(8960,xpGS,ypos,color). 
The "xpos" represents the x-position (0-79) and 
"ypos" represents the y-position (0-95). "Color" is 
any color (0-255), calculated by the function 
16 * color + liuninance, which is exactly the same as 
if you were poking it into registers 704-712. The 
current color is always kept in location 203 ($CB). 
DRAWTO — Usage: Q = USR(8963,xpos,ypos, 
color). The "xpos" represents the destination x- 
position, and "ypos" represents the destination y- 
position. "Color" is the same as above. You must 
specify the color. It will draw a line from the cur- 
rent coordinate position specified in the last PLOT 
or DRAWTO made (or 0,0 if you are just starting 
out). If you would like to use DRAWTO with the 
color last used and you don't know what that color 
is, you can use: Q = USR(8963,xpos,ypos,PEEK 
(203)). For all of the above functions, if you attempt 
to pass too many or too few parameters to them, 
the function will be aborted. Also, if you try to plot 
beyond the screen boimdaries, the function will be 
aborted. 
To use APAC from a machine language program, the key 
locations are: $230C (8972) = PLOT; $230F (8975) = DRAW- 
TO; $2312 (8978) for EXIT APAC; and $2315 (8981) for INIT 
APAC. Make sure your program does not overlap locations 
$2300 through the value contained in MEMLO ($02E7- 
$02E8), or a system crash will most Ukely occvir. The much 
used and abused page six is left untouched. Locations 
203-222 ($CB-$DE) are altered by APAC. JSR to the loca- 
tions given above as follows: 

PLOT; ace = color; x-reg = x-pos; y-reg = y-pos. 
DRAWTO: acc= color; x-reg= destination x-pos; y- 
reg= destination y-pos. 

INIT and EXIT: All registers ignored and altered. 
Note: Remember that the current color is always kept in lo- 
cation $CB (203). Also, from machine language there is no 
error checking for the PLOT and DRAWTO routines. 

To use APAC with the Action! language, make the fol- 
lowing declarations within yoin program: 
PROC InitAPAC = $23150 
PROC ExitAPAC = $23120 

PROC PlotAPAC = $230C(BYTE xpos, ypos, col) 
PROC DrawAPAC = $230F(BYTE xpos, ypos, col) 
Call InitAPACO to set up the APAC graphics mode, and 
ExitAPACO to clear the APAC graphics mode and return to 
Graphics 0. Call PlotAPAC with three parameters to plot a 
point in the given color (col) at the given coordinates (xpos, 
ypos) and call DrawAPAC to draw a line from the last plot- 
ted point to the given coordinates (xpos, ypos) in the given 
color (col). 

How it works 

When I said you would need no display list interrupts, 
I fibbed. APAC uses DLIs on every line of the screen in a 
special way that lets you show any of 256 colors at any pix- 
el. It essentially sets up a graphics mode vwth a line of GTIA 
Graphics mode 9, followed by a line of Graphics mode 11, 
followed, followed by 9, and so on. When this shows up 
on the screen, the luminance of Graphics 9 and color of 
Graphics 11 blend together. Since Graphics 9 has 16 lu- 
minances and Graphics 11 has 16 hues, you get 16 times 
16(256)colors. The blending effect is what causes those 



horizontal blank lines most of the time; what appears to be 
the blank lines are really the Graphics 11 lines. 

In addition to the DLIs, there is an immediate mode VBI 
which keeps the screen in sync. But to use APAC, all you 
have to do is call the INIT APAC, EXIT APAC, PLOT and 
DRAWTO routines correctly and APAC will do the rest. The 
DRAWTO routine uses the same vector algorithm published 
in Tom Hudson's "BASIC Training" (issue 18). I translated 
the BASIC Usting into machine language and optimized the 
code greatly. (I suspect Tom had translated the BASIC code 
from machine language since it was a bit inefficient, but 
since his first name is Tom, he must be a good programmer.) 

Maybe in the future, I'll see some really good applica- 
tions for APAC: multi-colored, three dimensional spheres 
floating in space, or a fancy drawing program. Oh yes, there 
is yet another way to get 256 colors on the screen at any 
point, with 80 by 192 resolution and no blank lines, requir- 
ing 16K or memory and absolutely no DLIs (I promise!) In- 
terested? I'll leave that up to you, the reader, to figure out 
how it might be one, but here's a hint: Use both Graphics 
9 and 11, but in a different method than APAC. Will there 
be an APAC-II? We'll see. . . B 



The two-letter checksum code preceding the line 
numbers here is not a part of the BASIC program. 
For further information, see the "BASIC Editor II," 
in issue 47. 



Listing 1 
M/L Editor listing 



leee data 255,255,253,34,248,35,76,0,6 

4,76,24,35,76,136,35,76,1295 

ifllfl DATA 57,36,76,149,35,76,43,35,76, 

163,35,76,63,36,76,155,1734 

1020 DATA 36,104,201,3,240,3,76,152,37 

, 104, 104, 170, 104, 104, 168, 104, 6394 

1030 DATA 104,32,139,37,133,203,134,85 

,132,84,185,211,37,133,204,185,222 

1040 DATA 51,38,133,205,138,74,168,177 

, 204 , 133, 206 , 138, 41 , 1, 170 , 165, 8937 

1850 DATA 206,61,134,35,133,206,165,20 

3,224,1,208,5,41,15,76,92,4329 

1060 DATA 35,10,10,10,10,5,206,145,204 

,24,165,204,105,40,133,204,7390 

1070 DATA 144,2,230,205,177,204,61,134 

,35,133,206,165,203,224,1,208,1345 

1080 DATA 7,74,74,74,74,76,129,35,41,2 

40,5,206,145,204,96,15,5479 

1890 DATA 240,104,201,3,240,3,76,152,3 

7,104,104,170,104,104,168,165,7644 

1100 DATA 85,133,212,165,84,133,213,10 

4,104,32,139,37,134,221,132,215,9773 

1110 DATA 32,43,35,164,215,162,6,169,0 

,149,213,202,208,251,166,221,3931 

1120 DATA 228,212,240,20,144,7,138,229 

, 212, 230 , 214 , 208, 9 , 198, 214, 134 , 3433 

1130 DATA 221,165,212,56,229,221,133,2 

18,196,213,240,20,144,7,152,229,2375 

1140 DATA 213,230,215,208,9,198,215,13 

2,221,165,213,56,229,221,133,219,5308 

1150 DATA 165,218,197,219,144,4,133,21 

7,176,4,165,219,133,216,133,222,2996 

1160 DATA 133,220,249,35,244,36,70,216 

,70,217,165,222,240,55,165,216,3374 

1170 DATA 24,101,218,133,216,197,220,1 

44, 11, 229, 220, 133, 216, 165, 212, 24, 2623 

1180 DATA 101,214,133,212,165,217,24,1 

81, 219, 133, 217, 197, 220, 144, 11, 229, 2816 

1190 DATA 220,133,217,165,213,24,101,2 

15,133,213,166,212,164,213,32,45,634 

1200 DATA 35,198,222,208,201,96,104,24 

0, 3, 76, 152, 37, 173, 11, 212, 201, 9060 

1210 DATA 64,176,249,173,145,36,141,34 

,2,173,146,36,141,35,2,169,4108 

1220 DATA 64,141,14,212,162,0,169,12,1 



ANALOG COMPUTING 



MAY 1988 / PAGE 65 



fjQ APAC System continued 

41,66,3,32,86,228,162,8,3631 

1238 DATA 142,75,3,169,3,141,66,3,169, 

147,141,68,3,169,36,141,4113 

1248 DATA 69,3,169,12,141,74,3,32,86,2 

28,169,127,141,14,212,169,7646 

12S8 DATA 147,141,231,2,133,128,169,38 

,141,232,2,133,129,96,8,8,3528 

1268 DATA 69,58,184,248,3,76,152,37,16 

9,8,141,47,2,141,14,212,3786 

1278 DATA 133,84,133,85,133,86,141,283 

,2,133,283,133,284,141,48,2,6657 

1288 DATA 168,165,186,56,233,32,133,28 

5,141,49,2,169,112,145,284,288,9883 

1298 DATA 192,3,288,249,169,144,145,28 

4,169,287,298,145,284,169,8,288,3213 

1300 DATA 145,204,133,88,166,205,232,1 

38, 133, 89, 288, 145, 204, 200, 169, 143, 3694 

1310 DATA 145,284,200,192,208,208,249, 

160,102,169,207,145,204,169,0,200,3345 

1320 DATA 145,204,245,36,210,37,165,18 

6,56,233,16,288,145,204,160,200,1778 

1338 DATA 169,65,145,204,200,169,8,145 

,264,288,165,285,145,204,165,88,2789 

1348 DATA 133,8,165,89,133,1,24,185,38 

,133,221,168,8,152,145,8,4257 

1358 DATA 136,288,251,238,1,165,1,197, 

221,144,240,165,89,133,1,168,9796 

1368 DATA 0,165,8,153,211,37,165,1,153 

,51,38,24,165,0,105,88,2335 

1378 DATA 133,0,144,2,230,1,208,192,96 

, 208, 238, 173, 34, 2, 141, 145, 8490 

1380 DATA 36,173,35,2,141,146,36,169,6 

,162,37,160,161,32,92,228,6638 

1398 DATA 169,179,141,0,2,159,37,141,1 

,2,169,64,141,111,2,169,3528 

1488 DATA 192,141,14,212,169,34,141,47 

,2,96,32,255,255,169,121,133,9198 

1410 DATA 12,133,2,169,37,133,13,133,3 

,76,130,36,224,80,144,2,3381 

1420 DATA 176,4,192,96,144,227,104,104 

,96,178,248,5,184,184,202,208,636 

1438 DATA 251,96,72,169,192,141,14,212 

,169,179,141,8,2,141,283,2,6384 

1448 DATA 184,76,95,228,72,169,195,141 

,8,2,169,64,141,18,212,141,6816 

1458 DATA 27,288,184,64,72,169,179,141 

,8,2,169,192,141,18,212,141,7888 

1468 DATA 27,208,184,64,8,64,24,64,165 

,12,141,122,37,165,13,14113397 

1478 DATA 123,37,32,124,37,165,6,288,1 

,96,169,8,133,8,76,8,949 

* , 8, V , 1648 



Listing 2 
BASIC listing 

AR 1 REM « APAC DEMONSTRATION ttl 
NC 18 GRAPHICS 8:G0SUB 38800 
YC 20 L1XP1=32:L1KP2=48:L1YP1=58:L1YP2=38 
:HUE1=8 

KK 38 L2XP1=32:L2KP2=48!L2YP1=38:L2YP2=58 

:HUE2=136 
QK 48 GOSUB 1888 : L1KP1=L1KP1+RAND 
SD 50 GOSUB 1888:L1KP2=L1XP2+RAND 
SA 68 GOSUB 1888 : L1YP1=L1YP1+RAND 
TT 78 GOSUB 1888: L1YP2=L1YP2'I'RAND 
LD 86 Q=USRtPLTAP,LlXPl,LlYPl,HUEl) 
IM 90 Q=USRCDRH2AP,L1XP2,L1YP2,HUE1} 
IK 188 LlXPl=LlXPl+tLlXPl<lJ-aiXPl>78) 
LM 118 L1XP2=L1XP2+IL1XP2<1J-CL1XP2>78J 
JU 120 LlYPl=LlYPl+tLlYPl<lJ-CLlYPl>95J 
MX 130 LlYP2=LlYP2+tLlYP2<lJ-CLlYP2>95) 
PQ 140 HUE1=HUE1+1:IF HUE1=256 THEN HUE1= 

8 
OF 158 GOSUB 188e:L2XPl=L2XPl+RAND 
QB 168 GOSUB 1888 :L2XP2=L2XP2+RAND 
PZ 178 GOSUB 1888:L2YP1=L2VP1+RAND 
RV 188 GOSUB 1888:L2YP2=L2YP2+RAND 
SE 198 Q=USRCPLTAP,L2XP1,L2YP1,HUE2J 



QU 200 Q=USRCDRH2AP,L2XP2,L2YP2,HUE2] 
LB 210 L2XPl=L2XPl+tL2XPl<l>-CL2XPl>78) 
OD 228 L2XP2=L2XP2+CL2XP2<1}-CL2XP2>78} 
MM 230 L2YP1=L2YP1+CL2YP1<1)-CL2YP1>95J 
PO 240 L2YP2=L2YP2+CL2YP2<1J-CL2YP2>95) 
5M 250 HUE2=HUE2+l:IF HUE2=256 THEN HUE2= 

8 
EC 268 C0NS=PEEKC53279} 
EF 270 IF CDNS=3 THEN Q=USR CINITGR) 
LE 288 IF C0NS=6 THEN Q=USR CEXITGRI : END 
QI 300 GOTO 48 

XI 1808 RAND=INTCRNDC1}«31-1 
AC 1818 RETURN 
FZ 38888 INITGR=8969:PLTAP=8968:DRW2AP=89 

63:EXITGR=8966 
CS 38885 Q=USR CINITGR] 
DD 38818 RETURN 



Listing 3 
BASIC listing 



KU 1 REM « APAC DEMONSTRATION tt2 « 

IQ 5 GOSUB 38088 

QK 10 IF C0L>256 THEN C0L=C0L-256 

TZ 15 FOR Y=0 TO 79 

EU 20 C0L=C0L+1 

PK 30 0=USRCPLTAP,8,Y,C0LJ ;Q=USRtDRW2AP,Y 

,8, COL) 
OG 48 NEXT Y 
TL 58 FOR X=8 TO 79 
EY 68 C0L=C0L+1 

IR 78 Q=USRCPLTAP,X,79,C0LJ !Q=USRCDRW2AP, 

79, X, COL) 
OB 80 NEXT X 
RQ 98 GOTO 18 
FZ 38888 INIT6R=8969:PLTAP=8968;DRH2AP=89 

63:EXITGR=8966 
CS 38885 Q=USR CINITGR) 
DD 38818 RETURN 



Listing 4 
M/L Editor data 



1888 DATA 255,255,8,96,251,96,32,21,35 

,162,39,134,141,134,142,232,7895 

1810 DATA 134,144,169,8,162,8,149,132, 

202,208,251,133,132,169,255,141,3314 

1020 DATA 252,2,32,90,96,32,90,96,173, 

10,210,41,31,208,3,32,2133 

1030 DATA 126,96,32,144,96,238,132,173 

,31,288,281,6,248,288,173,252,3377 

1040 DATA 2,201,33,240,7,201,28,208,21 

2,76,18,35,173,241,2,288,7871 

1058 DATA 251,169,255,141,252,2,173,25 

2,2,281,33,288,249,76,23,96,8536 

1068 DATA 162,2,181,134,32,128,96,149, 

134,282,288,246,32,166,96,162,287 

hll^J'*^'* 2, 181, 132, 32, 120, 96, 149, 132, 

202, 208, 246, 76, 166, 96, 73, 255, 1426 

1888 DATA 24,185,1,96,162,4,173,18,218 

,41,3,248,249,56,233,2,6587 

^?!? ?5P„"9'i36,202,208,241,96,162,4 

,181,132,24,117,136,281,48,144,7999 

ii2^,SS^2,5'^^'233,4e,176,247,149,132, 

202, 208, 237, 96, 168, 4, 198, 242, 3052 

Hi®«^'*T?-^^' ^^5' ^^2, 8, 24, 117, 141, 198, 

248,96,149,158,136,208,239,32,709 

fil®„'>SI^-?®^''^'^^^'*'^50'244,96,185, 

132,8,24,117,141,198,258,96,9216 

^H^.lt^'* 149, 158, 136, 288, 239, 165, 132, 

}?5A^S54i®*' ^S^' ^2, 12, 35, 165, 132, 7524 

1148 DATA 166,152,164,153,32,15,35,165 

{132,166,151,164,152,32,12,35,4178' 

5,35, 8, 8,1, 1,8, 8, 8, 5487 

8"?8?ST2,Jiii"^''*'"*'"'''"'^'»'»' 



PAGE 66 /MAY 1988 



ANALOG COMPUTING 



Listing 5 
Assembly listing 

10 KKXKXKKlCKKICKKXMKXlCXKKKKKKKlCXKlt 
28 » flPfiC SYSTEM, Wl . 1 » 

39 « CREATED BY THOMAS TANIDA * 

40 » FIRST STARTED! 1/3/87 » 
50 » LAST REUISED! 2/7/87 » 
60 XXKXXXXXXXXXXXXXXXXXXXXXXXXXXX 

70 »= $22FD 

80 .OPT NO EJECT 

90 -TAB 8,12,30 

9180 XXXXXXXXXXXKXXXXXXXXXXXXXKXXMK 

0110 ZTEMP = 500 
0120 COLSAU = 203 

204 

206 

212 ; 212-222 USED 

213 1 FOR DRAWTO 
214 
215 
216 
217 
218 



0130 YBYT = 
0140 T8 = 
0150 FX = 
0160 FY = 
0170 XD = 
0180 YD = 
0190 XACC = 
0200 YACC = 
0210 DELTX : 
0220 DELTY = 219 
0230 EPOIMT = 220 
0240 TMPl = 221 

till SSxxixxxxxxxxxxxxxxxxxxxxxxxxx 

0270 » SYSTEM EQUATES * 
9280 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 



0290 CASINZ 
0300 TRAMSZ 
0310 MARMST 
0320 DOSUEC 
0330 DOSINI 
0340 RDMCRS 
0350 COLCRS 
0360 SCREEN 
0370 RAMTOP 



$02 
$06 
$08 
$0A 
$0C 
$54 
$55 
$58 
$6A 



0380 LOMEM = $80 
0390 UDSLST = $0200 
0400 UUBLKI = $0222 
0410 5DMCTL = $022F 
0420 5DL5TL = S0238 
0430 GPRIOR = $026F 
0440 C0L0R4 = $02CB 
0450 MEMLO = $02E7 
0460 ICCOM = $0342 
0470 ICBADR = $0344 
0480 ICBLEN = $0348 
0490 ZCAUXl = $034A 
8500 COLBK = $D01A 
0510 PRIOR = $D01B 
0520 WSYNC = $D40A 
0530 UCOUNT = $D40B 
0540 NMIEN = $D40E 
0550 CIOV = $E456 
0560 SETVBU = $E45C 

till XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

0590 » tFOR BINARY LOADSJ 

0600 

0610 

0620 

0630 

0640 

0650 

0660 

0670 

0680 

0690 

0700 

0710 



2 

6 

8 

10 

12 

84 

85 

88 

106 

128 

512 

546 

559 

560 

623 

712 

743 

834 

836 

840 

842 

53274 

53275 

54282 

54283 

54286 

58454 

58460 

58463 



JMP SYSSET 



* 



BASIC ENTRY POINTS: 
JMP BASPLT ;PLOT 
JMP BASDRM2 ;DRAHTO 
JMP BASEXGT ;EXIT APAC 
JMP BASIMGT ;INIT APAC 
ML ENTRY POINTS: 
JMP PLT256 ;PL0T 
JMP DRT256 ;DRAHTO 
JMP EXITGT ;EXIT APAC 
,3fA.w JMP INITGT JINIT APAC 

^720 xxxxxSiixixxxxxxxxxxxxxxxxxxxxx 

0730 » BASIC ENTRY: 

Q=USRtBASPLT,X,Y,COLJ 



0740 
0750 
0760 
0770 
0780 
0798 



* 
* 



THIS SUBR PLOTS A POINT 
ON THE APAC SCREEN AT THE 
GIVEN X,Y POSITION USING THE 
vf:,^ - GIVEN COLOR C8-255J. , ^„_, 
0808 » REMEMBER: THERE ARE 192 LINES, 
0818 » ALTERNATING ■-"« «»^» COL, 
0820 * SO THE SCREEN LIMITS ARE 
0830 » 88 HORIZONTAL AND 192/2=96 
0840 * VERTICAL 



0858 

0860 

0878 

0880 

0890 

0900 

0910 

0920 

0930 

0948 

0958 

0960 

0970 

0988 

0990 

1000 

1010 

1020 

1030 

1040 

1050 

1060 

1070 

1080 

1090 

1100 

1110 

1120 

1130 

1140 

1150 

1160 

1170 

1180 

1190 

1208 

1218 

1220 

1230 

1240 

1258 

1260 

1270 

1280 

1290 

1300 

1310 

1320 

1330 

1340 

1350 

1360 

1370 

1380 

1398 

1400 

1410 

1420 

1430 

1440 

1450 

1460 

1470 

1488 

1498 

1500 

1510 

1520 

1530 

1540 

1550 

1560 

1570 

1580 

1590 

1600 

1610 

1620 

1630 

1640 

1650 

1668 

1678 

1688 

1698 

1708 

1718 



* FIRST MAKE SURE THERE ARE 3 
» (NO MORE, NO LESS} ARGUMENTS 
» 
BASPLT 

PLA 

CMP tt3 

BEQ GETPARN 

JMP TRAP ;HRONG U OF ARGS 
GETPARM 



PLA 
PLA 
TAX 
PLA 
PLA 
TAY 
PLA 
PLA 



; IGNORE HI-BYTE 

;X-POS 

; IGNORE HI 

;Y-POS 

; COLOR 



» CHECK FOR ILLEGAL PLOT 

JSR BOUNDCK 
* ML ENTRY: A=COLOR 
« X=X-POS 

W Y=Y-POS 

PLT256 

5TA COLSAV ; SAVE COLOR 

PSAMCOL ,^ „..„^„„ 

STX COLCRS ; UPDATE CURSOR 
STV RONCRS 
» GET LO-BYTE OF SCREEN MEM PNTR 
LDA SCRALO,Y 
STA YBYT 
» GET HI-BYTE OF SCREEN MEM PNTR 
LDA SCRAHI,Y 
STA YBYT+1 
TXA 

LSR A ;A=A/2 
TAY 
» GET BYTE WITH PIXEL FROM THE 
« SCREEN CONTAINING THE LUM 
LDA CYBYTJ,Y 
STA T8 ;SAVE IT 
TXA 

AND ttl ;X=1=0DD X-POS 
TAX ;X=0=EVEN 

LDA T8 
MASK PREVIOUS PIXEL FROM SCRN 
AND BITABL,X 
STA T8 
RETRIEVE COLOR 
LDA COLSAV 
CPX ttl 

BNE LHHYB ;X IS EVEN 
THIS WORKS SINCE THE LUM 
IS IN THE LOWER NYBBLE OF THE 
COLOR, AND IF X IS ODD THEN 
THE LOWER NYBBLE OF THE SCR 
BYTE WILL CONTAIN THE PIXEL 
AND tt$eF 
JMP POKLUM 
K MOVE LUM INTO HI-NYBBLE 
LHNYB 

ASL A 
ASL A 
ASL A 
ASL A 
» POKE THE LUM BACK INTO THE SCR 
POKLUM 

ORA T8 

STA CYBYT>,Y 
CLC 

LDA YBYT 

ADC »t40 ;ADD 40 FOR THE 
STA YBYT ;NXT LINE CCOLRJ 
BCC GETCOLR 
INC YBYT+1 
» GETS THE BYTE CONTAINING THE 
» PIXEL WITH THE COLOR AND SAVE 
* IN T8 
GETCOLR 

LDA CYBYTJ,Y 
AND BITABL,X 
STA T8 
LDA COLSAV 
CPX ttl 

BNE CHNYB _^. ^ ^^ _^ 
SINCE THE COLOR ITSELF IS IN 
THE HI-HYBBLE OF THE GIVEN 



* 
* 






ANALOG COMPUTING 



MAY 1988 / PAGE 67 



if^ APAC System 



continued 



1728 

1739 

1740 

1750 

1768 

1778 

1788 

1798 

1888 

1818 

1828 

1838 

1848 

1858 

1868 

1878 

1888 

1898 

1988 

1918 

1928 

1938 

1948 

1950 

1968 

1970 

1980 

1990 

2080 

2818 

2828 

2838 

2048 

2850 

2868 

2870 

2080 

2090 

2188 

2118 

2128 

2138 

2148 

2158 

2168 

2178 

2188 

2198 

2288 

2216 

2228 

2238 

2248 

2258 

2268 

2278 

2288 

2298 

2380 

2310 

2328 

2330 

2340 

2350 

2360 

2370 

2380 

2390 

2400 

2410 

2420 

2430 

2440 

2450 

2460 

2470 

2480 

2490 

2500 

2510 

2520 

2538 

2548 



* COLOR, MOUE IT TO THE LOMER 

* NYBBLE SINCE THE X-POS 15 ODD 

LSR A 

LSR A 

LSR A 

LSR A 

JMP P8KC0L 
CHNYB 

AND tt$F8 ; SINCE XPDS EVEN 
POKCOL 

ORA T8 
» PUT IT INTO THE SCREEN 

STA {YBYT),Y 

RTS 

* BIT MASKS TABLE 
BITABL .BYTE SeF,$F0 

mmicimmiMmtiiiiMicmiMimKMiiicmiiiKKK 



BASIC ENTRY: 
a=USRCBASDRM2,X,V,C0Ll 

THIS SUBR DRAMS A LINE FROM 
THE CURRENT CURSOR POSITION 
TO THE GiyEH X,V USING 
THE GIVEN COLOR 

FIRST MAKE SURE THERE ARE 3 
(NO MORE, NO LESS} ARGUMENTS 



;MRONG It OF ARCS 



;dest-x 



;DEST-Y 

; CURSOR X-POS 

;from-x 

; cursor y-pos 

;FROM-Y 



* 
* 

* 

BASDRM2 
PLA 

CMP nz 

BEQ GETARGS 

JMP TRAP 
GETARGS 

PLA 

PLA 

TAX 

PLA 

PLA 

TAY 

LDA COLCRS 

STA FX 

LDA ROMCRS 

STA FY 

PLA 

PLA 
» CHECK FOR ILLEGAL DRAHTO 

JSR BOUNDCK 
» ML ENTRY: A=COLOR 
» X=DEST-X 

* Y=DEST-Y 

DRT256 

SIX TMPl ;SAVE X 

STY YD ;SAVE Y 
» PLOT THE DESTINATION PIXEL 

JSR PLT256 

LDY YD ; RESTORE Y 
» LOOP TO SET XD,YD,XACC,YACC, 
» DELTX,DELTY TO 

LDX »6 

LDA no 

POKZO 

STA XD-1,X 

DEX 

BNE POKZO 
THE FOLLOWING ROUTINE IS BASED 
ON THE VECTOR ROUTINE PRINTED 
IN ANALOG, ISSUE «18, IN THE 
"BASIC TRAINING" COLUMN BY 
TOM HUDSON 
INIT THE X VARIABLES 

LDX TMPl 

CPX FX 

BEQ SGNY 

BCC NEGXD 

TXA 



SBC FX 
INC XD 
BNE SAVDLX 



NEGXD 

DEC XD 
STX TMPl 
LDA FX 



;deltx=tx-fx 
; carry has set 
;XD=i 
;alnays 

;XD=-1 C$FFJ 
;DELTX=FX-TX 



2550 

2568 

2578 

2588 

2598 

2688 

2618 

2620 

2630 

2640 

2650 

2660 

2670 

2680 

2690 

2700 

2710 

2720 

2730 

2740 

2750 

2760 

2770 

2780 

2790 

2800 

2818 

2828 

2838 

2848 

2858 

2868 

2878 

2888 

2898 

2968 

2918 

2928 

2938 

2948 

2956 

2966 

2976 

2986 

2998 

3686 

3818 

3826 

3030 

3040 

3856 

3868 

3676 

3888 

3696 

3168 

3116 

3126 

3136 

3148 

3158 

3166 

3178 

3188 

3198 

3286 

3218 

3226 

3238 

3248 

3256 

3268 

3278 

3288 

3296 

3368 

3318 

3326 

3338 

3348 

3350 

3368 

3378 

3388 



SEC 

SBC TMPl 
SAVDLX 

STA DELTX 
» INIT THE Y variables 
SGNY 

CPY FY 

BEQ INTCNT 

BCC NEGY 

TYA 

SBC FY 

INC YD 

BNE SAVDLY 
NEGY 

DEC YD 

STY TMPl 

LDA FY 



;delty=yd-fy 
; carry mas set 
;yd=i 
;almays 

;yd=-i tSFFJ 



SEC 

SBC TMPl 



;DELTY=FY-TY 



;XACC=XACC/2 
;YACC=YACC/2 



SAVDLY 

STA DELTY 
INTCNT 

LDA DELTX 

CMP DELTY 

BCC XLTY 

STA YACC 

BC5 INTEPT jALMAYS 
» (X LESS THAN Y) 
XLTY 

LDA DELTY 

STA XACC 
INTEPT 

STA COUNT 

STA EPOINT 

LSR XACC 

LSR YACC 
* EXIT IF DESTINATION X,Y 
» SAME AS CURRENT X,Y 

LDA COUNT 

BEQ EXDRT 

« THE MAIN LOOPr 
XCALC 

LDA XACC 

CLC 

ADC DELTX 

STA XACC 

CMP EPOINT 

BCC YCALC 

SBC EPOINT 

STA XACC 

LDA FX 

CLC 

ADC XD 

STA FX 
YCALC 

LDA YACC 

CLC 

ADC DELTY 

STA YACC 

CMP EPOINT 

BCC PLIT 

SBC EPOINT 

STA YACC 

LDA FY 

CLC 

ADC YD 

STA FY 
» PLOT THE CALCULATED POINT 
PLIT 

LDX FX 

LDY FY 

JSR PSAMCOL J PLOT SAME COLOR 

DEC COUNT 

BNE XCALC ;D0 MORE POINTS 
EXDRT 

RTS 
KKKKMMKKMKKKKMKItKKlCKKKKMlClllOdm 
» BASIC ENTRY: 
Q=USR(BASEXGT1 



; CHANGE X 



; CARRY MAS SET 



; CHANGE V 



; CARRY MAS SET 



THIS SUBR RESTORES THE SCREEN 
TO GRAPHICS 9 AND RESETS OS 
INTERRUPT POINTERS, ETC. 



PAGE 68 / MAY 1988 



ANALOG COMPUTING 



S39e 

3480 

3410 

3420 

3430 

3440 

3450 

3460 

3470 

3480 

3490 

3508 

3518 

3528 

3530 

3540 

3550 

3560 

3570 

3580 

3598 

3600 

3618 

3620 

3638 

3648 

3650 

3660 

3670 

3680 

3690 

3700 

3710 

3720 

3738 

3748 

3758 

3768 

3770 

3788 

3798 

3800 

3810 

3820 

3830 

3840 

3850 

3860 

3870 

3880 

3890 

3900 

3910 

3920 

3930 

3940 

3950 

3960 

3970 

3988 

3990 

4800 

4010 

4020 

4030 

4048 

4050 

4060 

4070 

4080 

4090 

4100 

4110 

4120 

4130 

4140 

4150 

4160 

4170 

4180 

4190 

4200 

4210 

4220 

4230 

4248 

4250 



» IT STILL PROTECTS APftC 

* 

BA5EXGT 

PLfl 

BEQ EXITGT ; MO PARAMETERS! 

JMP TRAP 
» ML ENTRY: 

« (REGISTERS IGNORED! 
EXITGT 



;MAKE SURE 

;ME AREN'T NEAR 

;A UBI 

; RESTORE OS VBI 



LDA UCOUNT 
CMP tt64 
BCS EXITGT 
LDA SAVUBI 
STA UUBLKI 
LDA SAUUBI+l 
STA UUBLKI+l 

LDA tt64 

STA NMIEN ;N0 DLI'S 

LDX ttSOO ;IOCB 

LDA «SOC ; CLOSE 

STA ICCOM 

J5R CIOU ;G0 DO IT 

LDX tt$88 jIOCB 8 
STX ICAUXl+1 
LDA »$83 ;OPEN 
STA ICCOM 
POINT TO "E:", BELOM 
LDA « <SCRDEU 
STA ICBADR 
LDA tt >SCRDEU 
STA ICBADR+1 



LDA nSQC 
STA ICAUXl 
JSR CIOU 



JREAD/MRITE 
;C0 DO IT 



;NORML INTRUPTS 



PROTECT APAC BY MOWING THE 
BASIC AND OS POINTERS UP 



LDA tt$7F 
STA NMIEN 

5ETMEM 

LDA U <ENDAPAC ;LO-BYTE 

STA MEMLO 

STA LOMEM 

LDA « >ENDAPAC ; HI-BYTE 

STA MEMLO+1 

STA LOMEM+1 

RTS 
SAUUBI .BYTE 0,0 _ 

KXMMMMllicMlCKKXMKMltMlCXlCMICXXMKlCKK 

» BASIC ENTRY: 
« QzUSRCBASINGTJ 

» THIS SUBR SETS UP THE SPECIAL 
» APAC SCREEN WITH ALTERNATING 
» LINES OF LUMINANCE AND COLOR 
» 
BASINGT 

PLA 

BEQ INITGT ; ZERO ARG5 

JMP TRAP 
* ML ENTRY: 

» CREGISTEHS IGNORED! 
INITGT 

LDA ttO 

STA SDMCTL ; DISABLE SCR 

STA NMIEN ;N0 INTERRUPTS 

STA ROWCRS ; CURSORS C0, 01 

STA COLCRS 

STA COLCRS+1 

STA C0L0R4 



BAKGRND=BLACK 
DEFAULT COL=0 
MY POINTR TO DL 
OS POINTR TO DL 
Y=8 

HI-BYTE OF 

DLI5T ADR= 

RAMTOP-32 



STA COLSAU 
STA YBYT 
STA SDLSTL 
TAY 

LDA RAMTOP 
SEC 

SBC tt32 
STA YBYT+1 
STA SDLSTL+1 
CREATE THE DISPLAY LIST 

THE APAC DISPLAY LIST IS MUCH 
THE SAME AS A GRAPHICS 8 DL 
EXCEPT THERE ARE DLI ■ S ON 



4268 

4278 

4288 

4298 

4388 

4318 

4328 

4330 

4340 

4350 

4360 

4370 

4380 

4390 

4400 

4410 

4420 

4430 

4440 

4450 

4460 

4470 

4480 

4490 

4500 

4510 

4520 

4538 

4540 

4550 

4560 

4570 

4580 

4590 

4600 

4618 

4628 

4630 

4640 

4650 

4660 

4670 

4680 

4690 

4700 

4710 

4720 

4738 

4748 

4750 

4760 

4770 

4780 

4798 

4800 

4818 

4828 

4830 

4840 

4850 

4860 

4870 

4880 

4890 

4900 

4918 

4920 

4930 

4940 

4958 

4960 

4970 

4980 

4990 

5000 

5010 

5020 

5030 

5040 

5050 

5060 

5070 

5080 

5090 

5100 

5118 

5128 



« EVERY LINE, INCL THE LAST 

» BLANK SCAN LINE AT TOP OF THE 

* SCREEN 

LDA ltll2 ;CMD, 8 BLNK LNS 
NXTBNK 

STA tYBYTJ,Y 

INY 

CPY »3 

BNE NXTBNK 

LDA »S90 ;8 BLNK5+DLI 

STA CYBYTJ,Y 

LDA ttSCF ;MODE 15+DLI+LMS 

INY ;y=4 

STA tYBYT>,Y 

LDA ttO ;LO-BYTE, SCRN 

INY ;y=5 

STA CYBYT>,Y 

STA SCREEN 

LDX YBVT+1 ; HI-BYTE OF SCRN 

IMX ;I5 RAMTOP-31 

TXA 

STA SCREEN+1 

INY ;Y=6 

STA CYBYT),Y 

INY ;Y=7 

LDA n$8F ; ANTIC 15+DLI 

NXANTLN 

STA (YBYTJ,Y 

INY 

CPY »2oe 

BNE NXANTLN 

LDY »102 ;102TH BYTE, DL 

LDA ttSCF J MODE 15+DLI+LMS 

STA CYBYTJ,Y 

LDA ttO ;ADR OF 2ND HALF 

INY ;0F SCRN IS: 

STA tYBYTJ,Y 

LDA RAMTOP ; CRAMT0P-161»256 

SEC 

SBC ttl6 

INY ;Y=184 

STA tYBYTJ,Y 

LDY tt200 

LDA tt65 

STA CYBYTJ,Y 

INY ;Y=201 

LDA »8 JLO-BVTE, ADR DL 

STA tYBYTJ.Y 

INY ;Y=282 

LDA YBYT+1 ; HI-BYTE, ADR DL 

STA CYBYT>,Y 
« CLEAR OUT SCREEN MEMORY 
CLRSCR 

LDA SCREEN 

STA ZTEMP 

LDA SCREEN+1 

STA ZTEMP+1 

CLC 



;LA5T PAGE OF 
;MEM TO CLEAR+1 



ADC tt38 

STA TMPl 
SPACE 

LDY tte 

TYA ;A=0 

ZERSB 

STA tZTEMPJ,Y 

DEV 

BNE ZERSB 

INC ZTEMP+1 

LDA ZTEMP+1 

CMP TMPl ;END? 

BCC SPAGE ;NOPE 

* INITIALIZE THE TABLE 

» OF ADDRESSES THAT POINT TO THE 

* 96 APAC SCREEN LINES 

LDA 5CREEH+1 
STA ZTEMP+1 ; HI-BYTE 
LDY tt$80 
NXTLN80 

LDA ZTEMP ;SAUE LO 

STA SCRALO,Y 

LDA ZTEMP+1 ;SAUE HI 

STA SCRAHI,Y 

CLC 

LDA ZTEMP 

ADC «80 ;80 BYTES PER 

STA ZTEMP ;APAC LINE 

BCC NXTY 



ANALOG COMPUTING 



MAY 1988 / PAGE 69 



fli APAC System 



continued 



5130 

5i4e 

5156 

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 

5780 

5790 

5800 

5810 

5820 

5830 

5840 

5850 

5860 

5870 

5880 

5890 

5900 

5910 

5920 

5930 

5940 

5950 



ZTEMP+1 



tt96 ;96 LINES TO DO 

NXTLN80 

UUBLKI jSAUE THE OS UBI 

SAVUBZ 

UUBLKI+1 

SAUUBI+1 

TO THE APAC IHM UBI 

tt6 ; STAGE 1 UBI 

It >IUBI ;HI-BVTE 

» <IUBI ;LO-BYTE 

SETUBU ;SET IT 

TO THE FIRST DLI 

n <DLI1 

UDSLST 

n >DLI1 

UDSLST+1 

tt$40 ; GRAPHICS 9 

GPRIOR 

usee ;ALL INTERRUPTS 

NHIEN 

tt34 

SDMCTL ; SCREEN ON 



INC 
NKTY 

INY 

CPV 

BNE 

LDA 

STA 

LDA 

STA 
» POINT 

LDA 

LDX 

LDV 

JSR 
» POINT 

LDA 

STA 

LDA 

STA 

LDA 

STA 

LDA 

STA 

LDA 

STA 
LEAUE 

RTS 
KKKlCICICXKICMKKKlCMKlCIClCKltMMKMKKimM 
» THE RESET HANDLER: 

* THE JSR SFFFF will POINT TO 

* DOS AFTER LOADING APAC 
» CSEE SYSSET, BELOMI 

* 

MRMSTRT 

JSR $FFFF 
» POINT THE OS RESET UECTORS 
» TO MRMSTRT 
SETUEC 

LDA U <MRHSTRT ;LO-BYTE 

STA DOSINI 

STA CASINI 

LDA tt >NRMSTRT ; HI-BYTE 

STA DOSINI+1 

STA CASINI+1 
» GO SET THE LOMEM POINTERS 

JMP SETMEM 
MMKICKKMKKKKXMKKICKMKKKKMKMKMKKIC 

* MAKE SURE X<80 AND Y<96 
* 

BOUNDCK 

CPX ttOO 

BCC CKYPOS 

BCS ERRBND 
CKYPOS 

CPY tt96 

BCC LEAUE 
ERRBND 

PLA 

PLA 

RTS 



;X>79, EXIT APAC 



; ALL'S UELL 

;Y>95, SO PULL 
J JSR TO BOUNDCK 
;EXIT APAC 



.U. mail n^^ ^aaM-M^^ .__... 



» PULL OFF EXCESS ARGUMENTS 

TRAP 

TAX 

BEQ EXTRAP 
DELARG 

PLA 

PLA 

DEX 

BNE DELARG 
EXTRAP 

RTS 
MMMICKKKItKMKKKKKMKKKmCMICMKlCKKKIl 
» APAC'S IMM MODE UBI KEEPS 
» EUERYTHING TIMED RIGHT 

lUBI 



;N0 ARGS TO PULL 

;PULL HI 
;PULL LO 

;D0 MORE ARGS 



PHA 

LDA tt$ce 

STA NMIEN 



;SAUE ACC. 

; ENABLE 

;ALL INTERRUPTS 



5960 

5970 

5980 

5990 

6000 

6010 

6020 

6030 

6040 

6050 

6060 

6070 

6080 

6090 

6100 

6110 

6120 

6130 

6140 

6150 

6160 

6170 

6180 

6190 

6200 

6210 

6220 

6230 

6240 

6250 

6260 

6270 

6280 

6290 

6300 

6310 

6320 

6330 

6340 

6350 

6360 

6370 

6380 

6390 

6400 

6410 

6420 

6430 

6440 

6450 

6460 



STA C0L0R4 

PLA 

JMP SYSUBU 



;backgrnd=black 
; restore acc. 
;d0 os imn ubi 



KMKKKKKICICMICKKMKKXMKKXKKMKKKKXK 

» THE DLI'S TOGGLE- I.E. THEY 

» APPEAR EUERY OTHER LINE, 

* ALTERNATING GRAPHICS 9 & 11 

« 

DLIl 

PHA ;SAUE ACC. 

LDA » <DLI2 

STA UDSLST ; POINT TO DLI2 



DLI2 



LDA tt$4e 
STA WSYNC 
STA PRIOR 
PLA 
RTI 



PHA 

LDA tt <DLI1 

STA UDSLST 

LDA tt$C0 

STA MSYNC 

STA PRIOR 

PLA 

RTI 



; GRAPHICS 9 
; RESTORE ACC, 



;SAUE ACC. 

; POINT TO DLIl 



; GRAPHICS 11 
;RESTORE ACC, 



SCRALO »= »+96 
SCRAHI »= »+96 
ENDAPAC = « 

MKMKKKKKKKlCKltMKKIIMKllKKKKKKKKKK 

* 



SYSSET INITIALIZES WRMSTRT 
tPOINTS A JSR THERE TO DOSJ 
ALSO JSR'S TO SETUEC 
WHICH INITS APAC'S RESET TRAP 
AND SELF-PROTECTION 



*= $4000 
SYSSET 

LDA DOSINI ; MODIFY CODE 

STA WRMSTRT+1 ; IN SUBR 

LDA DOSINI+1 ; WARMSTRT 

STA WRMSTRT+2 

JSR SETUEC 

LDA TRANSZ 

BNE GDCART 

RTS 
GOCART 

LDA tte 

STA HARMST 

JM> $Aeee 



;IF 1, CART IN 
; CNO CARTRIDGE! 



;D0 A HARHSTART 
;T0 CARTRIDGE 



Listing 6 
Assembly listing 



10 KKXKlCHmcmCKKKKlClCKKICKXKKKKKlCM 
20 » APAC KAL DEMO, U2 . » 

30 » CREATED BY THOMAS TANIDA » 
40 » FIRST STARTED: 1/31/87 » 
50 « LAST REUISED: 2/7/87 » 

60 KWMMmClCKmdCKKliMXXIHClCmCltlClCKKIt 

70 «= $6000 

80 .OPT NO EJECT 

90 .TAB 8,12,30 

0100 KKKXKKKMKlCICKKMKKMICKMMKKlCKICMMMIIKll 

0110 ZTEMP r $80 

0120 DLE = $82 

8130 COLOR = $84 

0140 COORDS = $85 

$89 

$8D 



LDA tt <DLI1 ; POINT TO 
STA UDSLST ; FIRST DLI 



0150 DLTX = 

0160 OFFX = ,__ 

0170 PNTPOS = $96 

0180 TEMP = $A0 

0190 STORE = $B0 

0200 K 

0210 » SYSTEM EQUATES 

0220 « 

0230 KEYDEL = $02F1 ; 753 

0240 KEYPRS = $02FC ;754 

0250 CONSOL = $D01F J 53279 



RAGE 70 /MAY 1988 



ANALOG COMPUTING 



8266 

0270 

0280 

0290 

0300 

0310 

0320 

0330 

0340 

0350 

8360 

0370 

0380 

0390 

8408 

0410 

8428 

0430 

8440 

8450 

8468 

0470 

0480 

8498 

0508 

8518 

8528 

8538 

8548 

8558 

8568 

8578 

8588 

8598 

8600 

0610 

0620 

8638 

8640 

0650 

8668 

8678 

8680 

0690 

0788 

8718 

8728 

8738 

8748 

8758 

8768 

8778 

8780 

0790 

0888 

0810 

8828 

8838 

0840 

8858 

8868 

0878 

8888 

8896 

8986 

8916 

8926 

8936 

0946 

6956 

8968 

8970 

0980 

0990 

1088 

1818 

1828 

1838 

1848 

1858 

1060 

1878 

1888 

1898 

1100 

1118 

1120 



RANDOM = $l>26a ; 53776 

» APAC SYS EQUATES 

APACPLOT = $2380 
APACDRAH = $23eF 
APACEXIT = S2312 
APACINIT = S2315 



KKKMKKKXKXKXMKKKKKIIXKIIKKMKKKXICMK 

STARTUP 

J5R APACIMIT ;SET UP APAC 



LDX tt39 

STK OFFX 

STX OFFX+1 

INX 

STX OFFX+3 



;INIT UARS 
; OFFSETS 



LDA tt$88 

LDX tt$88 
INTS 

STA C00RD5-1,X 

DEX 

ONE INT8 

STA COLOR 
LOOP 

LDA ttSFF 

STA KEYPRS 

JSR POSSET 

JSR POSSET 

LDA RANDOM 

AND tt$lF 

ONE GOMOU 

JSR DIRSET 
GONOU 

JSR MAKHOV 

INC COLOR 

LDA CONSOL 

CMP tt6 

BEQ STARTUP 

LDA KEYPRS 

CMP tt33 

BEQ PAUSE 

CMP tt28 



;ZEHO OUT 
;SA5-SAC 



;1ST COLOR=BLACK 

; CLEAR KEYBD REG 

;LINE 1 
;LINE 2 
;GET A RAND tt 
;FROM 8-31 
;31 IN 32 
;l IN 32 



; CHANGE COLOR 
;GET CONSOLE KEY 
; START PRESSED? 
;YEP- CLEAR SCR 
;GET KEY 
JSPACE PRESSED? 
J YEP- PAUSE 
:E5C PRESSED? 
;N0- MAIN LOOP 



BNE LOOP 
JMP APACEXIT 

XXXXXXXKXXXXXXXXXXXXXXXXXXXXXXXX 
PAUSE 



;MAIT FOR KEY 
!T0 BE RELEASED 
; CLEAR KEYBD 



;GET KEYCODE 
; SPACE? 

;WAIT FOR SPACE 
;BACK TO MAIN 



LDA KEYDEL 
BNE PAUSE 
LDA ttSFF 
STA KEYPRS 
GETSPC 

LDA KEYPRS 
CMP tt33 
BNE GETSPC 

XXKXXXXXXXXMXXXXXXXXXXKXXXXXXMXW 

POSSET 

LDX tt2 
HXP2 

LDA C00RDS+1,X ; ROTATE X2,Y2 

JSR SUB256 

STA C00RDS+1,X 

DEX 

BNE NXP2 

JSR PNTSCR 
K 

LDX tt2 
NXPl 

LDA C00RDS-1,X ; ROTATE XI, Yl 

JSR SUB256 

STA C00RDS-1,X 

DEX 

BNE NXPl 

JMP PNTSCR 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXM 

SUB256 

EOR ttSFF JACC=256-ACC 

CLC 

ADC ttl 

RTS 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

» DIRSET CHANGES THE DIRECTION 
» OF THE MOVEMENT OF LINES YOU 
» SEE. OTHERWISE, THE KAL WOULD 
K BE REPETITIVE AND BORING. 



1136 

1140 

1150 

1160 

1170 

1180 

1198 

1288 

1218 

1228 

1238 

1248 

1258 

1260 

1278 

1288 

1290 

1308 

1310 

1320 

1330 

1340 

1350 

1360 

1370 

1380 

1390 

1400 

1410 

1428 

1438 

1440 

1450 

1460 

1470 

1480 

1490 

1588 

1518 

1528 

1538 

1548 

1558 

1568 

1570 

1580 

1590 

1608 

1618 

1628 

1630 

1640 

1650 

1660 

1670 

1688 

1698 

1788 

1718 

1728 

1738 

1740 

1750 

1760 

1770 

1780 

1790 

1888 

1810 

1820 

1838 

1840 

1856 

1866 

1876 

1888 

1890 

1908 

1910 

1920 

1930 

1940 

1950 

1960 

1970 

1988 

1998 



;GET A RANDOM U 
;FROM 8-3 
;BUT NOT 8 
;MAKE it -1,8,1 



« 
DIRSET 

LDX tt4 
GETPLM 

LDA RANDOM 

AND »$BZ 

BEQ GETPLM 

SEC 

SBC tt2 

STA DLTX-1,X ;SAUE IT 

DEX ;4 TIMES 

BNE GETPLM 

RTS 
KXKXKXXKXXKKXXKXXXXKXXXXKXXKKXMK 

MAKMOU 

LDX tt4 
NXTPSX 

LDA C00RDS-1,X ; GET COORD 

CLC 

ADC DLTX-1,X ;ADD -1,0 OR 1 
» ESSENTIALLY THESE NEXT FEW 

* LINES DO A "ACC MOD 40" 

* BY SUBTRACTING 40 EACH TIME 
» ACC>=40 UNTIL ACC<48 

» THE PURPOSE IS TO MAKE SURE 
K THE COORDS DON'T GO OUTSIDE 
» SCREEN LIMITS CTHERE ARE 4 

* QUADRANTS 40 BY 40) 
M0D40 

CMP tt40 



LT40 



BCC LT4e 
SEC 

SBC tt4e 
BCS M0D40 



;LESS THAN 48 

;A=A-48 
;G0 BACK 



STA C00RDS-1,X ; SAVE IT BACK 

DEX 

BNE NXTPSX ;NEXT POSITION 

RTS 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

PNTSCR 

LDY tt4 

NXPERM 

LDX 0F0FF-1,Y {ALTERNATE 
LDA C00RDS-1,Y ;THE COORDS 
CLC ; PLOTTED 

ADC OFFX,X ;T0 REFLECT 
LDX PNT0FF-1,Y ; IN EACH 
STA PNTPOS,X ;PART OF THE 
DEY ; SCREEN 

BNE NXPERM 
JSR PUTONSCR ;DRAM ON SCR 

LDY tt4 ;SAME AS ABOVE 
NXCOMB _ „^ 

LDX 0F0FF+1,Y ;SEE END OF 
LDA C00RDS-1,Y ;KAL FOR THE 
CLC ; REARRANGEMENT 

ADC OFFX,X ;0F THE COORDS 
LDX PNT0FF+1,Y 
STA PNTPOS,X 
DEY 

BNE NXCOMB 
» CFALLS THROUGH TO BELOWJ 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXM 

PUTONSCR 

LDA COLOR ;GET COLOR 
LDX PNTPOS ;X-POS 
LDY PNTPOS+1 ;Y-POS 
JSR APACPLOT JPLOT XI, Yl 
LDA COLOR ;GET COLOR 
LDX PNTP05+2 ;DE5T X-POS 
LDY PMTP05+3 ;DEST Y-POS 
JSR APACDRAM ; DRAUTO X2,Y2 

LDA COLOR ;GET COLOR 
LDX PNTPOS+1 ;X-P05 
LDY PNTPOS+2 ;Y-P05 
JSR APACPLOT ;PL0T Y1,X2 
LDA COLOR ;GET COLOR 
LDX PNTPOS ;DE5T X-POS 
LDY PNTP05+3 ; DE5T Y-POS 
JMP APACDRAW ; DRAWTO XI, Y2 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXM 

OFOFF .BYTE 0,0,1,1,0,0 

PNTOFF .BYTE 6,2,1,3,0,2 • 



ANALOG COMPUTING 



MAY 1988 / PAGE 71 



TUTORIAL 



48K Cassette or Disk 



Dealin' Demo 



A machine language subroutine 
to create playing card graphics 



by Eric Hnifman 



One day, while looking for an idea for a programming pro- 
ject, I came across a book which gave me not one idea but 
hundreds! The book. The Official RuJebook of Playing Card 
Games, was a veritable jackpot. I love card games and most 
of them can be easily coded in BASIC. 

However, I hit a snag almost immediately. The play al- 
gorithms were rapidly done in BASIC, but the card graph- 
ics were painfully slow. "What I need," I said to myself, "is 
a machine language subroutine to handle the playing card 
graphics." I pulled out my Atari Macro Assembler. 

About the program 

The subroutine is stored in a string and called with the 
USR function. The routine will instantly place a card any- 
where on a Graphics 8 screen. The card placed can be 
placed either face up or face down, or changed to the back- 
ground color (for erasing purposes). 

Dealin' Demo, found in Listing 1, will demo the subrou- 
tine in three ways. The first demo places cards randomly 
about the screen. The second demo fans the cards horizon- 
tally and shows the different spacings available and, final- 
ly, the third demo fans the deck in an arc, one suit at a time. 

In any case, the routine is called with a: 

J=USR(':S,Y,X,SIDE,SUIT,V) 
Where: 



playing cards. (Anybody for Greek playing cards? Better yet, 
how about Dungeons and Dragons playing cards?) B 



CS 

Y 

X 

SIDE = 

SUIT = 

V 



Subroutine start address 

Vertical position (0-160) 

Horizontal position (0-37) 

Back, front or blank (0, 1 or 2) 

Heart, Club, Diamond or Spade (1, 2, 3 or 4) 

Value (ASC("2-A")) 

The program gets its image data from the Atari ROM, 

starting at location 57344. It does, however, vector through 

the Character Base Register (756). This will allow the user 

to load an alternate character set and use this set for his 



The two-letter checksum code preceding the line 
numbers here is not a part of the BASIC program. 
For further information, see the "BASIC Editor II," 
in issue 47. 



Listing 1 
BASIC Usting 



PROGRt^M: CARD.BA5 
A CARD DEALING SUBROUTINE, 
ALLDMS A CARD TO BE DEALT 
ANYMHERE ON THE SCREEN. 



ALTER DLIST FOR TITLE SCREEN 



VI 18 REH 

KU 11 REH 

VQ 12 REH 

OY 13 REH 

BG 14 REH 

WY 15 REH COPYRIGHT 1988 

YD 16 REH BY ANALOG COHPUTING 

BH 17 REH 

PM 28 REH 

IM 38 CLR :GRAPHICS 8:P0KE 710, : DLOC=PEE 

K C560] +PEEK (561}»256 
CT 35 FOR 1=68 TO 98:P0KE DLOC+I, : NEXT I 
FY 48 POKE DL0C+4,8:P0KE DLOC+5, 7: POKE DL 

0C+181,6:P0KE DLDC+iee,e:PDKE DLOC+182 

PU 45 FOR 1=8 TO 2 : POKE DL0C+183+I, 2 : POKE 

DLOC+I,e:NEXT I 
NU 48 DIH TITLES tl2) :TITLES="DEALIN' DEH8 

ZG 58 FOR 1=1 TO 12: POKE 1+1579, A5C (TITLE 

S£I,IJJ-32:NEKT I 
ZI 55 ? '■ A CARD DEALING SUBROUTINE" 

!? " BY E RIC H UFFHAN" 

H5 90 GQ5UB 2888! REH 

KY 278 REH l:M.'Uil!»iiriiT 

KH 288 FOR 1=1 TO 180: J=USH tCS,Y, K, SIDE, S 

F5 298'k=PEEKC5377«J/7!Y=PEEKC53770J/1.56 
: SIDE=INT (RND C8) +8 . 5J : SUIT=INT CRND CBJ* 

KH 292 V=ASC(NUH$(INTCRND(8)W13+1I)):NEXT 

Hu 328 REH iiiVitiif ■>Tafnn 



PAGE 72 / MAY 1988 



ANALOG COMPUTING 



QJ 324 GRAPHICS 8+16: POKE 799, 15: POKE 718 

,96:P0KE 712,4 
IT 325 FOR H=l TO 3 : FOR SIDE=8 TO 2 
RM 339 FOR 5UIT=1 TO 4 : Y=SUIT»35-32 : FOR N 

=1 TO 13 
NC 331 yzftSCtMUMSCMJJ :X=M»W-M:Y=Y+2; J=U5R 

CCS, V,K, SIDE, SUIT, VJ :MEXT N:NEXT SUIT 
PH 335 NEXT SIPE:NEXT U 
10 348 REM WA'/illliai'aJd!!!] 
ZC 343 SIDE=1 
10 345 FOR SUIT=1 TO 4 
DC 358 FOR N=l TO 13 : U = ASC CNUM$ CN) } : X=N«2 

+ 3+ftBS CSUIT-2J : Y=128-SQR Cie888- CX»5-92 

J'^2)+SUIT»28:J=USRCCS,Y,X,5IDE,SUIT,UJ 
HU 368 NEXT N : NEXT SUIT 
EC 378 FOR 1:^8 TO 1898; NEXT I: END 
UU 999 REM l>T:ir;'Mail!».1il;l!IililfITTg 
OR 1609 DATA 194,169,9,133,77,165,88,133, 

283, 165, 89, 133, 294, 194 
00 1819 DATA 194,249,17,168,24,165,293,18 

5,48,133,283,165,284,185,9,133,294,136 

,298,249 
LK 1929 DATA 24,194,194,191,293,133,293,1 

65,294,195,9,133,294,194,194,298,117,1 

94,194,194 
PU 1839 DATA 194,162,16,169,3,169,59,145, 

283,136,169,51,145,293,136,169,179,145 

,283,165 
HQ 1840 DATA 283,24,185,88,133,283,165,28 

4,185,8,133,284,282,288,224,168,3,169, 

178,145 
CC 1858 DATA 283,136,288,249,165,293,56,2 

33,49,133,283,165,284,233,9,133,294,16 

2,16,169 
LB 1868 DATA 3,169,286,145,283,136,169,28 

4,145,283,136,169,148,145,283,165,283, 

56,233,88 
PY 1878 DATA 133,283,165,284,233,8,133,28 

4,282,288,224,165,283,24,185,48,133,28 

3,165,284 
UX 1889 DATA 195,9,133,284,168,3,169,178, 

145,283,136,298,249,96,56,233,1,248,32 

,162 
IB 1898 DATA 33,168,3,169,8,145,283,136,2 

88,249,165,293,24,185,48,133,283,165,2 

84,185 
GQ 1188 DATA 8,133,284,282,288,231,194,18 
4,184,184,96,162,32,168,3,169,85,145,2 

83,136 
MO 1118 DATA 288,249,165,203,24,195,49,13 

3,283,165,284,185,8,133,284,282,168,3, 

169,253 
ME 1128 DATA 145,283,136,169,255,145,293, 

136,169,127,145,293,165,293,24,195,48, 

133 
SO 1139 DATA 283,165,204,105,8,133,264,28 

2,288,224,168,3,169,85,145,283,136,288 
KC 1149 DATA 249,169,8,133,286,133,288,13 

3,289,184,184,72,281,2,248,8,281,4,248 

,4 
CX 1158 DATA 169,85,133,289,184,56,233,1, 

18,18,18,18,281,48,288,3,24,195,11,24 
FF 1168 DATA 185,64,24,18,38,286,19,38,29 

6,19,38,296,133,295,24,165,296,199,244 

,2 
HE 1179 DATA 133,296,194,194,56,233,32,24 

,19,38,298,19,38,298,19,38,288,133,287 

/24 
EG 1188 DATA 165,288,189,244,2,133,288,56 

,165,283,233,37,133,283,165,204,233,8, 

133,284 
YE 1198 DATA 162,8,168,7,56,169,254,241,2 

87,18,24,185,1,5,299,129,293,56,165,29 

3 
UJ 1288 DATA 233,48,133,283,165,284,233,8 

,133,284,136,16,227,168,7,56,169,255,2 

41,285 
CD 1218 DATA 18,18,24,185,1,5,289,129,283 

,56,165,283,233,48,133,283,165,264,233 

i8 
PP 1229 DATA 133,294,136,16,226,24,165,29 

3,195,38,133,293,165,294,195,9,133,294 

,169,7 
EL 1239 DATA 56,169,127,241,295,5,289,129 

,293,56,165,283,233,48,133,283,165,284 

,233,8 
SP 1248 DATA 133,284,136,16,231,168,7,56, 



169, 255, 241, 287, 74, 5, 289, 129, 283, 56, 16 

5,283 
MI 1258 DATA 233,48,133,283,165,284,233,8 

■ 133 ■ 284 . 136 . 16 . 238, 96 
BY 2998 REM M 1 1 :i -III H ■» ; | -jm j ' | j 
TU 2819 DIM CARDS C594) ,NUM$(13) :CARDS=" " 

: CARD$ C594) =CARD$ : CARD$ C2) =CARD$ 
CX 2929 CS=ADRCCARD$) 
PB 2838 RESTORE 1888: FOR 1=8 TO 583: READ 

D:POKE CS -H,D:NEXT I 
IX 2848 REM 
ES 2858 REM 
VI 2868 REM 
JH 2878 REM 
UN 2888 REM 
QL 2898 REM 

EE 2188 REM ^__ 

UN 2118 NUMS="23456789TJQKA' 

XP 2128 GRAPHICS 8+16 

NU 2138 POKE 789,15:P0KE 71B,96:P0KE 712, 

4 
AC 2148 RETURN 



Listing 2 
Assembly listing 

KMKlCKlCKKMKKKKlCKKKmCKKlCKKKKKKKKKKMll 



J = U5R tCS, Y, X, SIDE, SUIT^UJ 
C5=START OF SUBROUTINE! 
Y=VERTICAL POS. C8-168J 
X=HOR. POS. C0-37J 
SIDE-BflCK. FRONT. BLft NKC9.1,2i 
SUIT = ¥J>*t tl,2,3,4J 
U=UALUE tASCC"2-A"J) 



BY: 



10 

28 

38 

48 

58 

68 

78 

88 

98 

0199 

8119 

9128 

0138 

8149 

9159 

8169 

8178 

9189 

9199 

9298 UL 

8219 SU 

8229 UAL 

0239 COL 



PROGRAM: CARD.SOR 

A RELOCATABLE ASSEMBLY LANGUAGE 
SUBROUTINE TO PLACE A CARD 
ANYWHERE ON A GR . 8 SCREEN. CARDS 
MILL BE 32 SCAN LINES HIGH AND 3 
BYTES NIDE 



ERIC HUFFMAN 

4339 NEM BEDFORD DRIUE 

FT. COLLINS, CO 89525 



OPTIONS: FACE UP, BACK UP,& ERASE 



CARD TO SCREEN SUBROUTINE 

MKKICllKlCKKmClllCKKmiKMKKXKKltKmtKlCKK 



EQU 283 

EQU 285 

EQU 287 

EQU 289 

PLA 

LDA »8 
STA 77 

LDA 88 

STA UL 
LDA 89 
STA UL+1 



; UPPER LEFT POS 
;SUIT OF CARD 
; VALUE OF CARD 
;COLOR OF CARD 

;PULL ARG CNT 



; RESET ATTRACT 

; STORE SCRN UPPER 
CORNER IN UL 



9248 
8258 
8268 
9278 
8288 
8299 
8389 
0319 
8328 
0338 
0348 
9359 
8369 
8378 
8388 
8398 
8488 
8418 
0428 
8439 
9448 
8458 

8468 Loopy clc 

8470 LDA UL 

8488 ADC tt48 

8498 STA UL 

8588 LDA UL+1 

8518 ADC tt8 

6528 STA UL+1 

8538 DEY 

8548 BNE LOOPY 

8558 ; 

0568 ; 

8578 ; HORIZONTAL POSITION ADJUSTMENT 

8588 DONEY CLC 

0598 PLA 



; VERTICAL POSITION ADJUSTMENT 

PLA ;PULL Y HIGH BYTE 

; ; DISCARD C=8 J 

PLA ;PULL Y 
BEQ DONEY ; IF 8 SKIP 

; VERT ADJ 
TAY 

ADD 48 BYTES FOR EACH Y 



; BUMP 48 UNTIL 
Y=8 



;PULL X HIGH BYTE 



ANALOG COMPUTING 



MAY 1988 / PAGE 73 



Dealin' Demo 



continued 



eeee 
eeie 

0626 

0636 

6646 

6656 

6666 

6676 

6686 

6696 

6766 

6716 

6726 

6736 

6746 

6756 

6766 

6776 

6786 

6796 

6806 

6816 

6820 

6836 

6840 

0850 

0860 

0870 

0880 

0890 

0900 

0910 

0920 

0936 

0948 

0950 

6960 

0976 

6986 

6996 

1006 

1616 

1626 

1636 

1646 

1056 

1666 

1670 

1686 

1696 

1100 

1116 

1126 

1136 

1146 

1156 

1166 

1176 

1186 

1196 

1260 

1216 

1226 

1230 

1240 

1256 

1266 

1276 

1286 

1296 

1366 

1316 

1326 

1336 

1346 

1356 

1366 

1376 

1380 

1390 

1406 

1416 

1426 



PLA 

ADC UL 
STA UL 
LI>A UL+1 
ADC tt6 
STA UL+1 



DISCARD 1=0} 
jPULL X L0MC6-37] 



;X OFFSET ADDED 



; MKlCllKKKKKmCKKlCKKKKKKKKKKKKKKKKKIC 

; DETERMINE OPTION CBACK, FRONT OR 

; BLANK (6,1 OR 21 

PLA ;PULL SIDE HIGH, 

; DISCARD c=e) 

PLA ;PULL SIDE LDH 

ONE FB ;IF NOT 6, SKIP 
TO FRONT/BLANK 



KKKKKlCKlCimKKMKKKMKMKlCllKlCKMKKlCKlCK 



IF 6 THEN DISCARD UNUSED SUIT & 
VALUE AND DRAM BACK OF CARD 
PLA ;PULL SUIT HIGH 

PLA ;PULL SUIT 

PLA ;PULL VALUE HIGH 

PLA ;PULL UALUE 

PAINT BACK OF CARD 
FOR EASE OF ADDRESSING THE X 
REG HOLDS THE VERTICAL POSITION 
AND THE Y REG HOLDS THE HOR. 
CONLY Y HAS INDEXED INDIRECT} 



LDX ttl6 ;16 PAIRS OF 

; SCAN LINE 

LX LDY t»3 ;3 BYTES HIDE 
; BACK PATTERN IS 179,51,50 EVERY 
; OTHER LINE GOING DOMN 

LDA ttSO 

STA CULJ,Y 

DEV 

LDA ttSl 

STA CULJ,Y 

DEY 

LDA ttl79 

STA tULJ,Y 

LDA UL 

CLC 

ADC ttse 

STA UL 

LDA UL+1 

ADC tt6 

STA UL+1 

DEX 

ONE LX 
; DRAM BOTTOM LINE 

LDY tt3 
BT LDA ttl76 

STA CUL),Y 

DEY 

BNE BT 
; DRAM BACK PATTERN 146,264,266 
; EVERY OTHER LINE GOING UP 

LDA UL 

SEC 

SBC tt48 

STA UL 

LDA UL+1 

SBC no 

STA UL+1 
LDX ttl6 
LX2 LDY tt3 

LDA »2e6 

STA (UL},Y 

DEY 

LDA t*264 

STA (UL},Y 

DEY 

LDA ttl48 

STA CULJ,Y 

LDA UL 

SEC 

SBC tt86 



1436 

1448 

1456 

1466 

1476 

1486 

1496 

1566 

1516 

1526 

1530 

1540 

1550 

1560 

1570 

1580 

1590 

1600 

1610 

1620 

1630 

1640 

1650 

1660 

1670 

1680 

1690 

1700 

1716 

1726 

1736 

1746 

1750 

1760 

1770 

1780 

1790 

1800 

1816 

1826 

1830 

1846 

1856 

1866 

1876 

1886 

1898 

1966 

1918 

1926 

1936 

1948 

1956 

1966 

1978 

ANK 

1988 

1996 

2600 

2010 

2020 

2030 

2040 

2050 

2060 

2070 

2680 

2090 

2100 

2110 

2120 

2130 

2140 

2150 

2160 

2170 

2180 

2190 

2200 

2210 

2226 

2238 

2246 



STA UL 

LDA UL+1 

SBC ttO 

STA UL+1 

DEX 

BNE LX2 

LDA UL 

CLC 

ADC tt46 

STA UL 

LDA UL+1 

ADC ttS 

STA UL+1 
; DRAM TOP LINE 

LDY «3 
TP LDA »176 

STA (UL),Y 

DEY 

BNE TP 

RTS 



BACK DONE 



MKKMKKXMICICICKKKKKKKMKICKKICKKKKKKKM 



PAINT FRONT/BLANK 

FB SEC 

SBC ttl 
BEQ FRONT 

MKKmdCKKKlllCKMKKKMKKKKKmcmCKKKKKIl 



PAINT BLANK 

OK, OPTION MUST BE BLANK CERASE} 

SO DRAM BACKGROUND COLOR 

LDX tt33 
B2 LDY 1*3 
Bl LDA Ue 

STA (ULJ,Y 

DEY 

BNE Bl 

LDA UL 

CLC 

ADC tt48 

STA UL 

LDA UL+1 

ADC tt8 

STA UL+1 

DEX 

BNE B2 
;PULL SUIT S VALUE, DISCARD 

PLA J PULL SUIT 

PLA 

PLA ;PULL VALUE 

PLA 

RTS ;ALL DONE HITH BL 



; KICICK1CK1CKXMKK1CKK)CKKKKIC1C1IMXMKMKMKM 

; THIS SECTION PAINTS THE FRONT 
; OF A CARD. 

FRONT LDX tt32 

LDY tt3 
; DRAM TOP LINE 
TF LDA tt85 

STA CULJ,Y 

DEY 

BNE TF 

LDA UL 

CLC 

ADC tt40 

STA UL 

LDA UL+1 

ADC tte 

STA UL+1 

DEX 
DRAM MHITE FACE AND BORDER 



LX3 LDY tt3 

LDA 1*253 

STA (UL),Y 

DEY 

LDA 1*255 



PAGE 74 / MAY 1988 



ANALOG COMPUTING 



2258 


9TA 


CUL),Y 


.'" 


2260 


DEY 






2278 


L!>A 


ttl27 




2280 


STfl 


CULJ,Y 




2290 


LDA 


UL 




2300 


CLC 






2310 


ADC 


tt4e 




2320 


STA 


UL 




2330 


LDA 


UL+1 




2340 


ADC 


ttO 




2350 


STA 


UL+1 




2360 


DEX 






2370 


BNE 


LX3 




2380 


; DRAM BOTTOM LINE 


2390 


LDY 


tt3 




2400 


BF LDA 


no 5 




2410 


STA 


CUL},Y 




2420 


DEY 






2430 


BNE 


BF 




2440 


; ZERO OUT SUIT 


, UALUE & COLOR 


2450 


LDA 


no 




2460 


STA 


SU+1 




2470 


STA 


UAL+1 




2480 


STA 


COL 




2490 


PLA 




;PULL SUIT HIGH 


2500 


PLA 




JPULL SUIT (1-41 


2510 


; PUSH TO STACK 


FOR USE LATER 


2520 


PHA 






2530 


; SET COLOR MASK - FOR BLACK 


2540 


; 




85 FOR RED 


2550 


CMP 


tt2 




2560 


BEO 


BLK 




2570 


CMP 


tt4 




2580 


BEQ 


BLK 




2590 


LDA 


ttos 




2600 


STA 


COL 




2610 


BLK PLA 




;PULL SUIT AGAIN 


2620 


; FIND SUIT IN 


MEMORY 


2630 


SEC 






2640 


SBC 


ttl 




2650 


ASL 


A 




2660 


ASL 


A 




2670 


ASL 


A 




2680 


ASL 


A 




2690 


CMP 


tt48 




2700 


BNE 


SKI 




2710 


CLC 






2720 


ADC 


ttll 




2730 


SKI CLC 






2740 


ADC 


tt64 




2750 


CLC 






2760 


; NEXT MUST MULTIPLY BY 8 


2770 


ASL 


A 




2780 


ROL 


SU+1 




2790 


ASL 


A 




2800 


ROL 


SU+1 




2818 


ASL 


A 




2828 


ROL 


SU+1 




2838 


STA 


su 




2848 


CLC 






2850 


LDA 


SU+1 




2880 


ADC 


756 


;ADD CHAR. SET 


2870 


; 




START 


2880 


STA 


SU+1 


;SUIT MEM POS 


2890 


t 




STORED 


2900 


; START 


ON VALUE 


2910 


PLA 




jUALUE HIGH 


2920 


PLA 




J UALUE LOH 


2930 


SEC 






2940 


SBC 


tt32 




2950 


CLC 




;NEXT MUST X8 


2960 


ASL 


A 




2970 


ROL 


VAL+1 




2980 


ASL 


A 




2990 


ROL 


UAL+1 




3000 


ASL 


A 




3010 


ROL 


UAL+1 




3020 


STA 


UAL 




3030 


CLC 






3840 


LDA 


UAL+1 




3050 


ADC 


756 




3860 


STA 


UAL+1 


; UALUE MEM. STORE 


3070 








3080 


; * PUT 


EM ON THE SCREEN « 


3898 








3188 


; START 


AT BOTTOM, HORK UP 


3118 


SEC 







3128 


LDA UL 




3130 


SBC tt37 




3140 


STA UL 




3150 


LDA UL+1 




3160 


SBC tie 




3170 


STA UL+1 




3180 


LDX ttO 




3190 


; FIRST, THE UALUE ON RIGHT SIDE 


3200 


LDY »7 




3210 


UR SEC 




3220 


LDA tt254 


; CREATE INUERSE 


3230 


SBC CUAL],Y 




3240 


ASL A 


;FOR CLARITY 


3250 


CLC 




3260 


ADC ttl 




3270 


ORA COL 


; COLOR MASK 


3280 


STA CUL,X} 




3290 


SEC 




3300 


LDA UL 




3310 


SBC n40 




3320 


STA UL 




3330 


LDA UL+1 




3340 


SBC no 




3350 


STA UL+1 




3360 


DEY 




3370 


BPL UR 




3380 


; SECOND, THE SUIT ON RIGHT SIDE 


3390 


LDY »7 




3400 


SR SEC 




3410 


LDA tt255 


; CREATE INUERSE 


3420 


SBC CSU},Y 




3430 


ASL A 


;FOR CLARITY 


3440 


ASL A 


;F0R CLARITY 


3450 


CLC 




3460 


ADC ttl 




3470 


ORA COL 


; COLOR MASK 


3480 


STA (UL,X1 




3490 


SEC 




3500 


LDA UL 




3510 


SBC tt40 




3520 


STA UL 




3530 


LDA UL+1 




3540 


SBC ttO 




3550 


STA UL+1 




3560 


DEY 




3570 


BPL SR 




3580 


CLC 




3590 


LDA UL 




3600 


ADC tt38 




3610 


STA UL 




3620 


LDA UL+1 




3630 


ADC ttO 




3640 


STA UL+1 




3650 


; THIRD, THE SUIT ON THE LEFT SIDE 


3660 


LDY tt7 




3670 


SL SEC 




3680 


LDA ttl27 


; CREATE INUERSE 


3690 


SBC CSUJ,Y 




3700 


ORA COL 


; COLOR MASK 


3710 


STA tUL,X) 




3720 


SEC 




3738 


LDA UL 




3748 


SBC t>4e 




3758 


STA UL 




3768 


LDA UL+1 




3778 


SBC ite 




3788 


STA UL+1 




3798 


DEY 




3800 


BPL SL 




3810 


;LAST, THE UALUE 


ON THE LEFT SIDE 


3820 


LDY tt7 




3830 


UL SEC 




3840 


LDA tt255 


; CREATE INUERSE 


3850 


SBC (UAL],Y 




3860 


LSR A 


;FOR CLARITY 


3870 


ORA COL 


; COLOR MASK 


3880 


STA CUL,X) 




3890 


SEC 




3900 


LDA UL 




3910 


SBC tt40 




3920 


STA UL 




3930 


LDA UL+1 




3940 


SBC ttO 




3950 


STA UL+1 




3960 


DEY 




3978 


BPL UL 




3988 


RTS 


; FRONT DONE • 



ANALOG COMPUTING 



MAY 1988 / PAGE 75 




REGULAR FEATURE 



Database 
Delphi 



by Michael A. Banks (KZIN) 

As usual, there's lots happening on Del- 
phi in general, and in the Atari Users' 
Group in particular. In case you haven't 
logged on in a while, or might have 
missed something, we'll try to get you 
caught up on things here. And if you're 
not on-line. . .well, you really don't know 
what you're missing, so we're going to 
show a bit of it to you in a few lines. 

First, let's take a a look at some recent 
enhancements to Delphi. 

Downloading and uploading: 
Ymodem and a simplified 
database download menu 

In addition to ASCII file transfer, Xmo- 
dem, windowed Xmodem, and Kermit file 
transfer protocols, Delphi now supports 
the increasingly popular Ymodem pro- 
tocol for uploads and downloads. Ymo- 
dem is an extended version of Xmodem, 
using 1024-byte (IK) blocks, rather than 
Xmodem's 128-byte blocks — which adds 
noticeable speed to uploads and down- 
loads! 

To use Ymodem in the database areas, 
type YM at the ACTION > prompt— after 
you've set your terminal software to re- 
ceive Ymodem, of course. (Notice to 
"Flash" terminal program users: Flash 
calls Ymodem "1 K-byte Xmodem.") 

Alternatively, you can simply type 
DOWN (for "Download") at a database 
ACTION > prompt, and select Ymodem 
transfer from the menu that is displayed. 
This menu is a handy reminder of the var- 
ious download protocols and the com- 
mands used to invoke them. 

To use Ymodem in your personal work- 
space, simply type YUP or YDO (for 
"Ymodem UPload" or "Ymodem Down- 
load," respectively) at the WS > prompt. 

Database search enhancement 

Delphi has streamlined its database 
search procedures. To find items meeting 
your criteria in any database in the Atari 
Users' Group, simply type SEARCH at a 
database name prompt, then enter a key- 
word. All items that don't match the key- 
word will be rendered temporarily "in- 



News and updates from 

the ANALOG Computing 

Atari Users' Group on Delphi 



visible" to you. Delphi will tell you how 
many items match your keyword, and 
you'll be presented with a temporary sub- 
set of the database that you can access 
with the usual database commands. 

If the keyword you enter returns too 
many items, you can narrow the search 
by typing NARROW. This will prompt 
you for a kejrword. After you enter it, Del- 
phi will reduce the number of files 
"found" to include only those items that 
have both keywords. 

Too few items? Use EXPAND to include 
all items that have either the first keyword 
or the new keyword. The NARROW and 
EXPAND commands can be used to speci- 
fy virtually any number of keyw^ords. 

A quick look at 
Delphi groups and clubs — 
and The Atari Users' Group! 

And now, for those of you who have 
been wondering just what Delphi looks 
like, here's a small sample — including the 
Atari Users' Group, the on-line service for 
readers of ANALOG Computing and ST- 
Log. 

First, let's take a look at Delphi's 
"Groups and Clubs" menu (noting, of 
course, the number one position of our 
favorite group!): 



Atari SIG 

Antiques/Collectibles 
Apple ][ & /// 
Aviation SIG 
Business Forum 
Close Encounters 
Color Computer 
Commodore SIGs 
C.SIX 
GameSig 

Macintosh ICONlacl 
Micro Artists (MANIAC) 
Model Builders 



Music City 

0S9 On-Llne 

PC Compatibles/IBM SIG 

Portable Place 

Science Fiction Sig 

Starstiip Amiga 

Tandy PC SIG 

Tl Information Network 

Theological Network 

Wang Users SIG 

Writers Group 

HELP 

EXIT 



As you can see, there is a group or club 
for virtually any Interest — computing or 
non-computing — on Delphi. 

Now, let's take an all-too-brief look at 
the Atari Users' Group. (Type ATARI at 
the "Groups and Clubs" menu to get in.) 

When you first enter the Atari area, 
you'll see ANALOG'S logo and banner Af- 
ter the logo and banner and any new an- 
nouncements, you'll see this menu: 



ANALOG'S ATARI SIG Menu: 



Announcements 


Request Free Upload 


Conference 


Set Preferences 


Databases 


Topic Descriptions 


Entry Log 


Who's Here 


Forum (Messages) 


Workspace 


MAIL (Electronic) 


Help 


Member Directory 


Exit 


Poll 





ANALOG > What do you want to do? 

The Atari menu is your gateway to 
many on-line activities, including real- 
time conference, databases packed with 
informative articles and useful programs, 
the "Forum" (a bulletin board where you 
can post questions and join in discussions 
on a wide variety of topics), and much 
more. 

You may well be wondering what sort 
of information and programs are available 
in the databases. Here's a list of topics to 
whet your appetite: 

Databases Available Menu: 

General Interests Reviews & News 

Games & Entertainment ST Programs 

Telecommunications Koala Pictures 

Utilities DEGAS Pictures 

Toolbox for the ST Current Issue 

Sight & Sound Home use 

Education Applications for the ST 
Electronics & Science 

TOPIC > Which topic? 

And — what the heck — here's a peek at 
a very small portion of the list of files 
available for dow^nload in just one of the 
database topics, "Games & Entertain- 
ment": 

(Okay, so you're not on Delphi yet. 
That's alright: We've reserved a spot for 
you. Check elsewhere in these pages for 
information on a special Delphi signup 
offer) 

Atari database updates 

Speaking of databases (and we were, a 
few lines back), fans of the Electronic 
MAG will be happy to know that MAT- 
RAT (Matthew J.W. Ratcliff) has finally 
found enough time to put together the 
fifth issue. Of special interest in this is- 
sue are bizarre techniques for crashing the 
ST. According to MATRAT, this informa- 
tion is important, "So we know how they 



PAGE 76 /MAY 1988 



ANALOG COMPUTING 




Database 

Delphi continued 



occur, and therefore, how to avoid them." 

In the same issue, you find reviews of 
some classic 8-bit Atari cartridges by 
MATRAT, a report from IBLAKE (Blake 
Arnold] on the Navarone Clock card for 
the ST, and more. 

Files from the September and October, 
1987 issues of ST-Log are in the "Current 
Issue" section of the database area. In- 
cluded are Darek Mihocka's "ST Xform- 
er" (this one turns your ST into an Atari 
800), and the monochrome version of 
"Floyd the Droid on the Run." Eight- 
bitters will find files from the same issues 
of ANALOG Computing in the same sec- 
tion of the database. 

Of special interest in the "Reviews and 
News" database is the verbatim text of 
ANALOG Publishing's Summer CES in- 
terview with Atari executives Neil Har- 
ris, Sam Tramiel and Jerry Brown. 

C programmers and graphics fans will 
also find some special gems in the data- 
bases. 

(Note: The programs presented in both 



ANALOG Computing and ST-Log maga- 
zines are posted in the relevant databases 
on or after the first of the month of each 
issue's cover date. While we permit free 
distribution of programs presented in 
both magazines, the text of program docu- 
mentation and articles published in both 
magazines is copyrighted material and is 
definitely not public domain. This text 
may not be reproduced in any form [in- 
cluding distribution through BBSs or oth- 
er telecommunication services] without 
written permission from the publishers of 
ANALOG Computing and ST-Log.) 
Forum update: hot topics 
and yet another enhancement 
Current hot topics of discussion in the 
Forum include OS-9 68K (and we couldn't 
help but notice a few pointed barbs re- 
garding COCO OS-9 users], and ST pric- 
ing. Too, MATRAT managed to stir up 
more than a little interest with a message 
that brought to everyone's attention the 
fact that coverage of the ST and Amiga 
have been dropped from Byte — perhaps 



DBASES:Gam> DIRECTORY 








ROTO-WRENCH 


PROG 


24-AUG 


ANAL0G2 


LIFE IN THE FAST LANE 


PROG 


10-JUL 


ANALOG2 


DRAGONLORD DUNGEON EDITOR 


PROG 


10-JUL 


ANALOG2 


ROCKS! 


PROG 


9-JUL 


ANALOG2 


AUSTRALIAN XAGON 


PROG 


17-JUN 


ATARICOP 


ANIMATED GRAPHIC STORYBOOK 


PROG 


16-JUN 


ATARICOP 


WALNUM'S VINTAGE ADVENTURES 


PROG 


15-JUN 


ANAL0G4 


TV BINGO TRACKER 


PROG 


12-JUN 


FREDBUSH 


DRILLING FOR OIL 


PROG 


10-JUN 


ATARICOP 


CAVELORD FROM GERMANY 


PROG 


10-JUN 


ATARICOP 


FLOYD THE DROID GOES BLASTIN' 


PROG 


7-JUN 


ANALOG2 


FRENCH FORTUNE-WHEEL 


PROG 


24-MAY 


NORMLEV 


MIDAS MAZE 


PROG 


1-MAY 


ANALOG2 


RAMBUG II 


PROG 


1-MAY 


ANAL0G2 


DEVILS DOORWAY 


PROG 


1-MAY 


ANAL0G2 


LEATHER GOD.SOL 


TEXT 


21-APR 


JEC 


DECRYPTO 


PROG 


7-APR 


MENTAT 


SLITHER 


PROG 


6-MAR 


ANAL0G2 


STARLANES 


PROG 


6-MAR 


ANALOG2 


WYZLE 


PROG 


25-FEB 


ANAL0G2 


TR.I.A.D 


PROG 


2-JAN 


PHOEBUS 


CHECKERS 


PROG 


29-DEC 


PHOEBUS 


KRAZY KAI IhRPILLARS 


PROG 


24-DEC 


ANALOG2 


ZEVIOUS 


PROG 


24-DEC 


ATARICOP 


SNOWBALL 


PROG 


22-DEC 


AJQ 


AMAZING MAZE 


PROG 


10-DEC 


ANALOG2 


FORTUNE-WHEEL 


PROG 


10-DEC 


ANALOG2 


ESP TEST 


PROG 


25-NOV 


ATARICOP 


COSMIC GLOB 


PROG 


17-NOV 


ANAL0G2 


MODEM CHESS 


PROG 


17-NOV 


ANAL0G2 


CASTEL QUEST 


PROG 


29-OCT 


ATARICOP 


TOOTH PASTE 


DATA 


29-OCT 


ATARICOP 


COMPUTER TESTS 


PROG 


29-OCT 


ATARICOP 


THE GAME OF RATS 


PROG 


28-OCT 


ANALOG2 


DEATHZONE 


PROG 


17-OCT 


ANAL0G2 


SMACK 


PROG 


4-OCT 


RCURZON 


WHEEL OF FORTUNE II 


PROG 


25-SEP 


TUCKER 


LAUNCH CODE 


PROG 


15-SEP 


ANAL0G2 


MOONLORD 


PROG 


15-SEP 


ANAL0G2 


COMMODORE KILL 


DATA 


8-SEP 


ATARICOP 


WHEEL OF FORTUNE 


PROG 


5-SEP 


ATARICOP 


SOLAR FLARES... 


TEXT 


5-SEP 


THUD 


FUN WITH MACHINES 


TEXT 


5-SEP 


THUD 


More? No 









because they aren't drawing the advertis- 
ing dollars that other products bring in, 
or because Byte readers have an IBM and 
Mac fixation. Who knows? Check into the 
Forum and add your comments! 

Yet another useful command has been 
added to the retinue of Forum options. 
The command is TAG, and it's used to 
mark messages that you wish to view a 
second time for reference or reply. TAG 
works like this: Each time you read a mes- 
sage that you know you'll want to see 
again, type TAG. The message is marked, 
and will be displayed (along with any oth- 
er marked messages) when you type 
READ TAGGED. If you tag messages and 
forget about them, Delphi v^rill remind you 
when you leave Forum that there are 
tagged messages waiting, and give you 
the option of then reading them. 

And why would you want to tag mes- 
sages? Well, tagging messages is especial- 
ly useful in selecting messages for down- 
load. Rather than opening your capture 
buffer and catching everything (and then 
having to sort through a few Ks worth of 
characters off-line], use TAG to mark mes- 
sages of interest. After you've finished 
checking all of the new messages in the 
Forum, open your buffer, type READ 
TAGGED, and get only the messages you 
want. 

TAG is also handy for marking mes- 
sages for reply. Mark messages to which 
you wish to reply as you go through new 
messages, then go back with READ 
TAGGED to display those messages. Tliis 
can save time and keep you from enter- 
ing dumb messages. You won't have to 
stop to note message numbers, and by the 
time you enter your rephes, you will have 
read everything relevant to the messages 
in question. 

That's it for this month. We'll be back 
next issue with more news and tips. Un- 
til then, see you on-line! H 

Michael A. Bonks is the author/designer 
of Gateway, a text and graphics adventure 
for the ST published by Pryority Software 
and Action Software. 

Banks also writes science fiction nov- 
els (among which is The Odysseus Solu- 
tion, from Baen Books), and non-/iction 
books (The Official Guide to Delphi, Bra- 
dy Brooks, and Second Stage: Advanced 
Model Rocketry, Kalmbach Books). 

He currently has three novels, one ju- 
venile book, and eight non-/iction books 
in print. A full-time writer for four years 
and a computer user for six, Banks resides 
in Ohio, with his wife, daughter, son and 
no cats. 



ANALOG COIVIPUTING 



MAY 1988 / PAGE 77 



Get the Extra on disk! 



A special offer 
for Extra 
owners. . . 

2 DISKS 
for 
only 
$24.95 




Use the convenient card at the back of this book 
to order your disk version. 

Send for It now! 



HARDWARE 







Bits &s Pieces 



Leftover Zucchini — part 2 



by Lee S. Brilliant, M.D. 



Last time we began a long journey into the inner work- 
ings of the Atari SIO by looking at the interrupt system, and 
we hinted at finding other uses for your old 400/800 com- 
puters. This month we'll continue our trek by delving into 
the inner workings of POKEY, and seeing just what it does 
in terms of the serial port. So let's get started. 

POKEY is a large-scale IC which combines several func- 
tions into one package. It has 16 registers in the address 
block $D200 to $D20F, and performs sound generation, pad- 
dle inputs. Serial I/O, keyboard scanning, random number 
generation, and IRQ interrupts. Two installments ago 
("Sights and sounds"), we discussed the first nine registers, 
so we won't repeat this information, but we will refer to 
Figure 1 regarding the last seven registers. 



Register 


Address 


Name 


Read 


Name 


Write 


9 


D209 


KBCODE 


Raw keyboard code 
when moved (o 764 


STIMER 


Starts POKEY timers when 
audio channels are timers 


10 


D20A 


RANDOM 


Random # 0-255 


SKREST 


Reset serial port bits 
5-7 ® SKSTAT 


11 


D20B 




NOT USED 


POTGO 


Stan paddle read cycle 


12 


D20C 




NOT USED 




NOT USED 


13 


D20D 


SERIN 


Data read from serial 
port 


SEROUT 


Data write to serial 
port 


14 


D20E 


IRQST 


IRQ interrupt status 


IRQEN 


IRQ interrupt enable 


15 


D20F 


SKSTAT 


Serial port error 
status register 


SKOTL 


Serial port, pot & key- 
board control register 



Figure 1 — POKEY registers 

Of these last seven registers, numbers 10, 13, 14 and 15 
are of importance to Serial I/O. 



One at a time 

Data is sent serially by placing a byte into an 8-bit shift 
register, then applying clock pulses. A shift register is a line 
of 1-bit registers which "shift" their contents one position 
to the right with each clock pulse. The leftover bit is forced 
onto the output line with the wire assuming the logic state 
of the shifted bit. After eight clocks, the register is empty 
and the whole byte has been sent. POKEY's shift register 
output goes to pin 5 on the serial plug. Actually, the Atari 
uses a 10-bit register with the first (start) bit permanently 
set to 0; the last (stop) bit set to 1; and the data byte sand- 
wiched in between. 







1 



1 
1 




DATA 


BYTE 


\ I 


1 \ 


10 111 


10 10 


o"'" 


cK.cn '' 




10 11 


10 10 1 


-. 


cioe, -^ 




- - 1 1 


110 10 


lie -^ 













Figure 2 — Shift register 

The similarity to the ASL, LSR, ROR and ROL commands 
is obvious. 



ANALOG COMPUTING 



MAY 1988 / PAGE 79 



^f Bits &? Pieces continued 



The shift register is located within POKEY, so it makes 
sense that clock pulses are generated by the sound chan- 
nels. While this provides flexibility in baud rates — and 
saves hardware — it prevents sound production and I/O from 
occurring at the same time. Channels 3 and 4 are arranged 
in 16-bit format and clocked at 1.79 MHz to yield a rate of 
about 19,200 baud or bits per second. The same frequency 
also shows up on the Clock Out pin of the serial plug and 
could be used for synchronous communications, but most 
Serial I/O is asynchronous. 

You load the Serial Shift register by storing your data byte 
into the SEROUT register at $D20D (POKEY register 13). 
Assmning the clock is running, writing to SEROUT fills the 
shift register and starts serial transmission. Data is received 
in reverse order by another shift register with the input com- 
ing from pin 3 of the serial plug. The clock must be run- 
ning when the Data In line goes to with the start bit. The 
bit value of the Data In line is then passed to the first bit 
of the shift register with each clock pulse, while the rest 
of the data moves to the left. When the shift register is full, 
the byte is finally moved to SERIN, also at $D20D, where 
it can be read by the OS. The stop bit is always a 1 to leave 
the serial line ready for the next start bit. 



Actually, it isn't quite that simple, because all of this read- 
ing, writing and shifting is regulated through the POKEY 
IRQ interrupt system. Three of POKEY's interrupts are used 
to regulate Serial I/O: two for transmission and one for 
reception. Writing to SEROUT fills an Internal Holding reg- 
ister, and when this byte is then moved to the shift regis- 
ter, POKEY signals that it wants more data by setting bit 
4 of IRQST. 

If the corresponding bit in IRQEN has been set, the in- 
terrupt is generated and the OS performs an IRQ, via the 
interrupt processor, which then routes through the VSEROR 
(Vectors for the SERial Output Requested) interrupt routine. 
This routine puts the next byte into SEROUT before the shift 
register sends the last bit of the previous byte, thus ensur- 
ing a smooth transmission of data. When the last data byte 
has been loaded into SEROUT, the next byte is a checksum. 
After the checksum is loaded into SEROUT, the VSEROC 
(Vectors for the SERial Output Complete) interrupt is ena- 
bled so that when the last bit of the checksum has been sent, 
this interrupt routine can be called to terminate trans- 
mission. 

When data is being received, shifting begins when the 
Data In line goes to logic with the start bit, and ends with 



B&C 



Compute rVisions 



3257 Kifer Road 

Santa Clara, CA 95051 

(408)749-1003 



A 



STORE HOURS 
TUE - FRI 10am - 6pm 

SAT - 10am - 5pm 
CLOSED SUN - MON 



RECONDITIONED ATARI MERCHANDISE 

All merchandise has been tested and reconditioned and is in like-new condition except where noted by the letter "B" after the price. The "B" price indicates 
product may have scratches or other superficial surface marks. 30 day warranty. 



ATARI 

IRAK BALL 

$9.95 A 

SPICE UP THE 
ACTION IN YOUR 
ARCADE GAMES! 



ATARI 
SPACE AGE 
JOYSTICK 

$5.00 A 

GUN TRIGGER ACTION! 



STANDARD 

ATARI 
JOYSTICK 

$4.50 A 

STOCK UP ON A FEW 
SPARES 



1 



REMOTE 

CONTROL 

JOYSTICKS (2) 

$15.95 A 

REQUIRES 2600 POWER 
PACK FOR USE WITH 
400/800/XL/XE - $5.00 



ATARI 
TOUCH 
TABLET 
$39.95 A 

DONT PUT OFF GETTING 
THIS HARD-TO-FIND ITEM 



400 (16K) 

COMPUTER 
$29.95 A 

48K UPGRADE KIT 

$25.00 



600XL(16K) 

COMPUTER 

$49.95 A 

INCL. POWER 
SUPPLY & TV 
SWITCH BOX 



800 (48K) 

COMPUTER 

$69.95 B 

$79.95 A 

INCL. BASIC CART & 
MANUAL 



NUMERIC 
KEY PAD 

$7.95 A 

INCL. HANDLER DISK USE 

WITH THE BOOKKEEPER 

AND BASIC 



850 
INTERFACE 

$89.95 A 

LIMITED 
SUPPLY 



1030 
MODEM 

WITH 

EXPRESS 
$29.95 A 

GET ON- LINE TODAY! 




835 
MODEM 

WITH 

EXPRESS! 
$29.95 A 

LIMITED SUPPLY 



810 
DISK DRIVE 

$110.00 B 
$120.00 A 

INCLUDES POWER 

SUPPLY, I/O CABLE 

&DOS2 



ATARI 
BOOKKEEPER 
$14.95 - NO BOX 

($19.95 WITH RECON KEYPAD) 

$24.95- IN BOX 

($29.95 WITH RECON KEYPAD) 



DISKETTES 

AS LOW AS 
20 CENTS 

10 FOR $4.00 

100 FOR $29.00 

1000 FOR S200 

MOST ARE UNNOTCHED 
WITH OLD SOFTWARE 




SH PPING INFORMATION - Prices do not include sliipping and handling. Add $5.00 for small items Add $8.00 for disk drive 
Gaht. res. include 7% sales tax. Mastercard and Visa accepted if your telepfione is listed in your local phone directory Orders may be 
pre-paid with money order, cashier check, or personal check. Personal checks are held for three weeks before order is processed COD 
orders are shipped via UPS and must be paid with cash, cashier check or money order. International and APO orders must be pre-paid with 
cashier ="eck or money order $20 00 minimum on all orders. All sales are final - no refunds - prices are subject to change. Phone orders 
accepted TUESDAY THROUGH FRIDAY from 10:00 am 10 6:00 pm PST. 

We carry a complete line of ATARI products and have a large public domain library. Write or call 
for free catalogue. (408) 749-1003 TUE - FRI 10AM - 6 PM 



PAGE 80 / MAY 1988 



Circle #105 on reader service card. 



ANALOG COfVlPUTING 



the stop bit going to 1. At this point, the SERIN (SERial 
INput) interrupt is generated to call the OS to "read" the 
data byte before the next one appears. If too few or too many 
bits are received, or the start and stop bits are not right, 
error flags are set. 

It does not register 
The next POKEY register for us to explore is 14 at $D20E, 
with the split functions IRQST and IRQEN. Reading IRQST 
will give you the status of all POKEY IRQ requests and is 
normally only used by the interrupt processor to determine 
the cause of the IRQ interrupt. Writing to IRQEN will set 
the bits as follows: 

Bit Vector 

5 Serial input data ready 

4 Serial output data needed 

3 Serial output transmission done 

When any bit is set to 1, then that interrupt request can 
be passed on to the processor. Conversely, a blocks that 
interrupt from occurring as we saw in part 1. Finally, the 
last register at $D20F is labeled SKCTL/SKSTAT as follows: 

Bit Function 

7 Serial data input framing error 

6 Serial data input overrun error 

5 Keyboard overrun (?) 

4 Direct connection to Data In line 

3 Shift key dov;/n 

2 Last key still dovKn 

1 Serial Input Stiitt Register busy 

Not Used 

Reading gives the error status of the serial port in bits 
5, 6 and 7; keyboard functions in bits 2 and 3; and some 
miscellaneous functions in the rest. We will only need the 
last 3 bits for our interface and the rest we will ignore. Af- 
ter each byte is received, the OS checks these bits. If an er- 
ror occurred during serial input, you get the familiar Errors 
140 or 142. All three error bits can be simultaneously reset 
by writing anything to SKREST($D20A), and this occurs 
after each reading of SKSTAT. Writing to SKCTL selects the 
function modes of POKEY's shift registers as illustrated 
below: 

Bit Function 

7 Forces serial output to 

6 Serial port parameter selections 

5 Serial port parameter selections 

4 Serial port parameter selections 

3 Changes serial out from 1/0 logic to two-tone 

2 Changes from normal to fast POT scan 

1 Activates keyboard scanning 

Enables keyboard "debounce" circuits 

Now that you know about Serial I/O on the micro level, 
let us examine it on the macro level and look at the OS. 
Unfortunately, trying to understand the OS source code is 
like peeling an onion. Every time you remove one layer, you 
find another. If you keep at it, you eventually reach the 
core— and then nothing. So too, the I/O system is layered 
in levels and at the bottom appears to be nothing. Refer to 
the flowchart in Figure 3. 

When you type the command LPRINT "HELLO" you set 
into motion a complex chain of machine routines. BASIC 
sets up lOCB 7 for OPEN. CIO then calls subroutines to set 
up IOCB7 for a write operation. The buffer pointers are set 
to the start location of the string and the number of bytes 



BASIC LPRINT "HELLQ" 
OPEN lOCB (*7 
laCB WRITE RECORD 
CALL CIO 



TRANSFER "HELLO" TO 
PRINT BUFFER 
ONE BYTE AT A TIME 



FILLS PRINT BUFFER TO 

PROPER LENGTH. FILL WITH 
ZEROS IF TOO SHORT. 

SET UP DEVICE CONTROL BLOCK 

CALL SIO 

(A! SET BAUD RATE 

SET JP COMMAND FRAME BUFFER 
LOWER COMMAND LINE 



JSR SEND 

CLEAR FLAGS 

STORE FIRST BYTE TO SEROUT 
IDLE UNTIL XMTDON FLAG SET 
«I»SEND COMMAND FRAME 



RAISE COMMAND LINE 



WAIT FOR ACKNOWLEDGE 



REPEAT AT IB) EXCEPT USE DATA FRAME 



CHECK FOR ERRORS 
GIVE ERROR MESSAGE IF NO GOOD 
CLOSE lOCB 97 
RETURN TO BASIC PROGRAM 



Figure 3 — CIO flowchart 

to be sent. CIO then calls the printer handler, which moves 
blocks of data 40 bytes at a time to the print buffer. Then 
the printer handler invokes SIO to send the data. If there 
are less than 40 bytes to send, then zeroes are added to fill 
up the buffer. 

To actually send the data, the handler sets up a block of 
RAM at $0300, which functions like the lOCB system, ex- 
cept it is used only by SIO. It contains the device ID num- 
ber (printer is $40), the command type (write is $57), status 
byte, buffer location, size and AUXl and AUX2 from the 
lOCB. SIO then uses subroutines to enable POKEY to send, 
and after a batch of extra JSRs, you wind up at the very bot- 
tom of SIO. What's found there is a short endless loop that 
can only be terminated by either of two flags being set. One 
is a Timeout flag and the other indicates that all the data 
was sent. 

Timeouts are created by using the System VBlank Timer 
1. While the OS idles in this loop, POKEY will continu- 
ously interrupt to increment the pointers and send the next 
data byte, via the shift register. When the last bit of the last 
byte is sent, VSEROC sets the Transmit Done flag and al- 
lows the OS to break out of the loop. The OS then finds its 
way back through all the layers of onion to your BASIC pro- 
gram where you first called LPRINT. Similar progranmiing 
occurs to receive data. So the actual work of data transmis- 
sion and reception is done exclusively by the interrupt 
routines. 

Catching the right bus 

Transferring data on the serial bus at 19,200 bits every 
second requires careful attention to a rigid protocol. Since 
there may be as many as ten different peripherals all shar- 
ing the same bus, each must have its own unique route num- 
ber. Before any data can be transferred, the proper device 
must be queried to ensure that only the correct device com- 



ANALOG COMPUTING 



MAY 1988 / PAGE 81 



Bits &? Pieces 



continued 



mumcates with the computer. This means that only the com- 
puter can initiate data transfer and that each device must 
be "intelUgent." By this, we mean that it must be able to 
understand the Atari protocol of device IDs, queries, etc., 
so each one must have a microprocessor and a program to 
follow. This is true of all peripherals, except the cassette 
recorder which is dumb. In other words, it requires a sepa- 
rate wire to turn it on and off, and intelhgent fingers to push 
the right buttons at the right time. 

If you recall from the last article, both PACTL and PBCTL 
have output hues involved in Serial I/O: PACTL's PA2 line 
controls the cassette recorder on pin 8 of the serial plug, 
while PBCTL's PB2 shows up on pin 7. This line is called 
COMMAND by the SIO and is very important in the scheme 
of things. Like E.F. Hutton, when COMMAND goes low, 
all the peripherals listen. The transition from high to low 
tells all the peripherals that a command frame is about to 
be sent by the computer. This is a 5-byte data frame with 
the following format: 

BYTE Device ID No. Printer=$40, D1=$31. 

BYTE 1 Command type. Write=$57, Read=$52, Status=$S3. 

BYTE 2 Aux 1: Device dependent info. Not the same as lOCB AUX 

1. Printer uses lOCB AUX 2 in this byte. 
BYTE 3 Aux 2: Same as above. Disl< drive lool<s to these 2 bytes^for 

sector number(LO/HI). 
BYTE 4 Checksum. Total of above bytes. 

After this frame is sent, COMMAND returns to its logic 
1 state. If the device, whose ID is in byte 0, is on-line, it 
will now send back a single bjrte containing the mmiber $41, 
or the letter "A" for ACKnowledge. If no ACK is received, 
the SIO attempts to resend the command frame up to 13 
times before it gives you an Error 138. 

Let me digress for a moment. This whole transfer system 
makes a couple of assumptions. One is that the computer 
has a program plan on how to use a peripheral, and the other 
is that the peripheral knows that same plan. For example, 
printer frames are 40 bytes long, while disk drive and cas- 
sette frames are 128. Both of these handlers are built into 
the ROM, but peripherals know to use the proper buffer size. 
Handlers hke the 850 interface must be uploaded either from 
disk or the peripheral itself. Meanwhile, back at the bus, 
if the computer is performing a "write," then the next event 
is the transmission of the data frame. If the computer is re- 
questing a "read," then the peripheral sends another 1-byte 
frame containing a $43 or CoMPlete (CMP), followed by the 
data frame. If it was a write, when the peripheral finishes 
receiving the frame, it again sends an ACK, and if the frame 
is accepted, it sends a CMP When a peripheral sends data, 
no other bytes follow the data frame. All this is summa- 
rized in Figure 4. 

In our above example of LPRINT, lOCB 7 is opened by 
querying the printer, using the status routine in the printer 
handler. Status routines are basically READ procedures, but 
the frame sent back from the peripheral is not the same as 
a normal data frame. The printer sends back a 5-bit frame 
with the following format: 



BYTE Success/failure flags. Usually=$80. 

BYTE 1 AUX2: Found in command frame byte 3. 

BYTE 2 Timeout value in seconds. Usually 28. 

BYTE 3 Not used in printer 

BYTE 4 Checksum. 

The disk drive has a different format for status, but again, 
both the peripheral and the handler know what to expect 
from each other. Once a satisfactory status frame is received 
back, the computer starts another cycle to send text to the 
printer, using conmaand frame/40-byte data frame cycles, 
imtil all text is sent. The timeout value returned in byte 2 
tells the handler how long to wait between an imsuccess- 
ful command or data frame and the next attempt to send. 
The printer returns 28 seconds and the handler allows only 
one retry. Try this: OPEN #1,8,0,"P:" 



COMMAND 




OPEN 










PRINT 
































DATA OUT 














""'""" 


















DATA IN 








INFORMATION Command A C STATUS 
TRANSFERRED '-^' i <* ;-"" 
33 S4I 143 33 
33 IF 

Ch.d<,«i„ ck. 


Commond A Dole A c 
Fromo C From* C M 
J40 t "H K P 
57 E 
41 L 
O L 
Cki O" 
EOL 
34 Of 
Ck> 



Figure 4 — Serial protocol 

Now take your printer "off-line" with the power on and 
type: PRINT #1; "HELLO" 

The computer will attempt to send, but will be unsuc- 
cessful, so it will wait 28 seconds and try again. You can 
hear this if your monitor volume is turned up high. If the 
printer still does not respond 28 seconds later, an Error 138 
will be returned. Such a long time allows you to change 
paper or align forms, and so on. 

For real Zucchini lovers only 

Well, this article has been left in the oven too long — it's 
now hard and dry. The usual purpose of this series is to 
be useful and illustrative, at the same time providing a sim- 
ple hands-on approach. I know it's been a long time wait- 
ing for your Atari Zucchini a-la-mode recipe, but I promise 
next month to knock your socks off— to reveal all— and 
show you how to turn your old Atari into a peripheral with- 
out any hardware modifications. Until then, keep reading, fl 

An Obstetricion-GynecoJogist hy day, Lee Brilliant, M.D. 
turns into a bug-eyed computer monster by night. He start- 
ed on computers in August 1983 with a Tl 99/4A and rapidly 
graduated to Atari. He's programmed Apple U, Commodore 
and IBM, hut prefers his old 800. His favorite pastime is 
tearing computers apart to see how they tick. Of course, he 
uses a scalpel! 



PAGE 82 / MAY 1988 



ANALOG COMPUTING 



VIDEO GAME DIGEST 




Q&A 



Five things you always 
wanted to Icnow about video 



by The Game Doctor 

Video games are back, and with them 
come questions. Old questions, new ques- 
tions; everybody has questions. These are 
five of the most frequently asked video 
game queries and, just for the heck of it, 
answers are included. 

Q: Are video games addictive? 
A: Video games are not "addictive," 
Vulnerable people are apt to become emo- 
tionally dependent on a wide range of en- 
joyable experiences. Movies, comic books, 
TV and sports have all, at various times, 
been vilified as "addictive," because of the 
compulsive behavior exhibited by their 
devotees. Video games, which provide 
high levels of stimulation, feedback and 
interaction, are an especially attractive 
form of entertainment for those seeking 
escape from conventional reality. 

Video games should be enjoyed as a 
component in a balanced lifestyle. It 
should be remembered, however, that the 
child who spends a great deal of time 
playing video games is at least engaging 
in an interactive activity, and not passive- 
ly vegetating in front of a TV set. 

Q: Are video games detrimental to your 
health? 

A: A plethora of physical ills have been 
ascribed to video games, but no evidence 
exists to support any of these theories. 
Staring for hours at a large, brightly col- 
ored video display probably won't im- 
prove anyone's vision, but it doesn't ap- 
pear to be harmful, either. Remember, 
even folks who spend their entire work- 
ing day in front of a VDT do not qualify 
for "hazardous duty" benefits. 

The one area where personal experi- 
ence indicates that gaming can cause 
physical pain regards joystick controllers. 
A controller that doesn't fit comfortably 
in one's hand can cause cramps and cir- 
culation problems. 
O: Do video games hurt TVs? 
A: This largely mythical notion stems 
from the fact that some of the earliest 



games. 

Pong-type home game systems did, in 
fact, leave "scars" on TV tubes. 

Games which featured fixed white 
areas (like the perforated "net," which ran 
vertically down the center of most early 
game screens) often burned themselves 
into the picture tube, leaving an imprint 
that remained, even when the game was 
switched off. 

Since those primitive times, game sys- 
tems routinely employ color-switching 
technology to eliminate this problem. 

Large-screen TVs, however, sometimes 
have systems not compatible with video 
games, so always consult the manufac- 
turer before wiring a video game system 
to such a set. 

Q: Are video game cartridges inter- 
changeable among systems? 

A: Alas, no. Although the Atari 7800 
also plays 2600-format games, video game 
software is definitely non-compatible. Any 
potential damage is headed off, however, 
by the individual design of the cartridge 
casings, which do not permit even ac- 
cidental mis-insertion. 

Q: Which video game system is the 
best? 

A: The answer to this one is simple: 
what are you looking for in a video game 
system? 

In terms of cost, the three major sys- 
tems [Atari 7800, NES, Sega) are all pretty 
similar. 

The Atari, by virtue of its 2600 com- 
patibility has the largest library of avail- 
able software, but its 7800 catalog is still 
rather light on titles. The NES has plenty 
of available software. Nintendo alone will 
produce thirty-six titles this year, while 
third-party developers— hke Activision, 
Konami, CapCom, Data East and Absolute 
Entertainment— will produce another 
thirty-six. Sega, meanwhile, is still the 
new kid on the block, with only twenty- 
four cartridges available, but more prom- 
ised. 

The 7800 is strongest in the arena of 
arcade shoot-'em-ups, with its knockout 
versions of Joust, Robotron:2084 and of 



Pole Position II. Better still, any Atari- 
compatible joystick will work with this 
system, providing a selection of controllers 
at a range of price points. 

The NES is strong in several areas, en- 
abling the system to handle medium- 
action arcade games (Super Mario Bros.), 
sports (Baseball, Tennis), and even fairly 
sophisticated action-adventures (The Leg- 
end of Zelda)— with equal facility. The 
NES also boasts a cornucopia of peripher- 
als, from the dubious game-playing robot 
to a light gun (the Zapper). 

The Sega System has the most sizzle of 
the big three. It is sleekly styled, as are 
the peripherals. (Nintendo's Zapper looks 
like something Dirty Harry would be 
comfortable with, while Sega's Light 
Phaser would seem more at home tucked 
through Han Solo's waistband.) It also 
boasts the most eye-popping graphics, a 
first-rate library (Choplifter, TransBot, 
Wrestling, Rambo, etc.) and a hot 3-D 
peripheral . 

Sega has also upped the ante in the 
memory sweepstakes with its new 2-meg 
carts, and seems determined to go head- 
to-head with Nintendo. 

In other words, each system has its own 
strengths; viability is determined solely 
by the needs of the consumer. 



Ask The Game Doctor 

Got a question about video game 
hardware or software? Video Game 
Digest has the man with all the an- 
swers, the Game Doctor. The cele- 
brated software sawbones has h\mg 
his shingle and opened his office in 
these pages. 

So, if you have a question for the 
megabyte medico, just send it to: 
Game Doctor, Video Game Digest, c/o 
ANALOG Computing, P.O. Box 23, 
Worcester, MA 01603. 



ANALOG COMPUTING 



MAY 1988 / PAGE 83 




VIDEO GAME DIGEST 



The history 
of video gaming 



Part 2: 

The Golden Age dawns 



by Amie Katz and Joyce Worley 

f/n Chapter 1 of out story, we left a de- 
liriously happy Nolan BushneJi counting 
(he proceeds from the first day of opera- 
tion for his video game coin-op Pong. . . J 

Pong's opening day success was a pre- 
view of things to come. Bushnell formed 
a new company, dubbed Atari, to man- 
ufacture and distribute coin-operated 
Pong machines. (For latecomers, the name 
derives from a term used in the ancient 
Japanese strategy game of Go, which is the 
equivalent of "check" in Chess.) 

After Pong, Bushnell continued to ad- 
dress the amusement center audience. He 
marketed a series of driving games, sports 
contests and tank battles. Though many 
were successful, Atari didn't advance the 
state of the art significantly until the re- 
lease of Breakout. This venerable wall- 
bashing game pioneered a play-mechanic 
which is still highly popular today. 

A major technological breakthrough, 
the invention of the LSI (Large Scale In- 
tegration) chip, had the minor side-effect 
of moving home video gaming to its next 
stage. The General Instruments AY38500 
chip, for example, could carry enough 



program instructions to play four ball- 
and-paddle or two target video games. 

If the founding of Atari is monument to 
the entrepreneurial spirit, then the entry 
of Coleco into the video game field is a 
tribute to the positive power of corporate 
drift. The company's name is a contrac- 
tion of "Connecticut Leather Company." 
Coleco went from leather goods to toys 
through a fortuitous string of expansion 
moves which began with a deal to pro- 
duce toy gun holsters with a Tom Mix 
license tie-in, Coleco dove into the above- 
ground swimming pool market after 
World War II— and ran right into the 
boom in the construction of suburban 
housing developments. 

Good fortune continued to smile on 
Coleco when it became General Instru- 
ment's biggest customer for the AY38500 
in 1975. Coleco's Telstar Arcade, the first 
"dedicated chip" home video game sys- 
tem, rocked the toy business. By Christ- 
mas of the following year, more than 75 
other manufacturers had issued similar 
video game units. No one could have im- 
agined how quickly all of these players 
wrould become obsolete. 

Among companies pulled into the 




home video game market by Telstar's per- 
formance was Atari. Bushnell formed a 
brand new division to sell home systems. 
He inked a deal with Sears — a landmark 
agreement guaranteeing nationwide dis- 
tribution for Atari video games— then se- 
cured needed working capital by selling 
Atari to Warner Communications for $28 
million in 1976. He remained in charge as 
Chairman of the Board. 

The glut of all-too-similar hard-wired 
video game units quickly exceeded the 
saturation point. Consumers could bare- 
ly tell one system from another, a condi- 
tion that wasn't helped by many rapid 
changes in the manufacturers' product 
lines. To many, it seemed like a new and 
better game appeared about every two 
weeks. 

And yet, the games were basically all 
the same: endless variations on the ball- 
and-paddle format. Boredom swept the 
land. The backs of closets began to fill up. 

Fairchild Electronics thought it had an 
idea to chase away the boredom. It in- 
troduced the first programmable video 
game system, the Channel F, in 1976. Fair- 
child transferred the game programs from 
the console to interchangeable game car- 



PAGE 84 /MAY 1988 



ANALOG COMPUTING 



■^\9 



4.^9^ 



^^ 



tridges. 

RCA joined Fairchild in the program- 
mable video game market with its Studio 
II. The use of black and white graphics 
was merely the worst of its many flaws. 
No one greatly mourned its passing. 

That wonderful year, 1978 

Coin-op giant Bally tested the home 
market with the Bally Professional Ar- 
cade. This small gaming computer, which 
made its debut during the second half of 
1977, boasted by far the best sound and 
graphics of any home system and played 
an astonishing roster of games. Bally's lack 
of familiarity with the home market prob- 
ably had more to do with the Profession- 
al Arcade's lack of success than any 
intrinsic weakness in the unit. It was too 
expensive, and its distribution was con- 
centrated on computer stores rather than 
department, leisure electronics, and dis- 
count outlets. 



Magnavox didn't abandon video gam- 
ing when Odyssey failed to catch the pub- 
lic fancy. The company made a series of 
dedicated video game consoles during the 
mid-197Ds, culminating in the programma- 
ble Odyssey^ in 1978. 

Atari's entry in the programmable 
sweepstakes was the Video Computer Sys- 
tem (VCS), the ancestor of today's 2600. 
It presented home versions of some of 
Atari's top arcade programs Hke Combat 
and almost instantly leapt to the front of 
the pack in sales and popularity. 

Had one Atari faction had its way, the 
VCS would have had a memory limit of 
2K. Since no game could ever use up 
more memory than this, they reasoned, 
why load up the VCS with an unneces- 
sary frill? Caution carried the day, how- 
ever. It was at least possible that cartridges 
would some day require more RAM. 
Soon, software designers would thank 
Atari for the decision to go with a 4K 



memory. 

On the other side of the world— Japan, 
to be specific— a small company called 
Taito thought it had a game that might di- 
vert a few coins earmarked for the 
Pachinko machines. Space Invaders 
presented video gamers with something 
entirely new: a shooting game with ani- 
mated targets. 

It didn't take Space Invaders six months 
to shatter the dominance of Pachinko. It 
would soon prove an even bigger hit in 
Occidental family amusement centers. 

The Mattel Intellivision reached stores 
in 1980 and was an immediate hit, despite 
its relatively high price. Although the unit 
had some drawbacks, like shoddy con- 
trollers and slow movement for on-screen 
objects, it quickly displaced the Odyssey^ 
as the major competitor to the Atari VCS. 

Can George Plimpton help Mattel de- 
throne Atari? Why is Jim Levy having all 
those lunches with programmers? And 
what is that wocka-wocka sound? The an- 
swers to these and other burning ques- 
tions will be found in "The History of 
Video Games Part III: The Golden Age" 
in next month's Video Game Digest. B 



ANALOG COMPUTING 



MAY 1988 / PAGE 85 






REVIEWS 



Panak 
strikes! 



Reviews of the latest 
software 



by Steve Panak 



There was an explosion last year in soft- 
ware titles for the ST, the 800's big broth- 
er. And despite fear and anxiety, we saw 
little reduction in the software support for 
the first Atari. Sure, there are a lot of 
games out there that are starting to require 
64K, and diskettes containing mouthfuls 
of data too rich for my old 800's delicate 
digestive system. But the XL/XE series 
evolved, and now stands ready to shoul- 
der this burden, paving the way for more 
and better games. 

Last year we were treated to a variety 
of fine 8-bit software. But by the same to- 
ken, there were a few disappointments as 
well— the biggest being the lack of earth- 
shattering new releases. Don't get me 
wrong here; there were a lot of great game 
simulations from SSI and GDW, plus a 
continuum of high-quaUty text adventures 
from Infocom. 

I might be tempted to reach the conclu- 
sion that all genres have been covered, all 
stones turned, every iota of creativity 
spent. But an addictive little ditty by the 
name of Trailblazer, which I reviewed last 
time, showed that not to be the case. I 
think it's just a little harder to come up 
with something really new these days. 
The well is not dry, it simply takes a lit- 
tle more elbow grease to get it primed. 
If there's one thing I'd like to see in the 
future it would be more innovation. Get- 
ting the same thing — however well done 




done — over and over 
again is simply, well, 
boring. Unless, of course 
you just bought your Atari 
and you're jumping into the 
water for the first time. And 
if this is your first such 
plunge, and you feel lost and 
alone in a sea of software, I think 
you will find that any of these 
games would make a good life 
preserver. 

Rebel Charge 
at Chickamauga 

by Chuck Kroegel 

SSI 

1046 North Rengstorff Avenue 

Mountain View, CA 94043 

48K Disl< $49.95 

In the beginning, war simulations were 
played on large maps, with himdreds of 
small, cardboard squares representing the 
infantry and artillery battalions, while 
dice and complex charts decided life and 
death on the battlefield. Then the com- 
puter took over, with its ability to quick- 
ly calculate values, thus relieving much of 
the monotony of the game. Moreover, 



the computer's colorful screen displays 
provided insurance against a gust of 
wind blowing a week-old battle off the 
board. Yet these computerized versions 
were still very complex to learn and 
play 

Rebel Charge at Chickamauga 
is the latest war simulation from 
SSI, and the third one to simu- 
late an important battle from our 
country's Civil War. This scenario 
explores the Confederates' last major at- 
tempt to take control of a split nation. 
And, by combining extraordinary realism 
and three degrees of difficulty with sim- 
ple control and intuitive commands, SSI 
creates a game that all war-gamers will 
want on their side. 

It's the fall of 1863. The Union, having 
scored victories at Gettysburg and Vicks- 
burg, seems invincible. Still, the Con- 
federates were not knovra to give up 
easily, so the two opposing forces find 
themselves clashing at Chickamauga 
Creek. Although this battle may not be the 
most famous of the wax, this computer- 
recreation makes you feel as though 
you're there. And who knows, you might 
just change history. 

The battle is recreated in 13 two-hour 



PAGE 86 / MAY 1988 



ANALOG COMPUTING 




Panak strikes! continued 



turns, requiring up to 40 hours to com- 
plete. The game uses a refined version of 
the system last seen in Gettysburg: The 
Turning Point, which allows incredible 
control of the individual units. The myri- 
ad of commands are easily learned and 
implemented. In fact, this latest product 
of SSI's evolution is the easiest to play that 
I've yet seen. 







Rebel Charge at Chickamauga 

The simple game system contains two 
phases: operation and combat. The form- 
er lets you examine and give orders to 
your troops, while the latter gives you the 
power to resolve the various conflicts that 
arise. Using the keyboard, you move the 
cursor around the map, examining and or- 
dering your units. Tapping the space bar 
picks up a unit (or the first unit, in the 
event you have stacked multiple units on 
one square), and displays various attrib- 
utes, such as size, firepower, morale and 
efficiency. At this point, the command 
menu appears and you are able to move 
or aim the unit. A key is provided to cy- 
cle you to the next unit on the map await- 
ing instructions, insuring that no one is 
left without orders. 

Operation points, which are awarded 
du'-ing each operation phase, determine 
how far a unit can move and how much 
it can fire. Efficiency, fatigue and morale 
points modify the play, hence decreasing 
accuracy and slowing movement. Inter- 
mediate and advanced versions of the 
game add even more realism, taking into 
account the leaders' strengths and their 
movement among units. It's staggering 
how many factors are taken into account. 
For instance, combat results are modified 
depending on what type of terrain the 
troops are in, their formation and loca- 
tion, and even their past success. 

Once all the orders have been given, 
you move to the combat phase, in which 
the computer resolves all pending con- 
flicts. The map scrolls to display each unit 
as it is engaged in combat, while a text 
window at the bottom of the screen flash- 



es statistics, such as unit involved and 
number of men killed. 

Once the battles have been resolved, 
and the computer has made its move, you 
begin the next turn, starting the cycle over 
again. This continues until 13 turns have 
passed — or until one side is clearly the 
winner. 

Soimd, which can be turned off if 
desired, enhances the play. You can hear 
the artillery shells falling and the rifles 
firing. The graphics are also quite good. 
Most players should have very little diffi- 
culty differentiating between their many 
unit icons, as each has very specific 
markings. 

The manual is superbly designed and 
written. A tutorial gets the impatient play- 
er, as well as the novice, right into the 
thick of the action, while another section 
details the rules for the intermediate and 
advanced games. A generous amount of 
charts, maps and tables keep you ap- 
prised of modifiers, troop location and 
the chain of command. Six pages of back- 
ground provide a nice history primer on 
this important battle. But, despite all of 
these kudos, I do have a couple of com- 
plaints. 

First of all, I truly hate using the num- 
bers 1 through 8 to control movement. 
Even with the on-screen help window, it's 
difficult to remember which numbers cor- 
respond to each of the eight compass 
headings, especially since the numbers 
don't exist in keypad form. It would be 
nice to have the option of using a joystick 
to control cursor movement. Also, there 
are too many disk swaps at the end of 
each turn. I guess that's the price you 
have to pay for having a game crammed 
into 48K. 

Overall, Rebel Charge at Caiickamau- 
ga is a simulation well done, from a com- 
pany that knows how to get the job done. 
If you're into this type of game, you will 
not be disappointed, although the high 
price could woimd your wallet rather 
severely. 

Triple Pack 

by Bruce and Roger Carver 
ACCESS SOFTWARE, INC. 
#A 2561 South 1560 West 
Woods Cross, UT 84087 
48K Disk $19.95 

While the packaging is new, the three 
games contained in Triple Pack are old. 
When sold separately, I felt that these 
three games offered little. However, the 
idea of selling them as a package at a spe- 
cial price, changed my feelings. 



The two disks contain the games Beach- 
Head I and II, and Raid Over Moscow. 
Since all of these games have been exam- 
ined in depth in the past (issues 30, 49 
and 51], I'll not go into great detail on 
them here. Suffice it to say that each fol- 
lows the same basic framework: You en- 
gage in a series of battles on your way to 
a final confrontation. These battles con- 
sist of a number of different screens, and 
sometimes feature different combat meth- 
ods. 

In Beach-Head I, you move through six 
sequences in which you search out the 
enemy, attack their island, and finally de- 
stroy their fortress. In Beach-Head II, it 
seems that the evil dictator escaped your 
prior attack, and is ready for a second go 
at it. In four sequences, you attempt to 
rescue hostages captured in previous bat- 
tles, ending with a final showdown 
against the "Dragon" himself. Beach- 
Head I and II are very similar. The main 
difference is that in II you control indi- 
vidual troops to a greater extent. 




Beach-Head I 

In Raid Over Moscow (my favorite of 
the three), you are the squadron com- 
mander of the U.S. Defense Space Station, 
with a virtual suicide mission: You must 
stop a nuclear attack. You have to knock 
out launch sites, then penetrate Moscow 
and destroy the defense center. In seven 
play sequences, you determine the loca- 
tion of the latest missile launch, then de- 
stroy it. In the final chapters of this saga, 
you storm the defense center's reactor, 
wiping out the defensive troops and wast- 
ing the maintenance robots. Without its 
coolant, the core becomes rmstable and 
detonates. The most successful agents not 
only complete this suicide mission, but 
survive it as well. This game provides 
plenty of opportimity for strategy, as you 
try to decide which targets need your im- 
mediate attention, and which can wait. 
Both Beach-Head I and II can be played 
by one or two players, one taking the of- 
fense and one the defense, and each al- 



ANALOG COMPUTING 



MAY 1988 / PAGE 87 



lows multiple skill levels. Moscow simi- 
larly allows selection of one of three skill 
levels, however, only one may play the 
game at any given time. The graphics in 
each of these games is fair to good, and 
nearly identical — at least in style. Noth- 
ing spectacular, their resolution and de- 
tail are similar to that found in the vast 
majority of 8-bit gameware. I had little 
trouble controlling any of these games, 
and the action is undeniably fast, espe- 
cially when those tracer bullets start 
flying. 

Each program has its own simple black- 
and-white instruction manual. These are, 
for all intents and purposes, reprints of 
the manuals packaged with the original 
versions of these games. A small card- 
board slip provides quick loading instruc- 
tions applicable to all three. This setup is 
fine, although I'd rather see all documen- 
tation gathered in one place. The trade- 
off of inconvenience against the low price, 
however, is tolerable. 

The repackaging of these three games 
into a bargain trio brings the price down 
to about $7 a game, which is more than 
fair, considering that each of these games 
sold separately for $39.95 a year ago. Tri- 
ple Pack packs a triple punch that might 
just be worth a look. 

That's a wrap for this month. Last year. 



fiuirmt 13 tt 



HSeS r>''Vl !»;»?■» 




SCORE: eaeec 



Raid Over Moscow 



we saw a couple of great games, several 
good games, and a lot of really mediocre 
ones. You can rest assured that the above 
fall right about in the middle. While they 
break no new ground, they do provide 
good, strong performance that will sure- 
ly be appreciated by Atari newcomers. SI 




Beach Head-U 



ANALOG'S new customer service number is (818) 760-8983. You may also write to: 

ST-Log 

P.O. Box 16928 

Nortli Hollywood, CA 91615 



ANALOG Computing 

RO. Box 16927 

North Hollywood, CA 91615 



The above phone number and addresses are for subscription matters only 



SUPER DAtA BAJSE 1-2-3 

(men tfian a daa base) 

$59.95 ' 

Will generateian*io-(;i,Blom software 
yati will ever n&ad. 



1 . Create Professional Data Screens. 

2. Run Custpm Reports. j 

3. Link Everything Together With ; 
Custom oKg Key Menus. / 

• Easy-'Manual and Tulorlals 
^:i^= =,-=:: 



J 



For IBM PC, PC Jr., XT 

Atari (except ST) Apple II, HE 

Commondore 64 

Hafd Disk ccvnpatibid - 36,000 Files 

• High Quality • 
Adventure Games Only $ 19.95 ea. 



I. M. P. SOFTWARE 

Rt. 1 Box 362 
Ozark, Mo. 65721 

Call your local dealer a us at 
(417) 485-6398 

* Add $2.00 shippeig and handling 
Missouri residents add 5.25% sales tax 



Circle #106 on reader service card. 



New! 3-D Graphic WWII Sea Game 



Now play "Destroyer Warship" on your XL/XE 
Computer System! It is a WWII arcade type Sea 
Battle against Japan! You are captain and protect 
f^idway Island and the Shipping Lanes! Its a hard 
war if you can lake it! Play it! Be a hero and play 
"Destroyer Warship"!! * Now Only! $14.95 
+ 2.95 shipping & handling. (Continental U.S.). 

■ Requires XL/XE, joysticks & 1050 drive. 

64 K 
New! "Lem Landing Simulator & Fastbudget". 
Land the LEM on the planets or figures your 
budget! (Order Yours Today!) 

* LEfvI Landing Simulator & Fastbudget 

* Now Only $9.95 + $2.95 shipping & handling. 
(Continental U.S.). 

■ Requires XUXE, joystick & 1050 drive. 

64K 

* Cashier's Check or Money Order only! 

* Michigan Residents add 4% Sales Tax. 
Send To: IntelaSoft 

P.O. Box 102 

St. Charles. Ml 48655 
Prices are subject to change without notice. 
Due to tow prices all sales are final. 



Circle #107 on reader service card. 



PAGE 88 / MAY 1988 



ANALOG COMPUTING 



ST BOOK REVIEW 



y/ 



Working with the Atari ST 



by David Lawrence and Mark England 

SUNSHINE BOOKS 

12-13 Little Newport Street 

London WC2H 7PP, U.K. 

134 pages — $14.95 (7.95 pounds sterling) 

monochrome (page 13). The statement 
that the ST can handle only three acces- 



by John W. Little 



Working with the Atari ST {WAST for 

brevity) is intended for those inexperi- 
enced with their new ST, but who have 
gotten it set up and running. 

The book's sixteen chapters do an ade- 
quate job (sometimes more than adequate) 
of describing the hardware and system, 
and instructing us in the use of the GEM 
desktop. WAST has both a table of con- 
tents (two!) and an index. I feel it is among 
the best books out for the new ST user. 

In fact, even a person who's been using 
the machine for some time may find, on 
reading this book, that his or her early 
education was incomplete; I found the 
section on configuring the desktop invalu- 
able, and I have yet to see a comparable 
treatment of installing and using applica- 
tions. 

Excepting typos, none of which are crit- 
ical, there are few errors in WAST. Those 
I did find are a result of the fact that it 
was written when the ST was very new — 
or perhaps not even released yet. 

Chapters 1 through 7 describe the hard- 
ware and operating system. For the most 
part, WAST gives us, in layman's terms: 
the 68000 and its memory, comparing it 
with other common CPU chips; the 
graphics system, touching lightly on the 
multi-plane color concept; the sound sys- 
tem, with a short discussion of the Pro- 
grammable Sound Generator and MIDI; 
the peripheral ports and devices that use 
them (mouse, floppy, etc.); GEM, with 
sections on VDI and AES; and TOS, com- 
paring it with CP/M. 

In these chapters, a predictable error of 
"early-ST" books is found. The ST is said 
to have interfaces for three different kinds 
of monitors: composite video, RGB, or 



series dates the book as "pre-ROM TOS." 

With the general description out of the 
way. Chapter 8 gets down to the "how-to" 
of using the ST, covering mouse tech- 
niques (selecting, dragging, double-click- 
ing), window techniques (moving, sizing 
and selecting the window itself, as well 
as using the scroll bars and sliders to 
move the window contents), and file ma- 
nipulations (copying, deleting). It's eleven 
pages of good, solid information that is 
basic to using the desktop. 

I feel Chapter 9, though brief, is one of 
the most important in the book. It tells 
how to configure the desktop so that it is 
comfortable and convenient for the in- 
dividual user. It also instructs us in how 
to save that configuration so it will be the 
same the next time we boot. That may 
seem elementary to experienced users, but 
learning to control the environment is 
crucial to making the ST a joy to use. 

Chapter 10 continues on "environment 
control," with drop-down menus. Each 
option of each menu is discussed in am- 
ple detail, including the "original" desk 
accessories: VT52 emulator; control pan- 
el, with which the user can change some 
parameters, such as screen color and key 
and mouse-button sensitivity; RS232 con- 
figiu-ation; and printer installation. 

For those not familiar with the concept 
of pathnames. Chapter 11 is a tutorial on 
the use of folders, with an exercise to 
work while reading the chapter. It also ex- 
plains the dangers of deleting folders 
without ascertaining their contents. 

Chapter 12 is the only thorough discus- 
sion I've seen on the installation and use 
of ST apphcations. I had often seen the 
menu option "Install Application," with- 



out knowing how much it exemplified the 
power of GEM. In my opinion, the infor- 
mation here and in Chapter 9 are worth 
the price of the whole book. 

Chapter 13 describes some of the basic 
types of applications available for the ST 
(word processors, databases, etc.) and 
again gives away its early publication by 
espousing the virtues of GEM Draw, GEM 
Paint, and GEM Write, which were not 
released for the ST. Ignoring that flaw, it 
does a good job of informing the neophyte 
on the different types of applications 
available, and what features might be con- 
sidered when purchasing them. 

Chapters 14 and 15 introduce Logo and 
BASIC, respectively. The purpose is sim- 
ply to give the reader a taste of the lan- 
guages, including a sample program or 
two for each language. 

Finally, Chapter 16 is a discussion of an 
alternative to GEM, the BOS operating 
system, by Business Operating Software. 
It covers some of the features of BOS and 
makes note of substantial differences be- 
tween it and GEM, without attempting to 
pictrue one or the other as superior. 

With the few exceptions noted, this 
book is old hat to someone who's been us- 
ing the ST for any length of time. For the 
new user, though, this one gets my vote 
as the book to have, both for its overall 
view of the ST and its specific instruction 
on actually using the machine. H 

John W. Little started computing on an 
800 about /our years ago, and does most 
of his programming on the 8-bits in as- 
sembly. He likes to use the joystick ports 
for experimenting with reaJ-world-to- 
computer I/O. He bought one of the earli- 
est STs and fiddles around with C and 
68000 assembly. 



ANALOG COMPUTING 



MAY 1988 / PAGE 89 



When you want to talk Atari 



XL/XE HARDWARE 



INTERFACES 

ICD 

P:R Connection 58.99 

Printer Connection 39.99 

Supra 

1150 38.99 

1151 (1200 XL) 39.99 

Xetec 

Graphix Interface 38.99 

Atari 

850 Interface 109.00 

COMPUTERS 




Atari 130XE ^135 

Atari 

65 XE 99.99 

XL/XE ENHANCEMENTS 

Axion 32K Mem. Board (400/800) .19.99 
Atari 80 Column Card 84.99 

MODEMS 

Atari 

SX212 300/1200(ST) 89.99 

835 19.99 

XMM301 42.99 

Anchor 

VM520 300/1200 ST Dir. Con ...119.00 

Avatex 

1200 HC 99.99 

2400 209.00 

Supra 

2400 Baud XL, XE 169.00 

2400 Baud ST 169.00 

MONITORS 

IMagnavox 

CM8502 13" Comp. & Cables . . . 169.00 



ST HARDWARE 




520 ST FM .^^^ 

RGB/COLOR V89 

Includes: 520 ST FM with 31/2" drive 
built-in, mouse, power supply and 
1224 color monitor. 

1040 RGB/Color System 899.00 

1 040 Monchrome System 769.00 

1040 Computer (no monitor) . . .639.00 

520ST FM Monociirome System 
(Includes: 520 ST, internal drive, 
modulator, mouse, Basic and 

monochrome monitor) Call 

SM124 Monochrome Monitor . .159.00 
SM1224 Color Monitor 329.00 

Atari 

XF551 Drive (XL/XE) 189.00 

AA314 DS/DD Disk (ST) 199.00 

AA354 SS/DD Disl< (ST) 11 9.00 



DRIVES 




'ArortHiirtio^ 

30Ma I 

Atari SHD204 .. ^ 

20 Meg for ST ^^559 

I.B. 

5.25 ST Drive 229.00 

Indus 

GTS 100 3V2" Drive (ST) 199.00 

GT Drive (XL/XE) 179.00 

Supra 

20 Meg Hard Drive (XL/XE) 639.00 

20 Meg Hard Drive (ST) 539.00 

30 Meg Hard Drive (ST) 689.00 





PRINTERS 



Atari 

1020 XL/XE Plotter 



.31.99 




Atari XDM 121 



$H 



Letter Quality XL/XE 149 

XM-M801 XL/XE Dot Matrix .... 189.00 
XM-M804 ST Dot Matrix 179.00 

Brotiier 

M-1 109 100 cps Dot Matrix 199.00 

M-1409 180 cps Dot Matrix 309.00 

HR-20 22cps Daisy wheel 339.00 

Citizen 

120D 120 cps Dot Matrix 149.00 

180D 180 cps Dot Matrix 169.00 

Premier-35 35 cps Daisywheel .479.00 

Epson 

LX-800 150 cps, 80 col 179.00 

Hi-80 4 pen plotter 249.00 

FX-86E 240 cps, 80 col Call 

FX-286E 240 cps, 132 col Call 

LQ-500 180 cps, 24-wire Call 

LQ-850 330 cps, 80 col Call 

EX-800 300 cps, 80 col Call 

NEC 

P2200 pinwriter 24-wire 379.00 

P660 pinwriter 24-wire 459.00 

P760 pinwriter 132 col 669.00 

Olcidata 

OI<imate 20 color printer 129.00 

ML-182 120 CDS. 80 column 229.00 

ML-192-f 200 cps, 80 column ..359.00 

ML-193-(- 200 cps, 132 col 469.00 

Panasonic 

KX-P1080i 144 cps, 80 col 189.00 

KX-P1091i194cps,80col 199.00 

Star Micronics 

NX-1000 140 cps, 80 column ...169.00 

NX-15 120 cps, 132 column 319.00 

Toshiba 

P321-SL 216 cps, 24-wire 539.00 




COMPUTER MAIL ORDER 



you want to talk to us. 



XL/XE SOFTWARE 



ACCGSS 

Leaderboard Golf (pk.) 15.99 

Tournament Disk 13.99 

Accolade 

Hardball 19.99 

Atari 

Filemanager 11.99 

Music Painter 1 1 .99 




Atariwriter Plus 



Atari Program Exchange 

Misc. Programs (cassettes) ... .at 1.99 
Batteries Included 

Home Pack 18.99 

Broderbund 

Printshop 25.99 

Karateka 12.99 

Cygnus 

Starfleetl 32.99 

Datasoft 

221 Baker St 21.99 

Electronic Arts 

Touchdown Football 11.99 

Pinball Construction 9.99 

Microprose 

Top Gunner 15.99 

F-15 Eagle Strike 21.99 

Silent Service 21.99 

Origin Systems 

Ultima 4 36.99 

Roklyn SPECIAL 
Gorf/Wizard of Wor/AT Deluxe/ 
Anti-Sub/Journey to Planet . .(ea.)3.99 
Strategic Simulations 

Gemstone Warrior 1 1 .99 

Sublogic 

Flight Simulator II 31.99 

Scenery FL, NO, SO 14.99 

X-Lent 

Typesetter 22.99 

Printshop Interface 21.99 



ACCESSORIES 



Maxell 

MD1-M SS/DD5V4" 7.99 

MD2-DM DS/DD5V4" 8.99 

MF-1DDMSS/DD3V2" 12.49 

MF2-DDM DS/DD3V2" 18.49 

Sony 

MD1DSS/DD5V4" 7.99 

MD2DDS/DD5V4" 9.49 

MFD-1DDSS/DD3V2" 12.49 

MFD-2DDDS/DD3V2" 19.49 

Alisop Disk Holders 

Disk File 60-5 1/4" 9.99 

Disk File 30-31/2" 9.99 

Curtis 

Emerald 39.99 

Safe Strip 19.99 

Universal Printer Stand 14.99 

Tool Kit 22.99 

ICD (XL/XE) 

Sparta DOS Construction Set . . .28.99 

US Doubler/Sparta DOS 47.99 

Real Time Clock 48.99 

RamboXL 28.00 

Multl I/O Board 256K 169.00 

Multi I/O Board 1 Meg 299.00 



ST SOFTWARE 




Activision 



99 



Hacker II Doomsday 29 



ACCGSS 

Leaderboard Golf 22.99 

Antic 

Stereo CAD 3-D 54.99 

Atari 

Algebra I Vol II GRD 7-9 16.99 

Avant Garde 

PC Ditto 69.99 

Batteries Included 

Degas Elite 39.99 



ST SOFTWARE 



Cygnus 

Starfleetl 33.99 

DAC 

Payroll 44.99 

Electronic Arts 

Gridiron Fooball/Auto Duel .(ea.) 30.99 

Firebird 

Guild of Thieves 25.99 

Infocom 

Beyond Zork 37.99 

Michtron 

Major Motion 25.99 

IVIicroprose 

Silent Service 24.99 

F-15 Strike Eagle 24.99 

Miles Software 

ST Wars 28.99 

Mark Williams 

C 119.00 

Paradox 

Wanderer (3D) 25.99 

WarZone/Fireblaster 26.99 

Psygnosis 

Barbarian/Deep Space (ea.) 26.99 

Strategic Simulations 

Rings of Zilfin 23.99 

Sublogic 

Flight Simulator II 32.99 

Timeworks 

Swiftcalc/Wordwriter (ea.) 47.99 

PartnerST 41.99 




DAC 

Easy Accounting 



Unison World 

Printmaster Plus . . 
Word Perfect Corp 

Word Perfect 4.1 . . 



^59 



99 



..25.99 
. 239.00 



± 



In the U.S.A. and in Canada 

Call toll-free: 1-800-233-8950 

Outside the U.S.A. call 717-327-9575, Fax 717-327-1217 

Educational, Governmental and Corporate Organizations call toll-free 1-800-221-4283 

CMO. 477 East Third Street, Dept. B7, Williamsport, PA 17701 

ALL MAJOR CREDIT CARDS ACCEPTED 

POLICY- Add 3% (minimum $7.00) shipping and handling. Larger shipments may require additional charges. Personal and company checks require 3 weeks to clear. For 
faster delivery use your credit card or send cashier's check or bank money order. Credit cards are not charged until we ship. Pennsylvania residents add 6% sales tax. 
All prices are U S A prices and are subject to change, and all items are subject to availability. Defective software will be replaced with the same item only. Hardware will 
be replaced or repaired at our discretion within the terms and limits of the manufacturer's warranty. We cannot guarantee compatibility. All sales are final and returned shipments 

are subject to a restocking fee. „. , „^„r, i ^ 

' Circle #108 on reader service card. 



REGULAR FEATURE 




Boot 




Camp 



RAMdisk file copier 



by Karl E. Wiegers 



Recently, while I was talking to a regular Boot Camp read- 
er, he made the interesting observation that the logical proc- 
ess of going from program idea to final product really isn't 
discussed much in the public literature. You can read scads 
of articles about this language or that, programming tips 
from experts, and even books on the best ways to design 
complex software systems. However, very little is written 
about the thought processes other programmers go through 
in developing an idea. 

Assembly language programming poses its own set of 
questions about the most effective sequence of program de- 
velopment steps. This is because you have to do a lot of the 
work in assembly (such as memory allocation) that the com- 
puter handles in high-level languages. 

This month's Boot Camp will be a little different. I'll try 
to pass on to you the thoughts that flit through my mind, 
and the resulting activities, as I develop an assembly pro- 
gram. Along the way, we'll actually generate a useful prod- 
uct. 

The first thing I do when starting a MAC/65 session with 
my 130XE is set up a RAMdisk and copy my MACRO. LIB 
and SUBS. LIB files to it. Then I'm ready to roll. I've often 
wanted a program to handle this chore for me, and, by the 
end of this discussion, we'll all have one in hand. The sam- 
ple program reads a disk file called RAMDISK. FIL that con- 
tains a list of the files you want to place in the RAMdisk. 
Each of those files is copied in turn, and the MAC/65 edi- 
tor magically appears afterward. You can name this file AU- 
TORUN.SYS, so the whole process takes place automatically 
on booting. 

This program uses several macros from earlier columns, 
as well as a few new ones. If you don't have a macro as- 
sembler, you'll need to modify the code to expand the mac- 
ros out by hand and make any other changes specific to your 



assembler. If you don't have an Atari 130XE with the RAM- 
disk, but have a second physical disk drive, you can change 
the references in the program from D8: to D2:. If you only 
have a 64K or smaller computer with a single drive, please 
bear with us and keep reading, since you may encounter 
some other useful information. 

Getting started 

Quite often, the hardest part of writing a program is 
deciding what sort of program to write. Each month I have 
to think of something that at least some of you will find 
useful, informative, interesting and amusing enough to keep 
you entranced to the very last word. Your own program 
ideas are probably more goal oriented . . . How can I write 
the world's best word processor program? How can I daz- 
zle my friends with some graphics displays? How can I save 
twenty bucks and write my own checkbook balancing pro- 
gram? How can I make $300,000 quickly in the software 
business? This month's idea came from my desire to find 
more ways to have the computer work for me, instead of 
the other way around. 

I tend to think about my programming projects for quite 
a while before actually sitting down at the keyboard. This 
bit of wisdom leads to a discussion of the classic steps in- 
volved in software development (or any other problem solv- 
ing exercise): analysis, design, programming, testing, de- 
bugging, release on an unsuspecting public. These steps 
tend to flow from one into another, and all too often they 
become hopelessly interwoven. 

Analysis consists of making sure you understand the 
problem. A lot of people bHthely skip this step and proceed 
with only a vague notion of what they're trying to accom- 
plish. If you aren't sure what you're trying to do, how will 
you know when you're done? I always feel better if I know 
just where I'm heading before I write any code. 

Design involves coming up with a solution to the prob- 
lem. This is the most challenging pai-t of the project, con- 



PAGE 92 / MAY 1988 



ANALOG COMPUTING 




Boot Camp continued 



ceptually, and one of the most critical. In the years I've spent 
as a professional software developer in the Eastman Kodak 
Research Laboratories, I've learned that every minute you 
spend on design is worthwhile. For smaller projects like 
the RAMdisk copier program, I do much of the design in 
my head — over and over and over again — until I think I've 
figured out every angle. Then I put it on paper and see all 
the things I missed. 

There are many techniques — all useful, but none perfect 
— for working out a design on paper. The traditional meth- 
od is flowcharting. While flowcharting is still useful for 
figuring out the details of logic flow, it's severely limited 
when dealing with any but the smallest programs. Many 
new methods for representing a system design have ap- 
peared in the last few years; I'm still looking into them and 
trying different approaches. All of them deal with the ba- 
sic pieces of the puzzle: input (what data are we going to 
process?); a process (what are we going to do to the data?); 
and output (where do we put the results?). 

Let's think about this in the context of today's program, 
and I'll try to reconstruct some of my thought processes in 
a coherent fashion. 

Analysis and design 

First, we'll deal with the problem analysis. I want to write 
a program that will copy a specified group of files from the 
boot disk to a RAMdisk. The program should run automat- 
ically upon booting. Of course, the RAMdisk must be set 
up before this program can run. After completion, control 
of my Atari should be passed either to the cartridge (prob- 
ably MAC/65) or the DOS menu, if no cartridge is present. 

Now some thoughts on the system design, pretty much 
in the order in which I first had them. I need to have a list 
of the filenames to be copied. This list could be in a file 
on the boot disk. Let's call it RAMDISK. FIL. The program 
will end after the last record in RAMDISK. FIL has been 
processed. 

I could read the file in its entirety into memory, then copy 
it to the RAMdisk. This would require a lot of RAM for a 
big file. Alternatively, I could read it in little chunks, copy- 
ing each chunk to the I^AMdisk after reading it. The last 
might be shorter than earUer chunks. This method won't re- 
quire much RAM, since I can make the chunks as big or 
small as I Uke. I could even copy it 1 byte at a time. I decid- 
ed to use the second method, of 255-byte chunks. 

(So far, the problem analysis and design are really in- 
dependent of the language and computer that will be used 
for the program. In fact, this analysis could apply just as 
well to a bunch of monks copying some documents by hand. 
We can describe this level of system design as being very 
abstract. Now, I'll become more concrete and continue the 
design at a more detailed level.) 

I'll write this program on my Atari 130XE in assembly 
language, using MAC/65. I'll need one IOCS (Input/Output 
Control Block) for reading the RAMDISK. FIL file, another 
lOCB for reading the file being copied, and a third for the 
output file on the RAMdisk. I'll process chunks of files 255 
bytes long at a time. The program will stop executing when 
an End-Of-File marker (EOF, for short) is read from RAM- 
DISK. FIL. I'll set this program up to autorun upon loading 



from disk. If the program file is named AUTORUN.SYS, it 
will load and execute upon booting. 

How about memory allocation? I'll begin this program at 
address $5000, just because I always do. I need to reserve 
a block of RAM 255 bytes long to hold each chvmk of file 
as I read it (a "buffer"). I also need to reserve space to hold 
the name of the file being processed (which I just read from 
RAMDISK. FIL), and space for the output name (the same 
as input, except with a D8: drive specification), at 16 bytes 
each. (If I were writing a graphics program, I'd also decide 
how much RAM I needed for display list, character sets or 
whatever, and what addresses I'd use.) 

Now, what sort of things might go wrong that I must teach 
my program to handle? Maybe the user's computer doesn't 
have a RAMdisk setup. Maybe the RAMDISK. FIL file is 
missing. Maybe the files listed in RAMDISK. FIL aren't on 
the boot disk. In the first two cases, the program will sim- 
ply stop executing. For the third situation, I'll copy any files 
I find and print a message for any that aren't found. I'll use 
any macros I have lying around to save my typing in code 
wherever possible. 

Picture perfect? 

Whew! Did you follow all that? Maybe a diagram would 
clarify things somewhat. In Figure 1, I've drawn what's 
called an "action diagram." This is a simple way to sketch 
out the detailed logical structure of a program, as an alter- 
native to a flowchart. I'm sure you could also draw a flow- 
chart for a program this short, but let's move into the 1980s. 



COPY FILES TO RAM DISK 
Open D1:RAMDIS£.FIL 

+ If error 

Print error mesBage 

Escape 

ElEB 

+--- Loop 1 

Read a record from Dl :RAMDISK.FIL 
+ — If EOF 

Close Dl; RAMDISK. FIL 
— Escape 
- Else 

Set up output filename 
+-— Loop 2 



Open input file 
Read a chunk 



If not EOF 

Write chunk to output file 

Else If EOF 

Get nujnber of bytes read 
Write chunk to output file 
Close input and output files 
-Escape 



+ End if 

+ End Loop 2 

+ End 'if 

End Loop 1 

+ End if 

End COPY FILES TO RAM DISK 



Figure 1 



ANALOG COMPUTING 



MAY 1988 / PAGE 93 



The brackets in the action diagram enclose logical blocks 
of operation. The IF/ELSE/ENDIF structures show condi- 
tional actions that depend on various situations. The brack- 
ets marked with a double line (equal signs) at the top 
indicate a repetitive (looping) action. The horizontal arrows 
labeled "Escape" show ways to exit from the inner bracket- 
ed actions when certain conditions (usually errors) are en- 
countered. Sometimes we can use error conditions to our 
advantage, such as when an EOF condition error means 
we're done with a particular operation. 

After all this design work, I'm ready to begin writing a 
program. Again, let me stress that the more time you spend 
going over and over the design steps, the less aggravation 
you'll encounter when coding, testing and debugging. I 
guarantee you'll think of new angles, potential pitfalls, and 
so on, each time you iterate through the design process. 
Believe me, it's a lot easier to modify an action diagram than 
rewrite a segment of your program because of a logic flaw 
or functional omission. 

Toolbox 

While working through the program design, I also think 
about what tools I'll need to implement it. For a graphics 
program, I ponder such heavy questions as whether I need 
a vertical blank interrupt routine to move players, display 
list interrupts to make the screen look nice, a mixed-mode 
display list (build your own or modify the default?}, or some 
redefined characters. I think about the macros and subrou- 
tines I have available that might do the job, and any others 
I'll have to create. 

For the file copier program, I need my OPEN macro to 
open some lOCBs, and, of course, the CLOSE macro when 
I'm finished with them. The PRINT macro would be nice 
for putting error messages on the screen. I can use INPUT 
(discussed in issue 58) to read the entries in RAMDISK.FIL. 
MOVE would be handy for copying the input filename to 
the output filename space, so I can change the drive desig- 
nation to D8:. 

Recall that I decided to read a chunk of the input file con- 
taining 255 characters and store it in a buffer. INPUT won't 
work for this, since INPUT expects to see a carriage return 
(end-of-line character, EOL, $9B) at the end of the string 
being read. Similarly, PRINT adds an EOL to the output 
string, so that's no good for writing to the output file. I guess 
I'll have to write some new macros that don't involve car- 
riage returns. These are the PUT and GET macros fomid 
in Listing 1. 

New macros 

Please merge Listing 1 with your existing MACRO. LIB 
file, using the line numbers shovwi. The equates at the top 
of Listing 1 define the error number for an end-of-file con- 
dition (EOF $88) and the CIO command bytes for PUT- 
CHAR and GETCHAR (put and get a string of characters, 
respectively) operations. RUNAD ($02E0) is a magic address 
for making an object code program rrm automatically upon 
loading, as we'll see a little later. 

The PUT macro sends a string of bytes out to a specified 
lOCB. PUT takes three parameters. The first is the lOCB 
number to use, and the second is the address of the buffer 
where the data to be output resides. Parameter 3 is an op- 



tional number of bytes to be output. If %3 is less than 256 
it's assumed to be a value. If greater, it's assumed to be the 
address of a pair of bytes containing the number of bytes 
to be output. If %3 is missing, only 1 byte is output. 

PUT is pretty straightforward. When I wrote PUT and 
GET, I found they had several statements in common, so 
I collected those into a separate macro called PGSETUP 
(Lines 6780-7070 of Listing 1). PUT and GET pass two 
parameters to PGSETUP, which sets up the lOCB buffer ad- 
dress and length for the specific operation being performed. 

GET is the converse of PUT. The command value of GET- 
CHAR ($07) is used in Line 6650, rather than the PUTCHAR 
($0B) of Line 6360. GET and PUT both treat EOL Hke any 
other character. However, GET does recognize the end-of- 
file marker (CTRL-3), which terminates the input operation 
and retruns an error status of $88 (decimal 136). 

There's one more macro in Listing 1, OPENA (Lines 
7110-7360). If you look back to the OPEN macro (issue 55), 
you'll see that it expected parameter 4 to be a literal charac- 
ter string containing the name of the unit or file to open. 
However, in this program I'll be opening some file whose 
name I just read from the RAMDISK.FIL file. Hence, I need 
a version of an OPEN macro that can accept an address as 
a parameter. OPENA corrects this limitation of my original 
OPEN macro. 

Programming, at last! 

If you're like me, you'll have to restrain yourself from the 
temptation to dive right in and start spewing out code as 
soon as you think you're ready. The catch is that you prob- 
ably aren't ready as soon as you think you are. However, 
at this point I felt I understood the problem clearly and had 
a design in hand that was good enough to implement. 
Hence, I wrote the program you see in Listing 2. Type in 
Listing 2 and assemble it into a file called BC59.0BJ. Once 
you've tested BC59.0BJ enough to convince yourself that 
it works (just load it from the DOS menu with option L), 
you can safely rename it to AUTORUN.SYS, so it executes 
upon booting. 

Okay, I admit it. My program didn't look like Listing 2 
when I first wrote it. I went through the usual series of test- 
ing, changing and retesting sections of code. Once I foimd 
the line I'd uiadvertently deleted during editing, things went 
pretty smoothly. I also admit that, while coding, I found a 
few things I'd overlooked during the design phase, so I 
squeezed them into my action diagram. Incidentally, the ac- 
tion diagram (or other graphic representation of the pro- 
gram logic) will be mighty useful when you look at a pro- 
gram again a few months after writing it and want to fig- 
ure out how in the world it works. Comments help too. 

The BYTESREAD equate in Line 200 of Listing 2 is kind 
of interesting. Recall that the last chunk of data we read from 
the input file being copied may be shorter than 255 bytes, 
since GET stops whenever an EOF is encountered. We'll 
want to know just how many bytes were read in that final 
chunk, so we can PUT exactly the right number out to the 
copy of that file on the RAMdisk. The other equate, INBUFF, 
says we want to use the 255 bytes, beginning at address 
$6000, as our buffer for data read from the input file. 

The first thing our action diagram says to do is try to open 



PAGE 94 /MAY 1988 



ANALOG COMPUTING 




Boot Camp 



continued 



the RAMDISK.FIL file. Lines 360-370 set the stage by clear- 
ing the decimal mode for arithmetic (not critical in this pro- 
gram, but a good practice) and clearing the display screen 
using the CLS subroutine from last time. Lines 380-480 at- 
tempt to open D1:RAMDISK.FIL for input using lOCB 2. 
If successful, we branch to label FOUNDIT and proceed. 
Otherwise, Lines 400-480 print an appropriate message on 
the screen and jump to the end of the program at label EXIT. 

Recall that CIO errors leave their calling card in the Y- 
register. In Lines 400-410, I'm storing this value temporari- 
ly on the program stack, so I can write the first part of the 
error message (MISSINGJ. The error number from the OPEN 
is retrieved in Lines 430-440. If I didn't stash the Y-register 
contents like this, Y would otherwise contain the error sta- 
tus from the PUT in Line 420, which is probably 1 and 
therefore not very useful! Our old subroutine, STATUSERR, 
tries to figure out the problem with the OPEN and prints 
an appropriate message. I could have used PRINT for the 
MISSING message, but that would have caused a carriage 
return before STATUSERR told us what happened— strictly 
a cosmetic decision, but appearances are important. 

The action diagram next says we should read a record 
from RAMDISK.FIL, as in Line 580. Lines 600-690 handle 
any error, which should just be an end-of-file condition. This 
isn't really an error; it just indicates that the program's job 
is complete. In any case, we close lOCB 2 and exit from 
the program. Remember to always close lOCBs you open. 

The filename read from RAMDISK.FIL is stored at ad- 
dress FNAMEIN. Sixteen bytes were reserved for this pur- 
pose in Line 1450. In Lines 770-800, we copy that filename 
to the FNAMEOUT address reserved in Line 1460, and 
change the drive identifier to D8:. Note that this code seg- 
ment assumes the records in RAMDISK.FIL are in the form 
Dl: FILENAME. EXT, one filename per record; more about 
that later. 

Line 810 prints the filename on-screen, so we can keep 
the user informed as to what's going on. I'm a big believer 
in not making the user guess whether or not the computer 
is paying any attention to him. In Lines 820-870, we open 
the input file and handle any problems. This time we jump 
back to get the next filename, even if the present one caused 
some error. 

The next section, at FOUNDINP, attempts to open an out- 
put file on the RAMdisk. This section will trap for situa- 
tions such as no RAMdisk existing, or a full Rv^Mdisk, or. . . 
Notice how many lines of code I've devoted to error han- 
dling? This is pretty typical for my programs. Just when 
you think you've covered every possible thing that might 
go v^rrong, either the user or the computer will get even more 
creatively nasty. 

The actual copy routine in Lines 1080-1130 is ridiculously 
simple. It just alternates between reading a 255-byte chunk 
from the input file and writing it to the output file. When 
the EOF is detected, control branches to the FINISH rou- 
tine at Line 1210. Now we find out how many bytes were 
actually read during the final GET operation, by checking 
the lOCB 3 buffer length, and put that number of bytes out 
to lOCB 4. This completes the copy process, so both lOCBs 
are closed. A message confirming that the copy was suc- 



cessful is printed, and Line 1310 jumps back to read an- 
other record from RAMDISK.FIL. What could be simpler? 

Autorunning 

If you want a binary (object code) program to rmi auto- 
matically upon loading, end it with an RTS (Return From 
Subroutine) instruction, as in Line 1380. This will return 
control to the environment from which the program was 
loaded, usually DOS. Setting up a file to "load-and-go" is 
very simple. Address RUNAD ($02E0) just has to be load- 
ed with the address at which execution is to begin. In this 
program, like all of mine, the magic address is $5000. Note 
that, in Line 290 of Listing 2, I thoughtfully put the label 
START right at the beginning of the program. Then, at the 
very end of the program (Lines 1580-1590), I set the pro- 
gram counter to RUNAD and state that the 2-byte address 
defined by START is to be loaded into RUNAD. Very sim- 
ple, very easy. 

Now, you can assemble Listing 2 and save the object code 
under filename AUTORUN.SYS. If you aren't using a RAM- 
disk to house your MACRO. LIB and SUBS. LIB files, change 
the drive numbers in Lines 180 and 1520. Each time you 
boot from that disk, the .LIB files will be copied onto the 
RAMdisk. 

But wait! How do we get the RAMDISK.FIL file? The eas- 
iest method is to use the "Copy" function from the DOS 
menu. Select option C for copy, and copy from device E: 
(the screen editor) to device D1:RAMDISK.FIL. Each line 
you type at the cursor and end with a RETURN will now 
end up in the RAMDISK.FIL file. Enter the complete file- 
specs for the files you want to copy to the RAMdisk, in the 
form Dl: MACRO. LIB. Press RETURN after each filespec. 
When you're done, press CTRL-3 to create the end-of-file 
character, and RAMDISK.FIL is created. To verify the con- 
tents, simply copy from D1:RAMDISK.FIL to E:. Of course, 
you could also use any text editor that produces straight 
ATASCII text to create the RAMDISK.FIL entries. 

Wrap-up 

I hope you found "A Trip Through Karl's Brain" to be in- 
formative. Everyone writes programs a little differently, but 
my approach seems to get the job done. I have some other 
ideas for useful programs that I might present in future is- 
sues. Remember, ask not what you can do for your computer. 
Ask, rather, what your computer can do for you. fl 

Despite having a Ph.D. in organic chemistry, Karl Wie- 
gers earns a living writing applications software for photo- 
graphic research at Eastman Kodak Company, mostly on an 
IBM mainframe. He is also interested in educational appli- 
cations of Atari 8-bit, Atari ST and Apple II computers. 

Listing 1 
Assembly listing 

0165 EOF = 588 

0195 GETCHAR = 587 

8285 PUTCHAR = $8B 

8265 RUNAD = 582E0 

6188 

6198 

6288 

6210 ;PUT Hacro 

6228 : 



MKMKKMKlCKKKMKKKKKltKKlCKKKKKKKKMM 



ANALOG COMPUTING 



MAY 1988 / PAGE 95 



6238 

6248 

6258 

6268 

6278 

6288 

6298 

6306 

6310 

6320 

6330 

6340 

6350 

6360 

6378 

6380 

6398 

6488 

6418 

6428 

6438 

6448 

6458 

6468 

6470 

6480 

6490 

6500 

6510 

6520 

6530 

6540 

6550 

6560 

6570 

6580 

6598 

6608 

6618 

6628 

6638 

6648 

6658 

6668 

6678 

6680 

6698 

6780 

6718 

6720 

6730 

6740 

6750 

6768 

6778 

6788 

6798 

6888 

6818 

6828 

6838 

6848 

6858 

6868 

6878 

6888 

6898 

6988 

6910 

6920 

6930 

6940 

6950 

6968 

6978 

6980 

6998 

7888 



Usage; PUT lOCB, address, length 

■IOCS' is the Z8CB nuMber to use 
■address* is a label or buffer 
address where the output data is 
■length' is the nuMber of bt^tes 
to be output-if Missing then =1 

.MACRO PUT 

.IF X8<2 .OR Y.Q>Z 

.ERROR "Error in PUT" 

.ELSE 

LDX UY.1*16 

LDA ttPUTCHAR 

STA ICC0M,X 

.IF X8=2 

PGSETUP y.2,l 
.ELSE 

PGSETUP y.2,y.z 

.ENDIF 
JSR CIOU 
■ENDIF 
.ENDM 

ICICXKMKKMKKKMMKKICICKKMKKXKMKKMKKK 



GET Macro 

Usage: get IOCB, address, length 

■lOCB^ is the I8CB nuMber to use 
■address' is a label or buffer 
address where the input data 
should go 

■length' is the nuMber of bytes 
to be input-if Missing then =1 

■MACRO GET 

■IF X8<2 .OR K8>3 

.ERROR "Error in GET" 

.ELSE 

LDX ttXl»16 

LDA ttGETCHAR 

STA ICC0M,K 

.IF X0=2 

PGSETUP y.2,1 
.ELSE 

PGSETUP Y.2,y.Z 
.ENDIF 
JSR CIOV 
.ENDIF 
.ENDM 



MICXMKICKXMXICKMMXICKKICICICMKKMXXICICKIC 



PGSETUP Macro 

Usage: PGSETUP address, length 

'address' is I/O buffer address 
'length' is nuMber of bytes for 
PUT or GET operation Cvalue<256 
or address) 

.MACRO PGSETUP 
.IF K0<>2 

.ERROR "Error in PGSETUP'^ 

.ELSE 

LDA U <y.i 

STA ICBAL,X 

LDA n yy.L 

STA ICBAH,X 
.IF X2<256 

LDA ny.2 

STA ICBLL,X 

LDA no 

STA ICBLH,X 
.ELSE 



7810 
7828 
7838 
7840 
7050 
7060 
7070 
7080 
7090 
7100 
7110 
7120 
7130 
7140 
7150 
7160 
7170 
7188 
7198 
7208 
7218 
7228 
7230 
7240 
7258 
7260 
7270 
7280 
7298 
7380 
7310 
7320 
7330 
7340 
7350 
7360 
• 



0100 
Olio 
8128 
8138 
8148 
0158 
8168 
8178 
0180 
8190 
8280 
8210 
8228 
8230 
0240 
0250 
8260 
0270 
0280 
0290 
0300 
8310 
0328 
8338 
8340 
0350 
0360 
8370 
0380 
0390 
0408 
8418 
8428 
8438 
8440 
0450 
0460 
8470 
0488 



LDA y,2 
STA ICBLL,X 
LDA X2+1 
STA ICBLH,X 
.ENDIF 
.ENDIF 
■ ENDM 



XXXKKXXMXXXXXXXXXXXXXXKXXXXXKXX 



OPENA Macro 

Usage: OPENA I0CB,axl,ax2,add 

'lOCB' is lOCB nuHber to use 
'axl' is task nuMber 
'ax2' is the 2nd auxiliary byte 
'add' is the address of the 
device naMe to be opened 

.MACRO OPENA 
.IF X0O4 

.ERROR "Error in OPENA" 

.ELSE 

LDX ttKlKlO 

LDA ny.2 

STA ICAX1,X 

LDA ny.z 

STA ICAX2,X 
LDA U <y.A 
STA ICBAL,X 
LDA » >y.A 
STA ICBAH,X 
JSR OPENIOCB 
.ENDIF 
.ENDM 

Listing 2 
Assembly listing 

PrograM to copy a list of files 
whose nanes are in a file naMed 
Dl:RANDISK.FIL froM drive Dl: 
to RAM disk drive D8 : 

by Karl E. Miegers 

.OPT OBJ, NO LIST 
.INCLUDE ltD8: MACRO. LIB 

BYTESREAD = S4FFE 
INBUFF = $6888 



XXXKXXXXXXXXXXXXXKKXXXXXKKXXXXK 

PROGRAM BEGINS HERE 
XXXKXXXKKKKKXKKKKXKXKKKKXXXXXXX 



«= $5000 
START 



look for Dl:RAMDlSK.FlL; print 
error Message if not found 



CLD 
JSR CLS 

OPEN 2,4,e,"Dl;RAMDISK.FIL" 
BPL FOUNDIT 
TYA 
PHA 

PUT 0, MISSING, 15 
PLA 
TAY 
JSR STATUSERR 

CLOSE 2 
JMP EXIT 
MISSING .BYTE "Dl: RAMDISK . FIL " 



PAGE 96 / MAY 1988 



ANALOG COMPUTING 




Boot Camp 



continued 



0490 
0500 




1270 
1280 


PUT 4, INBUFF, BYTESREAD 
CLOSE 3 




0510 


J read a record froM RaMDiSK.FiL; 


1290 


CLOSE 4 


0520 


;if EOF is reached, progran is 


1300 


PRINT OKAY 


0530 


;coMplete; print Hessage if 


1310 


JMP FOUNDIT 


0540 
0550 


;soMe other error crops up 


1320 OKAY .BYTE "Copied Okay",E0L 
1330 ; 


0560 




1340 




0570 
0580 


FOUKDIT 

^P &■ V% I I ^P J% r* &■ ^ ^M^^ ^^ &■ 


1350 
1360 


RTS lets this be AUTORUN.SYS 


INPUT 2,FNaNEIN 




0590 


BPL NOTEOF 


1370 




0600 


CPY ttEOF 


1380 EXIT RT5 


0610 


BNE OTHERERR 


1390 
1400 




0628 


CLOSE 2 


~""~ — — — . — __ 


0630 




1410 


; space for input & output 


0640 
0650 


DTHERERR 


1420 
1430 


1 f ilenanes 


PRINT UNKNOMNERR 


' _———_————————_-.———————————— 


0660 


CLOSE 2 


1440 


' 


0670 


JMP EXIT 


1450 FNAMEIN 16 


0680 


UNKNOMNERR .BYTE "Unknown error" 


1460 FNAMEOUT 16 


0690 


.BYTE " on RftMDISK.FIL",EOL 


1470 
1480 




0700 






0710 




1490 


idon't forget the subroutines! 


0720 


build the output file nane. 


1500 




0730 




1510 




0740 
0750 




1520 
1530 


.INCLUDE ttD8: SUBS. LIB 




0760 NOTEOF 


1540 




0770 


MOVE FNAMEIN,FNAME0UT,16 


1550 


iset up for autorun on loading 


0780 


LDX ni 


1560 




0790 


LDA tt56 ;ATASCII 'S' 


1570 




0800 


STfl FNAME0UT,X 


1580 


*= RUNAD 


0810 


PRINT FNAMEIN 


1590 


■MORD START 


0820 


OPENA 3,4,8,FNAMEIN 


• 




0830 


BPL FOUNDINP 






0840 


JSR STATUSERR 






0850 


CLOSE 3 






0860 


CLOSE 4 






0870 


JMP FOUNDIT 






0880 1 
0890 J 














0900 J 


open output file, check for 






0910 ; 
0920 J 


error with randisk 












0930 ; 








0940 F 


OUNDINP 






0950 


OPENA 4,8,8,FNAME0UT 






0960 


BPL DOCOPY 






0970 


CLOSE 2 






0980 


CLOSE 3 






0990 


PRINT RANDERROR 






1000 


JMP EXIT 






1010 F 


lAMDERROR .BYTE "ProbleM With" 






1020 


.BYTE " the randisk. . .",EOL 






1030 J 








1040 








1050 , 


copy file in blocks of 255 bytes 






1060 








1070 ; 








1880 [ 


>OCOPY 






1090 


GET 3,INBUFF,255 






1100 


BMI FINISH 






1110 


PUT 4,IHBUFF,255 






1120 


CLC 






1130 


BCC DOCOPY 






1140 , 








1150 








1160 ; 


write the renaining nuMber of 






1170 ; 


input bytes, close files, go 






1180 J 
1190 J 


get the next input filename 












1200 , 








1210 f 


■INI5H 






1220 


LDX n$Z9 






1230 


LDA ICBLL,K 






1240 


STA BYTESREAD 






1250 


LDA ICBLH,X 






1260 


STA BYTESREAD+1 






ANALOG C 


;OMPUTING 




MAY 1988 / PAGE 97 



Attention 
Programmers! 



ANALOG Computing is interested in programs, articles, and software review sub- 
missions dealing with the Atari home computers. If you feel that you can write as well 
as you can program, then submit those articles and reviews that have been floating 
around in your head, awaiting publication. This is your opportunity to share your knowl- 
edge with the growing family of Atari computer owners. 

All submissions for publication, both program listings and text, should be provided 
in printed and magnetic form. Typed or printed copy of text is mandatory and should 
be in upper and lower case with double spacing. By submitting articles to ANALOG 
Computing, authors acknowledge that such materials, upon acceptance for publica- 
tion, become the exclusive property of ANALOG Computing. If not accepted for pub- 
lication, the articles and/or programs will remain the property of the author. If submissions 
are to be returned, please supply a self-addressed, stamped envelope. All submissions 
of any kind must be accompanied by the author's full address and telephone number 

For those of you who are sincerely interested in the rules and regulations for publica- 
tion, we've taken this opportunity to print our guidelines for authors. See page 128 of 
this book for everything you'll need to know. 



Send your programs ar^d articles to: 
Editor, ANALOG Computing 

RQ Box 23, Worcester, MA 01603. 



i^'cr^j-^" 



MAGNAVOX 




EGA 

MONITOR 
CM9043 



Full compatibility with the IBM Enhanced 

Graphics Adapter Card, or equivalent 

High contrast 14" CRT (13" visual) 

Glare-reducing etched glass tube face 

64 color capability in Enhanced Graphics 

(EGA) mode 

16 color capability in Color Graphics 

(CGA) mode 

Up to 640 dots resolution (horizontal) 

Up to 350 lines resolution (vertical, 

Enhanced Graphics mode) 

Text mode display function in green or 



amber 



$ 



339 



EGA Card - $125 





NX 1000 

NLQ - 56 CPS 
DRnFT-144CPS 



B€ST PRIC€ CALL 

NX1 000 Roinbouu Color Printer - Coll 



8CM515 
New 

«269.95 



Cable 515 Magnavox to 
Amiga Computer- *13.95 





^184.95 



CM8502 Color Monitor 40 

• Accepts composite video input • 330 
dots resolution (horizontal) • 350 lines 
resolution (vertical) • Green text display 
switch • Variable sharpness control 



Modems 

2400 Baud External 139.95 

2400 Baud Internal 139.95 

1200 Baud External 79.95 

1200 Baud Internal 64.95 



SUPER SPECIAL 

OF THE MONTH 

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




lOOCf Hayes Compatibility 
Hayes is a Regisd-red Trademark of Hayes 



• Full niiimifaitiiiHT wiiiianty. 

• I'lT.siiiiiil thfck :t vvi-ok.s cleaiiiiuT. 

• Rfturn iiuthuiizatioii iciiuiied. 

• I'lii'i's show li'. <ash discoimt. 

• Compatibility not jjuaianti-ril. 

• COl) afi-c|>tf<l. 

Al'«), KHO, Intfi-iiational: add .$5 plus It' i priority. 
N<> sales lax outside N.Y. 
l'rKcs/availul)iiily sulijccl li> change. 



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



y^ 



KC3 

APPLE IBM 

'16.99 




KRAFT 

MICROMOUSE IBM 

«39.95 



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



Cables 



=^ 



IBM Parallel Cable 6' 5.99 

IBM Parallel Cable 10' 7.99 

M-M RS232 Cable 6' 7.95 

M-M RS232 Cable 10' 8.49 

M-F RS232 Cable 6' 7.95 

M-F RS232 Cable 10' 8.49 

IBM Modem Cable 6' 5.99 

IBM Modem Cable 10' 7.99 

IBM at Modem Cable 5.99 

M-M Centronics 6' H'SS 

M-F Centronics 1 1 -95 

M-M Centronics 10' 1295 

IBM Keyboard Extension 4,99 

Monitor Extension-DB9 M-F 11 95 

Monitor Cable-DB9 M-M 11 95 

IBM Color RGB Cable-DB9 Cable to 

8 Pin Din 12 95 

Mac to Imagewriter 9 99 

Mac to Imagewriter II 9-99 

Mac • to Hayse 9-99 





Accessories 



A;B DB9 Switch Box 32.95 

ABCD DB9 Switch Box 49,95 

A;B Telephone Switch Box RJ11 34.95 

Serial Cross-Over Switch Box 39.95 

Parallel Cross-Over Switch Box 39.95 

M-M DB9 Gender Changer 5.95 

F-F DB9 Gender Changer 5.95 

A B Parallel Switch Box 22.95 

A;B Serial Switch Box 22.95 

A'B'C.D Parallel Switch Box 39,95 

A B,C, D Serial Switch Box 39.95 

6 Outlet AC Surge Pr 9-95 

B-109 Parallel Card 29.96 

B-106 Serial Card 26.95 

Male Male Gender Chg 5,95 

FemI FemI Gender Chg 5.95 

Winner 200 11-99 

Winner 104 ''•99 

Winner 770 Com Atari 1195 

Winner 909 Apple/IBM 23,95 

Winner 220 Joystick 13-95 

500XJ Atari/Comm K^B 

Competition Pro 5000 14.95 

Kraft Apple,lBM KC 3 24.95 

Mazemaster Atari C64 14.95 

#31 Apple Mouse 32.95 

Starmaster Joystick 5.49 

Joystick Ast Ada. Kit 27.95 

Kraft Ace Joystick 5.49 

Kraft Premium 2 IBM 26,95 

Apple Mach 3 Stick 12.95 

Apple Kraft Stick 8.95 

Mouse Joystick 12.95 

Competition Pro 15, 95 

Suncom Slik Stiks 6,99 

Suncom Econo Stik 4.99 

Suncom Tac 2 9-99 

Suncom Tac 3 1 1 -99 

Suncom Tac 5 13-95 

Suncom Starfighter 17. 85 

Icon Controller 1 599 

Tad 1 24.95 

Starfighter IBM 17,85 

Starfighter C64;Atar 8.95 

Terminator Joystick 19-95 



«3.99 



■IMEMOREX 



aiMEMOREX 

UNIVERSAL PRINTER STAND 



MEMOREX 



Disk Label Kit 

PAPER 

#0150 

InkJet *14.99 

500 Count 




DISKETTES 

3.5 SS/DD 13.99 

3.5 DS/DD 16.99 

5.25 SS/DD 5.99 

5.25 DS/DD 8.99 

5.25 DS/HD 16.99 



#0200 s 6.99 

4 Color - 200 Sheets 

#0024 *22.95 

2400 Sheets - 20 lb. 



20# 250 SHEETS 
H.99 12 + "3.99 



#0035 

Thermal Transfer 
500 Ct. 



"12.99 



J^ 



Circle #109 on reader service card. 



WU a" 






It's W«i t a hUUV-'" • , 



yot^r^^^"' 



T;o«i^^«>- 



atet^f^ 



.„te Vn*^", 

.4.P tie*' ' .;„' 






-J 11 ft 



oVease ca 



o,*rUe 



,CV)S^^ 



AatdOrVve 



vievtns- 



.s\eeU'^«*^" 



«« 






Circle #110 on reader service card.