Chapter 4: Programming the AD12-8
Manual Number: 00650-014-4
Page 4-9
B. The array dimension statement must be followed by the COMMON SHARED statement for the
driver to be able to find the array. Note: Steps A and B are necessary for any array that will be
used by the driver. Certain tasks within the driver required the address of a data buffer, so these
two steps would need to be performed for those arrays as well.
COMMON SHARED PARAM%()
C. Now DECLARE the driver routine. This declaration must include a BYVAL statement before
the array variable.
DECLARE SUB A12DRV(TASK%, BYVAL PARAM%, STAT%)
D. Make your assignment to these variables as desired for the function you wish to perform. See
CHAPTER 5: DRIVER REFERENCE
for details on each task.
E. Make the call to the driver. The CALL statement must explicitly pass the offset of the array
variable.
CALL A12DRV(TASK%, VARPTR(PARAM%(1)), STAT%)
F. To use the program and driver in the environment, you must link a Quick Library. Perform the
following command from the command line.
LINK /Q A12DRV.OBJ,A12DRV.QLB,,BQLB45.LIB; [ENTER]
G. Now load the Quick Library when starting the environment.
QB /L A12DRV.QLB [ENTER]
H. Use the start command from the run menu to execute the program.
I. To prepare an EXE file from the command line, use the following compile and link
commands.
BC /o YOURPROG;[ENTER]
LINK YA12DRV;[ENTER]
Using the Driver with BASIC
The following procedure will show you how to use the driver with most BASIC languages. You
may refer to any of the BASIC sample programs for further illustration.
A. Declare the three variables for the driver as global.
10 DIM TASK%, STAT%, PARAMS(5)
B. Define a segment within memory to load the driver. You must make sure this segment is not used
by BASIC or your program.
20 DRIVERSEG = &H5000
30 DEF SEG = DRIVERSEG