EasyManua.ls Logo

Commodore VIC-20 - Operators

Commodore VIC-20
308 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...
The
three
Boolean
operators
can
also
be
used
to
perform
logic
operations
on
the
individual
binary
digits
of
two
adjacent
terms
(or
just
the
term
to
the
right
in
the
case
of
NOT).
But
the
terms
must
be
in
the
integer
range.
Boolean
operations
are
defined
by
groups
of
statements,
which
taken
together
constitute
a
"truth
table."
The
following
table
lists
the
truth
tables
for
the
Boolean
operators
used
by
VIC
BASIC.
I
Boolean
Truth Table
The
AND
operation
results
in
a
1
only
if
both
bits
are
1.
1
AND
1
=
1
0
AND
1
=
0
1
AND
0-0
0
AND
0
=
0
The
OR
operation
results
in
a
1
if
either
bit
is
1.
1
OR
1
=1
0
OR
1
=
1
1
OR
0
=
1
0
OR
0
=
0
The
NOT
operation
logically
complements
each
bit.
NOT
1
=
0
NOT
0
=
1
I
Thisdiscussion
of
binary
digit
(bit)
oriented
Boolean
operations
is
presented
for
those
who
are
interested
in
the
details
of
how
these
operations
are
performed.
If
you
do
not
understand
it,
skip
it.
You
are
not
skipping
anything
you
must
know.
Recall
that
a
single
term
has
an
implied
"<>0"
following
it.
The
expression
therefore
becomes:
IF
G<>0
GOTO
40
Thus,
the
branch
is
not
taken.
In
contrast,
a
Boolean
operation
performed
on
two
variables
may
yield
any
integer
number:
IF
A%
AND
B%
GOTO
40
Assume
that
A%
=
255 and
B%
=
240.
The
Boolean
operation
255
AND
240
yields
240.
The
statement,
therefore,
is
equivalent
to:
66
I

Other manuals for Commodore VIC-20

Related product manuals