Question

I know the naming convention which says if there are n*2 registers or variables which are semantically connected you should name them like following:

REGH REGL

In the case of 2*2 registers it would be:

REGHH REGHL REGLH REGLL

The last two letters stand for high-high, high-low, low-high and low-low. Is there any convention which declares the same thing for 3 registers? Like:

REGH REGM REGL

In this case the last letters stand for high, middle and low. 6 byte would look like this:

REGHH REGHM REGHL REGLH REGLM REGLL

I hope you understand what I mean. Is there any convention for this case?

Was it helpful?

Solution

The Atmel AVR Microcontroller, 1st ed. [P. 173; 6.10.1]

For a register larger than 16 bits, the bytes are numbered from the least significant byte. For example, the 32-bit ADC calibration register is named CAL. The four bytes are named CAL0, CAL1, CAL2, CAL3 (from the least to the most significant byte).

So in a 8-bit system we shouldn't even do:

REGHH REGHL REGLH REGLL

but:

REG3 REG2 REG1 REG0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top