Apple II User Manual

Page of 257
POKE            POKE location, byte                                     357 POKE I,J
                The POKE statement stores the byte
                specified by its second argument (J) into
                the location given by its first argument (I).
                The byte to be stored must be =>0 and
                <=255, or an FC error will occur.  The
                address (I) must be =>0 and <=65535, or
                an FC error result.  Caution:  Careless use
                of the POKE statement may cause your
                program, BASIC, or the Monitor functions
                to operate incorrectly, to hang up, and/or
                cause loss of your program.  Note that
                Pages 0 and 1 in memory are reserved for
                use by BASIC and should not be used for
                user program variable storage.  A POKE to
                a non-existent memory location is harmless.
                One of the main uses of POKE is to pass
                arguments to machine language subroutines.
                (See Appendix F.)  You could also use
                PEEK and POKE to write a memory
                diagnostic or an assembler in BASIC.
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
RUN             RUN line number                                         RUN 200
                Starts execution of the program currently in
                memory at the specified line number.  RUN
                deletes all variables [does a CLEAR) and
                restores DATA.  If you have stopped your
                program and wish to continue execution at
                some point in the program, use a direct
                GOTO statement to start execution of your
                program at the desired line, or CONT to
                continue after a break.
                Start program execution at the lowest                   RUN
                numbered statement.
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
SAVE            SAVE                                                    SAVE
                Saves the current program in the AIM 65
                memory on cassette tape.  The program in
                memory is left unchanged.  More than one
                program may be stored on cassette using
                this command.
                See Appendix G for more information.
304  PROGRAM STATEMENTS
In the following description of statements, an argument of B, C, V or W denotes a numeric variable,
X denotes a numeric expression, X$ denotes a string expression and an I or J denotes an expression
that is truncated to an integer before the statement is executed.  Truncation means that any
fractional part of the number is lost, e.g., 3.9 becomes 3, 4.01 becomes 4.
An expression is a series of variables, operators, function calls and constants which after the
operations and function calls are performed using the precedence rules, evaluates to a numeric
or string value.
A constant is either a number (3.14) or a string literal ("FOO").
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
DEF             DEF FNx [(argument list)] = expression                  100 DEF FNA(V)=V/B+C
                The user can define functions like the built-
                in functions (SQR, SGN, ABS, etc.) through
                the use of the DEF statement.  The name
                of the function is "FN" followed by any
                legal variable name, for example:  FNX,