Jakob Engblom claims that if working with a 8 bit processor, one should try to always use 8 bit variables. Using 32 bit will bog down the processor. When using a 32 bit processor, one should try to always use 32 bit variables, because the processor uses 32 bit registers anyways. Using smaller variables will just cause the processor to have to use shift, mask, and sign-extend operations in the code (depending on how the smaller types are represented). He also states that this is not true for structures, arrays, etc. that obviously take up much space in memory.
My question is, is he only talking about local variables? I am not sure if a 32 bit processor only uses 32 bit registers for storing locals or if all of the processor only uses these for any type of memory? I know I am missing the the main point he is getting at from a lack of micro architecture or programming understanding. Any ideas?
My question is, is he only talking about local variables? I am not sure if a 32 bit processor only uses 32 bit registers for storing locals or if all of the processor only uses these for any type of memory? I know I am missing the the main point he is getting at from a lack of micro architecture or programming understanding. Any ideas?