Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!nbires!mmm
From: mmm@nbires.UUCP (Michelle Melvin)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Memory Res. Prgs.
Message-ID: <964@nbires.UUCP>
Date: Wed, 14-Jan-87 16:03:31 EST
Article-I.D.: nbires.964
Posted: Wed Jan 14 16:03:31 1987
Date-Received: Thu, 15-Jan-87 04:09:29 EST
References: <1541@isis.UUCP>
Reply-To: mmm@nbires.UUCP (Michelle Melvin)
Distribution: world
Organization: NBI Inc, Boulder CO
Lines: 18

in order to check to see if you are already loaded insert a string in
your program that is likely to be unique like 'RES_PROG'.  In the byte
imediately following the string stick a status flag.  Set the flag
once you are running.  This way, when you start up you can search
all of memory for the string with the correctly set flag.  If you
find the string and the flag is set you are already loaded.

the reason you need the flag is that there may be a partial copy of 
your program in one of DOS's disk buffers.  You don't want to identify
that as a copy of your program.

hope this helps.

lloyd w. tabb
nbi engineering
3450 mitchell lane
boulder, colorado  80301
{hao|ucbval|allegra}!nbires!mmm