我知道命名约定,如果有 n*2 个语义连接的寄存器或变量,你应该像下面这样命名它们:
REGH REGL
在 2*2 寄存器的情况下,它将是:
REGHH REGHL REGLH REGLL
最后两个字母代表高-高、高-低、低-高和低-低。是否有任何约定为 3 个寄存器声明相同的内容?喜欢:
REGH REGM REGL
在这种情况下,最后一个字母代表高、中和低。 6 字节看起来像这样:
REGHH REGHM REGHL REGLH REGLM REGLL
希望你明白我的意思。这种情况有什么约定吗?
最佳答案
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).
所以在 8 位系统中我们甚至不应该这样做:
REGHH REGHL REGLH REGLL
但是:
REG3 REG2 REG1 REG0
关于c - 是否有语义连接的 n*3 个寄存器的命名约定?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20448671/