On 1 Oct 2012, at 17:39, Dilwyn Jones wrote:
>> The trouble seems to be that although the manual says that "if D2 is a
>> negative long word"
>> the paper and oink will not be set, the actual code tests D2.B and not D2.L.
> Brilliant typo ("oink") !
Actually, I have discovered that the PE code is correct in this respect. It is
the top byte of D2.L which is tested not D2.B. The real reason for the
non-setting lies in the definition of the "selected" code. This is defined as
$80 + $FFFFFF00. (Why not $FFFFFF80?) If you use either
MOVEQ #WSI.SLCT,D2 or
MOVE.L #WSI.SLCT,D2
The top bit of D2.L will be 1 and so paper and ink will not be set.
If you don't positively arrange for D2.L to be non-negative, the result of
WM.SWLIT will be undefined.
Thus, you could write
MOVEQ #0,D2 to clear D2.L
MOVE.W #WSI.SLCT,D2
Better not to use WSI.SLCT and write
MOVE.L #$80,D2
which is a pity, since who can remember what $80 means?
Oink ... Oink
George
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm