- Sun Aug 14, 2011 2:53 am
#131788
Hello all,
Some time ago, I decided to shift from 8 bit AVRs to the 32 bit ARM Cortex M3 core MCUs. After struggling with Eclipse etc for a long time, I've now been successfully writing code and programming the LPC1768 with the evaluation version of the Keil MDK.
Anyway, on the 8 bit AVRs, the operations with integers above 8 bits (uint16_t, uint32_t etc) are software emulated with multiple 8 bit operations and are therefore slower. I'm sure it'll be something similar with uint64_t on the 32 bit ARM.
But what about smaller integers, say uint8_t on a 32 bit platform? I was wondering if there're any drawbacks to using uint8_t instead of uint32_t if I only needed 8 bits. Would the hardware store it as 8 bits, access 8 bits, convert to 32 bits, perform operations and convert it back to 8 bits? Or is it capable of operating on it directly?
The answer can likely be found if I understood ASM code, but unfortunately, I still can't! It'll be really great if someone could shed some light on this. Thank you!
Some time ago, I decided to shift from 8 bit AVRs to the 32 bit ARM Cortex M3 core MCUs. After struggling with Eclipse etc for a long time, I've now been successfully writing code and programming the LPC1768 with the evaluation version of the Keil MDK.
Anyway, on the 8 bit AVRs, the operations with integers above 8 bits (uint16_t, uint32_t etc) are software emulated with multiple 8 bit operations and are therefore slower. I'm sure it'll be something similar with uint64_t on the 32 bit ARM.
But what about smaller integers, say uint8_t on a 32 bit platform? I was wondering if there're any drawbacks to using uint8_t instead of uint32_t if I only needed 8 bits. Would the hardware store it as 8 bits, access 8 bits, convert to 32 bits, perform operations and convert it back to 8 bits? Or is it capable of operating on it directly?
The answer can likely be found if I understood ASM code, but unfortunately, I still can't! It'll be really great if someone could shed some light on this. Thank you!