On 24 Sep 2006, at 12:03, Marcel Kilgus wrote: > George Gwilt wrote: >> Dickens says that codes $31 to $FF are extended to a negative word >> $FF31 to $FFFF when used to determine the storage address. Apart from >> the fact that $31 does not seem to be allowed, Pennel and Dickens are >> saying the same thing in different ways, Pennel is in fact correct. > > Yes, looking at the code, the upper byte is generated or derived from > the lower byte, so it really doesn't matter whether it's $FF31 or $31, > even though thinking of it as $FF31 makes it a) clearer and b) lends > itself to the pointer arithmetic trick I did in my code sample. > > The problem here is that Minerva does OR the value with $FF00, which > seems to be the desired result, while SMSQ/E sign extends the lower > byte, which means that SMSQ/E will behave differently on the values > $31 to $7F. Which could be considered a bug, I guess. > > Also, SMSQ/E defines the opcode $32 (push PI on stack), so the range > effectively starts at $34 there ($33 actually, but that would be a > "store only" location).
Dickens describes the way $32 to $FF are used to define the address as A6+A4+((opcode OR $FF00)AND $FFEE). This is a definition of what the addresses are not a definition of the way they have to be programmed. The last hex amount should of course be $FFFE - the $FFEE is just a misprint. The point about all this is that the opcodes $32 up to $FF should produce the addresses $FF32(A6,A4.L) to $FFFE(A6,A4.L), or -206 (A6,A4.L) to -2(A6,A4.L) by whatever means. If SMSQ/E sets $32 to $0032 instead of $FF32 then it is definitely wrong! George _______________________________________________ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm