Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
How does 9k exceed 64k of external RAM if I use "Option ExtRamConfig On"? It seems perhaps there is a separate RAM required for stack use, etc. that must be internal to the device.
pjc30943 wrote:How does 9k exceed 64k of external RAM if I use "Option ExtRamConfig On"?
Lacking any advice to the contrary, the compiler assumes that a ZX-1280 has 8K of RAM available. The presence of Option ExtRamConfig On is not sufficient information since you might have 2K of external RAM or the full complement. The compiler has no way of knowing how much external RAM you might have.
The way to resolve this problem is to tell the compiler how much RAM you have using Option RamSize. A full complement of external RAM is expressed using the idiom shown below. Register.RamStart gives the starting address of internal RAM; subtracting that value from 64K yields the number of bytes of RAM available with an external RAM chip of 64K or more attached.
I thought that what you suggested wouldn't work because of the example Mike posted in the post asking about large arrays:
"In trying out code to respond to this question, I have found two potential problems for Don to resolve:
The following does not compile. The native mode Ramstart appears to be the same value as the ZVM when it fact it should be smaller.Code: