[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introducing Slammer!



Ivan Drucker <ivan@ivanx.com> writes:

> KansasFest was very exciting for me this year -- in addition to all the fun,
> I was pleased to introduce two new tools for Applesoft programmers.
> (Attendees received a KansasFest 2010 limited edition 5.25" floppy disk!)
> Both tools are available (for free, of course) at
> http://www.ivanx.com/appleii/.
>
> SLAMMER!
>
> Slammer, lets you embed machine language routines (or other data) within
> 100% legal, typeable Applesoft programs. Unlike other methods, Slammer has
> no performance, stability, or dependency issues.
>
> It's extremely simple to use; you just CALL 2107, and all subsequent REM
> statements are interpreted as though you typed them in at the monitor
> prompt. Usually, you'd want to enter bytes, but you can also move memory, do
> hex dumps, etc. Slammer keeps interpreting REM statements until it hits a
> blank REM, a non-REM statement, or the end of the program. You can call
> Slammer as often as you like.
>
> To enable Slammer, all you need is for lines 0-9 to contain REM statements
> containing specific ASCII characters, provided on the disk. The disk also
> includes SLAMINATOR, which will convert a routine on disk or in memory to
> Applesoft REM statements so you don't have to do it yourself; it also
> contains documentation.
>
> Slammer also has a bonus feature: for byte entry, you can use **** in place
> of an address, and the bytes will be placed between program end and variable
> space start. (This moves LOMEM, so it will erase any variables already set.)
> Entry can be continued on subsequent lines by omitting the address and
> starting them with a colon. With this feature, you don't need to pick any
> defined spot in memory for a relocatable routine such as NuInput; it just
> automatically gets tucked away in a safe spot.
>
> The inspiration for creating Slammer arose last year when I asked c.s.a2.p
> about the best method for providing a machine language routine for an
> Applesoft program. After many responses, I found all of the established
> methods to be flawed. BLOAD requires one or more accompanying files;
> DATA/READ is very slow and difficult to maintain; binary code in program
> lines or before the end-of-program marker is brittle (if a user changes a
> line, forget it). I found the best self-contained solution to be the S.H.
> Lam technique (after which Slammer was named), as it is more versatile and
> easily maintained than DATA/READ (plus, it's insanely clever), but it is
> still quite slow.
>
> I wanted the Lam technique, but at machine language speed. So I tried to do
> something that I figured was probably impossible, and in any event crazy:
> write a routine consisting exclusively of bytes in the range $21-$5A, so
> that they could appear in REM lines that could be typed on every Apple II.
> This meant the only useful memory I could address was $0021-$005A, the only
> operands I could use were #$21-#$5A, and the only instructions I had
> available were AND BIT BMI BVC CLI EOR JMPa LSR PHA PLP ROL RTI. (I used all
> but one of them.) It took nearly a year to complete, and I gave up at least
> once along the way, but now you have it, and it works! (If anyone is
> curious, I can detail how I managed this on my web page or on c.s.a2.p.)

Hey, that is great!  And a truly clever and ingenious hack, in the best
sense of the word!


--
Jerry    awanderin at yahoo dot ca