//
// IN PLASMA, ANY VALUE CAN BE USED
// AS A CHARACTER, INTEGER, ADDRESS,
// OFFSET, ETC. JUST LIKE IN ASSEMBLY
// LANGUAGE, THERE ARE NO RESTRICTIONS.
// WITH GREAT FLEXIBILITY COMES GREAT
// RESPONSIBILITY. IN THE FIRST EXAMPLE,
// YOU SAW WHERE A STRING WAS PRINTED.
// THE LINE LOOKED LIKE: PUTS(@HELLO)
// HOWEVER, THE STRING NAME WAS JUST
// "HELLO", WITHOUT THE '@'. SO WHAT
// DOES THAT '@' DO? IT IS THE
// ADDRESS-OF OPERATOR. IT TAKES THE
// ADDRESS WHERE THE VARIABLE IS STORED
// FOR ITS VALUE, NOT THE VALUE OF THE
// VARIABLE. WHEN OUTPUTTING THE STRING,
// THE ADDRESS OF THE STRING IS PASSED
// IN, NOT THE ENTIRE STRING. THIS IS
// MUCH MORE EFFICIENT. WHEN AN ADDRESS
// IS PASSED AROUND, IT IS REFERED TO
// AS A "POINTER". IT "POINTS" TO
// SOMETHING.
//
// THE COROLLARY TO THE ADDRESS-OF
// OPERATOR IS THE POINTER-TO OPERATOR.
// NOW, IN PLASMA, A POINTER IS JUST AN
// ADDRESS, THERE IS NO IDEA OF WHAT IT
// POINTS TO. PLASMA ONLY KNOWS ABOUT
// BYTES AND WORDS, SO THERE ARE TWO
// POINTER-TO OPERATORS:
//
//   ^ POINTER-TO-BYTE
//   * POINTER-TO-WORD
//
// NOW THE '*' OPERATOR LOOKS JUST LIKE
// THE MULTIPLICATION OPERATOR, BUT IT
// BEHAVES DIFFERENTLY DEPENDING ON
// WHERE IT IS PLACED. THESE OPERATORS
// ARE PRE-OPS; THEY COME BEFORE THE
// OPERAND.
//
// NOTE THAT ADDRESSES, THUS POINTERS,
// ARE 16 BIT VALUES ON THE APPLE II.
// IF YOU ARE GOING TO SAVE AN ADDRESS
// IN A VARIABLE, IT MUST BE A WORD
// VARIABLE TO HOLD THE FULL PRECISION.
//
// HERE IS AN EXAMPLE TO PLAY WITH:
//

BYTE MYBYTE = 26
WORD MYWORD = 75
WORD MYPTR

MYPTR = @MYBYTE
PUTI(^MYPTR)

PUTC($8D) // THIS IS A CARRIAGE-RETURN CHARACTER

MYPTR = @MYWORD
PUTI(*MYPTR)

DONE // EVERYTHING AFTER "DONE" IS IGNORED

TRY PLAYING AROUND WITH THE CODE. GO
AHEAD. YOU CAN'T REALLY BREAK THE
COMPUTER. IF IT LOCKS UP AND CTRL-RESET
DOESN'T GET YOU BACK TO THE EDITOR, JUST
REBOOT THE MACHINE.

HOPEFULLY YOU SEE THAT THE VARIABLE
NAMES IN PLASMA ARE JUST LABELS APPLIED
TO ADDRESSES. SPACE IS SET ASIDE
DEPENDING ON THE SIZE OF THE VARIABLE,IF
ITS AN ARRAY, AND IF IT IS INITIALIZED.
