Text content (OCR)
For The Serious User Of Apple ][ Computers
Softkeys For:
DB Master 4.2 & 4+
Computer SAT
Take 1
Bank Street Speller
Carmen Sandiego
Bank Street Writer //c
Word Challenge
Core:
DOS to ProDOS and
back
*. Feature:
tT
Adding ‘‘If Then Else’’
to Applesoft
Hardcore COMPUTIST
PO Box 110846-T
Tacoma, WA 98411
Many of the articles published in Hardcore COMPUTIST detail the removal of copy protection
schemes from commercial disks or contain information on copy protection and backup methods
in general. We
techniques (APT*
to the serious Apple user.
Hardcore COMPUTIS
iso print bit copy parameters, tips for adventure games, advanced playing
s) for arcade game fanatics and any other information which may be of use
also contains a special CORE section which focuses on information
not directly related to copy protection. Topics may include, but are not limited to: tutorials.
hardware/software product reviews and app
What Is A Softkey Anyway? Softkey is a term
which we coined to describe a procedure that removes,
or at least circumvents, any PY protection on a
particular disk. Once a softkey procedure has been
performed, the resulting disk can usually be copied by
the use of Apple's COPYA program (on the DOS 3.3
System Master Disk).
Commands And Controls: In any article appearing
in Hardcore COMPUTIST, commands which a reader
is required to perform are set apart from normal text by
being indented and bold, An example is:
PRI
Follow this with the RETURN key, The RETURN key
mist be pressed at the end of every such command unless
otherwise specified
Control characters are indicated by being boxed. An
example iy
6(P)
To complete this command, you must first type the
number 6 and then place one finger on the CTRL key
and one finger on the P key.
Requirements: Most of the programs and softkeys
which appear in Hardcore COMPUTIST require one of
the Apple || series of computers and at least on disk drive
with DOS 3.3. Occasionally, some programs and
procedures have special requirements. The prerequisites
for deprotection techniques or programs will always be
listed at the beginning of the article under the
*Requirements:"* heading
Software Recommendations: ‘The following pro
gfams (or similar ones) are strongly recommended for
readers who wish to obtain the most benefit from our
articles
1) Applesoft Program Editor such as Global Program
Line Editor (GPLE)
Sector Editor such as DiskEdit, ZAP from Bug of
Tricks or Tricky Dick from The CIA
3) Disk Search Utility such as The Inspector, The
‘Tracer from The CIA or The CORE Disk Searcher
4) Assembler such as the S-C Assembler or Merlin/Big
Mac
5) Bit Copy Program such as Copy j[ Plus. Locksmith
or The Essential Data Duplicator
‘Text Editor capable of producing normal sequential
text files such as Applewriter }]. Magic Window JI
or Sereenwriter |
You will also find COPYA, FID and MUFFIN from
the DOS 3.3 System Master Disk useful
Super IOB: This program has most recently appeared
in Hardcore COMPUTIST No. 22. Several softkey
procedures will make use of a Super 1OB controller, a
small program that must be keyed into the middle of
Super IOB. The controller changes Super [OB so that
it can copy different disks. To get the latest version of
this program, you may order Hardcore COMPUTIST
No, 22 as a back issue or order Program Library Disk
No; 22.
RESET Into The Monitor: Many softkey pro-
cedures require that the user be able to enter the Apple's
system monitor during the execution of a copy protected
program. Check the following list wo see what hardware
you will need to obtain this ability
Apple }[ Plus - Apple //e - Apple compatibles: |) Place
an Integer BASIC ROM card in one of the Apple slots
2) Use a non-maskable interrupt (NMI) card such as
Replay or Wildcard
‘Apple |[ Plus - Apple compatibles: |) Install an F8 ROM
with a modified RESET vector on the computer's
2
motherboard as detailed in the "’ Modified ROM’s” artic
‘of Hardoore COMPUTIST No. 6 or the "Dual ROM’
article in Hardcore COMPUTIST No. 19.
Apple //e - Apple //e: Install a modified CD ROM on
the computer's motherboard. Don Lancaster's company
(Synergetics; 746 First Street; Box 809-HC; Thatcher.
AZ 85552; free voice HelpLine 602-428-4073) sells the
instructions necessary to make this moxlification. Making
this modification to an Apple //c will void its warranty
but the increased ability to remove copy protection may
justify it
Recommended Literature: ‘The Apple I Reference
Manual and DOS 3.3 manual are musts for any serious
Apple user. Other helpful books include: Beneath Apple
DOS, Don Worth and Peter Leichner, Quality Software,
$19.95: Assembly Language For The Applesoft
Programmer, Roy Meyers and C.W. Finley, Addison
Wesley, $16.95; and What's Where In The Apple.
William Lubert, Micro Ink.. $24.95.
Keying In Applesoft Programs: BASIC programs
are printed in Hardcore COMPUTIST in a format that
is designed to minimize errors for readers who key in
these programs, To understand this format. you must
first understand the formatted LIST feature of Applesoft
An illustration- If you strike these keys:
10 HOME:REMCLEAR SCREEN
4 program will be stored in the computer’s memory
Strangely, this program will not have a LIST that is
exactly as you typed it. Instead. the LIST will look like
this
10 HOME : REM CLEAR SCREEN
Programs don’t usually LIST the same as they were
keyed in because Applesoft inserts spaces into a program
listing before and after every command word or
mathematical operator. These spaces usually don’t pose
problem except in line numbers which contain REM
or DATA command words, The space inserted after these
‘command words can be misleading. For example, if you
want a program to have a list like this:
10 DATA 67,45,54,52
you would have to omit the space directly after the DATA
‘command word. If you were to key in the space directly
after the DATA command word, the LIST of the program
would look like this:
1 DATA 67,45,54,52
This LIST is different from the LIST you wanted. The
number of spaces you key after DATA and REM
command words is very important
All of this brings us to the Hardcore COMPUTIST
LiSTing format. Ina BASIC L1STing. there are two types
‘of spaces: spaces that don’t matter whether they are keyed
‘or not and spaces that must be keyed. Spaces that must
be keyed in are printed as delta characters (4). All other
spaces in a Hardcore COMPUTIST BASIC listing are
put there for easier reading and it doesn’t matter whether
you type them or not
‘There is one exception: If you want your checksums
(Sce “Computing Checksums™ section) to match up. you
must not key in any spaces after a DATA command word
unless they are marked by delta characters.
Keying In Hexdumps: | Machine language programs
are printed in Hardcore COMPUTIST as both source
code and hexdumps. Only one of these formats need be
keyed in to get a machine language program. Hexdumps
are the shortest and easiest format to type in.
‘To key in hexdumps. you must first enter the monitor:
CALL -151
Now key in the hexdump exactly as it appears in the
magazine ignoring the four digit checksum at the end
of each line (a “*$"" and four digits). If you hear a beep.
you will know that you have typed something
incorrectly and must retype that line
When finished. return to BASIC with a
E@3
Remember to BSAVE the program with the correct
filename, address and length parameters as given in
the anticle.
Keying In Source Code The source code
portion of a machine language program is provided
‘only to better explain the program's aperation, If you
wish to key it in, you will need an assembler. The
S-C Assembler is used to generate all source code
printed in Hardcore COMPUTIST, Without this
assembler, you will have to translate pieces of the
source code into something your assembler will
understand. A table of S-C Assembler directives just
for this purpose was printed in Hardcore
COMPUTIST No. 17. To translate source code. you
will need to understand the directives of your
assembler and convert the directives used in the
source code listing to similar directives used by your
assembler.
omputing Checksums Checksum are four
digit hexadecimal numbers which verify whether or
not you keyed a program exactly as it was printed
in Hardeore COMPUTIST. ¢ Iwo types of
checksums: one created by the CHECKBIN program
(for machine language (programs) and the other
created by the CHECKSOFT program (for BASIC
programs). Both programs appeared in Hardcore
COMPUTIST No, | and The Best of Hardco
Computing. An update to CHECKSOFT appeared
in Hardcore COMPUTIST No, 18, If the checksums.
these programs create on your computer match the
checksums accompanying the program in the
magazine. ther od in the program correctly
If not, the program is incorrect at the line where the
first checksum differs.
1) To compute CHECKSOFT checksums:
LOAD filename
BRUNCHECKSOFT
Get the checksums with
«
And correct the program where the checksums differ
2) To compute CHECKBIN checksums
CALL -151
BLOAD filename
Install CHECKBIN at an out of the way place
BRUN CHECKBIN,AS6000
Get the checksums by typing the starting address
4 period and ending address of the file followed by
By y
xxxax(¥)
And correct the lines at which the checksums difter
How-To's
Of Hardcore
Welcome to Hardcore COMPUTIST, a
publication devoted to the serious user of
Apple [ and Apple |[ compatible computers.
Our magazine contains information you are
not likely to find in any of the other major
journals dedicated to the Apple market.
Our editorial policy is that we do NOT
condone software piracy, but we do believe
that honest users are entitled to backup
commercial disks they have purchased. In
addition to the security of a backup disk,
the removal of copy protection gives the user
the option of modifying application
programs to meet his or her needs,
New readers are advised to read this page
carefully to avoid frustration when
attempting to follow a softkey or when
entering the programs printed in this iss
DEAD OR ALIVE
The Most Wanted List comes alive as separated posters scattered through the pages of
the COMPUTIST. We're not just wasting space, we're offering bounties! You'll see
lots of WANTED posters with publicly announced REWARDS for softkeys to certain
not-yet-unlocked software! Be a bounty hunter and earn your rewards now by
becoming a hard-core COMPUTIST softkey author.
TIME TO RENEW?
Check your mailing label to see if you need to renew your subscription. And if you think
you might forget when that fatal time arrives, renew right now. Just use the order blank
below
BACK IT UP OR BUST
If you aren't a subscriber, then maybe you need to find out more about the plague of
copy-protection that is turning your valuable software library into a collection of
inpenetrable, mysterious black boxes that stop working at the wrong times when the nearest
backup is weeks and dollars away
NEW SUBSCRIBERS!
You've just joined the ranks of concerned software users who are ensuring that the software
they use is copy-corrected, copyable, and user-useful. No need to depend on the inflated
back-up costs charged by the makers of your software, make your own back-up, and
even remove the often time-consuming boot-up delays caused by copy-protection. In
other words, Welcome aboard. You'll find every issue packed with softkeys, hardcore
user and programmer articles, and even some relaxing entertainment.
IF YOU’RE MOVING...
Let us know right away or at least 30 days in advance so that you won't miss a single
issue. Just Write your new address here, and paste your present address label in the
order form below and send it to us
My new address is
City — State Zip__
Phone
All purpose Subsciption, Renewal, change-of-address, and survey form
Name
Address
City
Phone
Signature
VISA/MC - = = Exp.
Send check or money order (US funds drawn on US bank) to:
Hardcore COMPUTIST, PO Box 110846-T, Tacoma, WA 98411
USER SURVEY
OC | Love Copy-protection
and | hope that you
naughty hackers stop
publishing your rag!
CI want to make legitimate
copies of the software
that | own but | am
unable to do so.
C) | want to get rid of any
and all computer code
that prevents me from
using my property the
way | want to use it.
0 | hate Copy-protection
and will do anything in
my power to get rid of
this scourge.
OO I find that locked-up
disks present an
intellectual challenge
and user-barrier that |
must overcome.
| am a software pirate.
(J RENEW subscription
() NEW subscriber
SUBSCRIPTION RATES:
(for 6 issues)
0 US $20
US 1st class $24
() Canada, Mexico $34
XO) Foreign $60
SAMPLE COPY:
0) US $4.75
0 Foreign $5.75
Christrume Speeiets.
$5 |
Volume |
The Book of Softke
This coupon is valid only for current subscribers of Hardcore COMPUTIST.
This coupon can be applied to the purchase of the product named, resulting
in $5 off the current price only. Expires December 31, 1985
see advertisement on the back cover
$5 OFF $5
The Best of Hardcore Computing
This coupon is valid only for current subscribers of Hardcore COMPUTIST.
This coupon can be applied to the purchase of the product named, resulting
in $5 off the current price only. Expires December 31, 1985
see advertisement on the inside of the back cover
§
SPSS CPS CPST CRS PSPS PS PIS TS RSS A,
$2 OFF $2
The Diskbusters T-shirt
This coupon is valid only for current subscribers of Hardcore COMPUTIST.
This coupon can be applied to the purchase of the product named, resulting
in $2 off the current price only. Expires December 31, 1985
ae
=>
a
a
Qo
. oS
S
wo
Qa
So
3
mo)
i —
=
m1) 2
=
a
=]
b= *)
ty
—
So
wm
a
wm
See the adversoment on the | inside of the back cover
3
for
This coupon is valid only for current subscribers of Hardcore COMPUTIST.
This coupon allows you to purchase three (3) Hardcore Computist Library
disks for only $20. Expires December 31, 1985
___ see advertisement on page 32
OS CE COR RY CS COR CAS CS CR OPS CPS CO OS OF
r
IF
you’re a
subscriber,
THEN
you can
SAVE
lots of $$$
ELSE
sorry,
no savings
on
You can
, subscribe!
INSTRUCTIONS TO SUBSCRIBERS
Just include these coupons with your
regular order (see appropriate
advertisement in this or last issue) along
with your subscriber number or mailing
sticker and deduct the appropriate
savings. These coupons are good till the
end of 1985, so if you're not yet a
subscriber, or you forgot to renew, use
the form on page one and you'll be a
subscriber, too. Then you, too, can take
advantage of these holiday savings!
country of
Rwanda, ha
population of
Harketplace Depart by plane
Hotel igate
Library Visit Interpol
This month's cover: Graphics from DLM’s Shape & Color
Rodeo.
Address all advertising inquiries to Hardcore COMPUTIST,
‘Advertising Department, PO Box 110816, Tacoma, WA 98411
‘Mail manuscripts or requests for Writer's Guides to Hardcore
COMPUTIST, PO Box 110846-K, Tacoma, WA 98411
Return postage must accompany all manuscripts, drawings
photos, disks, or tapes if they are to be returned. Unsolicited
manuscripts will be returned only it adequate return postage Is
included
Entire contents copyright 1985 by SoftKey Publishing. All
rights reserved. Copying dane for other than personal or internal
reference (without express written permission from the publisher)
‘The editorial stat! assumes no lability oF responsibilty for the
products advertised in the magazine. Any opinions expressed
by the authors are not necessarily those of Hardcore
COMPUTIST magazine or SoftKey Publishing
‘Apple usually refers to the Apple or I{ Plus Computer, and
‘is a trademark of Apple Computers, Inc.
SUBSCRIPTIONS: Rates (for 6 issues): U.S. $20, U.S. 1st
Class $24, Canada & Mexico $34, Foreign $60. Direct inquiries
to: Hardcore COMPUTIST, Subscription Department, PO
Box 1108467, Tacoma, WA 98411. Please include address
label with correspondence.
DOMESTIC DEALER RATES: Call (206) 474-5750 for more
information.
Change Of Address: Piease allow 4 weeks for change of
address to take effect. On postal form 3576 supply your new
address and your mast recent address label. \ssues missed due
to non-receipt of change of address may be acquired at the
regular back issue rate
Hardcore Issue 25
COM PUTIST
Publisher/Editor: Charles R, Haight Managing Editor: Ray Darrah
‘Technine Raion Reben Keowies Chreaiaton’ Mite Fria Deste Kova
‘Advertising: (206) 474-5750 Printing: Valco Graphics Inc., Seattle, WA
Hardcore COMPUTIST is published monthly, except December, by SoftKey Publishing, $233 S. Washington, Tacoma, WA 98409
Phone: (206) 474-5750
softkeys
10 DB Master 4.2 and Business Writer
Super IOB comes through again by softkeying these Stoneware programs by Clay Harrell
12 Another DB Master 4+ deprotection
With this article, you are invited to take another look at the popular data base program used
by several small businesses by Anthony L. Barnett
13 Barron’s Computer SAT
Start studying now for the Scholastic Aptitude Test with your freshly broken copy of Barrons
Computer SAT, compliments of Hardcore COMPUTIST & Super IOB. by Glenn Schmottlach
14 Takei
Take actions toward the removal of copy protection from this graphic program.
by Clay Harrell
24 Bank Street Speller
Use the built-in copy program of this popular spelling checker to make as many copies as
you need. by Jeff Lucia
25 Where in the world is Carmen Sandiego?
Follow Hardcore COMPUTIST as it tears into the copy protection on this recent Broderbund
release. by Ronald Wilson
26 Bank Street Writer 128K (//e & //c)
‘The gigantic softkeying machine crunches yet another version of this popular word processor.
by Jordi Le Vant
28 Word Challenge
Hayden's Word Challenge proves to be no challenge to Super IOB. by Larry Jasonowicz
feature
20 Adding “If Then Else” to Applesoft
Give your Applesoft programs a third decision making choice, use ELSE statements with
this article by John R. Vokey
Core
16 DOS to ProDOS and back
This single drive solution to inter-DOS file transfer uses a specially created diskette that
contains directories for both DOSes by Brian K. Chinn
departments
4 Input
6 Most Wanted List
7 Readers’ Softkey & Copy Exchange
Softkeys for: Penguin's Spy’s Demise by Danny Pollak, Human Edge’s Mind Prober
by Michael A. Coffey, Sierra On-Line’s BC’s Quest for Tires by Danny Pollak, DLM's
Early Games by Greg Prior, Sierra On-Line’s Homeword Speller by Nick Galbreath.
imp ut
a er
Please address letters to:
Hardcore COMPUTIST
Editorial Department
PO Box 110846-K
Tacoma, WA 98411
Include your name, address and
phone.
Correspondence appearing in the
INPUT section may be edited for
clarity and space requirements. In
addition, because of the great
number of letters that we receive and
the small size of our staff, a response
to each letter is not guaranteed.
Squire Meets Millionaire
Mr. A. L. Head's letter on deprotecting
Millionaire in Hardcore COMPUTIST No. 21
gave me the clue I needed to deprotect Squire
and Baron. The necessary information is
contained in the Basic file CDIINC. The file
CDIINC contains inverse characters after each
non-inverse letter. (Inverse C follows C,
Inverse D follows D, etc.) By reading this file
with Copy ]{ Plus, I discovered that Squire
requires a MAXFILES 5 command, followed
by BRUN SQROOT.X, and that Baron uses
MAXFILES 6, followed by RUN
BARINIT.BAS.
Baron Step By Step
1) Init 2 sides of a disk with a Basic program
named HELLO.
2) Load the system master, type NEW, and
enter the following program:
10 PRINT CHR$(4) "MAXFILES 6”
20 PRINT CHRS(4) "RUNBARINIT BAS”
3) Insert the front side of your previously
INITted disk.
4) SAVE HELLO.
5) Using Fid or Copy I+, copy all files except
ENTRA, CON, and CDIINC.
6) Turn the initted disk over and copy all files
from the second side.
Squire Step by Step
To deprotect Squire follow steps 1-6, except
that the HELLO program in step 2 should read
as follows:
10 PRINT CHRS(4) “MAXFILES 5"
20 PRINT CHRS(4) "BRUNSQROOT BAS”
Also, most EDUWARE programs can be
deprotected using SUPER IOB 1.5 with the
NewSwap controller installed. Except for
Rendezvous, the copied programs will run
without further alteration,
Charles Taylor
Los Angeles, CA
Spiradisk Info
with a short program or something to set the
clock. Any help or information would be greatly
appreciated. Thanks for any help. Keep up the
good work with the best magazine available to
the Apple user.
Greg Poulos
Detroit, MI
Mr. Poulos: While I cannot offer you a program
for setting your clock, 1 can offer some
information. First of all, to turn off the other
cards and turn on your mountain card, do an
“X = PEEK (53247) + PEEK (49152 + SLOT
256) where SLOT is equal to the slot where
your card is. You must then POKE the values
for the time you want into memory addresses
38304 ($950) through 38315 ($95AB) and do
@ “CALL 38316".
Responding to my article in Hardcore
COMPUTIST No, 21 on quarter tracks, M. M.
McFadden informed me of the existence of the
so-called “‘spiradisk’® that uses quarter-track
increments for track arcing. By obtaining a copy
of such a disk (Frogger by Sierra ON-LINE)
I was able to verify that he was right. Since
parameters using quarter tracks can only copy
disk data that is a half-track apart, the
“‘spiradisk"’ cannot be copied by the current bit-
copiers. Fortunately, the new Apple //c
hardware implements a delay between
commands to the stepper magnets which
Prevent one from accessing quarter tracks
accurately. Thus the **spiradisk’* has gone the
way of DOS 3.2, thank goodness. Please refer
to my article in Hardcore COMPUTIST No.
21 for more information on quarter tracks.
Bruce W. Jones
Pueblo, CO
Setting a Mountain Clock
A year and a half ago, before I moved to
Brazil, I purchased a Mountain Clock Card for
my Apple //e. I got this on sale and it came with
no software to set the date and time. I have had
it all this time with the wrong date and no way
to set it. Does anyone know how to set this
clock? And, if so, put a letter in this column
4 Hardcore COMPUTIST No. 25
Handling the New Handlers
In partial reply to Michael Mullin’s problems
with The Handlers; a letter to ALS at 1195 E.
Arques Ave, Sunnyvale, CA 94086 and a check
for $15.00 sent with his old Word Handler disk
will get him an updated version of that great
litle word processor. The new version is
copyable with Copy }/ Plus v5.0 with the built-
in auto-copy routine. He may want to call
technical assistance at 1-408-730-0307 between
9:00 and 3:00 to get authorization to have the
whole Handlers package updated
If he gets the new package he will find a new
“Tutorial Disk’. When he boots the backside
called, **Tutorial Documents'’, he will get a
utility to convert the proprietary files to DOS
3.3 text files for transmission by modem.
Keep the magazine coming. Right now | am
especially enjoying the Graphic Grabber v3.0
from Hardcore COMPUTIST Issue No. 20.
Lots of great programs and tips.
P.S. I am still looking for help making
backup copies of Milliken Comprehensive
Power Programs and Borg Warner's College
Entrance Exam Preparation
D. J. Ward
So. Williamsport, PA
Mr. Ward: Joel Huse’s article on backing up
the College Entrance Exam Prep in Hardcore
COMPUTIST No. 21 might be what you're
looking for.
imput
2 a ne a SSS SSS SSS SS SS ND
A Nutritional Softkey
The following is a softkey for The Dine
System, by D. Dennison, 724 Robin Rd, West
Amherst, NY 14228, (716)688-2492.
This is a nutritional plan which is designed
to improve personal eating behavior, with an
extensive database of over 3500 foods including
many brand name items. It is an excellent
program, but I desired to modify the basic
program to include more factors in determining
daily nutrient requirements. The program disk
is copyable with a bit copier, but the program
cannot be accessed normally.
Using Softmove, a utility which comes with
the Replay II card, I was able to move the
Applesoft program to standard DOS 3.3.
Listing this program allowed me to discover the
protection used. There is an additional catalog
on track 10, which is accessed by 3 POKE
statements:
POKE 44033,10
POKE 47445,176
POKE 47455,213
After making these pokes in DOS 3.3,
LOAD each file from the program disk, return
the addresses to their normal values:
POKE 44033,17
POKE 47445,213
POKE 47455,170
and SAVE the file onto another formatted disk
with a normal DOS 3.3 or fast DOS on it.
Then, as you make your modifications to
Dine, modify all pokes to these addresses to the
normal values given above.
T hope this may be useful to someone who
needs to modify this already good program.
Jason Chao, MD
Cleveland Hts., OH
A Mickey Mouse Protection
Mickey's Space Adventure by Walt Disney
and Sierra On-line is a game designed for
beginning adventurers (especially kids), giving
the player options to select instead of the
standard, two-word input style.
The disk can be copied normally except that
the program doesn’t quite run. After going
through a title page and quite a bit of disk
reading, a copy of the program will jump into
the monitor at $1702. It sure takes its time
before deciding that it is a copy.
However, the copy protection is really quite
minimal. By booting Dos 3.3 from a normal
disk, Mickey's Space Adventure can be
CATALOGed. (Which is only the beginning of
the simple-mindedness of their protection.)
In the catalog is an Applesoft program with
the very suspicious title of BOOT. By loading
this program I found that it ran MICKEY-
CODE at $4000.
I typed MONICO (so that DOS commands
will be echoed to the screen) and ran BOOT.
The computer obligingly displayed each loaded
Program module and, in most cases, even
showed where in memory it was loaded. Since
MICKEY-CODE was the only BRUN program
(all others were BLOADed) I started my search
there.
At $4000 there was a JSR (jump subroutine)
to a routine that displayed a ‘PLEASE WAIT”
type message, BLOADed the other modules and
kindly returned to where it came from. The
main routine then set up some pointers and
such, called a routine at $1572 (which I
considered very close to where the whole thing
blew up when booting) and then jumped
somewhere.
I removed the JSR $1572 with NOP (no
operation) instructions and gave it a 4000G from
the monitor. The program loaded without any
trouble. Apparently the subroutine at $1572 did
some nibble counting on the data that normally
brought the boot process to a grinding halt.
Step By Step
1) Copy Mickey's Space adventure with
COPYA.
2) Boot DOS 3.3.
3) LOAD BOOT from the copied Mickey's
Space Adventure.
4) CALL -151 to enter the monitor.
5) 4014:EA EA EA to remove the subroutine
6) BSAVE MICKEY-CODE, A$4000, L9728.
That's it!
Gary Kowalski
Anaheim, CA
P.S. My vote is to keep Hardcore
COMPUTIST for the Apple ]{ family only. Too
many magazines allocate space for the MAC.
There already are magazines for the MAC and
more will spring up.
A Quick Pop Into the Monitor
I love your magazine. I'm sending money to
renew my subscription. You can reset into the
monitor on any apple by using a 100 ohm
resistor and connecting it to pins 26 and 29 of
any slot. This causes an NMI.
Brian Snook
Riverside, CA
Running the CIA on a //c
We advertise a product called the CIA with
your magazine and have done so, for quite some
time now. It has come to our attention that a
small patch is necessary to run the CIA on the
Apple //c.
‘The patch is given below in the hope that you
may print it as a press release in Hardcore
COMPUTIST. This would benefit many of
your readers who have ordered the CIA from
us over the past year or so.
TRICKY DICK:
If program is in memory, change:
B1 to 68 at $1302
If program is on disk, change:
B1 to 68 at Track 15 Sector 05 Byte 03
TRACER:
If program is in memory, change:
50 to 70 at $8980
If program is on disk, change:
5@ to 70 at Track 1B Sector @9 Byte 87
Many thanks in advance.
Golden Delicious Software
Chelsea, England
Hardcore COMPUTIST No. 25 5
Know of any Knowdrive
Prospects?
In Hardcore COMPUTIST No, 20, you have
a review of a 128K memory board called **The
Know Drive”. In this review it was stated that
you can get them for less than half-off by getting
a user group buy together. Well, I tried to do
this at my local user group, but only a few were
interested. Therefore, I was wondering if you
knew of anybody who is getting a large buy
together? If so, please give me their names and
addresses, or you can give them mine. If you
don't know of any, then please put my name
and address in your magazine and I will try to
put a buy together.
Also, I have been looking for information on
X and K modem protocols but haven't seen a
thing. (These are standards in which computers
send files over modems). If you people know
or can find out about them, why don’t you write
an article about them in the core section?
Finally, here are a few adventure tips for you
on The Dark Crystal:
Locked gate giving you a problem, Fizgig
does more than grrrr.
Riddle troubles, moss covered rocks help.
Sharp rocks are a big help to get things
floating along.
Richard Blair
12252 Manning Place
Medway, OH 45341
Various Cracks
Here's a few programs that I have cracked.
You might want to pass them on to your
readers.
DINOSAUR DIG
by CBS
Use SWAP controller or do a CALL-151,
B942:18 and copy with COPYA.
OPERATION FROG
by SCHOLASTIC
Same as DINOSAUR DIG.
STELLAR DEFENSE
by RAINBOW COMPUTING
To copy this popular Star Trek game, first
copy nomally with COPYA or LS fast copy.
1) Boot the copy, immediately hit or
reset.
2) LOAD the program called ‘*‘DRIVER”™ into
memory.
3) LIST line 506 of DRIVER, it should
read: CALL 15953.
4) Type in 506 and hit return to erase this line
from the program.
5) SAVE DRIVER back to the disk.
You are now the proud holder of an
unprotected copy of Stellar Defense.
MAGIC SLATE
by SUNBURST
To back up this very good word processor,
use Copy }] Plus v5.0. Now go back and BIT
COPY Track 1 keeping the track length.
William Forsyth
New York, NY
The Quicker Aux
A few issues ago, a method was. for using
the Apple extended 80-column card on an Apple //e
for cracking. The article used several small
to manipulate the auxilary memory. However, it is
much easier to do this:
1) Boot Dos 3.3
2) Type
CALL -151
@:8D 63 CO 8D 0S CO 4C 00 C6
3) Insert disk to boot.
4) Type
0G
When the disk is done booting insert a normal DOS
disk and hit (4 reset. Next, drop into the monitor
(CALL -151) and type this:
300:18 4C 11 C3 3F8:4C 00 03
This causes the to move auxilary memory
into main memory. Now type
800<9600.BFFF (OY)
This moves the DOS and RWTS into main
memory starting at $800.
Steve Dietz
Arlington, TX
6 Hardcore COMPUTIST No. 25
Most
Wanted
List
Need help
backing-up a particularly
stubborn program?
Send us the name of the program and its
manufacturer and we'll add it to our Most
Wanted List, a column (updated each issue)
which helps to keep Hardcore COMPUTIST
readers informed of the programs for which
softkeys are MOST needed. Send your
requests to
Hardcore COMPUTIST
Wanted List
PO Box 110846-K
Tacoma, WA 98411
If you know how to deprotect
unlock, or modify
any of the programs below,
let us know. You'll be helping your fellow
Hardcore COMPUTIST readers and earning
MONEY at the same time. Send the
information to us in article form on a DOS
3 diskette
Mouse Cale Apple Computer
Apple Business Graphics Apple Computer
Flight Simulator It Sub Logic
Factory Sunburst Communicating
Jane Arktronics
Bookends Sensible Software
Visiblend Microlab
Sundog FTL Games
Sundog, V2 FTL
Lifesaver Microlab
Catalyst Quark. Inc
Gutenburg Jr. & Sr. Micromation LTD
Prime Plotter Primesoft Corp.
Zardax Computer Solutions
The Handlers Silicon Valley Systems
Milliken Math Series (NEW) Milliken Publishing
‘The Apple's Core: Parts 1-3. The Professor
King’s Quest Sierra On-line
Hayes Terminal Program Hayes
Fun Bunch Unicorn
nes
readers’ softkey & copy exchange
Danny Pollak’s Softkey for...
| Spy’s Demise
Spy’s Demise
Penguin Software
830 Fourth Ave.
P.O. Box 311
Geneva, IL 60134
Requirements:
Apple }[ Plus or equivalent
A blank initialized DOS 3.3 disk
Spy's Demise
Spy’s Demise is a game from Penguin
Software in which you, the spy, must traverse
the floors of the diplomatic mission in
Pyongyang and gather pieces to a message
which is the key to a fortune in valuable
computer data.
The program occupies tracks 0 through 12
with alternating address headers of DS AA 96
and D4 AA 96. We can use a boot trace to load
in the entire file and then exit to the Monitor.
Here's how it is done.
The first thing we need to do is to load in
Boot! from the Spy’s Demise disk and then re-
enter the monitor. Insert the Spy's Demise disk
into drive 1 and then enter the following:
CALL-151
9600<C600.C700M
96F A:98
9801:4C 59 FF
9600G
Boot! has now been loaded into page 8 of
memory. We will now alter our code at $9600
so that it will load Boot! at $1800 and jump
to the Boot! at $800.
9659:18
96FA:08
If we examine the code starting at $801, we
see that it loads some code into memory, sets
up the reset vector, loads the x-register with the
value stored at $2B (slot number times 16) and
then jumps to the load routine at $B700. We
can alter this code so that it will exit to the
Monitor before jumping to the routine at $B700.
80C:90
84D:FF
84F:59
8A4:4C 59 FF
9600G
If we now examine the code at $B700, we
see a jump to $6000 at $B734. Alter this code
AN
alt
|
il
Hil
so that it will exit to the Monitor instead of
jumping to $6000 by entering
B734:4C 59 FF
Load the x-register with $60 and execute the
code at $B700 by entering
The rest of the program should have been
loaded and you should now be in the Monitor
The program resides in memory from $4000
to $8DFF. We will fill memory from $8E00
to 8EFF with $00’s and save this extra page of
memory with the program. The extra sector that
results in our binary file will be used to store
the high scores. Boot the initialized disk and
then enter the following:
CALL-151
3F04:AD EC B7 8D
3F08:EE 88 AD ED B7 8D EF 80
3F10:AD 50 CB AD 52 CO AD 55
3F18:CO AD 57 CO 4C 00
8E00:00
8E01<8E00.8EFEM
80D4:20 0@ BD 60
BSAVE SPY’S DEMISE,A$3F04,L$4FFB
And there you have it. A completely
unprotected copy of Spy’s Demise. Here are
a couple of APTs you can use.
Start with any number of spies:
6@AB:(number of men)
Infinite number of spies:
6D8A:EA EA
These are neither all of the APTs, nor are
they the best. Have fun finding your own and
good luck on decoding the message. é
Michael A. Coffey’s Softkey for...
Mind Prober
Mind Prober
Human Edge Software Corp.
2445 Faber Place
Palo Alto, CA 94303
$49.95
Requirements:
Apple J[
COPYA or Super IOB
Both sides of a blank disk
Mind Prober disk
Mind Prober is a fascinating research based
program that provides you with a profile of a
person. The outcome of the profile depends on
your accuracy in answering the questions. The
results can leave you confounded in their
preciseness or seem so far out of line so as to
be laughable. In using the program, my subjects
felt that most of the conclusions were correct,
sometimes to the point of being frightening. I
suspect that it is the use of the program on those
you don’t know well, or those who lie when
answering the questions that accounts for the
occasional ‘‘it's only a party game"’ attitude.
One fault I have with the program is the
$9.95 charge to provide you with a backup.
Since I’d rather make my own anyway, I set
about to do so. The program appears to be
protectionless, and none of the popular bit
copiers seem to work. Nevertheless a backup
can be made can be made with little trouble
following these steps:
1) Make a copy of both sides of Mind Prober
using either COPYA or Super IOB with the
standard controller
2) The turnkey program is called HELLO and
it is this we must modify. Under normal DOS
and side one of the copy of the drive, type
UNLOCK HELLO
LOAD HELLO
3) Get rid of all the lines before 4000 by typing
DEL 3012,3060
4) Save and lock the new program.
SAVE HELLO
LOCK HELLO
You now have an enjoyable and deprotected
disk. Happy profiling
Hardcore COMPUTIST No. 25 7
readers’ softkey & copy exchange
‘ ;
ey : {| b i
z uy)
a
Danny Pollak’s Softkey for...
BC’s Quest
For Tires
B.C.'s Quest For Tires
Sierra On-Line, Inc
10398 Rockingham Dr., Ste. 12
Sacramento, CA 95827
$34.95
Requirements
48K Apple }[
B.C."s Quest For Tires
A blank disk
B.C. "s Quest For Tires is a game from Sierra
On-Line. Unfortunately, like their other
software, B.C.'S Quest For Tires is copy
protected. I have not been fortunate enough to
see the **Sierra On-Line softkey"? which I have
seen mentioned in several of the latest issues
of Hardcore COMPUTIST. For that reason
here is my method of breaking Quest For Tires.
The copy protection used on B.C."s Quest
For Tires is the same as that on the other games
by Sierra On-Line I have seen, Hopefully, this
method can be used to unlock other Sierra On-
Line software.
1) Prepare a slave disk with a deleted HEL
program. If you want, use the name BC
QUEST FOR TIRES.
INIT HELLO
DELETE HELLO
2) Boot the original B.C."s Quest For Tires
disk. When the prompt appears. hit the reset
key (you have to be fast). If this does not put
you into Applesoft, then repeat step 2 until you
do get in
3) Get some of the code from the disk and move
$800-8FF out of the way
BLOAD X,A$4000,L$2000,BSOB0@
BLOAD Y,A$0800,L$3800,B30708
CALL-151
6000<800.8FFM
4) Insert your initialized disk in drive one and
reboot
PR#6
5) Restore $800-8FF and save to the new disk
CALL-151
800<6000.60FFM
BSAVE XY,A$800,L$5800
6) Repeat step 2
7) Get some more code from Quest For Tires.
BLOAD Z,A$6000,LS3A00,BS0300
8 Hardcore COMPUTIST No. 25
CALL-151
1600<9600.99F FM
BLOAD W,A$2000,L$4000,BSOD00
8) Insert your initialized disk in drive one again
PR#6
9) Type in the following
BSAVE W,A$2000,L$4000
MAXFILES1
CALL-151
9600< 1600.19FFM
BLOAD XY
TFD:4C FS5 19
97A0;AD 55 CO 20 A9 97 4C CA
97A8:97 AO 00 B9 B7 97 20 ED
97B0:FD C8 CO 10 DO F5 60 8D
97B8:84 C2 CC CF Cl C4 AO C2
97C0:C3 AE C8 C9 C7 C8 8D
97CD:4C EB 97
97E8:EA EA EA
10) Tell DOS to allow binary files up to $F
in length so you can save a huge file
A964:FF
BSAVE BC.OBJ,A$7FD,LS9203
11) Hang in there, you're nearly done. Type
in the following
BLOAD W
2031:4C DF 20
20AA; 20 BO 20 4C DF 20
2080;A0 00 B9 BE 20 20 ED FD
20B8:C8 CO 1C DO F5 60 84 C2
2000:03 Cl D6 C5 C2 C3 AE C8
20C8:C9 C7 C8 AC Cl A4 B2 BO
2000;80 BO AC CC A4 B4 BO BO
2008.80 8D
20EC:A9 19 8D 86
20F0:1C AI 1A 8D 06 IC
BSAVE BC.HIGH,A$2000,L$4000
11) Enter this Applesoft program
FP
10 DS = CHRS( 13) + CHRS( 4)
20 HGR ; POKE -16302 0
30 PRINT DS "MAXFILES1"
40 PRINT DS "BRUN* BC OBJ"
SAVE BC’S QU | FOR TIRES
12) Delete the extra files you made. leaving
only BC’S QUEST FOR TIRES, BC.OBJ. and
BC.HIGH
Now you are off and rolling with a totally
unprotected version of B.C."s Quest For Tires,
You can also put the files on your favorite game
disk. A fast DOS will help immensely
readers’ softkey & copy exchange
Greg Prior’s Revisted Softkey for...
3
DLM Software
Development Learning Materials
1 DLM Park
Allen, TX 75002
Requirements:
Apple ][ Plus or equivalent
Minus Mission or Meteor Multiplication
Super IOB v1.2
A blank disk
In Hardcore COMPUTIST No. 13, a DLM
softkey appeared that doesn’t seem to work on
the new releases of DLM software. Could it be
that DLM might have a subscription to
Hardcore COMPUTIST and changed the
protection scheme on at least some of their
disks? Specifically, the ones I found changed
were Minus Mission and Meteor Multiplication.
It would seem that they have dropped the 13
sector format and have altered the address and
data epilogues from the normal DE AA to DA
AA. Now, This would seem to be an alteration
that wouldn't be worth the trouble, until a slick
little utility like Bag of Tricks returns ‘‘unable
to interpret data’’ on at least half of the tracks.
This is caused by the first byte of either the
address field or data field prologues appearing
to be sync bytes, Hmm, it seems that they’re
a bit more devious than appears at first glance.
Anyway, type in the Super IOB controller
that follows (by the way, it was generated by
the Controller Writer from Hardcore
COMPUTIST No. 16), and proceed as follows:
1) Install the Controller into Super IOB using
your favorite method.
2) INITialize a blank disk with a normal or fast
DOS using the name of the original disk as the
hello file. (ex. for Minus Mission, type INIT
MINUS MISSION)
3) Run Super IOB to make the copy onto the
freshly INITialized disk and presto-chango! a
COPY Aable DLM program.
If you look at the controller, you will notice
that tracks Q through 2 are not copied from the
original disk. We don't really want to copy their
DOS, do we?
Note: if this method does not work for these
or other DLM programs, you can try using the
Swap controller and the RWTS from the
offending disk.
controller
1900 REM NEW DLM CONTROLLER
1010 TK=3 :LT=35 :CD=WR :MB=151 : ONERRGOTO
550
1920 ST =@ :T1 = TK : GOSUB 490 : RESTORE : GOSUB
190 : GOSUB 210 : GOSUB 170
1930 GOSUB 430 : GOSUB 108 :ST =ST+1
16 THEN 1030
1040 IF BF THEN 1060
1050 ST = 6 :TK=TK+1 : IF TK <LT THEN 1030
1960 GOSUB 230 :TK = Tl :ST=9 : GOSUB 490
IFST<
1070 GOSUB 438 : GOSUB 160 :ST=ST+1: IFST<
16 THEN 1070
1080 ST =6 :TK=TK+1: IF BF =@ ANDTK<LT THEN
1978
1090 IF TK < LT THEN 1020
1100 HOME :A$ = "ALL* DONE” : GOSUB 450 : END
5000 DATA 213 170 ,150 ,213 170 ,173 218 178
218 ,170
controller checksums
1900 - $3568 1960 - $6AE6
1010 - $5E3F 1070 - $22FD
1920 - $B92C 1080 - $5408
1030 - $E2AA 1098 - $7FC2
1040 - $2463 1100 - $F952
1050 - SE2BC 5008 - SEFOF
Nick Galbreath’s softkey for...
Homeword
Speller
Homeword Speller
Sierra On-Line Systems
36575 Mudge Ranch Rd.
Coarsegold, CA 93614
Requirements:
Apple ][
COPYA or equivalent sector copier
A sector editor
To crack the spelling checker, copy the disk
with COPYA, then get out a sector editor and
change the following
TRK SEC BYTE FROM TO
1 7 $C8 $28 $4C
1 7 $C9 $12 $0C
<
Hardcore COMPUTIST No. 25 9
: ,
Beating Stoneware'’s...
DB Master v4.2
By Clay Harrell
DB Master 4,2
DB Master Business Writer
Stoneware, Inc.
50 Belvedere St.
San Rafael, CA 94901
Requirements:
At least 64K (required by program)
At least one disk drive
Super IOB v1.5
Some blank disks
DB Master version 4.2 and/or Business Writer
from Stoneware
OK, it’s about time someone put to paper the
deprotection method used for the Stoneware
series of software! If you have used (the
infamous) DB Master, you will know exactly
what I mean...
Stoneware offers several great products, but
they are not known for customer service.
Stories of four-week delays for backups, and
unanswered phone calls to customer service are
all true, and probably very familiar to those who
have had any problems. Well, this is where I
come in... Here is your customer service!
Now Stoneware has developed a new product
called *‘Business Writer”. This is a word
processor allowing you to take files from
several different word processors (and formats)
and combine them into one document. It is very
easy to use and convenient.
The protections used on DB Master version
4.2 and Business Writer are exactly the same
This should be no great shock since the
protection used is good, and for quite some time
remained untouched by prying eyes. The main
protection used is half tracking, and Stoneware
was one of the first (if not THE first) publisher
to use half tracking.
The only other protection used by Stoneware
is modified data and address epilogue bytes (you
know, the three byte sequence found on every
sector of a disk that tells DOS where the data
to read ends).
So our job is to convert the half tracks to
normal DOS whole tracks and to change
Stoneware’s DOS to read just whole trac
not half tracks. It turns out this isn’t a difficult
job as far as manual labor is concerned. But to
figure it out, you need a real good
understanding of RWTS (the Read and Write
a Track and Sector portion of DOS).
First a little background on half tracks... Yes,
regardless of how stupid it sounds, it is possible
to write in between the normal DOS track, thus
the name **half tracks’’ evolved. This is not to
say that we can use track 1, 1.5 and track 2
Due to hardware limitations, tracks must be |
full step away from each other. In other words,
you could use full tracks @ to 5, and then half
tracks 6.5 to 34.5, and this is precisely what
Stoneware has done. Notice that track 6 and
track 5.5 are not used. Again, this is because
tracks must be at least 1 full step away from
each other, or you could get “track bleeding’’
where data from one track bleeds to another.
(Actually, there is a way around track bleeding
called *‘spiral tracking"*, but that is out of the
scope of this article).
Now as any good student would ask. “Holy
bat-tracks, how did you know that Stoneware
uses tracks @ to 5 and 6.5 to 34.5?" Well, you
10 Hardcore COMPUTIST No. 25
can not tell by listening, so the only way left
is by watching, This involves stripping your
drive of its skin and watching the stepper motor
(as described in Hardcore COMPUTIST No.
5, pg. 11), or by using a “track monitor’’ such
as Track Star by Midwest Microsystems
Whatever your weapon, Stoneware knows
that only some extremely small percentage of
Apple users would ever be able to figure this
out, much less find a way to convert and defeat
this protection. Well, we can’t let them get away
with it!
Now that we have a diagnosis on the
mutation, we have to understand how it works,
On a hardware level, the way your Apple tells
the drive to move the read/write head is by
pulses. Timing is critical, and there are a couple
of ways to create pulses to move the head. Each
pulse moves the head a quarter track. but the
way DOS is written you can only move the head
in half track increments from standard RWTS.
Stoneware uses a fairly standard RWTS portion
of DOS, so they can only deal in half and whole
tracks.
The routine in DOS that carries out the job
of moving the head is at $B9AQ. It issues two
pulses to move the head a full track. But if we
tell it to do one more pulse it pushes the head
to a half track beyond the desired track. This
is easy to do from normal DOS. At $B9A0 you
can put a JSR (Jump Subroutine) to the
following routine:
B430- 86 2B STX $28
B432- 85 2A STA $2A
B434- C9 XX CMP #$XX
B436- 90 02 BCC $B43A
B438- £6 2A INC $28
B43A- AD 78 04 LDA $0478
B43D- C9 _ XX CMP #SXX
& Business Writer
B43F- 90 03 BCC $B444
B441- EE 78 04 INC $0478
B444~ AS 2A LDA $2A
B446- 60 RTS
This is the routine that Stoneware uses to read
half tracks (note that the XX represents twice
the value of the track you want to read). When
Stoneware wants to read whole tracks they put
a $60 (RTS, Return From Subroutine) at
$B434, When they want to read half tracks they
put a $C9 back at $B434,
It was easy to find the routine that did the
switching between whole and half tracks by
searching for the byte sequence “A9 C9 8D 34
B4"', which represents **load the accumulator
with the value $C9 and store it at $B934"". To
fix it so it just reads whole tracks, merely
involves changing the **load accumulator with
the value $C9"" to *‘load the accumulator with
the value $60". This way the half track routine
is never accessed
Now we must copy tracks @ to 5 to another
disk and convert the half tracks 6.5 to 34.5 to
whole tracks by reading in half tracks and
writing out whole tracks.
Super IOB can handle it with ease
Examination of the disk reveals that both
epilogues have been changed to DF AB. The
controller reads the Stoneware disk from tracks
@to 5 (using the Fast routine in Super IOB v1.5)
and writes them onto the copy normally. Simple
so far, Each following track is read by setting
the variable CD to @ (seek only) and going to
the R/W Sector routine to move the head to
track x.0, then using the Move S Phases
subroutine to move forward one half track to
track x.5. This is done for each track.
A sector edit is performed on the following
locations:
add this for Business Writer
05 0A 13 co 60
Instructions
1) Install the controller with this article in Super
IOB v1.5. It takes advantage of the Fast routine
in version 1.5.
2) If you are copying Business Writer, add these
lines:
5010 DATA 6 CHANGES
5070 DATA 5,10,19,96
3) RUN Super IOB and copy the disk.
4) Don't forget to copy both sides of DB
Master.
Congratulations, you now are finished!
controller
1006 REM STONEWARE CONTROLLER
1910 TK=0 :LT=6 :ST=15 :LS=15 :CD=WR :FAST
=i
1920 GOSUB 490 : GOSUB 170 : GOSUB 610 :TK=5
GOSUB 319 :TK = 6
1030 GOSUB 490 : GOSUB 230 ; GOSUB 610 :LT = 35
TK=6 :ST=0
1049 T K : GOSUB 498 : RESTORE : GOSUB 170
1950 CD = 6 : GOSUB 100 : POKE BUF , PEEK (BUF )
-1:CD=RD :PH=TK * 2 :S= 1: GOSUB 130
1060 GOSUB 430 : GOSUB 100 :ST = ST+1
DOS THEN 1060
1070 IF BF THEN 1090
1080 ST=0 :TK= TK+1: IF TK<LT THEN 1050
1090 GOSUB 230 : GOSUB 490 :TK=T1 :ST=0
1100 GOSUB 430 : GOSUB 100 :ST=ST +1; IF ST<
DOS THEN 1100
1110 ST=0 ;TK=TK+1
1100
1120 |F TK < LT THEN 1040
1130 HOME : PRINT "COPYDONE!" ; END
5000 DATA 223 171 223 171
5010 DATA 5* CHANGES
5020 DATAG ,3 145 222
5030 DATAO 3,155 170
5040 DATA® ,3 ,53 222
5050 DATAO ,3 63 170
5060 DATAO 12 227 96
5070 REM DATAS 10 19 96
IFST<
IF BF = @ AND TK < LT THEN
controller checksums
1008 - $3568 1118 ~ $2028
1010 - $F776 1120 - $8AB5
1028 - $7880 1130 - $74C1
1030 - SOAA8 5000 ~ $0659
1040 - SF4E7 5010 - $69C9
1050 - $8408 5020 - $1734
1060 - $8BOF 5030 - SABED
1070 - $19F5 5040 - S6CFE
1080 - $5D14 5050 - $C398
1099 - $2981 5060 - $71B6
1100 - $1881 5070 - $4368
Hardcore COMPUTIST No. 25 11
softkey for...
Another DB Master 4 +
By Anthony L. Barnett
Stoneware, Inc.
50 Belvedere St
San Rafael, CA 94901
Requirements:
Apple //e, //c, or 64K ][ Plus
Super IOB v1.2
A sector editor
Previous DB Master softkeys from Hardcore
COMPUTIST Nos, 7 and 21,
When DB Master Version 4+ disappeared
from the Most Wanted list in Hardcore
COMPUTIST No. 20, I thought a softkey might
be on the way. When I saw Clay Harrell’s
softkey in Hardcore COMPUTIST No. 21, I
thought at last I would be able to back up this
program with four copies which I usually make
of all my valuable software. (Stoneware has
done some amazing feats to fool all the bit
copiers but not the Super IOB technique on this
software.)
Unfortunately, although Super IOB copied
the disk without an error message the resultant
copy would not boot. In fact, it crashed into
the monitor at $B100. As nothing had been put
into memory at $B100, it appeared as though
the third stage of the boot was failing to load.
I then looked at $BF75 and saw that a volume
mismatch error ($20) had occurred. Fortunately
DB Master uses a fairly standard RWTS
routine. The volume number found in location
$B7F6 was $FF. However, checking the code
which caused the jump to $B100, I saw that SFF
was loaded into $BF76 by the program.
I decided the simplest way to check the actual
volume number was to use a nibble viewer (like
The Nibbler) on the original disk. Sure enough,
a volume number of | showed up. So, this time
T used Super IOB with a disk formatted with
volume number of 1.
At last the familiar DB Master logo appeared.
This time, however, the program would not
read the Utility disk. It was then I remembered
Dan Lui’s earlier softkey for version 3
(Hardcore COMPUTIST No. 7). With a sector
editor, I modified track @, sector E, bytes
SA,SB to D@ 12.
With this last modification I could not boot
program disk #1 and read data and utility disks.
However, The program would not recognize
Program disk #2. Even after modifying track
@, sector E on disk 2 it was still not readable.
Finally I decided to check the volume number
again. Eureka! The volume number of disk 2
is 2. So by using Super IOB and formatting disk
2 to volume 2 plus the sector edit of track @
sector E, I had a working, unprotected copy of
DB Master 4+... well, almost.
There is a bug in the label printer program
which does not allow you to justify a label with
spaces in the comment fields. This works fine,
however, on the label printer on Utility Pak #2
In addition, one may wish to use Stats Pak or
the transaction file merge facility of Utility Pak
#2.
To get to the Utility or Stats Pak one uses
option 9 from the Utility Pak menu. The
unprotected version of DB master could not
read the Stats Pak or Utility Pak disks. To
overcome this I used Dan Lui's version 3
softkey on these disks, editing track 0, sectors
3 and E only. However, the program would still
not read the unprotected Utility or Stats Pak.
I then began to search Program disk No. 2
for some code which turned on the half-tracking
of the Utility Paks. In fact, on track 8 sector
9, I found the BASIC program which gives the
menus for file maintenance. To get into the
Program it is necessary to use a sector editor
to modify a statement with a CALL-151 (the
sequence 8C C9 31 35 31 3A) so the program
crashes into the Monitor. Then do 00 to
turn off the run time flag, and
Applesoft.
After listing the program, I found a line that
said
Li = PEEK(106) * 16°2 + PEEK(105) - 48
CALL LI
I suspected this call to be the one which
12 Hardcore COMPUTIST No. 25
turned on the half tracking so I set my “*break
point’* (CALL-151) to the line before it and ran
the program again. I thus found the value of
LI and the starting point of the routine I wished
to avoid.
I changed this line with a sector editor to read
POKE PEEK(106) * 16 ~ 2 + PEEK(105) -
48, 96:REM
At last, I had a completely deprotected version
of DB Master 4+ and Utility Paks.
As a final fling, I have always been peeved
that DB Master would not find the date from
my CCS 7424B clock in spite of what the
manual says. Several letters to Stoneware have
proved fruitless on this issue. However, by
modifying the BASIC program which begins
on track 4 sector A of Program disk No, 1 so
that it recognizes the signature bytes of my
clock I no longer have to enter the date.
Step By Step
1) Use Clay Harrell's softkey (Hardcore
COMPUTIST No. 21) with Super IOB v1.2 for
DB Master program disks. When asked whether
you wish to format the disks, respond Yes and
use Volume No. | for disk 1 and Volume No.
2 for disk 2.
2) In addition to the sector edits listed by Clay
Harrell, edit Track @, Sector E, bytes $A and
$B to D0 12 on both program disks.
3) On disk 2 edit track 8, sector 9, bytes
$86-$A0 (27 bytes) to
B9 E2 28 31 30 36 29 CA
31 36 CC 32 CB E2 28 31
30 35 29 C9 34 38 2C 39
36 3A B2
4) Use Dan Lui’s softkey (Hardcore
COMPUTIST No. 7) to make unprotected
copies of Utility Paks or Stats Pak editing Track
@only. To be safe, modify line 250 of COPYA
to ensure the copy is formatted with a volume
number of 1.
5) Put a write-protect tab on all disks.
softkey for
Barron’s
Computer SAT
by Glenn Schmottlach
Barron's Computer SAT Study Program
Barron's Educational Series, Inc
113 Crossways Park Drive
Woodbury, New York 11797
$89.95
Requirements:
48K Apple }[ or equivalent
Super IOB v1.2
Six blank disks
One or two disk drives
This computer preparation package by
Barron has to be considered one of the best
programs available for preparation before
taking the SAT. Along with three double sided
disks comes three hefty study manuals which
you use along with the program. Essentially you
read the SAT questions out of the study manuals
and choose the correct answer on the computer
If you choose the wrong answer the computer
responds by giving you hints for the correct
answer, and if you are still incorrect the right
answer and an explanation of why it is the
correct choice appears on the screen. The
program uses actual hi-res pictures on the
mathematic section to convey an easier
understanding of the problems given. Of course
the program also keeps track of your score and
gives you some guidelines on what you should
study more.
The Protection
When the Barron study program disks boot
they sound like normal DOS 3.3 disks and the
familiar bracket appears. After browsing
through the raw track nibbles using Copy I+
4.4D (another good program for this task is the
Nibbler published in Hardcore COMPUTIST
NO. 19, page 25), I noticed two things different
from normal DOS 3.3 disks. The first thing I
noticed was that the start of address marks were
changed on all of the disks from the normal
values of DS AA 96 to BB AA 96. For those
out there who are unaware of what these marks
are let me tell you. When you initialize a disk
DOS places these certain values on a disk so
it can find the beginning of valuable information
such as where a sector begins and where valid
data can be found. If standard DOS 3.3 tries
to read or write to one of these protected disks
it won't be able to find valid data because of
the changed marks and therefore an error will
be produced. This is a very common technique
and it is used on almost all protected disks and
often in conjunction with other protection
methods. The second major difference I noted
was the fact that on all six disk sides track $0A
was unformatted. The only explanation I can
come up with this is that the protected DOS
might use some sort of nibble count on track
$0A. We won't have to worry about that
because the deprotected versions of these disks
work smoothly with standard DOS 3.3. The
only thing that I had to change because of the
unformatted track was programming the
controller to skip track $0A so Super IOB
wouldn't get hung up on it
How to Deprotect the Disk
The following steps are used to deprotect the
Barron program disks:
1) Boot a standard DOS 3.3 disk and then clear
memory
FP
2) Initialize each of the six blank disks using
HELLO as your boot program
INIT HELLO
repeat for each disk.
3) Load up Super IOB Ver. 1.5 and type in the
controller program.
4) Follow the prompts and when the program
asks you if you want to initialize the duplicate
disk tell it no because we just formatted all six
blank disks.
5) Copy all six program sides of the Barron
SAT disks using the same contoller just like in
step 4.
Closing Comments
You have completely deprotected all of the
Barron SAT program disks. You should now
feel at ease knowing that you aren't using the
original disks. Sit down now and study, study,
study. Maybe you'll be able to raise those scores
just a few more points; and then again maybe
not
controller
100 REM BARRONS COMPUTER SAT CONTROLLER
1010 TK =3 :ST=@ :LT=35 :CD=W
1020 Tl = TK : POKE 47445 , 187 : GOSUB 490
1030 GOSUB 430 : GOSUB 100 :ST=ST+1: IF ST<
DOS THEN 1038
1040 |F BF THEN 1070
1950 ST=0 :TK=TK+1
1060 IF TK < LT THEN 1030
1970 GOSUB 490 :TK = T1 :ST = ; GOSUB 230
1080 GOSUB 430 : GOSUB 100 :ST=ST +1. IF ST<
DOS THEN 1080
1098 ST =0 :TK=1K+1: IF TK = 10 THENTK=11
1100 |F BF = 0 AND TK < LT THEN 1080
1110 |F TK < LT THEN 1020
112 HOME : PRINT : PRINT “DONE* WITH* COPY”
END
IF TK = 10 THEN TK = 11
controller checksums
1008 - $3568 1070 - $0588
1010 - S4CFF 1988 - $CF82
1020 - SA7C5 1098 - $24F9
1930 - $BIC4 1108 - $9708
1040 - $15AA 1110 - SED2F
1950 - S9CE7 1120 - $C700
1068 - $482C
-&
Hardcore COMPUTIST No. 25 13
Softkey for...
The RAM card occupies the same memory
as your Applesoft ROMs and the monitor ROM
($D000-SFFFF). It is accessed by soft switches,
much like the way you turn on and off the hi
res pages. But when you turn on the RAM card
you are also turning off the motherboard
monitor ROM, which overlooks all your
Apple’s functions. Since there isn’t a monitor
ROM in the RAM card, your Apple locks up
To prevent this, we can set the RAM card to
“write enabled,’’ and read from the
motherboard ROMs. Now we can copy an
image of the monitor ROM into the RAM card
using the monitor's memory-move command
Finally, we can turn on the RAM card and
examine the memory in it!
To do this type
ACTORS & ACTIONS
SCEWE EDITOR
HOVIE EDITOR
HOVIE PROJECTOR
DISK UTILITIES
©1984) BAUD OILL
By Clay Harrell
Baudville
1001 Medical Park Dr. S.E.
Grand Rapids, MI 49506
$49.95
Requirements
64K Apple ][ Plus, //e or //c
One disk drive with DOS 3.3
A sector editor
Take 1 from Baudville Software
Take | is an excellent graphics program! Just
looking at the demo makes you want Christmas
to come early, so you can get one. The graphics
are extremely smooth, flowing and detailed
This program is a ‘10° on my list
The protection isn’t too shabby either, and
Baudville does a trick or two to keep us from
making easy copies. The protection can't be too
wild though, or the users would have problems
interfacing their graphics routines with normal
DOS 3.3
The disk seems pretty much normal, and can
be copied with COPYA without too much
difficulty. Use COPYA to copy Take | to
another disk. This will be our work disk and
we can examine the protection from here.
Go ahead and boot the COPYA version of
Take 1. Notice it reads the disk and prints
“Take 1”* and your serial number on the screen
Then it just hangs there, looking for something
on the disk!
Since (after many tries of reading the disk
and not finding what it wanted) it doesn’t clear
memory and reboot, we can interrupt the
program at our leisure and examine the code
The best way to do this is to use a Replay II
card or a Know-Drive. These tools will allow
you to interrupt the program and let you know
the current location a program is running at
Running in the RAM Card
But we encounter our first problem with Take
1: they are using the memory within the RAM
card for the RWTS. To access this memory we
have to use some tack, and refer to our 16K
RAM card manual
Looking at our RAM card manual tells us that
if we want to turn on the RAM card, we type
C080 from the monitor. If you try this, your
Apple will lock up and the only way to recover
is to power down and cold boot. The reason
for this is simple
14 Hardcore COMPUTIST No. 25
C681 C681
F800<F800.FFFFM
Cee
From our Replay card we know that the
program was stuck reading the disk around
SDC4F
0C43- RTS
pc44- LOY
DC46- STY
OC48- INY
0C49- BNE
OC4B- INC
OC4D- BEQ
OC4F- LDA
0C52- BPL
0c54~ CMP
0C56- BNE
DC58- NOP
0C59- LDA
OC5C- BPL
OC5E- CMP
DC60- BNE
0C62- LOY
0C64~- LDA
0C67- BPL
OC69- CMP.
OC6B- BNE
OC8B- LDA
OC8E- BPL
0C90- CMP
DC92- BNE
0C94- NOP
DC95- LDA
DC98- BPL
DC9A- CMP
DC9C- BNE
DC9E- CLC
DC9F- RTS
HSFC
$26
SDC4F
$26
$0042
$C08C
SDC4F
#$05
$0048
$CO8C, x
$DC59
HSAA
$0C54
#$03
$CO8C
$0C64
#$96
$0054
$CO8C,X
$OC8B
#$DE
$042
$CO8C, x
$0095
#SAA
$0C42
Here is the code:
End of previous routine
start
First byte of Address
prologue marker
Second byte of Address
Prologue marker
Last byte of Address
prologue marker
First byte of Address or
Data epi logue
Last byte of Address or
Data epi logue
End of routine
As you can see, this routine checks the disk
for the prologue address marker of SDS AA 96.
Note that a prologue address marker is on every
sector of a normal DOS disk. It’s a road sign
to tell DOS the next few bytes designate what
track, sector, and volume it is reading (hence
“soft sectori )
Likewise, the routine also checks for an
epilogue byte of SDE AA. Epilogue bytes are
on every sector of a normal DOS disk too. They
tell DOS that “the data ends here"
There is really nothing funny about this
routine, The address and epilogue bytes this
routine is looking for is on every normal DOS
disk. So we must dig deeper, since the program
is hanging here for some reason. First, we
should find where this routine is called from
(we know the routine starts at $DC44 since
there is an RTS at $DC43).
To make this easier, | copied the RAM card
memory down to motherboard RAM with the
monitor move command
4000<D000.FFEFM
Then I used the Inspector's search command
to look for a JSR $DC44. Sure enough, I found
one at $500F (really $EQOF). Here is the code
1 found
AAA INDUSTRIES
CHEMICAL PRODUCTS DIVISION
10 20 30 40 50 60 70 80
0 8 82 aa
Ist Quarter Sales
84
Here is the offending routine! Notice it jumps
to a subroutine at $DC44 to check the disk
After it returns, it checks location $2D, and if
it is not FF, it goes back and starts over. Hence
it loads location $2D with something other than
SFF
So to defeat this routine we must find it on
the disk, and change the code with a sector
EQOF- JSR $DC44 :go to check disk
£012- LDA $2D oad A with location $2D
EQ14- CMP #SFF <compare it to SFF
E016- BNE SEOOF -if not equal, go to $SEO0F
editor from $D@ F7 (BNE $E007) to $EA EA,
which stands for **no operation’’ (NOP). This
removes the **branch back to start if location
$2D is not equal to $FF The code lives on
track @, sector 6, byte $16, and also on track
0, sector $F, byte $08. I used the Inspector's
Locate command to find the code on the disk
Lo and behold, Take | is now deprotected
Note that this routine lived in two places on the
disk. If you only found the first one on sector
6 of track Q, the program would die about a
third of the way through the boot
our disk keeps running in this infinite loop and
never finishes loading the program. Obviously,
somewhere in the code at $DC44 it reads the
disk, and if something is not up to benchmarks,
Cookbook Version
1) Boot your system master disk and run
COPYA
PR#6
RUN COPYA
2) Run your favorite sector editor and make the
following changes to the COPYA version of
Take 1
Track ®, Sector 6, Byte $16
Change from $D@ F7
to SEA EA
Track 0, Sector SF, Byte $08
Change from $DB F7
to SEA EA
3) Write the sectors back out
And you're all done!
—
Hardcore COMPUTIST No. 25 15
DOS to ProDOS and Back
Another
Single-drive
Solution
By Brian K. Chin
Requirements:
64K Apple ][ Plus and up
One disk drive
A DOS 3.3 disk
A blank disk
A ProDOS disk formatter program
A sector editor or block editor (optional)
This procedure for single disk DC
ProDOS conversion is presented not only as an
alternative to the procedure presented by Mr.
Eubanks (Hardcore COMPUTIST No. 9,
p.15), but also as a simpler and more flexible
solution which will attempt to shed a little light
on the subject of how disk formats work, The
process involves the creation of a disk on which
both the ProDOS and DOS 3.3 environments
can peacefully co-exist. The inspiration for this
article was to find an easier way to convert files
with only one drive. Being an avid AppleWorks
user, I have found that even occasionally
working with only one drive can be a real
hassle, not to mention being unable to convert
text files back and forth without the second
drive. The reason behind the creation of the
Dual DOS Disk was to see if it could even be
done, The notion that my new disk could be
used to solve the single disk conversion problem
did not come to my attention until after it had
spent a month on my shelf doing nothing
As with all changes come both advantages
and disadvantages. The same holds true here
as well. You are no longer confined to
converting only Applesoft and binary files. You
are no longer confined to a maximum file size
of 59 sectors (30 blocks) in one direction, and
193 sectors (86 blocks) in the other. You now
possess the ability to transfer a file of ANY
type, and up to a maximum size of 258 sectors
(129 blocks), The only drawback which exists
is that you only have the available space of half
of a ProDOS disk and half of a DOS 3.3 disk,
which reduces your operating and storage space
by a factor of two. While this may eliminate
any need for disk swapping during the
conversion process, it may require copying files
onto and off of the special disk both before and
after the conversion is made. In light of the
benefits gained, this becomes a minor problem
at worst. Lastly, and most important, it permits
you to use the CONVERT program, without
forcing you to make all of those nasty little
RESET breaks, memory moves or forcing you
to learn how to think in hexadecimal
But Aren’t the Formats Different?
At one time or another, it was the general,
concensus (I think) that only a disk formatted
under DOS 3.3 could contain DOS 3.3 files.
The same held true with Apple CP/M, Pascal
and ProDOS. This is true to a certain degree
The major dissimilarities between the four
16 Hardcore COMPUTIST No. 25
operating systems (we'll only be dealing with
two of them) are the location of the directory
data and volume bit-map, the placement and
numbering of logical sectors, and how the
operating system defines the minimum amount
of data that can be read at any one time
Let's start with the simplest of them, the last
one. As you already know, DOS 3.3 reads and
writes data in 256 byte sectors, while ProDOS
uses 512 byte blocks. However, as we shall see
in a minute, ProDOS does not really allocate
eight blocks per track when it formats, in the
way DOS 3.3 would allocate 16 sectors, but
defines a block as a specified sector, plus the
physical sector located two sectors over. Thus,
ProDOS does not read a full block, it makes
a sequential read of two noncontiguous sectors.
If this is confusing, please bear with me. It
should become a little clearer very soon
In order for a disk (with the exception of
DOS 3.2) to be Apple-readable, its format must
be consistent with Apple's sixteen-sector
format. This is why sector editor utilities, such
as DiskEdit, are able to read any of the four
operating system formats. However, the sectors
read from a non-DOS 3.3 disk will appear to
be in an unorganized order because each system
utilizes a different
logical sector layout when accessing the disk
When a disk is formatted, under any of the
four operating systems, it divides each track into
16 equally sized subdivisions. Each of these
subdivisions are known as physical sectors
because they are numbered (physically) by their
orientation on the disk. Sector 0 is next to sector
1, which is next to sector 2, and so on. Sector
@ is determined rather arbitrarily and is used
to denote the start of that particular track.
Within the boundaries of each physical sector
are two fields, the first containing the address
information, and the second the actual data.
Within the address field of each physical
sector is a pair of bytes indicating the physical
sector number, With the exception of sector 0,
the logical sectors are numbered by their
respective operating systems, independently of
their location on the disk (their physical sector
numbering)
All the operating systems have their own way
of keeping track of the sectors internally. The:
are referred to as logical sectors. When the time
comes to access the disk, the logical sector
number is cross-referenced in a table to find the
matching physical sector number. The way in
which a physical sector is logically numbered
is called sector skewing. The following table
shows how the different operating systems
logically number each of the 16 sectors.
Physical O123456789ABCDEF
cP/M OBE1IC7T2ZDBZEX4FAS
Pascal OB192A3B4C5D6E7F
DOS3.3 O@7E6D5C4B3A2918F
ProDOS O8192A3B4C5D6E7F
PDOS bikKO404151526263737
1 tThis sector is the second
half of ProDOS block @
This sector is the first half
of ProDOS block @
Thus, when DOS 3.3 looks for a sector $OF (its
logical number), it first reads the 16th byte
(don’t forget sector 0) in its sector translate
table, which yields the corresponding physical
sector number (in this case 2). DOS then looks
for physical sector 2, and reads the following
data field. When the sector is in memory, DOS
will think that it got sector $OF and continue
on its way. You will note that disk access under
ProDOS (and Pascal) is dramatically faster than
DOS 3.3. This is due less to changes in the
operating system and more to the changes in
sector skewing
A Word About Directories
‘The main reason why any one operating
system cannot read another operating systems
files is the location and format of the volume
bit-map and directory sectors. The directory
sectors (blocks) act as the the disk’s table of
contents, holding the file names and their
locations on the disk. The volume bit-map is
responsible for keeping the status of each sector
(block) on the disk; whether the sector (block)
is available for storing data, or is currently in
use. On a ProDOS disk the directory lies in
blocks 2 through 5, and the bit-map in block
6. Under DOS, the directory lies on track 17,
sectors 1 through 15 (SOF), and the bit-map,
or volume table of contents (VTOC) on sector
0
The directories of both DOS and ProDOS
function in much the same way. They both
contain filenames and vital file accounting
information such as links to the other directory
sectors (blocks), file-size, file-type, and file
location, or more appropriately, the location to
the DOS track/sector list and the ProDOS index
block. These two packets of data contain the
locations of all track/sector pairs (blocks) of
data relevant to that particular file. ProDOS
directory blocks also contain other data. Among
them are, volume name, file creation times and
dates, last modification time and date, starting
file address, file length, and text record length
The differences between bit-map formats are
more evident, The DOS bit-map begins at byte
56 on track 17, sector 0, the VTOC. The first
quarter of the sector is
miscellaneous accounting information such as
disk volume number, DOS version number,
location of first directory sector, and track
allocation direction. Each track is represented
by a sequence of 4 bytes. Of the first two bytes,
each bit, either 1 or ®, represents a sector which
is either free or allocated, respectively. The
second two bytes are not needed and left at $00.
Thus, an empty track is represented by "FF FF
00 00". Under ProDOS, since a volume may
be of any size, allocates one byte to represent
8 blocks, or in this case, a single track, Here
too, it bit-maps with 1 and 0 so that $FF
indicates free range of 8 blocks.
reserved for
Bearing this in mind, the only reason that
DOS cannot read ProDOS files, and vice-versa,
is that both DOS and ProDOS expect the
directory to be in a certain position on the disk
Thus, when the directory sector (block) is read,
Hardcore COMPUTIST No. 25 17
the operating system must attempt to interpret
an empty sector (block), unused and filled with
00°". or a sector (block) full of valid data, but
directory data. This has the effect of
confusing the CATALOG routine because the
directory information is not where it is expected
to be, and is also written in a different format
What Had To Be Done
Armed with this information, I forged ahead
to create a disk of two **DOSs"’. Actually the
solution was simple, just create a disk with two
catalogs on it. However, the process was a little
bit tougher. I formatted a disk under ProDOS,
then bit-copied tracks 17 through 34 from a
freshly formatted DOS 3.3 disk. At that point
I thought I was done, until I remembered that
both operating systems would regard the disk
us free for storage and that there was no
provision for keeping one system from over-
writing data saved by the other. It was at this
time when I realized, a bit late, that the DOS
catalog track is conveniently located in the
middle of the disk, and the ProDOS directory
on track 0. Therefore, I could allocate tracks
@ to 16 as ProDOS tracks and tell the DOS
VTOC that they had been written to, and tell
ProDOS that tracks 17 to 34 were also full. This
however, would require a modification of both
bit-maps.
By manipulating the information in a disk’s
bit-map, one can define sections of the disk as
being are off-limits to the operating system. The
operating system interprets those areas as
“written to’’ and therefore cannot de-allocate
them, whether there is valid data there or not
(in this case, it’s the latter). The only way that
DOS or ProDOS can ‘free up’ a used sector is
by deleting the file which last resided there.
Since there will be no DOS files in the ProDOS
allocated section and vice versa, DOS will not
be able to do anything to the ProDOS allocated
tracks, as well as the reverse. Be warned
however, that improperly modifying a bit map
after data is stored on the disk could result in
allocation of already used sectors as usable,
which could lead to the accidental over-writing
of valuable data or even critical DOS
information,
At the time I made the proper modifications,
Tused a sector editor for the DOS bit-map and
a block editor for the ProDOS bit-map. By
accident however, I discovered that the required
procedure need not be as long and complicated,
and that I could complete the entire operation
in the DOS 3.3 environment. As I was scanning
through track @, my finger brushed the key
which instructs the program to read the previous
block of data. Since I was on block @, it read
block 279 (track 34, sectors | and 15). I was
rather surprised to see that it did not return with
an ‘I/O ERROR’ message. At that point, I tried
reading and writing to a regular DOS 3.3 disk
with the block editor and to a ProDOS disk with
a sector editor, with mostly successful results.
The only problem was that the logical sector
numbering (skewing) was fouled up.
Sensing that the discovery was only
beginning, I tried another experiment. I
formatted two disks under ProDOS and two
under DOS 3.3 (here referred to DOS A & B
and ProDOS A & B). I left the A disks alone,
but sector copied DOS track 17 onto ProDOS
B and ProDOS track @ onto DOS B, thereby
creating a DOS disk with ProDOS sector
skewing and vice-versa. I then saved a rather
large ($7000 bytes) binary file on each disk,
under the appropriate operating system and ran
speed tests on loading them. I found that the
DOS skewing dramatically increased the time
it took for ProDOS to load the file, but that the
ProDOS skewing had no effect on DOS 3.3 at
all. Upon determining this, I surmised that 1
could use a ProDOS disk and modify it on a
sector by sector basis. Finally, 1 dug into all
four disks with a sector editor and derived a
block-to-sector and sector-to-sector translation
table. Using this, I took another ProDOS
formatted disk, sector copied another DOS
catalog track and modified the bit-maps, which
yielded my goal. The results of conversion tests
‘on a single drive Apple }[+ were miraculous.
After my experiment with the dual DOS disk.
I developed an assembly language program, the
DUAL DOS DISK MAKER, which modifies
a standard, ProDOS formatted disk, and creates
2000: 20 76 20 START JSR CLEARBUF
2003: A2 80 DOSMAP LDX #$80
2005: AQ FF LDA #SFF
2000: £8 INX
200E: £8 INX
200F: E8 INX
2010: £8 INX
2011:° D0 F4 BNE L1
2013: A2 00 MAKEVTOC LOX #$00
2015: BD A9 20 L2
2018: FO OA
201A: BC AA 20
201D: 99 00 21
2020: £8 INK
2021: £8 INX
2022: 08 FL BNE L2
2024: A9 00 WRTVTOC LDA #$00
2026: 8D ED 87 STA $B7ED
2029: Ad 11 LDA #$11
2028: 20 82 20 JSR GORWTS
202E: 20 76 20 JSR CLEARBUF
2031: A9 01 LDA #$01
2033: 8D ED 87 STA $B7ED
2036: AQ 11 LDA #$11
2038: 20 82 20 JSR GORWTS
2038: AQ 11 BUILDDIR LDA #$11
203D: 8D 61 21
2040: A2 OF LOX #S0F
2042: 86 FF STX SFF
2044: 8E ED B7 13 STX $B7ED
2047: CA
2048: 8E 02 21
2048: 86 FF STX SFF
2040: AS 11 LDA #$11
204F: 20 82 20 JSR GORWTS
2052: A6 FF LOX $FF
2054: £0 01 CPX #$01
2056: D8 EC BNE L3
Source Code for D.D.D.M.
ne ee Et ee ee *
* DUAL DOS DISK MAKER *
* BY BRIAN CHINN *
ke JUNE, 1985 x
03E3- SETRWTS EQ $03E3
0309- CALLRWTS .£Q $0309
2100- BUFFER EQ $2100
OR $2000
TF 0BJ..DDDM
7 eae ee alc: <0 a ea,
SET T/S BITMAP BUFFER OFFSET
SET T/S BITMAP MARKING VALUE
STA BUFFER,X ,ALLOCATE A TRACK AS FREE
STA BUFFER+1 .X
ySKIP THE NEXT FOUR BYTES
‘BUILD REMAINING VTOC AREA
LDA DATATBLI,X .FETCH DATA FROM FIRST TABLE
BEQ WRTVTOC TEST FOR ‘EOD’
UDY DATATBL1+1,X ;FETCH DATA OFFSET
STA BUFFER.Y ;STORE DATA IN BUFFER
;STORE SECTOR NUMBER TO WRITE
(SET TRACK NUMBER TO WRITE
«WRITE VTOC
sWRITE 1ST DIRECTORY SECTOR (ALL 00'S)
;STORE SECTOR NUMBER TO WRITE
(SET TRACK NUMBER TO WRITE
STA BUFFER+1 ;STORE TRACK OF NEXT DIRECTORY SECTOR
+SAVE SECTOR# FROM RWTS DECTRUCTION
+STORE SECTOR NUMBER TO WRITE
DEX iPOINT TO PREVIOUS SECTOR
STX BUFFER+2 ;STORE SECTOR POINTER IN BUFFER
vSAVE SECTOR VALUE FOR NEXT WRITE
;SET TRACK NUMBER TO WRITE
sWRITE SUBSEQUENT DIRECTORY SECTOR
‘FETCH VALUE OF NEXT SECTOR TO DO
‘CHECK TO SEE IF WE'RE DONE
18 Hardcore COMPUTIST No. 25
a DUAL DOS data disk. This was to alleviate
the problem of having to copy the entire disk
for my friends who wanted one, but mostly
because I wanted to write this article. Have you
ever tried to COPYA a disk out of a magazine
article?
Unfortunately, I have only scratched the
surface of how DOS and ProDOS disks work.
Although the intent was not a DOS tutorial, I
hope I have exposed enough of DOS and
ProDOS to form the foundation upon which the
“DUAL DOS DISK MAKER” is based. For
the most concise and in-depth coverage of both
DOS and ProDOS, I highly recommend both
Beneath Apple DOS and Beneath Apple
ProDOS by Don Worth and Pieter Lechner.
Doing It
1) Type in the DUAL DOS DISK MAKER
hexdump and save it on a DOS 3.3 disk.
2) Format a blank disk, or as many as you need,
under the ProDOS operating system. You can
use the FILER program on the ProDOS Users
Disk, the Appleworks disk formatter, or any
*
* TELL PRODOS TO ALLOCATE HALF THE DISK FOR DOS *
* pono enn -n + --- + +--+ +--+ - - +--+ ---- --------- ---- +--+ -- -------------- +--+
2058: 20 76 20 PRODOS JSR CLEARBUF
2058: AQ FF LDA #SFF ALLOCATE A TRACK AS FREE
2050: A2 10 LOX #810
205F; 90 00 21 L4 STA BUFFER,X STORE PRODOS BITMAP DATA \N BUFFER
2062: CA DEX
2063: 10 FA BPL L4
2065: A9 01 LOA #801
2067: 80 00 21 STA BUFFER STORE STATUS OF TRACK ONE
206A: A9 03 LDA #303
206C: 80 ED B7 STA SB7ED STORE SECTOR NUMBER TO WRITE
206F: A9 00 LDA #800 SET TRACK NUMBER TO WRITE
2071; 20 82 20 JSR GORWTS — ;WRITE PRODOS 8| TAP
2074: 60 RTS ‘ALL DONE
2075: 60 RTS ;JUST IN CASE STACK WAS PLAYED WITH
Re ee eee SR.
* WAIN SUBROUTINES *
oie teagan NE ec a at etna Rs «
2076: A900 —-CLEARBUF LOA #500
2078: 85 42 STA $42
207A: A9 21 LDA #521
2070: 85 43 STA $43
207E: 20 06 B7 JSR $8706 CLEAR BUFFER AT $2100
2081: 60 RTS
2082: 8D EC B7 GORNTS STA $B7EC ;STORE TRACK NUMBER TO WRITE
2085: A9 01 LOA #801
2087: 8D E8 B7 STA $B7E8 STORE RTS TABLE TYPE
208A: A9 02 LDA #502
208C: 8D F4 B7 STA SB7F4 STORE DISK FUNCTION
208F: A9 00 LOA #800
2091: 8D FO B7 STA $B7FO STORE BUFFER LOCATION
2094: A9 21 LOA #821
2096: 8D Fl B7 STA SB7F1 STORE BUFFER LOCATION
2099: A9 00 LDA #800 PREPARE EXTRA DOS LOCATIONS
2098: 8D EB B7 STA $B7EB STORE VOLUME MATCHING NUMBER
2098: 8D F3 B7 STA $B7F3_ STORE BYTE COUNT
20A1: 20 £3 03 JSR SETRNTS PREPARE FOR RWTS CALL
2044: 4C D9 03 JWP CALLRWTS ;MAKE RATS CALL
2047: 60 RTS
20A8: 60 RTS ;JUST IN CASE STACK WAS PLAYED WITH
~ Sa Fe eee iene Saree x
DATA TABLES *
Sree a |
2049: 01 31 91
20AC: 37 03 03
20AF: OF G2 DATATBLI .HS 0131013703030F02
2081: 10 35 11
2084: 01 11 30
2087: 23 34 HS 1035110111302334
2089: 7A 27 FE
2080: 06 00 00 HS 7427FE060000
other suitable utility. You may name the disk
anything you want, as long as it complies with
the ProDOS rules.
3) Boot up any DOS 3.3 disk and load the
program.
BLOAD DUAL DOS DISK MAKER
4) Place the ProDOS disk(s), formatted from
step 2, into the drive and run the program
Repeat as often as necessary.
CALL 8192
5) You now have a DUAL DOS disk which can
be copied with COPYA or any other suitable
copy program,
6) When you wish to use the DOS User's
Conversion Kit (DUCK). simply set the DOS
3.3 drive to the slot and drive your controller
card is in, and set the prefix via the pathname
or slot and drive option. You're all set to
convert. This disk will also work on a system
with more than one drive, but I see no real need
to use it there.
One last note: since this disk only leaves half
as much storage space as usual, 1 would
recommend it only be used as a transfer disk,
unless your particular application does not
require large amounts of disk space. If you're
using an applications program or programming.
save the data you need to convert to both your
master storage disk and to the DUAL DOS disk
If this is not possible, copy the appropriate files
onto the DUAL DOS disk before you convert.
Dual DOS Maker Hexdump
2000: 20 76 20 A2 80 .A9 FF 9D = SFBF9
2008: 00 21 9D 01 21 EB EB E8 $F767
2010: £8 DO F4 A2 00 BD AS 20 © $FB93
2018: FO OA BC AA 2099 00 21 SAOBS
2020; E8 E8 DO Fl A9 00 BD ED SEs0F
2028: 87 AD 11 20 82 20 20 76 = SA7CE
2030; 20 A9 01 8D ED B7 AD 11 = S211A
2038: 20 82 20 A9 11 8D 01 21 = S7ACF
2040: A2 OF 86 FF BE ED B7 CA $0331
2048: 8E 02 21 86 FF A9 11 20 $0480
2050; 82 20 AG FF EO 01 DO EC $BC89
2058: 20 76 20 A9 FF A2 10 9D $0708
2060: 00 21 CA 10 FA AQ 01 8D = $FO9L
2068: 00 21 A9 03 8D ED B7 A9 = $3FA9
2070; 00 20 82 20 60 60 .A9 00 © SC8C2
2078: 85 42 AS 21 85 43 20 D6 © $40DE
2080: 87 60 8D EC B7 A901 8D SE654
2088: E8 B7 A9 02 8D F4.B7 AQ $8071
2090: 00 8D FO B7 AQ 21 BD Fl $9358
2098: B7 A9 00 8D EB B7 8D F3 S4BE5
20A0: B7 20 £3 03 4C D9 03 60 SFBA3
20A8: 60 01 31 01 3703 03 OF $FC82
2080: 02 10 35 11 O1 11 30 23 $66E5
2088: 34 7A 27 FE 06 00 $EO9C
Hardcore COMPUTIST No. 25 19
Adding “If Then
By John R. Vokey
Requirements:
Apple JI Plus, //e, //c
A need for higher programming
The decision structure is one of the four basic
structures of computer programs (Grogono,
1980). Most high-level computer languages
implement this structure as an **IF’’ command,
as in the BASIC statement “IF X>1 THEN
X=1" in which the statement following the
“THEN” is executed only if the expression
following the “IF"’ evaluates as TRUE. Many
computer languages, including some versions
of BASIC, extend the “IF... THEN..."
command to include an *‘ELSE” statement with
which the programmer may state explicitly what
the program is to do if the expression following
the “IF” evaluates as FALSE. A few languages
extend the concept even further by including
the ‘ELSE IF"’ statement to allow the explicit
conditional sequencing of decisions. Although
the functions performed by the “ELSE"* and
the “ELSE IF’’ extensions to the *‘IF*
statement may be simulated by appropriate use
of the simple “IF... THEN...’’ command
structure and branching commands, **ELSE"’
and **ELSE IF"’ add considerable clarity to the
structure and flow of the program. For this
reason, they have been included in virtually all
structured programming languages, such as
PASCAL.
This article describes a short machine-
language “‘patch"’ to Apple's floating-point
BASIC, Applesoft BASIC, that extends the
BASIC “IF... THEN..."* command to allow
both **ELSE" and ‘ELSE IF"’. The patch will
work for the complete series of Apple Jf
computers under the DOS 3.3 environment
Command Structure and Syntax
The syntax of the Applesoft BASIC “IF
THEN..."" command as described in the
Applesoft BASIC Reference Manual
(1978/1981) is:
IF expr THEN {:} [{:instruction}]
where “‘expr’’ refers to any legal Applesoft
BASIC expression, **instruction’’ refers to any
legal Applesoft BASIC statement, and ‘*{{:
instruction}]"" refers to an optional extension
of the program line that will be executed only
if ‘‘expr’’ evaluates as TRUE (i.e., any non-
zero value). Because conditional branching is
a common occurrence, Applesoft BASIC allows
conditional branch statements to be abbreviated:
IF expr THEN [GOTO] linenum
and
IF expr [THEN] GOTO linenum
where the bracketed command is implied. For
each of these statements, if *expr’’ evaluates
as FALSE (i.e., equal to zero), program
execution branches to the next numbered line
of the program, ignoring in the process any
instructions following the ‘‘THEN"’. The
20 Hardcore COMPUTIST No. 25
machine-language patch is transparent to these
statements; with the patch installed they still
function as described
ELSE and ELSE IF
With the patch installed, all versions of the
“IF... THEN..."" statement may be extended
on the same program line with the statement
““:ELSE:"*. Note that the colon is required both
as a prefix and a suffix of the “ELSE”
statement; otherwise, ‘ELSE"’ is assumed to
be a variable name and will be ignored by the
patch, The basic syntax is:
IF expr THEN {:} [{:instruction}
{:ELSE:} {instruction}]
The instruction(s) following t ELSE” will
be executed only if ‘expr’? evaluates as
FALSE, whereas the instruction(s) preceding
the ‘‘ELSE** but subsequent to the **THEN™*
will, as usual, be executed only if ‘*expr’®
evaluates as TRUE.
Conditional sequencing of decisions (i.c.,
“ELSE IF") is effected by following the
“ELSE” statement, either immediately or
subsequent to other commands, with an “IF’*
statement, as in:
IF X THEN 1000:ELSE:IF Y THEN
2000
Multiple “ELSE” statements on the same
program line are allowed. Each “ELSE”
statement is associated with the most recent
“‘IF"’ statement on the same line that is not
already associated with a preceding ‘‘ELSE"*
Statement. That is, ‘‘IF’’ and ‘‘ELSE"’
statements are associated in nested-pairs in a
Else”? To Applesoft
manner similar to nested ‘‘FOR... NEXT"
loops, More *‘ELSE"’ statements than
preceding ‘‘IF" statements on the same
program line, if executed, result in a
“SYNTAX ERROR” in a manner similar to
a “NEXT WITHOUT FOR" error.
GOTO and GOSUB
The Applesoft BASIC statements “GOTO”
and ‘‘GOSUB"™ (and their ON... GOTO /
GOSUB variants) complicate the meaning of the
same line rule for ““ELSE"’ statements cited
earlier since both of these commands result in
a branch from one line of BASIC code to
another. For the purposes of the “ELSE”
patch, the program line branched to is
considered to be an extension of the program
line branched from all subsequent lines,
however, even with a subroutine, are
considered to be new lines.
This complication is of no consequence for
“GOTO" commands, but it can limit the
effectiveness of “ELSE” statements in progrem
lines containing conditional *‘GOSUB**
commands (e.g., IF X THEN GOSUB
100:ELSE: ). The problem arises if the
subroutine terminates with a RETURN"
statement on a program line subsequent to the
‘one branched to by the conditional **GOSUB""
statement, or if the ‘RETURN"" statement is
the last command on the program line even
though the line is the one branched to. In both
cases, the ‘‘ELSE"’ patch will detect an end-
of-line (EOL) token, effectively forgetting the
prior ‘*IF"* statement that initiated the branch
Upon encountering any “*ELSE” associated
with the now-forgotten “IF"*, the program will
halt with a “SYNTAX ERROR"”. The cure for
the problem is a simple rule: Never precede
an “ELSE” statement with a con
“GOSUB” statement. This rule is less sev:
than it sounds since the rule is satisfied if the
““GOSUB™ statement follows the ‘*ELSE"
statement rather than the **THEN"’ statement
of an “IF - ELSE” pair. For example, the
program line:
10 IF X THEN GOSUB 100:ELSE:
PRINT X
will crash with a “SYNTAX ERROR™ on the
“ELSE” statement upon RETURNing from a
multiple-line subroutine at line 100, However,
the logically equivalent program line:
10 IF NOT X THEN PRINT X:ELSE:
GOSUB 100
will execute correctly
Installing the Patch
Start by using the instructions on page 2 of
this magazine key in the hexdump and save it
with:
BSAVE ELSE.OBJ,A$300,L$9C
It is assembled to reside in page three of
memory, but may be re-assembled with a
different origin to be located elsewhere (say,
above HIMEM). BRUNning the object code
from disk (or BLOADing it, then CALLing 768
from BASIC) will install the patch on the
system. The patch will remain active until
Applesoft BASIC is cold-started (i.e., either a
re-boot of the system or the DOS 3,3 ‘*FP”*
command). The patch is interfaced to Applesoft
BASIC through the Applesoft CHRGET
routine, Discussion of this approach to patching
Applesoft BASIC may be found in Kaner and
Vokey (1982) and Mossberg (1982)
It should be noted that CHRGET patches will
not function with the ProDOS BASIC operating
system,
Examples of the ELSE Statement
The simplest and probably the most common
use of the “ELSE” command is exemplified
by the following program line:
100 IF X THEN PRINT ““TRUE’
ELSE : PRINT ‘‘FALSE‘
Execution of this line will print “TRUE” if X
<> 0, and “FALSE” if X = 0. Program lines
of this sort may be used to replace the more
cumbersome line combination normally
required in Applesoft BASIC:
100 IF X THEN PRINT “‘TRUE‘
110 IF NOT X THEN PRINT
“FALSE*
An example of the conditional sequencing of
decisions (i.e., ELSE IF) is given by
100 IF X THEN PRINT “TRUE”
ELSE : IF Y THEN PRINT “‘TR'
: ELSE : PRINT “‘FALSE‘
In this case, execution of the line will print
“TRUE” if either X <> @ or Y <> 0, and
Hardcore COMPUTIST No, 25 21
“FALSE” if both X = @ and Y = 0.
The real power of the ‘*‘ELSE"’ command,
however, arises with the ability to nest “IF -
ELSE” combinations. For example:
100 IF X THEN PRINT “*X-TRU
IF Y THEN PRINT * + Y-TR'
ELSE : PRINT ** + Y-FALSE”
ELSE : PRINT ‘*X-FALSE”
If X <> @, then execution of the statement will
print either “*X-TRUE + Y-TRUE”™ or **X-
TRUE + Y-FALSE” depending upon whether
or not Y <> @, On the other hand, if X = 0,
execution of the statement will print simply
‘ALSE’.
Further examples of using the “*ELSE™
command may be found in the Applesoft
BASIC program “IF. THEN.ELSE.DEMO”
shown in Listing 2.
Notes on the Patch
Applesoft BASIC is an interpreted language
~ meaning that execution of a statement involves
the action of an interpreter that first determines
what operation(s) are to be performed and then
calls the appropriate routines(s). Full details of
this process may be found in Kaner and Vokey
(1982) and in many of Dr. Mossberg’s
Disassembly Lines columns in Nibble
Magazine.
To effect this process, the interpreter
re the statement using a short routine
known as CHRGET. Unlike the remainder of
Applesoft BASIC. this routine resides in RAM
and, hence, is modifiable. Redirecting calls to
this routine to the ELSE patch allows the patch
to interpret any statement before it is passed to
the interpreter. In this way, the patch is able
to determine whether an **IF"* statement is to
be executed, and is able to monitor for pending
“ELSE” commands.
If an “IF"* statement is encountered, the
patch evaluates the expression following the
“IF, If the result is FALSE (i.¢., equal to @),
the patch scans the remainder of the program
line for an ‘‘ELSE"" statement, noting any
subsequent **IF** commands in the process. If
a matching “‘ELSE" statement is found,
TXTPTR (a pointer to the next character in the
program line) is advanced to the statement
following the ELSE" and control is returned
to the interpreter. Otherwise, TXTPTR is
advanced to the next program line.
If the result of the expression evaluation is
TRUE (i,e., not equal to 0), control is passed
to the routine that normally handles execution
of TRUE "‘IF” statements, and a flag is set to
indicate to the patch that any matching *“ELSE™
(and all code following it) subsequent to the
““IF"’ on the same program line is to be ignored
(i.e., not sent to the interpreter). Monitoring
for a pending “ELSE” occurs until one is found
or until an end-of-line token (EOL) is
encountered. Thus, ““ELSE™’ statements not
preceded by a matching ““IF"’ will be passed
to the interpreter with a “SYNTAX ERROR”
as the correct result, and **ELSE"’ statements
and their associated code preceded by a
matching TRUE ‘‘IF"’ will not be executed.
Similarly, the code following the ‘‘ELSE™*
ELSE.OBJ Source Code
OR $300
TF ELSE.OBJ
@ cceeecrmn nsec So SUR ee ac SCTE *
* \F...THEN. . ELSE m
as SRS A SR ER UNIESTSS *
* Copyright (c) 1985 *
cs Softkey Pub! ishing *
4 —-~~------------------------ ~~ nnn nnn nnn nnn #
* EQUATES *
------------------------------------------------------------------------------ *
QOB1- CHRGET EQ $Bl CHRGET routine
Q0B7- CHRGOT £Q $B7
Q@B8- TXTPTR EQ $B8 TeXT PoinTeR
OD7B- FRWEVL £0 $DD7B — FoRMula EVaLuation
D9E1- INIF EQ S$D9E1 PART OF IF routine
QOAD- FF EQ SAD IF token
QOAB- GOTO EQ SAB GOTO token
Q0C4~- THEN EQ $C4 THEN token
D9DC- IFEXIT .£Q $090C FALSE-IF exit
O0B4- ELSFLG EQ CHRGET+3 Else statement to skip over?
@09D- FACEXP EQ $9D FAC exponent
O005- LENGTH EQ $5 length of ‘ELSE
DEC9- ERROR EQ $DEC9 = SYNTAX ERROR
--------~---------------------------------------------------------------------- *
* INITIALIZE *
& ------------------------------------------------------------------------------ *
9300: AQ 4c INIT LDA #$4C load a ‘JMP’
0302: 85 81 STA CHRGET store at CHRGET
0304: AS OD LOA #START low byte of interpreter
0306: 85 B2 STA CHRGET+1
0308: A9 03 LDA /START high byte
030A: 85 B3 STA CHRGET+2
030C: 60 RTS and return to BASIC
& ------------------------------------------------------------------------------ *
* SCAN FOR PENDING ELSE *
® -------------------------------------------------------------------+---~-------- *
30D: AS B4 START ~—-LOA ELSFLG pending ELSE?
030F: FO 18 BEQ NOELSE No, go
0311: 98 ELSCHK TYA Yes, save Y
0312: 48 PHA on stack
9313: AD 05 LDY #LENGTH use Y as index
0315: B1 B8 LOOP@ = —- LDA (TXTPTR).Y Get CHAR
9317: D9 96 03 CMP CMD,Y = Match?
O31A: 00 OE BNE FIXY No, go
O31C; 88 DEY Yes, try next
O31D: 10 F6 BPL LOOPO
O31F: A9 00 LDA #0 Clear FLAG
0321: 85 B4 STA ELSFLG
0323: 68 PLA Adjust stack
0324: 20 DC D9 JSR IFEXIT Move TXTPTR to EOL
0327: 4C B7 08 OUT JMP CHRGOT and exit
032A: 68 FIXY PLA Recover ¥
032B: AS TAY
* ---------------------------. -%
* \F CHECK *
Eee rena nS ee a + a ae SOE SRN. vere Serenata eer ee %
22 Hardcore COMPUTIST No. 25
932C; 20 8D 3 NOELSE JSR ADVTXT Next CHAR
032F: C9 80 CMP #0 EOL?
9331; DO 04 BNE |FTST No, test ‘IF’
0333: 85 B4 EOLOUT STA ELSFLG clear FLAG
0335: FO FO BEQ OUT always taken
9337: C9 AD (FIST CMP #1 FF IF Token?
0339; DO EC BNE OUT No, exit
9338: 20 8D 03 IFEVAL JSR ADVTXT Yes, next CHAR
033E: 20 7B 0D JSR FRMEVL Evaluate expression
9341; AS 9D LOA FACEXP TRUE or FALSE (1 or 0)?
9343: FO 1D BEQ TKELSE FALSE, take ELSE
0345: 85 B4 STA ELSFLG TRUE, flag pending ELSE
0347: 20 87 00 JSR CHRGOT Recover CHAR
034A: C9 AB CMP #GOTO == GOTO _ token?
034C: FO OE BEQ DOIF Yes, do it
O34E; C9 C4 CMP #THEN THEN token?
9350: FO 03 BEQ DOIFO = Yes, do it
9352: 4C C9 DE JMP ERROR No, SYNTAX ERROR
0355: 20 8D 83 DOIFO JSR ADVTXT Get CHAR after ‘THEN’
9358: C9 AD CMP #1FF IF token?
@35A: FO DF BEQ IFEVAL Yes, evaluate it
935C: 20 £1 D9 DOIF JSR INIF Do THEN
O35F: 4C B7 00 JMP CHRGOT and exit
Ne Ne oe eS is SER: SR a OA *
* TAKE ELSE 4
a Er ar le RE RR Se *
0362: £6 9D TKELSE “INC FACEXP IF’ count
0364: 20 80 03 LOOPl JSR ADVTXT next CHAR
0367: 20 87 OB LOOP2 JSR CHRGOT Recover CHAR
036A: FO 06 BEQ TSTEOL If Z then test for EOL
@36C: C9 AD CMP #1FF IF token?
O36E: DO F4 BNE LOOP! No, try next
0370: FO FO BEQ TKELSE Yes, increment count
0372: C9 00 TSTEOL CMP #0 eol?
0374: FO BD BEQ EOLOUT Yes, exit
0376: AQ 01 TSTELSE LDY #1 index
0378: 20 80 03 LOOP3 JSR ADVTXT next CHAR
0378: D9 96 03 CMP CMD,.Y = match?
037E: 00 E7 BNE LOOP2 No, try next
0380; CO 05 CPY #LENGTH Yes, done?
0382: FO 03 BEQ TSTELSE2 Yes, one down
0384: C8 NY i
0385: 00 Fl BNE LOOP3 go again
0387: C6 9D TSTELSE2 DEC FACEXP any more to go?
9389: 00 EB BNE TSTELSE Yes, do it
0388: FO 9A BEQ OUT No, exit
eee ea eet eae tla *
* ADVANCE TXTPTR *
HE et *
0380: £6 B8 ADVTXT INC TXTPTR Replace chrget
O38F: DO 02 BNE EXIT to allow processing
0391; £6 B9 INC TXTPTR+1 of BASIC commands
0393: 4C 87 00 EXIT JMP CHRGOT
9396: 3A 45 4C
0399: 53 45 3A CMD AS *:ELSE:”
statement of a matching FALSE “IF" will be
executed in place of the code immediately
following the “IF*.
Suggestions on Extensions
One obvious extension to the patch is to
remove the *‘on the same line’ rule. This
extension could be implemented by having the
routine monitor both within and across program
lines for, say, an ““ENDIF”’ statement, rather
than an EOL before ceasing its search for a
matching or a pending *‘ELSE” statement
While such an approach has much commending
it (it would, for example, emulate the Pascal
language's implementation of **IF"’), it also
would require that all ‘‘IF** statements be
followed at some point in the program by the
“ENDIF™ statement, eliminating BASIC’s
usual (and often useful) handling of “IF
commands. Moreover, it would require some
method of keeping track of nested IF"
statements, s
Showing the first 100000 of 141853 characters.