I had a bug that haunted me for quite some time.. me and my stupid premature optimizations. Anyway, typically address register word size operations sign extend and stuff automatically to 32 bits. I tend to use that routinely. So, my code had:
in an attempt to clear A2 but if bits 31-16 contained data they remained and did not get sign extended to all 0 or 1 as I had assumed. Took a while to figure this out from the depths of macro mush and admit being caught pants down
I had to run few more experiments and code like:
Code:
MOVE.L #$00AA0001,A0
MOVE.L #$00110002,A1
SUBA.W A1,A0
Produces #$00A9FFFF and not #$FFFFFFFF as I had expected. What confuses me is that #$00AA0001 in A0 does not seem to get sign extended to #$00000001 but apparently #$00110002 in A1 does get sign extended to #$00000002. What I am not seeing/knowing/understanding here?