Dec 072017
MSC 5.1 functions to search/view RAM.
File INMEM.ZIP from The Programmer’s Corner in
Category C Source Code
MSC 5.1 functions to search/view RAM.
File Name File Size Zip Size Zip Type
DMAP.EXE 38794 18071 deflated
INMEM.C 4064 1213 deflated
INMEM.COM 7026 4568 deflated
INMEM.MAK 151 122 deflated
INMEM.TXT 3165 1473 deflated
INMEMT.BAT 258 148 deflated

Download File INMEM.ZIP Here

Contents of the INMEM.TXT file

INMEMA memory block search routine

Date:March 1989

Author:Dennis Ihde
11114 Brownstone Dr
Parker, Co. 80134

(303) 841-0460

The INMEM program was written to help BAT files chose the correct
instructions to execute when that decision is dependant on whether a
memory resident program is resident or not. For example, a bat file
to run an application that requires BTRIEVE to be memory resident
might be coded as follows:

inmem B
if errorlevel 1 goto loadbtrieve the application...
goto end

...load btrieve into memory... the application... unload btrieve...


This bat file would load btrieve into memory if its not already
there, run the application, and unload btrieve when the application
programs are done. However, if btrieve is already in memory the bat
file will run the application programs and then exit, leaving btrieve
alone since it was already there.

You can include the resident() function from the inmem program into
your own "C" program. If you need to read your SideKick appointment
file, you can get the directory that SideKick was loaded from by
calling resident(); Resident() returns a far pointer to the fully
qualified path if the resident program was found. If it was not
found a 0 is returned. The drive:path\pgm loaded from string can be
moved into your own string to be parsed with fnsplit() to get the
location of the appointment file. You will get a NULL terminated
asciiz string, so no length calculations or end of data searches will
have to be performed in order to do string functions on it.

I also use the resident() function in programs that are spawn'd from
a root program and cannot run without the root program. In the
initialization portion of the "spawn'd" program I call resident()
with the name of the root program. If a "false" is returned, I
display a message that says "You cannot run this program without
??.exe. Please run ??.exe instead".

Since this kind of stuff is a hobby for me, there are obviously no
warranties of any kind, shape, or form. I will, however, be open to
suggestions on how to improve this code or try to help solve any
problems that you may have with it. I have found it quite useful for
many different applications. Have fun with it.

Note:I have also included a copy of my DMAP program. This is a
memory mapper like many others, except that it shows far more detail
than most. You can inspect individual memory blocks, print reports,
etc. I have not included source code for it because it was written
using Vitamin C screen utilities. If anyone is interested in the
source code, let me know and I will be glad to provide it (except for
the Vitamin C libraries). To use it simply run it. The arrow keys
and PgUp, PgDn keys will scroll the display window. Hit the "I" key
to inspect individual memory blocks. Again the PgUp and PgDn keys
will page through the memory blocks while in "inspect" mode. The "P"
key will print the current report. Home and End will always take you
to the first or last allocated memory block.

 December 7, 2017  Add comments

Leave a Reply