PROGRAMING WITH THE PAMUX DRIVER
Pamux User’s Guide
3-3
USING THE PAMUX DRIVER WITH INTERPRETED BASIC OR QBASIC
To call the Pamux driver subroutine from a program written in Interpreted BASIC or QBasic, the program
must load the driver, name it, declare and initialize variables, and call the driver. These steps are
described below.
Load the Pamux Driver
To use the driver in your application program, you must first load the subroutine into memory. This is
done with two commands: DEF SEG and BLOAD.
DEF SEG is used to tell BASIC where to put the driver. The driver should be loaded above BASIC. This
location depends on the size of DOS and the BASIC interpreter. A typical value for a system with 640 KB
of memory is 3600 hex. The following statement can be used in most cases without modifications:
DEF SEG = &H3600
BLOAD is used to tell the BASIC interpreter to load the driver subroutine from disk to memory. This
statement must follow the DEF SEG statement, since BASIC must know where to put the driver before it
can load it. The following BLOAD statement instructs BASIC to load the driver at the currently defined
segment:
BLOAD “PDRIVER.COM”, 0
The 0 in the statement above tells BASIC to start loading at an offset of 0 from the currently defined
segment.
The file containing the version of the driver to be loaded under Interpreted BASIC or QBasic is
PDRIVER.COM.
Name the Pamux Driver
The CALL statement calls the driver subroutine from a BASIC program. The CALL statement must
include the name of a variable whose value indicates where the subroutine is located in relation to the
currently defined segment. If you have loaded the driver as described previously, the variable must be
equal to 0. The name Pamux must be used when using the BASIC compiler. Hence, the following simple
assignment statement should appear in your program before the driver is called:
Pamux = 0
Declare and Initialize the Parameters
All variables passed to the driver subroutine must be declared and initialized before the driver can be
called. The VALUE% array parameter must be declared using the DIM statement. Each element should
then be set to a default value. The following program segment is an example:
200
DIM VALUE%(7)
‘ Dimension the array
210
FOR I% = 0 TO 7
‘ Fill all array elements with 0
220
VALUE%(I%) = 0
230
NEXT
240
ERRCOD% = 0
‘ Initialize all parameters
250
ADDRESS% = 0
260
COMMAND% = 0
270
POSITION% = 0
Содержание PAMUX
Страница 10: ...TABLE OF CONTENTS x Pamux User s Guide...
Страница 14: ...TABLE OF CONTENTS xiv Pamux User s Guide...
Страница 103: ...PROGRAMING WITH THE PAMUX DRIVER 3 42 Pamux User s Guide...
Страница 121: ...PROGRAMING WITHOUT THE PAMUX DRIVER 4 18 Pamux User s Guide...
Страница 125: ...TROUBLESHOOTING AND TIPS A 4 A 4 A 4 A 4 A 4 Pamux User s Guide...
Страница 135: ...SPECIFICATIONS B 10 Pamux User s Guide...
Страница 141: ...TEMPERATURE CONVERSIONS ROUTINES C 6 Pamux User s Guide...
Страница 143: ...PRODUCT SUPPORT D 2 Pamux User s Guide...
Страница 149: ...GLOSSARY E 6 Pamux User s Guide...