View Single Post
Old 26 February 2018, 14:06   #14
ross
Sum, ergo Cogito

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 1,367
But the problem lies in the fact that you use the constant NF_SUBSECTOR both as 16 and 32 bit?

Because otherwise no problems arose.
If you define as -$8000 the value is the same both 16 or 32 bit: $FFFF8000 or $8000, sign extended

And if you use
and.w #~NF_SUBSECTOR,d0
or
and.l #~NF_SUBSECTOR,d0
or
and #~NF_SUBSECTOR,d0
result is one:
and.x #$7fff,d
0,
that is the requested operation (logically for .w upper bits are untouched).

So, even if assembler default to 32bit, result is correct.

What's wrong with this?
ross is offline  
 
Page generated in 0.04011 seconds with 11 queries