Passing Strings to Assembler Routines Written for GW-Basic (33714)
The information in this article applies to:
- Microsoft QuickBASIC 2.0
- Microsoft QuickBASIC 2.01
- Microsoft QuickBASIC 3.0
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
This article was previously published under Q33714 SUMMARY
Assembler routines that are written to run with Microsoft GW-Basic (or
with IBM BasicA or Compaq BasicA) and are passed a string variable as
an argument will not run properly when called from QuickBasic compiled
programs. This problem arises because the length of the string
descriptor for QuickBasic strings (4 bytes) is 1 byte longer than the
string descriptor for the GWBasic.EXE or the BasicA interpreter (3
bytes).
One solution to this problem is to simulate a GW-Basic string in
QuickBasic and pass this simulated string to the assembler routine.
The assembler routine does not need to be modified when this method is
used.
Note that many other more complicated factors (such as memory
management of code and data) may also prevent assembler routines that
were designed for GW-Basic or BasicA to be successfully called from
compiled Basic. Many assembler routines may require rewriting.
This information applies to QuickBasic Versions 2.00, 2.01, 3.00,
4.00, 4.00b, and 4.50 and to Microsoft Basic Compiler Versions 6.00
and 6.00b for MS-DOS and MS OS/2.
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | KB33714 |
---|
|