Apple II User Manual

Page of 257
+------------------------------------------------------------------------
|  TOPIC -- Apple II -- WOZPAK Sweet-16 article by Dick Sedgewick
+------------------------------------------------------------------------
SWEET 16 - INTRODUCTION
by Dick Sedgewick
Sweet 16 is probably the least used and least understood seed
in the Apple ][.
In exactly the same sense that Integer and Applesoft Basics
are languages, SWEET 16 is a language. Compared to the
Basics, however, it would be classed as low level with a
strong likeness to conventional 6502 Assembly language.
To use SWEET 16, you must learn the language - and to quote
"WOZ", "The opcode list is short and uncomplicated". "WOZ"
(Steve Wozniak), of course is Mr. Apple, and the creator of
SWEET 16.
SWEET 16 is ROM based in every Apple ][ from $F689 to $F7FC.
It has it's own set of opcodes and instruction sets, and uses
the SAVE and RESTORE routines from the Apple Monitor to
preserve the 6502 registers when in use, allowing SWEET 16 to
be used as a subroutine.
It uses the first 32 locations on zero page to set up its 16
double byte registers, and is therefore not compatible with
Applesoft Basic without some additional efforts.
The original article, "SWEET 16: The 6502 Dream Machine",
first appeared in Byte Magazine, November 1977 and later in
the original "WOZ PAK". The article is included here and
again as test material to help understand the use and
implementation of SWEET 16.
Examples of the use of SWEET 16 are found in the Programmer's
Aid #1, in the Renumber, Append, and Relocate programs. The
Programmer's Aid Operating Manual contains complete source
assembly listings, indexed on page 65.
The demonstration program is written to be introductory and
simple, consisting of three parts:
     1. Integer Basic Program
     2. Machine Language Subroutine
     3. SWEET 16 Subroutine
The task of the program will be to move data. Parameters of
the move will be entered in the Integer Basic Program.
The "CALL 768" ($300) at line 120, enters a 6502 machine
language subroutine having the single purpose of entering
SWEET 16 and subsequently returning to BASIC (addresses $300,