This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:piot:chapter_4_3 [2025/05/31 09:20] – marcin | en:multiasm:piot:chapter_4_3 [2026/01/19 15:08] (current) – marcin | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| **R0-R15: | **R0-R15: | ||
| - | Basic general-purpose registers used for various arithmetic and logical operations. | + | Basic general-purpose registers |
| **R16-R31: | **R16-R31: | ||
| General-purpose registers that can be used with immediate | General-purpose registers that can be used with immediate | ||
| - | + | ||
| - | {{:en: | + | Comparison Table: AVR Registers R0–R15 vs. R16–R31 |
| + | |||
| + | ^ Feature | ||
| + | | Instruction compatibility | ||
| + | | Opcode encoding | ||
| + | | Typical compiler usage | Less preferred; used for temporary or special roles | ||
| + | | Special-purpose roles | ||
| + | | Pointer support | ||
| + | | Efficiency | ||
| + | | Multiplication involvement | ||
| + | | Suitability in ASM | Limited; avoid with immediates; R0/R1 have special rules | Recommended for general ALU operations | ||
| + | | GCC policy | ||
| + | |||
| + | <figure avr_registers> | ||
| + | {{en: | ||
| + | < | ||
| + | </ | ||
| **The X-register, Y-register, and Z-register: | **The X-register, Y-register, and Z-register: | ||
| address pointers for indirect addressing | address pointers for indirect addressing | ||
| - | R26-R31: These registers | + | R26-R31: These registers |
| + | <figure avr_registers> | ||
| + | {{en: | ||
| + | < | ||
| + | </ | ||
| **Other registers: | **Other registers: | ||
| Line 25: | Line 45: | ||
| EIND: Register concatenated with the Z-register, enabling indirect jump and call to the entire program space on MCUs with more than 64K words (128 KB) of program space. | EIND: Register concatenated with the Z-register, enabling indirect jump and call to the entire program space on MCUs with more than 64K words (128 KB) of program space. | ||
| + | |||
| + | <table Register properties> | ||
| + | < | ||
| + | ^ Register | ||
| + | | RAMPX | ||
| + | | RAMPY | ||
| + | | RAMPZ | ||
| + | | RAMPD | ||
| + | | EIND | Extends program addressing | ||
| + | </ | ||
| + | |||
| + | All of the registers RAMPX, RAMPY, RAMPZ, RAMPD, and EIND are located in the extended I/O space of AVR microcontrollers. This area typically occupies addresses 0x3B–0x3F, | ||
| + | |||
| + | |||