Text content (OCR)
===> presents | A Dp E
hard
Orc
SPRING 1984
The IAC is coming
to Chicago in May!
Chicago Convention anc \d Tourism Bureau
soecials
VISICALC 124.95 PANASONIC COLOR MONITOR 395.00
DESKTOP PLAN 165.00 CENTRONICS 737 795.00
APPLE TAX PLANNER 95.00 INTERFACE CABLE for 737 25.95
APPLE FORTRAN 159.95 MICROSOFT "RAMCARD" 167.50
MONTY PLAYS MONOPOLY [disk] NEC GREEN PHOSPHOR MONITOR 229.95
VERSAWRITER — Graphi 219.95
jeu)
pa
AMERICA’S INFORMATION UTILITY XYM EX
+ 1000
with Quadra-Pitch 10,
12,15 Pitch and
Proportional Spacing
D.C. Hayes Micromodem II™
CORVUS 10 MEGABYTE
HARD DISK BASF DISKS
NOW! Corvus speaks Apple pascal! $25.95 for 10
APPLE DISK DRIVE
Reg. $525 now $459.95
LANGUAGE SYSTEM
$425.95
APPLE /// 128k
price $4350.00 $3995.00
WORD PROCESSING COMBO! OUNE: PRINTER 5/45
$2495.00
EasyWriter with a
Videx Board only $450.00
Westwood
Computer a ‘computer
Sales and Service
Systems (213) 475-5467
Telephone Orders Only
: software
Whoneedsit?
For small amounts of information a pencil and paper
filing system works great. But when you want to keep track
of hundreds of pieces of information this system
has limitations. Recording information is slow,
locating what you want can be impossible, and the
system is so time consuming it keeps you from
filing information you know is valuable.
With PFS software and an APPLE* ,
computer you have a powerful alternative. :
Using the concept of designing a form on [
the screen, PFS lets you create a file of
information on any subject you wish
without programming. You can catalog
your stereo record collection, 35mm
slides, magazine articles, daily ex-
penses, or your club’ membership list.
Using PFS at work you can make better
decisions by creating files on inventory, customers, or or
ders and accessing them in seconds.
To use PFS you simply design a form on the screen
by typing the names of the items you want to store in-
formation about. Once the form is created you tab from
PFS isa trademark of Software Publishing Corporation.
requiresa 48K, 16-sector disc based
APPLE Il system
item to item and fill in the information. This can be a
single piece of data or several pages of text. Up to 1000
forms can be stored on a diskette.
Looking up information is just as easy. PFS
can search for a number, a single data item, or a
word within a page of text. All forms that match
are displayed on the screen. You can browse
through each one and change, delete, ex-
\ pand, or print it. PFS even has a print for
matter that lets you create mailing labels.
PFS software is different. It is not a
specialized application package or a
complex programmer oriented data
base manager. It is a personal filing sys-
tem that lets you communicate with
the computer using meaningful every-
day concepts to rapidly create files on
any subject matter you require.
PFS isavailable through your local dealers. Ifthey don’t
carry it, have them give us a call at (415) 368-
7598 or write to us at Software Publishing Corp- e,]
oration, RQ Box 50575, Palo Alto, CA 94303.
“APPLE isa registered trademark of Apple Computer Inc.
Software Publishing Corporation
.4 MEGABYTES
FOR YOUR APPLE
Double-Sided, Double-Density 8-Inch Drive
Capability is Here ... Now!
The new LOBO DRIVES Model LCA-22 Double
Density Floppy Disk Controller has been
specifically designed to match your APPLE® to
the new double-sided, double-density 8-inch floppy
disk drives. Now, you can add up to four 1.1
Megabyte drives (4.4 Megabytes total) and realize
all the power and potential of your APPLE
computer.
Completely Software transparent, the Model
LCA-22 will plug into any chassis slot. You are no
longer restricted to slot 7. And, the Model LCA-22
is fully compatible with 3.2. (3.3 DOS systems,
PASCAL will be available soon.)
LOBO’s new LCA-22 Disk Controller and full line
of field-proven, high-reliability disk drives (all
LOBO products come with a one year, 100%
parts/labor warranty) are available at computer
retail stores nationwide. Stop in and see a
demonstration at your local dealer today.
LOBO DRIVES INT’L
354 South Fairview Ave.
Goleta, CA 93117
(805) 683-1576
\@B
Orives
INTERNATIONAL
(area code)
Gaesces tear ee a ee 1
' '
+ I’m looking to expand my APPLE. Please ;
t send me more information on: t
' 1
{© Model LCA-22 Disk CO Fixed Disk Drives :
! Controller '
! Gi Floppy Disk Drives 1 5%-inch H
! 0 5%-inch C1 B.inch H
+ © 8inch 14-inch ‘
H t
{Name t
' t
1 Address '
\ City State Zip t
n
| Phone i
1 1
1 t
L 4
SPRING 1981
PRESIDEN
APPLE ORCHARD
In the past months the IAC has
been receiving many phone calls
and letters and the main question
asked is “What can the IAC do for
my club?”
As a member club, you receive
APNOTES which Apple Computer,
other manufacturers and members
give the IAC for distribution. They
contain information on hardware/
software modifications/fixs and any
other data that can help the end
user with his/her Apple. As of this
time, the IAC has sent over 140
pages of APNOTES.
As a member club, you also re-
ceive software disks that have been
donated by clubs as far away as
Japan and Australia, and as close as
Apple Computer itself. So far there
have been five official disks re-
leased by the IAC to its members,
and we hope to have one a month
starting in May. If you are a new
PAGE 3.
member club, the IAC does not
end back issues of the software,
ut commences sending the cur-
rent disk at the time of joining. The
software is given FREE to our mem-
ber clubs.
The IAC publishes the “Apple Or-
chard”, which is made available at a
bulk discount rate to our member
clubs. You can also individually
subscribe. An additional monthly
bulletin is also sent to our member
clubs to inform them of late news
and developments.
The IAC has committees dealing
with all manner of special interests.
You can communicate with these
committees by writing and making
use of their experts.
In the near future we hope to
establish a WATS [800] line to
answer some of your questions.
There is in the planning stage a
“scholarship” fund, and we will be
video taping the seminars given at
our annual meeting so we can send
them to you for viewing. As the di-
rectors from each region receive
your inputs we, the IAC, will act on
them.
Now back to the question “What
can the IAC do for my club?” |
would like to change that to read
“What can you as a member club
contribute to help the IAC?” We
need programs to distribute to the
members, we need articles for the
Orchard, we need your input.
The IAC is a volunteer organization
and without INPUT there is no
OUTPUT.
Ken Silverman,
President,
International Apple Core
INTERNATIONAL APPLE CORE
SPONSORING MEMBERS
I.A.C. sponsors are a special breed. They are the organizations who along with our advertisers, contri-
bute to and support many I.A.C. activities. In addition, they will provide us with application notes con-
cerning their products—notes that will benefit users by showing new and different ways to utilize their
products or production/software modifications that have been made to upgrade their product. When
considering a software or product purchase, we request that they be given special consideration.
Those organizations that would like to become sponsors or who would like additional information
about the benefits and advantages of becoming a sponsoring member are urged to contact Michael
Weinstock, Vice-President, International Apple Core, P.O. Box 976, Daly City, CA 94017.
A list of sponsoring members, current through the first of February, 1981, appears on page 68.
(continued on page 68)
PAGE 4 APPLE ORCHARD
INTERNATIONAL
APPLE CORE™
PRESENTS
Vol. 2 No.1 Spring 1981
Entire Contents Copyright® 1981
by International Apple Core
Published for the International Apple Core by
dilithium Press, P.O. Box 1493, Beaverton, OR 97075
SPRING 1981
President's Comer
IAC Sponsoring Members
Select One
PRINT FRE(ed)
Screen Formatting of Text
‘An Introduction to Light Pens
IN THIS ISSUE
Notes on Hi-Res Graphics Routines in Applesoft
‘An Apple ll Quickie
Practical Super Hires Graphics
‘Comparing Applesoft Programs for Differences
Charles Boody, David W. Walker, Val |. Golding 22
2 Sided Disks
5. H. Lam Routine Utility
Double-Size Graphics for the Silentype
Matix Functions with the Apple
Programming the Apple to Communicate by Telephone
Resurrecting Killed Programs
Lookit
‘ANote on CPIM
Programmer's Aid RAM Test Initializer
Text Train and Sub Search
Word of Caution
Getting There Faster in Applesoft Basic
Modifying Pascal BIOS to Work with the Paymar LC Adapter
Craig Vaughan, Lee Meador 47
Simple Functions in Applesoft
Homebrew to Champagne
‘The Apple Il Cassette Interface
***SYNTAX ERR
New Product Parade
Application for Membership
Sorting in BASIC
IAC Membership Information
IAC Miscellany
Who was Asking About ASCII?
Passing Argument Values to Machine Language Subroutines
in Applesoft
Low Resolution Graphics in Pascal
Color Compliments for Black and White
Green Apple Bits
Tune Your Apple
Proper Printer Protocol
Single Drive Copy
‘Advertisers Index
Ken Silverman
3
3
TheEditor 6
Val.J.Golding 7
Peter C. Weiglin
Neil D.Lipson 14
C.K. Mesztenyi 17
Gordon Stallings 19
R.H.Good 20
Lee Reynolds 28
Bruce F.Field 30
Max|.Nareff 36
Terry Guerrant 40
DavidG. McDonald 41
Steve Jenkins 43
GaryM.Comeau 44
David B.Garson 45
D.laden 45
David Bartley 46
D.B.Buchler 47
Steve Wozniak 51
Mark Crosby 61
ArtMack — 68
Joe Budge 73
Val.J.Golding 74
C.K. Mesztenyi 77
BillShepard 80
Tom Jacobsen 86
Mark Welty 86
Valj.Golding 91
Steve Adams 92
Jill A. Scofield — Publisher
Val J. Golding— Editor
Kathryn Hallgrimson—Assistant to the Editor
Tymera Coen—Production Manager
Larry Danielson—Circulation
ADVERTISING REPRESENTATIVES.
dilithium Press
P.O. Box 1493
Beaverton, OR 97075
(503) 646-2713
SUBSCRIPTIONS — DEALER INFORMATION
Apple Orchard Subscriptions
P.O. Box 1493
Beaverton, OR 97075
$10/year— Published Quarterly
For information on becoming a member of IAC
please write: International Apple Core
P.O. Box 976
Daly City, CA 94017
INTERNATIONAL APPLE CORE
Jerry Vitt
Ken Silverman
Michael Weinstock
Dave Gordon
Joe Budge
Jon R. Lawrence
Harlan G. Felt
Jerry Vitt
Scott Knaster
Bernie Urban
Tony Cerreta
Joe Alinsky
Fred Wilkinson
Roger Keating
‘Auby Mandell
Wolfgang Dederichs
Apnotes
Apple Fair
Apple Orchard
Constitution & Bylaws
Education SIG
Ham Radio SIG
Handicapped SIG
1.A.C. Software
Legal SIG
Medical SIG
Newsletter Exchange
Newsletter Library
New Club Assistance
Standards
Telecommunications
Officers
Chairman
President
Vice-President
Treasurer
Secretary
Regional Directors
(north)
(north)
(south)
(south)
(east)
(east)
(west)
(west)
International Directors
(214) 369-7660
(415) 878-9171
(516) 360-0988
(213) 954-0240
(919) 489-4284
(313) 534-2433
(408) 866-1733
(214) 369-7660
(303) 355-2379
(301) 229-3458
(914) 636-3417
(213) 703-1894
(415) 585-2240
P.O. Box 448, Double Bay 2028, NSW, Australia
409 Queen St. W., Toronto, Ont. Canada M5V 2A5,
‘Auf Drenhausen 2 4320 Hattigen, West Germany
Committee Chairmen
John Shanes
David Alpert
Val J. Golding
Ken Silverman
Ted Perry
James E. Hassler,
WB7TRQ
David McFarling
Neil Lipson
Butch Clayton
Dr. Larry L Stoneburner
David Alpert
Major Terry N. Taylor
Randy Fields
Mark Robbins
Craig Vaughn
(804) 746-2711
(312) 295-6078
(206) 932-6588
(415) 878-9171
(916) 961-7776
(307) 632-4934
(420) 467-1878
(215) 356-6183
(803) 884-5370
(714) 953-9151
(312) 295-6078
(213) 372-4134
(415) 775-7965
(303) 750-5813
(703) 255-2241
Ural
MTTETETY? |
Turn your Apple into the world’s
most versatile personal computer.
The SoftCard™ Solution. SoftCard
turns your Apple into two computers.
AZ-80 and a 6502. By adding a Z-80
microprocessor and CP/M to your
Apple, SoftCard turns your Apple into
a CP/M based machine. That means
you can access the single largest body
of microcomputer software in exist-
ence. Two computers in one. And, the
advantages of both.
Plug and go. The SoftCard system
starts with a Z-80 based circuit card
Just plug it into any slot (except O) of
your Apple. No modifications required.
SoftCard supports most of your Apple
peripherals, and, in 6502-mode, your
Apple is still your Apple.
CP/M for your Apple. You get CP/M
on disk with the SoftCard package. It's
a powerful and simple-to-use operating
system. It supports more software
than any other microcomputer operat-
ing system. And that's the key to the
versatility of the SoftCard/Apple.
CIRCLE READER SERVICE NUMBER
BASIC included. A powerful tool,
BASIC-80 is included in the SoftCard
package. Running under CP/M, ANSI
Standard BASIC-80 is the most
powerful microcomputer BASIC
available. It includes extensive disk I/O
statements, error trapping, integer
variables, 16-digit precision, exten-
sive EDIT commands and string func-
tions, high and low-res Apple graphics,
PRINT USING, CHAIN and COM-
MON, plus many additional com-
mands. And, it’s a BASIC you can
compile with Microsoft's BASIC
Compiler.
More languages. With SoftCard and
CP/M, you can add Microsoft's ANSI
Standard COBOL, and FORTRAN, or
Basic Compiler and Assembly Lan-
guage Development System. All, more
powerful tools for your Apple.
Seeing is believing. See the SoftCard
in operation at your Microsoft or Apple
dealer. We think you'll agree that the
SoftCard turns your Apple into the
world’s most versatile personal
computer.
Complete information? It's at your
dealer's now. Or, we'll send it to you
and include a dealer list. Write us. Call
us. Or, circle the reader service card
number below.
SoftCard is a trademark of Microsoft. Apple I! and
Apple I! Plus are registered trademarks of Appie
Computer. Z-80 is a registered trademark of Zilog,
Inc. CP/M is a registered trademark of Digital
Research, Inc.
Microsoft Consumer Products, 400 108th Ave. N.E.,
Bellevue, WA 98004.
(206) 454-1315,
PAGE 6
APPLE ORCHARD.
FROM THE EDITOR’S
NOTEBOOK
SCRATCHPAD
RAVINGS
ASSISTANT
ASYLUM
SELECT ONE
SPRING 1981
It seems incredible that an entire
year has rolled past since we put
the first Orchard to bed and cele-
brated the new arrival, but it has
and we are. Celebrating the arrival
of the fourth Orchard, 96 pages of
fact and information filled articles
and programs.
Leading off this anniversary issue
on Page 9 is Peter C. Weiglin’s
Screen Formatting of Text, a well
written article from the San Fran-
cisco Apple Core’s Cider Press, and
of special significance to new-
comers to Appledom who want to
learn more about the Apple's easy
to use screen display commands.
Our second major contribution is
by C. K. Mesztenyi of the Washing-
ton, D.C. Apple Pi group, who has
greatly expanded on the Applesoft
Hi-Res Internals information from
the first Orchard, with his Notes on
Hi-Res Graphics Routines in Apple-
soft. This feature makes it truly pos-
sible for the first time to utilize the
speed of Applesoft’s Hi-Res routines
from Assembly Language.
One of Call -A.P.P.L.E.’s bestowals
is a substantial rewrite by David W.
Walker and ourselves of Charles
Boody’s Comparing Applesoft Pro-
By the Editor
grams for differences, a program
that is helpful to the utmost when
you can’t remember exactly what
changes you have made to the pro-
gram you are working on.
Call -A.P.P.L.E. and Cider Press
each appear on the scene again
with Lee Reynolds’ 5. H. Lam Rou-
tine Utility, a handy program that
converts machine language to
BASIC, and Max Nareff’s thorough
exploration of Matrix Functions
with the Apple.
Have you ever wondered what
ASCII really means? Our explana-
tory article offers some clues as to
how the ASCII standard character
set and Apple display set differ,
while Washington Apple Pi also
puts in another appearance with
Bruce Field’s Double Size Graphics
for the Silentype and C. K. Mesz-
tenyi’s really neat method of pass-
ing parameters to the A, X, Y and PC
registers from BASIC.
Pascal users should not feel ne-
glected either, with a passel of
goodies, including Low Resolution
Graphics in Pascal by Bill Shepard,
nor is CP/M overlooded, as Steve
Jenkins contributes A Note on
CP/M.
In Apple Computer, Inc.'s Con-
tact, co-founder Stever Wozniak
describes some of the events pre-
ceeding Apple | and the Apple JL,
under the title Homebrew to Cham-
pagne. “Woz” was recently injured
while taking off in his aircraft, but is
doing very well. We are certain any
cards would be well received, and
may be sent c/o Apple Computer,
Inc., 10260 Bandley Driver, Cuper-
tino, CA 95014.
Finally, in the International Apple
Core section, you will find the first
of several new features, Mark Cros-
by’s New Products Parade, along
with information as to how you, as
an individual, can subscribe to the
Orchard, or locate a user group
near you to join. User groups, in
turn, will find how they may join
the I.A.C.
Don't forget, we are just scratch-
ing the surface. It would take
another two or three pages just to
describe all the fine material under
these covers; best you look for
yourself. To make sure you don't
miss out on our next big batch of
brilliant booleanisms, better buy a
subscription. (whew!)
SPRING 1981
APPLE ORCHARD
PAGE7
EDITOR RESIGNS, CLUB IN UPROAR
PRINT FRE(ed)
By Val J. Golding
Got your attention, there, didn’t I!
So commenced a story by Lee
Meador in the Ft. Worth Apple
User's Group Newsletter, and
griping about much the same situa-
tion as we are about to espouse.
Contributions.
It is not the almighty dollar we are
talking about, but the almighty arti-
cle. This issue of the Apple Orchard
would not have at all been possible
without the efforts of three of the
largest user groups in the country:
San Francisco Apple Core (Cider
Press), Washington, D.C. Apple Pi
(Washington Apple Pi) and Apple
Pugetsound Program Library Ex-
change (Call -A.P.P.L.E.). To these
three organizations, then, we must
first extend our thanks and our con-
gratulations for coming through ina
pinch.
It seems inconceivable that the
member clubs of the International
Apple Core, now numbering well
over 200, with just minor excep-
tions, submitted not so much as one
original or reprint story for this issue
of the Orchard. We have read
many, but not enough, issues of the
club newsletters to know that there
is a wealth of material out there that
would be of much interest to many
of the readers of the Orchard.
If the president of each club, or
the editor of its newsletter, would
take just a few moments to review
material they have recently pub-
lished and recommend it to us, we
would have enough material for the
next year or two of the Apple
Orchard.
The IAC is an organization that
provides a multitude of services to
its member clubs, not the least of
which is free public domain soft-
ware. In return, each member club
has a responsibility, an obligation,
to reciprocate in the form of mater-
ial for the Orchard. The Orchard
was, and remains, the primary
source of financial support for the
IAC. Without its revenues, the IAC
could not survive.
This editorial is no idle threat; it is
a statement of fact. We will bandy
no words. Your support is needed,
and it is needed now.
IN MEMORIAM:
Apple Orchard
Vol. Il, No. 2
Summer, 1981
After you play the
Temple of Apshdi,
you can play
Sticks and Stones
for free.
Within the 200 rooms and catacombs of the
Temple of Apshai, untold treasures await you —
the hero. All you have fo do is elude, outsmart and
outwit the beasts, monsters and demons lurking
in the dark labyrinth. Spend minutes or hours on this
role-playing fantasy — the boldest computer game
in our Dunjonquest™ series.
Now, when you order the “Temple of Apshai,’ you
get the “Sticks & Stones” board game for no extra
charge. In fact, if you're not satisfied with the “Temple
of Apshai,’ you can return it within 10 days and still
keep “Sticks & Stones!”
But don’t wait, this special offer is limited. (We'll
also send you a catalog outlining
our other exciting com-
puter games).
(Add $1.00 shipping and handling charge; plus 6% or 672% tax for California
residents.)
1
|
I Automated Simulations, P.O. Box 4247, 1988 Leghorn Street Name. |
| Mountain View, California 94040 Department AO I
| Please send me the “Tempe of Apshat or: nares |
| Cassette ($24.95) Disk ($29.95) 7 I
| _TRs-80 TI 16K, Level it 32K TRSDOS ; !
| _ APPLE Not available Cl 48K Applesoft in ROM Clty, State, Zip i
| PET 032k Not available 1 Check enclosed, Charge to: 1 VISA C) MasterCard |
| |
| |
| |
| |
i
Amount $. # Expiration date.
r charge by phone: (800) 824-7888, operator 861. In California: (800) 852-7777,
‘operator 861. Ityou prefer, call these numbers fr a lst ofthe computer stores near you
Verbatim
comments:
®€Compared to the brands
I've used before, Verbatim
Datalifé'is the best yet! 99
Sandy Tiedeman
Las Vegas, NV
&€New Verbatim helped
eliminate I/O errors on
my Apple.99
Richard Adams
Ft. Walton Beach, FL
I would prefer Verbatim
Datalife over any brand I've
ever used.99
Skip Piltz
Overland Park, KS
&¢My experience with
Verbatim diskettes has been
excellent. I've used several
boxes over the past few
months and they've all been
error-free.99
Robert Roeder
Las Vegas, NV
e¢Much stronger, better
centering. A definite im-
provement.99
Leroy LaBalle
Marrero, LA
eet has worked perfectly
everytime!99
Richard Ruth
Shippensburg, PA
€t] like the thicker pro-
tective cover.99
David Hendel
Lititz, PA
Great! I have had no
problems!99
Timothy Roscoe
Mechanicsburg, PA
&€So far my Verbatim disks
have been performing flaw-
lessly. Not always so with
other disks.99
Chris Otis
Hoffman Estates, IL
€¢Runs quieter in the disk
drive.99
Richard Cannova
Los Angeles, CA
€Verbatim disks are super.
They're our standard for
quality.99
Bob Mills
Mission, KS
€tAnything that prolongs the
life of a diskette is a plus.
Thank you Verbatim for an
excellent improvement.99
Steve Toth
Piscataway, NJ
Of the 130-plus Verbatim
disks I have, I'm not aware
of any problems. I'm sure
the improvements will give
your disks an even longer
life.99
Gerald Janas
Warren, MI
ReFANTASTIC. Nota single
registration problem. Much
more reliable than what I
had been using.99
Gary Sandler
Playa Del Rey, CA
€¢Verbatim is much more
reliable. I wouldn‘t trust
anything else.99
Howard Chin
Pomona, CA
€¢Thank you for the im-
provements. Just another
reason why I'll always use
Verbatim.99
James Hassler
Cheyenne, WY
We introduced Verbatim
Datalife mere months ago.
And it’s already playing to
rave reviews like these.
But don't take anybody
else's word for it. Try it your-
self, and see if you don't
agree it's the best media
you've ever tried. For the
name of your nearest
Verbatim dealer, call (800)
538-1793, in California call
(408) 737-7771 collect.
We play it back, Verbatim!
SPRING 1981
APPLE ORCHARD.
PAGE9
SCREEN FORMATTING OF TEXT
One of the more satisfying sights
in Apple land is watching as your
program successfully runs and
information is being displayed on
the CRT (Cathode Ray Tube, or TV
screen to most of us). Lists of infor-
mation scroll by—bunched up
against the left margin, maybe, and
with numbers not quite lined up,
but printing, by golly. But soon, the
desire to make things look a bit
neater wells up inside of us, par-
ticularly if we're going to show this
thing off to anyone else, like for ex-
ample with a project involving our
work.
So let's take time here to consider
the formatting of data. At the outset,
| must say that this material has
been gathered from many sources.
Further, there must be better ways
to do some of these things, or at
least alternate methods which you
may have. If so, please let us know
about them.
The BASIC commands which play
a part in formatting include:
PRINT
TAB
HTAB
SPC()
FLASH
INVERSE
NORMAL
VTAB
INPUT
GET
SPEED
STR$(
LEN(
VAL(
ASC(
CHR$(
HOME (or CALL -936)
CALL -958
CALL -868
POKE
by Peter C. Weiglin
Cider Press
©1981, All Rights Reserved
—and others.
The primary statement is, of
course, PRINT. All else is format-
ting which characters we place on
the screen, and where we place
them. Within the limitations of the
40-character wide screen and the
Apple character set, there is vir-
tually nothing that can’t be done.
(There is both hardware and soft-
ware available which bends these
limitations, but let’s stay with the
unadorned Apple for now.)
The PRINT statement causes dis-
play of letters, numbers and all sym-
bols except the double quotes (”).
The reason you can’t display double
quotes is that this symbol is used to
tell the Apple where material to be
printed starts and ends. No prob-
lem; we have single quotes (’) avail-
able to pinch hit. Example:
10 PRINT “‘HELLO’, SHE SAID AS
WE”
Whatever you put between dou-
ble quotes will be PRINTed. Some
things can be PRINTed without
quotes, namely numbers and pre-
viously identified strings. Examples:
PRINT 250
PRINT 4+6
30 X=5
40 PRINT X
50 X$= “CIDER PRESS”
60 PRINT X$
In addition, Applesoft will allow
the double quote within a PRINT
statement, through the use of
CHR$(34). To rewrite our example
above:
10 PRINT CHR$(34); “HELLO”;
CHRSG4); “, SHE SAID A‘
What about this one?
70 PRINT
Well, the PRINT command by it-
self brings about a line feed and [RE-
TURN]; it's the equivalent of skip-
ping a line.
How about this?
In Applesoft, a quick way to type
[PRINT] is to type a question mark
as a shorthand symbol.
80 ? “APPLE CORE”
will yield
80 PRINT “APPLE CORE”
when the line is LISTed. This not
only saves typing strokes, but also
allows you to edit a program line
more quickly, by taking advantage
of the four-character difference be-
tween [?] and [PRINT].
All of these PRINT commands so
far will begin their display at the left
side of the screen. Here's the first
approach to making the right-hand
phosphors carry their share of the
load:
90 PRINT “ APPLE”
PAGE 10
Sure; put in enough spaces to get
you as far to the right as you want to
be. Oh...if you put in more than
40 spaces, you'll continue the word
on the next screen line.
Well, there are easier ways to
break free of the left margin; [TAB]
in Integer Basic and [HTAB] in
Applesoft Basic. They work the
same way in their respective dia-
lects; let’s use the Applesoft version:
100 HTAB 8
110 PRINT “APPLE CORE”
~and the first letter of the print
statement will appear 8 spaces from
the left margin. We risk duplicating
the Apple manual here because
there has been some confusion
about [TAB], since it appears also in
Applesoft, but as a slightly different
function, and there is no “Integer/
Applesoft comparative manual".
SIDE NOTE: THERE IS ONLY ONE
“R” IN THE WORD “INTEGER!”
Regarding [TAB] and [HTAB], the
lowest legal value you can use is 1;
the highest is 255. (Well, you could
use [HTAB 0], but only if you
wanted to tab 256 spaces.)
Note too, that the [HTAB] com-
mand can cause the next item to be
printed to the left or right of the cur-
rent cursor position. Try this:
120 HTAB 20:PRINT “E”;:HTAB
10:PRINT “A”
Yep, the “E” was printed first,
then the “A” to the left of the “E”, on
the same line. Now try it without
the semicolon after the “E”, and you
see that the “A” is one line lower.
But before we get into the semi-
colon and other delights, let's clear
up the Applesoft [TAB] first. Note
that in Line 100 above, [HTAB]
stood by itself as a command. So
does [TAB] in Integer. [TAB] in Ap-
plesoft does not; it must be in-
cluded in a [PRINT] statement, with
the number in parentheses, like
this:
130 PRINT TAB(8) “APPLE CORE”
APPLE ORCHARD
Why do we bother with [TAB] in
Applesoft at all? Frankly, | dunno.
[HTAB] runs a bit faster than [TAB]
and [TAB] cannot move the cursor
to the left. Anybody have the
answer?
Now try this:
140 A=7
150 HTAB A: PRINT “APPLE”
Yes, you can [HTAB] to a variable,
too, which leads to all kinds of pos-
sibilities. You may have noticed one
application of this in an S. F. Apple
Core Disk of the Month:
160 C$= “APPLE CORE”
170 HTAB (20- INT(LEN(C$)/2))
180 PRINT C$
Since 20 is halfway across the
screen, and we're HTABbing 20
minus one-half the length of the
string, the string will automatically
be centered. If you want to print C$
so that it will be flush with the right-
hand margin, make line 170 above
read this way:
170 HTAB (41- LEN(C$))
Yes, that’s “41”, not “40”. The last
character of the string will occupy
the 40th space on the screen, which
is the rightmost space.
We also lightly scratched the sur-
face of ways to print more than one
item on the same line. This is most
often done with semicolons, al-
though commas and the [SPC( )]
command are also available. Try
this:
190 PRINT “APPLE”; ”;“CORE”
—and you get the space between
the two words. The semicolons tie
the elements of a PRINT statement
together. Remember, a PRINT state-
ment normally contains an auto-
matic RETURN within it; the semi-
colon inhibits that RETURN. For
example:
200 PRINT “APPLE”;
210 PRINT“ ”;
220 PRINT “CORE”
SPRING 1981
—and all is on the same line, even
though three program lines were
used.
The comma in a PRINT statement
also inhibits the carriage return -or
line feed, but it does so in a very
specialized way. The line
230 PRINT “A”,“B",“C“,“D”
—causes the “A” to be printed at the
left margin, the “B” in the 17th
space, the “C” in the 33rd space,
and the “D” in the first space on the
next line. These locations are fixed;
while you use the comma, you can't
change them. It'll go 1, 17, 33 ‘till
Kingdom come.
To print columns, you can use the
comma, or you can use a formula
which gives you better control of
the columns. Let’s assume a list of
30 items, each 6 characters wide. If
you just [PRINT] that list, it'll scroll
the first items on the list right off the
screen. But if you split it into two
columns, it'll all fit. Try this:
240 FOR I= 1. TO 15
242 PRINT S$(I);
244 HTAB 20: PINT S$(I+ 15)
246 NEXT
For more than two columns, the
general idea is the same; divide the
total number of items in the list by
the number of columns you want,
and add 1. That becomes the top
number in the for-next loop. As an
example, for three columns, with
48 items, it’s:
250 RN=48
251 N=(RN/3)+1
252 FOR I=1 to N
253 PRINT S$(I);:HTAB 15
254 PRINT S$(N + 1);:HTAB 30
255 PRINT S$(2*N) +1)
256 NEXT I
—Note the semicolons used in lines
253 and 254 to keep the items on
the same line. For four columns, N
would be set equal to ((RN/4)+1),
and another PRINT statement
would call for printing $$((3*N)+1)..
Obviously, you’d have to adjust the
tabs accordingly.
SPRING 1981
Another command which helps
to free us from the right margin is
[SPC( )], which, as the name im-
plies, involves spaces rather than
tabulation. The TAB/HTAB family of
commands uses the left margin as
its baseline, measuring from there
each time it is used. The SPC( )
command measures from the end
of the previously printed statement.
These next two statements will do
precisely the same thing:
260 PRINT “A”,” muBr
270 PRINT “A”SPC(8)“B”
Note that the SPC( ) command
must be in a PRINT statement, that
it does not require semicolons, and
that the number of spaces must be
in parentheses. SPC( ) also requires
less memory than a string of blank
spaces in your program. And, to
make this complete, you can also
SPC( ) to a variable, which means
that this next line will duplicate
lines 260 and 270 above, putting
eight spaces between the “A” and
the “B”:
280 X= 16
282 PRINT “A”SPC(X/2)“B”
Remember, the SPC( )command
measures from the end of the item
preceding it, rather than HTAB or
TAB's reference to the left margin
every time they are used.
The FLASH and INVERSE com-
mands are used to highlight char-
acters on the video screen (excuse
me, the CRT display). They look
good, if not overused. The most
common programming error with
them is forgetting to use NORMAL
to return to good ‘ol white on black,
but this one manifests itself very
quickly. Thanks to the semicolon,
we can highlight part of the PRINT
statement, like this:
290 PRINT “YOU ARE ”;:
INVERSE: PRINT “VERY WEAK”;
:NORMAL:PRINT ” TODAY.”
The INVERSE and NORMAL com-
mands are set off by colons as se-
parate statements in the program
line. The PRINT command must be
repeated after a colon, or else:
APPLE ORCHARD.
300 PRINT “YOU ARE ”;:FLASH:
PRINT “DEAD”;: NORMAL:
PRINT “TODAY.”
There is one aesthetic problem
with FLASH: if it’s on the screen for
more than a few seconds, it be-
comes more of a nuisance than a
help. Clear it out when it has done
its attention-getting job. One good
use for FLASH is for showing that
the computer is occupied by an in-
ternal activity for the moment, with
a message like
310 FLASH: PRINT
“WORKING. . .”: NORMAL
INVERSE and FLASH affect only
the Apple’s output to the CRT dis-
play (excuse me, the video screen).
Your input remains white on black.
VERTICAL SPACING
Remember, with the horizontal
location process, that semicolons
and [SPC) )] measure from the pre-
viously printed character, while
HTAB, TAB, and commas use fixed
references measured from the left
margin. Vertical location is also pos-
sible from a fixed reference (the top
of the screen) or a relative distance
from the last characters PRINTed.
We begin with the relative refer-
ence; the applicable command is:
320 PRINT
Yup; PRINT by itself allows you to
skip a line. To skip three lines, type:
330 PRINT: PRINT: PRINT
335 2:2:2:
—remembering that the question
mark is a shorthand way of asking
for [PRINT]. It's no more difficult
than that. But sometimes, as when
material scrolls upward off the
24-line screen, relative spacing
doesn’t quite do the job.
PAGE 11
Hence the need for a means of
positioning or formatting material
vertically. The primary means of do-
ing this is VTAB, or vertical tabula-
tor, which will place the first char-
acter of your material a given num-
ber of lines down from the top of
the screen. So,
340 VTAB 5: PRINT “APPLE”
will cause the word “APPLE” to be
printed on the fifth line, at the left
hand margin. Note, however, that
whatever is on the screen from pre-
vious [PRINT] statements will not be
disturbed. This is a situation which
could very quickly lead to clutter,
but which also has advantages.
Now, it is through the combina-
tion of vertical and horizontal for-
matting commands that we gain
both flexibility and power. For ex-
ample, given a blank screen, try
this:
350 VTAB 5: HTAB 7:
PRINT “COMPUTER”
~—and, if you RUN lines 340 and
350 together, you get both words
properly placed, but by indepen-
dent commands. Aha! That should
suggest all kinds of flexible for-
matting possibilities. The combina-
tion of VTAB and HTAB allows you
to place any characters anywhere
on the screen. One example is:
360 VTAB 5: PRINT “NUMBER OF
MEMBERS: ”
(lines calculating the number of
members)
370 VTAB 5:HTAB 20:PRINT M:
REM M= MEMBERS
What that means is that a data
framework can be set up on the
screen using commands like Line
360 above for the descriptions, and
coming back later with commands
like Line 370 to supply or to change
the data. You can even do this:
380 VTAB 5:HTAB 20:INVERSE:
PRINT “ ”;M;“ ” :NORMAL
PAGE 12
—and you get the data in inverse,
while the description is normal.
(The spaces before and after the M
are just to make the display look
better). It’s not uncommon to use
the top 15 screen lines as a form
framework, while the prompts for
inputting data occupy lines 16
through 24. Part of the screen can
be made to hold still, or be “frozen”,
by use of a [POKE] command.
A [POKE] command?? Yup. As
with any POKE command, we enter
a location and a value, lowering the
top of the screen from line 0 to
another line between 0 and 23. The
memory location is 34, so if you
want the screen fixed in place
above line 10, the command is:
390 POKE 34,9
~and you can't print above line 10.
Well, yes you can, by using VTAB to
a line above line 10. But all of the
text scrolling will take place below
line 9 until you reset the window;
try:
400 POKE 34,0: HOME
and all is normal. In addition, loca-
tion 34 (along with the other win-
dows) can be cleared with:
405 TEXT
That HOME reminds me of three
commands which can be used to
“erase” material already on the
screen prior to installing revised
data at the same screen location.
Example: if we set:
410 HOME:VTAB 4:HTAB 5:
PRINT “CIDER SQUEEZINGS”
—we get the printed words on the
fourth line down, covering the hori-
zontal spaces from 6 through 21, as
the string is 16 characters long.
Now, we can try to replace the
word “squeezings” with the word
“press”, thus:
420 VTAB 4:HTAB 11:PRINT
“PRESS”
APPLE ORCHARD
and we get—“CIDER PRESSZINGS’.
Oops! The new word didn't erase all
of the longer word that was there
first. Well, we couldn't use HOME
or CALL -936, or we'd clear the
whole screen.
Note: HOME is not available in
Integer Basic; use CALL -936.
Note to Note: THERE IS ONLY
ONE “R” IN “INTEGER”!
But we can use CALL -958, which
clears only that part of the screen
below and to the right of the cursor
location. Or, if you have other
material below the cursor, use
CALL -868, which clears only the
rest of the line on which the cursor
is located. Like this:
430 VTAB 4:HTAB 11:CALL
-868:PRINT “PRESS”
Note that the [HTAB] precedes
the [CALL]; you thus clear from the
11th space to the right margin.
Now let’s say you have a list of
data to be printed out on the
screen, and the list has more than
24 items. Whoops—there go the
first few items off the top of the
screen, while you scramble to find
CTRL-S to stop the runaway. Well,
there is a better way. At least two
better ways, in fact.
Method 1:
Set your PRINT routine up like this:
* 800 REM PRINT ROUTINE
810 F=0: REM FLAG
820 FOR I= 1 TON: REM N=
NO. OF ITEMS
830 (the data print statement for
each line)
840 F=F+ 1: IF F> 22 THEN
GOSUB 1000: F= 0: HOME
850 NEXT I
1000 INVERSE:PRINT “ PRESS
[SPACE] TO CONTINUE...
"3: GET A$: PRINT:
NORMAL: RETURN
This method increments a flag
with each line printed. At Line 23,
the subroutine is called. Pressing
the space bar (or any other key)
causes the PRINT routine to con-
tinue in an orderly fashion, a
screenful or “page” at a time.
SPRING 1981
Method 2
900 REM ROUTINE
910 FORI=1TON
920 (the data print statement for
each line)
930 IF PEEK (37)> = 22 THEN
GOSUB 1000: HOME
940 NEXT I
This one looks for the cursor loca-
tion, at memory location 37. Find-
ing the cursor at or below Line 22, it
triggers the subroutine. You can, of
course, set the values at other lines,
to fit your format.
A semi-digression (which is noth-
ing like a trailer truck running off
the road): you can vary your dis-
plays by using the [SPEED] com-
mand to slow down the rate at
which characters appear. SPEED=
255 is both the fastest speed and the
default value. .. what you normally
see on your Apple is the “255” rate.
The slowest rate is 0. Like [FLASH],
the slower display rates are useful in
small quantities, but become irri-
tating after prolonged exposure.
INPUTS AND GETS
Having covered the means
whereby PRINTed characters out-
put by the computer can be liber-
ated from the left margin, or the top
of the screen, let's consider the
characters input by you in answer
to requests for information neces-
sary to the execution of your pro-
gram. Like this:
440 PRINT “YOUR NAME”;:
INPUT A$
or
445 INPUT “YOUR NAME?”;A$
which are the two variations of this
command. Now, as shown above,
these lines will begin at the left mar-
gin. You can move ‘em wherever
you want ‘em.
SPRING 1981
Note another wrinkle here. In
Line 440, we used a PRINT state-
ment for the prompt material, fol-
lowed by the INPUT request. In
Line 445, the prompt material is in-
cluded as part of the INPUT re-
quest. We didn’t put the question
mark in Line 440, because the sys-
tem does it automatically, since it
didn’t find any prompt material in
quotes. The INPUT request, when
used as in Line 445, allows you to
replace the question mark with any
text you desire.
In a format situation, you quite
often want a number printed in the
same position on the screen, even if
it may contain different numbers of
digits at various times. Don’t input a
real or integer variable, INPUT a
string, then use the VAL( ) function
to derive the numerical value. If
you hit a letter when the computer
is expecting a number, it's error
time.
Having INPUT a string, you can
use one of my favorite subroutines,
which equalizes string lengths:
450 FOR K=1 to L% :IF LEN(A$)
<L% THEN A$=” "+ A$
451 RETURN
Of course, you have to set L%to
the maximum string length for that
application, but you can use differ-
ent lengths during the program. It
looks like this:
460 L% = 4: GOSUB 450: PRINT
A% = VAL(A$)
The subroutine inserts blank
spaces ahead of the INPUTed num-
ber, then creates the Integer vari-
able after printing the formatted
string. (Yes, it could be a real vari-
able too).
The PRINT statement for a num-
ber calculated by the computer can
also be converted to a formatted
string before PRINTing; in fact,
there’s no law against using the A$
variable over and over, in conjunc-
tion with Subroutine 450. A$ needs
to retain a value only long enough
to PRINT it, after which it moves on
to the next number.
APPLE ORCHARD
470 A$ = STRG(TL):L% = 4:
GOSUB 20: HTAB 4: PRINT
A$;:A$ = STR$(TM):
L% = 6:HTAB 18:PRINT A$.
The INPUT statement requires a
[RETURN] after the data is typed,
and we all know that a GET state-
ment does not. That is, as soon as
the info is typed in response to a
GET statement, the microprocessor
is off and running with it:
480 PRINT “ENTER INITIAL: ”
GET A$
So a GET statement, while it is
faster, is good for only a single-
character response, right? Wrong. If
you have a definite number of char-
acters to be entered, try this:
490 PRINT “ENTER 3 INITIALS:
"3: GET A$: GET B$: GET C$:
D$ = A$+ B$+C$: PRINT D$
As an alternative, you can GET ina
loop, as in:
495 PRINT “ENTER3 INITIALS: ”;:
FOR I= 1 TO 3: GET A$:
B$= B$+ A$: NEXT:PRINT BS
Notice that you can’t do with GET
what you can with INPUT as we
showed in Line 445 above; you
must use the PRINT statement.
Note also, the absence of semi-
colons between the GETs. Either ex-
ample will pick up three characters,
no more, no less. It combines the
three single-letter strings into one
three-letter string, and heads for the
hills. ..or at least for the next pro-
gram line. For many reasons, in-
cluding some caused by quirks in
the machinery, you're best off ac-
quiring numerical answers by GET-
ting string variables and converting
to real or integer using the VAL( )
function.
Finally, the most direct, and yet
most sophisticated way to put a text
character on the TV/CRT/VDU
(Video Display Unit) screen is to
POKE it there, directly into one of
the 960 cells of the 40 by 24 “grid”.
Try this:
500 HOME: POKE 1335, 195:
POKE 1336, 201: POKE 1337,
196: POKE 1338, 197: POKE
1339, 210: POKE 1340, 160: 510
POKE 1341, 208: POKE 1342,
210: POKE 1343, 197: POKE
1344, 211: POKE 1344, 211
PAGE 13
How ‘bout that! What you've
done, of course, is exactly what the
Apple has been doing for you all
through this article. You have first
identified a location on the screen,
and then placed a specific character
in that location.
The first number in the POKE
command is the location for a par-
ticular block on the screen, which is
mapped out on Page 16 of the Ap-
ple Reference Manual. Each of the
960 blocks on the screen has its
own address in the Apple's mem-
ory. We used the Figure to locate
the address of the eleventh line for
our example above (starting loca-
tion in 1320 decimal or 528 in hexa-
decimal), and then moved 15
spaces in from the left margin by
adding 15 to the 1320 line starting
address, to begin our word at loca-
tion 1335.
Look closely at that screen map;
notice that the blocks are not num-
bered consecutively, but rather in
three horizontal bands of eight lines
each. You can easily demonstrate
this phenomenon:
520 HOME: FOR I= 1024 TO
2039:530 POKE I, 193: NEXT
Which character goes into that lo-
cation is determined by a numerical
code; the American Standard Code
for Information Interchange, or
ASCII. (To pronounce “ASCII”, think
of a donkey unlocking a door). The
table on Page 15 of the Reference
Manual shows the ASCII numbers
for the characters available to you
on the Apple. The ASCII code num-
ber is the second number in the
POKE command.
Now try this:
540 HOME:POKE 1339, 220
That's a backward slash, and you
won't find it on the Apple keyboard.
The only way you'll get it on the
screen is by POKEing it there, or by
using the CHR$( ) function, which
also involves the ASCII code num-
ber, in a PRINT statement. There
are a couple of other characters
you'll not find on the keyboard, in-
cluding the underline (ASCII 223)
and left bracket (ASCII 219). For all
characters, whether normal, flash-
ing, or inverse, the POKEs give you
direct access to the screen.
PAGE 14
APPLE ORCHARD
AN
INTRODUCTION
TO LIGHT PENS
by Neil D. Lipson
A.C. Software Chairman
It has been brought to my atten-
tion that there are many program-
mers that do not know the opera-
tion of a light pen. The operation is
relatively simple. There are a few
different types of pens out on the
market, each of which functions dif-
ferently. Hopefully, this article will
help you in your understanding of
the operation of these pens.
There are basically three types of
pens in use for the Apple. Those
that use an on-off type of cell
(typically a phototransistor), those
that operate on resistance, and
those that use an optodetector, sen-
sitive to raster scan of a monitor.
The most expensive (over $200) is
the raster scan model. It picks up
the actual scan on the monitor and
uses this for determining the loca-
tion of the point. Since this is far
faster than the former two, it is fast
enough to draw lines very quickly.
However, to accomplish this, it
must have some sophisticated elec-
tronics and a rather large barrel,
which accounts for the very high
price of the unit. It can pick out
very small points (hi-res), among
other things. This is due to the
focusing nature of the optodetec-
tor. It must be very accurately ad-
justed along with the monitor, or it
will not operate correctly.
The most popular light pens for
the Apple, however, are those that
use phototransistors, and cadmium
sulfide and selenide cells. The
phototransistor cell is somewhat
faster than the cadmium cells, but
does not do as much. It can detect
only an on-off threshold. When us-
ing it with a monitor or TV, the
brightness and contrast must be ad-
justed just right, or again, it will not
always operate perfectly. This leads
into another shortcoming of the
cell, in that it cannot determine dif-
ferent variations of light. Therefore,
you cannot use software to deter-
mine differences in light; only an
on-off condition. This is fine if all
you do is pick points from the
screen with no change in light con-
ditions. However, if the sun rises
and shines through the window
close to the monitor, you may end
up readjusting the monitor. Also,
suppose you want to use the pen to
give variable readings instead of on
and off?
This is the reason for going to a
cadmium sulfide. They will do both
of these functions. However, a pure
cadmium sulfide cell is very slow.
The solution for this is to go toa high
speed cadmium selenide cell. You
then have the speed of a phototran-
sistor, and the ability to read differ-
ent levels of light. These cells are
quite expensive, and the manufac-
turer must choose very carefully a
cell that fits all these parameters.
What had to be done to satisfy
these conditions, was to custom
make -the cell to operate under
these parameters. While this added
to the expense of the light pen, it
gave the user the ability to do every-
thing he could want with a light
pen. Pens of this type can act as
light meters, and other applications
which the regular phototransistor
pens cannot do.
The pen works differently for dif-
ferent applications. To spot a point
on the screen, it will check every
point very fast, and look for a possi-
ble match. When the point on the
screen turns off, and the pen “sees”
an off condition, it registers a possi-
ble hit. It then verifies the point by
turning it on and off, checking it
SPRING 1981
everytime it does this. If after a few
checks, it verifies, and then uses
this point in the program.
When the pen is used in drawing
points, there are a few different
methods used. One is to draw a
“sheet” of light coming from the top
down, and then from the left to
right, and picking out the x and y
coordinates. Another method is to
scan the screen in bars, and localize
which bar is being scanned.
Another method is by using blocks
of light. They are all satisfactory and
give roughly the same end result.
For those pens that use cadmium
selenide cells, different levels of
light can be detected, and used ac-
cordingly. This type of pen is
plugged into the game paddle into
the pdl(0), pdl(1) or pdl(2) point.
They simulate the paddle opera-
tion. The resistance (if the cell is
properly designed) is from 0 to
150K ohms. As the amount of light
rises, the resistance drops. Even if
the operation of the resistance is
not linear, software can correct it.
Hopefully, this will help you in
your understanding of light pens
and their operation.
Screen Formatting
of Text
(continued from page 9)
But all that POKEing is a tedious
process for large amounts of text,
which is why we have all of the
other PRINT and formatting com-
mands. But with the POKEs, you've
just stepped out onto the path that
leads to (gasp!) machine language. |
suggest that you review the Apple II
Reference Manual (spiral bound,
1979), Pages 14-16, in which the
Figure and Table appear. While
you're in the Manual, you can de-
cide how much closer to machine
language you'd like to get, by trans-
lating the POKEs into “00’s through
“FFs.
As noted, if you find better ways,
please let us know; and do your
part to beautify the world’s CRT/
TV/VDT screens.
SPRING 1981 APPLE ORCHARD PAGE 15
Make the Apple II* a powerful
IEEE-488 Controller in asnap.
Just plug the SSM A488 board into any Apple II* expansion slot for a low-cost,
full-featured instrumentation interface. SSM gives the Apple II the power and
versatility of a $9,000 IEEE-488 controller. At a fraction of the price.
Our board converts the Apple II into a truly sophisticated controller that
programs and controls up to 15 different instruments connected together
on the 488 bus.
‘We make programming easy. The 68488 chip, designed by Motorola, forms the
heart of our A488. We back this chip with powerful on-board firmware to
give you system control via simple string commands. The only software
you need is easy-to-program Applesoft* Basic. To develop special purpose
firmware, simply replace our PROM with a RAM. With the A488, bus com-
munications operate at top speed—without depending on software loops for
timing. And like the more expensive IEEE-488 controllers, this system interfaces
with more than 1200 instruments and peripherals.
Suitable for OEMs as well as end users. Whether you make test/measurement systems for re-
sale, or simply for yourself, the SSM/Apple combo gives you top performance. As it cuts
your costs. Call your local dealer or SSM today for complete details.
IEEE-488 bus cable
(6 ft. with stackable connectors)
Industrial grade circuit board
PROM firmware for powerful user interface
68488 IEEE-488 controller chip-
Slot-independent connection to Apple II
EY EEF
ae aw AU
SSM’s A488 board expands the Apple II ti
's oard expands the Apple II to :
a high-performance IEEE-488 controller. Be Eee orn utes Productsnlne:
San Jose, CA 95131
(408) 946-7400 Telex: 171171
* Registered trademarks of Apple Computer In. TWX: 910-338-2077
PAGE 16 APPLE ORCHARD SPRING 1981
MR. RAINBOW
presents our valuable free
catalog (over 100 pages). He PROMPTS you
to PEEK at the latest collection of
software and hardware
products for your APPLE II™
VERSAWRITER Il
A drawing tablet,
simply plugs into your
game 1/0 port. Trace, draw,
design, or color any type of
graphic. Adds words to
pictures. Creates schematics.
Computes Distance /Area of any
figure. New - fill any area
on the screen in seconds with
over 100 different and
distinct colors. Needs 32K
Applesoft ROM and disk
drive. A bargain at...
$249.95
A STELLAR TREK
the definitive Hi-Res
color version of the classic
irtrek game. Three
different Klingon opponents.
Many command prerogatives
from use of weapons to
repair of damages. Needs
48K Applesoft ROM.
Disk. ..$24.95
SUPER SOUND
Musical rhythms,
gunshots, sirens, laser blasts,
explosions...add these and
many more exciting
sounds to your Apple. Use
them in your programs,
or create your own
BOWLING DATA
SYSTEM
This data mangement
program provides accurate
record keeping and report
generation for bowling leagues
of up to 40 teams with
bowlers per team. SUPER SOUNDS. Needs
Needs 80-column printer, “6K Applesort.
32k Applegate ROM. Have a blast for only
Disk...$78.95 $12.95... Tape
$16.95...Disk
ADD $2.00 U.S. $10.00 FOREIGN FOR SHIPPING
CALIFORNIA RESIDENTS ADD 6% SALES TAX
Open Tues. - Sun.
Don't see what you want
here, then write or call
today for your free
catalog. We're saving
one just for you.
GARDEN PLAZA SHOPPING CENTER
9719 RESEDA BOULEVARD DEPT. 12AO
NORTHRIDGE, CALIFORNIA 91324
Visa/Mastercharge welcome. PHONE (213) 349-0300
SPRING 1981
APPLE ORCHARD
PAGE 17
NOTES ON HI-RES GRAPHICS
ROUTINES IN APPLESOFT
Checking out the entry points given
by J. Crossley in the article “APPLE-
SOFT INTERNAL ENTRYPOINTS” in
the March/April 1980 Apple Or-
chard, | found the given entry
points were 4 bytes off from the
given ones in our APPLE II Plus. Fur-
thermore, after checking out the
routines in more detail, | thought to
share my experiments with other
APPLE II Plus owners interested in
machine language programming. In
the first section, | describe the
essential data storage area, in the
second | give the entry points of the
subroutines somewhat more detail-
ed than in the above article, and in
the last section | give some listings
of instructions following the entry
points so that one could identify it
for different versions of Applesoft.
1. DATA STRUCTURE
There are four data in five mem-
ory locations which specify a point
on the high resolution screen
(whether the screen is displayed or
not, is irrelevant). | call these data
collectively as external cursor data.
The five memory locations, and
their contents are as follows:
$EO: Low order bits of the hori-
zontal screen coordinate
$E1: High order bit of the hori-
zontal screen coordinate
$E2: Vertical screen coordinate
$E4: Color masking word from
the color table ($F6F6-
$F6FD)
$E6: Page indicator ($20 for
Page 1, $40 for Page 2)
by C. K. Mesztenyi
Washington Apple Pi
| have called the above set of data
as external cursor data since the ac-
tual point plot is performed by the
following five instructions:
LDA $1C
EOR ($26),Y
AND $30
EOR ($26),Y
STA ($26),Y
which uses data located at $1C,
$26, $27, register Y and $30. The
contents of register Y are always
picked up from location $E5 prior
to the above instructions, thus we
may call the data in the following
five locations as internal cursor
data:
$1C: The color masking byte
shifted for odd address and
none black or white, un-
changed otherwise.
$27: (Low, high order) ad-
dress of the byte corre-
sponding to the page, verti-
cal coordinate and leftmost
seven points of the screen.
$E5 (register Y): The integer
part of the horizontal
screen coordinate divided
by 7.
$30: The bit position taken from
Bit Position Table corre-
sponding to the remainder
of the horizontal coordi-
nate divided by 7.
$26,
These two cursor data (external
and internal) are equivalent in the
sense that given one, the other can
be derived from it. There would be
no need to make any distinction if
they would correspond to each
other all the time, but unfortu-
nately, this is not always the case,
e.g. the following sequence of
BASIC instructions:
HCOLOR=1
HPLOT 0,0 TO 10,10
HCOLOR =2
HPLOT TO 10,50
plots two lines, (0,0) to (10,10) and
(10,10) to (10,50), both with color
1, ie. HCOLOR=2 has no effect.
Actually it resets the color code in
$E4 but it does not change $1C, and
the statement HPLOT TO picks up
whatever was left in $1C.
A machine language programmer
can write his/her own graphics rou-
tines which takes time and uses
sometimes much-needed memory
space. Thus using the available pro-
grams in Applesoft ROM can be ad-
vantageous. If execution time is also
important, as in the case of anima-
tion, then one should concentrate
only on the internal cursor data,
and modify the external cursor only
when it is necessary. The entry
points INTX and INTY, provide the
basic routines for incremental plot-
ting which are not available directly
in BASIC. Also, modifying the exter-
nal cursor coordinates allows the
use of HLINE with off-set.
PAGE 18
2. ENTRY POINTS IN APPLESOFT
Page and Color:
HGR2 ($F3D8): Displays page 2
with all graphics mode,
sets $E6 to $40, clears
page 2 (black) and sets
$1C to zero (black 1).
HGR ($F3E2): Displays page 1 in
mixed mode, sets $E6 to
$20, clears page 1 (black)
and sets $1C to zero
(black 1).
BKGND ($F3F4): Clears the page
defined by $E£6 to the
color defined by the con-
tents of register A, which
should be one from the
Color Masking Table. Also
stores register A in $1C.
HCOLOR ($F6FO): Assumes regis-
ter X contains the color
index (0 to 7). The rou-
tine picks up the appro-
priate color code from
the Color Masking Table
and stores it in $E4.
Positioning Entries:
HPOSN ($F411): Assumes the in-
put upon entry in the re-
gisters as:
register X= low order bits
of the horizontal screen
coordinate,
register Y=high order bit
of the horizontal screen
coordinate,
register A=vertical screen
coordinate.
The routine stores the re-
gisters in $E0, $E1 and
$E2. Then, using $E6, sets
$26, $27, $30 and $E5
together with register Y,
and sets $1C to the con-
tents of $£4. Thus this
routine makes the internal
cursor equivalent to the
external one.
INTX ($F465): Modifies the internal
cursor data in $1C, $E5,
register Y and $30 so
that it corresponds to
incrementing/decre-
menting the horizontal
APPLE ORCHARD.
screen coordinate X by
one. Upon entry, if the
N-flag is zero (positive)
then it increments; if N
is set (negative) then it
decrements. The modi-
fication has a wrap
around feature, i.e., in-
crementing/decrement-
ing at the extreme sides
of the screen defined
by the internal cursor
causes it to come back
on the other side. The
routine assumes that re-
gister Y corresponds to
$E5 upon entry, and
leaves the routine cor-
rectly modified if
necessary.
Upon testing the N-flag
the routine jumps to
DECRX or INCRX.
DECRX ($F467): The routine modi-
fies the internal cursor
data by decrementing
the horizontal screen
coordinate by 1 (see
INTX).
INCRX ($F48A): The routine modi-
fies the internal cursor
data by incrementing
the horizontal screen
coordinate by 1 (see
INTX).
INTY ($F4D3): Modifies the inter-
nal cursor data in $26,
$27, so that it corre-
sponds to incrementing/
decrementing the verti-
cal screen coordinate
by one. Upon entry,
the N-flag is checked,
and if it is set (negative)
then goes to INCRY to
increment by one, if it
is not set (positive) then
goes to DECRY to de-
crement by one. Note
that the sign convention
is used opposite of
INTX. These entries also
have the wraparound
features, i.e. if the in-
crementation/decre-
mentation causes the
cursor to leave the
screen on the bottom/
top, then it comes back
on the top/bottom.
SPRING 1981
DECRY ($F4D5): The routine modi-
fies the internal cursor
data by decrementing the
vertical screen coordinate
by 1 (see INTY).
INCRY ($F504): The routine modi-
fies the internal cursor
data by incrementing the
vertical coordinate by 1
(see INTY).
IPOSN ($F5CB): Sets the external
cursor data in $E0, $E1,
$E2 equivalent to the in-
ternal cursor coordinate
data.
Plotting Entries:
HPLOT ($F457): Assumes input data
in the registers as
HPOSN:
register X: low order bits
of horizontal screen
coordinate,
register Y: high order bit
of horizontal screen
coordinate,
register A: vertical screen
coordinate.
The routine calls HPOSN
with the above data, then
goes to PLOT.
PLOT ($F45A): The routine exe-
cutes the five instructions
listed in the beginning of
the article which plots a
point using the internal
cursor data. If this entry is
used directly, then the
user should make sure
that register Y contains
the data from $E5.
HLINE ($F53A): The routine as-
sumes input in the
registers:
register A: low order bits
of horizontal screen
coordinate,
register X: high order bit
of horizontal screen
coordinate,
register Y: vertical screen
coordinate.
(Note that it is in different
order than (HPOSN.)
SPRING 1981
The routine draws a line
from the internal cursor
position to the point de-
fined by the input. Upon
exit, it leaves the external
cursor data corresponding
to the input, the internal
cursor data corresponding
to the last plot point of
the line. If the internal
and external cursor data
were not equivalent, then
an off-set occurs. This can
be visualized as follows:
Draw a line segment
from the external cursor
coordinates to the input
coordinates. Now move
this line segment parallel
to itself so that the end-
point at the external cur-
sor position gets into the
internal cursor position.
This is the actual line seg-
ment which will be
drawn. If it gets outside of
the screen, then a wrap-
around occurs, i.e. it
comes back on the oppo-
site side of the screen.
APPENDIX
The first few instructions are listed
for each entry point so that one
could identify them using the Moni-
tor list feature.
Bit Position Table:
$F5B2: $81 = 10000001
$F5B3: $82 = 10000010
$F5B4: $84 = 10000100
$F5B5: $88 = 10001000
$F5B6: $90= 10010000
$F5B7: $A0= 10100000
$F5B8: $CO= 11000000
Color Masking Table:
$F6F6: $00 =00000000 (black 1)
$F6F7: $2A=00101010
$F6F8: $55=01010101
$FOF9: $7F=01111111 (white |)
$F6FA: $80 = 10000000 (black 11)
$F6FB: $AA= 10101010
$F6FC: $D5=11010101
$FOFD: $FF=11111111 (white I!)
HGR2: $F3D8: BIT $C055
BIT $CO52
LDA #$40
BNE $F3EA
APPLE ORCHARD
HGR: $F3E2: LDA #$20
BIT $C054
BIT $C053
STA $E6
BKGND: $F3F4: STA $1C
LDA $E6
STA $1B
LDY $#00
HCOLOR: $F6FO: LDA $F6F6,X
STA $E4
RTS
HPOSN: $F411: STA $E2
STX $E0
STY $E1
PHA
AND #$CO
STA $26
IPOSN: $F5CB: LDA $26
ASL
LDA $27
AND #$03
ROL
ORA $26
INTX: $F465:
DECRX: — $F467:
BPL $F48A
LDA $30
LSR
BCS $F471
EOR #$CO
INCRX: $F48A: LDA $30
ASL
EOR #$80
BMI $F46E
INTY: $F4D3: BMI $F505
DECRY: $F4D5: CLC
LDA $27
BIT $F5B9
PNE $F4FF
INCRY: $6505: CLC
LDA $27
ADC #§04
BIT $F5B9
HPLOT: $F457: JSR $F411
LDA $1C
EOR ($26),Y
AND $30
EOR ($26),Y
STA ($26),Y
RTS
$F53A: PHA
SEC
SPC $E0
PHA
TXA
SPC $E1
HLINE:
PAGE 19
AN APPLE II QUICKIE
by Gordon Stallings
Tulsa Computer Society
Here is a simple program which
has been in use by the TCS Apple
Users for the past year, and which
should be more widely known:
To copy a cassette tape from one
recorder to another, you can use
the Apple II as an intermediary to
restore the signal levels.
Recorder #1} “mon
(playback)
“in” Apple Ul “out”
“mic” Recorder #2
(record)
Put this program into the Apple II:
0000 20 FD FC JSR $FCFD
0003 AD 20 CO LDA $C020
0006 4C 00 00 JMP $0000
Start the program: *0G
As long as this program is run-
ning, any signal received from re-
corder #1 will be sent to recorder
#2. For best results, the following
tips should be observed:
1. Be sure that Recorder #1 is set
up to reliably read the tape which
you are wanting to copy—volume,
tone, and head alignment must be
set so that the Apple can read the
tape.
2. Recorder #2 should have cor-
rect head alignment so that the new
tape will be compatible with other
machines.
HOW IT WORKS
The JSR calls subroutine $FCFD in
the Monitor ROM, which watches
the cassette input port waiting for a
change of state, which indicates a
zero-crossing on the playback tape.
When the transition occurs, the
subroutine RETURNS. The LDA
$C020 toggles the cassette output
port, recording a transition on the
new tape. The JMP closes a pro-
gram loop which can only be
broken by RESET.
PAGE 20
APPLE ORCHARD
SPRING 1981
PRACTICAL SUPER HIRES GRAPHICS
Bob Bishop's article in the Fall
1980 Apple Orchard serves its di-
dactic purposes admirably in show-
ing that resolution of 560x192 is
attainable with Apple II. But the
program he presents in his Fig. 4
has two substantial defects: it is
slow, and it leaves occasional dark
segments (particularly noticeable
on a color TV monitor).
Both problems can be alleviated
by R. H. Good
California State University
Hayward, CA
HPLOT successive vertical
ments of steep lines as follows:
seg-
HCOLOR =3, HPLOT first segment;
HCOLOR=7, HPLOT second seg-
ment; increment x by
Ty
HCOLOR=3, HPLOT third seg-
ment;
HCOLOR=7, HPLOT fourth seg-
ment; increment x by
Note that HCOLOR=7 automati-
cally plots things one-half x unit to
the right of HCOLOR=3. A black
line, HCOLOR=4, helps make the
segments uniform.
Here is Bishop's example again,
with its two nearly-vertical lines, to
which has been added a third line
drawn by the improved procedures
outlined above.
with little trouble. The secret is to 1; and so on.
160 IF MZ = 2 THEN HCOLOR= 1
LIST 170 IF MZ = 3 THEN HCOLOR= 5
180 HPLOT X% / 29Y
5S REM 190 NEXT
200 PRINT CHRS (07)% REM BELL
220 REM
LINE DEMO * RH GOOD
10 HGR
20 REN RHCOOD
HPLOT
230 X = 150
40 PRINT CHR$ (7)$ REM BELL 240 D = 159 / 20
50 HCOLOR= 3 250 FOR Y = 0 TO 150 STEP It
60 HPLOT 13070 TO 140%156 260 HCOLOR= 4
70 PRINT CHR$ €7)$ REM BELL 270 HPLOT X + 3exY TOX + 39Y + DO
cep |
280 HCOLOR= 7
100 REM 290 HPLOT X*s¥ TO XxY + D- 1
300 HCOLOR= 3
310 X =X +1
BISHOP 320Y=Y+5
330 HPLOT XsY¥Y TO Xex¥Y + D
110 FOR Y = 0 TO 156 340 NEXT
120 X% = 280 + Y/8 350 PRINT CHRS (07)! REM BELL
130 XX% = XX / 43MK = XX - 4 K XX 360 PRINT TABC 21)"HPLOT”
x 370 PRINT TABC 22)"BISHOP”
140 IF M% = 0 THEN HCOLOR= 2 380 PRINT TABC 24)"R H GOOD"
150 IF MZ = 1 THEN HCOLOR= 6 390 CALL - 756: TEXT ¢$ END
SPRING
1981
APPLE
ORCH.
IARD
PAGE
21
sponse) by pppielBOrer
qne BOSON, computer society apple Use Grour
nnvee COM 1920, BONG tase. 02808
et) "361-8080
PAGE 22
APPLE ORCHARD
SPRING 1981
COMPARING APPLESOFT
PROGRAMS FOR DIFFERENCES
In the July/August 1980 Call
-A.P.P.L.E., Charles Boody wrote:
“I often use programs that are
published in various journals,
and almost always find they lack
some small (or sometimes some
large) pieces that will make
them more useful for me. Once
I have made the changes or ad-
ditions, | would often like to
pass the changes on to others in
the form of an article or list of
changes. Unfortunately, it is dif-
ficult to remember what
10 REM
By Charles Boody, David W. Walker
and Val J. Golding
Call -A.P.P.L.E.
changes have been made in
which lines of what parts of
which subroutines, and how
those changes affect other parts
of the program. | also often find
myself with more than one ver-
sion of a program; my own or
public domain ones, that seem
to have small differences that
are very hard to trace down.
Sometimes too, | find that | have
kept several versions of a pro-
gram under development, but
am not sure about the detailed
differences in them.”
IST
To alleviate some of those prob-
lems, Boody wrote the COMPARE
program. Subsequent to the publi-
cation of the COMPARE program,
we received a letter from David W.
Walker who added some changes
to the original program which he
felt were significant changes, and
we agree. In addition, Walker made
several nice, but purely cosmetic
changes. Interestingly enough, the
form in which he submitted the
changes to us was a printout pro-
duced by the COMPARE program,
which for us made the work of up-
dating the original a breeze!
COMPARE CAPTURER BY VAL J GOLDING
100 D$ = CHRS$ (13) + CHRS (4):0
PS = “OPEN"SWRS = "WRITE" SCL
$ = "CLOSE"$ INPUT " PROGRA
M NAME TO CREATE TEXTFILE FR
OM ?P"SNAMESSFILES = NAMES +
".T"? PRINT DSsOP$"LIST."NAM
ESsDSsWRS"LIST."NAMES? PRINT
“LOAD” 3NAMES
110 DL$ = "DELETELIST."$TXTS = "3
TEXT? DELOsOtEND"iCMDS = "$HO
MESPOKES3, 33¢LIST1-{"iCHS =
“PCHRS( 4)" SPTS = "P"IC$ = "3
"3Q$ = CHR$ (34):ZERO$ = "
Oo" + CHS + Q$ + OPS + FILES
+ QS + C$ + CHS + QS + URE +
FILES + Q$ + CMRS + CHS + QS
+ CL$ + QS + C$ + CHS + GS +
DL$ + NAMES + Q$ + TXTS
120 PRINT ZERO$$ PRINT "RUN"? PRINT
D$"CLOSE”
130 PRINT D$"EXECLIST."NAMES"
100 REM
COMPARE PROGRAMS ROUTINE
BY CHARLES GC. BOODY
ADAPTED BY DAVID W WALKER
110 DS = CHRS (13) + CHRS (4)
PRINT D$"NOMONCIO”
120 COTO 2000
150 ONERR GOTO 810
160 GOTO 340% REM
200 REM
GETS STATEMENT FROM THE OLD FILE
210 LET OS$ = ""$ PRINT DSs"READ
"30%
220 GET A$? IF AS < > CHRS (13
) OR LEN (0S$) = 0 THEN IF
LEN (OS$) < 255 THEN OS$ =
OSs + A$$ GOTO 220
230 RETURN
SPRING 1981
The COMPARE program requires
that you first write your object pro-
grams to a text file which it can
read. This is handled entirely auto-
matically by our COMPARE CAP-
TURER, which requires only that
you supply it with the name of the
program you wish to create a text
file from, and that this program has
no line numbered zero.
The CAPTURER program will first
create a temporary text file named
“LIST. FILENAME", which it will later
delete when it has served its pur-
pose. CAPTURER then EXECs this
file, which in turn lists the BASIC
program to a text file named “FILE
NAME.T”. When the “old” and
“new” files have been created, just
run the COMPARE program, which
will ask you for the names of the old
and new programs. The suffix “.T”
should not be added; COMPARE
will do this itself.
It should be noted that program
lines longer than 255 characters will
APPLE ORCHARD
be truncated by the COMPARE pro-
gram, and that certain control char-
acters may produce unexpected
events.- For example, a REM line
which contains a Control M, [Car-
riage Return] (such as in the COM-
PARE program itself) will result in
COMPARE believing that the data
following the Control M is a separ-
ate program line, even though there
is no line number.
Printer protocol is established in
the group of lines commencing at
1000, and line 1110 assumes you
have a printer card requiring a Con-
trol |. In both lines 1110 and 1120,
the variable establishes a default of
70 characters per line for the
printer. This may be changed to suit
your specific needs.
That the program works is at-
tested to by a page of sample out-
put, which compares “CREATE3”
(an early version of the EXEC file
writer) and “COMPARE CAP-
TURER’, the final version.
PAGE 23
When entering COMPARE CAP-
TURER, it would be a good idea to
not enter the extraneous spaces in
the latter half of line 110, or a“TOO.
LONG ERROR” may result. The
CAPTURER should also serve as a
reasonably well written example of
how to write a text file that writes a
text file. Q$ is set to equal
CHR$(34), the double quote (”),
and is used when required to place
a PRINT statement within a PRINT
statement.
We have preferred to keep this
type of shenanagin to an absolute
minimum by almost entirely using
strings instead of PRINT statements.
The strings are defined in line 100
and in the first part of line 110,
while the latter part of 110 is almost
exclusively concatanenation.
ZEROS$ is the villain in this one, as it
is later EXECed into the object pro-
gram and run, causing the object
program to list itself to the second
text file.
\)
aap
fet, San Rafael, CA 98901 (416) 454-6500,
250 REN
GETS STATEMENT FROM THE NEW FILE
260 LET NS& = ""% PRINT D$s"READ
"SNS
270 GET AS? IF AS < > CHRS (13
) OR LEN (NS$) = 0 THEN IF
LEN (NS$) < 255 THEN NS$ =
NSS + AS? GOTO 270
280 RETURN Finally
300 REM
PRINTS A STATEMENT WITH A
LINE LENGTH OF LL
310 Il = 0
320 10 =
3699% PRINT MIDS (J$%»TOrLbL)
: IF II < LEN (J$) THEN 320
330 RETURN
340 PRINT D$"GPEN"0$5D$"OPEN"NS
350 GOSUB 2103 GOSUB 260: REM
rotation
355 IF LEFT$ (0S$91) = CHRS (1
3) THEN OS$ = RIGHTS (OS$» LEN
€O0S$) - 1)
360 IF LEFT$ (NS$91) = CHRS (1
3) THEN NS$ = RIGHTS (NS$» LEN
(NS$) - 1)
TT + 281% = 1 + Lei
POKE
‘The Hires Baseball that's as good as the Apple!
by Arthur Wells
$24.95/32K/Disk/Applesoft or Integer
we
8different pitches, 6 different
+ Player controlled fielding
and throwing
+ Vocal umpire
boar
+ Beautiful stadium in fullcolor
A great hi-res lunar lander, just lke the arcade game!
by Bill Budge creator of Trilogy and Penny Arcade
$24.95/48K/Disk/Applesoft or Integer
+ Landscape scrolling
+ Auto-zoom for landing site
close-up
+ Player control of 360° craft
+ Spectacular crashes
+ Always challenging
Improve your scores 2s you
improve your skill
al. Residents Add 6% Soles Tax. NoC.O.D's Add $2.00for Shipping
“Handling. Use Check, Money Order, VISA or MASTERCARD. (We
‘ed expiration date on charge card.) DEALER INQUIRIES INVITED.
APPLE ia rete radar of Ae Computer,
PAGE 24 APPLE ORCHARD
Computer Station
12 Crossroads Plaza
Granite City, IL 62040
(618) 452-1860
COMPUTER STATION proudly offers a high-speed binary
video digitizer for the Apple Il called the DITHERTIZER II.
The peripheral board uses a video camera with external sync
to load the hi-res page of the Apple with any image the
camera can capture. The DITHERTIZER Il is a frame grab-
ber, DMA type digitizer requiring only '/,th of a second to
capture a binary image. Software supplied with the board
enables building dithered images and capturing image inten-
sity contours. Intensity and contrast are user controllable via
the game paddles. Matrix size for dithering changable with
one keystroke. Requires video camera. With external sync;
recommended model, Sanyo VC1610X.
DITHERTIZER Il, $300; B/W SANYO
VIDEO CAMERA, $410; PACKAGE OF
DITHERTIZER Il AND CAMERA, $650.
GRAPHIC DUMPS: COMPUTER STATION offers the
highest degree of human engineering on the market for hard
copy graphics from the hi-res pages of the Apple. The follow-
ing machine language dump routines are available for BASIC:
1DS440G/445G°
1DS460G*
ANADEX 9501
NEC SPINWRITER 5510
NEC SPINWRITER 5520
* Also availabe for use with Pascal, $44.95.
GRAPHICWRITER: Hard copy of character sets found in
DOS Tool Kit for use with Applewriter or print statements in
your own programs. Requires DOS 3.3, DOS Tool Kit, one
of graphic printers below:
Silentype $34.95
1DS440G /445G 34.95
IDS460G 34.95
VISILIST: Get hard copy of the FORMULAS used in
VISICALC models. Prints grid location, contents (formulas
or labels). and giobal parameters. Handy utlity for all
VISICALC users. 95
PROGRAMMER'S GUIDE TO THE APPLE, it a Thiel
reference card (40 page booklet). $4.
PROGHAMMERS HANDBOOK TO THE APPLE I:
Send or call for free catalog.
Apple Il is a registered trademark of Apple Computer, ISICALC is a
Mentored iradersnn of Personal Software, Ine. DITRERTIZER Ils regered
trademark of Computer Stations, Inc.
SPRING 138592
400 REM
IF BOTH STATEMENT NUMBER AND
CONTENTS AGREE» THEN IGNORE
410 IF VAL (O0S$) = VAL (NSS) AND
OS$ = NS$ THEN 350: REM
500 REM
IF LINE NUMBERS ARE THE SAME BUT
CONTENTS DIFFER» THEN PRINT
*CHANGER” ANDI GET NEXT STATEMENT
510 IF VAL (OS$) = VAL (NS$) AND
ass < > NS$ THEN PRINT $ PRINT
"CHANCED "533% = O0S$$ GOSUB
3103 PRINT "TO "533% = NS$% GOSUB
310% GOTO 350% REM
600 REM
IF OLD LINE NUMBER < NEW LINE
NUMBER THEN OLD LINE IS DELETEDS
FETCH NEXT OLD LINE
610 IF VAL (OS$) < VAL (NS$) THEN
PRINT $ PRINT “DELETED "s$iJ
$ = OS$! GOSUB 310% GOSUB 21
0: GOTO 410: REM
700 REM
IF NONE OF THE ABOVE, THEN THE
NEW LINE IS ADDED. PRINT “ADDED”
AND FETCH NEXT NEW LINE
710 PRINT “ ADDED "s3J$ = NS$3 GOSUB
310% GOSUB 260: “GoTo 4103 REN
800 REM
WHEN ONE FILE IS EXHAUSTED>
DETERMINE WHICH AND INDICATE
REMAINDER OF OTHER "ALDED"
OR "DELETED"» AS CASE MAY BE
810 X = PEEK (218) + PEEK (219)
x 256% POKE 21620% ONERR GOTO
910
820 IF X > 230 THEN 840
SPRING 1981
830
840
850
900
GOSUB 260% PRINT $ PRINT "AD
LEDS"53J$ = NS$$ GOSUB 310%
830
IF VAL (OS$) < > VAL (NSS
) THEN PRINT $ PRINT “DELET
ELDS"s3J$ = OS$$ GCOSUB 310
GOSUB 210% PRINT $ PRINT “DE
LETEDS"stJ$ = OS$i GOSUB 310
3 GOTO 850% REM
GoTo
REM
ASSUME END OF DATA ERROR IN
LAST
910
1000
FILE AND END PROGRAM
PRINT $ PRINT "END OF COMPAR
ISONS":$ PRINT D$"CLOSE"DS$"PR
30" END $ REM
REM
PRINTER SUBROUTINES
1010
1020
1030
1100
1110
1120
2000
2010
2020
2030
2040
2050
2065
2070
2080
PRINT “PRINTER OR CRT? "5% GET
PRS: PRINT PRS
IF PR& = "C* THEN PR = O&LL
= 30% RETURN
INPUT "ENTER PRINTER SLOT 0
R CALL “sPR% RETURN
IF NOT PR THEN RETURN
IF PR < 8 THEN PRINT DS"PR
$"3PR3 PRINT CHRS (9)5 CHRS
(26)8LL = 703 RETURN
CALL PR? PRINT CHR (26 )3L
L = 70% RETURN $ REM
TEXT ¢ PRINT
HOME $ PRINT ¢
TI$ = " PROGRAM COMPARER °
HTAB 20 - LEN (TI$) / 22 INVERSE
3 PRINT TI$? NORMAL
PRINT $ PRINT
PRINT ” This Program wi
11 compare two ver- sions of
3 Program and produce 2 lis
t ofthe differences between
them. "5
PRINT "Both Programs mu
st be in textfiles# use the
Program " CHRS (34 "COMPARE
CAPTURER.” CHRS (34)
PRINT $ PRINT "What is the
name of the OLD version?”
INPUT 01$%0$ = G16 + ".T”
PRINT $ PRINT “What is the
name of the NEW version?"
INPUT N1$3NS = N1S + ".T"
APPLE ORCHARD.
PAGE 25
2085 PRINT $ INPUT “What is toda
w’s date? “sDTS
PRINT $ PRINT ¢
HOME $ VTAB 9
IF PR THEN PRINT "MAKE SUR
E THE PRINTER IS READY» THEN
«
2090 GOSUB 1000
2100
2110
2120 INPUT * HIT CRETURNI
TO RUN "sXX$
2130 TEXT ¢ HOME
2140 GOSUB 1100
2150 XX$ = “KkEK COMPARISON OF *&
wx"
2160 GOSUB 2500
2170 PRINT %XX$ = 01$% GOSUB 250
°
2180 PRINT %XX$ = "and" GOSUB 2
500
2190 PRINT %XX$ = N1$i GOSUB 250
0
2200 PRINT $ POKE 36740 + 40 & (¢
PR > 0) - (10 + LEN (BT$))3
PRINT “Prerared? *BT$! GOTO
150
POKE 369(20 + 20 & (PR > 0)
) - LEN (XX$) / 2% PRINT XX
$3 RETURN
2500
KEYBOARD RECORDER
This program generates a keyboard file by
monitoring and recording keyboard input. It can
be used together with the System Monitor, BASIC
or DOS, and is transparent to other programs
receiving the input. The keyboard file can be
selectively played back in a similar manner as the
disk EXEC command to avoid repeated typing of
the same input. A user may review the file on the
screen, or save and load the file by using tape or
disk. It saves time and storage space during pro-
gram development and revision by keeping rec-
ords of program changes or doing automatic pro-
gram testing.
DISKETTE OR CASSETTE: $25.95 (with docu-
mentation; specify DOS 3.2 or DOS 3.3 for disk)
SINGLE DRIVE DISK COPY
This program makes disk copying easy and er-
ror free. It uses only one disk drive to copy some
or all sectors on the disk.
DISKETTE ONLY: $11.95
DOS 3.3, APPLE II or ll+)
(specify DOS 3.2 or
Zeus Computing, A1
P.O. Box 712
Downey, Ca. 90241
PAGE 26 APPLE ORCHARD SPRING 1981
*5%% COMPARISON OF *2x%
CREATES
and
COMPARE CAPTURER
Prepared: 2/8/81
ADDED 10 REM
ADDED COMPARE CAPTURER BY VAL J GOLDING
CHANGED 100 DS = CHR$ (13) + CHRS (0)% INPUT “PROGRAM NAME TO CREATE TEXTFIL
E FROM "SNAMESSFILES = NAMES + “.T"% PRINT DS" OPENLIST. ”"NAMESSD$"WRITE
LIST."NAME$! PRINT “LOAD” sNAMES
To 100 D$ = CHR$ (13) + CHRS (4):0P$ = “OPEN"SWRS$ = “WRITE” SCL$ = “CLOS
€"t INPUT © PROGRAM NAME TO CREATE TEXTFILE FROM 7°$NAMESSFILES = NAM
£$ + ".T"$ PRINT DSFOPS$"LIST."“NAMESSDSSWRS"LIST.°NAMES$ PRINT "LOAD" 5N
AMES
CHANCED 110 Q$ = CHRS (34)3CMDS = “OPEN"SZEROS = " 0 DS=CHRS( 13 )+CHRS( 4 )3PRIN
TDSs" + QS + CMDS + FILES + QSiCMDS = "WRITE" $ZEROS = ZEROS + “SPRINT
DSs" + QS + CMDS + FILES + QSiCMDS = "CLOSE" $PRNT$ = " PRINT " + CHRS
(34)
To 110 DL$ = "DELETELIST."$TXT$ = "STEXTSDELO*sO%END"SCMD$ = " SHOMESPOKE33
s33tLISTI-3"8CHS = "“PCHRSC4)"SPTS = "“P"SCS$ = “$"3Q$ = CHRS (343 ZEROS
=" 0" + CHS + QS + OPS + FILES + QS + C$ + CHS + GS + WRS + FILES +
Q$ + CMDS + CHS + Q$ + CL$ + GS + CS + CHS +
ADDED Qs + DLS + NAMES + Q$ + TXTS
CHANGED 120 ZEROS = ZEROS + “SHOMESPOKE33s33:LIST:" + " PRINT DS" + QS + CMDS
+ QS + “STEXT{PRINTDS” + Q$ + “DELETELIST.” + NAMES + Q$ + “3END"
TO 120 PRINT ZEROS: PRINT “RUN"$ PRINT D$"CLOSE”
CHANGED 130 PRINT ZEROS! PRINT "RUN"? PRINT * 0”
TO 130 PRINT D$"EXECLIST.“NAMES"
DELETED: 200 PRINT D$"CLOSE"
DELETED: 210 PRINT D$"EXECLIST. "NAMES"
DELETED: 220 END
END OF COMPARISONS
SPRING 1981
APPLE ORCHARD
2 SIDED DISKS
Edited by D. Buchler of Mini’App’les from material
supplied by Dysan Corporation
Reversing Media on Single Head
Flexible Disk Drive
Flexible Disk Drives (floppys) of-
fer the end user low cost random
access to data records. Prior to the
introduction of the floppy, the only
other alternatives were sequential
tape cassettes, low cost one-half
inch tape, or single cartridge hard
media disk drives. The floppy disk
has been an ideal peripheral for low
cost systems.
There has been a tendency by
some end users to economize by at-
tempting to use the media on both
sides in a single head drive. We
most not lose sight of the fact that
the value of the data stored on
diskettes exceeds the cost of the
media by a wide margin. Loss of
data on either read or write means
time delays, reconstruction of lost
data, and customer dissatisfaction
with the system, drive and/or manu-
facturer. All of this can be avoided
in advance if the end user is made
aware of the whys and why nots.
Head Shoe and Pad operation —
The relationship of the head to
the media is such that when the
jacket is properly inserted, and all
interlocks are satisfied, the head is
loaded on to the media on the
recording side, and a felt loading
pad is applied to the non-recorded
side. In a Shugart disk drive this is
the top of the disk. In normal opera-
tion, a gradual build up of oxide will
accumulate on the pressure pad.
There might even be some wear on
the non-recorded side due to a
scouring action of the oxide
impregnated pad.
If the media is reversed, that is
turned up side down, the scouring
action will now occur on the prime
recorded side, and the previously
scoured side is now presented for
recording. The recorded data is
now subjected to an abrasive wear-
ing by the contaminated load pad.
Since this data is not being read,
there is not any means of detecting
the amount of wear or the loss of
data. While a catastrophic failure
might not occur, it is possible that
some drop out or other read errors
might go undetected. Worse yet, is
the possibility that the error condi-
tion might be intermittent, which
makes the entire operating system
suspect.
Another adverse effect of revers-
ing the media is caused by reversing
the direction of rotation of the
media against the jacket. This re-
versal of direction is apt to “break
off” any build up of oxide particles.
This presents a potential loose con-
taminant situation.
The net effect of this reversing (or
flipping) action over a period of
time, is to reduce performance and
increase the probability of drop
outs and errors.
Diskette tensioning
On most Floppy Disk Drives,
when the diskette is properly in-
serted and operation has begun,
pressure is applied to the jacket on
both sides so that proper tension is
created on the flexible media prior
to the recording head. This also
provides a wiping action of the liner
material against the flexible media.
When the jacket is reversed, or
flipped, the direction of rotation is
reversed, breaking loose any extra-
neous particles built up by prior
wiping. Thus, reversing the media
increases the probability of extra-
neous contamination and again in-
creases the probability of errors.
PAGE 27
Two head Drives
The above problem areas do not
occur on two-head drives that are
designed for two-sided applica-
tions. On a two-head drive, the
pressure pad has been replaced by
a second head mounted on a
ceramic shoe. The operation now
consists of a head-media-head rela-
tionship. The soft pressure pad with
possible oxide build up has been
eliminated.
The diskette tensioning apparatus
is the same on one and two-head
drives. Since media spin direction is
not reversed by flipping, the oxide
break off problem does not occur.
Summary
The foregoing summarizes the
reasoning why Dysan and major
OEM suppliers of diskette drives do
not recommend two-sided media
for one-head drive operation.
Dysan feels the potential operating
problems would make an unwar-
ranted reflection on its reputation
by using media in an unsuitable
fashion. When IBM introduced the
3740 diskette, they intentionally in-
terlocked reversal possibilities by
offsetting the index hole from the
centerline. IBM does not make a
reversable diskette. DYSAN does
test and supply two-sided media for
operation in two-head (two sides)
disk drives. Note that the standard
diskettes are not certified for opera-
tion in two-head drives!
Some club members have re-
ported problems in using both sides
of a diskette. While those problems
cannot be proven to be related to
any of the above types of occur-
rences, it would seem wise to fol-
low DYSAN’s advice. Members
have argued that the manufacturers
are trying to sell more disks. How-
ever, not one of them has come out
and recommended two side opera-
tion or even sold diskettes with two
slots cut. Another argument heard
frequently is that the member is us-
ing the second side for backup.
Well you might get away with it, but
| challenge anyone to religiously
avoid using that reverse side except
for the occasional update to create
the backup. | myself plan to stick to
one side from now on.
PAGE 28
APPLE ORCHARD
S. H. LAM ROUTINE UTILITY
by Lee
Reynolds
Call -A.P.P.L.E. staff writer
S. H. Lam’s Routine to set up ma-
chine language routines within a
BASIC program has been used by
various authors submitting to CALL
-A.P.P.L.E. and other magazines.
The usage of this routine is best
covered in the article “Hiding Out
in Basic”, by Val Golding, in the
June ‘79 issue of CALL -A.P.P.L.E.
| have often used this routine my-
self in my own programming. My
usual method has been to: (1)
create the machine code using my
assembler, (2) assemble it into
memory, and (3) go into the Moni-
tor and laboriously copy down the
hexadecimal values to be passed to
Lam’s routine in a string. Recently,
however, | thought: why not let my
computer save me some energy in
step (3) above? This is my justifica-
tion for the program whose listing
accompanies this article. The pro-
gram will automatically create a
Text File containing the necessary
statement(s) to call Lam’s routine
after setting up the string or strings it
requires. The format of these state-
ments in the Text File is:
(linum) A$ = (monitor string):
GOSUB (1st linum - 10)
CALL - 144
The value of (linum) above is
asked for by the program, which
will also ask the name of the binary
file to BLOAD, BLOAD it, and as-
10 REM
SoH.
BY LEE REYNOLDS
CALL -A.P.P.L.E.
LAM ROUTINE UTILITY
SPRING 1981
sign a “.T” suffix to the name of the
Text File to be created.
If more than one BASIC statement
must be generated to process the
machine language code, then sub-
sequent line numbers increase by
10. (You could change this, if you
wish, by modifying line 470.)
After you've used the program to
create this Text File, you now need
only EXEC it into your program that
uses the machine language routine.
You will note that the name of the
string variable passed as an argu-
ment to Lam's routine is A$. You
could change this also, by modify-
ing two lines in my program,
namely 410, 430 and 470. (If you
use Lam's routine in an Integer
Basic program, remember that you
must DIMension the string variable.
As the program stands now, the
maximum length of the string is 96
characters—not counting the extra
8 characters added on by Lam’s
routine.)
All functions are fully automatic,
other than the specification of the
line numbers to be assigned. The
program will BLOAD the machine
code, determine the starting ad-
dress and length, write and save the
Text File.
| hope that you will find this utility
of value in your future program-
ming.
STAFF WRITER
100 DIM HD$(16):D$ = CHRS (13) + 210 MEMSIZ = PEEK (978)3MEMSIZ =
CHRS (4):Q% = CHRS (34) (MESIZ + 13) & 2562MEMAD = M
110 GOSUE 700: GOTO 200 EMSIZ + 114tA1 = PEEK (MEMA
120 J = INT (BYTE / 16)3HEX$ = H D) + PEEK (MEMAD + 1) & 256
D$(J + 1933 = BYTE - 16 * J3 SMEMAD = MEMAD - 18tA2 = Al +
HEX$ = HEX$ + HBSC(J + 18883 ( PEEK (MEMAD) + PEEK (MEMA
RETURN D+ 1) ® 256)
130 BYTE = INT (I / 256)! GOSUB 220 VTAB 8$ INPUT "BINARY FILE N
120% RETURN AME? “SFILE$! VTAB 10% INPUT
140 BYTE = I - 256 * BYTE: GOSUB “BEGINNING LINE#? "SLINES{SU
120% RETURN BS = LINES$LINE = VAL. (LINE
150 PRINT $ PRINT ¢ INVERSE $ HTAB $) + LOSLINES = STRS (LINE)
83 PRINT " HIT ANY KEY TO CO
NTINUE "$ NORMAL $ CALL - 7
563 HOME : RETURN
200 DATA "OMe" 1M 9 223% ohh "Ss
BM 7 MBM Oy" AM @B™ "CT
*o"D",s"E"e"F"3 FOR I = 2 TO 230 PRINT D$"BLOAD*FILEStFILE$ =
FILES + *.T"
16% READ HD$C I): NEXT I
SPRING 1981
400 ADDR = A2tI = Al? GOSUB 13034
= HEX$3 GOSUB 140tA1$ = A
16 + HEX$
410 X$ = LINES + " AS= "+ QS TA
1$ + "3"tL = LEN (X$)
420 PRINT DS*GPEN"FILES#DS" WRITE
“FILES
430 RTS = QS + "NIB2ZIC" + QS PRINT
" “SUBS5" AS=AS+"RT$"$ FOR I
= 1 TO LEN (A$)% POKE Sit
+ Ivy ASC ( MIDS (ASoTs1)) +
128% NEXT 3 POKE 7220: RETUR
Nn?"
440 FOR ADDR = Al TO A22¢BYTE =
PEEK (ADDR): GOSUB 120:X$ =
X$ + HEX$ +" "3L =L + 3% IF
L < 100 THEN 490
450 X$ = X$ + QS + “$GOSUBR" + SUB
$ + "SCALL-144"% PRINT X$
460 IF ABDR = A2 THEN 500
470 LINE = LINE + 10%I = ADDR + 1
$ GOSUB 130:X$ = STRS (LINE
>+ " AS= " + QS + HEX$? GOSUB
140
480 X$ = X$ + HEX$ + "f"3L = LEN
(x$)
490 NEXT ADDRiX$ = X$ + QS + "3G
GSUBY + SUBS + "$CALL-144"%%
PRINT X$
500 PRINT D$s"CLOSE"$FILE$$ END
700 HOME $ PRINT "S. H. LAM ROUT
INE UTILITY"? PRINT $ PRINT
“THE LAM ROUTINE IS A WAY OF
STORING A MACHINE LANGUAG
E ROUTINE INTO MEMORY FRO
M INTEGER BASIC OR APPLESOFT
+ SEE THE ARTICLE “Q$"HIL
ING QUT IN BASIC"Q$" IN"
710 PRINT “THE JUNE ‘79 CALL —-A.
P.P.L.E. YOU COULDWRITE A T
EXT FILE CONTAINING THIS ROU
T- INE» THEN EXEC THE FILE I
NTO A PROGRAM." PRINT $ PRINT
720 PRINT “THE PRESENT PROGRAM W
ILL LIKEWISE CREATEA TEXT FI
LE CONTAINING THE LINES NEED
ED TO EXECUTE THE LAM ROUTIN
Ey AS WELL AS STORE THE STR
INGS THAT IT REQUIRES." GOSUB
150
APPLE ORCHARD
PAGE 29
730 NORMAL $ HOME $ HTAB 6% PRINT
"TO USE THIS UTILITY!" PRINT
$ PRINT " 1. BLOAD YOUR MACH
INE LANGUAGE ROUTINE INTO M
EMORY BY ENTERING THE FILE N
AME." PRINT ¢ PRINT " 2. EN
TER THE STARTING LINE NUMBE
R TO BE USED RY THE EXEC F
ILE."
740 PRINT $ PRINT " 3. EXEC THE
NEWLY CREATED FILE INTO
YOUR PROGRAM AND ENTER A LIN
E THAT WILL GOTO THE SE
COND LINE OF THE LINES CREA
TED BY THE EXEC FILE.”
750 PRINT $ PRINT "NOTES AS IS
THE NAME OF THE STRING USEDI
N THE EXEC FILE» AND MAY EAS
ILY BE CHANGED. LINE NUM
BERS IN THE EXEC FILE WILL
BE INCREMENTED BY 10." GOSUB
1503 RETURN
900 REM
BY LEE REYNOLDS & VAL J GOLDING
APPLE 8 DEV
MATE
Now includes the Simplified Text Processor (STP)
For 32K PET, disk 48K APPLE II
3.0 or 4.0 ROMS or —OR— or APPLE Ii +
8032 (specify) and DISK I
MAE FEATURES
— Control Files for Assembling Multiple named source files
from disk
— Sorted Symbol table — Up to 31 chars./label
— 27 Commands, 26 Pseudo-ops, 39 Error Codes
— Macros, Conditional Assembly, and a new feature we developed
called Interactive Assembly
— Relocatable Object Code
— String search and replace, move, copy, automatic line
numbering, etc.
STP FEATURES
= 17 text processing macros
— Right and left justification
— Variable page lengths and widths
— Document size limited only by disk capacity
— Software lower case provision for APPLE I without lower
case modification
ALSO INCLUDED.
— Relocating Loader
— Sweet 16 macro library for APPLE and PET
— Machine Language macro library
— Sample files for Assembly and text processing
— Separate manuals for both APPLE and PET
PRICE
—" MAE, STP, Relocating Loader, Library files, 50 page manual,
diskette —'$169.95
SEND FOR FREE DETAILED SPEC SHEET
The Most Powerful Disk-Based
Macro Assembler/Text Editor
Available at ANY Price
EASTERN HOUSE SOFTWARE
239 LINDA DR
WINSTON-SALEM. NUC.27106
(919) 924.2889 (919) 748-8446
PAGE 30,
Let me start by saying that | think
the Silentype printer is potentially
one of the most versatile printers on
the market. Most conventional
printers available for the APPLE
control the printer operation via
microprocessors in the printer with
the printer functions coded in
ROM. These instructions that tell
the printer how to operate are hid-
den from the user, and in fact are
unalterable by the user. You can
only do as much as the manufac-
turer will let you do.
The Silentype on the other hand
uses the microprocessor in the
APPLE to control the printer func-
tions with the instructions con-
tained on a ROM on the printer in-
terface card. What this means to the
user is that the hardware functions
of the printer (i.e. moving the print-
head, printing a dot, and advancing
the paper) are all controllable di-
rectly by the APPLE! We are no
longer tied to the software provided
by the manufacturer and are free to
do anything we want within the
mechanical constraints of the
printer mechanism. WOOPIE!
Our only problem now is to find
out how to control the functions of
the printer. Well, APPLE “thought-
fully” didn’t provide any information
on the ROM software or the printer
hardware to allow this. Letters to
APPLE didn’t produce any results
either. Enter Sandy Greenfarb.
Sandy also was trying to get infor-
mation on the printer and obtained
through IAC (International Apple
Core) a 14 page writeup* on how to
move the head and print a dot, and
*See p. 43 Winter Apple Orchard “Inside
the Silentype Firmware”.
===
APPLE ORCHARD
FOR THE SILENTYPE
by Bruce F. Field
Washington Apple Pi
also a little on how the printer char-
acter set is defined and used. Just
what | wanted. The result is the ma-
chine language routine presented
here for printing either Hi-res
graphics screen at double size.
Using the routine is very simple; it
uses the standard Silentype para-
meters to control the printing. You
simply BLOAD the DBL GRAPHICS
routine into memory (it resides from
$300 to $3C7 and so won't conflict
with Applesoft, Integer Basic, or
DOS). You can generate or load
your hi-resolution picture either be-
fore or after loading the DBL
GRAPHICS routine. Then initialize
the Silentype as you would nor-
mally (PR#1 from BASIC if your
printer is in slot 1) and set up the
printer parameters as desired. In-
stead of typing a control-Q to print
the Hi-res screen, from BASIC you
CALL 768 to activate this routine.
The CALL can be placed inside a
program or typed directly from the
keyboard. If you are typing the
CALL from the keyboard and don't
want those words to appear on the
printer, first reset the APPLE output
to the screen (PR#0); the printer
does not have to be “turned on” to
print the graphics.
As it is written, the routine is
slightly slot dependent and assumes
your printer interface card is
plugged into slot 1. It is very easy to
change this if you use a different
slot. The offending byte is at $30F
hex or 783 decimal. This should be
changed to $C0+printer slot (hex)
or 192+ printer slot (decimal). Once
you do this, you can save it back to
disk and not worry about it.
For those of you who are old
hands at the APPLE and know how
SPRING 1981
DOUBLE-SIZE GRAPHICS
the Hi-res graphics screen works,
you can go on to the next article;
otherwise I’m going to try to de-
scribe how the routine works. First
let me air a pet peeve. Most double
size graphics printing routines |
have seen (as for the Paper Tiger)
chop off the sides of the screen
when printed full double size be-
cause the picture is a little too wide
for the printer. This comes about
because the characters on the
APPLE screen are 5 dots wide with
a 2 dot space between them. Forty
characters on the screen means 280
dot positions in the horizontal di-
rection which is exactly the resolu-
tion of the Hi-res screen. Most dot
matrix printers however, print char-
acters 5 dots wide with a one dot
space between. For 80 column
wide printers this means 480 dot
positions, not quite enough to print
the graphics double sized. The ob-
vious solution (at least for me) is to
print the graphics screen sideways
on the printer! The vertical resolu-
tion of the Hi-res screen is 192,
times 2 is 384 which easily fits on a
printer with 480 dot positions. So,
guess which way my routine prints
the screen?
Now that | have that off my chest,
let's dig a little deeper into how the
routine works. A rather poor map of
the Hi-res screen is shown on page
21 of the new APPLE Reference
Manual. (It would be handy to get it
out now for reference.) This map
shows an array of 40 boxes in the
horizontal direction and 24 in the
vertical direction. In the horizontal
direction, each box controls 7 dots
on the graphics screen. As ex-
plained on page 19 of the manual,
bits 0 through 6 control the seven
APPLE ORCHARD PAGE 31
The tricks our IBMS software
can make your Apple* do!
The small businessman has never had itso good, or
so easy. Because now there’s our Interactive
Business Management System (IBMS) . .. which
lets your micro-computer perform’like a larger
unit, so you can mind, monitor and manage every
aspect of your business accounting
A Full System
While it’s extremely easy to use, IBMS jis a full
system to handle the full job. The ten program
modules can generate everything from the
original invoice to the final profit/loss statements,
plus many peripheral operations. The special
Menu includes: System Start-up. Accounts Re-
ceivable. Accounts Payable. Perpetual Inventory.
Payroll. Fixed Assets. General Ledger. Plus Mailing
Labels, and an Appointments Calendar.
Save Maximum Time
Since IBMS is a totally interactive system, multiple-
entering of data is eliminated. Make an entry in
one area and it automatically updates all con-
cerned areas! No duplication of effort, no wasted
time, no problems.
Proven. And then some.
It took 3 years to develop IBMS, including shake-
down and on-site testing. As a result, it’s reliable
and versatile and its documentation is thorough
and easily understandable. No wonder we con-
sider it 5 years ahead of anything else available to
the Apple Il user.
Introductory Offer
The complete IBMS software package, on mini-
floppy disks, documentation, and the backing of
Programma International, Inc. is offered for a
limited time at the Introductory Price of $1495.00.
You'll be amazed how it can satisfy you by
saving you time, effort, money and employee
growth.
The Key toBusiness Management Pues
L
: Kg
PROGRAMMA
PROGRAMMA INTERNATIONAL, INC.
2908 N. Naomi Street, Burbank, Ca 91504
(213) 954-0240
* Apple is a trademark of Apple Computer, Inc.
PAGE 32
dots, with the least significant bit (bit
0) controlling the left-most dot of
the group. In the vertical direction,
things are not organized in an or-
derly fashion. Each box represents 8
bytes in memory, with each byte
corresponding to a different vertical
position on the screen, and the bits
within the bytes controlling the 7
horizontal dots as explained above.
Now let's see if | can straighten all
this out with an example. Suppose
we want to know the address of the
byte that controls the 87th dot from
the left on the 23rd line from the
top of the screen. Twenty-three
divided by 8 is 2, with a remainder
of 7, so we go down to the third ver-
tical box from the top, which has an
address of 8448 (decimal), and we
want the 7th line in that box, which
means we add 6144 to 8448. (We
go to the third box, because box 1
controls lines 1-8, box 2 lines 9-16,
etc., and we use the diagram in the
lower right hand corner to find the
number 6144 to be added to the
base address.) Then we move over
to the right to add in the contribu-
tion of the horizontal position.
Eighty-seven divided by 7 is 12 with
a remainder of 3. So we go over to
the 13th box (which is labelled 12
because the numbering starts with
*
3 x
4 x
3 x
& x
z x
8 x
q x
° x
il x
12 x
13 x
x
15 x
16 x
1 OT
2 Rh,
19 HBASH
20 xO
3 YO
LFMG
23° HPAG
ie
26 FURS
27 SETLFT
28 PRNT
4 FEED
WAIT
31 x
32 *
BY
WASHINGTON APPLE FI
Printer mus
with correc
inverse moder lef
Showing the first 100000 of 320479 characters.