I have an array in memory that holds certain hex values that describe assembly instructions. For example:
708877665544332211 = jump 0x1122334455667788
70
indicates a jump in assembly and the following hex numbers are what I need to concatenate. I've already tried doing,
address |= memory[1];
address |= memory[2]<<8;
address |= memory[3]<<16;
address |= memory[4]<<24;
address |= memory[5]<<32;
address |= memory[6]<<40;
address |= memory[7]<<48;
address |= memory[8]<<56;
The string that was outputted was:
0x100: 708877665544332211 | jump 1432778700
Where am I going wrong in the concatenation?
EDIT: Following Benjamin's suggestion, I changed it to:
With print statement printf("APPEND: %016llx", address)
to debug, I found that the uint64_t
was being changed as:
APPEND: 0000000000002211
APPEND: 0000000000332211
APPEND: 0000000044332211
APPEND: 0000000044332255
APPEND: 0000000044336655
APPEND: 0000000044776655
If the address is a 64bit integer, why does it appear to be behaving as a 32bit integer?