Bit operations is what you need.
What you see in your code is masking. You can use a mask and the "and" operator to get the assigned bits within a range. So for the low-order dword, you need a mask with a value which represents all bits for a dword. Which is 2^32, or simply 0xFFFFFFFF.
If you needed the high order dword, you's use the shift operators.
For signed values, you need to take into consideration the highest order bit, it is 1 if it's a negative value.