Page 1 of 1

Command for total amount of RAM installed?

Posted: Mon Feb 06, 2012 9:46 am
by olliraa
This is pretty noobish to ask, but how do I get the amount of RAM installed from the Basic?

Re: Command for total amount of RAM installed?

Posted: Mon Feb 06, 2012 10:28 am
by dex
FREE_MEM function is a part of Toolkit II (or Thor XVI formware, or almost any Toolkit II equipped QFLP floppy ROM).

Sample of usage:
PRINT FREE_MEM

The total RAM amount is displayed on start-up by Minerva ROM.

Re: Command for total amount of RAM installed?

Posted: Mon Feb 06, 2012 11:03 am
by tofro
Hi,
While FREE_MEM is fine for getting the amount of RAM that's free (hence the name...) at the moment, it doesn't give you the amount of RAM that's installed.
Finding out the overall amount of memory installed is not easily achieved on all QDOSMSQ platforms - While you can peek SV_RAMT giving you the end of RAM, the beginning is not that easy to find - Your best bet could be to assume that RAM starts with the System variables (although on the original box, it's the screen memory - But that could be anywhere on other hardware incarnations).

On the original Box (plus suitable toolkit), the total amount of installed RAM can be found by

PRINT SYS_VARS($20) - (HEX("20000"))
(i.e. RAMTOP - Start of Screen)

This should cover most of the commercially available RAM extensions (internal, QBoard, TrumpCard, even Gold and Super Gold cards) to the original box. Any extension that happens to locate RAM in the lower I/O space would not be covered, however.

The QL memory map can be found here: http://qdosmsq.dunbar-it.co.uk/doku.php ... memory:map
(That's Norman Dunbar's QL Wiki with loads of more excellent information)

Cheers,
Tobias

Re: Command for total amount of RAM installed?

Posted: Mon Feb 06, 2012 11:37 am
by RWAP
On a standard QL,

Code: Select all

PRINT (PEEK_L(163856)-PEEK_L(163852)-1024)/1024
gives the amount of free memory in Kilobyes

Code: Select all

PRINT (PEEK_L(163872)/1024 - 128)
gives the total amount of memory available.

Re: Command for total amount of RAM installed?

Posted: Mon Feb 06, 2012 11:59 am
by olliraa
Thanks guys :D You were fast, as always! Off to test my QL...