PROGRAMS “R” US
Nearly everyone reading this is already a programmer, on one level or another. Even if you don’t know a “GOTO” from a “STA $C030”, you already know how to program something. For the act of “programming” is nothing more than giving instructions to a non-human device to have it carry out what you want it to do. The device that most of you already know how to program is your automobile. The act of giving those instructions may not seem like programming to you; nevertheless in its strictest sense, programming it is. You want the car to go forward? Set the transmission to “D”. Go in reverse? Use “R”. Of course, the programming needed to operate an automobile is quite simple, and cannot be done in more than one step at a time. An example of a device that is more complicated to program but does let you store up several instructions in advance is a VCR or DVR. On this device you instruct it to record a television broadcast that starts at 7:00 pm and ends at 8:30 pm, on channel 6. All current DVRs can have several programs set up in advance, even download a schedule and automatically add new programs to the record queue. If you can operate a VCR or DVR in this fashion (which is, admittedly, not always easy), you are a programmer.
When it comes to the microcomputer, the process of programming (giving it instructions on how to carry out a task) is more complicated. This is primarily because the computer is far more flexible in its ability to accept instructions and carry them out than is an automobile or DVR. Devices attached to a computer can be manipulated by a program to do something useful (print a letter several times, or perhaps read the outside temperature and sound an alarm if it drops too low). This flexibility, plus the speed at which a computer can execute its instructions, makes it a powerful tool for doing things that have previously taken much more effort and time. And as a project becomes more sophisticated, so also must the programming acquire a similar level of sophistication. The rate at which computers, including the Apple II, increased in capacity since the 1970s made it possible to design programs that could do things that were not even dreamed possible back in the days of the 4K Integer BASIC machine.
An example of programming evolution on the Apple II was given during the A2-Central Developer’s Conference (KansasFest) in July of 1991. To fully appreciate this narrative, it is necessary to know a little about an old Integer BASIC program, APPLEVISION. This was found on the DOS 3.2.1 System Master disk, and was a fun little display that showed off the use of hi-res graphics. It began by creating a simple line drawing of a room, with a picture on the wall (“HOME SWEET HOME”) and a television set. On the screen of the TV appeared a man who danced to the tune of “Turkey In The Straw”, which sounded on the built-in speaker. It ran repeatedly, until the user interrupted the program. It was fascinating at the time, since there was nothing in the program text that showed off exactly how the hi-res effects were accomplished. But things have gotten a bit more complex as time has gone by:
Roger Wagner’s keynote address featured a history of hypermedia, which Roger set into action and left to run as he wandered offstage. The history began with Bob Bishop’s classic APPLEVISION, done in black and white on the original Apple II. Progressive screens enhanced the APPLEVISION image using subsequent incarnations of Apple II graphics (single hi-resolution, double hi-resolution, and the IIGS‘s Super Hi-Resolution modes). Finally, thanks to a laserdisc player under HyperStudio‘s control and a video overlay card, Roger’s image appeared within the television’s screen and spoke to the audience, completing the introduction before turning the presentation back to Roger (returning from offstage).
To follow the programming progress that has made such magic possible, this chapter will begin with the first two built-in high-level languages for the Apple II, Integer BASIC and Applesoft, and then move on to a briefer discussion of some of the other languages that became available over the years. Following this will be a summary of various 6502 and 65816 assemblers that programmers used on the Apple II platform. The chapter will finish with an introduction to “hypertext”, and programs that used this concept on the Apple II.
FUNDAMENTALS OF PROGRAMMING
A programming language has the standards to translate “what I want” into commands that the computer understands. To do so, it must take some human language and convert it into the binary dialect of the computer on which it is executed.
Computer languages usually come in one of two different types: “interpreted” and “compiled”. A language that functions as an interpreter takes the text of the program and translates it at the time of execution into commands the computer can understand. A compiled program, on the other hand, has already had the program text translated into executable code before it is run, usually including some extra code needed to carry out necessary functions of input, output, and calculations. As such, an interpreted program usually runs more slowly, but has the advantage of being easier to modify and re-run without the delay of first re-compiling. A compiled program will ordinarily run faster, but may use more memory than an equivalent interpreted program.
Languages are also given the designation of being “high-level” or “low-level”, depending on how close they are to the base language of the computer on which they run. The lowest level of computer programming is at the level of the bytes understood as commands by the microprocessor. This “machine language” is typically not very understandable to humans. A low-level language more often used by programmers is “assembly language”. This uses commands somewhat more understandable (“LDA $24” means “load the accumulator with the contents of memory location $24”), which are then assembled (actually compiled) into machine-readable code. Assembly language is very powerful, since it works on the byte level of the computer. However, as a low-level language it can be very complicated and requires an intimate understanding of the function of the computer.
As a language becomes more “high-level”, it is easier for humans to read, but requires more effort from its interpreter or compiler to translate it into the native language of the computer.
This was the first language available for general use on the Apple II (aside from assembly, which will be dealt with later). Most of the details concerning its development have already been covered in Chapter 3 of this History. It was a quick, compact language, and its creation was an example of programming directly in machine language (since Steve Wozniak, the author, had no assembler available to use). Its disadvantage was the lack of easy access to floating point operations, and it lacked some string handling functions. Apple II users, especially those who wanted to produce programs that could be used in business applications, wanted something more powerful to use.
Despite its limitations, Integer BASIC was a language that had a loyal following. For those thousands who purchased the Apple II from June 1977 to June 1979, this was the only programming language available, and it took on a status similar to that of a beloved first-born child. Games, utilities, and even some simple business-use programs were written using Wozniak’s hand-assembled masterpiece, and those who followed the pages of Call-A.P.P.L.E. magazine learned much about the internals of the language. With the disassembler built into the Monitor, people tore Integer BASIC apart to learn how it worked, and to make it work better. Val Golding, the editor of Call-A.P.P.L.E., even wrote a series of columns in 1979 entitled “So Who Needs Applesoft?” These articles showed how to simulate some of the more advanced features of Applesoft in this older BASIC. A.P.P.L.E. even sold (under license agreement with Apple Computer) “Integer BASIC +”, a relocatable RAM version of the original ROM BASIC. It had all the features of the original language, plus a “USER” command, the ability to easily do four direction scrolling on the text and lo-res screens, easy printing of ASCII characters, and improved error handling.
Apple never released a comprehensive reference manual for Integer BASIC. The only manual available for it was primarily a tutorial (and a general introduction to using a computer). The “Apple II BASIC Programming Manual” didn’t even call it “Integer BASIC”, but referred to the language as “Apple BASIC”. It gave most of its programming examples in the form of segments of a graphics and sound demo that created a lo-res ball bouncing off the sides of the screen.
With the many programs available that were written in Integer BASIC, it was almost a necessity for Apple to offer a means for Apple II Plus users to be able to run the older software. The Integer Firmware card made this “backward compatibility” possible. This was especially important in the early days of the II Plus, when there was little new software available to use with Applesoft.
Back in 1975 and 1976, Microsoft was producing BASIC interpreters for nearly every microprocessor that was produced, in hopes of licensing or selling their BASIC to those who built a computer around that chip. In mid-1976, Richard Weiland, Bill Gates, and Monte Davidoff at Microsoft ported their Intel 8080 BASIC to the then-new 6502 microprocessor, even though there not yet any computers that used that processor. The tool used for this was a 6800 microprocessor simulator written by Microsoft’s first employee, Marc McDonald; they could do this because the 6800 had an instruction set that was very similar to the 6502.
They became aware of Steve Wozniak’s efforts at creating the Apple II, and one of Microsoft’s programmers called Steve Jobs to see if he would be interested in a BASIC language for this computer. Jobs told him that they already had a BASIC , and if they needed a better one, they could “do it themselves over the weekend.”
For several months, Microsoft had their 6502 BASIC sitting on a shelf, unwanted and unused. But by October 1976 they finally had a contract to put this interpreter into the new PET computer that was being designed by Commodore. This would ultimately become the first time that BASIC was included with a computer built into the ROM, rather than being loaded from a paper tape, disk, or cassette. However, the contract Microsoft had with Commodore was no good to them at that time, as far as income was concerned; it stipulated that they would not be paid until some time in 1977, when the computer was to be finished and ready to ship. With income and cash reserves running dangerously low, Microsoft was given a reprieve by none other than Apple Computer.
Apple was receiving increasing numbers of requests by users of the Apple II for a floating point BASIC. Integer BASIC (which Wozniak had also at one time called “Game BASIC”) worked well for many purposes, and a skilled programmer could even make use of the floating-point routines that were included in the Integer BASIC ROM. However, the average Apple II user was not satisfied with Integer BASIC, especially as it made them unable to easily implement business software (where the number to the right of the decimal point is as important as the one to left). Wozniak tried to make modifications to his Integer BASIC to make use of the floating point routines, but at that time he was also hard at work on designing the Disk II interface card, and his efforts on creating a floating point BASIC fell further and further behind. Consequently, Apple’s management decided to go back to Microsoft and license the 6502 floating point BASIC that had been offered to them in 1976.
In August 1977, Apple made a $10,500 payment to Microsoft for the first half of a flat-fee license that they were able to negotiate. Typically, Microsoft would license its BASIC on a royalty basis; they would be paid a set fee for every copy of BASIC that went out the door – in this case, with every computer that was sold. The fact that Microsoft was willing to concede and let Apple license their 6502 BASIC on a flat-fee basis is a reflection of the financial straits that Microsoft was under.
The version Apple licensed was version 1.1 of Microsoft’s 6502 BASIC, correcting some bugs present in the original version. ,, At Apple, Randy Wigginton was assigned the job of incorporating into Microsoft’s BASIC the graphics commands that were unique to the Apple II.
Another early employee, Cliff Huston, became involved in the floating point BASIC project (to be named “Applesoft”). According to Huston, the source code that had been obtained from Microsoft was “a mess”, and needed considerable bug fixing, over and above the incorporation of the lo-res and hi-res graphics commands. The problem they had in trying to do this work was a lack of tools. Since there was no assembler to use on the Apple II, Wigginton had to do his programming using a cross-assembler over a 110 baud modem via teletype with a company named “Call Computer”. The work was tedious because of the slow speed of the connection; compare this 110-baud speed to the significantly faster dial-up modem speeds of 56K (56,000 baud, over 500 times as fast) that became available years later. Not only was his connection very slow, but also the cross-assembler he was using to compile 6502 code for the Applesoft project was itself written in BASIC. This resulted in a long compile time, over two hours. Printing out a new source code was out of the question; it would have taken days to make a printout.
By December 1977, Wigginton hit a crisis. Call Computer managed to accidentally destroy the saved work on a number of accounts, including the workspace for Apple that he had been using to work on Applesoft. Call Computer tried to restore from a tape of the previous month – and that tape didn’t work. The same happened with the backup from the month before that. It turned out that the tape being used to reload the system at Call Computer was being erased by a faulty tape drive, and so all of the backups were being sequentially destroyed. The end result was that several months of work on Applesoft were all gone, except for the handwritten notes on his single source code printout. It was intended that the finished version of Applesoft was to be ready by January 1978.
What saved the situation was Cliff Huston, and his IMSAI computer. When he had started working at Apple, Huston had brought in his own computer, because it was (at the time) all he had to work on. He had done his own programming on this IMSAI, and it had a paper tape reader. Wigginton and others had previously criticized him for using this foreign, inferior piece of equipment. Now, using the paper tape reader, Huston was able to input the original BASIC source code from Microsoft, break it up into multiple segments (he had only a single floppy disk drive), and let Wigginton resume work on fixing the source code, using an IMSAI-based cross-assembler. Because it required several floppy disks to hold the entire source, it was necessary to swap disks during the compile process, but it took only six minutes to do the compile (rather than the two hours required for Call Computer’s cross-assembler written in BASIC). Mike Scott, the president at Apple, bought a Centronics printer to use with the IMSAI, and with that Wigginton was able to get a full printout of the source code in only 35 minutes. In the end, Scott leased Huston’s IMSAI for development at Apple for nearly two years after this.
With this last-minute help from Huston’s “inferior” IMSAI, Applesoft BASIC was completed on schedule and was released in January of 1978 on cassette. It was loaded as a 10K program that looked to the computer just like an Integer BASIC program, though only a small part of it really was. To make it easy to load and start from cassette, the Applesoft interpreter was attached to the end of a short Integer BASIC program. When the Integer program was run, it poked some values into memory and jumped to the start of the machine language section, which relocated the Applesoft interpreter to the lower part of memory (at $800), just after the memory that held the screen display.
Using this version of Applesoft (which later became known as Applesoft I) could be frustrating. It took several minutes to load from the cassette tape, and it was not dependable. If the wrong key was pressed while entering or running an Applesoft program, the program that was being run could be wiped out, and the Applesoft interpreter itself would have to be reloaded from cassette. However, few users knew how to make use of the floating-point routines that Wozniak had written into the Integer ROM, so this unreliable Applesoft BASIC became the only practical means of doing floating-point math on the Apple II.
Aside from the reliability issue, another difficulty with this early version of Applesoft involved hi-resolution graphics. Although the Apple II was capable of displaying it, the Applesoft interpreter extended up into the memory used by the hi-res screen, and so prevented its use. Furthermore, Applesoft I had no built-in commands to manage hi-res graphics.
Applesoft I came with a manual that was 8 1/2 inches by 11 inches in size, and sported a blue cover with square glued binding. This came to be known as the “Blue Book” (recall that the reference book for the computer itself was affectionately known as the “Red Book”). (Click here for a link to download both of these manuals). There were actually two versions of the Applesoft Reference Manual. The first edition was dated November 1977, and the second edition came out nearly a year later, August 1978. The changes between the two involved the change from Applesoft I to Applesoft II (see below), and the newly available firmware version of Applesoft. The August 1978 edition included these additional changes:
- The section about color graphics was shortened from twelve pages to just three pages, and also did not include a demo program for color graphics
- Appendix A, “Getting APPLESOFT BASIC Up”, added the information about the Firmware Card.
- It did not include a program for converting Applesoft I programs to Applesoft II.
- Appendix K, which documented Applesoft zero page usage, was added
Applesoft I – Photo credit: personal
When starting the interpreter after loading it from the cassette, a screen was displayed announcing that Applesoft was copyright 1977 by Apple and Microsoft. It then asked the user for the memory size of his computer, and gave options of allowing either LET and REM statements or the use of lo-res graphics. The names of the lo-res graphics commands were very different from those that existed in Integer BASIC (and in the later versions of Applesoft). The commands were:
PLTG = Go to lo-res graphics mode
TEX = Go to text mode
PLTC N = Set color to N (0-15)
PLTP X,Y = Plot square at X,Y
PLTH X1,X2,Y = Plot horizontal line from X1 to X2 at Y
PLTV Y1,Y2,X = Plot vertical line from Y1 to Y2 at X
There was a note about these commands in the reference card included with Applesoft I that warned about using graphics coordinates only between 0 and 39, or a program could “self-destruct”. Apparently it lacked the error checking that could prevent the plotting of lines from spilling over into the text of the Applesoft program itself.,
The A.P.P.L.E. user group published a patch in 1978 that allowed programmers to avoid the question about using LET and REM statements versus lo-res graphics, and use the graphics only. The author of the patch pointed out that the LET statements were not necessary (“A = 3” worked just as well as “LET A = 3”). The REMark statements could be simulated by putting them at the end of a GOTO line (where they were ignored by the interpreter), and the GOTO could just jump to the following line:
Additional patches were made available for some of the other bugs found in Applesoft I.
Microsoft had found and corrected several bugs in version 1.1 of their 6502 BASIC since that version had been delivered to Apple in late 1977. Several months later, the company now offered Microsoft 6502 BASIC version 2, which included a number of important bug fixes and improvements in the code that made it more efficient.
In spring 1978, Randy Wigginton and some others at Apple took this new Microsoft revision and made other changes to improve Applesoft. Using a cross-assembler running on a North Star Horizon (Z-80) microcomputer (modified from Dick Huston’s IMSAI compiler), they fixed the known bugs and added other commands to control features unique to the Apple II. These commands included the ones needed to draw and manipulate hi-res graphics. Also, the lo-res graphics commands were renamed to be more consistent with the equivalent commands in Integer BASIC (GR, HLIN, VLIN, etc.) This version was called “Applesoft II”, and eventually it was available in five forms: Cassette RAM and Diskette RAM (which loaded to the same memory locations that interfered with hi-res graphics as did Applesoft I), Firmware card ROM, Language card RAM, and finally main board ROM (in the Apple II Plus).
Applesoft II – Photo credit: personal
When Applesoft II was started up from cassette or diskette versions, the display screen now showed a copyright date of 1978 by Apple Computer, Inc., and 1976 by Microsoft (which may be either their copyright date for the original Microsoft BASIC, or possibly for Microsoft’s first 6502 version). This RAM version of Applesoft II used memory from $800-$2FFF, and the Applesoft BASIC program itself was loaded beginning at $3000. When the versions in ROM and for the Language Card RAM were released, the BASIC program could load at $800, and much more memory was available for it. However, some of this extra space (in high memory) was reclaimed by DOS when the Disk II was released.
Applesoft in the original IIe was unchanged from the II Plus version. When the IIc was introduced in 1984, however, Apple programmers had cautiously made a few useful changes to the language:
- Input processing was changed to allow lowercase entry of Applesoft commands (they were translated into uppercase)
- Screen output commands (PRINT, TAB, HTAB, etc.) were modified to more properly handle the 80-column screen
- Program lines (when LISTed) were changed to begin in column 2, making screen editing easier
- All of the cassette tape routines (LOAD, SAVE, SHLOAD, STORE, and RECALL) were removed, since the hardware did not support cassette I/O. The keywords were still in the token table, but now pointed to the same memory vector as the ampersand (“&”) command.
- Patches were made to the lo-res graphics commands (GR, HLIN, VLIN, PLOT, and SCRN) to work with double lo-res graphics. However, a bug was introduced that allowed PLOTting vertically to areas outside of the double lo-res graphics screen, which would land right in the beginning of the $800 space where the Applesoft program text was located (similar to the “plot” bug in Applesoft I).
When the Apple IIe Enhanced ROMs were made available, Applesoft in those ROMs had undergone some similar modifications. All the above IIc changes were added, with the exception that double lo-res graphics capability was not added (lack of ROM space), and the cassette I/O commands were not removed (since the cassette input and output port was still present).
The version of Applesoft on the Apple IIGS closely resembled the Apple IIc variant, the only exception being a fix of the double lo-res PLOTting bug. However, a bug in the SCRN function that applied to double lo-res mode wasnot fixed. No changes to Applesoft from the IIc version appeared in the Apple IIc Plus.
The manuals written for Applesoft II were far more comprehensive than either the older “Blue Book” or the Integer BASIC manual. It gave not only programming examples for each of the commands, but included much more information about the various ways in which each Applesoft statement could be used. It also mentioned some of the differences between Applesoft and Integer (for those who wanted to convert their older programs), and gave a little information about the internals of Applesoft to aid in creating machine language additions to the language. Curiously, the manuals that were reprinted even as late as 1990 by Addison-Wesley included an odd cautionary note to programmers. In a section in the index about “reserved words” (words reserved as Applesoft commands), it advises against using “XPLOT” as a variable name, stating, “It is a reserved word that does not correspond to a current Applesoft statement.” What is apparently meant by this comment is that at one time Apple intended to extend the language and add another command “XPLOT” to it, probably working with HPLOT in the same way that XDRAW complements DRAW in doing hi-res graphics. Examination of the command table within the Applesoft interpreter shows there is no entry labeled “XPLOT”, and a disassembly of the interpreter shows no preliminary code to support the command. Somehow this precaution persisted and was never removed, even though Applesoft was never upgraded by Apple (their license from Microsoft expired in 1993; see below).
Particularly helpful for programmers was the foresight to include a simple extension called the “ampersand hook”. If Applesoft came across the “&” symbol while interpreting a line, it jumped to a known location in memory and left it to the programmer to insert the correct code to add a machine language extension to the language. With the publication of important information about the internals of Applesoft in 1980, assembly language programmers were able to add statements to do things that could not be done with the language as it was originally created. Music, extended graphics, IF-THEN-ELSE logic, and even the missing “XPLOT” command could be added to the language. The only limits were the author’s imagination (and available memory).
A significant part of the story of Applesoft and Apple Computer occurred in March of 1985. At this time, Apple was still struggling to get the new Macintosh and Lisa computers to sell well enough to make it on their own. The company was still depending heavily on the continued strong sales of the Apple II line, specifically the Apple IIe and IIc computers. An ominous event was looming on the horizon, however, and it was one more way in which Apple and Microsoft were beginning to come into conflict with one another. The eight year license on Applesoft BASIC, which was actually Microsoft’s old 6502 BASIC (modified by Randy Wigginton) was due to expire in 1985, and if Apple could not renew the license they could not continue to sell any version of the Apple II without making the computer unable to run a large body of existing software. By this time, an Apple II was defined by the existence of Applesoft in ROM; if Apple could not continue to use Applesoft in the popular Apple II line, there would be no more Apple II. It would be unthinkable to revert back to the product that Apple did own (Integer BASIC) at that late date. And without the Apple II to provide a steady income while Macintosh development continued, there just might be no more Apple Computer.
Back in 1977 when Apple was granted the eight-year license for Microsoft’s 6502 BASIC, Microsoft was in a much tighter situation financially. In 1985, however, they could ask for and get from Apple quite a bit more. However, rather than making it a financial deal, Microsoft offered to swap a second eight-year license for Applesoft BASIC in exchange for something that Bill Gates had his eyes on: MacBASIC. This product had been in development at Apple for quite a while, and was slowly progressing. But Microsoft had built its original business on supplying BASIC for every computer, and to not be the supplier of a BASIC for the Macintosh was unacceptable to Bill Gates. Steve Jobs had no choice but to allow the code for MacBASIC to be given to Microsoft, and Applesoft survived. However, Apple probably got the better end of the deal, since BASIC on the Macintosh never really turned out to be important in the same way that BASIC was in the 1970s and early 1980s. Even Gates admitted that the deal for Applesoft’s renewal was not the smartest decision he has ever made. Microsoft could have demanded a high price for Applesoft and Apple would have had no choice but to pay it to them.
Overall, the importance of Applesoft as an influence to productivity on the Apple II cannot be overstated. Since the release of the Apple II Plus in 1979, every variety of Apple II contained Applesoft in virtually an unchanged form. This made it possible for anybody to write programs that all other Apple II users would be able to use, since the language did not have to be purchased or added. If there were thousands of Integer BASIC programs written during the two years when the Integer BASIC Apple II was the only available choice, there were hundreds of thousands of Applesoft programs that appeared in the years following. Even in its later years, it was not uncommon for an applications program to include a configuration module written in Applesoft using the disk commands available with BASIC.SYSTEM in ProDOS. It was often faster to write such a program in BASIC, and the author would know without a doubt that his customer will be able to run it.
[Additional note: When Microsoft wrote their 6502 floating point BASIC back in 1976, the programmers embedded the company name in a hidden fashion within the object code. The encoding hid it such that simply looking at the code displayed as ASCII text would not reveal it. It was present in nearly all Microsoft versions of this 6502 language, and it is also present in Applesoft. On the Commodore PET, a command could be typed from the keyboard to display this “Easter egg”. On the Apple II the code was present, but there was no secret method to invoke it. If viewing from the Monitor, the bytes for it can be found from $F094 to $F09C, just after the definitions for powers of pi. The bytes at those addresses are:
F094:A6 D3 C1 C8 D4 C8 D5 C4 CE CA
If printed as ASCII, it reads as “&SAHTHUDNJ”. If an exclusive-or function with $87 is performed on each byte, it changes this to “!TFOSORCIM”, which is “MICROSOFT!” backwards., ]
APPLESOFT 3 (?)
In 1979 there were rumors at the West Coast Computer Faire about an enhancement to Applesoft II that was in the works at Apple. It would possibly be called Applesoft 3, and would be as much of an enhancement over Applesoft II as that version was to Applesoft I. Supposedly it was intended to merge DOS and BASIC, and would include such powerful functions as IF-THEN-ELSE, PRINT USING, WINDOW, and VIEW PORT. It was predicted to be a RAM version only, and would be about 24K in size.
What was actually happening at Apple was that there had indeed been a move to create a better Applesoft, starting in late 1978. Internally it was called Basic III (or Basic ///), and was created to be RAM-based, with the additional features mentioned above. It was a revision of Applesoft II to make it more powerful, and was originally intended for the Apple II. When the Apple III project was getting far enough along to start planning a shipping date of March 1980, they found that Pascal for the Apple III was not going to be ready at the same time. It was decided to take Basic III, which was working well on the Apple II in a beta form, and modify it to work on the Apple III. Donn Denman was hired to do this conversion, and did his work on a 6502 cross assembler on a Polymorphic computer. He collaborated with Taylor Pohlman, who had long experience with BASIC. They produced what eventually became Business Basic, and the original code never became a product on the Apple II.,
The work done on Business Basic was later revived in the attempt to create GS Basic for the Apple IIGS.
A comparison of the source code for Business Basic and Applesoft shows that they share quite a bit of code. This confirms that Applesoft (or, really, Microsoft’s 6502 BASIC) is at the core of this Apple III language. It even contains the same Microsoft Easter egg as in Applesoft, at the same relative location (after the definitions of powers of pi).
On the 8-bit Apple II models, several utilities were created to extend the usability of Applesoft and try to meet some of its limitations.
Beagle Bros sold a utility in 1986 called the Beagle Compiler. Written by Alan Bird, it took an Applesoft program and created an executable binary program that ran just like the original. This binary ran much faster than the original, though some programs could not take advantage of it due to memory constraints. Also, it did not help with programs that did floating-point calculations (trigonometry and logarithmic functions, division, and the RND function). One reviewer claimed that this compiler could speed up programs by five to fifteen times.
Another method of optimizing Applesoft was MD-BASIC, sold for $89.95 by Morgan Davis Group. Davis wrote it to help him speed the Proline software he had written for his computer bulletin board system. MD-BASIC took an Applesoft program and created a highly optimized version of it that would run on any Apple II. Written in C, the MD-BASIC optimizer ran only on the Apple IIGS, but the programs it created could run on any Apple II. MD-BASIC allowed logic that did not naturally come in Applesoft, such as IF-THEN-ELSE and WHILE-WEND statements. It also allowed meaningful variable names (using more than two significant characters), did not require line numbers, and had named subroutines. The BASIC program could be written and designed in a standard word processor, with as much commentary as was desired.
Applesoft on the Apple IIGS was virtually the same ROM-based language that appeared on the Apple II Plus back in 1979, and so worked just as it did on the 8-bit Apple II computers. It could utilize the lowest 64K of RAM, but could not make use of extended memory on the IIGS. For those who wanted to program in BASIC on the Apple IIGS, some options became available within two years of its release. In February 1988, Absoft released AC/BASIC, a 16-bit BASIC for the Apple IIGS, selling for $125. It was a compiled BASIC, and was almost completely compatible with versions of Microsoft BASIC, as well as Absoft’s AC/BASIC for the Commodore Amiga. Like other modern BASIC languages, it did not require line numbers, and allowed access to IIGS graphics, sound, and GUI interface elements. It worked under the Apple Programmer’s Workshop editor.
Developed at Apple by John Arkley, GS BASIC for the Apple IIGS was another interpreted BASIC. It was derived from Apple III Business BASIC, though the original work on it was done through a contract with an outside company, Regent Systems. Arkley began to work on it in June 1986, and by November he had a working version. One of the challenges Arkley had to overcome was making this interpreted language properly interact with the Apple IIGS toolbox. Since it was modeled off of Business BASIC, it offered more sophisticated data file read and write (all Applesoft could do was save and load text, and translate that text into numbers within the program). It offered more advanced and modern commands such as DO-WHILE and UNTIL options, and was actually much closer to newer versions of Microsoft BASIC than it was to the ten-year-old Applesoft language.
Although GS BASIC was never officially released, there were beta copies sent out to developers that have survived. A comment made by one user who tried it out years later mentioned how slow it was compared to Applesoft. A simple program that used a FOR/NEXT loop to count from 1 to 10,000 took four seconds to run under Applesoft, but took 43 seconds to run under GS BASIC. A response to this claim was that the problem was related to the use of the SANE routines (Standard Apple Numerics Environment, for high precision math) on the IIGS. Although the SANE package offered significantly higher precision floating-point math, in many side-by-side comparisons, Applesoft ran faster.
Micol Systems released Micol Advanced BASIC for $145 in November 1988. It worked much like Applesoft, and did not have the steeper learning curve of other versions of BASIC. It was a compiled BASIC, and as with other BASIC languages offered at this time, line numbers were optional, it offered named procedures and more structured loop commands, a CASE statement, a PRINT USING command, and could support strings as long as 1,023 characters. It worked on the Apple IIGS, and could use all of the available IIGS RAM. Development on improving and bug-fixing the language continued until 1994.
BASIC beyond Applesoft on the Apple IIGS was not a popular option with many casual programmers. The ease of use and inclusion of Applesoft made it the first go-to language for quick and easy projects. If programmers wanted a powerful language, they turned to Pascal, and, increasingly, to C. As a result of this, by 1992 most of these IIGS-specific BASIC programming languages were no longer available or supported. GS BASIC had died on the vine at Apple, having never moved beyond a beta release for developers. AC/BASIC and TML BASIC did not stay on the market for very long. At that time (in 1992), Micol Advanced BASIC was still sold, but it did not support access to the Apple IIGS toolbox, and did not have PEEK, POKE, or call commands or more modern equivalents.
Despite these previous product failures, The Byte Works released GSoft BASIC in August 1998, six years after Apple stopped selling the Apple IIGS. Author Mike Westerfield released updates to version 1.1 in November, and version 1.2 in February 1999. The Byte Works also sold a course on programming in GSoft BASIC in 1999. Like other programming languages from The Byte Works, GSoft BASIC worked from the ORCA (APW) command line, and included commands to allow access to the IIGS toolbox. In 2011, Westerfield released GSoft as freeware. At the same time he began to sell a product called techBASIC for iOS 5, designed to run on the iPhone, iPad, and iPod touch. techBASIC was derived from GSoft, and added matrix operations which most version of BASIC had neglected, though it was part of the original BASIC language description.