Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
128K SPECTRUM COMPATIBILITY...
#12
Start here:

<!-- m --><a class="postlink" href="http://www.worldofspectrum.org/faq/reference/128kreference.htm">http://www.worldofspectrum.org/faq/refe ... erence.htm</a><!-- m -->

At the very least it shows how memory works.

Right now, if you use the compiler cleverly, you could probably manually bank switch and use the extended memory yourself.

It would be nice if eventually the compiler did all that for you though - calling a function would work out what bank it was in, swap if necessary, and go there!

There are lots of considerations though. Just one example: We can only swap the top 16K of memory. So if code is running at an address higher than 49152 then anything it needs can't be in another bank of memory or we'll lose the code trying to access it. So you can't have code and data in separate banks if the code needs the data.

It's probably not a huge problem, and might be fixed by putting in some explicit compiler directives to say where code has to be.

For example:

BANK 2
<code for this 16K of memory>
END BANK 2

BANK 4
<code and data for this bank>
END BANK 4

And so on. If the code or memory requirements of any specified BANK -> END BANK are greater than 16384 bytes, then the compiler should throw a fit and stop compiling.

Of course then there's memory contention to think about. On the +3 it basically any bank that isn't the standard is contended (Just 0 and 2 are not).

However, on any 128K machine, we do get memory from about 24,000 to 49152 available that isn't going to be switched out. That's a bigger chunk. Though everything below 32768 is contended memory, so a little slower. But, if we don't want to bank switch at all, we can still use somewhere from about 24,000 to 65535 comfortably anyway - just like 48K mode!

Note: If we do it using marked bank memory, we'll need to load it in in chunks from "Tape" so as to be able to put things in other banks of memory.

Oh yeah, this is going to get complicated. Perhaps get everything stable in 48K mode first? Smile
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)