Microsoft KB Archive/10294

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 17:49, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Compiled BASIC Parameter Passing to MASM ID Number: Q10294

3.x-5.x MS-DOS enduser |

Question: How does a compiled BASIC program link to routines in Assembler?

Response: In compiled BASIC, programs do not “link” to the assembler routines as do other high-level languages such as Pascal or C. Typically, the assembler routine is written, which creates an OBJ file; then, it is linked to produce a relocatable EXE file. BASIC does not handle EXE type files; it prefers files that can be loaded in a fixed location in memory. These files are sometimes called “binary files.” To save this type of file, use the BSAVE command, which needs the following information:

  1. The segment address of the file
  2. The name of the file with a .BIN extension (This is not required; do this only if you wish to show that this is a binary file.)
  3. The offset address of the file
  4. The length of the file in bytes

This information can be used with the BLOAD command to load the assembly routine from the BASIC program.