Help with qb & tasm...

 BBS: Inland Empire Archive
Date: 04-07-92 (20:15)             Number: 137
From: STEVE HALKO                  Refer#: NONE
  To: CHRIS LINDSEY                 Recvd: NO  
Subj: Help with qb & tasm...         Conf: (1) 80xxx

CL>I've seen many programs pass strings from .ASM to QBasic without having CL>to define the string length in advance (I think)... Is there CL>any other way to do this? Yes. Instead of passing a string variable name from QB to ASM, just create the string in ASM (including string descriptor), and pass the address of the string descriptor back to QB. In other words, set it up as a function: GetDrive Proc .DATA DescLen DW 3 ;String Length DescAddr DW 0 ;String Address StringBuffer DB "C:\" ;the string itself .CODE [Do what you need to do here to get the desired string into StringBuffer] MOV DescAddr, Offset StringBuffer MOV AX, Offset DescLen ;Return the address of the string ;descriptor to QB RET GetDrive Endp In your QB program, put: DECLARE FUNCTION GetDrive$() Drive$ = GetDrive$ [Change drives here] Drv$ = GetDrive$ Now, Drive$ and Drv$ will be different, but you don't have to predefine them as before. CL> You asked why I'm not using the CALL INTERRUPT from QuickBasic; CL>I'd like this library to be usable by those people using QBasic CL>(bundled with DOS 5.0) since they can't use CALL INTERRUPT. Ah, but now they CAN! See the latest QBNews (Vol.3, No.1). * SLMR 2.1a * Its an EXE Jim, but its not an EXE file as we know it! --- DB B1064/002487 * Origin: Gulf Coast BBS - (904) 563-2547 - HST/V.32bis (1:365/12)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET