EASy68K  
It is currently Mon Sep 23, 2019 12:03 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Feb 22, 2012 6:18 pm 
Offline

Joined: Wed Feb 22, 2012 2:17 am
Posts: 8
Location: toronto
what are some nice ways to manipulate numbers with bit masking and bit manipulations?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 7:23 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1102
Each shift left multiplies by 2
Each shift right divides by 2

AND with mask to force bits to 0
OR with mask to force bits to 1
Exclusive OR with mask to force bits to change.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 23, 2012 4:50 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
BCHG - Test a Bit and Change
BCLR - Test a Bit and Clear
BSET - Test a Bit and Set

And of course the rich set of shift or rotate


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group