Technical information
BASterm Serial Solutions
28500 END
28510 :
28600 ’**************************************************************
28610 ’Call BIOS via statement call interrupt. QuickBASIC 4.5
28620 :
28630 CALL INTERRUPT(&H14, INREGS, OUTREGS)
28640 :
28650 RETURN
28660 :
28670 :
The subroutine is Figure 10-5 uses the extended initialise service
supplied as part of NewBIOS to set the port up. It works its way
though the function parameters, checking that each has a valid
value. The chapter "NewBIOS Reference", sets out the
parameters that service 4, the extended initialise, requires. The
parameters are stored in the variables inregs.ax etc., which are
used to specify the parameters for the interrupt. QuickBASIC
sees inregs as a single structured variable, and GW-BASIC sees
inregs as four separate variables. The flag ISBASICA is set true
earlier on (in the subroutine at line 27000, which sets up the
BIOS interface) if the program detects that it is running under
GW-BASIC/BASICA, and is tested to see whether a
GW-BASIC-style BIOS call or QuickBASIC-style BIOS call
should be made. These are separated into two subroutines, shown
above, at lines 28400 and 28600 respectively. The chapter
"Using NewBIOS", includes a full discussion of accessing the
BIOS under QuickBASIC and GW-BASIC.
The variable initok returns true (-1) to show that the
subroutine has checked its parameters, found them to be ok, and
used them to set the serial port. If the parameters are bad then a
false flag (0) is returned and the serial port is left alone.
Fitting The Parts Together.________________________
The main program of BASterm is shown in Figure 10-6.
Chapter 10 Page 159