ARM ARM7TDMI Bedienungsanleitung Seite 22

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 43
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 21
Page 18
Usage and Examples:
The LDM instruction permits block moves of memory to the registers and enables
efficient stack operations. The registers may be listed in any order, but the registers are
always loaded in order with the lowest numbered register getting the value form the
lowest memory address. If Rn is also listed in the register list and register writeback (W
bit) is set, the final value in Rn is unpredictable.
The addressing_mode field determines how
next_address
is calculated (bits P & W),
which control how the address is updated in conjunction with each register load. The
four addressing_mode values are;
IA - increment address by 4 after each load (post-increment)
IB - increment address by 4 before each load (pre-increment)
DA - decrement address by 4 after each load (post-decrement)
DB - decrement address by 4 before each load (pre-decrement)
The “!” following Rn controls the value of the writeback bit (bit W), and signifies that Rn
should be updated with the ending address at the end of the instruction. If the “!” is
not present (W=0), the value of Rn will be unchanged at the end of the instruction.
LDMIA R7, {R0, R2-R4} ;R0 memory[R7]
;R2 memory[R7+4]
;R3 memory[R7+8]
;R4 memory[R7+12]
;R7 is unchanged
LDMDB R7!, {R0, R2-R4} ;R0 memory[R7-16]
;R2 memory[R7-12]
;R3 memory[R7-8]
;R4 memory[R7-4]
;R7 R7 - 16
For use in conjunction with stack addressing, four alternative names can be used for
the addressing modes. These names are based on the type of stack being used instead
of the addressing mode being used. This eliminates confusion in coding stack push and
pop operations, since the type of stack will be the same for both the LDM and STM
instructions. In ARM syntax, a full stack is one where the stack pointer points to the last
used (full) location. An empty stack is one where the stack pointer points to the next
available (empty) stack location. As well, a stack can grow through increasing memory
addresses (ascending), or downward through decreasing memory addresses
(descending). The table below summarizes the stack addressing modes.
FA (full ascending) - post-decrement (DA) on pop
FD (full descending) - post-increment (IA) on pop
EA (empty ascending) - pre-decrement (DB) on pop
ED (empty descending) - pre-increment on (IB) pop
Seitenansicht 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 42 43

Kommentare zu diesen Handbüchern

Keine Kommentare