Converting a specific range of binary bits in a char array that contains 4 byte binary instruction
A relatively trivial question today Suppose I have a the following code: int extract_bits_21_to_25(unsigned char* instruction) { int instruction_to_int = *(int*)instruction; int bits_21_to_25 = (instruction_to_int >> 20) & 0x1F; return bits_21_to_25; } unsigned char* reverse(unsigned char* instruction){ int length = strlen(instruction); for (int i = 0; i < length / 2; i++) { char temp… Read More Converting a specific range of binary bits in a char array that contains 4 byte binary instruction