<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 27 Nov 2006 17:46:10 -0000 (GMT)
From   : splodge@... (Richard Gellman)
Subject: More sideways RAM questions

Hi,

> I once wrote a small program to this (before I got the Master). I am not
> sure where it is, but will look it out if I can and make it available.
>
> The Master, of course, has the command *SRLOAD, but this is actually quite
> a
> lot slower than the straight *LOAD into main memory.

Ah, you forget the mighty Q!

SRLOAD on the Master has two ways of loading in RAM; the default "safe"
method, of using sequential file access (internally using OSBGET/OSGBPB)
to read data into its private buffers, and thence into sideways RAM by
using a small segment of code running outside of sideways memory. This
tends to take a while, around 8 - 10 seconds.

If the last parameter of the SRLOAD command is Q (for "quick") the data is
*LOADed into main memory (presumably at OSHWM?) and then SRWRITEn to
sideways RAM (again presumably using a code segment outside sideways
memory). This takes around 1.5 - 2 seconds.

The downside to this method is that it corrupts anything in main memory by
overwriting it with ROM image, including your BASIC programs, hence it
must be used explicitly.

The extra-ROM code is needed as the filing system (the DFS ROM contains
the SR commands) can't be switched in at the same time as the destination
RAM bank. Though I'm not sure if this is code that the DFS ROM relocates
to a temporary RAM block, or if it calls code in the MOS ROM.

You can probably implement something similiar on a Q-less system by using
OSFILE to load into main RAM (suggest MODE 7 readily to hand...) then
disable interrupts, take a note of ROMSEL at &F4, reprogram ROMSEL to the
RAM bank, copy 16K of data in, reprogram ROMSEL back to the original ROM,
then re-enable interrupts and RTS.

The Master Compact SR commands allow for a ROM image to not only be
loaded, but "initialised" once done. By adding "I" to "Q" SRLOAD will do
the necessary MOS init to make the ROM available without using CTRL+BREAK.
I believe is done by changing a byte in the MOS workspace, but I can't
remember which off hand.

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