This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:cs:chapter_3_10 [2025/01/08 08:17] – [Program flow destination addressing] ktokarz | en:multiasm:cs:chapter_3_10 [2025/01/09 08:19] (current) – [Program control flow destination addressing] ktokarz | ||
|---|---|---|---|
| Line 82: | Line 82: | ||
| jump destin | jump destin | ||
| </ | </ | ||
| + | |||
| + | <figure jumpdirect> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| **Indirect addressing** of the destination uses the content of the register as the address where the program will jump. In the following example, the processor will jump to the destination address which is stored in //R0//: | **Indirect addressing** of the destination uses the content of the register as the address where the program will jump. In the following example, the processor will jump to the destination address which is stored in //R0//: | ||
| Line 87: | Line 92: | ||
| jump [R0] | jump [R0] | ||
| </ | </ | ||
| + | |||
| + | <figure jumpindirect> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| ===== Absolute and Relative addressing ===== | ===== Absolute and Relative addressing ===== | ||
| - | In all previous examples, the addresses were specified as the values which represent the **absolute** memory location. The resulting address (even calculated as the sum of some values) was the memory location counted from the beginning of the memory - address " | + | In all previous examples, the addresses were specified as the values which represent the **absolute** memory location. The resulting address (even calculated as the sum of some values) was the memory location counted from the beginning of the memory - address " |
| + | |||
| + | <figure addrabsolute> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| Absolute addressing is simple and doesn' | Absolute addressing is simple and doesn' | ||
| - | Absolute addressing is very hard to use in general-purpose operating systems like Linux or Windows where the user can start a variety of different programs, and their placement in the memory differs every time they' | + | Absolute addressing is very hard to use in general-purpose operating systems like Linux or Windows where the user can start a variety of different programs, and their placement in the memory differs every time they' |
| + | |||
| + | <figure addrrelative> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| Relative addressing is also implemented in many jump, branch or loop instructions. | Relative addressing is also implemented in many jump, branch or loop instructions. | ||