英特爾 XScale(R) 技術主題STM(1) - 多重儲存

語法

STM[condition] addr_mode basereg[!], reg [,{ reg }],...

其中:

 condition

16 個條件之一。
請參閱條件程式碼狀態

 addr_mode

定址模式 4:多重載入與儲存

 basereg

addr_mode 使用的基址暫存器

 !

設定 W 位 [21]

 reg

要載入的有效暫存器

說明

此格式的 STM 指令儲存數據塊並支援堆疊操作。reg 指定的暫存器按照升序從自低到高的記憶體地址進行載入。condition 必須是有效值;否則將指令當作 NOP。

備註

如果試圖進行無效的載入或儲存數據訪問,則產生數據終止異常。如果實現系統控制協處理器時啟用對齊檢查,並且存在位 [01:0] != 0b00 的地址,則產生對齊異常。

定址模式

請參閱“定址模式 4 - 多重載入與儲存”。

影響的標誌

N

Z

C

V

Q

S

I

F

T

T

T

T

T

 

 

 

 

 

編碼

31

 

28

27

26

25

24

23

22

21

20

19

 

16

15

 

0

condition

1

0

0

P

U

0

W

0

basereg

reglist

示例

1                          ;@.text
2                          ;@.globl funstm
3                          ;@.align 0
4                          ;@ **** STM (Addressing Mode 4) ****
5                          ;
6                          ; Store multiple registers to memory
7                          ; from base address held in R9,
8                          ; increment base address after each use
9                          ; update R9 finally at end
10                         ;
11                   AREA example,CODE,READONLY
12
13                   label1
14
15   00000000   E1A09008   MOV     R9, R8
16   00000004   E8A901F7   STMIA   R9!, {R1,R0,R2,R4-R7,R8}
17
18
19                         ; -----------------------------------
20                         ; Example 2 shows pushing registers
21                         ; R0 thru R7 onto stack, together with
22                         ; the Link Register, at entry to a
23                         ; subroutine.
24                         ;
25                         ; Then at end of subroutine POP these
26                         ; same resisters off stack, and place
27                         ; the value of Link Reg onto PC causing
28                         ; a return to calling program
29
30
31                   AREA example,CODE,READONLY
32
33                   label1a
34   00000008   E8AD40FF   STMFD   R13!, {R0-R7,LR}
35   00000012   E8BD80FF   LDMFD   R13!, {R0-R7,PC}

更多資訊

請參閱定址模式 4:多重載入與儲存