Page 1 of 1

A programming question

Posted: Fri Jul 19, 2019 6:26 pm
by pjw
Can it safely be assumed that a RAM address can never be "negative" in a SMSQ/E system? Ie,
that so much of the system relies on the assumption that RAM will never exceed 2GB, that any negative
return from some function can be taken to be an error code rather than a valid address..?
Asking for a friend..

Re: A programming question

Posted: Fri Jul 19, 2019 10:02 pm
by janbredenbeek
pjw wrote:Can it safely be assumed that a RAM address can never be "negative" in a SMSQ/E system? Ie,
that so much of the system relies on the assumption that RAM will never exceed 2GB, that any negative
return from some function can be taken to be an error code rather than a valid address..?
Asking for a friend..
On the Q68, the display memory starts at address $FE800000 and the internal I/O at $FF000000. So addresses can be 'negative' on this hardware.

Jan

Re: A programming question

Posted: Fri Jul 19, 2019 10:28 pm
by tofro
Agree that generally, an address can be negative (not only on the Q68, the Q40/Q60 have nearly the same layout).

Some internal routines in SMSQ/E and QDOS, however, like the queue and list support, do assume and rely on the fact that "normal", working memory addresses are always positive.

Tobias

Re: A programming question

Posted: Fri Jul 19, 2019 11:15 pm
by janbredenbeek
tofro wrote:Agree that generally, an address can be negative (not only on the Q68, the Q40/Q60 have nearly the same layout).
Some internal routines in SMSQ/E and QDOS, however, like the queue and list support, do assume and rely on the fact that "normal", working memory addresses are always positive.
This goes for the job and channel table too ($FFxxxxxx indicates an unused entry, else it's a pointer to the job header or channel definition block).
Fortunately, it's very unlikely that these would extend into the Q68's screen memory :) .

Jan

Re: A programming question

Posted: Sat Jul 20, 2019 12:37 am
by pjw
I suspected the possibility regarding hardware addresses. So let me be more specific: A user RAM request will never, ever return a "negative" address, right?

I guess that by the time we see systems sporting 2 gig or more - in about 2029 Jan 19 03:14:08 (or more likely around 2097 Feb 06 06:28:15) - so many other things will have had to change that the issue will be moot anyways..

Re: A programming question

Posted: Mon Jul 29, 2019 12:42 am
by Nasta
It seems RAM is limited by compatibility with one of the superbasic compilers (Qliberator?) which used the top 3 bits of the address references to store data about the reference. These need to be 'don't care' for decoding (which also makes it 'fun' to write cache management code...), so only bits 28 down to 0 are used for addressing, resulting in 512M total RAM. This is of course a limitation on OS managed RAM, not things like frame buffer RAM for video, as this is not used to store programs. Hence, you should be safe and anything managed by the OS should never return a negative pointer to a RAM address.

Re: A programming question

Posted: Sun Aug 04, 2019 10:45 am
by pjw
Nasta wrote:It seems RAM is limited by compatibility with one of the superbasic compilers (Qliberator?) which used the top 3 bits of the address references to store data about the reference. These need to be 'don't care' for decoding (which also makes it 'fun' to write cache management code...), so only bits 28 down to 0 are used for addressing, resulting in 512M total RAM. This is of course a limitation on OS managed RAM, not things like frame buffer RAM for video, as this is not used to store programs. Hence, you should be safe and anything managed by the OS should never return a negative pointer to a RAM address.
Knowledgeable and comprehensive answer as usual :) Thanks!