Sharp PC-1500A Instruction Manual page 115

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

Advertisement

All
and
more
about Sharp PC-1500
at
http://www.PC-1500.info
I. CSA VE what
you
have
done to this point; use a
new
name
when saving to
tape,
i.e .. "PR OG,3"
(Example).
2.
CLOAD the program saved
in
step
on
e back
into
memory.
3.
Now
make any
desired
modifications
or
changes.
However,
keep this in
mind
: changes
can
be
made
ONLY to the first program or to the FIRST OCCURANCE of any duplicated line
numbers.
I.E
..
if
program
line
10 appears
in
the
first
program
as well as the second,
changes
will only affect the
first
occurance of line 10.
Thus if
you attempt
to
edit
the second
occurance of
line 10,
the
change will be erroneously reflected
in
the
first p
rogram
portion
only.
ADDING ADDITIONAL PROGRAM
LIMES:
Additional lines
may
be addocl at the end of
the
existing programs ONLY IF THEY HAVE
LINE
NUMBERS
GREATER THAN THOSE PREVIOUSLY USED.
Note that additional program lines
may not necessarily appear at
t
he "bottom"
of
the
listing.
Since modules
must be linked
via labels (see below).
this
should not be of concern.
LINKING
MERGED
MODULES
{programs)
TOGETHER
Since
the
processor executes your program
lines in logical
sequence,
it
will stop when
it
encounters
a
break in the sequence in
line numbering,
i.e
..
if
line
numbers
10,
20, 30
are
followed by duplicate
line
numbers
in a
second modu
l-e,
the processor will cease
execution
after
line
30 in the first
modu le
.
To
"LINK" your various modules together, the
following
techniques are
valid
:
GOTO
"B"
GOSUB "B",
IF
...
THEN
"B"
(Bis
used for example
only,
you can
use
any
label
except
reserved words or
letters
which .appear in row
#
2
on
the keyboard, i.e
..
Q
thru
P).
NOTE:
When
another program
is
subroutine·called with GOSUB statement in a plurality of
merged
programs, program a GOTO statement (a
line
number greater
th
an
the line
number
to be executed)
after the
GOSUB
statement.
Example:
10
"A"
:
INPUT
A
20 GOSUB
"B"
: GOTO 30
30
GOTO
10
10
"B"
PR
INT
A
20 RETURN
6.
The
CHAIN Statement
CHAIN is a
program
instruction
;
it can only be used with in
a
program.
It cannot be
used
manually
like
CSAVE
, CLOAD,
and MERGE.
The
CHAIN statement allows you to
run
a
program
that
is
too
large to
fit
into
memory all at
once.
Such
large
programs
must be
divided
up into
sections
with
a
CHAIN
statement at the end of each section. These sections can be
saved
on
tape
with CSAVE.
For
example
,
let's
assume you
have
three
program
sections named PROG
1,
PROG2,
PROG3.
Each
of these sections
ends
with a CHAIN statement.
..
PAOGl"
·-PROG2"
"Pft0G3 ..
10:
i-1
1010:
rl
2010
:
20:
.
rl
1000:
CHAIN
r
WOO:
CiiAIN
1000:
CltA
IN
"PROGr. 1010
2000:
CHAIN
··PROG3", 2010
4000:
ENO
During
execution,
when the
computer
encounters the CHAIN
statement. the
next section
is
called into memory and executed. Jn this manner, all of the sections are eventually
run.
113
Do not sale this PDF
!!!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents