<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 09 Sep 2002 10:10:36 +0100 
From   : owner-bbc-micro@...
Subject: Regaining disc drive memory work space




-----Original Message-----
From: Christopher Dewhurst Clerical Assistant SS 
Sent: 09 September 2002 09:44
To: 'james watson'
Subject: RE: [BBC-Micro] Regaining disc drive memory work space


Hi Folks

This can also be done faster in machine code (doing this from memory, let me
know if I've missed summat):

FOR N%=0 TO 2 STEP 2
P%=&900
[OPT N%
\ Set up pointers
\ &70/71 = &1900 (source address)
\ &72/73 = &E00 (destination address) 
LDY #0:STY &70:STY &72
LDA #&19:STA &71
LDA #&0E:STA &73

LDX #&20  \number of pages to be moved e.g. &20 for program length &2000
.loop LDA (&70),Y
STA (&72),Y
INY:BNE loop
INC &71:INC &73
DEX:BNE loop
RTS
]NEXT

Include the above lines in a loader program; it could be assembled in a
procedure, for example. You would still have to do something like CALL &900
:PAGE=&E00:RUN in Basic - it *could* be done in machine code but not very
easily - or else subsitute RTS for CALL &xxxx where xxxx is the original
execution address of the machine code. Note that it downloads round pages of
code, not a problem so long as you set the X register to the next nearest
number of pages, e.g. &11 for a program that is &1021 bytes long.

Regards
Christopher.

-----Original Message-----
From: james watson [mailto:james@...]
Sent: 06 September 2002 20:29
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.

This email (including any attachments) is intended only for the recipient(s)
named above.  It may contain confidential or privileged information and
should not be read, copied or otherwise used by any other person unless
express permission is given.  If you are not a named recipient, please
contact the sender and delete the email from your system. It is the
recipient's responsibility to ensure that appropriate measures are in place
to check for software viruses. 

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