This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:piot:chapter_4_5 [2026/03/01 19:39] – [Extended Indirect Program Memory Addressing] ktokarz | en:multiasm:piot:chapter_4_5 [2026/04/01 14:21] (current) – ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Addressing Modes ====== | ====== Addressing Modes ====== | ||
| - | Addressing modes define how the processor accesses data. There are 15 different addressing modes, such as: Direct Addressing, Indirect Addressing, Indirect with Displacement, | + | Addressing modes define how the processor accesses data and the target address of a jump. There are more than a dozen different addressing modes, such as: Direct Addressing, Indirect Addressing, Indirect with Displacement, |
| - | + | ||
| - | Details on addressing | + | |
| =====Direct Single Register Addressing===== | =====Direct Single Register Addressing===== | ||
| Line 57: | Line 55: | ||
| =====Data Indirect Addressing===== | =====Data Indirect Addressing===== | ||
| - | Indirect addressing uses the content of an index register as a pointer to memory. As shown in Fig {{ref> | + | Indirect addressing uses the content of an index register as a pointer to memory. As shown in Fig {{ref> |
| An example of the instruction is load data from memory addressed with an X pointer. | An example of the instruction is load data from memory addressed with an X pointer. | ||
| <code asm> | <code asm> | ||
| Line 106: | Line 104: | ||
| =====Program Memory Constant Addressing===== | =====Program Memory Constant Addressing===== | ||
| - | With this addressing mode, it is possible to read the byte from the program memory. As shown in Fig {{ref> | + | With this addressing mode, it is possible to read the byte from the program memory. As shown in Fig {{ref> |
| The upper 15 bits (Most Significant bits - MSbs) select the word address (each word contains 2 bytes). | The upper 15 bits (Most Significant bits - MSbs) select the word address (each word contains 2 bytes). | ||
| Line 136: | Line 134: | ||
| =====Program Memory Addressing with Post-increment===== | =====Program Memory Addressing with Post-increment===== | ||
| - | <todo @pczekalski> | ||
| Program memory can be addressed with post-increment mode. In this mode, the Z pointer is automatically incremented after reading. | Program memory can be addressed with post-increment mode. In this mode, the Z pointer is automatically incremented after reading. | ||
| As shown in Fing {{ref> | As shown in Fing {{ref> | ||
| Line 155: | Line 152: | ||
| As visible in Fig {{ref> | As visible in Fig {{ref> | ||
| - | <todo @mfojcik> | ||
| <figure avr_addr_11> | <figure avr_addr_11> | ||
| {{ : | {{ : | ||
| Line 173: | Line 169: | ||
| </ | </ | ||
| - | <todo @mfojcik> | + | |
| =====Indirect Program Memory Addressing===== | =====Indirect Program Memory Addressing===== | ||