I have a 64 bit number comprised of various bit fields and I'm writing a simple python utility to parse the number. The problem I'm facing is that the lower 32 bits comprise of one field and using some combination of bit shifts or bit masking doesn't give just the 32 bits.
big_num = 0xFFFFFFFFFFFFFFFF
some_field = (big_num & 0x00FFFF0000000000) # works as expected
field_i_need = big_num & 0x00000000FFFFFFFF # doesn't work
What happens is that field_i_need
is equal to big_num
, not the lower 32 bits.
Am I missing something simple here?
Thanks!
Matthew