Microsoft KB Archive/57363

From BetaArchive Wiki
Knowledge Base


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.

MORE INFORMATION

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$ = "Assembly test successful" + "$"
CALL printmessage(SSEG(a$), SADD(a$))
LOCATE 10, 10
PRINT "Back from assembly"
END

; MASM code here
                    .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
                


Additional query words: VBmsdos BasicCom 1.00 7.00 7.10

Keywords: KB57363