Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:multiasm:cs:chapter_3_10 [2026/03/01 14:13] – [Program control flow destination addressing] ktokarzen:multiasm:cs:chapter_3_10 [2026/05/27 09:24] (current) – [Absolute and Relative addressing] ktokarz
Line 88: Line 88:
 </figure> </figure>
  
-**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, as shown in Fig {{ref>jumpindirect}} 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//:
 <code> <code>
  jump [R0]  jump [R0]
Line 108: Line 108:
  
 Absolute addressing is simple and doesn't require any additional calculations by the processor. It is often used in embedded systems, where the software is installed and configured by the designer, and the location of programs does not change. Absolute addressing is simple and doesn't require any additional calculations by the processor. It is often used in embedded systems, where the software is installed and configured by the designer, and the location of programs does not change.
-Absolute addressing is difficult to use in general-purpose operating systems like Linux or Windows, where users can start a variety of programs, and their placement in memory varies each time they're loaded and executed. Much more useful is the **relative addressing**, where operands are specified as differences from a memory location and some known value, which can be easily modified and accessed. Often, the operands are provided relative to the Instruction Pointer, which allows the program to be loaded at any address in the address space, but the distance between the currently executed instruction and the location of the data it wants to reach is always the same. This is the default addressing mode in the Windows operating system, working on x64 machines. It is illustrated in Fig{{ref>addrrelative}}.+Absolute addressing is difficult to use in general-purpose operating systems like Linux-based or Windows, where users can start a variety of programs, and their placement in memory varies each time they're loaded and executed. Much more useful is the **relative addressing**, where operands are specified as differences from a memory location and some known value, which can be easily modified and accessed. Often, the operands are provided relative to the Instruction Pointer, which allows the program to be loaded at any address in the address space, but the distance between the currently executed instruction and the location of the data it wants to reach is always the same. This is the default addressing mode in the Windows operating system, working on x64 machines. It is illustrated in Fig {{ref>addrrelative}}.
  
 <figure addrrelative> <figure addrrelative>
en/multiasm/cs/chapter_3_10.1772367200.txt.gz · Last modified: by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0