bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Absolute Routine Details
  ◄Syntax►  ◄Details►  ◄Example►                 ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
The Absolute routine transfers control to a machine-language procedure. This
routine is included in the QBX.QLB and QBX.LIB libraries.
 
CALL Absolute ([argumentlist,] integervariable%)
    ■ Arguments in argumentlist are passed to the machine-language program
      as offsets (near pointers) from the current data segment. Although
      arguments are passed as offsets, the machine-language program is
      invoked with a far call.
    ■ The integervariable% is not passed to the procedure. Your program
      may need to execute a DEF SEG statement before executing Absolute
      to set the code segment for the called routine. Using a noninteger
      value for integervariable% produces unpredictable results.
 
Important
    ■ To use the Absolute routine in the QBX environment, use the QBX.QLB
      Quick library. To use Absolute outside the QBX environment, link
      your program with the QBX.LIB file.
    ■ The QBX.BI header file contains the necessary declarations for the
      Absolute routine.
    ■ The Absolute routine is provided to maintain compatibility
      with earlier versions of BASIC. Mixed-language programming using
      the CALL and DECLARE statements provide a simpler way to use
      assembly language with BASIC.
 
Programming With OS/2
    ■ When using the Absolute routine in OS/2 protected mode, be
      careful not to refer to an illegal memory address. Before it
      executes the Absolute routine, BASIC attempts to get an executable-
      code-segment alias for the code you wish to access. If this
      operation fails, BASIC generates the error message, "Permission
      denied." A safe place to store user-written machine code is in
      memory allocated for a conventional BASIC object, such as an array.
 
Differences from BASICA
    ■ Assembly-language programs that are invoked from BASICA and that have
      string arguments must be changed because string descriptors are now
      4 bytes long. For a near-string descriptor, the 4 bytes are the low
      byte and high byte of the string length followed by the low byte and
      high byte of the string address. Far-string descriptors are also
      4 bytes long, but their structure is proprietary. For more
      information on using far-string descriptors, see "Mixed-Language
      Programming" and "Advanced Programming with Far Strings" in the
      Programmer's Guide.
    ■ The Absolute routine replaces the BASICA CALL statement.