I need to get the last byte (bits 24:31 inclusive) from an unsigned int variable into a char variable. I have a variable to store all 32 bits from ecx. According to AMD; the value I want (L1 cache size) is stored in bits 24:31.
How can I put these into another variable? I don't want the rest of the information (TLB stuff) :(
For which endianness?
If you want to do tricky stuff with bytes maintaining the endianness of the computer you are working on, you can make a char pointer pointing to the integer.
If you want to preserve a mathematical meaning, you should use bitwise operations ( >> & )