<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 19 Mar 2009 22:43:23 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: RISC OS Memory Allocation Question

"Mark Haysman" wrote:
> *WIMPSLOT -NEXT 2000K
> *WIMPTASK BASIC
> will run Basic, with 2MB available (on a 4 meg machine). It starts in a
> window, but you can then just MODE xx out of it.
 
That's the standard way of doing it. Allocating a task a set amount
of memory only makes sense in an environment where multiple tasks
may be present, ie the Wimp.
 
If you boot up into the supervisor prompt, or straight into BASIC,
then the executing task gets all available memory. Try:
 
  Ctrl-Keypad-*-Reset
  *BASIC
 
On a 4M machine you should get a message similar to:
  ARM BBC BASIC V
  Starting with 3984000 bytes free
 
> For instance, if I am in Supervisor mode and I want to start BASIC with
> only half of the available RAM (e.g. 2MB on a 4MB machine) would there
 
Use the following bit of code to call SWI OS_ChangeEnvironment to
set the memory limit:
 
REM > SlotSize
SYS "OS_GetEnv" TO A$
A$=MID$(A$,1+INSTR(A$," ",1+INSTR(A$," ",1+INSTR(A$," "))))
IF VALA$=0:ERROR 220,"Syntax: SlotSize <size>K"
SYS "OS_ChangeEnvironment",0,VALA$*1024+32768
QUIT
 
Example:
  *SlotSize 32K
  *BASIC
  ARM BBC BASIC IV
  Starting with 28924 bytes free
  >PRINT ~HIMEM
      10000
  >
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
The most perfect world is an imperfect world as the imperfections
give people a reason to strive to change it.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>