Autoincrement and Decrement Addressing Modes (with Proper Examples)

Autoincrement and Decrement Addressing Modes (with Proper Examples)

Verified Sources
Nov 3, 2026

Autoincrement and autodecrement are memory-indirect addressing patterns where a pointer register is automatically updated as part of the load/store. In common assembler syntax, this is often written with symbols like:

  • Autoincrement: use [R][R], then increment RR for the next access
  • Autodecrement: decrement RR, then use the new [R][R]
  • Pointer register
  • Effective address

The key idea: the pointer update is implicit in the addressing mode, so a loop can traverse arrays without separate add/sub instructions. The exact “increment/decrement amount” depends on the architecture and operand size (e.g., increment by 1 for bytes, by 2 for halfwords, etc.).

Note: Different ISAs use different mnemonics/syntax (e.g., 68k style vs. ARM vs. custom educational assemblers). The semantics below match the canonical “update-before” / “update-after” behavior used in systems teaching these addressing modes.

4

Footnotes

  1. Autoincrement addressing mode (concept) — overview - Describes update-after (autoincrement-like) addressing mode behavior. ↩

  2. Autodecrement addressing mode (concept) — overview - Describes update-before (autodecrement-like) addressing mode behavior and variants. ↩

  3. ARM load/store addressing with pre/post indexing and writeback - ARM documentation site describing pre/post-indexing and writeback semantics for effective addresses. ↩

  4. Stack and addressing mode relationship (general addressing modes) - Background on stack conventions often implemented using pointer increment/decrement patterns. ↩

Addressing modes: autoincrement/autodecrement intuition

Autoincrement addressing (update-after)

Autoincrement uses the current pointer value to form the effective address, performs the memory read/write, and then increments the pointer register for the next access.

Typical pseudo-syntax (architecture-dependent):

  • LD Rdest, (Rptr)+ or LDR Rdest, [Rptr], #+k

Where:

  • Effective address EA=RptrEA = Rptr
  • After the access: Rptr←Rptr+kRptr \leftarrow Rptr + k

Here kk is usually the operand size (bytes for byte loads/stores, etc.). This “post-update” behavior is the defining feature of autoincrement. 2

Worked example (conceptual)

Assume:

  • Rptr=0x1000Rptr = 0x1000
  • Operand size = 4 bytes (so k=4k=4)
  • Memory:
    • Mem[0x1000] = 0xAAAA5555
    • Mem[0x1004] = 0xBBBB6666

Instruction:

  • LOAD R1, (Rptr)+

Semantics:

  1. Compute EA=0x1000EA = 0x1000
  2. Load R1 ← Mem[0x1000] = 0xAAAA5555
  3. Update pointer: Rptr←0x1000+4=0x1004Rptr \leftarrow 0x1000 + 4 = 0x1004

So after the instruction:

  • R1 = 0xAAAA5555
  • Rptr = 0x1004

This “use then increment” pattern is widely used to walk through arrays sequentially. 2

Footnotes

  1. Autoincrement addressing mode (concept) — overview - Describes update-after (autoincrement-like) addressing mode behavior. ↩ ↩2

  2. Autodecrement addressing mode (concept) — overview - Describes update-before (autodecrement-like) addressing mode behavior and variants. ↩ ↩2

Autodecrement addressing (update-before)

Autodecrement decrements the pointer register and then uses the new value as the effective address.

Typical pseudo-syntax:

  • LD Rdest, -(Rptr) or LDR Rdest, [Rptr, #-k]!

Where:

  • Update-first: Rptr←Rptr−kRptr \leftarrow Rptr - k
  • Then effective address EA=RptrEA = Rptr
  • Then memory access uses EAEA

This “pre-update” behavior is the defining feature of autodecrement. 2

Worked example (conceptual)

Assume:

  • Rptr=0x2008Rptr = 0x2008
  • Operand size = 4 bytes (k=4k=4)
  • Memory:
    • Mem[0x2004] = 0x11112222
    • Mem[0x2008] = 0x33334444

Instruction:

  • LOAD R1, -(Rptr)

Semantics:

  1. Decrement pointer first: Rptr←0x2008−4=0x2004Rptr \leftarrow 0x2008 - 4 = 0x2004
  2. EA=0x2004EA = 0x2004
  3. Load R1 ← Mem[0x2004] = 0x11112222

After:

  • R1 = 0x11112222
  • Rptr = 0x2004

Autodecrement is useful for reverse traversal and for stack-like behavior (though real “stack” conventions are architecture-specific). 2

Footnotes

  1. Autodecrement addressing mode (concept) — overview - Describes update-before (autodecrement-like) addressing mode behavior and variants. ↩ ↩2

  2. ARM load/store addressing with pre/post indexing and writeback - ARM documentation site describing pre/post-indexing and writeback semantics for effective addresses. ↩ ↩2

type="tip" title="Pro Tip" content="To avoid confusion, always decide whether the update is post (autoincrement: use EA first) or pre (autodecrement: update pointer first), then check whether kk equals operand size in bytes."

type="warning" title="Warning: Syntax varies across ISAs" content="Different architectures write these modes differently (e.g., post-index vs pre-index writeback). Always map the syntax to the underlying semantics: EAEA formation and whether pointer update is before/after."

How to reason about autoincrement/decrement in any assembly syntax

  1. 1
    Step 1

    Look for patterns like (Rptr)+, -(Rptr), [Rptr], #+k, [Rptr,#-k]!, etc. These indicate post-update or pre-update.

  2. 2
    Step 2

    Find whether the instruction operates on byte/halfword/word/dword to compute the increment/decrement amount kk.

  3. 3
    Step 3

    If autoincrement: EA=RptrEA=Rptr then Rptr←Rptr+kRptr\leftarrow Rptr+k. If autodecrement: Rptr←Rptr−kRptr\leftarrow Rptr-k then EA=RptrEA=Rptr.

  4. 4
    Step 4

    Perform the load/store at address EAEA.

  5. 5
    Step 5

    After the memory operation, ensure RptrRptr reflects the implicit update for the next iteration.

  6. 6
    Step 6

    Simulate two iterations to confirm the pointer moves in the expected direction and by the expected stride kk.

Semantic summary: EA computation and pointer update order

Compare autoincrement (post-update) vs autodecrement (pre-update)

Concrete examples in pseudocode + typical assembly forms

Because exact syntax differs, it’s helpful to express the semantics in a uniform pseudocode form.

Autoincrement pseudocode

  • Input: RptrRptr
  • Compute: EA←RptrEA \leftarrow Rptr
  • Access: Rdest←Mem[EA]Rdest \leftarrow Mem[EA]
  • Update: Rptr←Rptr+kRptr \leftarrow Rptr + k

Autodecrement pseudocode

  • Input: RptrRptr
  • Update: Rptr←Rptr−kRptr \leftarrow Rptr - k
  • Compute: EA←RptrEA \leftarrow Rptr
  • Access: Rdest←Mem[EA]Rdest \leftarrow Mem[EA]

These update-before vs update-after semantics are the core of the addressing modes across teaching materials. 3

Footnotes

  1. Autoincrement addressing mode (concept) — overview - Describes update-after (autoincrement-like) addressing mode behavior. ↩

  2. Autodecrement addressing mode (concept) — overview - Describes update-before (autodecrement-like) addressing mode behavior and variants. ↩

  3. ARM load/store addressing with pre/post indexing and writeback - ARM documentation site describing pre/post-indexing and writeback semantics for effective addresses. ↩

Common questions and edge cases

Knowledge Check

Question 1 of 4
Q1Single choice

In autoincrement addressing, when is the pointer register updated relative to the memory access?