|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
I'm trying to use the register keyword to declare variables I want to be stored in registers. However, the C51 C compiler seems to ignore this.
This is by design. The 8051 only has 8 general purpose of registers. Each of them is a single byte register. So, declaring 2 unsigned long register variables would consume all of the available registers if this feature were supported.
There is no way to declare register variables with the C51 Compiler. If you must use registers, you should consider writing an assembly routine for the function that requires register variables.
Article last edited on: 2001-01-23 00:00:00
Did you find this article helpful? Yes No
How can we improve this article?