Microsoft KB Archive/10294

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 18:13, 12 August 2020 by X010 (talk | contribs) (X010 moved page Microsoft KB Archive/Q10294 to Microsoft KB Archive/10294 without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft 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.