ARM A64 STR指令

发布于:2025-05-18 ⋅ 阅读:(19) ⋅ 点赞:(0)

Arm Architecture Reference Manual Armv8, for Armv8-A architecture profile

1 STR (immediate)

Store Register (immediate) stores a word or a doubleword from a register to memory. The address that is used for the store is calculated from a base register and an immediate offset.

1.1 Post-index

在这里插入图片描述

1.1.1 32-bit variant

Applies when size == 10.
在这里插入图片描述

STR <Wt>, [<Xn|SP>], #<simm>

1.1.2 64-bit variant

Applies when size == 11.
在这里插入图片描述

STR <Xt>, [<Xn|SP>], #<simm>

1.2 Pre-index

在这里插入图片描述

1.2.1 32-bit variant

Applies when size == 10.
在这里插入图片描述

STR <Wt>, [<Xn|SP>], #<simm>

1.2.2 64-bit variant

Applies when size == 11.
在这里插入图片描述

STR <Xt>, [<Xn|SP>], #<simm>

1.3 Unsigned offset

在这里插入图片描述

1.3.1 32-bit variant

Applies when size == 10.
在这里插入图片描述

STR <Wt>, [<Xn|SP>{, #<pimm>}]

1.3.2 64-bit variant

Applies when size == 11.
在这里插入图片描述

STR <Xt>, [<Xn|SP>{, #<pimm>}]

1.4 Assembler symbols

<Wt>
Is the 32-bit name of the general-purpose register to be transferred, encoded in the “Rt” field.
<Xt>
Is the 64-bit name of the general-purpose register to be transferred, encoded in the “Rt” field.
<Xn|SP>
Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the “Rn” field.
<simm>
Is the signed immediate byte offset, in the range -256 to 255, encoded in the “imm9” field.
<pimm>
For the 32-bit variant: is the optional positive immediate byte offset, a multiple of 4 in the range 0 to 16380, defaulting to 0 and encoded in the “imm12” field as <pimm>/4.
For the 64-bit variant: is the optional positive immediate byte offset, a multiple of 8 in the range 0 to 32760, defaulting to 0 and encoded in the “imm12” field as <pimm>/8.

2 STR (register)

Store Register (register) calculates an address from a base register value and an offset register value, and stores a 32-bit word or a 64-bit doubleword to the calculated address, from a register.
The instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an offset register value. The offset can be optionally shifted and extended.
在这里插入图片描述

2.1 32-bit variant

Applies when size == 10.

STR <Wt>, [<Xn|SP>, (<Wm>|<Xm>){, <extend> {<amount>}}]

2.2 64-bit variant

Applies when size == 11.

STR <Xt>, [<Xn|SP>, (<Wm>|<Xm>){, <extend> {<amount>}}]

2.3 Assembler symbols

<Wt> Is the 32-bit name of the general-purpose register to be transferred, encoded in the “Rt” field.
<Xt> Is the 64-bit name of the general-purpose register to be transferred, encoded in the “Rt” field.
<Xn|SP> Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the “Rn” field.
<Wm> When option<0> is set to 0, is the 32-bit name of the general-purpose index register, encoded in the “Rm” field.
<Xm> When option<0> is set to 1, is the 64-bit name of the general-purpose index register, encoded in the “Rm” field.
<extend> Is the index extend/shift specifier, defaulting to LSL, and which must be omitted for the LSL option when <amount> is omitted. encoded in the “option” field. It can have the following values:
UXTW when option = 010
LSL when option = 011
SXTW when option = 110
SXTX when option = 111
<amount> For the 32-bit variant: is the index shift amount, optional only when <extend> is not LSL. Where it is permitted to be optional, it defaults to #0. It is encoded in the “S” field. It can have the following values:
#0 when S = 0
#2 when S = 1
For the 64-bit variant: is the index shift amount, optional only when <extend> is not LSL. Where it is permitted to be optional, it defaults to #0. It is encoded in the “S” field. It can have the following
values:
#0 when S = 0
#3 when S = 1

3 STRB (immediate)

Store Register Byte (immediate) stores the least significant byte of a 32-bit register to memory. The address that is used for the store is calculated from a base register and an immediate offset.

3.1 Post-index

在这里插入图片描述

STRB <Wt>, [<Xn|SP>], #<simm>

3.2 Pre-index

在这里插入图片描述

STRB <Wt>, [<Xn|SP>, #<simm>]!

3.3 Unsigned offset

在这里插入图片描述

STRB <Wt>, [<Xn|SP>{, #<pimm>}]

4 STRB (register)

Store Register Byte (register) calculates an address from a base register value and an offset register value, and stores a byte from a 32-bit register to the calculated address.
The instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an offset register value. The offset can be optionally shifted and extended.
在这里插入图片描述

4.1 Extended register variant

Applies when option != 011.

STRB <Wt>, [<Xn|SP>, (<Wm>|<Xm>), <extend> {<amount>}]

4.2 Shifted register variant

Applies when option == 011.

STRB <Wt>, [<Xn|SP>, <Xm>{, LSL <amount>}]

5 STRH (immediate)

Store Register Halfword (immediate) stores the least significant halfword of a 32-bit register to memory. The address that is used for the store is calculated from a base register and an immediate offset.

5.1 Post-index

在这里插入图片描述

STRH <Wt>, [<Xn|SP>], #<simm>

5.2 Pre-index

在这里插入图片描述

STRH <Wt>, [<Xn|SP>, #<simm>]!

5.3 Unsigned offset

在这里插入图片描述

STRH <Wt>, [<Xn|SP>{, #<pimm>}]

6 STRH (register)

Store Register Halfword (register) calculates an address from a base register value and an offset register value, and stores a halfword from a 32-bit register to the calculated address.
The instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an offset register value. The offset can be optionally shifted and extended.
在这里插入图片描述

6.1 Encoding

STRH <Wt>, [<Xn|SP>, (<Wm>|<Xm>){, <extend> {<amount>}}]

6.2 Assembler symbols

<Wt> Is the 32-bit name of the general-purpose register to be transferred, encoded in the “Rt” field.
<Xn|SP> Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the “Rn” field.
<Wm> When option<0> is set to 0, is the 32-bit name of the general-purpose index register, encoded in the “Rm” field.
<Xm> When option<0> is set to 1, is the 64-bit name of the general-purpose index register, encoded in the “Rm” field.
<extend> Is the index extend/shift specifier, defaulting to LSL, and which must be omitted for the LSL option when <amount> is omitted. encoded in the “option” field. It can have the following values:
UXTW when option = 010
LSL when option = 011
SXTW when option = 110
SXTX when option = 111
<amount> Is the index shift amount, optional only when <extend> is not LSL. Where it is permitted to be optional, it defaults to #0. It is encoded in the “S” field. It can have the following values:
#0 when S = 0
#1 when S = 1


网站公告

今日签到

点亮在社区的每一天
去签到