Command for total amount of RAM installed?

Helpful tips and guides, also new users can ask for help here.
Post Reply
olliraa
ROM Dongle
Posts: 13
Joined: Fri Feb 03, 2012 6:48 pm

Command for total amount of RAM installed?

Post by olliraa »

This is pretty noobish to ask, but how do I get the amount of RAM installed from the Basic?


User avatar
dex
Gold Card
Posts: 286
Joined: Thu Dec 23, 2010 1:40 pm

Re: Command for total amount of RAM installed?

Post 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.


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Command for total amount of RAM installed?

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Command for total amount of RAM installed?

Post 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.


olliraa
ROM Dongle
Posts: 13
Joined: Fri Feb 03, 2012 6:48 pm

Re: Command for total amount of RAM installed?

Post by olliraa »

Thanks guys :D You were fast, as always! Off to test my QL...


Post Reply