| | | | | String
VN DSP NVA DATA DATA Terminator
The SWEET 16 registers are as shown:
low high low high low high low high
$0000 1E 00 08 08 08 0A 00 00
---------- ---------- ---------- ----------
| | | |
register register register register
R0 R1 R2 R3
(acc) (source) (dest) (#bytes)
The low order byte of R0, the SWEET 16 accumulator, has $1E
in it, the last byte moved (the 8th).
The low order byte of the source register R1 started as $00
and was incremented eight times, once for each byte of moved
data.
The high order byte of the destination register R2 contains
$0A, which was entered at 10 (the variable) and poked into
the SWEET 16 code. The low-order byte of R2 was incremented
exactly like R1.
Finally, register R3, the register that stores the number of
bytes to be moved, has been poked to 8 (the variable B) and
decremented eight times as each byte got moved, ending up
$0000.
By entering character strings and varying the number of bytes
to be moved, the SWEET 16 registers can be observed and the
contents predicted.
Working with this demonstration program, and study of the
text material will enable you to write SWEET 16 programs that
perform additional 16 bit manipulations. The unassigned
opcodes mentioned in the "WOZ Dream Machine" article should
present a most interesting opportunity to "play".
SWEET 16 as a language - or tool - opens a new direction to
Apple ][ owners without spending a dime, and it's been there
all the time.
"Apple-ites" who desire to learn machine language programming,
can use SWEET 16 as a starting point. With this text
material to use, and less opcodes to learn, a user can
quickly be effective.
Listing #1
>List
10 PRINT "[D]BLOAD SWEET": REM CTRL D
20 CALL - 936: DIM A $ (10)
30 INPUT "ENTER STRING A $ " , A $