EasyManua.ls Logo

Commodore Plus 4 - Built-in software; CHAPTER 4 Getting Started

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
30
The
BASIC
Language
40
READ
C,D
READs
the
next
two
values
50
PRINT
"C
=";C;"D
=";D
from
the
DATA
list.
60
RESTORE
Resets
the
data
pointer
to
the
beginning
of
the
DATA
list.
70
READ
X,Y,Z,
READs
the
first
three
values
90
PRINT
"X
=";X;"Y
=
";Y;"Z
=";Z
from
the
RESTOREd
DATA
list.
RUN
A=1B=2
C
=
3
D
=
4
X=
1
Y=2
Z
=
3
DEC
Abbr.
none
DEC
(string)
Finds
the
decimal
(base
10)
value
of
a
hexadecimal
base
16)
number.
Hexa
decimal
base
digits
are
0
through
F,
which
equals
decimal
15.
The
hexadecimal
number,
which
must
be
a
string
expression,
must
be
between
0
and
hexadecimal
value
$FFFF,
which
is
equal
to
decimal
65535.
(The
dollar
sign
preceding
a
number
is
used
to
indicate
that
the
number
is
hexadecimal
but
should
NOT
be
included
in
the
string
sent
to
the
DEC
function.)
The
DEC
function
returns
the
unsigned
value
of
the
hexadecimal
number.
To
get
the
16-bit
two's
complement,
X,
of
a
hexadecimal
number,
X$,
use
X
=
DEC(X$)+(DEC(X$)>32767)*65536
Example:
PRINT
DEC("1E");
DEC("10");
DEC("A")
30
16
10
DEF
FN
Abbr.
dE
fn
DEF
FN
name
(variable)
=
function
Defines
a
calculation
as
a
function.
DEF
FN
saves
time
and
errors
by
sparing
you
from
having
to
reenter
a
calculation
you
will
use
more
than
once
in
a
program.
After
the
function
is
defined
as
a
formula,
you
can
use
it
to
solve
a
specific
problem.
To
do
so,
call
the
function
and
supply
the
value
you
want
the
formula
to
solve,
with
FN
name
(value).
Parameters:
function
name
(variable)
=
calculation
1.
The
function
name
is
any
legal
variable
name.
When
you
want
to
use
the
function
later
in
the
program,
you
give
FN
followed
by
the
function
name.
2.
The
(variable)
is
replaced
by
a
value
when
you
call
the
function
you
defined.

Other manuals for Commodore Plus 4

Related product manuals