How To Link Swm Subprograms; Connection Status; Com Block - HP 4085M Operation Manual

Hide thumbs Also See for 4085M:
Table of Contents

Advertisement

Section 1II
3-44.
How To Link S W M Subprograms
To use any of the S WM sub programs, you must link them to the end of y,our program.
There are three w ays to accomplish this.
( 1 )
LOADSUB Sub_name From "SW M "
This c o m m and links a single sub program (Sub_name) from the SWM program
library to the last line of the program presently i n memory.
LOADSUB ALL FROM "SWM"
(2)
This com mand links all the subprogrjl.ms contained in the S W M program library
to the last line of the program presently in memory.
(3)
LOADSUB FROM "SWM"
This
described above except that it links only those subprograms actually called in
the main program.
Which form of the LOADSUB command should you use? The choice depends on a number
of considerations; for example, the number of subprograms to be linked, the size of the
main program, and the size of your computer's user m emory. If you have to link only one
subprogram , form (1) is the best choice since it links only the specified subprogram . Form
of the LOADSUB command can also be used program m atically. This allows you to link
(1)
a subprogram only when the m ain program requires it; when the subprogram is
necessary, it can be "unlinked" by the DELSUB command, and another subprogram can
then be linked.
time.
This is an important consideration if you have severe m emory constraints; for
example, the main program is very large or user memory is small.
many subprogram s and you are "memory rich," form (2) of the LOADSUB command can be
used.
Like form ( 1 ), form (2) can be used programmatically, but it is uneconom ical
because it links all subprograms, including unnecessary ones.
offers you a happy medium between forms
prerun to find out which subprograms are required, and then links only those subprograms.
This
from,
however,
programm atically.
be found in the com puter's reference manuals.
One
last
word
subprogram s that you use often, you should consider storing them in the S W M program
library. This w ill sim plify subprogram handling.
3-45.

Connection Status

3-46.
Often it is necessary to m onitor the status of port-to"pin connections during
program
execution.
appropriate
points
displays, on the CR T of the computer, a m atrix-type table showing the connection status
of each port/pin c
sample program tha! illustrates the use of the Swm_status subprogram .
3-47.
C O M Block
3-48.
You can use the S W M COM block in your own programs and subprograms simply by
inserting the necessary COM block declaration, as shown below.
3-20
command
is similar
Only one subprogram will be linked to the ' main program at any given
requires
BASIC
Complete details on the various forms of the LOADSUB command can
on
linking
subprograms.
This is possible
in
the
program.
om
bination'
.
Figure 3-1 2 shows the table, and Figure 3-Hl shows a
COM ISyscoml
INTEGER
to the
LOADSUB
ALL
(1)
and (2) since it scans the m ain program at
Extensions
2.1,
If
you've
written
by calling the S w m _status subprogram at the
When
executed,
the
DCB , S wm , P i n_p o r t C l
'
FROM
" command
" •••
no
longer
If you have to link
Form_ (3) of LOADSUB
and
it , cannot
be
several
m easurement
Swm _status
subprogram
: 4 8 )
M odel 4085M
used

Advertisement

Table of Contents
loading

Table of Contents