Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
en:multiasm:paarm:chapter_5_5 [2026/02/27 16:17] – [Other addressing modes] jtokarzen:multiasm:paarm:chapter_5_5 [2026/06/21 21:18] (current) pczekalski
Line 4: Line 4:
  
 ====Register addressing==== ====Register addressing====
-The register is used to store the address of the data in the memory. Or the data will be stored in the memory at the address given in the register. +The register is used to store the address of the data in the memory. Or the data will be stored in memory at the address specified by the register. 
  
 ''<fc #800000>LDR</fc> <fc #008000>X0</fc>, [<fc #008000>X1</fc>] <fc #6495ed>@ fill the register X0 with the data located at address stored in X1 register</fc>'' ''<fc #800000>LDR</fc> <fc #008000>X0</fc>, [<fc #008000>X1</fc>] <fc #6495ed>@ fill the register X0 with the data located at address stored in X1 register</fc>''
Line 22: Line 22:
  
 ====Pre-indexed addressing with write back==== ====Pre-indexed addressing with write back====
-The ARM separates this addressing mode because the register that points to the address in memory can now be modified. The value will be added to the register before the access is performed.+The ARM distinguishes this addressing mode because the register that points to the memory address can now be modified. The value will be added to the register before the access is performed.
  
 ''<fc #800000>LDR</fc> <fc #008000>X0</fc>, [<fc #008000>X1</fc>, <fc #ffa500>#32</fc>]<fc #800080>**!**</fc> <fc #6495ed>@ read the data into <fc #008000>X0</fc> register from address pointed to by X1+32, then X1=X1 + 32</fc>'' ''<fc #800000>LDR</fc> <fc #008000>X0</fc>, [<fc #008000>X1</fc>, <fc #ffa500>#32</fc>]<fc #800080>**!**</fc> <fc #6495ed>@ read the data into <fc #008000>X0</fc> register from address pointed to by X1+32, then X1=X1 + 32</fc>''
Line 30: Line 30:
  
 ====Post-index with write back==== ====Post-index with write back====
-Like with the previous addressing mode, this one is also separated. As the addressing mode says, ‘post’ means that the value of the register will be increased after performing the memory access.+Like with the previous addressing mode, this one is also separated. As the addressing mode indicates, ‘post’ means the register value will be incremented after the memory access.
  
 ''<fc #800000>LDR</fc> <fc #008000>X0</fc>, [<fc #008000>X1</fc>],<fc #ffa500> #32</fc> <fc #6495ed>@ read X0 from address pointed to by X1, then X1=X1 + 32</fc>'' ''<fc #800000>LDR</fc> <fc #008000>X0</fc>, [<fc #008000>X1</fc>],<fc #ffa500> #32</fc> <fc #6495ed>@ read X0 from address pointed to by X1, then X1=X1 + 32</fc>''
  
 ====Other addressing modes==== ====Other addressing modes====
-There are some other addressing modes available. Some addressing modes are used only for function or procedure calls, while others combine previously described addressing modes. This subsection will introduce some of the other available addressing modes.+There are some other addressing modes available. Some addressing modes are used only for function or procedure calls, while others combine previously described addressing modes. This subsection introduces some other available addressing modes.
   * Register to register, also called register direct addressing mode. It is used to copy data from one register to another. No memory access is performed with such operations.   * Register to register, also called register direct addressing mode. It is used to copy data from one register to another. No memory access is performed with such operations.
   * Literal addressing, alternatively, the immediate addressing mode is used to identify the data directly in the instruction.    * Literal addressing, alternatively, the immediate addressing mode is used to identify the data directly in the instruction. 
   * PC-relative addressing   * PC-relative addressing
  
-Literal addressing mode allows the use of literal addresses in the program code. Something similar is done with function names, but in this situation, the data are addressed by literal names. PC-relative addressing +Literal addressing mode allows literal addresses in the program code. Something similar is done with function names, but in this situation, the data are addressed by literal names. PC-relative addressing 
 Some instructions allow loading (and storing) a pair of data (LDP and STP instructions).  Some instructions allow loading (and storing) a pair of data (LDP and STP instructions). 
  
Line 55: Line 55:
 </figure> </figure>
  
-The data are loaded from memory, and the sign bit is preserved only for a 32-bit wide value when the destination register is addressed as a 32-bit register. If the 64-bit register is used as the destination, the sign bit is preserved in the entire 64-bit register.+The data are loaded from memory, and the sign bit is preserved only for a 32-bit wide value when the destination register is addressed as a 32-bit register. If the 64-bit register is used as the destination, the sign bit is preserved throughout the register.
  
 <figure ldrsbw0> <figure ldrsbw0>
Line 81: Line 81:
 ** Unprivileged addressing mode** ** Unprivileged addressing mode**
  
-The unprivileged addressing mode simulates EL0 memory access even when the CPU is running at EL1 exception level. Such an addressing mode is used to copy the data between different exception levels.+The unprivileged addressing mode simulates EL0 memory access even when the CPU is running at EL1 exception level. This addressing mode is used to copy data between different exception levels.
  
 ''<fc #800000>LDTR  </fc> <fc #008000>W0</fc>, [<fc #008000>X1</fc>]'' ''<fc #800000>LDTR  </fc> <fc #008000>W0</fc>, [<fc #008000>X1</fc>]''
Line 87: Line 87:
 ''<fc #800000>STTR   </fc> <fc #008000>W2</fc>, [<fc #008000>X1</fc>]'' ''<fc #800000>STTR   </fc> <fc #008000>W2</fc>, [<fc #008000>X1</fc>]''
  
-These two instruction examples load/store a 32-bit word from/to memory at address X1, but the data access is performed using EL0 permissions even if the CPU is currently running in EL1. If <fc #008000>X1</fc> register points to invalid user memory, the load instruction will fail with a fault.+These two instruction examples load/store a 32-bit word to/from memory at address X1, but the data access is performed with EL0 permissions even if the CPU is currently running in EL1. If <fc #008000>X1</fc> register points to invalid user memory, the load instruction will fail with a fault.
  
 ** Atomic/exclusive addressing** ** Atomic/exclusive addressing**
Line 136: Line 136:
 </codeblock> </codeblock>
  
-Atomic addressing mode does not have immediate offset, register offset, or pre-indexing/post-indexing options. Basically, the atomic addressing uses simple memory addressing.+The atomic addressing mode does not support immediate offset, register offset, or pre- or post-indexing options. Basically, the atomic addressing uses simple memory addressing.
en/multiasm/paarm/chapter_5_5.txt · Last modified: by pczekalski
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