George wrote: > > 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! >
Hi George, SMSQ/E does indeed get it wrong. The code simply extends D0.B to a word and carries on. After this extension, it is compared with a max value and if higher, a load/save operation is considered. So op codes $31 to $7F are going to sign extend to exactly the same while those between $80 and $FF will sign extend correctly to a load/save op-code. In my opinion, qa_op in SMSQE should do something like : compare unsigned the byte in D0 with the real op-code (for a maths op) first, then if bigger (ie $31 onwards), skip to the load/save code where it should be immediately OR'd with $FF00 to ensure a negative load/save op-code. In the case where Marcel's nifty arithmetic trick has been done, the negative value already in D0.B would be considered a large positive and remain unchanged by the bit fiddling. Unfortunately, if SMSQE allows £32 as a 'stack Pi' op-code, then we also need to filter out that one (if not already) and the 'store only' op-code which does seem a little superfluous to me :o) Cheers, Norm. (flame proof coat on - just in case !)
_______________________________________________ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm