Hi guys) Please tell me - why is it impossible to keep global variables in C in a processor register?
thanks in advance)
The reason is that there are only a limited finite number of resigers available to the program. For example on Intel and compatible processors there are only 6 register variables in common use throught the program (eax,ebx,ecx,edx,esi and edi), so it would be impossible to store global variables in them. Read More
A value is a value, and any appropriate value can be place in a register, but if the global variable's value changes and something reliant on it is only being given the value from the register; then the value in the global is no longer the same as the one … Read More
In C and C++ there is a [b]register[/b] keyword, but most (if not all) compoilers just ignore it for reasons previously stated. And even then [b]register[/b] can not be used with global variables. Read More
Edited by Ancient Dragon: n/a
Edited by MosaicFuneral: n/a
Edited by vedro-compota: n/a