HP 9100B Operating & Programming Manual page 69

Hide thumbs Also See for 9100B:
Table of Contents

Advertisement

PROGRAMMING THE 91008
INTRODUCTION TO PROGRAMMING
lt is not necessary to use the octal code in order to program
the
calculator, so until it becomes necessary to edit and correct a
program
,
it is more convenient to consider the memory in terms
of only the two dimensions, registers and characters.
When a program is written it is first assigned a starting address
[because of the convenience of the END instruction
,
described
on Page
70,
it is usual to start at address (
+
)00]
. As each
step is entered into the
calculator,
by pressing the appropriate
keys, the program is automatically stored
sequentially,
begin-
ning at the starting
address.
With the first program step at
( +
)00 (for example) storage is used in the following sequence:
(+
)00,
(+
)01,----- (
+
)09,
(+)Oa, (+)Ob,
(+
)Oe,
(
+
) 0
d, (
+
) 1 0, - .
-
-
·
(
+
) 19, ( +) 1
a, ( +)
1
b, (
+
)
1
c,
(
+
) 1
d, (
+
) 2 0, - . - - -
u p to · - · · · (
+
)
d
c, (
+
)
d d.
When address
(+)dd
is filled the
(+
) page is completed and
the 'program counter' automatically switches to the (
-
) page:
. - . (
+
)
d
c' ( +)
d d,
(-
)
0
0' (-
) 0 1 ' - - . . -
u
p t
0 . . -
.
(-
)dc,
(-
)dd.
When address
(-
)dd
is filled the 'program counter' automatical-
ly resets to address (
+
)00, so that, if another key is then press-
ed, the original program step in (
+
)00 will be erased and re-
placed by the new program step.
The 'Program Counter' is best considered as those electronic
circuits which automatically step the calculator sequentially
through the memory. The programmer can preset the counter
to start at any address, this operation is known as 'addressing
the program counter' (See GO TO key on Page 68).
The
programmer can also instruct the counter to 'branch' dur-
ing a program (i.e. go to another address and continue stepping
from
there).
Branching
can take two forms; 'conditional' and
'uncond itiona I'.
lf the branch
is 'conditional',
the
calculator makes
the
decision
whether to branch
or
not;
as a simplified example, the calcula
-
tor may
ask, "ls
one number
larger
than
another number?"
lf
the answer
is
NO, the
calculator branches
to
another address
and performs the
steps
from there;
if
the
answer is
YES,
the
calculator goes to the next
step in
the
program. Conditional
branching
is
fully described,
starting on Page
83.
An 'unconditional' branch gives the
calculator no option; it
must
branch to the address indicated
in
the
program (See GO TO
key on Page 68 )
.
BRA
59
IG

Advertisement

Table of Contents
loading

Table of Contents