Microsoft KB Archive/57363

= How to Pass a Variable Length String from Basic to MASM =

Article ID: 57363

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q57363



SUMMARY
The example below demonstrates how to pass a variable-length string from a compiled Basic program to a MASM procedure.

This information is also included with the Help file provided with the Standard and Professional Editions of Microsoft Visual Basic for MS-DOS, version 1.0.



Basic to MASM Example
For Visual Basic for MS-DOS, compile and link as follows: Compile: BC /d basmasm.bas; MASM masmtest; Link:   LINK basmasm.obj masmtest.obj,,,VBDRT10E.lib;

For Basic PDS for MS-DOS and MS OS/2, compile and link as follows:

Compile: BC /Fs/d basmasm.bas; MASM masmtest; Link:   LINK basmasm+masmtest,,,BRT70EFR;

REM ==Basic to MASM code=== DEFINT A-Z DECLARE SUB printmessage (BYVAL segm, BYVAL offs) CLS a$ = &quot;Assembly test successful&quot; + &quot;$&quot; CALL printmessage(SSEG(a$), SADD(a$)) LOCATE 10, 10 PRINT &quot;Back from assembly&quot; END

.Model   Medium,basic .stack .code public   printmessage printmessage       proc      uses ds,segm,offs mov      ax,segm mov      ds,ax mov      dx,offs mov      ah,9 int      21h ret printmessage       endp end
 * MASM code here

Additional query words: VBmsdos BasicCom 1.00 7.00 7.10

Keywords: KB57363

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.