<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 07 Sep 2002 01:34:42 +0100
From   : "Richard Gellman" <ricky@...>
Subject: Re: Regaining disc drive memory work space

You write your program thus:

10 IF PAGE<>&E00 GOTO 9000
...
your program
...
9000 FOR I%=0 TO TOP-PAGE STEP
4:!(I%+&E00)=!(i%+PAGE):NEXT:PAGE=&E00:OLD:RUN

Notes:
The relocation line (9000) need not ALL be on one line, but PAGE=&E00, OLD,
and RUN MUST be on the same line, else the system will crash. If the
relocated program overlaps the unrelocated program then the whole relocation
line (line 9000) must be on one line. BASIC translates the whole ine before
execution, so once its read in, it doesn't matter if it gets overwritten,
and the system is reset to point to the relocated program.

OLD is needed to ensure BASIC is aware of the new program in memory.

If the difference between the old and new locations of the program is less
than 4 bytes (which should be impossible because PAGE can only be set to
page boundaries, i.e. a multiple of 256 bytes) then the whole relocation
line needs to be on one line.

In later versions of BASIC, the middle of the FOR loop can be replaced with
I%!&E00=I%!PAGE for simplicity.

:)

-- RIchard
  -----Original Message-----
  From: owner-bbc-micro@... [mailto:owner-bbc-micro@...]On
Behalf Of james watson
  Sent: Friday, September 06, 2002 8:29 PM
  To: bbc-micro@...
  Subject: [BBC-Micro] Regaining disc drive memory work space


  When using a disc drive on a BBC micro, Page is moved from &E00 to &1900
to create memory work space for the disc drive. Is possible  to regain the
disc drive work space once the program has loaded. I.e resetting page back
to &E00. Can anybody give an example of various techniques on how to achieve
this.



<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>