Text content (OCR)
Releasing the power to everyone.
duly 1985
Vol. 1, No.6
Sculley reorganizes Apple, Inc.
Apple's Macintosh division finally got its balloon punctured May 31, when
John Scully, Apple's president, announced a reorganization of the company,
‘Two weeks later, on June 14, Apple announced it was moving the production
of the Apple IIc to its “Macintosh” plant in Fremont, Calif; moving production
of all Iles to its factory in Singapore; and firing 21 per cent of its work force.
Sixty per cent of the firings are among manufacturing workers. All Apple
factories, except the Fremont and Singapore plants and one in Cork, Ireland,
will be closed,
Apple’s board of directors decided to allow Sculley to reorganize the
company from two product-oriented divisions (Apple Ii and Macintosh) into
two function-oriented divisions (operations and marketing). In the shuffle
Steve Jobs, founding father and chairman of Apple, lost his operating
responsibilities, (previously he had direct control over both the manufacturing
and marketing of the Macintosh). He remains chairman of the company.
Del Yocam, the Apple veteran who had been in charge of the Apple II
division, is nowhead ofall operations, including manufacturing, distribution,
and new product development. Yocam, 41 years old, joined Apple in 1979.
Yocam’s accomplishments at Apple include coordinating the manufacturing
changeover from the Apple IL-Plus to the Apple Ile in late 1982, and
overseeing the development and introduction of the Apple llc. In a Wall
‘Street Journalarticle on Yocam and Apple (June 7, page 18), Steve Wozniak
said that during Yocam’s tenure, “the direction of the Apple II division is the
best it has been in five years.”
Jean-Louis Gassee will work for Yocam as head of product operations,
which includes new product development. In 1980, Gassee formed an Apple
distributorship in France. The distributorship later became Apple France, a
company subsidiary. Under Gassee, Apple France captured about 30 per
centofthe French personal computer market; more than IBMand more than
Apple's share in other countries. In its June 10 edition, InfoWorld (page 15;
caution, this article was written before Sculley’s reorganization and has
Gassee’s position wrong) describes Gassee as an intellectual and a visionary
—amore mature French counterpart to Steve Jobs. However, he is also said
to be an experienced turnaround manager and to have an ability to satisfy
dealers.
Apple‘s new marketing division will be headed by William Campbell, who
was recruited by Sculley in late 1983 from Eastman Kodak. At Kodak,
Campbell was director of consumer product marketing in Europe. At Apple,
he had been directly associated with neither the Apple II nor Macintosh
divisions, but was the top marketing person on Apple's corporate staff.
Sculley's reorganization is the result of a leveling-off in the growth rate of
personal computer sales. Apple's sales are actually higher than last year,
however, they are not as high as planned. (In 1984 Apple's revenues were 54
per cent higher than the previous year. 1985's growth in sales will be
considerably less.) Because of costs associated with the reorganization,
Apple expects to post its first quarterly loss at the end of June.
The slowdown in the growth rate of computer sales is affecting the entire
industry. The usual profit growth Wall Street has become accustomed to just
isn’t materializing this year. IBM has announced that it expects no change in
profits during the first nine months of 1985 compared to the previous year.
Apple expects to eam a lower profit this year than last. Wang, for the first time
in its history, is predicting it will eam no profit at all.
The slowdown has hurt Apple more than IBM because the situation is
worse in the consumer market, where Apple is strongest, than in the
business market, where IBM leads. Much like just before the IBM PC jr
appeared on the scene, many consumers are delaying computer purchases
until new, Macintosh-like computers announced by Commodore and Atari
are on dealers’ shelves. Look for Apple Il sales to surge—and shortages to
develop—when those machines finally hit the streets, just as happened
when the PC jr came out of IBM's closet.
My Two Bits
ron a
Apple hasn’tasked for my advice (merely
two subscriptions have been paid for with
checks from Cupertino...) but let's take a
look at the Apple Il family and send a few
thoughts about the future back to California
anyhow.
For six years now Apple's management
has been trying to build acomputer better
than the Apple II. During those six years
the scomed I! has provided Apple with
millions of dollars for research and devel-
opment. The money was spent on the
Apple Ill and Lisa, both now dead, and the
Macintosh, which isn’t dead yet. In all
these years, after all this money, only the Apple II has ever shown a profit.
The message here is that computer buyers are not looking for the fastest
chips, the biggest memory, the best graphics, or the largest disk drives. They
aren't looking for “user-friendliness” that sacrifices programmability and
speed for mice and bit-mapped trashcans.
Buyers are looking for tools they can use. The Apple I has plenty of power
to be useful. So have several hundred other machines.
The significant thing about the Apple Il is the community of people that
has sprung up around the machine, teaching other people how to use it,
developing applications for it, designing hard and software for it. It is this
community that makes the Apple Il a significant machine. It is this
community that is the driving force behind Apple Inc's phenomenal growth.
The fastest road to glory for Apple is to continue a slow evolution in the
Apple II family. The fastest road to ruin is to develop machines that abandon
this community in Apple's technological wake.
The Apple 1! community is averse to walking away from its hard-eamed
understanding of the Apple Il. Ifthe community can’t leverage its accumulated
knowledge into better explanations for new users, better applications, and
better hard and software, a new machine will not get its interest. If we are
forced to walk away from the Apple II, we are as likely to walk in the direction
of IBM or Atari as in whatever direction Apple Inc is “leading.”
Aslow evolution would allow features to be added to new high-end models.
But the compatibility of these new models with previous modelsis a far more
important issue ss the latest technological wizardry.
means a microprocessor based on the 6502, Applesoft
in ROM, Apple Il-compatible memory mapping, Apple I-compatible
slots, and 5-1/4 inch disk drives as standard equipment. It means
computers that will start up DOS 3.3 disks with no special handling.
And it means reasonable prices. Any computer that has these features
will be a success in the marketplace
50 Open-Apple
From its base in education, the home, and small business, the Apple II's
market could be gradually broadened to include larger organizations by the
introduction of more powerful machines and software. The technology is
available to build a family of computers around the Apple II.
‘At the top could bea true 16-bit computer based on the 65816 micropro-
cessor. It should have a ton of memory. But it should also have some
standard Apple II slots. How about a souped-up version of AppleWorks to go
with this machine, with macros, graphics, terminal-emulation software, and
desktop accessories? But be careful, Apple. Unless this machine can also
boot and run APPLEVISION, the early Integer Basic hi-res graphics and
sound demonstration program, it’s not an Apple Il.
In the middle could be a “16-bit” computer based on the 65802. The
65802 has intemal registers 16 bits wide but reads and writes to and from
memory 8 bits ata time (just like the IBM-PC). Because of this, and because
(like the 65816) it acts like a 6502 when you turn it on, you can actually plug
one of these into an existing Apple II. Imagine a machine with 256K to 1
megabyte of memory built around one of these at the price of today’s Apple
lle. But it’s gotta run APPLEVISION.
Then there's the Ile and IIc. Gradually falling prices and the inclusion of
AppleWorks in the box with the computer could extend the lives of these
machines beyond anything IBM ever dreamed of. And we already know they
run APPLEVISION.
In addition to computers, Apple can look for growth in the peripherals
market. With the major exception of the Laserwriter, Apple has shown no
technological leadership at all in the area of printers, modems, or monitors.
An add-on 800K 3-1/2 inch drive, at a good price, could certainly be a
successful Apple Il peripheral (but its incompatiblity with existing software
would crush the sales of any “Apple II” it was built into).
And how about special private label models of the Il that could be sold to
companies that want to build other things out of them? This is a market
Apple has totally ignored. Since starting Open-Apple, I've corresponded with
people who have Apple Ils at the center of electronic weighing systems, cash
registers, and library circulation systems, among others. These people all
sell products that happen to include Apple Ils. Because there are so many
people in the world who know how to make an Apple Il dance, there is a
tremendous unexploited market here. It's easy to imagine Apples hidden
away at the heart of security systems, engine or blood or fertilizer analyzers,
or (dare ! say it?) telephones. But Apple has to learn to pursue these “low-
tech” Apple Il-based markets and stop wasting its resources trying to seduce
the Fortune 500 with the Macintosh.
Does Apple's sudden reorganization mean the people who run it have
finally realized the potential shyly hiding inside the Apple II? We'll have to
wait and see.
Digging
Into DOS
The /RAM disk that ProDOS automatically installs on 128K Apples is a
feature that can be hard to take advantage of. Ifyou have avery big program,
you can theoretically split the program into sections, put the sections on /
RAM, and use the CHAIN command to quickly move from one section to
another. Or, if you have a small program but a large data file, you can
theoretically put the data file on /RAM and access it at the speed of light
instead of your disk drive's 300 RPM.
To change these ideas from theory to practice, however, requires a
program that will copy files from disk to /RAM when you start up your
computer, and from /RAM back to disk just before you turn it off. You canuse
the ProDOS FILERfor this, but it doesn’t give the kind of automatic operation
most computer users are looking for.
Several subscribers have written asking for a Basic program that can copy
files from disk to /RAM and back. Such a program tums out to be extremely
simple to write because of some powerful parameters. Basic.system provides
for binary file commands. Since many people haven't discovered this power
yet, let's examine these parameters and write a basic Basic copy program for
ProDOS.
Vol. 1, No.6
ProDOS and Basic.system version numbers. Before we start, let's talk
about the various versions of ProDOS, since there are some version
differences in how the binary commands work. Before we can even talk about
versions, however, let's talk about something even more elementary—the
difference between the ProDOS kemel and Basic.system. A major fault with
the ProDOS documentation, beginning with Apple's stuffand extending right
through almost everything else that has been written, is a failure to
distinguish between the ProDOS kernal and Basic.system.
The ProDOS kemal lives in a file called PRODOS. I've found four official
versions in my disk library (there may be more); L011 (1-JAN-84), 1.0.2 (15-
FEB-84), 11 (17-AUG-84), and 1.11 (18-SEP-84). You can tell which version is
on a disk by cataloging the disk and looking at the date the file was last
modified (not created, that's when the FILER putiton your disk). Youcan also
tell by booting the disk and watching the screen carefully. The version
number of the ProDOS kernel and a copyright notice appear for about 4
seconds while the disk is booting.
ProDOS is accessed through a machine language interface. The ProDOS
kemel supports no other language, only machine language. Ithas commands
such as set_file_info, get_eof, and alloc_interrupt. It doesn’t know control-D
from synchronous idle. It doesn’t even have a CATALOG command.
Basicsystem lives in a file called BASIC.SYSTEM. It's been officially
released in only two versions that I can find; 1.0 (15-NOV-83) and (15-MAR-84)
and 1.1 (18-JUN-84). You can tell which version is on a disk by cataloging the
disk and checking the date. You can also start up BASIC.SYSTEM in such a
way that it can’t find a STARTUP file (temporarily change the name of the
STARTUP file to something else); Basicsystem prints its version number
after booting if there’s nothing to start up.
The commands everyone refers to as “ProDOS” commands, such as
CATALOG, BLOAD, and PREFIX, are really “Basicsystem” commands.
“Basic.system” is the connecting link between Applesoft and the ProDOS
kemel. Basic.system provides a DOS 3.3-like control-D interface for Basic
programmers working under ProDOS. The likeness to DOS 3.3, however, is
not a feature of ProDOS; Logo runs under ProDOS and can't even print a
control-D.
Binary file anatomy and execution. Binary files typically hold either
machine language programs or high-resolution graphics images. They're
the ones identified by BiYin a disk’s catalog,
Binary files can be executed with either the DASH ("-”) or the BRUN
command, like this:
~ Iny .D1SK/my.PROGRAN
BRUN /mY.O1SK/MY. PROGRAM
These commands work best, of course, if the file really is a machine
language program. If the file contains a graphic or hides some other type of
data, an attempt to execute it will usually make your computer lock up or
crash into the Monitor.
Think of binary files as “snapshots” of portions of your computer's
memory. They are very similar to the photographic images a Kodak takes.
However, they have one significant advantage — you can snap them back into
memory the next day and take up where you left off. That's something we
can't do yet with my baby pictures.
When you take a snapshot of memory, you have to specify what address
range you want to take a picture of. Basicsystem provides three parameters
for doing this. The A parameter (address) specifies where in memory the
range starts. You specify where it ends with either the E parameter (end),
which gives the address of the last byte in the range, or with the L parameter
(length), which tells how long itis.
Basicsystem stows this memory-position information, along with other
data about the file, inside the disk’s directory. The 80-column ProDOS
CATALOG will dig it back out for you. Here’s a ProDOS catalog with a file
holding a hi-res picture. The address of the file is given (in hex) under
“subtype;” the length is given (in decimal) under “endfile.”
NAME TYPE BLOCKS MODIFIED CREATED ENDFILE SUBTYPE
PRETTY.PIC © BIN. 17. A-JUN-85 7:47 31-JUN-B5 7:47 8192 A=$2000
Ifyou use the DASH command to execute a program, Basicsystem will use
the addresses in the directory to determine where to load the file. The same.
thing happens with the BRUN command, although with BRUN you can
override the “default” addresses with the A, E, or L parameters,
Get a load of this. Binary snapshots can be loaded into your computer
without executing them with the command BLOAD. A feature found in
Basicsystem’s BLOAD and BRUN commands that's not in DOS 3.3 is thatyou
Downloaded from www-ApplezOnline.com
duly 1985
can use the L (or E) parameter to load just part of a binary file. You don'thave.
to load the whole thing, If you use the L parameter with BLOAD or BRUN
under DOS 3.3 you get a syntax error.
Another difference from DOS 3.3 is the Basic.system file type parameter,
T. This parameter can be used with BLOAD (but not with BRUN) to load any
type offile into memory as if it were a binary snapshot. This isa very powerful
feature; without it our soon-to-follow basic Basic copy program would be
impossible.
The binary savior. Binary snapshots are created with the command
BSAVE. If the file doesn’t already exist, you have to specify an address range
for the picture. Here’s an example:
SAVE PRETTY.PIC,962000,L 52000
or
BSAVE PRETTY.PIC,ABL92,E83F FF
When the file doesn’t already exist, BSAVE will create a new one and tuck
your snapshot into it An interesting side effect of using BSAVE with the file
type parameter, however, is that with T, BSAVE can't create new files. Itretums
a PATH NOT FOUND error, even if the file type you specify is BIN.
If the file does already exist, on the other hand, Basic.system has some
more magic for us. Unlike DOS 3.3, Basicsystem doesn’t make you specify
an address range for existing files. BSAVE PRETTY.PIC works just fine—
Basic.system will use the existing address and length information.
The big difference between Basic.system 10 and 1.1 is what happens when
the file already exists and you specify a different address range. With LO, as
with DOS 3.3, the old address range is thrown out and the new one is used. If
the new range is shorter than the previous one, any unneeded disk blocks
are released. With 11, on the other hand, the old address range is retained. (If
the new material makes the file longer, however, the file length will be
increased as required.)
‘Sandy Mossberg (letter in Nibble, June 1985, page 7) and Glen Bredon
(letter in Open-Apple, May 1985, page 40), both competent authorities on
such stuff, say this is a bug in Basic.system 11.
But Ken Kashmarek and Cecil Fretwell, also competent authorities, argue
in letters to Open-Apple that it's not a bug at all. More about this is a
moment.
It’s painful to B misunderstood. First, though, let's examine the most
misunderstood little creature in all of Appledom, the B (byte) parameter. B
got off on the wrong foot in the original DOS 3.3 documention, The DOS
Manual. That book had a two-page section on the B parameter that began,
“Note: the following section is not for beginners...”, and which consisted
mostly of warnings about all the problems you could create by using the B
parameter inappropriately.
In the later DOS Programmer's Manual, this two-page section is missing,
What little information on B that is presented in this book is only partially
correct.
In Basic Programming with ProDOS, the B parameter loses even its entry
in the index. No examples of how to use the parameter are given. And the
tradition continues in Gary Little's ProDOS series running in A+ and in Lee
Swoboda's series running in inCider—neither of them say much about B
and both of them have its maximum value wrong.
The B parameter allows you to quickly and easily move the position-in-file
pointer to any byte in a file. Unlike DOS 3.3, Basicsystem allows you to use B
with BLOAD and BSAVE. B can also be used (under both DOS 3.3 and
ProDOS) with READ and WRITE, but this is more complicated; for a complete
discussion see the August 1984 DOStalk (in Softalk, page 43).
When you use B and L (or E) together, you suddenly have some amazing
new binary-file-handling abilities. You can put several graphics in the same
file and access them one at a time. You can put several programs in one file,
too.
The best part, though, is using B and L (or E) and T together at the same
time. This allows you to read and write records to and from any part ofa text
file at binary-file speeds. For example, imagine a hard-disk based data file
with 1,000 records, each 1.200 bytes long. Reading in a 1,200 byte record can
take awhile with INPUT; but imagine how long it would take with:
PRINT DS;“BLOAD OATA.FILE, TXT, 984000, L1z0@, 8°:R#1200
That command would load the 1,200 byte record specified by R into the
memory range beginning at $4000 in a fraction of the time INPUT would take.
But consider for a moment the equivalent command for saving to the data
file, and you'll understand why our correspondents Kashmarek and Fretwell
don’t see a bug where Mossberg and Bredon do:
Open-Apple 51
PRINT OS;“ESAVE DATA.FILE, TIT, 84000, L120, B°sRELZ00
If Basic.system’s BSAVE works like DOS 5.3's in this situation, all the data
in the file beyond the current record gets cut off and thrown away. That's not
an acceptable alternative.
But, on the other hand, if BSAVE doesn’t adjust the length of binary files,
you'll often end up with files that have junk tacked on the end—as frequently
happens with text files.
Ifthe ProDOS modification team thinks like | do, someday they'll fix BSAVE
so it cuts off the end of the file, but only if no file type parameter is given.
Treat the T like Mr. T, I say, and don’t cut anything from files when a BSAVE
uses it.
Xerox will love this. Now that everybody understands the magic of
BLOAD and BSAVE under Basic.system, let's write a quick routine for copying
files from disk to /RAM and back. We'll BLOAD the files with one prefix, then
quickly BSAVE them with another prefix. Just one problem; wherein memory
do we load them? Our program and its variables will be in memory
somewhere; it's important that we don't load a file on top of anything.
Refer back to the memory map in our January article “Taking a poke at the
Garbageman’ (page 4). The map shows that there's an area of free memory
between a Basic program’s variable tables and its string storage area. The
map shows what bytes to peek at to find the boundaries of this free area. And
the article explains that the FRE command makes this area as large as
possible.
So, to get some memory we'll execute a FRE command; peek into the
location knownas STREND at 109-110 ($6D-6E) to getan Address parameter;
and peek into the location known as FRETOP at 111-112 ($6F-70) and
subtract 1 to get an End parameter. How about:
10 REM *#* BRSIC.COPY #ex pee P76
REN prefix of volune that files are to be copied FRON
EM prefix of volume that files are to be copied 70
2 TS="TXT” : GUSUB 490 : REM names and types of
140 FS="FILE2” GOSUB 400: REM Files to be copied
180 FS="FILE3” “BIN” : GOSUB 400
200 ENO
400 8-0 4 L+O : REM Inportant--messing with this line can be fatal
410 PRINT D8:"FRE™
420 A=PEEK(199) + PEEK(110)+256
425 E=PEEK(111) + PEEK(112)*255
430 ONERR GOTO S80
449 PRINT DS;°CREATE”; P2S;FS3 "1°31.
450 PRINT DS;"BLOAD": PIS:FS: “T°: TS:
460 L=PEEK( 48853) + PEEK(48860)#256
470 PRINT DS;"BSAVE”; P2S:FS; “,T°sT8; *¥!
480 IF L=(E-A) THEN B-B+L : GOTO 450
490 POKE 216.0 : RETURN
=19 THEN PRINT 03:°DELETE™; P25iFS = RESUME
THEN CALL -3286 : GOTO 450
520 PRINT “ERROR 8°;PEEK(222);” IN LINE “;PEEK(218) + PECK(219)#255
530 END
Don't mess with line 400. It makes sure all the variables used in the
routine have been allocated space in memory before we find out how much
free space we have. Ifa variable is used for the first time afterwe do our peeks
to determine A, the variable table will get moved up into our free space with
not inconsequential consequences.
Since BSAVE—when used with the T parameter—can't create files, we
have to CREATE a file for our /RAM copy in line 440. If the file already exists,
{as it most certainly will when we copy from /RAM back to disk), a DUPICATE.
PATHNAME error will occur and line 430’s ONERR will take us to line 500. The
error code for duplicate pathname is 19; line 500 deletes the file and
RESUMEs back to the CREATE command.
Line 450 BLOADS the file. If the file is shorter than what we have specified
with the E parameter, no error will occur. Ifitis longer, Esees to itthat we load
only as much of the file as will fit Loading begins with the first byte of the file
(byte 0).
Line 460 peeks at a Basic.system location known as RWTRANS at 48859-
60 ($BEDB-DC) to find out how many bytes actually were loaded by the
BLOAD command. (The equivalent location in DOS 3.3 is 43616-17 ($AA60-
611); the actual loading Address can be found at 48855-56 ($BED7-D9), this is
equivalent to DOS 3.3's 43634-65 ($AA72-73).)
52 Open-Apple
Line 470 BSAVES the file using it’s actual Length. This Length will transfer
tothe newcopy ofthe file correctly. However, ifthe file really is a binary file, the
copy’s loading Address, as shown in the catalog, will be wrong. So will the
record length (R=) of text files. Basicsystem 1.0 shows the address we used in
parameter A, not the one on the original file, for both Address and record
length. Version 11, on the other hand, sets both to zero. (Incidentally, ifyou try
to BLOAD a file with a loading address of zero you get a NO BUFFERS
AVAILABLE error. This message is quite confusing, because the problem has
nothing to do with buffers; the ProDOS kemel simply refuses to load files into
that address because the area is “protected” in the "system bit map.’)
These problems are fixable, but not this month. For now, always specify A
and L when using files copied by this techinque.
Line 480 looks to see if we got the whole file or if there is more of it still on
the disk. Ifthe actual Length we got was less than the End minus the Address,
we gotit all. If these values are equal, the file was either exactly the same size
as our free memory area, or there is more. In either case, adjust the B
parameter so it points to the first byte we didn’t get, and go back to line 450.
The second time we execute BLOAD, the B parameter points well inside
the file. We'll get a bunch more ofit; this will continue until we have the whole
file. If we should run across a file that accidentally has the same number of
bytes as our free space, line 450 will get an END OF DATA error. Line 430's
ONERR will then take us to line 510, where we clear the stack (see January's
Digging Into DOS, page 2), and retum to the caller.
There you have it—a basic Basic copy routine.
This one didn’t stick. In preparing this article, | took a look at whatall the
books I have on ProDOS had to say about binary files. This brought me face-
to-face with the fact that Chapter 6 of Prentice-Hall's Inside Apple's ProDOSis
an idea-for-idea rip-off of Chapter 9 of Apple's own Basic Programming with
ProDOS. For example, compare these two sentences:
Vol. 1, No.6
Because of the way ProDOS uses memory, it is difficult to predict which
parts of memory are free to hold machine-language routines.
Because of the way ProDOS dynamically allocates and deallocates
memory for file buffers, it is somewhat more difficult to manage memory
and guarantee which parts of memory will be free to store and protect
machine-language routines,
The first sentence is from Apple's book (page 154), the second from Inside
Apple's ProDOS (page 100), which was published by Reston Publishing
Company, a division of Prentice-Hall. The whole chapter is like that. | didn’t
compare the entire contents of the two books, only this chapter; I don’t mean
to say there is anything illegal about this type of paraphrasing, because |
don't think there is.
The problem is that it's a disservice to both customers and to legitimate
writers when publishing companies flood the market with this kind of crap.
Compare the two sentences and you'll see Apple's original wording is much
clearer. In Prentice-Hall’s version, try to figure out what managing memory is
more difficult than. It makes you wonder whether the book was even copy
edited.
As it happens, both books do an inadequate job of explaining how to
install machine-language routines in memory. (See Softalk, June 1984, page
159, for an adequate explanation.)
As a book buyer, you should be aware that Prentice-Hall’s publishing
philosophy is to throw lots of books on the market and see what sticks. Some.
of them turn out to be quite good, for example, the Quality Software books
published by Brady Communcations, also a division of Prentice-Hall
(Understanding the Apple Ile by Jim Sather and Beneath Apple ProDOS by
Don Worth and Pieter Lechner). More of them, however, tum out to be
mediocre at best, including Inside Apple's ProDOS. Buyer beware.
Miscellanea
Adding commands to Basic.system is becoming a good-sized cottage
industry. Apple's ProDOS development team put some neat features in
Basic.system that allow any number of special routines to be hidden away in
memory and called as DOS commands. Lots of stuff that uses this feature is
coming out of the woodwork and much of it is quite interesting.
Glen Bredon (321 State Rd, Princeton, NJ 08540), author of the Merlin
assembler, has a $20 disk he is selling himself called /PROCMD. Itincludes a
number of Applesoft editing and debugging utilities, and then some. The
disk has a GPLE-like editor; renumber, hold, and merge commands; cross-
referenceand current value dumps for variables, as well as avalue tracer that
works while a program is running; copy, sort, type, memory dump, date, and
print-using commands; and a double-high resolution graphics package. The
documentation is included on the disk. (Incidentally, Glen wrote to say that
he documented the changes in IIc Applesoft that we trekked through here
last month well over a year ago in the Applesoft source code that comes free
with the Merlin-Pro assembler —$70 from Roger Wagner Software, P.O Box
582, Santee, CA 92071)
Aroutine for stepping through ProDOS directories is part of another
interesting disk that appeared in my mailbox. It's called Developer Disk #1
($7 from Nite Owl Productions, 5734 Lamar Ave, Mission, KS 66202). This
disk hasa bunch of routines to assist in the development of programs for the
Night Owl Journal, a magazine-on-disk scheduled to begin publication this
month. The command that steps through directories is called “Quick Index:
It allows users to quickly find and select a file even if it's buried inside
multiple subdirectories. This is a neat feature we should see more of in
ProDOS software. A GETFILE command on this disk allows such selection
from within Applesoft programs. The name of the file the user selects is
returned in a string variable. Also on this disk are three new INPUT
commands. One simply accepts commas and colons; the other two support
the underline cursor and delete key, as well as provide GPLEvlike string
editing functions. One of these is for inputting new strings; the other allows
the user to edit existing strings.
The ability to mix routines from various authors is the best part of
Basic.system’s added commands feature. For example, you can mix Nite
Ow!'s input-anything GETSTR command with Bredon’s print USING command
to quickly add the two most needed features to Applesoft. Very little memory
is used because the commands can be added independently of the rest of
the commands they come with. Authors of such routines have to know what
theyre doing, however, to get routines to mix. Several extra steps are
required to assure a routine will work with others,
Unfortunately, Apple has never documented what these steps are. (In fact,
Apple’s own added-command routines, HELP and APA, which are on the /
EXAMPLES disk that comes with Basic Programming with ProDOS, don’t
take these steps and can’t be combined with other routines.) The June 1984
DOStalk (Softalk, page 157), however, did list the required steps and
pompously called them the DOStalk Protocol for adding machine language
utilities to Basic.system. Itwould be helpful ifthose of you write these utilities
state in your documentation whether you have followed this protocol or not.
Refer to the DOStalk article for complete details if you are writing such
routines. Here’s a summary of the protocol:
1. Use Basic.system’s GETBUFR call to allocate menary for your routine.
Be prepared to relocate your routine anyuhere; don’t expect to be
the first or only user of GETBUFR.
2. Never use Basic.systen’s FREEBUFR call; the only crash-proof way to
free the buffers is to restart Basic.systen,
3. When connecting your routine to Basic.systen’s EXTRNCHD vector or to
Applesoft’s AMPERSAND vector, save uhat’s already in the vector and
daisy-chain to it if the call is not for you.
The DOStalk article this originally appeared in included source code fora
public domain TYPE command. This command displays text files on your
Screen or printer and demonstrates how to use the protocol. The command's
only failing is that it doesn’t accept lower-case commands; something all
added commands should do. Don’t bother to type in the source code from
that article, however, the DOStalk TYPE command was included on a recent
disk distributed by the International Apple Core and consequently is
available in user group libraries. The disk is /IAC.44. It also includes a
ProDOS version of File Cabinet, an early public domain database program
for the Apple II.
Extra 65C02 bulletins
Your old chums at Beagle Bros just put out Extra K,
adandy set of programs that let you use the extra 64K
in alc or 128K Ile. They mention that if you use the
program that puts variables into the extra 64K, you
need to modify existing machine language routines
for sorting arrays and strings. Do you have any tips on
how to do this?
I'm told that the 65C02 included in the enhanced
ROM upgrade kitwill allow my Apple Ile to run cooler
and slightly faster. Is this true?
Do you know if the Sider hard drive performs well
with bulletin board systems? I plan to put up a board
for my department very soon, and would appreciate
any input or tips from others who may already be
using it for that purpose.
Peter Chin
Brooklyn, NY.
Beagle Bros’ ace programmerstell me they haven't
figured out yet how to get machine language sorts to
work with variables stored in auxiliary memory.
They point out that if you're not in a hurry, sort
routines written in Applesoft will work with Extra K.
1 personally think the 65C02 is the most over-
hyped item to come down the Apple I! pike in some
time. It’sa nice little chip, and it does run cooler, butif
it produced no heat at all it wouldn't significantly
affect the temperature inside an Apple II-Plus or Ile
because of all the other stuff in there. Bob Sander-
Cederlof at Apple Assembly Line tells me there is one
set of infrequently-used machine language instruc-
tions that executes in 6 cycles rather than 7, however,
there is another set that executes in 7 rather than 6,
so there's nonet gain there. Programs written to take
advantage of some new instructions in the 65C02
could potentially run slightly faster; no programs
that! know of, however, other than SuperCalc 3A and
the IIc firmware, use the new instructions — including
the enhanced Ile firmware. Bob also pointed out the
chip is available from the manufacturer in versions
capable of running faster than the fastest 6502,
however, the Apple I! is unable to take advantage of
this capability without adding a special card.
The Apple user group in Phoenix had a newsletter
article last month about setting up a bulletin board
using a Sider and a ProDOS-based bulletin board
system called GBBS II ($95 from Micro Data Products,
5739 South Olathe Court, Aurora, Colo. 505-699-
1161). The gist of the article was that they were quite
happy with the system, however, they admit it tooka
club member with bulletin board experience 30 to
40 hours to get everything set up as they wanted it.
The author of the article was Jerry Cline, who
mistakenly let somebody put his phone number in
the newsletter: 602-992-7035.
Short end of joystick
I have been enjoying Open-Apple since the first
issue. | am, however, a little disappointed too. | own
(and use a lot!) an Apple Il-Plus with shift key modifi-
cation and a 16K RAM card. Almost everything you
print is geared to the lle or llc.
| would like to know such things as which of the
newer chips I can use in my IL-Plus (and tips on
installation), what advantages they could give me,
and whether or not patches are available so that | can
use such software as AppleWorks or other new
software that was not designed with the I-Plus in
mind. | use Applewriter II and Screenwriter. Could |
use the new revised Apple Writer? Can | functionally
do anything to make more than 64K available to the
commercial software | use? | still have DOS and am
‘contemplating getting a CP/M card. I'm really beginning
to feel left out when I look at the recent Apple
software,
I'm reasonably sure that I'm notalone among your
readers. Do think about us I-Plus people too, With
that off my chest, | should say too that you are the
best thing for Apple users since Softalk died.
Hannah Lerman
Los Angeles, Calif.
‘The Apple Il-Plus is a classic. A lot of the stuff in
Open-Apple works ona Il-Plus as well as a lle or lic
—particularly programming information. However,
‘as you point out, a lot of other stuff doesn't.
There is no advantage to using newer chips or
adding memory to any version of the Apple I untess
you also have software that will take advantage of
the changes. Almost none will so— there's very little
to write or talk about in this area other than
programming.
New “productivity” software (word processors,
spreadsheets, etc.) is written for the Ile and IIc
because they have full keyboards, a standard 80-
column screen, and a standard way of adding extra
memory. Most of this kind of software, such as
newer versions of Apple Writer, won't run on a Il-
Plus because it has no standards in these areas. On
the other hand, a great deal of II-Plus compatible
software is being developed and released, but most
of it is in other categories—education, games,
utilities, and specialized applications.
The idea of adding CP/M capability to your machine
is a good one if your are committed to the II-Plus,
Because CP/M was designed asa ‘universal’ operating
system to begin with, its programs adapt to various
keyboard, memory, and 80-column schemes more
easily.
The day will finally come, however, when you will
decide to get a newer computer. The Open-Apple
information that now seems irrelevant to II-Plus
users will be much more meaningful then.
Printing graphics
Howcan | print outa picture from insidea protected
program? I use programs such as Facemaker and
Kidwriter in my classroom and Id like to be able to
print out my students’ creations so the kids could
take them home and show them off.
Right now | use open-apple/control/reset to get
out of these programs and Grafpak to print the
picture that's left in memory, but the procedure is
disruptive and the pictures are full of ugly distortion
lines. Help.
S.H. Gidi
Allen Park, Mich.
OpenApple 53
Juse Apple Business Graphics on my Apple Ile. Itis
Pascal program and several years old. Itis configured
to print to an Apple Silentype or Qume printer.
Although I can getiitto print text to my Prowriter with
the Grappler card I can’t get graphics to print. I've
contacted dealers in the past and get the story of
expensive drivers I need to purchase. There must be
an easier answer, | just haven't found it.
Dave Hamilton
Lincoln, Neb.
Those distortion lines you get in graphics after
Pressing open-apple/control/reset come from a
“feature” of the Ile/Iic Monitor that destroys a couple
of bytes on every page of memory as an aid to the
dark forces of copy protection.
There is a new kind of printer interface card on the
market that solves the problems both of you are
having. This kind of card has the power to take
control of your computer no matter what kind of
Program is running—protected, Pascal, or plain—
and dump whatever is on your screen (graphics or
text or both) to your printer. This kind of card comes
with a button you press when you want to print.
One of these new cards is called Print-it! It's
available for $199 from Texprint, 220 Reservoir St.,
Needham Heights, MA 02194 (800-255-1510/617-
449-5808). | know of this card only through the
company's advertising.
Another is called FingerPrint Plus. It's sold by
Thirdware Computer Products, 4747 NW 72nd Ave,
Miami, FL 33166 (305-592-7522) for $149. Thirdware
sent me one ofits cards a couple of months ago to try
out. | like it. Its “button” is a small square of
cardboard with a cute little fingerprint on it. The
button is attached to a thin mylar cable that you can
String through the lid crack on the top of your Apple.
Stick the pre-gummed button somewhere handy
and you're set.
When you press the button, the card grabs control
of your machine and displays a menu. From here
you can preview all of the Apple text and graphics
pages and print any of them. The menu also allows
you to change interface card parameters such as
margins and line length; allows you to rotate,
double, and crop hi-res graphics; allows you to print
low-res, double-high-res, mixed text and graphics,
and color; allows you to jump into Applesoft or the
Monitor; and allows you to choose whether the
card's serial port or parallel port will be active (you
can also choose both or neither).
The card supports both serial and parallel printers,
but comes with only one cable. A second cable is
$28. Both cables are over 6 feet long, which isatleast
a foot longer than the cable that came with my
Grappler Plus.
The only reservation I have about the card is that it
isn't completely Grappler-compatible. The biggest
thing I miss is the Grappler's “NOT SELECTED”
message, which appears when your printer isn't
tuned on or is out of paper or whatever. That little
message is worth its weight in IBM software. I've
sorely missed it for at least 20 panic-stricken minutes
since I installed the Fingerprint Plus—time spent
trying to figure out why programs that used to work
fine were hanging up. The answer, of course, was as
simple as “tum the printer on, stupid’, but I'd rather
have my interface card tell me that than have to
figure it out for myself.
Another esoteric problem I had has to do with the
control-| command character. The program that
prints Open-Apple mailing labels uses printer tabs.
54 Open-Apple
The control code for tab is control-I. To get controll
to a printer, however, you have to change the
interface card command character, which is also -
control-I, to something else. Otherwise the card will
eat them instead of sending them along to the
printer (now you know why you couldn't get your
printer's tab command to work, Alfie). The standard
way to change the command character is to print a
control-I control-something-else. The something
else then becomes the interface card's command
character.
So far so good. But the Grappler Plus reinitializes
itself everytime you tum the printer on. Thus you
have to do control-I control-something else after
every PR# 1 The Fingerprint Plus, on the other hand,
doesn't reinitialize itself. The second time you turn
the printer on it sends your control-I to the printer,
swallows your control-something else, and, if the
next character you send is acontrol character (it was
an escape in my case) changes the command char-
acter a second time. Now you have a mess on your
hands, as well as a puzzle.
If you are writing your own programs, of course,
all this is fixable, once you figure out what it going
on. But if you are using commercial software that's
Grappler-compatible, you could end up with some
problems. (Incidentally, the May tip from Bernard
Goodman on getting a hex dump of what's going to
the printer (page 39) was invaluable in solving this
puzzle.)
The manual that comes with the Fingerprint Plus is
pretty good for printer-related documentation, which
is notoriously bad, but not nearly detailed enough
fora perfect world. In particular, it doesn’t wam you
in big letters on every page not to push the button
while a disk drive is saving something. In fact, it
doesn’t wam you about this at all—even though it’s
an easy way to destroy the data on disks.
Allinall, however, the advantages of the Fingerprint
Plus compared to the Grappler Plus are quite explicit,
while the disadvantages are esoteric. The Fingerprint
Plus not only allows you to print from within any
program, butit has several graphics-printing features
the Grappler Plus tacks. Look at the price, too—on a
features-per-dollar basis the Fingerprint Plus looks
to me tke an exceptional card.
Both sides win again
Ijust wanted to add my two cents to the controversy
over using the back side of single-sided disks. The
disk manufacturers will tell you that only one side is
certified; but in fact, since some drives write on the
back of the disk and others on the front, they don’t
know which side your disk drive is writing to.
Therefore they have to certify both sides; witness the
fact that there are “data holes” on both sides of the
disk.
There's a potential problem of dirt accumulating in
the dust jacket and then being released when the
disk spins the “other” way, but I've yet to see data loss
due to this in my six years of flipping floppies.
Keep up the great work with Open-Apple; next to
Nibble, it's my favorite Apple reading.
David Szetela
Concord, Mass.
I hate to reprint letters in which people say they
prefer Nibble to Open-Apple, but after last month's
smart-aleck exclamation point expose (page 45), |
owe them one. Just so you understand where this
correspondent is coming from, he’s Nibble‘s Man-
aging Editor.
Edasm problems
Having used the mini-assembler to start learning
machine language, | purchased the ProDOS Editor-
Assembler, mostly because of its well-written tutorial.
However, since there is no provision for multiple
ORGs in the program section of the source code, |
haven't been able to enter even short data tables at
absolute memory locations without using the Monitor
or another file. Is there any technique around this
limitation?
‘Stephen Gale
Keyport, NJ
According to Don Lancaster's Assembly Cookbook
for the Apple Ii/Ile ($21.95 from Howard W Sams &
Co, 4300 West 62nd St, Indianapolis, Ind. 46268), you
can use multiple ORGs with EDASM. This book is
based on EDASM—it's a good introduction to using
assembly language. Apple gave me a copy of EDASM
at a ProDOS seminar | went to a couple of years ago
and it was so different from the other assemblers I've
used that | immediately filed it away and haven't
seen it since, so I don't know much about it. You
might try calling or writing Lancaster, in care of
Synergetics, Box 809, Thatcher, Ariz. 85552 602-
428-4073.
Speaking of Lancaster, he sent the following logo
this month with the caption “This is a Lasenwriter
image done with Applewriter on an Apple Ile. Ask
your local printer to estimate the typesetting cost on
this for you. Be sure to wear good running shoes;
you will need them.” The image has been reduced 50
percent.
TINAJA
QUESTING
BRUN bug/More on RGB
1am perplexed by something from the May issue of
Open-Apple. Why do we have to switch SNGL.RES on
and off to make double hi-res work on an RGB
screen? Is this a timing problem, or what?
I'm wondering whether this is related to a problem
Imhavingwitha double hi-es screen dump program
I wrote. When I BRUN the program it hangs, but if |
BLOAD and CALL it instead, it runs just fine. Here’s a
small test program that demonstrates the bug. It
seems to hang when it reaches the main mem/aux
mem flip:
€300:80 SE co
0303:80 @D Co
€306:80 Se Co
€303:80 57 Co
0300:80 53 Co
@30F +80 01 CO
@312:80 55 C0
0315:80 80 20
STR SNGL.RES.OFF (davble-res on)
STA COLBO.ON
STR GRAPH.ON
STA HIRES.ON
STA MIXGR.ON
STA STORES
‘STA PAGE2.ON
LOR $2000
Vol. 1, No.6
0318:20 DA FD JSR PREYTE
0318:80 S4.CO STA PAGEL.ON
031E:A0 @@ 20 LOR S200
0321:20 DA FO JSR PRBYTE
0324260 RTS
Alain Toutant
Ste-Angele-de-Laval, Quebec
Your problem is actually a bug in the DOS 3.3
BRUN command. The program doesn’t hang until it
gets to the RTS.
When you BRUN a program, DOS loads your code
and does a JMP to it from within a subroutine. The
RTS at the end of your codes taken as the end of that
DOS subroutine.
Any program running under DOS 5.3 that is BRUN
should save the value Uncle DOS has stored at byte
43609 ($AA59). This values critical to your program's
finding its way home again, but it gets ovenwritten
when DOS intercepts a character passing through
the 1/0 hooks. if you save $4459 before doing any
input/output, and replace it before your final RTS,
your problems will go away. Look at lines $408B
‘and $4094 of March's INCINERATOR (page 18) for an
example.
Poking the SNGL.RES and 80COL switches as
Shown in the May issue (page 36) shifts bits into two
flags on the RGB card, which in tum tell the card
which video mode to display. In addition to the three
modes discussed earlier (560 x 192 monochrome,
140x 192 16-color, and a mix of 560 and 140), ittuns
out there is also a fourth mode— 160 x 192 in 16
colors. This mode uses all 8 bits of each byte (two 4-
bit pixels per byte), rather than 7 as the other modes
do. Consequently, it is much easier to program. The
first two pixels of line one are stored at $2000 in
auxiliary memory, the next two pixels are in main
memory, and so on across the line.
Here's the correct sequence for poking the switches
to get any of the four modes (it doesn't matter what
value you poke). The 80COL off and on switches are
at 49164 and 49165 ($COOC-COOD) and the SNGL.RES
off and on switches are at 49246 and 49247 ($COSE-
CO5F). (Note that SNGL.RES off is the same thing as
DBL.RES on, which is what I wish I had called this
pair of switches last time. They are also known as
ANS, because they also control an output on the
game port called annunciator #3,):
RGB Control Sequences
560x192 148 x 192 S608 140 168 x 152
monochrome 16-color mixed 16-color
800 off 0C on 80C off BC on
DBL on aL on DBL on BL on
DAL of F DBL off DBL off ©—DBL of F
80C on 800 off
DBL on DBL on DAL on aL on
DBL oF F OBL off OBL ofF_——OBL of f
8@C on 8@C on
08. on BL on DBL on aL on
All the above modes require that both DBL.RES
and 80COL end up tured on.
BEWARE, programmers, of leaving DBL.RES on
and switching to 40-column text. Users with RGB
cards get a color text display in this situation that is
often unreadable if turned on by accident. With
DBL.RESon, 40-column text on RGB-equipped Apples
appears in combinations of 16 foreground-background
colors. The display page in main memory holds the
text and the display page in auxiliary memory holds
color information. The first nibble of each color byte
holds the color of the text (the foreground), the
July 1985
second nibble holds the background color. If both
nibbles hold the same value, the text blends into the
background and becomes invisible. .
Token tinkering
In your June issue (page 42), you tell how the IIc
cassette commands point to the same location as
‘the & command. There is a simpler method than the
‘one you give to distinguish between the commands.
When Applesoft calls a command routine, the Y
register contains an index to the command. The
following three instructions will move the index into
the A register and convert it into the command token
($9A=SHLOAD, $A7=RECALL, and so on, as listed in
the June issue):
ya
sec
ROR
Glenn Chappell
Overland Park, Kans.
Here's a little program that’s demonstrates Chap-
pelts technique:
100 REM poke $300 in page-3 anpersand vector
110 C$="3F6:00 03°
120 GOSUB 500
4190 REM poke Chappell’s routine at $300
140 ($="300:98 38 6A 4C DR FO"
150 GOSUE 520
160 END
500 C8=05+" N DSCSG" : REN S.H. Lan routine
$10 FoR T=1 TO LEN(CS)
512 + POKE SL1+1, ASC(MIOS(CS,1,1))+128
S14 NEXT
520 POXE 72,0 CALL -144
$30 RETURN
After running this program, enter the 6 possible lic
ampersand commands (SHLOAD, RECALL, STORE,
LOAD, SAVE, &) directly on a lic keyboard. The
program causes each to print its associated token on
the screen.
Make byte low
Tam finally gritting my teeth and attempting a
wholesale conversion from DOS 3.3 to ProDOS. One
of the most heavily used word processors in our
company is Format If Enhanced, because of its easy
‘on-page orientation and the ability to do columns for
script writing.
However, the ProDOS CONVERT utility inexplicably
sets the high bit on all the text files coverted over.
Format uses the high bit, so converted files are a
mess, Several phone calls to Kensington Microware
resulted in a vague commitment to work on it
sometime and Apple referred me to my local dealer
(Ho, Ho). Is there a way to fix CONVERT? Oris there a
nice simple little program that can take a converted
file and tum off the high bit in every byte?
By the way, | haven't noticed any mention of it in
Open-Apple, but one of the key reasons for my
switch to the combination of ProDOS and the tle
enhancement is the wonderful SuperCalc 3A This is
one of the best indications yet of the increasingly long
life of the Il series.
Flip Baldwin
Salinas, Calif.
Take the basic Basic.copy program from the front
part of this issue. Add the S.H. Lam routine near the
beginning of the program (see the February issue,
page 12, for details on this; the answer to the last
letter includes the actual routine) to load the following
machine language stuffat $500:
C§e"300:18 AD 07 BE 8S IC 60 08 BE
85 3€ AD DG BE BS 30 6D DC
BE 85 3F A000 61 30 29 7F
91 30 2@ BA FC 90 FS GO”
Now adda CALL 768 to the copy program between
the BLOAD and the BSAVE. The program will then
load a file and call the machine lanugage subroutine
at 768 ($300). That routine zips through the image of
the file in memory and tums off all the high bits.
Whenit's done, the main program will resave the file.
ProDOS 40-track bug
In the April Open-Apple you published some
patches to make ProDOS 1.11 and FILER 11 work with
40-track drives. You point out that the patches are
based on Worth and Lechner's patches in Beneath
Apple ProDOS. There seems to be an error in both.
The change of $23 (35) to $28 (40) makes sense but
shouldn't $18 ($0118 = 280) be changed to $40
($0140 = 320) instead of $39 ($0139 = 315)?
Worth and Lechner claim the patches will allow for
320 blocks instead of 280. | have formatted disks
both ways and inspected them with a disk zap utility,
and it seems to me
Open-Apple 55
the disk for 40 tracks but only allows for 513 of 320
blocks to be used. Am I right?
A different question: you note parenthetically that
block 2 = track 0, sector 11; but Worth and Lechner’s
Table 3.1 shows block 2 in sectors 8 and 10. Who's
right?
George Tylutki
LaPlume, Penn.
You're right about the patches in our April issue
(page 52). Where yousee $39 change it to $40. Pencil
this change in your back issue now, everybody.
The confusing thing about Worth and Lechner's
Table 5.1 in Beneath Apple ProDOS is that it relates
ProDOS blocks to physical disk sectors. The physical
sectors on DOS 5.3 and ProDOS disks are identical: a
disk zap utility based on either operating system can
access the other's disks. But Worth and Lechner's
table is meaningless to anyone trying to examine a
ProDOS block with a DOS 3.3 zap utility because
DOS3.3sector numbers are logical numbers; alittle
table inside DOS is used to change them to physical
sector numbers just before accessing a disk.
The shaded box on this page has a table similar to
Worth and Lechner's that converts ProDOS blocks to
DOS 5.3 tracks and sectors. (Note that since ProDOS
blocks are twice as big as a DOS 3.3 sector, it takes
56 Open-Apple
Basic.system trace bug
Both versions of Basicsystem contain an ephemeral
but interesting bug that suddenly triggers trace mode
and just as suddenly disappears.
Consider the following 4liner by J.R. Wakefield
from the “Letters” section of the April 1985 Nibble:
10 GET AS: PRINT
20 IF ®6=°R” THEN FLASH : PRINT “ERROR” ; GOTO 40
30 FLASH : PRINT “OK™
40 NORHAL : GOTO 10
Ifan upper case “A” is pressed, tracing begins. All
other input produces a normal response. Abnormal
tracing ceases when another text mode command is
encountered.
Tracking the bug to its lair took considerable effort
and will be the subject of Disassembly Lines column
in the December 1985 or January 1986 Nibble. For
now, here’s a summary of the problem and a recom-
mended solution,
Unlike DOS 3.3, Basic.system bullies the Applesoft
new statement and trace handler (NEWSTT, $D7D2-
$DB56) into kicking trace information back to Basic-
system. Basic-system uses the trace informationasa
signal that a new command is being executed. It
checks out the token of the command for screening
and pre-processing, It does all this by making sure
that the Applesoft trace flag (TRCFLG, $F2) is always
on (high bit set). The true status of trace mode is kept
within Basic.system’s global page (DTRACE, $BE41).
Bychecking this byte Basicsystem determines whether
to pass the tracing information on to the screen or
not.
Basic.system also stores an image of the normal
trace character, which happens to be "#” (ASCII $43).
Whenever anything is printed, Basic.system, like DOS
3.3, intercepts it. Basic.system, however, checks to
see if the source of the information is Applesoft’s
trace mode by first checking if the pound sign is
being output, and if so, by determining whether the
output originates from NEWSTT.
After Applesoft processes a FLASH command,
trace’s leading pound sign acquires an ASCII value of
$E3 instead of $A3. Thus, when Basic.system sees a
FLASH token, it changes the trace character image
from $A3 to $E3. But, unfortunately, not all contingen-
cies are taken into account.
When Applesoft executes an IF statement, trace
data is sent to Basic.system as usual. However, if the
formula following the IF statement is true, Applesoft
will execute the command following THEN without
outputting any additional trace information. Thus, if
FLASH is executed inside an IF-THEN statement,
CFE -
: Open-Apple
® Copyright 1985
Tomer
Published monthly.
World-wide price:
US$24/year
Sendall
correspondence to:
pen apps a racemar of Tom Weshaae Apple Computer and
fer Ripe ae wo erent urrltes.rdoponder comparics
frat wiah everyone nthe wordhad an Appel
Basic.system never sees the FLASH token and doesn't
change the trace character image from $A3 to $E3.
Consequently, Basicsystem doesn't recognize the
following flashing trace data for what itis and sends it
onto the screen.
The dynamics of this adverse interaction between
Applesoftand Basic.system is complex andillustrates
that debugging involves more than the mere exami-
nation of code segments.
Fixing the bug is as simple as realizing that the
concept of a trace character image is unnecessary. If
output comes from NEWSTT, the pound sign must be
the character being processed. With this in mind,
here is my patch for Basic.system 11 (for 10 change
the starting address to $9E5B):
E2048 BE 3F BE
9€30:8A 6D 04 10 C9 12 00 oR
‘5E30260 @5 1 C3 D8 De 03 6B
5€40:60 74 6B EA ER ER
I stress that this fix is no substitute for revising
Basic.system’s output handler. If someone would
rather avoid the bug than correct it (a mortal sin for
hackers), just be certain that Applesoft commands
pre-processed by Basicsystem (e.g, TRACE, NOTRACE,
NORMAL, INVERSE, FLASH, RESUME) do not imme-
diately follow a THEN. Sandy Mossberg
Rye Brook, NY
Bugs and the future
Here is an answer for “Problem too complex”
(February, page 15). A="A” internally uses a zero page
temporary string descriptor for the literal “A.” This
descriptor is freed upon successful completion of the
statement. However, the statement does not complete
because it isin error. ONERR redirects the program to
execute the statementagain. Soon the limited number
of internal string descriptors is exhausted. FORMULA
TOO COMPLEX is generated when no more are
available. AS=A doesn't use an intemal zero page
temporary sting descriptor. Too many internal nested
string generations will also produce the same result.
With regard to “Interrupts and the Sun” (June, page
46), ProDOS does use $45! The ProDOS Technical
Reference Manual (page 110-111) describes the
locations to be used by intelligent controller boards,
such as the one used with the Profile. The ProFile
may be called directly with the following memory
locations set:
comand (O=status, I=read, 2:urite)
unit nuaber (dsssxxxx, dedrive, sss=slot)
buffer polnter (512 byte area)
block nunber
$43
44-45,
346-547
Ihave written routines to directly access the ProFile
using this layout and JSR $CsXX, where s is the slot
number and XX is the value at $CsFF. Notice that the
last 5 of the 6 bytes are the same as the ProDOS
Read Block ($80) and Write_Block ($81) MLI calls.
The error codes returned by the ProFile ROM in the A-
eq are exactly the same as the ProDOS MLI codes
($27=1/0 ERROR, $28=NO DEVICE CONNECTED,
$2B=WRITE PROTECTED), with carry set. So, yes, $45
is used by ProDOS. By the way, you can see why DOS
5.5 doesn't support the ProFile, since the I/O is done
in units of 512 byte blocks.
So why won't DOS 53.3 be supported on future
versions of the Apple II? Well, we all complained that
DOS 3.3 didn’t have enough features, had enough
bugs, and could not easily handle a number of
significant new devices (hard disks, interrupt genera-
tors, etc.). Everyone and his uncle hada patch to DOS
3.3 for something or other, And Apple Computer
Vol. 1, No.6
listened. Thus, along came ProDOS. The amazing
part is that the Applesoft interface is very nearly the
same (and Applesoft is even the same; I converted
Softgraph from Softalk with less than a half dozen
changes). Ina nutshell, ProDOS has all of the capabil-
ities that we wanted in DOS 3.3 (but really could not
be put in DOS 3.5), fixes many problems (how many
years to fix append), and is expandable for the future.
[believe the potential for DOS 3.3 is far too limited
for the future of the Apple !! computer. The DOS 3.3
append error was almost unfixable. How many bugs
still exist that will not be found until someone
attempts to use the code on a device that was not
originally supported (like a 3-1/2 inch Sony floppy
with variable speed depending on track number)?
If there is a future for the Apple Il, and ifthat future
includes faster CPU chips (65816), more memory,
larger disk devices, and extended human interface
capabilities (mouse and graphics), then DOS 5.3 just
does not make it. ProDOS isa better base.
With the departure of the Apple III and SOS,
ProDOS is the only good operating system left at
Apple Computer. The Mac file handling has been the
pits. Itis even worse than the days of early DOS 3 (at
least, that is what I read, and of course, only the bad
stuff gets printed). used to have all kinds of problems
with DOS 3.3 (it had to be babied). | don’t have any
problems with ProDOS. That means a lot when I have
thousands of hours of work invested on my Profile.
Not one bad block. Not one lost track. Not one 1/0
error. And the Apple Mouse worked right away. And
the extended memory worked right away. And the Ile
enhancement worked right away. Maybe | am spoiled.
When I buy something, | expect it to work. All of my
ProDOS products work. Can this be said about DOS
3.3? What kind of changes need to be made to DOS
3.3 to support the 65816?
Ken Kashmarek
Eldridge, lowa
Thanks for your help with FORMULA TOO COMPLEX
and $45. I suspect interrupts are disabled when
ProDOS calls intelligent controller boards and that's
why this call is allowed to use $45. Direct calls such
as yours should also either disable interrupts or plan
not to use them on Il-Pluses and original Iles.
Tagree with your comments on ProDOS. As hard
disks and other high-capacity storage devices come
down in price most other people will agree with you,
too. However, you have to admit that the biggest
problem with ProDOS and Basic.system right now is
that we just don’t know what bugs lurk within them.
‘There certainly appear to be a few —as is expected in
any major piece of software.
Yet healthy enthusiasm for ProDOS is no reason to
abandon all the effort that's gone into learning about
DOS 5.5, The problem is not that DOS 3.5 doesn't
support the Profile, but that the ProFile—alone
among hard disks for the Apple I! family—doesn’t
support DOS 5.3. The technical problemsare solvable;
Apple in its arrogance toward the market simply
decided not to solve them. But compare ProFile sales
to those of other hard disks for the II and you'll see
that Apple, in this case at least, ts paying for its
disregard of the customer.
DOS 3.3 has bugs, sure, but why, just when we
finally know what they are and have thousands of
people who know how to program around them,
should we dump it? It's a perfectly good operating
system for many, many floppy-based applications, I
continue to insist that any future Apple that can’t
boot DOS 5.5 is just an Apple, too; it's not a member
of the Apple Il family.