|
Post by VDC 8x2 on May 15, 2016 19:36:42 GMT
How would you do a pointer in a banked system like the 128?
.a could be the bank. 128 and higher would refer to external mem. less than 128 could refer to internal ram. .x would be low byte .y would be high byte
I don't think that would work. I am just throwing ideas at the wall to see what sticks.
|
|
|
Post by gsteemso on May 20, 2016 4:33:24 GMT
As posed, this question is difficult to answer. What assumptions are you making about the hardware environment? Your mention of reserving values under 128 (i.e., a 7-bit-wide value) to indicate internal memory is… a bit unexpected, shall we say. The original Commodore 128 concept allowed for up to 16, 64KiB banks of native RAM (totalling 1 MiB of capacity and needing 4 bits to encode), of which two banks are physically present and four are allowed for in the we'll-fill-the-rest-in-later firmware that was cobbled together to get it out the door on time. The 16 pre-defined RAM-plus-extras configurations that BASIC 7 calls "banks" would, if extended to account for the other 12 banks of physical RAM, presumably number somewhere around 64, which would eat six bits to encode. So far so good.
This whole scheme was obsoleted mid-development by the invention of the REU, which could (if its design were fully realized) hold up to 256, 64KiB banks. That value needs a full byte to encode, so referencing both maxed-out internal RAM and maxed-out REU RAM cannot be done in a single octet.
Making matters even more annoying, there are numerous other flavours of RAM in "common" use (insofar as the term can be said to apply to a platform with a residual userbase of at most a few thousand or so worldwide), such as RAMLink and GeoRAM. All of these matters were very elegantly dealt with in the 1990s by a fellow named Craig Bruce, whose text-mode ACE operating system which makes use of the method he devised is still available from his website. (I think the current version has been release 16 for roughly 20 years.) In short, he uses a 4-byte pointer model: one byte each for the type of RAM, bank number, page number within that bank, and byte number within that page. The details are freely available in a clearly linked-to file on his page.
As an aside, I observed a few years ago that the 4-byte universal pointer model can be extended by adding a fifth byte to indicate which of the CPUs available locally on the Commodore Serial Bus (or IEEE-488 bus, if present) is in charge of the memory pointed to by the other four bytes. Obviously, this extension would only be useful in a custom-programmed CSB-based cluster computer… That said, you can make one of those using only a single Commodore computer plus whatever programmable disk drives you have plugged into it. More than one person has written degree theses concerning exactly that type of bargain-basement multiprocessor system.
|
|