Variables in Registers

With MPLAB XC8, there is no direct control of placement of variables in registers. The register keyword (which can only be used with auto variables) is silently ignored and has no effect on the allocation of variables.

Some arguments are passed to functions in the W register rather than in a memory location; however, these values will typically be stored back to memory by code inside the function so that W can be used by code associated with that function. See Function Parameters for more information as to which parameter variables can use registers.