View Single Post
Old 25 September 2015, 13:41   #139
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
A few more tricks...
For rare cases but useful maybe ?


Clear the lowest bit that is =1 (e.g. $1234 becomes $1230, $1000 becomes 0, etc) :
Code:
 move.w d0,d1
 subq.w #1,d1
 and.w d1,d0

To know if the n leftmost bits of the reg are identical :
Code:
 asl.b #n-1,d0		; note : asl, not lsl !
 bvc yes		; we get there if all bits were the same
meynaf is offline  
 
Page generated in 0.07687 seconds with 10 queries