Example 1; Example 2 - Sharp PC-1500A Instruction Manual

Hide thumbs Also See for PC-1500A:
Table of Contents

Advertisement

All
and
more
about
Sharp PC-1500
at
http://www.PC-1500.info
Congratulations!
Your
first
BASIC
program is
now
running.
Your instructions are
being
followed
and
the computer
is
busy
listing all
the
positive
odd
numbers.
in
order.
"So,"
you
say to yourself,
" I'm a
genius.
But
when
wi
ll
it stop?"
Well.,
. , . unfortunately,
w ithout your
in
tervention or battery fa
ilure.
this
part
icular
progC"am
will
never
finish.
To
see
why, let's
review our program:
10
A
=
1
20
PAUSE A
30
A
=
A+2
40
GOTO 20
The effect of
the line
numbered
40
is to
cause
the computer to re-perform all lines after
the
one
numbered
20.
This
includes
line
40
which,
of
course,
tells
the
computer
to
re.re.perform
lines
20,
30,
and 40 .
.
..
and so
on
fo
rever.
This
repetition
without
end
is
known in computer ja,.gon
as ''looping".
Our program
is
stuck in
an "infinite loop" and only
you
have
the
ability to stop
this
tragic
expense
of
battery power.
To
do
this,
press
the
lo•
I
key
.
Since the PC·1500A
is
al ready
on,
you
are actually selecting the BREAK
fu
nction.
Don't
be
alarmed.
Despite
what
the name
seems
to
indicate,
this is not a
self-destruct key. As a matter of
record,
you
cannot.
in
any
way, hurt or
damage
the computer
merely
by pressing
keys,
so
feel free to
experiment
!
If
you
have
pressed the
BR
EAK key, a
message similar
to
the following
is
visible
in
the display
window:
•••
BF.' .
EAK
I
t·~
T
his
informs you i.vhich
instruction
was
being
''executed".
or·
worked
on,
when
you interrupted
the
computer.
Press
the BREAK
key once more,
and
the
computer
awaits your
next
instruction:
DC<
KUH
For those
of
you who
just remembered
that
you
left the tap ru nning at home, this is a
good
stopping
point.
(Before
leaving,
please
press
the
!OFFt
key
to
conserve
batteries.}
Others
of
you
are already becoming p rogramming
addicts and w ill want
to
conti
nue
your
education
with
our
second
example.
(We hereby waive
responsibility
if
you're
late
for
dinner).
Example 2
To
begin
our second program it
is
necessary to
enter the program
mode by
pressing
the
MODE
key until the letters
PRO
(short
for PROGRAM} replace
the
le
tters
RUN
at
t
he top of
the
d
isplay.
The
PC·
1500A will
now
let
us
submit
a new
program or
modify an
o
ld
program. Because
our
new
program
will
not
build on the instructions of
our
old program,
we must
clear those instructions
from
the
computer's
memory.
To
do
this, type in
the
word N EW
and
press
ENTER
.
Aftoer
a
pause the
>
character {called a
prompt) will
return.
Type the following
keystrokes
to enter
the
first
line of
the
program
:
moorn
oomuorn
'""'"'
c:::i
m
rn
oorn
1
..
•c•
1
oo
m
m
m
1
..
,"1 m
''""''
c:::i
''""''
rn
rn
IENTERI
Do not
sale
this PDF
!!!
9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents