PC Assembly Programming
AOL Assembly Lesson 2

This second bit of code is designed to show us how to write a subroutine for BASIC that is compatible with all versions of the BASIC interpreter. This routine will accept three parameters, adding the first two together and then storing the sum into the third parameter. The third parameter must be a legal variable that can accept a value (don't specify 5, for example.)

This program can be downloaded directly as project 2's source or you can just look at it directly as pretty project 2.

   ML /AT /Sa /Fl PROJCT02.ASM

You should get a warning message from the linker, this time. Something like:

   LINK : warning L4055: start address not equal to 0x100
                       for /TINY

The warning is just because the linker believes we've told it to produce a valid .COM file and the object file that the assembler made just doesn't look right. However, we're not planning on running this .COM file, because the data in it is going into our BASIC program, instead. So, it's no problem at all.

Once the PROJCT02.COM file has been generated, you need to convert it into DATA statements. I've written a short piece of BASIC code to do this for you.

Here's the BASIC source code for the converter program.

That program will generate a series of DATA statements into a file for you. You can then include those DATA statements in your program as you see fit.

Here's my final version final version of the code to test this assembly program.

Quick Links:
 
 
 
    Creation Date:  Mon 29-Mar-1999 15:19:29
    Last Modified:  Sun 09-Apr-2000 21:03:28
    Copyright (C) 1999, 2000 Jonathan Dale Kirwan