!lm12
!rm75
Applesoft Source, Completely Commented.....Bob Sander-Cederlof

For several years I have been working on this.  I even bought an assembler from another company just to get the promised source code of Applesoft that came in the package, but I was very disappointed.  (No complaints, it was intended as a "freebie" with their assembler.)  I wanted LOTS of comments, MEANINGFUL labels, and I wanted it in the format of the S-C Macro Assembler.

Now I have it.  And you can have a copy, on two diskettes, for only $50.  It comes in an encrypted form, with a driving program which creates the source code files on your machine with the aid of the Applesoft image in ROM or RAM.  The encryption is meant to protect the interests of Apple and Microsoft.

You need two disk drives to assemble Applesoft, a printer to get a permanent listing, and of course you need the S-C Macro Assembler.  The source code is split into more than a dozen source files, assembled together using a control file full of .IN directives.  After assembling and printing, you will have well over 100 pages of the best documentation of Applesoft internals available anywhere.

In the process of writing the comments, I discovered some very interesting bugs.  Some have been published before, and others I have never heard of.  Just for fun, try this:

!lm+5
]A%=-32768     (you get an error message, correctly)
]A%=-32768.00049    (No error message!)
]PRINT A%           (You get 32767!)
!lm-5

Or open your disk drive doors, just in case, and type:

!lm+5
]LIST 440311
!lm-5

That last one can be disastrous!  Any use of a six-digit line number (illegal, but not caught by Applesoft) between 437760 and 440319 will cause a branch to a totally incorrect place.  For example, GOTO 440311 branches to $22D9!

The causes of these and other interesting phenomena, as well as some suggested improvements resulting in smaller/faster code, are documented in my comments.

