Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here



Hello Newbie here,
To all you Assembly Guru's out there PLEASE HELP!
looking to create a ramsniffer that will detect how much ram any given pc has, why! Well I want to make a bolt on routine to XMSDSK.EXE (RAMDISK Maker)that will find out how much ram you have on your pc, pipe this info into a .txt file, then use a small DOS calc todo 0.75x%variable%, then as a calculated variable %xxxxxxx% place this info into a batch file to auto create a ramdisk that is say 70% of the system ram of a Pc (with a built in safety guard of say no less than 16388-16mb's). This would need to be undertaken in dos7.1 with Himem.sys loaded. E.g. path\XMSDSK.EXE [%Variablesize%] r: /t /C1 /y

I found a routine called biosmem.asm which can be found at http://my.execpc.com/~geezer/osd/boot/biosmem.asm that uses bios calls in 3 stages to identify the ramsize. I then used a program called NASM (DOS)with the folowing code [NASM -f bin -o biosmem.com biosmem.asm] "Without brackets" to compile it into a .com file called biosmem.com. It displays the following text upon running:
memory ranges:
   base=0x0, size=0x9FC00
   base=0x100000, size=0x7EF0000
What I need is this progey to list only the ramsize in in Kb's. I was wondering if someone with Assembly knowledge would be able to adapt the biosmem.asm file to display only the ramsize with no text at all just the size in decimal numbers  NOT Hex as I have no absolutely no idea at all in coding ASM otherwise I would try do it myself.



RE: Ramfind


then use a small DOS calc todo 0.75x%variable%

do you mean a manual calculation? or something within a batch file?

RE: Ramfind

Hi denc4,

Ummm, Yes I would do that once the size=0x7EF0000 could be isolated to whatever the decimal equivelant of 0x7EF0000 is identified to in RAMsize. Then, in theory pipe that to a .txt file, then use the DOS Calc progey, or Am I missing the point here?

However thanks for the reply, are you able to adapt the biosmem.asm to filter out the unneeded info just leaving the RAM figure in Decimal not HEX. It just seems simpler that way but I may be unerestimating the task of the ASM alterations, can you advise please? Please note the link in original message to Biosmem.asm.



RE: Ramfind

what kind of DOS Calc program are you talking about?
DOS doesn't have a calculator program that reads its input from a text file..

why don't you run the biosmem program and then convert
it's output manually.

if you are confined to DOS, use

to convert hex to decimal.
otherwise just use the Windows Calculator to convert.

hope this helps.

RE: Ramfind

Yes I could do that but the whole idea as I see it is to be able to undertake this task automatically within the batch file. So it looks like the biosmem.asm/biosmem.com program program would need to be adapted to detect the total value of the ram in decimal format, do the math conversion, then be able to input that info into a variable to then insert that into the batch code to load the ramdisk.

Ummm sounds very complicated looks as if it cannot be done, also Himem.sys & Emm386.exe would need to be loaded to make the said ram  XMS area available for dos to.

Thanks for the link to the numconv.zip program Kewl


RE: Ramfind

you don't need EMM386.EXE to access extended memory,
just load HIMEM.SYS and XMSDSK.EXE can do its job.

RE: Ramfind

Yes U R right however I have found a dos util that fullfills part of the jigsaw. it is called Ramfree & issues forth 1 line of text namely: ram bytes available: xxxxxxx.
If I could export this with Ramfree|find etc may be able to export to text file.

Thanks for the advise though denc4

best wishes


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close